tguikit 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.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["__defProp","__name","__defProp","__name","setRef","__defProp","__name","getElementRef","__defProp","__name","__defProp","__name"],"sources":["../src/shared/lib/cn.ts","../src/components/TguiProvider/context.ts","../src/shared/lib/telegram.ts","../src/shared/lib/appearance.ts","../src/shared/lib/platform.ts","../src/components/TguiProvider/TguiProvider.module.css","../src/components/TguiProvider/TguiProvider.tsx","../src/shared/lib/haptics.ts","../src/components/TguiProvider/useHaptic.ts","../src/components/TguiProvider/useTgui.ts","../src/components/Accordion/Accordion.module.css","../src/components/Accordion/context.ts","../src/components/Accordion/Accordion.tsx","../src/components/Accordion/AccordionItem.tsx","../src/components/Avatar/Avatar.module.css","../src/components/Avatar/Avatar.variants.ts","../src/components/Avatar/Avatar.tsx","../src/components/AvatarStack/AvatarStack.module.css","../src/components/AvatarStack/AvatarStack.tsx","../src/components/Badge/Badge.module.css","../src/components/Badge/Badge.variants.ts","../src/components/Badge/Badge.tsx","../src/components/Banner/Banner.module.css","../src/components/Banner/Banner.variants.ts","../src/components/Banner/Banner.tsx","../src/components/Blockquote/Blockquote.module.css","../src/components/Blockquote/Blockquote.tsx","../src/components/Breadcrumbs/Breadcrumbs.module.css","../src/components/Breadcrumbs/Breadcrumbs.tsx","../src/components/Spinner/Spinner.module.css","../src/components/Spinner/Spinner.variants.ts","../src/components/Spinner/Spinner.tsx","../src/components/Typography/Typography.module.css","../src/components/Typography/Typography.variants.ts","../src/components/Typography/Typography.tsx","../src/components/Subheadline/Subheadline.module.css","../src/components/Subheadline/Subheadline.variants.ts","../src/components/Subheadline/Subheadline.tsx","../src/components/Tappable/Ripple.module.css","../src/components/Tappable/Ripple.tsx","../src/components/Tappable/Tappable.module.css","../src/components/Tappable/useRipple.ts","../src/components/Tappable/Tappable.tsx","../src/components/Text/Text.module.css","../src/components/Text/Text.tsx","../src/components/Button/Button.module.css","../src/components/Button/Button.variants.ts","../src/components/Button/Button.tsx","../src/components/Callout/Callout.module.css","../src/components/Callout/Callout.tsx","../src/components/Caption/Caption.module.css","../src/components/Caption/Caption.variants.ts","../src/components/Caption/Caption.tsx","../src/components/Card/Card.context.ts","../src/components/Card/Card.module.css","../src/components/Cell/Cell.module.css","../src/components/Cell/Cell.variants.ts","../src/components/Cell/Cell.tsx","../src/components/Card/CardCell.tsx","../src/components/Card/Card.tsx","../src/components/Checkbox/Checkbox.module.css","../src/components/Checkbox/Checkbox.tsx","../src/components/Chip/Chip.module.css","../src/components/Chip/Chip.variants.ts","../src/components/Chip/Chip.tsx","../src/components/CircularProgress/CircularProgress.module.css","../src/components/CircularProgress/CircularProgress.variants.ts","../src/components/CircularProgress/CircularProgress.tsx","../node_modules/@radix-ui/primitive/dist/index.mjs","../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../node_modules/@radix-ui/react-slot/dist/index.mjs","../node_modules/@radix-ui/react-primitive/dist/index.mjs","../node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs","../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs","../node_modules/@radix-ui/react-focus-scope/dist/index.mjs","../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs","../node_modules/@radix-ui/react-presence/dist/index.mjs","../src/components/Portal/Portal.tsx","../src/components/Dialog/Dialog.module.css","../src/components/Dialog/Dialog.tsx","../src/components/Divider/Divider.module.css","../src/components/Divider/Divider.tsx","../src/components/DropdownMenu/context.ts","../src/components/DropdownMenu/CheckIcon.tsx","../src/components/DropdownMenu/DropdownMenu.module.css","../src/components/DropdownMenu/DropdownMenuCheckboxItem.tsx","../src/shared/lib/floatingPosition.ts","../src/components/DropdownMenu/DropdownMenuContent.tsx","../src/components/DropdownMenu/DropdownMenuItem.tsx","../src/components/DropdownMenu/DropdownMenuLabel.tsx","../src/components/DropdownMenu/DropdownMenuRadioGroup.tsx","../src/components/DropdownMenu/DropdownMenuRadioItem.tsx","../src/components/DropdownMenu/DropdownMenuSeparator.tsx","../src/components/DropdownMenu/DropdownMenuTrigger.tsx","../src/components/DropdownMenu/DropdownMenu.tsx","../src/components/FixedLayout/FixedLayout.module.css","../src/components/FixedLayout/FixedLayout.tsx","../src/components/Footnote/Footnote.module.css","../src/components/Footnote/Footnote.tsx","../src/components/Headline/Headline.module.css","../src/components/Headline/Headline.tsx","../src/components/HorizontalScroll/HorizontalScroll.module.css","../src/components/HorizontalScroll/HorizontalScroll.tsx","../src/components/IconButton/IconButton.module.css","../src/components/IconButton/IconButton.variants.ts","../src/components/IconButton/IconButton.tsx","../src/components/Image/Image.module.css","../src/components/Image/Image.tsx","../src/components/InlineButtons/context.ts","../src/components/InlineButtons/InlineButtons.module.css","../src/components/InlineButtons/InlineButtons.variants.ts","../src/components/InlineButtons/InlineButtonsItem.tsx","../src/components/InlineButtons/InlineButtons.tsx","../src/components/FormField/FormField.module.css","../src/components/FormField/FormField.tsx","../src/components/Input/Input.module.css","../src/components/Input/Input.tsx","../src/components/LargeTitle/LargeTitle.module.css","../src/components/LargeTitle/LargeTitle.tsx","../src/components/Link/Link.module.css","../src/components/Link/Link.tsx","../src/components/List/List.module.css","../src/components/List/List.tsx","../src/components/Pagination/Pagination.module.css","../src/components/Pagination/paginationRange.ts","../src/components/Pagination/CompactPagination.tsx","../src/components/Pagination/Pagination.tsx","../src/components/PinInput/PinInput.module.css","../src/components/PinInput/PinInput.tsx","../src/components/Title/Title.module.css","../src/components/Title/Title.variants.ts","../src/components/Title/Title.tsx","../src/components/Placeholder/Placeholder.module.css","../src/components/Placeholder/Placeholder.tsx","../src/components/Popover/context.ts","../src/components/Popover/Popover.module.css","../src/components/Popover/PopoverContent.tsx","../src/components/Popover/PopoverTrigger.tsx","../src/components/Popover/Popover.tsx","../src/components/Progress/Progress.module.css","../src/components/Progress/Progress.tsx","../src/components/Radio/Radio.module.css","../src/components/Radio/Radio.tsx","../src/components/Rating/Rating.module.css","../src/components/Rating/Rating.tsx","../src/components/SearchBar/SearchBar.module.css","../src/components/SearchBar/SearchBar.tsx","../src/components/Section/Section.module.css","../src/components/Section/SectionFooter.tsx","../src/components/Section/SectionHeader.tsx","../src/components/Section/Section.tsx","../src/components/SegmentedControl/context.ts","../src/components/SegmentedControl/SegmentedControl.module.css","../src/components/SegmentedControl/SegmentedControl.tsx","../src/components/SegmentedControl/SegmentedControlItem.tsx","../src/components/Select/Select.module.css","../src/components/Select/Select.tsx","../src/shared/lib/useReducedMotion.ts","../src/components/Sheet/Sheet.module.css","../src/components/Sheet/Sheet.tsx","../src/components/Skeleton/Skeleton.module.css","../src/components/Skeleton/Skeleton.tsx","../src/components/Slider/Slider.module.css","../src/components/Slider/Slider.tsx","../src/components/Snackbar/context.ts","../src/components/Snackbar/Snackbar.module.css","../src/components/Snackbar/SnackbarProvider.tsx","../src/components/Snackbar/useSnackbar.ts","../src/components/Spoiler/particles.ts","../src/components/Spoiler/Spoiler.module.css","../src/components/Spoiler/Spoiler.tsx","../src/components/Stepper/Stepper.module.css","../src/components/Stepper/Stepper.tsx","../src/components/Steps/Steps.module.css","../src/components/Steps/Steps.tsx","../src/components/Switch/Switch.module.css","../src/components/Switch/Switch.tsx","../src/components/TabBar/TabBar.module.css","../src/components/TabBar/TabBarItem.tsx","../src/components/TabBar/TabBar.tsx","../src/components/Textarea/Textarea.module.css","../src/components/Textarea/Textarea.tsx","../src/components/Timeline/Timeline.module.css","../src/components/Timeline/Timeline.tsx","../src/components/Timeline/TimelineItem.tsx","../src/components/Tooltip/Tooltip.module.css","../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import { type ClassValue, clsx } from 'clsx';\n\nexport function cn(...inputs: ClassValue[]) {\n return clsx(inputs);\n}\n","import { createContext } from 'react';\nimport type { TguiContextValue } from '../../shared/types/tgui';\n\nexport const TguiContext = createContext<TguiContextValue | null>(null);\n\nTguiContext.displayName = 'TguiContext';\n","import type { WebApp } from '../types/telegram';\n\nexport function getTelegramWebApp(): WebApp | undefined {\n if (typeof window === 'undefined') return undefined;\n return window.Telegram?.WebApp;\n}\n\n// true only inside a Telegram client whose Bot API is at least `version`\nexport function isTelegramVersionAtLeast(version: string): boolean {\n const webApp = getTelegramWebApp();\n if (webApp == null) return false;\n try {\n return webApp.isVersionAtLeast(version);\n } catch {\n return false;\n }\n}\n","import type { Appearance } from '../types/tgui';\nimport { getTelegramWebApp } from './telegram';\n\nconst DARK_QUERY = '(prefers-color-scheme: dark)';\n\nfunction canMatchMedia() {\n return typeof window !== 'undefined' && typeof window.matchMedia === 'function';\n}\n\nexport function getAppearance(): Appearance {\n const webApp = getTelegramWebApp();\n if (webApp) {\n return webApp.colorScheme === 'dark' ? 'dark' : 'light';\n }\n\n if (canMatchMedia()) {\n return window.matchMedia(DARK_QUERY).matches ? 'dark' : 'light';\n }\n\n return 'light';\n}\n\nexport function subscribeAppearance(onChange: () => void): () => void {\n const webApp = getTelegramWebApp();\n if (webApp != null && typeof webApp.onEvent === 'function') {\n webApp.onEvent('themeChanged', onChange);\n return () => webApp.offEvent?.('themeChanged', onChange);\n }\n\n if (!canMatchMedia()) {\n return () => {};\n }\n\n const media = window.matchMedia(DARK_QUERY);\n media.addEventListener('change', onChange);\n return () => media.removeEventListener('change', onChange);\n}\n","import type { TguiPlatform } from '../types/tgui';\nimport { getTelegramWebApp } from './telegram';\n\nconst TELEGRAM_IOS_LIKE = new Set(['ios', 'macos']);\n\nexport function getPlatform(): TguiPlatform {\n const webApp = getTelegramWebApp();\n if (webApp) {\n return TELEGRAM_IOS_LIKE.has(webApp.platform) ? 'ios' : 'base';\n }\n\n if (typeof navigator === 'undefined') {\n return 'base';\n }\n\n const ua = navigator.userAgent;\n const isIpadOs = ua.includes('Macintosh') && navigator.maxTouchPoints > 1;\n\n return /iphone|ipad|ipod/i.test(ua) || isIpadOs ? 'ios' : 'base';\n}\n","/* design tokens: palette (raw) → semantic (the component API, light/dark) → component */\n\n.wrapper {\n /* ─── palette ─────────────────────────────────────────────── */\n --tgui--white: #ffffff;\n --tgui--black: #000000;\n --tgui--palette-blue: #007aff;\n --tgui--palette-red: #ff3b30;\n --tgui--palette-green: #34c759;\n --tgui--palette-orange: #ff9500;\n --tgui--palette-yellow: #ffcc00;\n --tgui--palette-purple: #af52de;\n\n /* ─── semantic · surfaces ─────────────────────────────────── */\n --tgui--bg: var(--tg-theme-bg-color, #ffffff);\n --tgui--bg-secondary: var(--tg-theme-secondary-bg-color, #f2f2f7);\n --tgui--bg-elevated: var(--tg-theme-section-bg-color, #ffffff);\n --tgui--fill: rgba(120, 120, 128, 0.12);\n --tgui--fill-secondary: rgba(120, 120, 128, 0.08);\n --tgui--fill-tertiary: rgba(118, 118, 128, 0.05);\n\n /* ─── semantic · content (greyscale hierarchy) ────────────── */\n --tgui--label: var(--tg-theme-text-color, #000000);\n /* secondaryLabel darkened from the iOS #8e8e93 to clear WCAG AA on white + tint */\n --tgui--label-secondary: var(--tg-theme-hint-color, #68686d);\n --tgui--label-tertiary: rgba(60, 60, 67, 0.3);\n --tgui--label-quaternary: rgba(60, 60, 67, 0.18);\n --tgui--placeholder: rgba(60, 60, 67, 0.3);\n\n /* ─── semantic · lines ───────────────────────────────────── */\n --tgui--separator: rgba(60, 60, 67, 0.13);\n --tgui--separator-opaque: #c6c6c8;\n\n /* ─── semantic · accent & status ─────────────────────────── */\n --tgui--accent: var(--tg-theme-button-color, #007aff);\n --tgui--accent-label: var(--tg-theme-button-text-color, #ffffff);\n /* *-strong: accent/link/destructive made WCAG-AA-safe (raw hues run ≈3.6:1) */\n --tgui--accent-strong: var(--tgui--accent);\n --tgui--accent-fill: rgba(0, 122, 255, 0.12);\n --tgui--link: var(--tg-theme-link-color, #007aff);\n --tgui--link-strong: var(--tgui--link);\n --tgui--destructive: var(--tg-theme-destructive-text-color, #ff3b30);\n --tgui--destructive-label: #ffffff;\n --tgui--destructive-strong: var(--tgui--destructive);\n --tgui--success: #34c759;\n --tgui--warning: #ff9500;\n\n /* ─── semantic · focus ───────────────────────────────────── */\n /* one ring for every interactive component – outline, so overflow never clips it\n and it survives forced-colors. resolves per theme via --tgui--accent.\n -shadow is the same ring as a box-shadow, for small proxies (checkbox / knob). */\n --tgui--focus-ring: 2px solid var(--tgui--accent);\n --tgui--focus-ring-offset: 2px;\n --tgui--focus-ring-shadow: 0 0 0 2px var(--tgui--accent);\n\n /* ─── semantic · surface ─────────────────────────────────── */\n /* one background for every raised surface in the kit – cards, sections, tab bar,\n and every floating overlay (popover, menu, dialog, sheet, tooltip, snackbar).\n resolves per theme through --tgui--bg-elevated, so no dark override of its own. */\n --tgui--surface-bg: var(--tgui--bg-elevated);\n /* the floating elevation – hairline ring + ambient shadow – only overlays wear it */\n --tgui--overlay-shadow: 0 0 0 0.5px var(--tgui--separator), var(--tgui--shadow-lg);\n\n /* ─── spacing (name = px) ────────────────────────────────── */\n --tgui--space-2: 2px;\n --tgui--space-4: 4px;\n --tgui--space-8: 8px;\n --tgui--space-12: 12px;\n --tgui--space-16: 16px;\n --tgui--space-20: 20px;\n --tgui--space-24: 24px;\n --tgui--space-32: 32px;\n --tgui--space-40: 40px;\n --tgui--space-48: 48px;\n --tgui--space-64: 64px;\n --tgui--page-margin: 16px;\n --tgui--tap-target: 44px;\n --tgui--hairline: 1px;\n\n /* device safe area, chaining in Telegram's own value where it provides one */\n --tgui--safe-area-top: var(--tg-safe-area-inset-top, 0px);\n --tgui--safe-area-right: var(--tg-safe-area-inset-right, 0px);\n --tgui--safe-area-bottom: var(--tg-safe-area-inset-bottom, 0px);\n --tgui--safe-area-left: var(--tg-safe-area-inset-left, 0px);\n /* margin taken by Telegram's own UI inside the webview */\n --tgui--content-safe-area-top: var(--tg-content-safe-area-inset-top, 0px);\n --tgui--content-safe-area-bottom: var(--tg-content-safe-area-inset-bottom, 0px);\n\n /* ─── radius (one knob + derived) ───────────────────────── */\n --tgui--radius: 12px;\n --tgui--radius-sm: 8px;\n --tgui--radius-lg: 16px;\n --tgui--radius-full: 999px;\n\n /* ─── elevation (soft, low-opacity, large-radius) ───────── */\n --tgui--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);\n --tgui--shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);\n --tgui--shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.18);\n\n /* ─── materials (blur + bg; components apply both; fallback below) ─ */\n --tgui--material-blur-ultra-thin: blur(20px) saturate(1.8);\n --tgui--material-blur-thin: blur(30px) saturate(1.8);\n --tgui--material-blur-regular: blur(40px) saturate(1.8);\n --tgui--material-blur-thick: blur(50px) saturate(1.8);\n --tgui--material-bg-ultra-thin: rgba(255, 255, 255, 0.55);\n --tgui--material-bg-thin: rgba(255, 255, 255, 0.7);\n --tgui--material-bg-regular: rgba(255, 255, 255, 0.82);\n --tgui--material-bg-thick: rgba(255, 255, 255, 0.93);\n\n /* ─── motion ─────────────────────────────────────────────── */\n --tgui--duration-instant: 100ms;\n --tgui--duration-overlay: 150ms;\n --tgui--duration-fast: 200ms;\n --tgui--duration-base: 300ms;\n --tgui--duration-slow: 340ms;\n --tgui--ease-standard: cubic-bezier(0.4, 0, 0.2, 1);\n --tgui--ease-out: cubic-bezier(0, 0, 0.2, 1);\n --tgui--ease-in: cubic-bezier(0.4, 0, 1, 1);\n --tgui--ease-spring: cubic-bezier(0.32, 0.72, 0, 1);\n\n /* ─── z-index ────────────────────────────────────────────── */\n --tgui--z-base: 1;\n --tgui--z-raised: 10;\n --tgui--z-sticky: 100;\n --tgui--z-overlay: 1000;\n --tgui--z-toast: 1100;\n\n /* ─── typography ─────────────────────────────────────────── */\n --tgui--font-family:\n -apple-system, BlinkMacSystemFont, \"SF Pro Text\", \"SF Pro Display\", \"Helvetica Neue\",\n \"Segoe UI\", \"Roboto\", system-ui, sans-serif;\n --tgui--font-family-mono: ui-monospace, \"SF Mono\", \"Geist Mono\", \"Menlo\", monospace;\n\n --tgui--weight-regular: 400;\n --tgui--weight-medium: 500;\n --tgui--weight-semibold: 600;\n --tgui--weight-bold: 700;\n\n /* iOS semantic text styles: size / line-height / weight / tracking */\n --tgui--font-large-title-size: 34px;\n --tgui--font-large-title-line: 41px;\n --tgui--font-large-title-weight: 700;\n --tgui--font-large-title-tracking: 0.4px;\n\n --tgui--font-title-1-size: 28px;\n --tgui--font-title-1-line: 34px;\n --tgui--font-title-1-weight: 700;\n --tgui--font-title-1-tracking: 0.36px;\n\n --tgui--font-title-2-size: 22px;\n --tgui--font-title-2-line: 28px;\n --tgui--font-title-2-weight: 700;\n --tgui--font-title-2-tracking: 0.35px;\n\n --tgui--font-title-3-size: 20px;\n --tgui--font-title-3-line: 25px;\n --tgui--font-title-3-weight: 600;\n --tgui--font-title-3-tracking: 0.38px;\n\n --tgui--font-headline-size: 17px;\n --tgui--font-headline-line: 22px;\n --tgui--font-headline-weight: 600;\n --tgui--font-headline-tracking: -0.43px;\n\n --tgui--font-body-size: 17px;\n --tgui--font-body-line: 22px;\n --tgui--font-body-weight: 400;\n --tgui--font-body-tracking: -0.43px;\n\n --tgui--font-callout-size: 16px;\n --tgui--font-callout-line: 21px;\n --tgui--font-callout-weight: 400;\n --tgui--font-callout-tracking: -0.31px;\n\n --tgui--font-subheadline-size: 15px;\n --tgui--font-subheadline-line: 20px;\n --tgui--font-subheadline-weight: 400;\n --tgui--font-subheadline-tracking: -0.23px;\n\n --tgui--font-footnote-size: 13px;\n --tgui--font-footnote-line: 18px;\n --tgui--font-footnote-weight: 400;\n --tgui--font-footnote-tracking: -0.08px;\n\n --tgui--font-caption-1-size: 12px;\n --tgui--font-caption-1-line: 16px;\n --tgui--font-caption-1-weight: 400;\n --tgui--font-caption-1-tracking: 0px;\n\n --tgui--font-caption-2-size: 11px;\n --tgui--font-caption-2-line: 13px;\n --tgui--font-caption-2-weight: 400;\n --tgui--font-caption-2-tracking: 0.06px;\n\n /* ─── field chrome (shared by FormField / SearchBar / Stepper) ─── */\n --tgui--field-padding-x: 16px;\n --tgui--field-padding-y: 12px;\n --tgui--field-radius: 12px;\n --tgui--field-gap: 12px;\n --tgui--field-min-height: 48px;\n\n -webkit-tap-highlight-color: transparent;\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-family: var(--tgui--font-family);\n font-optical-sizing: auto;\n color: var(--tgui--label);\n}\n\n/* platform: iOS shares the HIG type scale with base; kept for CSS-only iOS diffs */\n.wrapper--ios {\n /* intentionally minimal – structural platform differences are handled in JS */\n}\n\n.wrapper--dark {\n --tgui--palette-blue: #0a84ff;\n --tgui--palette-red: #ff453a;\n --tgui--palette-green: #30d158;\n --tgui--palette-orange: #ff9f0a;\n\n --tgui--bg: var(--tg-theme-bg-color, #000000);\n --tgui--bg-secondary: var(--tg-theme-secondary-bg-color, #000000);\n --tgui--bg-elevated: var(--tg-theme-section-bg-color, #1c1c1e);\n --tgui--fill: rgba(120, 120, 128, 0.24);\n --tgui--fill-secondary: rgba(120, 120, 128, 0.16);\n --tgui--fill-tertiary: rgba(118, 118, 128, 0.12);\n\n --tgui--label: var(--tg-theme-text-color, #ffffff);\n --tgui--label-secondary: var(--tg-theme-hint-color, #98989e);\n --tgui--label-tertiary: rgba(235, 235, 245, 0.3);\n --tgui--label-quaternary: rgba(235, 235, 245, 0.16);\n --tgui--placeholder: rgba(235, 235, 245, 0.3);\n\n --tgui--separator: rgba(84, 84, 88, 0.6);\n --tgui--separator-opaque: #38383a;\n\n --tgui--accent: var(--tg-theme-button-color, #0a84ff);\n --tgui--accent-fill: rgba(10, 132, 255, 0.2);\n --tgui--link: var(--tg-theme-link-color, #0a84ff);\n --tgui--destructive: var(--tg-theme-destructive-text-color, #ff453a);\n --tgui--success: #30d158;\n --tgui--warning: #ff9f0a;\n\n --tgui--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);\n --tgui--shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);\n --tgui--shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);\n\n --tgui--material-bg-ultra-thin: rgba(28, 28, 30, 0.55);\n --tgui--material-bg-thin: rgba(28, 28, 30, 0.7);\n --tgui--material-bg-regular: rgba(28, 28, 30, 0.82);\n --tgui--material-bg-thick: rgba(28, 28, 30, 0.93);\n}\n\n@media (min-resolution: 2dppx) {\n .wrapper {\n --tgui--hairline: 0.5px;\n }\n}\n\n@supports (padding: max(0px, env(safe-area-inset-top))) {\n .wrapper {\n --tgui--safe-area-top: max(env(safe-area-inset-top), var(--tg-safe-area-inset-top, 0px));\n --tgui--safe-area-right: max(env(safe-area-inset-right), var(--tg-safe-area-inset-right, 0px));\n --tgui--safe-area-bottom: max(\n env(safe-area-inset-bottom),\n var(--tg-safe-area-inset-bottom, 0px)\n );\n --tgui--safe-area-left: max(env(safe-area-inset-left), var(--tg-safe-area-inset-left, 0px));\n }\n}\n\n@supports (color: color-mix(in srgb, red 10%, transparent)) {\n .wrapper {\n --tgui--accent-fill: color-mix(in srgb, var(--tgui--accent) 12%, transparent);\n --tgui--accent-strong: color-mix(in srgb, var(--tgui--accent) 76%, #000);\n --tgui--link-strong: color-mix(in srgb, var(--tgui--link) 76%, #000);\n --tgui--destructive-strong: color-mix(in srgb, var(--tgui--destructive) 76%, #000);\n --tgui--material-bg-ultra-thin: color-mix(in srgb, var(--tgui--bg-elevated) 55%, transparent);\n --tgui--material-bg-thin: color-mix(in srgb, var(--tgui--bg-elevated) 70%, transparent);\n --tgui--material-bg-regular: color-mix(in srgb, var(--tgui--bg-elevated) 82%, transparent);\n --tgui--material-bg-thick: color-mix(in srgb, var(--tgui--bg-elevated) 93%, transparent);\n }\n\n .wrapper--dark {\n --tgui--accent-fill: color-mix(in srgb, var(--tgui--accent) 22%, transparent);\n /* fill stays deep for white text; text hues stay raw (bright on near-black) */\n --tgui--accent-strong: color-mix(in srgb, var(--tgui--accent) 80%, #000);\n --tgui--link-strong: var(--tgui--link);\n --tgui--destructive-strong: var(--tgui--destructive);\n }\n}\n\n/* material fallbacks – must come after the color-mix block to win */\n@media (prefers-reduced-transparency: reduce) {\n .wrapper {\n --tgui--material-blur-ultra-thin: none;\n --tgui--material-blur-thin: none;\n --tgui--material-blur-regular: none;\n --tgui--material-blur-thick: none;\n --tgui--material-bg-ultra-thin: var(--tgui--bg-elevated);\n --tgui--material-bg-thin: var(--tgui--bg-elevated);\n --tgui--material-bg-regular: var(--tgui--bg-elevated);\n --tgui--material-bg-thick: var(--tgui--bg-elevated);\n }\n}\n\n@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {\n .wrapper {\n --tgui--material-bg-ultra-thin: var(--tgui--bg-elevated);\n --tgui--material-bg-thin: var(--tgui--bg-elevated);\n --tgui--material-bg-regular: var(--tgui--bg-elevated);\n --tgui--material-bg-thick: var(--tgui--bg-elevated);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wrapper *,\n .wrapper *::before,\n .wrapper *::after {\n /* biome-ignore lint/complexity/noImportantStyles: a reduced-motion reset must beat every component's own transition/animation */\n animation-duration: 0.01ms !important;\n /* biome-ignore lint/complexity/noImportantStyles: see above */\n animation-iteration-count: 1 !important;\n /* biome-ignore lint/complexity/noImportantStyles: see above */\n transition-duration: 0.01ms !important;\n /* biome-ignore lint/complexity/noImportantStyles: see above */\n scroll-behavior: auto !important;\n }\n}\n","import {\n type HTMLAttributes,\n type Ref,\n useCallback,\n useMemo,\n useState,\n useSyncExternalStore,\n} from 'react';\nimport { getAppearance, subscribeAppearance } from '../../shared/lib/appearance';\nimport { cn } from '../../shared/lib/cn';\nimport { getPlatform } from '../../shared/lib/platform';\nimport type { Appearance, TguiPlatform } from '../../shared/types/tgui';\nimport { TguiContext } from './context';\nimport styles from './TguiProvider.module.css';\n\nexport interface TguiProviderProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n platform?: TguiPlatform;\n appearance?: Appearance;\n portalContainer?: HTMLElement | null;\n // set false to opt every component out of Telegram haptic feedback\n haptics?: boolean;\n}\n\nconst getServerAppearance = (): Appearance => 'light';\n\nexport function TguiProvider({\n ref,\n platform: platformProp,\n appearance: appearanceProp,\n portalContainer: portalContainerProp,\n haptics = true,\n className,\n children,\n ...rest\n}: TguiProviderProps) {\n const platform = useMemo(() => platformProp ?? getPlatform(), [platformProp]);\n\n const systemAppearance = useSyncExternalStore(\n subscribeAppearance,\n getAppearance,\n getServerAppearance,\n );\n const appearance = appearanceProp ?? systemAppearance;\n\n const [wrapper, setWrapper] = useState<HTMLDivElement | null>(null);\n const setRef = useCallback(\n (node: HTMLDivElement | null) => {\n setWrapper(node);\n\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n },\n [ref],\n );\n\n const value = useMemo(\n () => ({\n platform,\n appearance,\n portalContainer: portalContainerProp ?? wrapper,\n haptics,\n }),\n [platform, appearance, portalContainerProp, wrapper, haptics],\n );\n\n return (\n <div\n ref={setRef}\n data-slot=\"tgui-provider\"\n data-platform={platform}\n data-appearance={appearance}\n className={cn(\n styles.wrapper,\n platform === 'ios' && styles['wrapper--ios'],\n appearance === 'dark' && styles['wrapper--dark'],\n className,\n )}\n {...rest}\n >\n <TguiContext.Provider value={value}>{children}</TguiContext.Provider>\n </div>\n );\n}\n\nTguiProvider.displayName = 'TguiProvider';\n","import { getTelegramWebApp } from './telegram';\n\n// semantic intents, mapped to Telegram's HapticFeedback API\nexport type HapticIntent = 'tap' | 'press' | 'select' | 'success' | 'warning' | 'error';\n\n// fire a haptic through the Telegram client; a no-op everywhere else\nexport function triggerHaptic(intent: HapticIntent): void {\n const haptic = getTelegramWebApp()?.HapticFeedback;\n if (haptic == null) return;\n try {\n switch (intent) {\n case 'tap':\n haptic.impactOccurred('light');\n break;\n case 'press':\n haptic.impactOccurred('medium');\n break;\n case 'select':\n haptic.selectionChanged();\n break;\n case 'success':\n haptic.notificationOccurred('success');\n break;\n case 'warning':\n haptic.notificationOccurred('warning');\n break;\n case 'error':\n haptic.notificationOccurred('error');\n break;\n }\n } catch {\n // older clients throw on styles they don't support\n }\n}\n","import { useCallback, useContext } from 'react';\nimport { type HapticIntent, triggerHaptic } from '../../shared/lib/haptics';\nimport { TguiContext } from './context';\n\n// returns a stable function that fires a Telegram haptic, respecting the\n// provider's `haptics` flag; a no-op outside Telegram and provider-optional\nexport function useHaptic(): (intent: HapticIntent) => void {\n const enabled = useContext(TguiContext)?.haptics ?? true;\n return useCallback(\n (intent: HapticIntent) => {\n if (enabled) triggerHaptic(intent);\n },\n [enabled],\n );\n}\n","import { useContext } from 'react';\nimport type { TguiContextValue } from '../../shared/types/tgui';\nimport { TguiContext } from './context';\n\nexport function useTgui(): TguiContextValue {\n const context = useContext(TguiContext);\n\n if (context === null) {\n throw new Error('useTgui must be used within a <TguiProvider>.');\n }\n\n return context;\n}\n",".accordion {\n display: flex;\n flex-direction: column;\n}\n\n.item {\n border-bottom: var(--tgui--hairline, 1px) solid var(--tgui--separator);\n}\n\n.item:last-child {\n border-bottom: 0;\n}\n\n.header {\n display: flex;\n align-items: center;\n gap: 12px;\n width: 100%;\n padding: 15px var(--tgui--accordion-inset, 20px);\n border: 0;\n background: transparent;\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 16px;\n font-weight: var(--tgui--weight-semibold);\n line-height: 22px;\n text-align: start;\n cursor: pointer;\n}\n\n.title {\n flex: 1;\n min-width: 0;\n}\n\n.header:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: calc(-1 * var(--tgui--focus-ring-offset));\n}\n\n.chevron {\n flex-shrink: 0;\n width: 18px;\n height: 18px;\n color: var(--tgui--label-tertiary);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .chevron {\n transition: transform 0.2s ease;\n }\n}\n\n.header[aria-expanded=\"true\"] .chevron {\n transform: rotate(180deg);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .header:hover .title {\n color: var(--tgui--link-strong);\n }\n}\n\n.panel {\n display: grid;\n grid-template-rows: 0fr;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .panel {\n transition: grid-template-rows 0.25s ease;\n }\n}\n\n.panel[data-state=\"open\"] {\n grid-template-rows: 1fr;\n}\n\n.panelInner {\n overflow: hidden;\n}\n\n.panelContent {\n padding: 2px var(--tgui--accordion-inset, 20px) 16px;\n color: var(--tgui--label-secondary);\n font-family: var(--tgui--font-family);\n font-size: 15px;\n line-height: 21px;\n}\n","import { createContext } from 'react';\n\nexport interface AccordionContextValue {\n open: string[];\n toggle: (value: string) => void;\n}\n\nexport const AccordionContext = createContext<AccordionContextValue | null>(null);\n\nAccordionContext.displayName = 'AccordionContext';\n","'use client';\n\nimport { type HTMLAttributes, type Ref, useCallback, useMemo, useState } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic } from '../TguiProvider';\nimport styles from './Accordion.module.css';\nimport { AccordionContext } from './context';\n\nconst toArray = (value: string | string[] | undefined): string[] =>\n value == null ? [] : Array.isArray(value) ? value : [value];\n\nexport interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {\n ref?: Ref<HTMLDivElement>;\n multiple?: boolean;\n value?: string | string[];\n defaultValue?: string | string[];\n onValueChange?: (value: string[]) => void;\n}\n\nexport function Accordion({\n ref,\n multiple = false,\n value: valueProp,\n defaultValue,\n onValueChange,\n className,\n children,\n ...rest\n}: AccordionProps) {\n const [uncontrolled, setUncontrolled] = useState(() => toArray(defaultValue));\n const open = valueProp != null ? toArray(valueProp) : uncontrolled;\n const haptic = useHaptic();\n\n const toggle = useCallback(\n (item: string) => {\n const isOpen = open.includes(item);\n const next = isOpen ? open.filter((v) => v !== item) : multiple ? [...open, item] : [item];\n haptic('tap');\n if (valueProp == null) setUncontrolled(next);\n onValueChange?.(next);\n },\n [open, multiple, valueProp, onValueChange, haptic],\n );\n\n const context = useMemo(() => ({ open, toggle }), [open, toggle]);\n\n return (\n <AccordionContext.Provider value={context}>\n <div ref={ref} data-slot=\"accordion\" className={cn(styles.accordion, className)} {...rest}>\n {children}\n </div>\n </AccordionContext.Provider>\n );\n}\n\nAccordion.displayName = 'Accordion';\n","'use client';\n\nimport { type HTMLAttributes, type ReactNode, type Ref, useContext, useId } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Accordion.module.css';\nimport { AccordionContext } from './context';\n\nexport interface AccordionItemProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n value: string;\n header: ReactNode;\n}\n\nexport function AccordionItem({\n ref,\n value,\n header,\n className,\n children,\n ...rest\n}: AccordionItemProps) {\n const context = useContext(AccordionContext);\n if (!context) {\n throw new Error('AccordionItem must be used within an <Accordion>.');\n }\n const panelId = useId();\n const open = context.open.includes(value);\n\n const state = open ? 'open' : 'closed';\n\n return (\n <div\n ref={ref}\n data-slot=\"accordion-item\"\n data-state={state}\n className={cn(styles.item, className)}\n {...rest}\n >\n <button\n type=\"button\"\n data-slot=\"accordion-trigger\"\n data-state={state}\n className={styles.header}\n aria-expanded={open}\n aria-controls={panelId}\n onClick={() => context.toggle(value)}\n >\n <span className={styles.title}>{header}</span>\n <svg className={styles.chevron} viewBox=\"0 0 18 18\" fill=\"none\" aria-hidden>\n <path\n d=\"M4.5 7l4.5 4.5L13.5 7\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n <div data-slot=\"accordion-panel\" data-state={state} className={styles.panel}>\n <div className={styles.panelInner}>\n <div\n id={panelId}\n data-slot=\"accordion-content\"\n className={styles.panelContent}\n inert={!open}\n aria-hidden={!open}\n >\n {children}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nAccordionItem.displayName = 'AccordionItem';\n",".avatar {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n flex-shrink: 0;\n overflow: hidden;\n border-radius: 50%;\n background: var(--tgui--fill);\n color: var(--tgui--label-secondary);\n font-family: var(--tgui--font-family);\n font-weight: var(--tgui--weight-semibold);\n line-height: 1;\n user-select: none;\n}\n\n.s20 {\n width: 20px;\n height: 20px;\n font-size: 9px;\n}\n\n.s24 {\n width: 24px;\n height: 24px;\n font-size: 10px;\n}\n\n.s28 {\n width: 28px;\n height: 28px;\n font-size: 11px;\n}\n\n.s40 {\n width: 40px;\n height: 40px;\n font-size: 15px;\n}\n\n.s48 {\n width: 48px;\n height: 48px;\n font-size: 18px;\n}\n\n.s96 {\n width: 96px;\n height: 96px;\n font-size: 34px;\n}\n\n.img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n}\n\n.acronym {\n text-transform: uppercase;\n}\n\n.icon {\n display: flex;\n width: 60%;\n height: 60%;\n}\n\n.icon > svg {\n width: 100%;\n height: 100%;\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Avatar.module.css';\n\nexport type AvatarSize = 20 | 24 | 28 | 40 | 48 | 96;\n\nexport const avatar = cva(styles.avatar, {\n variants: {\n size: {\n 20: styles.s20,\n 24: styles.s24,\n 28: styles.s28,\n 40: styles.s40,\n 48: styles.s48,\n 96: styles.s96,\n },\n },\n defaultVariants: { size: 40 },\n});\n","'use client';\n\nimport { type HTMLAttributes, type ReactNode, type Ref, useState } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Avatar.module.css';\nimport { type AvatarSize, avatar } from './Avatar.variants';\n\nexport type { AvatarSize };\n\nexport interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {\n ref?: Ref<HTMLSpanElement>;\n size?: AvatarSize;\n src?: string;\n alt?: string;\n acronym?: string;\n fallbackIcon?: ReactNode;\n}\n\nfunction PersonIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden>\n <path d=\"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0 2c-4.2 0-7 2.4-7 4.5V20h14v-1.5c0-2.1-2.8-4.5-7-4.5Z\" />\n </svg>\n );\n}\n\nexport function Avatar({\n ref,\n size = 40,\n src,\n alt = '',\n acronym,\n fallbackIcon,\n className,\n children,\n ...rest\n}: AvatarProps) {\n const [failedSrc, setFailedSrc] = useState<string | null>(null);\n const showImage = src != null && src !== '' && src !== failedSrc;\n\n return (\n <span ref={ref} data-slot=\"avatar\" className={cn(avatar({ size }), className)} {...rest}>\n {showImage ? (\n <img\n data-slot=\"avatar-image\"\n className={styles.img}\n src={src}\n alt={alt}\n loading=\"lazy\"\n onError={() => setFailedSrc(src)}\n />\n ) : acronym ? (\n <span data-slot=\"avatar-fallback\" className={styles.acronym}>\n {acronym}\n </span>\n ) : (\n <span data-slot=\"avatar-fallback\" className={styles.icon}>\n {fallbackIcon ?? <PersonIcon />}\n </span>\n )}\n {children}\n </span>\n );\n}\n\nAvatar.displayName = 'Avatar';\n",".stack {\n display: inline-flex;\n align-items: center;\n}\n\n.stack > * {\n margin-inline-start: calc(-1 * var(--tgui--avatar-stack-overlap, 8px));\n border-radius: 50%;\n box-shadow: 0 0 0 2px var(--tgui--bg);\n}\n\n.stack > *:first-child {\n margin-inline-start: 0;\n}\n","import type { CSSProperties, HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './AvatarStack.module.css';\n\nexport interface AvatarStackProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n overlap?: number;\n}\n\nexport function AvatarStack({ ref, overlap, className, style, ...rest }: AvatarStackProps) {\n return (\n <div\n ref={ref}\n data-slot=\"avatar-stack\"\n className={cn(styles.stack, className)}\n style={\n overlap != null\n ? ({ ...style, '--tgui--avatar-stack-overlap': `${overlap}px` } as CSSProperties)\n : style\n }\n {...rest}\n />\n );\n}\n\nAvatarStack.displayName = 'AvatarStack';\n",".badge {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n flex-shrink: 0;\n font-family: var(--tgui--font-family);\n font-weight: var(--tgui--weight-semibold);\n}\n\n.number {\n min-width: 20px;\n height: 20px;\n padding: 0 6px;\n border-radius: 10px;\n font-size: 13px;\n line-height: 1;\n}\n\n.large.number {\n min-width: 24px;\n height: 24px;\n padding: 0 8px;\n border-radius: 12px;\n font-size: 15px;\n}\n\n.dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n}\n\n.large.dot {\n width: 10px;\n height: 10px;\n}\n\n.mode-primary {\n color: var(--tgui--accent-label);\n background: var(--tgui--accent-strong);\n}\n\n.mode-critical {\n color: var(--tgui--white);\n background: var(--tgui--destructive);\n}\n\n@supports (color: color-mix(in srgb, red 10%, transparent)) {\n .mode-critical {\n /* deep enough for the white count to pass AA in both themes */\n background: color-mix(in srgb, var(--tgui--destructive) 78%, #000);\n }\n}\n\n.mode-secondary {\n color: var(--tgui--link-strong);\n background: var(--tgui--accent-fill);\n}\n\n.mode-gray {\n color: var(--tgui--label);\n background: var(--tgui--fill);\n}\n\n.mode-white {\n color: var(--tgui--black);\n background: var(--tgui--white);\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Badge.module.css';\n\nexport type BadgeType = 'number' | 'dot';\nexport type BadgeMode = 'primary' | 'critical' | 'secondary' | 'gray' | 'white';\n\nexport const badge = cva(styles.badge, {\n variants: {\n type: { number: styles.number, dot: styles.dot },\n mode: {\n primary: styles['mode-primary'],\n critical: styles['mode-critical'],\n secondary: styles['mode-secondary'],\n gray: styles['mode-gray'],\n white: styles['mode-white'],\n },\n large: { true: styles.large },\n },\n defaultVariants: { type: 'number', mode: 'primary' },\n});\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { type BadgeMode, type BadgeType, badge } from './Badge.variants';\n\nexport type { BadgeMode, BadgeType };\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n ref?: Ref<HTMLSpanElement>;\n type?: BadgeType;\n mode?: BadgeMode;\n large?: boolean;\n children?: ReactNode;\n}\n\nexport function Badge({\n ref,\n type = 'number',\n mode = 'primary',\n large = false,\n className,\n children,\n ...rest\n}: BadgeProps) {\n return (\n <span\n ref={ref}\n data-slot=\"badge\"\n data-mode={mode}\n className={cn(badge({ type, mode, large }), className)}\n {...rest}\n >\n {type === 'number' ? children : null}\n </span>\n );\n}\n\nBadge.displayName = 'Badge';\n",".banner {\n position: relative;\n display: flex;\n gap: 16px;\n box-sizing: border-box;\n padding: 16px;\n border-radius: 12px;\n overflow: hidden;\n font-family: var(--tgui--font-family);\n}\n\n.type-section {\n background: var(--tgui--fill);\n color: var(--tgui--label);\n}\n\n.type-image {\n color: var(--tgui--white);\n}\n\n.background {\n position: absolute;\n inset: 0;\n z-index: 0;\n}\n\n.background > * {\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n\n.type-image::after {\n content: \"\";\n position: absolute;\n inset: 0;\n z-index: 1;\n background: linear-gradient(180deg, rgb(0 0 0 / 0.1), rgb(0 0 0 / 0.55));\n}\n\n.before {\n position: relative;\n z-index: 2;\n flex-shrink: 0;\n}\n\n.body {\n position: relative;\n z-index: 2;\n display: flex;\n flex-direction: column;\n gap: 4px;\n min-width: 0;\n flex: 1;\n}\n\n.callout {\n font-size: 13px;\n line-height: 16px;\n font-weight: var(--tgui--weight-semibold);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n opacity: 0.75;\n}\n\n.header {\n font-size: 16px;\n line-height: 22px;\n font-weight: var(--tgui--weight-bold);\n}\n\n.subheader {\n font-size: 14px;\n line-height: 20px;\n opacity: 0.8;\n}\n\n.description {\n margin-top: 4px;\n font-size: 14px;\n line-height: 20px;\n}\n\n.actions {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n margin-top: 12px;\n}\n\n.close {\n position: relative;\n z-index: 2;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 24px;\n height: 24px;\n margin: -4px -4px auto auto;\n padding: 0;\n border: 0;\n border-radius: 50%;\n color: currentColor;\n background: transparent;\n cursor: pointer;\n opacity: 0.7;\n}\n\n.close:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n opacity: 1;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .close:hover {\n opacity: 1;\n }\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Banner.module.css';\n\nexport type BannerType = 'section' | 'image';\n\nexport const banner = cva(styles.banner, {\n variants: {\n type: {\n section: styles['type-section'],\n image: styles['type-image'],\n },\n },\n defaultVariants: { type: 'section' },\n});\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Banner.module.css';\nimport { type BannerType, banner } from './Banner.variants';\n\nexport type { BannerType };\n\nexport interface BannerProps extends HTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n type?: BannerType;\n before?: ReactNode;\n callout?: ReactNode;\n header?: ReactNode;\n subheader?: ReactNode;\n description?: ReactNode;\n actions?: ReactNode;\n background?: ReactNode;\n onClose?: () => void;\n closeLabel?: string;\n}\n\nexport function Banner({\n ref,\n type = 'section',\n before,\n callout,\n header,\n subheader,\n description,\n actions,\n background,\n onClose,\n closeLabel = 'Close',\n className,\n children,\n ...rest\n}: BannerProps) {\n return (\n <section\n ref={ref}\n data-slot=\"banner\"\n data-type={type}\n className={cn(banner({ type }), className)}\n {...rest}\n >\n {type === 'image' && background != null ? (\n <div data-slot=\"banner-background\" className={styles.background} aria-hidden>\n {background}\n </div>\n ) : null}\n\n {before != null ? (\n <div data-slot=\"banner-before\" className={styles.before}>\n {before}\n </div>\n ) : null}\n\n <div data-slot=\"banner-body\" className={styles.body}>\n {callout != null ? (\n <span data-slot=\"banner-callout\" className={styles.callout}>\n {callout}\n </span>\n ) : null}\n {header != null ? (\n <span data-slot=\"banner-title\" className={styles.header}>\n {header}\n </span>\n ) : null}\n {subheader != null ? (\n <span data-slot=\"banner-subtitle\" className={styles.subheader}>\n {subheader}\n </span>\n ) : null}\n {description != null ? (\n <p data-slot=\"banner-description\" className={styles.description}>\n {description}\n </p>\n ) : null}\n {children}\n {actions != null ? (\n <div data-slot=\"banner-actions\" className={styles.actions}>\n {actions}\n </div>\n ) : null}\n </div>\n\n {onClose != null ? (\n <button\n type=\"button\"\n data-slot=\"banner-close\"\n className={styles.close}\n aria-label={closeLabel}\n onClick={onClose}\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden>\n <path\n d=\"M3.5 3.5l7 7M10.5 3.5l-7 7\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n </button>\n ) : null}\n </section>\n );\n}\n\nBanner.displayName = 'Banner';\n",".blockquote {\n margin: 0;\n padding: 8px 12px 8px 16px;\n border-radius: 4px 12px 12px 4px;\n border-inline-start: 3px solid var(--tgui--link);\n background: var(--tgui--accent-fill);\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 15px;\n line-height: 21px;\n}\n\n.cite {\n display: block;\n margin-top: 6px;\n color: var(--tgui--label-secondary);\n font-size: 13px;\n font-style: normal;\n}\n","import type { BlockquoteHTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Blockquote.module.css';\n\nexport interface BlockquoteProps extends BlockquoteHTMLAttributes<HTMLQuoteElement> {\n ref?: Ref<HTMLQuoteElement>;\n author?: ReactNode;\n}\n\nexport function Blockquote({ ref, author, className, children, ...rest }: BlockquoteProps) {\n return (\n <blockquote\n ref={ref}\n data-slot=\"blockquote\"\n className={cn(styles.blockquote, className)}\n {...rest}\n >\n {children}\n {author != null ? (\n <cite data-slot=\"blockquote-author\" className={styles.cite}>\n {author}\n </cite>\n ) : null}\n </blockquote>\n );\n}\n\nBlockquote.displayName = 'Blockquote';\n",".nav {\n min-width: 0;\n font-family: var(--tgui--font-family);\n font-size: 14px;\n line-height: 18px;\n}\n\n.list {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 6px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.item {\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n}\n\n.link {\n margin: 0;\n padding: 0;\n border: 0;\n background: none;\n color: var(--tgui--link-strong);\n font: inherit;\n cursor: pointer;\n text-decoration: none;\n border-radius: 4px;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .link:hover {\n text-decoration: underline;\n }\n}\n\n.link:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n.current {\n overflow: hidden;\n max-width: 220px;\n color: var(--tgui--label);\n font-weight: var(--tgui--weight-semibold);\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.ellipsis {\n color: var(--tgui--label-secondary);\n}\n\n.chevron {\n flex-shrink: 0;\n color: var(--tgui--label-secondary);\n}\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Breadcrumbs.module.css';\n\nexport interface BreadcrumbItem {\n label: ReactNode;\n href?: string;\n onClick?: () => void;\n}\n\nexport interface BreadcrumbsProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {\n ref?: Ref<HTMLElement>;\n items: BreadcrumbItem[];\n maxItems?: number;\n}\n\nconst Chevron = () => (\n <svg\n data-slot=\"breadcrumbs-separator\"\n className={styles.chevron}\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 18 18\"\n fill=\"none\"\n aria-hidden\n >\n <path\n d=\"M6.75 4.5L11.25 9l-4.5 4.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport function Breadcrumbs({ ref, items, maxItems = 4, className, ...rest }: BreadcrumbsProps) {\n const collapsed = items.length > maxItems;\n const visible: (BreadcrumbItem | 'ellipsis')[] = collapsed\n ? [items[0], 'ellipsis', ...items.slice(items.length - (maxItems - 1))]\n : items;\n\n return (\n <nav\n ref={ref}\n aria-label=\"Breadcrumbs\"\n data-slot=\"breadcrumbs\"\n className={cn(styles.nav, className)}\n {...rest}\n >\n <ol data-slot=\"breadcrumbs-list\" className={styles.list}>\n {visible.map((item, index) => {\n const isLast = index === visible.length - 1;\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: breadcrumb trail order is stable\n <li key={index} data-slot=\"breadcrumbs-item\" className={styles.item}>\n {item === 'ellipsis' ? (\n <span data-slot=\"breadcrumbs-ellipsis\" className={styles.ellipsis} aria-hidden>\n …\n </span>\n ) : isLast ? (\n <span data-slot=\"breadcrumbs-page\" className={styles.current} aria-current=\"page\">\n {item.label}\n </span>\n ) : item.href != null ? (\n <a\n href={item.href}\n data-slot=\"breadcrumbs-link\"\n className={styles.link}\n onClick={item.onClick}\n >\n {item.label}\n </a>\n ) : (\n <button\n type=\"button\"\n data-slot=\"breadcrumbs-link\"\n className={styles.link}\n onClick={item.onClick}\n >\n {item.label}\n </button>\n )}\n {!isLast ? <Chevron /> : null}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n}\n\nBreadcrumbs.displayName = 'Breadcrumbs';\n",".spinner {\n display: inline-block;\n box-sizing: border-box;\n border-radius: 50%;\n border-style: solid;\n border-color: currentColor;\n border-top-color: transparent;\n animation: tgui-spinner 0.6s linear infinite;\n}\n\n.s {\n width: 16px;\n height: 16px;\n border-width: 2px;\n}\n\n.m {\n width: 24px;\n height: 24px;\n border-width: 2.5px;\n}\n\n.l {\n width: 32px;\n height: 32px;\n border-width: 3px;\n}\n\n@keyframes tgui-spinner {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .spinner {\n animation-duration: 1.6s;\n }\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Spinner.module.css';\n\nexport type SpinnerSize = 's' | 'm' | 'l';\n\nexport const spinner = cva(styles.spinner, {\n variants: {\n size: { s: styles.s, m: styles.m, l: styles.l },\n },\n defaultVariants: { size: 'm' },\n});\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { type SpinnerSize, spinner } from './Spinner.variants';\n\nexport type { SpinnerSize };\n\nexport interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {\n ref?: Ref<HTMLSpanElement>;\n size?: SpinnerSize;\n}\n\nexport function Spinner({ ref, size = 'm', className, ...rest }: SpinnerProps) {\n return (\n <span\n ref={ref}\n role=\"status\"\n aria-label=\"Loading\"\n data-slot=\"spinner\"\n className={cn(spinner({ size }), className)}\n {...rest}\n />\n );\n}\n\nSpinner.displayName = 'Spinner';\n",".typography {\n margin: 0;\n font-family: var(--tgui--font-family);\n}\n\n.weight-1 {\n font-weight: var(--tgui--weight-bold);\n}\n\n.weight-2 {\n font-weight: var(--tgui--weight-semibold);\n}\n\n.weight-3 {\n font-weight: var(--tgui--weight-regular);\n}\n\n.caps {\n text-transform: uppercase;\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Typography.module.css';\n\nexport const typography = cva(styles.typography, {\n variants: {\n weight: {\n '1': styles['weight-1'],\n '2': styles['weight-2'],\n '3': styles['weight-3'],\n },\n caps: { true: styles.caps },\n },\n defaultVariants: { weight: '3' },\n});\n","import type { AllHTMLAttributes, ElementType, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { typography } from './Typography.variants';\n\nexport interface TypographyProps extends AllHTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n weight?: '1' | '2' | '3';\n caps?: boolean;\n Component?: ElementType;\n}\n\nexport function Typography({\n ref,\n weight,\n caps,\n Component = 'span',\n className,\n ...rest\n}: TypographyProps) {\n return (\n <Component\n ref={ref}\n data-slot=\"typography\"\n className={cn(typography({ weight, caps }), className)}\n {...rest}\n />\n );\n}\n\nTypography.displayName = 'Typography';\n",".level-1 {\n font-size: var(--tgui--font-subheadline-size);\n line-height: var(--tgui--font-subheadline-line);\n letter-spacing: var(--tgui--font-subheadline-tracking);\n}\n\n.level-2 {\n font-size: var(--tgui--font-footnote-size);\n line-height: var(--tgui--font-footnote-line);\n letter-spacing: var(--tgui--font-footnote-tracking);\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Subheadline.module.css';\n\nexport type SubheadlineLevel = '1' | '2';\n\nexport const subheadline = cva('', {\n variants: {\n level: {\n '1': styles['level-1'],\n '2': styles['level-2'],\n },\n },\n defaultVariants: { level: '1' },\n});\n","import type { Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Typography, type TypographyProps } from '../Typography';\nimport { type SubheadlineLevel, subheadline } from './Subheadline.variants';\n\nexport interface SubheadlineProps extends TypographyProps {\n ref?: Ref<HTMLElement>;\n level?: SubheadlineLevel;\n}\n\nexport function Subheadline({\n ref,\n level,\n Component = 'h6',\n className,\n ...rest\n}: SubheadlineProps) {\n return (\n <Typography\n data-slot=\"subheadline\"\n ref={ref}\n Component={Component}\n className={cn(subheadline({ level }), className)}\n {...rest}\n />\n );\n}\n\nSubheadline.displayName = 'Subheadline';\n",".ripple {\n position: absolute;\n inset: 0;\n overflow: hidden;\n border-radius: inherit;\n pointer-events: none;\n}\n\n.wave {\n position: absolute;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n transform: translate(-50%, -50%);\n background: var(--tgui--separator);\n opacity: 0;\n animation: wave-rise 0.35s cubic-bezier(0.3, 0.3, 0.5, 1);\n}\n\n@keyframes wave-rise {\n from {\n transform: translate(-50%, -50%) scale(1);\n opacity: 1;\n }\n 30% {\n opacity: 1;\n }\n to {\n transform: translate(-50%, -50%) scale(8);\n opacity: 0;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wave {\n animation: none;\n }\n}\n","import styles from './Ripple.module.css';\nimport type { Wave } from './useRipple';\n\ninterface RippleProps {\n waves: Wave[];\n onWaveEnd: (id: number) => void;\n}\n\nexport function Ripple({ waves, onWaveEnd }: RippleProps) {\n return (\n <span aria-hidden className={styles.ripple}>\n {waves.map((wave) => (\n <span\n key={wave.id}\n className={styles.wave}\n style={{ top: wave.y, left: wave.x }}\n onAnimationEnd={() => onWaveEnd(wave.id)}\n />\n ))}\n </span>\n );\n}\n",".tappable {\n position: relative;\n isolation: isolate;\n cursor: pointer;\n transition: opacity 0.15s ease-out;\n /* a tap target is a control surface, not a document – no text selection, like a native row/button */\n user-select: none;\n}\n\n.tappable[data-readonly] {\n cursor: default;\n}\n\n.tappable[data-disabled] {\n cursor: default;\n opacity: 0.35;\n}\n\n.tappable--ios:not([data-disabled]):not([data-readonly]):active,\n.tappable--opacity:not([data-disabled]):not([data-readonly]):active {\n opacity: 0.65;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .tappable--ios:not([data-disabled]):not([data-readonly]):hover,\n .tappable--opacity:not([data-disabled]):not([data-readonly]):hover {\n opacity: 0.85;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tappable {\n transition: none;\n }\n}\n","import { type PointerEvent, useCallback, useEffect, useRef, useState } from 'react';\n\nconst PRESS_DELAY = 70;\nconst WAVE_FALLBACK = 600;\n\nexport interface Wave {\n id: number;\n x: number;\n y: number;\n}\n\ntype Timer = ReturnType<typeof setTimeout>;\n\nexport function useRipple() {\n const [waves, setWaves] = useState<Wave[]>([]);\n const nextId = useRef(0);\n const pressTimers = useRef(new Map<number, Timer>());\n const waveTimers = useRef(new Set<Timer>());\n\n useEffect(() => {\n const press = pressTimers.current;\n const wave = waveTimers.current;\n return () => {\n for (const timer of press.values()) clearTimeout(timer);\n for (const timer of wave) clearTimeout(timer);\n };\n }, []);\n\n const removeWave = useCallback((id: number) => {\n setWaves((current) => current.filter((wave) => wave.id !== id));\n }, []);\n\n const onPointerDown = useCallback(\n (event: PointerEvent<HTMLElement>) => {\n const { top, left } = event.currentTarget.getBoundingClientRect();\n const x = event.clientX - left;\n const y = event.clientY - top;\n const { pointerId } = event;\n\n const press = setTimeout(() => {\n pressTimers.current.delete(pointerId);\n const id = nextId.current++;\n setWaves((current) => [...current, { id, x, y }]);\n\n const fallback = setTimeout(() => {\n waveTimers.current.delete(fallback);\n removeWave(id);\n }, WAVE_FALLBACK);\n waveTimers.current.add(fallback);\n }, PRESS_DELAY);\n\n pressTimers.current.set(pointerId, press);\n },\n [removeWave],\n );\n\n const onPointerCancel = useCallback((event: PointerEvent<HTMLElement>) => {\n const press = pressTimers.current.get(event.pointerId);\n if (press) {\n clearTimeout(press);\n pressTimers.current.delete(event.pointerId);\n }\n }, []);\n\n return { waves, onPointerDown, onPointerCancel, removeWave };\n}\n","'use client';\n\nimport type { AllHTMLAttributes, ElementType, PointerEvent, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic } from '../TguiProvider/useHaptic';\nimport { useTgui } from '../TguiProvider/useTgui';\nimport { Ripple } from './Ripple';\nimport styles from './Tappable.module.css';\nimport { useRipple } from './useRipple';\n\nexport interface TappableProps extends AllHTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n Component?: ElementType;\n // background = ripple on base · opacity = dim on both · none = component owns it\n interactiveAnimation?: 'background' | 'opacity' | 'none';\n}\n\nexport function Tappable({\n ref,\n Component = 'div',\n interactiveAnimation = 'background',\n className,\n children,\n onPointerDown,\n onPointerCancel,\n ...rest\n}: TappableProps) {\n const { platform } = useTgui();\n const haptic = useHaptic();\n const ripple = useRipple();\n const disabled = Boolean(rest.disabled);\n const readOnly = Boolean(rest.readOnly);\n\n const interactive = Component !== 'div' && Component !== 'span';\n const tappable = !readOnly && !disabled && (interactive || rest.onClick != null);\n const hasRipple = platform === 'base' && interactiveAnimation === 'background' && tappable;\n\n const handlePointerDown = (event: PointerEvent<HTMLElement>) => {\n // feedback lands on the press, iOS-style\n if (tappable && event.isPrimary) haptic('tap');\n if (hasRipple) ripple.onPointerDown(event);\n onPointerDown?.(event);\n };\n\n const handlePointerCancel = (event: PointerEvent<HTMLElement>) => {\n if (hasRipple) ripple.onPointerCancel(event);\n onPointerCancel?.(event);\n };\n\n return (\n <Component\n ref={ref}\n data-slot=\"tappable\"\n className={cn(\n styles.tappable,\n platform === 'ios' && interactiveAnimation !== 'none' && styles['tappable--ios'],\n interactiveAnimation === 'opacity' && styles['tappable--opacity'],\n className,\n )}\n data-readonly={readOnly || undefined}\n data-disabled={disabled || undefined}\n aria-disabled={disabled || undefined}\n onPointerDown={handlePointerDown}\n onPointerCancel={handlePointerCancel}\n {...rest}\n >\n {hasRipple && <Ripple waves={ripple.waves} onWaveEnd={ripple.removeWave} />}\n {children}\n </Component>\n );\n}\n\nTappable.displayName = 'Tappable';\n",".text {\n font-size: var(--tgui--font-body-size);\n line-height: var(--tgui--font-body-line);\n letter-spacing: var(--tgui--font-body-tracking);\n}\n","import type { Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Typography, type TypographyProps } from '../Typography';\nimport styles from './Text.module.css';\n\nexport interface TextProps extends TypographyProps {\n ref?: Ref<HTMLElement>;\n}\n\nexport function Text({ ref, className, Component = 'span', ...rest }: TextProps) {\n return (\n <Typography\n ref={ref}\n data-slot=\"text\"\n Component={Component}\n className={cn(styles.text, className)}\n {...rest}\n />\n );\n}\n\nText.displayName = 'Text';\n",".button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n max-inline-size: 100%;\n min-inline-size: 80px;\n border: none;\n /* one radius for every size and platform (override with --tgui--button-radius) */\n border-radius: var(--tgui--button-radius, var(--tgui--radius));\n text-decoration: none;\n}\n\n.stretched {\n inline-size: 100%;\n flex-grow: 1;\n}\n\n.button:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n.button::after {\n content: \"\";\n position: absolute;\n inset: 0;\n border-radius: inherit;\n opacity: 0;\n background: var(--tgui--bg);\n transition: opacity 0.15s ease-out;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .button:not([data-disabled]):hover::after {\n opacity: var(--tgui--button-wash-opacity);\n }\n}\n\n.before,\n.after {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.content {\n display: flex;\n flex: 0 1 auto;\n min-inline-size: 0;\n align-items: center;\n justify-content: center;\n z-index: var(--tgui--z-base);\n}\n\n.label {\n min-inline-size: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.content svg {\n display: block;\n}\n\n.button[data-loading] {\n pointer-events: none;\n}\n\n.button[data-loading] .before,\n.button[data-loading] .after,\n.button[data-loading] .content {\n opacity: 0;\n}\n\n.spinner {\n position: absolute;\n color: var(--tgui--button-spinner-color);\n}\n\n.size-s {\n height: 36px;\n min-width: 34px;\n gap: 6px;\n padding: 8px 12px;\n}\n\n.size-m {\n height: 42px;\n min-width: 42px;\n gap: 8px;\n padding: 8px 14px;\n}\n\n.size-l {\n height: 50px;\n gap: 10px;\n padding: 10px 20px;\n}\n\n.ios::after {\n content: none;\n}\n\n.mode-filled {\n --tgui--button-wash-opacity: 0.15;\n --tgui--button-spinner-color: var(--tgui--accent-label);\n color: var(--tgui--accent-label);\n background: var(--tgui--accent-strong);\n}\n\n.mode-bezeled {\n --tgui--button-wash-opacity: 0.07;\n --tgui--button-spinner-color: var(--tgui--link-strong);\n color: var(--tgui--link-strong);\n background: var(--tgui--accent-fill);\n}\n\n.mode-plain {\n --tgui--button-wash-opacity: 0.03;\n --tgui--button-spinner-color: var(--tgui--label);\n color: var(--tgui--link-strong);\n background: transparent;\n}\n\n.mode-gray {\n --tgui--button-wash-opacity: 0.5;\n --tgui--button-spinner-color: var(--tgui--label);\n color: var(--tgui--label);\n background: var(--tgui--fill-tertiary);\n}\n\n.mode-outline {\n --tgui--button-wash-opacity: 0.5;\n --tgui--button-spinner-color: var(--tgui--label);\n color: var(--tgui--label);\n background: transparent;\n box-shadow: 0 0 0 1px var(--tgui--separator);\n}\n\n.mode-white {\n --tgui--button-wash-opacity: 0.5;\n --tgui--button-spinner-color: var(--tgui--label);\n color: var(--tgui--black);\n background: var(--tgui--white);\n}\n","import { cva } from 'class-variance-authority';\nimport type { TguiPlatform } from '../../shared/types/tgui';\nimport styles from './Button.module.css';\n\nexport type ButtonMode = 'filled' | 'bezeled' | 'plain' | 'gray' | 'outline' | 'white';\nexport type ButtonSize = 's' | 'm' | 'l';\n\nexport const button = cva(styles.button, {\n variants: {\n mode: {\n filled: styles['mode-filled'],\n bezeled: styles['mode-bezeled'],\n plain: styles['mode-plain'],\n gray: styles['mode-gray'],\n outline: styles['mode-outline'],\n white: styles['mode-white'],\n },\n size: {\n s: styles['size-s'],\n m: styles['size-m'],\n l: styles['size-l'],\n },\n stretched: { true: styles.stretched },\n platform: { ios: styles.ios, base: null },\n },\n defaultVariants: { mode: 'filled', size: 'm' },\n});\n\nexport type ButtonVariantInput = {\n mode?: ButtonMode;\n size?: ButtonSize;\n stretched?: boolean;\n platform: TguiPlatform;\n};\n","'use client';\n\nimport type { AllHTMLAttributes, ElementType, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Spinner } from '../Spinner';\nimport { Subheadline } from '../Subheadline';\nimport { Tappable } from '../Tappable';\nimport { Text } from '../Text';\nimport { useTgui } from '../TguiProvider';\nimport styles from './Button.module.css';\nimport { type ButtonMode, type ButtonSize, button } from './Button.variants';\n\nexport interface ButtonProps extends Omit<AllHTMLAttributes<HTMLElement>, 'size'> {\n ref?: Ref<HTMLElement>;\n Component?: ElementType;\n mode?: ButtonMode;\n size?: ButtonSize;\n stretched?: boolean;\n loading?: boolean;\n before?: ReactNode;\n after?: ReactNode;\n}\n\nfunction Label({ size, children }: { size: ButtonSize; children: ReactNode }) {\n // Text / Subheadline are used for their type step only – the label is not a\n // heading, so force a span.\n const shared = { weight: '2', Component: 'span', className: styles.content } as const;\n const inner = (\n <span data-slot=\"button-label\" className={styles.label}>\n {children}\n </span>\n );\n return size === 'l' ? (\n <Text {...shared}>{inner}</Text>\n ) : (\n <Subheadline level=\"2\" {...shared}>\n {inner}\n </Subheadline>\n );\n}\n\nexport function Button({\n ref,\n Component = 'button',\n mode = 'filled',\n size = 'm',\n stretched = false,\n loading = false,\n type,\n before,\n after,\n children,\n className,\n ...rest\n}: ButtonProps) {\n const { platform } = useTgui();\n\n return (\n <Tappable\n ref={ref}\n Component={Component}\n type={Component === 'button' ? (type ?? 'button') : type}\n data-slot=\"button\"\n data-loading={loading || undefined}\n aria-busy={loading || undefined}\n className={cn(button({ mode, size, stretched, platform }), className)}\n {...rest}\n >\n {loading ? (\n <Spinner size=\"s\" data-slot=\"button-spinner\" className={styles.spinner} aria-hidden />\n ) : null}\n {before ? (\n <span data-slot=\"button-before\" className={styles.before}>\n {before}\n </span>\n ) : null}\n <Label size={size}>{children}</Label>\n {after ? (\n <span data-slot=\"button-after\" className={styles.after}>\n {after}\n </span>\n ) : null}\n </Tappable>\n );\n}\n\nButton.displayName = 'Button';\n",".callout {\n font-size: var(--tgui--font-callout-size);\n line-height: var(--tgui--font-callout-line);\n letter-spacing: var(--tgui--font-callout-tracking);\n}\n","import type { Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Typography, type TypographyProps } from '../Typography';\nimport styles from './Callout.module.css';\n\nexport interface CalloutProps extends TypographyProps {\n ref?: Ref<HTMLElement>;\n}\n\nexport function Callout({ ref, className, Component = 'span', ...rest }: CalloutProps) {\n return (\n <Typography\n data-slot=\"callout\"\n ref={ref}\n Component={Component}\n className={cn(styles.callout, className)}\n {...rest}\n />\n );\n}\n\nCallout.displayName = 'Callout';\n",".level-1 {\n font-size: var(--tgui--font-caption-1-size);\n line-height: var(--tgui--font-caption-1-line);\n letter-spacing: var(--tgui--font-caption-1-tracking);\n}\n\n.level-2 {\n font-size: var(--tgui--font-caption-2-size);\n line-height: var(--tgui--font-caption-2-line);\n letter-spacing: var(--tgui--font-caption-2-tracking);\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Caption.module.css';\n\nexport type CaptionLevel = '1' | '2';\n\nexport const caption = cva('', {\n variants: {\n level: {\n '1': styles['level-1'],\n '2': styles['level-2'],\n },\n },\n defaultVariants: { level: '1' },\n});\n","import type { Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Typography, type TypographyProps } from '../Typography';\nimport { type CaptionLevel, caption } from './Caption.variants';\n\nexport interface CaptionProps extends TypographyProps {\n ref?: Ref<HTMLElement>;\n level?: CaptionLevel;\n}\n\nexport function Caption({ ref, level, Component = 'span', className, ...rest }: CaptionProps) {\n return (\n <Typography\n data-slot=\"caption\"\n ref={ref}\n Component={Component}\n className={cn(caption({ level }), className)}\n {...rest}\n />\n );\n}\n\nCaption.displayName = 'Caption';\n","import { createContext } from 'react';\n\nexport type CardType = 'plain' | 'ambient';\n\nexport const CardContext = createContext<{ type: CardType }>({ type: 'plain' });\n",".card {\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n border-radius: 20px;\n background: var(--tgui--surface-bg);\n box-shadow:\n 0 32px 64px 0 rgba(0, 0, 0, 0.04),\n 0 0 2px 1px rgba(0, 0, 0, 0.02);\n}\n\n.card > * {\n flex-shrink: 0;\n}\n\n.cardAmbient {\n background: var(--tgui--black);\n}\n\n.cell {\n padding: 0 20px;\n background: var(--tgui--surface-bg);\n}\n\n.cellAmbient {\n --tgui--cell-middle-padding: 12px 0;\n\n position: absolute;\n inset: auto 0 0 0;\n padding-top: 64px;\n padding-bottom: 4px;\n background: linear-gradient(\n 180deg,\n rgba(0, 0, 0, 0) 0%,\n rgba(0, 0, 0, 0.12) 22%,\n rgba(0, 0, 0, 0.55) 62%,\n rgba(0, 0, 0, 0.85) 100%\n );\n color: var(--tgui--white);\n}\n\n.cellHeader {\n font-weight: var(--tgui--weight-semibold);\n}\n\n.cellSubtitle {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n\n.cellAmbient .cellHeader {\n color: var(--tgui--white);\n}\n\n.cellAmbient .cellSubtitle {\n color: rgba(255, 255, 255, 0.8);\n}\n",".cell {\n --tgui--cell-middle-padding: 16px 0;\n\n display: flex;\n align-items: center;\n gap: 24px;\n padding: 0 24px;\n}\n\n.before,\n.after {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.middle {\n flex-grow: 1;\n min-inline-size: 0;\n max-inline-size: 100%;\n padding: var(--tgui--cell-middle-padding);\n\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.middle > *,\n.title {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.multiline .middle > *,\n.multiline .title {\n white-space: normal;\n}\n\n.head {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n\n.subhead {\n color: var(--tgui--label-secondary);\n}\n\n.hint,\n.subtitle,\n.description {\n color: var(--tgui--label-secondary);\n}\n\n/* row press / hover highlight – a clear tint, distinct from the grouped canvas */\n.cell {\n --tgui--cell-highlight: var(--tgui--fill);\n}\n\n@supports (color: color-mix(in srgb, red 10%, transparent)) {\n .cell {\n --tgui--cell-highlight: color-mix(in srgb, var(--tgui--label) 9%, transparent);\n }\n}\n\n.hovered,\n.interactive:not([data-disabled]):active {\n background: var(--tgui--cell-highlight);\n}\n\n/* inset – a row is flush to the card edge, an outset ring would be clipped */\n.interactive:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: calc(-1 * var(--tgui--focus-ring-offset));\n}\n\n.ios {\n --tgui--cell-middle-padding: 12px 0;\n gap: 16px;\n padding: 0 16px;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .interactive:not([data-disabled]):hover {\n background: var(--tgui--cell-highlight);\n }\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Cell.module.css';\n\nexport const cell = cva(styles.cell, {\n variants: {\n platform: { ios: styles.ios, base: null },\n hovered: { true: styles.hovered },\n interactive: { true: styles.interactive },\n multiline: { true: styles.multiline },\n },\n});\n","'use client';\n\nimport type { ElementType, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Caption } from '../Caption';\nimport { Subheadline } from '../Subheadline';\nimport { Tappable, type TappableProps } from '../Tappable';\nimport { Text } from '../Text';\nimport { useTgui } from '../TguiProvider';\nimport styles from './Cell.module.css';\nimport { cell } from './Cell.variants';\n\nexport interface CellProps extends Omit<TappableProps, 'Component'> {\n ref?: Ref<HTMLElement>;\n Component?: ElementType;\n subhead?: ReactNode;\n hint?: ReactNode;\n titleBadge?: ReactNode;\n subtitle?: ReactNode;\n description?: ReactNode;\n before?: ReactNode;\n after?: ReactNode;\n hovered?: boolean;\n multiline?: boolean;\n}\n\n// a row is not a document section: text slots render as spans\nfunction CellTitle({ ios, children }: { ios: boolean; children: ReactNode }) {\n return ios ? (\n <Text Component=\"span\" className={styles.head}>\n {children}\n </Text>\n ) : (\n <Subheadline Component=\"span\" level=\"1\" className={styles.head}>\n {children}\n </Subheadline>\n );\n}\n\nfunction CellDescription({ ios, children }: { ios: boolean; children: ReactNode }) {\n return ios ? (\n <Caption Component=\"span\" className={styles.description}>\n {children}\n </Caption>\n ) : (\n <Subheadline Component=\"span\" level=\"2\" className={styles.description}>\n {children}\n </Subheadline>\n );\n}\n\nexport function Cell({\n ref,\n Component = 'div',\n subhead,\n children,\n hint,\n titleBadge,\n subtitle,\n description,\n before,\n after,\n hovered,\n multiline,\n className,\n ...rest\n}: CellProps) {\n const { platform } = useTgui();\n const ios = platform === 'ios';\n const hasTitle = children != null || hint != null || titleBadge != null;\n const interactive =\n rest.onClick != null ||\n rest.href != null ||\n Component === 'a' ||\n Component === 'button' ||\n Component === 'label';\n\n return (\n <Tappable\n ref={ref}\n Component={Component}\n // a list row highlights its background – it never dims like a button\n interactiveAnimation={ios ? 'none' : 'background'}\n data-slot=\"cell\"\n className={cn(cell({ platform, hovered, multiline, interactive }), className)}\n {...rest}\n >\n {before != null ? (\n <div data-slot=\"cell-before\" className={styles.before}>\n {before}\n </div>\n ) : null}\n\n <div data-slot=\"cell-content\" className={styles.middle}>\n {subhead != null ? (\n <Subheadline Component=\"span\" level=\"2\" className={styles.subhead}>\n {subhead}\n </Subheadline>\n ) : null}\n\n {hasTitle ? (\n <CellTitle ios={ios}>\n {children != null ? <span className={styles.title}>{children}</span> : null}\n {hint != null ? <span className={styles.hint}>{hint}</span> : null}\n {titleBadge}\n </CellTitle>\n ) : null}\n\n {subtitle != null ? (\n <Subheadline Component=\"span\" level=\"2\" className={styles.subtitle}>\n {subtitle}\n </Subheadline>\n ) : null}\n\n {description != null ? <CellDescription ios={ios}>{description}</CellDescription> : null}\n </div>\n\n {after != null ? (\n <div data-slot=\"cell-after\" className={styles.after}>\n {after}\n </div>\n ) : null}\n </Tappable>\n );\n}\n\nCell.displayName = 'Cell';\n","'use client';\n\nimport { type Ref, useContext } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Cell, type CellProps } from '../Cell';\nimport { CardContext } from './Card.context';\nimport styles from './Card.module.css';\n\nexport interface CardCellProps extends CellProps {\n ref?: Ref<HTMLElement>;\n}\n\nexport function CardCell({ ref, children, subtitle, className, ...rest }: CardCellProps) {\n const { type } = useContext(CardContext);\n const ambient = type === 'ambient';\n\n return (\n <Cell\n ref={ref}\n data-slot=\"card-cell\"\n className={cn(styles.cell, ambient && styles.cellAmbient, className)}\n subtitle={\n subtitle != null ? (\n <span data-slot=\"card-cell-subtitle\" className={styles.cellSubtitle}>\n {subtitle}\n </span>\n ) : undefined\n }\n {...rest}\n >\n {children != null ? (\n <span data-slot=\"card-cell-title\" className={styles.cellHeader}>\n {children}\n </span>\n ) : null}\n </Cell>\n );\n}\n\nCardCell.displayName = 'CardCell';\n","'use client';\n\nimport { type HTMLAttributes, type Ref, useMemo } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { CardContext, type CardType } from './Card.context';\nimport styles from './Card.module.css';\nimport { CardCell } from './CardCell';\n\nexport interface CardProps extends HTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n type?: CardType;\n}\n\nexport function Card({ ref, type = 'plain', className, children, ...rest }: CardProps) {\n const context = useMemo(() => ({ type }), [type]);\n\n return (\n <CardContext.Provider value={context}>\n <article\n ref={ref}\n data-slot=\"card\"\n data-type={type}\n className={cn(styles.card, type === 'ambient' && styles.cardAmbient, className)}\n {...rest}\n >\n {children}\n </article>\n </CardContext.Provider>\n );\n}\n\nCard.displayName = 'Card';\nCard.Cell = CardCell;\n",".checkbox {\n position: relative;\n display: inline-flex;\n cursor: pointer;\n}\n\n.checkbox[data-disabled] {\n cursor: default;\n opacity: 0.3;\n}\n\n.input {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n opacity: 0;\n cursor: inherit;\n}\n\n.box {\n position: relative;\n width: 20px;\n height: 20px;\n border-radius: 6px;\n box-shadow: inset 0 0 0 2px var(--tgui--separator);\n pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .box {\n transition:\n box-shadow 0.15s ease-out,\n background 0.15s ease-out;\n }\n}\n\n.input:checked + .box,\n.input:indeterminate + .box {\n background: var(--tgui--link);\n box-shadow: none;\n}\n\n.input:focus-visible + .box {\n box-shadow: var(--tgui--focus-ring-shadow);\n}\n\n.input:checked + .box::after {\n content: \"\";\n position: absolute;\n left: 7px;\n top: 3px;\n width: 5px;\n height: 9px;\n border: solid var(--tgui--accent-label);\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n}\n\n.input:indeterminate + .box::after {\n content: \"\";\n position: absolute;\n left: 4px;\n top: 9px;\n width: 12px;\n height: 2px;\n background: var(--tgui--accent-label);\n}\n","import { type ChangeEvent, type InputHTMLAttributes, type Ref, useEffect, useRef } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic } from '../TguiProvider';\nimport styles from './Checkbox.module.css';\n\nexport interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement> {\n ref?: Ref<HTMLInputElement>;\n indeterminate?: boolean;\n}\n\nexport function Checkbox({\n ref,\n indeterminate = false,\n disabled,\n className,\n style,\n onChange,\n ...rest\n}: CheckboxProps) {\n const inner = useRef<HTMLInputElement>(null);\n const haptic = useHaptic();\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n haptic('select');\n onChange?.(event);\n };\n\n useEffect(() => {\n if (inner.current) inner.current.indeterminate = indeterminate;\n }, [indeterminate]);\n\n const mergeRef = (node: HTMLInputElement | null) => {\n inner.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n };\n\n return (\n <span\n data-slot=\"checkbox\"\n className={cn(styles.checkbox, className)}\n style={style}\n data-disabled={disabled || undefined}\n >\n <input\n ref={mergeRef}\n type=\"checkbox\"\n data-slot=\"checkbox-input\"\n className={styles.input}\n disabled={disabled}\n onChange={handleChange}\n {...rest}\n />\n <span className={styles.box} data-slot=\"checkbox-indicator\" aria-hidden />\n </span>\n );\n}\n\nCheckbox.displayName = 'Checkbox';\n",".chip {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n box-sizing: border-box;\n min-height: 32px;\n padding: 4px 12px;\n border: 0;\n border-radius: 16px;\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 14px;\n line-height: 18px;\n}\n\n.mode-elevated {\n background: var(--tgui--fill);\n box-shadow: 0 1px 4px rgb(0 0 0 / 0.1);\n}\n\n.mode-outline {\n background: transparent;\n box-shadow: inset 0 0 0 1px var(--tgui--separator);\n}\n\n.clickable {\n cursor: pointer;\n user-select: none;\n}\n\n.clickable:focus-visible,\n.remove:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .clickable:not([data-disabled]):hover {\n opacity: 0.85;\n }\n}\n\n.before,\n.after {\n display: inline-flex;\n align-items: center;\n margin-inline-start: -2px;\n}\n\n.after {\n margin-inline-start: 0;\n margin-inline-end: -4px;\n}\n\n.label {\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.remove {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 18px;\n height: 18px;\n margin-inline-end: -4px;\n padding: 0;\n border: 0;\n border-radius: 50%;\n color: var(--tgui--label-tertiary);\n background: transparent;\n cursor: pointer;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .remove:hover {\n opacity: 0.6;\n }\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Chip.module.css';\n\nexport type ChipMode = 'elevated' | 'outline';\n\nexport const chip = cva(styles.chip, {\n variants: {\n mode: {\n elevated: styles['mode-elevated'],\n outline: styles['mode-outline'],\n },\n clickable: { true: styles.clickable },\n },\n defaultVariants: { mode: 'elevated' },\n});\n","import type { AllHTMLAttributes, ElementType, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic } from '../TguiProvider';\nimport styles from './Chip.module.css';\nimport { type ChipMode, chip } from './Chip.variants';\n\nexport type { ChipMode };\n\nexport interface ChipProps extends Omit<AllHTMLAttributes<HTMLElement>, 'onClick'> {\n ref?: Ref<HTMLElement>;\n Component?: ElementType;\n mode?: ChipMode;\n before?: ReactNode;\n after?: ReactNode;\n onClick?: () => void;\n onRemove?: () => void;\n removeLabel?: string;\n}\n\nexport function Chip({\n ref,\n Component = 'div',\n mode = 'elevated',\n before,\n after,\n onClick,\n onRemove,\n removeLabel = 'Remove',\n className,\n children,\n ...rest\n}: ChipProps) {\n const clickable = onClick != null;\n const haptic = useHaptic();\n\n return (\n <Component\n ref={ref}\n data-slot=\"chip\"\n className={cn(chip({ mode, clickable }), className)}\n onClick={\n onClick == null\n ? undefined\n : () => {\n haptic('tap');\n onClick();\n }\n }\n {...rest}\n >\n {before != null ? (\n <span data-slot=\"chip-before\" className={styles.before}>\n {before}\n </span>\n ) : null}\n <span data-slot=\"chip-label\" className={styles.label}>\n {children}\n </span>\n {onRemove != null ? (\n <button\n type=\"button\"\n data-slot=\"chip-remove\"\n className={styles.remove}\n aria-label={removeLabel}\n onClick={(event) => {\n event.stopPropagation();\n haptic('tap');\n onRemove();\n }}\n >\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" aria-hidden>\n <path\n d=\"M3 3l6 6M9 3l-6 6\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n </button>\n ) : after != null ? (\n <span data-slot=\"chip-after\" className={styles.after}>\n {after}\n </span>\n ) : null}\n </Component>\n );\n}\n\nChip.displayName = 'Chip';\n",".root {\n display: inline-flex;\n color: var(--tgui--link);\n}\n\n.svg {\n display: block;\n}\n\n.track {\n stroke: var(--tgui--fill);\n}\n\n.indicator {\n stroke: currentColor;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .indicator {\n transition: stroke-dashoffset 0.25s ease;\n }\n}\n","export type CircularProgressSize = 's' | 'm' | 'l';\n\nexport const DIMENSION: Record<CircularProgressSize, number> = { s: 20, m: 28, l: 36 };\nexport const STROKE: Record<CircularProgressSize, number> = { s: 2, m: 2.5, l: 3 };\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './CircularProgress.module.css';\nimport { type CircularProgressSize, DIMENSION, STROKE } from './CircularProgress.variants';\n\nexport type { CircularProgressSize };\n\nexport interface CircularProgressProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'size'> {\n ref?: Ref<HTMLSpanElement>;\n value?: number;\n size?: CircularProgressSize;\n}\n\nexport function CircularProgress({\n ref,\n value = 0,\n size = 'm',\n className,\n 'aria-label': ariaLabel,\n ...rest\n}: CircularProgressProps) {\n const clamped = Math.max(0, Math.min(100, value));\n const dimension = DIMENSION[size];\n const stroke = STROKE[size];\n const radius = (dimension - stroke) / 2;\n const circumference = 2 * Math.PI * radius;\n const center = dimension / 2;\n\n return (\n <span\n ref={ref}\n role=\"progressbar\"\n aria-label={ariaLabel ?? 'Progress'}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={Math.round(clamped)}\n data-slot=\"circular-progress\"\n className={cn(styles.root, className)}\n {...rest}\n >\n <svg\n className={styles.svg}\n width={dimension}\n height={dimension}\n viewBox={`0 0 ${dimension} ${dimension}`}\n aria-hidden\n >\n <circle\n className={styles.track}\n cx={center}\n cy={center}\n r={radius}\n strokeWidth={stroke}\n fill=\"none\"\n />\n <circle\n className={styles.indicator}\n cx={center}\n cy={center}\n r={radius}\n strokeWidth={stroke}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={circumference * (1 - clamped / 100)}\n fill=\"none\"\n />\n </svg>\n </span>\n );\n}\n\nCircularProgress.displayName = 'CircularProgress';\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/primitive.tsx\nvar canUseDOM = !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return /* @__PURE__ */ __name(function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n }, \"handleEvent\");\n}\n__name(composeEventHandlers, \"composeEventHandlers\");\nfunction getOwnerWindow(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access window outside of the DOM\");\n }\n return element?.ownerDocument?.defaultView ?? window;\n}\n__name(getOwnerWindow, \"getOwnerWindow\");\nfunction getOwnerDocument(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access document outside of the DOM\");\n }\n return element?.ownerDocument ?? document;\n}\n__name(getOwnerDocument, \"getOwnerDocument\");\nfunction getActiveElement(node, activeDescendant = false) {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n return null;\n }\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\n if (activeDescendant) {\n const id = activeElement.getAttribute(\"aria-activedescendant\");\n if (id) {\n const element = getOwnerDocument(activeElement).getElementById(id);\n if (element) {\n return element;\n }\n }\n }\n return activeElement;\n}\n__name(getActiveElement, \"getActiveElement\");\nfunction isFrame(element) {\n return element.tagName === \"IFRAME\";\n}\n__name(isFrame, \"isFrame\");\nexport {\n canUseDOM,\n composeEventHandlers,\n getActiveElement,\n getOwnerDocument,\n getOwnerWindow,\n isFrame\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\n__name(setRef, \"setRef\");\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n__name(composeRefs, \"composeRefs\");\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\n__name(useComposedRefs, \"useComposedRefs\");\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/slot.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n let slottableElement = null;\n let hasSlottable = false;\n const newChildren = [];\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n React.Children.forEach(children, (maybeSlottable) => {\n if (isSlottable(maybeSlottable)) {\n hasSlottable = true;\n const slottable = maybeSlottable;\n let child = \"child\" in slottable.props ? slottable.props.child : slottable.props.children;\n if (isLazyComponent(child) && typeof use === \"function\") {\n child = use(child._payload);\n }\n slottableElement = getSlottableElementFromSlottable(slottable, child);\n newChildren.push(slottableElement?.props?.children);\n } else {\n newChildren.push(maybeSlottable);\n }\n });\n if (slottableElement) {\n slottableElement = React.cloneElement(slottableElement, void 0, newChildren);\n } else if (\n // A `Slottable` was found but it didn't resolve to a single element (e.g.\n // it wrapped multiple elements, text, or a render-prop `child` that\n // wasn't an element). Don't fall back to treating the `Slottable` wrapper\n // itself as the slot target — throw a descriptive error below instead.\n !hasSlottable && React.Children.count(children) === 1 && React.isValidElement(children)\n ) {\n slottableElement = children;\n }\n const slottableElementRef = slottableElement ? getElementRef(slottableElement) : void 0;\n const composedRef = useComposedRefs(forwardedRef, slottableElementRef);\n if (!slottableElement) {\n if (children || children === 0) {\n throw new Error(\n hasSlottable ? createSlottableError(ownerName) : createSlotError(ownerName)\n );\n }\n return children;\n }\n const mergedProps = mergeProps(slotProps, slottableElement.props ?? {});\n if (slottableElement.type !== React.Fragment) {\n mergedProps.ref = forwardedRef ? composedRef : slottableElementRef;\n }\n return React.cloneElement(slottableElement, mergedProps);\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\n__name(createSlot, \"createSlot\");\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\nvar SLOTTABLE_IDENTIFIER = Symbol.for(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = /* @__PURE__ */ __name((props) => \"child\" in props ? props.children(props.child) : props.children, \"Slottable\");\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\n__name(createSlottable, \"createSlottable\");\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nvar getSlottableElementFromSlottable = /* @__PURE__ */ __name((slottable, child) => {\n if (\"child\" in slottable.props) {\n const child2 = slottable.props.child;\n if (!React.isValidElement(child2)) return null;\n return React.cloneElement(child2, void 0, slottable.props.children(child2.props.children));\n }\n return React.isValidElement(child) ? child : null;\n}, \"getSlottableElementFromSlottable\");\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\n__name(mergeProps, \"mergeProps\");\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\n__name(getElementRef, \"getElementRef\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\n__name(isSlottable, \"isSlottable\");\nvar REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nfunction isLazyComponent(element) {\n return element != null && typeof element === \"object\" && \"$$typeof\" in element && element.$$typeof === REACT_LAZY_TYPE && \"_payload\" in element && isPromiseLike(element._payload);\n}\n__name(isLazyComponent, \"isLazyComponent\");\nfunction isPromiseLike(value) {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\n__name(isPromiseLike, \"isPromiseLike\");\nvar createSlotError = /* @__PURE__ */ __name((ownerName) => {\n return `${ownerName} failed to slot onto its children. Expected a single React element child or \\`Slottable\\`.`;\n}, \"createSlotError\");\nvar createSlottableError = /* @__PURE__ */ __name((ownerName) => {\n return `${ownerName} failed to slot onto its \\`Slottable\\`. Expected \\`Slottable\\` to receive a single React element child.`;\n}, \"createSlottableError\");\nvar use = React[\" use \".trim().toString()];\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n__name(dispatchDiscreteCustomEvent, \"dispatchDiscreteCustomEvent\");\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/use-callback-ref.tsx\nimport * as React from \"react\";\nfunction useCallbackRef(callback) {\n const callbackRef = React.useRef(callback);\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n return React.useMemo(() => ((...args) => callbackRef.current?.(...args)), []);\n}\n__name(useCallbackRef, \"useCallbackRef\");\nexport {\n useCallbackRef\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/dismissable-layer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { jsx } from \"react/jsx-runtime\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set(),\n // Outside elements that belong to a layer's own dismiss affordance (eg, a\n // dialog overlay). Pressing them should dismiss the layer regardless of\n // whether or not they stop propagation.\n //\n // See https://github.com/radix-ui/primitives/issues/3346\n dismissableSurfaces: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = /* @__PURE__ */ React.forwardRef(\n // blank line to reduce diff noise\n /* @__PURE__ */ __name(function DismissableLayer2(props, forwardedRef) {\n const {\n disableOutsidePointerEvents = false,\n deferPointerDownOutside = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, setNode);\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [\n ...context.layersWithOutsidePointerEventsDisabled\n ].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = highestLayerWithOutsidePointerEventsDisabled ? layers.indexOf(highestLayerWithOutsidePointerEventsDisabled) : -1;\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const isDeferredPointerDownOutsideRef = React.useRef(false);\n const pointerDownOutside = usePointerDownOutside(\n (event) => {\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n },\n {\n ownerDocument,\n deferPointerDownOutside,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces: context.dismissableSurfaces,\n shouldHandlePointerDownOutside: React.useCallback(\n (target) => {\n if (!(target instanceof Node)) {\n return false;\n }\n const isPointerDownOnBranch = [...context.branches].some(\n (branch) => branch.contains(target)\n );\n return isPointerEventsEnabled && !isPointerDownOnBranch;\n },\n [context.branches, isPointerEventsEnabled]\n )\n }\n );\n const focusOutside = useFocusOutside((event) => {\n if (deferPointerDownOutside && isDeferredPointerDownOutsideRef.current) {\n return;\n }\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const isHighestLayer = node ? index === layers.length - 1 : false;\n const handleKeyDown = useCallbackRef((event) => {\n if (event.key !== \"Escape\") {\n return;\n }\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n });\n React.useEffect(() => {\n if (!isHighestLayer) {\n return;\n }\n ownerDocument.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => ownerDocument.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n }, [ownerDocument, isHighestLayer, handleKeyDown]);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents) {\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = /* @__PURE__ */ __name(() => force({}), \"handleUpdate\");\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }, \"DismissableLayer\")\n);\nvar DismissableLayerBranch = /* @__PURE__ */ React.forwardRef(/* @__PURE__ */ __name(function DismissableLayerBranch2(props, forwardedRef) {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n}, \"DismissableLayerBranch\"));\nfunction useDismissableLayerSurface() {\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n React.useEffect(() => {\n if (!node) {\n return;\n }\n context.dismissableSurfaces.add(node);\n return () => {\n context.dismissableSurfaces.delete(node);\n };\n }, [node, context.dismissableSurfaces]);\n return setNode;\n}\n__name(useDismissableLayerSurface, \"useDismissableLayerSurface\");\nvar IS_TRUE = /* @__PURE__ */ __name(() => true, \"IS_TRUE\");\nfunction usePointerDownOutside(onPointerDownOutside, args) {\n const {\n ownerDocument = globalThis?.document,\n deferPointerDownOutside = false,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces,\n shouldHandlePointerDownOutside = IS_TRUE\n } = args;\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const isPointerDownOutsideRef = React.useRef(false);\n const interceptedOutsideInteractionEventsRef = React.useRef(/* @__PURE__ */ new Map());\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n function resetOutsideInteraction() {\n isPointerDownOutsideRef.current = false;\n isDeferredPointerDownOutsideRef.current = false;\n interceptedOutsideInteractionEventsRef.current.clear();\n }\n __name(resetOutsideInteraction, \"resetOutsideInteraction\");\n function isOutsideInteractionIntercepted() {\n return Array.from(interceptedOutsideInteractionEventsRef.current.values()).some(Boolean);\n }\n __name(isOutsideInteractionIntercepted, \"isOutsideInteractionIntercepted\");\n function handleInteractionCapture(event) {\n if (!isPointerDownOutsideRef.current) {\n return;\n }\n const target = event.target;\n const isDismissableSurface = target instanceof Node && [...dismissableSurfaces].some((surface) => surface.contains(target));\n if (!isDismissableSurface) {\n interceptedOutsideInteractionEventsRef.current.set(event.type, true);\n }\n if (event.type === \"click\") {\n window.setTimeout(() => {\n if (isPointerDownOutsideRef.current) {\n handleClickRef.current();\n }\n }, 0);\n }\n }\n __name(handleInteractionCapture, \"handleInteractionCapture\");\n function handleInteractionBubble(event) {\n if (isPointerDownOutsideRef.current) {\n interceptedOutsideInteractionEventsRef.current.set(event.type, false);\n }\n }\n __name(handleInteractionBubble, \"handleInteractionBubble\");\n const handlePointerDown = /* @__PURE__ */ __name((event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n const wasOutsideInteractionIntercepted = isOutsideInteractionIntercepted();\n resetOutsideInteraction();\n if (!wasOutsideInteractionIntercepted) {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n }\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n __name(handleAndDispatchPointerDownOutsideEvent2, \"handleAndDispatchPointerDownOutsideEvent\");\n if (!shouldHandlePointerDownOutside(event.target)) {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n resetOutsideInteraction();\n isPointerInsideReactTreeRef.current = false;\n return;\n }\n const eventDetail = { originalEvent: event };\n isPointerDownOutsideRef.current = true;\n isDeferredPointerDownOutsideRef.current = deferPointerDownOutside && event.button === 0;\n interceptedOutsideInteractionEventsRef.current.clear();\n if (!deferPointerDownOutside || event.button !== 0) {\n handleAndDispatchPointerDownOutsideEvent2();\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n resetOutsideInteraction();\n }\n isPointerInsideReactTreeRef.current = false;\n }, \"handlePointerDown\");\n const outsideInteractionEvents = [\n \"pointerup\",\n \"mousedown\",\n \"mouseup\",\n \"touchstart\",\n \"touchend\",\n \"click\"\n ];\n for (const eventName of outsideInteractionEvents) {\n ownerDocument.addEventListener(eventName, handleInteractionCapture, true);\n ownerDocument.addEventListener(eventName, handleInteractionBubble);\n }\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n for (const eventName of outsideInteractionEvents) {\n ownerDocument.removeEventListener(eventName, handleInteractionCapture, true);\n ownerDocument.removeEventListener(eventName, handleInteractionBubble);\n }\n };\n }, [\n ownerDocument,\n handlePointerDownOutside,\n deferPointerDownOutside,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces,\n shouldHandlePointerDownOutside\n ]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: /* @__PURE__ */ __name(() => isPointerInsideReactTreeRef.current = true, \"onPointerDownCapture\")\n };\n}\n__name(usePointerDownOutside, \"usePointerDownOutside\");\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = /* @__PURE__ */ __name((event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n }, \"handleFocus\");\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: /* @__PURE__ */ __name(() => isFocusInsideReactTreeRef.current = true, \"onFocusCapture\"),\n onBlurCapture: /* @__PURE__ */ __name(() => isFocusInsideReactTreeRef.current = false, \"onBlurCapture\")\n };\n}\n__name(useFocusOutside, \"useFocusOutside\");\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\n__name(dispatchUpdate, \"dispatchUpdate\");\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\n__name(handleAndDispatchCustomEvent, \"handleAndDispatchCustomEvent\");\nvar Root = DismissableLayer;\nvar Branch = DismissableLayerBranch;\nexport {\n Branch,\n DismissableLayer,\n DismissableLayerBranch,\n Root,\n useDismissableLayerSurface\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/focus-scope.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { jsx } from \"react/jsx-runtime\";\nvar AUTOFOCUS_ON_MOUNT = \"focusScope.autoFocusOnMount\";\nvar AUTOFOCUS_ON_UNMOUNT = \"focusScope.autoFocusOnUnmount\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar FocusScope = /* @__PURE__ */ React.forwardRef(\n /* @__PURE__ */ __name(function FocusScope2(props, forwardedRef) {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, setContainer);\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n }\n }).current;\n React.useEffect(() => {\n if (trapped) {\n let handleFocusIn2 = function(event) {\n if (focusScope.paused || !container) return;\n const target = event.target;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleFocusOut2 = function(event) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget;\n if (relatedTarget === null) return;\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleMutations2 = function(mutations) {\n const focusedElement = document.activeElement;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n };\n var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;\n __name(handleFocusIn2, \"handleFocusIn\");\n __name(handleFocusOut2, \"handleFocusOut\");\n __name(handleMutations2, \"handleMutations\");\n document.addEventListener(\"focusin\", handleFocusIn2);\n document.addEventListener(\"focusout\", handleFocusOut2);\n const mutationObserver = new MutationObserver(handleMutations2);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n return () => {\n document.removeEventListener(\"focusin\", handleFocusIn2);\n document.removeEventListener(\"focusout\", handleFocusOut2);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused]);\n React.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n setTimeout(() => {\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? document.body, { select: true });\n }\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n const handleKeyDown = React.useCallback(\n (event) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n const isTabKey = event.key === \"Tab\" && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement;\n if (isTabKey && focusedElement) {\n const container2 = event.currentTarget;\n const [first, last] = getTabbableEdges(container2);\n const hasTabbableElementsInside = first && last;\n if (!hasTabbableElementsInside) {\n if (focusedElement === container2) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused]\n );\n return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });\n }, \"FocusScope\")\n);\nfunction focusFirst(candidates, { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\n__name(focusFirst, \"focusFirst\");\nfunction getTabbableEdges(container) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last];\n}\n__name(getTabbableEdges, \"getTabbableEdges\");\nfunction getTabbableCandidates(container) {\n const nodes = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: /* @__PURE__ */ __name((node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }, \"acceptNode\")\n });\n while (walker.nextNode()) nodes.push(walker.currentNode);\n return nodes;\n}\n__name(getTabbableCandidates, \"getTabbableCandidates\");\nfunction findVisible(elements, container) {\n const canUseCheckVisibility = typeof container.checkVisibility === \"function\" && container.checkVisibility({ checkVisibilityCSS: true });\n for (const element of elements) {\n const hidden = canUseCheckVisibility ? !element.checkVisibility({ checkVisibilityCSS: true }) : isHidden(element, { upTo: container });\n if (!hidden) {\n return element;\n }\n }\n}\n__name(findVisible, \"findVisible\");\nfunction isHidden(node, { upTo }) {\n if (getComputedStyle(node).visibility === \"hidden\") return true;\n while (node) {\n if (upTo !== void 0 && node === upTo) return false;\n if (getComputedStyle(node).display === \"none\") return true;\n node = node.parentElement;\n }\n return false;\n}\n__name(isHidden, \"isHidden\");\nfunction isSelectableInput(element) {\n return element instanceof HTMLInputElement && \"select\" in element;\n}\n__name(isSelectableInput, \"isSelectableInput\");\nfunction focus(element, { select = false } = {}) {\n if (element && element.focus) {\n const previouslyFocusedElement = document.activeElement;\n element.focus({ preventScroll: true });\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\n__name(focus, \"focus\");\nvar focusScopesStack = createFocusScopesStack();\nfunction createFocusScopesStack() {\n let stack = [];\n return {\n add(focusScope) {\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n remove(focusScope) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n }\n };\n}\n__name(createFocusScopesStack, \"createFocusScopesStack\");\nfunction arrayRemove(array, item) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\n__name(arrayRemove, \"arrayRemove\");\nfunction removeLinks(items) {\n return items.filter((item) => item.tagName !== \"A\");\n}\n__name(removeLinks, \"removeLinks\");\nvar Root = FocusScope;\nexport {\n FocusScope,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","// src/use-layout-effect.tsx\nimport * as React from \"react\";\nvar useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {\n};\nexport {\n useLayoutEffect2 as useLayoutEffect\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/presence.tsx\nimport * as React2 from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\n\n// src/use-state-machine.tsx\nimport * as React from \"react\";\nfunction useStateMachine(initialState, machine) {\n return React.useReducer((state, event) => {\n const nextState = machine[state][event];\n return nextState ?? state;\n }, initialState);\n}\n__name(useStateMachine, \"useStateMachine\");\n\n// src/presence.tsx\nvar Presence = /* @__PURE__ */ __name((props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n const child = typeof children === \"function\" ? children({ present: presence.isPresent }) : React2.Children.only(children);\n const ref = useStableComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === \"function\";\n return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;\n}, \"Presence\");\nfunction usePresence(present) {\n const [node, setNode] = React2.useState();\n const stylesRef = React2.useRef(null);\n const prevPresentRef = React2.useRef(present);\n const prevAnimationNameRef = React2.useRef(\"none\");\n const mountAnimationNameRef = React2.useRef(void 0);\n const initialState = present ? \"mounted\" : \"unmounted\";\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: \"unmounted\",\n ANIMATION_OUT: \"unmountSuspended\"\n },\n unmountSuspended: {\n MOUNT: \"mounted\",\n ANIMATION_END: \"unmounted\"\n },\n unmounted: {\n MOUNT: \"mounted\"\n }\n });\n React2.useEffect(() => {\n if (state === \"mounted\") {\n prevAnimationNameRef.current = mountAnimationNameRef.current ?? getAnimationName(stylesRef.current);\n mountAnimationNameRef.current = void 0;\n } else {\n prevAnimationNameRef.current = \"none\";\n }\n }, [state]);\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n if (present) {\n mountAnimationNameRef.current = currentAnimationName;\n send(\"MOUNT\");\n } else if (currentAnimationName === \"none\" || styles?.display === \"none\") {\n send(\"UNMOUNT\");\n } else {\n const isAnimating = prevAnimationName !== currentAnimationName;\n if (wasPresent && isAnimating) {\n send(\"ANIMATION_OUT\");\n } else {\n send(\"UNMOUNT\");\n }\n }\n prevPresentRef.current = present;\n }\n }, [present, send]);\n useLayoutEffect(() => {\n if (node) {\n let timeoutId;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n const handleAnimationEnd = /* @__PURE__ */ __name((event) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));\n if (event.target === node && isCurrentAnimation) {\n send(\"ANIMATION_END\");\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = \"forwards\";\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === \"forwards\") {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n }, \"handleAnimationEnd\");\n const handleAnimationStart = /* @__PURE__ */ __name((event) => {\n if (event.target === node) {\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n }, \"handleAnimationStart\");\n node.addEventListener(\"animationstart\", handleAnimationStart);\n node.addEventListener(\"animationcancel\", handleAnimationEnd);\n node.addEventListener(\"animationend\", handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener(\"animationstart\", handleAnimationStart);\n node.removeEventListener(\"animationcancel\", handleAnimationEnd);\n node.removeEventListener(\"animationend\", handleAnimationEnd);\n };\n } else {\n send(\"ANIMATION_END\");\n }\n }, [node, send]);\n return {\n isPresent: [\"mounted\", \"unmountSuspended\"].includes(state),\n ref: React2.useCallback((node2) => {\n if (node2) {\n const styles = getComputedStyle(node2);\n stylesRef.current = styles;\n mountAnimationNameRef.current = getAnimationName(styles);\n } else {\n stylesRef.current = null;\n }\n setNode(node2);\n }, [])\n };\n}\n__name(usePresence, \"usePresence\");\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\n__name(setRef, \"setRef\");\nfunction useStableComposedRefs(...refs) {\n const refsRef = React2.useRef(refs);\n refsRef.current = refs;\n return React2.useCallback((node) => {\n const currentRefs = refsRef.current;\n let hasCleanup = false;\n const cleanups = currentRefs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup === \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup === \"function\") {\n cleanup();\n } else {\n setRef(currentRefs[i], null);\n }\n }\n };\n }\n }, []);\n}\n__name(useStableComposedRefs, \"useStableComposedRefs\");\nfunction getAnimationName(styles) {\n return styles?.animationName || \"none\";\n}\n__name(getAnimationName, \"getAnimationName\");\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\n__name(getElementRef, \"getElementRef\");\nvar Root = Presence;\nexport {\n Presence,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { createPortal } from 'react-dom';\nimport { useTgui } from '../TguiProvider';\n\nexport interface PortalProps {\n children?: ReactNode;\n container?: Element | DocumentFragment | null;\n}\n\nexport function Portal({ children, container }: PortalProps) {\n const { portalContainer } = useTgui();\n const target = container ?? portalContainer;\n if (!target) return null;\n return createPortal(children, target);\n}\n\nPortal.displayName = 'Portal';\n",".overlay {\n position: fixed;\n inset: 0;\n z-index: var(--tgui--z-overlay);\n display: grid;\n place-items: center;\n padding: 24px;\n background: rgb(0 0 0 / 0.4);\n}\n\n.content {\n width: 100%;\n max-width: 270px;\n overflow: hidden;\n border-radius: var(--tgui--radius-lg);\n background: var(--tgui--surface-bg);\n color: var(--tgui--label);\n box-shadow: var(--tgui--overlay-shadow);\n transform-origin: center;\n}\n\n/* the element is visible at rest; the animations only ferry it in and out,\n so a paused/skipped animation can never leave the dialog invisible */\n@media (prefers-reduced-motion: no-preference) {\n .overlay[data-state=\"open\"] {\n animation: dialog-overlay-in var(--tgui--duration-overlay) ease;\n }\n\n .overlay[data-state=\"closed\"] {\n animation: dialog-overlay-out var(--tgui--duration-overlay) ease forwards;\n }\n\n .content[data-state=\"open\"] {\n animation: dialog-in var(--tgui--duration-overlay) var(--tgui--ease-spring);\n }\n\n .content[data-state=\"closed\"] {\n animation: dialog-out var(--tgui--duration-overlay) var(--tgui--ease-in) forwards;\n }\n}\n\n@keyframes dialog-overlay-in {\n from {\n opacity: 0;\n }\n}\n\n@keyframes dialog-overlay-out {\n to {\n opacity: 0;\n }\n}\n\n@keyframes dialog-in {\n from {\n opacity: 0;\n transform: scale(0.96);\n }\n}\n\n@keyframes dialog-out {\n to {\n opacity: 0;\n transform: scale(0.96);\n }\n}\n\n.body {\n padding: 20px 16px 16px;\n text-align: center;\n}\n\n.title {\n margin: 0;\n font-family: var(--tgui--font-family);\n font-size: 17px;\n font-weight: var(--tgui--weight-semibold);\n line-height: 22px;\n}\n\n.description {\n margin: 4px 0 0;\n font-family: var(--tgui--font-family);\n font-size: 13px;\n line-height: 18px;\n color: var(--tgui--label-secondary);\n}\n\n.actions {\n display: flex;\n border-top: var(--tgui--hairline) solid var(--tgui--separator);\n}\n\n.actions[data-layout=\"stacked\"] {\n flex-direction: column;\n}\n\n.action {\n flex: 1 1 0;\n min-width: 0;\n padding: 11px 12px;\n border: 0;\n background: transparent;\n color: var(--tgui--link-strong);\n font-family: var(--tgui--font-family);\n font-size: 17px;\n font-weight: var(--tgui--weight-regular);\n line-height: 22px;\n cursor: pointer;\n}\n\n.action[data-default=\"true\"] {\n font-weight: var(--tgui--weight-semibold);\n}\n\n.action[data-role=\"destructive\"] {\n color: var(--tgui--destructive-strong);\n}\n\n.actions:not([data-layout=\"stacked\"]) .action + .action {\n border-inline-start: var(--tgui--hairline) solid var(--tgui--separator);\n}\n\n.actions[data-layout=\"stacked\"] .action + .action {\n border-top: var(--tgui--hairline) solid var(--tgui--separator);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .action:hover {\n background: var(--tgui--fill);\n }\n}\n\n.action:active {\n background: var(--tgui--fill);\n}\n\n.action:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: calc(-1 * var(--tgui--focus-ring-offset));\n}\n","'use client';\n\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { Presence } from '@radix-ui/react-presence';\nimport { type KeyboardEvent as ReactKeyboardEvent, type ReactNode, useEffect, useId } from 'react';\nimport { getTelegramWebApp, isTelegramVersionAtLeast } from '../../shared/lib/telegram';\nimport type { PopupButton } from '../../shared/types/telegram';\nimport { Portal } from '../Portal';\nimport styles from './Dialog.module.css';\n\nexport type DialogActionRole = 'default' | 'cancel' | 'destructive';\n\nexport interface DialogAction {\n label: ReactNode;\n onClick?: () => void;\n role?: DialogActionRole;\n}\n\nexport interface DialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: ReactNode;\n description?: ReactNode;\n actions: DialogAction[];\n cancelLabel?: string;\n container?: Element | DocumentFragment | null;\n}\n\n// a destructive alert always offers a way out; add one if the caller didn't\nfunction withCancel(actions: DialogAction[], cancelLabel: string): DialogAction[] {\n const hasCancel = actions.some((a) => a.role === 'cancel');\n const hasDestructive = actions.some((a) => a.role === 'destructive');\n if (hasCancel || !hasDestructive) return actions.slice(0, 3);\n return [...actions.slice(0, 2), { label: cancelLabel, role: 'cancel' }];\n}\n\n// the Telegram native popup fits only plain-string, length-bounded content\nfunction toNativePopup(\n title: ReactNode,\n description: ReactNode,\n actions: DialogAction[],\n): { title?: string; message: string; buttons: PopupButton[] } | null {\n if (!isTelegramVersionAtLeast('6.2')) return null;\n const heading = typeof title === 'string' ? title : null;\n const body = typeof description === 'string' ? description : null;\n const message = body ?? heading;\n if (message == null || message.length < 1 || message.length > 256) return null;\n if (heading != null && (body == null || heading.length > 64)) {\n // no room for both, or title too long → render ours\n if (body == null && heading.length <= 256) {\n // title-only: send it as the message\n } else {\n return null;\n }\n }\n const buttons: PopupButton[] = [];\n for (const [index, action] of actions.entries()) {\n if (action.role === 'cancel') {\n buttons.push({ id: String(index), type: 'cancel' });\n continue;\n }\n if (typeof action.label !== 'string' || action.label.length < 1 || action.label.length > 64) {\n return null;\n }\n buttons.push({\n id: String(index),\n type: action.role === 'destructive' ? 'destructive' : 'default',\n text: action.label,\n });\n }\n return {\n title: body != null ? (heading ?? undefined) : undefined,\n message: body ?? (heading as string),\n buttons: buttons.slice(0, 3),\n };\n}\n\nexport function Dialog({\n open,\n onOpenChange,\n title,\n description,\n actions,\n cancelLabel = 'Cancel',\n container,\n}: DialogProps) {\n const titleId = useId();\n const descId = useId();\n const resolved = withCancel(actions, cancelLabel);\n const defaultIndex = resolved.findIndex((a) => a.role === 'default' || a.role == null);\n const cancelIndex = resolved.findIndex((a) => a.role === 'cancel');\n const stacked = resolved.length > 2;\n const native = toNativePopup(title, description, resolved);\n\n const run = (action: DialogAction) => {\n action.onClick?.();\n onOpenChange(false);\n };\n\n // inside a recent Telegram client this is a real UIAlertController / native dialog\n // biome-ignore lint/correctness/useExhaustiveDependencies: fire once per open transition\n useEffect(() => {\n if (!open || native == null) return;\n const webApp = getTelegramWebApp();\n if (webApp == null) return;\n webApp.showPopup(native, (buttonId) => {\n const index = Number(buttonId);\n if (Number.isInteger(index)) resolved[index]?.onClick?.();\n onOpenChange(false);\n });\n }, [open, native != null]);\n\n useEffect(() => {\n if (!open || native != null) return;\n const { body } = document;\n const previousOverflow = body.style.overflow;\n body.style.overflow = 'hidden';\n return () => {\n body.style.overflow = previousOverflow;\n };\n }, [open, native]);\n\n const state = open ? 'open' : 'closed';\n\n const onKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' && defaultIndex >= 0) {\n event.preventDefault();\n run(resolved[defaultIndex]);\n }\n };\n\n // native popup renders no DOM of its own\n if (native != null) return null;\n\n return (\n <Portal container={container}>\n <Presence present={open}>\n <div data-slot=\"dialog-overlay\" data-state={state} className={styles.overlay}>\n <FocusScope asChild trapped loop>\n <DismissableLayer\n asChild\n onEscapeKeyDown={() => {\n if (cancelIndex >= 0) run(resolved[cancelIndex]);\n else onOpenChange(false);\n }}\n >\n <div\n role=\"alertdialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n aria-describedby={description != null ? descId : undefined}\n data-slot=\"dialog-content\"\n data-state={state}\n className={styles.content}\n onKeyDown={onKeyDown}\n >\n <div className={styles.body}>\n <h2 id={titleId} data-slot=\"dialog-title\" className={styles.title}>\n {title}\n </h2>\n {description != null ? (\n <p id={descId} data-slot=\"dialog-description\" className={styles.description}>\n {description}\n </p>\n ) : null}\n </div>\n <div\n data-slot=\"dialog-actions\"\n data-layout={stacked ? 'stacked' : 'row'}\n className={styles.actions}\n >\n {resolved.map((action, index) => (\n <button\n // biome-ignore lint/suspicious/noArrayIndexKey: actions are a fixed positional list\n key={index}\n type=\"button\"\n data-slot=\"dialog-action\"\n data-role={action.role ?? 'default'}\n data-default={index === defaultIndex || undefined}\n className={styles.action}\n onClick={() => run(action)}\n >\n {action.label}\n </button>\n ))}\n </div>\n </div>\n </DismissableLayer>\n </FocusScope>\n </div>\n </Presence>\n </Portal>\n );\n}\n\nDialog.displayName = 'Dialog';\n",".divider {\n margin: 0;\n border: none;\n border-block-start: var(--tgui--hairline) solid var(--tgui--separator);\n}\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Divider.module.css';\n\nexport interface DividerProps extends HTMLAttributes<HTMLHRElement> {\n ref?: Ref<HTMLHRElement>;\n}\n\nexport function Divider({ ref, className, ...rest }: DividerProps) {\n return <hr ref={ref} data-slot=\"divider\" className={cn(styles.divider, className)} {...rest} />;\n}\n\nDivider.displayName = 'Divider';\n","import { createContext, type RefObject } from 'react';\n\nexport interface DropdownMenuContextValue {\n open: boolean;\n setOpen: (open: boolean) => void;\n triggerRef: RefObject<HTMLElement | null>;\n contentId: string;\n}\n\nexport const DropdownMenuContext = createContext<DropdownMenuContextValue | null>(null);\nDropdownMenuContext.displayName = 'DropdownMenuContext';\n\nexport interface DropdownMenuRadioContextValue {\n value: string | undefined;\n select: (value: string) => void;\n}\n\nexport const DropdownMenuRadioContext = createContext<DropdownMenuRadioContextValue | null>(null);\nDropdownMenuRadioContext.displayName = 'DropdownMenuRadioContext';\n","export function CheckIcon() {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden>\n <path\n d=\"M3.5 8.5l3 3 6-7\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n",".content {\n position: fixed;\n top: 0;\n inset-inline-start: 0;\n z-index: var(--tgui--z-overlay);\n min-width: 200px;\n max-width: 280px;\n padding: 5px;\n overflow: hidden auto;\n max-height: calc(100vh - 32px);\n border-radius: var(--tgui--radius);\n background: var(--tgui--surface-bg);\n color: var(--tgui--label);\n box-shadow: var(--tgui--overlay-shadow);\n}\n\n.content[data-side=\"bottom\"] {\n transform-origin: top center;\n}\n\n.content[data-side=\"top\"] {\n transform-origin: bottom center;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .content[data-state=\"open\"] {\n animation: dropdown-menu-in var(--tgui--duration-overlay) var(--tgui--ease-spring);\n }\n\n .content[data-state=\"closed\"] {\n animation: dropdown-menu-out var(--tgui--duration-overlay) var(--tgui--ease-in) forwards;\n }\n}\n\n@keyframes dropdown-menu-in {\n from {\n opacity: 0;\n transform: scale(0.96);\n }\n}\n\n@keyframes dropdown-menu-out {\n to {\n opacity: 0;\n transform: scale(0.96);\n }\n}\n\n.item {\n display: flex;\n align-items: center;\n gap: 10px;\n width: 100%;\n box-sizing: border-box;\n padding: 9px 10px;\n border: 0;\n border-radius: var(--tgui--radius-sm);\n background: transparent;\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 16px;\n line-height: 21px;\n text-align: start;\n cursor: pointer;\n}\n\n.item:disabled {\n opacity: 0.35;\n cursor: default;\n}\n\n.item[data-destructive] {\n color: var(--tgui--destructive-strong);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .item:not(:disabled):hover {\n background: var(--tgui--fill);\n }\n}\n\n.item:not(:disabled):active,\n.item:focus-visible {\n background: var(--tgui--fill);\n}\n\n.item:focus-visible {\n outline: none;\n}\n\n.itemIcon,\n.itemIndicator {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n color: var(--tgui--label-secondary);\n}\n\n.itemIndicator {\n color: var(--tgui--link-strong);\n}\n\n.itemLabel {\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.itemSelectable .itemLabel {\n flex: 1;\n}\n\n.separator {\n height: var(--tgui--hairline);\n margin: 5px 0;\n border: 0;\n background: var(--tgui--separator);\n}\n\n.label {\n padding: 8px 10px 4px;\n color: var(--tgui--label-secondary);\n font-family: var(--tgui--font-family);\n font-size: 12px;\n font-weight: var(--tgui--weight-semibold);\n letter-spacing: 0.04em;\n text-transform: uppercase;\n}\n","'use client';\n\nimport type { ButtonHTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { CheckIcon } from './CheckIcon';\nimport styles from './DropdownMenu.module.css';\n\nexport interface DropdownMenuCheckboxItemProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {\n ref?: Ref<HTMLButtonElement>;\n checked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n}\n\nexport function DropdownMenuCheckboxItem({\n ref,\n checked = false,\n onCheckedChange,\n disabled,\n className,\n children,\n onClick,\n ...rest\n}: DropdownMenuCheckboxItemProps) {\n return (\n <button\n ref={ref}\n type=\"button\"\n role=\"menuitemcheckbox\"\n aria-checked={checked}\n tabIndex={-1}\n disabled={disabled}\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(styles.item, styles.itemSelectable, className)}\n onClick={(event) => {\n onClick?.(event);\n onCheckedChange?.(!checked);\n }}\n {...rest}\n >\n <span data-slot=\"dropdown-menu-item-indicator\" className={styles.itemIndicator} aria-hidden>\n {checked ? <CheckIcon /> : null}\n </span>\n <span className={styles.itemLabel}>{children as ReactNode}</span>\n </button>\n );\n}\n\nDropdownMenuCheckboxItem.displayName = 'DropdownMenuCheckboxItem';\n","export type FloatingSide = 'top' | 'bottom' | 'left' | 'right';\nexport type FloatingAlign = 'start' | 'center' | 'end';\nexport type FloatingPlacement = FloatingSide | `${FloatingSide}-start` | `${FloatingSide}-end`;\n\nexport interface FloatingPosition {\n top: number;\n left: number;\n side: FloatingSide;\n}\n\nconst MARGIN = 8;\nconst clamp = (value: number, min: number, max: number) => Math.max(min, Math.min(max, value));\n\nfunction parsePlacement(placement: FloatingPlacement): {\n side: FloatingSide;\n align: FloatingAlign;\n} {\n const [side, align] = placement.split('-') as [FloatingSide, FloatingAlign | undefined];\n return { side, align: align ?? 'center' };\n}\n\n// a `position: fixed` element is offset by any ancestor that establishes a\n// containing block (transform / filter / perspective / will-change / contain).\n// returns the offset + scale to convert viewport coords into that block's space.\nexport function getFixedOffset(floatingEl: Element | null): {\n x: number;\n y: number;\n scale: number;\n} {\n let node = floatingEl?.parentElement ?? null;\n while (node != null && node !== document.documentElement) {\n const cs = getComputedStyle(node);\n if (\n cs.transform !== 'none' ||\n cs.perspective !== 'none' ||\n (cs.filter != null && cs.filter !== 'none') ||\n cs.willChange === 'transform' ||\n cs.willChange === 'perspective' ||\n cs.willChange === 'filter' ||\n cs.contain === 'layout' ||\n cs.contain === 'paint' ||\n cs.contain === 'strict' ||\n cs.contain === 'content'\n ) {\n const rect = node.getBoundingClientRect();\n const scale = rect.width > 0 ? rect.width / node.offsetWidth : 1;\n return { x: rect.left, y: rect.top, scale: scale || 1 };\n }\n node = node.parentElement;\n }\n return { x: 0, y: 0, scale: 1 };\n}\n\nexport function computeFloatingPosition(\n anchor: DOMRect,\n floating: DOMRect,\n placement: FloatingPlacement,\n gap: number,\n floatingEl?: Element | null,\n): FloatingPosition {\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n const { side: wantSide, align } = parsePlacement(placement);\n let side = wantSide;\n\n if (side === 'top' && anchor.top - floating.height - gap < MARGIN) side = 'bottom';\n else if (side === 'bottom' && anchor.bottom + floating.height + gap > vh - MARGIN) side = 'top';\n else if (side === 'left' && anchor.left - floating.width - gap < MARGIN) side = 'right';\n else if (side === 'right' && anchor.right + floating.width + gap > vw - MARGIN) side = 'left';\n\n let top = 0;\n let left = 0;\n\n if (side === 'top' || side === 'bottom') {\n if (align === 'start') left = anchor.left;\n else if (align === 'end') left = anchor.right - floating.width;\n else left = anchor.left + anchor.width / 2 - floating.width / 2;\n top = side === 'top' ? anchor.top - floating.height - gap : anchor.bottom + gap;\n } else {\n if (align === 'start') top = anchor.top;\n else if (align === 'end') top = anchor.bottom - floating.height;\n else top = anchor.top + anchor.height / 2 - floating.height / 2;\n left = side === 'left' ? anchor.left - floating.width - gap : anchor.right + gap;\n }\n\n left = clamp(left, MARGIN, vw - floating.width - MARGIN);\n top = clamp(top, MARGIN, vh - floating.height - MARGIN);\n\n // translate viewport coords into the containing block's space\n if (floatingEl != null) {\n const offset = getFixedOffset(floatingEl);\n left = (left - offset.x) / offset.scale;\n top = (top - offset.y) / offset.scale;\n }\n\n return { top, left, side };\n}\n","'use client';\n\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { Presence } from '@radix-ui/react-presence';\nimport {\n type HTMLAttributes,\n type KeyboardEvent as ReactKeyboardEvent,\n type Ref,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport {\n computeFloatingPosition,\n type FloatingPlacement,\n type FloatingPosition,\n} from '../../shared/lib/floatingPosition';\nimport { Portal } from '../Portal';\nimport { DropdownMenuContext } from './context';\nimport styles from './DropdownMenu.module.css';\n\nexport interface DropdownMenuContentProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> {\n ref?: Ref<HTMLDivElement>;\n placement?: FloatingPlacement;\n gap?: number;\n container?: Element | DocumentFragment | null;\n className?: string;\n}\n\nconst ITEM_SELECTOR = '[role=\"menuitem\"],[role=\"menuitemcheckbox\"],[role=\"menuitemradio\"]';\n\nexport function DropdownMenuContent({\n ref,\n placement = 'bottom-start',\n gap = 6,\n container,\n className,\n children,\n onKeyDown,\n ...rest\n}: DropdownMenuContentProps) {\n const ctx = useContext(DropdownMenuContext);\n const nodeRef = useRef<HTMLDivElement | null>(null);\n const [contentNode, setContentNode] = useState<HTMLDivElement | null>(null);\n const [position, setPosition] = useState<FloatingPosition | null>(null);\n\n const open = ctx?.open ?? false;\n const setOpen = ctx?.setOpen;\n const triggerRef = ctx?.triggerRef;\n\n const reposition = useCallback(() => {\n const trigger = triggerRef?.current;\n const node = nodeRef.current;\n if (!trigger || !node) return;\n setPosition(\n computeFloatingPosition(\n trigger.getBoundingClientRect(),\n node.getBoundingClientRect(),\n placement,\n gap,\n node,\n ),\n );\n }, [placement, gap, triggerRef]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: contentNode re-runs this once Presence mounts the div\n useLayoutEffect(() => {\n if (open) reposition();\n }, [open, reposition, contentNode]);\n\n useEffect(() => {\n if (!open) return;\n const onScrollOrResize = () => reposition();\n window.addEventListener('resize', onScrollOrResize);\n window.addEventListener('scroll', onScrollOrResize, true);\n return () => {\n window.removeEventListener('resize', onScrollOrResize);\n window.removeEventListener('scroll', onScrollOrResize, true);\n };\n }, [open, reposition]);\n\n const handleKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (!nodeRef.current) return;\n const items = [...nodeRef.current.querySelectorAll<HTMLElement>(ITEM_SELECTOR)].filter(\n (el) => !el.hasAttribute('disabled') && el.getAttribute('aria-disabled') !== 'true',\n );\n if (items.length === 0) return;\n const current = items.indexOf(document.activeElement as HTMLElement);\n const move = (next: number) => {\n event.preventDefault();\n items[(next + items.length) % items.length]?.focus();\n };\n if (event.key === 'ArrowDown') move(current + 1);\n else if (event.key === 'ArrowUp') move(current - 1);\n else if (event.key === 'Home') move(0);\n else if (event.key === 'End') move(items.length - 1);\n };\n\n if (ctx == null) return null;\n\n return (\n <Portal container={container}>\n <Presence present={open}>\n <FocusScope\n asChild\n trapped\n loop\n onUnmountAutoFocus={(event) => {\n event.preventDefault();\n triggerRef?.current?.focus();\n }}\n >\n <DismissableLayer\n asChild\n deferPointerDownOutside\n onEscapeKeyDown={() => setOpen?.(false)}\n onPointerDownOutside={() => setOpen?.(false)}\n onFocusOutside={() => setOpen?.(false)}\n >\n <div\n ref={(node) => {\n nodeRef.current = node;\n setContentNode(node);\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as { current: HTMLDivElement | null }).current = node;\n }}\n id={ctx.contentId}\n role=\"menu\"\n data-slot=\"dropdown-menu-content\"\n data-side={position?.side}\n data-state={position ? (open ? 'open' : 'closed') : undefined}\n className={cn(styles.content, className)}\n style={\n position\n ? { top: position.top, left: position.left }\n : { top: 0, left: 0, opacity: 0, pointerEvents: 'none' }\n }\n onKeyDown={handleKeyDown}\n {...rest}\n >\n {children}\n </div>\n </DismissableLayer>\n </FocusScope>\n </Presence>\n </Portal>\n );\n}\n\nDropdownMenuContent.displayName = 'DropdownMenuContent';\n","'use client';\n\nimport { type ButtonHTMLAttributes, type ReactNode, type Ref, useContext } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { DropdownMenuContext } from './context';\nimport styles from './DropdownMenu.module.css';\n\nexport interface DropdownMenuItemProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onSelect'> {\n ref?: Ref<HTMLButtonElement>;\n icon?: ReactNode;\n destructive?: boolean;\n // fired on activation; the menu closes afterwards unless you call preventDefault\n onSelect?: (event: { preventDefault: () => void }) => void;\n}\n\nexport function DropdownMenuItem({\n ref,\n icon,\n destructive = false,\n disabled,\n className,\n children,\n onSelect,\n onClick,\n ...rest\n}: DropdownMenuItemProps) {\n const ctx = useContext(DropdownMenuContext);\n\n return (\n <button\n ref={ref}\n type=\"button\"\n role=\"menuitem\"\n tabIndex={-1}\n disabled={disabled}\n data-slot=\"dropdown-menu-item\"\n data-destructive={destructive || undefined}\n className={cn(styles.item, className)}\n onClick={(event) => {\n onClick?.(event);\n let prevented = false;\n onSelect?.({ preventDefault: () => (prevented = true) });\n if (!prevented) ctx?.setOpen(false);\n }}\n {...rest}\n >\n {icon != null ? (\n <span data-slot=\"dropdown-menu-item-icon\" className={styles.itemIcon}>\n {icon}\n </span>\n ) : null}\n <span className={styles.itemLabel}>{children}</span>\n </button>\n );\n}\n\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './DropdownMenu.module.css';\n\nexport interface DropdownMenuLabelProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n}\n\nexport function DropdownMenuLabel({ ref, className, ...rest }: DropdownMenuLabelProps) {\n return (\n <div\n ref={ref}\n data-slot=\"dropdown-menu-label\"\n className={cn(styles.label, className)}\n {...rest}\n />\n );\n}\n\nDropdownMenuLabel.displayName = 'DropdownMenuLabel';\n","'use client';\n\nimport { type ReactNode, useCallback, useMemo, useState } from 'react';\nimport { DropdownMenuRadioContext } from './context';\n\nexport interface DropdownMenuRadioGroupProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n children: ReactNode;\n}\n\nexport function DropdownMenuRadioGroup({\n value: valueProp,\n defaultValue,\n onValueChange,\n children,\n}: DropdownMenuRadioGroupProps) {\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n const value = valueProp ?? uncontrolled;\n\n const select = useCallback(\n (next: string) => {\n if (valueProp == null) setUncontrolled(next);\n onValueChange?.(next);\n },\n [valueProp, onValueChange],\n );\n\n const context = useMemo(() => ({ value, select }), [value, select]);\n\n return (\n <DropdownMenuRadioContext.Provider value={context}>\n {children}\n </DropdownMenuRadioContext.Provider>\n );\n}\n\nDropdownMenuRadioGroup.displayName = 'DropdownMenuRadioGroup';\n","'use client';\n\nimport { type ButtonHTMLAttributes, type ReactNode, type Ref, useContext } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { CheckIcon } from './CheckIcon';\nimport { DropdownMenuContext, DropdownMenuRadioContext } from './context';\nimport styles from './DropdownMenu.module.css';\n\nexport interface DropdownMenuRadioItemProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {\n ref?: Ref<HTMLButtonElement>;\n value: string;\n}\n\nexport function DropdownMenuRadioItem({\n ref,\n value,\n disabled,\n className,\n children,\n onClick,\n ...rest\n}: DropdownMenuRadioItemProps) {\n const menu = useContext(DropdownMenuContext);\n const group = useContext(DropdownMenuRadioContext);\n const checked = group?.value === value;\n\n return (\n <button\n ref={ref}\n type=\"button\"\n role=\"menuitemradio\"\n aria-checked={checked}\n tabIndex={-1}\n disabled={disabled}\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(styles.item, styles.itemSelectable, className)}\n onClick={(event) => {\n onClick?.(event);\n group?.select(value);\n menu?.setOpen(false);\n }}\n {...rest}\n >\n <span data-slot=\"dropdown-menu-item-indicator\" className={styles.itemIndicator} aria-hidden>\n {checked ? <CheckIcon /> : null}\n </span>\n <span className={styles.itemLabel}>{children as ReactNode}</span>\n </button>\n );\n}\n\nDropdownMenuRadioItem.displayName = 'DropdownMenuRadioItem';\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './DropdownMenu.module.css';\n\nexport interface DropdownMenuSeparatorProps extends HTMLAttributes<HTMLHRElement> {\n ref?: Ref<HTMLHRElement>;\n}\n\nexport function DropdownMenuSeparator({ ref, className, ...rest }: DropdownMenuSeparatorProps) {\n return (\n <hr\n ref={ref}\n data-slot=\"dropdown-menu-separator\"\n className={cn(styles.separator, className)}\n {...rest}\n />\n );\n}\n\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n","'use client';\n\nimport { cloneElement, isValidElement, type ReactElement, useContext } from 'react';\nimport { DropdownMenuContext } from './context';\n\nexport interface DropdownMenuTriggerProps {\n children: ReactElement;\n}\n\nexport function DropdownMenuTrigger({ children }: DropdownMenuTriggerProps) {\n const ctx = useContext(DropdownMenuContext);\n if (ctx == null || !isValidElement(children)) return children;\n const { open, setOpen, triggerRef, contentId } = ctx;\n\n const child = children as ReactElement<Record<string, unknown>>;\n const childRef = (child.props as { ref?: unknown }).ref;\n const childOnClick = child.props.onClick as ((event: unknown) => void) | undefined;\n\n return cloneElement(child, {\n ref: (node: HTMLElement | null) => {\n triggerRef.current = node;\n if (typeof childRef === 'function') childRef(node);\n else if (childRef && typeof childRef === 'object')\n (childRef as { current: HTMLElement | null }).current = node;\n },\n onClick: (event: unknown) => {\n childOnClick?.(event);\n setOpen(!open);\n },\n 'aria-haspopup': 'menu',\n 'aria-expanded': open,\n 'aria-controls': open ? contentId : undefined,\n 'data-slot': 'dropdown-menu-trigger',\n 'data-state': open ? 'open' : 'closed',\n });\n}\n\nDropdownMenuTrigger.displayName = 'DropdownMenuTrigger';\n","'use client';\n\nimport { type ReactNode, useCallback, useId, useMemo, useRef, useState } from 'react';\nimport { DropdownMenuContext } from './context';\nimport { DropdownMenuCheckboxItem } from './DropdownMenuCheckboxItem';\nimport { DropdownMenuContent } from './DropdownMenuContent';\nimport { DropdownMenuItem } from './DropdownMenuItem';\nimport { DropdownMenuLabel } from './DropdownMenuLabel';\nimport { DropdownMenuRadioGroup } from './DropdownMenuRadioGroup';\nimport { DropdownMenuRadioItem } from './DropdownMenuRadioItem';\nimport { DropdownMenuSeparator } from './DropdownMenuSeparator';\nimport { DropdownMenuTrigger } from './DropdownMenuTrigger';\n\nexport interface DropdownMenuProps {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children: ReactNode;\n}\n\nexport function DropdownMenu({\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n children,\n}: DropdownMenuProps) {\n const [uncontrolled, setUncontrolled] = useState(defaultOpen);\n const open = openProp ?? uncontrolled;\n const triggerRef = useRef<HTMLElement | null>(null);\n const contentId = useId();\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (openProp == null) setUncontrolled(next);\n onOpenChange?.(next);\n },\n [openProp, onOpenChange],\n );\n\n const context = useMemo(\n () => ({ open, setOpen, triggerRef, contentId }),\n [open, setOpen, contentId],\n );\n\n return <DropdownMenuContext.Provider value={context}>{children}</DropdownMenuContext.Provider>;\n}\n\nDropdownMenu.displayName = 'DropdownMenu';\nDropdownMenu.Trigger = DropdownMenuTrigger;\nDropdownMenu.Content = DropdownMenuContent;\nDropdownMenu.Item = DropdownMenuItem;\nDropdownMenu.CheckboxItem = DropdownMenuCheckboxItem;\nDropdownMenu.RadioGroup = DropdownMenuRadioGroup;\nDropdownMenu.RadioItem = DropdownMenuRadioItem;\nDropdownMenu.Separator = DropdownMenuSeparator;\nDropdownMenu.Label = DropdownMenuLabel;\n",".fixedLayout {\n position: fixed;\n left: 0;\n right: 0;\n z-index: var(--tgui--z-sticky, 100);\n box-sizing: border-box;\n}\n\n.top {\n top: 0;\n padding-top: var(--tgui--safe-area-top);\n}\n\n.bottom {\n bottom: 0;\n padding-bottom: calc(var(--tgui--safe-area-bottom) + var(--tgui--content-safe-area-bottom));\n}\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './FixedLayout.module.css';\n\nexport interface FixedLayoutProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n vertical?: 'top' | 'bottom';\n}\n\nexport function FixedLayout({ ref, vertical = 'bottom', className, ...rest }: FixedLayoutProps) {\n return (\n <div\n ref={ref}\n data-slot=\"fixed-layout\"\n className={cn(styles.fixedLayout, styles[vertical], className)}\n {...rest}\n />\n );\n}\n\nFixedLayout.displayName = 'FixedLayout';\n",".footnote {\n font-size: var(--tgui--font-footnote-size);\n line-height: var(--tgui--font-footnote-line);\n letter-spacing: var(--tgui--font-footnote-tracking);\n}\n","import type { Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Typography, type TypographyProps } from '../Typography';\nimport styles from './Footnote.module.css';\n\nexport interface FootnoteProps extends TypographyProps {\n ref?: Ref<HTMLElement>;\n}\n\nexport function Footnote({ ref, className, Component = 'span', ...rest }: FootnoteProps) {\n return (\n <Typography\n data-slot=\"footnote\"\n ref={ref}\n Component={Component}\n className={cn(styles.footnote, className)}\n {...rest}\n />\n );\n}\n\nFootnote.displayName = 'Footnote';\n",".headline {\n font-size: var(--tgui--font-headline-size);\n line-height: var(--tgui--font-headline-line);\n letter-spacing: var(--tgui--font-headline-tracking);\n}\n","import type { Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Typography, type TypographyProps } from '../Typography';\nimport styles from './Headline.module.css';\n\nexport interface HeadlineProps extends TypographyProps {\n ref?: Ref<HTMLElement>;\n}\n\nexport function Headline({\n ref,\n weight = '2',\n className,\n Component = 'h5',\n ...rest\n}: HeadlineProps) {\n return (\n <Typography\n data-slot=\"headline\"\n ref={ref}\n weight={weight}\n Component={Component}\n className={cn(styles.headline, className)}\n {...rest}\n />\n );\n}\n\nHeadline.displayName = 'Headline';\n",".root {\n --tgui--hscroll-fade: 36px;\n --tgui--hscroll-bg: var(--tgui--bg);\n position: relative;\n min-width: 0;\n max-width: 100%;\n}\n\n.edge {\n position: absolute;\n top: 0;\n bottom: 0;\n width: var(--tgui--hscroll-fade);\n z-index: 1;\n opacity: 0;\n pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .edge {\n transition: opacity 0.2s ease;\n }\n}\n\n.edge--start {\n left: 0;\n background: linear-gradient(to right, var(--tgui--hscroll-bg), transparent);\n}\n\n.edge--end {\n right: 0;\n background: linear-gradient(to left, var(--tgui--hscroll-bg), transparent);\n}\n\n.root[data-start=\"true\"] .edge--start,\n.root[data-end=\"true\"] .edge--end {\n opacity: 1;\n}\n\n.scroller {\n display: flex;\n min-width: 0;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n overscroll-behavior-x: contain;\n}\n\n.scroller::-webkit-scrollbar {\n display: none;\n}\n\n.scroller:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: calc(-1 * var(--tgui--focus-ring-offset));\n border-radius: var(--tgui--radius-sm);\n}\n\n.scroller > * {\n -webkit-user-drag: none;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .scroller {\n cursor: grab;\n }\n\n .scroller[data-grabbing=\"true\"] {\n cursor: grabbing;\n }\n\n .scroller[data-grabbing=\"true\"] * {\n pointer-events: none;\n }\n}\n\n.snap {\n scroll-snap-type: x mandatory;\n}\n\n.snap > * {\n scroll-snap-align: start;\n}\n","'use client';\n\nimport {\n type HTMLAttributes,\n type PointerEvent as ReactPointerEvent,\n type Ref,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './HorizontalScroll.module.css';\n\nconst DRAG_THRESHOLD = 4;\n\nexport interface HorizontalScrollProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n snap?: boolean;\n fade?: boolean;\n // names the scroll region for assistive tech; the region is keyboard-focusable\n scrollLabel?: string;\n}\n\nexport function HorizontalScroll({\n ref,\n snap = false,\n fade = true,\n scrollLabel = 'Scrollable content',\n className,\n children,\n ...rest\n}: HorizontalScrollProps) {\n const scrollerRef = useRef<HTMLDivElement | null>(null);\n const [edges, setEdges] = useState({ start: false, end: false });\n const drag = useRef({ down: false, moved: false, startX: 0, startScroll: 0 });\n\n const measure = useCallback(() => {\n const el = scrollerRef.current;\n if (!el) return;\n const start = el.scrollLeft > 1;\n const end = el.scrollLeft < el.scrollWidth - el.clientWidth - 1;\n setEdges((prev) => (prev.start === start && prev.end === end ? prev : { start, end }));\n }, []);\n\n useEffect(() => {\n const el = scrollerRef.current;\n if (!el) return;\n measure();\n el.addEventListener('scroll', measure, { passive: true });\n const observer = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(measure) : null;\n observer?.observe(el);\n return () => {\n el.removeEventListener('scroll', measure);\n observer?.disconnect();\n };\n }, [measure]);\n\n const onPointerDown = (event: ReactPointerEvent<HTMLDivElement>) => {\n if (event.pointerType !== 'mouse' || event.button !== 0) return;\n const el = scrollerRef.current;\n if (!el) return;\n drag.current = {\n down: true,\n moved: false,\n startX: event.clientX,\n startScroll: el.scrollLeft,\n };\n };\n\n const onPointerMove = (event: ReactPointerEvent<HTMLDivElement>) => {\n const state = drag.current;\n const el = scrollerRef.current;\n if (!state.down || !el) return;\n const dx = event.clientX - state.startX;\n if (!state.moved) {\n if (Math.abs(dx) < DRAG_THRESHOLD) return;\n state.moved = true;\n el.setPointerCapture(event.pointerId);\n el.dataset.grabbing = 'true';\n el.style.scrollBehavior = 'auto';\n }\n event.preventDefault();\n el.scrollLeft = state.startScroll - dx;\n };\n\n const endDrag = (event: ReactPointerEvent<HTMLDivElement>) => {\n const el = scrollerRef.current;\n if (el && drag.current.moved) {\n el.releasePointerCapture?.(event.pointerId);\n delete el.dataset.grabbing;\n el.style.scrollBehavior = '';\n }\n drag.current.down = false;\n };\n\n return (\n <div\n ref={ref}\n data-slot=\"horizontal-scroll\"\n className={cn(styles.root, className)}\n data-start={fade ? String(edges.start) : undefined}\n data-end={fade ? String(edges.end) : undefined}\n {...rest}\n >\n {fade ? (\n <>\n <span\n data-slot=\"horizontal-scroll-fade-start\"\n className={cn(styles.edge, styles['edge--start'])}\n aria-hidden\n />\n <span\n data-slot=\"horizontal-scroll-fade-end\"\n className={cn(styles.edge, styles['edge--end'])}\n aria-hidden\n />\n </>\n ) : null}\n {/* biome-ignore lint/a11y/useSemanticElements: a scroll region is a group, not a fieldset */}\n <div\n ref={scrollerRef}\n data-slot=\"horizontal-scroll-viewport\"\n className={cn(styles.scroller, snap && styles.snap)}\n // biome-ignore lint/a11y/noNoninteractiveTabindex: a scroll region must be keyboard-focusable to arrow-scroll\n tabIndex={0}\n role=\"group\"\n aria-label={scrollLabel}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={endDrag}\n onPointerCancel={endDrag}\n onDragStart={(event) => event.preventDefault()}\n onClickCapture={(event) => {\n if (drag.current.moved) {\n event.stopPropagation();\n drag.current.moved = false;\n }\n }}\n >\n {children}\n </div>\n </div>\n );\n}\n\nHorizontalScroll.displayName = 'HorizontalScroll';\n",".iconButton {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding: 0;\n border: none;\n overflow: hidden;\n border-radius: 10px;\n color: var(--tgui--link);\n background: transparent;\n}\n\n.circle {\n border-radius: 50%;\n}\n\n.iconButton:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n.s {\n width: 30px;\n height: 30px;\n}\n\n.m {\n width: 36px;\n height: 36px;\n}\n\n.l {\n width: 44px;\n height: 44px;\n}\n\n.iconButton::after {\n content: \"\";\n position: absolute;\n inset: 0;\n opacity: 0;\n background: currentColor;\n}\n\n.ios::after {\n content: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .iconButton::after {\n transition: opacity 0.15s ease-out;\n }\n}\n\n@media (hover: hover) and (pointer: fine) {\n .iconButton:not([data-disabled]):hover::after {\n opacity: 0.08;\n }\n}\n\n.icon {\n display: flex;\n z-index: var(--tgui--z-base);\n}\n\n.icon svg {\n display: block;\n}\n\n.mode-bezeled {\n color: var(--tgui--link);\n background: var(--tgui--accent-fill);\n}\n\n.mode-plain {\n color: var(--tgui--link);\n}\n\n.mode-gray {\n color: var(--tgui--label);\n background: var(--tgui--fill-tertiary);\n}\n\n.mode-outline {\n color: var(--tgui--label);\n box-shadow: inset 0 0 0 1px var(--tgui--separator);\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './IconButton.module.css';\n\nexport type IconButtonMode = 'bezeled' | 'plain' | 'gray' | 'outline';\nexport type IconButtonSize = 's' | 'm' | 'l';\n\nexport const iconButton = cva(styles.iconButton, {\n variants: {\n mode: {\n bezeled: styles['mode-bezeled'],\n plain: styles['mode-plain'],\n gray: styles['mode-gray'],\n outline: styles['mode-outline'],\n },\n size: { s: styles.s, m: styles.m, l: styles.l },\n circle: { true: styles.circle },\n platform: { ios: styles.ios, base: null },\n },\n defaultVariants: { mode: 'plain', size: 'm' },\n});\n","'use client';\n\nimport type { AllHTMLAttributes, ElementType, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Tappable } from '../Tappable';\nimport { useTgui } from '../TguiProvider';\nimport styles from './IconButton.module.css';\nimport { type IconButtonMode, type IconButtonSize, iconButton } from './IconButton.variants';\n\nexport type { IconButtonMode, IconButtonSize };\n\nexport interface IconButtonProps extends Omit<AllHTMLAttributes<HTMLElement>, 'size'> {\n ref?: Ref<HTMLElement>;\n Component?: ElementType;\n mode?: IconButtonMode;\n size?: IconButtonSize;\n circle?: boolean;\n}\n\nexport function IconButton({\n ref,\n Component = 'button',\n mode = 'plain',\n size = 'm',\n circle = false,\n type,\n className,\n children,\n ...rest\n}: IconButtonProps) {\n const { platform } = useTgui();\n\n return (\n <Tappable\n ref={ref}\n Component={Component}\n type={Component === 'button' ? (type ?? 'button') : type}\n data-slot=\"icon-button\"\n className={cn(iconButton({ mode, size, circle, platform }), className)}\n {...rest}\n >\n <span data-slot=\"icon-button-icon\" className={styles.icon}>\n {children}\n </span>\n </Tappable>\n );\n}\n\nIconButton.displayName = 'IconButton';\n",".frame {\n position: relative;\n display: inline-block;\n overflow: hidden;\n flex-shrink: 0;\n background: var(--tgui--fill);\n line-height: 0;\n}\n\n.bordered {\n box-shadow: inset 0 0 0 1px var(--tgui--separator);\n}\n\n.img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: var(--tgui--image-fit, cover);\n}\n\n.frame[data-state=\"loading\"] .img {\n opacity: 0;\n}\n\n.placeholder,\n.fallback {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--tgui--label-tertiary);\n}\n\n.placeholder {\n overflow: hidden;\n background: var(--tgui--fill);\n}\n\n.placeholder::after {\n content: \"\";\n position: absolute;\n inset: 0;\n transform: translateX(-100%);\n background: linear-gradient(\n 90deg,\n transparent,\n color-mix(in srgb, var(--tgui--label) 6%, transparent),\n transparent\n );\n animation: tgui-image-shimmer 1.5s ease-in-out infinite;\n}\n\n@keyframes tgui-image-shimmer {\n to {\n transform: translateX(100%);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .placeholder::after {\n animation: none;\n }\n}\n\n.fallback svg {\n width: 32%;\n height: 32%;\n max-width: 48px;\n max-height: 48px;\n}\n","'use client';\n\nimport {\n type CSSProperties,\n type ImgHTMLAttributes,\n type ReactNode,\n type Ref,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Image.module.css';\n\ntype Fit = 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';\n\nexport interface ImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'width' | 'height'> {\n ref?: Ref<HTMLImageElement>;\n size?: number;\n width?: number | string;\n height?: number | string;\n aspectRatio?: number | string;\n fit?: Fit;\n radius?: number | 'full';\n bordered?: boolean;\n fallback?: ReactNode;\n}\n\nconst BrokenIcon = (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden>\n <path\n d=\"M3 5h18v14H3zM3 15l5-5 4 4 3-3 6 6\"\n stroke=\"currentColor\"\n strokeWidth=\"1.6\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport function Image({\n ref,\n size,\n width,\n height,\n aspectRatio,\n fit = 'cover',\n radius,\n bordered = false,\n fallback = BrokenIcon,\n src,\n alt = '',\n className,\n style,\n onLoad,\n onError,\n ...rest\n}: ImageProps) {\n const [failedSrc, setFailedSrc] = useState<string | null>(null);\n const [loaded, setLoaded] = useState(false);\n const errored = src != null && src === failedSrc;\n\n const frameStyle: CSSProperties = {\n ...style,\n width: size ?? width,\n height: size ?? height,\n aspectRatio,\n borderRadius: radius === 'full' ? '50%' : radius,\n '--tgui--image-fit': fit,\n } as CSSProperties;\n\n return (\n <div\n data-slot=\"image\"\n data-state={errored ? 'error' : loaded ? 'loaded' : 'loading'}\n data-bordered={bordered || undefined}\n className={cn(styles.frame, bordered && styles.bordered, className)}\n style={frameStyle}\n >\n {src != null && !errored ? (\n <img\n ref={ref}\n data-slot=\"image-img\"\n className={styles.img}\n src={src}\n alt={alt}\n draggable={false}\n onLoad={(event) => {\n setLoaded(true);\n onLoad?.(event);\n }}\n onError={(event) => {\n setFailedSrc(src);\n onError?.(event);\n }}\n {...rest}\n />\n ) : null}\n {!loaded && !errored ? (\n <div data-slot=\"image-placeholder\" className={styles.placeholder} aria-hidden />\n ) : null}\n {errored ? (\n <div data-slot=\"image-fallback\" className={styles.fallback} aria-hidden>\n {fallback}\n </div>\n ) : null}\n </div>\n );\n}\n\nImage.displayName = 'Image';\n","import { createContext } from 'react';\nimport type { InlineButtonsMode } from './InlineButtons.variants';\n\nexport interface InlineButtonsContextValue {\n mode: InlineButtonsMode;\n}\n\nexport const InlineButtonsContext = createContext<InlineButtonsContextValue>({ mode: 'bezeled' });\n\nInlineButtonsContext.displayName = 'InlineButtonsContext';\n",".group {\n display: flex;\n gap: 8px;\n overflow-x: auto;\n scroll-snap-type: x proximity;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n}\n\n.group::-webkit-scrollbar {\n display: none;\n}\n\n.item {\n display: flex;\n flex: 1 1 0;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 4px;\n min-width: 72px;\n padding: 10px 4px;\n border: 0;\n border-radius: 12px;\n color: var(--tgui--link-strong);\n scroll-snap-align: start;\n}\n\n/* the row is an overflow scroller – an outset ring would be clipped */\n.item:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: calc(-1 * var(--tgui--focus-ring-offset));\n}\n\n.mode-bezeled {\n background: var(--tgui--accent-fill);\n}\n\n.mode-plain {\n background: transparent;\n}\n\n.mode-gray {\n color: var(--tgui--label);\n background: var(--tgui--fill-tertiary);\n}\n\n.icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n}\n\n.icon svg {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n.label {\n max-width: 100%;\n overflow: hidden;\n color: inherit;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './InlineButtons.module.css';\n\nexport type InlineButtonsMode = 'bezeled' | 'plain' | 'gray';\n\nexport const inlineButtonsItem = cva(styles.item, {\n variants: {\n mode: {\n bezeled: styles['mode-bezeled'],\n plain: styles['mode-plain'],\n gray: styles['mode-gray'],\n },\n },\n defaultVariants: { mode: 'bezeled' },\n});\n","'use client';\n\nimport { type ButtonHTMLAttributes, type ReactNode, type Ref, useContext } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Caption } from '../Caption';\nimport { Tappable } from '../Tappable';\nimport { InlineButtonsContext } from './context';\nimport styles from './InlineButtons.module.css';\nimport { inlineButtonsItem } from './InlineButtons.variants';\n\nexport interface InlineButtonsItemProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {\n ref?: Ref<HTMLButtonElement>;\n icon: ReactNode;\n children: ReactNode;\n}\n\nexport function InlineButtonsItem({\n ref,\n icon,\n children,\n className,\n ...rest\n}: InlineButtonsItemProps) {\n const { mode } = useContext(InlineButtonsContext);\n\n return (\n <Tappable\n ref={ref}\n Component=\"button\"\n type=\"button\"\n interactiveAnimation=\"opacity\"\n data-slot=\"inline-buttons-item\"\n className={cn(inlineButtonsItem({ mode }), className)}\n {...rest}\n >\n <span data-slot=\"inline-buttons-item-icon\" className={styles.icon}>\n {icon}\n </span>\n <Caption data-slot=\"inline-buttons-item-label\" className={styles.label} level=\"2\" weight=\"2\">\n {children}\n </Caption>\n </Tappable>\n );\n}\n\nInlineButtonsItem.displayName = 'InlineButtonsItem';\n","'use client';\n\nimport type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { InlineButtonsContext } from './context';\nimport styles from './InlineButtons.module.css';\nimport type { InlineButtonsMode } from './InlineButtons.variants';\nimport { InlineButtonsItem } from './InlineButtonsItem';\n\nexport type { InlineButtonsMode };\n\nexport interface InlineButtonsProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n mode?: InlineButtonsMode;\n}\n\nexport function InlineButtons({\n ref,\n mode = 'bezeled',\n className,\n children,\n ...rest\n}: InlineButtonsProps) {\n return (\n <InlineButtonsContext.Provider value={{ mode }}>\n {/* biome-ignore lint/a11y/useSemanticElements: a row of action buttons, not a form control group; <fieldset> would add a border box and legend semantics we don't want */}\n <div\n ref={ref}\n role=\"group\"\n data-slot=\"inline-buttons\"\n className={cn(styles.group, className)}\n {...rest}\n >\n {children}\n </div>\n </InlineButtonsContext.Provider>\n );\n}\n\nInlineButtons.displayName = 'InlineButtons';\nInlineButtons.Item = InlineButtonsItem;\n",".base {\n position: relative;\n padding: 20px 22px 16px;\n background: var(--tgui--bg);\n}\n\n.body {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n padding: var(--tgui--field-padding-y) var(--tgui--field-padding-x);\n}\n\n.body > :not(:first-child) {\n margin-inline-start: var(--tgui--field-gap);\n}\n\n.base .body {\n border-radius: 14px;\n box-shadow: 0 0 0 1.5px var(--tgui--separator-opaque);\n}\n\n.ios .body {\n min-height: var(--tgui--field-min-height);\n border-radius: var(--tgui--field-radius);\n background: var(--tgui--fill);\n}\n\n.align-start .body {\n align-items: flex-start;\n}\n\n.before,\n.after {\n display: flex;\n align-items: center;\n}\n\n.header {\n position: absolute;\n top: 6px;\n inset-inline-start: 32px;\n margin: 0;\n max-width: calc(100% - 76px);\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n padding: 0 6px;\n border-radius: 5px;\n color: var(--tgui--label-secondary);\n background: var(--tgui--bg);\n}\n\n/* iOS filled fields don't show a floating label – keep it for assistive tech only */\n.ios .header {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n}\n\n.base[data-state=\"focused\"] .body {\n box-shadow: 0 0 0 2px var(--tgui--link);\n}\n\n.base[data-state=\"focused\"] .header {\n color: var(--tgui--link-strong);\n}\n\n.base[data-state=\"error\"] .body {\n box-shadow: 0 0 0 2px var(--tgui--destructive);\n}\n\n.base[data-state=\"error\"] .header {\n color: var(--tgui--destructive-strong);\n}\n\n.ios[data-state=\"error\"] .body {\n box-shadow: 0 0 0 1.5px var(--tgui--destructive);\n}\n\n.base[data-disabled],\n.ios[data-disabled] {\n pointer-events: none;\n}\n\n.ios[data-disabled] {\n opacity: 0.35;\n}\n","import type { ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './FormField.module.css';\n\nexport type FormFieldStatus = 'default' | 'error' | 'focused';\n\nexport interface FormFieldProps {\n ref?: Ref<HTMLDivElement>;\n ios?: boolean;\n status?: FormFieldStatus;\n disabled?: boolean;\n alignStart?: boolean;\n header?: ReactNode;\n before?: ReactNode;\n after?: ReactNode;\n className?: string;\n children: ReactNode;\n}\n\nexport function FormField({\n ref,\n ios = false,\n status = 'default',\n disabled = false,\n alignStart = false,\n header,\n before,\n after,\n className,\n children,\n}: FormFieldProps) {\n return (\n <div\n ref={ref}\n data-slot=\"form-field\"\n data-state={status}\n data-disabled={disabled || undefined}\n className={cn(ios ? styles.ios : styles.base, alignStart && styles['align-start'], className)}\n aria-disabled={disabled || undefined}\n >\n {/* biome-ignore lint/a11y/noLabelWithoutControl: the control is the field passed in as children */}\n <label className={styles.body} data-slot=\"form-field-body\">\n {before != null ? (\n <span className={styles.before} data-slot=\"form-field-before\">\n {before}\n </span>\n ) : null}\n {children}\n {after != null ? (\n <span className={styles.after} data-slot=\"form-field-after\">\n {after}\n </span>\n ) : null}\n {/* inside the label so it names the control; hidden on iOS */}\n {header != null ? (\n <span className={styles.header} data-slot=\"form-field-label\">\n {header}\n </span>\n ) : null}\n </label>\n </div>\n );\n}\n\nFormField.displayName = 'FormField';\n",".field {\n display: block;\n width: 100%;\n margin: 0;\n padding: 0;\n border: 0;\n outline: 0;\n background: transparent;\n color: var(--tgui--label);\n text-overflow: ellipsis;\n}\n\n.field::placeholder {\n color: var(--tgui--label-tertiary);\n}\n\n.field::-webkit-outer-spin-button,\n.field::-webkit-inner-spin-button {\n appearance: none;\n}\n","'use client';\n\nimport {\n type FocusEvent,\n type InputHTMLAttributes,\n type ReactNode,\n type Ref,\n useState,\n} from 'react';\nimport { FormField } from '../FormField';\nimport { Subheadline } from '../Subheadline';\nimport { Text } from '../Text';\nimport { useTgui } from '../TguiProvider';\nimport styles from './Input.module.css';\n\nexport type InputStatus = 'default' | 'error' | 'focused';\n\nexport interface InputProps extends InputHTMLAttributes<HTMLInputElement> {\n ref?: Ref<HTMLInputElement>;\n header?: ReactNode;\n before?: ReactNode;\n after?: ReactNode;\n status?: InputStatus;\n}\n\nexport function Input({\n ref,\n type = 'text',\n header,\n before,\n after,\n status,\n disabled,\n className,\n onFocus,\n onBlur,\n ...rest\n}: InputProps) {\n const { platform } = useTgui();\n const ios = platform === 'ios';\n const [focused, setFocused] = useState(false);\n const state = status ?? (focused ? 'focused' : 'default');\n const Typography = ios ? Text : Subheadline;\n\n const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n if (!disabled) setFocused(true);\n onFocus?.(event);\n };\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n setFocused(false);\n onBlur?.(event);\n };\n\n return (\n <FormField\n ios={ios}\n status={state}\n disabled={disabled}\n header={header}\n before={before}\n after={after}\n className={className}\n >\n <Typography\n ref={ref as Ref<HTMLElement>}\n Component=\"input\"\n data-slot=\"input\"\n className={styles.field}\n type={type}\n disabled={disabled}\n aria-invalid={state === 'error' || undefined}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...rest}\n />\n </FormField>\n );\n}\n\nInput.displayName = 'Input';\n",".large-title {\n font-size: var(--tgui--font-large-title-size);\n line-height: var(--tgui--font-large-title-line);\n letter-spacing: var(--tgui--font-large-title-tracking);\n}\n","import type { Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Typography, type TypographyProps } from '../Typography';\nimport styles from './LargeTitle.module.css';\n\nexport interface LargeTitleProps extends TypographyProps {\n ref?: Ref<HTMLElement>;\n}\n\nexport function LargeTitle({\n ref,\n weight = '1',\n className,\n Component = 'h1',\n ...rest\n}: LargeTitleProps) {\n return (\n <Typography\n data-slot=\"large-title\"\n ref={ref}\n weight={weight}\n Component={Component}\n className={cn(styles['large-title'], className)}\n {...rest}\n />\n );\n}\n\nLargeTitle.displayName = 'LargeTitle';\n",".link {\n color: var(--tgui--link-strong);\n text-decoration: none;\n border-radius: 3px;\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .link:hover {\n text-decoration: underline;\n }\n}\n\n.link:focus-visible {\n outline: var(--tgui--focus-ring);\n}\n\n.icon {\n display: inline-block;\n width: 0.85em;\n height: 0.85em;\n margin-inline-start: 0.15em;\n vertical-align: -0.05em;\n}\n","import type { AnchorHTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Link.module.css';\n\nexport interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n ref?: Ref<HTMLAnchorElement>;\n}\n\nexport function Link({ ref, target, rel, className, children, ...rest }: LinkProps) {\n const external = target === '_blank';\n return (\n <a\n ref={ref}\n target={target}\n rel={external ? (rel ?? 'noopener noreferrer') : rel}\n data-slot=\"link\"\n data-external={external || undefined}\n className={cn(styles.link, className)}\n {...rest}\n >\n {children}\n {external ? (\n <svg\n data-slot=\"link-icon\"\n className={styles.icon}\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden\n >\n <path\n d=\"M6 3h7v7M13 3l-8 8\"\n stroke=\"currentColor\"\n strokeWidth=\"1.6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n ) : null}\n </a>\n );\n}\n\nLink.displayName = 'Link';\n",".list {\n box-sizing: border-box;\n /* grouped lists are inset from the screen edge, symmetrically, on both platforms */\n padding: var(--tgui--space-16) var(--tgui--page-margin);\n}\n\n.list > :not(:last-child) {\n margin-bottom: var(--tgui--space-32);\n}\n","'use client';\n\nimport type { ElementType, HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './List.module.css';\n\nexport interface ListProps extends HTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n Component?: ElementType;\n}\n\nexport function List({ ref, Component = 'div', className, children, ...rest }: ListProps) {\n return (\n <Component ref={ref} data-slot=\"list\" className={cn(styles.list, className)} {...rest}>\n {children}\n </Component>\n );\n}\n\nList.displayName = 'List';\n",".nav {\n font-family: var(--tgui--font-family);\n}\n\n.list {\n display: flex;\n align-items: center;\n gap: 4px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.page {\n min-width: 32px;\n height: 32px;\n padding: 0 8px;\n border: 0;\n border-radius: 8px;\n background: transparent;\n color: var(--tgui--label);\n font: inherit;\n font-size: 14px;\n cursor: pointer;\n}\n\n.page[aria-current=\"page\"] {\n color: var(--tgui--link-strong);\n font-weight: var(--tgui--weight-semibold);\n background: var(--tgui--accent-fill);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .page:not([aria-current=\"page\"]):hover {\n background: var(--tgui--fill-tertiary);\n }\n}\n\n.page:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n.dots {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 32px;\n height: 32px;\n color: var(--tgui--label-secondary);\n}\n\n.dotList {\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.dot {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n padding: 0;\n border: 0;\n background: transparent;\n cursor: pointer;\n}\n\n.dot::after {\n content: \"\";\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--tgui--accent-fill);\n}\n\n.dot[data-active]::after {\n width: 8px;\n height: 8px;\n background: var(--tgui--accent-strong);\n}\n\n.dotGap {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: 12px;\n height: 20px;\n}\n\n.dotGap::after {\n content: \"\";\n width: 3px;\n height: 3px;\n border-radius: 50%;\n background: var(--tgui--label-secondary);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .dot::after {\n transition:\n width 0.15s ease,\n height 0.15s ease,\n background 0.15s ease;\n }\n}\n\n.dot:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n border-radius: 50%;\n}\n","export const DOTS = 'dots' as const;\n\nfunction range(start: number, end: number) {\n return Array.from({ length: end - start + 1 }, (_, index) => start + index);\n}\n\nexport function paginationRange(page: number, count: number, siblingCount: number) {\n const totalNumbers = siblingCount * 2 + 5;\n if (totalNumbers >= count) return range(1, count);\n\n const leftSibling = Math.max(page - siblingCount, 1);\n const rightSibling = Math.min(page + siblingCount, count);\n const showLeftDots = leftSibling > 2;\n const showRightDots = rightSibling < count - 1;\n\n if (!showLeftDots && showRightDots) {\n return [...range(1, 3 + siblingCount * 2), DOTS, count];\n }\n if (showLeftDots && !showRightDots) {\n return [1, DOTS, ...range(count - (3 + siblingCount * 2) + 1, count)];\n }\n return [1, DOTS, ...range(leftSibling, rightSibling), DOTS, count];\n}\n","'use client';\n\nimport type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Pagination.module.css';\nimport { DOTS, paginationRange } from './paginationRange';\n\nexport interface CompactPaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {\n ref?: Ref<HTMLElement>;\n page: number;\n count: number;\n onChange: (page: number) => void;\n siblingCount?: number;\n}\n\nexport function CompactPagination({\n ref,\n page,\n count,\n onChange,\n siblingCount = 1,\n className,\n ...rest\n}: CompactPaginationProps) {\n const items = paginationRange(page, count, siblingCount);\n\n return (\n <nav ref={ref} aria-label=\"Pagination\" className={cn(styles.nav, className)} {...rest}>\n <ul className={styles.dotList}>\n {items.map((item, index) =>\n item === DOTS ? (\n // biome-ignore lint/suspicious/noArrayIndexKey: ellipsis positions are stable per render\n <li key={`dots-${index}`} className={styles.dotGap} aria-hidden />\n ) : (\n <li key={item}>\n <button\n type=\"button\"\n className={styles.dot}\n data-active={item === page || undefined}\n aria-label={`Page ${item}`}\n aria-current={item === page ? 'page' : undefined}\n onClick={() => onChange(item)}\n />\n </li>\n ),\n )}\n </ul>\n </nav>\n );\n}\n\nCompactPagination.displayName = 'CompactPagination';\n","'use client';\n\nimport type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { IconButton } from '../IconButton';\nimport styles from './Pagination.module.css';\nimport { DOTS, paginationRange } from './paginationRange';\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {\n ref?: Ref<HTMLElement>;\n page: number;\n count: number;\n onChange: (page: number) => void;\n siblingCount?: number;\n}\n\nconst ArrowIcon = ({ direction }: { direction: 'prev' | 'next' }) => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 18 18\" fill=\"none\" aria-hidden>\n <path\n d={direction === 'prev' ? 'M11.25 4.5L6.75 9l4.5 4.5' : 'M6.75 4.5L11.25 9l-4.5 4.5'}\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport function Pagination({\n ref,\n page,\n count,\n onChange,\n siblingCount = 1,\n className,\n ...rest\n}: PaginationProps) {\n const items = paginationRange(page, count, siblingCount);\n\n return (\n <nav\n ref={ref}\n aria-label=\"Pagination\"\n data-slot=\"pagination\"\n className={cn(styles.nav, className)}\n {...rest}\n >\n <ul className={styles.list}>\n <li>\n <IconButton\n mode=\"gray\"\n size=\"s\"\n data-slot=\"pagination-previous\"\n aria-label=\"Previous page\"\n disabled={page <= 1}\n onClick={() => onChange(page - 1)}\n >\n <ArrowIcon direction=\"prev\" />\n </IconButton>\n </li>\n {items.map((item, index) =>\n item === DOTS ? (\n // biome-ignore lint/suspicious/noArrayIndexKey: ellipsis positions are stable per render\n <li key={`dots-${index}`} className={styles.dots} aria-hidden>\n …\n </li>\n ) : (\n <li key={item}>\n <button\n type=\"button\"\n data-slot=\"pagination-item\"\n className={styles.page}\n aria-current={item === page ? 'page' : undefined}\n onClick={() => onChange(item)}\n >\n {item}\n </button>\n </li>\n ),\n )}\n <li>\n <IconButton\n mode=\"gray\"\n size=\"s\"\n data-slot=\"pagination-next\"\n aria-label=\"Next page\"\n disabled={page >= count}\n onClick={() => onChange(page + 1)}\n >\n <ArrowIcon direction=\"next\" />\n </IconButton>\n </li>\n </ul>\n </nav>\n );\n}\n\nPagination.displayName = 'Pagination';\n",".pinInput {\n display: inline-flex;\n gap: 10px;\n}\n\n.cell {\n width: 44px;\n height: 52px;\n padding: 0;\n border: 0;\n border-radius: 12px;\n background: var(--tgui--fill);\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 24px;\n font-weight: var(--tgui--weight-semibold);\n text-align: center;\n caret-color: var(--tgui--link);\n box-shadow: inset 0 0 0 1.5px transparent;\n transition: box-shadow 0.12s ease;\n}\n\n.cell:focus {\n outline: none;\n box-shadow: inset 0 0 0 1.5px var(--tgui--link);\n}\n\n.cell:disabled {\n opacity: 0.4;\n}\n\n.pinInput[data-invalid] .cell {\n box-shadow: inset 0 0 0 1.5px var(--tgui--destructive);\n}\n","'use client';\n\nimport {\n type ClipboardEvent as ReactClipboardEvent,\n type KeyboardEvent as ReactKeyboardEvent,\n type Ref,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './PinInput.module.css';\n\nconst PATTERNS = {\n numeric: /[0-9]/,\n alphanumeric: /[a-z0-9]/i,\n};\n\nexport interface PinInputProps {\n ref?: Ref<HTMLDivElement>;\n length?: number;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n onComplete?: (value: string) => void;\n type?: 'numeric' | 'alphanumeric';\n mask?: boolean;\n disabled?: boolean;\n invalid?: boolean;\n name?: string;\n 'aria-label'?: string;\n className?: string;\n}\n\nexport function PinInput({\n ref,\n length = 4,\n value: valueProp,\n defaultValue = '',\n onValueChange,\n onComplete,\n type = 'numeric',\n mask = false,\n disabled = false,\n invalid = false,\n name,\n 'aria-label': ariaLabel = 'Verification code',\n className,\n}: PinInputProps) {\n const [uncontrolled, setUncontrolled] = useState(defaultValue.slice(0, length));\n const raw = valueProp ?? uncontrolled;\n const chars = useMemo(() => {\n const next = raw.split('').slice(0, length);\n while (next.length < length) next.push('');\n return next;\n }, [raw, length]);\n\n const inputs = useRef<(HTMLInputElement | null)[]>([]);\n const pattern = PATTERNS[type];\n\n const commit = (next: string[]) => {\n const value = next.join('');\n if (valueProp == null) setUncontrolled(value);\n onValueChange?.(value);\n if (value.length === length && next.every(Boolean)) onComplete?.(value);\n };\n\n const focusCell = (index: number) => {\n const clamped = Math.max(0, Math.min(length - 1, index));\n inputs.current[clamped]?.focus();\n inputs.current[clamped]?.select();\n };\n\n const handleChange = (index: number, incoming: string) => {\n const char = incoming\n .split('')\n .reverse()\n .find((c) => pattern.test(c));\n if (!char) return;\n const next = [...chars];\n next[index] = char;\n commit(next);\n focusCell(index + 1);\n };\n\n const handleKeyDown = (index: number, event: ReactKeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Backspace') {\n event.preventDefault();\n const next = [...chars];\n if (next[index]) {\n next[index] = '';\n commit(next);\n } else if (index > 0) {\n next[index - 1] = '';\n commit(next);\n focusCell(index - 1);\n }\n } else if (event.key === 'ArrowLeft') {\n event.preventDefault();\n focusCell(index - 1);\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n focusCell(index + 1);\n }\n };\n\n const handlePaste = (index: number, event: ReactClipboardEvent<HTMLInputElement>) => {\n event.preventDefault();\n const pasted = event.clipboardData\n .getData('text')\n .split('')\n .filter((c) => pattern.test(c));\n if (pasted.length === 0) return;\n const next = [...chars];\n for (let i = 0; i < pasted.length && index + i < length; i += 1) {\n next[index + i] = pasted[i];\n }\n commit(next);\n focusCell(index + pasted.length);\n };\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: a labelled group of separate inputs; <fieldset> would add a border box and legend semantics we don't want\n <div\n ref={ref}\n data-slot=\"pin-input\"\n className={cn(styles.pinInput, className)}\n role=\"group\"\n aria-label={ariaLabel}\n data-invalid={invalid || undefined}\n >\n {chars.map((char, index) => (\n <input\n // biome-ignore lint/suspicious/noArrayIndexKey: fixed-length positional cells\n key={index}\n ref={(node) => {\n inputs.current[index] = node;\n }}\n data-slot=\"pin-input-cell\"\n className={styles.cell}\n aria-invalid={invalid || undefined}\n type={mask ? 'password' : 'text'}\n inputMode={type === 'numeric' ? 'numeric' : 'text'}\n autoComplete={index === 0 ? 'one-time-code' : 'off'}\n name={name ? `${name}-${index}` : undefined}\n aria-label={`${ariaLabel}, digit ${index + 1}`}\n maxLength={1}\n value={char}\n disabled={disabled}\n onChange={(event) => handleChange(index, event.target.value)}\n onKeyDown={(event) => handleKeyDown(index, event)}\n onPaste={(event) => handlePaste(index, event)}\n onFocus={(event) => event.target.select()}\n />\n ))}\n </div>\n );\n}\n\nPinInput.displayName = 'PinInput';\n",".level-1 {\n font-size: var(--tgui--font-title-1-size);\n line-height: var(--tgui--font-title-1-line);\n letter-spacing: var(--tgui--font-title-1-tracking);\n}\n\n.level-2 {\n font-size: var(--tgui--font-title-2-size);\n line-height: var(--tgui--font-title-2-line);\n letter-spacing: var(--tgui--font-title-2-tracking);\n}\n\n.level-3 {\n font-size: var(--tgui--font-title-3-size);\n line-height: var(--tgui--font-title-3-line);\n letter-spacing: var(--tgui--font-title-3-tracking);\n}\n","import type { ElementType } from 'react';\nimport type { TypographyProps } from '../Typography';\nimport styles from './Title.module.css';\n\nexport type TitleLevel = '1' | '2' | '3';\n\nexport const TITLE_LEVELS: Record<\n TitleLevel,\n { tag: ElementType; className: string; weight: NonNullable<TypographyProps['weight']> }\n> = {\n '1': { tag: 'h2', className: styles['level-1'], weight: '1' },\n '2': { tag: 'h3', className: styles['level-2'], weight: '1' },\n '3': { tag: 'h4', className: styles['level-3'], weight: '2' },\n};\n","import type { Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Typography, type TypographyProps } from '../Typography';\nimport { TITLE_LEVELS, type TitleLevel } from './Title.variants';\n\nexport interface TitleProps extends TypographyProps {\n ref?: Ref<HTMLElement>;\n level?: TitleLevel;\n}\n\nexport function Title({ ref, level = '2', weight, Component, className, ...rest }: TitleProps) {\n const { tag, className: levelClass, weight: levelWeight } = TITLE_LEVELS[level];\n\n return (\n <Typography\n data-slot=\"title\"\n ref={ref}\n weight={weight ?? levelWeight}\n Component={Component ?? tag}\n className={cn(levelClass, className)}\n {...rest}\n />\n );\n}\n\nTitle.displayName = 'Title';\n",".placeholder {\n overflow: hidden;\n\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n gap: 24px;\n padding: 32px;\n}\n\n.fields {\n margin: 0;\n text-align: center;\n overflow-wrap: anywhere;\n}\n\n.description {\n color: var(--tgui--label-secondary);\n}\n\n.description:not(:first-child) {\n margin-top: 8px;\n}\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Text } from '../Text';\nimport { Title } from '../Title';\nimport styles from './Placeholder.module.css';\n\nexport interface PlaceholderProps extends HTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n children?: ReactNode;\n header?: ReactNode;\n description?: ReactNode;\n action?: ReactNode;\n}\n\nexport function Placeholder({\n ref,\n children,\n header,\n description,\n action,\n className,\n ...rest\n}: PlaceholderProps) {\n return (\n <section\n ref={ref}\n data-slot=\"placeholder\"\n className={cn(styles.placeholder, className)}\n {...rest}\n >\n {children}\n {header != null || description != null ? (\n <dl data-slot=\"placeholder-fields\" className={styles.fields}>\n {header != null ? (\n <Title Component=\"dt\" level=\"3\" weight=\"2\">\n {header}\n </Title>\n ) : null}\n {description != null ? (\n <Text Component=\"dd\" className={styles.description}>\n {description}\n </Text>\n ) : null}\n </dl>\n ) : null}\n {action}\n </section>\n );\n}\n\nPlaceholder.displayName = 'Placeholder';\n","import { createContext, type RefObject } from 'react';\n\nexport interface PopoverContextValue {\n open: boolean;\n setOpen: (open: boolean) => void;\n triggerRef: RefObject<HTMLElement | null>;\n contentId: string;\n}\n\nexport const PopoverContext = createContext<PopoverContextValue>({\n open: false,\n setOpen: () => {},\n triggerRef: { current: null },\n contentId: '',\n});\n\nPopoverContext.displayName = 'PopoverContext';\n",".content {\n position: fixed;\n top: 0;\n inset-inline-start: 0;\n z-index: var(--tgui--z-overlay);\n min-width: 160px;\n max-width: 320px;\n border-radius: var(--tgui--radius);\n background: var(--tgui--surface-bg);\n color: var(--tgui--label);\n box-shadow: var(--tgui--overlay-shadow);\n}\n\n.content[data-side=\"bottom\"] {\n transform-origin: top center;\n}\n\n.content[data-side=\"top\"] {\n transform-origin: bottom center;\n}\n\n.content[data-side=\"left\"] {\n transform-origin: right center;\n}\n\n.content[data-side=\"right\"] {\n transform-origin: left center;\n}\n\n/* the canonical overlay motion — every component that appears anchored to a\n trigger (tooltip, menus, dialog) uses these exact values */\n@media (prefers-reduced-motion: no-preference) {\n .content[data-state=\"open\"] {\n animation: popover-in var(--tgui--duration-overlay) var(--tgui--ease-spring);\n }\n\n .content[data-state=\"closed\"] {\n animation: popover-out var(--tgui--duration-overlay) var(--tgui--ease-in) forwards;\n }\n}\n\n@keyframes popover-in {\n from {\n opacity: 0;\n transform: scale(0.96);\n }\n}\n\n@keyframes popover-out {\n to {\n opacity: 0;\n transform: scale(0.96);\n }\n}\n","'use client';\n\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { Presence } from '@radix-ui/react-presence';\nimport {\n type HTMLAttributes,\n type Ref,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport {\n computeFloatingPosition,\n type FloatingPlacement,\n type FloatingPosition,\n} from '../../shared/lib/floatingPosition';\nimport { Portal } from '../Portal';\nimport { PopoverContext } from './context';\nimport styles from './Popover.module.css';\n\nexport interface PopoverContentProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> {\n ref?: Ref<HTMLDivElement>;\n placement?: FloatingPlacement;\n gap?: number;\n container?: Element | DocumentFragment | null;\n className?: string;\n}\n\nexport function PopoverContent({\n ref,\n placement = 'bottom-start',\n gap = 8,\n container,\n className,\n children,\n ...rest\n}: PopoverContentProps) {\n const { open, setOpen, triggerRef, contentId } = useContext(PopoverContext);\n const nodeRef = useRef<HTMLDivElement | null>(null);\n const [contentNode, setContentNode] = useState<HTMLDivElement | null>(null);\n const [position, setPosition] = useState<FloatingPosition | null>(null);\n\n const reposition = useCallback(() => {\n const trigger = triggerRef.current;\n const node = nodeRef.current;\n if (!trigger || !node) return;\n setPosition(\n computeFloatingPosition(\n trigger.getBoundingClientRect(),\n node.getBoundingClientRect(),\n placement,\n gap,\n node,\n ),\n );\n }, [placement, gap, triggerRef]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: contentNode re-runs this once Presence actually mounts the div, one render after `open` flips\n useLayoutEffect(() => {\n if (open) reposition();\n }, [open, reposition, contentNode]);\n\n useEffect(() => {\n if (!open) return;\n const onScrollOrResize = () => reposition();\n window.addEventListener('resize', onScrollOrResize);\n window.addEventListener('scroll', onScrollOrResize, true);\n return () => {\n window.removeEventListener('resize', onScrollOrResize);\n window.removeEventListener('scroll', onScrollOrResize, true);\n };\n }, [open, reposition]);\n\n return (\n <Portal container={container}>\n <Presence present={open}>\n <FocusScope\n asChild\n trapped\n loop\n onUnmountAutoFocus={(event) => {\n event.preventDefault();\n triggerRef.current?.focus();\n }}\n >\n <DismissableLayer\n asChild\n deferPointerDownOutside\n onEscapeKeyDown={() => setOpen(false)}\n onPointerDownOutside={() => setOpen(false)}\n onFocusOutside={() => setOpen(false)}\n >\n <div\n ref={(node) => {\n nodeRef.current = node;\n setContentNode(node);\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as { current: HTMLDivElement | null }).current = node;\n }}\n id={contentId}\n role=\"dialog\"\n data-slot=\"popover-content\"\n data-side={position?.side}\n data-state={position ? (open ? 'open' : 'closed') : undefined}\n className={cn(styles.content, className)}\n style={\n position\n ? { top: position.top, left: position.left }\n : { top: 0, left: 0, opacity: 0, pointerEvents: 'none' }\n }\n {...rest}\n >\n {children}\n </div>\n </DismissableLayer>\n </FocusScope>\n </Presence>\n </Portal>\n );\n}\n\nPopoverContent.displayName = 'PopoverContent';\n","'use client';\n\nimport { cloneElement, isValidElement, type ReactElement, useContext } from 'react';\nimport { PopoverContext } from './context';\n\nexport interface PopoverTriggerProps {\n children: ReactElement;\n}\n\nexport function PopoverTrigger({ children }: PopoverTriggerProps) {\n const { open, setOpen, triggerRef, contentId } = useContext(PopoverContext);\n\n if (!isValidElement(children)) return children;\n\n const child = children as ReactElement<Record<string, unknown>>;\n const childRef = (child.props as { ref?: unknown }).ref;\n const childOnClick = child.props.onClick as ((event: unknown) => void) | undefined;\n\n return cloneElement(child, {\n ref: (node: HTMLElement | null) => {\n triggerRef.current = node;\n if (typeof childRef === 'function') childRef(node);\n else if (childRef && typeof childRef === 'object')\n (childRef as { current: HTMLElement | null }).current = node;\n },\n onClick: (event: unknown) => {\n childOnClick?.(event);\n setOpen(!open);\n },\n 'aria-haspopup': 'dialog',\n 'aria-expanded': open,\n 'aria-controls': open ? contentId : undefined,\n 'data-slot': 'popover-trigger',\n 'data-state': open ? 'open' : 'closed',\n });\n}\n\nPopoverTrigger.displayName = 'PopoverTrigger';\n","'use client';\n\nimport { type ReactNode, useCallback, useId, useRef, useState } from 'react';\nimport { PopoverContext } from './context';\nimport { PopoverContent } from './PopoverContent';\nimport { PopoverTrigger } from './PopoverTrigger';\n\nexport interface PopoverProps {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children: ReactNode;\n}\n\nexport function Popover({\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n children,\n}: PopoverProps) {\n const [uncontrolled, setUncontrolled] = useState(defaultOpen);\n const open = openProp ?? uncontrolled;\n const triggerRef = useRef<HTMLElement | null>(null);\n const contentId = useId();\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (openProp == null) setUncontrolled(next);\n onOpenChange?.(next);\n },\n [openProp, onOpenChange],\n );\n\n return (\n <PopoverContext.Provider value={{ open, setOpen, triggerRef, contentId }}>\n {children}\n </PopoverContext.Provider>\n );\n}\n\nPopover.displayName = 'Popover';\nPopover.Trigger = PopoverTrigger;\nPopover.Content = PopoverContent;\n",".track {\n overflow: hidden;\n width: 100%;\n height: 4px;\n border-radius: 2px;\n background: var(--tgui--fill);\n}\n\n.bar {\n height: 100%;\n border-radius: inherit;\n background: var(--tgui--link);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .bar {\n transition: width 0.25s ease;\n }\n}\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Progress.module.css';\n\nexport interface ProgressProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n value?: number;\n}\n\nexport function Progress({\n ref,\n value = 0,\n className,\n 'aria-label': ariaLabel,\n ...rest\n}: ProgressProps) {\n const clamped = Math.max(0, Math.min(100, value));\n return (\n <div\n ref={ref}\n role=\"progressbar\"\n aria-label={ariaLabel ?? 'Progress'}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={Math.round(clamped)}\n data-slot=\"progress\"\n className={cn(styles.track, className)}\n {...rest}\n >\n <div data-slot=\"progress-indicator\" className={styles.bar} style={{ width: `${clamped}%` }} />\n </div>\n );\n}\n\nProgress.displayName = 'Progress';\n",".radio {\n position: relative;\n display: inline-flex;\n cursor: pointer;\n}\n\n.radio[data-disabled] {\n cursor: default;\n opacity: 0.3;\n}\n\n.input {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n opacity: 0;\n cursor: inherit;\n}\n\n.dot {\n position: relative;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n box-shadow: inset 0 0 0 2px var(--tgui--separator);\n pointer-events: none;\n}\n\n.dot::after {\n content: \"\";\n position: absolute;\n inset: 5px;\n border-radius: 50%;\n background: var(--tgui--link);\n transform: scale(0);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .dot {\n transition: box-shadow 0.15s ease-out;\n }\n\n .dot::after {\n transition: transform 0.15s ease-out;\n }\n}\n\n.input:checked + .dot {\n box-shadow: inset 0 0 0 2px var(--tgui--link);\n}\n\n.input:checked + .dot::after {\n transform: scale(1);\n}\n\n.input:focus-visible + .dot {\n box-shadow:\n inset 0 0 0 2px var(--tgui--separator),\n var(--tgui--focus-ring-shadow);\n}\n\n.input:checked:focus-visible + .dot {\n box-shadow:\n inset 0 0 0 2px var(--tgui--accent),\n var(--tgui--focus-ring-shadow);\n}\n","import type { ChangeEvent, InputHTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic } from '../TguiProvider';\nimport styles from './Radio.module.css';\n\nexport interface RadioProps extends InputHTMLAttributes<HTMLInputElement> {\n ref?: Ref<HTMLInputElement>;\n}\n\nexport function Radio({ ref, disabled, className, style, onChange, ...rest }: RadioProps) {\n const haptic = useHaptic();\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n haptic('select');\n onChange?.(event);\n };\n\n return (\n <span\n data-slot=\"radio\"\n className={cn(styles.radio, className)}\n style={style}\n data-disabled={disabled || undefined}\n >\n <input\n ref={ref}\n type=\"radio\"\n data-slot=\"radio-input\"\n className={styles.input}\n disabled={disabled}\n onChange={handleChange}\n {...rest}\n />\n <span className={styles.dot} data-slot=\"radio-indicator\" aria-hidden />\n </span>\n );\n}\n\nRadio.displayName = 'Radio';\n",".rating {\n position: relative;\n display: inline-flex;\n width: max-content;\n}\n\n.row {\n display: flex;\n gap: 2px;\n}\n\n.empty {\n color: color-mix(in srgb, var(--tgui--rating-color, #f5a623) 22%, transparent);\n}\n\n.fill {\n position: absolute;\n inset: 0;\n pointer-events: none;\n color: var(--tgui--rating-color, #f5a623);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .fill {\n transition: clip-path 0.15s ease-out;\n }\n}\n\n.star {\n display: block;\n width: 1em;\n height: 1em;\n padding: 0;\n border: 0;\n background: transparent;\n color: inherit;\n font-size: 24px;\n line-height: 0;\n}\n\n.rating[data-interactive] .star {\n cursor: pointer;\n}\n\n.rating[data-interactive]:not([data-disabled]) .star:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n border-radius: 4px;\n}\n\n.star svg {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n.rating[data-disabled] {\n opacity: 0.4;\n}\n","'use client';\n\nimport {\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n type Ref,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic } from '../TguiProvider';\nimport styles from './Rating.module.css';\n\nconst DefaultStar = (\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden>\n <path d=\"M12 2l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.8 5.9 20.4l1.4-6.8L2.2 9.1l6.9-.8z\" />\n </svg>\n);\n\nexport interface RatingProps {\n ref?: Ref<HTMLDivElement>;\n value?: number;\n defaultValue?: number;\n onValueChange?: (value: number) => void;\n count?: number;\n readOnly?: boolean;\n disabled?: boolean;\n icon?: ReactNode;\n name?: string;\n 'aria-label'?: string;\n className?: string;\n}\n\nexport function Rating({\n ref,\n value: valueProp,\n defaultValue = 0,\n onValueChange,\n count = 5,\n readOnly = false,\n disabled = false,\n icon = DefaultStar,\n name,\n 'aria-label': ariaLabel = 'Rating',\n className,\n}: RatingProps) {\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n const value = valueProp ?? uncontrolled;\n const [hovered, setHovered] = useState<number | null>(null);\n\n const interactive = !readOnly && !disabled;\n const shown = hovered ?? value;\n const pct = Math.max(0, Math.min(1, shown / count)) * 100;\n const haptic = useHaptic();\n\n const set = (next: number) => {\n if (!interactive || next === value) return;\n haptic('select');\n if (valueProp == null) setUncontrolled(next);\n onValueChange?.(next);\n };\n\n const onKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n if (!interactive) return;\n if (event.key === 'ArrowRight' || event.key === 'ArrowUp') {\n event.preventDefault();\n set(Math.min(count, Math.round(value) + 1));\n } else if (event.key === 'ArrowLeft' || event.key === 'ArrowDown') {\n event.preventDefault();\n set(Math.max(0, Math.round(value) - 1));\n }\n };\n\n const stars = Array.from({ length: count }, (_, i) => i + 1);\n\n const interactiveHandlers = interactive\n ? { onKeyDown, onMouseLeave: () => setHovered(null) }\n : {};\n\n const role = interactive ? 'radiogroup' : 'img';\n const label = interactive ? ariaLabel : `${ariaLabel}: ${value} out of ${count}`;\n\n return (\n // biome-ignore lint/a11y/useAriaPropsSupportedByRole: role is radiogroup or img, both support aria-label\n <div\n ref={ref}\n data-slot=\"rating\"\n data-interactive={interactive || undefined}\n className={cn(styles.rating, className)}\n data-disabled={disabled || undefined}\n role={role}\n aria-label={label}\n {...interactiveHandlers}\n >\n <div className={cn(styles.row, styles.empty)} aria-hidden={!interactive}>\n {stars.map((star) =>\n interactive ? (\n // biome-ignore lint/a11y/useSemanticElements: a button in a radiogroup is the rating ARIA pattern; a native radio can't hold the icon\n <button\n key={star}\n type=\"button\"\n role=\"radio\"\n aria-checked={Math.round(value) === star}\n aria-label={`${star}`}\n tabIndex={star === (Math.round(value) || 1) ? 0 : -1}\n name={name}\n data-slot=\"rating-star\"\n className={styles.star}\n onClick={() => set(star)}\n onMouseEnter={() => setHovered(star)}\n onFocus={() => setHovered(star)}\n onBlur={() => setHovered(null)}\n >\n {icon}\n </button>\n ) : (\n <span key={star} data-slot=\"rating-star\" className={styles.star}>\n {icon}\n </span>\n ),\n )}\n </div>\n <div className={styles.fill} style={{ clipPath: `inset(0 ${100 - pct}% 0 0)` }} aria-hidden>\n <div className={styles.row}>\n {stars.map((star) => (\n <span key={star} data-slot=\"rating-star\" className={styles.star}>\n {icon}\n </span>\n ))}\n </div>\n </div>\n </div>\n );\n}\n\nRating.displayName = 'Rating';\n",".bar {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n}\n\n.field {\n position: relative;\n display: flex;\n align-items: center;\n flex: 1;\n min-width: 0;\n height: var(--tgui--field-min-height);\n padding: 0 var(--tgui--field-padding-x);\n border-radius: var(--tgui--field-radius);\n background: var(--tgui--fill);\n}\n\n.icon {\n flex-shrink: 0;\n margin-inline-end: var(--tgui--field-gap);\n color: var(--tgui--label-secondary);\n}\n\n.input {\n flex: 1;\n min-width: 0;\n height: 100%;\n margin: 0;\n padding: 0;\n border: 0;\n outline: 0;\n background: transparent;\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 16px;\n}\n\n.input::placeholder {\n color: var(--tgui--label-tertiary);\n}\n\n.input::-webkit-search-cancel-button,\n.input::-webkit-search-decoration {\n appearance: none;\n}\n\n.clear {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n margin-inline-start: 4px;\n padding: 0;\n border: 0;\n border-radius: 50%;\n color: var(--tgui--label-secondary);\n background: transparent;\n cursor: pointer;\n}\n\n.clear:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n.cancel {\n flex-shrink: 0;\n overflow: hidden;\n max-width: 0;\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--tgui--link-strong);\n font-family: var(--tgui--font-family);\n font-size: 16px;\n white-space: nowrap;\n cursor: pointer;\n opacity: 0;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .cancel {\n transition:\n opacity 0.2s ease,\n max-width 0.2s ease;\n }\n}\n\n.cancel:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n.bar[data-focused] .cancel {\n max-width: 80px;\n opacity: 1;\n}\n","'use client';\n\nimport {\n type ChangeEvent,\n type HTMLAttributes,\n type MouseEvent,\n type Ref,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './SearchBar.module.css';\n\nexport interface SearchBarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {\n ref?: Ref<HTMLDivElement>;\n value: string;\n onChange: (value: string) => void;\n placeholder?: string;\n onCancel?: () => void;\n label?: string;\n}\n\nconst preventFocusLoss = (event: MouseEvent<HTMLButtonElement>) => event.preventDefault();\n\nexport function SearchBar({\n ref,\n value,\n onChange,\n placeholder = 'Search',\n onCancel,\n label = 'Search',\n className,\n ...rest\n}: SearchBarProps) {\n const inputRef = useRef<HTMLInputElement | null>(null);\n const [focused, setFocused] = useState(false);\n\n const handleClear = () => {\n onChange('');\n inputRef.current?.focus();\n };\n\n const handleCancel = () => {\n onCancel?.();\n inputRef.current?.blur();\n };\n\n return (\n <div\n ref={ref}\n data-slot=\"search-bar\"\n data-focused={focused || undefined}\n className={cn(styles.bar, className)}\n {...rest}\n >\n <div data-slot=\"search-bar-field\" className={styles.field}>\n <svg\n data-slot=\"search-bar-icon\"\n className={styles.icon}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden\n >\n <circle cx=\"7\" cy=\"7\" r=\"5.25\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path\n d=\"M11.5 11.5L14.5 14.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n <input\n ref={inputRef}\n type=\"search\"\n data-slot=\"search-bar-input\"\n className={styles.input}\n value={value}\n placeholder={placeholder}\n aria-label={label}\n onChange={(event: ChangeEvent<HTMLInputElement>) => onChange(event.target.value)}\n onFocus={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n />\n {value.length > 0 ? (\n <button\n type=\"button\"\n data-slot=\"search-bar-clear\"\n className={styles.clear}\n aria-label=\"Clear\"\n onMouseDown={preventFocusLoss}\n onClick={handleClear}\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden>\n <circle cx=\"7\" cy=\"7\" r=\"7\" fill=\"currentColor\" opacity=\"0.15\" />\n <path\n d=\"M4.5 4.5l5 5M9.5 4.5l-5 5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.4\"\n strokeLinecap=\"round\"\n />\n </svg>\n </button>\n ) : null}\n </div>\n {onCancel != null ? (\n <button\n type=\"button\"\n data-slot=\"search-bar-cancel\"\n className={styles.cancel}\n tabIndex={focused ? 0 : -1}\n onMouseDown={preventFocusLoss}\n onClick={handleCancel}\n >\n Cancel\n </button>\n ) : null}\n </div>\n );\n}\n\nSearchBar.displayName = 'SearchBar';\n",".body {\n display: flex;\n flex-direction: column;\n}\n\n/* row separators run the full card width – flush to the card edge, never inset to the content */\n.body > hr {\n margin-inline: 0;\n}\n\n.sectionBase .bodyWithHeader {\n background: var(--tgui--surface-bg);\n box-shadow: var(--tgui--shadow-sm);\n}\n\n.sectionIos .body {\n border-radius: var(--tgui--radius);\n background: var(--tgui--surface-bg);\n}\n\n.sectionIos .body > :first-child {\n border-radius: var(--tgui--radius) var(--tgui--radius) 0 0;\n}\n\n.sectionIos .body > :last-child {\n border-radius: 0 0 var(--tgui--radius) var(--tgui--radius);\n}\n\n.sectionIos .body > :only-child {\n border-radius: var(--tgui--radius);\n}\n\n.header {\n padding: 20px 24px 4px 22px;\n color: var(--tgui--label-secondary);\n}\n\n.headerLarge {\n padding-inline-start: 24px;\n color: var(--tgui--label);\n}\n\n.headerIos {\n padding: 16px 16px 8px;\n color: var(--tgui--label-secondary);\n}\n\n.headerIos.headerLarge {\n padding: 0 0 12px;\n color: var(--tgui--label);\n}\n\n.footer {\n padding: 12px 24px;\n}\n\n.footerIos {\n padding: 8px 16px 0;\n}\n\n.footerCentered {\n padding: 16px 24px 20px;\n text-align: center;\n}\n\n.footerIos.footerCentered {\n padding: 16px 16px 0;\n}\n\n.footerText {\n color: var(--tgui--label-secondary);\n}\n","'use client';\n\nimport type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Caption } from '../Caption';\nimport { Subheadline } from '../Subheadline';\nimport { useTgui } from '../TguiProvider';\nimport styles from './Section.module.css';\n\nexport interface SectionFooterProps extends HTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n centered?: boolean;\n}\n\nfunction FooterText({ ios, children }: { ios: boolean; children: ReactNode }) {\n return ios ? (\n <Caption Component=\"span\" className={styles.footerText}>\n {children}\n </Caption>\n ) : (\n <Subheadline Component=\"span\" level=\"2\" className={styles.footerText}>\n {children}\n </Subheadline>\n );\n}\n\nexport function SectionFooter({\n ref,\n centered = false,\n className,\n children,\n ...rest\n}: SectionFooterProps) {\n const { platform } = useTgui();\n const ios = platform === 'ios';\n\n return (\n <footer\n ref={ref}\n data-slot=\"section-footer\"\n className={cn(\n styles.footer,\n ios && styles.footerIos,\n centered && styles.footerCentered,\n className,\n )}\n {...rest}\n >\n <FooterText ios={ios}>{children}</FooterText>\n </footer>\n );\n}\n\nSectionFooter.displayName = 'SectionFooter';\n","'use client';\n\nimport type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Caption } from '../Caption';\nimport { Subheadline } from '../Subheadline';\nimport { Text } from '../Text';\nimport { useTgui } from '../TguiProvider';\nimport styles from './Section.module.css';\n\nexport interface SectionHeaderProps extends HTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n large?: boolean;\n}\n\nfunction HeaderText({\n ios,\n large,\n children,\n}: {\n ios: boolean;\n large: boolean;\n children: ReactNode;\n}) {\n if (large) {\n return ios ? (\n <Subheadline Component=\"h2\" level=\"1\" weight=\"2\">\n {children}\n </Subheadline>\n ) : (\n <Text Component=\"h2\" weight=\"2\">\n {children}\n </Text>\n );\n }\n return ios ? (\n <Caption Component=\"h2\" caps>\n {children}\n </Caption>\n ) : (\n <Subheadline Component=\"h2\" level=\"2\" weight=\"2\">\n {children}\n </Subheadline>\n );\n}\n\nexport function SectionHeader({\n ref,\n large = false,\n className,\n children,\n ...rest\n}: SectionHeaderProps) {\n const { platform } = useTgui();\n const ios = platform === 'ios';\n\n return (\n <header\n ref={ref}\n data-slot=\"section-header\"\n className={cn(styles.header, ios && styles.headerIos, large && styles.headerLarge, className)}\n {...rest}\n >\n <HeaderText ios={ios} large={large}>\n {children}\n </HeaderText>\n </header>\n );\n}\n\nSectionHeader.displayName = 'SectionHeader';\n","'use client';\n\nimport {\n Children,\n Fragment,\n type HTMLAttributes,\n isValidElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Divider } from '../Divider';\nimport { useTgui } from '../TguiProvider';\nimport styles from './Section.module.css';\nimport { SectionFooter } from './SectionFooter';\nimport { SectionHeader } from './SectionHeader';\n\nexport interface SectionProps extends HTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n header?: ReactNode;\n footer?: ReactNode;\n}\n\nconst isText = (node: ReactNode) => typeof node === 'string' || typeof node === 'number';\n\nexport function Section({ ref, header, footer, className, children, ...rest }: SectionProps) {\n const { platform } = useTgui();\n const rows = Children.toArray(children);\n\n return (\n <section\n ref={ref}\n data-slot=\"section\"\n className={cn(platform === 'ios' ? styles.sectionIos : styles.sectionBase, className)}\n {...rest}\n >\n <div className={styles.bodyWithHeader}>\n {isText(header) ? <SectionHeader>{header}</SectionHeader> : header}\n <div data-slot=\"section-body\" className={styles.body}>\n {rows.map((row, i) => (\n <Fragment key={isValidElement(row) ? row.key : i}>\n {row}\n {i < rows.length - 1 ? <Divider /> : null}\n </Fragment>\n ))}\n </div>\n </div>\n {isText(footer) ? <SectionFooter>{footer}</SectionFooter> : footer}\n </section>\n );\n}\n\nSection.displayName = 'Section';\nSection.Header = SectionHeader;\nSection.Footer = SectionFooter;\n","import { createContext } from 'react';\n\nexport interface SegmentedControlContextValue {\n value: string | undefined;\n select: (value: string) => void;\n}\n\nexport const SegmentedControlContext = createContext<SegmentedControlContextValue | null>(null);\n",".control {\n position: relative;\n display: flex;\n box-sizing: border-box;\n padding: 2px;\n border-radius: 9px;\n background: var(--tgui--accent-fill);\n}\n\n.pill {\n position: absolute;\n top: 2px;\n left: 0;\n bottom: 2px;\n border-radius: 7px;\n background: var(--tgui--surface-bg);\n box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .pill {\n transition:\n transform var(--tgui--duration-fast) var(--tgui--ease-spring),\n width var(--tgui--duration-fast) var(--tgui--ease-spring);\n }\n}\n\n.item {\n position: relative;\n z-index: var(--tgui--z-base, 1);\n flex: 1 1 0;\n min-width: 0;\n padding: 6px 12px;\n border: 0;\n border-radius: 7px;\n background: transparent;\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 14px;\n font-weight: var(--tgui--weight-semibold);\n line-height: 20px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n cursor: pointer;\n transition: color 0.15s ease;\n}\n\n.item:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: calc(-1 * var(--tgui--focus-ring-offset));\n}\n\n.item[data-selected] {\n cursor: default;\n}\n\n.item:disabled {\n opacity: 0.35;\n cursor: default;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .item:not([data-selected]):not(:disabled):hover {\n color: var(--tgui--link-strong);\n }\n}\n","'use client';\n\nimport {\n type HTMLAttributes,\n type MutableRefObject,\n type KeyboardEvent as ReactKeyboardEvent,\n type Ref,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic } from '../TguiProvider';\nimport { SegmentedControlContext } from './context';\nimport styles from './SegmentedControl.module.css';\n\nexport interface SegmentedControlProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue'> {\n ref?: Ref<HTMLDivElement>;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n}\n\nexport function SegmentedControl({\n ref,\n value: valueProp,\n defaultValue,\n onValueChange,\n className,\n children,\n onKeyDown,\n ...rest\n}: SegmentedControlProps) {\n const trackRef = useRef<HTMLDivElement | null>(null);\n const [pill, setPill] = useState<{ left: number; width: number } | null>(null);\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n const value = valueProp ?? uncontrolled;\n const haptic = useHaptic();\n\n const select = useCallback(\n (next: string) => {\n if (next === (valueProp ?? uncontrolled)) return;\n haptic('select');\n if (valueProp == null) setUncontrolled(next);\n onValueChange?.(next);\n },\n [valueProp, uncontrolled, onValueChange, haptic],\n );\n\n const context = useMemo(() => ({ value, select }), [value, select]);\n\n const measure = useCallback(() => {\n const track = trackRef.current;\n if (!track) return;\n const selected = track.querySelector<HTMLElement>('[role=\"radio\"][data-selected]');\n const next = selected ? { left: selected.offsetLeft, width: selected.offsetWidth } : null;\n setPill((prev) => {\n if (prev === next) return prev;\n if (prev && next && prev.left === next.left && prev.width === next.width) return prev;\n return next;\n });\n }, []);\n\n useLayoutEffect(measure);\n\n useEffect(() => {\n const track = trackRef.current;\n if (!track || typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(measure);\n observer.observe(track);\n return () => observer.disconnect();\n }, [measure]);\n\n const setRef = useCallback(\n (node: HTMLDivElement | null) => {\n trackRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [ref],\n );\n\n const handleKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return;\n const track = trackRef.current;\n if (!track) return;\n const radios = Array.from(\n track.querySelectorAll<HTMLButtonElement>('[role=\"radio\"]:not(:disabled)'),\n );\n const current = radios.indexOf(document.activeElement as HTMLButtonElement);\n if (current < 0) return;\n event.preventDefault();\n const delta = event.key === 'ArrowRight' ? 1 : -1;\n const next = radios[(current + delta + radios.length) % radios.length];\n next.focus();\n next.click();\n };\n\n return (\n <SegmentedControlContext.Provider value={context}>\n <div\n ref={setRef}\n role=\"radiogroup\"\n data-slot=\"segmented-control\"\n className={cn(styles.control, className)}\n onKeyDown={handleKeyDown}\n {...rest}\n >\n <div\n className={styles.pill}\n data-slot=\"segmented-control-indicator\"\n style={\n pill ? { transform: `translateX(${pill.left}px)`, width: pill.width } : { opacity: 0 }\n }\n aria-hidden\n />\n {children}\n </div>\n </SegmentedControlContext.Provider>\n );\n}\n\nSegmentedControl.displayName = 'SegmentedControl';\n","'use client';\n\nimport { type ButtonHTMLAttributes, type Ref, useContext } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { SegmentedControlContext } from './context';\nimport styles from './SegmentedControl.module.css';\n\nexport interface SegmentedControlItemProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {\n ref?: Ref<HTMLButtonElement>;\n value?: string;\n selected?: boolean;\n}\n\nexport function SegmentedControlItem({\n ref,\n value,\n selected: selectedProp,\n className,\n onClick,\n ...rest\n}: SegmentedControlItemProps) {\n const ctx = useContext(SegmentedControlContext);\n const selected = selectedProp ?? (ctx != null && value != null && ctx.value === value);\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: a button in a radiogroup is the segmented-control ARIA pattern; a native radio can't hold arbitrary content\n <button\n ref={ref}\n type=\"button\"\n role=\"radio\"\n aria-checked={selected}\n tabIndex={selected ? 0 : -1}\n data-slot=\"segmented-control-item\"\n data-selected={selected || undefined}\n data-state={selected ? 'active' : 'inactive'}\n className={cn(styles.item, className)}\n onClick={(event) => {\n onClick?.(event);\n if (value != null) ctx?.select(value);\n }}\n {...rest}\n />\n );\n}\n\nSegmentedControlItem.displayName = 'SegmentedControlItem';\n",".base {\n position: relative;\n padding: 20px 22px 16px;\n background: var(--tgui--bg);\n}\n\n.row {\n display: block;\n position: relative;\n box-sizing: border-box;\n border-radius: 14px;\n}\n\n.base .row {\n box-shadow: inset 0 0 0 1.5px var(--tgui--separator-opaque);\n}\n\n.ios .row {\n border-radius: 12px;\n background: var(--tgui--fill);\n}\n\n.select {\n appearance: none;\n display: block;\n width: 100%;\n min-height: 48px;\n margin: 0;\n padding: 12px 44px 12px 16px;\n border: 0;\n outline: 0;\n border-radius: inherit;\n background: transparent;\n color: var(--tgui--label);\n}\n\n.chevron {\n position: absolute;\n top: 50%;\n inset-inline-end: 18px;\n width: 8px;\n height: 8px;\n border: solid var(--tgui--label-tertiary);\n border-width: 0 2px 2px 0;\n transform: translateY(-75%) rotate(45deg);\n pointer-events: none;\n}\n\n.header {\n position: absolute;\n top: -7px;\n inset-inline-start: 10px;\n margin: 0;\n max-width: calc(100% - 20px);\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n padding: 0 6px;\n font-size: 13px;\n border-radius: 5px;\n color: var(--tgui--label-secondary);\n background: var(--tgui--bg);\n}\n\n/* iOS filled selects don't show a floating label – keep it for assistive tech */\n.ios .header {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n}\n\n.base[data-state=\"focused\"] .row {\n box-shadow: inset 0 0 0 2px var(--tgui--link);\n}\n\n.base[data-state=\"focused\"] .header {\n color: var(--tgui--link-strong);\n}\n\n.base[data-state=\"error\"] .row {\n box-shadow: inset 0 0 0 2px var(--tgui--destructive);\n}\n\n.base[data-state=\"error\"] .header {\n color: var(--tgui--destructive-strong);\n}\n\n.ios[data-state=\"error\"] .row {\n box-shadow: inset 0 0 0 1.5px var(--tgui--destructive);\n}\n\n.base[data-disabled],\n.ios[data-disabled] {\n pointer-events: none;\n}\n\n.ios[data-disabled] {\n opacity: 0.35;\n}\n","'use client';\n\nimport {\n type FocusEvent,\n type ReactNode,\n type Ref,\n type SelectHTMLAttributes,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport type { InputStatus } from '../Input';\nimport { Subheadline } from '../Subheadline';\nimport { Text } from '../Text';\nimport { useTgui } from '../TguiProvider';\nimport styles from './Select.module.css';\n\nexport interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {\n ref?: Ref<HTMLSelectElement>;\n header?: ReactNode;\n status?: InputStatus;\n}\n\nexport function Select({\n ref,\n header,\n status,\n disabled,\n className,\n onFocus,\n onBlur,\n children,\n ...rest\n}: SelectProps) {\n const { platform } = useTgui();\n const ios = platform === 'ios';\n const [focused, setFocused] = useState(false);\n const state = status ?? (focused ? 'focused' : 'default');\n const Typography = ios ? Text : Subheadline;\n\n const handleFocus = (event: FocusEvent<HTMLSelectElement>) => {\n if (!disabled) setFocused(true);\n onFocus?.(event);\n };\n const handleBlur = (event: FocusEvent<HTMLSelectElement>) => {\n setFocused(false);\n onBlur?.(event);\n };\n\n return (\n <div\n data-slot=\"select\"\n data-state={state}\n data-disabled={disabled || undefined}\n className={cn(ios ? styles.ios : styles.base, className)}\n aria-disabled={disabled || undefined}\n >\n {/* biome-ignore lint/a11y/noLabelWithoutControl: the control is the select rendered below */}\n <label className={styles.row} data-slot=\"select-row\">\n <Typography\n ref={ref as Ref<HTMLElement>}\n Component=\"select\"\n data-slot=\"select-control\"\n className={styles.select}\n disabled={disabled}\n aria-invalid={state === 'error' || undefined}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...rest}\n >\n {children}\n </Typography>\n <span aria-hidden data-slot=\"select-chevron\" className={styles.chevron} />\n {/* names the select; visually hidden on iOS (see FormField) */}\n {header != null ? (\n <span className={styles.header} data-slot=\"select-label\">\n {header}\n </span>\n ) : null}\n </label>\n </div>\n );\n}\n\nSelect.displayName = 'Select';\n","import { useSyncExternalStore } from 'react';\n\nconst QUERY = '(prefers-reduced-motion: reduce)';\n\nfunction subscribe(callback: () => void) {\n if (typeof window === 'undefined' || !window.matchMedia) return () => {};\n const query = window.matchMedia(QUERY);\n query.addEventListener('change', callback);\n return () => query.removeEventListener('change', callback);\n}\n\nfunction getSnapshot() {\n if (typeof window === 'undefined' || !window.matchMedia) return false;\n return window.matchMedia(QUERY).matches;\n}\n\nexport function useReducedMotion() {\n return useSyncExternalStore(subscribe, getSnapshot, () => false);\n}\n",".backdrop {\n position: fixed;\n inset: 0;\n z-index: var(--tgui--z-overlay, 1000);\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n background: rgb(0 0 0 / 0.4);\n opacity: 0;\n}\n\n.backdrop--contained {\n position: absolute;\n}\n\n.backdrop[data-state=\"open\"] {\n opacity: 1;\n}\n\n.panel {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n max-width: 512px;\n max-height: var(--tgui--sheet-max-height, 50%);\n margin: 0 auto;\n border-radius: 16px 16px 0 0;\n /* every surface that appears over the page shares one background */\n background: var(--tgui--surface-bg);\n color: var(--tgui--label);\n box-shadow:\n 0 -0.5px 0 var(--tgui--separator),\n 0 -8px 40px rgb(0 0 0 / 0.4);\n transform: translateY(100%);\n will-change: transform;\n contain: layout;\n}\n\n.panel[data-state=\"open\"] {\n transform: translateY(0);\n}\n\n/* a sheet is edge-anchored – it slides from the edge it lives on, but shares the\n kit's spring easing with every other surface that appears */\n@media (prefers-reduced-motion: no-preference) {\n .backdrop {\n transition: opacity var(--tgui--duration-slow) ease;\n }\n\n .panel {\n transition: transform var(--tgui--duration-slow) var(--tgui--ease-spring);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .backdrop {\n transition: opacity var(--tgui--duration-overlay) linear;\n }\n\n .panel {\n transform: none;\n opacity: 0;\n transition: opacity var(--tgui--duration-overlay) linear;\n }\n\n .panel[data-state=\"open\"] {\n opacity: 1;\n }\n}\n\n.grip {\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n padding-top: 8px;\n touch-action: none;\n cursor: grab;\n}\n\n.handle {\n align-self: center;\n width: 36px;\n height: 4px;\n border-radius: 2px;\n background: var(--tgui--fill-secondary, var(--tgui--fill));\n}\n\n.header {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 12px 20px;\n font-family: var(--tgui--font-family);\n font-size: 20px;\n font-weight: var(--tgui--weight-bold);\n line-height: 1.2;\n}\n\n.title {\n flex: 1;\n min-width: 0;\n}\n\n.close {\n margin-inline-end: -7px;\n color: var(--tgui--label-secondary);\n}\n\n.body {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n overscroll-behavior: contain;\n padding: 4px 20px\n calc(20px + var(--tgui--safe-area-bottom) + var(--tgui--content-safe-area-bottom));\n -webkit-overflow-scrolling: touch;\n}\n\n.grip + .body {\n padding-top: 0;\n}\n","'use client';\n\nimport {\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n type PointerEvent as ReactPointerEvent,\n type Ref,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { getTelegramWebApp } from '../../shared/lib/telegram';\nimport { useReducedMotion } from '../../shared/lib/useReducedMotion';\nimport { IconButton } from '../IconButton';\nimport { Portal } from '../Portal';\nimport styles from './Sheet.module.css';\n\nconst DURATION_MS = 340;\nconst DRAG_THRESHOLD = 6;\nconst DISMISS_DISTANCE = 96;\nconst DISMISS_VELOCITY = 0.5;\n\nexport interface SheetProps {\n ref?: Ref<HTMLDivElement>;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n header?: ReactNode;\n children?: ReactNode;\n dismissable?: boolean;\n closeLabel?: string;\n className?: string;\n container?: Element | DocumentFragment | null;\n}\n\nfunction focusable(root: HTMLElement) {\n return Array.from(\n root.querySelectorAll<HTMLElement>(\n 'a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex=\"-1\"])',\n ),\n ).filter((el) => el.offsetParent !== null || el === document.activeElement);\n}\n\nexport function Sheet({\n ref,\n open,\n onOpenChange,\n header,\n children,\n dismissable = true,\n closeLabel = 'Close',\n className,\n container,\n}: SheetProps) {\n const reducedMotion = useReducedMotion();\n const contained = container != null;\n const [rendered, setRendered] = useState(open);\n const [visible, setVisible] = useState(false);\n\n const panelRef = useRef<HTMLDivElement | null>(null);\n const restoreFocusRef = useRef<HTMLElement | null>(null);\n const drag = useRef({ id: -1, active: false, startY: 0, lastY: 0, lastT: 0, velocity: 0 });\n\n useEffect(() => {\n if (open) {\n setRendered(true);\n return;\n }\n setVisible(false);\n if (reducedMotion) {\n setRendered(false);\n return;\n }\n const id = setTimeout(() => setRendered(false), DURATION_MS);\n return () => clearTimeout(id);\n }, [open, reducedMotion]);\n\n useEffect(() => {\n if (!rendered || !open) return;\n const panel = panelRef.current;\n if (!panel) return;\n // reflow so the browser registers the off-screen start before the class flips\n void panel.offsetHeight;\n setVisible(true);\n }, [rendered, open]);\n\n useEffect(() => {\n if (!rendered) return;\n restoreFocusRef.current = document.activeElement as HTMLElement | null;\n\n const { body, documentElement } = document;\n const previous = { overflow: body.style.overflow, paddingRight: body.style.paddingRight };\n if (!contained) {\n const scrollbar = window.innerWidth - documentElement.clientWidth;\n body.style.overflow = 'hidden';\n if (scrollbar > 0) body.style.paddingRight = `${scrollbar}px`;\n }\n\n const id = requestAnimationFrame(() => panelRef.current?.focus({ preventScroll: true }));\n return () => {\n cancelAnimationFrame(id);\n body.style.overflow = previous.overflow;\n body.style.paddingRight = previous.paddingRight;\n restoreFocusRef.current?.focus?.({ preventScroll: true });\n };\n }, [rendered, contained]);\n\n useEffect(() => {\n if (!rendered) return;\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape' && dismissable) {\n event.stopPropagation();\n onOpenChange(false);\n }\n };\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [rendered, dismissable, onOpenChange]);\n\n // stop Telegram's swipe-to-minimise from fighting the sheet's own drag-to-dismiss\n useEffect(() => {\n if (!rendered) return;\n const webApp = getTelegramWebApp();\n if (typeof webApp?.disableVerticalSwipes !== 'function') return;\n webApp.disableVerticalSwipes();\n return () => webApp.enableVerticalSwipes?.();\n }, [rendered]);\n\n const trapTab = useCallback((event: ReactKeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'Tab' || !panelRef.current) return;\n const items = focusable(panelRef.current);\n if (items.length === 0) {\n event.preventDefault();\n panelRef.current.focus();\n return;\n }\n const first = items[0];\n const last = items[items.length - 1];\n const active = document.activeElement;\n if (event.shiftKey && (active === first || active === panelRef.current)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && active === last) {\n event.preventDefault();\n first.focus();\n }\n }, []);\n\n const onPointerDown = (event: ReactPointerEvent<HTMLDivElement>) => {\n if (!dismissable || event.button !== 0 || reducedMotion) return;\n if ((event.target as HTMLElement).closest('button')) return;\n drag.current = {\n id: event.pointerId,\n active: false,\n startY: event.clientY,\n lastY: event.clientY,\n lastT: event.timeStamp,\n velocity: 0,\n };\n };\n\n const onPointerMove = (event: ReactPointerEvent<HTMLDivElement>) => {\n const state = drag.current;\n if (state.id !== event.pointerId) return;\n const delta = event.clientY - state.startY;\n if (!state.active) {\n if (delta < DRAG_THRESHOLD) return;\n state.active = true;\n event.currentTarget.setPointerCapture(event.pointerId);\n if (panelRef.current) panelRef.current.style.transition = 'none';\n }\n const dt = event.timeStamp - state.lastT;\n if (dt >= 1) {\n const instant = (event.clientY - state.lastY) / dt;\n state.velocity = state.velocity * 0.6 + instant * 0.4;\n state.lastY = event.clientY;\n state.lastT = event.timeStamp;\n }\n if (panelRef.current) {\n panelRef.current.style.transform = `translateY(${Math.max(0, delta)}px)`;\n }\n };\n\n const endDrag = (event: ReactPointerEvent<HTMLDivElement>) => {\n const state = drag.current;\n if (state.id !== event.pointerId) return;\n drag.current = { ...state, id: -1, active: false };\n if (!state.active) return;\n event.currentTarget.releasePointerCapture?.(event.pointerId);\n\n const panel = panelRef.current;\n const travelled = event.clientY - state.startY;\n const dismiss = travelled > DISMISS_DISTANCE || state.velocity > DISMISS_VELOCITY;\n\n if (panel) {\n panel.style.transition = '';\n panel.getBoundingClientRect();\n panel.style.transform = '';\n }\n if (dismiss) {\n setVisible(false);\n onOpenChange(false);\n }\n };\n\n if (!rendered) return null;\n\n const showPanel = visible && open;\n\n return (\n <Portal container={container}>\n <div\n ref={ref}\n data-slot=\"sheet-overlay\"\n data-state={showPanel ? 'open' : 'closed'}\n className={cn(styles.backdrop, contained && styles['backdrop--contained'])}\n onPointerDown={(event) => {\n if (event.target === event.currentTarget && dismissable) onOpenChange(false);\n }}\n >\n <div\n ref={panelRef}\n role=\"dialog\"\n aria-modal=\"true\"\n tabIndex={-1}\n data-slot=\"sheet-content\"\n data-state={showPanel ? 'open' : 'closed'}\n className={cn(styles.panel, className)}\n onKeyDown={trapTab}\n >\n <div\n data-slot=\"sheet-grip\"\n className={styles.grip}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={endDrag}\n onPointerCancel={endDrag}\n >\n {dismissable ? (\n <span data-slot=\"sheet-handle\" className={styles.handle} aria-hidden />\n ) : null}\n {header != null ? (\n <div data-slot=\"sheet-header\" className={styles.header}>\n <div data-slot=\"sheet-title\" className={styles.title}>\n {header}\n </div>\n {dismissable ? (\n <IconButton\n mode=\"gray\"\n size=\"s\"\n circle\n data-slot=\"sheet-close\"\n className={styles.close}\n aria-label={closeLabel}\n onClick={() => onOpenChange(false)}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden>\n <path\n d=\"M4 4l8 8M12 4l-8 8\"\n stroke=\"currentColor\"\n strokeWidth=\"1.6\"\n strokeLinecap=\"round\"\n />\n </svg>\n </IconButton>\n ) : null}\n </div>\n ) : null}\n </div>\n <div data-slot=\"sheet-body\" className={styles.body}>\n {children}\n </div>\n </div>\n </div>\n </Portal>\n );\n}\n\nSheet.displayName = 'Sheet';\n",".skeleton {\n display: block;\n}\n\n.skeleton[data-state=\"loading\"] {\n position: relative;\n overflow: hidden;\n min-height: 1em;\n border-radius: 8px;\n background: var(--tgui--fill);\n color: transparent;\n pointer-events: none;\n}\n\n.skeleton[data-state=\"loading\"] * {\n visibility: hidden;\n}\n\n.skeleton[data-state=\"loading\"]::after {\n content: \"\";\n position: absolute;\n inset: 0;\n transform: translateX(-100%);\n background: linear-gradient(\n 90deg,\n transparent,\n color-mix(in srgb, var(--tgui--label) 5%, transparent),\n transparent\n );\n animation: tgui-skeleton 1.5s ease-in-out infinite;\n}\n\n@keyframes tgui-skeleton {\n to {\n transform: translateX(100%);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .skeleton[data-state=\"loading\"]::after {\n animation: none;\n }\n}\n\n@media (prefers-reduced-transparency: reduce) {\n .skeleton[data-state=\"loading\"] {\n background: var(--tgui--fill);\n }\n}\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Skeleton.module.css';\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n visible?: boolean;\n children?: ReactNode;\n}\n\nexport function Skeleton({ ref, visible = true, className, children, ...rest }: SkeletonProps) {\n return (\n <div\n ref={ref}\n data-slot=\"skeleton\"\n data-state={visible ? 'loading' : 'loaded'}\n aria-hidden={visible || undefined}\n className={cn(styles.skeleton, className)}\n {...rest}\n >\n {children}\n </div>\n );\n}\n\nSkeleton.displayName = 'Skeleton';\n",".slider {\n display: flex;\n align-items: center;\n gap: 12px;\n width: 100%;\n}\n\n.track {\n position: relative;\n flex: 1;\n height: 28px;\n display: flex;\n align-items: center;\n}\n\n.rail {\n position: absolute;\n left: 0;\n right: 0;\n height: 4px;\n border-radius: 2px;\n background: var(--tgui--accent-fill);\n}\n\n.fill {\n position: absolute;\n left: 0;\n height: 4px;\n border-radius: 2px;\n background: var(--tgui--link);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .fill {\n transition: width 0.1s linear;\n }\n}\n\n.input {\n position: relative;\n z-index: 1;\n width: 100%;\n height: 28px;\n margin: 0;\n padding: 0;\n background: transparent;\n appearance: none;\n cursor: pointer;\n}\n\n.input:focus-visible {\n outline: none;\n}\n\n.input::-webkit-slider-thumb {\n appearance: none;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: var(--tgui--white);\n box-shadow: 0 1px 4px rgb(0 0 0 / 0.25);\n cursor: grab;\n}\n\n.input:active::-webkit-slider-thumb {\n cursor: grabbing;\n}\n\n.input::-moz-range-thumb {\n width: 22px;\n height: 22px;\n border: 0;\n border-radius: 50%;\n background: var(--tgui--white);\n box-shadow: 0 1px 4px rgb(0 0 0 / 0.25);\n}\n\n.input:focus-visible::-webkit-slider-thumb {\n box-shadow:\n 0 1px 4px rgb(0 0 0 / 0.25),\n var(--tgui--focus-ring-shadow);\n}\n\n.input:focus-visible::-moz-range-thumb {\n box-shadow:\n 0 1px 4px rgb(0 0 0 / 0.25),\n var(--tgui--focus-ring-shadow);\n}\n\n.input:disabled {\n cursor: default;\n}\n\n.slider[data-disabled] {\n opacity: 0.4;\n}\n\n.side {\n flex-shrink: 0;\n color: var(--tgui--label-secondary);\n font-family: var(--tgui--font-family);\n font-size: 14px;\n}\n","'use client';\n\nimport {\n type ChangeEvent,\n type InputHTMLAttributes,\n type ReactNode,\n type Ref,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic } from '../TguiProvider';\nimport styles from './Slider.module.css';\n\nexport interface SliderProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onChange'> {\n ref?: Ref<HTMLInputElement>;\n value?: number;\n defaultValue?: number;\n onValueChange?: (value: number) => void;\n min?: number;\n max?: number;\n step?: number;\n before?: ReactNode;\n after?: ReactNode;\n}\n\nexport function Slider({\n ref,\n value: valueProp,\n defaultValue,\n onValueChange,\n min = 0,\n max = 100,\n step = 1,\n before,\n after,\n disabled,\n className,\n ...rest\n}: SliderProps) {\n const [uncontrolled, setUncontrolled] = useState(defaultValue ?? min);\n const value = valueProp ?? uncontrolled;\n const percent = max > min ? ((value - min) / (max - min)) * 100 : 0;\n const haptic = useHaptic();\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const next = Number(event.target.value);\n if (next !== value) haptic('select');\n if (valueProp == null) setUncontrolled(next);\n onValueChange?.(next);\n };\n\n return (\n <div\n data-slot=\"slider\"\n className={cn(styles.slider, className)}\n data-disabled={disabled || undefined}\n >\n {before != null ? (\n <span data-slot=\"slider-before\" className={styles.side}>\n {before}\n </span>\n ) : null}\n <span data-slot=\"slider-track\" className={styles.track}>\n <span data-slot=\"slider-rail\" className={styles.rail} />\n <span\n data-slot=\"slider-range\"\n className={styles.fill}\n style={{ width: `${Math.max(0, Math.min(100, percent))}%` }}\n />\n <input\n ref={ref}\n type=\"range\"\n data-slot=\"slider-input\"\n className={styles.input}\n min={min}\n max={max}\n step={step}\n value={value}\n disabled={disabled}\n onChange={handleChange}\n {...rest}\n />\n </span>\n {after != null ? (\n <span data-slot=\"slider-after\" className={styles.side}>\n {after}\n </span>\n ) : null}\n </div>\n );\n}\n\nSlider.displayName = 'Slider';\n","import type { ReactNode } from 'react';\nimport { createContext } from 'react';\n\nexport interface SnackbarOptions {\n message: ReactNode;\n description?: ReactNode;\n before?: ReactNode;\n action?: { label: string; onClick: () => void };\n duration?: number;\n}\n\nexport interface SnackbarApi {\n show: (options: SnackbarOptions) => string;\n dismiss: (id: string) => void;\n}\n\nexport const SnackbarContext = createContext<SnackbarApi | null>(null);\n\nSnackbarContext.displayName = 'SnackbarContext';\n",".viewport {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: var(--tgui--z-overlay, 1000);\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n padding: 12px;\n padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));\n overflow: clip;\n overflow-clip-margin: 28px;\n pointer-events: none;\n}\n\n.snackbar {\n display: flex;\n align-items: center;\n gap: 12px;\n width: 100%;\n max-width: 440px;\n box-sizing: border-box;\n padding: 12px 16px;\n border-radius: 12px;\n /* every surface that appears over the page shares one background */\n background: var(--tgui--surface-bg);\n color: var(--tgui--label);\n box-shadow:\n 0 0 0 0.5px var(--tgui--separator),\n 0 6px 24px rgb(0 0 0 / 0.4);\n pointer-events: auto;\n touch-action: pan-y;\n opacity: 0;\n transform: translateY(16px);\n}\n\n.snackbar[data-state=\"open\"] {\n opacity: 1;\n transform: translateY(0);\n}\n\n/* a toast is edge-anchored – it slides up from the screen edge, sharing the\n kit's spring easing with every other surface that appears */\n@media (prefers-reduced-motion: no-preference) {\n .snackbar {\n transition:\n opacity var(--tgui--duration-fast) ease,\n transform var(--tgui--duration-fast) var(--tgui--ease-spring);\n }\n}\n\n.snackbar--dragging {\n transition: none;\n}\n\n.before {\n display: flex;\n flex-shrink: 0;\n color: var(--tgui--link-strong);\n}\n\n.body {\n display: flex;\n flex-direction: column;\n gap: 2px;\n flex: 1;\n min-width: 0;\n font-family: var(--tgui--font-family);\n}\n\n.message {\n font-size: 15px;\n line-height: 20px;\n}\n\n.description {\n font-size: 13px;\n line-height: 18px;\n color: var(--tgui--label-secondary);\n}\n\n.action {\n flex-shrink: 0;\n padding: 4px 8px;\n margin-inline-end: -8px;\n border: 0;\n border-radius: 8px;\n background: transparent;\n color: var(--tgui--link-strong);\n font-family: var(--tgui--font-family);\n font-size: 15px;\n font-weight: var(--tgui--weight-semibold);\n cursor: pointer;\n}\n\n.action:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: calc(-1 * var(--tgui--focus-ring-offset));\n}\n","'use client';\n\nimport {\n type ReactNode,\n type PointerEvent as ReactPointerEvent,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useReducedMotion } from '../../shared/lib/useReducedMotion';\nimport { Portal } from '../Portal';\nimport { SnackbarContext, type SnackbarOptions } from './context';\nimport styles from './Snackbar.module.css';\n\nconst EXIT_MS = 240;\nconst SWIPE_DISMISS = 80;\n\ninterface SnackItem extends SnackbarOptions {\n id: string;\n}\n\nexport interface SnackbarProviderProps {\n children: ReactNode;\n duration?: number;\n max?: number;\n}\n\nexport function SnackbarProvider({ children, duration = 4000, max = 3 }: SnackbarProviderProps) {\n const [items, setItems] = useState<SnackItem[]>([]);\n const nextId = useRef(0);\n\n const dismiss = useCallback((id: string) => {\n setItems((current) => current.filter((item) => item.id !== id));\n }, []);\n\n const show = useCallback(\n (options: SnackbarOptions) => {\n const id = `snackbar-${nextId.current++}`;\n setItems((current) => [...current, { ...options, id }].slice(-max));\n return id;\n },\n [max],\n );\n\n const api = useMemo(() => ({ show, dismiss }), [show, dismiss]);\n\n return (\n <SnackbarContext.Provider value={api}>\n {children}\n {items.length > 0 ? (\n <Portal>\n <div data-slot=\"snackbar-viewport\" className={styles.viewport}>\n {items.map((item) => (\n <SnackbarItem\n key={item.id}\n item={item}\n defaultDuration={duration}\n onDismiss={() => dismiss(item.id)}\n />\n ))}\n </div>\n </Portal>\n ) : null}\n </SnackbarContext.Provider>\n );\n}\n\nSnackbarProvider.displayName = 'SnackbarProvider';\n\ninterface SnackbarItemProps {\n item: SnackItem;\n defaultDuration: number;\n onDismiss: () => void;\n}\n\nfunction SnackbarItem({ item, defaultDuration, onDismiss }: SnackbarItemProps) {\n const reducedMotion = useReducedMotion();\n const [visible, setVisible] = useState(false);\n const [leaving, setLeaving] = useState(false);\n const nodeRef = useRef<HTMLDivElement | null>(null);\n\n const duration = item.duration ?? defaultDuration;\n const remaining = useRef(duration);\n const startedAt = useRef(0);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const drag = useRef({ id: -1, startX: 0, active: false });\n\n useLayoutEffect(() => {\n const node = nodeRef.current;\n if (node) void node.offsetHeight;\n setVisible(true);\n }, []);\n\n const close = useCallback(() => {\n setLeaving(true);\n setVisible(false);\n if (reducedMotion) {\n onDismiss();\n return;\n }\n const id = setTimeout(onDismiss, EXIT_MS);\n return () => clearTimeout(id);\n }, [reducedMotion, onDismiss]);\n\n const pause = useCallback(() => {\n if (!timer.current) return;\n clearTimeout(timer.current);\n timer.current = null;\n remaining.current -= Date.now() - startedAt.current;\n }, []);\n\n const resume = useCallback(() => {\n if (duration <= 0 || leaving || timer.current) return;\n startedAt.current = Date.now();\n timer.current = setTimeout(() => close(), Math.max(0, remaining.current));\n }, [duration, leaving, close]);\n\n useEffect(() => {\n resume();\n return pause;\n }, [resume, pause]);\n\n const onPointerDown = (event: ReactPointerEvent<HTMLDivElement>) => {\n if (event.button !== 0) return;\n drag.current = { id: event.pointerId, startX: event.clientX, active: false };\n pause();\n };\n\n const onPointerMove = (event: ReactPointerEvent<HTMLDivElement>) => {\n const state = drag.current;\n if (state.id !== event.pointerId) return;\n const dx = event.clientX - state.startX;\n if (!state.active) {\n if (Math.abs(dx) < 6) return;\n state.active = true;\n event.currentTarget.setPointerCapture(event.pointerId);\n nodeRef.current?.classList.add(styles['snackbar--dragging']);\n }\n if (nodeRef.current) {\n nodeRef.current.style.transform = `translateX(${dx}px)`;\n nodeRef.current.style.opacity = `${Math.max(0, 1 - Math.abs(dx) / 240)}`;\n }\n };\n\n const endDrag = (event: ReactPointerEvent<HTMLDivElement>) => {\n const state = drag.current;\n if (state.id !== event.pointerId) return;\n drag.current = { id: -1, startX: 0, active: false };\n const node = nodeRef.current;\n if (!node) return;\n node.classList.remove(styles['snackbar--dragging']);\n const dx = event.clientX - state.startX;\n if (state.active && Math.abs(dx) > SWIPE_DISMISS) {\n if (reducedMotion) {\n onDismiss();\n return;\n }\n node.style.transition = 'transform 0.2s ease-out, opacity 0.2s ease-out';\n node.style.transform = `translateX(${Math.sign(dx) * (window.innerWidth || 400)}px)`;\n node.style.opacity = '0';\n setTimeout(onDismiss, 190);\n return;\n }\n node.style.transform = '';\n node.style.opacity = '';\n resume();\n };\n\n return (\n <div\n ref={nodeRef}\n data-slot=\"snackbar\"\n data-state={visible && !leaving ? 'open' : 'closed'}\n className={styles.snackbar}\n role=\"status\"\n onMouseEnter={pause}\n onMouseLeave={resume}\n onFocus={pause}\n onBlur={resume}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={endDrag}\n onPointerCancel={endDrag}\n >\n {item.before != null ? (\n <span data-slot=\"snackbar-before\" className={styles.before}>\n {item.before}\n </span>\n ) : null}\n <div data-slot=\"snackbar-body\" className={styles.body}>\n <span data-slot=\"snackbar-message\" className={styles.message}>\n {item.message}\n </span>\n {item.description != null ? (\n <span data-slot=\"snackbar-description\" className={styles.description}>\n {item.description}\n </span>\n ) : null}\n </div>\n {item.action != null ? (\n <button\n type=\"button\"\n data-slot=\"snackbar-action\"\n className={styles.action}\n onClick={() => {\n item.action?.onClick();\n close();\n }}\n >\n {item.action.label}\n </button>\n ) : null}\n </div>\n );\n}\n","import { useContext } from 'react';\nimport { type SnackbarApi, SnackbarContext } from './context';\n\nexport function useSnackbar(): SnackbarApi {\n const api = useContext(SnackbarContext);\n if (!api) {\n throw new Error('useSnackbar must be used within a <SnackbarProvider>.');\n }\n return api;\n}\n","export interface Particle {\n x0: number;\n y0: number;\n vx: number;\n vy: number;\n life: number;\n respawn: number;\n phase: number;\n size: number;\n square: boolean;\n}\n\nconst TAU = Math.PI * 2;\nconst clamp01 = (value: number) => Math.max(0, Math.min(1, value));\nconst easeOutCubic = (t: number) => 1 - (1 - t) ** 3;\n\n// particle grows in over `up` seconds, holds, shrinks over `down` seconds\nfunction trapezoid(life: number, up: number, down: number, t: number) {\n const hold = Math.max(up, life - down);\n if (t < up) return Math.max(0, t / up);\n if (t > hold) return Math.max(0, 1 - (t - hold) / (life - hold));\n return 1;\n}\n\nexport function createParticles(w: number, h: number, density: number): Particle[] {\n const count = Math.round(Math.min(1800, Math.max(12, density * w * h)));\n const particles: Particle[] = [];\n for (let i = 0; i < count; i += 1) {\n const speed = 2 + Math.random() * 10;\n const angle = Math.random() * TAU;\n const life = 0.3 + Math.random() * 1.2;\n const respawn = Math.random();\n particles.push({\n x0: Math.random() * w,\n y0: Math.random() * h,\n vx: speed * Math.cos(angle),\n vy: speed * Math.sin(angle),\n life,\n respawn,\n phase: Math.random() * (life + respawn),\n size: 1 + Math.random() * 0.7,\n square: Math.random() > 0.5,\n });\n }\n return particles;\n}\n\n// paints one frame; `stop` is the loop time (s) at which the reveal began, or null\nexport function paintParticles(\n ctx: CanvasRenderingContext2D,\n pixelW: number,\n pixelH: number,\n dpr: number,\n particles: Particle[],\n color: readonly [number, number, number],\n time: number,\n stop: number | null,\n fade: number,\n) {\n ctx.clearRect(0, 0, pixelW, pixelH);\n const w = pixelW / dpr;\n const h = pixelH / dpr;\n const [r, g, b] = color;\n const n = particles.length;\n\n for (let i = 0; i < n; i += 1) {\n const p = particles[i];\n const period = p.life + p.respawn;\n\n if (stop != null) {\n const spawned = Math.floor((time + p.phase) / period);\n const lastAllowed = Math.floor((stop + p.phase) / period);\n if (spawned > lastAllowed) continue;\n }\n\n const local = (time + p.phase) % period;\n if (local >= p.life) continue;\n\n let x = (p.x0 + p.vx * local) % w;\n if (x < 0) x += w;\n let y = (p.y0 + p.vy * local) % h;\n if (y < 0) y += h;\n\n const visible = trapezoid(p.life, 0.15, 0.3, local);\n let alpha = visible * (0.45 + 0.55 * (1 - local / p.life));\n\n if (stop != null && fade > 0) {\n const fadeStart = stop + ((2 / 3) * fade * i) / n;\n const progress = clamp01((time - fadeStart) / ((1 / 3) * fade));\n alpha *= easeOutCubic(1 - progress);\n }\n\n if (alpha <= 0.01) continue;\n\n const size = Math.max(0.5, p.size * visible) * dpr;\n ctx.fillStyle = `rgba(${r}, ${g}, ${b}, ${alpha.toFixed(3)})`;\n ctx.beginPath();\n if (p.square) {\n ctx.rect(x * dpr, y * dpr, size, size);\n } else {\n ctx.arc(x * dpr, y * dpr, size / 2, 0, TAU);\n }\n ctx.fill();\n }\n}\n",".spoiler {\n --tgui--spoiler-p: 0;\n --tgui--spoiler-edge: 10px;\n --tgui--spoiler-edge-y: 3px;\n --tgui--spoiler-radius: 5px;\n position: relative;\n display: inline-block;\n max-width: 100%;\n border-radius: 4px;\n vertical-align: baseline;\n isolation: isolate;\n color: var(--tgui--label);\n}\n\n.spoiler[data-state=\"closed\"] {\n cursor: pointer;\n}\n\n.spoiler::before,\n.canvas {\n border-radius: var(--tgui--spoiler-radius);\n overflow: hidden;\n -webkit-mask-image:\n linear-gradient(\n to right,\n transparent,\n #000 var(--tgui--spoiler-edge),\n #000 calc(100% - var(--tgui--spoiler-edge)),\n transparent\n ),\n linear-gradient(\n to bottom,\n transparent,\n #000 var(--tgui--spoiler-edge-y),\n #000 calc(100% - var(--tgui--spoiler-edge-y)),\n transparent\n );\n -webkit-mask-composite: source-in;\n mask-image:\n linear-gradient(\n to right,\n transparent,\n #000 var(--tgui--spoiler-edge),\n #000 calc(100% - var(--tgui--spoiler-edge)),\n transparent\n ),\n linear-gradient(\n to bottom,\n transparent,\n #000 var(--tgui--spoiler-edge-y),\n #000 calc(100% - var(--tgui--spoiler-edge-y)),\n transparent\n );\n mask-composite: intersect;\n}\n\n.spoiler::before {\n content: \"\";\n position: absolute;\n inset: -1px -3px;\n z-index: 0;\n background: currentColor;\n opacity: calc((1 - var(--tgui--spoiler-p)) * 0.06);\n pointer-events: none;\n}\n\n.content {\n display: inline-block;\n position: relative;\n z-index: 2;\n opacity: var(--tgui--spoiler-p);\n}\n\n.spoiler[data-state=\"closed\"] .content {\n user-select: none;\n pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .content,\n .spoiler::before {\n transition: opacity 0.4s ease;\n }\n}\n\n.canvas {\n position: absolute;\n inset: -1px -3px;\n z-index: 1;\n width: calc(100% + 6px);\n height: calc(100% + 2px);\n pointer-events: none;\n}\n\n.spoiler:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n","'use client';\n\nimport {\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent as ReactKeyboardEvent,\n type Ref,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useReducedMotion } from '../../shared/lib/useReducedMotion';\nimport { createParticles, type Particle, paintParticles } from './particles';\nimport styles from './Spoiler.module.css';\n\nconst FADE_S = 0.5;\n\nexport interface SpoilerProps extends HTMLAttributes<HTMLSpanElement> {\n ref?: Ref<HTMLSpanElement>;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n revealOn?: 'click' | 'hover';\n accentColor?: string;\n density?: number;\n fps?: number;\n revealLabel?: string;\n}\n\nfunction parseColor(value: string): [number, number, number] {\n const parts = value.match(/-?\\d*\\.?\\d+/g);\n if (!parts || parts.length < 3) return [128, 128, 128];\n return [Number(parts[0]), Number(parts[1]), Number(parts[2])];\n}\n\nexport function Spoiler({\n ref,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n revealOn = 'click',\n accentColor,\n density = 0.1,\n fps = 40,\n revealLabel = 'Reveal hidden text',\n className,\n style,\n children,\n onClick,\n onKeyDown,\n onMouseEnter,\n onMouseLeave,\n ...rest\n}: SpoilerProps) {\n const [uncontrolled, setUncontrolled] = useState(defaultOpen);\n const revealed = openProp ?? uncontrolled;\n const reducedMotion = useReducedMotion();\n const isButton = revealOn === 'click';\n\n const rootRef = useRef<HTMLSpanElement | null>(null);\n const canvasRef = useRef<HTMLCanvasElement | null>(null);\n const particles = useRef<Particle[]>([]);\n const colorRef = useRef<[number, number, number]>([128, 128, 128]);\n const inView = useRef(true);\n const stopAt = useRef<number | null>(revealed ? 0 : null);\n const loopTime = useRef(0);\n\n const [painting, setPainting] = useState(!revealed);\n\n const setRevealed = (next: boolean) => {\n if (next) {\n stopAt.current = loopTime.current;\n } else {\n stopAt.current = null;\n setPainting(true);\n }\n if (openProp == null) setUncontrolled(next);\n onOpenChange?.(next);\n };\n\n useEffect(() => {\n if (!painting) return;\n const root = rootRef.current;\n const canvas = canvasRef.current;\n const ctx = canvas?.getContext('2d');\n if (!root || !canvas || !ctx) return;\n\n const dpr = Math.min(2, window.devicePixelRatio || 1);\n\n const sync = () => {\n const box = canvas.getBoundingClientRect();\n const w = Math.max(1, Math.round(box.width * dpr));\n const h = Math.max(1, Math.round(box.height * dpr));\n if (canvas.width !== w || canvas.height !== h) {\n canvas.width = w;\n canvas.height = h;\n particles.current = createParticles(w / dpr, h / dpr, density);\n }\n colorRef.current = parseColor(accentColor ?? getComputedStyle(root).color);\n };\n sync();\n\n if (reducedMotion) {\n paintParticles(\n ctx,\n canvas.width,\n canvas.height,\n dpr,\n particles.current,\n colorRef.current,\n 0.6,\n null,\n 0,\n );\n return;\n }\n\n let raf = 0;\n let start = 0;\n let last = -1;\n const frameGap = 1000 / Math.max(8, fps);\n\n const loop = (now: number) => {\n if (!start) start = now;\n const time = (now - start) / 1000;\n loopTime.current = time;\n const stop = stopAt.current;\n\n if (stop != null && time > stop + FADE_S + 0.06) {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n setPainting(false);\n return;\n }\n\n raf = requestAnimationFrame(loop);\n if (!inView.current || now - last < frameGap) return;\n last = now;\n\n paintParticles(\n ctx,\n canvas.width,\n canvas.height,\n dpr,\n particles.current,\n colorRef.current,\n time,\n stop,\n FADE_S,\n );\n };\n\n raf = requestAnimationFrame(loop);\n\n const ro = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(sync) : null;\n ro?.observe(root);\n const io =\n typeof IntersectionObserver !== 'undefined'\n ? new IntersectionObserver(([entry]) => {\n inView.current = entry.isIntersecting;\n })\n : null;\n io?.observe(root);\n\n return () => {\n cancelAnimationFrame(raf);\n ro?.disconnect();\n io?.disconnect();\n };\n }, [painting, reducedMotion, density, fps, accentColor]);\n\n const toggle = () => setRevealed(!revealed);\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: a spoiler sits inline inside a sentence; a <button> would break the text flow and reset typography\n <span\n ref={(node) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as { current: HTMLSpanElement | null }).current = node;\n }}\n data-slot=\"spoiler\"\n data-state={revealed ? 'open' : 'closed'}\n className={cn(styles.spoiler, className)}\n role=\"button\"\n tabIndex={0}\n aria-pressed={revealed}\n aria-label={revealed ? undefined : revealLabel}\n style={{ ...style, '--tgui--spoiler-p': revealed ? 1 : 0 } as CSSProperties}\n onClick={(event) => {\n onClick?.(event);\n if (isButton) toggle();\n }}\n onKeyDown={(event: ReactKeyboardEvent<HTMLSpanElement>) => {\n onKeyDown?.(event);\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n toggle();\n }\n }}\n onMouseEnter={(event) => {\n onMouseEnter?.(event);\n if (!isButton && !revealed) setRevealed(true);\n }}\n onMouseLeave={(event) => {\n onMouseLeave?.(event);\n if (!isButton && revealed) setRevealed(false);\n }}\n {...rest}\n >\n <span data-slot=\"spoiler-content\" className={styles.content} aria-hidden={!revealed}>\n {children}\n </span>\n {painting ? (\n <canvas ref={canvasRef} data-slot=\"spoiler-overlay\" className={styles.canvas} aria-hidden />\n ) : null}\n </span>\n );\n}\n\nSpoiler.displayName = 'Spoiler';\n",".stepper {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n}\n\n.value {\n width: 36px;\n margin: 0;\n padding: 0;\n border: 0;\n outline: 0;\n background: transparent;\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 16px;\n text-align: center;\n appearance: textfield;\n}\n\n.value::-webkit-outer-spin-button,\n.value::-webkit-inner-spin-button {\n margin: 0;\n appearance: none;\n}\n\n.value:disabled {\n color: var(--tgui--label-secondary);\n}\n\n.value:focus-visible {\n border-radius: 4px;\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .value[data-pulse=\"up\"] {\n animation: pulse-up 0.18s ease-out;\n }\n\n .value[data-pulse=\"down\"] {\n animation: pulse-down 0.18s ease-out;\n }\n}\n\n@keyframes pulse-up {\n from {\n transform: translateY(6px);\n opacity: 0.4;\n }\n}\n\n@keyframes pulse-down {\n from {\n transform: translateY(-6px);\n opacity: 0.4;\n }\n}\n","'use client';\n\nimport {\n type ChangeEvent,\n type HTMLAttributes,\n type KeyboardEvent,\n type Ref,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useReducedMotion } from '../../shared/lib/useReducedMotion';\nimport { IconButton } from '../IconButton';\nimport styles from './Stepper.module.css';\n\nexport interface StepperProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {\n ref?: Ref<HTMLDivElement>;\n value?: number;\n defaultValue?: number;\n onValueChange?: (value: number) => void;\n min?: number;\n max?: number;\n step?: number;\n disabled?: boolean;\n}\n\nconst clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));\n\nconst MinusIcon = () => (\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden>\n <path d=\"M2.5 7h9\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" />\n </svg>\n);\n\nconst PlusIcon = () => (\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden>\n <path d=\"M7 2.5v9M2.5 7h9\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" />\n </svg>\n);\n\nexport function Stepper({\n ref,\n value: valueProp,\n defaultValue,\n onValueChange,\n min = 0,\n max = Number.POSITIVE_INFINITY,\n step = 1,\n disabled = false,\n className,\n ...rest\n}: StepperProps) {\n const reducedMotion = useReducedMotion();\n const [uncontrolled, setUncontrolled] = useState(defaultValue ?? min);\n const value = valueProp ?? uncontrolled;\n const [text, setText] = useState(String(value));\n const [pulse, setPulse] = useState<'up' | 'down' | null>(null);\n const previousValue = useRef(value);\n\n const setValue = (next: number) => {\n if (valueProp == null) setUncontrolled(next);\n onValueChange?.(next);\n };\n\n useEffect(() => {\n setText(String(value));\n if (value !== previousValue.current) {\n if (!reducedMotion) setPulse(value > previousValue.current ? 'up' : 'down');\n previousValue.current = value;\n }\n }, [value, reducedMotion]);\n\n const commit = () => {\n const parsed = Number.parseFloat(text);\n const next = clamp(Number.isNaN(parsed) ? value : parsed, min, max);\n setValue(next);\n setText(String(next));\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key !== 'Enter') return;\n commit();\n event.currentTarget.blur();\n };\n\n return (\n <div ref={ref} data-slot=\"stepper\" className={cn(styles.stepper, className)} {...rest}>\n <IconButton\n mode=\"gray\"\n size=\"s\"\n circle\n data-slot=\"stepper-decrement\"\n aria-label=\"Decrease\"\n disabled={disabled || value <= min}\n onClick={() => setValue(clamp(value - step, min, max))}\n >\n <MinusIcon />\n </IconButton>\n <input\n className={styles.value}\n data-slot=\"stepper-input\"\n type=\"number\"\n inputMode=\"numeric\"\n aria-label=\"Value\"\n value={text}\n disabled={disabled}\n data-pulse={pulse ?? undefined}\n onChange={(event: ChangeEvent<HTMLInputElement>) => setText(event.target.value)}\n onBlur={commit}\n onKeyDown={handleKeyDown}\n onAnimationEnd={() => setPulse(null)}\n />\n <IconButton\n mode=\"gray\"\n size=\"s\"\n circle\n data-slot=\"stepper-increment\"\n aria-label=\"Increase\"\n disabled={disabled || value >= max}\n onClick={() => setValue(clamp(value + step, min, max))}\n >\n <PlusIcon />\n </IconButton>\n </div>\n );\n}\n\nStepper.displayName = 'Stepper';\n",".steps {\n display: flex;\n align-items: center;\n gap: 4px;\n width: 100%;\n}\n\n.segment {\n flex: 1 1 0;\n overflow: hidden;\n height: 3px;\n border-radius: 2px;\n background: var(--tgui--accent-fill);\n}\n\n.fill {\n height: 100%;\n border-radius: inherit;\n background: var(--tgui--link);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .fill {\n transition: width 0.2s ease;\n }\n}\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Steps.module.css';\n\nexport interface StepsProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n count: number;\n progress: number;\n}\n\nconst clamp01 = (value: number) => Math.max(0, Math.min(1, value));\n\nexport function Steps({\n ref,\n count,\n progress,\n className,\n 'aria-label': ariaLabel,\n ...rest\n}: StepsProps) {\n return (\n <div\n ref={ref}\n role=\"progressbar\"\n aria-label={ariaLabel ?? 'Progress'}\n aria-valuemin={0}\n aria-valuemax={count}\n aria-valuenow={Math.max(0, Math.min(count, progress))}\n data-slot=\"steps\"\n className={cn(styles.steps, className)}\n {...rest}\n >\n {Array.from({ length: count }, (_, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: fixed-length positional segments\n <div key={index} data-slot=\"steps-segment\" className={styles.segment}>\n <div\n data-slot=\"steps-fill\"\n className={styles.fill}\n style={{ width: `${clamp01(progress - index) * 100}%` }}\n />\n </div>\n ))}\n </div>\n );\n}\n\nSteps.displayName = 'Steps';\n",".switch {\n position: relative;\n overflow: hidden;\n display: inline-flex;\n align-items: center;\n width: 52px;\n height: 32px;\n border-radius: 16px;\n cursor: pointer;\n flex-shrink: 0;\n}\n\n.switch[data-disabled] {\n cursor: default;\n opacity: 0.4;\n}\n\n.input {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n opacity: 0;\n cursor: inherit;\n}\n\n.control::before {\n position: absolute;\n content: \"\";\n inset: 0;\n background: var(--tgui--bg-secondary);\n}\n\n.base .control::before {\n border-radius: 16px;\n border: 3px solid var(--tgui--label-tertiary);\n}\n\n.control::after {\n position: absolute;\n content: \"\";\n top: 50%;\n transform: translateY(-50%);\n border-radius: 50%;\n}\n\n.base .control::after {\n width: 16px;\n height: 16px;\n margin-inline-start: 8px;\n background: var(--tgui--label-tertiary);\n}\n\n.ios .control::before {\n background: rgba(120, 120, 128, 0.22);\n}\n\n.ios .control::after {\n width: 28px;\n height: 28px;\n margin-inline-start: 2px;\n background: var(--tgui--white);\n box-shadow:\n 0 3px 8px 0 rgba(0, 0, 0, 0.12),\n 0 1px 1px 0 rgba(0, 0, 0, 0.16);\n}\n\n.input:checked + .control::before {\n border-color: var(--tgui--link);\n background-color: var(--tgui--link);\n}\n\n.input:checked + .control::after {\n transform: translateX(20px) translateY(-50%);\n}\n\n.base .input:checked + .control::after {\n width: 24px;\n height: 24px;\n background: var(--tgui--white);\n transform: translateX(16px) translateY(-50%);\n}\n\n.input:focus-visible + .control::before {\n box-shadow: var(--tgui--focus-ring-shadow);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .control::before {\n transition:\n background-color 0.2s ease,\n border-color 0.2s ease;\n }\n .control::after {\n transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);\n }\n .ios .control::after {\n transition: transform 0.2s cubic-bezier(0.36, -0.24, 0.26, 1.32);\n }\n}\n","'use client';\n\nimport type { ChangeEvent, InputHTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic, useTgui } from '../TguiProvider';\nimport styles from './Switch.module.css';\n\nexport interface SwitchProps extends InputHTMLAttributes<HTMLInputElement> {\n ref?: Ref<HTMLInputElement>;\n}\n\nexport function Switch({ ref, disabled, className, style, onChange, ...rest }: SwitchProps) {\n const { platform } = useTgui();\n const haptic = useHaptic();\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n haptic('select');\n onChange?.(event);\n };\n\n return (\n <label\n data-slot=\"switch\"\n className={cn(styles.switch, platform === 'ios' ? styles.ios : styles.base, className)}\n style={style}\n data-disabled={disabled || undefined}\n >\n <input\n ref={ref}\n type=\"checkbox\"\n data-slot=\"switch-input\"\n className={styles.input}\n disabled={disabled}\n onChange={handleChange}\n {...rest}\n />\n <span aria-hidden data-slot=\"switch-thumb\" className={styles.control} />\n </label>\n );\n}\n\nSwitch.displayName = 'Switch';\n",".bar {\n display: flex;\n align-items: stretch;\n padding: 0 16px;\n padding-bottom: calc(var(--tgui--safe-area-bottom) + var(--tgui--content-safe-area-bottom));\n background: var(--tgui--surface-bg);\n box-shadow: 0 -0.5px 0 var(--tgui--separator);\n}\n\n.barIos {\n padding: 0;\n padding-bottom: calc(6px + var(--tgui--safe-area-bottom) + var(--tgui--content-safe-area-bottom));\n}\n\n.item {\n flex: 1 0 0;\n min-inline-size: 0;\n max-inline-size: 100%;\n margin: 0;\n padding: 10px 16px 14px;\n border: none;\n background: transparent;\n\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 4px;\n\n /* inactive tab – iOS secondaryLabel grey; must stay a readable label */\n color: var(--tgui--label-secondary);\n}\n\n.itemIos {\n padding: 7px 12px 2px;\n gap: 3px;\n}\n\n.item[data-selected] {\n color: var(--tgui--link-strong);\n}\n\n.item:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: calc(-1 * var(--tgui--focus-ring-offset));\n}\n\n.icon {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 64px;\n height: 32px;\n padding: 2px 10px;\n border-radius: 16px;\n}\n\n.itemIos .icon {\n min-width: 0;\n height: 28px;\n padding: 0;\n}\n\n.item[data-selected]:not(.itemIos) .icon {\n background: var(--tgui--accent-fill);\n}\n\n.text {\n max-inline-size: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .item {\n transition: color 0.15s ease-out;\n }\n\n .icon {\n transition: background 0.15s ease-out;\n }\n}\n","'use client';\n\nimport type { ButtonHTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Caption } from '../Caption';\nimport { Tappable } from '../Tappable';\nimport { useTgui } from '../TguiProvider';\nimport styles from './TabBar.module.css';\n\nexport interface TabBarItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n ref?: Ref<HTMLElement>;\n selected?: boolean;\n text?: string;\n children?: ReactNode;\n}\n\nexport function TabBarItem({ ref, selected, text, children, className, ...rest }: TabBarItemProps) {\n const { platform } = useTgui();\n const ios = platform === 'ios';\n\n return (\n <Tappable\n ref={ref}\n Component=\"button\"\n interactiveAnimation=\"opacity\"\n data-slot=\"tab-bar-item\"\n data-selected={selected || undefined}\n aria-current={selected ? 'page' : undefined}\n className={cn(styles.item, ios && styles.itemIos, className)}\n {...rest}\n >\n {children != null ? (\n <span data-slot=\"tab-bar-item-icon\" className={styles.icon}>\n {children}\n </span>\n ) : null}\n {text != null ? (\n <Caption\n data-slot=\"tab-bar-item-label\"\n className={styles.text}\n weight=\"2\"\n level={ios ? '2' : '1'}\n >\n {text}\n </Caption>\n ) : null}\n </Tappable>\n );\n}\n\nTabBarItem.displayName = 'TabBarItem';\n","'use client';\n\nimport type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useTgui } from '../TguiProvider';\nimport styles from './TabBar.module.css';\nimport { TabBarItem } from './TabBarItem';\n\nexport interface TabBarProps extends HTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n}\n\nexport function TabBar({ ref, className, children, ...rest }: TabBarProps) {\n const { platform } = useTgui();\n\n return (\n <nav\n ref={ref}\n data-slot=\"tab-bar\"\n className={cn(styles.bar, platform === 'ios' && styles.barIos, className)}\n {...rest}\n >\n {children}\n </nav>\n );\n}\n\nTabBar.displayName = 'TabBar';\nTabBar.Item = TabBarItem;\n",".field {\n display: block;\n width: 100%;\n margin: 0;\n padding: 0;\n border: 0;\n outline: 0;\n resize: none;\n background: transparent;\n color: var(--tgui--label);\n font-family: inherit;\n line-height: 1.4;\n overflow-y: auto;\n}\n\n.field::placeholder {\n color: var(--tgui--label-tertiary);\n}\n","'use client';\n\nimport {\n type ChangeEvent,\n type FocusEvent,\n type MutableRefObject,\n type ReactNode,\n type Ref,\n type TextareaHTMLAttributes,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { FormField } from '../FormField';\nimport { Subheadline } from '../Subheadline';\nimport { Text } from '../Text';\nimport { useTgui } from '../TguiProvider';\nimport styles from './Textarea.module.css';\n\nexport type TextareaStatus = 'default' | 'error' | 'focused';\n\nexport interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {\n ref?: Ref<HTMLTextAreaElement>;\n header?: ReactNode;\n status?: TextareaStatus;\n autoGrow?: boolean;\n maxRows?: number;\n}\n\nexport function Textarea({\n ref,\n header,\n status,\n autoGrow = false,\n maxRows,\n rows = 3,\n disabled,\n className,\n value,\n defaultValue,\n onFocus,\n onBlur,\n onChange,\n ...rest\n}: TextareaProps) {\n const { platform } = useTgui();\n const ios = platform === 'ios';\n const [focused, setFocused] = useState(false);\n const state = status ?? (focused ? 'focused' : 'default');\n const Typography = ios ? Text : Subheadline;\n\n const innerRef = useRef<HTMLTextAreaElement>(null);\n const setRefs = useCallback(\n (node: HTMLTextAreaElement | null) => {\n innerRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as MutableRefObject<HTMLTextAreaElement | null>).current = node;\n },\n [ref],\n );\n\n const resize = useCallback(() => {\n const el = innerRef.current;\n if (!el || !autoGrow) return;\n el.style.height = 'auto';\n const cs = getComputedStyle(el);\n const lineHeight = Number.parseFloat(cs.lineHeight) || 20;\n const max = maxRows ? lineHeight * maxRows : Number.POSITIVE_INFINITY;\n el.style.height = `${Math.min(el.scrollHeight, max)}px`;\n el.style.overflowY = el.scrollHeight > max ? 'auto' : 'hidden';\n }, [autoGrow, maxRows]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: value drives the re-measure\n useEffect(resize, [resize, value, defaultValue]);\n\n const handleFocus = (event: FocusEvent<HTMLTextAreaElement>) => {\n if (!disabled) setFocused(true);\n onFocus?.(event);\n };\n const handleBlur = (event: FocusEvent<HTMLTextAreaElement>) => {\n setFocused(false);\n onBlur?.(event);\n };\n const handleChange = (event: ChangeEvent<HTMLTextAreaElement>) => {\n resize();\n onChange?.(event);\n };\n\n return (\n <FormField\n ios={ios}\n status={state}\n disabled={disabled}\n alignStart\n header={header}\n className={className}\n >\n <Typography\n ref={setRefs as Ref<HTMLElement>}\n Component=\"textarea\"\n data-slot=\"textarea\"\n className={styles.field}\n rows={rows}\n disabled={disabled}\n aria-invalid={state === 'error' || undefined}\n value={value}\n defaultValue={defaultValue}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChange={handleChange}\n {...rest}\n />\n </FormField>\n );\n}\n\nTextarea.displayName = 'Textarea';\n",".timeline {\n display: flex;\n flex-direction: column;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.item {\n position: relative;\n display: flex;\n gap: 12px;\n padding-bottom: 20px;\n}\n\n.item:last-child {\n padding-bottom: 0;\n}\n\n.rail {\n position: relative;\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n width: 10px;\n padding-top: 5px;\n}\n\n.connector {\n position: absolute;\n top: 10px;\n bottom: -30px;\n left: 50%;\n width: 1.5px;\n transform: translateX(-50%);\n background: var(--tgui--separator);\n}\n\n.item:last-child .connector {\n display: none;\n}\n\n.item:has(~ .item[data-active]) .connector {\n background: var(--tgui--link);\n}\n\n.dot {\n z-index: 1;\n flex-shrink: 0;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background: var(--tgui--label-tertiary);\n}\n\n.item:has(~ .item[data-active]) .dot {\n background: var(--tgui--link);\n}\n\n.item[data-active] .dot {\n background: var(--tgui--link);\n box-shadow: 0 0 0 3px var(--tgui--accent-fill);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .connector,\n .dot {\n transition:\n background 0.2s ease,\n box-shadow 0.2s ease;\n }\n}\n\n.content {\n flex: 1;\n min-width: 0;\n padding-top: 1px;\n}\n\n.heading {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 8px;\n}\n\n.title {\n font-family: var(--tgui--font-family);\n font-size: 15px;\n font-weight: var(--tgui--weight-semibold);\n color: var(--tgui--label);\n}\n\n.time {\n flex-shrink: 0;\n font-family: var(--tgui--font-family);\n font-size: 13px;\n color: var(--tgui--label-secondary);\n}\n\n.description {\n margin-top: 2px;\n font-family: var(--tgui--font-family);\n font-size: 14px;\n line-height: 18px;\n color: var(--tgui--label-secondary);\n}\n\n.item[data-active] ~ .item .title {\n color: var(--tgui--label-secondary);\n}\n\n.item[data-active] ~ .item .description {\n color: var(--tgui--label-secondary);\n}\n\n.item[data-active] ~ .item .dot {\n background: color-mix(in srgb, var(--tgui--label-tertiary) 55%, var(--tgui--bg));\n}\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Timeline.module.css';\n\nexport interface TimelineProps extends HTMLAttributes<HTMLOListElement> {\n ref?: Ref<HTMLOListElement>;\n}\n\nexport function Timeline({ ref, className, children, ...rest }: TimelineProps) {\n return (\n <ol ref={ref} data-slot=\"timeline\" className={cn(styles.timeline, className)} {...rest}>\n {children}\n </ol>\n );\n}\n\nTimeline.displayName = 'Timeline';\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Timeline.module.css';\n\nexport interface TimelineItemProps extends Omit<HTMLAttributes<HTMLLIElement>, 'title'> {\n ref?: Ref<HTMLLIElement>;\n title: ReactNode;\n description?: ReactNode;\n time?: ReactNode;\n active?: boolean;\n}\n\nexport function TimelineItem({\n ref,\n title,\n description,\n time,\n active = false,\n className,\n ...rest\n}: TimelineItemProps) {\n return (\n <li\n ref={ref}\n data-slot=\"timeline-item\"\n className={cn(styles.item, className)}\n data-active={active || undefined}\n {...rest}\n >\n <span data-slot=\"timeline-item-rail\" className={styles.rail} aria-hidden>\n <span className={styles.connector} />\n <span className={styles.dot} />\n </span>\n <div data-slot=\"timeline-item-content\" className={styles.content}>\n <div className={styles.heading}>\n <span data-slot=\"timeline-item-title\" className={styles.title}>\n {title}\n </span>\n {time != null ? (\n <span data-slot=\"timeline-item-time\" className={styles.time}>\n {time}\n </span>\n ) : null}\n </div>\n {description != null ? (\n <div data-slot=\"timeline-item-description\" className={styles.description}>\n {description}\n </div>\n ) : null}\n </div>\n </li>\n );\n}\n\nTimelineItem.displayName = 'TimelineItem';\n",".trigger {\n display: inline-flex;\n}\n\n.tooltip {\n position: fixed;\n top: 0;\n left: 0;\n z-index: var(--tgui--z-overlay, 1000);\n max-width: 260px;\n padding: 6px 10px;\n border-radius: var(--tgui--radius-sm);\n background: var(--tgui--surface-bg);\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 13px;\n line-height: 17px;\n box-shadow: var(--tgui--overlay-shadow);\n pointer-events: none;\n transform-origin: var(--tgui--tooltip-origin-x, 50%) var(--tgui--tooltip-origin-y, 50%);\n}\n\n/* visible at rest once positioned; the keyframes only ferry it in and out, and it\n stays hidden (inline opacity: 0) until the layout effect has placed it, so the\n entrance always plays from the final position – same as Popover */\n@media (prefers-reduced-motion: no-preference) {\n .tooltip[data-state=\"open\"] {\n animation: tooltip-in var(--tgui--duration-overlay) var(--tgui--ease-spring);\n }\n\n .tooltip[data-state=\"closed\"] {\n animation: tooltip-out var(--tgui--duration-overlay) var(--tgui--ease-in) forwards;\n }\n}\n\n@keyframes tooltip-in {\n from {\n opacity: 0;\n transform: scale(0.96);\n }\n}\n\n@keyframes tooltip-out {\n to {\n opacity: 0;\n transform: scale(0.96);\n }\n}\n\n.arrow {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n /* hairline on the two outer edges so the tip keeps the bubble's ring on a light surface */\n box-shadow: 0 0 0 0.5px var(--tgui--separator);\n transform: rotate(45deg);\n}\n","'use client';\n\nimport { Presence } from '@radix-ui/react-presence';\nimport {\n type CSSProperties,\n type ReactNode,\n type Ref,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { getFixedOffset } from '../../shared/lib/floatingPosition';\nimport { Portal } from '../Portal';\nimport styles from './Tooltip.module.css';\n\nexport type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nexport interface TooltipProps {\n ref?: Ref<HTMLSpanElement>;\n children: ReactNode;\n content: ReactNode;\n placement?: TooltipPlacement;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n className?: string;\n}\n\nconst GAP = 8;\nconst MARGIN = 8;\nconst clamp = (value: number, min: number, max: number) => Math.max(min, Math.min(max, value));\n\ninterface Position {\n top: number;\n left: number;\n placement: TooltipPlacement;\n originX: number;\n originY: number;\n arrow: CSSProperties;\n}\n\nfunction compute(\n trigger: DOMRect,\n tip: DOMRect,\n want: TooltipPlacement,\n tipEl: Element | null,\n): Position {\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n let placement = want;\n if (placement === 'top' && trigger.top - tip.height - GAP < MARGIN) placement = 'bottom';\n else if (placement === 'bottom' && trigger.bottom + tip.height + GAP > vh - MARGIN)\n placement = 'top';\n else if (placement === 'left' && trigger.left - tip.width - GAP < MARGIN) placement = 'right';\n else if (placement === 'right' && trigger.right + tip.width + GAP > vw - MARGIN)\n placement = 'left';\n\n let top = 0;\n let left = 0;\n if (placement === 'top' || placement === 'bottom') {\n left = trigger.left + trigger.width / 2 - tip.width / 2;\n top = placement === 'top' ? trigger.top - tip.height - GAP : trigger.bottom + GAP;\n } else {\n top = trigger.top + trigger.height / 2 - tip.height / 2;\n left = placement === 'left' ? trigger.left - tip.width - GAP : trigger.right + GAP;\n }\n left = clamp(left, MARGIN, vw - tip.width - MARGIN);\n top = clamp(top, MARGIN, vh - tip.height - MARGIN);\n\n const centerX = trigger.left + trigger.width / 2 - left;\n const centerY = trigger.top + trigger.height / 2 - top;\n const arrow: CSSProperties = {};\n if (placement === 'top') {\n arrow.left = clamp(centerX, 10, tip.width - 10) - 4;\n arrow.bottom = -4;\n } else if (placement === 'bottom') {\n arrow.left = clamp(centerX, 10, tip.width - 10) - 4;\n arrow.top = -4;\n } else if (placement === 'left') {\n arrow.top = clamp(centerY, 10, tip.height - 10) - 4;\n arrow.right = -4;\n } else {\n arrow.top = clamp(centerY, 10, tip.height - 10) - 4;\n arrow.left = -4;\n }\n\n const offset = getFixedOffset(tipEl);\n return {\n top: (top - offset.y) / offset.scale,\n left: (left - offset.x) / offset.scale,\n placement,\n originX: clamp(centerX, 0, tip.width),\n originY: clamp(centerY, 0, tip.height),\n arrow,\n };\n}\n\nexport function Tooltip({\n ref,\n children,\n content,\n placement = 'top',\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n className,\n}: TooltipProps) {\n const [uncontrolled, setUncontrolled] = useState(defaultOpen);\n const open = openProp ?? uncontrolled;\n\n const triggerRef = useRef<HTMLSpanElement | null>(null);\n const tipRef = useRef<HTMLDivElement | null>(null);\n const pressTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const [tipNode, setTipNode] = useState<HTMLDivElement | null>(null);\n const [pos, setPos] = useState<Position | null>(null);\n const id = useId();\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (openProp == null) setUncontrolled(next);\n onOpenChange?.(next);\n },\n [openProp, onOpenChange],\n );\n\n const reposition = useCallback(() => {\n const trigger = triggerRef.current;\n const tip = tipRef.current;\n if (!trigger || !tip) return;\n setPos(compute(trigger.getBoundingClientRect(), tip.getBoundingClientRect(), placement, tip));\n }, [placement]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: tipNode re-runs this once Presence mounts the tip, a render after `open` flips\n useLayoutEffect(() => {\n if (open) reposition();\n }, [open, reposition, tipNode]);\n\n useEffect(() => {\n if (!open) return;\n const onScroll = () => setOpen(false);\n window.addEventListener('scroll', onScroll, true);\n window.addEventListener('resize', reposition);\n return () => {\n window.removeEventListener('scroll', onScroll, true);\n window.removeEventListener('resize', reposition);\n };\n }, [open, reposition, setOpen]);\n\n useEffect(() => {\n if (!open) return;\n const onKey = (event: KeyboardEvent) => {\n if (event.key === 'Escape') setOpen(false);\n };\n document.addEventListener('keydown', onKey);\n return () => document.removeEventListener('keydown', onKey);\n }, [open, setOpen]);\n\n const clearPress = useCallback(() => {\n if (pressTimer.current) {\n clearTimeout(pressTimer.current);\n pressTimer.current = null;\n }\n }, []);\n\n useEffect(() => clearPress, [clearPress]);\n\n return (\n <>\n {/* biome-ignore lint/a11y/noStaticElementInteractions: this span only relays hover/focus to the described tooltip; the child is the real control */}\n <span\n ref={(node) => {\n triggerRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as { current: HTMLSpanElement | null }).current = node;\n }}\n data-slot=\"tooltip-trigger\"\n className={cn(styles.trigger, className)}\n aria-describedby={open ? id : undefined}\n onPointerEnter={(event) => {\n if (event.pointerType !== 'touch') setOpen(true);\n }}\n onPointerLeave={(event) => {\n if (event.pointerType !== 'touch') setOpen(false);\n clearPress();\n }}\n onPointerDown={(event) => {\n if (event.pointerType === 'touch') {\n pressTimer.current = setTimeout(() => setOpen(true), 450);\n }\n }}\n onPointerUp={clearPress}\n onPointerCancel={clearPress}\n onFocus={() => setOpen(true)}\n onBlur={() => setOpen(false)}\n >\n {children}\n </span>\n <Portal>\n <Presence present={open}>\n <div\n ref={(node) => {\n tipRef.current = node;\n setTipNode(node);\n }}\n id={id}\n role=\"tooltip\"\n data-slot=\"tooltip-content\"\n data-state={pos ? (open ? 'open' : 'closed') : undefined}\n className={styles.tooltip}\n style={\n pos\n ? ({\n top: pos.top,\n left: pos.left,\n '--tgui--tooltip-origin-x': `${pos.originX}px`,\n '--tgui--tooltip-origin-y': `${pos.originY}px`,\n } as CSSProperties)\n : { top: 0, left: 0, opacity: 0, pointerEvents: 'none' }\n }\n data-placement={pos?.placement}\n >\n {content}\n {pos ? (\n <span\n data-slot=\"tooltip-arrow\"\n className={styles.arrow}\n style={pos.arrow}\n aria-hidden\n />\n ) : null}\n </div>\n </Presence>\n </Portal>\n </>\n );\n}\n\nTooltip.displayName = 'Tooltip';\n"],"x_google_ignoreList":[68,69,70,71,72,73,74,75,76],"mappings":";;;;;;;;;AAEA,SAAgB,EAAG,GAAG,GAAsB;CAC1C,OAAO,EAAK,CAAM;AACpB;;;ACDA,IAAa,IAAc,EAAuC,IAAI;AAEtE,EAAY,cAAc;;;ACH1B,SAAgB,IAAwC;CAClD,aAAO,SAAW,MACtB,OAAO,OAAO,UAAU;AAC1B;AAGA,SAAgB,EAAyB,GAA0B;CACjE,IAAM,IAAS,EAAkB;CACjC,IAAI,KAAU,MAAM,OAAO;CAC3B,IAAI;EACF,OAAO,EAAO,iBAAiB,CAAO;CACxC,QAAQ;EACN,OAAO;CACT;AACF;;;ACbA,IAAM,IAAa;AAEnB,SAAS,IAAgB;CACvB,OAAO,OAAO,SAAW,OAAe,OAAO,OAAO,cAAe;AACvE;AAEA,SAAgB,IAA4B;CAC1C,IAAM,IAAS,EAAkB;CASjC,OARI,IACK,EAAO,gBAAgB,SAAS,SAAS,UAG9C,EAAc,KACT,OAAO,WAAW,CAAU,CAAC,CAAC,UAAU,SAAS;AAI5D;AAEA,SAAgB,EAAoB,GAAkC;CACpE,IAAM,IAAS,EAAkB;CACjC,IAAI,KAAU,QAAQ,OAAO,EAAO,WAAY,YAE9C,OADA,EAAO,QAAQ,gBAAgB,CAAQ,SAC1B,EAAO,WAAW,gBAAgB,CAAQ;CAGzD,IAAI,CAAC,EAAc,GACjB,aAAa,CAAC;CAGhB,IAAM,IAA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GACD,CAAA,IACC,IACD;;CACG,CAAA,EACJ,CAAA,CACR,EAAA,CAAA;AAEN;AAEA,GAAQ,cAAc"}
1
+ {"version":3,"file":"index.js","names":["__defProp","__name","__defProp","__name","setRef","__defProp","__name","getElementRef","__defProp","__name","__defProp","__name"],"sources":["../src/shared/lib/cn.ts","../src/components/TguiProvider/context.ts","../src/shared/lib/telegram.ts","../src/shared/lib/appearance.ts","../src/shared/lib/platform.ts","../src/components/TguiProvider/TguiProvider.module.css","../src/components/TguiProvider/TguiProvider.tsx","../src/shared/lib/haptics.ts","../src/components/TguiProvider/useHaptic.ts","../src/components/TguiProvider/useTgui.ts","../src/components/Accordion/Accordion.module.css","../src/components/Accordion/context.ts","../src/components/Accordion/Accordion.tsx","../src/components/Accordion/AccordionItem.tsx","../src/components/Avatar/Avatar.module.css","../src/components/Avatar/Avatar.variants.ts","../src/components/Avatar/Avatar.tsx","../src/components/AvatarStack/AvatarStack.module.css","../src/components/AvatarStack/AvatarStack.tsx","../src/components/Badge/Badge.module.css","../src/components/Badge/Badge.variants.ts","../src/components/Badge/Badge.tsx","../src/components/Banner/Banner.module.css","../src/components/Banner/Banner.variants.ts","../src/components/Banner/Banner.tsx","../src/components/Blockquote/Blockquote.module.css","../src/components/Blockquote/Blockquote.tsx","../src/components/Breadcrumbs/Breadcrumbs.module.css","../src/components/Breadcrumbs/Breadcrumbs.tsx","../src/components/Spinner/Spinner.module.css","../src/components/Spinner/Spinner.variants.ts","../src/components/Spinner/Spinner.tsx","../src/components/Typography/Typography.module.css","../src/components/Typography/Typography.variants.ts","../src/components/Typography/Typography.tsx","../src/components/Subheadline/Subheadline.module.css","../src/components/Subheadline/Subheadline.variants.ts","../src/components/Subheadline/Subheadline.tsx","../src/components/Tappable/Ripple.module.css","../src/components/Tappable/Ripple.tsx","../src/components/Tappable/Tappable.module.css","../src/components/Tappable/useRipple.ts","../src/components/Tappable/Tappable.tsx","../src/components/Text/Text.module.css","../src/components/Text/Text.tsx","../src/components/Button/Button.module.css","../src/components/Button/Button.variants.ts","../src/components/Button/Button.tsx","../src/components/Callout/Callout.module.css","../src/components/Callout/Callout.tsx","../src/components/Caption/Caption.module.css","../src/components/Caption/Caption.variants.ts","../src/components/Caption/Caption.tsx","../src/components/Card/Card.context.ts","../src/components/Card/Card.module.css","../src/components/Cell/Cell.module.css","../src/components/Cell/Cell.variants.ts","../src/components/Cell/Cell.tsx","../src/components/Card/CardCell.tsx","../src/components/Card/Card.tsx","../src/components/Checkbox/Checkbox.module.css","../src/components/Checkbox/Checkbox.tsx","../src/components/Chip/Chip.module.css","../src/components/Chip/Chip.variants.ts","../src/components/Chip/Chip.tsx","../src/components/CircularProgress/CircularProgress.module.css","../src/components/CircularProgress/CircularProgress.variants.ts","../src/components/CircularProgress/CircularProgress.tsx","../node_modules/@radix-ui/primitive/dist/index.mjs","../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../node_modules/@radix-ui/react-slot/dist/index.mjs","../node_modules/@radix-ui/react-primitive/dist/index.mjs","../node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs","../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs","../node_modules/@radix-ui/react-focus-scope/dist/index.mjs","../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs","../node_modules/@radix-ui/react-presence/dist/index.mjs","../src/components/Portal/Portal.tsx","../src/components/Dialog/Dialog.module.css","../src/components/Dialog/Dialog.tsx","../src/components/Divider/Divider.module.css","../src/components/Divider/Divider.tsx","../src/components/DropdownMenu/context.ts","../src/components/DropdownMenu/CheckIcon.tsx","../src/components/DropdownMenu/DropdownMenu.module.css","../src/components/DropdownMenu/DropdownMenuCheckboxItem.tsx","../src/shared/lib/floatingPosition.ts","../src/components/DropdownMenu/DropdownMenuContent.tsx","../src/components/DropdownMenu/DropdownMenuItem.tsx","../src/components/DropdownMenu/DropdownMenuLabel.tsx","../src/components/DropdownMenu/DropdownMenuRadioGroup.tsx","../src/components/DropdownMenu/DropdownMenuRadioItem.tsx","../src/components/DropdownMenu/DropdownMenuSeparator.tsx","../src/components/DropdownMenu/DropdownMenuTrigger.tsx","../src/components/DropdownMenu/DropdownMenu.tsx","../src/components/FixedLayout/FixedLayout.module.css","../src/components/FixedLayout/FixedLayout.tsx","../src/components/Footnote/Footnote.module.css","../src/components/Footnote/Footnote.tsx","../src/components/Headline/Headline.module.css","../src/components/Headline/Headline.tsx","../src/components/HorizontalScroll/HorizontalScroll.module.css","../src/components/HorizontalScroll/HorizontalScroll.tsx","../src/components/IconButton/IconButton.module.css","../src/components/IconButton/IconButton.variants.ts","../src/components/IconButton/IconButton.tsx","../src/components/Image/Image.module.css","../src/components/Image/Image.tsx","../src/components/InlineButtons/context.ts","../src/components/InlineButtons/InlineButtons.module.css","../src/components/InlineButtons/InlineButtons.variants.ts","../src/components/InlineButtons/InlineButtonsItem.tsx","../src/components/InlineButtons/InlineButtons.tsx","../src/components/FormField/FormField.module.css","../src/components/FormField/FormField.tsx","../src/components/Input/Input.module.css","../src/components/Input/Input.tsx","../src/components/LargeTitle/LargeTitle.module.css","../src/components/LargeTitle/LargeTitle.tsx","../src/components/Link/Link.module.css","../src/components/Link/Link.tsx","../src/components/List/List.module.css","../src/components/List/List.tsx","../src/components/Pagination/Pagination.module.css","../src/components/Pagination/paginationRange.ts","../src/components/Pagination/CompactPagination.tsx","../src/components/Pagination/Pagination.tsx","../src/components/PinInput/PinInput.module.css","../src/components/PinInput/PinInput.tsx","../src/components/Title/Title.module.css","../src/components/Title/Title.variants.ts","../src/components/Title/Title.tsx","../src/components/Placeholder/Placeholder.module.css","../src/components/Placeholder/Placeholder.tsx","../src/components/Popover/context.ts","../src/components/Popover/Popover.module.css","../src/components/Popover/PopoverContent.tsx","../src/components/Popover/PopoverTrigger.tsx","../src/components/Popover/Popover.tsx","../src/components/Progress/Progress.module.css","../src/components/Progress/Progress.tsx","../src/components/Radio/Radio.module.css","../src/components/Radio/Radio.tsx","../src/components/Rating/Rating.module.css","../src/components/Rating/Rating.tsx","../src/components/SearchBar/SearchBar.module.css","../src/components/SearchBar/SearchBar.tsx","../src/components/Section/Section.module.css","../src/components/Section/SectionFooter.tsx","../src/components/Section/SectionHeader.tsx","../src/components/Section/Section.tsx","../src/components/SegmentedControl/context.ts","../src/components/SegmentedControl/SegmentedControl.module.css","../src/components/SegmentedControl/SegmentedControl.tsx","../src/components/SegmentedControl/SegmentedControlItem.tsx","../src/components/Select/Select.module.css","../src/components/Select/Select.tsx","../src/shared/lib/useReducedMotion.ts","../src/components/Sheet/Sheet.module.css","../src/components/Sheet/Sheet.tsx","../src/components/Skeleton/Skeleton.module.css","../src/components/Skeleton/Skeleton.tsx","../src/components/Slider/Slider.module.css","../src/components/Slider/Slider.tsx","../src/components/Snackbar/context.ts","../src/components/Snackbar/Snackbar.module.css","../src/components/Snackbar/SnackbarProvider.tsx","../src/components/Snackbar/useSnackbar.ts","../src/components/Spoiler/particles.ts","../src/components/Spoiler/Spoiler.module.css","../src/components/Spoiler/Spoiler.tsx","../src/components/Stepper/Stepper.module.css","../src/components/Stepper/Stepper.tsx","../src/components/Steps/Steps.module.css","../src/components/Steps/Steps.tsx","../src/components/Switch/Switch.module.css","../src/components/Switch/Switch.tsx","../src/components/TabBar/TabBar.module.css","../src/components/TabBar/TabBarItem.tsx","../src/components/TabBar/TabBar.tsx","../src/components/Textarea/Textarea.module.css","../src/components/Textarea/Textarea.tsx","../src/components/Timeline/Timeline.module.css","../src/components/Timeline/Timeline.tsx","../src/components/Timeline/TimelineItem.tsx","../src/components/Tooltip/Tooltip.module.css","../src/components/Tooltip/Tooltip.tsx","../src/telegram/lib.ts","../src/telegram/useBackButton.ts","../src/telegram/useClosingConfirmation.ts","../src/telegram/useCloudStorage.ts","../src/telegram/useInitData.ts","../src/telegram/bottomButton.ts","../src/telegram/useMainButton.ts","../src/telegram/useSecondaryButton.ts","../src/telegram/useSettingsButton.ts","../src/telegram/useVerticalSwipes.ts","../src/telegram/useViewport.ts"],"sourcesContent":["import { type ClassValue, clsx } from 'clsx';\n\nexport function cn(...inputs: ClassValue[]) {\n return clsx(inputs);\n}\n","import { createContext } from 'react';\nimport type { TguiContextValue } from '../../shared/types/tgui';\n\nexport const TguiContext = createContext<TguiContextValue | null>(null);\n\nTguiContext.displayName = 'TguiContext';\n","import type { WebApp } from '../types/telegram';\n\nexport function getTelegramWebApp(): WebApp | undefined {\n if (typeof window === 'undefined') return undefined;\n return window.Telegram?.WebApp;\n}\n\n// true only inside a Telegram client whose Bot API is at least `version`\nexport function isTelegramVersionAtLeast(version: string): boolean {\n const webApp = getTelegramWebApp();\n if (webApp == null) return false;\n try {\n return webApp.isVersionAtLeast(version);\n } catch {\n return false;\n }\n}\n","import type { Appearance } from '../types/tgui';\nimport { getTelegramWebApp } from './telegram';\n\nconst DARK_QUERY = '(prefers-color-scheme: dark)';\n\nfunction canMatchMedia() {\n return typeof window !== 'undefined' && typeof window.matchMedia === 'function';\n}\n\nexport function getAppearance(): Appearance {\n const webApp = getTelegramWebApp();\n if (webApp) {\n return webApp.colorScheme === 'dark' ? 'dark' : 'light';\n }\n\n if (canMatchMedia()) {\n return window.matchMedia(DARK_QUERY).matches ? 'dark' : 'light';\n }\n\n return 'light';\n}\n\nexport function subscribeAppearance(onChange: () => void): () => void {\n const webApp = getTelegramWebApp();\n if (webApp != null && typeof webApp.onEvent === 'function') {\n webApp.onEvent('themeChanged', onChange);\n return () => webApp.offEvent?.('themeChanged', onChange);\n }\n\n if (!canMatchMedia()) {\n return () => {};\n }\n\n const media = window.matchMedia(DARK_QUERY);\n media.addEventListener('change', onChange);\n return () => media.removeEventListener('change', onChange);\n}\n","import type { TguiPlatform } from '../types/tgui';\nimport { getTelegramWebApp } from './telegram';\n\nconst TELEGRAM_IOS_LIKE = new Set(['ios', 'macos']);\n\nexport function getPlatform(): TguiPlatform {\n const webApp = getTelegramWebApp();\n if (webApp) {\n return TELEGRAM_IOS_LIKE.has(webApp.platform) ? 'ios' : 'base';\n }\n\n if (typeof navigator === 'undefined') {\n return 'base';\n }\n\n const ua = navigator.userAgent;\n const isIpadOs = ua.includes('Macintosh') && navigator.maxTouchPoints > 1;\n\n return /iphone|ipad|ipod/i.test(ua) || isIpadOs ? 'ios' : 'base';\n}\n","/* design tokens: palette (raw) → semantic (the component API, light/dark) → component */\n\n.wrapper {\n /* ─── palette ─────────────────────────────────────────────── */\n --tgui--white: #ffffff;\n --tgui--black: #000000;\n --tgui--palette-blue: #007aff;\n --tgui--palette-red: #ff3b30;\n --tgui--palette-green: #34c759;\n --tgui--palette-orange: #ff9500;\n --tgui--palette-yellow: #ffcc00;\n --tgui--palette-purple: #af52de;\n\n /* ─── semantic · surfaces ─────────────────────────────────── */\n --tgui--bg: var(--tg-theme-bg-color, #ffffff);\n --tgui--bg-secondary: var(--tg-theme-secondary-bg-color, #f2f2f7);\n --tgui--bg-elevated: var(--tg-theme-section-bg-color, #ffffff);\n --tgui--fill: rgba(120, 120, 128, 0.12);\n --tgui--fill-secondary: rgba(120, 120, 128, 0.08);\n --tgui--fill-tertiary: rgba(118, 118, 128, 0.05);\n\n /* ─── semantic · content (greyscale hierarchy) ────────────── */\n --tgui--label: var(--tg-theme-text-color, #000000);\n /* secondaryLabel darkened from the iOS #8e8e93 to clear WCAG AA on white + tint */\n --tgui--label-secondary: var(--tg-theme-hint-color, #68686d);\n --tgui--label-tertiary: rgba(60, 60, 67, 0.3);\n --tgui--label-quaternary: rgba(60, 60, 67, 0.18);\n --tgui--placeholder: rgba(60, 60, 67, 0.3);\n\n /* ─── semantic · lines ───────────────────────────────────── */\n --tgui--separator: rgba(60, 60, 67, 0.13);\n --tgui--separator-opaque: #c6c6c8;\n\n /* ─── semantic · accent & status ─────────────────────────── */\n --tgui--accent: var(--tg-theme-button-color, #007aff);\n --tgui--accent-label: var(--tg-theme-button-text-color, #ffffff);\n /* *-strong: accent/link/destructive made WCAG-AA-safe (raw hues run ≈3.6:1) */\n --tgui--accent-strong: var(--tgui--accent);\n --tgui--accent-fill: rgba(0, 122, 255, 0.12);\n --tgui--link: var(--tg-theme-link-color, #007aff);\n --tgui--link-strong: var(--tgui--link);\n --tgui--destructive: var(--tg-theme-destructive-text-color, #ff3b30);\n --tgui--destructive-label: #ffffff;\n --tgui--destructive-strong: var(--tgui--destructive);\n --tgui--success: #34c759;\n --tgui--warning: #ff9500;\n\n /* ─── semantic · focus ───────────────────────────────────── */\n /* one ring for every interactive component – outline, so overflow never clips it\n and it survives forced-colors. resolves per theme via --tgui--accent.\n -shadow is the same ring as a box-shadow, for small proxies (checkbox / knob). */\n --tgui--focus-ring: 2px solid var(--tgui--accent);\n --tgui--focus-ring-offset: 2px;\n --tgui--focus-ring-shadow: 0 0 0 2px var(--tgui--accent);\n\n /* ─── semantic · surface ─────────────────────────────────── */\n /* one background for every raised surface in the kit – cards, sections, tab bar,\n and every floating overlay (popover, menu, dialog, sheet, tooltip, snackbar).\n resolves per theme through --tgui--bg-elevated, so no dark override of its own. */\n --tgui--surface-bg: var(--tgui--bg-elevated);\n /* the floating elevation – hairline ring + ambient shadow – only overlays wear it */\n --tgui--overlay-shadow: 0 0 0 0.5px var(--tgui--separator), var(--tgui--shadow-lg);\n\n /* ─── spacing (name = px) ────────────────────────────────── */\n --tgui--space-2: 2px;\n --tgui--space-4: 4px;\n --tgui--space-8: 8px;\n --tgui--space-12: 12px;\n --tgui--space-16: 16px;\n --tgui--space-20: 20px;\n --tgui--space-24: 24px;\n --tgui--space-32: 32px;\n --tgui--space-40: 40px;\n --tgui--space-48: 48px;\n --tgui--space-64: 64px;\n --tgui--page-margin: 16px;\n --tgui--tap-target: 44px;\n --tgui--hairline: 1px;\n\n /* device safe area, chaining in Telegram's own value where it provides one */\n --tgui--safe-area-top: var(--tg-safe-area-inset-top, 0px);\n --tgui--safe-area-right: var(--tg-safe-area-inset-right, 0px);\n --tgui--safe-area-bottom: var(--tg-safe-area-inset-bottom, 0px);\n --tgui--safe-area-left: var(--tg-safe-area-inset-left, 0px);\n /* margin taken by Telegram's own UI inside the webview */\n --tgui--content-safe-area-top: var(--tg-content-safe-area-inset-top, 0px);\n --tgui--content-safe-area-bottom: var(--tg-content-safe-area-inset-bottom, 0px);\n\n /* ─── radius (one knob + derived) ───────────────────────── */\n --tgui--radius: 12px;\n --tgui--radius-sm: 8px;\n --tgui--radius-lg: 16px;\n --tgui--radius-full: 999px;\n\n /* ─── elevation (soft, low-opacity, large-radius) ───────── */\n --tgui--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);\n --tgui--shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);\n --tgui--shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.18);\n\n /* ─── materials (blur + bg; components apply both; fallback below) ─ */\n --tgui--material-blur-ultra-thin: blur(20px) saturate(1.8);\n --tgui--material-blur-thin: blur(30px) saturate(1.8);\n --tgui--material-blur-regular: blur(40px) saturate(1.8);\n --tgui--material-blur-thick: blur(50px) saturate(1.8);\n --tgui--material-bg-ultra-thin: rgba(255, 255, 255, 0.55);\n --tgui--material-bg-thin: rgba(255, 255, 255, 0.7);\n --tgui--material-bg-regular: rgba(255, 255, 255, 0.82);\n --tgui--material-bg-thick: rgba(255, 255, 255, 0.93);\n\n /* ─── motion ─────────────────────────────────────────────── */\n --tgui--duration-instant: 100ms;\n --tgui--duration-overlay: 150ms;\n --tgui--duration-fast: 200ms;\n --tgui--duration-base: 300ms;\n --tgui--duration-slow: 340ms;\n --tgui--ease-standard: cubic-bezier(0.4, 0, 0.2, 1);\n --tgui--ease-out: cubic-bezier(0, 0, 0.2, 1);\n --tgui--ease-in: cubic-bezier(0.4, 0, 1, 1);\n --tgui--ease-spring: cubic-bezier(0.32, 0.72, 0, 1);\n\n /* ─── z-index ────────────────────────────────────────────── */\n --tgui--z-base: 1;\n --tgui--z-raised: 10;\n --tgui--z-sticky: 100;\n --tgui--z-overlay: 1000;\n --tgui--z-toast: 1100;\n\n /* ─── typography ─────────────────────────────────────────── */\n --tgui--font-family:\n -apple-system, BlinkMacSystemFont, \"SF Pro Text\", \"SF Pro Display\", \"Helvetica Neue\",\n \"Segoe UI\", \"Roboto\", system-ui, sans-serif;\n --tgui--font-family-mono: ui-monospace, \"SF Mono\", \"Geist Mono\", \"Menlo\", monospace;\n\n --tgui--weight-regular: 400;\n --tgui--weight-medium: 500;\n --tgui--weight-semibold: 600;\n --tgui--weight-bold: 700;\n\n /* iOS semantic text styles: size / line-height / weight / tracking */\n --tgui--font-large-title-size: 34px;\n --tgui--font-large-title-line: 41px;\n --tgui--font-large-title-weight: 700;\n --tgui--font-large-title-tracking: 0.4px;\n\n --tgui--font-title-1-size: 28px;\n --tgui--font-title-1-line: 34px;\n --tgui--font-title-1-weight: 700;\n --tgui--font-title-1-tracking: 0.36px;\n\n --tgui--font-title-2-size: 22px;\n --tgui--font-title-2-line: 28px;\n --tgui--font-title-2-weight: 700;\n --tgui--font-title-2-tracking: 0.35px;\n\n --tgui--font-title-3-size: 20px;\n --tgui--font-title-3-line: 25px;\n --tgui--font-title-3-weight: 600;\n --tgui--font-title-3-tracking: 0.38px;\n\n --tgui--font-headline-size: 17px;\n --tgui--font-headline-line: 22px;\n --tgui--font-headline-weight: 600;\n --tgui--font-headline-tracking: -0.43px;\n\n --tgui--font-body-size: 17px;\n --tgui--font-body-line: 22px;\n --tgui--font-body-weight: 400;\n --tgui--font-body-tracking: -0.43px;\n\n --tgui--font-callout-size: 16px;\n --tgui--font-callout-line: 21px;\n --tgui--font-callout-weight: 400;\n --tgui--font-callout-tracking: -0.31px;\n\n --tgui--font-subheadline-size: 15px;\n --tgui--font-subheadline-line: 20px;\n --tgui--font-subheadline-weight: 400;\n --tgui--font-subheadline-tracking: -0.23px;\n\n --tgui--font-footnote-size: 13px;\n --tgui--font-footnote-line: 18px;\n --tgui--font-footnote-weight: 400;\n --tgui--font-footnote-tracking: -0.08px;\n\n --tgui--font-caption-1-size: 12px;\n --tgui--font-caption-1-line: 16px;\n --tgui--font-caption-1-weight: 400;\n --tgui--font-caption-1-tracking: 0px;\n\n --tgui--font-caption-2-size: 11px;\n --tgui--font-caption-2-line: 13px;\n --tgui--font-caption-2-weight: 400;\n --tgui--font-caption-2-tracking: 0.06px;\n\n /* ─── field chrome (shared by FormField / SearchBar / Stepper) ─── */\n --tgui--field-padding-x: 16px;\n --tgui--field-padding-y: 12px;\n --tgui--field-radius: 12px;\n --tgui--field-gap: 12px;\n --tgui--field-min-height: 48px;\n\n -webkit-tap-highlight-color: transparent;\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-family: var(--tgui--font-family);\n font-optical-sizing: auto;\n color: var(--tgui--label);\n}\n\n/* platform: iOS shares the HIG type scale with base; kept for CSS-only iOS diffs */\n.wrapper--ios {\n /* intentionally minimal – structural platform differences are handled in JS */\n}\n\n.wrapper--dark {\n --tgui--palette-blue: #0a84ff;\n --tgui--palette-red: #ff453a;\n --tgui--palette-green: #30d158;\n --tgui--palette-orange: #ff9f0a;\n\n --tgui--bg: var(--tg-theme-bg-color, #000000);\n --tgui--bg-secondary: var(--tg-theme-secondary-bg-color, #000000);\n --tgui--bg-elevated: var(--tg-theme-section-bg-color, #1c1c1e);\n --tgui--fill: rgba(120, 120, 128, 0.24);\n --tgui--fill-secondary: rgba(120, 120, 128, 0.16);\n --tgui--fill-tertiary: rgba(118, 118, 128, 0.12);\n\n --tgui--label: var(--tg-theme-text-color, #ffffff);\n --tgui--label-secondary: var(--tg-theme-hint-color, #98989e);\n --tgui--label-tertiary: rgba(235, 235, 245, 0.3);\n --tgui--label-quaternary: rgba(235, 235, 245, 0.16);\n --tgui--placeholder: rgba(235, 235, 245, 0.3);\n\n --tgui--separator: rgba(84, 84, 88, 0.6);\n --tgui--separator-opaque: #38383a;\n\n --tgui--accent: var(--tg-theme-button-color, #0a84ff);\n --tgui--accent-fill: rgba(10, 132, 255, 0.2);\n --tgui--link: var(--tg-theme-link-color, #0a84ff);\n --tgui--destructive: var(--tg-theme-destructive-text-color, #ff453a);\n --tgui--success: #30d158;\n --tgui--warning: #ff9f0a;\n\n --tgui--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);\n --tgui--shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);\n --tgui--shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);\n\n --tgui--material-bg-ultra-thin: rgba(28, 28, 30, 0.55);\n --tgui--material-bg-thin: rgba(28, 28, 30, 0.7);\n --tgui--material-bg-regular: rgba(28, 28, 30, 0.82);\n --tgui--material-bg-thick: rgba(28, 28, 30, 0.93);\n}\n\n@media (min-resolution: 2dppx) {\n .wrapper {\n --tgui--hairline: 0.5px;\n }\n}\n\n@supports (padding: max(0px, env(safe-area-inset-top))) {\n .wrapper {\n --tgui--safe-area-top: max(env(safe-area-inset-top), var(--tg-safe-area-inset-top, 0px));\n --tgui--safe-area-right: max(env(safe-area-inset-right), var(--tg-safe-area-inset-right, 0px));\n --tgui--safe-area-bottom: max(\n env(safe-area-inset-bottom),\n var(--tg-safe-area-inset-bottom, 0px)\n );\n --tgui--safe-area-left: max(env(safe-area-inset-left), var(--tg-safe-area-inset-left, 0px));\n }\n}\n\n@supports (color: color-mix(in srgb, red 10%, transparent)) {\n .wrapper {\n --tgui--accent-fill: color-mix(in srgb, var(--tgui--accent) 12%, transparent);\n --tgui--accent-strong: color-mix(in srgb, var(--tgui--accent) 76%, #000);\n --tgui--link-strong: color-mix(in srgb, var(--tgui--link) 76%, #000);\n --tgui--destructive-strong: color-mix(in srgb, var(--tgui--destructive) 76%, #000);\n --tgui--material-bg-ultra-thin: color-mix(in srgb, var(--tgui--bg-elevated) 55%, transparent);\n --tgui--material-bg-thin: color-mix(in srgb, var(--tgui--bg-elevated) 70%, transparent);\n --tgui--material-bg-regular: color-mix(in srgb, var(--tgui--bg-elevated) 82%, transparent);\n --tgui--material-bg-thick: color-mix(in srgb, var(--tgui--bg-elevated) 93%, transparent);\n }\n\n .wrapper--dark {\n --tgui--accent-fill: color-mix(in srgb, var(--tgui--accent) 22%, transparent);\n /* fill stays deep for white text; text hues stay raw (bright on near-black) */\n --tgui--accent-strong: color-mix(in srgb, var(--tgui--accent) 80%, #000);\n --tgui--link-strong: var(--tgui--link);\n --tgui--destructive-strong: var(--tgui--destructive);\n }\n}\n\n/* material fallbacks – must come after the color-mix block to win */\n@media (prefers-reduced-transparency: reduce) {\n .wrapper {\n --tgui--material-blur-ultra-thin: none;\n --tgui--material-blur-thin: none;\n --tgui--material-blur-regular: none;\n --tgui--material-blur-thick: none;\n --tgui--material-bg-ultra-thin: var(--tgui--bg-elevated);\n --tgui--material-bg-thin: var(--tgui--bg-elevated);\n --tgui--material-bg-regular: var(--tgui--bg-elevated);\n --tgui--material-bg-thick: var(--tgui--bg-elevated);\n }\n}\n\n@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {\n .wrapper {\n --tgui--material-bg-ultra-thin: var(--tgui--bg-elevated);\n --tgui--material-bg-thin: var(--tgui--bg-elevated);\n --tgui--material-bg-regular: var(--tgui--bg-elevated);\n --tgui--material-bg-thick: var(--tgui--bg-elevated);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wrapper *,\n .wrapper *::before,\n .wrapper *::after {\n /* biome-ignore lint/complexity/noImportantStyles: a reduced-motion reset must beat every component's own transition/animation */\n animation-duration: 0.01ms !important;\n /* biome-ignore lint/complexity/noImportantStyles: see above */\n animation-iteration-count: 1 !important;\n /* biome-ignore lint/complexity/noImportantStyles: see above */\n transition-duration: 0.01ms !important;\n /* biome-ignore lint/complexity/noImportantStyles: see above */\n scroll-behavior: auto !important;\n }\n}\n","import {\n type HTMLAttributes,\n type Ref,\n useCallback,\n useMemo,\n useState,\n useSyncExternalStore,\n} from 'react';\nimport { getAppearance, subscribeAppearance } from '../../shared/lib/appearance';\nimport { cn } from '../../shared/lib/cn';\nimport { getPlatform } from '../../shared/lib/platform';\nimport type { Appearance, TguiPlatform } from '../../shared/types/tgui';\nimport { TguiContext } from './context';\nimport styles from './TguiProvider.module.css';\n\nexport interface TguiProviderProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n platform?: TguiPlatform;\n appearance?: Appearance;\n portalContainer?: HTMLElement | null;\n // set false to opt every component out of Telegram haptic feedback\n haptics?: boolean;\n}\n\nconst getServerAppearance = (): Appearance => 'light';\n\nexport function TguiProvider({\n ref,\n platform: platformProp,\n appearance: appearanceProp,\n portalContainer: portalContainerProp,\n haptics = true,\n className,\n children,\n ...rest\n}: TguiProviderProps) {\n const platform = useMemo(() => platformProp ?? getPlatform(), [platformProp]);\n\n const systemAppearance = useSyncExternalStore(\n subscribeAppearance,\n getAppearance,\n getServerAppearance,\n );\n const appearance = appearanceProp ?? systemAppearance;\n\n const [wrapper, setWrapper] = useState<HTMLDivElement | null>(null);\n const setRef = useCallback(\n (node: HTMLDivElement | null) => {\n setWrapper(node);\n\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n },\n [ref],\n );\n\n const value = useMemo(\n () => ({\n platform,\n appearance,\n portalContainer: portalContainerProp ?? wrapper,\n haptics,\n }),\n [platform, appearance, portalContainerProp, wrapper, haptics],\n );\n\n return (\n <div\n ref={setRef}\n data-slot=\"tgui-provider\"\n data-platform={platform}\n data-appearance={appearance}\n className={cn(\n styles.wrapper,\n platform === 'ios' && styles['wrapper--ios'],\n appearance === 'dark' && styles['wrapper--dark'],\n className,\n )}\n {...rest}\n >\n <TguiContext.Provider value={value}>{children}</TguiContext.Provider>\n </div>\n );\n}\n\nTguiProvider.displayName = 'TguiProvider';\n","import { getTelegramWebApp } from './telegram';\n\n// semantic intents, mapped to Telegram's HapticFeedback API\nexport type HapticIntent = 'tap' | 'press' | 'select' | 'success' | 'warning' | 'error';\n\n// fire a haptic through the Telegram client; a no-op everywhere else\nexport function triggerHaptic(intent: HapticIntent): void {\n const haptic = getTelegramWebApp()?.HapticFeedback;\n if (haptic == null) return;\n try {\n switch (intent) {\n case 'tap':\n haptic.impactOccurred('light');\n break;\n case 'press':\n haptic.impactOccurred('medium');\n break;\n case 'select':\n haptic.selectionChanged();\n break;\n case 'success':\n haptic.notificationOccurred('success');\n break;\n case 'warning':\n haptic.notificationOccurred('warning');\n break;\n case 'error':\n haptic.notificationOccurred('error');\n break;\n }\n } catch {\n // older clients throw on styles they don't support\n }\n}\n","import { useCallback, useContext } from 'react';\nimport { type HapticIntent, triggerHaptic } from '../../shared/lib/haptics';\nimport { TguiContext } from './context';\n\n// returns a stable function that fires a Telegram haptic, respecting the\n// provider's `haptics` flag; a no-op outside Telegram and provider-optional\nexport function useHaptic(): (intent: HapticIntent) => void {\n const enabled = useContext(TguiContext)?.haptics ?? true;\n return useCallback(\n (intent: HapticIntent) => {\n if (enabled) triggerHaptic(intent);\n },\n [enabled],\n );\n}\n","import { useContext } from 'react';\nimport type { TguiContextValue } from '../../shared/types/tgui';\nimport { TguiContext } from './context';\n\nexport function useTgui(): TguiContextValue {\n const context = useContext(TguiContext);\n\n if (context === null) {\n throw new Error('useTgui must be used within a <TguiProvider>.');\n }\n\n return context;\n}\n",".accordion {\n display: flex;\n flex-direction: column;\n}\n\n.item {\n border-bottom: var(--tgui--hairline, 1px) solid var(--tgui--separator);\n}\n\n.item:last-child {\n border-bottom: 0;\n}\n\n.header {\n display: flex;\n align-items: center;\n gap: 12px;\n width: 100%;\n padding: 15px var(--tgui--accordion-inset, 20px);\n border: 0;\n background: transparent;\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 16px;\n font-weight: var(--tgui--weight-semibold);\n line-height: 22px;\n text-align: start;\n cursor: pointer;\n}\n\n.title {\n flex: 1;\n min-width: 0;\n}\n\n.header:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: calc(-1 * var(--tgui--focus-ring-offset));\n}\n\n.chevron {\n flex-shrink: 0;\n width: 18px;\n height: 18px;\n color: var(--tgui--label-tertiary);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .chevron {\n transition: transform 0.2s ease;\n }\n}\n\n.header[aria-expanded=\"true\"] .chevron {\n transform: rotate(180deg);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .header:hover .title {\n color: var(--tgui--link-strong);\n }\n}\n\n.panel {\n display: grid;\n grid-template-rows: 0fr;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .panel {\n transition: grid-template-rows 0.25s ease;\n }\n}\n\n.panel[data-state=\"open\"] {\n grid-template-rows: 1fr;\n}\n\n.panelInner {\n overflow: hidden;\n}\n\n.panelContent {\n padding: 2px var(--tgui--accordion-inset, 20px) 16px;\n color: var(--tgui--label-secondary);\n font-family: var(--tgui--font-family);\n font-size: 15px;\n line-height: 21px;\n}\n","import { createContext } from 'react';\n\nexport interface AccordionContextValue {\n open: string[];\n toggle: (value: string) => void;\n}\n\nexport const AccordionContext = createContext<AccordionContextValue | null>(null);\n\nAccordionContext.displayName = 'AccordionContext';\n","'use client';\n\nimport { type HTMLAttributes, type Ref, useCallback, useMemo, useState } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic } from '../TguiProvider';\nimport styles from './Accordion.module.css';\nimport { AccordionContext } from './context';\n\nconst toArray = (value: string | string[] | undefined): string[] =>\n value == null ? [] : Array.isArray(value) ? value : [value];\n\nexport interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {\n ref?: Ref<HTMLDivElement>;\n multiple?: boolean;\n value?: string | string[];\n defaultValue?: string | string[];\n onValueChange?: (value: string[]) => void;\n}\n\nexport function Accordion({\n ref,\n multiple = false,\n value: valueProp,\n defaultValue,\n onValueChange,\n className,\n children,\n ...rest\n}: AccordionProps) {\n const [uncontrolled, setUncontrolled] = useState(() => toArray(defaultValue));\n const open = valueProp != null ? toArray(valueProp) : uncontrolled;\n const haptic = useHaptic();\n\n const toggle = useCallback(\n (item: string) => {\n const isOpen = open.includes(item);\n const next = isOpen ? open.filter((v) => v !== item) : multiple ? [...open, item] : [item];\n haptic('tap');\n if (valueProp == null) setUncontrolled(next);\n onValueChange?.(next);\n },\n [open, multiple, valueProp, onValueChange, haptic],\n );\n\n const context = useMemo(() => ({ open, toggle }), [open, toggle]);\n\n return (\n <AccordionContext.Provider value={context}>\n <div ref={ref} data-slot=\"accordion\" className={cn(styles.accordion, className)} {...rest}>\n {children}\n </div>\n </AccordionContext.Provider>\n );\n}\n\nAccordion.displayName = 'Accordion';\n","'use client';\n\nimport { type HTMLAttributes, type ReactNode, type Ref, useContext, useId } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Accordion.module.css';\nimport { AccordionContext } from './context';\n\nexport interface AccordionItemProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n value: string;\n header: ReactNode;\n}\n\nexport function AccordionItem({\n ref,\n value,\n header,\n className,\n children,\n ...rest\n}: AccordionItemProps) {\n const context = useContext(AccordionContext);\n if (!context) {\n throw new Error('AccordionItem must be used within an <Accordion>.');\n }\n const panelId = useId();\n const open = context.open.includes(value);\n\n const state = open ? 'open' : 'closed';\n\n return (\n <div\n ref={ref}\n data-slot=\"accordion-item\"\n data-state={state}\n className={cn(styles.item, className)}\n {...rest}\n >\n <button\n type=\"button\"\n data-slot=\"accordion-trigger\"\n data-state={state}\n className={styles.header}\n aria-expanded={open}\n aria-controls={panelId}\n onClick={() => context.toggle(value)}\n >\n <span className={styles.title}>{header}</span>\n <svg className={styles.chevron} viewBox=\"0 0 18 18\" fill=\"none\" aria-hidden>\n <path\n d=\"M4.5 7l4.5 4.5L13.5 7\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n <div data-slot=\"accordion-panel\" data-state={state} className={styles.panel}>\n <div className={styles.panelInner}>\n <div\n id={panelId}\n data-slot=\"accordion-content\"\n className={styles.panelContent}\n inert={!open}\n aria-hidden={!open}\n >\n {children}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nAccordionItem.displayName = 'AccordionItem';\n",".avatar {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n flex-shrink: 0;\n overflow: hidden;\n border-radius: 50%;\n background: var(--tgui--fill);\n color: var(--tgui--label-secondary);\n font-family: var(--tgui--font-family);\n font-weight: var(--tgui--weight-semibold);\n line-height: 1;\n user-select: none;\n}\n\n.s20 {\n width: 20px;\n height: 20px;\n font-size: 9px;\n}\n\n.s24 {\n width: 24px;\n height: 24px;\n font-size: 10px;\n}\n\n.s28 {\n width: 28px;\n height: 28px;\n font-size: 11px;\n}\n\n.s40 {\n width: 40px;\n height: 40px;\n font-size: 15px;\n}\n\n.s48 {\n width: 48px;\n height: 48px;\n font-size: 18px;\n}\n\n.s96 {\n width: 96px;\n height: 96px;\n font-size: 34px;\n}\n\n.img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n}\n\n.acronym {\n text-transform: uppercase;\n}\n\n.icon {\n display: flex;\n width: 60%;\n height: 60%;\n}\n\n.icon > svg {\n width: 100%;\n height: 100%;\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Avatar.module.css';\n\nexport type AvatarSize = 20 | 24 | 28 | 40 | 48 | 96;\n\nexport const avatar = cva(styles.avatar, {\n variants: {\n size: {\n 20: styles.s20,\n 24: styles.s24,\n 28: styles.s28,\n 40: styles.s40,\n 48: styles.s48,\n 96: styles.s96,\n },\n },\n defaultVariants: { size: 40 },\n});\n","'use client';\n\nimport { type HTMLAttributes, type ReactNode, type Ref, useState } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Avatar.module.css';\nimport { type AvatarSize, avatar } from './Avatar.variants';\n\nexport type { AvatarSize };\n\nexport interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {\n ref?: Ref<HTMLSpanElement>;\n size?: AvatarSize;\n src?: string;\n alt?: string;\n acronym?: string;\n fallbackIcon?: ReactNode;\n}\n\nfunction PersonIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden>\n <path d=\"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0 2c-4.2 0-7 2.4-7 4.5V20h14v-1.5c0-2.1-2.8-4.5-7-4.5Z\" />\n </svg>\n );\n}\n\nexport function Avatar({\n ref,\n size = 40,\n src,\n alt = '',\n acronym,\n fallbackIcon,\n className,\n children,\n ...rest\n}: AvatarProps) {\n const [failedSrc, setFailedSrc] = useState<string | null>(null);\n const showImage = src != null && src !== '' && src !== failedSrc;\n\n return (\n <span ref={ref} data-slot=\"avatar\" className={cn(avatar({ size }), className)} {...rest}>\n {showImage ? (\n <img\n data-slot=\"avatar-image\"\n className={styles.img}\n src={src}\n alt={alt}\n loading=\"lazy\"\n onError={() => setFailedSrc(src)}\n />\n ) : acronym ? (\n <span data-slot=\"avatar-fallback\" className={styles.acronym}>\n {acronym}\n </span>\n ) : (\n <span data-slot=\"avatar-fallback\" className={styles.icon}>\n {fallbackIcon ?? <PersonIcon />}\n </span>\n )}\n {children}\n </span>\n );\n}\n\nAvatar.displayName = 'Avatar';\n",".stack {\n display: inline-flex;\n align-items: center;\n}\n\n.stack > * {\n margin-inline-start: calc(-1 * var(--tgui--avatar-stack-overlap, 8px));\n border-radius: 50%;\n box-shadow: 0 0 0 2px var(--tgui--bg);\n}\n\n.stack > *:first-child {\n margin-inline-start: 0;\n}\n","import type { CSSProperties, HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './AvatarStack.module.css';\n\nexport interface AvatarStackProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n overlap?: number;\n}\n\nexport function AvatarStack({ ref, overlap, className, style, ...rest }: AvatarStackProps) {\n return (\n <div\n ref={ref}\n data-slot=\"avatar-stack\"\n className={cn(styles.stack, className)}\n style={\n overlap != null\n ? ({ ...style, '--tgui--avatar-stack-overlap': `${overlap}px` } as CSSProperties)\n : style\n }\n {...rest}\n />\n );\n}\n\nAvatarStack.displayName = 'AvatarStack';\n",".badge {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n flex-shrink: 0;\n font-family: var(--tgui--font-family);\n font-weight: var(--tgui--weight-semibold);\n}\n\n.number {\n min-width: 20px;\n height: 20px;\n padding: 0 6px;\n border-radius: 10px;\n font-size: 13px;\n line-height: 1;\n}\n\n.large.number {\n min-width: 24px;\n height: 24px;\n padding: 0 8px;\n border-radius: 12px;\n font-size: 15px;\n}\n\n.dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n}\n\n.large.dot {\n width: 10px;\n height: 10px;\n}\n\n.mode-primary {\n color: var(--tgui--accent-label);\n background: var(--tgui--accent-strong);\n}\n\n.mode-critical {\n color: var(--tgui--white);\n background: var(--tgui--destructive);\n}\n\n@supports (color: color-mix(in srgb, red 10%, transparent)) {\n .mode-critical {\n /* deep enough for the white count to pass AA in both themes */\n background: color-mix(in srgb, var(--tgui--destructive) 78%, #000);\n }\n}\n\n.mode-secondary {\n color: var(--tgui--link-strong);\n background: var(--tgui--accent-fill);\n}\n\n.mode-gray {\n color: var(--tgui--label);\n background: var(--tgui--fill);\n}\n\n.mode-white {\n color: var(--tgui--black);\n background: var(--tgui--white);\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Badge.module.css';\n\nexport type BadgeType = 'number' | 'dot';\nexport type BadgeMode = 'primary' | 'critical' | 'secondary' | 'gray' | 'white';\n\nexport const badge = cva(styles.badge, {\n variants: {\n type: { number: styles.number, dot: styles.dot },\n mode: {\n primary: styles['mode-primary'],\n critical: styles['mode-critical'],\n secondary: styles['mode-secondary'],\n gray: styles['mode-gray'],\n white: styles['mode-white'],\n },\n large: { true: styles.large },\n },\n defaultVariants: { type: 'number', mode: 'primary' },\n});\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { type BadgeMode, type BadgeType, badge } from './Badge.variants';\n\nexport type { BadgeMode, BadgeType };\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n ref?: Ref<HTMLSpanElement>;\n type?: BadgeType;\n mode?: BadgeMode;\n large?: boolean;\n children?: ReactNode;\n}\n\nexport function Badge({\n ref,\n type = 'number',\n mode = 'primary',\n large = false,\n className,\n children,\n ...rest\n}: BadgeProps) {\n return (\n <span\n ref={ref}\n data-slot=\"badge\"\n data-mode={mode}\n className={cn(badge({ type, mode, large }), className)}\n {...rest}\n >\n {type === 'number' ? children : null}\n </span>\n );\n}\n\nBadge.displayName = 'Badge';\n",".banner {\n position: relative;\n display: flex;\n gap: 16px;\n box-sizing: border-box;\n padding: 16px;\n border-radius: 12px;\n overflow: hidden;\n font-family: var(--tgui--font-family);\n}\n\n.type-section {\n background: var(--tgui--fill);\n color: var(--tgui--label);\n}\n\n.type-image {\n color: var(--tgui--white);\n}\n\n.background {\n position: absolute;\n inset: 0;\n z-index: 0;\n}\n\n.background > * {\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n\n.type-image::after {\n content: \"\";\n position: absolute;\n inset: 0;\n z-index: 1;\n background: linear-gradient(180deg, rgb(0 0 0 / 0.1), rgb(0 0 0 / 0.55));\n}\n\n.before {\n position: relative;\n z-index: 2;\n flex-shrink: 0;\n}\n\n.body {\n position: relative;\n z-index: 2;\n display: flex;\n flex-direction: column;\n gap: 4px;\n min-width: 0;\n flex: 1;\n}\n\n.callout {\n font-size: 13px;\n line-height: 16px;\n font-weight: var(--tgui--weight-semibold);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n opacity: 0.75;\n}\n\n.header {\n font-size: 16px;\n line-height: 22px;\n font-weight: var(--tgui--weight-bold);\n}\n\n.subheader {\n font-size: 14px;\n line-height: 20px;\n opacity: 0.8;\n}\n\n.description {\n margin-top: 4px;\n font-size: 14px;\n line-height: 20px;\n}\n\n.actions {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n margin-top: 12px;\n}\n\n.close {\n position: relative;\n z-index: 2;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 24px;\n height: 24px;\n margin: -4px -4px auto auto;\n padding: 0;\n border: 0;\n border-radius: 50%;\n color: currentColor;\n background: transparent;\n cursor: pointer;\n opacity: 0.7;\n}\n\n.close:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n opacity: 1;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .close:hover {\n opacity: 1;\n }\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Banner.module.css';\n\nexport type BannerType = 'section' | 'image';\n\nexport const banner = cva(styles.banner, {\n variants: {\n type: {\n section: styles['type-section'],\n image: styles['type-image'],\n },\n },\n defaultVariants: { type: 'section' },\n});\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Banner.module.css';\nimport { type BannerType, banner } from './Banner.variants';\n\nexport type { BannerType };\n\nexport interface BannerProps extends HTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n type?: BannerType;\n before?: ReactNode;\n callout?: ReactNode;\n header?: ReactNode;\n subheader?: ReactNode;\n description?: ReactNode;\n actions?: ReactNode;\n background?: ReactNode;\n onClose?: () => void;\n closeLabel?: string;\n}\n\nexport function Banner({\n ref,\n type = 'section',\n before,\n callout,\n header,\n subheader,\n description,\n actions,\n background,\n onClose,\n closeLabel = 'Close',\n className,\n children,\n ...rest\n}: BannerProps) {\n return (\n <section\n ref={ref}\n data-slot=\"banner\"\n data-type={type}\n className={cn(banner({ type }), className)}\n {...rest}\n >\n {type === 'image' && background != null ? (\n <div data-slot=\"banner-background\" className={styles.background} aria-hidden>\n {background}\n </div>\n ) : null}\n\n {before != null ? (\n <div data-slot=\"banner-before\" className={styles.before}>\n {before}\n </div>\n ) : null}\n\n <div data-slot=\"banner-body\" className={styles.body}>\n {callout != null ? (\n <span data-slot=\"banner-callout\" className={styles.callout}>\n {callout}\n </span>\n ) : null}\n {header != null ? (\n <span data-slot=\"banner-title\" className={styles.header}>\n {header}\n </span>\n ) : null}\n {subheader != null ? (\n <span data-slot=\"banner-subtitle\" className={styles.subheader}>\n {subheader}\n </span>\n ) : null}\n {description != null ? (\n <p data-slot=\"banner-description\" className={styles.description}>\n {description}\n </p>\n ) : null}\n {children}\n {actions != null ? (\n <div data-slot=\"banner-actions\" className={styles.actions}>\n {actions}\n </div>\n ) : null}\n </div>\n\n {onClose != null ? (\n <button\n type=\"button\"\n data-slot=\"banner-close\"\n className={styles.close}\n aria-label={closeLabel}\n onClick={onClose}\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden>\n <path\n d=\"M3.5 3.5l7 7M10.5 3.5l-7 7\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n </button>\n ) : null}\n </section>\n );\n}\n\nBanner.displayName = 'Banner';\n",".blockquote {\n margin: 0;\n padding: 8px 12px 8px 16px;\n border-radius: 4px 12px 12px 4px;\n border-inline-start: 3px solid var(--tgui--link);\n background: var(--tgui--accent-fill);\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 15px;\n line-height: 21px;\n}\n\n.cite {\n display: block;\n margin-top: 6px;\n color: var(--tgui--label-secondary);\n font-size: 13px;\n font-style: normal;\n}\n","import type { BlockquoteHTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Blockquote.module.css';\n\nexport interface BlockquoteProps extends BlockquoteHTMLAttributes<HTMLQuoteElement> {\n ref?: Ref<HTMLQuoteElement>;\n author?: ReactNode;\n}\n\nexport function Blockquote({ ref, author, className, children, ...rest }: BlockquoteProps) {\n return (\n <blockquote\n ref={ref}\n data-slot=\"blockquote\"\n className={cn(styles.blockquote, className)}\n {...rest}\n >\n {children}\n {author != null ? (\n <cite data-slot=\"blockquote-author\" className={styles.cite}>\n {author}\n </cite>\n ) : null}\n </blockquote>\n );\n}\n\nBlockquote.displayName = 'Blockquote';\n",".nav {\n min-width: 0;\n font-family: var(--tgui--font-family);\n font-size: 14px;\n line-height: 18px;\n}\n\n.list {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 6px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.item {\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n}\n\n.link {\n margin: 0;\n padding: 0;\n border: 0;\n background: none;\n color: var(--tgui--link-strong);\n font: inherit;\n cursor: pointer;\n text-decoration: none;\n border-radius: 4px;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .link:hover {\n text-decoration: underline;\n }\n}\n\n.link:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n.current {\n overflow: hidden;\n max-width: 220px;\n color: var(--tgui--label);\n font-weight: var(--tgui--weight-semibold);\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.ellipsis {\n color: var(--tgui--label-secondary);\n}\n\n.chevron {\n flex-shrink: 0;\n color: var(--tgui--label-secondary);\n}\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Breadcrumbs.module.css';\n\nexport interface BreadcrumbItem {\n label: ReactNode;\n href?: string;\n onClick?: () => void;\n}\n\nexport interface BreadcrumbsProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {\n ref?: Ref<HTMLElement>;\n items: BreadcrumbItem[];\n maxItems?: number;\n}\n\nconst Chevron = () => (\n <svg\n data-slot=\"breadcrumbs-separator\"\n className={styles.chevron}\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 18 18\"\n fill=\"none\"\n aria-hidden\n >\n <path\n d=\"M6.75 4.5L11.25 9l-4.5 4.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport function Breadcrumbs({ ref, items, maxItems = 4, className, ...rest }: BreadcrumbsProps) {\n const collapsed = items.length > maxItems;\n const visible: (BreadcrumbItem | 'ellipsis')[] = collapsed\n ? [items[0], 'ellipsis', ...items.slice(items.length - (maxItems - 1))]\n : items;\n\n return (\n <nav\n ref={ref}\n aria-label=\"Breadcrumbs\"\n data-slot=\"breadcrumbs\"\n className={cn(styles.nav, className)}\n {...rest}\n >\n <ol data-slot=\"breadcrumbs-list\" className={styles.list}>\n {visible.map((item, index) => {\n const isLast = index === visible.length - 1;\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: breadcrumb trail order is stable\n <li key={index} data-slot=\"breadcrumbs-item\" className={styles.item}>\n {item === 'ellipsis' ? (\n <span data-slot=\"breadcrumbs-ellipsis\" className={styles.ellipsis} aria-hidden>\n …\n </span>\n ) : isLast ? (\n <span data-slot=\"breadcrumbs-page\" className={styles.current} aria-current=\"page\">\n {item.label}\n </span>\n ) : item.href != null ? (\n <a\n href={item.href}\n data-slot=\"breadcrumbs-link\"\n className={styles.link}\n onClick={item.onClick}\n >\n {item.label}\n </a>\n ) : (\n <button\n type=\"button\"\n data-slot=\"breadcrumbs-link\"\n className={styles.link}\n onClick={item.onClick}\n >\n {item.label}\n </button>\n )}\n {!isLast ? <Chevron /> : null}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n}\n\nBreadcrumbs.displayName = 'Breadcrumbs';\n",".spinner {\n display: inline-block;\n box-sizing: border-box;\n border-radius: 50%;\n border-style: solid;\n border-color: currentColor;\n border-top-color: transparent;\n animation: tgui-spinner 0.6s linear infinite;\n}\n\n.s {\n width: 16px;\n height: 16px;\n border-width: 2px;\n}\n\n.m {\n width: 24px;\n height: 24px;\n border-width: 2.5px;\n}\n\n.l {\n width: 32px;\n height: 32px;\n border-width: 3px;\n}\n\n@keyframes tgui-spinner {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .spinner {\n animation-duration: 1.6s;\n }\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Spinner.module.css';\n\nexport type SpinnerSize = 's' | 'm' | 'l';\n\nexport const spinner = cva(styles.spinner, {\n variants: {\n size: { s: styles.s, m: styles.m, l: styles.l },\n },\n defaultVariants: { size: 'm' },\n});\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { type SpinnerSize, spinner } from './Spinner.variants';\n\nexport type { SpinnerSize };\n\nexport interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {\n ref?: Ref<HTMLSpanElement>;\n size?: SpinnerSize;\n}\n\nexport function Spinner({ ref, size = 'm', className, ...rest }: SpinnerProps) {\n return (\n <span\n ref={ref}\n role=\"status\"\n aria-label=\"Loading\"\n data-slot=\"spinner\"\n className={cn(spinner({ size }), className)}\n {...rest}\n />\n );\n}\n\nSpinner.displayName = 'Spinner';\n",".typography {\n margin: 0;\n font-family: var(--tgui--font-family);\n}\n\n.weight-1 {\n font-weight: var(--tgui--weight-bold);\n}\n\n.weight-2 {\n font-weight: var(--tgui--weight-semibold);\n}\n\n.weight-3 {\n font-weight: var(--tgui--weight-regular);\n}\n\n.caps {\n text-transform: uppercase;\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Typography.module.css';\n\nexport const typography = cva(styles.typography, {\n variants: {\n weight: {\n '1': styles['weight-1'],\n '2': styles['weight-2'],\n '3': styles['weight-3'],\n },\n caps: { true: styles.caps },\n },\n defaultVariants: { weight: '3' },\n});\n","import type { AllHTMLAttributes, ElementType, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { typography } from './Typography.variants';\n\nexport interface TypographyProps extends AllHTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n weight?: '1' | '2' | '3';\n caps?: boolean;\n Component?: ElementType;\n}\n\nexport function Typography({\n ref,\n weight,\n caps,\n Component = 'span',\n className,\n ...rest\n}: TypographyProps) {\n return (\n <Component\n ref={ref}\n data-slot=\"typography\"\n className={cn(typography({ weight, caps }), className)}\n {...rest}\n />\n );\n}\n\nTypography.displayName = 'Typography';\n",".level-1 {\n font-size: var(--tgui--font-subheadline-size);\n line-height: var(--tgui--font-subheadline-line);\n letter-spacing: var(--tgui--font-subheadline-tracking);\n}\n\n.level-2 {\n font-size: var(--tgui--font-footnote-size);\n line-height: var(--tgui--font-footnote-line);\n letter-spacing: var(--tgui--font-footnote-tracking);\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Subheadline.module.css';\n\nexport type SubheadlineLevel = '1' | '2';\n\nexport const subheadline = cva('', {\n variants: {\n level: {\n '1': styles['level-1'],\n '2': styles['level-2'],\n },\n },\n defaultVariants: { level: '1' },\n});\n","import type { Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Typography, type TypographyProps } from '../Typography';\nimport { type SubheadlineLevel, subheadline } from './Subheadline.variants';\n\nexport interface SubheadlineProps extends TypographyProps {\n ref?: Ref<HTMLElement>;\n level?: SubheadlineLevel;\n}\n\nexport function Subheadline({\n ref,\n level,\n Component = 'h6',\n className,\n ...rest\n}: SubheadlineProps) {\n return (\n <Typography\n data-slot=\"subheadline\"\n ref={ref}\n Component={Component}\n className={cn(subheadline({ level }), className)}\n {...rest}\n />\n );\n}\n\nSubheadline.displayName = 'Subheadline';\n",".ripple {\n position: absolute;\n inset: 0;\n overflow: hidden;\n border-radius: inherit;\n pointer-events: none;\n}\n\n.wave {\n position: absolute;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n transform: translate(-50%, -50%);\n background: var(--tgui--separator);\n opacity: 0;\n animation: wave-rise 0.35s cubic-bezier(0.3, 0.3, 0.5, 1);\n}\n\n@keyframes wave-rise {\n from {\n transform: translate(-50%, -50%) scale(1);\n opacity: 1;\n }\n 30% {\n opacity: 1;\n }\n to {\n transform: translate(-50%, -50%) scale(8);\n opacity: 0;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wave {\n animation: none;\n }\n}\n","import styles from './Ripple.module.css';\nimport type { Wave } from './useRipple';\n\ninterface RippleProps {\n waves: Wave[];\n onWaveEnd: (id: number) => void;\n}\n\nexport function Ripple({ waves, onWaveEnd }: RippleProps) {\n return (\n <span aria-hidden className={styles.ripple}>\n {waves.map((wave) => (\n <span\n key={wave.id}\n className={styles.wave}\n style={{ top: wave.y, left: wave.x }}\n onAnimationEnd={() => onWaveEnd(wave.id)}\n />\n ))}\n </span>\n );\n}\n",".tappable {\n position: relative;\n isolation: isolate;\n cursor: pointer;\n transition: opacity 0.15s ease-out;\n /* a tap target is a control surface, not a document – no text selection, like a native row/button */\n user-select: none;\n}\n\n.tappable[data-readonly] {\n cursor: default;\n}\n\n.tappable[data-disabled] {\n cursor: default;\n opacity: 0.35;\n}\n\n.tappable--ios:not([data-disabled]):not([data-readonly]):active,\n.tappable--opacity:not([data-disabled]):not([data-readonly]):active {\n opacity: 0.65;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .tappable--ios:not([data-disabled]):not([data-readonly]):hover,\n .tappable--opacity:not([data-disabled]):not([data-readonly]):hover {\n opacity: 0.85;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tappable {\n transition: none;\n }\n}\n","import { type PointerEvent, useCallback, useEffect, useRef, useState } from 'react';\n\nconst PRESS_DELAY = 70;\nconst WAVE_FALLBACK = 600;\n\nexport interface Wave {\n id: number;\n x: number;\n y: number;\n}\n\ntype Timer = ReturnType<typeof setTimeout>;\n\nexport function useRipple() {\n const [waves, setWaves] = useState<Wave[]>([]);\n const nextId = useRef(0);\n const pressTimers = useRef(new Map<number, Timer>());\n const waveTimers = useRef(new Set<Timer>());\n\n useEffect(() => {\n const press = pressTimers.current;\n const wave = waveTimers.current;\n return () => {\n for (const timer of press.values()) clearTimeout(timer);\n for (const timer of wave) clearTimeout(timer);\n };\n }, []);\n\n const removeWave = useCallback((id: number) => {\n setWaves((current) => current.filter((wave) => wave.id !== id));\n }, []);\n\n const onPointerDown = useCallback(\n (event: PointerEvent<HTMLElement>) => {\n const { top, left } = event.currentTarget.getBoundingClientRect();\n const x = event.clientX - left;\n const y = event.clientY - top;\n const { pointerId } = event;\n\n const press = setTimeout(() => {\n pressTimers.current.delete(pointerId);\n const id = nextId.current++;\n setWaves((current) => [...current, { id, x, y }]);\n\n const fallback = setTimeout(() => {\n waveTimers.current.delete(fallback);\n removeWave(id);\n }, WAVE_FALLBACK);\n waveTimers.current.add(fallback);\n }, PRESS_DELAY);\n\n pressTimers.current.set(pointerId, press);\n },\n [removeWave],\n );\n\n const onPointerCancel = useCallback((event: PointerEvent<HTMLElement>) => {\n const press = pressTimers.current.get(event.pointerId);\n if (press) {\n clearTimeout(press);\n pressTimers.current.delete(event.pointerId);\n }\n }, []);\n\n return { waves, onPointerDown, onPointerCancel, removeWave };\n}\n","'use client';\n\nimport type { AllHTMLAttributes, ElementType, PointerEvent, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic } from '../TguiProvider/useHaptic';\nimport { useTgui } from '../TguiProvider/useTgui';\nimport { Ripple } from './Ripple';\nimport styles from './Tappable.module.css';\nimport { useRipple } from './useRipple';\n\nexport interface TappableProps extends AllHTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n Component?: ElementType;\n // background = ripple on base · opacity = dim on both · none = component owns it\n interactiveAnimation?: 'background' | 'opacity' | 'none';\n}\n\nexport function Tappable({\n ref,\n Component = 'div',\n interactiveAnimation = 'background',\n className,\n children,\n onPointerDown,\n onPointerCancel,\n ...rest\n}: TappableProps) {\n const { platform } = useTgui();\n const haptic = useHaptic();\n const ripple = useRipple();\n const disabled = Boolean(rest.disabled);\n const readOnly = Boolean(rest.readOnly);\n\n const interactive = Component !== 'div' && Component !== 'span';\n const tappable = !readOnly && !disabled && (interactive || rest.onClick != null);\n const hasRipple = platform === 'base' && interactiveAnimation === 'background' && tappable;\n\n const handlePointerDown = (event: PointerEvent<HTMLElement>) => {\n // feedback lands on the press, iOS-style\n if (tappable && event.isPrimary) haptic('tap');\n if (hasRipple) ripple.onPointerDown(event);\n onPointerDown?.(event);\n };\n\n const handlePointerCancel = (event: PointerEvent<HTMLElement>) => {\n if (hasRipple) ripple.onPointerCancel(event);\n onPointerCancel?.(event);\n };\n\n return (\n <Component\n ref={ref}\n data-slot=\"tappable\"\n className={cn(\n styles.tappable,\n platform === 'ios' && interactiveAnimation !== 'none' && styles['tappable--ios'],\n interactiveAnimation === 'opacity' && styles['tappable--opacity'],\n className,\n )}\n data-readonly={readOnly || undefined}\n data-disabled={disabled || undefined}\n aria-disabled={disabled || undefined}\n onPointerDown={handlePointerDown}\n onPointerCancel={handlePointerCancel}\n {...rest}\n >\n {hasRipple && <Ripple waves={ripple.waves} onWaveEnd={ripple.removeWave} />}\n {children}\n </Component>\n );\n}\n\nTappable.displayName = 'Tappable';\n",".text {\n font-size: var(--tgui--font-body-size);\n line-height: var(--tgui--font-body-line);\n letter-spacing: var(--tgui--font-body-tracking);\n}\n","import type { Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Typography, type TypographyProps } from '../Typography';\nimport styles from './Text.module.css';\n\nexport interface TextProps extends TypographyProps {\n ref?: Ref<HTMLElement>;\n}\n\nexport function Text({ ref, className, Component = 'span', ...rest }: TextProps) {\n return (\n <Typography\n ref={ref}\n data-slot=\"text\"\n Component={Component}\n className={cn(styles.text, className)}\n {...rest}\n />\n );\n}\n\nText.displayName = 'Text';\n",".button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n max-inline-size: 100%;\n min-inline-size: 80px;\n border: none;\n /* one radius for every size and platform (override with --tgui--button-radius) */\n border-radius: var(--tgui--button-radius, var(--tgui--radius));\n text-decoration: none;\n}\n\n.stretched {\n inline-size: 100%;\n flex-grow: 1;\n}\n\n.button:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n.button::after {\n content: \"\";\n position: absolute;\n inset: 0;\n border-radius: inherit;\n opacity: 0;\n background: var(--tgui--bg);\n transition: opacity 0.15s ease-out;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .button:not([data-disabled]):hover::after {\n opacity: var(--tgui--button-wash-opacity);\n }\n}\n\n.before,\n.after {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.content {\n display: flex;\n flex: 0 1 auto;\n min-inline-size: 0;\n align-items: center;\n justify-content: center;\n z-index: var(--tgui--z-base);\n}\n\n.label {\n min-inline-size: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.content svg {\n display: block;\n}\n\n.button[data-loading] {\n pointer-events: none;\n}\n\n.button[data-loading] .before,\n.button[data-loading] .after,\n.button[data-loading] .content {\n opacity: 0;\n}\n\n.spinner {\n position: absolute;\n color: var(--tgui--button-spinner-color);\n}\n\n.size-s {\n height: 36px;\n min-width: 34px;\n gap: 6px;\n padding: 8px 12px;\n}\n\n.size-m {\n height: 42px;\n min-width: 42px;\n gap: 8px;\n padding: 8px 14px;\n}\n\n.size-l {\n height: 50px;\n gap: 10px;\n padding: 10px 20px;\n}\n\n.ios::after {\n content: none;\n}\n\n.mode-filled {\n --tgui--button-wash-opacity: 0.15;\n --tgui--button-spinner-color: var(--tgui--accent-label);\n color: var(--tgui--accent-label);\n background: var(--tgui--accent-strong);\n}\n\n.mode-bezeled {\n --tgui--button-wash-opacity: 0.07;\n --tgui--button-spinner-color: var(--tgui--link-strong);\n color: var(--tgui--link-strong);\n background: var(--tgui--accent-fill);\n}\n\n.mode-plain {\n --tgui--button-wash-opacity: 0.03;\n --tgui--button-spinner-color: var(--tgui--label);\n color: var(--tgui--link-strong);\n background: transparent;\n}\n\n.mode-gray {\n --tgui--button-wash-opacity: 0.5;\n --tgui--button-spinner-color: var(--tgui--label);\n color: var(--tgui--label);\n background: var(--tgui--fill-tertiary);\n}\n\n.mode-outline {\n --tgui--button-wash-opacity: 0.5;\n --tgui--button-spinner-color: var(--tgui--label);\n color: var(--tgui--label);\n background: transparent;\n box-shadow: 0 0 0 1px var(--tgui--separator);\n}\n\n.mode-white {\n --tgui--button-wash-opacity: 0.5;\n --tgui--button-spinner-color: var(--tgui--label);\n color: var(--tgui--black);\n background: var(--tgui--white);\n}\n","import { cva } from 'class-variance-authority';\nimport type { TguiPlatform } from '../../shared/types/tgui';\nimport styles from './Button.module.css';\n\nexport type ButtonMode = 'filled' | 'bezeled' | 'plain' | 'gray' | 'outline' | 'white';\nexport type ButtonSize = 's' | 'm' | 'l';\n\nexport const button = cva(styles.button, {\n variants: {\n mode: {\n filled: styles['mode-filled'],\n bezeled: styles['mode-bezeled'],\n plain: styles['mode-plain'],\n gray: styles['mode-gray'],\n outline: styles['mode-outline'],\n white: styles['mode-white'],\n },\n size: {\n s: styles['size-s'],\n m: styles['size-m'],\n l: styles['size-l'],\n },\n stretched: { true: styles.stretched },\n platform: { ios: styles.ios, base: null },\n },\n defaultVariants: { mode: 'filled', size: 'm' },\n});\n\nexport type ButtonVariantInput = {\n mode?: ButtonMode;\n size?: ButtonSize;\n stretched?: boolean;\n platform: TguiPlatform;\n};\n","'use client';\n\nimport type { AllHTMLAttributes, ElementType, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Spinner } from '../Spinner';\nimport { Subheadline } from '../Subheadline';\nimport { Tappable } from '../Tappable';\nimport { Text } from '../Text';\nimport { useTgui } from '../TguiProvider';\nimport styles from './Button.module.css';\nimport { type ButtonMode, type ButtonSize, button } from './Button.variants';\n\nexport interface ButtonProps extends Omit<AllHTMLAttributes<HTMLElement>, 'size'> {\n ref?: Ref<HTMLElement>;\n Component?: ElementType;\n mode?: ButtonMode;\n size?: ButtonSize;\n stretched?: boolean;\n loading?: boolean;\n before?: ReactNode;\n after?: ReactNode;\n}\n\nfunction Label({ size, children }: { size: ButtonSize; children: ReactNode }) {\n // Text / Subheadline are used for their type step only – the label is not a\n // heading, so force a span.\n const shared = { weight: '2', Component: 'span', className: styles.content } as const;\n const inner = (\n <span data-slot=\"button-label\" className={styles.label}>\n {children}\n </span>\n );\n return size === 'l' ? (\n <Text {...shared}>{inner}</Text>\n ) : (\n <Subheadline level=\"2\" {...shared}>\n {inner}\n </Subheadline>\n );\n}\n\nexport function Button({\n ref,\n Component = 'button',\n mode = 'filled',\n size = 'm',\n stretched = false,\n loading = false,\n type,\n before,\n after,\n children,\n className,\n ...rest\n}: ButtonProps) {\n const { platform } = useTgui();\n\n return (\n <Tappable\n ref={ref}\n Component={Component}\n type={Component === 'button' ? (type ?? 'button') : type}\n data-slot=\"button\"\n data-loading={loading || undefined}\n aria-busy={loading || undefined}\n className={cn(button({ mode, size, stretched, platform }), className)}\n {...rest}\n >\n {loading ? (\n <Spinner size=\"s\" data-slot=\"button-spinner\" className={styles.spinner} aria-hidden />\n ) : null}\n {before ? (\n <span data-slot=\"button-before\" className={styles.before}>\n {before}\n </span>\n ) : null}\n <Label size={size}>{children}</Label>\n {after ? (\n <span data-slot=\"button-after\" className={styles.after}>\n {after}\n </span>\n ) : null}\n </Tappable>\n );\n}\n\nButton.displayName = 'Button';\n",".callout {\n font-size: var(--tgui--font-callout-size);\n line-height: var(--tgui--font-callout-line);\n letter-spacing: var(--tgui--font-callout-tracking);\n}\n","import type { Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Typography, type TypographyProps } from '../Typography';\nimport styles from './Callout.module.css';\n\nexport interface CalloutProps extends TypographyProps {\n ref?: Ref<HTMLElement>;\n}\n\nexport function Callout({ ref, className, Component = 'span', ...rest }: CalloutProps) {\n return (\n <Typography\n data-slot=\"callout\"\n ref={ref}\n Component={Component}\n className={cn(styles.callout, className)}\n {...rest}\n />\n );\n}\n\nCallout.displayName = 'Callout';\n",".level-1 {\n font-size: var(--tgui--font-caption-1-size);\n line-height: var(--tgui--font-caption-1-line);\n letter-spacing: var(--tgui--font-caption-1-tracking);\n}\n\n.level-2 {\n font-size: var(--tgui--font-caption-2-size);\n line-height: var(--tgui--font-caption-2-line);\n letter-spacing: var(--tgui--font-caption-2-tracking);\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Caption.module.css';\n\nexport type CaptionLevel = '1' | '2';\n\nexport const caption = cva('', {\n variants: {\n level: {\n '1': styles['level-1'],\n '2': styles['level-2'],\n },\n },\n defaultVariants: { level: '1' },\n});\n","import type { Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Typography, type TypographyProps } from '../Typography';\nimport { type CaptionLevel, caption } from './Caption.variants';\n\nexport interface CaptionProps extends TypographyProps {\n ref?: Ref<HTMLElement>;\n level?: CaptionLevel;\n}\n\nexport function Caption({ ref, level, Component = 'span', className, ...rest }: CaptionProps) {\n return (\n <Typography\n data-slot=\"caption\"\n ref={ref}\n Component={Component}\n className={cn(caption({ level }), className)}\n {...rest}\n />\n );\n}\n\nCaption.displayName = 'Caption';\n","import { createContext } from 'react';\n\nexport type CardType = 'plain' | 'ambient';\n\nexport const CardContext = createContext<{ type: CardType }>({ type: 'plain' });\n",".card {\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n border-radius: 20px;\n background: var(--tgui--surface-bg);\n box-shadow:\n 0 32px 64px 0 rgba(0, 0, 0, 0.04),\n 0 0 2px 1px rgba(0, 0, 0, 0.02);\n}\n\n.card > * {\n flex-shrink: 0;\n}\n\n.cardAmbient {\n background: var(--tgui--black);\n}\n\n.cell {\n padding: 0 20px;\n background: var(--tgui--surface-bg);\n}\n\n.cellAmbient {\n --tgui--cell-middle-padding: 12px 0;\n\n position: absolute;\n inset: auto 0 0 0;\n padding-top: 64px;\n padding-bottom: 4px;\n background: linear-gradient(\n 180deg,\n rgba(0, 0, 0, 0) 0%,\n rgba(0, 0, 0, 0.12) 22%,\n rgba(0, 0, 0, 0.55) 62%,\n rgba(0, 0, 0, 0.85) 100%\n );\n color: var(--tgui--white);\n}\n\n.cellHeader {\n font-weight: var(--tgui--weight-semibold);\n}\n\n.cellSubtitle {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n\n.cellAmbient .cellHeader {\n color: var(--tgui--white);\n}\n\n.cellAmbient .cellSubtitle {\n color: rgba(255, 255, 255, 0.8);\n}\n",".cell {\n --tgui--cell-middle-padding: 16px 0;\n\n display: flex;\n align-items: center;\n gap: 24px;\n padding: 0 24px;\n}\n\n.before,\n.after {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.middle {\n flex-grow: 1;\n min-inline-size: 0;\n max-inline-size: 100%;\n padding: var(--tgui--cell-middle-padding);\n\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.middle > *,\n.title {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.multiline .middle > *,\n.multiline .title {\n white-space: normal;\n}\n\n.head {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n\n.subhead {\n color: var(--tgui--label-secondary);\n}\n\n.hint,\n.subtitle,\n.description {\n color: var(--tgui--label-secondary);\n}\n\n/* row press / hover highlight – a clear tint, distinct from the grouped canvas */\n.cell {\n --tgui--cell-highlight: var(--tgui--fill);\n}\n\n@supports (color: color-mix(in srgb, red 10%, transparent)) {\n .cell {\n --tgui--cell-highlight: color-mix(in srgb, var(--tgui--label) 9%, transparent);\n }\n}\n\n.hovered,\n.interactive:not([data-disabled]):active {\n background: var(--tgui--cell-highlight);\n}\n\n/* inset – a row is flush to the card edge, an outset ring would be clipped */\n.interactive:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: calc(-1 * var(--tgui--focus-ring-offset));\n}\n\n.ios {\n --tgui--cell-middle-padding: 12px 0;\n gap: 16px;\n padding: 0 16px;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .interactive:not([data-disabled]):hover {\n background: var(--tgui--cell-highlight);\n }\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Cell.module.css';\n\nexport const cell = cva(styles.cell, {\n variants: {\n platform: { ios: styles.ios, base: null },\n hovered: { true: styles.hovered },\n interactive: { true: styles.interactive },\n multiline: { true: styles.multiline },\n },\n});\n","'use client';\n\nimport type { ElementType, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Caption } from '../Caption';\nimport { Subheadline } from '../Subheadline';\nimport { Tappable, type TappableProps } from '../Tappable';\nimport { Text } from '../Text';\nimport { useTgui } from '../TguiProvider';\nimport styles from './Cell.module.css';\nimport { cell } from './Cell.variants';\n\nexport interface CellProps extends Omit<TappableProps, 'Component'> {\n ref?: Ref<HTMLElement>;\n Component?: ElementType;\n subhead?: ReactNode;\n hint?: ReactNode;\n titleBadge?: ReactNode;\n subtitle?: ReactNode;\n description?: ReactNode;\n before?: ReactNode;\n after?: ReactNode;\n hovered?: boolean;\n multiline?: boolean;\n}\n\n// a row is not a document section: text slots render as spans\nfunction CellTitle({ ios, children }: { ios: boolean; children: ReactNode }) {\n return ios ? (\n <Text Component=\"span\" className={styles.head}>\n {children}\n </Text>\n ) : (\n <Subheadline Component=\"span\" level=\"1\" className={styles.head}>\n {children}\n </Subheadline>\n );\n}\n\nfunction CellDescription({ ios, children }: { ios: boolean; children: ReactNode }) {\n return ios ? (\n <Caption Component=\"span\" className={styles.description}>\n {children}\n </Caption>\n ) : (\n <Subheadline Component=\"span\" level=\"2\" className={styles.description}>\n {children}\n </Subheadline>\n );\n}\n\nexport function Cell({\n ref,\n Component = 'div',\n subhead,\n children,\n hint,\n titleBadge,\n subtitle,\n description,\n before,\n after,\n hovered,\n multiline,\n className,\n ...rest\n}: CellProps) {\n const { platform } = useTgui();\n const ios = platform === 'ios';\n const hasTitle = children != null || hint != null || titleBadge != null;\n const interactive =\n rest.onClick != null ||\n rest.href != null ||\n Component === 'a' ||\n Component === 'button' ||\n Component === 'label';\n\n return (\n <Tappable\n ref={ref}\n Component={Component}\n // a list row highlights its background – it never dims like a button\n interactiveAnimation={ios ? 'none' : 'background'}\n data-slot=\"cell\"\n className={cn(cell({ platform, hovered, multiline, interactive }), className)}\n {...rest}\n >\n {before != null ? (\n <div data-slot=\"cell-before\" className={styles.before}>\n {before}\n </div>\n ) : null}\n\n <div data-slot=\"cell-content\" className={styles.middle}>\n {subhead != null ? (\n <Subheadline Component=\"span\" level=\"2\" className={styles.subhead}>\n {subhead}\n </Subheadline>\n ) : null}\n\n {hasTitle ? (\n <CellTitle ios={ios}>\n {children != null ? <span className={styles.title}>{children}</span> : null}\n {hint != null ? <span className={styles.hint}>{hint}</span> : null}\n {titleBadge}\n </CellTitle>\n ) : null}\n\n {subtitle != null ? (\n <Subheadline Component=\"span\" level=\"2\" className={styles.subtitle}>\n {subtitle}\n </Subheadline>\n ) : null}\n\n {description != null ? <CellDescription ios={ios}>{description}</CellDescription> : null}\n </div>\n\n {after != null ? (\n <div data-slot=\"cell-after\" className={styles.after}>\n {after}\n </div>\n ) : null}\n </Tappable>\n );\n}\n\nCell.displayName = 'Cell';\n","'use client';\n\nimport { type Ref, useContext } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Cell, type CellProps } from '../Cell';\nimport { CardContext } from './Card.context';\nimport styles from './Card.module.css';\n\nexport interface CardCellProps extends CellProps {\n ref?: Ref<HTMLElement>;\n}\n\nexport function CardCell({ ref, children, subtitle, className, ...rest }: CardCellProps) {\n const { type } = useContext(CardContext);\n const ambient = type === 'ambient';\n\n return (\n <Cell\n ref={ref}\n data-slot=\"card-cell\"\n className={cn(styles.cell, ambient && styles.cellAmbient, className)}\n subtitle={\n subtitle != null ? (\n <span data-slot=\"card-cell-subtitle\" className={styles.cellSubtitle}>\n {subtitle}\n </span>\n ) : undefined\n }\n {...rest}\n >\n {children != null ? (\n <span data-slot=\"card-cell-title\" className={styles.cellHeader}>\n {children}\n </span>\n ) : null}\n </Cell>\n );\n}\n\nCardCell.displayName = 'CardCell';\n","'use client';\n\nimport { type HTMLAttributes, type Ref, useMemo } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { CardContext, type CardType } from './Card.context';\nimport styles from './Card.module.css';\nimport { CardCell } from './CardCell';\n\nexport interface CardProps extends HTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n type?: CardType;\n}\n\nexport function Card({ ref, type = 'plain', className, children, ...rest }: CardProps) {\n const context = useMemo(() => ({ type }), [type]);\n\n return (\n <CardContext.Provider value={context}>\n <article\n ref={ref}\n data-slot=\"card\"\n data-type={type}\n className={cn(styles.card, type === 'ambient' && styles.cardAmbient, className)}\n {...rest}\n >\n {children}\n </article>\n </CardContext.Provider>\n );\n}\n\nCard.displayName = 'Card';\nCard.Cell = CardCell;\n",".checkbox {\n position: relative;\n display: inline-flex;\n cursor: pointer;\n}\n\n.checkbox[data-disabled] {\n cursor: default;\n opacity: 0.3;\n}\n\n.input {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n opacity: 0;\n cursor: inherit;\n}\n\n.box {\n position: relative;\n width: 20px;\n height: 20px;\n border-radius: 6px;\n box-shadow: inset 0 0 0 2px var(--tgui--separator);\n pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .box {\n transition:\n box-shadow 0.15s ease-out,\n background 0.15s ease-out;\n }\n}\n\n.input:checked + .box,\n.input:indeterminate + .box {\n background: var(--tgui--link);\n box-shadow: none;\n}\n\n.input:focus-visible + .box {\n box-shadow: var(--tgui--focus-ring-shadow);\n}\n\n.input:checked + .box::after {\n content: \"\";\n position: absolute;\n left: 7px;\n top: 3px;\n width: 5px;\n height: 9px;\n border: solid var(--tgui--accent-label);\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n}\n\n.input:indeterminate + .box::after {\n content: \"\";\n position: absolute;\n left: 4px;\n top: 9px;\n width: 12px;\n height: 2px;\n background: var(--tgui--accent-label);\n}\n","import { type ChangeEvent, type InputHTMLAttributes, type Ref, useEffect, useRef } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic } from '../TguiProvider';\nimport styles from './Checkbox.module.css';\n\nexport interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement> {\n ref?: Ref<HTMLInputElement>;\n indeterminate?: boolean;\n}\n\nexport function Checkbox({\n ref,\n indeterminate = false,\n disabled,\n className,\n style,\n onChange,\n ...rest\n}: CheckboxProps) {\n const inner = useRef<HTMLInputElement>(null);\n const haptic = useHaptic();\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n haptic('select');\n onChange?.(event);\n };\n\n useEffect(() => {\n if (inner.current) inner.current.indeterminate = indeterminate;\n }, [indeterminate]);\n\n const mergeRef = (node: HTMLInputElement | null) => {\n inner.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n };\n\n return (\n <span\n data-slot=\"checkbox\"\n className={cn(styles.checkbox, className)}\n style={style}\n data-disabled={disabled || undefined}\n >\n <input\n ref={mergeRef}\n type=\"checkbox\"\n data-slot=\"checkbox-input\"\n className={styles.input}\n disabled={disabled}\n onChange={handleChange}\n {...rest}\n />\n <span className={styles.box} data-slot=\"checkbox-indicator\" aria-hidden />\n </span>\n );\n}\n\nCheckbox.displayName = 'Checkbox';\n",".chip {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n box-sizing: border-box;\n min-height: 32px;\n padding: 4px 12px;\n border: 0;\n border-radius: 16px;\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 14px;\n line-height: 18px;\n}\n\n.mode-elevated {\n background: var(--tgui--fill);\n box-shadow: 0 1px 4px rgb(0 0 0 / 0.1);\n}\n\n.mode-outline {\n background: transparent;\n box-shadow: inset 0 0 0 1px var(--tgui--separator);\n}\n\n.clickable {\n cursor: pointer;\n user-select: none;\n}\n\n.clickable:focus-visible,\n.remove:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .clickable:not([data-disabled]):hover {\n opacity: 0.85;\n }\n}\n\n.before,\n.after {\n display: inline-flex;\n align-items: center;\n margin-inline-start: -2px;\n}\n\n.after {\n margin-inline-start: 0;\n margin-inline-end: -4px;\n}\n\n.label {\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.remove {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 18px;\n height: 18px;\n margin-inline-end: -4px;\n padding: 0;\n border: 0;\n border-radius: 50%;\n color: var(--tgui--label-tertiary);\n background: transparent;\n cursor: pointer;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .remove:hover {\n opacity: 0.6;\n }\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './Chip.module.css';\n\nexport type ChipMode = 'elevated' | 'outline';\n\nexport const chip = cva(styles.chip, {\n variants: {\n mode: {\n elevated: styles['mode-elevated'],\n outline: styles['mode-outline'],\n },\n clickable: { true: styles.clickable },\n },\n defaultVariants: { mode: 'elevated' },\n});\n","import type { AllHTMLAttributes, ElementType, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic } from '../TguiProvider';\nimport styles from './Chip.module.css';\nimport { type ChipMode, chip } from './Chip.variants';\n\nexport type { ChipMode };\n\nexport interface ChipProps extends Omit<AllHTMLAttributes<HTMLElement>, 'onClick'> {\n ref?: Ref<HTMLElement>;\n Component?: ElementType;\n mode?: ChipMode;\n before?: ReactNode;\n after?: ReactNode;\n onClick?: () => void;\n onRemove?: () => void;\n removeLabel?: string;\n}\n\nexport function Chip({\n ref,\n Component = 'div',\n mode = 'elevated',\n before,\n after,\n onClick,\n onRemove,\n removeLabel = 'Remove',\n className,\n children,\n ...rest\n}: ChipProps) {\n const clickable = onClick != null;\n const haptic = useHaptic();\n\n return (\n <Component\n ref={ref}\n data-slot=\"chip\"\n className={cn(chip({ mode, clickable }), className)}\n onClick={\n onClick == null\n ? undefined\n : () => {\n haptic('tap');\n onClick();\n }\n }\n {...rest}\n >\n {before != null ? (\n <span data-slot=\"chip-before\" className={styles.before}>\n {before}\n </span>\n ) : null}\n <span data-slot=\"chip-label\" className={styles.label}>\n {children}\n </span>\n {onRemove != null ? (\n <button\n type=\"button\"\n data-slot=\"chip-remove\"\n className={styles.remove}\n aria-label={removeLabel}\n onClick={(event) => {\n event.stopPropagation();\n haptic('tap');\n onRemove();\n }}\n >\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" aria-hidden>\n <path\n d=\"M3 3l6 6M9 3l-6 6\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n </button>\n ) : after != null ? (\n <span data-slot=\"chip-after\" className={styles.after}>\n {after}\n </span>\n ) : null}\n </Component>\n );\n}\n\nChip.displayName = 'Chip';\n",".root {\n display: inline-flex;\n color: var(--tgui--link);\n}\n\n.svg {\n display: block;\n}\n\n.track {\n stroke: var(--tgui--fill);\n}\n\n.indicator {\n stroke: currentColor;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .indicator {\n transition: stroke-dashoffset 0.25s ease;\n }\n}\n","export type CircularProgressSize = 's' | 'm' | 'l';\n\nexport const DIMENSION: Record<CircularProgressSize, number> = { s: 20, m: 28, l: 36 };\nexport const STROKE: Record<CircularProgressSize, number> = { s: 2, m: 2.5, l: 3 };\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './CircularProgress.module.css';\nimport { type CircularProgressSize, DIMENSION, STROKE } from './CircularProgress.variants';\n\nexport type { CircularProgressSize };\n\nexport interface CircularProgressProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'size'> {\n ref?: Ref<HTMLSpanElement>;\n value?: number;\n size?: CircularProgressSize;\n}\n\nexport function CircularProgress({\n ref,\n value = 0,\n size = 'm',\n className,\n 'aria-label': ariaLabel,\n ...rest\n}: CircularProgressProps) {\n const clamped = Math.max(0, Math.min(100, value));\n const dimension = DIMENSION[size];\n const stroke = STROKE[size];\n const radius = (dimension - stroke) / 2;\n const circumference = 2 * Math.PI * radius;\n const center = dimension / 2;\n\n return (\n <span\n ref={ref}\n role=\"progressbar\"\n aria-label={ariaLabel ?? 'Progress'}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={Math.round(clamped)}\n data-slot=\"circular-progress\"\n className={cn(styles.root, className)}\n {...rest}\n >\n <svg\n className={styles.svg}\n width={dimension}\n height={dimension}\n viewBox={`0 0 ${dimension} ${dimension}`}\n aria-hidden\n >\n <circle\n className={styles.track}\n cx={center}\n cy={center}\n r={radius}\n strokeWidth={stroke}\n fill=\"none\"\n />\n <circle\n className={styles.indicator}\n cx={center}\n cy={center}\n r={radius}\n strokeWidth={stroke}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={circumference * (1 - clamped / 100)}\n fill=\"none\"\n />\n </svg>\n </span>\n );\n}\n\nCircularProgress.displayName = 'CircularProgress';\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/primitive.tsx\nvar canUseDOM = !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return /* @__PURE__ */ __name(function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n }, \"handleEvent\");\n}\n__name(composeEventHandlers, \"composeEventHandlers\");\nfunction getOwnerWindow(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access window outside of the DOM\");\n }\n return element?.ownerDocument?.defaultView ?? window;\n}\n__name(getOwnerWindow, \"getOwnerWindow\");\nfunction getOwnerDocument(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access document outside of the DOM\");\n }\n return element?.ownerDocument ?? document;\n}\n__name(getOwnerDocument, \"getOwnerDocument\");\nfunction getActiveElement(node, activeDescendant = false) {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n return null;\n }\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\n if (activeDescendant) {\n const id = activeElement.getAttribute(\"aria-activedescendant\");\n if (id) {\n const element = getOwnerDocument(activeElement).getElementById(id);\n if (element) {\n return element;\n }\n }\n }\n return activeElement;\n}\n__name(getActiveElement, \"getActiveElement\");\nfunction isFrame(element) {\n return element.tagName === \"IFRAME\";\n}\n__name(isFrame, \"isFrame\");\nexport {\n canUseDOM,\n composeEventHandlers,\n getActiveElement,\n getOwnerDocument,\n getOwnerWindow,\n isFrame\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\n__name(setRef, \"setRef\");\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n__name(composeRefs, \"composeRefs\");\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\n__name(useComposedRefs, \"useComposedRefs\");\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/slot.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n let slottableElement = null;\n let hasSlottable = false;\n const newChildren = [];\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n React.Children.forEach(children, (maybeSlottable) => {\n if (isSlottable(maybeSlottable)) {\n hasSlottable = true;\n const slottable = maybeSlottable;\n let child = \"child\" in slottable.props ? slottable.props.child : slottable.props.children;\n if (isLazyComponent(child) && typeof use === \"function\") {\n child = use(child._payload);\n }\n slottableElement = getSlottableElementFromSlottable(slottable, child);\n newChildren.push(slottableElement?.props?.children);\n } else {\n newChildren.push(maybeSlottable);\n }\n });\n if (slottableElement) {\n slottableElement = React.cloneElement(slottableElement, void 0, newChildren);\n } else if (\n // A `Slottable` was found but it didn't resolve to a single element (e.g.\n // it wrapped multiple elements, text, or a render-prop `child` that\n // wasn't an element). Don't fall back to treating the `Slottable` wrapper\n // itself as the slot target — throw a descriptive error below instead.\n !hasSlottable && React.Children.count(children) === 1 && React.isValidElement(children)\n ) {\n slottableElement = children;\n }\n const slottableElementRef = slottableElement ? getElementRef(slottableElement) : void 0;\n const composedRef = useComposedRefs(forwardedRef, slottableElementRef);\n if (!slottableElement) {\n if (children || children === 0) {\n throw new Error(\n hasSlottable ? createSlottableError(ownerName) : createSlotError(ownerName)\n );\n }\n return children;\n }\n const mergedProps = mergeProps(slotProps, slottableElement.props ?? {});\n if (slottableElement.type !== React.Fragment) {\n mergedProps.ref = forwardedRef ? composedRef : slottableElementRef;\n }\n return React.cloneElement(slottableElement, mergedProps);\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\n__name(createSlot, \"createSlot\");\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\nvar SLOTTABLE_IDENTIFIER = Symbol.for(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = /* @__PURE__ */ __name((props) => \"child\" in props ? props.children(props.child) : props.children, \"Slottable\");\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\n__name(createSlottable, \"createSlottable\");\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nvar getSlottableElementFromSlottable = /* @__PURE__ */ __name((slottable, child) => {\n if (\"child\" in slottable.props) {\n const child2 = slottable.props.child;\n if (!React.isValidElement(child2)) return null;\n return React.cloneElement(child2, void 0, slottable.props.children(child2.props.children));\n }\n return React.isValidElement(child) ? child : null;\n}, \"getSlottableElementFromSlottable\");\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\n__name(mergeProps, \"mergeProps\");\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\n__name(getElementRef, \"getElementRef\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\n__name(isSlottable, \"isSlottable\");\nvar REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nfunction isLazyComponent(element) {\n return element != null && typeof element === \"object\" && \"$$typeof\" in element && element.$$typeof === REACT_LAZY_TYPE && \"_payload\" in element && isPromiseLike(element._payload);\n}\n__name(isLazyComponent, \"isLazyComponent\");\nfunction isPromiseLike(value) {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\n__name(isPromiseLike, \"isPromiseLike\");\nvar createSlotError = /* @__PURE__ */ __name((ownerName) => {\n return `${ownerName} failed to slot onto its children. Expected a single React element child or \\`Slottable\\`.`;\n}, \"createSlotError\");\nvar createSlottableError = /* @__PURE__ */ __name((ownerName) => {\n return `${ownerName} failed to slot onto its \\`Slottable\\`. Expected \\`Slottable\\` to receive a single React element child.`;\n}, \"createSlottableError\");\nvar use = React[\" use \".trim().toString()];\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n__name(dispatchDiscreteCustomEvent, \"dispatchDiscreteCustomEvent\");\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/use-callback-ref.tsx\nimport * as React from \"react\";\nfunction useCallbackRef(callback) {\n const callbackRef = React.useRef(callback);\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n return React.useMemo(() => ((...args) => callbackRef.current?.(...args)), []);\n}\n__name(useCallbackRef, \"useCallbackRef\");\nexport {\n useCallbackRef\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/dismissable-layer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { jsx } from \"react/jsx-runtime\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set(),\n // Outside elements that belong to a layer's own dismiss affordance (eg, a\n // dialog overlay). Pressing them should dismiss the layer regardless of\n // whether or not they stop propagation.\n //\n // See https://github.com/radix-ui/primitives/issues/3346\n dismissableSurfaces: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = /* @__PURE__ */ React.forwardRef(\n // blank line to reduce diff noise\n /* @__PURE__ */ __name(function DismissableLayer2(props, forwardedRef) {\n const {\n disableOutsidePointerEvents = false,\n deferPointerDownOutside = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, setNode);\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [\n ...context.layersWithOutsidePointerEventsDisabled\n ].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = highestLayerWithOutsidePointerEventsDisabled ? layers.indexOf(highestLayerWithOutsidePointerEventsDisabled) : -1;\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const isDeferredPointerDownOutsideRef = React.useRef(false);\n const pointerDownOutside = usePointerDownOutside(\n (event) => {\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n },\n {\n ownerDocument,\n deferPointerDownOutside,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces: context.dismissableSurfaces,\n shouldHandlePointerDownOutside: React.useCallback(\n (target) => {\n if (!(target instanceof Node)) {\n return false;\n }\n const isPointerDownOnBranch = [...context.branches].some(\n (branch) => branch.contains(target)\n );\n return isPointerEventsEnabled && !isPointerDownOnBranch;\n },\n [context.branches, isPointerEventsEnabled]\n )\n }\n );\n const focusOutside = useFocusOutside((event) => {\n if (deferPointerDownOutside && isDeferredPointerDownOutsideRef.current) {\n return;\n }\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const isHighestLayer = node ? index === layers.length - 1 : false;\n const handleKeyDown = useCallbackRef((event) => {\n if (event.key !== \"Escape\") {\n return;\n }\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n });\n React.useEffect(() => {\n if (!isHighestLayer) {\n return;\n }\n ownerDocument.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => ownerDocument.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n }, [ownerDocument, isHighestLayer, handleKeyDown]);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents) {\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = /* @__PURE__ */ __name(() => force({}), \"handleUpdate\");\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }, \"DismissableLayer\")\n);\nvar DismissableLayerBranch = /* @__PURE__ */ React.forwardRef(/* @__PURE__ */ __name(function DismissableLayerBranch2(props, forwardedRef) {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n}, \"DismissableLayerBranch\"));\nfunction useDismissableLayerSurface() {\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n React.useEffect(() => {\n if (!node) {\n return;\n }\n context.dismissableSurfaces.add(node);\n return () => {\n context.dismissableSurfaces.delete(node);\n };\n }, [node, context.dismissableSurfaces]);\n return setNode;\n}\n__name(useDismissableLayerSurface, \"useDismissableLayerSurface\");\nvar IS_TRUE = /* @__PURE__ */ __name(() => true, \"IS_TRUE\");\nfunction usePointerDownOutside(onPointerDownOutside, args) {\n const {\n ownerDocument = globalThis?.document,\n deferPointerDownOutside = false,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces,\n shouldHandlePointerDownOutside = IS_TRUE\n } = args;\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const isPointerDownOutsideRef = React.useRef(false);\n const interceptedOutsideInteractionEventsRef = React.useRef(/* @__PURE__ */ new Map());\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n function resetOutsideInteraction() {\n isPointerDownOutsideRef.current = false;\n isDeferredPointerDownOutsideRef.current = false;\n interceptedOutsideInteractionEventsRef.current.clear();\n }\n __name(resetOutsideInteraction, \"resetOutsideInteraction\");\n function isOutsideInteractionIntercepted() {\n return Array.from(interceptedOutsideInteractionEventsRef.current.values()).some(Boolean);\n }\n __name(isOutsideInteractionIntercepted, \"isOutsideInteractionIntercepted\");\n function handleInteractionCapture(event) {\n if (!isPointerDownOutsideRef.current) {\n return;\n }\n const target = event.target;\n const isDismissableSurface = target instanceof Node && [...dismissableSurfaces].some((surface) => surface.contains(target));\n if (!isDismissableSurface) {\n interceptedOutsideInteractionEventsRef.current.set(event.type, true);\n }\n if (event.type === \"click\") {\n window.setTimeout(() => {\n if (isPointerDownOutsideRef.current) {\n handleClickRef.current();\n }\n }, 0);\n }\n }\n __name(handleInteractionCapture, \"handleInteractionCapture\");\n function handleInteractionBubble(event) {\n if (isPointerDownOutsideRef.current) {\n interceptedOutsideInteractionEventsRef.current.set(event.type, false);\n }\n }\n __name(handleInteractionBubble, \"handleInteractionBubble\");\n const handlePointerDown = /* @__PURE__ */ __name((event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n const wasOutsideInteractionIntercepted = isOutsideInteractionIntercepted();\n resetOutsideInteraction();\n if (!wasOutsideInteractionIntercepted) {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n }\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n __name(handleAndDispatchPointerDownOutsideEvent2, \"handleAndDispatchPointerDownOutsideEvent\");\n if (!shouldHandlePointerDownOutside(event.target)) {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n resetOutsideInteraction();\n isPointerInsideReactTreeRef.current = false;\n return;\n }\n const eventDetail = { originalEvent: event };\n isPointerDownOutsideRef.current = true;\n isDeferredPointerDownOutsideRef.current = deferPointerDownOutside && event.button === 0;\n interceptedOutsideInteractionEventsRef.current.clear();\n if (!deferPointerDownOutside || event.button !== 0) {\n handleAndDispatchPointerDownOutsideEvent2();\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n resetOutsideInteraction();\n }\n isPointerInsideReactTreeRef.current = false;\n }, \"handlePointerDown\");\n const outsideInteractionEvents = [\n \"pointerup\",\n \"mousedown\",\n \"mouseup\",\n \"touchstart\",\n \"touchend\",\n \"click\"\n ];\n for (const eventName of outsideInteractionEvents) {\n ownerDocument.addEventListener(eventName, handleInteractionCapture, true);\n ownerDocument.addEventListener(eventName, handleInteractionBubble);\n }\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n for (const eventName of outsideInteractionEvents) {\n ownerDocument.removeEventListener(eventName, handleInteractionCapture, true);\n ownerDocument.removeEventListener(eventName, handleInteractionBubble);\n }\n };\n }, [\n ownerDocument,\n handlePointerDownOutside,\n deferPointerDownOutside,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces,\n shouldHandlePointerDownOutside\n ]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: /* @__PURE__ */ __name(() => isPointerInsideReactTreeRef.current = true, \"onPointerDownCapture\")\n };\n}\n__name(usePointerDownOutside, \"usePointerDownOutside\");\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = /* @__PURE__ */ __name((event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n }, \"handleFocus\");\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: /* @__PURE__ */ __name(() => isFocusInsideReactTreeRef.current = true, \"onFocusCapture\"),\n onBlurCapture: /* @__PURE__ */ __name(() => isFocusInsideReactTreeRef.current = false, \"onBlurCapture\")\n };\n}\n__name(useFocusOutside, \"useFocusOutside\");\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\n__name(dispatchUpdate, \"dispatchUpdate\");\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\n__name(handleAndDispatchCustomEvent, \"handleAndDispatchCustomEvent\");\nvar Root = DismissableLayer;\nvar Branch = DismissableLayerBranch;\nexport {\n Branch,\n DismissableLayer,\n DismissableLayerBranch,\n Root,\n useDismissableLayerSurface\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/focus-scope.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { jsx } from \"react/jsx-runtime\";\nvar AUTOFOCUS_ON_MOUNT = \"focusScope.autoFocusOnMount\";\nvar AUTOFOCUS_ON_UNMOUNT = \"focusScope.autoFocusOnUnmount\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar FocusScope = /* @__PURE__ */ React.forwardRef(\n /* @__PURE__ */ __name(function FocusScope2(props, forwardedRef) {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, setContainer);\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n }\n }).current;\n React.useEffect(() => {\n if (trapped) {\n let handleFocusIn2 = function(event) {\n if (focusScope.paused || !container) return;\n const target = event.target;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleFocusOut2 = function(event) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget;\n if (relatedTarget === null) return;\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleMutations2 = function(mutations) {\n const focusedElement = document.activeElement;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n };\n var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;\n __name(handleFocusIn2, \"handleFocusIn\");\n __name(handleFocusOut2, \"handleFocusOut\");\n __name(handleMutations2, \"handleMutations\");\n document.addEventListener(\"focusin\", handleFocusIn2);\n document.addEventListener(\"focusout\", handleFocusOut2);\n const mutationObserver = new MutationObserver(handleMutations2);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n return () => {\n document.removeEventListener(\"focusin\", handleFocusIn2);\n document.removeEventListener(\"focusout\", handleFocusOut2);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused]);\n React.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n setTimeout(() => {\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? document.body, { select: true });\n }\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n const handleKeyDown = React.useCallback(\n (event) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n const isTabKey = event.key === \"Tab\" && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement;\n if (isTabKey && focusedElement) {\n const container2 = event.currentTarget;\n const [first, last] = getTabbableEdges(container2);\n const hasTabbableElementsInside = first && last;\n if (!hasTabbableElementsInside) {\n if (focusedElement === container2) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused]\n );\n return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });\n }, \"FocusScope\")\n);\nfunction focusFirst(candidates, { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\n__name(focusFirst, \"focusFirst\");\nfunction getTabbableEdges(container) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last];\n}\n__name(getTabbableEdges, \"getTabbableEdges\");\nfunction getTabbableCandidates(container) {\n const nodes = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: /* @__PURE__ */ __name((node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }, \"acceptNode\")\n });\n while (walker.nextNode()) nodes.push(walker.currentNode);\n return nodes;\n}\n__name(getTabbableCandidates, \"getTabbableCandidates\");\nfunction findVisible(elements, container) {\n const canUseCheckVisibility = typeof container.checkVisibility === \"function\" && container.checkVisibility({ checkVisibilityCSS: true });\n for (const element of elements) {\n const hidden = canUseCheckVisibility ? !element.checkVisibility({ checkVisibilityCSS: true }) : isHidden(element, { upTo: container });\n if (!hidden) {\n return element;\n }\n }\n}\n__name(findVisible, \"findVisible\");\nfunction isHidden(node, { upTo }) {\n if (getComputedStyle(node).visibility === \"hidden\") return true;\n while (node) {\n if (upTo !== void 0 && node === upTo) return false;\n if (getComputedStyle(node).display === \"none\") return true;\n node = node.parentElement;\n }\n return false;\n}\n__name(isHidden, \"isHidden\");\nfunction isSelectableInput(element) {\n return element instanceof HTMLInputElement && \"select\" in element;\n}\n__name(isSelectableInput, \"isSelectableInput\");\nfunction focus(element, { select = false } = {}) {\n if (element && element.focus) {\n const previouslyFocusedElement = document.activeElement;\n element.focus({ preventScroll: true });\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\n__name(focus, \"focus\");\nvar focusScopesStack = createFocusScopesStack();\nfunction createFocusScopesStack() {\n let stack = [];\n return {\n add(focusScope) {\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n remove(focusScope) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n }\n };\n}\n__name(createFocusScopesStack, \"createFocusScopesStack\");\nfunction arrayRemove(array, item) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\n__name(arrayRemove, \"arrayRemove\");\nfunction removeLinks(items) {\n return items.filter((item) => item.tagName !== \"A\");\n}\n__name(removeLinks, \"removeLinks\");\nvar Root = FocusScope;\nexport {\n FocusScope,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","// src/use-layout-effect.tsx\nimport * as React from \"react\";\nvar useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {\n};\nexport {\n useLayoutEffect2 as useLayoutEffect\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/presence.tsx\nimport * as React2 from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\n\n// src/use-state-machine.tsx\nimport * as React from \"react\";\nfunction useStateMachine(initialState, machine) {\n return React.useReducer((state, event) => {\n const nextState = machine[state][event];\n return nextState ?? state;\n }, initialState);\n}\n__name(useStateMachine, \"useStateMachine\");\n\n// src/presence.tsx\nvar Presence = /* @__PURE__ */ __name((props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n const child = typeof children === \"function\" ? children({ present: presence.isPresent }) : React2.Children.only(children);\n const ref = useStableComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === \"function\";\n return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;\n}, \"Presence\");\nfunction usePresence(present) {\n const [node, setNode] = React2.useState();\n const stylesRef = React2.useRef(null);\n const prevPresentRef = React2.useRef(present);\n const prevAnimationNameRef = React2.useRef(\"none\");\n const mountAnimationNameRef = React2.useRef(void 0);\n const initialState = present ? \"mounted\" : \"unmounted\";\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: \"unmounted\",\n ANIMATION_OUT: \"unmountSuspended\"\n },\n unmountSuspended: {\n MOUNT: \"mounted\",\n ANIMATION_END: \"unmounted\"\n },\n unmounted: {\n MOUNT: \"mounted\"\n }\n });\n React2.useEffect(() => {\n if (state === \"mounted\") {\n prevAnimationNameRef.current = mountAnimationNameRef.current ?? getAnimationName(stylesRef.current);\n mountAnimationNameRef.current = void 0;\n } else {\n prevAnimationNameRef.current = \"none\";\n }\n }, [state]);\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n if (present) {\n mountAnimationNameRef.current = currentAnimationName;\n send(\"MOUNT\");\n } else if (currentAnimationName === \"none\" || styles?.display === \"none\") {\n send(\"UNMOUNT\");\n } else {\n const isAnimating = prevAnimationName !== currentAnimationName;\n if (wasPresent && isAnimating) {\n send(\"ANIMATION_OUT\");\n } else {\n send(\"UNMOUNT\");\n }\n }\n prevPresentRef.current = present;\n }\n }, [present, send]);\n useLayoutEffect(() => {\n if (node) {\n let timeoutId;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n const handleAnimationEnd = /* @__PURE__ */ __name((event) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));\n if (event.target === node && isCurrentAnimation) {\n send(\"ANIMATION_END\");\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = \"forwards\";\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === \"forwards\") {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n }, \"handleAnimationEnd\");\n const handleAnimationStart = /* @__PURE__ */ __name((event) => {\n if (event.target === node) {\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n }, \"handleAnimationStart\");\n node.addEventListener(\"animationstart\", handleAnimationStart);\n node.addEventListener(\"animationcancel\", handleAnimationEnd);\n node.addEventListener(\"animationend\", handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener(\"animationstart\", handleAnimationStart);\n node.removeEventListener(\"animationcancel\", handleAnimationEnd);\n node.removeEventListener(\"animationend\", handleAnimationEnd);\n };\n } else {\n send(\"ANIMATION_END\");\n }\n }, [node, send]);\n return {\n isPresent: [\"mounted\", \"unmountSuspended\"].includes(state),\n ref: React2.useCallback((node2) => {\n if (node2) {\n const styles = getComputedStyle(node2);\n stylesRef.current = styles;\n mountAnimationNameRef.current = getAnimationName(styles);\n } else {\n stylesRef.current = null;\n }\n setNode(node2);\n }, [])\n };\n}\n__name(usePresence, \"usePresence\");\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\n__name(setRef, \"setRef\");\nfunction useStableComposedRefs(...refs) {\n const refsRef = React2.useRef(refs);\n refsRef.current = refs;\n return React2.useCallback((node) => {\n const currentRefs = refsRef.current;\n let hasCleanup = false;\n const cleanups = currentRefs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup === \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup === \"function\") {\n cleanup();\n } else {\n setRef(currentRefs[i], null);\n }\n }\n };\n }\n }, []);\n}\n__name(useStableComposedRefs, \"useStableComposedRefs\");\nfunction getAnimationName(styles) {\n return styles?.animationName || \"none\";\n}\n__name(getAnimationName, \"getAnimationName\");\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\n__name(getElementRef, \"getElementRef\");\nvar Root = Presence;\nexport {\n Presence,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { createPortal } from 'react-dom';\nimport { useTgui } from '../TguiProvider';\n\nexport interface PortalProps {\n children?: ReactNode;\n container?: Element | DocumentFragment | null;\n}\n\nexport function Portal({ children, container }: PortalProps) {\n const { portalContainer } = useTgui();\n const target = container ?? portalContainer;\n if (!target) return null;\n return createPortal(children, target);\n}\n\nPortal.displayName = 'Portal';\n",".overlay {\n position: fixed;\n inset: 0;\n z-index: var(--tgui--z-overlay);\n display: grid;\n place-items: center;\n padding: 24px;\n background: rgb(0 0 0 / 0.4);\n}\n\n.content {\n width: 100%;\n max-width: 270px;\n overflow: hidden;\n border-radius: var(--tgui--radius-lg);\n background: var(--tgui--surface-bg);\n color: var(--tgui--label);\n box-shadow: var(--tgui--overlay-shadow);\n transform-origin: center;\n}\n\n/* the element is visible at rest; the animations only ferry it in and out,\n so a paused/skipped animation can never leave the dialog invisible */\n@media (prefers-reduced-motion: no-preference) {\n .overlay[data-state=\"open\"] {\n animation: dialog-overlay-in var(--tgui--duration-overlay) ease;\n }\n\n .overlay[data-state=\"closed\"] {\n animation: dialog-overlay-out var(--tgui--duration-overlay) ease forwards;\n }\n\n .content[data-state=\"open\"] {\n animation: dialog-in var(--tgui--duration-overlay) var(--tgui--ease-spring);\n }\n\n .content[data-state=\"closed\"] {\n animation: dialog-out var(--tgui--duration-overlay) var(--tgui--ease-in) forwards;\n }\n}\n\n@keyframes dialog-overlay-in {\n from {\n opacity: 0;\n }\n}\n\n@keyframes dialog-overlay-out {\n to {\n opacity: 0;\n }\n}\n\n@keyframes dialog-in {\n from {\n opacity: 0;\n transform: scale(0.96);\n }\n}\n\n@keyframes dialog-out {\n to {\n opacity: 0;\n transform: scale(0.96);\n }\n}\n\n.body {\n padding: 20px 16px 16px;\n text-align: center;\n}\n\n.title {\n margin: 0;\n font-family: var(--tgui--font-family);\n font-size: 17px;\n font-weight: var(--tgui--weight-semibold);\n line-height: 22px;\n}\n\n.description {\n margin: 4px 0 0;\n font-family: var(--tgui--font-family);\n font-size: 13px;\n line-height: 18px;\n color: var(--tgui--label-secondary);\n}\n\n.actions {\n display: flex;\n border-top: var(--tgui--hairline) solid var(--tgui--separator);\n}\n\n.actions[data-layout=\"stacked\"] {\n flex-direction: column;\n}\n\n.action {\n flex: 1 1 0;\n min-width: 0;\n padding: 11px 12px;\n border: 0;\n background: transparent;\n color: var(--tgui--link-strong);\n font-family: var(--tgui--font-family);\n font-size: 17px;\n font-weight: var(--tgui--weight-regular);\n line-height: 22px;\n cursor: pointer;\n}\n\n.action[data-default=\"true\"] {\n font-weight: var(--tgui--weight-semibold);\n}\n\n.action[data-role=\"destructive\"] {\n color: var(--tgui--destructive-strong);\n}\n\n.actions:not([data-layout=\"stacked\"]) .action + .action {\n border-inline-start: var(--tgui--hairline) solid var(--tgui--separator);\n}\n\n.actions[data-layout=\"stacked\"] .action + .action {\n border-top: var(--tgui--hairline) solid var(--tgui--separator);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .action:hover {\n background: var(--tgui--fill);\n }\n}\n\n.action:active {\n background: var(--tgui--fill);\n}\n\n.action:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: calc(-1 * var(--tgui--focus-ring-offset));\n}\n","'use client';\n\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { Presence } from '@radix-ui/react-presence';\nimport { type KeyboardEvent as ReactKeyboardEvent, type ReactNode, useEffect, useId } from 'react';\nimport { getTelegramWebApp, isTelegramVersionAtLeast } from '../../shared/lib/telegram';\nimport type { PopupButton } from '../../shared/types/telegram';\nimport { Portal } from '../Portal';\nimport styles from './Dialog.module.css';\n\nexport type DialogActionRole = 'default' | 'cancel' | 'destructive';\n\nexport interface DialogAction {\n label: ReactNode;\n onClick?: () => void;\n role?: DialogActionRole;\n}\n\nexport interface DialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: ReactNode;\n description?: ReactNode;\n actions: DialogAction[];\n cancelLabel?: string;\n container?: Element | DocumentFragment | null;\n}\n\n// a destructive alert always offers a way out; add one if the caller didn't\nfunction withCancel(actions: DialogAction[], cancelLabel: string): DialogAction[] {\n const hasCancel = actions.some((a) => a.role === 'cancel');\n const hasDestructive = actions.some((a) => a.role === 'destructive');\n if (hasCancel || !hasDestructive) return actions.slice(0, 3);\n return [...actions.slice(0, 2), { label: cancelLabel, role: 'cancel' }];\n}\n\n// the Telegram native popup fits only plain-string, length-bounded content\nfunction toNativePopup(\n title: ReactNode,\n description: ReactNode,\n actions: DialogAction[],\n): { title?: string; message: string; buttons: PopupButton[] } | null {\n if (!isTelegramVersionAtLeast('6.2')) return null;\n const heading = typeof title === 'string' ? title : null;\n const body = typeof description === 'string' ? description : null;\n const message = body ?? heading;\n if (message == null || message.length < 1 || message.length > 256) return null;\n if (heading != null && (body == null || heading.length > 64)) {\n // no room for both, or title too long → render ours\n if (body == null && heading.length <= 256) {\n // title-only: send it as the message\n } else {\n return null;\n }\n }\n const buttons: PopupButton[] = [];\n for (const [index, action] of actions.entries()) {\n if (action.role === 'cancel') {\n buttons.push({ id: String(index), type: 'cancel' });\n continue;\n }\n if (typeof action.label !== 'string' || action.label.length < 1 || action.label.length > 64) {\n return null;\n }\n buttons.push({\n id: String(index),\n type: action.role === 'destructive' ? 'destructive' : 'default',\n text: action.label,\n });\n }\n return {\n title: body != null ? (heading ?? undefined) : undefined,\n message: body ?? (heading as string),\n buttons: buttons.slice(0, 3),\n };\n}\n\nexport function Dialog({\n open,\n onOpenChange,\n title,\n description,\n actions,\n cancelLabel = 'Cancel',\n container,\n}: DialogProps) {\n const titleId = useId();\n const descId = useId();\n const resolved = withCancel(actions, cancelLabel);\n const defaultIndex = resolved.findIndex((a) => a.role === 'default' || a.role == null);\n const cancelIndex = resolved.findIndex((a) => a.role === 'cancel');\n const stacked = resolved.length > 2;\n const native = toNativePopup(title, description, resolved);\n\n const run = (action: DialogAction) => {\n action.onClick?.();\n onOpenChange(false);\n };\n\n // inside a recent Telegram client this is a real UIAlertController / native dialog\n // biome-ignore lint/correctness/useExhaustiveDependencies: fire once per open transition\n useEffect(() => {\n if (!open || native == null) return;\n const webApp = getTelegramWebApp();\n if (webApp == null) return;\n webApp.showPopup(native, (buttonId) => {\n const index = Number(buttonId);\n if (Number.isInteger(index)) resolved[index]?.onClick?.();\n onOpenChange(false);\n });\n }, [open, native != null]);\n\n useEffect(() => {\n if (!open || native != null) return;\n const { body } = document;\n const previousOverflow = body.style.overflow;\n body.style.overflow = 'hidden';\n return () => {\n body.style.overflow = previousOverflow;\n };\n }, [open, native]);\n\n const state = open ? 'open' : 'closed';\n\n const onKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' && defaultIndex >= 0) {\n event.preventDefault();\n run(resolved[defaultIndex]);\n }\n };\n\n // native popup renders no DOM of its own\n if (native != null) return null;\n\n return (\n <Portal container={container}>\n <Presence present={open}>\n <div data-slot=\"dialog-overlay\" data-state={state} className={styles.overlay}>\n <FocusScope asChild trapped loop>\n <DismissableLayer\n asChild\n onEscapeKeyDown={() => {\n if (cancelIndex >= 0) run(resolved[cancelIndex]);\n else onOpenChange(false);\n }}\n >\n <div\n role=\"alertdialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n aria-describedby={description != null ? descId : undefined}\n data-slot=\"dialog-content\"\n data-state={state}\n className={styles.content}\n onKeyDown={onKeyDown}\n >\n <div className={styles.body}>\n <h2 id={titleId} data-slot=\"dialog-title\" className={styles.title}>\n {title}\n </h2>\n {description != null ? (\n <p id={descId} data-slot=\"dialog-description\" className={styles.description}>\n {description}\n </p>\n ) : null}\n </div>\n <div\n data-slot=\"dialog-actions\"\n data-layout={stacked ? 'stacked' : 'row'}\n className={styles.actions}\n >\n {resolved.map((action, index) => (\n <button\n // biome-ignore lint/suspicious/noArrayIndexKey: actions are a fixed positional list\n key={index}\n type=\"button\"\n data-slot=\"dialog-action\"\n data-role={action.role ?? 'default'}\n data-default={index === defaultIndex || undefined}\n className={styles.action}\n onClick={() => run(action)}\n >\n {action.label}\n </button>\n ))}\n </div>\n </div>\n </DismissableLayer>\n </FocusScope>\n </div>\n </Presence>\n </Portal>\n );\n}\n\nDialog.displayName = 'Dialog';\n",".divider {\n margin: 0;\n border: none;\n border-block-start: var(--tgui--hairline) solid var(--tgui--separator);\n}\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Divider.module.css';\n\nexport interface DividerProps extends HTMLAttributes<HTMLHRElement> {\n ref?: Ref<HTMLHRElement>;\n}\n\nexport function Divider({ ref, className, ...rest }: DividerProps) {\n return <hr ref={ref} data-slot=\"divider\" className={cn(styles.divider, className)} {...rest} />;\n}\n\nDivider.displayName = 'Divider';\n","import { createContext, type RefObject } from 'react';\n\nexport interface DropdownMenuContextValue {\n open: boolean;\n setOpen: (open: boolean) => void;\n triggerRef: RefObject<HTMLElement | null>;\n contentId: string;\n}\n\nexport const DropdownMenuContext = createContext<DropdownMenuContextValue | null>(null);\nDropdownMenuContext.displayName = 'DropdownMenuContext';\n\nexport interface DropdownMenuRadioContextValue {\n value: string | undefined;\n select: (value: string) => void;\n}\n\nexport const DropdownMenuRadioContext = createContext<DropdownMenuRadioContextValue | null>(null);\nDropdownMenuRadioContext.displayName = 'DropdownMenuRadioContext';\n","export function CheckIcon() {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden>\n <path\n d=\"M3.5 8.5l3 3 6-7\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n",".content {\n position: fixed;\n top: 0;\n inset-inline-start: 0;\n z-index: var(--tgui--z-overlay);\n min-width: 200px;\n max-width: 280px;\n padding: 5px;\n overflow: hidden auto;\n max-height: calc(100vh - 32px);\n border-radius: var(--tgui--radius);\n background: var(--tgui--surface-bg);\n color: var(--tgui--label);\n box-shadow: var(--tgui--overlay-shadow);\n}\n\n.content[data-side=\"bottom\"] {\n transform-origin: top center;\n}\n\n.content[data-side=\"top\"] {\n transform-origin: bottom center;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .content[data-state=\"open\"] {\n animation: dropdown-menu-in var(--tgui--duration-overlay) var(--tgui--ease-spring);\n }\n\n .content[data-state=\"closed\"] {\n animation: dropdown-menu-out var(--tgui--duration-overlay) var(--tgui--ease-in) forwards;\n }\n}\n\n@keyframes dropdown-menu-in {\n from {\n opacity: 0;\n transform: scale(0.96);\n }\n}\n\n@keyframes dropdown-menu-out {\n to {\n opacity: 0;\n transform: scale(0.96);\n }\n}\n\n.item {\n display: flex;\n align-items: center;\n gap: 10px;\n width: 100%;\n box-sizing: border-box;\n padding: 9px 10px;\n border: 0;\n border-radius: var(--tgui--radius-sm);\n background: transparent;\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 16px;\n line-height: 21px;\n text-align: start;\n cursor: pointer;\n}\n\n.item:disabled {\n opacity: 0.35;\n cursor: default;\n}\n\n.item[data-destructive] {\n color: var(--tgui--destructive-strong);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .item:not(:disabled):hover {\n background: var(--tgui--fill);\n }\n}\n\n.item:not(:disabled):active,\n.item:focus-visible {\n background: var(--tgui--fill);\n}\n\n.item:focus-visible {\n outline: none;\n}\n\n.itemIcon,\n.itemIndicator {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n color: var(--tgui--label-secondary);\n}\n\n.itemIndicator {\n color: var(--tgui--link-strong);\n}\n\n.itemLabel {\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.itemSelectable .itemLabel {\n flex: 1;\n}\n\n.separator {\n height: var(--tgui--hairline);\n margin: 5px 0;\n border: 0;\n background: var(--tgui--separator);\n}\n\n.label {\n padding: 8px 10px 4px;\n color: var(--tgui--label-secondary);\n font-family: var(--tgui--font-family);\n font-size: 12px;\n font-weight: var(--tgui--weight-semibold);\n letter-spacing: 0.04em;\n text-transform: uppercase;\n}\n","'use client';\n\nimport type { ButtonHTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { CheckIcon } from './CheckIcon';\nimport styles from './DropdownMenu.module.css';\n\nexport interface DropdownMenuCheckboxItemProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {\n ref?: Ref<HTMLButtonElement>;\n checked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n}\n\nexport function DropdownMenuCheckboxItem({\n ref,\n checked = false,\n onCheckedChange,\n disabled,\n className,\n children,\n onClick,\n ...rest\n}: DropdownMenuCheckboxItemProps) {\n return (\n <button\n ref={ref}\n type=\"button\"\n role=\"menuitemcheckbox\"\n aria-checked={checked}\n tabIndex={-1}\n disabled={disabled}\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(styles.item, styles.itemSelectable, className)}\n onClick={(event) => {\n onClick?.(event);\n onCheckedChange?.(!checked);\n }}\n {...rest}\n >\n <span data-slot=\"dropdown-menu-item-indicator\" className={styles.itemIndicator} aria-hidden>\n {checked ? <CheckIcon /> : null}\n </span>\n <span className={styles.itemLabel}>{children as ReactNode}</span>\n </button>\n );\n}\n\nDropdownMenuCheckboxItem.displayName = 'DropdownMenuCheckboxItem';\n","export type FloatingSide = 'top' | 'bottom' | 'left' | 'right';\nexport type FloatingAlign = 'start' | 'center' | 'end';\nexport type FloatingPlacement = FloatingSide | `${FloatingSide}-start` | `${FloatingSide}-end`;\n\nexport interface FloatingPosition {\n top: number;\n left: number;\n side: FloatingSide;\n}\n\nconst MARGIN = 8;\nconst clamp = (value: number, min: number, max: number) => Math.max(min, Math.min(max, value));\n\nfunction parsePlacement(placement: FloatingPlacement): {\n side: FloatingSide;\n align: FloatingAlign;\n} {\n const [side, align] = placement.split('-') as [FloatingSide, FloatingAlign | undefined];\n return { side, align: align ?? 'center' };\n}\n\n// a `position: fixed` element is offset by any ancestor that establishes a\n// containing block (transform / filter / perspective / will-change / contain).\n// returns the offset + scale to convert viewport coords into that block's space.\nexport function getFixedOffset(floatingEl: Element | null): {\n x: number;\n y: number;\n scale: number;\n} {\n let node = floatingEl?.parentElement ?? null;\n while (node != null && node !== document.documentElement) {\n const cs = getComputedStyle(node);\n if (\n cs.transform !== 'none' ||\n cs.perspective !== 'none' ||\n (cs.filter != null && cs.filter !== 'none') ||\n cs.willChange === 'transform' ||\n cs.willChange === 'perspective' ||\n cs.willChange === 'filter' ||\n cs.contain === 'layout' ||\n cs.contain === 'paint' ||\n cs.contain === 'strict' ||\n cs.contain === 'content'\n ) {\n const rect = node.getBoundingClientRect();\n const scale = rect.width > 0 ? rect.width / node.offsetWidth : 1;\n return { x: rect.left, y: rect.top, scale: scale || 1 };\n }\n node = node.parentElement;\n }\n return { x: 0, y: 0, scale: 1 };\n}\n\nexport function computeFloatingPosition(\n anchor: DOMRect,\n floating: DOMRect,\n placement: FloatingPlacement,\n gap: number,\n floatingEl?: Element | null,\n): FloatingPosition {\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n const { side: wantSide, align } = parsePlacement(placement);\n let side = wantSide;\n\n if (side === 'top' && anchor.top - floating.height - gap < MARGIN) side = 'bottom';\n else if (side === 'bottom' && anchor.bottom + floating.height + gap > vh - MARGIN) side = 'top';\n else if (side === 'left' && anchor.left - floating.width - gap < MARGIN) side = 'right';\n else if (side === 'right' && anchor.right + floating.width + gap > vw - MARGIN) side = 'left';\n\n let top = 0;\n let left = 0;\n\n if (side === 'top' || side === 'bottom') {\n if (align === 'start') left = anchor.left;\n else if (align === 'end') left = anchor.right - floating.width;\n else left = anchor.left + anchor.width / 2 - floating.width / 2;\n top = side === 'top' ? anchor.top - floating.height - gap : anchor.bottom + gap;\n } else {\n if (align === 'start') top = anchor.top;\n else if (align === 'end') top = anchor.bottom - floating.height;\n else top = anchor.top + anchor.height / 2 - floating.height / 2;\n left = side === 'left' ? anchor.left - floating.width - gap : anchor.right + gap;\n }\n\n left = clamp(left, MARGIN, vw - floating.width - MARGIN);\n top = clamp(top, MARGIN, vh - floating.height - MARGIN);\n\n // translate viewport coords into the containing block's space\n if (floatingEl != null) {\n const offset = getFixedOffset(floatingEl);\n left = (left - offset.x) / offset.scale;\n top = (top - offset.y) / offset.scale;\n }\n\n return { top, left, side };\n}\n","'use client';\n\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { Presence } from '@radix-ui/react-presence';\nimport {\n type HTMLAttributes,\n type KeyboardEvent as ReactKeyboardEvent,\n type Ref,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport {\n computeFloatingPosition,\n type FloatingPlacement,\n type FloatingPosition,\n} from '../../shared/lib/floatingPosition';\nimport { Portal } from '../Portal';\nimport { DropdownMenuContext } from './context';\nimport styles from './DropdownMenu.module.css';\n\nexport interface DropdownMenuContentProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> {\n ref?: Ref<HTMLDivElement>;\n placement?: FloatingPlacement;\n gap?: number;\n container?: Element | DocumentFragment | null;\n className?: string;\n}\n\nconst ITEM_SELECTOR = '[role=\"menuitem\"],[role=\"menuitemcheckbox\"],[role=\"menuitemradio\"]';\n\nexport function DropdownMenuContent({\n ref,\n placement = 'bottom-start',\n gap = 6,\n container,\n className,\n children,\n onKeyDown,\n ...rest\n}: DropdownMenuContentProps) {\n const ctx = useContext(DropdownMenuContext);\n const nodeRef = useRef<HTMLDivElement | null>(null);\n const [contentNode, setContentNode] = useState<HTMLDivElement | null>(null);\n const [position, setPosition] = useState<FloatingPosition | null>(null);\n\n const open = ctx?.open ?? false;\n const setOpen = ctx?.setOpen;\n const triggerRef = ctx?.triggerRef;\n\n const reposition = useCallback(() => {\n const trigger = triggerRef?.current;\n const node = nodeRef.current;\n if (!trigger || !node) return;\n setPosition(\n computeFloatingPosition(\n trigger.getBoundingClientRect(),\n node.getBoundingClientRect(),\n placement,\n gap,\n node,\n ),\n );\n }, [placement, gap, triggerRef]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: contentNode re-runs this once Presence mounts the div\n useLayoutEffect(() => {\n if (open) reposition();\n }, [open, reposition, contentNode]);\n\n useEffect(() => {\n if (!open) return;\n const onScrollOrResize = () => reposition();\n window.addEventListener('resize', onScrollOrResize);\n window.addEventListener('scroll', onScrollOrResize, true);\n return () => {\n window.removeEventListener('resize', onScrollOrResize);\n window.removeEventListener('scroll', onScrollOrResize, true);\n };\n }, [open, reposition]);\n\n const handleKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (!nodeRef.current) return;\n const items = [...nodeRef.current.querySelectorAll<HTMLElement>(ITEM_SELECTOR)].filter(\n (el) => !el.hasAttribute('disabled') && el.getAttribute('aria-disabled') !== 'true',\n );\n if (items.length === 0) return;\n const current = items.indexOf(document.activeElement as HTMLElement);\n const move = (next: number) => {\n event.preventDefault();\n items[(next + items.length) % items.length]?.focus();\n };\n if (event.key === 'ArrowDown') move(current + 1);\n else if (event.key === 'ArrowUp') move(current - 1);\n else if (event.key === 'Home') move(0);\n else if (event.key === 'End') move(items.length - 1);\n };\n\n if (ctx == null) return null;\n\n return (\n <Portal container={container}>\n <Presence present={open}>\n <FocusScope\n asChild\n trapped\n loop\n onUnmountAutoFocus={(event) => {\n event.preventDefault();\n triggerRef?.current?.focus();\n }}\n >\n <DismissableLayer\n asChild\n deferPointerDownOutside\n onEscapeKeyDown={() => setOpen?.(false)}\n onPointerDownOutside={() => setOpen?.(false)}\n onFocusOutside={() => setOpen?.(false)}\n >\n <div\n ref={(node) => {\n nodeRef.current = node;\n setContentNode(node);\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as { current: HTMLDivElement | null }).current = node;\n }}\n id={ctx.contentId}\n role=\"menu\"\n data-slot=\"dropdown-menu-content\"\n data-side={position?.side}\n data-state={position ? (open ? 'open' : 'closed') : undefined}\n className={cn(styles.content, className)}\n style={\n position\n ? { top: position.top, left: position.left }\n : { top: 0, left: 0, opacity: 0, pointerEvents: 'none' }\n }\n onKeyDown={handleKeyDown}\n {...rest}\n >\n {children}\n </div>\n </DismissableLayer>\n </FocusScope>\n </Presence>\n </Portal>\n );\n}\n\nDropdownMenuContent.displayName = 'DropdownMenuContent';\n","'use client';\n\nimport { type ButtonHTMLAttributes, type ReactNode, type Ref, useContext } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { DropdownMenuContext } from './context';\nimport styles from './DropdownMenu.module.css';\n\nexport interface DropdownMenuItemProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onSelect'> {\n ref?: Ref<HTMLButtonElement>;\n icon?: ReactNode;\n destructive?: boolean;\n // fired on activation; the menu closes afterwards unless you call preventDefault\n onSelect?: (event: { preventDefault: () => void }) => void;\n}\n\nexport function DropdownMenuItem({\n ref,\n icon,\n destructive = false,\n disabled,\n className,\n children,\n onSelect,\n onClick,\n ...rest\n}: DropdownMenuItemProps) {\n const ctx = useContext(DropdownMenuContext);\n\n return (\n <button\n ref={ref}\n type=\"button\"\n role=\"menuitem\"\n tabIndex={-1}\n disabled={disabled}\n data-slot=\"dropdown-menu-item\"\n data-destructive={destructive || undefined}\n className={cn(styles.item, className)}\n onClick={(event) => {\n onClick?.(event);\n let prevented = false;\n onSelect?.({ preventDefault: () => (prevented = true) });\n if (!prevented) ctx?.setOpen(false);\n }}\n {...rest}\n >\n {icon != null ? (\n <span data-slot=\"dropdown-menu-item-icon\" className={styles.itemIcon}>\n {icon}\n </span>\n ) : null}\n <span className={styles.itemLabel}>{children}</span>\n </button>\n );\n}\n\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './DropdownMenu.module.css';\n\nexport interface DropdownMenuLabelProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n}\n\nexport function DropdownMenuLabel({ ref, className, ...rest }: DropdownMenuLabelProps) {\n return (\n <div\n ref={ref}\n data-slot=\"dropdown-menu-label\"\n className={cn(styles.label, className)}\n {...rest}\n />\n );\n}\n\nDropdownMenuLabel.displayName = 'DropdownMenuLabel';\n","'use client';\n\nimport { type ReactNode, useCallback, useMemo, useState } from 'react';\nimport { DropdownMenuRadioContext } from './context';\n\nexport interface DropdownMenuRadioGroupProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n children: ReactNode;\n}\n\nexport function DropdownMenuRadioGroup({\n value: valueProp,\n defaultValue,\n onValueChange,\n children,\n}: DropdownMenuRadioGroupProps) {\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n const value = valueProp ?? uncontrolled;\n\n const select = useCallback(\n (next: string) => {\n if (valueProp == null) setUncontrolled(next);\n onValueChange?.(next);\n },\n [valueProp, onValueChange],\n );\n\n const context = useMemo(() => ({ value, select }), [value, select]);\n\n return (\n <DropdownMenuRadioContext.Provider value={context}>\n {children}\n </DropdownMenuRadioContext.Provider>\n );\n}\n\nDropdownMenuRadioGroup.displayName = 'DropdownMenuRadioGroup';\n","'use client';\n\nimport { type ButtonHTMLAttributes, type ReactNode, type Ref, useContext } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { CheckIcon } from './CheckIcon';\nimport { DropdownMenuContext, DropdownMenuRadioContext } from './context';\nimport styles from './DropdownMenu.module.css';\n\nexport interface DropdownMenuRadioItemProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {\n ref?: Ref<HTMLButtonElement>;\n value: string;\n}\n\nexport function DropdownMenuRadioItem({\n ref,\n value,\n disabled,\n className,\n children,\n onClick,\n ...rest\n}: DropdownMenuRadioItemProps) {\n const menu = useContext(DropdownMenuContext);\n const group = useContext(DropdownMenuRadioContext);\n const checked = group?.value === value;\n\n return (\n <button\n ref={ref}\n type=\"button\"\n role=\"menuitemradio\"\n aria-checked={checked}\n tabIndex={-1}\n disabled={disabled}\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(styles.item, styles.itemSelectable, className)}\n onClick={(event) => {\n onClick?.(event);\n group?.select(value);\n menu?.setOpen(false);\n }}\n {...rest}\n >\n <span data-slot=\"dropdown-menu-item-indicator\" className={styles.itemIndicator} aria-hidden>\n {checked ? <CheckIcon /> : null}\n </span>\n <span className={styles.itemLabel}>{children as ReactNode}</span>\n </button>\n );\n}\n\nDropdownMenuRadioItem.displayName = 'DropdownMenuRadioItem';\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './DropdownMenu.module.css';\n\nexport interface DropdownMenuSeparatorProps extends HTMLAttributes<HTMLHRElement> {\n ref?: Ref<HTMLHRElement>;\n}\n\nexport function DropdownMenuSeparator({ ref, className, ...rest }: DropdownMenuSeparatorProps) {\n return (\n <hr\n ref={ref}\n data-slot=\"dropdown-menu-separator\"\n className={cn(styles.separator, className)}\n {...rest}\n />\n );\n}\n\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n","'use client';\n\nimport { cloneElement, isValidElement, type ReactElement, useContext } from 'react';\nimport { DropdownMenuContext } from './context';\n\nexport interface DropdownMenuTriggerProps {\n children: ReactElement;\n}\n\nexport function DropdownMenuTrigger({ children }: DropdownMenuTriggerProps) {\n const ctx = useContext(DropdownMenuContext);\n if (ctx == null || !isValidElement(children)) return children;\n const { open, setOpen, triggerRef, contentId } = ctx;\n\n const child = children as ReactElement<Record<string, unknown>>;\n const childRef = (child.props as { ref?: unknown }).ref;\n const childOnClick = child.props.onClick as ((event: unknown) => void) | undefined;\n\n return cloneElement(child, {\n ref: (node: HTMLElement | null) => {\n triggerRef.current = node;\n if (typeof childRef === 'function') childRef(node);\n else if (childRef && typeof childRef === 'object')\n (childRef as { current: HTMLElement | null }).current = node;\n },\n onClick: (event: unknown) => {\n childOnClick?.(event);\n setOpen(!open);\n },\n 'aria-haspopup': 'menu',\n 'aria-expanded': open,\n 'aria-controls': open ? contentId : undefined,\n 'data-slot': 'dropdown-menu-trigger',\n 'data-state': open ? 'open' : 'closed',\n });\n}\n\nDropdownMenuTrigger.displayName = 'DropdownMenuTrigger';\n","'use client';\n\nimport { type ReactNode, useCallback, useId, useMemo, useRef, useState } from 'react';\nimport { DropdownMenuContext } from './context';\nimport { DropdownMenuCheckboxItem } from './DropdownMenuCheckboxItem';\nimport { DropdownMenuContent } from './DropdownMenuContent';\nimport { DropdownMenuItem } from './DropdownMenuItem';\nimport { DropdownMenuLabel } from './DropdownMenuLabel';\nimport { DropdownMenuRadioGroup } from './DropdownMenuRadioGroup';\nimport { DropdownMenuRadioItem } from './DropdownMenuRadioItem';\nimport { DropdownMenuSeparator } from './DropdownMenuSeparator';\nimport { DropdownMenuTrigger } from './DropdownMenuTrigger';\n\nexport interface DropdownMenuProps {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children: ReactNode;\n}\n\nexport function DropdownMenu({\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n children,\n}: DropdownMenuProps) {\n const [uncontrolled, setUncontrolled] = useState(defaultOpen);\n const open = openProp ?? uncontrolled;\n const triggerRef = useRef<HTMLElement | null>(null);\n const contentId = useId();\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (openProp == null) setUncontrolled(next);\n onOpenChange?.(next);\n },\n [openProp, onOpenChange],\n );\n\n const context = useMemo(\n () => ({ open, setOpen, triggerRef, contentId }),\n [open, setOpen, contentId],\n );\n\n return <DropdownMenuContext.Provider value={context}>{children}</DropdownMenuContext.Provider>;\n}\n\nDropdownMenu.displayName = 'DropdownMenu';\nDropdownMenu.Trigger = DropdownMenuTrigger;\nDropdownMenu.Content = DropdownMenuContent;\nDropdownMenu.Item = DropdownMenuItem;\nDropdownMenu.CheckboxItem = DropdownMenuCheckboxItem;\nDropdownMenu.RadioGroup = DropdownMenuRadioGroup;\nDropdownMenu.RadioItem = DropdownMenuRadioItem;\nDropdownMenu.Separator = DropdownMenuSeparator;\nDropdownMenu.Label = DropdownMenuLabel;\n",".fixedLayout {\n position: fixed;\n left: 0;\n right: 0;\n z-index: var(--tgui--z-sticky, 100);\n box-sizing: border-box;\n}\n\n.top {\n top: 0;\n padding-top: var(--tgui--safe-area-top);\n}\n\n.bottom {\n bottom: 0;\n padding-bottom: calc(var(--tgui--safe-area-bottom) + var(--tgui--content-safe-area-bottom));\n}\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './FixedLayout.module.css';\n\nexport interface FixedLayoutProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n vertical?: 'top' | 'bottom';\n}\n\nexport function FixedLayout({ ref, vertical = 'bottom', className, ...rest }: FixedLayoutProps) {\n return (\n <div\n ref={ref}\n data-slot=\"fixed-layout\"\n className={cn(styles.fixedLayout, styles[vertical], className)}\n {...rest}\n />\n );\n}\n\nFixedLayout.displayName = 'FixedLayout';\n",".footnote {\n font-size: var(--tgui--font-footnote-size);\n line-height: var(--tgui--font-footnote-line);\n letter-spacing: var(--tgui--font-footnote-tracking);\n}\n","import type { Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Typography, type TypographyProps } from '../Typography';\nimport styles from './Footnote.module.css';\n\nexport interface FootnoteProps extends TypographyProps {\n ref?: Ref<HTMLElement>;\n}\n\nexport function Footnote({ ref, className, Component = 'span', ...rest }: FootnoteProps) {\n return (\n <Typography\n data-slot=\"footnote\"\n ref={ref}\n Component={Component}\n className={cn(styles.footnote, className)}\n {...rest}\n />\n );\n}\n\nFootnote.displayName = 'Footnote';\n",".headline {\n font-size: var(--tgui--font-headline-size);\n line-height: var(--tgui--font-headline-line);\n letter-spacing: var(--tgui--font-headline-tracking);\n}\n","import type { Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Typography, type TypographyProps } from '../Typography';\nimport styles from './Headline.module.css';\n\nexport interface HeadlineProps extends TypographyProps {\n ref?: Ref<HTMLElement>;\n}\n\nexport function Headline({\n ref,\n weight = '2',\n className,\n Component = 'h5',\n ...rest\n}: HeadlineProps) {\n return (\n <Typography\n data-slot=\"headline\"\n ref={ref}\n weight={weight}\n Component={Component}\n className={cn(styles.headline, className)}\n {...rest}\n />\n );\n}\n\nHeadline.displayName = 'Headline';\n",".root {\n --tgui--hscroll-fade: 36px;\n --tgui--hscroll-bg: var(--tgui--bg);\n position: relative;\n min-width: 0;\n max-width: 100%;\n}\n\n.edge {\n position: absolute;\n top: 0;\n bottom: 0;\n width: var(--tgui--hscroll-fade);\n z-index: 1;\n opacity: 0;\n pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .edge {\n transition: opacity 0.2s ease;\n }\n}\n\n.edge--start {\n left: 0;\n background: linear-gradient(to right, var(--tgui--hscroll-bg), transparent);\n}\n\n.edge--end {\n right: 0;\n background: linear-gradient(to left, var(--tgui--hscroll-bg), transparent);\n}\n\n.root[data-start=\"true\"] .edge--start,\n.root[data-end=\"true\"] .edge--end {\n opacity: 1;\n}\n\n.scroller {\n display: flex;\n min-width: 0;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n overscroll-behavior-x: contain;\n}\n\n.scroller::-webkit-scrollbar {\n display: none;\n}\n\n.scroller:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: calc(-1 * var(--tgui--focus-ring-offset));\n border-radius: var(--tgui--radius-sm);\n}\n\n.scroller > * {\n -webkit-user-drag: none;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .scroller {\n cursor: grab;\n }\n\n .scroller[data-grabbing=\"true\"] {\n cursor: grabbing;\n }\n\n .scroller[data-grabbing=\"true\"] * {\n pointer-events: none;\n }\n}\n\n.snap {\n scroll-snap-type: x mandatory;\n}\n\n.snap > * {\n scroll-snap-align: start;\n}\n","'use client';\n\nimport {\n type HTMLAttributes,\n type PointerEvent as ReactPointerEvent,\n type Ref,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './HorizontalScroll.module.css';\n\nconst DRAG_THRESHOLD = 4;\n\nexport interface HorizontalScrollProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n snap?: boolean;\n fade?: boolean;\n // names the scroll region for assistive tech; the region is keyboard-focusable\n scrollLabel?: string;\n}\n\nexport function HorizontalScroll({\n ref,\n snap = false,\n fade = true,\n scrollLabel = 'Scrollable content',\n className,\n children,\n ...rest\n}: HorizontalScrollProps) {\n const scrollerRef = useRef<HTMLDivElement | null>(null);\n const [edges, setEdges] = useState({ start: false, end: false });\n const drag = useRef({ down: false, moved: false, startX: 0, startScroll: 0 });\n\n const measure = useCallback(() => {\n const el = scrollerRef.current;\n if (!el) return;\n const start = el.scrollLeft > 1;\n const end = el.scrollLeft < el.scrollWidth - el.clientWidth - 1;\n setEdges((prev) => (prev.start === start && prev.end === end ? prev : { start, end }));\n }, []);\n\n useEffect(() => {\n const el = scrollerRef.current;\n if (!el) return;\n measure();\n el.addEventListener('scroll', measure, { passive: true });\n const observer = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(measure) : null;\n observer?.observe(el);\n return () => {\n el.removeEventListener('scroll', measure);\n observer?.disconnect();\n };\n }, [measure]);\n\n const onPointerDown = (event: ReactPointerEvent<HTMLDivElement>) => {\n if (event.pointerType !== 'mouse' || event.button !== 0) return;\n const el = scrollerRef.current;\n if (!el) return;\n drag.current = {\n down: true,\n moved: false,\n startX: event.clientX,\n startScroll: el.scrollLeft,\n };\n };\n\n const onPointerMove = (event: ReactPointerEvent<HTMLDivElement>) => {\n const state = drag.current;\n const el = scrollerRef.current;\n if (!state.down || !el) return;\n const dx = event.clientX - state.startX;\n if (!state.moved) {\n if (Math.abs(dx) < DRAG_THRESHOLD) return;\n state.moved = true;\n el.setPointerCapture(event.pointerId);\n el.dataset.grabbing = 'true';\n el.style.scrollBehavior = 'auto';\n }\n event.preventDefault();\n el.scrollLeft = state.startScroll - dx;\n };\n\n const endDrag = (event: ReactPointerEvent<HTMLDivElement>) => {\n const el = scrollerRef.current;\n if (el && drag.current.moved) {\n el.releasePointerCapture?.(event.pointerId);\n delete el.dataset.grabbing;\n el.style.scrollBehavior = '';\n }\n drag.current.down = false;\n };\n\n return (\n <div\n ref={ref}\n data-slot=\"horizontal-scroll\"\n className={cn(styles.root, className)}\n data-start={fade ? String(edges.start) : undefined}\n data-end={fade ? String(edges.end) : undefined}\n {...rest}\n >\n {fade ? (\n <>\n <span\n data-slot=\"horizontal-scroll-fade-start\"\n className={cn(styles.edge, styles['edge--start'])}\n aria-hidden\n />\n <span\n data-slot=\"horizontal-scroll-fade-end\"\n className={cn(styles.edge, styles['edge--end'])}\n aria-hidden\n />\n </>\n ) : null}\n {/* biome-ignore lint/a11y/useSemanticElements: a scroll region is a group, not a fieldset */}\n <div\n ref={scrollerRef}\n data-slot=\"horizontal-scroll-viewport\"\n className={cn(styles.scroller, snap && styles.snap)}\n // biome-ignore lint/a11y/noNoninteractiveTabindex: a scroll region must be keyboard-focusable to arrow-scroll\n tabIndex={0}\n role=\"group\"\n aria-label={scrollLabel}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={endDrag}\n onPointerCancel={endDrag}\n onDragStart={(event) => event.preventDefault()}\n onClickCapture={(event) => {\n if (drag.current.moved) {\n event.stopPropagation();\n drag.current.moved = false;\n }\n }}\n >\n {children}\n </div>\n </div>\n );\n}\n\nHorizontalScroll.displayName = 'HorizontalScroll';\n",".iconButton {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding: 0;\n border: none;\n overflow: hidden;\n border-radius: 10px;\n color: var(--tgui--link);\n background: transparent;\n}\n\n.circle {\n border-radius: 50%;\n}\n\n.iconButton:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n.s {\n width: 30px;\n height: 30px;\n}\n\n.m {\n width: 36px;\n height: 36px;\n}\n\n.l {\n width: 44px;\n height: 44px;\n}\n\n.iconButton::after {\n content: \"\";\n position: absolute;\n inset: 0;\n opacity: 0;\n background: currentColor;\n}\n\n.ios::after {\n content: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .iconButton::after {\n transition: opacity 0.15s ease-out;\n }\n}\n\n@media (hover: hover) and (pointer: fine) {\n .iconButton:not([data-disabled]):hover::after {\n opacity: 0.08;\n }\n}\n\n.icon {\n display: flex;\n z-index: var(--tgui--z-base);\n}\n\n.icon svg {\n display: block;\n}\n\n.mode-bezeled {\n color: var(--tgui--link);\n background: var(--tgui--accent-fill);\n}\n\n.mode-plain {\n color: var(--tgui--link);\n}\n\n.mode-gray {\n color: var(--tgui--label);\n background: var(--tgui--fill-tertiary);\n}\n\n.mode-outline {\n color: var(--tgui--label);\n box-shadow: inset 0 0 0 1px var(--tgui--separator);\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './IconButton.module.css';\n\nexport type IconButtonMode = 'bezeled' | 'plain' | 'gray' | 'outline';\nexport type IconButtonSize = 's' | 'm' | 'l';\n\nexport const iconButton = cva(styles.iconButton, {\n variants: {\n mode: {\n bezeled: styles['mode-bezeled'],\n plain: styles['mode-plain'],\n gray: styles['mode-gray'],\n outline: styles['mode-outline'],\n },\n size: { s: styles.s, m: styles.m, l: styles.l },\n circle: { true: styles.circle },\n platform: { ios: styles.ios, base: null },\n },\n defaultVariants: { mode: 'plain', size: 'm' },\n});\n","'use client';\n\nimport type { AllHTMLAttributes, ElementType, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Tappable } from '../Tappable';\nimport { useTgui } from '../TguiProvider';\nimport styles from './IconButton.module.css';\nimport { type IconButtonMode, type IconButtonSize, iconButton } from './IconButton.variants';\n\nexport type { IconButtonMode, IconButtonSize };\n\nexport interface IconButtonProps extends Omit<AllHTMLAttributes<HTMLElement>, 'size'> {\n ref?: Ref<HTMLElement>;\n Component?: ElementType;\n mode?: IconButtonMode;\n size?: IconButtonSize;\n circle?: boolean;\n}\n\nexport function IconButton({\n ref,\n Component = 'button',\n mode = 'plain',\n size = 'm',\n circle = false,\n type,\n className,\n children,\n ...rest\n}: IconButtonProps) {\n const { platform } = useTgui();\n\n return (\n <Tappable\n ref={ref}\n Component={Component}\n type={Component === 'button' ? (type ?? 'button') : type}\n data-slot=\"icon-button\"\n className={cn(iconButton({ mode, size, circle, platform }), className)}\n {...rest}\n >\n <span data-slot=\"icon-button-icon\" className={styles.icon}>\n {children}\n </span>\n </Tappable>\n );\n}\n\nIconButton.displayName = 'IconButton';\n",".frame {\n position: relative;\n display: inline-block;\n overflow: hidden;\n flex-shrink: 0;\n background: var(--tgui--fill);\n line-height: 0;\n}\n\n.bordered {\n box-shadow: inset 0 0 0 1px var(--tgui--separator);\n}\n\n.img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: var(--tgui--image-fit, cover);\n}\n\n.frame[data-state=\"loading\"] .img {\n opacity: 0;\n}\n\n.placeholder,\n.fallback {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--tgui--label-tertiary);\n}\n\n.placeholder {\n overflow: hidden;\n background: var(--tgui--fill);\n}\n\n.placeholder::after {\n content: \"\";\n position: absolute;\n inset: 0;\n transform: translateX(-100%);\n background: linear-gradient(\n 90deg,\n transparent,\n color-mix(in srgb, var(--tgui--label) 6%, transparent),\n transparent\n );\n animation: tgui-image-shimmer 1.5s ease-in-out infinite;\n}\n\n@keyframes tgui-image-shimmer {\n to {\n transform: translateX(100%);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .placeholder::after {\n animation: none;\n }\n}\n\n.fallback svg {\n width: 32%;\n height: 32%;\n max-width: 48px;\n max-height: 48px;\n}\n","'use client';\n\nimport {\n type CSSProperties,\n type ImgHTMLAttributes,\n type ReactNode,\n type Ref,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Image.module.css';\n\ntype Fit = 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';\n\nexport interface ImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'width' | 'height'> {\n ref?: Ref<HTMLImageElement>;\n size?: number;\n width?: number | string;\n height?: number | string;\n aspectRatio?: number | string;\n fit?: Fit;\n radius?: number | 'full';\n bordered?: boolean;\n fallback?: ReactNode;\n}\n\nconst BrokenIcon = (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden>\n <path\n d=\"M3 5h18v14H3zM3 15l5-5 4 4 3-3 6 6\"\n stroke=\"currentColor\"\n strokeWidth=\"1.6\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport function Image({\n ref,\n size,\n width,\n height,\n aspectRatio,\n fit = 'cover',\n radius,\n bordered = false,\n fallback = BrokenIcon,\n src,\n alt = '',\n className,\n style,\n onLoad,\n onError,\n ...rest\n}: ImageProps) {\n const [failedSrc, setFailedSrc] = useState<string | null>(null);\n const [loaded, setLoaded] = useState(false);\n const errored = src != null && src === failedSrc;\n\n const frameStyle: CSSProperties = {\n ...style,\n width: size ?? width,\n height: size ?? height,\n aspectRatio,\n borderRadius: radius === 'full' ? '50%' : radius,\n '--tgui--image-fit': fit,\n } as CSSProperties;\n\n return (\n <div\n data-slot=\"image\"\n data-state={errored ? 'error' : loaded ? 'loaded' : 'loading'}\n data-bordered={bordered || undefined}\n className={cn(styles.frame, bordered && styles.bordered, className)}\n style={frameStyle}\n >\n {src != null && !errored ? (\n <img\n ref={ref}\n data-slot=\"image-img\"\n className={styles.img}\n src={src}\n alt={alt}\n draggable={false}\n onLoad={(event) => {\n setLoaded(true);\n onLoad?.(event);\n }}\n onError={(event) => {\n setFailedSrc(src);\n onError?.(event);\n }}\n {...rest}\n />\n ) : null}\n {!loaded && !errored ? (\n <div data-slot=\"image-placeholder\" className={styles.placeholder} aria-hidden />\n ) : null}\n {errored ? (\n <div data-slot=\"image-fallback\" className={styles.fallback} aria-hidden>\n {fallback}\n </div>\n ) : null}\n </div>\n );\n}\n\nImage.displayName = 'Image';\n","import { createContext } from 'react';\nimport type { InlineButtonsMode } from './InlineButtons.variants';\n\nexport interface InlineButtonsContextValue {\n mode: InlineButtonsMode;\n}\n\nexport const InlineButtonsContext = createContext<InlineButtonsContextValue>({ mode: 'bezeled' });\n\nInlineButtonsContext.displayName = 'InlineButtonsContext';\n",".group {\n display: flex;\n gap: 8px;\n overflow-x: auto;\n scroll-snap-type: x proximity;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n}\n\n.group::-webkit-scrollbar {\n display: none;\n}\n\n.item {\n display: flex;\n flex: 1 1 0;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 4px;\n min-width: 72px;\n padding: 10px 4px;\n border: 0;\n border-radius: 12px;\n color: var(--tgui--link-strong);\n scroll-snap-align: start;\n}\n\n/* the row is an overflow scroller – an outset ring would be clipped */\n.item:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: calc(-1 * var(--tgui--focus-ring-offset));\n}\n\n.mode-bezeled {\n background: var(--tgui--accent-fill);\n}\n\n.mode-plain {\n background: transparent;\n}\n\n.mode-gray {\n color: var(--tgui--label);\n background: var(--tgui--fill-tertiary);\n}\n\n.icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n}\n\n.icon svg {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n.label {\n max-width: 100%;\n overflow: hidden;\n color: inherit;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n","import { cva } from 'class-variance-authority';\nimport styles from './InlineButtons.module.css';\n\nexport type InlineButtonsMode = 'bezeled' | 'plain' | 'gray';\n\nexport const inlineButtonsItem = cva(styles.item, {\n variants: {\n mode: {\n bezeled: styles['mode-bezeled'],\n plain: styles['mode-plain'],\n gray: styles['mode-gray'],\n },\n },\n defaultVariants: { mode: 'bezeled' },\n});\n","'use client';\n\nimport { type ButtonHTMLAttributes, type ReactNode, type Ref, useContext } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Caption } from '../Caption';\nimport { Tappable } from '../Tappable';\nimport { InlineButtonsContext } from './context';\nimport styles from './InlineButtons.module.css';\nimport { inlineButtonsItem } from './InlineButtons.variants';\n\nexport interface InlineButtonsItemProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {\n ref?: Ref<HTMLButtonElement>;\n icon: ReactNode;\n children: ReactNode;\n}\n\nexport function InlineButtonsItem({\n ref,\n icon,\n children,\n className,\n ...rest\n}: InlineButtonsItemProps) {\n const { mode } = useContext(InlineButtonsContext);\n\n return (\n <Tappable\n ref={ref}\n Component=\"button\"\n type=\"button\"\n interactiveAnimation=\"opacity\"\n data-slot=\"inline-buttons-item\"\n className={cn(inlineButtonsItem({ mode }), className)}\n {...rest}\n >\n <span data-slot=\"inline-buttons-item-icon\" className={styles.icon}>\n {icon}\n </span>\n <Caption data-slot=\"inline-buttons-item-label\" className={styles.label} level=\"2\" weight=\"2\">\n {children}\n </Caption>\n </Tappable>\n );\n}\n\nInlineButtonsItem.displayName = 'InlineButtonsItem';\n","'use client';\n\nimport type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { InlineButtonsContext } from './context';\nimport styles from './InlineButtons.module.css';\nimport type { InlineButtonsMode } from './InlineButtons.variants';\nimport { InlineButtonsItem } from './InlineButtonsItem';\n\nexport type { InlineButtonsMode };\n\nexport interface InlineButtonsProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n mode?: InlineButtonsMode;\n}\n\nexport function InlineButtons({\n ref,\n mode = 'bezeled',\n className,\n children,\n ...rest\n}: InlineButtonsProps) {\n return (\n <InlineButtonsContext.Provider value={{ mode }}>\n {/* biome-ignore lint/a11y/useSemanticElements: a row of action buttons, not a form control group; <fieldset> would add a border box and legend semantics we don't want */}\n <div\n ref={ref}\n role=\"group\"\n data-slot=\"inline-buttons\"\n className={cn(styles.group, className)}\n {...rest}\n >\n {children}\n </div>\n </InlineButtonsContext.Provider>\n );\n}\n\nInlineButtons.displayName = 'InlineButtons';\nInlineButtons.Item = InlineButtonsItem;\n",".base {\n position: relative;\n padding: 20px 22px 16px;\n background: var(--tgui--bg);\n}\n\n.body {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n padding: var(--tgui--field-padding-y) var(--tgui--field-padding-x);\n}\n\n.body > :not(:first-child) {\n margin-inline-start: var(--tgui--field-gap);\n}\n\n.base .body {\n border-radius: 14px;\n box-shadow: 0 0 0 1.5px var(--tgui--separator-opaque);\n}\n\n.ios .body {\n min-height: var(--tgui--field-min-height);\n border-radius: var(--tgui--field-radius);\n background: var(--tgui--fill);\n}\n\n.align-start .body {\n align-items: flex-start;\n}\n\n.before,\n.after {\n display: flex;\n align-items: center;\n}\n\n.header {\n position: absolute;\n top: 6px;\n inset-inline-start: 32px;\n margin: 0;\n max-width: calc(100% - 76px);\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n padding: 0 6px;\n border-radius: 5px;\n color: var(--tgui--label-secondary);\n background: var(--tgui--bg);\n}\n\n/* iOS filled fields don't show a floating label – keep it for assistive tech only */\n.ios .header {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n}\n\n.base[data-state=\"focused\"] .body {\n box-shadow: 0 0 0 2px var(--tgui--link);\n}\n\n.base[data-state=\"focused\"] .header {\n color: var(--tgui--link-strong);\n}\n\n.base[data-state=\"error\"] .body {\n box-shadow: 0 0 0 2px var(--tgui--destructive);\n}\n\n.base[data-state=\"error\"] .header {\n color: var(--tgui--destructive-strong);\n}\n\n.ios[data-state=\"error\"] .body {\n box-shadow: 0 0 0 1.5px var(--tgui--destructive);\n}\n\n.base[data-disabled],\n.ios[data-disabled] {\n pointer-events: none;\n}\n\n.ios[data-disabled] {\n opacity: 0.35;\n}\n","import type { ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './FormField.module.css';\n\nexport type FormFieldStatus = 'default' | 'error' | 'focused';\n\nexport interface FormFieldProps {\n ref?: Ref<HTMLDivElement>;\n ios?: boolean;\n status?: FormFieldStatus;\n disabled?: boolean;\n alignStart?: boolean;\n header?: ReactNode;\n before?: ReactNode;\n after?: ReactNode;\n className?: string;\n children: ReactNode;\n}\n\nexport function FormField({\n ref,\n ios = false,\n status = 'default',\n disabled = false,\n alignStart = false,\n header,\n before,\n after,\n className,\n children,\n}: FormFieldProps) {\n return (\n <div\n ref={ref}\n data-slot=\"form-field\"\n data-state={status}\n data-disabled={disabled || undefined}\n className={cn(ios ? styles.ios : styles.base, alignStart && styles['align-start'], className)}\n aria-disabled={disabled || undefined}\n >\n {/* biome-ignore lint/a11y/noLabelWithoutControl: the control is the field passed in as children */}\n <label className={styles.body} data-slot=\"form-field-body\">\n {before != null ? (\n <span className={styles.before} data-slot=\"form-field-before\">\n {before}\n </span>\n ) : null}\n {children}\n {after != null ? (\n <span className={styles.after} data-slot=\"form-field-after\">\n {after}\n </span>\n ) : null}\n {/* inside the label so it names the control; hidden on iOS */}\n {header != null ? (\n <span className={styles.header} data-slot=\"form-field-label\">\n {header}\n </span>\n ) : null}\n </label>\n </div>\n );\n}\n\nFormField.displayName = 'FormField';\n",".field {\n display: block;\n width: 100%;\n margin: 0;\n padding: 0;\n border: 0;\n outline: 0;\n background: transparent;\n color: var(--tgui--label);\n text-overflow: ellipsis;\n}\n\n.field::placeholder {\n color: var(--tgui--label-tertiary);\n}\n\n.field::-webkit-outer-spin-button,\n.field::-webkit-inner-spin-button {\n appearance: none;\n}\n","'use client';\n\nimport {\n type FocusEvent,\n type InputHTMLAttributes,\n type ReactNode,\n type Ref,\n useState,\n} from 'react';\nimport { FormField } from '../FormField';\nimport { Subheadline } from '../Subheadline';\nimport { Text } from '../Text';\nimport { useTgui } from '../TguiProvider';\nimport styles from './Input.module.css';\n\nexport type InputStatus = 'default' | 'error' | 'focused';\n\nexport interface InputProps extends InputHTMLAttributes<HTMLInputElement> {\n ref?: Ref<HTMLInputElement>;\n header?: ReactNode;\n before?: ReactNode;\n after?: ReactNode;\n status?: InputStatus;\n}\n\nexport function Input({\n ref,\n type = 'text',\n header,\n before,\n after,\n status,\n disabled,\n className,\n onFocus,\n onBlur,\n ...rest\n}: InputProps) {\n const { platform } = useTgui();\n const ios = platform === 'ios';\n const [focused, setFocused] = useState(false);\n const state = status ?? (focused ? 'focused' : 'default');\n const Typography = ios ? Text : Subheadline;\n\n const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n if (!disabled) setFocused(true);\n onFocus?.(event);\n };\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n setFocused(false);\n onBlur?.(event);\n };\n\n return (\n <FormField\n ios={ios}\n status={state}\n disabled={disabled}\n header={header}\n before={before}\n after={after}\n className={className}\n >\n <Typography\n ref={ref as Ref<HTMLElement>}\n Component=\"input\"\n data-slot=\"input\"\n className={styles.field}\n type={type}\n disabled={disabled}\n aria-invalid={state === 'error' || undefined}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...rest}\n />\n </FormField>\n );\n}\n\nInput.displayName = 'Input';\n",".large-title {\n font-size: var(--tgui--font-large-title-size);\n line-height: var(--tgui--font-large-title-line);\n letter-spacing: var(--tgui--font-large-title-tracking);\n}\n","import type { Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Typography, type TypographyProps } from '../Typography';\nimport styles from './LargeTitle.module.css';\n\nexport interface LargeTitleProps extends TypographyProps {\n ref?: Ref<HTMLElement>;\n}\n\nexport function LargeTitle({\n ref,\n weight = '1',\n className,\n Component = 'h1',\n ...rest\n}: LargeTitleProps) {\n return (\n <Typography\n data-slot=\"large-title\"\n ref={ref}\n weight={weight}\n Component={Component}\n className={cn(styles['large-title'], className)}\n {...rest}\n />\n );\n}\n\nLargeTitle.displayName = 'LargeTitle';\n",".link {\n color: var(--tgui--link-strong);\n text-decoration: none;\n border-radius: 3px;\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .link:hover {\n text-decoration: underline;\n }\n}\n\n.link:focus-visible {\n outline: var(--tgui--focus-ring);\n}\n\n.icon {\n display: inline-block;\n width: 0.85em;\n height: 0.85em;\n margin-inline-start: 0.15em;\n vertical-align: -0.05em;\n}\n","import type { AnchorHTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Link.module.css';\n\nexport interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n ref?: Ref<HTMLAnchorElement>;\n}\n\nexport function Link({ ref, target, rel, className, children, ...rest }: LinkProps) {\n const external = target === '_blank';\n return (\n <a\n ref={ref}\n target={target}\n rel={external ? (rel ?? 'noopener noreferrer') : rel}\n data-slot=\"link\"\n data-external={external || undefined}\n className={cn(styles.link, className)}\n {...rest}\n >\n {children}\n {external ? (\n <svg\n data-slot=\"link-icon\"\n className={styles.icon}\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden\n >\n <path\n d=\"M6 3h7v7M13 3l-8 8\"\n stroke=\"currentColor\"\n strokeWidth=\"1.6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n ) : null}\n </a>\n );\n}\n\nLink.displayName = 'Link';\n",".list {\n box-sizing: border-box;\n /* grouped lists are inset from the screen edge, symmetrically, on both platforms */\n padding: var(--tgui--space-16) var(--tgui--page-margin);\n}\n\n.list > :not(:last-child) {\n margin-bottom: var(--tgui--space-32);\n}\n","'use client';\n\nimport type { ElementType, HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './List.module.css';\n\nexport interface ListProps extends HTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n Component?: ElementType;\n}\n\nexport function List({ ref, Component = 'div', className, children, ...rest }: ListProps) {\n return (\n <Component ref={ref} data-slot=\"list\" className={cn(styles.list, className)} {...rest}>\n {children}\n </Component>\n );\n}\n\nList.displayName = 'List';\n",".nav {\n font-family: var(--tgui--font-family);\n}\n\n.list {\n display: flex;\n align-items: center;\n gap: 4px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.page {\n min-width: 32px;\n height: 32px;\n padding: 0 8px;\n border: 0;\n border-radius: 8px;\n background: transparent;\n color: var(--tgui--label);\n font: inherit;\n font-size: 14px;\n cursor: pointer;\n}\n\n.page[aria-current=\"page\"] {\n color: var(--tgui--link-strong);\n font-weight: var(--tgui--weight-semibold);\n background: var(--tgui--accent-fill);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .page:not([aria-current=\"page\"]):hover {\n background: var(--tgui--fill-tertiary);\n }\n}\n\n.page:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n.dots {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 32px;\n height: 32px;\n color: var(--tgui--label-secondary);\n}\n\n.dotList {\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.dot {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n padding: 0;\n border: 0;\n background: transparent;\n cursor: pointer;\n}\n\n.dot::after {\n content: \"\";\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--tgui--accent-fill);\n}\n\n.dot[data-active]::after {\n width: 8px;\n height: 8px;\n background: var(--tgui--accent-strong);\n}\n\n.dotGap {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: 12px;\n height: 20px;\n}\n\n.dotGap::after {\n content: \"\";\n width: 3px;\n height: 3px;\n border-radius: 50%;\n background: var(--tgui--label-secondary);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .dot::after {\n transition:\n width 0.15s ease,\n height 0.15s ease,\n background 0.15s ease;\n }\n}\n\n.dot:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n border-radius: 50%;\n}\n","export const DOTS = 'dots' as const;\n\nfunction range(start: number, end: number) {\n return Array.from({ length: end - start + 1 }, (_, index) => start + index);\n}\n\nexport function paginationRange(page: number, count: number, siblingCount: number) {\n const totalNumbers = siblingCount * 2 + 5;\n if (totalNumbers >= count) return range(1, count);\n\n const leftSibling = Math.max(page - siblingCount, 1);\n const rightSibling = Math.min(page + siblingCount, count);\n const showLeftDots = leftSibling > 2;\n const showRightDots = rightSibling < count - 1;\n\n if (!showLeftDots && showRightDots) {\n return [...range(1, 3 + siblingCount * 2), DOTS, count];\n }\n if (showLeftDots && !showRightDots) {\n return [1, DOTS, ...range(count - (3 + siblingCount * 2) + 1, count)];\n }\n return [1, DOTS, ...range(leftSibling, rightSibling), DOTS, count];\n}\n","'use client';\n\nimport type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Pagination.module.css';\nimport { DOTS, paginationRange } from './paginationRange';\n\nexport interface CompactPaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {\n ref?: Ref<HTMLElement>;\n page: number;\n count: number;\n onChange: (page: number) => void;\n siblingCount?: number;\n}\n\nexport function CompactPagination({\n ref,\n page,\n count,\n onChange,\n siblingCount = 1,\n className,\n ...rest\n}: CompactPaginationProps) {\n const items = paginationRange(page, count, siblingCount);\n\n return (\n <nav ref={ref} aria-label=\"Pagination\" className={cn(styles.nav, className)} {...rest}>\n <ul className={styles.dotList}>\n {items.map((item, index) =>\n item === DOTS ? (\n // biome-ignore lint/suspicious/noArrayIndexKey: ellipsis positions are stable per render\n <li key={`dots-${index}`} className={styles.dotGap} aria-hidden />\n ) : (\n <li key={item}>\n <button\n type=\"button\"\n className={styles.dot}\n data-active={item === page || undefined}\n aria-label={`Page ${item}`}\n aria-current={item === page ? 'page' : undefined}\n onClick={() => onChange(item)}\n />\n </li>\n ),\n )}\n </ul>\n </nav>\n );\n}\n\nCompactPagination.displayName = 'CompactPagination';\n","'use client';\n\nimport type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { IconButton } from '../IconButton';\nimport styles from './Pagination.module.css';\nimport { DOTS, paginationRange } from './paginationRange';\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {\n ref?: Ref<HTMLElement>;\n page: number;\n count: number;\n onChange: (page: number) => void;\n siblingCount?: number;\n}\n\nconst ArrowIcon = ({ direction }: { direction: 'prev' | 'next' }) => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 18 18\" fill=\"none\" aria-hidden>\n <path\n d={direction === 'prev' ? 'M11.25 4.5L6.75 9l4.5 4.5' : 'M6.75 4.5L11.25 9l-4.5 4.5'}\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport function Pagination({\n ref,\n page,\n count,\n onChange,\n siblingCount = 1,\n className,\n ...rest\n}: PaginationProps) {\n const items = paginationRange(page, count, siblingCount);\n\n return (\n <nav\n ref={ref}\n aria-label=\"Pagination\"\n data-slot=\"pagination\"\n className={cn(styles.nav, className)}\n {...rest}\n >\n <ul className={styles.list}>\n <li>\n <IconButton\n mode=\"gray\"\n size=\"s\"\n data-slot=\"pagination-previous\"\n aria-label=\"Previous page\"\n disabled={page <= 1}\n onClick={() => onChange(page - 1)}\n >\n <ArrowIcon direction=\"prev\" />\n </IconButton>\n </li>\n {items.map((item, index) =>\n item === DOTS ? (\n // biome-ignore lint/suspicious/noArrayIndexKey: ellipsis positions are stable per render\n <li key={`dots-${index}`} className={styles.dots} aria-hidden>\n …\n </li>\n ) : (\n <li key={item}>\n <button\n type=\"button\"\n data-slot=\"pagination-item\"\n className={styles.page}\n aria-current={item === page ? 'page' : undefined}\n onClick={() => onChange(item)}\n >\n {item}\n </button>\n </li>\n ),\n )}\n <li>\n <IconButton\n mode=\"gray\"\n size=\"s\"\n data-slot=\"pagination-next\"\n aria-label=\"Next page\"\n disabled={page >= count}\n onClick={() => onChange(page + 1)}\n >\n <ArrowIcon direction=\"next\" />\n </IconButton>\n </li>\n </ul>\n </nav>\n );\n}\n\nPagination.displayName = 'Pagination';\n",".pinInput {\n display: inline-flex;\n gap: 10px;\n}\n\n.cell {\n width: 44px;\n height: 52px;\n padding: 0;\n border: 0;\n border-radius: 12px;\n background: var(--tgui--fill);\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 24px;\n font-weight: var(--tgui--weight-semibold);\n text-align: center;\n caret-color: var(--tgui--link);\n box-shadow: inset 0 0 0 1.5px transparent;\n transition: box-shadow 0.12s ease;\n}\n\n.cell:focus {\n outline: none;\n box-shadow: inset 0 0 0 1.5px var(--tgui--link);\n}\n\n.cell:disabled {\n opacity: 0.4;\n}\n\n.pinInput[data-invalid] .cell {\n box-shadow: inset 0 0 0 1.5px var(--tgui--destructive);\n}\n","'use client';\n\nimport {\n type ClipboardEvent as ReactClipboardEvent,\n type KeyboardEvent as ReactKeyboardEvent,\n type Ref,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './PinInput.module.css';\n\nconst PATTERNS = {\n numeric: /[0-9]/,\n alphanumeric: /[a-z0-9]/i,\n};\n\nexport interface PinInputProps {\n ref?: Ref<HTMLDivElement>;\n length?: number;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n onComplete?: (value: string) => void;\n type?: 'numeric' | 'alphanumeric';\n mask?: boolean;\n disabled?: boolean;\n invalid?: boolean;\n name?: string;\n 'aria-label'?: string;\n className?: string;\n}\n\nexport function PinInput({\n ref,\n length = 4,\n value: valueProp,\n defaultValue = '',\n onValueChange,\n onComplete,\n type = 'numeric',\n mask = false,\n disabled = false,\n invalid = false,\n name,\n 'aria-label': ariaLabel = 'Verification code',\n className,\n}: PinInputProps) {\n const [uncontrolled, setUncontrolled] = useState(defaultValue.slice(0, length));\n const raw = valueProp ?? uncontrolled;\n const chars = useMemo(() => {\n const next = raw.split('').slice(0, length);\n while (next.length < length) next.push('');\n return next;\n }, [raw, length]);\n\n const inputs = useRef<(HTMLInputElement | null)[]>([]);\n const pattern = PATTERNS[type];\n\n const commit = (next: string[]) => {\n const value = next.join('');\n if (valueProp == null) setUncontrolled(value);\n onValueChange?.(value);\n if (value.length === length && next.every(Boolean)) onComplete?.(value);\n };\n\n const focusCell = (index: number) => {\n const clamped = Math.max(0, Math.min(length - 1, index));\n inputs.current[clamped]?.focus();\n inputs.current[clamped]?.select();\n };\n\n const handleChange = (index: number, incoming: string) => {\n const char = incoming\n .split('')\n .reverse()\n .find((c) => pattern.test(c));\n if (!char) return;\n const next = [...chars];\n next[index] = char;\n commit(next);\n focusCell(index + 1);\n };\n\n const handleKeyDown = (index: number, event: ReactKeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Backspace') {\n event.preventDefault();\n const next = [...chars];\n if (next[index]) {\n next[index] = '';\n commit(next);\n } else if (index > 0) {\n next[index - 1] = '';\n commit(next);\n focusCell(index - 1);\n }\n } else if (event.key === 'ArrowLeft') {\n event.preventDefault();\n focusCell(index - 1);\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n focusCell(index + 1);\n }\n };\n\n const handlePaste = (index: number, event: ReactClipboardEvent<HTMLInputElement>) => {\n event.preventDefault();\n const pasted = event.clipboardData\n .getData('text')\n .split('')\n .filter((c) => pattern.test(c));\n if (pasted.length === 0) return;\n const next = [...chars];\n for (let i = 0; i < pasted.length && index + i < length; i += 1) {\n next[index + i] = pasted[i];\n }\n commit(next);\n focusCell(index + pasted.length);\n };\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: a labelled group of separate inputs; <fieldset> would add a border box and legend semantics we don't want\n <div\n ref={ref}\n data-slot=\"pin-input\"\n className={cn(styles.pinInput, className)}\n role=\"group\"\n aria-label={ariaLabel}\n data-invalid={invalid || undefined}\n >\n {chars.map((char, index) => (\n <input\n // biome-ignore lint/suspicious/noArrayIndexKey: fixed-length positional cells\n key={index}\n ref={(node) => {\n inputs.current[index] = node;\n }}\n data-slot=\"pin-input-cell\"\n className={styles.cell}\n aria-invalid={invalid || undefined}\n type={mask ? 'password' : 'text'}\n inputMode={type === 'numeric' ? 'numeric' : 'text'}\n autoComplete={index === 0 ? 'one-time-code' : 'off'}\n name={name ? `${name}-${index}` : undefined}\n aria-label={`${ariaLabel}, digit ${index + 1}`}\n maxLength={1}\n value={char}\n disabled={disabled}\n onChange={(event) => handleChange(index, event.target.value)}\n onKeyDown={(event) => handleKeyDown(index, event)}\n onPaste={(event) => handlePaste(index, event)}\n onFocus={(event) => event.target.select()}\n />\n ))}\n </div>\n );\n}\n\nPinInput.displayName = 'PinInput';\n",".level-1 {\n font-size: var(--tgui--font-title-1-size);\n line-height: var(--tgui--font-title-1-line);\n letter-spacing: var(--tgui--font-title-1-tracking);\n}\n\n.level-2 {\n font-size: var(--tgui--font-title-2-size);\n line-height: var(--tgui--font-title-2-line);\n letter-spacing: var(--tgui--font-title-2-tracking);\n}\n\n.level-3 {\n font-size: var(--tgui--font-title-3-size);\n line-height: var(--tgui--font-title-3-line);\n letter-spacing: var(--tgui--font-title-3-tracking);\n}\n","import type { ElementType } from 'react';\nimport type { TypographyProps } from '../Typography';\nimport styles from './Title.module.css';\n\nexport type TitleLevel = '1' | '2' | '3';\n\nexport const TITLE_LEVELS: Record<\n TitleLevel,\n { tag: ElementType; className: string; weight: NonNullable<TypographyProps['weight']> }\n> = {\n '1': { tag: 'h2', className: styles['level-1'], weight: '1' },\n '2': { tag: 'h3', className: styles['level-2'], weight: '1' },\n '3': { tag: 'h4', className: styles['level-3'], weight: '2' },\n};\n","import type { Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Typography, type TypographyProps } from '../Typography';\nimport { TITLE_LEVELS, type TitleLevel } from './Title.variants';\n\nexport interface TitleProps extends TypographyProps {\n ref?: Ref<HTMLElement>;\n level?: TitleLevel;\n}\n\nexport function Title({ ref, level = '2', weight, Component, className, ...rest }: TitleProps) {\n const { tag, className: levelClass, weight: levelWeight } = TITLE_LEVELS[level];\n\n return (\n <Typography\n data-slot=\"title\"\n ref={ref}\n weight={weight ?? levelWeight}\n Component={Component ?? tag}\n className={cn(levelClass, className)}\n {...rest}\n />\n );\n}\n\nTitle.displayName = 'Title';\n",".placeholder {\n overflow: hidden;\n\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n gap: 24px;\n padding: 32px;\n}\n\n.fields {\n margin: 0;\n text-align: center;\n overflow-wrap: anywhere;\n}\n\n.description {\n color: var(--tgui--label-secondary);\n}\n\n.description:not(:first-child) {\n margin-top: 8px;\n}\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Text } from '../Text';\nimport { Title } from '../Title';\nimport styles from './Placeholder.module.css';\n\nexport interface PlaceholderProps extends HTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n children?: ReactNode;\n header?: ReactNode;\n description?: ReactNode;\n action?: ReactNode;\n}\n\nexport function Placeholder({\n ref,\n children,\n header,\n description,\n action,\n className,\n ...rest\n}: PlaceholderProps) {\n return (\n <section\n ref={ref}\n data-slot=\"placeholder\"\n className={cn(styles.placeholder, className)}\n {...rest}\n >\n {children}\n {header != null || description != null ? (\n <dl data-slot=\"placeholder-fields\" className={styles.fields}>\n {header != null ? (\n <Title Component=\"dt\" level=\"3\" weight=\"2\">\n {header}\n </Title>\n ) : null}\n {description != null ? (\n <Text Component=\"dd\" className={styles.description}>\n {description}\n </Text>\n ) : null}\n </dl>\n ) : null}\n {action}\n </section>\n );\n}\n\nPlaceholder.displayName = 'Placeholder';\n","import { createContext, type RefObject } from 'react';\n\nexport interface PopoverContextValue {\n open: boolean;\n setOpen: (open: boolean) => void;\n triggerRef: RefObject<HTMLElement | null>;\n contentId: string;\n}\n\nexport const PopoverContext = createContext<PopoverContextValue>({\n open: false,\n setOpen: () => {},\n triggerRef: { current: null },\n contentId: '',\n});\n\nPopoverContext.displayName = 'PopoverContext';\n",".content {\n position: fixed;\n top: 0;\n inset-inline-start: 0;\n z-index: var(--tgui--z-overlay);\n min-width: 160px;\n max-width: 320px;\n border-radius: var(--tgui--radius);\n background: var(--tgui--surface-bg);\n color: var(--tgui--label);\n box-shadow: var(--tgui--overlay-shadow);\n}\n\n.content[data-side=\"bottom\"] {\n transform-origin: top center;\n}\n\n.content[data-side=\"top\"] {\n transform-origin: bottom center;\n}\n\n.content[data-side=\"left\"] {\n transform-origin: right center;\n}\n\n.content[data-side=\"right\"] {\n transform-origin: left center;\n}\n\n/* the canonical overlay motion — every component that appears anchored to a\n trigger (tooltip, menus, dialog) uses these exact values */\n@media (prefers-reduced-motion: no-preference) {\n .content[data-state=\"open\"] {\n animation: popover-in var(--tgui--duration-overlay) var(--tgui--ease-spring);\n }\n\n .content[data-state=\"closed\"] {\n animation: popover-out var(--tgui--duration-overlay) var(--tgui--ease-in) forwards;\n }\n}\n\n@keyframes popover-in {\n from {\n opacity: 0;\n transform: scale(0.96);\n }\n}\n\n@keyframes popover-out {\n to {\n opacity: 0;\n transform: scale(0.96);\n }\n}\n","'use client';\n\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { Presence } from '@radix-ui/react-presence';\nimport {\n type HTMLAttributes,\n type Ref,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport {\n computeFloatingPosition,\n type FloatingPlacement,\n type FloatingPosition,\n} from '../../shared/lib/floatingPosition';\nimport { Portal } from '../Portal';\nimport { PopoverContext } from './context';\nimport styles from './Popover.module.css';\n\nexport interface PopoverContentProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> {\n ref?: Ref<HTMLDivElement>;\n placement?: FloatingPlacement;\n gap?: number;\n container?: Element | DocumentFragment | null;\n className?: string;\n}\n\nexport function PopoverContent({\n ref,\n placement = 'bottom-start',\n gap = 8,\n container,\n className,\n children,\n ...rest\n}: PopoverContentProps) {\n const { open, setOpen, triggerRef, contentId } = useContext(PopoverContext);\n const nodeRef = useRef<HTMLDivElement | null>(null);\n const [contentNode, setContentNode] = useState<HTMLDivElement | null>(null);\n const [position, setPosition] = useState<FloatingPosition | null>(null);\n\n const reposition = useCallback(() => {\n const trigger = triggerRef.current;\n const node = nodeRef.current;\n if (!trigger || !node) return;\n setPosition(\n computeFloatingPosition(\n trigger.getBoundingClientRect(),\n node.getBoundingClientRect(),\n placement,\n gap,\n node,\n ),\n );\n }, [placement, gap, triggerRef]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: contentNode re-runs this once Presence actually mounts the div, one render after `open` flips\n useLayoutEffect(() => {\n if (open) reposition();\n }, [open, reposition, contentNode]);\n\n useEffect(() => {\n if (!open) return;\n const onScrollOrResize = () => reposition();\n window.addEventListener('resize', onScrollOrResize);\n window.addEventListener('scroll', onScrollOrResize, true);\n return () => {\n window.removeEventListener('resize', onScrollOrResize);\n window.removeEventListener('scroll', onScrollOrResize, true);\n };\n }, [open, reposition]);\n\n return (\n <Portal container={container}>\n <Presence present={open}>\n <FocusScope\n asChild\n trapped\n loop\n onUnmountAutoFocus={(event) => {\n event.preventDefault();\n triggerRef.current?.focus();\n }}\n >\n <DismissableLayer\n asChild\n deferPointerDownOutside\n onEscapeKeyDown={() => setOpen(false)}\n onPointerDownOutside={() => setOpen(false)}\n onFocusOutside={() => setOpen(false)}\n >\n <div\n ref={(node) => {\n nodeRef.current = node;\n setContentNode(node);\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as { current: HTMLDivElement | null }).current = node;\n }}\n id={contentId}\n role=\"dialog\"\n data-slot=\"popover-content\"\n data-side={position?.side}\n data-state={position ? (open ? 'open' : 'closed') : undefined}\n className={cn(styles.content, className)}\n style={\n position\n ? { top: position.top, left: position.left }\n : { top: 0, left: 0, opacity: 0, pointerEvents: 'none' }\n }\n {...rest}\n >\n {children}\n </div>\n </DismissableLayer>\n </FocusScope>\n </Presence>\n </Portal>\n );\n}\n\nPopoverContent.displayName = 'PopoverContent';\n","'use client';\n\nimport { cloneElement, isValidElement, type ReactElement, useContext } from 'react';\nimport { PopoverContext } from './context';\n\nexport interface PopoverTriggerProps {\n children: ReactElement;\n}\n\nexport function PopoverTrigger({ children }: PopoverTriggerProps) {\n const { open, setOpen, triggerRef, contentId } = useContext(PopoverContext);\n\n if (!isValidElement(children)) return children;\n\n const child = children as ReactElement<Record<string, unknown>>;\n const childRef = (child.props as { ref?: unknown }).ref;\n const childOnClick = child.props.onClick as ((event: unknown) => void) | undefined;\n\n return cloneElement(child, {\n ref: (node: HTMLElement | null) => {\n triggerRef.current = node;\n if (typeof childRef === 'function') childRef(node);\n else if (childRef && typeof childRef === 'object')\n (childRef as { current: HTMLElement | null }).current = node;\n },\n onClick: (event: unknown) => {\n childOnClick?.(event);\n setOpen(!open);\n },\n 'aria-haspopup': 'dialog',\n 'aria-expanded': open,\n 'aria-controls': open ? contentId : undefined,\n 'data-slot': 'popover-trigger',\n 'data-state': open ? 'open' : 'closed',\n });\n}\n\nPopoverTrigger.displayName = 'PopoverTrigger';\n","'use client';\n\nimport { type ReactNode, useCallback, useId, useRef, useState } from 'react';\nimport { PopoverContext } from './context';\nimport { PopoverContent } from './PopoverContent';\nimport { PopoverTrigger } from './PopoverTrigger';\n\nexport interface PopoverProps {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children: ReactNode;\n}\n\nexport function Popover({\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n children,\n}: PopoverProps) {\n const [uncontrolled, setUncontrolled] = useState(defaultOpen);\n const open = openProp ?? uncontrolled;\n const triggerRef = useRef<HTMLElement | null>(null);\n const contentId = useId();\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (openProp == null) setUncontrolled(next);\n onOpenChange?.(next);\n },\n [openProp, onOpenChange],\n );\n\n return (\n <PopoverContext.Provider value={{ open, setOpen, triggerRef, contentId }}>\n {children}\n </PopoverContext.Provider>\n );\n}\n\nPopover.displayName = 'Popover';\nPopover.Trigger = PopoverTrigger;\nPopover.Content = PopoverContent;\n",".track {\n overflow: hidden;\n width: 100%;\n height: 4px;\n border-radius: 2px;\n background: var(--tgui--fill);\n}\n\n.bar {\n height: 100%;\n border-radius: inherit;\n background: var(--tgui--link);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .bar {\n transition: width 0.25s ease;\n }\n}\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Progress.module.css';\n\nexport interface ProgressProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n value?: number;\n}\n\nexport function Progress({\n ref,\n value = 0,\n className,\n 'aria-label': ariaLabel,\n ...rest\n}: ProgressProps) {\n const clamped = Math.max(0, Math.min(100, value));\n return (\n <div\n ref={ref}\n role=\"progressbar\"\n aria-label={ariaLabel ?? 'Progress'}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={Math.round(clamped)}\n data-slot=\"progress\"\n className={cn(styles.track, className)}\n {...rest}\n >\n <div data-slot=\"progress-indicator\" className={styles.bar} style={{ width: `${clamped}%` }} />\n </div>\n );\n}\n\nProgress.displayName = 'Progress';\n",".radio {\n position: relative;\n display: inline-flex;\n cursor: pointer;\n}\n\n.radio[data-disabled] {\n cursor: default;\n opacity: 0.3;\n}\n\n.input {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n opacity: 0;\n cursor: inherit;\n}\n\n.dot {\n position: relative;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n box-shadow: inset 0 0 0 2px var(--tgui--separator);\n pointer-events: none;\n}\n\n.dot::after {\n content: \"\";\n position: absolute;\n inset: 5px;\n border-radius: 50%;\n background: var(--tgui--link);\n transform: scale(0);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .dot {\n transition: box-shadow 0.15s ease-out;\n }\n\n .dot::after {\n transition: transform 0.15s ease-out;\n }\n}\n\n.input:checked + .dot {\n box-shadow: inset 0 0 0 2px var(--tgui--link);\n}\n\n.input:checked + .dot::after {\n transform: scale(1);\n}\n\n.input:focus-visible + .dot {\n box-shadow:\n inset 0 0 0 2px var(--tgui--separator),\n var(--tgui--focus-ring-shadow);\n}\n\n.input:checked:focus-visible + .dot {\n box-shadow:\n inset 0 0 0 2px var(--tgui--accent),\n var(--tgui--focus-ring-shadow);\n}\n","import type { ChangeEvent, InputHTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic } from '../TguiProvider';\nimport styles from './Radio.module.css';\n\nexport interface RadioProps extends InputHTMLAttributes<HTMLInputElement> {\n ref?: Ref<HTMLInputElement>;\n}\n\nexport function Radio({ ref, disabled, className, style, onChange, ...rest }: RadioProps) {\n const haptic = useHaptic();\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n haptic('select');\n onChange?.(event);\n };\n\n return (\n <span\n data-slot=\"radio\"\n className={cn(styles.radio, className)}\n style={style}\n data-disabled={disabled || undefined}\n >\n <input\n ref={ref}\n type=\"radio\"\n data-slot=\"radio-input\"\n className={styles.input}\n disabled={disabled}\n onChange={handleChange}\n {...rest}\n />\n <span className={styles.dot} data-slot=\"radio-indicator\" aria-hidden />\n </span>\n );\n}\n\nRadio.displayName = 'Radio';\n",".rating {\n position: relative;\n display: inline-flex;\n width: max-content;\n}\n\n.row {\n display: flex;\n gap: 2px;\n}\n\n.empty {\n color: color-mix(in srgb, var(--tgui--rating-color, #f5a623) 22%, transparent);\n}\n\n.fill {\n position: absolute;\n inset: 0;\n pointer-events: none;\n color: var(--tgui--rating-color, #f5a623);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .fill {\n transition: clip-path 0.15s ease-out;\n }\n}\n\n.star {\n display: block;\n width: 1em;\n height: 1em;\n padding: 0;\n border: 0;\n background: transparent;\n color: inherit;\n font-size: 24px;\n line-height: 0;\n}\n\n.rating[data-interactive] .star {\n cursor: pointer;\n}\n\n.rating[data-interactive]:not([data-disabled]) .star:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n border-radius: 4px;\n}\n\n.star svg {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n.rating[data-disabled] {\n opacity: 0.4;\n}\n","'use client';\n\nimport {\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n type Ref,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic } from '../TguiProvider';\nimport styles from './Rating.module.css';\n\nconst DefaultStar = (\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden>\n <path d=\"M12 2l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.8 5.9 20.4l1.4-6.8L2.2 9.1l6.9-.8z\" />\n </svg>\n);\n\nexport interface RatingProps {\n ref?: Ref<HTMLDivElement>;\n value?: number;\n defaultValue?: number;\n onValueChange?: (value: number) => void;\n count?: number;\n readOnly?: boolean;\n disabled?: boolean;\n icon?: ReactNode;\n name?: string;\n 'aria-label'?: string;\n className?: string;\n}\n\nexport function Rating({\n ref,\n value: valueProp,\n defaultValue = 0,\n onValueChange,\n count = 5,\n readOnly = false,\n disabled = false,\n icon = DefaultStar,\n name,\n 'aria-label': ariaLabel = 'Rating',\n className,\n}: RatingProps) {\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n const value = valueProp ?? uncontrolled;\n const [hovered, setHovered] = useState<number | null>(null);\n\n const interactive = !readOnly && !disabled;\n const shown = hovered ?? value;\n const pct = Math.max(0, Math.min(1, shown / count)) * 100;\n const haptic = useHaptic();\n\n const set = (next: number) => {\n if (!interactive || next === value) return;\n haptic('select');\n if (valueProp == null) setUncontrolled(next);\n onValueChange?.(next);\n };\n\n const onKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n if (!interactive) return;\n if (event.key === 'ArrowRight' || event.key === 'ArrowUp') {\n event.preventDefault();\n set(Math.min(count, Math.round(value) + 1));\n } else if (event.key === 'ArrowLeft' || event.key === 'ArrowDown') {\n event.preventDefault();\n set(Math.max(0, Math.round(value) - 1));\n }\n };\n\n const stars = Array.from({ length: count }, (_, i) => i + 1);\n\n const interactiveHandlers = interactive\n ? { onKeyDown, onMouseLeave: () => setHovered(null) }\n : {};\n\n const role = interactive ? 'radiogroup' : 'img';\n const label = interactive ? ariaLabel : `${ariaLabel}: ${value} out of ${count}`;\n\n return (\n // biome-ignore lint/a11y/useAriaPropsSupportedByRole: role is radiogroup or img, both support aria-label\n <div\n ref={ref}\n data-slot=\"rating\"\n data-interactive={interactive || undefined}\n className={cn(styles.rating, className)}\n data-disabled={disabled || undefined}\n role={role}\n aria-label={label}\n {...interactiveHandlers}\n >\n <div className={cn(styles.row, styles.empty)} aria-hidden={!interactive}>\n {stars.map((star) =>\n interactive ? (\n // biome-ignore lint/a11y/useSemanticElements: a button in a radiogroup is the rating ARIA pattern; a native radio can't hold the icon\n <button\n key={star}\n type=\"button\"\n role=\"radio\"\n aria-checked={Math.round(value) === star}\n aria-label={`${star}`}\n tabIndex={star === (Math.round(value) || 1) ? 0 : -1}\n name={name}\n data-slot=\"rating-star\"\n className={styles.star}\n onClick={() => set(star)}\n onMouseEnter={() => setHovered(star)}\n onFocus={() => setHovered(star)}\n onBlur={() => setHovered(null)}\n >\n {icon}\n </button>\n ) : (\n <span key={star} data-slot=\"rating-star\" className={styles.star}>\n {icon}\n </span>\n ),\n )}\n </div>\n <div className={styles.fill} style={{ clipPath: `inset(0 ${100 - pct}% 0 0)` }} aria-hidden>\n <div className={styles.row}>\n {stars.map((star) => (\n <span key={star} data-slot=\"rating-star\" className={styles.star}>\n {icon}\n </span>\n ))}\n </div>\n </div>\n </div>\n );\n}\n\nRating.displayName = 'Rating';\n",".bar {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n}\n\n.field {\n position: relative;\n display: flex;\n align-items: center;\n flex: 1;\n min-width: 0;\n height: var(--tgui--field-min-height);\n padding: 0 var(--tgui--field-padding-x);\n border-radius: var(--tgui--field-radius);\n background: var(--tgui--fill);\n}\n\n.icon {\n flex-shrink: 0;\n margin-inline-end: var(--tgui--field-gap);\n color: var(--tgui--label-secondary);\n}\n\n.input {\n flex: 1;\n min-width: 0;\n height: 100%;\n margin: 0;\n padding: 0;\n border: 0;\n outline: 0;\n background: transparent;\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 16px;\n}\n\n.input::placeholder {\n color: var(--tgui--label-tertiary);\n}\n\n.input::-webkit-search-cancel-button,\n.input::-webkit-search-decoration {\n appearance: none;\n}\n\n.clear {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n margin-inline-start: 4px;\n padding: 0;\n border: 0;\n border-radius: 50%;\n color: var(--tgui--label-secondary);\n background: transparent;\n cursor: pointer;\n}\n\n.clear:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n.cancel {\n flex-shrink: 0;\n overflow: hidden;\n max-width: 0;\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--tgui--link-strong);\n font-family: var(--tgui--font-family);\n font-size: 16px;\n white-space: nowrap;\n cursor: pointer;\n opacity: 0;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .cancel {\n transition:\n opacity 0.2s ease,\n max-width 0.2s ease;\n }\n}\n\n.cancel:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n.bar[data-focused] .cancel {\n max-width: 80px;\n opacity: 1;\n}\n","'use client';\n\nimport {\n type ChangeEvent,\n type HTMLAttributes,\n type MouseEvent,\n type Ref,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './SearchBar.module.css';\n\nexport interface SearchBarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {\n ref?: Ref<HTMLDivElement>;\n value: string;\n onChange: (value: string) => void;\n placeholder?: string;\n onCancel?: () => void;\n label?: string;\n}\n\nconst preventFocusLoss = (event: MouseEvent<HTMLButtonElement>) => event.preventDefault();\n\nexport function SearchBar({\n ref,\n value,\n onChange,\n placeholder = 'Search',\n onCancel,\n label = 'Search',\n className,\n ...rest\n}: SearchBarProps) {\n const inputRef = useRef<HTMLInputElement | null>(null);\n const [focused, setFocused] = useState(false);\n\n const handleClear = () => {\n onChange('');\n inputRef.current?.focus();\n };\n\n const handleCancel = () => {\n onCancel?.();\n inputRef.current?.blur();\n };\n\n return (\n <div\n ref={ref}\n data-slot=\"search-bar\"\n data-focused={focused || undefined}\n className={cn(styles.bar, className)}\n {...rest}\n >\n <div data-slot=\"search-bar-field\" className={styles.field}>\n <svg\n data-slot=\"search-bar-icon\"\n className={styles.icon}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden\n >\n <circle cx=\"7\" cy=\"7\" r=\"5.25\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path\n d=\"M11.5 11.5L14.5 14.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n <input\n ref={inputRef}\n type=\"search\"\n data-slot=\"search-bar-input\"\n className={styles.input}\n value={value}\n placeholder={placeholder}\n aria-label={label}\n onChange={(event: ChangeEvent<HTMLInputElement>) => onChange(event.target.value)}\n onFocus={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n />\n {value.length > 0 ? (\n <button\n type=\"button\"\n data-slot=\"search-bar-clear\"\n className={styles.clear}\n aria-label=\"Clear\"\n onMouseDown={preventFocusLoss}\n onClick={handleClear}\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden>\n <circle cx=\"7\" cy=\"7\" r=\"7\" fill=\"currentColor\" opacity=\"0.15\" />\n <path\n d=\"M4.5 4.5l5 5M9.5 4.5l-5 5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.4\"\n strokeLinecap=\"round\"\n />\n </svg>\n </button>\n ) : null}\n </div>\n {onCancel != null ? (\n <button\n type=\"button\"\n data-slot=\"search-bar-cancel\"\n className={styles.cancel}\n tabIndex={focused ? 0 : -1}\n onMouseDown={preventFocusLoss}\n onClick={handleCancel}\n >\n Cancel\n </button>\n ) : null}\n </div>\n );\n}\n\nSearchBar.displayName = 'SearchBar';\n",".body {\n display: flex;\n flex-direction: column;\n}\n\n/* row separators run the full card width – flush to the card edge, never inset to the content */\n.body > hr {\n margin-inline: 0;\n}\n\n.sectionBase .bodyWithHeader {\n background: var(--tgui--surface-bg);\n box-shadow: var(--tgui--shadow-sm);\n}\n\n.sectionIos .body {\n border-radius: var(--tgui--radius);\n background: var(--tgui--surface-bg);\n}\n\n.sectionIos .body > :first-child {\n border-radius: var(--tgui--radius) var(--tgui--radius) 0 0;\n}\n\n.sectionIos .body > :last-child {\n border-radius: 0 0 var(--tgui--radius) var(--tgui--radius);\n}\n\n.sectionIos .body > :only-child {\n border-radius: var(--tgui--radius);\n}\n\n.header {\n padding: 20px 24px 4px 22px;\n color: var(--tgui--label-secondary);\n}\n\n.headerLarge {\n padding-inline-start: 24px;\n color: var(--tgui--label);\n}\n\n.headerIos {\n padding: 16px 16px 8px;\n color: var(--tgui--label-secondary);\n}\n\n.headerIos.headerLarge {\n padding: 0 0 12px;\n color: var(--tgui--label);\n}\n\n.footer {\n padding: 12px 24px;\n}\n\n.footerIos {\n padding: 8px 16px 0;\n}\n\n.footerCentered {\n padding: 16px 24px 20px;\n text-align: center;\n}\n\n.footerIos.footerCentered {\n padding: 16px 16px 0;\n}\n\n.footerText {\n color: var(--tgui--label-secondary);\n}\n","'use client';\n\nimport type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Caption } from '../Caption';\nimport { Subheadline } from '../Subheadline';\nimport { useTgui } from '../TguiProvider';\nimport styles from './Section.module.css';\n\nexport interface SectionFooterProps extends HTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n centered?: boolean;\n}\n\nfunction FooterText({ ios, children }: { ios: boolean; children: ReactNode }) {\n return ios ? (\n <Caption Component=\"span\" className={styles.footerText}>\n {children}\n </Caption>\n ) : (\n <Subheadline Component=\"span\" level=\"2\" className={styles.footerText}>\n {children}\n </Subheadline>\n );\n}\n\nexport function SectionFooter({\n ref,\n centered = false,\n className,\n children,\n ...rest\n}: SectionFooterProps) {\n const { platform } = useTgui();\n const ios = platform === 'ios';\n\n return (\n <footer\n ref={ref}\n data-slot=\"section-footer\"\n className={cn(\n styles.footer,\n ios && styles.footerIos,\n centered && styles.footerCentered,\n className,\n )}\n {...rest}\n >\n <FooterText ios={ios}>{children}</FooterText>\n </footer>\n );\n}\n\nSectionFooter.displayName = 'SectionFooter';\n","'use client';\n\nimport type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Caption } from '../Caption';\nimport { Subheadline } from '../Subheadline';\nimport { Text } from '../Text';\nimport { useTgui } from '../TguiProvider';\nimport styles from './Section.module.css';\n\nexport interface SectionHeaderProps extends HTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n large?: boolean;\n}\n\nfunction HeaderText({\n ios,\n large,\n children,\n}: {\n ios: boolean;\n large: boolean;\n children: ReactNode;\n}) {\n if (large) {\n return ios ? (\n <Subheadline Component=\"h2\" level=\"1\" weight=\"2\">\n {children}\n </Subheadline>\n ) : (\n <Text Component=\"h2\" weight=\"2\">\n {children}\n </Text>\n );\n }\n return ios ? (\n <Caption Component=\"h2\" caps>\n {children}\n </Caption>\n ) : (\n <Subheadline Component=\"h2\" level=\"2\" weight=\"2\">\n {children}\n </Subheadline>\n );\n}\n\nexport function SectionHeader({\n ref,\n large = false,\n className,\n children,\n ...rest\n}: SectionHeaderProps) {\n const { platform } = useTgui();\n const ios = platform === 'ios';\n\n return (\n <header\n ref={ref}\n data-slot=\"section-header\"\n className={cn(styles.header, ios && styles.headerIos, large && styles.headerLarge, className)}\n {...rest}\n >\n <HeaderText ios={ios} large={large}>\n {children}\n </HeaderText>\n </header>\n );\n}\n\nSectionHeader.displayName = 'SectionHeader';\n","'use client';\n\nimport {\n Children,\n Fragment,\n type HTMLAttributes,\n isValidElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Divider } from '../Divider';\nimport { useTgui } from '../TguiProvider';\nimport styles from './Section.module.css';\nimport { SectionFooter } from './SectionFooter';\nimport { SectionHeader } from './SectionHeader';\n\nexport interface SectionProps extends HTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n header?: ReactNode;\n footer?: ReactNode;\n}\n\nconst isText = (node: ReactNode) => typeof node === 'string' || typeof node === 'number';\n\nexport function Section({ ref, header, footer, className, children, ...rest }: SectionProps) {\n const { platform } = useTgui();\n const rows = Children.toArray(children);\n\n return (\n <section\n ref={ref}\n data-slot=\"section\"\n className={cn(platform === 'ios' ? styles.sectionIos : styles.sectionBase, className)}\n {...rest}\n >\n <div className={styles.bodyWithHeader}>\n {isText(header) ? <SectionHeader>{header}</SectionHeader> : header}\n <div data-slot=\"section-body\" className={styles.body}>\n {rows.map((row, i) => (\n <Fragment key={isValidElement(row) ? row.key : i}>\n {row}\n {i < rows.length - 1 ? <Divider /> : null}\n </Fragment>\n ))}\n </div>\n </div>\n {isText(footer) ? <SectionFooter>{footer}</SectionFooter> : footer}\n </section>\n );\n}\n\nSection.displayName = 'Section';\nSection.Header = SectionHeader;\nSection.Footer = SectionFooter;\n","import { createContext } from 'react';\n\nexport interface SegmentedControlContextValue {\n value: string | undefined;\n select: (value: string) => void;\n}\n\nexport const SegmentedControlContext = createContext<SegmentedControlContextValue | null>(null);\n",".control {\n position: relative;\n display: flex;\n box-sizing: border-box;\n padding: 2px;\n border-radius: 9px;\n background: var(--tgui--accent-fill);\n}\n\n.pill {\n position: absolute;\n top: 2px;\n left: 0;\n bottom: 2px;\n border-radius: 7px;\n background: var(--tgui--surface-bg);\n box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .pill {\n transition:\n transform var(--tgui--duration-fast) var(--tgui--ease-spring),\n width var(--tgui--duration-fast) var(--tgui--ease-spring);\n }\n}\n\n.item {\n position: relative;\n z-index: var(--tgui--z-base, 1);\n flex: 1 1 0;\n min-width: 0;\n padding: 6px 12px;\n border: 0;\n border-radius: 7px;\n background: transparent;\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 14px;\n font-weight: var(--tgui--weight-semibold);\n line-height: 20px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n cursor: pointer;\n transition: color 0.15s ease;\n}\n\n.item:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: calc(-1 * var(--tgui--focus-ring-offset));\n}\n\n.item[data-selected] {\n cursor: default;\n}\n\n.item:disabled {\n opacity: 0.35;\n cursor: default;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .item:not([data-selected]):not(:disabled):hover {\n color: var(--tgui--link-strong);\n }\n}\n","'use client';\n\nimport {\n type HTMLAttributes,\n type MutableRefObject,\n type KeyboardEvent as ReactKeyboardEvent,\n type Ref,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic } from '../TguiProvider';\nimport { SegmentedControlContext } from './context';\nimport styles from './SegmentedControl.module.css';\n\nexport interface SegmentedControlProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue'> {\n ref?: Ref<HTMLDivElement>;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n}\n\nexport function SegmentedControl({\n ref,\n value: valueProp,\n defaultValue,\n onValueChange,\n className,\n children,\n onKeyDown,\n ...rest\n}: SegmentedControlProps) {\n const trackRef = useRef<HTMLDivElement | null>(null);\n const [pill, setPill] = useState<{ left: number; width: number } | null>(null);\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n const value = valueProp ?? uncontrolled;\n const haptic = useHaptic();\n\n const select = useCallback(\n (next: string) => {\n if (next === (valueProp ?? uncontrolled)) return;\n haptic('select');\n if (valueProp == null) setUncontrolled(next);\n onValueChange?.(next);\n },\n [valueProp, uncontrolled, onValueChange, haptic],\n );\n\n const context = useMemo(() => ({ value, select }), [value, select]);\n\n const measure = useCallback(() => {\n const track = trackRef.current;\n if (!track) return;\n const selected = track.querySelector<HTMLElement>('[role=\"radio\"][data-selected]');\n const next = selected ? { left: selected.offsetLeft, width: selected.offsetWidth } : null;\n setPill((prev) => {\n if (prev === next) return prev;\n if (prev && next && prev.left === next.left && prev.width === next.width) return prev;\n return next;\n });\n }, []);\n\n useLayoutEffect(measure);\n\n useEffect(() => {\n const track = trackRef.current;\n if (!track || typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(measure);\n observer.observe(track);\n return () => observer.disconnect();\n }, [measure]);\n\n const setRef = useCallback(\n (node: HTMLDivElement | null) => {\n trackRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [ref],\n );\n\n const handleKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return;\n const track = trackRef.current;\n if (!track) return;\n const radios = Array.from(\n track.querySelectorAll<HTMLButtonElement>('[role=\"radio\"]:not(:disabled)'),\n );\n const current = radios.indexOf(document.activeElement as HTMLButtonElement);\n if (current < 0) return;\n event.preventDefault();\n const delta = event.key === 'ArrowRight' ? 1 : -1;\n const next = radios[(current + delta + radios.length) % radios.length];\n next.focus();\n next.click();\n };\n\n return (\n <SegmentedControlContext.Provider value={context}>\n <div\n ref={setRef}\n role=\"radiogroup\"\n data-slot=\"segmented-control\"\n className={cn(styles.control, className)}\n onKeyDown={handleKeyDown}\n {...rest}\n >\n <div\n className={styles.pill}\n data-slot=\"segmented-control-indicator\"\n style={\n pill ? { transform: `translateX(${pill.left}px)`, width: pill.width } : { opacity: 0 }\n }\n aria-hidden\n />\n {children}\n </div>\n </SegmentedControlContext.Provider>\n );\n}\n\nSegmentedControl.displayName = 'SegmentedControl';\n","'use client';\n\nimport { type ButtonHTMLAttributes, type Ref, useContext } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { SegmentedControlContext } from './context';\nimport styles from './SegmentedControl.module.css';\n\nexport interface SegmentedControlItemProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {\n ref?: Ref<HTMLButtonElement>;\n value?: string;\n selected?: boolean;\n}\n\nexport function SegmentedControlItem({\n ref,\n value,\n selected: selectedProp,\n className,\n onClick,\n ...rest\n}: SegmentedControlItemProps) {\n const ctx = useContext(SegmentedControlContext);\n const selected = selectedProp ?? (ctx != null && value != null && ctx.value === value);\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: a button in a radiogroup is the segmented-control ARIA pattern; a native radio can't hold arbitrary content\n <button\n ref={ref}\n type=\"button\"\n role=\"radio\"\n aria-checked={selected}\n tabIndex={selected ? 0 : -1}\n data-slot=\"segmented-control-item\"\n data-selected={selected || undefined}\n data-state={selected ? 'active' : 'inactive'}\n className={cn(styles.item, className)}\n onClick={(event) => {\n onClick?.(event);\n if (value != null) ctx?.select(value);\n }}\n {...rest}\n />\n );\n}\n\nSegmentedControlItem.displayName = 'SegmentedControlItem';\n",".base {\n position: relative;\n padding: 20px 22px 16px;\n background: var(--tgui--bg);\n}\n\n.row {\n display: block;\n position: relative;\n box-sizing: border-box;\n border-radius: 14px;\n}\n\n.base .row {\n box-shadow: inset 0 0 0 1.5px var(--tgui--separator-opaque);\n}\n\n.ios .row {\n border-radius: 12px;\n background: var(--tgui--fill);\n}\n\n.select {\n appearance: none;\n display: block;\n width: 100%;\n min-height: 48px;\n margin: 0;\n padding: 12px 44px 12px 16px;\n border: 0;\n outline: 0;\n border-radius: inherit;\n background: transparent;\n color: var(--tgui--label);\n}\n\n.chevron {\n position: absolute;\n top: 50%;\n inset-inline-end: 18px;\n width: 8px;\n height: 8px;\n border: solid var(--tgui--label-tertiary);\n border-width: 0 2px 2px 0;\n transform: translateY(-75%) rotate(45deg);\n pointer-events: none;\n}\n\n.header {\n position: absolute;\n top: -7px;\n inset-inline-start: 10px;\n margin: 0;\n max-width: calc(100% - 20px);\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n padding: 0 6px;\n font-size: 13px;\n border-radius: 5px;\n color: var(--tgui--label-secondary);\n background: var(--tgui--bg);\n}\n\n/* iOS filled selects don't show a floating label – keep it for assistive tech */\n.ios .header {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n}\n\n.base[data-state=\"focused\"] .row {\n box-shadow: inset 0 0 0 2px var(--tgui--link);\n}\n\n.base[data-state=\"focused\"] .header {\n color: var(--tgui--link-strong);\n}\n\n.base[data-state=\"error\"] .row {\n box-shadow: inset 0 0 0 2px var(--tgui--destructive);\n}\n\n.base[data-state=\"error\"] .header {\n color: var(--tgui--destructive-strong);\n}\n\n.ios[data-state=\"error\"] .row {\n box-shadow: inset 0 0 0 1.5px var(--tgui--destructive);\n}\n\n.base[data-disabled],\n.ios[data-disabled] {\n pointer-events: none;\n}\n\n.ios[data-disabled] {\n opacity: 0.35;\n}\n","'use client';\n\nimport {\n type FocusEvent,\n type ReactNode,\n type Ref,\n type SelectHTMLAttributes,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport type { InputStatus } from '../Input';\nimport { Subheadline } from '../Subheadline';\nimport { Text } from '../Text';\nimport { useTgui } from '../TguiProvider';\nimport styles from './Select.module.css';\n\nexport interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {\n ref?: Ref<HTMLSelectElement>;\n header?: ReactNode;\n status?: InputStatus;\n}\n\nexport function Select({\n ref,\n header,\n status,\n disabled,\n className,\n onFocus,\n onBlur,\n children,\n ...rest\n}: SelectProps) {\n const { platform } = useTgui();\n const ios = platform === 'ios';\n const [focused, setFocused] = useState(false);\n const state = status ?? (focused ? 'focused' : 'default');\n const Typography = ios ? Text : Subheadline;\n\n const handleFocus = (event: FocusEvent<HTMLSelectElement>) => {\n if (!disabled) setFocused(true);\n onFocus?.(event);\n };\n const handleBlur = (event: FocusEvent<HTMLSelectElement>) => {\n setFocused(false);\n onBlur?.(event);\n };\n\n return (\n <div\n data-slot=\"select\"\n data-state={state}\n data-disabled={disabled || undefined}\n className={cn(ios ? styles.ios : styles.base, className)}\n aria-disabled={disabled || undefined}\n >\n {/* biome-ignore lint/a11y/noLabelWithoutControl: the control is the select rendered below */}\n <label className={styles.row} data-slot=\"select-row\">\n <Typography\n ref={ref as Ref<HTMLElement>}\n Component=\"select\"\n data-slot=\"select-control\"\n className={styles.select}\n disabled={disabled}\n aria-invalid={state === 'error' || undefined}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...rest}\n >\n {children}\n </Typography>\n <span aria-hidden data-slot=\"select-chevron\" className={styles.chevron} />\n {/* names the select; visually hidden on iOS (see FormField) */}\n {header != null ? (\n <span className={styles.header} data-slot=\"select-label\">\n {header}\n </span>\n ) : null}\n </label>\n </div>\n );\n}\n\nSelect.displayName = 'Select';\n","import { useSyncExternalStore } from 'react';\n\nconst QUERY = '(prefers-reduced-motion: reduce)';\n\nfunction subscribe(callback: () => void) {\n if (typeof window === 'undefined' || !window.matchMedia) return () => {};\n const query = window.matchMedia(QUERY);\n query.addEventListener('change', callback);\n return () => query.removeEventListener('change', callback);\n}\n\nfunction getSnapshot() {\n if (typeof window === 'undefined' || !window.matchMedia) return false;\n return window.matchMedia(QUERY).matches;\n}\n\nexport function useReducedMotion() {\n return useSyncExternalStore(subscribe, getSnapshot, () => false);\n}\n",".backdrop {\n position: fixed;\n inset: 0;\n z-index: var(--tgui--z-overlay, 1000);\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n background: rgb(0 0 0 / 0.4);\n opacity: 0;\n}\n\n.backdrop--contained {\n position: absolute;\n}\n\n.backdrop[data-state=\"open\"] {\n opacity: 1;\n}\n\n.panel {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n max-width: 512px;\n max-height: var(--tgui--sheet-max-height, 50%);\n margin: 0 auto;\n border-radius: 16px 16px 0 0;\n /* every surface that appears over the page shares one background */\n background: var(--tgui--surface-bg);\n color: var(--tgui--label);\n box-shadow:\n 0 -0.5px 0 var(--tgui--separator),\n 0 -8px 40px rgb(0 0 0 / 0.4);\n transform: translateY(100%);\n will-change: transform;\n contain: layout;\n}\n\n.panel[data-state=\"open\"] {\n transform: translateY(0);\n}\n\n/* a sheet is edge-anchored – it slides from the edge it lives on, but shares the\n kit's spring easing with every other surface that appears */\n@media (prefers-reduced-motion: no-preference) {\n .backdrop {\n transition: opacity var(--tgui--duration-slow) ease;\n }\n\n .panel {\n transition: transform var(--tgui--duration-slow) var(--tgui--ease-spring);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .backdrop {\n transition: opacity var(--tgui--duration-overlay) linear;\n }\n\n .panel {\n transform: none;\n opacity: 0;\n transition: opacity var(--tgui--duration-overlay) linear;\n }\n\n .panel[data-state=\"open\"] {\n opacity: 1;\n }\n}\n\n.grip {\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n padding-top: 8px;\n touch-action: none;\n cursor: grab;\n}\n\n.handle {\n align-self: center;\n width: 36px;\n height: 4px;\n border-radius: 2px;\n background: var(--tgui--fill-secondary, var(--tgui--fill));\n}\n\n.header {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 12px 20px;\n font-family: var(--tgui--font-family);\n font-size: 20px;\n font-weight: var(--tgui--weight-bold);\n line-height: 1.2;\n}\n\n.title {\n flex: 1;\n min-width: 0;\n}\n\n.close {\n margin-inline-end: -7px;\n color: var(--tgui--label-secondary);\n}\n\n.body {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n overscroll-behavior: contain;\n padding: 4px 20px\n calc(20px + var(--tgui--safe-area-bottom) + var(--tgui--content-safe-area-bottom));\n -webkit-overflow-scrolling: touch;\n}\n\n.grip + .body {\n padding-top: 0;\n}\n","'use client';\n\nimport {\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n type PointerEvent as ReactPointerEvent,\n type Ref,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { getTelegramWebApp } from '../../shared/lib/telegram';\nimport { useReducedMotion } from '../../shared/lib/useReducedMotion';\nimport { IconButton } from '../IconButton';\nimport { Portal } from '../Portal';\nimport styles from './Sheet.module.css';\n\nconst DURATION_MS = 340;\nconst DRAG_THRESHOLD = 6;\nconst DISMISS_DISTANCE = 96;\nconst DISMISS_VELOCITY = 0.5;\n\nexport interface SheetProps {\n ref?: Ref<HTMLDivElement>;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n header?: ReactNode;\n children?: ReactNode;\n dismissable?: boolean;\n closeLabel?: string;\n className?: string;\n container?: Element | DocumentFragment | null;\n}\n\nfunction focusable(root: HTMLElement) {\n return Array.from(\n root.querySelectorAll<HTMLElement>(\n 'a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex=\"-1\"])',\n ),\n ).filter((el) => el.offsetParent !== null || el === document.activeElement);\n}\n\nexport function Sheet({\n ref,\n open,\n onOpenChange,\n header,\n children,\n dismissable = true,\n closeLabel = 'Close',\n className,\n container,\n}: SheetProps) {\n const reducedMotion = useReducedMotion();\n const contained = container != null;\n const [rendered, setRendered] = useState(open);\n const [visible, setVisible] = useState(false);\n\n const panelRef = useRef<HTMLDivElement | null>(null);\n const restoreFocusRef = useRef<HTMLElement | null>(null);\n const drag = useRef({ id: -1, active: false, startY: 0, lastY: 0, lastT: 0, velocity: 0 });\n\n useEffect(() => {\n if (open) {\n setRendered(true);\n return;\n }\n setVisible(false);\n if (reducedMotion) {\n setRendered(false);\n return;\n }\n const id = setTimeout(() => setRendered(false), DURATION_MS);\n return () => clearTimeout(id);\n }, [open, reducedMotion]);\n\n useEffect(() => {\n if (!rendered || !open) return;\n const panel = panelRef.current;\n if (!panel) return;\n // reflow so the browser registers the off-screen start before the class flips\n void panel.offsetHeight;\n setVisible(true);\n }, [rendered, open]);\n\n useEffect(() => {\n if (!rendered) return;\n restoreFocusRef.current = document.activeElement as HTMLElement | null;\n\n const { body, documentElement } = document;\n const previous = { overflow: body.style.overflow, paddingRight: body.style.paddingRight };\n if (!contained) {\n const scrollbar = window.innerWidth - documentElement.clientWidth;\n body.style.overflow = 'hidden';\n if (scrollbar > 0) body.style.paddingRight = `${scrollbar}px`;\n }\n\n const id = requestAnimationFrame(() => panelRef.current?.focus({ preventScroll: true }));\n return () => {\n cancelAnimationFrame(id);\n body.style.overflow = previous.overflow;\n body.style.paddingRight = previous.paddingRight;\n restoreFocusRef.current?.focus?.({ preventScroll: true });\n };\n }, [rendered, contained]);\n\n useEffect(() => {\n if (!rendered) return;\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape' && dismissable) {\n event.stopPropagation();\n onOpenChange(false);\n }\n };\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [rendered, dismissable, onOpenChange]);\n\n // stop Telegram's swipe-to-minimise from fighting the sheet's own drag-to-dismiss\n useEffect(() => {\n if (!rendered) return;\n const webApp = getTelegramWebApp();\n if (typeof webApp?.disableVerticalSwipes !== 'function') return;\n webApp.disableVerticalSwipes();\n return () => webApp.enableVerticalSwipes?.();\n }, [rendered]);\n\n const trapTab = useCallback((event: ReactKeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'Tab' || !panelRef.current) return;\n const items = focusable(panelRef.current);\n if (items.length === 0) {\n event.preventDefault();\n panelRef.current.focus();\n return;\n }\n const first = items[0];\n const last = items[items.length - 1];\n const active = document.activeElement;\n if (event.shiftKey && (active === first || active === panelRef.current)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && active === last) {\n event.preventDefault();\n first.focus();\n }\n }, []);\n\n const onPointerDown = (event: ReactPointerEvent<HTMLDivElement>) => {\n if (!dismissable || event.button !== 0 || reducedMotion) return;\n if ((event.target as HTMLElement).closest('button')) return;\n drag.current = {\n id: event.pointerId,\n active: false,\n startY: event.clientY,\n lastY: event.clientY,\n lastT: event.timeStamp,\n velocity: 0,\n };\n };\n\n const onPointerMove = (event: ReactPointerEvent<HTMLDivElement>) => {\n const state = drag.current;\n if (state.id !== event.pointerId) return;\n const delta = event.clientY - state.startY;\n if (!state.active) {\n if (delta < DRAG_THRESHOLD) return;\n state.active = true;\n event.currentTarget.setPointerCapture(event.pointerId);\n if (panelRef.current) panelRef.current.style.transition = 'none';\n }\n const dt = event.timeStamp - state.lastT;\n if (dt >= 1) {\n const instant = (event.clientY - state.lastY) / dt;\n state.velocity = state.velocity * 0.6 + instant * 0.4;\n state.lastY = event.clientY;\n state.lastT = event.timeStamp;\n }\n if (panelRef.current) {\n panelRef.current.style.transform = `translateY(${Math.max(0, delta)}px)`;\n }\n };\n\n const endDrag = (event: ReactPointerEvent<HTMLDivElement>) => {\n const state = drag.current;\n if (state.id !== event.pointerId) return;\n drag.current = { ...state, id: -1, active: false };\n if (!state.active) return;\n event.currentTarget.releasePointerCapture?.(event.pointerId);\n\n const panel = panelRef.current;\n const travelled = event.clientY - state.startY;\n const dismiss = travelled > DISMISS_DISTANCE || state.velocity > DISMISS_VELOCITY;\n\n if (panel) {\n panel.style.transition = '';\n panel.getBoundingClientRect();\n panel.style.transform = '';\n }\n if (dismiss) {\n setVisible(false);\n onOpenChange(false);\n }\n };\n\n if (!rendered) return null;\n\n const showPanel = visible && open;\n\n return (\n <Portal container={container}>\n <div\n ref={ref}\n data-slot=\"sheet-overlay\"\n data-state={showPanel ? 'open' : 'closed'}\n className={cn(styles.backdrop, contained && styles['backdrop--contained'])}\n onPointerDown={(event) => {\n if (event.target === event.currentTarget && dismissable) onOpenChange(false);\n }}\n >\n <div\n ref={panelRef}\n role=\"dialog\"\n aria-modal=\"true\"\n tabIndex={-1}\n data-slot=\"sheet-content\"\n data-state={showPanel ? 'open' : 'closed'}\n className={cn(styles.panel, className)}\n onKeyDown={trapTab}\n >\n <div\n data-slot=\"sheet-grip\"\n className={styles.grip}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={endDrag}\n onPointerCancel={endDrag}\n >\n {dismissable ? (\n <span data-slot=\"sheet-handle\" className={styles.handle} aria-hidden />\n ) : null}\n {header != null ? (\n <div data-slot=\"sheet-header\" className={styles.header}>\n <div data-slot=\"sheet-title\" className={styles.title}>\n {header}\n </div>\n {dismissable ? (\n <IconButton\n mode=\"gray\"\n size=\"s\"\n circle\n data-slot=\"sheet-close\"\n className={styles.close}\n aria-label={closeLabel}\n onClick={() => onOpenChange(false)}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden>\n <path\n d=\"M4 4l8 8M12 4l-8 8\"\n stroke=\"currentColor\"\n strokeWidth=\"1.6\"\n strokeLinecap=\"round\"\n />\n </svg>\n </IconButton>\n ) : null}\n </div>\n ) : null}\n </div>\n <div data-slot=\"sheet-body\" className={styles.body}>\n {children}\n </div>\n </div>\n </div>\n </Portal>\n );\n}\n\nSheet.displayName = 'Sheet';\n",".skeleton {\n display: block;\n}\n\n.skeleton[data-state=\"loading\"] {\n position: relative;\n overflow: hidden;\n min-height: 1em;\n border-radius: 8px;\n background: var(--tgui--fill);\n color: transparent;\n pointer-events: none;\n}\n\n.skeleton[data-state=\"loading\"] * {\n visibility: hidden;\n}\n\n.skeleton[data-state=\"loading\"]::after {\n content: \"\";\n position: absolute;\n inset: 0;\n transform: translateX(-100%);\n background: linear-gradient(\n 90deg,\n transparent,\n color-mix(in srgb, var(--tgui--label) 5%, transparent),\n transparent\n );\n animation: tgui-skeleton 1.5s ease-in-out infinite;\n}\n\n@keyframes tgui-skeleton {\n to {\n transform: translateX(100%);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .skeleton[data-state=\"loading\"]::after {\n animation: none;\n }\n}\n\n@media (prefers-reduced-transparency: reduce) {\n .skeleton[data-state=\"loading\"] {\n background: var(--tgui--fill);\n }\n}\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Skeleton.module.css';\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n visible?: boolean;\n children?: ReactNode;\n}\n\nexport function Skeleton({ ref, visible = true, className, children, ...rest }: SkeletonProps) {\n return (\n <div\n ref={ref}\n data-slot=\"skeleton\"\n data-state={visible ? 'loading' : 'loaded'}\n aria-hidden={visible || undefined}\n className={cn(styles.skeleton, className)}\n {...rest}\n >\n {children}\n </div>\n );\n}\n\nSkeleton.displayName = 'Skeleton';\n",".slider {\n display: flex;\n align-items: center;\n gap: 12px;\n width: 100%;\n}\n\n.track {\n position: relative;\n flex: 1;\n height: 28px;\n display: flex;\n align-items: center;\n}\n\n.rail {\n position: absolute;\n left: 0;\n right: 0;\n height: 4px;\n border-radius: 2px;\n background: var(--tgui--accent-fill);\n}\n\n.fill {\n position: absolute;\n left: 0;\n height: 4px;\n border-radius: 2px;\n background: var(--tgui--link);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .fill {\n transition: width 0.1s linear;\n }\n}\n\n.input {\n position: relative;\n z-index: 1;\n width: 100%;\n height: 28px;\n margin: 0;\n padding: 0;\n background: transparent;\n appearance: none;\n cursor: pointer;\n}\n\n.input:focus-visible {\n outline: none;\n}\n\n.input::-webkit-slider-thumb {\n appearance: none;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: var(--tgui--white);\n box-shadow: 0 1px 4px rgb(0 0 0 / 0.25);\n cursor: grab;\n}\n\n.input:active::-webkit-slider-thumb {\n cursor: grabbing;\n}\n\n.input::-moz-range-thumb {\n width: 22px;\n height: 22px;\n border: 0;\n border-radius: 50%;\n background: var(--tgui--white);\n box-shadow: 0 1px 4px rgb(0 0 0 / 0.25);\n}\n\n.input:focus-visible::-webkit-slider-thumb {\n box-shadow:\n 0 1px 4px rgb(0 0 0 / 0.25),\n var(--tgui--focus-ring-shadow);\n}\n\n.input:focus-visible::-moz-range-thumb {\n box-shadow:\n 0 1px 4px rgb(0 0 0 / 0.25),\n var(--tgui--focus-ring-shadow);\n}\n\n.input:disabled {\n cursor: default;\n}\n\n.slider[data-disabled] {\n opacity: 0.4;\n}\n\n.side {\n flex-shrink: 0;\n color: var(--tgui--label-secondary);\n font-family: var(--tgui--font-family);\n font-size: 14px;\n}\n","'use client';\n\nimport {\n type ChangeEvent,\n type InputHTMLAttributes,\n type ReactNode,\n type Ref,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic } from '../TguiProvider';\nimport styles from './Slider.module.css';\n\nexport interface SliderProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onChange'> {\n ref?: Ref<HTMLInputElement>;\n value?: number;\n defaultValue?: number;\n onValueChange?: (value: number) => void;\n min?: number;\n max?: number;\n step?: number;\n before?: ReactNode;\n after?: ReactNode;\n}\n\nexport function Slider({\n ref,\n value: valueProp,\n defaultValue,\n onValueChange,\n min = 0,\n max = 100,\n step = 1,\n before,\n after,\n disabled,\n className,\n ...rest\n}: SliderProps) {\n const [uncontrolled, setUncontrolled] = useState(defaultValue ?? min);\n const value = valueProp ?? uncontrolled;\n const percent = max > min ? ((value - min) / (max - min)) * 100 : 0;\n const haptic = useHaptic();\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const next = Number(event.target.value);\n if (next !== value) haptic('select');\n if (valueProp == null) setUncontrolled(next);\n onValueChange?.(next);\n };\n\n return (\n <div\n data-slot=\"slider\"\n className={cn(styles.slider, className)}\n data-disabled={disabled || undefined}\n >\n {before != null ? (\n <span data-slot=\"slider-before\" className={styles.side}>\n {before}\n </span>\n ) : null}\n <span data-slot=\"slider-track\" className={styles.track}>\n <span data-slot=\"slider-rail\" className={styles.rail} />\n <span\n data-slot=\"slider-range\"\n className={styles.fill}\n style={{ width: `${Math.max(0, Math.min(100, percent))}%` }}\n />\n <input\n ref={ref}\n type=\"range\"\n data-slot=\"slider-input\"\n className={styles.input}\n min={min}\n max={max}\n step={step}\n value={value}\n disabled={disabled}\n onChange={handleChange}\n {...rest}\n />\n </span>\n {after != null ? (\n <span data-slot=\"slider-after\" className={styles.side}>\n {after}\n </span>\n ) : null}\n </div>\n );\n}\n\nSlider.displayName = 'Slider';\n","import type { ReactNode } from 'react';\nimport { createContext } from 'react';\n\nexport interface SnackbarOptions {\n message: ReactNode;\n description?: ReactNode;\n before?: ReactNode;\n action?: { label: string; onClick: () => void };\n duration?: number;\n}\n\nexport interface SnackbarApi {\n show: (options: SnackbarOptions) => string;\n dismiss: (id: string) => void;\n}\n\nexport const SnackbarContext = createContext<SnackbarApi | null>(null);\n\nSnackbarContext.displayName = 'SnackbarContext';\n",".viewport {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: var(--tgui--z-overlay, 1000);\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n padding: 12px;\n padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));\n overflow: clip;\n overflow-clip-margin: 28px;\n pointer-events: none;\n}\n\n.snackbar {\n display: flex;\n align-items: center;\n gap: 12px;\n width: 100%;\n max-width: 440px;\n box-sizing: border-box;\n padding: 12px 16px;\n border-radius: 12px;\n /* every surface that appears over the page shares one background */\n background: var(--tgui--surface-bg);\n color: var(--tgui--label);\n box-shadow:\n 0 0 0 0.5px var(--tgui--separator),\n 0 6px 24px rgb(0 0 0 / 0.4);\n pointer-events: auto;\n touch-action: pan-y;\n opacity: 0;\n transform: translateY(16px);\n}\n\n.snackbar[data-state=\"open\"] {\n opacity: 1;\n transform: translateY(0);\n}\n\n/* a toast is edge-anchored – it slides up from the screen edge, sharing the\n kit's spring easing with every other surface that appears */\n@media (prefers-reduced-motion: no-preference) {\n .snackbar {\n transition:\n opacity var(--tgui--duration-fast) ease,\n transform var(--tgui--duration-fast) var(--tgui--ease-spring);\n }\n}\n\n.snackbar--dragging {\n transition: none;\n}\n\n.before {\n display: flex;\n flex-shrink: 0;\n color: var(--tgui--link-strong);\n}\n\n.body {\n display: flex;\n flex-direction: column;\n gap: 2px;\n flex: 1;\n min-width: 0;\n font-family: var(--tgui--font-family);\n}\n\n.message {\n font-size: 15px;\n line-height: 20px;\n}\n\n.description {\n font-size: 13px;\n line-height: 18px;\n color: var(--tgui--label-secondary);\n}\n\n.action {\n flex-shrink: 0;\n padding: 4px 8px;\n margin-inline-end: -8px;\n border: 0;\n border-radius: 8px;\n background: transparent;\n color: var(--tgui--link-strong);\n font-family: var(--tgui--font-family);\n font-size: 15px;\n font-weight: var(--tgui--weight-semibold);\n cursor: pointer;\n}\n\n.action:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: calc(-1 * var(--tgui--focus-ring-offset));\n}\n","'use client';\n\nimport {\n type ReactNode,\n type PointerEvent as ReactPointerEvent,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useReducedMotion } from '../../shared/lib/useReducedMotion';\nimport { Portal } from '../Portal';\nimport { SnackbarContext, type SnackbarOptions } from './context';\nimport styles from './Snackbar.module.css';\n\nconst EXIT_MS = 240;\nconst SWIPE_DISMISS = 80;\n\ninterface SnackItem extends SnackbarOptions {\n id: string;\n}\n\nexport interface SnackbarProviderProps {\n children: ReactNode;\n duration?: number;\n max?: number;\n}\n\nexport function SnackbarProvider({ children, duration = 4000, max = 3 }: SnackbarProviderProps) {\n const [items, setItems] = useState<SnackItem[]>([]);\n const nextId = useRef(0);\n\n const dismiss = useCallback((id: string) => {\n setItems((current) => current.filter((item) => item.id !== id));\n }, []);\n\n const show = useCallback(\n (options: SnackbarOptions) => {\n const id = `snackbar-${nextId.current++}`;\n setItems((current) => [...current, { ...options, id }].slice(-max));\n return id;\n },\n [max],\n );\n\n const api = useMemo(() => ({ show, dismiss }), [show, dismiss]);\n\n return (\n <SnackbarContext.Provider value={api}>\n {children}\n {items.length > 0 ? (\n <Portal>\n <div data-slot=\"snackbar-viewport\" className={styles.viewport}>\n {items.map((item) => (\n <SnackbarItem\n key={item.id}\n item={item}\n defaultDuration={duration}\n onDismiss={() => dismiss(item.id)}\n />\n ))}\n </div>\n </Portal>\n ) : null}\n </SnackbarContext.Provider>\n );\n}\n\nSnackbarProvider.displayName = 'SnackbarProvider';\n\ninterface SnackbarItemProps {\n item: SnackItem;\n defaultDuration: number;\n onDismiss: () => void;\n}\n\nfunction SnackbarItem({ item, defaultDuration, onDismiss }: SnackbarItemProps) {\n const reducedMotion = useReducedMotion();\n const [visible, setVisible] = useState(false);\n const [leaving, setLeaving] = useState(false);\n const nodeRef = useRef<HTMLDivElement | null>(null);\n\n const duration = item.duration ?? defaultDuration;\n const remaining = useRef(duration);\n const startedAt = useRef(0);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const drag = useRef({ id: -1, startX: 0, active: false });\n\n useLayoutEffect(() => {\n const node = nodeRef.current;\n if (node) void node.offsetHeight;\n setVisible(true);\n }, []);\n\n const close = useCallback(() => {\n setLeaving(true);\n setVisible(false);\n if (reducedMotion) {\n onDismiss();\n return;\n }\n const id = setTimeout(onDismiss, EXIT_MS);\n return () => clearTimeout(id);\n }, [reducedMotion, onDismiss]);\n\n const pause = useCallback(() => {\n if (!timer.current) return;\n clearTimeout(timer.current);\n timer.current = null;\n remaining.current -= Date.now() - startedAt.current;\n }, []);\n\n const resume = useCallback(() => {\n if (duration <= 0 || leaving || timer.current) return;\n startedAt.current = Date.now();\n timer.current = setTimeout(() => close(), Math.max(0, remaining.current));\n }, [duration, leaving, close]);\n\n useEffect(() => {\n resume();\n return pause;\n }, [resume, pause]);\n\n const onPointerDown = (event: ReactPointerEvent<HTMLDivElement>) => {\n if (event.button !== 0) return;\n drag.current = { id: event.pointerId, startX: event.clientX, active: false };\n pause();\n };\n\n const onPointerMove = (event: ReactPointerEvent<HTMLDivElement>) => {\n const state = drag.current;\n if (state.id !== event.pointerId) return;\n const dx = event.clientX - state.startX;\n if (!state.active) {\n if (Math.abs(dx) < 6) return;\n state.active = true;\n event.currentTarget.setPointerCapture(event.pointerId);\n nodeRef.current?.classList.add(styles['snackbar--dragging']);\n }\n if (nodeRef.current) {\n nodeRef.current.style.transform = `translateX(${dx}px)`;\n nodeRef.current.style.opacity = `${Math.max(0, 1 - Math.abs(dx) / 240)}`;\n }\n };\n\n const endDrag = (event: ReactPointerEvent<HTMLDivElement>) => {\n const state = drag.current;\n if (state.id !== event.pointerId) return;\n drag.current = { id: -1, startX: 0, active: false };\n const node = nodeRef.current;\n if (!node) return;\n node.classList.remove(styles['snackbar--dragging']);\n const dx = event.clientX - state.startX;\n if (state.active && Math.abs(dx) > SWIPE_DISMISS) {\n if (reducedMotion) {\n onDismiss();\n return;\n }\n node.style.transition = 'transform 0.2s ease-out, opacity 0.2s ease-out';\n node.style.transform = `translateX(${Math.sign(dx) * (window.innerWidth || 400)}px)`;\n node.style.opacity = '0';\n setTimeout(onDismiss, 190);\n return;\n }\n node.style.transform = '';\n node.style.opacity = '';\n resume();\n };\n\n return (\n <div\n ref={nodeRef}\n data-slot=\"snackbar\"\n data-state={visible && !leaving ? 'open' : 'closed'}\n className={styles.snackbar}\n role=\"status\"\n onMouseEnter={pause}\n onMouseLeave={resume}\n onFocus={pause}\n onBlur={resume}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={endDrag}\n onPointerCancel={endDrag}\n >\n {item.before != null ? (\n <span data-slot=\"snackbar-before\" className={styles.before}>\n {item.before}\n </span>\n ) : null}\n <div data-slot=\"snackbar-body\" className={styles.body}>\n <span data-slot=\"snackbar-message\" className={styles.message}>\n {item.message}\n </span>\n {item.description != null ? (\n <span data-slot=\"snackbar-description\" className={styles.description}>\n {item.description}\n </span>\n ) : null}\n </div>\n {item.action != null ? (\n <button\n type=\"button\"\n data-slot=\"snackbar-action\"\n className={styles.action}\n onClick={() => {\n item.action?.onClick();\n close();\n }}\n >\n {item.action.label}\n </button>\n ) : null}\n </div>\n );\n}\n","import { useContext } from 'react';\nimport { type SnackbarApi, SnackbarContext } from './context';\n\nexport function useSnackbar(): SnackbarApi {\n const api = useContext(SnackbarContext);\n if (!api) {\n throw new Error('useSnackbar must be used within a <SnackbarProvider>.');\n }\n return api;\n}\n","export interface Particle {\n x0: number;\n y0: number;\n vx: number;\n vy: number;\n life: number;\n respawn: number;\n phase: number;\n size: number;\n square: boolean;\n}\n\nconst TAU = Math.PI * 2;\nconst clamp01 = (value: number) => Math.max(0, Math.min(1, value));\nconst easeOutCubic = (t: number) => 1 - (1 - t) ** 3;\n\n// particle grows in over `up` seconds, holds, shrinks over `down` seconds\nfunction trapezoid(life: number, up: number, down: number, t: number) {\n const hold = Math.max(up, life - down);\n if (t < up) return Math.max(0, t / up);\n if (t > hold) return Math.max(0, 1 - (t - hold) / (life - hold));\n return 1;\n}\n\nexport function createParticles(w: number, h: number, density: number): Particle[] {\n const count = Math.round(Math.min(1800, Math.max(12, density * w * h)));\n const particles: Particle[] = [];\n for (let i = 0; i < count; i += 1) {\n const speed = 2 + Math.random() * 10;\n const angle = Math.random() * TAU;\n const life = 0.3 + Math.random() * 1.2;\n const respawn = Math.random();\n particles.push({\n x0: Math.random() * w,\n y0: Math.random() * h,\n vx: speed * Math.cos(angle),\n vy: speed * Math.sin(angle),\n life,\n respawn,\n phase: Math.random() * (life + respawn),\n size: 1 + Math.random() * 0.7,\n square: Math.random() > 0.5,\n });\n }\n return particles;\n}\n\n// paints one frame; `stop` is the loop time (s) at which the reveal began, or null\nexport function paintParticles(\n ctx: CanvasRenderingContext2D,\n pixelW: number,\n pixelH: number,\n dpr: number,\n particles: Particle[],\n color: readonly [number, number, number],\n time: number,\n stop: number | null,\n fade: number,\n) {\n ctx.clearRect(0, 0, pixelW, pixelH);\n const w = pixelW / dpr;\n const h = pixelH / dpr;\n const [r, g, b] = color;\n const n = particles.length;\n\n for (let i = 0; i < n; i += 1) {\n const p = particles[i];\n const period = p.life + p.respawn;\n\n if (stop != null) {\n const spawned = Math.floor((time + p.phase) / period);\n const lastAllowed = Math.floor((stop + p.phase) / period);\n if (spawned > lastAllowed) continue;\n }\n\n const local = (time + p.phase) % period;\n if (local >= p.life) continue;\n\n let x = (p.x0 + p.vx * local) % w;\n if (x < 0) x += w;\n let y = (p.y0 + p.vy * local) % h;\n if (y < 0) y += h;\n\n const visible = trapezoid(p.life, 0.15, 0.3, local);\n let alpha = visible * (0.45 + 0.55 * (1 - local / p.life));\n\n if (stop != null && fade > 0) {\n const fadeStart = stop + ((2 / 3) * fade * i) / n;\n const progress = clamp01((time - fadeStart) / ((1 / 3) * fade));\n alpha *= easeOutCubic(1 - progress);\n }\n\n if (alpha <= 0.01) continue;\n\n const size = Math.max(0.5, p.size * visible) * dpr;\n ctx.fillStyle = `rgba(${r}, ${g}, ${b}, ${alpha.toFixed(3)})`;\n ctx.beginPath();\n if (p.square) {\n ctx.rect(x * dpr, y * dpr, size, size);\n } else {\n ctx.arc(x * dpr, y * dpr, size / 2, 0, TAU);\n }\n ctx.fill();\n }\n}\n",".spoiler {\n --tgui--spoiler-p: 0;\n --tgui--spoiler-edge: 10px;\n --tgui--spoiler-edge-y: 3px;\n --tgui--spoiler-radius: 5px;\n position: relative;\n display: inline-block;\n max-width: 100%;\n border-radius: 4px;\n vertical-align: baseline;\n isolation: isolate;\n color: var(--tgui--label);\n}\n\n.spoiler[data-state=\"closed\"] {\n cursor: pointer;\n}\n\n.spoiler::before,\n.canvas {\n border-radius: var(--tgui--spoiler-radius);\n overflow: hidden;\n -webkit-mask-image:\n linear-gradient(\n to right,\n transparent,\n #000 var(--tgui--spoiler-edge),\n #000 calc(100% - var(--tgui--spoiler-edge)),\n transparent\n ),\n linear-gradient(\n to bottom,\n transparent,\n #000 var(--tgui--spoiler-edge-y),\n #000 calc(100% - var(--tgui--spoiler-edge-y)),\n transparent\n );\n -webkit-mask-composite: source-in;\n mask-image:\n linear-gradient(\n to right,\n transparent,\n #000 var(--tgui--spoiler-edge),\n #000 calc(100% - var(--tgui--spoiler-edge)),\n transparent\n ),\n linear-gradient(\n to bottom,\n transparent,\n #000 var(--tgui--spoiler-edge-y),\n #000 calc(100% - var(--tgui--spoiler-edge-y)),\n transparent\n );\n mask-composite: intersect;\n}\n\n.spoiler::before {\n content: \"\";\n position: absolute;\n inset: -1px -3px;\n z-index: 0;\n background: currentColor;\n opacity: calc((1 - var(--tgui--spoiler-p)) * 0.06);\n pointer-events: none;\n}\n\n.content {\n display: inline-block;\n position: relative;\n z-index: 2;\n opacity: var(--tgui--spoiler-p);\n}\n\n.spoiler[data-state=\"closed\"] .content {\n user-select: none;\n pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .content,\n .spoiler::before {\n transition: opacity 0.4s ease;\n }\n}\n\n.canvas {\n position: absolute;\n inset: -1px -3px;\n z-index: 1;\n width: calc(100% + 6px);\n height: calc(100% + 2px);\n pointer-events: none;\n}\n\n.spoiler:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n","'use client';\n\nimport {\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent as ReactKeyboardEvent,\n type Ref,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useReducedMotion } from '../../shared/lib/useReducedMotion';\nimport { createParticles, type Particle, paintParticles } from './particles';\nimport styles from './Spoiler.module.css';\n\nconst FADE_S = 0.5;\n\nexport interface SpoilerProps extends HTMLAttributes<HTMLSpanElement> {\n ref?: Ref<HTMLSpanElement>;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n revealOn?: 'click' | 'hover';\n accentColor?: string;\n density?: number;\n fps?: number;\n revealLabel?: string;\n}\n\nfunction parseColor(value: string): [number, number, number] {\n const parts = value.match(/-?\\d*\\.?\\d+/g);\n if (!parts || parts.length < 3) return [128, 128, 128];\n return [Number(parts[0]), Number(parts[1]), Number(parts[2])];\n}\n\nexport function Spoiler({\n ref,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n revealOn = 'click',\n accentColor,\n density = 0.1,\n fps = 40,\n revealLabel = 'Reveal hidden text',\n className,\n style,\n children,\n onClick,\n onKeyDown,\n onMouseEnter,\n onMouseLeave,\n ...rest\n}: SpoilerProps) {\n const [uncontrolled, setUncontrolled] = useState(defaultOpen);\n const revealed = openProp ?? uncontrolled;\n const reducedMotion = useReducedMotion();\n const isButton = revealOn === 'click';\n\n const rootRef = useRef<HTMLSpanElement | null>(null);\n const canvasRef = useRef<HTMLCanvasElement | null>(null);\n const particles = useRef<Particle[]>([]);\n const colorRef = useRef<[number, number, number]>([128, 128, 128]);\n const inView = useRef(true);\n const stopAt = useRef<number | null>(revealed ? 0 : null);\n const loopTime = useRef(0);\n\n const [painting, setPainting] = useState(!revealed);\n\n const setRevealed = (next: boolean) => {\n if (next) {\n stopAt.current = loopTime.current;\n } else {\n stopAt.current = null;\n setPainting(true);\n }\n if (openProp == null) setUncontrolled(next);\n onOpenChange?.(next);\n };\n\n useEffect(() => {\n if (!painting) return;\n const root = rootRef.current;\n const canvas = canvasRef.current;\n const ctx = canvas?.getContext('2d');\n if (!root || !canvas || !ctx) return;\n\n const dpr = Math.min(2, window.devicePixelRatio || 1);\n\n const sync = () => {\n const box = canvas.getBoundingClientRect();\n const w = Math.max(1, Math.round(box.width * dpr));\n const h = Math.max(1, Math.round(box.height * dpr));\n if (canvas.width !== w || canvas.height !== h) {\n canvas.width = w;\n canvas.height = h;\n particles.current = createParticles(w / dpr, h / dpr, density);\n }\n colorRef.current = parseColor(accentColor ?? getComputedStyle(root).color);\n };\n sync();\n\n if (reducedMotion) {\n paintParticles(\n ctx,\n canvas.width,\n canvas.height,\n dpr,\n particles.current,\n colorRef.current,\n 0.6,\n null,\n 0,\n );\n return;\n }\n\n let raf = 0;\n let start = 0;\n let last = -1;\n const frameGap = 1000 / Math.max(8, fps);\n\n const loop = (now: number) => {\n if (!start) start = now;\n const time = (now - start) / 1000;\n loopTime.current = time;\n const stop = stopAt.current;\n\n if (stop != null && time > stop + FADE_S + 0.06) {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n setPainting(false);\n return;\n }\n\n raf = requestAnimationFrame(loop);\n if (!inView.current || now - last < frameGap) return;\n last = now;\n\n paintParticles(\n ctx,\n canvas.width,\n canvas.height,\n dpr,\n particles.current,\n colorRef.current,\n time,\n stop,\n FADE_S,\n );\n };\n\n raf = requestAnimationFrame(loop);\n\n const ro = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(sync) : null;\n ro?.observe(root);\n const io =\n typeof IntersectionObserver !== 'undefined'\n ? new IntersectionObserver(([entry]) => {\n inView.current = entry.isIntersecting;\n })\n : null;\n io?.observe(root);\n\n return () => {\n cancelAnimationFrame(raf);\n ro?.disconnect();\n io?.disconnect();\n };\n }, [painting, reducedMotion, density, fps, accentColor]);\n\n const toggle = () => setRevealed(!revealed);\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: a spoiler sits inline inside a sentence; a <button> would break the text flow and reset typography\n <span\n ref={(node) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as { current: HTMLSpanElement | null }).current = node;\n }}\n data-slot=\"spoiler\"\n data-state={revealed ? 'open' : 'closed'}\n className={cn(styles.spoiler, className)}\n role=\"button\"\n tabIndex={0}\n aria-pressed={revealed}\n aria-label={revealed ? undefined : revealLabel}\n style={{ ...style, '--tgui--spoiler-p': revealed ? 1 : 0 } as CSSProperties}\n onClick={(event) => {\n onClick?.(event);\n if (isButton) toggle();\n }}\n onKeyDown={(event: ReactKeyboardEvent<HTMLSpanElement>) => {\n onKeyDown?.(event);\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n toggle();\n }\n }}\n onMouseEnter={(event) => {\n onMouseEnter?.(event);\n if (!isButton && !revealed) setRevealed(true);\n }}\n onMouseLeave={(event) => {\n onMouseLeave?.(event);\n if (!isButton && revealed) setRevealed(false);\n }}\n {...rest}\n >\n <span data-slot=\"spoiler-content\" className={styles.content} aria-hidden={!revealed}>\n {children}\n </span>\n {painting ? (\n <canvas ref={canvasRef} data-slot=\"spoiler-overlay\" className={styles.canvas} aria-hidden />\n ) : null}\n </span>\n );\n}\n\nSpoiler.displayName = 'Spoiler';\n",".stepper {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n}\n\n.value {\n width: 36px;\n margin: 0;\n padding: 0;\n border: 0;\n outline: 0;\n background: transparent;\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 16px;\n text-align: center;\n appearance: textfield;\n}\n\n.value::-webkit-outer-spin-button,\n.value::-webkit-inner-spin-button {\n margin: 0;\n appearance: none;\n}\n\n.value:disabled {\n color: var(--tgui--label-secondary);\n}\n\n.value:focus-visible {\n border-radius: 4px;\n outline: var(--tgui--focus-ring);\n outline-offset: var(--tgui--focus-ring-offset);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .value[data-pulse=\"up\"] {\n animation: pulse-up 0.18s ease-out;\n }\n\n .value[data-pulse=\"down\"] {\n animation: pulse-down 0.18s ease-out;\n }\n}\n\n@keyframes pulse-up {\n from {\n transform: translateY(6px);\n opacity: 0.4;\n }\n}\n\n@keyframes pulse-down {\n from {\n transform: translateY(-6px);\n opacity: 0.4;\n }\n}\n","'use client';\n\nimport {\n type ChangeEvent,\n type HTMLAttributes,\n type KeyboardEvent,\n type Ref,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useReducedMotion } from '../../shared/lib/useReducedMotion';\nimport { IconButton } from '../IconButton';\nimport styles from './Stepper.module.css';\n\nexport interface StepperProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {\n ref?: Ref<HTMLDivElement>;\n value?: number;\n defaultValue?: number;\n onValueChange?: (value: number) => void;\n min?: number;\n max?: number;\n step?: number;\n disabled?: boolean;\n}\n\nconst clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));\n\nconst MinusIcon = () => (\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden>\n <path d=\"M2.5 7h9\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" />\n </svg>\n);\n\nconst PlusIcon = () => (\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden>\n <path d=\"M7 2.5v9M2.5 7h9\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" />\n </svg>\n);\n\nexport function Stepper({\n ref,\n value: valueProp,\n defaultValue,\n onValueChange,\n min = 0,\n max = Number.POSITIVE_INFINITY,\n step = 1,\n disabled = false,\n className,\n ...rest\n}: StepperProps) {\n const reducedMotion = useReducedMotion();\n const [uncontrolled, setUncontrolled] = useState(defaultValue ?? min);\n const value = valueProp ?? uncontrolled;\n const [text, setText] = useState(String(value));\n const [pulse, setPulse] = useState<'up' | 'down' | null>(null);\n const previousValue = useRef(value);\n\n const setValue = (next: number) => {\n if (valueProp == null) setUncontrolled(next);\n onValueChange?.(next);\n };\n\n useEffect(() => {\n setText(String(value));\n if (value !== previousValue.current) {\n if (!reducedMotion) setPulse(value > previousValue.current ? 'up' : 'down');\n previousValue.current = value;\n }\n }, [value, reducedMotion]);\n\n const commit = () => {\n const parsed = Number.parseFloat(text);\n const next = clamp(Number.isNaN(parsed) ? value : parsed, min, max);\n setValue(next);\n setText(String(next));\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key !== 'Enter') return;\n commit();\n event.currentTarget.blur();\n };\n\n return (\n <div ref={ref} data-slot=\"stepper\" className={cn(styles.stepper, className)} {...rest}>\n <IconButton\n mode=\"gray\"\n size=\"s\"\n circle\n data-slot=\"stepper-decrement\"\n aria-label=\"Decrease\"\n disabled={disabled || value <= min}\n onClick={() => setValue(clamp(value - step, min, max))}\n >\n <MinusIcon />\n </IconButton>\n <input\n className={styles.value}\n data-slot=\"stepper-input\"\n type=\"number\"\n inputMode=\"numeric\"\n aria-label=\"Value\"\n value={text}\n disabled={disabled}\n data-pulse={pulse ?? undefined}\n onChange={(event: ChangeEvent<HTMLInputElement>) => setText(event.target.value)}\n onBlur={commit}\n onKeyDown={handleKeyDown}\n onAnimationEnd={() => setPulse(null)}\n />\n <IconButton\n mode=\"gray\"\n size=\"s\"\n circle\n data-slot=\"stepper-increment\"\n aria-label=\"Increase\"\n disabled={disabled || value >= max}\n onClick={() => setValue(clamp(value + step, min, max))}\n >\n <PlusIcon />\n </IconButton>\n </div>\n );\n}\n\nStepper.displayName = 'Stepper';\n",".steps {\n display: flex;\n align-items: center;\n gap: 4px;\n width: 100%;\n}\n\n.segment {\n flex: 1 1 0;\n overflow: hidden;\n height: 3px;\n border-radius: 2px;\n background: var(--tgui--accent-fill);\n}\n\n.fill {\n height: 100%;\n border-radius: inherit;\n background: var(--tgui--link);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .fill {\n transition: width 0.2s ease;\n }\n}\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Steps.module.css';\n\nexport interface StepsProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n count: number;\n progress: number;\n}\n\nconst clamp01 = (value: number) => Math.max(0, Math.min(1, value));\n\nexport function Steps({\n ref,\n count,\n progress,\n className,\n 'aria-label': ariaLabel,\n ...rest\n}: StepsProps) {\n return (\n <div\n ref={ref}\n role=\"progressbar\"\n aria-label={ariaLabel ?? 'Progress'}\n aria-valuemin={0}\n aria-valuemax={count}\n aria-valuenow={Math.max(0, Math.min(count, progress))}\n data-slot=\"steps\"\n className={cn(styles.steps, className)}\n {...rest}\n >\n {Array.from({ length: count }, (_, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: fixed-length positional segments\n <div key={index} data-slot=\"steps-segment\" className={styles.segment}>\n <div\n data-slot=\"steps-fill\"\n className={styles.fill}\n style={{ width: `${clamp01(progress - index) * 100}%` }}\n />\n </div>\n ))}\n </div>\n );\n}\n\nSteps.displayName = 'Steps';\n",".switch {\n position: relative;\n overflow: hidden;\n display: inline-flex;\n align-items: center;\n width: 52px;\n height: 32px;\n border-radius: 16px;\n cursor: pointer;\n flex-shrink: 0;\n}\n\n.switch[data-disabled] {\n cursor: default;\n opacity: 0.4;\n}\n\n.input {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n opacity: 0;\n cursor: inherit;\n}\n\n.control::before {\n position: absolute;\n content: \"\";\n inset: 0;\n background: var(--tgui--bg-secondary);\n}\n\n.base .control::before {\n border-radius: 16px;\n border: 3px solid var(--tgui--label-tertiary);\n}\n\n.control::after {\n position: absolute;\n content: \"\";\n top: 50%;\n transform: translateY(-50%);\n border-radius: 50%;\n}\n\n.base .control::after {\n width: 16px;\n height: 16px;\n margin-inline-start: 8px;\n background: var(--tgui--label-tertiary);\n}\n\n.ios .control::before {\n background: rgba(120, 120, 128, 0.22);\n}\n\n.ios .control::after {\n width: 28px;\n height: 28px;\n margin-inline-start: 2px;\n background: var(--tgui--white);\n box-shadow:\n 0 3px 8px 0 rgba(0, 0, 0, 0.12),\n 0 1px 1px 0 rgba(0, 0, 0, 0.16);\n}\n\n.input:checked + .control::before {\n border-color: var(--tgui--link);\n background-color: var(--tgui--link);\n}\n\n.input:checked + .control::after {\n transform: translateX(20px) translateY(-50%);\n}\n\n.base .input:checked + .control::after {\n width: 24px;\n height: 24px;\n background: var(--tgui--white);\n transform: translateX(16px) translateY(-50%);\n}\n\n.input:focus-visible + .control::before {\n box-shadow: var(--tgui--focus-ring-shadow);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .control::before {\n transition:\n background-color 0.2s ease,\n border-color 0.2s ease;\n }\n .control::after {\n transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);\n }\n .ios .control::after {\n transition: transform 0.2s cubic-bezier(0.36, -0.24, 0.26, 1.32);\n }\n}\n","'use client';\n\nimport type { ChangeEvent, InputHTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useHaptic, useTgui } from '../TguiProvider';\nimport styles from './Switch.module.css';\n\nexport interface SwitchProps extends InputHTMLAttributes<HTMLInputElement> {\n ref?: Ref<HTMLInputElement>;\n}\n\nexport function Switch({ ref, disabled, className, style, onChange, ...rest }: SwitchProps) {\n const { platform } = useTgui();\n const haptic = useHaptic();\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n haptic('select');\n onChange?.(event);\n };\n\n return (\n <label\n data-slot=\"switch\"\n className={cn(styles.switch, platform === 'ios' ? styles.ios : styles.base, className)}\n style={style}\n data-disabled={disabled || undefined}\n >\n <input\n ref={ref}\n type=\"checkbox\"\n data-slot=\"switch-input\"\n className={styles.input}\n disabled={disabled}\n onChange={handleChange}\n {...rest}\n />\n <span aria-hidden data-slot=\"switch-thumb\" className={styles.control} />\n </label>\n );\n}\n\nSwitch.displayName = 'Switch';\n",".bar {\n display: flex;\n align-items: stretch;\n padding: 0 16px;\n padding-bottom: calc(var(--tgui--safe-area-bottom) + var(--tgui--content-safe-area-bottom));\n background: var(--tgui--surface-bg);\n box-shadow: 0 -0.5px 0 var(--tgui--separator);\n}\n\n.barIos {\n padding: 0;\n padding-bottom: calc(6px + var(--tgui--safe-area-bottom) + var(--tgui--content-safe-area-bottom));\n}\n\n.item {\n flex: 1 0 0;\n min-inline-size: 0;\n max-inline-size: 100%;\n margin: 0;\n padding: 10px 16px 14px;\n border: none;\n background: transparent;\n\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 4px;\n\n /* inactive tab – iOS secondaryLabel grey; must stay a readable label */\n color: var(--tgui--label-secondary);\n}\n\n.itemIos {\n padding: 7px 12px 2px;\n gap: 3px;\n}\n\n.item[data-selected] {\n color: var(--tgui--link-strong);\n}\n\n.item:focus-visible {\n outline: var(--tgui--focus-ring);\n outline-offset: calc(-1 * var(--tgui--focus-ring-offset));\n}\n\n.icon {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 64px;\n height: 32px;\n padding: 2px 10px;\n border-radius: 16px;\n}\n\n.itemIos .icon {\n min-width: 0;\n height: 28px;\n padding: 0;\n}\n\n.item[data-selected]:not(.itemIos) .icon {\n background: var(--tgui--accent-fill);\n}\n\n.text {\n max-inline-size: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .item {\n transition: color 0.15s ease-out;\n }\n\n .icon {\n transition: background 0.15s ease-out;\n }\n}\n","'use client';\n\nimport type { ButtonHTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { Caption } from '../Caption';\nimport { Tappable } from '../Tappable';\nimport { useTgui } from '../TguiProvider';\nimport styles from './TabBar.module.css';\n\nexport interface TabBarItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n ref?: Ref<HTMLElement>;\n selected?: boolean;\n text?: string;\n children?: ReactNode;\n}\n\nexport function TabBarItem({ ref, selected, text, children, className, ...rest }: TabBarItemProps) {\n const { platform } = useTgui();\n const ios = platform === 'ios';\n\n return (\n <Tappable\n ref={ref}\n Component=\"button\"\n interactiveAnimation=\"opacity\"\n data-slot=\"tab-bar-item\"\n data-selected={selected || undefined}\n aria-current={selected ? 'page' : undefined}\n className={cn(styles.item, ios && styles.itemIos, className)}\n {...rest}\n >\n {children != null ? (\n <span data-slot=\"tab-bar-item-icon\" className={styles.icon}>\n {children}\n </span>\n ) : null}\n {text != null ? (\n <Caption\n data-slot=\"tab-bar-item-label\"\n className={styles.text}\n weight=\"2\"\n level={ios ? '2' : '1'}\n >\n {text}\n </Caption>\n ) : null}\n </Tappable>\n );\n}\n\nTabBarItem.displayName = 'TabBarItem';\n","'use client';\n\nimport type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { useTgui } from '../TguiProvider';\nimport styles from './TabBar.module.css';\nimport { TabBarItem } from './TabBarItem';\n\nexport interface TabBarProps extends HTMLAttributes<HTMLElement> {\n ref?: Ref<HTMLElement>;\n}\n\nexport function TabBar({ ref, className, children, ...rest }: TabBarProps) {\n const { platform } = useTgui();\n\n return (\n <nav\n ref={ref}\n data-slot=\"tab-bar\"\n className={cn(styles.bar, platform === 'ios' && styles.barIos, className)}\n {...rest}\n >\n {children}\n </nav>\n );\n}\n\nTabBar.displayName = 'TabBar';\nTabBar.Item = TabBarItem;\n",".field {\n display: block;\n width: 100%;\n margin: 0;\n padding: 0;\n border: 0;\n outline: 0;\n resize: none;\n background: transparent;\n color: var(--tgui--label);\n font-family: inherit;\n line-height: 1.4;\n overflow-y: auto;\n}\n\n.field::placeholder {\n color: var(--tgui--label-tertiary);\n}\n","'use client';\n\nimport {\n type ChangeEvent,\n type FocusEvent,\n type MutableRefObject,\n type ReactNode,\n type Ref,\n type TextareaHTMLAttributes,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { FormField } from '../FormField';\nimport { Subheadline } from '../Subheadline';\nimport { Text } from '../Text';\nimport { useTgui } from '../TguiProvider';\nimport styles from './Textarea.module.css';\n\nexport type TextareaStatus = 'default' | 'error' | 'focused';\n\nexport interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {\n ref?: Ref<HTMLTextAreaElement>;\n header?: ReactNode;\n status?: TextareaStatus;\n autoGrow?: boolean;\n maxRows?: number;\n}\n\nexport function Textarea({\n ref,\n header,\n status,\n autoGrow = false,\n maxRows,\n rows = 3,\n disabled,\n className,\n value,\n defaultValue,\n onFocus,\n onBlur,\n onChange,\n ...rest\n}: TextareaProps) {\n const { platform } = useTgui();\n const ios = platform === 'ios';\n const [focused, setFocused] = useState(false);\n const state = status ?? (focused ? 'focused' : 'default');\n const Typography = ios ? Text : Subheadline;\n\n const innerRef = useRef<HTMLTextAreaElement>(null);\n const setRefs = useCallback(\n (node: HTMLTextAreaElement | null) => {\n innerRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as MutableRefObject<HTMLTextAreaElement | null>).current = node;\n },\n [ref],\n );\n\n const resize = useCallback(() => {\n const el = innerRef.current;\n if (!el || !autoGrow) return;\n el.style.height = 'auto';\n const cs = getComputedStyle(el);\n const lineHeight = Number.parseFloat(cs.lineHeight) || 20;\n const max = maxRows ? lineHeight * maxRows : Number.POSITIVE_INFINITY;\n el.style.height = `${Math.min(el.scrollHeight, max)}px`;\n el.style.overflowY = el.scrollHeight > max ? 'auto' : 'hidden';\n }, [autoGrow, maxRows]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: value drives the re-measure\n useEffect(resize, [resize, value, defaultValue]);\n\n const handleFocus = (event: FocusEvent<HTMLTextAreaElement>) => {\n if (!disabled) setFocused(true);\n onFocus?.(event);\n };\n const handleBlur = (event: FocusEvent<HTMLTextAreaElement>) => {\n setFocused(false);\n onBlur?.(event);\n };\n const handleChange = (event: ChangeEvent<HTMLTextAreaElement>) => {\n resize();\n onChange?.(event);\n };\n\n return (\n <FormField\n ios={ios}\n status={state}\n disabled={disabled}\n alignStart\n header={header}\n className={className}\n >\n <Typography\n ref={setRefs as Ref<HTMLElement>}\n Component=\"textarea\"\n data-slot=\"textarea\"\n className={styles.field}\n rows={rows}\n disabled={disabled}\n aria-invalid={state === 'error' || undefined}\n value={value}\n defaultValue={defaultValue}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChange={handleChange}\n {...rest}\n />\n </FormField>\n );\n}\n\nTextarea.displayName = 'Textarea';\n",".timeline {\n display: flex;\n flex-direction: column;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.item {\n position: relative;\n display: flex;\n gap: 12px;\n padding-bottom: 20px;\n}\n\n.item:last-child {\n padding-bottom: 0;\n}\n\n.rail {\n position: relative;\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n width: 10px;\n padding-top: 5px;\n}\n\n.connector {\n position: absolute;\n top: 10px;\n bottom: -30px;\n left: 50%;\n width: 1.5px;\n transform: translateX(-50%);\n background: var(--tgui--separator);\n}\n\n.item:last-child .connector {\n display: none;\n}\n\n.item:has(~ .item[data-active]) .connector {\n background: var(--tgui--link);\n}\n\n.dot {\n z-index: 1;\n flex-shrink: 0;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background: var(--tgui--label-tertiary);\n}\n\n.item:has(~ .item[data-active]) .dot {\n background: var(--tgui--link);\n}\n\n.item[data-active] .dot {\n background: var(--tgui--link);\n box-shadow: 0 0 0 3px var(--tgui--accent-fill);\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .connector,\n .dot {\n transition:\n background 0.2s ease,\n box-shadow 0.2s ease;\n }\n}\n\n.content {\n flex: 1;\n min-width: 0;\n padding-top: 1px;\n}\n\n.heading {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 8px;\n}\n\n.title {\n font-family: var(--tgui--font-family);\n font-size: 15px;\n font-weight: var(--tgui--weight-semibold);\n color: var(--tgui--label);\n}\n\n.time {\n flex-shrink: 0;\n font-family: var(--tgui--font-family);\n font-size: 13px;\n color: var(--tgui--label-secondary);\n}\n\n.description {\n margin-top: 2px;\n font-family: var(--tgui--font-family);\n font-size: 14px;\n line-height: 18px;\n color: var(--tgui--label-secondary);\n}\n\n.item[data-active] ~ .item .title {\n color: var(--tgui--label-secondary);\n}\n\n.item[data-active] ~ .item .description {\n color: var(--tgui--label-secondary);\n}\n\n.item[data-active] ~ .item .dot {\n background: color-mix(in srgb, var(--tgui--label-tertiary) 55%, var(--tgui--bg));\n}\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Timeline.module.css';\n\nexport interface TimelineProps extends HTMLAttributes<HTMLOListElement> {\n ref?: Ref<HTMLOListElement>;\n}\n\nexport function Timeline({ ref, className, children, ...rest }: TimelineProps) {\n return (\n <ol ref={ref} data-slot=\"timeline\" className={cn(styles.timeline, className)} {...rest}>\n {children}\n </ol>\n );\n}\n\nTimeline.displayName = 'Timeline';\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport styles from './Timeline.module.css';\n\nexport interface TimelineItemProps extends Omit<HTMLAttributes<HTMLLIElement>, 'title'> {\n ref?: Ref<HTMLLIElement>;\n title: ReactNode;\n description?: ReactNode;\n time?: ReactNode;\n active?: boolean;\n}\n\nexport function TimelineItem({\n ref,\n title,\n description,\n time,\n active = false,\n className,\n ...rest\n}: TimelineItemProps) {\n return (\n <li\n ref={ref}\n data-slot=\"timeline-item\"\n className={cn(styles.item, className)}\n data-active={active || undefined}\n {...rest}\n >\n <span data-slot=\"timeline-item-rail\" className={styles.rail} aria-hidden>\n <span className={styles.connector} />\n <span className={styles.dot} />\n </span>\n <div data-slot=\"timeline-item-content\" className={styles.content}>\n <div className={styles.heading}>\n <span data-slot=\"timeline-item-title\" className={styles.title}>\n {title}\n </span>\n {time != null ? (\n <span data-slot=\"timeline-item-time\" className={styles.time}>\n {time}\n </span>\n ) : null}\n </div>\n {description != null ? (\n <div data-slot=\"timeline-item-description\" className={styles.description}>\n {description}\n </div>\n ) : null}\n </div>\n </li>\n );\n}\n\nTimelineItem.displayName = 'TimelineItem';\n",".trigger {\n display: inline-flex;\n}\n\n.tooltip {\n position: fixed;\n top: 0;\n left: 0;\n z-index: var(--tgui--z-overlay, 1000);\n max-width: 260px;\n padding: 6px 10px;\n border-radius: var(--tgui--radius-sm);\n background: var(--tgui--surface-bg);\n color: var(--tgui--label);\n font-family: var(--tgui--font-family);\n font-size: 13px;\n line-height: 17px;\n box-shadow: var(--tgui--overlay-shadow);\n pointer-events: none;\n transform-origin: var(--tgui--tooltip-origin-x, 50%) var(--tgui--tooltip-origin-y, 50%);\n}\n\n/* visible at rest once positioned; the keyframes only ferry it in and out, and it\n stays hidden (inline opacity: 0) until the layout effect has placed it, so the\n entrance always plays from the final position – same as Popover */\n@media (prefers-reduced-motion: no-preference) {\n .tooltip[data-state=\"open\"] {\n animation: tooltip-in var(--tgui--duration-overlay) var(--tgui--ease-spring);\n }\n\n .tooltip[data-state=\"closed\"] {\n animation: tooltip-out var(--tgui--duration-overlay) var(--tgui--ease-in) forwards;\n }\n}\n\n@keyframes tooltip-in {\n from {\n opacity: 0;\n transform: scale(0.96);\n }\n}\n\n@keyframes tooltip-out {\n to {\n opacity: 0;\n transform: scale(0.96);\n }\n}\n\n.arrow {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n /* hairline on the two outer edges so the tip keeps the bubble's ring on a light surface */\n box-shadow: 0 0 0 0.5px var(--tgui--separator);\n transform: rotate(45deg);\n}\n","'use client';\n\nimport { Presence } from '@radix-ui/react-presence';\nimport {\n type CSSProperties,\n type ReactNode,\n type Ref,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../../shared/lib/cn';\nimport { getFixedOffset } from '../../shared/lib/floatingPosition';\nimport { Portal } from '../Portal';\nimport styles from './Tooltip.module.css';\n\nexport type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nexport interface TooltipProps {\n ref?: Ref<HTMLSpanElement>;\n children: ReactNode;\n content: ReactNode;\n placement?: TooltipPlacement;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n className?: string;\n}\n\nconst GAP = 8;\nconst MARGIN = 8;\nconst clamp = (value: number, min: number, max: number) => Math.max(min, Math.min(max, value));\n\ninterface Position {\n top: number;\n left: number;\n placement: TooltipPlacement;\n originX: number;\n originY: number;\n arrow: CSSProperties;\n}\n\nfunction compute(\n trigger: DOMRect,\n tip: DOMRect,\n want: TooltipPlacement,\n tipEl: Element | null,\n): Position {\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n let placement = want;\n if (placement === 'top' && trigger.top - tip.height - GAP < MARGIN) placement = 'bottom';\n else if (placement === 'bottom' && trigger.bottom + tip.height + GAP > vh - MARGIN)\n placement = 'top';\n else if (placement === 'left' && trigger.left - tip.width - GAP < MARGIN) placement = 'right';\n else if (placement === 'right' && trigger.right + tip.width + GAP > vw - MARGIN)\n placement = 'left';\n\n let top = 0;\n let left = 0;\n if (placement === 'top' || placement === 'bottom') {\n left = trigger.left + trigger.width / 2 - tip.width / 2;\n top = placement === 'top' ? trigger.top - tip.height - GAP : trigger.bottom + GAP;\n } else {\n top = trigger.top + trigger.height / 2 - tip.height / 2;\n left = placement === 'left' ? trigger.left - tip.width - GAP : trigger.right + GAP;\n }\n left = clamp(left, MARGIN, vw - tip.width - MARGIN);\n top = clamp(top, MARGIN, vh - tip.height - MARGIN);\n\n const centerX = trigger.left + trigger.width / 2 - left;\n const centerY = trigger.top + trigger.height / 2 - top;\n const arrow: CSSProperties = {};\n if (placement === 'top') {\n arrow.left = clamp(centerX, 10, tip.width - 10) - 4;\n arrow.bottom = -4;\n } else if (placement === 'bottom') {\n arrow.left = clamp(centerX, 10, tip.width - 10) - 4;\n arrow.top = -4;\n } else if (placement === 'left') {\n arrow.top = clamp(centerY, 10, tip.height - 10) - 4;\n arrow.right = -4;\n } else {\n arrow.top = clamp(centerY, 10, tip.height - 10) - 4;\n arrow.left = -4;\n }\n\n const offset = getFixedOffset(tipEl);\n return {\n top: (top - offset.y) / offset.scale,\n left: (left - offset.x) / offset.scale,\n placement,\n originX: clamp(centerX, 0, tip.width),\n originY: clamp(centerY, 0, tip.height),\n arrow,\n };\n}\n\nexport function Tooltip({\n ref,\n children,\n content,\n placement = 'top',\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n className,\n}: TooltipProps) {\n const [uncontrolled, setUncontrolled] = useState(defaultOpen);\n const open = openProp ?? uncontrolled;\n\n const triggerRef = useRef<HTMLSpanElement | null>(null);\n const tipRef = useRef<HTMLDivElement | null>(null);\n const pressTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const [tipNode, setTipNode] = useState<HTMLDivElement | null>(null);\n const [pos, setPos] = useState<Position | null>(null);\n const id = useId();\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (openProp == null) setUncontrolled(next);\n onOpenChange?.(next);\n },\n [openProp, onOpenChange],\n );\n\n const reposition = useCallback(() => {\n const trigger = triggerRef.current;\n const tip = tipRef.current;\n if (!trigger || !tip) return;\n setPos(compute(trigger.getBoundingClientRect(), tip.getBoundingClientRect(), placement, tip));\n }, [placement]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: tipNode re-runs this once Presence mounts the tip, a render after `open` flips\n useLayoutEffect(() => {\n if (open) reposition();\n }, [open, reposition, tipNode]);\n\n useEffect(() => {\n if (!open) return;\n const onScroll = () => setOpen(false);\n window.addEventListener('scroll', onScroll, true);\n window.addEventListener('resize', reposition);\n return () => {\n window.removeEventListener('scroll', onScroll, true);\n window.removeEventListener('resize', reposition);\n };\n }, [open, reposition, setOpen]);\n\n useEffect(() => {\n if (!open) return;\n const onKey = (event: KeyboardEvent) => {\n if (event.key === 'Escape') setOpen(false);\n };\n document.addEventListener('keydown', onKey);\n return () => document.removeEventListener('keydown', onKey);\n }, [open, setOpen]);\n\n const clearPress = useCallback(() => {\n if (pressTimer.current) {\n clearTimeout(pressTimer.current);\n pressTimer.current = null;\n }\n }, []);\n\n useEffect(() => clearPress, [clearPress]);\n\n return (\n <>\n {/* biome-ignore lint/a11y/noStaticElementInteractions: this span only relays hover/focus to the described tooltip; the child is the real control */}\n <span\n ref={(node) => {\n triggerRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as { current: HTMLSpanElement | null }).current = node;\n }}\n data-slot=\"tooltip-trigger\"\n className={cn(styles.trigger, className)}\n aria-describedby={open ? id : undefined}\n onPointerEnter={(event) => {\n if (event.pointerType !== 'touch') setOpen(true);\n }}\n onPointerLeave={(event) => {\n if (event.pointerType !== 'touch') setOpen(false);\n clearPress();\n }}\n onPointerDown={(event) => {\n if (event.pointerType === 'touch') {\n pressTimer.current = setTimeout(() => setOpen(true), 450);\n }\n }}\n onPointerUp={clearPress}\n onPointerCancel={clearPress}\n onFocus={() => setOpen(true)}\n onBlur={() => setOpen(false)}\n >\n {children}\n </span>\n <Portal>\n <Presence present={open}>\n <div\n ref={(node) => {\n tipRef.current = node;\n setTipNode(node);\n }}\n id={id}\n role=\"tooltip\"\n data-slot=\"tooltip-content\"\n data-state={pos ? (open ? 'open' : 'closed') : undefined}\n className={styles.tooltip}\n style={\n pos\n ? ({\n top: pos.top,\n left: pos.left,\n '--tgui--tooltip-origin-x': `${pos.originX}px`,\n '--tgui--tooltip-origin-y': `${pos.originY}px`,\n } as CSSProperties)\n : { top: 0, left: 0, opacity: 0, pointerEvents: 'none' }\n }\n data-placement={pos?.placement}\n >\n {content}\n {pos ? (\n <span\n data-slot=\"tooltip-arrow\"\n className={styles.arrow}\n style={pos.arrow}\n aria-hidden\n />\n ) : null}\n </div>\n </Presence>\n </Portal>\n </>\n );\n}\n\nTooltip.displayName = 'Tooltip';\n","import { getTelegramWebApp, isTelegramVersionAtLeast } from '../shared/lib/telegram';\nimport type { TelegramEventMap } from '../shared/types/telegram';\n\nexport { getTelegramWebApp, isTelegramVersionAtLeast };\n\n// subscribe to a Telegram WebApp event; returns a cleanup. a no-op outside Telegram.\nexport function onTelegramEvent<K extends keyof TelegramEventMap>(\n event: K,\n handler: (...args: TelegramEventMap[K] extends undefined ? [] : [TelegramEventMap[K]]) => void,\n): () => void {\n const webApp = getTelegramWebApp();\n if (webApp == null || typeof webApp.onEvent !== 'function') return () => {};\n webApp.onEvent(event, handler);\n return () => webApp.offEvent?.(event, handler);\n}\n","import { useEffect, useRef } from 'react';\nimport { getTelegramWebApp } from './lib';\n\n// shows Telegram's Back button and runs `onClick` when it's tapped; hides it\n// again on unmount. a no-op outside Telegram.\nexport function useBackButton(onClick: () => void, visible = true): void {\n const onClickRef = useRef(onClick);\n onClickRef.current = onClick;\n\n useEffect(() => {\n const button = getTelegramWebApp()?.BackButton;\n if (button == null) return;\n\n const handler = () => onClickRef.current();\n button.onClick(handler);\n if (visible) button.show();\n else button.hide();\n\n return () => {\n button.offClick(handler);\n button.hide();\n };\n }, [visible]);\n}\n","import { useEffect } from 'react';\nimport { getTelegramWebApp } from './lib';\n\n// while `enabled`, Telegram asks the user to confirm before the Mini App closes —\n// turn it on when there are unsaved edits. restores the prior state on unmount.\n// a no-op outside Telegram.\nexport function useClosingConfirmation(enabled: boolean): void {\n useEffect(() => {\n const webApp = getTelegramWebApp();\n if (webApp == null || typeof webApp.enableClosingConfirmation !== 'function') return;\n\n const wasEnabled = webApp.isClosingConfirmationEnabled;\n if (enabled) webApp.enableClosingConfirmation();\n else webApp.disableClosingConfirmation();\n\n return () => {\n if (wasEnabled) webApp.enableClosingConfirmation();\n else webApp.disableClosingConfirmation();\n };\n }, [enabled]);\n}\n","import { useMemo } from 'react';\nimport { getTelegramWebApp, isTelegramVersionAtLeast } from './lib';\n\nexport interface CloudStorageApi {\n // false outside Telegram or on Bot API < 6.9 — every method rejects when false\n readonly isAvailable: boolean;\n // resolves null for a missing key\n getItem(key: string): Promise<string | null>;\n getItems(keys: string[]): Promise<Record<string, string>>;\n setItem(key: string, value: string): Promise<void>;\n removeItem(key: string): Promise<void>;\n removeItems(keys: string[]): Promise<void>;\n getKeys(): Promise<string[]>;\n}\n\nconst rejectUnavailable = () =>\n Promise.reject(new Error('CloudStorage is unavailable (needs Telegram, Bot API 6.9+)'));\n\n// Telegram's per-user key-value store (synced across the user's devices),\n// with the callback API wrapped as promises. the returned object is stable.\nexport function useCloudStorage(): CloudStorageApi {\n return useMemo<CloudStorageApi>(() => {\n const storage = getTelegramWebApp()?.CloudStorage;\n if (storage == null || !isTelegramVersionAtLeast('6.9')) {\n return {\n isAvailable: false,\n getItem: rejectUnavailable,\n getItems: rejectUnavailable,\n setItem: rejectUnavailable,\n removeItem: rejectUnavailable,\n removeItems: rejectUnavailable,\n getKeys: rejectUnavailable,\n };\n }\n\n return {\n isAvailable: true,\n getItem: (key) =>\n new Promise((resolve, reject) => {\n storage.getItem(key, (error, value) =>\n error ? reject(new Error(error)) : resolve(value === '' ? null : value),\n );\n }),\n getItems: (keys) =>\n new Promise((resolve, reject) => {\n storage.getItems(keys, (error, values) =>\n error ? reject(new Error(error)) : resolve(values),\n );\n }),\n setItem: (key, value) =>\n new Promise((resolve, reject) => {\n storage.setItem(key, value, (error) => (error ? reject(new Error(error)) : resolve()));\n }),\n removeItem: (key) =>\n new Promise((resolve, reject) => {\n storage.removeItem(key, (error) => (error ? reject(new Error(error)) : resolve()));\n }),\n removeItems: (keys) =>\n new Promise((resolve, reject) => {\n storage.removeItems(keys, (error) => (error ? reject(new Error(error)) : resolve()));\n }),\n getKeys: () =>\n new Promise((resolve, reject) => {\n storage.getKeys((error, keys) => (error ? reject(new Error(error)) : resolve(keys)));\n }),\n };\n }, []);\n}\n","import { useMemo } from 'react';\nimport type { WebAppInitData, WebAppUser } from '../shared/types/telegram';\nimport { getTelegramWebApp } from './lib';\n\nexport interface InitData {\n // the signed string to send to your backend — trust nothing until the server\n // validates this against the bot token\n raw: string;\n // parsed but UNVERIFIED — for reference only, never a security decision\n unsafe: WebAppInitData | null;\n user: WebAppUser | null;\n startParam: string | null;\n}\n\n// the Mini App's launch data. `raw` is what you send to your API; `unsafe` /\n// `user` are the parsed copy and must not be trusted without server validation.\nexport function useInitData(): InitData {\n return useMemo<InitData>(() => {\n const webApp = getTelegramWebApp();\n const unsafe = webApp?.initDataUnsafe ?? null;\n return {\n raw: webApp?.initData ?? '',\n unsafe,\n user: unsafe?.user ?? null,\n startParam: unsafe?.start_param ?? null,\n };\n }, []);\n}\n","import { useEffect, useRef } from 'react';\nimport type { BottomButtonParams, BottomButtonPosition } from '../shared/types/telegram';\nimport { getTelegramWebApp, isTelegramVersionAtLeast } from './lib';\n\nexport interface BottomButtonOptions {\n // label; the button stays hidden while this is empty\n text?: string;\n // fired on tap\n onClick?: () => void;\n // default true — mounting the hook means you want the button shown\n visible?: boolean;\n // default true\n enabled?: boolean;\n // shows the progress spinner\n loading?: boolean;\n color?: string;\n textColor?: string;\n hasShineEffect?: boolean;\n // secondary button only — where it sits relative to the main button\n position?: BottomButtonPosition;\n}\n\n// shared implementation for MainButton / SecondaryButton: declarative — you\n// describe the desired button, the hook syncs it and tears it down on unmount.\nexport function useBottomButton(kind: 'main' | 'secondary', options: BottomButtonOptions): void {\n const {\n text,\n onClick,\n visible = true,\n enabled = true,\n loading = false,\n color,\n textColor,\n hasShineEffect,\n position,\n } = options;\n\n // latest onClick without re-registering the listener every render\n const onClickRef = useRef(onClick);\n onClickRef.current = onClick;\n\n useEffect(() => {\n const webApp = getTelegramWebApp();\n const button = kind === 'main' ? webApp?.MainButton : webApp?.SecondaryButton;\n if (button == null) return;\n if (kind === 'secondary' && !isTelegramVersionAtLeast('7.10')) return;\n\n const handler = () => onClickRef.current?.();\n button.onClick(handler);\n\n if (visible && (text ?? '').trim().length > 0) {\n const params: BottomButtonParams = {\n text,\n is_visible: true,\n is_active: enabled && !loading,\n };\n if (color !== undefined) params.color = color;\n if (textColor !== undefined) params.text_color = textColor;\n if (hasShineEffect !== undefined) params.has_shine_effect = hasShineEffect;\n if (kind === 'secondary' && position !== undefined) params.position = position;\n button.setParams(params);\n if (loading) button.showProgress();\n else button.hideProgress();\n } else {\n button.hide();\n }\n\n return () => {\n button.offClick(handler);\n button.hideProgress();\n button.hide();\n };\n }, [kind, text, visible, enabled, loading, color, textColor, hasShineEffect, position]);\n}\n","import { type BottomButtonOptions, useBottomButton } from './bottomButton';\n\n// drives Telegram's MainButton from a component. describe the button; the hook\n// syncs text / colour / active / progress and hides it again on unmount.\n// a no-op outside Telegram. assumes one consumer mounted at a time.\nexport function useMainButton(options: BottomButtonOptions): void {\n useBottomButton('main', options);\n}\n","import { type BottomButtonOptions, useBottomButton } from './bottomButton';\n\n// drives Telegram's SecondaryButton (Bot API 7.10+). same shape as\n// `useMainButton`, plus `position`. a no-op below 7.10 or outside Telegram.\nexport function useSecondaryButton(options: BottomButtonOptions): void {\n useBottomButton('secondary', options);\n}\n","import { useEffect, useRef } from 'react';\nimport { getTelegramWebApp } from './lib';\n\n// shows the Settings item in Telegram's ••• menu and runs `onClick` when it's\n// chosen; hides it again on unmount. a no-op outside Telegram.\nexport function useSettingsButton(onClick: () => void, visible = true): void {\n const onClickRef = useRef(onClick);\n onClickRef.current = onClick;\n\n useEffect(() => {\n const button = getTelegramWebApp()?.SettingsButton;\n if (button == null) return;\n\n const handler = () => onClickRef.current();\n button.onClick(handler);\n if (visible) button.show();\n else button.hide();\n\n return () => {\n button.offClick(handler);\n button.hide();\n };\n }, [visible]);\n}\n","import { useEffect } from 'react';\nimport { getTelegramWebApp } from './lib';\n\n// controls Telegram's swipe-down-to-minimise gesture (Bot API 7.7+). pass\n// `false` while a custom vertical gesture is active (a drawer, a slider) so it\n// doesn't fight the app. Telegram re-enables swipes on unmount. a no-op\n// outside Telegram. (`Sheet` already does this internally while open.)\nexport function useVerticalSwipes(enabled: boolean): void {\n useEffect(() => {\n const webApp = getTelegramWebApp();\n if (webApp == null || typeof webApp.disableVerticalSwipes !== 'function') return;\n\n if (enabled) webApp.enableVerticalSwipes();\n else webApp.disableVerticalSwipes();\n\n return () => webApp.enableVerticalSwipes?.();\n }, [enabled]);\n}\n","import { useSyncExternalStore } from 'react';\nimport { getTelegramWebApp, onTelegramEvent } from './lib';\n\nexport interface Viewport {\n // current visible height in px\n height: number;\n // height in the last stable (non-animating) state\n stableHeight: number;\n isExpanded: boolean;\n // false while the viewport is mid-animation\n isStable: boolean;\n // ask Telegram to expand the Mini App to full height\n expand(): void;\n}\n\nconst expand = () => getTelegramWebApp()?.expand();\n\nlet snapshot: Viewport | null = null;\n\nfunction read(): Viewport {\n const webApp = getTelegramWebApp();\n const height = webApp?.viewportHeight ?? (typeof window !== 'undefined' ? window.innerHeight : 0);\n const stableHeight = webApp?.viewportStableHeight ?? height;\n const isExpanded = webApp?.isExpanded ?? true;\n\n if (\n snapshot != null &&\n snapshot.height === height &&\n snapshot.stableHeight === stableHeight &&\n snapshot.isExpanded === isExpanded\n ) {\n return snapshot;\n }\n snapshot = { height, stableHeight, isExpanded, isStable: height === stableHeight, expand };\n return snapshot;\n}\n\nfunction subscribe(onChange: () => void): () => void {\n const off = onTelegramEvent('viewportChanged', onChange);\n if (getTelegramWebApp() == null && typeof window !== 'undefined') {\n window.addEventListener('resize', onChange);\n return () => {\n off();\n window.removeEventListener('resize', onChange);\n };\n }\n return off;\n}\n\nconst serverSnapshot: Viewport = {\n height: 0,\n stableHeight: 0,\n isExpanded: true,\n isStable: true,\n expand: () => {},\n};\n\n// the Telegram viewport, kept in sync through `viewportChanged`. outside\n// Telegram it falls back to `window.innerHeight`.\nexport function useViewport(): Viewport {\n return useSyncExternalStore(subscribe, read, () => serverSnapshot);\n}\n"],"x_google_ignoreList":[68,69,70,71,72,73,74,75,76],"mappings":";;;;;;;;;AAEA,SAAgB,EAAG,GAAG,GAAsB;CAC1C,OAAO,EAAK,CAAM;AACpB;;;ACDA,IAAa,IAAc,EAAuC,IAAI;AAEtE,EAAY,cAAc;;;ACH1B,SAAgB,IAAwC;CAClD,aAAO,SAAW,MACtB,OAAO,OAAO,UAAU;AAC1B;AAGA,SAAgB,EAAyB,GAA0B;CACjE,IAAM,IAAS,EAAkB;CACjC,IAAI,KAAU,MAAM,OAAO;CAC3B,IAAI;EACF,OAAO,EAAO,iBAAiB,CAAO;CACxC,QAAQ;EACN,OAAO;CACT;AACF;;;ACbA,IAAM,IAAa;AAEnB,SAAS,IAAgB;CACvB,OAAO,OAAO,SAAW,OAAe,OAAO,OAAO,cAAe;AACvE;AAEA,SAAgB,IAA4B;CAC1C,IAAM,IAAS,EAAkB;CASjC,OARI,IACK,EAAO,gBAAgB,SAAS,SAAS,UAG9C,EAAc,KACT,OAAO,WAAW,CAAU,CAAC,CAAC,UAAU,SAAS;AAI5D;AAEA,SAAgB,EAAoB,GAAkC;CACpE,IAAM,IAAS,EAAkB;CACjC,IAAI,KAAU,QAAQ,OAAO,EAAO,WAAY,YAE9C,OADA,EAAO,QAAQ,gBAAgB,CAAQ,SAC1B,EAAO,WAAW,gBAAgB,CAAQ;CAGzD,I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