@alfadocs/ui-kit-debug 1.39.0 → 1.41.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.
Files changed (201) hide show
  1. package/dist/_chunks/{ai-consent-banner-DvtaM3yg.js → ai-consent-banner-D7I2U-cz.js} +37 -36
  2. package/dist/_chunks/ai-consent-banner-D7I2U-cz.js.map +1 -0
  3. package/dist/_chunks/arrow-left-BfaGqVam.js +15 -0
  4. package/dist/_chunks/arrow-left-BfaGqVam.js.map +1 -0
  5. package/dist/_chunks/{booking-Dn3jvv3K.js → booking-D43ASl8y.js} +1109 -1103
  6. package/dist/_chunks/booking-D43ASl8y.js.map +1 -0
  7. package/dist/_chunks/{calendar-workspace-B-fUbm62.js → calendar-workspace-UllCER2k.js} +2170 -2163
  8. package/dist/_chunks/calendar-workspace-UllCER2k.js.map +1 -0
  9. package/dist/_chunks/{contact-profile-card-Zt6WNg1u.js → contact-profile-card-C0WpwpVV.js} +38 -33
  10. package/dist/_chunks/contact-profile-card-C0WpwpVV.js.map +1 -0
  11. package/dist/_chunks/editor-overlay-DwNKaI22.js +93 -0
  12. package/dist/_chunks/editor-overlay-DwNKaI22.js.map +1 -0
  13. package/dist/_chunks/format-price-DAbh61Lz.js +51 -0
  14. package/dist/_chunks/format-price-DAbh61Lz.js.map +1 -0
  15. package/dist/_chunks/help-me-write-templates-GB70jnV9.js +764 -0
  16. package/dist/_chunks/help-me-write-templates-GB70jnV9.js.map +1 -0
  17. package/dist/_chunks/{marketplace-app-shell-d2EtcUbe.js → marketplace-app-shell-D_g9BaDI.js} +2 -2
  18. package/dist/_chunks/{marketplace-app-shell-d2EtcUbe.js.map → marketplace-app-shell-D_g9BaDI.js.map} +1 -1
  19. package/dist/_chunks/{money-BY-HmKhZ.js → money-BXLBIRVO.js} +2 -2
  20. package/dist/_chunks/{money-BY-HmKhZ.js.map → money-BXLBIRVO.js.map} +1 -1
  21. package/dist/_chunks/{notes-panel-CAD1Ytcj.js → notes-panel-_diLt8Cj.js} +76 -73
  22. package/dist/_chunks/notes-panel-_diLt8Cj.js.map +1 -0
  23. package/dist/_chunks/{panel-subview-Cc2Wtt7D.js → panel-subview-PMBRPFOa.js} +49 -59
  24. package/dist/_chunks/panel-subview-PMBRPFOa.js.map +1 -0
  25. package/dist/_chunks/{practice-results-D_jjzwgf.js → practice-results-D11Zpt27.js} +50 -45
  26. package/dist/_chunks/practice-results-D11Zpt27.js.map +1 -0
  27. package/dist/_chunks/rich-text-editor-D7AKKAQ2.js +3119 -0
  28. package/dist/_chunks/rich-text-editor-D7AKKAQ2.js.map +1 -0
  29. package/dist/_chunks/{sidebar-C-Gr2LL-.js → sidebar-ClTY9lLI.js} +160 -169
  30. package/dist/_chunks/sidebar-ClTY9lLI.js.map +1 -0
  31. package/dist/_chunks/{treatment-receipt-dUm99mdn.js → treatment-receipt-DU0OewqH.js} +2 -2
  32. package/dist/_chunks/{treatment-receipt-dUm99mdn.js.map → treatment-receipt-DU0OewqH.js.map} +1 -1
  33. package/dist/_chunks/trending-up-C_luYBzS.js +15 -0
  34. package/dist/_chunks/trending-up-C_luYBzS.js.map +1 -0
  35. package/dist/_chunks/wand-sparkles-DAjKyhz7.js +27 -0
  36. package/dist/_chunks/wand-sparkles-DAjKyhz7.js.map +1 -0
  37. package/dist/agent-catalog.json +87 -1
  38. package/dist/agent-i18n/en.json +7 -0
  39. package/dist/components/_shared/format-price.d.ts +6 -0
  40. package/dist/components/_shared/format-price.d.ts.map +1 -1
  41. package/dist/components/_shared/index.d.ts +1 -1
  42. package/dist/components/_shared/index.d.ts.map +1 -1
  43. package/dist/components/ai-consent-banner/ai-consent-banner.d.ts +9 -0
  44. package/dist/components/ai-consent-banner/ai-consent-banner.d.ts.map +1 -1
  45. package/dist/components/ai-consent-banner/index.d.ts +1 -1
  46. package/dist/components/ai-consent-banner/index.d.ts.map +1 -1
  47. package/dist/components/ai-consent-banner/index.js +1 -1
  48. package/dist/components/booking/booking-types.d.ts +6 -0
  49. package/dist/components/booking/booking-types.d.ts.map +1 -1
  50. package/dist/components/booking/booking.d.ts.map +1 -1
  51. package/dist/components/booking/cascade.d.ts +6 -0
  52. package/dist/components/booking/cascade.d.ts.map +1 -1
  53. package/dist/components/booking/index.js +1 -1
  54. package/dist/components/contact-profile-card/contact-profile-card.d.ts +2 -2
  55. package/dist/components/contact-profile-card/contact-profile-card.d.ts.map +1 -1
  56. package/dist/components/contact-profile-card/index.js +1 -1
  57. package/dist/components/editor-overlay/editor-overlay.d.ts.map +1 -1
  58. package/dist/components/editor-overlay/index.js +1 -1
  59. package/dist/components/index.d.ts +1 -0
  60. package/dist/components/index.d.ts.map +1 -1
  61. package/dist/components/money/index.js +1 -1
  62. package/dist/components/notes-panel/index.d.ts +1 -0
  63. package/dist/components/notes-panel/index.d.ts.map +1 -1
  64. package/dist/components/notes-panel/index.js +1 -1
  65. package/dist/components/notes-panel/notes-panel.d.ts +8 -1
  66. package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
  67. package/dist/components/panel-subview/index.js +1 -1
  68. package/dist/components/practice-results/index.js +1 -1
  69. package/dist/components/practice-results/practice-results.d.ts +2 -1
  70. package/dist/components/practice-results/practice-results.d.ts.map +1 -1
  71. package/dist/components/rich-text-editor/editor-toolbar.d.ts +6 -1
  72. package/dist/components/rich-text-editor/editor-toolbar.d.ts.map +1 -1
  73. package/dist/components/rich-text-editor/index.d.ts +1 -1
  74. package/dist/components/rich-text-editor/index.d.ts.map +1 -1
  75. package/dist/components/rich-text-editor/index.js +1 -1
  76. package/dist/components/rich-text-editor/rich-text-editor.d.ts +122 -0
  77. package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
  78. package/dist/components/sidebar/index.js +1 -1
  79. package/dist/components/treatment-receipt/index.js +1 -1
  80. package/dist/host-compat.css +13 -1
  81. package/dist/i18n/locales/ar.d.ts +92 -11
  82. package/dist/i18n/locales/ar.d.ts.map +1 -1
  83. package/dist/i18n/locales/ar.js +94 -13
  84. package/dist/i18n/locales/ar.js.map +1 -1
  85. package/dist/i18n/locales/de.d.ts +92 -11
  86. package/dist/i18n/locales/de.d.ts.map +1 -1
  87. package/dist/i18n/locales/de.js +94 -13
  88. package/dist/i18n/locales/de.js.map +1 -1
  89. package/dist/i18n/locales/el.d.ts +92 -11
  90. package/dist/i18n/locales/el.d.ts.map +1 -1
  91. package/dist/i18n/locales/el.js +94 -13
  92. package/dist/i18n/locales/el.js.map +1 -1
  93. package/dist/i18n/locales/en.d.ts +81 -0
  94. package/dist/i18n/locales/en.d.ts.map +1 -1
  95. package/dist/i18n/locales/en.js +83 -2
  96. package/dist/i18n/locales/en.js.map +1 -1
  97. package/dist/i18n/locales/es.d.ts +92 -11
  98. package/dist/i18n/locales/es.d.ts.map +1 -1
  99. package/dist/i18n/locales/es.js +94 -13
  100. package/dist/i18n/locales/es.js.map +1 -1
  101. package/dist/i18n/locales/fr.d.ts +92 -11
  102. package/dist/i18n/locales/fr.d.ts.map +1 -1
  103. package/dist/i18n/locales/fr.js +94 -13
  104. package/dist/i18n/locales/fr.js.map +1 -1
  105. package/dist/i18n/locales/hi.d.ts +92 -11
  106. package/dist/i18n/locales/hi.d.ts.map +1 -1
  107. package/dist/i18n/locales/hi.js +94 -13
  108. package/dist/i18n/locales/hi.js.map +1 -1
  109. package/dist/i18n/locales/it.d.ts +92 -11
  110. package/dist/i18n/locales/it.d.ts.map +1 -1
  111. package/dist/i18n/locales/it.js +94 -13
  112. package/dist/i18n/locales/it.js.map +1 -1
  113. package/dist/i18n/locales/ja.d.ts +92 -11
  114. package/dist/i18n/locales/ja.d.ts.map +1 -1
  115. package/dist/i18n/locales/ja.js +94 -13
  116. package/dist/i18n/locales/ja.js.map +1 -1
  117. package/dist/i18n/locales/nl.d.ts +92 -11
  118. package/dist/i18n/locales/nl.d.ts.map +1 -1
  119. package/dist/i18n/locales/nl.js +94 -13
  120. package/dist/i18n/locales/nl.js.map +1 -1
  121. package/dist/i18n/locales/pl.d.ts +92 -11
  122. package/dist/i18n/locales/pl.d.ts.map +1 -1
  123. package/dist/i18n/locales/pl.js +94 -13
  124. package/dist/i18n/locales/pl.js.map +1 -1
  125. package/dist/i18n/locales/pt.d.ts +92 -11
  126. package/dist/i18n/locales/pt.d.ts.map +1 -1
  127. package/dist/i18n/locales/pt.js +94 -13
  128. package/dist/i18n/locales/pt.js.map +1 -1
  129. package/dist/i18n/locales/ro.d.ts +92 -11
  130. package/dist/i18n/locales/ro.d.ts.map +1 -1
  131. package/dist/i18n/locales/ro.js +94 -13
  132. package/dist/i18n/locales/ro.js.map +1 -1
  133. package/dist/i18n/locales/ru.d.ts +92 -11
  134. package/dist/i18n/locales/ru.d.ts.map +1 -1
  135. package/dist/i18n/locales/ru.js +94 -13
  136. package/dist/i18n/locales/ru.js.map +1 -1
  137. package/dist/i18n/locales/sq.d.ts +92 -11
  138. package/dist/i18n/locales/sq.d.ts.map +1 -1
  139. package/dist/i18n/locales/sq.js +94 -13
  140. package/dist/i18n/locales/sq.js.map +1 -1
  141. package/dist/i18n/locales/sv.d.ts +92 -11
  142. package/dist/i18n/locales/sv.d.ts.map +1 -1
  143. package/dist/i18n/locales/sv.js +94 -13
  144. package/dist/i18n/locales/sv.js.map +1 -1
  145. package/dist/i18n/locales/tr.d.ts +92 -11
  146. package/dist/i18n/locales/tr.d.ts.map +1 -1
  147. package/dist/i18n/locales/tr.js +94 -13
  148. package/dist/i18n/locales/tr.js.map +1 -1
  149. package/dist/i18n/locales/zh.d.ts +92 -11
  150. package/dist/i18n/locales/zh.d.ts.map +1 -1
  151. package/dist/i18n/locales/zh.js +94 -13
  152. package/dist/i18n/locales/zh.js.map +1 -1
  153. package/dist/index.js +143 -136
  154. package/dist/index.js.map +1 -1
  155. package/dist/locales/ar.json +94 -13
  156. package/dist/locales/de.json +94 -13
  157. package/dist/locales/el.json +94 -13
  158. package/dist/locales/en.json +83 -2
  159. package/dist/locales/es.json +94 -13
  160. package/dist/locales/fr.json +94 -13
  161. package/dist/locales/hi.json +94 -13
  162. package/dist/locales/it.json +94 -13
  163. package/dist/locales/ja.json +94 -13
  164. package/dist/locales/nl.json +94 -13
  165. package/dist/locales/pl.json +94 -13
  166. package/dist/locales/pt.json +94 -13
  167. package/dist/locales/ro.json +94 -13
  168. package/dist/locales/ru.json +94 -13
  169. package/dist/locales/sq.json +94 -13
  170. package/dist/locales/sv.json +94 -13
  171. package/dist/locales/tr.json +94 -13
  172. package/dist/locales/zh.json +94 -13
  173. package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -1
  174. package/dist/patterns/calendar/calendar.journey.d.ts +9 -1
  175. package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -1
  176. package/dist/patterns/calendar/calendar.sheets.d.ts +6 -1
  177. package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
  178. package/dist/patterns/calendar/index.js +1 -1
  179. package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +164 -0
  180. package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts.map +1 -0
  181. package/dist/patterns/help-me-write-templates/index.d.ts +3 -0
  182. package/dist/patterns/help-me-write-templates/index.d.ts.map +1 -0
  183. package/dist/patterns/help-me-write-templates/index.js +10 -0
  184. package/dist/patterns/help-me-write-templates/index.js.map +1 -0
  185. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  186. package/dist/tokens.css +51 -42
  187. package/package.json +5 -1
  188. package/dist/_chunks/ai-consent-banner-DvtaM3yg.js.map +0 -1
  189. package/dist/_chunks/booking-Dn3jvv3K.js.map +0 -1
  190. package/dist/_chunks/calendar-workspace-B-fUbm62.js.map +0 -1
  191. package/dist/_chunks/contact-profile-card-Zt6WNg1u.js.map +0 -1
  192. package/dist/_chunks/editor-overlay-9tcPXNWt.js +0 -89
  193. package/dist/_chunks/editor-overlay-9tcPXNWt.js.map +0 -1
  194. package/dist/_chunks/format-price-BkMEbeW3.js +0 -47
  195. package/dist/_chunks/format-price-BkMEbeW3.js.map +0 -1
  196. package/dist/_chunks/notes-panel-CAD1Ytcj.js.map +0 -1
  197. package/dist/_chunks/panel-subview-Cc2Wtt7D.js.map +0 -1
  198. package/dist/_chunks/practice-results-D_jjzwgf.js.map +0 -1
  199. package/dist/_chunks/rich-text-editor-C6fE-uP4.js +0 -2627
  200. package/dist/_chunks/rich-text-editor-C6fE-uP4.js.map +0 -1
  201. package/dist/_chunks/sidebar-C-Gr2LL-.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"contact-profile-card-Zt6WNg1u.js","sources":["../../src/components/contact-profile-card/contact-profile-card.agent.ts","../../src/components/contact-profile-card/contact-profile-card.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { ContactProfileCardHandle } from './contact-profile-card';\n\n/* -------------------------------------------------------------------- */\n/* Agent adapter — ContactProfileCard */\n/* */\n/* Read-only adapter. Surfaces the rendered profession field so an */\n/* agent / MCP runtime can resolve \"what kind of practice is this?\" */\n/* without re-parsing the DOM. No actions yet — the card is a passive */\n/* presentation surface; navigation lives on the consumer's page. */\n/* -------------------------------------------------------------------- */\n\nexport const contactProfileCardAgent: AgentAdapter<ContactProfileCardHandle> = {\n id: 'contact-profile-card',\n // Passive presentation surface — only exposes the rendered profession for\n // introspection. No interactive capability is backed by the handle.\n capabilities: [],\n state: {\n profession: {\n type: 'string',\n descriptionKey: 'ui.agent.contactProfileCard.state.profession',\n description:\n 'Profession string the card is currently rendering — undefined when the consumer omitted it.',\n read: (handle) => handle.getProfession(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'contact-profile-card',\n description: 'Marks the ContactProfileCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n useMemo,\n type ComponentPropsWithoutRef,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n Banknote,\n ExternalLink,\n Globe,\n Heart,\n Languages as LanguagesIcon,\n Mail,\n MapPin,\n MessageCircle,\n Phone,\n ShieldCheck,\n Stethoscope,\n type LucideIcon,\n} from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Card } from '../card/card';\nimport { KeyValueList, KeyValuePair } from '../key-value-pair/key-value-pair';\nimport { Link } from '../link/link';\nimport { formatPrice } from '../_shared/format-price';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { contactProfileCardAgent } from './contact-profile-card.agent';\n\n/* -------------------------------------------------------------------- */\n/* ContactProfileCard */\n/* */\n/* Replaces the bespoke \"Profilo\" / \"Practice info\" cards that every */\n/* AlfaDocs surface composes by hand (booking-website PracticeInfoCard, */\n/* alfascribe operator pages, builders docs example, …). Composes Card */\n/* + KeyValueList + KeyValuePair so the labels share a column (no */\n/* zigzag values) and every row uses the same lucide icon family. */\n/* */\n/* The component is intentionally opinionated: every field is optional, */\n/* but the ORDER, ICONS, and LABELS are owned by the kit. Consumers */\n/* pass the data; the kit owns the visual + i18n. */\n/* */\n/* All visible text flows through `useTranslation('ui')` against the */\n/* `contactProfileCard.*` namespace. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA */\n/* -------------------------------------------------------------------- */\n\n// Override the KVP icon colour at the card root so every inner row's\n// leading glyph paints with `--accent` (brand magenta/violet) instead\n// of the default `--muted-foreground`. The ContactProfileCard is a\n// marketing surface — muted icons read as disabled against the\n// otherwise saturated card chrome. Scoped via CSS custom property so\n// only this card's icons shift; standalone KVPs elsewhere keep\n// `--muted-foreground`.\nconst rootVariants = cva(\n 'ds:w-full ds:text-[color:var(--foreground)] ds:[--key-value-pair-icon-color:var(--accent)]',\n {\n variants: {\n // Matches the kit's other `surface` props (Booking, ReviewsPanel).\n // The card itself renders `<Card variant=\"elevated\">` so the\n // `surface=\"flat\"` opt-out is rare — most consumers want the\n // boundary.\n surface: {\n flat: '',\n elevated: '',\n },\n },\n defaultVariants: { surface: 'elevated' },\n },\n);\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\nexport interface ContactProfileCardAddress {\n /** Display text — already formatted by the consumer (street, postcode, city). */\n line: string;\n /** Optional lat/lng — drives the static-map link + the embedded thumbnail. */\n lat?: number;\n lng?: number;\n}\n\nexport interface ContactProfileCardHandle {\n /** Resolved consumer-supplied data — useful for agent introspection. */\n getProfession: () => string | undefined;\n}\n\nexport interface ContactProfileCardProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children' | 'children'\n> {\n /**\n * Override the localised \"Profilo\" / \"Profile\" heading. Most\n * consumers leave this unset.\n */\n heading?: string;\n /**\n * Free-text intro paragraph rendered above the data rows (e.g.\n * the practice's `bookingDescription` field). When omitted, the\n * card jumps straight into the data rows.\n */\n description?: string;\n\n /* ----- Identity rows ----- */\n\n /** Street + postcode + city, with optional lat/lng for the map link. */\n address?: ContactProfileCardAddress;\n /** Phone number, displayed as-is. Compiled into a `tel:` link. */\n phone?: string;\n /**\n * WhatsApp number — digits only (no `+`, no spaces). Compiled into\n * a `https://wa.me/<number>` link with an optional pre-filled message.\n */\n whatsappNumber?: string;\n /** Optional pre-filled WhatsApp message. Consumer-localised. */\n whatsappMessage?: string;\n /** Public-facing email. Compiled into a `mailto:` link. */\n email?: string;\n /** Practice website (already an absolute URL with protocol). */\n website?: string;\n\n /* ----- Embedded map thumbnail ----- */\n\n /**\n * Google Maps Static API key. When provided alongside `address.lat`\n * and `address.lng`, renders a static-map thumbnail at the top of\n * the card — a single one-shot `<img>` fetch, no JS SDK boot, no\n * consent gate needed (the same pattern PracticeResults uses).\n *\n * Without it (or without coords), the card renders info rows only —\n * the address row's \"Open in Google Maps\" link is still emitted as\n * a real `<a>` so the spatial cue isn't lost.\n *\n * Additive — existing consumers that don't pass this prop see the\n * same render as before.\n */\n googleMapsApiKey?: string;\n /**\n * Zoom level for the embedded map thumbnail. Default `14` —\n * neighbourhood-level, shows the pin in context. Ignored when the\n * thumbnail isn't rendered.\n */\n mapZoom?: number;\n\n /* ----- Profile metadata ----- */\n\n /**\n * ISO 639-1 language codes the practice speaks. Rendered as\n * `<Badge variant=\"neutral\">` chips. Each code is auto-resolved\n * into the active locale's native language name via the kit's\n * built-in `languages.<iso>` i18n bundle (18 ISO codes × 18\n * locales). For example `languages={['it', 'en']}` with\n * `i18n.language === 'it'` renders \"Italiano\" + \"Inglese\".\n *\n * Unknown / unbundled codes fall back to the uppercase ISO code\n * (`'xyz'` → `'XYZ'`). To override a specific label — regional\n * dialect, brand-voice variant, codes the kit doesn't ship — pass\n * `languageLabels`.\n */\n languages?: string[];\n /**\n * Override map from ISO code → display label, applied on top of\n * the kit's i18n auto-resolution. Only set when you need a\n * consumer-specific label for a code — the typical case is\n * regional dialect / brand-voice variants / non-ISO codes.\n *\n * Resolution order: `languageLabels[code]` > `t('languages.<code>')`\n * > `code.toUpperCase()`.\n */\n languageLabels?: Record<string, string>;\n /**\n * Insurance / convention strings (consumer-supplied, free text).\n * Rendered as `<Badge variant=\"info\">` chips.\n */\n insurances?: string[];\n /**\n * First-visit price in the smallest currency unit (cents / centesimi).\n * Formatted via `Intl.NumberFormat`. Omit when the consumer doesn't\n * want to show the price.\n */\n firstVisitPriceCents?: number;\n /** ISO-4217 currency code for the price formatter. Defaults to `EUR`. */\n currencyCode?: string;\n /** Profession line — single value or already-joined comma list. */\n profession?: string;\n /** Show the \"expert for anxious patients\" row when true. */\n specializedInFearPatients?: boolean;\n\n /* ----- Telemetry hooks ----- */\n\n /**\n * Fires when the patient clicks the phone link. The kit emits a\n * `track('practice_profile_card_phone_click')` event before\n * invoking this — gate consumer-side analytics on the same event\n * to avoid duplicate fires.\n */\n onPhoneClick?: () => void;\n /** Fires when the patient clicks the WhatsApp link. */\n onWhatsAppClick?: () => void;\n /** Fires when the patient clicks the static-map link. */\n onMapClick?: () => void;\n /** Fires when the patient clicks the email mailto link. */\n onEmailClick?: () => void;\n\n /* ----- Slots ----- */\n\n /**\n * Rendered above the heading — e.g. a `<Avatar>` for the operator\n * variant, or a coloured chip strip. Optional.\n */\n headerSlot?: ReactNode;\n /**\n * Render an arbitrary map widget at the top of the card chrome —\n * replaces the built-in static `<img>` thumbnail that\n * `googleMapsApiKey` would otherwise produce. Use this when you\n * want an interactive map inside the card boundary instead of a\n * fixed image:\n *\n * <ContactProfileCard\n * mapSlot={\n * <PracticeMap practice={practice} googleMapsApiKey={key} />\n * }\n * …\n * />\n *\n * When both `mapSlot` and `googleMapsApiKey` are provided, the slot\n * wins (explicit > implicit). When neither is provided, no map area\n * renders. The slot is unstyled — pass through any container chrome\n * the consumer wants (e.g. a fixed height wrapper). The kit\n * positions it where the static thumbnail would have lived.\n */\n mapSlot?: ReactNode;\n /**\n * Rendered at the end of the card body, below the rows. Use for\n * a \"Book now\" `<Button>` or a \"View full profile\" link.\n */\n footerSlot?: ReactNode;\n\n /* ----- Styling ----- */\n\n /**\n * `'elevated'` (default) wraps the card in `<Card variant=\"elevated\">`\n * for a defined surface — what most consumers want when the card\n * stands alone on a page. `'flat'` drops the Card chrome so the\n * content sits naked — use when an outer card / sheet already\n * provides the boundary (e.g. embedded inside a `<Sheet>` or a\n * parent `<Card.Body>`).\n */\n surface?: 'flat' | 'elevated';\n\n /* ----- a11y ----- */\n\n /** Override the default region aria-label. */\n 'aria-label'?: string;\n /** Agent-readiness consumer id, surfaced as `data-component-id`. */\n id?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n/** Strip everything except digits + leading `+` for `tel:` URLs. */\nfunction normalisePhone(raw: string): string {\n return raw.replace(/[^\\d+]/g, '');\n}\n\n/** Build the WhatsApp `wa.me` URL. Number must already be digits-only. */\nfunction buildWhatsAppHref(number: string, message?: string): string {\n const base = `https://wa.me/${number}`;\n if (!message) return base;\n return `${base}?text=${encodeURIComponent(message)}`;\n}\n\n/** Google Maps search query — works without an API key. */\nfunction buildMapHref(address: ContactProfileCardAddress): string {\n const q = encodeURIComponent(address.line);\n return `https://www.google.com/maps/search/?api=1&query=${q}`;\n}\n\n/* -------------------------------------------------------------------- */\n/* MapThumbStrip — embedded Google Static Maps image */\n/* */\n/* Full-width strip rendered at the top of the card when the consumer */\n/* supplies both `address.lat`/`lng` and `googleMapsApiKey`. Same */\n/* one-shot `<img>` strategy as PracticeResults' StaticMapThumb (no JS */\n/* SDK boot → no consent gate needed), but full-card-width instead of */\n/* a 12rem aside. */\n/* -------------------------------------------------------------------- */\n\ninterface MapThumbStripProps {\n apiKey: string;\n center: { lat: number; lng: number };\n zoom: number;\n altText: string;\n}\n\n/**\n * Resolve the kit's `--map-marker-color` token to a six-character hex\n * string (no leading `#`) for Google Static Maps' `markers=color:` URL\n * parameter, which requires a literal hex value at fetch time.\n *\n * SSR-safe: when `document` is undefined we fall back to the kit's\n * brand violet. Same helper as PracticeResults — keep in sync if you\n * touch one.\n */\nfunction getStaticMapMarkerHex(): string {\n if (typeof document === 'undefined') return '4945a3';\n const raw = getComputedStyle(document.documentElement)\n .getPropertyValue('--map-marker-color')\n .trim();\n const match = /^#?([0-9a-fA-F]{6})$/.exec(raw);\n return match ? match[1] : '4945a3';\n}\n\nfunction MapThumbStrip({ apiKey, center, zoom, altText }: MapThumbStripProps) {\n // 640×192 keeps the asset under Google's 1MP free tier at scale=2\n // (1280×384 actual) and matches the strip's 12rem height at a\n // ~3.33:1 aspect ratio. Marker colour resolves from the kit's\n // `--map-marker-color` token at runtime so the value still lives\n // in `src/tokens/**` per the closed-palette constraint.\n const markerHex = getStaticMapMarkerHex();\n const src =\n `https://maps.googleapis.com/maps/api/staticmap` +\n `?center=${center.lat},${center.lng}` +\n `&zoom=${zoom}` +\n `&size=640x192&scale=2` +\n `&markers=color:0x${markerHex}%7C${center.lat},${center.lng}` +\n `&key=${encodeURIComponent(apiKey)}`;\n return (\n <img\n src={src}\n alt={altText}\n loading=\"lazy\"\n decoding=\"async\"\n width={640}\n height={192}\n className=\"ds:block ds:inline-size-full ds:block-size-[12rem] ds:[object-fit:cover] ds:rounded-[var(--radius-md)]\"\n />\n );\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const ContactProfileCard = forwardRef<\n HTMLDivElement,\n ContactProfileCardProps\n>(\n (\n {\n heading,\n description,\n address,\n phone,\n whatsappNumber,\n whatsappMessage,\n email,\n website,\n languages,\n languageLabels,\n insurances,\n firstVisitPriceCents,\n currencyCode = 'EUR',\n profession,\n specializedInFearPatients,\n googleMapsApiKey,\n mapZoom = 14,\n onPhoneClick,\n onWhatsAppClick,\n onMapClick,\n onEmailClick,\n headerSlot,\n footerSlot,\n mapSlot,\n surface = 'elevated',\n 'aria-label': ariaLabel,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const headingId = useId();\n const locale = i18n.language ?? 'en';\n\n const resolvedHeading = heading ?? t('contactProfileCard.heading');\n const resolvedAriaLabel = ariaLabel ?? resolvedHeading;\n\n const formattedPrice = useMemo(() => {\n if (firstVisitPriceCents == null) return undefined;\n return formatPrice(firstVisitPriceCents, currencyCode, locale);\n }, [firstVisitPriceCents, currencyCode, locale]);\n\n // Compose the rows in display order. Each `row` carries the icon +\n // localised label + the rendered value. Skipping a field is just\n // omitting the row — `KeyValueList` collapses the subgrid cleanly.\n const rows: Array<{\n key: string;\n icon: ReactElement;\n label: string;\n value: ReactNode;\n alignValue?: 'start' | 'end';\n }> = [];\n\n if (address) {\n rows.push({\n key: 'address',\n icon: <MapPin aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.address'),\n value: (\n <span className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <span>{address.line}</span>\n {address.lat != null && address.lng != null ? (\n <Link\n href={buildMapHref(address)}\n external\n intent=\"default\"\n onClick={onMapClick}\n >\n {t('contactProfileCard.openInGoogleMaps')}\n </Link>\n ) : null}\n </span>\n ),\n });\n }\n\n if (phone) {\n rows.push({\n key: 'phone',\n icon: <Phone aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.phone'),\n value: (\n <Link\n href={`tel:${normalisePhone(phone)}`}\n intent=\"default\"\n onClick={onPhoneClick}\n >\n {phone}\n </Link>\n ),\n });\n }\n\n if (whatsappNumber) {\n rows.push({\n key: 'whatsapp',\n icon: <MessageCircle aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.whatsapp'),\n value: (\n <Link\n href={buildWhatsAppHref(whatsappNumber, whatsappMessage)}\n external\n intent=\"default\"\n onClick={onWhatsAppClick}\n >\n {whatsappNumber}\n </Link>\n ),\n });\n }\n\n if (email) {\n rows.push({\n key: 'email',\n icon: <Mail aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.email'),\n value: (\n <Link\n href={`mailto:${email}`}\n intent=\"default\"\n onClick={onEmailClick}\n >\n {email}\n </Link>\n ),\n });\n }\n\n if (website) {\n rows.push({\n key: 'website',\n icon: <Globe aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.website'),\n value: (\n <Link href={website} external intent=\"default\">\n {website}\n </Link>\n ),\n });\n }\n\n if (languages && languages.length > 0) {\n // Resolution order, highest to lowest:\n // 1. consumer `languageLabels` override — for regional dialects,\n // brand-voice variants, or codes the kit doesn't ship.\n // 2. kit i18n bundle (`languages.<iso>`) — auto-resolves the 18\n // ISO codes the kit ships into the active locale's native\n // language name. Retires consumer-side ISO→label plumbing.\n // 3. uppercase fallback for unknown codes that the consumer\n // didn't override.\n const resolveLabel = (code: string): string => {\n if (languageLabels?.[code]) return languageLabels[code];\n const key = `languages.${code}`;\n if (i18n.exists(key)) return t(key);\n return code.toUpperCase();\n };\n rows.push({\n key: 'languages',\n icon: <LanguagesIcon aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.languages'),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {languages.map((code) => (\n <Badge key={code} variant=\"neutral\">\n {resolveLabel(code)}\n </Badge>\n ))}\n </span>\n ),\n });\n }\n\n if (insurances && insurances.length > 0) {\n rows.push({\n key: 'insurances',\n icon: <ShieldCheck aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.insurances'),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {insurances.map((ins) => (\n <Badge key={ins} variant=\"info\">\n {ins}\n </Badge>\n ))}\n </span>\n ),\n });\n }\n\n if (formattedPrice) {\n // The one figure on this card a patient compares between\n // practices, so it gets a chip and is pinned to the row's end.\n // Left as body text where the label happens to stop, its\n // position shifts card to card and the eye has to hunt for it.\n // `accentSoft`, not `brand`. The languages and insurance rows on\n // this card are tonal chips (`neutral` and `info`), so a solid\n // `brand` fill would read as a different class of object rather\n // than the same family. `accentSoft` is the same tonal recipe in\n // the most distinct hue on the card, so the price still leads.\n // `lg` because `md` sets the label at the smallest step of the\n // ramp, and `.theme-accessible` cannot lift it — the one figure\n // patients compare should not be the smallest text on the card.\n rows.push({\n key: 'firstVisitPrice',\n icon: <Banknote aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.firstVisitPrice'),\n value: (\n <Badge variant=\"accentSoft\" size=\"lg\">\n {formattedPrice}\n </Badge>\n ),\n alignValue: 'end',\n });\n }\n\n if (specializedInFearPatients) {\n rows.push({\n key: 'expertForAnxiousPatients',\n icon: <Heart aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.expertForAnxiousPatients'),\n value: t('contactProfileCard.value.yesShort'),\n });\n }\n\n if (profession) {\n rows.push({\n key: 'profession',\n icon: <Stethoscope aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.profession'),\n value: profession,\n });\n }\n\n // Imperative handle for agent integrations.\n useAgentRegistration(\n contactProfileCardAgent,\n { getProfession: () => profession },\n id,\n );\n\n // Embedded static-map thumbnail. Renders only when the consumer\n // supplies BOTH a usable lat/lng pair AND a `googleMapsApiKey`.\n // The d.ts-promised behaviour; without a key the strip is silently\n // omitted and the address row's \"Open in Google Maps\" link still\n // emits as the spatial-cue fallback.\n const showMapThumb =\n !!googleMapsApiKey &&\n address?.lat !== undefined &&\n address?.lng !== undefined;\n const mapThumb = showMapThumb ? (\n <MapThumbStrip\n apiKey={googleMapsApiKey!}\n center={{ lat: address!.lat!, lng: address!.lng! }}\n zoom={mapZoom}\n altText={t('contactProfileCard.map.alt', {\n address: address!.line,\n defaultValue: 'Map showing {{address}}',\n })}\n />\n ) : null;\n\n // Map area: explicit consumer slot wins over the implicit\n // googleMapsApiKey-driven static thumbnail. 0.33.4 introduces the\n // slot so consumers can embed an interactive <MapView> /\n // <PracticeMap> wrapper inside the card chrome instead of the\n // fixed static <img>. When neither is set the area renders as\n // nothing. 0.33.6 moves the area from above the heading to below\n // the data rows — the map reads as the spatial closer (\"here it\n // is on the map\") rather than a stylised hero, and any CTA in\n // footerSlot still lands at the very bottom.\n const mapArea = mapSlot ?? mapThumb;\n\n const body = (\n <>\n {description ? (\n <p className=\"type-body-sm ds:m-0 ds:whitespace-pre-line\">\n {description}\n </p>\n ) : null}\n {rows.length > 0 ? (\n <KeyValueList rowGap=\"md\">\n {rows.map((row) => (\n <KeyValuePair\n key={row.key}\n icon={row.icon}\n label={row.label}\n value={row.value}\n alignValue={row.alignValue}\n />\n ))}\n </KeyValueList>\n ) : null}\n {mapArea}\n {footerSlot}\n </>\n );\n\n // `surface=\"flat\"` skips the Card wrapper — the consumer is\n // already inside a Card / Sheet and doesn't want a double border.\n const inner = (\n <>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n {headerSlot}\n <h2\n id={headingId}\n className=\"type-title-card ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {resolvedHeading}\n </h2>\n </div>\n {body}\n </>\n );\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={resolvedAriaLabel}\n aria-labelledby={headingId}\n data-component=\"contact-profile-card\"\n data-component-id={id}\n id={id}\n className={rootVariants({ surface, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {inner}\n </Card.Body>\n </Card>\n ) : (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {inner}\n </div>\n )}\n </div>\n );\n },\n);\n\nContactProfileCard.displayName = 'ContactProfileCard';\n\n// Helper export so consumers can mirror the kit's row order if they\n// need to compose a partial alternative (rare).\nexport const CONTACT_PROFILE_CARD_ROW_KEYS = [\n 'address',\n 'phone',\n 'whatsapp',\n 'email',\n 'website',\n 'languages',\n 'insurances',\n 'firstVisitPrice',\n 'expertForAnxiousPatients',\n 'profession',\n] as const;\n\n// Defensive icon export so consumers can render the same glyph\n// outside the card if they need it for consistency.\nexport const CONTACT_PROFILE_CARD_ROW_ICONS: Record<\n (typeof CONTACT_PROFILE_CARD_ROW_KEYS)[number],\n LucideIcon\n> = {\n address: MapPin,\n phone: Phone,\n whatsapp: MessageCircle,\n email: Mail,\n website: Globe,\n languages: LanguagesIcon,\n insurances: ShieldCheck,\n firstVisitPrice: Banknote,\n expertForAnxiousPatients: Heart,\n profession: Stethoscope,\n};\n\n// Re-exports of the rootVariants type for downstream typing.\nexport type ContactProfileCardSurface = NonNullable<\n VariantProps<typeof rootVariants>['surface']\n>;\n\n// ExternalLink is exported by lucide-react and used elsewhere in the\n// kit; re-exporting here so consumers don't have to add it as a\n// peer-dep import for icon parity in their own UIs.\nexport { ExternalLink };\n"],"names":["contactProfileCardAgent","handle","rootVariants","cva","normalisePhone","raw","buildWhatsAppHref","number","message","base","buildMapHref","address","getStaticMapMarkerHex","match","MapThumbStrip","apiKey","center","zoom","altText","markerHex","src","jsx","ContactProfileCard","forwardRef","heading","description","phone","whatsappNumber","whatsappMessage","email","website","languages","languageLabels","insurances","firstVisitPriceCents","currencyCode","profession","specializedInFearPatients","googleMapsApiKey","mapZoom","onPhoneClick","onWhatsAppClick","onMapClick","onEmailClick","headerSlot","footerSlot","mapSlot","surface","ariaLabel","id","className","rest","ref","i18n","useTranslation","headingId","useId","locale","resolvedHeading","resolvedAriaLabel","formattedPrice","useMemo","formatPrice","rows","MapPin","jsxs","Link","Phone","MessageCircle","Mail","Globe","resolveLabel","code","key","LanguagesIcon","Badge","ShieldCheck","ins","Banknote","Heart","Stethoscope","useAgentRegistration","mapThumb","mapArea","body","Fragment","KeyValueList","row","KeyValuePair","inner","Card","CONTACT_PROFILE_CARD_ROW_KEYS","CONTACT_PROFILE_CARD_ROW_ICONS"],"mappings":";;;;;;;;;;;;;;;;;;;AAYO,MAAMA,KAAkE;AAAA,EAC7E,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAA;AAAA,EACd,OAAO;AAAA,IACL,YAAY;AAAA,MACV,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,cAAA;AAAA,IAAc;AAAA,EACzC;AAAA,EAEF,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,IAEf,YAAY;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GCqBMC,KAAeC;AAAA,EACnB;AAAA,EACA;AAAA,IACE,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,MAKR,SAAS;AAAA,QACP,MAAM;AAAA,QACN,UAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IAEF,iBAAiB,EAAE,SAAS,WAAA;AAAA,EAAW;AAE3C;AAmMA,SAASC,GAAeC,GAAqB;AAC3C,SAAOA,EAAI,QAAQ,WAAW,EAAE;AAClC;AAGA,SAASC,GAAkBC,GAAgBC,GAA0B;AACnE,QAAMC,IAAO,iBAAiBF,CAAM;AACpC,SAAKC,IACE,GAAGC,CAAI,SAAS,mBAAmBD,CAAO,CAAC,KAD7BC;AAEvB;AAGA,SAASC,GAAaC,GAA4C;AAEhE,SAAO,mDADG,mBAAmBA,EAAQ,IAAI,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AAG;AAAA,UAAA;AAAA,QAAA;AAAA,MACH,GACF;AAAA,MACC0B;AAAA,IAAA,GACH;AAGF,WACE,gBAAA/D;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAA+B;AAAA,QACA,MAAK;AAAA,QACL,cAAYO;AAAA,QACZ,mBAAiBJ;AAAA,QACjB,kBAAe;AAAA,QACf,qBAAmBN;AAAA,QACnB,IAAAA;AAAA,QACA,WAAW/C,GAAa,EAAE,SAAA6C,GAAS,WAAAG,IAAW;AAAA,QAC7C,GAAGC;AAAA,QAEH,gBAAY,aACX,gBAAA9B,EAACqE,KAAK,SAAQ,YACZ,4BAACA,EAAK,MAAL,EAAU,WAAU,kDAClB,aACH,EAAA,CACF,sBAEC,OAAA,EAAI,WAAU,kDACZ,UAAAD,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAnE,GAAmB,cAAc;AAI1B,MAAMqE,KAAgC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAIaC,KAGT;AAAA,EACF,SAAS5B;AAAA,EACT,OAAOG;AAAA,EACP,UAAUC;AAAA,EACV,OAAOC;AAAA,EACP,SAASC;AAAA,EACT,WAAWI;AAAAA,EACX,YAAYE;AAAA,EACZ,iBAAiBE;AAAA,EACjB,0BAA0BC;AAAA,EAC1B,YAAYC;AACd;"}
@@ -1,89 +0,0 @@
1
- import { jsx as s, jsxs as f } from "react/jsx-runtime";
2
- import { useRef as p, useId as w, useCallback as y, useEffect as k } from "react";
3
- import { useTranslation as E } from "react-i18next";
4
- import { c as j } from "./index-D2ZczOXr.js";
5
- import { I } from "./icon-button-CehAeZoP.js";
6
- import { X as N } from "./x-B5YnXwCz.js";
7
- const z = j(
8
- [
9
- // Spans the editor's block-end edge (a docked bar) and expands from the pill.
10
- "ds:absolute ds:z-20",
11
- "ds:[inset-inline-start:var(--spacing-md)] ds:[inset-inline-end:var(--spacing-md)]",
12
- "ds:[inset-block-end:var(--spacing-md)]",
13
- // Slim docked bar — compact but with a little breathing room.
14
- "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
15
- "ds:p-[var(--spacing-md)]",
16
- "ds:rounded-[var(--radius-lg)]",
17
- // Apple "Liquid Glass": a translucent base + backdrop blur/saturate so the
18
- // editor shows through, a specular top "rim" + inner hairline ring, and a
19
- // soft drop shadow for a floating slab. --card-border is theme-aware (dark
20
- // hairline on light themes, bright on dark), so the rim reads in all four.
21
- "ds:bg-[color-mix(in_srgb,var(--popover)_64%,transparent)]",
22
- "ds:backdrop-blur-xl ds:backdrop-saturate-150",
23
- "ds:border ds:border-[color-mix(in_srgb,var(--card-border)_70%,transparent)]",
24
- "ds:shadow-[inset_0_1px_0_0_var(--card-border),inset_0_0_0_1px_color-mix(in_srgb,var(--card-border)_35%,transparent),var(--shadow-lg)]",
25
- // Liquid-glass grow out of the pill (bottom-inline-end origin).
26
- "ds:origin-bottom-right ds:animate-in ds:fade-in-0 ds:zoom-in-95",
27
- "ds:motion-reduce:animate-none"
28
- ].join(" ")
29
- ), C = "ds:text-[length:var(--font-size-base)] ds:font-medium ds:text-[color:var(--foreground)]";
30
- function D({
31
- open: n,
32
- onClose: t,
33
- title: a,
34
- ariaLabel: v,
35
- children: b,
36
- footer: i,
37
- id: g,
38
- className: x
39
- }) {
40
- const { t: _ } = E(), o = p(null), c = p(null), l = w(), d = y(() => t(), [t]);
41
- return k(() => {
42
- if (!n) return;
43
- c.current = document.activeElement;
44
- const h = window.requestAnimationFrame(() => {
45
- var r, u;
46
- (u = ((r = o.current) == null ? void 0 : r.querySelector(
47
- 'input, textarea, button, [tabindex]:not([tabindex="-1"])'
48
- )) ?? o.current) == null || u.focus();
49
- }), m = (e) => {
50
- e.key === "Escape" && (e.stopPropagation(), d());
51
- };
52
- return document.addEventListener("keydown", m), () => {
53
- var e, r;
54
- window.cancelAnimationFrame(h), document.removeEventListener("keydown", m), (r = (e = c.current) == null ? void 0 : e.focus) == null || r.call(e);
55
- };
56
- }, [n, d]), n ? /* @__PURE__ */ s("div", { "data-component": "editor-overlay", "data-component-id": g, children: /* @__PURE__ */ f(
57
- "div",
58
- {
59
- ref: o,
60
- role: "dialog",
61
- "aria-modal": "false",
62
- "aria-labelledby": a ? l : void 0,
63
- "aria-label": a ? void 0 : v,
64
- tabIndex: -1,
65
- className: [z(), x].filter(Boolean).join(" "),
66
- children: [
67
- a ? /* @__PURE__ */ f("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
68
- /* @__PURE__ */ s("div", { id: l, className: C, children: a }),
69
- /* @__PURE__ */ s(
70
- I,
71
- {
72
- size: "sm",
73
- intent: "ghost",
74
- icon: /* @__PURE__ */ s(N, {}),
75
- "aria-label": _("common.close"),
76
- onClick: d
77
- }
78
- )
79
- ] }) : null,
80
- /* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: b }),
81
- i ? /* @__PURE__ */ s("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-end ds:gap-[var(--spacing-sm)]", children: i }) : null
82
- ]
83
- }
84
- ) }) : null;
85
- }
86
- export {
87
- D as E
88
- };
89
- //# sourceMappingURL=editor-overlay-9tcPXNWt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-overlay-9tcPXNWt.js","sources":["../../src/components/editor-overlay/editor-overlay.tsx"],"sourcesContent":["/* ------------------------------------------------------------------ */\n/* EditorOverlay — a non-modal, liquid-glass bar docked INSIDE an */\n/* editor region (Gemini / Mac Mail \"Help me write\" style). */\n/* */\n/* Unlike Dialog it does NOT centre on screen, trap focus, or make the */\n/* page inert — and there is NO scrim, so the editor stays visible and */\n/* usable behind it. It expands from the AI pill into a frosted, */\n/* translucent, rounded bar across the editor's block-end edge. The */\n/* host must be `position: relative` (the RichTextEditor editor region */\n/* is); the overlay anchors to it absolutely. Escape and the close */\n/* button dismiss it. Reusable for any editor-attached surface (AI */\n/* draft, future inline tools). */\n/* ------------------------------------------------------------------ */\n\nimport { useCallback, useEffect, useId, useRef, type ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { X } from 'lucide-react';\nimport { cva } from 'class-variance-authority';\n\nimport { IconButton } from '../button';\n\nexport interface EditorOverlayProps {\n /** Controlled visibility. */\n open: boolean;\n /** Close request (Escape or the close button). */\n onClose: () => void;\n /** Optional visible heading; renders a header row with a close button. */\n title?: ReactNode;\n /** Accessible name for the overlay region (use when there is no visible title). */\n ariaLabel?: string;\n /** Body content. */\n children: ReactNode;\n /** Optional footer slot (e.g. action buttons), right-aligned. */\n footer?: ReactNode;\n /**\n * Opaque instance id, emitted on the wrapper as `data-component-id`. Pass it\n * when more than one overlay can be mounted so an agent / automation tool can\n * tell them apart (PRS §26 §6).\n */\n id?: string;\n /** Extra classes on the glass card. */\n className?: string;\n}\n\n// Non-blocking liquid-glass bar docked across the editor's block-end edge,\n// expanding from the AI pill. No scrim — the editor stays visible + usable.\nconst cardVariants = cva(\n [\n // Spans the editor's block-end edge (a docked bar) and expands from the pill.\n 'ds:absolute ds:z-20',\n 'ds:[inset-inline-start:var(--spacing-md)] ds:[inset-inline-end:var(--spacing-md)]',\n 'ds:[inset-block-end:var(--spacing-md)]',\n // Slim docked bar — compact but with a little breathing room.\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]',\n 'ds:p-[var(--spacing-md)]',\n 'ds:rounded-[var(--radius-lg)]',\n // Apple \"Liquid Glass\": a translucent base + backdrop blur/saturate so the\n // editor shows through, a specular top \"rim\" + inner hairline ring, and a\n // soft drop shadow for a floating slab. --card-border is theme-aware (dark\n // hairline on light themes, bright on dark), so the rim reads in all four.\n 'ds:bg-[color-mix(in_srgb,var(--popover)_64%,transparent)]',\n 'ds:backdrop-blur-xl ds:backdrop-saturate-150',\n 'ds:border ds:border-[color-mix(in_srgb,var(--card-border)_70%,transparent)]',\n 'ds:shadow-[inset_0_1px_0_0_var(--card-border),inset_0_0_0_1px_color-mix(in_srgb,var(--card-border)_35%,transparent),var(--shadow-lg)]',\n // Liquid-glass grow out of the pill (bottom-inline-end origin).\n 'ds:origin-bottom-right ds:animate-in ds:fade-in-0 ds:zoom-in-95',\n 'ds:motion-reduce:animate-none',\n ].join(' '),\n);\n\nconst titleClass =\n 'ds:text-[length:var(--font-size-base)] ds:font-medium ds:text-[color:var(--foreground)]';\n\nexport function EditorOverlay({\n open,\n onClose,\n title,\n ariaLabel,\n children,\n footer,\n id,\n className,\n}: EditorOverlayProps): React.JSX.Element | null {\n const { t } = useTranslation();\n const cardRef = useRef<HTMLDivElement>(null);\n const restoreFocusRef = useRef<HTMLElement | null>(null);\n const titleId = useId();\n\n const handleClose = useCallback(() => onClose(), [onClose]);\n\n useEffect(() => {\n if (!open) return undefined;\n restoreFocusRef.current = document.activeElement as HTMLElement | null;\n // Move focus into the overlay (non-modal: we don't trap it, just seed it).\n const raf = window.requestAnimationFrame(() => {\n const focusable = cardRef.current?.querySelector<HTMLElement>(\n 'input, textarea, button, [tabindex]:not([tabindex=\"-1\"])',\n );\n (focusable ?? cardRef.current)?.focus();\n });\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') {\n event.stopPropagation();\n handleClose();\n }\n };\n document.addEventListener('keydown', onKeyDown);\n return () => {\n window.cancelAnimationFrame(raf);\n document.removeEventListener('keydown', onKeyDown);\n restoreFocusRef.current?.focus?.();\n };\n }, [open, handleClose]);\n\n if (!open) return null;\n\n return (\n <div data-component=\"editor-overlay\" data-component-id={id}>\n <div\n ref={cardRef}\n role=\"dialog\"\n aria-modal=\"false\"\n aria-labelledby={title ? titleId : undefined}\n aria-label={title ? undefined : ariaLabel}\n tabIndex={-1}\n className={[cardVariants(), className].filter(Boolean).join(' ')}\n >\n {/* Header only when there's a visible title — a title-less overlay is a\n header-less composer (named via ariaLabel) whose consumer provides\n its own inline close so no empty band is reserved for it. */}\n {title ? (\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <div id={titleId} className={titleClass}>\n {title}\n </div>\n <IconButton\n size=\"sm\"\n intent=\"ghost\"\n icon={<X />}\n aria-label={t('common.close')}\n onClick={handleClose}\n />\n </div>\n ) : null}\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n {children}\n </div>\n {footer ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:justify-end ds:gap-[var(--spacing-sm)]\">\n {footer}\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"names":["cardVariants","cva","titleClass","EditorOverlay","open","onClose","title","ariaLabel","children","footer","id","className","t","useTranslation","cardRef","useRef","restoreFocusRef","titleId","useId","handleClose","useCallback","useEffect","raf","_b","_a","onKeyDown","event","jsx","jsxs","IconButton","X"],"mappings":";;;;;;AA8CA,MAAMA,IAAeC;AAAA,EACnB;AAAA;AAAA,IAEE;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AACZ,GAEMC,IACJ;AAEK,SAASC,EAAc;AAAA,EAC5B,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,IAAAC;AAAA,EACA,WAAAC;AACF,GAAiD;AAC/C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAUC,EAAuB,IAAI,GACrCC,IAAkBD,EAA2B,IAAI,GACjDE,IAAUC,EAAA,GAEVC,IAAcC,EAAY,MAAMf,KAAW,CAACA,CAAO,CAAC;AA0B1D,SAxBAgB,EAAU,MAAM;AACd,QAAI,CAACjB,EAAM;AACX,IAAAY,EAAgB,UAAU,SAAS;AAEnC,UAAM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AA,EAAI,WAAU,kDACZ,UAAAnB,EAAA,CACH;AAAA,QACCC,IACC,gBAAAkB,EAAC,OAAA,EAAI,WAAU,kFACZ,aACH,IACE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAER,IAvCgB;AAyCpB;"}
@@ -1,47 +0,0 @@
1
- const a = /* @__PURE__ */ new Set([
2
- "BIF",
3
- "CLP",
4
- "DJF",
5
- "GNF",
6
- "IDR",
7
- "JPY",
8
- "KMF",
9
- "KRW",
10
- "MGA",
11
- "PYG",
12
- "RWF",
13
- "UGX",
14
- "VND",
15
- "VUV",
16
- "XAF",
17
- "XOF",
18
- "XPF"
19
- ]);
20
- function s(e, n, o) {
21
- const r = n.toUpperCase(), t = a.has(r) ? e : e / 100;
22
- try {
23
- return new Intl.NumberFormat(o, {
24
- style: "currency",
25
- currency: r
26
- }).format(t);
27
- } catch {
28
- return `${a.has(r) ? String(t) : t.toFixed(2)} ${r}`;
29
- }
30
- }
31
- function u(e, n, o, r = {}) {
32
- const t = n.toUpperCase(), c = a.has(t) ? e : e / 100;
33
- try {
34
- return new Intl.NumberFormat(o, {
35
- style: "currency",
36
- currency: t,
37
- ...r
38
- }).formatToParts(c);
39
- } catch {
40
- return null;
41
- }
42
- }
43
- export {
44
- s as a,
45
- u as f
46
- };
47
- //# sourceMappingURL=format-price-BkMEbeW3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"format-price-BkMEbeW3.js","sources":["../../src/components/_shared/format-price.ts"],"sourcesContent":["/**\n * Shared money formatter for the kit's \"price in minor units\" convention.\n *\n * Every component that renders a price takes the amount as an integer in\n * the smallest currency unit (cents / centesimi) plus an ISO-4217\n * `currencyCode`, and the KIT does the formatting — the consumer never\n * hands the kit a pre-rendered string. Lifted from the file-local\n * duplicate in `contact-profile-card.tsx` when PracticeResults adopted\n * the same convention, so both surfaces render an identical price for\n * identical input.\n *\n * Not to be confused with `formatPaymentAmount` (payment-form): that one\n * is the checkout formatter and falls back to an `en` currency string so\n * a raw integer can never leak into a payment UI. This is the lightweight\n * leaf helper for read-only price captions — it lives in `_shared` so a\n * SERP card can use it without pulling the payment-form module graph in.\n * Both apply the same zero-decimal divisor rule; only the failure\n * behaviour differs.\n */\n\n/**\n * Currencies with no minor unit — the integer IS the major amount, so\n * dividing by 100 would render the price 100× too small. Pinned to\n * Stripe's list: https://stripe.com/docs/currencies#zero-decimal\n *\n * Kept in step with `ZERO_DECIMAL_CURRENCIES` in\n * `src/components/payment-form/payment-form.tsx`. Consolidating the two\n * into one exported set is a follow-up — payment-form is a shipped\n * subpath entry and re-pointing it is out of scope here.\n */\nconst ZERO_DECIMAL_CURRENCIES = new Set<string>([\n 'BIF',\n 'CLP',\n 'DJF',\n 'GNF',\n 'IDR',\n 'JPY',\n 'KMF',\n 'KRW',\n 'MGA',\n 'PYG',\n 'RWF',\n 'UGX',\n 'VND',\n 'VUV',\n 'XAF',\n 'XOF',\n 'XPF',\n]);\n\nexport function formatPrice(\n minorUnits: number,\n currency: string,\n locale: string,\n): string {\n const iso = currency.toUpperCase();\n const major = ZERO_DECIMAL_CURRENCIES.has(iso)\n ? minorUnits\n : minorUnits / 100;\n try {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency: iso,\n }).format(major);\n } catch {\n // Locale or currency code rejected. Fall back to a plain amount — but\n // keep the zero-decimal rule, or the fallback would reintroduce the very\n // bug this module exists to fix (`JPY 8000` reading as \"8000.00\"), and\n // keep the ISO code so the reader is not left with a bare number.\n const amount = ZERO_DECIMAL_CURRENCIES.has(iso)\n ? String(major)\n : major.toFixed(2);\n return `${amount} ${iso}`;\n }\n}\n\n/**\n * The same amount as {@link formatPrice}, but broken into its typed parts so\n * a renderer can treat the fraction differently from the rest.\n *\n * Splitting a formatted price with a regex is not safe across locales: in\n * `it-IT` the group separator is `.` and the decimal is `,`, so `1.000 €`\n * would read as a fraction of `000` and a \"drop the zero fraction\" rule\n * would render it as `1 €`. `Intl.NumberFormat.formatToParts` labels each\n * piece, so the fraction is whatever the locale says it is, wherever it\n * sits relative to the currency symbol.\n *\n * Returns `null` when the locale or currency is rejected — callers fall\n * back to {@link formatPrice}, which keeps the zero-decimal rule.\n */\nexport function formatPriceParts(\n minorUnits: number,\n currency: string,\n locale: string,\n options: Pick<Intl.NumberFormatOptions, 'signDisplay'> = {},\n): Intl.NumberFormatPart[] | null {\n const iso = currency.toUpperCase();\n const major = ZERO_DECIMAL_CURRENCIES.has(iso)\n ? minorUnits\n : minorUnits / 100;\n try {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency: iso,\n ...options,\n }).formatToParts(major);\n } catch {\n return null;\n }\n}\n"],"names":["ZERO_DECIMAL_CURRENCIES","formatPrice","minorUnits","currency","locale","iso","major","formatPriceParts","options"],"mappings":"AA8BA,MAAMA,wBAA8B,IAAY;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,SAASC,EACdC,GACAC,GACAC,GACQ;AACR,QAAMC,IAAMF,EAAS,YAAA,GACfG,IAAQN,EAAwB,IAAIK,CAAG,IACzCH,IACAA,IAAa;AACjB,MAAI;AACF,WAAO,IAAI,KAAK,aAAaE,GAAQ;AAAA,MACnC,OAAO;AAAA,MACP,UAAUC;AAAA,IAAA,CACX,EAAE,OAAOC,CAAK;AAAA,EACjB,QAAQ;AAQN,WAAO,GAHQN,EAAwB,IAAIK,CAAG,IAC1C,OAAOC,CAAK,IACZA,EAAM,QAAQ,CAAC,CACH,IAAID,CAAG;AAAA,EACzB;AACF;AAgBO,SAASE,EACdL,GACAC,GACAC,GACAI,IAAyD,CAAA,GACzB;AAChC,QAAMH,IAAMF,EAAS,YAAA,GACfG,IAAQN,EAAwB,IAAIK,CAAG,IACzCH,IACAA,IAAa;AACjB,MAAI;AACF,WAAO,IAAI,KAAK,aAAaE,GAAQ;AAAA,MACnC,OAAO;AAAA,MACP,UAAUC;AAAA,MACV,GAAGG;AAAA,IAAA,CACJ,EAAE,cAAcF,CAAK;AAAA,EACxB,QAAQ;AACN,WAAO;AAAA,EACT;AACF;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"notes-panel-CAD1Ytcj.js","sources":["../../src/components/_shared/get-error-message.ts","../../src/components/notes-panel/notes-panel.agent.ts","../../src/components/notes-panel/notes-panel.tsx"],"sourcesContent":["/** Read host error messages without relying on the host's JavaScript realm. */\nexport function getErrorMessage(error: unknown, fallback: string): string {\n if (\n typeof error === 'object' &&\n error !== null &&\n 'message' in error &&\n typeof error.message === 'string' &&\n error.message.trim()\n ) {\n return error.message;\n }\n return fallback;\n}\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — NotesPanel. */\n/* */\n/* The Notes tool: a composer over a note timeline. The agent reads the */\n/* timeline STRUCTURE (note ids + pinned / flagged / clinical flags — */\n/* never the note body or author, both PHI), composes and commits a new */\n/* note, and toggles a note's pinned / flagged state. `add_note` carries */\n/* the `phi` safety class: a note body is patient-identifiable clinical */\n/* content, so the host gates it behind the same confirm-before-act as a */\n/* destructive write and never auto-confirms. A clinical submission also */\n/* requires the host's `practice_add_clinical_note` permission (the */\n/* handle drops it when the gate is closed). Host-owned per-note */\n/* `noteActions` (edit, delete…) sit outside this handle — an agent */\n/* reaches them through the host's own adapters. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { NotesPanelHandle } from './notes-panel';\n\nexport const notesPanelAgent: AgentAdapter<NotesPanelHandle> = {\n id: 'notes-panel',\n // 'submit' backs add_note (compose + commit a note). pin / flag are toggles\n // with no dedicated capability in the closed vocabulary.\n capabilities: ['submit'],\n state: {\n notes: {\n type: 'Array<{ id?: string; pinned: boolean; flagged: boolean; clinical: boolean }>',\n descriptionKey: 'ui.agent.notesPanel.state.notes',\n description:\n 'Timeline note ids + pinned / flagged / clinical flags. Never the note body or author (both PHI).',\n read: (handle) => handle.getNotes(),\n },\n canAddClinical: {\n type: 'boolean',\n descriptionKey: 'ui.agent.notesPanel.state.canAddClinical',\n description:\n 'Whether the current user may write clinical notes (the practice_add_clinical_note permission gate).',\n read: (handle) => handle.canAddClinical(),\n },\n currentNoteId: {\n type: 'string | null',\n descriptionKey: 'ui.agent.notesPanel.state.currentNoteId',\n description:\n 'Id of the note the host has addressed — the one marked, scrolled to and focused. Null when none is. An id only, never note content.',\n read: (handle) => handle.getCurrentNoteId(),\n },\n },\n actions: {\n add_note: {\n // Writes a clinical/admin note body — patient-identifiable content. PHI.\n safety: 'phi',\n argsType: '{ content: string; clinical: boolean }',\n argsSchema: {\n type: 'object',\n properties: {\n content: {\n type: 'string',\n description:\n 'Note body. Rich HTML for the rich composer, else plain text.',\n },\n clinical: {\n type: 'boolean',\n description:\n 'Whether the note is clinical. Requires the clinical-note permission; the submission is dropped when the gate is closed.',\n },\n },\n required: ['content', 'clinical'],\n },\n openWorld: true,\n descriptionKey: 'ui.agent.notesPanel.actions.addNote',\n description:\n 'Compose and commit a new note. A clinical note requires the clinical-note permission (read canAddClinical first).',\n examples: [\n {\n args: { content: 'Patient reported improvement.', clinical: true },\n note: 'Add a clinical note.',\n },\n ],\n invoke: (handle, args: { content: string; clinical: boolean }) => {\n return handle.addNote(args);\n },\n },\n toggle_pin: {\n // Re-orders the timeline (pinned notes lead) — reversible view write.\n safety: 'write',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: false,\n descriptionKey: 'ui.agent.notesPanel.actions.togglePin',\n description:\n 'Toggle the pinned state of the note with the given id. Refused for a deleted note or one whose actions.pin is false.',\n invoke: (handle, args: { id: string }) => {\n handle.togglePin(args.id);\n },\n },\n toggle_flag: {\n safety: 'write',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: false,\n descriptionKey: 'ui.agent.notesPanel.actions.toggleFlag',\n description: 'Toggle the flagged state of the note with the given id.',\n invoke: (handle, args: { id: string }) => {\n handle.toggleFlag(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'notes-panel',\n description: 'Marks the NotesPanel region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific notes panel from the agent.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { getErrorMessage } from '../_shared/get-error-message';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { notesPanelAgent } from './notes-panel.agent';\nimport { ClinicalNoteCard } from '../clinical-note-card';\nimport type { ClinicalNoteCardProps } from '../clinical-note-card';\nimport { RichTextEditor } from '../rich-text-editor';\nimport type {\n RichTextEditorHandle,\n RichTextEditorProps,\n RichTextEditorToolbar,\n RedactorFactory,\n} from '../rich-text-editor';\nimport { TextArea } from '../text-area';\nimport { Alert } from '../alert';\nimport { Button, IconButton } from '../button';\nimport { Checkbox } from '../checkbox';\nimport { Card } from '../card/card';\nimport { CONTENT_ENTER_CLASS, Skeleton } from '../skeleton/skeleton';\nimport { Dialog } from '../dialog';\nimport { NotebookPen, Pencil, Trash2 } from 'lucide-react';\nimport { PanelHeader } from '../panel-header';\nimport { REFLOW_ROW_CLASS, useListReflow } from '../../hooks/use-list-reflow';\nimport { useExitTransition } from '../../hooks/use-exit-transition';\nimport { useTheme } from '../../hooks/use-theme';\n\n/* ------------------------------------------------------------------ */\n/* NotesPanel — the Notes tool for the Control Room rail. */\n/* */\n/* A composer over an elevated ClinicalNoteCard timeline. Drops */\n/* into a ControlRoomRail tool `panel`, the patient profile, or the */\n/* care-plan editor — anywhere notes about the open entity belong. */\n/* The composer is the kit RichTextEditor by default (degrades to a */\n/* textarea where Redactor is absent), carries a permission-gated */\n/* \"clinical note\" toggle, and forwards the editor's AI affordances. */\n/* The note attaches to whatever entity the host is showing — the */\n/* host owns the attachment; the panel only emits content + clinical. */\n/* Pinned notes lead; pin / flag are inline per-note toggles. */\n/* ------------------------------------------------------------------ */\n\n/**\n * One note in the panel — the data subset of `ClinicalNoteCard`.\n *\n * `aria-label` names the card for assistive tech. Set it whenever a row is not\n * a clinical note: the card's fallback name is \"Clinical note\", so an entry\n * that is something else (a dated event, an import) is announced as one.\n */\nexport type NotesPanelNote = Pick<\n ClinicalNoteCardProps,\n | 'id'\n | 'dateIso'\n | 'createdAtIso'\n | 'author'\n | 'clinical'\n | 'attachedTo'\n | 'content'\n | 'contentFormat'\n | 'pinned'\n | 'flagged'\n | 'aria-label'\n | 'deleted'\n | 'operatorName'\n> & {\n /** What the host lets the reader do with this note. */\n actions?: NotesPanelNoteActions;\n};\n\n/** Per-note write permissions; an absent key means allowed. The panel hides\n * the pin toggle on `pin: false` and on a deleted note. */\nexport type NotesPanelNoteActions = {\n edit?: boolean;\n delete?: boolean;\n pin?: boolean;\n};\n\n/**\n * Curated agent handle for NotesPanel. Reads the note timeline's STRUCTURE\n * (ids + pinned / flagged / clinical flags — never the note body or author,\n * both PHI) and drives the composer + per-note toggles. See\n * `notes-panel.agent.ts`.\n */\nexport interface NotesPanelHandle {\n /** Timeline snapshot — ids + flags only, never note content (PHI). */\n getNotes: () => Array<{\n id?: string;\n pinned: boolean;\n flagged: boolean;\n clinical: boolean;\n }>;\n /** Whether the composer is mounted (onAddNote is wired). */\n canAddNote: () => boolean;\n /** Whether clinical notes may be written (the permission gate). */\n canAddClinical: () => boolean;\n /** Id of the note the host has addressed, or null when none is. */\n getCurrentNoteId: () => string | null;\n /** Commit a new note with explicit content (mirrors the composer's submit). */\n addNote: (submission: NotesPanelSubmission) => void | Promise<void>;\n /** Toggle a note's pinned state (mirrors onTogglePin, with its gate). */\n togglePin: (id: string) => void;\n /** Toggle a note's flagged state (mirrors onToggleFlag). */\n toggleFlag: (id: string) => void;\n}\n\n/** Payload handed to `onAddNote` when the composer commits. */\nexport interface NotesPanelSubmission {\n /** The note body — rich HTML (`composer='rich'`) or plain text. */\n content: string;\n /** Whether the \"clinical note\" toggle was set. */\n clinical: boolean;\n}\n\nexport interface NotesPanelProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title' | 'children'\n> {\n /**\n * Stable instance id. Surfaced on the root as `data-component-id` so an\n * agent / MCP UI bridge can address this specific notes panel.\n */\n id?: string;\n /** Notes to render, newest-first by convention. Pinned notes lead. */\n notes: NotesPanelNote[];\n /**\n * Commit a new note. Omit to hide the composer (read-only timeline). Return\n * a promise to keep the draft until the host has saved it: the draft clears\n * when it resolves, and a rejection keeps it and shows the error's message.\n */\n onAddNote?: (submission: NotesPanelSubmission) => void | Promise<void>;\n /** The host's notes read. `'loading'` and `'error'` never show the empty\n * text; notes already held still render. Default `'ready'`. */\n status?: 'ready' | 'loading' | 'error';\n /** Retry a failed read. Renders a retry button in the error state. */\n onRetry?: () => void;\n /**\n * The note the reader ASKED for, addressed by id from somewhere else in the\n * record — a marker in a chart, a row in a grid, an agent. The panel marks\n * it, scrolls it to the middle of its own scroll region and moves focus to\n * it, and renders it unclamped so the thing that was asked for is readable\n * in full without a second click.\n *\n * Opening a panel is not the same as answering a question: a rail's\n * `setActiveTool` moves no focus and announces nothing, so a control whose\n * name promises \"in the notes panel\" produces no perceivable change for a\n * keyboard or screen-reader reader unless the panel lands them on the note.\n * That is what this prop is for; without it, a host has to reach into the\n * panel's DOM to do the same job.\n *\n * Marked on three channels, never colour alone (WCAG 1.4.1): an accent\n * wash that fades in and out over the card (steady where motion is off),\n * the focus outline on the row, and `aria-current` plus a visually-hidden\n * sentence naming the mark. Nothing is left on the row once the wash ends.\n *\n * Ids that match no note are ignored. To address the SAME note twice — the\n * reader pressing the same marker again after scrolling away — bump\n * `currentNoteKey` alongside it; this prop alone is a value, not a request.\n */\n currentNoteId?: string;\n /**\n * Bump on every address to re-scroll and re-focus the note in `currentNoteId`\n * and replay its wash, even when the id has not changed.\n *\n * Addressing is a request, not a value: a reader who presses the same marker\n * a second time (having scrolled away, or having moved focus off the note) is\n * asking to be taken back, and a control whose name promises the notes panel\n * must do something perceivable every time it is pressed. Without this the\n * second press is inert — the panel is already showing that note, so nothing\n * re-runs. Hosts increment a counter in the same handler that opens the tool.\n */\n currentNoteKey?: string | number;\n\n /* ----- Composer ----- */\n /**\n * `'rich'` (default) mounts the kit `RichTextEditor` (Redactor; degrades to a\n * textarea where Redactor is absent). `'plain'` keeps a simple `TextArea` for\n * lightweight surfaces / deterministic tests.\n */\n composer?: 'rich' | 'plain';\n /** Toolbar preset for the rich composer. Defaults to `'standard'`. */\n editorToolbar?: RichTextEditorToolbar;\n /** Inject the Redactor factory for the rich composer (else `window.$R`). */\n redactor?: RedactorFactory;\n /** Consumer image-upload endpoint for the rich composer. */\n imageUploadUrl?: string;\n\n /* ----- Clinical flag (permission-gated) ----- */\n /** Show the \"clinical note\" toggle in the composer. Default `true`. */\n showClinicalToggle?: boolean;\n /**\n * Permission gate — when `false` the clinical toggle is disabled and shows\n * `clinicalGatedReason` on hover/focus. Mirrors platform's\n * `practice_add_clinical_note` permission. Default `true`.\n */\n canAddClinicalNote?: boolean;\n /** Tooltip shown when the clinical toggle is gated off. */\n clinicalGatedReason?: string;\n /** Initial state of the clinical toggle. Default `false`. */\n defaultClinical?: boolean;\n\n /* ----- AI assistance (forwarded to RichTextEditor) ----- */\n onRequestAiDraft?: RichTextEditorProps['onRequestAiDraft'];\n aiDraftFormat?: RichTextEditorProps['aiDraftFormat'];\n aiPrivacyNotice?: RichTextEditorProps['aiPrivacyNotice'];\n onDictate?: RichTextEditorProps['onDictate'];\n onProofread?: RichTextEditorProps['onProofread'];\n onAutoFormat?: RichTextEditorProps['onAutoFormat'];\n\n /* ----- Per-note actions ----- */\n /** Toggle a note's pinned state — renders an inline pin button per note. */\n onTogglePin?: (id: string) => void;\n /** Toggle a note's flagged state — renders an inline flag button per note. */\n onToggleFlag?: (id: string) => void;\n /**\n * Host-owned actions for each note (edit, delete, share…), rendered by\n * the note card beside its pin and flag,\n * aligned to the inline end. The host supplies labelled controls and owns\n * what they do — the panel stays a timeline and never edits a note itself.\n */\n noteActions?: (note: NotesPanelNote) => ReactNode;\n /**\n * Save an edit to an existing note. When provided, each note the reader may\n * edit gets a pencil; it loads the note into the SAME composer that writes\n * new notes, in place, so a rich note is edited as rich text and keeps its\n * formatting. Return a promise to hold the pending state; a rejection keeps\n * the draft. Hidden on `actions.edit: false` and on a deleted note.\n */\n onEditNote?: (\n id: string,\n submission: NotesPanelSubmission,\n ) => void | Promise<void>;\n /**\n * Let an edit change a note's clinical flag. Default `false`: the \"Clinical\n * note\" toggle is hidden while editing and the submission carries the\n * note's existing flag. Most hosts save a note's content only, and a live\n * toggle that changes nothing is a lie. Set `true` only when the host\n * persists `submission.clinical` on edit.\n */\n editClinical?: boolean;\n /**\n * Request the host to delete a note. When provided, the panel holds the\n * row on screen long enough to fade it out before calling this, so the\n * removal reads as a removal rather than a vanish. Omit to let the host\n * own the timing entirely (the reflow animation still closes the gap).\n */\n onDeleteNote?: (id: string) => void;\n /**\n * Show a confirmation dialog before calling `onDeleteNote`. When `true`\n * (the default when `onDeleteNote` is provided), the built-in delete\n * button opens an alert dialog first; the exit fade only starts after\n * the user confirms. Pass `false` to delete immediately on click.\n */\n confirmDelete?: boolean;\n\n /* ----- Labels / chrome ----- */\n /** Panel heading. Defaults to the localised \"Notes\". */\n title?: string;\n /** Composer placeholder. */\n composerPlaceholder?: string;\n /** Save-button label. */\n addNoteLabel?: string;\n /** Rendered when there are no notes. */\n emptyState?: ReactNode;\n /** Accessible name for the panel region (defaults to `title`). */\n 'aria-label'?: string;\n}\n\n/* Lifts the card's content above the wash layer, so the wash tints the card\n surface only: note text and badges keep their own colours and contrast. */\nconst NOTE_CONTENT_ABOVE_WASH =\n 'ds:isolate ds:[&_[data-component=card]>*]:relative ds:[&_[data-component=card]>*]:z-[1]';\n\n/* The timeline row. The addressed row takes the keyboard focus outline; its\n visual mark is the wash layer below, so no row carries a border stripe. */\nconst noteItemVariants = cva(\n 'ds:relative ds:flex ds:flex-col ds:rounded-[var(--radius-lg)]',\n {\n variants: {\n current: {\n true: 'ds:focus:outline-[length:var(--focus-ring-width)] ds:focus:outline-solid ds:focus:outline-[color:var(--ring)] ds:focus:outline-offset-[length:var(--focus-ring-offset)]',\n false: '',\n },\n washed: { true: NOTE_CONTENT_ABOVE_WASH, false: '' },\n },\n defaultVariants: { current: false, washed: false },\n },\n);\n\n/* The accent wash on a row's card surface. `addressed` arrives, holds and\n leaves no mark; `editing` is steady for as long as the edit lasts. With\n motion off (OS setting, accessible theme) `addressed` holds steady too. */\nconst noteWashVariants = cva(\n 'ds:pointer-events-none ds:absolute ds:inset-0 ds:rounded-[var(--radius-lg)] ds:bg-[color:var(--accent)]',\n {\n variants: {\n state: {\n addressed: [\n 'ds:opacity-0',\n 'ds:animate-[note-addressed_calc(var(--animation-duration)*9)_var(--ease-in-out)]',\n 'ds:motion-reduce:animate-none ds:motion-reduce:opacity-[var(--opacity-12)]',\n 'ds:[.theme-accessible_&]:animate-none ds:[.theme-accessible_&]:opacity-[var(--opacity-12)]',\n ].join(' '),\n editing: 'ds:opacity-[var(--opacity-12)]',\n },\n },\n },\n);\n\n/* A row on its way out fades in place; the reflow hook then slides the\n rows below up to close the gap. Declared at rest so the transition has\n a value to animate from the moment the leaving class lands. */\nconst noteLeavingClass = 'ds:opacity-0';\nconst noteElevationClass = [\n 'ds:transition-opacity ds:duration-[var(--animation-duration)]',\n 'ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none',\n].join(' ');\n\n/* Body lines per placeholder note. Uneven, so three cards do not read as one\n repeated stamp. */\nconst NOTE_SKELETON_LINES = [3, 2, 3] as const;\n\n/** Strip tags / entities to test whether a rich draft holds real content. */\nfunction hasRichContent(html: string): boolean {\n if (!html) return false;\n if (/<img\\b/i.test(html)) return true;\n return (\n html\n .replace(/<[^>]*>/g, '')\n .replace(/&nbsp;/gi, ' ')\n .trim().length > 0\n );\n}\n\nexport const NotesPanel = forwardRef<HTMLElement, NotesPanelProps>(\n function NotesPanel(\n {\n id,\n notes,\n onAddNote,\n status = 'ready',\n onRetry,\n currentNoteId,\n currentNoteKey,\n composer = 'rich',\n editorToolbar = 'standard',\n redactor,\n imageUploadUrl,\n showClinicalToggle = true,\n canAddClinicalNote = true,\n clinicalGatedReason,\n defaultClinical = false,\n onRequestAiDraft,\n aiDraftFormat,\n aiPrivacyNotice,\n onDictate,\n onProofread,\n onAutoFormat,\n onTogglePin,\n onToggleFlag,\n noteActions,\n onEditNote,\n editClinical = false,\n onDeleteNote,\n confirmDelete = true,\n title,\n composerPlaceholder,\n addNoteLabel,\n emptyState,\n className,\n 'aria-label': ariaLabel,\n ...rest\n },\n ref,\n ) {\n const { t, i18n } = useTranslation();\n const editorRef = useRef<RichTextEditorHandle>(null);\n const [draft, setDraft] = useState('');\n const [clinical, setClinical] = useState(defaultClinical);\n const [pending, setPending] = useState(false);\n const [addError, setAddError] = useState<string | null>(null);\n // The note loaded into the composer for editing, or null when composing.\n const [editingId, setEditingId] = useState<string | null>(null);\n /* Settle in only when this content REPLACES a skeleton. Content that was\n simply there from the start must not fade: it would read as invisible\n for one animation to any test or reader that looks at once. */\n const followedLoading = useRef(false);\n if (status === 'loading') followedLoading.current = true;\n const enterClass = followedLoading.current ? CONTENT_ENTER_CLASS : '';\n\n const heading = title ?? t('notesPanel.title', { defaultValue: 'Notes' });\n const headingId = useId();\n const placeholder =\n composerPlaceholder ??\n t('notesPanel.placeholder', { defaultValue: 'Add a note…' });\n const composerLabel =\n editingId !== null\n ? t('notesPanel.edit', { defaultValue: 'Edit note' })\n : t('notesPanel.composerLabel', { defaultValue: 'New note' });\n\n // Live content check: plain reads the draft directly; rich strips the draft\n // (debounced) for the disabled state but commits from the editor handle.\n const hasContent =\n composer === 'rich' ? hasRichContent(draft) : draft.trim().length > 0;\n\n const commit = useCallback(() => {\n const save = editingId !== null ? onEditNote : onAddNote;\n if (!save || pending) return;\n const rich = composer === 'rich';\n const content = rich\n ? (editorRef.current?.getHTML() ?? draft)\n : draft.trim();\n if (rich ? !hasRichContent(content) : !content) return;\n const reset = () => {\n if (rich) editorRef.current?.clear();\n setDraft('');\n setClinical(defaultClinical);\n setEditingId(null);\n };\n setAddError(null);\n let result: void | Promise<void>;\n try {\n result =\n editingId !== null && onEditNote\n ? onEditNote(editingId, { content, clinical })\n : onAddNote?.({ content, clinical });\n } catch (error: unknown) {\n setAddError(getErrorMessage(error, t('notesPanel.addFailed')));\n return;\n }\n if (!result || typeof result.then !== 'function') return reset();\n // A failed save keeps the draft, so nothing typed is lost.\n setPending(true);\n Promise.resolve(result)\n .then(reset, (error: unknown) =>\n setAddError(getErrorMessage(error, t('notesPanel.addFailed'))),\n )\n .finally(() => setPending(false));\n }, [\n composer,\n draft,\n clinical,\n defaultClinical,\n editingId,\n onAddNote,\n onEditNote,\n pending,\n t,\n ]);\n\n const clinicalToggleShown =\n showClinicalToggle && (editingId === null || editClinical);\n\n /* Every row carries the SAME action words, so each accessible name adds\n the note's own date: otherwise a screen reader hears a list of\n identical \"Edit note\" buttons. The tooltip keeps the short words. */\n const noteStamp = useCallback(\n (note: NotesPanelNote): string => {\n try {\n return new Intl.DateTimeFormat(i18n.language, {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n }).format(new Date(note.dateIso));\n } catch {\n return note.dateIso;\n }\n },\n [i18n.language],\n );\n\n /* ----- Edit in place: the composer takes the note, and gives it back ----- */\n const startEdit = useCallback(\n (note: NotesPanelNote) => {\n if (!note.id || pending) return;\n const content = note.content ?? '';\n setAddError(null);\n setEditingId(note.id);\n setClinical(note.clinical ?? false);\n setDraft(content);\n if (composer === 'rich') {\n editorRef.current?.clear();\n editorRef.current?.insertAtCursor(content, { asHtml: true });\n }\n editorRef.current?.focus();\n },\n [composer, pending],\n );\n const cancelEdit = useCallback(() => {\n if (composer === 'rich') editorRef.current?.clear();\n setDraft('');\n setClinical(defaultClinical);\n setAddError(null);\n setEditingId(null);\n }, [composer, defaultClinical]);\n // The note being edited went away (deleted, or another patient's notes\n // arrived): its draft must not be saved against whatever comes next.\n const editingStillThere =\n editingId === null ||\n notes.some((note) => note.id === editingId && !note.deleted);\n useEffect(() => {\n if (!editingStillThere) cancelEdit();\n }, [editingStillThere, cancelEdit]);\n\n // Pinned notes lead; order within each group is preserved.\n const ordered = [...notes].sort(\n (a, b) => Number(b.pinned ?? false) - Number(a.pinned ?? false),\n );\n\n /* The accessible theme zeroes `--animation-duration`, so its CSS plays\n nothing — the JS must agree, or a row would sit still for the delay\n and then vanish anyway. `undefined` leaves the media query in charge. */\n const { resolvedTheme } = useTheme();\n const reduceMotion = resolvedTheme.endsWith('-accessible') || undefined;\n\n /* Closing the gap a removed row leaves: the rows below slide up rather\n than jumping, so the eye keeps its place in the list. Fires on add,\n delete, and re-order (pinning) — any change to the visible id\n sequence. */\n const { containerRef: reflowRef } = useListReflow<HTMLUListElement>({\n key: ordered.map((n) => n.id).join(),\n reduceMotion,\n });\n\n /* A note leaving the list fades out before the host drops it, so the\n removal reads as a removal rather than a vanish. The reflow hook\n then slides the rows below up to close the gap. */\n const deleteExit = useExitTransition({ reduceMotion });\n const [pendingDelete, setPendingDelete] = useState<string | null>(null);\n const handleDeleteNote = useCallback(\n (noteId: string) => {\n if (!onDeleteNote) return;\n if (confirmDelete) {\n setPendingDelete(noteId);\n } else {\n deleteExit.leave(noteId, () => onDeleteNote(noteId));\n }\n },\n [confirmDelete, deleteExit, onDeleteNote],\n );\n const confirmDeleteNote = useCallback(() => {\n if (!pendingDelete || !onDeleteNote) return;\n const noteId = pendingDelete;\n setPendingDelete(null);\n deleteExit.leave(noteId, () => onDeleteNote(noteId));\n }, [pendingDelete, onDeleteNote, deleteExit]);\n\n /* ----- The addressed note (see `currentNoteId`) ----- */\n const currentItemRef = useRef<HTMLLIElement>(null);\n useEffect(() => {\n if (!currentNoteId) return;\n // `center`, not `nearest`: nearest parks the note flush against the edge\n // of the scroll region, which is the least readable place to land.\n currentItemRef.current?.scrollIntoView({ block: 'center' });\n currentItemRef.current?.focus();\n // `currentNoteKey` is in the deps so a REPEAT address of the same note\n // re-runs — see the prop doc. Addressing is a request, not a value.\n }, [currentNoteId, currentNoteKey]);\n\n /* ----- Agent handle (structural reads + composer / toggles) ----- */\n const notesRef = useRef(notes);\n notesRef.current = notes;\n const onAddNoteRef = useRef(onAddNote);\n onAddNoteRef.current = onAddNote;\n const onTogglePinRef = useRef(onTogglePin);\n onTogglePinRef.current = onTogglePin;\n const onToggleFlagRef = useRef(onToggleFlag);\n onToggleFlagRef.current = onToggleFlag;\n const canAddClinicalRef = useRef(canAddClinicalNote);\n canAddClinicalRef.current = canAddClinicalNote;\n const currentNoteIdRef = useRef(currentNoteId);\n currentNoteIdRef.current = currentNoteId;\n\n const rootRef = useRef<HTMLElement>(null);\n useImperativeHandle(ref, () => rootRef.current as HTMLElement, []);\n\n const handle = useMemo<NotesPanelHandle>(\n () => ({\n // Ids + flags only — never the note body or author (both PHI).\n getNotes: () =>\n notesRef.current.map((n) => ({\n id: n.id,\n pinned: !!n.pinned,\n flagged: !!n.flagged,\n clinical: !!n.clinical,\n })),\n canAddNote: () => !!onAddNoteRef.current,\n canAddClinical: () => canAddClinicalRef.current,\n getCurrentNoteId: () => currentNoteIdRef.current ?? null,\n addNote: (submission) => {\n // A clinical submission requires the permission gate to be open.\n if (submission.clinical && !canAddClinicalRef.current) return;\n return onAddNoteRef.current?.(submission);\n },\n togglePin: (noteId) => {\n const note = notesRef.current.find((n) => n.id === noteId);\n if (note && (note.deleted || note.actions?.pin === false)) return;\n onTogglePinRef.current?.(noteId);\n },\n toggleFlag: (noteId) => onToggleFlagRef.current?.(noteId),\n }),\n [],\n );\n useAgentRegistration(notesPanelAgent, handle, id);\n\n return (\n <section\n ref={rootRef}\n data-component=\"notes-panel\"\n data-component-id={id}\n aria-labelledby={ariaLabel ? undefined : headingId}\n aria-label={ariaLabel}\n className={['ds:flex ds:flex-col', className].filter(Boolean).join(' ')}\n {...rest}\n >\n {/* Shared rail header — pins to the top of the panel's scroll region\n while the composer + note timeline scroll beneath it. The rail\n injects the favourite / close actions via PanelHeaderActionsProvider. */}\n <PanelHeader\n title={heading}\n icon={<NotebookPen aria-hidden=\"true\" />}\n headingId={ariaLabel ? undefined : headingId}\n sticky\n divider\n />\n\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]\">\n {onAddNote || editingId !== null ? (\n <div\n data-notes-panel-composer={editingId !== null ? 'edit' : 'add'}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\"\n >\n {composer === 'rich' ? (\n <RichTextEditor\n ref={editorRef}\n ariaLabel={composerLabel}\n placeholder={placeholder}\n toolbar={editorToolbar}\n minHeight=\"fill\"\n redactor={redactor}\n imageUploadUrl={imageUploadUrl}\n readOnly={pending}\n onChange={({ html }) => setDraft(html)}\n onRequestAiDraft={onRequestAiDraft}\n aiDraftFormat={aiDraftFormat}\n aiPrivacyNotice={aiPrivacyNotice}\n onDictate={onDictate}\n onProofread={onProofread}\n onAutoFormat={onAutoFormat}\n />\n ) : (\n <TextArea\n value={draft}\n readOnly={pending}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={placeholder}\n autoResize\n minRows={2}\n maxRows={6}\n aria-label={composerLabel}\n />\n )}\n <div\n className={[\n 'ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]',\n clinicalToggleShown ? 'ds:justify-between' : 'ds:justify-end',\n ].join(' ')}\n >\n {clinicalToggleShown ? (\n <Checkbox\n size=\"sm\"\n label={t('notesPanel.clinicalToggle', {\n defaultValue: 'Clinical note',\n })}\n checked={clinical}\n onCheckedChange={(next) => setClinical(next === true)}\n disabled={pending || !canAddClinicalNote}\n disabledReason={\n canAddClinicalNote\n ? undefined\n : (clinicalGatedReason ??\n t('notesPanel.clinicalGated', {\n defaultValue:\n 'You do not have permission to write clinical notes.',\n }))\n }\n />\n ) : null}\n <span className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n {editingId !== null ? (\n <Button\n type=\"button\"\n size=\"sm\"\n intent=\"ghost\"\n onClick={cancelEdit}\n disabled={pending}\n >\n {t('notesPanel.cancelEdit', { defaultValue: 'Cancel' })}\n </Button>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={commit}\n disabled={!hasContent}\n loading={pending}\n >\n {editingId !== null\n ? t('notesPanel.saveEdit', { defaultValue: 'Save note' })\n : (addNoteLabel ??\n t('notesPanel.add', { defaultValue: 'Add note' }))}\n </Button>\n </span>\n </div>\n {addError ? (\n <Alert variant=\"error\">\n <Alert.Description>{addError}</Alert.Description>\n </Alert>\n ) : null}\n </div>\n ) : null}\n\n {status === 'loading' && ordered.length === 0 ? (\n /* Note-shaped placeholders, not a spinner: the reader sees where\n the notes will land and how many to expect. The status text is\n for assistive tech only; sighted readers get the motion. */\n <div\n data-notes-panel-loading=\"\"\n aria-busy=\"true\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\"\n >\n <span role=\"status\" className=\"ds:sr-only\">\n {t('notesPanel.loading')}\n </span>\n {NOTE_SKELETON_LINES.map((lines, index) => (\n <Card key={index} variant=\"elevated\" aria-hidden=\"true\">\n <Card.Body>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <Skeleton\n variant=\"circular\"\n size=\"sm\"\n stagger={index * 2}\n />\n <div className=\"ds:flex ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <Skeleton\n variant=\"text\"\n size=\"sm\"\n stagger={index * 2}\n width=\"40%\"\n />\n <Skeleton\n variant=\"text\"\n size=\"sm\"\n stagger={index * 2}\n width=\"25%\"\n />\n </div>\n </div>\n <Skeleton\n variant=\"text\"\n size=\"sm\"\n lines={lines}\n stagger={index * 2 + 1}\n />\n </div>\n </Card.Body>\n </Card>\n ))}\n </div>\n ) : status === 'error' ? (\n <Alert variant=\"error\">\n <Alert.Description>{t('notesPanel.loadError')}</Alert.Description>\n {onRetry ? (\n <Alert.Action>\n <Button intent=\"secondary\" size=\"sm\" onClick={onRetry}>\n {t('notesPanel.retry')}\n </Button>\n </Alert.Action>\n ) : null}\n </Alert>\n ) : null}\n\n {/* A refresh keeps the notes it has: real notes never give way to\n placeholders. The list is marked busy and says so to a reader. */}\n {status === 'loading' && ordered.length > 0 ? (\n <span role=\"status\" className=\"ds:sr-only\">\n {t('notesPanel.loading')}\n </span>\n ) : null}\n {ordered.length > 0 ? (\n <ul\n ref={reflowRef}\n aria-busy={status === 'loading' || undefined}\n className={`ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0 ${enterClass}`.trim()}\n >\n {ordered.map(({ actions, ...note }, index) => {\n const isCurrent =\n currentNoteId != null && note.id === currentNoteId;\n const noteId = note.id as string | undefined;\n const isEditing = noteId != null && editingId === noteId;\n const leaving = noteId != null && deleteExit.isLeaving(noteId);\n return (\n <li\n key={note.id ?? index}\n ref={isCurrent ? currentItemRef : undefined}\n // Focus lands on the row, not inside the card, so the\n // sentence below and `aria-current` are read out before the\n // note — and the rail's own Escape still bubbles.\n tabIndex={isCurrent ? -1 : undefined}\n aria-current={isCurrent ? 'true' : undefined}\n data-reflow-id={noteId}\n data-leaving={leaving ? '' : undefined}\n data-editing={isEditing ? '' : undefined}\n className={[\n noteItemVariants({\n current: isCurrent,\n washed: isCurrent || isEditing,\n }),\n noteElevationClass,\n REFLOW_ROW_CLASS,\n leaving ? noteLeavingClass : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {isCurrent ? (\n <span className=\"ds:sr-only\">\n {t('notesPanel.current', {\n defaultValue: 'Current note',\n })}\n </span>\n ) : null}\n {/* Elevated card per note; the list gap (not a separator)\n spaces them. Bodies clamp to five lines with read-more —\n except the addressed one, which is what the reader came\n for and opens in full. */}\n {/* Keyed on the address, so a repeat address of the same\n note remounts the layer and the wash plays again. Editing\n wins: a steady state must not pulse. */}\n {isEditing ? (\n <span\n aria-hidden=\"true\"\n data-notes-panel-wash=\"editing\"\n className={noteWashVariants({ state: 'editing' })}\n />\n ) : isCurrent ? (\n <span\n key={`${currentNoteId}:${currentNoteKey ?? ''}`}\n aria-hidden=\"true\"\n data-notes-panel-wash=\"addressed\"\n className={noteWashVariants({ state: 'addressed' })}\n />\n ) : null}\n <ClinicalNoteCard\n surface=\"elevated\"\n truncate={!isCurrent}\n headerActions={\n <>\n {noteActions\n ? noteActions({ ...note, actions })\n : null}\n {onEditNote &&\n noteId &&\n !note.deleted &&\n actions?.edit !== false ? (\n <IconButton\n icon={<Pencil />}\n intent=\"ghost\"\n size=\"sm\"\n aria-label={t('notesPanel.editNamed', {\n date: noteStamp(note),\n defaultValue: 'Edit note · {{date}}',\n })}\n tooltip={t('notesPanel.edit', {\n defaultValue: 'Edit note',\n })}\n aria-pressed={editingId === noteId}\n disabled={pending}\n data-notes-panel-edit=\"\"\n onClick={() =>\n editingId === noteId\n ? cancelEdit()\n : startEdit(note)\n }\n />\n ) : null}\n {onDeleteNote && noteId && !note.deleted ? (\n <IconButton\n icon={<Trash2 />}\n intent=\"ghost\"\n size=\"sm\"\n aria-label={t('notesPanel.deleteNamed', {\n date: noteStamp(note),\n defaultValue: 'Delete note · {{date}}',\n })}\n tooltip={t('notesPanel.delete', {\n defaultValue: 'Delete note',\n })}\n onClick={() => handleDeleteNote(noteId)}\n />\n ) : null}\n </>\n }\n {...note}\n onTogglePin={\n onTogglePin &&\n note.id &&\n actions?.pin !== false &&\n !note.deleted\n ? () => onTogglePin(note.id as string)\n : undefined\n }\n onToggleFlag={\n onToggleFlag && note.id\n ? () => onToggleFlag(note.id as string)\n : undefined\n }\n />\n </li>\n );\n })}\n </ul>\n ) : status !== 'ready' ? null : (\n (emptyState ?? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {t('notesPanel.empty', { defaultValue: 'No notes yet.' })}\n </p>\n ))\n )}\n </div>\n\n {onDeleteNote && confirmDelete ? (\n <Dialog\n open={pendingDelete !== null}\n onOpenChange={(next) => !next && setPendingDelete(null)}\n >\n <Dialog.Content variant=\"alert\" size=\"sm\">\n <Dialog.Header>\n <Dialog.Title>\n {t('notesPanel.deleteConfirmTitle', {\n defaultValue: 'Delete this note?',\n })}\n </Dialog.Title>\n </Dialog.Header>\n <Dialog.Body>\n <Dialog.Description>\n {t('notesPanel.deleteConfirmBody', {\n defaultValue: 'The note will be removed from the record.',\n })}\n </Dialog.Description>\n </Dialog.Body>\n <Dialog.Footer>\n <Dialog.Close asChild>\n <Button\n intent=\"secondary\"\n size=\"sm\"\n onClick={() => setPendingDelete(null)}\n >\n {t('notesPanel.deleteConfirmCancel', {\n defaultValue: 'Cancel',\n })}\n </Button>\n </Dialog.Close>\n <Button\n intent=\"destructive\"\n size=\"sm\"\n onClick={confirmDeleteNote}\n >\n {t('notesPanel.deleteConfirmAction', {\n defaultValue: 'Delete',\n })}\n </Button>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog>\n ) : null}\n </section>\n );\n },\n);\n"],"names":["getErrorMessage","error","fallback","notesPanelAgent","handle","args","NOTE_CONTENT_ABOVE_WASH","noteItemVariants","cva","noteWashVariants","noteLeavingClass","noteElevationClass","NOTE_SKELETON_LINES","hasRichContent","html","NotesPanel","forwardRef","id","notes","onAddNote","status","onRetry","currentNoteId","currentNoteKey","composer","editorToolbar","redactor","imageUploadUrl","showClinicalToggle","canAddClinicalNote","clinicalGatedReason","defaultClinical","onRequestAiDraft","aiDraftFormat","aiPrivacyNotice","onDictate","onProofread","onAutoFormat","onTogglePin","onToggleFlag","noteActions","onEditNote","editClinical","onDeleteNote","confirmDelete","title","composerPlaceholder","addNoteLabel","emptyState","className","ariaLabel","rest","ref","t","i18n","useTranslation","editorRef","useRef","draft","setDraft","useState","clinical","setClinical","pending","setPending","addError","setAddError","editingId","setEditingId","followedLoading","enterClass","CONTENT_ENTER_CLASS","heading","headingId","useId","placeholder","composerLabel","hasContent","commit","useCallback","rich","content","_a","reset","result","clinicalToggleShown","noteStamp","note","startEdit","_b","_c","cancelEdit","editingStillThere","useEffect","ordered","a","b","resolvedTheme","useTheme","reduceMotion","reflowRef","useListReflow","n","deleteExit","useExitTransition","pendingDelete","setPendingDelete","handleDeleteNote","noteId","confirmDeleteNote","currentItemRef","notesRef","onAddNoteRef","onTogglePinRef","onToggleFlagRef","canAddClinicalRef","currentNoteIdRef","rootRef","useImperativeHandle","useMemo","submission","useAgentRegistration","jsxs","jsx","PanelHeader","NotebookPen","RichTextEditor","TextArea","event","Checkbox","next","Button","Alert","lines","index","Card","Skeleton","actions","isCurrent","isEditing","leaving","REFLOW_ROW_CLASS","ClinicalNoteCard","Fragment","IconButton","Pencil","Trash2","Dialog"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACO,SAASA,GAAgBC,GAAgBC,GAA0B;AACxE,SACE,OAAOD,KAAU,YACjBA,MAAU,QACV,aAAaA,KACb,OAAOA,EAAM,WAAY,YACzBA,EAAM,QAAQ,SAEPA,EAAM,UAERC;AACT;ACOO,MAAMC,KAAkD;AAAA,EAC7D,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,QAAQ;AAAA,EACvB,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,gBAAgB;AAAA,MACd,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,eAAA;AAAA,IAAe;AAAA,IAE1C,eAAe;AAAA,MACb,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,M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AAAA,kBAAA,GAEL;AAAA,kBACA,gBAAAiB;AAAA,oBAACQ;AAAA,oBAAA;AAAA,sBACC,QAAO;AAAA,sBACP,MAAK;AAAA,sBACL,SAAStB;AAAA,sBAER,YAAE,kCAAkC;AAAA,wBACnC,cAAc;AAAA,sBAAA,CACf;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACH,EAAA,CACF;AAAA,cAAA,EAAA,CACF;AAAA,YAAA;AAAA,UAAA,IAEA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"panel-subview-Cc2Wtt7D.js","sources":["../../node_modules/lucide-react/dist/esm/icons/arrow-left.mjs","../../src/components/panel-subview/panel-subview.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"m12 19-7-7 7-7\", key: \"1l729n\" }],\n [\"path\", { d: \"M19 12H5\", key: \"x3x0zl\" }]\n];\nconst ArrowLeft = createLucideIcon(\"arrow-left\", __iconNode);\n\nexport { __iconNode, ArrowLeft as default };\n//# sourceMappingURL=arrow-left.mjs.map\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n type HTMLAttributes,\n type ReactNode,\n type RefObject,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { ArrowLeft } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\nimport { PanelHeader } from '../panel-header/panel-header';\nimport { ScrollArea } from '../scroll-area/scroll-area';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { usePresenceTransition } from '../../hooks/use-presence-transition';\n\n/* -------------------------------------------------------------------- */\n/* PanelSubview */\n/* */\n/* A panel inside a panel: a second view that slides over a rail panel's */\n/* own body and hands it back. An edit form, a history, a detail drilled */\n/* into from a list. The panel underneath stays mounted, so its scroll */\n/* position and state are there when the reader comes back. */\n/* */\n/* Use it instead of a Dialog when the task belongs to the panel. A modal */\n/* blanks out the calendar the rail sits beside, and the list the item */\n/* came from; a subview covers only the panel. */\n/* */\n/* It exists because the shape was being hand-built per tool: a view */\n/* flag, a PanelHeader with a back arrow, a scroll body, a pinned footer, */\n/* and focus moved by hand. Hand-built, none of them animated and each */\n/* forgot a different part of the focus contract. */\n/* */\n/* The host must be a positioned, clipped box. Wrap the panel in */\n/* `PanelSubview.Host` and render the subview as its LAST child. */\n/* -------------------------------------------------------------------- */\n\nconst hostVariants = cva(\n 'ds:relative ds:flex ds:h-full ds:min-h-0 ds:flex-col ds:overflow-hidden',\n);\n\nconst subviewVariants = cva(\n [\n 'ds:absolute ds:inset-0 ds:z-[2] ds:flex ds:min-h-0 ds:flex-col',\n 'ds:bg-[var(--background)] ds:focus-visible:outline-none',\n // Slides in from the inline end, and back out the same way. Declared at\n // rest so both directions have a value to move from.\n 'ds:transition-[opacity,translate] ds:duration-[var(--animation-duration)]',\n 'ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none',\n 'ds:data-[presence=entering]:opacity-0 ds:data-[presence=leaving]:opacity-0',\n 'ds:data-[presence=entering]:translate-x-full ds:data-[presence=leaving]:translate-x-full',\n 'ds:rtl:data-[presence=entering]:-translate-x-full ds:rtl:data-[presence=leaving]:-translate-x-full',\n 'ds:data-[presence=leaving]:pointer-events-none',\n ].join(' '),\n);\n\n/* A control inside the subview whose popup is showing right now. */\nconst OPEN_POPUP =\n '[role=\"combobox\"][aria-expanded=\"true\"], [aria-haspopup][aria-expanded=\"true\"]';\n\nconst footerVariants = cva(\n [\n 'ds:flex ds:shrink-0 ds:items-center ds:justify-end',\n 'ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]',\n 'ds:border-t ds:border-[color:var(--border)]',\n ].join(' '),\n);\n\n/* -------------------------------------------------------------------- */\n/* Host */\n/* -------------------------------------------------------------------- */\n\nexport type PanelSubviewHostProps = HTMLAttributes<HTMLDivElement>;\n\n/** The positioned, clipped box a subview slides inside. Fills its parent. */\nconst PanelSubviewHost = forwardRef<HTMLDivElement, PanelSubviewHostProps>(\n ({ className, children, ...rest }, ref) => (\n <div\n ref={ref}\n data-component=\"panel-subview-host\"\n className={[hostVariants(), className].filter(Boolean).join(' ')}\n {...rest}\n >\n {children}\n </div>\n ),\n);\nPanelSubviewHost.displayName = 'PanelSubview.Host';\n\n/* -------------------------------------------------------------------- */\n/* Subview */\n/* -------------------------------------------------------------------- */\n\nexport interface PanelSubviewProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title'\n> {\n /** Whether the subview is showing. It animates in and out around this. */\n open: boolean;\n /** Fires from the back button and from Escape. Set `open` false in reply. */\n onBack: () => void;\n /** The subview's heading. Already translated upstream. */\n title: ReactNode;\n /** Accessible name and tooltip of the back button. Already translated. */\n backLabel: string;\n /** Optional leading glyph for the heading. */\n icon?: ReactNode;\n /** Heading level. Default `2`; pass `3` to read as subordinate to the host. */\n headingLevel?: 2 | 3;\n /** Extra header actions, rendered after the back button. */\n headerActions?: ReactNode;\n /** Pinned below the scroll body: the form's cancel and save, typically. */\n footer?: ReactNode;\n /** Fires once the exit has played and the subview has unmounted. */\n onExited?: () => void;\n /**\n * Focus this on open instead of the subview itself: a form's first field,\n * say. The subview is still announced through its heading.\n */\n initialFocusRef?: RefObject<HTMLElement | null>;\n children: ReactNode;\n}\n\nconst PanelSubviewRoot = forwardRef<HTMLElement, PanelSubviewProps>(\n (\n {\n open,\n onBack,\n title,\n backLabel,\n icon,\n headingLevel,\n headerActions,\n footer,\n onExited,\n initialFocusRef,\n className,\n children,\n ...rest\n },\n ref,\n ) => {\n const headingId = useId();\n const presence = usePresenceTransition<HTMLElement>(open, { onExited });\n const nodeRef = useRef<HTMLElement | null>(null);\n const returnFocusRef = useRef<HTMLElement | null>(null);\n const onBackRef = useRef(onBack);\n onBackRef.current = onBack;\n\n const { ref: presenceRef } = presence;\n const setNode = useCallback(\n (node: HTMLElement | null) => {\n nodeRef.current = node;\n presenceRef(node);\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [presenceRef, ref],\n );\n\n // Remember where focus was BEFORE the subview takes it, during render of\n // the opening pass, so the trigger is still the active element.\n const wasOpenRef = useRef(open);\n if (open && !wasOpenRef.current && typeof document !== 'undefined') {\n returnFocusRef.current =\n document.activeElement instanceof HTMLElement\n ? document.activeElement\n : null;\n }\n wasOpenRef.current = open;\n\n /* The panel underneath is covered, so it leaves the tab order and the\n accessibility tree for as long as the subview is open. */\n useIsomorphicLayoutEffect(() => {\n const node = nodeRef.current;\n const parent = node?.parentElement;\n if (!open || !node || !parent) return undefined;\n const covered = Array.from(parent.children).filter(\n (child) => child !== node && !child.hasAttribute('inert'),\n );\n covered.forEach((child) => child.setAttribute('inert', ''));\n // `preventScroll`: the subview is still off to the side at this point,\n // and a clipped Host would otherwise scroll sideways to reveal it.\n (initialFocusRef?.current ?? node).focus({ preventScroll: true });\n return () => {\n covered.forEach((child) => child.removeAttribute('inert'));\n };\n }, [open, presence.mounted, initialFocusRef]);\n\n /* A leaving subview is already closed to the user: `aria-hidden` alone\n would leave its controls focusable, so it goes `inert` while it fades.\n Set on the node, not as a prop: React 18 has no boolean for it. */\n const leaving = !open;\n useIsomorphicLayoutEffect(() => {\n const node = nodeRef.current;\n if (!node) return;\n // Blur first: nothing focused may sit inside a hidden subtree, even for\n // the moment before the passive effect below hands focus back.\n const active = document.activeElement;\n if (leaving && active instanceof HTMLElement && node.contains(active)) {\n active.blur();\n }\n node.toggleAttribute('inert', leaving);\n }, [leaving, presence.mounted]);\n\n /* Hand focus back to whatever opened the subview. A PASSIVE effect: React\n restores the pre-commit focus at the end of a commit, so a return made\n from a layout cleanup is overwritten by the closing subview itself. */\n useEffect(() => {\n if (!open) return undefined;\n return () => {\n const target = returnFocusRef.current;\n returnFocusRef.current = null;\n if (target?.isConnected) target.focus();\n };\n }, [open]);\n\n /* Escape goes back one level. A NATIVE listener: the rail collapses on\n Escape through its own native listener further up, and only a native\n stopPropagation here keeps one key press from doing both. */\n useEffect(() => {\n const node = nodeRef.current;\n if (!open || !node) return undefined;\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return;\n // Spent here either way: a key pressed inside never collapses the rail.\n event.stopPropagation();\n /* An OPEN popup inside took the key to close itself. A closed,\n force-mounted one (Combobox) prevents default too, so ask the DOM. */\n if (event.defaultPrevented && node.querySelector(OPEN_POPUP)) return;\n event.preventDefault();\n onBackRef.current();\n };\n node.addEventListener('keydown', onKeyDown);\n return () => node.removeEventListener('keydown', onKeyDown);\n }, [open, presence.mounted]);\n\n if (!presence.mounted) return null;\n\n return (\n <section\n {...rest}\n ref={setNode}\n tabIndex={-1}\n aria-labelledby={headingId}\n aria-hidden={leaving || undefined}\n data-component=\"panel-subview\"\n data-presence={presence.phase}\n className={[subviewVariants(), className].filter(Boolean).join(' ')}\n >\n <PanelHeader\n icon={icon}\n title={title}\n headingId={headingId}\n headingLevel={headingLevel}\n sticky\n divider\n actions={\n <>\n <IconButton\n icon={<ArrowLeft aria-hidden=\"true\" />}\n intent=\"ghost\"\n size=\"sm\"\n flipIconInRtl\n aria-label={backLabel}\n tooltip={backLabel}\n data-panel-subview-back=\"\"\n onClick={onBack}\n />\n {headerActions}\n </>\n }\n />\n <ScrollArea orientation=\"vertical\" className=\"ds:min-h-0 ds:flex-1\">\n {children}\n </ScrollArea>\n {footer ? (\n <div data-panel-subview-footer=\"\" className={footerVariants()}>\n {footer}\n </div>\n ) : null}\n </section>\n );\n },\n);\nPanelSubviewRoot.displayName = 'PanelSubview';\n\nexport const PanelSubview = Object.assign(PanelSubviewRoot, {\n Host: PanelSubviewHost,\n});\n"],"names":["__iconNode","ArrowLeft","createLucideIcon","hostVariants","cva","subviewVariants","OPEN_POPUP","footerVariants","PanelSubviewHost","forwardRef","className","children","rest","ref","jsx","PanelSubviewRoot","open","onBack","title","backLabel","icon","headingLevel","headerActions","footer","onExited","initialFocusRef","headingId","useId","presence","usePresenceTransition","nodeRef","useRef","returnFocusRef","onBackRef","presenceRef","setNode","useCallback","node","wasOpenRef","useIsomorphicLayoutEffect","parent","covered","child","leaving","active","useEffect","target","onKeyDown","event","jsxs","PanelHeader","Fragment","IconButton","ScrollArea","PanelSubview"],"mappings":";;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,kBAAkB,KAAK,SAAQ,CAAE;AAAA,EAC/C,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAC3C,GACMC,IAAYC,EAAiB,cAAcF,CAAU,GC0BrDG,IAAeC;AAAA,EACnB;AACF,GAEMC,IAAkBD;AAAA,EACtB;AAAA,IACE;AAAA,IACA;AAAA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AACZ,GAGME,IACJ,kFAEIC,IAAiBH;AAAA,EACrB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AACZ,GASMI,IAAmBC;AAAA,EACvB,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAAQC,MACjC,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,kBAAe;AAAA,MACf,WAAW,CAACV,EAAA,GAAgBO,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,MAC9D,GAAGE;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP;AACAH,EAAiB,cAAc;AAoC/B,MAAMO,IAAmBN;AAAA,EACvB,CACE;AAAA,IACE,MAAAO;AAAA,IACA,QAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAAC;AAAA,I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