@alfadocs/ui-kit-debug 0.84.0 → 0.85.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 (140) hide show
  1. package/dist/_chunks/actions-cell-renderer-DaL80uqL.js.map +1 -1
  2. package/dist/_chunks/{ai-consent-banner-DUhr1yNj.js → ai-consent-banner-BXD7W6FI.js} +2 -2
  3. package/dist/_chunks/{ai-consent-banner-DUhr1yNj.js.map → ai-consent-banner-BXD7W6FI.js.map} +1 -1
  4. package/dist/_chunks/{alert-KJbsPYkI.js → alert-Cxaqd-QO.js} +12 -12
  5. package/dist/_chunks/alert-Cxaqd-QO.js.map +1 -0
  6. package/dist/_chunks/anamnesis-card-CJ5MNbkc.js.map +1 -1
  7. package/dist/_chunks/{audio-recorder-Cc3KuL9y.js → audio-recorder-BjnB7V8n.js} +2 -2
  8. package/dist/_chunks/{audio-recorder-Cc3KuL9y.js.map → audio-recorder-BjnB7V8n.js.map} +1 -1
  9. package/dist/_chunks/{booking-CLmeXtGv.js → booking-BvCu2XWY.js} +2 -2
  10. package/dist/_chunks/{booking-CLmeXtGv.js.map → booking-BvCu2XWY.js.map} +1 -1
  11. package/dist/_chunks/breadcrumb-agut0PwN.js.map +1 -1
  12. package/dist/_chunks/calendar-event-card-C6qGtywL.js.map +1 -1
  13. package/dist/_chunks/chat-input-QpHxBEnN.js.map +1 -1
  14. package/dist/_chunks/chat-message-CdjWqZjo.js.map +1 -1
  15. package/dist/_chunks/checkbox-group-CfqMv57d.js.map +1 -1
  16. package/dist/_chunks/dependent-selector-DyFpdzZV.js.map +1 -1
  17. package/dist/_chunks/{document-preview-nwfulDEs.js → document-preview-DXl9migE.js} +2 -2
  18. package/dist/_chunks/{document-preview-nwfulDEs.js.map → document-preview-DXl9migE.js.map} +1 -1
  19. package/dist/_chunks/{document-scanner-B6h1Ir56.js → document-scanner-cS_ispQs.js} +3 -3
  20. package/dist/_chunks/document-scanner-cS_ispQs.js.map +1 -0
  21. package/dist/_chunks/editable-currency-cell-renderer-Dus_sBvX.js.map +1 -1
  22. package/dist/_chunks/email-input-Dpe63k0K.js.map +1 -1
  23. package/dist/_chunks/{entity-summary--vP698Jn.js → entity-summary-BILN4wEG.js} +2 -2
  24. package/dist/_chunks/{entity-summary--vP698Jn.js.map → entity-summary-BILN4wEG.js.map} +1 -1
  25. package/dist/_chunks/{field-value-DHG6gEKS.js → field-value-BRVbZJej.js} +133 -144
  26. package/dist/_chunks/field-value-BRVbZJej.js.map +1 -0
  27. package/dist/_chunks/{file-manager-DLJlinIO.js → file-manager-B9LZzT5E.js} +129 -129
  28. package/dist/_chunks/file-manager-B9LZzT5E.js.map +1 -0
  29. package/dist/_chunks/{file-upload-DENvuhfs.js → file-upload-CwxdqkMK.js} +134 -146
  30. package/dist/_chunks/file-upload-CwxdqkMK.js.map +1 -0
  31. package/dist/_chunks/finished-terminal-C0_mefrf.js.map +1 -1
  32. package/dist/_chunks/fiscal-code-input-QP9gkyDE.js.map +1 -1
  33. package/dist/_chunks/form-field-M5UpX65Z.js.map +1 -1
  34. package/dist/_chunks/{freemium-paywall-CmV642PA.js → freemium-paywall-Dr2342_S.js} +2 -2
  35. package/dist/_chunks/{freemium-paywall-CmV642PA.js.map → freemium-paywall-Dr2342_S.js.map} +1 -1
  36. package/dist/_chunks/iban-input-DXIA8Ln_.js.map +1 -1
  37. package/dist/_chunks/{marketplace-app-shell-Br2yebEK.js → marketplace-app-shell-Chcj4q4z.js} +2 -2
  38. package/dist/_chunks/{marketplace-app-shell-Br2yebEK.js.map → marketplace-app-shell-Chcj4q4z.js.map} +1 -1
  39. package/dist/_chunks/message-square-Bye4ATvx.js +20 -0
  40. package/dist/_chunks/message-square-Bye4ATvx.js.map +1 -0
  41. package/dist/_chunks/{notes-panel-Cvdp818a.js → notes-panel-BLjlYBt-.js} +2 -2
  42. package/dist/_chunks/{notes-panel-Cvdp818a.js.map → notes-panel-BLjlYBt-.js.map} +1 -1
  43. package/dist/_chunks/pagination-EkD5SiCK.js.map +1 -1
  44. package/dist/_chunks/{patient-details-COvYWp2e.js → patient-details-B9LCdyWW.js} +2 -2
  45. package/dist/_chunks/{patient-details-COvYWp2e.js.map → patient-details-B9LCdyWW.js.map} +1 -1
  46. package/dist/_chunks/{patient-search-BaUJ_Y-N.js → patient-search-vtRTSdf6.js} +2 -2
  47. package/dist/_chunks/{patient-search-BaUJ_Y-N.js.map → patient-search-vtRTSdf6.js.map} +1 -1
  48. package/dist/_chunks/{patient-summary-card-D6kgdTNn.js → patient-summary-card-vn1H4xWj.js} +2 -2
  49. package/dist/_chunks/patient-summary-card-vn1H4xWj.js.map +1 -0
  50. package/dist/_chunks/{patient-table-BHzmUbzu.js → patient-table-B6AKMTm3.js} +182 -196
  51. package/dist/_chunks/patient-table-B6AKMTm3.js.map +1 -0
  52. package/dist/_chunks/{payment-form-DL9xk9BA.js → payment-form-BoGxEmGn.js} +2 -2
  53. package/dist/_chunks/{payment-form-DL9xk9BA.js.map → payment-form-BoGxEmGn.js.map} +1 -1
  54. package/dist/_chunks/{payment-request-card-d-RmzsUd.js → payment-request-card-CygO1anM.js} +72 -70
  55. package/dist/_chunks/payment-request-card-CygO1anM.js.map +1 -0
  56. package/dist/_chunks/{pdf-viewer-DF3VMaPo.js → pdf-viewer-CcOuR2wj.js} +2 -2
  57. package/dist/_chunks/{pdf-viewer-DF3VMaPo.js.map → pdf-viewer-CcOuR2wj.js.map} +1 -1
  58. package/dist/_chunks/postal-code-input-BznBxVxf.js.map +1 -1
  59. package/dist/_chunks/{practice-results-BCr7jMt1.js → practice-results-yKbwIxqa.js} +2 -2
  60. package/dist/_chunks/{practice-results-BCr7jMt1.js.map → practice-results-yKbwIxqa.js.map} +1 -1
  61. package/dist/_chunks/radio-group-CI-6SmSw.js.map +1 -1
  62. package/dist/_chunks/{radiograph-panel.agent-CxF9pVxd.js → radiograph-panel.agent-M9XD4ze4.js} +2 -2
  63. package/dist/_chunks/{radiograph-panel.agent-CxF9pVxd.js.map → radiograph-panel.agent-M9XD4ze4.js.map} +1 -1
  64. package/dist/_chunks/{rich-text-editor-CCWjNkbx.js → rich-text-editor-RRkBN_WB.js} +2 -2
  65. package/dist/_chunks/rich-text-editor-RRkBN_WB.js.map +1 -0
  66. package/dist/_chunks/select-BW5ecXlX.js.map +1 -1
  67. package/dist/_chunks/{session-countdown-C8AsE072.js → session-countdown-Bc70VXN1.js} +58 -48
  68. package/dist/_chunks/session-countdown-Bc70VXN1.js.map +1 -0
  69. package/dist/_chunks/{sign-document-Bfk0WpWV.js → sign-document-DI561d1C.js} +2 -2
  70. package/dist/_chunks/sign-document-DI561d1C.js.map +1 -0
  71. package/dist/_chunks/{signature-request-CEOrCDyk.js → signature-request-D_6jgDZd.js} +60 -77
  72. package/dist/_chunks/signature-request-D_6jgDZd.js.map +1 -0
  73. package/dist/_chunks/task-card-BUgK6yZT.js.map +1 -1
  74. package/dist/_chunks/{task-tray-Br3vc0O1.js → task-tray-CLIqIXUZ.js} +58 -70
  75. package/dist/_chunks/task-tray-CLIqIXUZ.js.map +1 -0
  76. package/dist/_chunks/tasks-panel-CjGAhIN8.js.map +1 -1
  77. package/dist/_chunks/timeline-r-8IUoBS.js.map +1 -1
  78. package/dist/_chunks/{toast.agent-uV8CeAy6.js → toast.agent-Iw2jWdce.js} +2 -2
  79. package/dist/_chunks/{toast.agent-uV8CeAy6.js.map → toast.agent-Iw2jWdce.js.map} +1 -1
  80. package/dist/_chunks/tooth-scheme-BzJ6rcte.js.map +1 -1
  81. package/dist/_chunks/use-password-requirements-Bwtqx1qN.js.map +1 -1
  82. package/dist/_chunks/{warning-stack-BlG_Ujy3.js → warning-stack-CAHQ0xxS.js} +2 -2
  83. package/dist/_chunks/{warning-stack-BlG_Ujy3.js.map → warning-stack-CAHQ0xxS.js.map} +1 -1
  84. package/dist/_chunks/{workflow-map-C643Q43h.js → workflow-map-SIfAhmWz.js} +2 -2
  85. package/dist/_chunks/workflow-map-SIfAhmWz.js.map +1 -0
  86. package/dist/agent-catalog.json +1 -1
  87. package/dist/components/ai-consent-banner/index.js +1 -1
  88. package/dist/components/alert/index.js +1 -1
  89. package/dist/components/audio-recorder/index.js +1 -1
  90. package/dist/components/booking/index.js +1 -1
  91. package/dist/components/document-preview/index.js +1 -1
  92. package/dist/components/document-scanner/index.js +1 -1
  93. package/dist/components/entity-summary/index.js +1 -1
  94. package/dist/components/file-manager/index.js +1 -1
  95. package/dist/components/file-upload/file-upload.d.ts.map +1 -1
  96. package/dist/components/file-upload/index.js +1 -1
  97. package/dist/components/freemium-paywall/index.js +1 -1
  98. package/dist/components/notes-panel/index.js +1 -1
  99. package/dist/components/patient-details/index.js +1 -1
  100. package/dist/components/patient-search/index.js +1 -1
  101. package/dist/components/patient-summary-card/index.js +1 -1
  102. package/dist/components/patient-table/index.js +1 -1
  103. package/dist/components/payment-card/index.js +1 -1
  104. package/dist/components/payment-form/index.js +1 -1
  105. package/dist/components/pdf-viewer/index.js +1 -1
  106. package/dist/components/practice-results/index.js +1 -1
  107. package/dist/components/radiograph-panel/index.js +1 -1
  108. package/dist/components/rich-text-editor/index.js +1 -1
  109. package/dist/components/select/select.d.ts +8 -5
  110. package/dist/components/select/select.d.ts.map +1 -1
  111. package/dist/components/session-countdown/index.js +1 -1
  112. package/dist/components/sign-document/index.js +1 -1
  113. package/dist/components/task-card/task-card.d.ts.map +1 -1
  114. package/dist/components/task-tray/index.js +1 -1
  115. package/dist/components/toast/index.js +1 -1
  116. package/dist/components/tooth-scheme/tooth-scheme.d.ts.map +1 -1
  117. package/dist/components/warning-stack/index.js +1 -1
  118. package/dist/components/workflow/index.js +1 -1
  119. package/dist/index.js +434 -445
  120. package/dist/index.js.map +1 -1
  121. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  122. package/dist/patterns/signature-request/index.js +1 -1
  123. package/dist/tokens.css +1 -1
  124. package/package.json +5 -3
  125. package/dist/_chunks/alert-KJbsPYkI.js.map +0 -1
  126. package/dist/_chunks/circle-x-W8Enq3i4.js +0 -16
  127. package/dist/_chunks/circle-x-W8Enq3i4.js.map +0 -1
  128. package/dist/_chunks/document-scanner-B6h1Ir56.js.map +0 -1
  129. package/dist/_chunks/field-value-DHG6gEKS.js.map +0 -1
  130. package/dist/_chunks/file-manager-DLJlinIO.js.map +0 -1
  131. package/dist/_chunks/file-upload-DENvuhfs.js.map +0 -1
  132. package/dist/_chunks/patient-summary-card-D6kgdTNn.js.map +0 -1
  133. package/dist/_chunks/patient-table-BHzmUbzu.js.map +0 -1
  134. package/dist/_chunks/payment-request-card-d-RmzsUd.js.map +0 -1
  135. package/dist/_chunks/rich-text-editor-CCWjNkbx.js.map +0 -1
  136. package/dist/_chunks/session-countdown-C8AsE072.js.map +0 -1
  137. package/dist/_chunks/sign-document-Bfk0WpWV.js.map +0 -1
  138. package/dist/_chunks/signature-request-CEOrCDyk.js.map +0 -1
  139. package/dist/_chunks/task-tray-Br3vc0O1.js.map +0 -1
  140. package/dist/_chunks/workflow-map-C643Q43h.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb-agut0PwN.js","sources":["../../src/components/breadcrumb/breadcrumb.agent.ts","../../src/components/breadcrumb/breadcrumb.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — Breadcrumb. */\n/* */\n/* Breadcrumb is a navigation trail. Items expose their stable route id */\n/* + href ONLY — labels can contain patient names or other PHI and MUST */\n/* NOT be exposed on `data-*` or in adapter state (see PRS §26 §6.1). */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the full contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { BreadcrumbHandle } from './breadcrumb';\n\nexport interface BreadcrumbAgentItem {\n id: string;\n href?: string;\n}\n\nexport const breadcrumbAgent: AgentAdapter<BreadcrumbHandle> = {\n id: 'breadcrumb',\n capabilities: ['navigate'],\n state: {\n items: {\n type: 'Array<{ id: string, href?: string }>',\n descriptionKey: 'ui.agent.breadcrumb.state.items',\n description:\n 'Ordered list of crumb ids + hrefs in display order. Labels are intentionally excluded — they may contain PHI.',\n read: (handle) => handle.getItems(),\n },\n },\n actions: {\n navigate_to: {\n safety: 'read',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'Stable opaque crumb id (from getItems).',\n },\n },\n required: ['id'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.breadcrumb.actions.navigateTo',\n description:\n 'Activate the crumb with the given id — equivalent to clicking the link.',\n examples: [\n { args: { id: '/patients' }, note: 'Navigate to the patients crumb.' },\n ],\n invoke: (handle, args: { id: string }) => {\n handle.navigateTo(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'breadcrumb',\n description: 'Marks the Breadcrumb root `<nav>`.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-crumb-id',\n description:\n 'Stable opaque id of a crumb. Labels are NEVER carried in data-* — they may contain PHI.',\n },\n },\n};\n","import {\n Children,\n cloneElement,\n createContext,\n forwardRef,\n isValidElement,\n useContext,\n useImperativeHandle,\n useMemo,\n useRef,\n type AnchorHTMLAttributes,\n type ComponentPropsWithoutRef,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport * as DropdownMenu from '@radix-ui/react-dropdown-menu';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ChevronRight, MoreHorizontal } from 'lucide-react';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { breadcrumbAgent } from './breadcrumb.agent';\n\n/* -------------------------------------------------------------------- */\n/* Context — shares separator variant between siblings */\n/* -------------------------------------------------------------------- */\n\ntype SeparatorVariant = 'chevron' | 'slash';\n\ninterface BreadcrumbContextValue {\n separator: SeparatorVariant;\n}\n\nconst BreadcrumbContext = createContext<BreadcrumbContextValue>({\n separator: 'chevron',\n});\n\n/* -------------------------------------------------------------------- */\n/* Root — <nav aria-label> wrapper + truncation engine */\n/* -------------------------------------------------------------------- */\n\nexport interface BreadcrumbProps extends Omit<\n ComponentPropsWithoutRef<'nav'>,\n 'id'\n> {\n /** Override the default `aria-label` (falls back to translated `ui.navigation.breadcrumb.label`). */\n 'aria-label'?: string;\n /** Separator glyph between items. @default 'chevron' */\n separator?: SeparatorVariant;\n /** Maximum number of visible crumbs before collapsing. @default 4 */\n maxItems?: number;\n /** Items kept visible at the start. @default 1 */\n itemsBeforeCollapse?: number;\n /** Items kept visible at the end. @default 1 */\n itemsAfterCollapse?: number;\n /** If true, disables collapse behaviour. */\n disableCollapse?: boolean;\n /**\n * Consumer-supplied instance id, surfaced as `data-component-id` so an\n * agent / UI bridge can address this instance.\n */\n id?: string;\n}\n\n/**\n * Imperative handle for agent-readiness.\n *\n * Items expose their stable id (`BreadcrumbItem` `id` prop, falling back\n * to the `BreadcrumbLink` href) and href — never their visible label,\n * which may contain PHI (see PRS §26 §6.1).\n */\nexport interface BreadcrumbHandle {\n getItems: () => Array<{ id: string; href?: string }>;\n navigateTo: (id: string) => void;\n}\n\nconst Breadcrumb = forwardRef<HTMLElement, BreadcrumbProps>(\n (\n {\n children,\n className,\n 'aria-label': ariaLabel,\n separator = 'chevron',\n maxItems = 4,\n itemsBeforeCollapse = 1,\n itemsAfterCollapse = 1,\n disableCollapse = false,\n id,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const items = useMemo(() => extractAgentItems(children), [children]);\n\n const handle = useMemo<BreadcrumbHandle>(\n () => ({\n getItems: () => items,\n navigateTo: (targetId: string) => {\n const hit = items.find((i) => i.id === targetId);\n if (!hit?.href) return;\n if (typeof window === 'undefined') return;\n // Same allow-list as the BreadcrumbLink renderer — never honour\n // `javascript:` / `data:` URLs.\n const trimmed = hit.href.trim();\n if (/^\\s*javascript:/i.test(trimmed)) return;\n window.location.assign(trimmed);\n },\n }),\n [items],\n );\n const innerRef = useRef<HTMLElement>(null);\n useImperativeHandle(ref, () => innerRef.current as HTMLElement, []);\n useAgentRegistration(breadcrumbAgent, handle, id);\n\n return (\n <BreadcrumbContext.Provider value={{ separator }}>\n <nav\n ref={innerRef}\n id={id}\n aria-label={ariaLabel ?? t('navigation.breadcrumb.label')}\n data-component=\"breadcrumb\"\n data-component-id={id}\n className={className}\n {...rest}\n >\n <BreadcrumbList\n maxItems={maxItems}\n itemsBeforeCollapse={itemsBeforeCollapse}\n itemsAfterCollapse={itemsAfterCollapse}\n disableCollapse={disableCollapse}\n >\n {children}\n </BreadcrumbList>\n </nav>\n </BreadcrumbContext.Provider>\n );\n },\n);\nBreadcrumb.displayName = 'Breadcrumb';\n\n/**\n * Walks the Breadcrumb children to collect `{ id, href }` for the agent\n * handle. The id is taken from the BreadcrumbItem's `id` prop, falling\n * back to the inner BreadcrumbLink's href (or an index string as a last\n * resort). Labels are never read — they may contain PHI.\n */\nfunction extractAgentItems(\n children: ReactNode,\n): Array<{ id: string; href?: string }> {\n const out: Array<{ id: string; href?: string }> = [];\n let index = 0;\n Children.forEach(children, (child) => {\n if (!isValidElement(child)) return;\n // Only collect Items. Anything else (separators, custom wrappers) is\n // skipped — the agent contract addresses crumbs, not chrome.\n if (child.type !== BreadcrumbItem) return;\n const itemProps = child.props as BreadcrumbItemProps & {\n id?: string;\n children?: ReactNode;\n };\n let href: string | undefined;\n Children.forEach(itemProps.children, (grandchild) => {\n if (href) return;\n if (!isValidElement(grandchild)) return;\n if (grandchild.type !== BreadcrumbLink) return;\n const linkProps = grandchild.props as BreadcrumbLinkProps;\n if (typeof linkProps.href === 'string') href = linkProps.href;\n });\n const id = itemProps.id ?? href ?? String(index);\n out.push({ id, href });\n index += 1;\n });\n return out;\n}\n\n/* -------------------------------------------------------------------- */\n/* List — walks its children, injects separators & ellipsis */\n/* -------------------------------------------------------------------- */\n\nconst listClasses = [\n 'ds:flex ds:flex-wrap ds:items-center',\n 'ds:gap-[var(--spacing-xs)]',\n 'ds:text-[var(--font-size-sm)] ds:text-[var(--muted-foreground)]',\n 'ds:ps-0 ds:m-0',\n 'ds:list-none',\n].join(' ');\n\nexport interface BreadcrumbListProps extends ComponentPropsWithoutRef<'ol'> {\n maxItems?: number;\n itemsBeforeCollapse?: number;\n itemsAfterCollapse?: number;\n disableCollapse?: boolean;\n}\n\nconst BreadcrumbList = forwardRef<HTMLOListElement, BreadcrumbListProps>(\n (\n {\n children,\n className,\n maxItems = 4,\n itemsBeforeCollapse = 1,\n itemsAfterCollapse = 1,\n disableCollapse = false,\n ...rest\n },\n ref,\n ) => {\n const arr = Children.toArray(children).filter((c) =>\n isValidElement(c),\n ) as ReactElement[];\n const total = arr.length;\n\n const shouldCollapse =\n !disableCollapse &&\n total > maxItems &&\n itemsBeforeCollapse + itemsAfterCollapse < total;\n\n const renderItem = (child: ReactElement, isLast: boolean, key: string) =>\n cloneElement(child, {\n isCurrent: (child.props as BreadcrumbItemProps).isCurrent ?? isLast,\n key,\n } as Partial<BreadcrumbItemProps>);\n\n const renderSeparatorIf = (condition: boolean, key: string) =>\n condition ? <BreadcrumbSeparator key={key} /> : null;\n\n const nodes: ReactNode[] = [];\n if (!shouldCollapse) {\n arr.forEach((child, i) => {\n const isLast = i === total - 1;\n nodes.push(renderItem(child, isLast, `item-${i}`));\n nodes.push(renderSeparatorIf(!isLast, `sep-${i}`));\n });\n } else {\n const before = arr.slice(0, itemsBeforeCollapse);\n const after = arr.slice(total - itemsAfterCollapse);\n const hidden = arr.slice(itemsBeforeCollapse, total - itemsAfterCollapse);\n\n before.forEach((child, i) => {\n nodes.push(renderItem(child, false, `b-${i}`));\n nodes.push(renderSeparatorIf(true, `b-sep-${i}`));\n });\n\n nodes.push(\n <BreadcrumbItem key=\"ellipsis\">\n <BreadcrumbEllipsis hiddenItems={hidden} />\n </BreadcrumbItem>,\n );\n nodes.push(renderSeparatorIf(true, 'ellipsis-sep'));\n\n after.forEach((child, i) => {\n const isLast = i === after.length - 1;\n nodes.push(renderItem(child, isLast, `a-${i}`));\n nodes.push(renderSeparatorIf(!isLast, `a-sep-${i}`));\n });\n }\n\n return (\n <ol\n ref={ref}\n className={[listClasses, className].filter(Boolean).join(' ')}\n {...rest}\n >\n {nodes}\n </ol>\n );\n },\n);\nBreadcrumbList.displayName = 'BreadcrumbList';\n\n/* -------------------------------------------------------------------- */\n/* Item — <li> marks current when `isCurrent` */\n/* -------------------------------------------------------------------- */\n\nconst itemClasses = [\n 'ds:inline-flex ds:items-center',\n 'ds:[max-inline-size:16rem]',\n 'ds:min-h-[var(--min-target-size)]',\n 'ds:py-[var(--spacing-xs)]',\n].join(' ');\n\nexport interface BreadcrumbItemProps extends ComponentPropsWithoutRef<'li'> {\n /** Set automatically by `BreadcrumbList` on the final item. */\n isCurrent?: boolean;\n}\n\nconst BreadcrumbItem = forwardRef<HTMLLIElement, BreadcrumbItemProps>(\n ({ children, className, isCurrent = false, id, ...rest }, ref) => {\n // Derive an agent crumb id: explicit `id` prop, else the inner link's\n // href. Labels are never used — they may contain PHI (PRS §26 §6.1).\n let derived: string | undefined = id;\n if (!derived) {\n Children.forEach(children, (child) => {\n if (derived) return;\n if (!isValidElement(child)) return;\n if (child.type !== BreadcrumbLink) return;\n const linkProps = child.props as BreadcrumbLinkProps;\n if (typeof linkProps.href === 'string') derived = linkProps.href;\n });\n }\n return (\n <li\n ref={ref}\n id={id}\n data-crumb-id={derived}\n className={[itemClasses, className].filter(Boolean).join(' ')}\n {...rest}\n >\n {Children.map(children, (child) =>\n isValidElement(child) &&\n (child.type === BreadcrumbLink ||\n (child.props as { _link?: boolean })?._link)\n ? cloneElement(child as ReactElement<BreadcrumbLinkProps>, {\n isCurrent,\n })\n : child,\n )}\n </li>\n );\n },\n);\nBreadcrumbItem.displayName = 'BreadcrumbItem';\n\n/* -------------------------------------------------------------------- */\n/* Link — renders <a>, or plain text when current */\n/* -------------------------------------------------------------------- */\n\nconst linkClasses = [\n 'ds:inline-flex ds:items-center',\n 'ds:[max-inline-size:16rem]',\n 'ds:overflow-hidden ds:text-ellipsis ds:whitespace-nowrap',\n 'ds:break-normal',\n 'ds:text-[var(--muted-foreground)] ds:no-underline',\n 'ds:hover:text-[var(--foreground)] ds:hover:underline',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:min-h-[var(--min-target-size)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]',\n].join(' ');\n\nconst currentClasses = [\n 'ds:inline-flex ds:items-center',\n 'ds:[max-inline-size:16rem]',\n 'ds:overflow-hidden ds:text-ellipsis ds:whitespace-nowrap',\n 'ds:break-normal',\n 'ds:text-[var(--foreground)] ds:font-[var(--font-weight-semibold)]',\n 'ds:min-h-[var(--min-target-size)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]',\n].join(' ');\n\nexport interface BreadcrumbLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n /** Use Radix `Slot` so consumers can pass a router link. */\n asChild?: boolean;\n /** Set by the parent Item when this is the current page. */\n isCurrent?: boolean;\n}\n\nconst BreadcrumbLink = forwardRef<HTMLAnchorElement, BreadcrumbLinkProps>(\n (\n { asChild = false, isCurrent = false, className, children, ...rest },\n ref,\n ) => {\n const { t } = useTranslation();\n\n if (isCurrent) {\n return (\n <span\n aria-current=\"page\"\n aria-label={\n (rest['aria-label'] as string | undefined) ??\n t('navigation.breadcrumb.current')\n }\n className={[currentClasses, className].filter(Boolean).join(' ')}\n >\n {children}\n </span>\n );\n }\n\n if (asChild) {\n return (\n <Slot\n ref={ref}\n className={[linkClasses, className].filter(Boolean).join(' ')}\n {...rest}\n >\n {children}\n </Slot>\n );\n }\n\n return (\n <a\n ref={ref}\n className={[linkClasses, className].filter(Boolean).join(' ')}\n {...rest}\n >\n {children}\n </a>\n );\n },\n);\nBreadcrumbLink.displayName = 'BreadcrumbLink';\n\n/* -------------------------------------------------------------------- */\n/* Separator */\n/* -------------------------------------------------------------------- */\n\nconst separatorVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:text-[var(--muted-foreground)]',\n 'ds:ms-[var(--spacing-xs)] ds:me-[var(--spacing-xs)]',\n 'ds:select-none',\n ].join(' '),\n {\n variants: {\n variant: {\n chevron: '',\n slash: '',\n },\n },\n defaultVariants: { variant: 'chevron' },\n },\n);\n\nexport interface BreadcrumbSeparatorProps\n extends\n Omit<ComponentPropsWithoutRef<'li'>, 'children'>,\n VariantProps<typeof separatorVariants> {\n children?: ReactNode;\n}\n\nconst BreadcrumbSeparator = forwardRef<HTMLLIElement, BreadcrumbSeparatorProps>(\n ({ className, variant, children, ...rest }, ref) => {\n const ctx = useContext(BreadcrumbContext);\n const resolved = variant ?? ctx.separator;\n const defaultGlyph =\n resolved === 'slash' ? (\n <span aria-hidden=\"true\">/</span>\n ) : (\n <ChevronRight\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:rtl:-scale-x-100\"\n />\n );\n return (\n <li\n ref={ref}\n aria-hidden=\"true\"\n role=\"presentation\"\n className={separatorVariants({ variant: resolved, className })}\n {...rest}\n >\n {children ?? defaultGlyph}\n </li>\n );\n },\n);\nBreadcrumbSeparator.displayName = 'BreadcrumbSeparator';\n\n/* -------------------------------------------------------------------- */\n/* Ellipsis — opens a Radix DropdownMenu with hidden crumbs */\n/* -------------------------------------------------------------------- */\n\nconst ellipsisTriggerClasses = [\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-[var(--muted-foreground)]',\n 'ds:hover:text-[var(--foreground)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n].join(' ');\n\nconst ellipsisContentClasses = [\n 'ds:z-[var(--z-dropdown)] ds:min-w-[12rem] ds:overflow-hidden',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-[var(--border)]',\n 'ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:p-[var(--spacing-xs)]',\n 'ds:animate-in ds:fade-in ds:zoom-in-95 ds:motion-reduce:animate-none',\n].join(' ');\n\nconst ellipsisItemClasses = [\n 'ds:flex ds:items-center',\n 'ds:min-h-[var(--min-target-size)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-[var(--foreground)] ds:cursor-pointer ds:select-none',\n 'ds:data-[highlighted]:bg-[var(--muted)] ds:data-[highlighted]:text-[var(--foreground)]',\n 'ds:outline-none',\n].join(' ');\n\nexport interface BreadcrumbEllipsisProps extends ComponentPropsWithoutRef<'button'> {\n /** Hidden crumb elements rendered inside the dropdown menu. */\n hiddenItems?: ReactElement[];\n}\n\nconst BreadcrumbEllipsis = forwardRef<\n HTMLButtonElement,\n BreadcrumbEllipsisProps\n>(({ className, hiddenItems = [], ...rest }, ref) => {\n const { t } = useTranslation();\n const showPath = t('navigation.breadcrumb.showPath');\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <button\n ref={ref}\n type=\"button\"\n aria-label={showPath}\n className={[ellipsisTriggerClasses, className]\n .filter(Boolean)\n .join(' ')}\n {...rest}\n >\n <MoreHorizontal aria-hidden=\"true\" className=\"ds:size-4\" />\n <span className=\"ds:sr-only\">{showPath}</span>\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n className={ellipsisContentClasses}\n align=\"start\"\n sideOffset={6}\n >\n {hiddenItems.map((item, i) => {\n // Extract the anchor inside the hidden BreadcrumbItem (if any)\n const linkChild = extractLink(item);\n return (\n <DropdownMenu.Item\n key={`hidden-${i}`}\n asChild\n className={ellipsisItemClasses}\n >\n {linkChild ?? <span>{item}</span>}\n </DropdownMenu.Item>\n );\n })}\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n );\n});\nBreadcrumbEllipsis.displayName = 'BreadcrumbEllipsis';\n\n/**\n * Walks a `BreadcrumbItem` to find the first child whose type is\n * `BreadcrumbLink` and returns the link rendered as a plain `<a>` so the\n * dropdown item can adopt its navigational behaviour.\n */\nfunction extractLink(item: ReactElement): ReactElement | null {\n let found: ReactElement | null = null;\n const itemChildren = (item.props as { children?: ReactNode }).children;\n Children.forEach(itemChildren, (child) => {\n if (found) return;\n if (!isValidElement(child)) return;\n if (child.type === BreadcrumbLink) {\n const linkProps = child.props as BreadcrumbLinkProps & {\n children?: ReactNode;\n };\n const href =\n typeof linkProps.href === 'string' ? linkProps.href : undefined;\n const safeHref = href && /^\\s*javascript:/i.test(href) ? undefined : href;\n found = (\n <a\n href={safeHref}\n onClick={\n linkProps.onClick as AnchorHTMLAttributes<HTMLAnchorElement>['onClick']\n }\n >\n {linkProps.children}\n </a>\n );\n }\n });\n return found;\n}\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n};\n"],"names":["breadcrumbAgent","handle","args","BreadcrumbContext","createContext","Breadcrumb","forwardRef","children","className","ariaLabel","separator","maxItems","itemsBeforeCollapse","itemsAfterCollapse","disableCollapse","id","rest","ref","t","useTranslation","items","useMemo","extractAgentItems","targetId","hit","i","trimmed","innerRef","useRef","useImperativeHandle","useAgentRegistration","jsx","BreadcrumbList","out","index","Children","child","isValidElement","BreadcrumbItem","itemProps","href","grandchild","BreadcrumbLink","linkProps","listClasses","arr","total","shouldCollapse","renderItem","isLast","key","cloneElement","renderSeparatorIf","condition","BreadcrumbSeparator","nodes","before","after","hidden","BreadcrumbEllipsis","itemClasses","isCurrent","derived","_a","linkClasses","currentClasses","asChild","Slot","separatorVariants","cva","variant","ctx","useContext","resolved","defaultGlyph","ChevronRight","ellipsisTriggerClasses","ellipsisContentClasses","ellipsisItemClasses","hiddenItems","showPath","jsxs","DropdownMenu","MoreHorizontal","item","linkChild","extractLink","found","itemChildren","safeHref"],"mappings":";;;;;;;;;AAkBO,MAAMA,IAAkD;AAAA,EAC7D,IAAI;AAAA,EACJ,cAAc,CAAC,UAAU;AAAA,EACzB,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,EACpC;AAAA,EAEF,SAAS;AAAA,IACP,aAAa;AAAA,MACX,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,IAAI;AAAA,YACF,MAAM;AAAA,YACN,aAAa;AAAA,UAAA;AAAA,QACf;AAAA,QAEF,UAAU,CAAC,IAAI;AAAA,MAAA;AAAA,MAEjB,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,UAAU;AAAA,QACR,EAAE,MAAM,EAAE,IAAI,YAAA,GAAe,MAAM,kCAAA;AAAA,MAAkC;AAAA,MAEvE,QAAQ,CAACA,GAAQC,MAAyB;AACxC,QAAAD,EAAO,WAAWC,EAAK,EAAE;AAAA,MAC3B;AAAA,IAAA;AAAA,EACF;AAAA,EAEF,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,IAEf,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,aACE;AAA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mB,cAAc;AAOjC,SAAS2B,GAAYF,GAAyC;AAC5D,MAAIG,IAA6B;AACjC,QAAMC,IAAgBJ,EAAK,MAAmC;AAC9D,SAAAjD,EAAS,QAAQqD,GAAc,CAACpD,MAAU;AACxC,QAAI,CAAAmD,KACClD,EAAeD,CAAK,KACrBA,EAAM,SAASM,GAAgB;AACjC,YAAMC,IAAYP,EAAM,OAGlBI,IACJ,OAAOG,EAAU,QAAS,WAAWA,EAAU,OAAO,QAClD8C,IAAWjD,KAAQ,mBAAmB,KAAKA,CAAI,IAAI,SAAYA;AACrE,MAAA+C,IACE,gBAAAxD;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAM0D;AAAA,UACN,SACE9C,EAAU;AAAA,UAGX,UAAAA,EAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IAGjB;AAAA,EACF,CAAC,GACM4C;AACT;"}
1
+ {"version":3,"file":"breadcrumb-agut0PwN.js","sources":["../../src/components/breadcrumb/breadcrumb.agent.ts","../../src/components/breadcrumb/breadcrumb.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — Breadcrumb. */\n/* */\n/* Breadcrumb is a navigation trail. Items expose their stable route id */\n/* + href ONLY — labels can contain patient names or other PHI and MUST */\n/* NOT be exposed on `data-*` or in adapter state (see PRS §26 §6.1). */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the full contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { BreadcrumbHandle } from './breadcrumb';\n\nexport interface BreadcrumbAgentItem {\n id: string;\n href?: string;\n}\n\nexport const breadcrumbAgent: AgentAdapter<BreadcrumbHandle> = {\n id: 'breadcrumb',\n capabilities: ['navigate'],\n state: {\n items: {\n type: 'Array<{ id: string, href?: string }>',\n descriptionKey: 'ui.agent.breadcrumb.state.items',\n description:\n 'Ordered list of crumb ids + hrefs in display order. Labels are intentionally excluded — they may contain PHI.',\n read: (handle) => handle.getItems(),\n },\n },\n actions: {\n navigate_to: {\n safety: 'read',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'Stable opaque crumb id (from getItems).',\n },\n },\n required: ['id'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.breadcrumb.actions.navigateTo',\n description:\n 'Activate the crumb with the given id — equivalent to clicking the link.',\n examples: [\n { args: { id: '/patients' }, note: 'Navigate to the patients crumb.' },\n ],\n invoke: (handle, args: { id: string }) => {\n handle.navigateTo(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'breadcrumb',\n description: 'Marks the Breadcrumb root `<nav>`.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-crumb-id',\n description:\n 'Stable opaque id of a crumb. Labels are NEVER carried in data-* — they may contain PHI.',\n },\n },\n};\n","import {\n Children,\n cloneElement,\n createContext,\n forwardRef,\n isValidElement,\n useContext,\n useImperativeHandle,\n useMemo,\n useRef,\n type AnchorHTMLAttributes,\n type ComponentPropsWithoutRef,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport * as DropdownMenu from '@radix-ui/react-dropdown-menu';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ChevronRight, Ellipsis } from 'lucide-react';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { breadcrumbAgent } from './breadcrumb.agent';\n\n/* -------------------------------------------------------------------- */\n/* Context — shares separator variant between siblings */\n/* -------------------------------------------------------------------- */\n\ntype SeparatorVariant = 'chevron' | 'slash';\n\ninterface BreadcrumbContextValue {\n separator: SeparatorVariant;\n}\n\nconst BreadcrumbContext = createContext<BreadcrumbContextValue>({\n separator: 'chevron',\n});\n\n/* -------------------------------------------------------------------- */\n/* Root — <nav aria-label> wrapper + truncation engine */\n/* -------------------------------------------------------------------- */\n\nexport interface BreadcrumbProps extends Omit<\n ComponentPropsWithoutRef<'nav'>,\n 'id'\n> {\n /** Override the default `aria-label` (falls back to translated `ui.navigation.breadcrumb.label`). */\n 'aria-label'?: string;\n /** Separator glyph between items. @default 'chevron' */\n separator?: SeparatorVariant;\n /** Maximum number of visible crumbs before collapsing. @default 4 */\n maxItems?: number;\n /** Items kept visible at the start. @default 1 */\n itemsBeforeCollapse?: number;\n /** Items kept visible at the end. @default 1 */\n itemsAfterCollapse?: number;\n /** If true, disables collapse behaviour. */\n disableCollapse?: boolean;\n /**\n * Consumer-supplied instance id, surfaced as `data-component-id` so an\n * agent / UI bridge can address this instance.\n */\n id?: string;\n}\n\n/**\n * Imperative handle for agent-readiness.\n *\n * Items expose their stable id (`BreadcrumbItem` `id` prop, falling back\n * to the `BreadcrumbLink` href) and href — never their visible label,\n * which may contain PHI (see PRS §26 §6.1).\n */\nexport interface BreadcrumbHandle {\n getItems: () => Array<{ id: string; href?: string }>;\n navigateTo: (id: string) => void;\n}\n\nconst Breadcrumb = forwardRef<HTMLElement, BreadcrumbProps>(\n (\n {\n children,\n className,\n 'aria-label': ariaLabel,\n separator = 'chevron',\n maxItems = 4,\n itemsBeforeCollapse = 1,\n itemsAfterCollapse = 1,\n disableCollapse = false,\n id,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const items = useMemo(() => extractAgentItems(children), [children]);\n\n const handle = useMemo<BreadcrumbHandle>(\n () => ({\n getItems: () => items,\n navigateTo: (targetId: string) => {\n const hit = items.find((i) => i.id === targetId);\n if (!hit?.href) return;\n if (typeof window === 'undefined') return;\n // Same allow-list as the BreadcrumbLink renderer — never honour\n // `javascript:` / `data:` URLs.\n const trimmed = hit.href.trim();\n if (/^\\s*javascript:/i.test(trimmed)) return;\n window.location.assign(trimmed);\n },\n }),\n [items],\n );\n const innerRef = useRef<HTMLElement>(null);\n useImperativeHandle(ref, () => innerRef.current as HTMLElement, []);\n useAgentRegistration(breadcrumbAgent, handle, id);\n\n return (\n <BreadcrumbContext.Provider value={{ separator }}>\n <nav\n ref={innerRef}\n id={id}\n aria-label={ariaLabel ?? t('navigation.breadcrumb.label')}\n data-component=\"breadcrumb\"\n data-component-id={id}\n className={className}\n {...rest}\n >\n <BreadcrumbList\n maxItems={maxItems}\n itemsBeforeCollapse={itemsBeforeCollapse}\n itemsAfterCollapse={itemsAfterCollapse}\n disableCollapse={disableCollapse}\n >\n {children}\n </BreadcrumbList>\n </nav>\n </BreadcrumbContext.Provider>\n );\n },\n);\nBreadcrumb.displayName = 'Breadcrumb';\n\n/**\n * Walks the Breadcrumb children to collect `{ id, href }` for the agent\n * handle. The id is taken from the BreadcrumbItem's `id` prop, falling\n * back to the inner BreadcrumbLink's href (or an index string as a last\n * resort). Labels are never read — they may contain PHI.\n */\nfunction extractAgentItems(\n children: ReactNode,\n): Array<{ id: string; href?: string }> {\n const out: Array<{ id: string; href?: string }> = [];\n let index = 0;\n Children.forEach(children, (child) => {\n if (!isValidElement(child)) return;\n // Only collect Items. Anything else (separators, custom wrappers) is\n // skipped — the agent contract addresses crumbs, not chrome.\n if (child.type !== BreadcrumbItem) return;\n const itemProps = child.props as BreadcrumbItemProps & {\n id?: string;\n children?: ReactNode;\n };\n let href: string | undefined;\n Children.forEach(itemProps.children, (grandchild) => {\n if (href) return;\n if (!isValidElement(grandchild)) return;\n if (grandchild.type !== BreadcrumbLink) return;\n const linkProps = grandchild.props as BreadcrumbLinkProps;\n if (typeof linkProps.href === 'string') href = linkProps.href;\n });\n const id = itemProps.id ?? href ?? String(index);\n out.push({ id, href });\n index += 1;\n });\n return out;\n}\n\n/* -------------------------------------------------------------------- */\n/* List — walks its children, injects separators & ellipsis */\n/* -------------------------------------------------------------------- */\n\nconst listClasses = [\n 'ds:flex ds:flex-wrap ds:items-center',\n 'ds:gap-[var(--spacing-xs)]',\n 'ds:text-[var(--font-size-sm)] ds:text-[var(--muted-foreground)]',\n 'ds:ps-0 ds:m-0',\n 'ds:list-none',\n].join(' ');\n\nexport interface BreadcrumbListProps extends ComponentPropsWithoutRef<'ol'> {\n maxItems?: number;\n itemsBeforeCollapse?: number;\n itemsAfterCollapse?: number;\n disableCollapse?: boolean;\n}\n\nconst BreadcrumbList = forwardRef<HTMLOListElement, BreadcrumbListProps>(\n (\n {\n children,\n className,\n maxItems = 4,\n itemsBeforeCollapse = 1,\n itemsAfterCollapse = 1,\n disableCollapse = false,\n ...rest\n },\n ref,\n ) => {\n const arr = Children.toArray(children).filter((c) =>\n isValidElement(c),\n ) as ReactElement[];\n const total = arr.length;\n\n const shouldCollapse =\n !disableCollapse &&\n total > maxItems &&\n itemsBeforeCollapse + itemsAfterCollapse < total;\n\n const renderItem = (child: ReactElement, isLast: boolean, key: string) =>\n cloneElement(child, {\n isCurrent: (child.props as BreadcrumbItemProps).isCurrent ?? isLast,\n key,\n } as Partial<BreadcrumbItemProps>);\n\n const renderSeparatorIf = (condition: boolean, key: string) =>\n condition ? <BreadcrumbSeparator key={key} /> : null;\n\n const nodes: ReactNode[] = [];\n if (!shouldCollapse) {\n arr.forEach((child, i) => {\n const isLast = i === total - 1;\n nodes.push(renderItem(child, isLast, `item-${i}`));\n nodes.push(renderSeparatorIf(!isLast, `sep-${i}`));\n });\n } else {\n const before = arr.slice(0, itemsBeforeCollapse);\n const after = arr.slice(total - itemsAfterCollapse);\n const hidden = arr.slice(itemsBeforeCollapse, total - itemsAfterCollapse);\n\n before.forEach((child, i) => {\n nodes.push(renderItem(child, false, `b-${i}`));\n nodes.push(renderSeparatorIf(true, `b-sep-${i}`));\n });\n\n nodes.push(\n <BreadcrumbItem key=\"ellipsis\">\n <BreadcrumbEllipsis hiddenItems={hidden} />\n </BreadcrumbItem>,\n );\n nodes.push(renderSeparatorIf(true, 'ellipsis-sep'));\n\n after.forEach((child, i) => {\n const isLast = i === after.length - 1;\n nodes.push(renderItem(child, isLast, `a-${i}`));\n nodes.push(renderSeparatorIf(!isLast, `a-sep-${i}`));\n });\n }\n\n return (\n <ol\n ref={ref}\n className={[listClasses, className].filter(Boolean).join(' ')}\n {...rest}\n >\n {nodes}\n </ol>\n );\n },\n);\nBreadcrumbList.displayName = 'BreadcrumbList';\n\n/* -------------------------------------------------------------------- */\n/* Item — <li> marks current when `isCurrent` */\n/* -------------------------------------------------------------------- */\n\nconst itemClasses = [\n 'ds:inline-flex ds:items-center',\n 'ds:[max-inline-size:16rem]',\n 'ds:min-h-[var(--min-target-size)]',\n 'ds:py-[var(--spacing-xs)]',\n].join(' ');\n\nexport interface BreadcrumbItemProps extends ComponentPropsWithoutRef<'li'> {\n /** Set automatically by `BreadcrumbList` on the final item. */\n isCurrent?: boolean;\n}\n\nconst BreadcrumbItem = forwardRef<HTMLLIElement, BreadcrumbItemProps>(\n ({ children, className, isCurrent = false, id, ...rest }, ref) => {\n // Derive an agent crumb id: explicit `id` prop, else the inner link's\n // href. Labels are never used — they may contain PHI (PRS §26 §6.1).\n let derived: string | undefined = id;\n if (!derived) {\n Children.forEach(children, (child) => {\n if (derived) return;\n if (!isValidElement(child)) return;\n if (child.type !== BreadcrumbLink) return;\n const linkProps = child.props as BreadcrumbLinkProps;\n if (typeof linkProps.href === 'string') derived = linkProps.href;\n });\n }\n return (\n <li\n ref={ref}\n id={id}\n data-crumb-id={derived}\n className={[itemClasses, className].filter(Boolean).join(' ')}\n {...rest}\n >\n {Children.map(children, (child) =>\n isValidElement(child) &&\n (child.type === BreadcrumbLink ||\n (child.props as { _link?: boolean })?._link)\n ? cloneElement(child as ReactElement<BreadcrumbLinkProps>, {\n isCurrent,\n })\n : child,\n )}\n </li>\n );\n },\n);\nBreadcrumbItem.displayName = 'BreadcrumbItem';\n\n/* -------------------------------------------------------------------- */\n/* Link — renders <a>, or plain text when current */\n/* -------------------------------------------------------------------- */\n\nconst linkClasses = [\n 'ds:inline-flex ds:items-center',\n 'ds:[max-inline-size:16rem]',\n 'ds:overflow-hidden ds:text-ellipsis ds:whitespace-nowrap',\n 'ds:break-normal',\n 'ds:text-[var(--muted-foreground)] ds:no-underline',\n 'ds:hover:text-[var(--foreground)] ds:hover:underline',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:min-h-[var(--min-target-size)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]',\n].join(' ');\n\nconst currentClasses = [\n 'ds:inline-flex ds:items-center',\n 'ds:[max-inline-size:16rem]',\n 'ds:overflow-hidden ds:text-ellipsis ds:whitespace-nowrap',\n 'ds:break-normal',\n 'ds:text-[var(--foreground)] ds:font-[var(--font-weight-semibold)]',\n 'ds:min-h-[var(--min-target-size)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]',\n].join(' ');\n\nexport interface BreadcrumbLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n /** Use Radix `Slot` so consumers can pass a router link. */\n asChild?: boolean;\n /** Set by the parent Item when this is the current page. */\n isCurrent?: boolean;\n}\n\nconst BreadcrumbLink = forwardRef<HTMLAnchorElement, BreadcrumbLinkProps>(\n (\n { asChild = false, isCurrent = false, className, children, ...rest },\n ref,\n ) => {\n const { t } = useTranslation();\n\n if (isCurrent) {\n return (\n <span\n aria-current=\"page\"\n aria-label={\n (rest['aria-label'] as string | undefined) ??\n t('navigation.breadcrumb.current')\n }\n className={[currentClasses, className].filter(Boolean).join(' ')}\n >\n {children}\n </span>\n );\n }\n\n if (asChild) {\n return (\n <Slot\n ref={ref}\n className={[linkClasses, className].filter(Boolean).join(' ')}\n {...rest}\n >\n {children}\n </Slot>\n );\n }\n\n return (\n <a\n ref={ref}\n className={[linkClasses, className].filter(Boolean).join(' ')}\n {...rest}\n >\n {children}\n </a>\n );\n },\n);\nBreadcrumbLink.displayName = 'BreadcrumbLink';\n\n/* -------------------------------------------------------------------- */\n/* Separator */\n/* -------------------------------------------------------------------- */\n\nconst separatorVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:text-[var(--muted-foreground)]',\n 'ds:ms-[var(--spacing-xs)] ds:me-[var(--spacing-xs)]',\n 'ds:select-none',\n ].join(' '),\n {\n variants: {\n variant: {\n chevron: '',\n slash: '',\n },\n },\n defaultVariants: { variant: 'chevron' },\n },\n);\n\nexport interface BreadcrumbSeparatorProps\n extends\n Omit<ComponentPropsWithoutRef<'li'>, 'children'>,\n VariantProps<typeof separatorVariants> {\n children?: ReactNode;\n}\n\nconst BreadcrumbSeparator = forwardRef<HTMLLIElement, BreadcrumbSeparatorProps>(\n ({ className, variant, children, ...rest }, ref) => {\n const ctx = useContext(BreadcrumbContext);\n const resolved = variant ?? ctx.separator;\n const defaultGlyph =\n resolved === 'slash' ? (\n <span aria-hidden=\"true\">/</span>\n ) : (\n <ChevronRight\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:rtl:-scale-x-100\"\n />\n );\n return (\n <li\n ref={ref}\n aria-hidden=\"true\"\n role=\"presentation\"\n className={separatorVariants({ variant: resolved, className })}\n {...rest}\n >\n {children ?? defaultGlyph}\n </li>\n );\n },\n);\nBreadcrumbSeparator.displayName = 'BreadcrumbSeparator';\n\n/* -------------------------------------------------------------------- */\n/* Ellipsis — opens a Radix DropdownMenu with hidden crumbs */\n/* -------------------------------------------------------------------- */\n\nconst ellipsisTriggerClasses = [\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-[var(--muted-foreground)]',\n 'ds:hover:text-[var(--foreground)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n].join(' ');\n\nconst ellipsisContentClasses = [\n 'ds:z-[var(--z-dropdown)] ds:min-w-[12rem] ds:overflow-hidden',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-[var(--border)]',\n 'ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:p-[var(--spacing-xs)]',\n 'ds:animate-in ds:fade-in ds:zoom-in-95 ds:motion-reduce:animate-none',\n].join(' ');\n\nconst ellipsisItemClasses = [\n 'ds:flex ds:items-center',\n 'ds:min-h-[var(--min-target-size)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-[var(--foreground)] ds:cursor-pointer ds:select-none',\n 'ds:data-[highlighted]:bg-[var(--muted)] ds:data-[highlighted]:text-[var(--foreground)]',\n 'ds:outline-none',\n].join(' ');\n\nexport interface BreadcrumbEllipsisProps extends ComponentPropsWithoutRef<'button'> {\n /** Hidden crumb elements rendered inside the dropdown menu. */\n hiddenItems?: ReactElement[];\n}\n\nconst BreadcrumbEllipsis = forwardRef<\n HTMLButtonElement,\n BreadcrumbEllipsisProps\n>(({ className, hiddenItems = [], ...rest }, ref) => {\n const { t } = useTranslation();\n const showPath = t('navigation.breadcrumb.showPath');\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <button\n ref={ref}\n type=\"button\"\n aria-label={showPath}\n className={[ellipsisTriggerClasses, className]\n .filter(Boolean)\n .join(' ')}\n {...rest}\n >\n <Ellipsis aria-hidden=\"true\" className=\"ds:size-4\" />\n <span className=\"ds:sr-only\">{showPath}</span>\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n className={ellipsisContentClasses}\n align=\"start\"\n sideOffset={6}\n >\n {hiddenItems.map((item, i) => {\n // Extract the anchor inside the hidden BreadcrumbItem (if any)\n const linkChild = extractLink(item);\n return (\n <DropdownMenu.Item\n key={`hidden-${i}`}\n asChild\n className={ellipsisItemClasses}\n >\n {linkChild ?? <span>{item}</span>}\n </DropdownMenu.Item>\n );\n })}\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n );\n});\nBreadcrumbEllipsis.displayName = 'BreadcrumbEllipsis';\n\n/**\n * Walks a `BreadcrumbItem` to find the first child whose type is\n * `BreadcrumbLink` and returns the link rendered as a plain `<a>` so the\n * dropdown item can adopt its navigational behaviour.\n */\nfunction extractLink(item: ReactElement): ReactElement | null {\n let found: ReactElement | null = null;\n const itemChildren = (item.props as { children?: ReactNode }).children;\n Children.forEach(itemChildren, (child) => {\n if (found) return;\n if (!isValidElement(child)) return;\n if (child.type === BreadcrumbLink) {\n const linkProps = child.props as BreadcrumbLinkProps & {\n children?: ReactNode;\n };\n const href =\n typeof linkProps.href === 'string' ? linkProps.href : undefined;\n const safeHref = href && /^\\s*javascript:/i.test(href) ? undefined : href;\n found = (\n <a\n href={safeHref}\n onClick={\n linkProps.onClick as AnchorHTMLAttributes<HTMLAnchorElement>['onClick']\n }\n >\n {linkProps.children}\n </a>\n );\n }\n });\n return found;\n}\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n};\n"],"names":["breadcrumbAgent","handle","args","BreadcrumbContext","createContext","Breadcrumb","forwardRef","children","className","ariaLabel","separator","maxItems","itemsBeforeCollapse","itemsAfterCollapse","disableCollapse","id","rest","ref","t","useTranslation","items","useMemo","extractAgentItems","targetId","hit","i","trimmed","innerRef","useRef","useImperativeHandle","useAgentRegistration","jsx","BreadcrumbList","out","index","Children","child","isValidElement","BreadcrumbItem","itemProps","href","grandchild","BreadcrumbLink","linkProps","listClasses","arr","total","shouldCollapse","renderItem","isLast","key","cloneElement","renderSeparatorIf","condition","BreadcrumbSeparator","nodes","before","after","hidden","BreadcrumbEllipsis","itemClasses","isCurrent","derived","_a","linkClasses","currentClasses","asChild","Slot","separatorVariants","cva","variant","ctx","useContext","resolved","defaultGlyph","ChevronRight","ellipsisTriggerClasses","ellipsisContentClasses","ellipsisItemClasses","hiddenItems","showPath","jsxs","DropdownMenu","Ellipsis","item","linkChild","extractLink","found","itemChildren","safeHref"],"mappings":";;;;;;;;;AAkBO,MAAMA,IAAkD;AAAA,EAC7D,IAAI;AAAA,EACJ,cAAc,CAAC,UAAU;AAAA,EACzB,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,EACpC;AAAA,EAEF,SAAS;AAAA,IACP,aAAa;AAAA,MACX,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,IAAI;AAAA,YACF,MAAM;AAAA,YACN,aAAa;AAAA,UAAA;AAAA,QACf;AAAA,QAEF,UAAU,CAAC,IAAI;AAAA,MAAA;AAAA,MAEjB,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,UAAU;AAAA,QACR,EAAE,MAAM,EAAE,IAAI,YAAA,GAAe,MAAM,kCAAA;AAAA,MAAkC;AAAA,MAEvE,QAAQ,CAACA,GAAQC,MAAyB;AACxC,QAAAD,EAAO,WAAWC,EAAK,EAAE;AAAA,MAC3B;AAAA,IAAA;AAAA,EACF;AAAA,EAEF,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,IAEf,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,aACE;AAAA,IAAA;AAAA,EACJ;AAEJ,GCxCMC,IAAoBC,EAAsC;AAAA,EAC9D,WAAW;AACb,CAAC,GAyCKC,IAAaC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;AAC9D,SAAAjD,EAAS,QAAQqD,GAAc,CAACpD,MAAU;AACxC,QAAI,CAAAmD,KACClD,EAAeD,CAAK,KACrBA,EAAM,SAASM,GAAgB;AACjC,YAAMC,IAAYP,EAAM,OAGlBI,IACJ,OAAOG,EAAU,QAAS,WAAWA,EAAU,OAAO,QAClD8C,IAAWjD,KAAQ,mBAAmB,KAAKA,CAAI,IAAI,SAAYA;AACrE,MAAA+C,IACE,gBAAAxD;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAM0D;AAAA,UACN,SACE9C,EAAU;AAAA,UAGX,UAAAA,EAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IAGjB;AAAA,EACF,CAAC,GACM4C;AACT;"}
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-event-card-C6qGtywL.js","sources":["../../node_modules/lucide-react/dist/esm/icons/ban.mjs","../../node_modules/lucide-react/dist/esm/icons/euro.mjs","../../node_modules/lucide-react/dist/esm/icons/thumbs-up.mjs","../../node_modules/lucide-react/dist/esm/icons/zap.mjs","../../src/components/_shared/contrast-warning.ts","../../src/components/calendar-event-card/calendar-event-card.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 [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M4.929 4.929 19.07 19.071\", key: \"196cmz\" }]\n];\nconst Ban = createLucideIcon(\"ban\", __iconNode);\n\nexport { __iconNode, Ban as default };\n//# sourceMappingURL=ban.mjs.map\n","/**\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: \"M4 10h12\", key: \"1y6xl8\" }],\n [\"path\", { d: \"M4 14h9\", key: \"1loblj\" }],\n [\n \"path\",\n {\n d: \"M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2\",\n key: \"1j6lzo\"\n }\n ]\n];\nconst Euro = createLucideIcon(\"euro\", __iconNode);\n\nexport { __iconNode, Euro as default };\n//# sourceMappingURL=euro.mjs.map\n","/**\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 [\n \"path\",\n {\n d: \"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z\",\n key: \"emmmcr\"\n }\n ],\n [\"path\", { d: \"M7 10v12\", key: \"1qc93n\" }]\n];\nconst ThumbsUp = createLucideIcon(\"thumbs-up\", __iconNode);\n\nexport { __iconNode, ThumbsUp as default };\n//# sourceMappingURL=thumbs-up.mjs.map\n","/**\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 [\n \"path\",\n {\n d: \"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\",\n key: \"1xq2db\"\n }\n ]\n];\nconst Zap = createLucideIcon(\"zap\", __iconNode);\n\nexport { __iconNode, Zap as default };\n//# sourceMappingURL=zap.mjs.map\n","/* ------------------------------------------------------------------ */\n/* Shared contrast guardrail — Calendar + CalendarEventCard */\n/* */\n/* The consuming app supplies runtime hex pairs at several surfaces: */\n/* - event.backgroundColor / event.textColor (+ event.borderColor) */\n/* - modeBannerColor / modeBannerTextColor */\n/* - resource.color / resource.shortTitleTextColor */\n/* */\n/* When the text half of the pair is also a hex (i.e. both halves come */\n/* from the caller), we can validate them synchronously and warn the */\n/* consuming-app developer during DEV if the pair fails WCAG AA normal */\n/* text (4.5:1). When only the background half is supplied, */\n/* `resolveInk` derives a provably AA-safe black/white ink for it. */\n/* Every helper is a no-op in production builds. */\n/* ------------------------------------------------------------------ */\n\n/* Module-level dedup set — keyed on the (bg, fg, context) tuple so the\n same bad pair moving around the calendar only warns once per session.\n Exposed via `resetContrastWarnings()` for test isolation. */\nconst warnedTuples = new Set<string>();\n\n/** Reset the dedup set — intended for use between tests. */\nexport function resetContrastWarnings(): void {\n warnedTuples.clear();\n}\n\n/**\n * Parse a 3-char or 6-char `#RRGGBB` hex string into a linear sRGB\n * triple in the [0,1] range. Returns `null` for any input the caller\n * can't parse (malformed prefix, bad length, non-hex characters) —\n * the helper stays silent in that case rather than emitting noise.\n */\nfunction parseHex(hex: string): [number, number, number] | null {\n if (typeof hex !== 'string') return null;\n const trimmed = hex.trim();\n if (!trimmed.startsWith('#')) return null;\n const body = trimmed.slice(1);\n let r: number;\n let g: number;\n let b: number;\n if (body.length === 3) {\n if (!/^[0-9a-f]{3}$/i.test(body)) return null;\n r = parseInt(body[0] + body[0], 16);\n g = parseInt(body[1] + body[1], 16);\n b = parseInt(body[2] + body[2], 16);\n } else if (body.length === 6) {\n if (!/^[0-9a-f]{6}$/i.test(body)) return null;\n r = parseInt(body.slice(0, 2), 16);\n g = parseInt(body.slice(2, 4), 16);\n b = parseInt(body.slice(4, 6), 16);\n } else {\n return null;\n }\n return [r / 255, g / 255, b / 255];\n}\n\n/**\n * WCAG 2.1 relative luminance. Each channel is gamma-corrected then\n * weighted against the CIE photopic sensitivity of the human eye.\n * https://www.w3.org/TR/WCAG21/#dfn-relative-luminance\n */\nfunction relativeLuminance([r, g, b]: [number, number, number]): number {\n const lin = (c: number): number =>\n c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n return 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b);\n}\n\n/**\n * WCAG 2.1 contrast ratio. Always returns a value in [1, 21]; the\n * relative-luminance lighter-over-darker convention is applied here.\n */\nfunction contrastRatio(\n bg: [number, number, number],\n fg: [number, number, number],\n): number {\n const l1 = relativeLuminance(bg);\n const l2 = relativeLuminance(fg);\n const lighter = Math.max(l1, l2);\n const darker = Math.min(l1, l2);\n return (lighter + 0.05) / (darker + 0.05);\n}\n\n/**\n * DEV-only WCAG AA guardrail for caller-supplied hex pairs.\n *\n * - No-op when `import.meta.env.DEV` is false.\n * - No-op when either half of the pair is missing (the \"fg missing →\n * inherits DS token\" case is a docs concern; the DS token isn't a\n * hex at runtime so we can't check it here).\n * - No-op when either hex can't be parsed (silent — not the helper's\n * concern to police malformed input).\n * - Deduplicated by `(bgHex, fgHex, contextLabel)` tuple so moving a\n * ratio-bad event around the calendar doesn't spam the console.\n *\n * @param bgHex - Caller-supplied background hex (e.g. `'#c2185b'`)\n * @param fgHex - Caller-supplied foreground hex (e.g. `'#ffffff'`)\n * @param contextLabel - Short description for the warning (e.g. `'event e1'`).\n */\nexport function warnLowContrast(\n bgHex: string | undefined,\n fgHex: string | undefined,\n contextLabel: string,\n): void {\n if (!import.meta.env.DEV) return;\n if (!bgHex || !fgHex) return;\n\n const bg = parseHex(bgHex);\n const fg = parseHex(fgHex);\n if (!bg || !fg) return;\n\n const ratio = contrastRatio(bg, fg);\n if (ratio >= 4.5) return;\n\n const key = `${bgHex}|${fgHex}|${contextLabel}`;\n if (warnedTuples.has(key)) return;\n warnedTuples.add(key);\n\n /* `bg` parsed successfully above, so `resolveInk(bgHex)` is guaranteed\n to produce a compliant ink — the omit-textColor hint is always valid\n at this point. */\n console.warn(\n `[Calendar] Low contrast on ${contextLabel}: ${bgHex} / ${fgHex} (ratio ${ratio.toFixed(\n 2,\n )}, target 4.5). Pass a matching textColor/fgHex, pick a higher-contrast background, or omit textColor to let the kit choose a compliant ink.`,\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Ink derivation — bg-only caller colours */\n/* ------------------------------------------------------------------ */\n\nexport type EventInk = 'on-light' | 'on-dark';\n\n/**\n * Pick the ink for an arbitrary opaque bg hex. Returns `null` when the\n * input can't be parsed (`#rgb` / `#rrggbb` only).\n *\n * The threshold 0.1791 is the relative luminance at which\n * `contrast(bg, #fff) === contrast(bg, #000)`; the better of the two\n * always yields ≥ 4.58:1 (the minimum, at a mid-grey ≈ `#757575`) —\n * provably WCAG AA-safe for any opaque background.\n */\nexport function resolveInk(bgHex: string): EventInk | null {\n const bg = parseHex(bgHex);\n if (!bg) return null;\n // threshold where contrast(bg, #fff) === contrast(bg, #000)\n return relativeLuminance(bg) > 0.1791 ? 'on-light' : 'on-dark';\n}\n\n/**\n * DEV-only, one-shot warning for a caller `backgroundColor` the kit can't\n * parse (`rgb(…)`, keywords, malformed hex). The browser can still paint\n * it, but the text falls back to the token default and contrast can't be\n * verified. Deduplicated by `(bgHex, contextLabel)`.\n */\nexport function warnUnparseableBackground(\n bgHex: string,\n contextLabel: string,\n): void {\n if (!import.meta.env.DEV) return;\n if (parseHex(bgHex)) return;\n\n const key = `unparseable|${bgHex}|${contextLabel}`;\n if (warnedTuples.has(key)) return;\n warnedTuples.add(key);\n\n console.warn(\n `[Calendar] Unparseable backgroundColor on ${contextLabel}: \"${bgHex}\". ` +\n `Expected #rgb or #rrggbb — contrast cannot be verified and the text ` +\n `colour falls back to the token default.`,\n );\n}\n\n/**\n * DEV-only, one-shot warning for a near-white `backgroundColor`\n * (relative luminance > 0.9) supplied without a `borderColor` — the\n * event may be invisible against the calendar grid. The kit warns, it\n * does not repaint (delineation is decorative under WCAG 1.4.11 and the\n * consumer owns the picker colour). Deduplicated by `(bgHex, contextLabel)`.\n */\nexport function warnLowDelineation(bgHex: string, contextLabel: string): void {\n if (!import.meta.env.DEV) return;\n\n const bg = parseHex(bgHex);\n if (!bg) return;\n if (relativeLuminance(bg) <= 0.9) return;\n\n const key = `delineation|${bgHex}|${contextLabel}`;\n if (warnedTuples.has(key)) return;\n warnedTuples.add(key);\n\n console.warn(\n `[Calendar] Light backgroundColor without borderColor on ${contextLabel}: ` +\n `${bgHex} may be invisible against the grid — pass a borderColor ` +\n `(the platform convention sends a light-grey border for white backgrounds).`,\n );\n}\n","/* ------------------------------------------------------------------ */\n/* CalendarEventCard — the single painted surface of a calendar event. */\n/* */\n/* Colour model (platform parity): the caller's picker hex */\n/* (backgroundColor / textColor / borderColor) is the ONLY thing that */\n/* paints the card. `status` never paints the surface — it selects an */\n/* icon, an optional decorative accent bar, and (for `cancelled`) a */\n/* line-through. When no picker colour is supplied the surface falls */\n/* back to the theme's --primary / --primary-foreground pair. */\n/* */\n/* Non-interactive by design: inside FullCalendar the outer harness */\n/* anchor owns click/drag/focus; standalone consumers wrap the card in */\n/* their own button/link. No onClick in the contract. */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef } from 'react';\nimport type { CSSProperties, HTMLAttributes } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\nimport {\n ThumbsUp,\n Clock,\n Stethoscope,\n Check,\n Ban,\n Zap,\n Globe,\n AlertTriangle,\n HeartPulse,\n Euro,\n Video,\n type LucideIcon,\n} from 'lucide-react';\n// Type-only import — erased at build, no runtime cycle with calendar.tsx's\n// runtime import of this card. Do NOT convert to a value import.\nimport type { CalendarEventStatus } from '../calendar/calendar';\nimport {\n warnLowContrast,\n resolveInk,\n warnUnparseableBackground,\n warnLowDelineation,\n} from '../_shared/contrast-warning';\n\n/* ------------------------------------------------------------------ */\n/* Status lookups */\n/* ------------------------------------------------------------------ */\n\nconst STATUS_ICON: Record<CalendarEventStatus, LucideIcon> = {\n confirmed: ThumbsUp,\n waiting: Clock,\n in_care: Stethoscope,\n done: Check,\n cancelled: Ban,\n absent: Zap,\n};\n\n/* Status → i18n key lookup. Kept as a literal object (not a template)\n so static-analysis extractors can find every key. Keys already exist\n in all 18 locale bundles — do not add new ones here. */\nconst STATUS_LABEL_KEYS: Record<CalendarEventStatus, string> = {\n confirmed: 'calendar.status.confirmed',\n waiting: 'calendar.status.waiting',\n in_care: 'calendar.status.inCare',\n done: 'calendar.status.done',\n cancelled: 'calendar.status.cancelled',\n absent: 'calendar.status.absent',\n};\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst calendarEventCardVariants = cva(\n [\n // layout — verbatim from the Calendar's former eventCardVariants base,\n // plus ds:relative for the accent bar's positioning context\n 'ds:relative ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]',\n 'ds:w-full ds:h-full',\n 'ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-[length:var(--font-size-sm)]',\n 'ds:font-[var(--font-weight-medium)]',\n 'ds:overflow-hidden',\n // kept verbatim from the former base (inert on a non-focusable div\n // inside FC; harmless)\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-[var(--ring)]',\n 'ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n // SINGLE PAINTED SURFACE — always present, never conditional. One\n // declaration per paint channel; value chain = \"caller custom prop,\n // else token\". This structurally eliminates the CVA-vs-override\n // specificity race (the old double-paint bug) — stylesheet order\n // becomes irrelevant.\n 'ds:[background-color:var(--calendar-event-bg,var(--primary))]',\n 'ds:[color:var(--calendar-event-text,var(--primary-foreground))]',\n 'ds:border ds:[border-color:var(--calendar-event-border,transparent)]',\n ].join(' '),\n {\n variants: {\n // Do not add colour classes to this axis — status is icon + accent\n // + aria only; a unit test asserts identical computed background\n // across all six statuses.\n status: {\n none: '',\n confirmed: '',\n waiting: '',\n in_care: '',\n done: '',\n cancelled: 'ds:line-through',\n absent: '',\n },\n bookedOnline: {\n // class name kept as a stable inert DOM hook; the stripe paint\n // lives here (moved from fullcalendar-theme.css) so it works in\n // the card's own stories, outside .fc-theme-alfadocs.\n // currentcolor = resolved ink, so stripes stay visible over any\n // picker colour.\n true: 'event-booked-online ds:bg-[image:repeating-linear-gradient(45deg,transparent,transparent_4px,color-mix(in_srgb,currentcolor_10%,transparent)_4px,color-mix(in_srgb,currentcolor_10%,transparent)_8px)]',\n false: '',\n },\n },\n defaultVariants: { status: 'none', bookedOnline: false },\n },\n);\n\n/* Status accent — a SEPARATE absolutely-positioned decorative element,\n not a border, so it can never collide with the caller's borderColor on\n the inline-start edge. The 3px width literal is the same\n decorative-geometry category as the former done-variant border-s-[3px]. */\nconst statusAccentVariants = cva(\n 'ds:absolute ds:inset-y-0 ds:start-0 ds:w-[3px]',\n {\n variants: {\n status: {\n confirmed: 'ds:[background-color:var(--success)]',\n waiting: 'ds:[background-color:var(--info)]',\n in_care: 'ds:[background-color:var(--primary)]',\n done: 'ds:[background-color:var(--success)]',\n cancelled: 'ds:[background-color:var(--destructive)]',\n absent: 'ds:[background-color:var(--warning)]',\n },\n },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\n/**\n * The single painted surface of a calendar event.\n *\n * Colour model (platform parity): the caller's picker hex\n * (`backgroundColor` / `textColor` / `borderColor`) is the ONLY thing that\n * paints the card. `status` never paints the surface — it selects an icon,\n * an optional decorative accent bar, and (for `cancelled`) a line-through.\n *\n * Non-interactive by design: inside FullCalendar the outer harness anchor\n * owns click/drag/focus; standalone consumers wrap the card in their own\n * button/link. No onClick in the contract.\n */\nexport interface CalendarEventCardProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title'\n> {\n /**\n * Primary line. Pass the ALREADY-MASKED title when privacy applies — the\n * card never receives a name it must not render, so it cannot leak it\n * (visually or via the composed aria-label).\n */\n title: string;\n /**\n * Secondary description line, normal weight, truncated. Note: the\n * Calendar's privacy mode does NOT mask the suffix (current behaviour,\n * preserved deliberately).\n */\n suffix?: string;\n /**\n * Pre-formatted, localised time range (e.g. \"09:00 – 09:45\"). The\n * Calendar adapter computes it via Intl.DateTimeFormat.formatRange.\n * Included in the composed aria-label whenever present (even when the\n * visual time line is suppressed via showTime/allDay — matches today's\n * Calendar behaviour byte-for-byte).\n */\n rangeText?: string;\n /**\n * Gates the VISUAL time line only (aria keeps rangeText). Mirrors\n * CalendarProps.showTime. @default true\n */\n showTime?: boolean;\n /**\n * All-day events suppress the visual time line (aria keeps rangeText).\n * @default false\n */\n allDay?: boolean;\n\n /**\n * Lifecycle state (6-state, matches the platform DoctorAppointment\n * lifecycle) → status icon + optional accent bar + line-through for\n * `cancelled` + localised label in the aria-label. NEVER paints the\n * card surface.\n */\n status?: CalendarEventStatus;\n /**\n * Render the 3px inline-start accent bar in the status's semantic token\n * colour. Purely decorative (aria-hidden) — the icon and aria-label carry\n * status regardless. The platform (colour = picker, status = icons only)\n * passes false via CalendarProps.eventStatusAccent. @default true\n */\n statusAccent?: boolean;\n\n /**\n * Runtime hex (#rgb or #rrggbb) from the consumer's colour picker — THE\n * painted surface. Injected as `--calendar-event-bg` via the sanctioned\n * inline custom-property pattern (23-constraints §inline-style exception).\n */\n backgroundColor?: string;\n /**\n * Runtime hex paired with backgroundColor. When omitted while\n * backgroundColor is set, the card auto-derives black/white ink by\n * luminance (provably WCAG AA ≥ 4.58:1 for any opaque colour).\n */\n textColor?: string;\n /**\n * Runtime hex border for delineating light surfaces. The platform sends\n * '#cccccc' when backgroundColor is '#ffffff' and omits it otherwise.\n * Falls back to transparent; border-width is constant (1px always\n * rendered), so toggling never shifts layout and event boundaries\n * survive forced-colors / Windows High Contrast for free.\n */\n borderColor?: string;\n\n /* Indicator icons — names identical to CalendarEvent fields (1:1 map). */\n /** Globe icon + diagonal stripe overlay. */\n isBookedOnline?: boolean;\n /** AlertTriangle icon. */\n hasUnassignedPatient?: boolean;\n /** HeartPulse icon. */\n hasHighlightedAnamnesis?: boolean;\n /** Euro icon. */\n hasBillableAmount?: boolean;\n /** Video icon. */\n isTelehealth?: boolean;\n\n /**\n * Resource title (chair/operator) woven into the composed aria-label\n * only — never rendered visually. The Calendar adapter resolves\n * resourceId → title before passing it.\n */\n resourceLabel?: string;\n /**\n * Stable event id → emitted as `data-event-id` (Calendar.focusEvent\n * targets it) and used as the contrast-warning dedup context.\n */\n eventId?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport const CalendarEventCard = forwardRef<\n HTMLDivElement,\n CalendarEventCardProps\n>(\n (\n {\n title,\n suffix,\n rangeText,\n showTime = true,\n allDay = false,\n status,\n statusAccent = true,\n backgroundColor,\n textColor,\n borderColor,\n isBookedOnline = false,\n hasUnassignedPatient,\n hasHighlightedAnamnesis,\n hasBillableAmount,\n isTelehealth,\n resourceLabel,\n eventId,\n className,\n style,\n 'aria-label': ariaLabelProp,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const StatusIcon = status ? STATUS_ICON[status] : null;\n const statusLabel = status ? t(STATUS_LABEL_KEYS[status]) : undefined;\n\n /* Accessible name — exactly the Calendar's historical composition.\n An explicit consumer-supplied aria-label wins. rangeText is always\n included when present, even when the visual time line is hidden. */\n const ariaLabel =\n ariaLabelProp ??\n [title, rangeText, resourceLabel, statusLabel].filter(Boolean).join(', ');\n\n /* Ink derivation — only when the caller paints the surface without\n pairing a text colour. */\n const ink =\n !textColor && backgroundColor ? resolveInk(backgroundColor) : null;\n\n /* DEV-only guardrails — every helper no-ops in production and dedupes\n per session, so calling during render is safe. */\n const warnContext = eventId ? `event ${eventId}` : 'calendar-event-card';\n warnLowContrast(backgroundColor, textColor, warnContext);\n if (backgroundColor && !textColor) {\n // no-ops when the hex is parseable (i.e. when resolveInk succeeded)\n warnUnparseableBackground(backgroundColor, warnContext);\n }\n if (backgroundColor && !borderColor) {\n // no-ops unless the background is near-white (luminance > 0.9)\n warnLowDelineation(backgroundColor, warnContext);\n }\n\n /* Per-event colour override: the consuming app passes runtime hex from\n its colour picker. 23-constraints permits inline `style` only as a\n CSS custom-property setter for runtime values that can't be\n enumerated at build time — the consuming background-color / color /\n border-color declarations live in the CVA base as Tailwind arbitrary\n values with token fallbacks. */\n const colourOverrides: CSSProperties | undefined =\n backgroundColor || textColor || borderColor\n ? ({\n ...(backgroundColor\n ? { '--calendar-event-bg': backgroundColor }\n : {}),\n ...(textColor\n ? { '--calendar-event-text': textColor }\n : ink === 'on-light'\n ? { '--calendar-event-text': 'var(--event-ink-on-light)' }\n : ink === 'on-dark'\n ? { '--calendar-event-text': 'var(--event-ink-on-dark)' }\n : {}),\n ...(borderColor ? { '--calendar-event-border': borderColor } : {}),\n } as CSSProperties)\n : undefined;\n\n const mergedStyle: CSSProperties | undefined =\n style || colourOverrides ? { ...style, ...colourOverrides } : undefined;\n\n return (\n <div\n ref={ref}\n {...rest}\n className={calendarEventCardVariants({\n status: status ?? 'none',\n bookedOnline: isBookedOnline,\n className,\n })}\n // eslint-disable-next-line react/forbid-dom-props -- caller-supplied event bg/text/border hex injected via CSS variables (23-constraints §inline-style exception)\n style={mergedStyle}\n aria-label={ariaLabel}\n data-component=\"calendar-event-card\"\n data-event-id={eventId}\n data-status={status ?? 'none'}\n data-contrast={textColor ? 'custom' : (ink ?? 'default')}\n >\n {status && statusAccent ? (\n <span\n aria-hidden=\"true\"\n data-slot=\"status-accent\"\n className={statusAccentVariants({ status })}\n />\n ) : null}\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:self-end\">\n {/* All icons render in currentcolor — they inherit the resolved\n ink, so the ≥ 4.5:1 text guarantee makes every icon exceed the\n 3:1 graphics minimum (WCAG 1.4.11) on any picker surface.\n Never tint icons with status colours. */}\n {StatusIcon ? <StatusIcon size={14} aria-hidden=\"true\" /> : null}\n {isBookedOnline ? <Globe size={12} aria-hidden=\"true\" /> : null}\n {hasUnassignedPatient ? (\n <AlertTriangle size={12} aria-hidden=\"true\" />\n ) : null}\n {hasHighlightedAnamnesis ? (\n <HeartPulse size={12} aria-hidden=\"true\" />\n ) : null}\n {hasBillableAmount ? <Euro size={12} aria-hidden=\"true\" /> : null}\n {isTelehealth ? <Video size={12} aria-hidden=\"true\" /> : null}\n </div>\n {showTime && !allDay && rangeText ? (\n // No opacity here — composing 70% over saturated bgs drops\n // effective contrast below WCAG AA. The smaller font-size-xs vs\n // the title's font-weight-semibold provides sufficient visual\n // hierarchy.\n <span className=\"ds:text-[length:var(--font-size-xs)]\">\n {rangeText}\n </span>\n ) : null}\n <span className=\"ds:font-[var(--font-weight-semibold)] ds:truncate ds:text-start\">\n {title}\n </span>\n {suffix ? (\n <span className=\"ds:truncate ds:text-start ds:text-[length:var(--font-size-xs)]\">\n {suffix}\n </span>\n ) : null}\n </div>\n );\n },\n);\nCalendarEventCard.displayName = 'CalendarEventCard';\n"],"names":["__iconNode","Ban","createLucideIcon","Euro","ThumbsUp","Zap","parseHex","hex","trimmed","body","r","g","b","relativeLuminance","lin","c","warnLowContrast","bgHex","fgHex","contextLabel","resolveInk","bg","STATUS_ICON","Clock","Stethoscope","Check","STATUS_LABEL_KEYS","calendarEventCardVariants","cva","statusAccentVariants","CalendarEventCard","forwardRef","title","suffix","rangeText","showTime","allDay","status","statusAccent","backgroundColor","textColor","borderColor","isBookedOnline","hasUnassignedPatient","hasHighlightedAnamnesis","hasBillableAmount","isTelehealth","resourceLabel","eventId","className","style","ariaLabelProp","rest","ref","t","useTranslation","StatusIcon","statusLabel","ariaLabel","ink","colourOverrides","mergedStyle","jsxs","jsx","Globe","AlertTriangle","HeartPulse","Video"],"mappings":";;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,MAAM,KAAK,UAAU;AAAA,EACzD,CAAC,QAAQ,EAAE,GAAG,6BAA6B,KAAK,SAAQ,CAAE;AAC5D,GACMC,IAAMC,EA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BAAAqB,EAACC,GAAA,EAAM,MAAM,IAAI,eAAY,QAAO,IAAK;AAAA,YAC1DrB,IACC,gBAAAoB,EAACE,GAAA,EAAc,MAAM,IAAI,eAAY,QAAO,IAC1C;AAAA,YACHrB,IACC,gBAAAmB,EAACG,GAAA,EAAW,MAAM,IAAI,eAAY,QAAO,IACvC;AAAA,YACHrB,IAAoB,gBAAAkB,EAAC5D,GAAA,EAAK,MAAM,IAAI,eAAY,QAAO,IAAK;AAAA,YAC5D2C,IAAe,gBAAAiB,EAACI,GAAA,EAAM,MAAM,IAAI,eAAY,QAAO,IAAK;AAAA,UAAA,GAC3D;AAAA,UACChC,KAAY,CAACC,KAAUF;AAAA;AAAA;AAAA;AAAA;AAAA,YAKtB,gBAAA6B,EAAC,QAAA,EAAK,WAAU,wCACb,UAAA7B,EAAA,CACH;AAAA,cACE;AAAA,UACJ,gBAAA6B,EAAC,QAAA,EAAK,WAAU,mEACb,UAAA/B,GACH;AAAA,UACCC,IACC,gBAAA8B,EAAC,QAAA,EAAK,WAAU,kEACb,aACH,IACE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACAjC,GAAkB,cAAc;","x_google_ignoreList":[0,1,2,3]}
1
+ {"version":3,"file":"calendar-event-card-C6qGtywL.js","sources":["../../node_modules/lucide-react/dist/esm/icons/ban.mjs","../../node_modules/lucide-react/dist/esm/icons/euro.mjs","../../node_modules/lucide-react/dist/esm/icons/thumbs-up.mjs","../../node_modules/lucide-react/dist/esm/icons/zap.mjs","../../src/components/_shared/contrast-warning.ts","../../src/components/calendar-event-card/calendar-event-card.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 [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M4.929 4.929 19.07 19.071\", key: \"196cmz\" }]\n];\nconst Ban = createLucideIcon(\"ban\", __iconNode);\n\nexport { __iconNode, Ban as default };\n//# sourceMappingURL=ban.mjs.map\n","/**\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: \"M4 10h12\", key: \"1y6xl8\" }],\n [\"path\", { d: \"M4 14h9\", key: \"1loblj\" }],\n [\n \"path\",\n {\n d: \"M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2\",\n key: \"1j6lzo\"\n }\n ]\n];\nconst Euro = createLucideIcon(\"euro\", __iconNode);\n\nexport { __iconNode, Euro as default };\n//# sourceMappingURL=euro.mjs.map\n","/**\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 [\n \"path\",\n {\n d: \"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z\",\n key: \"emmmcr\"\n }\n ],\n [\"path\", { d: \"M7 10v12\", key: \"1qc93n\" }]\n];\nconst ThumbsUp = createLucideIcon(\"thumbs-up\", __iconNode);\n\nexport { __iconNode, ThumbsUp as default };\n//# sourceMappingURL=thumbs-up.mjs.map\n","/**\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 [\n \"path\",\n {\n d: \"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\",\n key: \"1xq2db\"\n }\n ]\n];\nconst Zap = createLucideIcon(\"zap\", __iconNode);\n\nexport { __iconNode, Zap as default };\n//# sourceMappingURL=zap.mjs.map\n","/* ------------------------------------------------------------------ */\n/* Shared contrast guardrail — Calendar + CalendarEventCard */\n/* */\n/* The consuming app supplies runtime hex pairs at several surfaces: */\n/* - event.backgroundColor / event.textColor (+ event.borderColor) */\n/* - modeBannerColor / modeBannerTextColor */\n/* - resource.color / resource.shortTitleTextColor */\n/* */\n/* When the text half of the pair is also a hex (i.e. both halves come */\n/* from the caller), we can validate them synchronously and warn the */\n/* consuming-app developer during DEV if the pair fails WCAG AA normal */\n/* text (4.5:1). When only the background half is supplied, */\n/* `resolveInk` derives a provably AA-safe black/white ink for it. */\n/* Every helper is a no-op in production builds. */\n/* ------------------------------------------------------------------ */\n\n/* Module-level dedup set — keyed on the (bg, fg, context) tuple so the\n same bad pair moving around the calendar only warns once per session.\n Exposed via `resetContrastWarnings()` for test isolation. */\nconst warnedTuples = new Set<string>();\n\n/** Reset the dedup set — intended for use between tests. */\nexport function resetContrastWarnings(): void {\n warnedTuples.clear();\n}\n\n/**\n * Parse a 3-char or 6-char `#RRGGBB` hex string into a linear sRGB\n * triple in the [0,1] range. Returns `null` for any input the caller\n * can't parse (malformed prefix, bad length, non-hex characters) —\n * the helper stays silent in that case rather than emitting noise.\n */\nfunction parseHex(hex: string): [number, number, number] | null {\n if (typeof hex !== 'string') return null;\n const trimmed = hex.trim();\n if (!trimmed.startsWith('#')) return null;\n const body = trimmed.slice(1);\n let r: number;\n let g: number;\n let b: number;\n if (body.length === 3) {\n if (!/^[0-9a-f]{3}$/i.test(body)) return null;\n r = parseInt(body[0] + body[0], 16);\n g = parseInt(body[1] + body[1], 16);\n b = parseInt(body[2] + body[2], 16);\n } else if (body.length === 6) {\n if (!/^[0-9a-f]{6}$/i.test(body)) return null;\n r = parseInt(body.slice(0, 2), 16);\n g = parseInt(body.slice(2, 4), 16);\n b = parseInt(body.slice(4, 6), 16);\n } else {\n return null;\n }\n return [r / 255, g / 255, b / 255];\n}\n\n/**\n * WCAG 2.1 relative luminance. Each channel is gamma-corrected then\n * weighted against the CIE photopic sensitivity of the human eye.\n * https://www.w3.org/TR/WCAG21/#dfn-relative-luminance\n */\nfunction relativeLuminance([r, g, b]: [number, number, number]): number {\n const lin = (c: number): number =>\n c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n return 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b);\n}\n\n/**\n * WCAG 2.1 contrast ratio. Always returns a value in [1, 21]; the\n * relative-luminance lighter-over-darker convention is applied here.\n */\nfunction contrastRatio(\n bg: [number, number, number],\n fg: [number, number, number],\n): number {\n const l1 = relativeLuminance(bg);\n const l2 = relativeLuminance(fg);\n const lighter = Math.max(l1, l2);\n const darker = Math.min(l1, l2);\n return (lighter + 0.05) / (darker + 0.05);\n}\n\n/**\n * DEV-only WCAG AA guardrail for caller-supplied hex pairs.\n *\n * - No-op when `import.meta.env.DEV` is false.\n * - No-op when either half of the pair is missing (the \"fg missing →\n * inherits DS token\" case is a docs concern; the DS token isn't a\n * hex at runtime so we can't check it here).\n * - No-op when either hex can't be parsed (silent — not the helper's\n * concern to police malformed input).\n * - Deduplicated by `(bgHex, fgHex, contextLabel)` tuple so moving a\n * ratio-bad event around the calendar doesn't spam the console.\n *\n * @param bgHex - Caller-supplied background hex (e.g. `'#c2185b'`)\n * @param fgHex - Caller-supplied foreground hex (e.g. `'#ffffff'`)\n * @param contextLabel - Short description for the warning (e.g. `'event e1'`).\n */\nexport function warnLowContrast(\n bgHex: string | undefined,\n fgHex: string | undefined,\n contextLabel: string,\n): void {\n if (!import.meta.env.DEV) return;\n if (!bgHex || !fgHex) return;\n\n const bg = parseHex(bgHex);\n const fg = parseHex(fgHex);\n if (!bg || !fg) return;\n\n const ratio = contrastRatio(bg, fg);\n if (ratio >= 4.5) return;\n\n const key = `${bgHex}|${fgHex}|${contextLabel}`;\n if (warnedTuples.has(key)) return;\n warnedTuples.add(key);\n\n /* `bg` parsed successfully above, so `resolveInk(bgHex)` is guaranteed\n to produce a compliant ink — the omit-textColor hint is always valid\n at this point. */\n console.warn(\n `[Calendar] Low contrast on ${contextLabel}: ${bgHex} / ${fgHex} (ratio ${ratio.toFixed(\n 2,\n )}, target 4.5). Pass a matching textColor/fgHex, pick a higher-contrast background, or omit textColor to let the kit choose a compliant ink.`,\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Ink derivation — bg-only caller colours */\n/* ------------------------------------------------------------------ */\n\nexport type EventInk = 'on-light' | 'on-dark';\n\n/**\n * Pick the ink for an arbitrary opaque bg hex. Returns `null` when the\n * input can't be parsed (`#rgb` / `#rrggbb` only).\n *\n * The threshold 0.1791 is the relative luminance at which\n * `contrast(bg, #fff) === contrast(bg, #000)`; the better of the two\n * always yields ≥ 4.58:1 (the minimum, at a mid-grey ≈ `#757575`) —\n * provably WCAG AA-safe for any opaque background.\n */\nexport function resolveInk(bgHex: string): EventInk | null {\n const bg = parseHex(bgHex);\n if (!bg) return null;\n // threshold where contrast(bg, #fff) === contrast(bg, #000)\n return relativeLuminance(bg) > 0.1791 ? 'on-light' : 'on-dark';\n}\n\n/**\n * DEV-only, one-shot warning for a caller `backgroundColor` the kit can't\n * parse (`rgb(…)`, keywords, malformed hex). The browser can still paint\n * it, but the text falls back to the token default and contrast can't be\n * verified. Deduplicated by `(bgHex, contextLabel)`.\n */\nexport function warnUnparseableBackground(\n bgHex: string,\n contextLabel: string,\n): void {\n if (!import.meta.env.DEV) return;\n if (parseHex(bgHex)) return;\n\n const key = `unparseable|${bgHex}|${contextLabel}`;\n if (warnedTuples.has(key)) return;\n warnedTuples.add(key);\n\n console.warn(\n `[Calendar] Unparseable backgroundColor on ${contextLabel}: \"${bgHex}\". ` +\n `Expected #rgb or #rrggbb — contrast cannot be verified and the text ` +\n `colour falls back to the token default.`,\n );\n}\n\n/**\n * DEV-only, one-shot warning for a near-white `backgroundColor`\n * (relative luminance > 0.9) supplied without a `borderColor` — the\n * event may be invisible against the calendar grid. The kit warns, it\n * does not repaint (delineation is decorative under WCAG 1.4.11 and the\n * consumer owns the picker colour). Deduplicated by `(bgHex, contextLabel)`.\n */\nexport function warnLowDelineation(bgHex: string, contextLabel: string): void {\n if (!import.meta.env.DEV) return;\n\n const bg = parseHex(bgHex);\n if (!bg) return;\n if (relativeLuminance(bg) <= 0.9) return;\n\n const key = `delineation|${bgHex}|${contextLabel}`;\n if (warnedTuples.has(key)) return;\n warnedTuples.add(key);\n\n console.warn(\n `[Calendar] Light backgroundColor without borderColor on ${contextLabel}: ` +\n `${bgHex} may be invisible against the grid — pass a borderColor ` +\n `(the platform convention sends a light-grey border for white backgrounds).`,\n );\n}\n","/* ------------------------------------------------------------------ */\n/* CalendarEventCard — the single painted surface of a calendar event. */\n/* */\n/* Colour model (platform parity): the caller's picker hex */\n/* (backgroundColor / textColor / borderColor) is the ONLY thing that */\n/* paints the card. `status` never paints the surface — it selects an */\n/* icon, an optional decorative accent bar, and (for `cancelled`) a */\n/* line-through. When no picker colour is supplied the surface falls */\n/* back to the theme's --primary / --primary-foreground pair. */\n/* */\n/* Non-interactive by design: inside FullCalendar the outer harness */\n/* anchor owns click/drag/focus; standalone consumers wrap the card in */\n/* their own button/link. No onClick in the contract. */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef } from 'react';\nimport type { CSSProperties, HTMLAttributes } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\nimport {\n ThumbsUp,\n Clock,\n Stethoscope,\n Check,\n Ban,\n Zap,\n Globe,\n TriangleAlert,\n HeartPulse,\n Euro,\n Video,\n type LucideIcon,\n} from 'lucide-react';\n// Type-only import — erased at build, no runtime cycle with calendar.tsx's\n// runtime import of this card. Do NOT convert to a value import.\nimport type { CalendarEventStatus } from '../calendar/calendar';\nimport {\n warnLowContrast,\n resolveInk,\n warnUnparseableBackground,\n warnLowDelineation,\n} from '../_shared/contrast-warning';\n\n/* ------------------------------------------------------------------ */\n/* Status lookups */\n/* ------------------------------------------------------------------ */\n\nconst STATUS_ICON: Record<CalendarEventStatus, LucideIcon> = {\n confirmed: ThumbsUp,\n waiting: Clock,\n in_care: Stethoscope,\n done: Check,\n cancelled: Ban,\n absent: Zap,\n};\n\n/* Status → i18n key lookup. Kept as a literal object (not a template)\n so static-analysis extractors can find every key. Keys already exist\n in all 18 locale bundles — do not add new ones here. */\nconst STATUS_LABEL_KEYS: Record<CalendarEventStatus, string> = {\n confirmed: 'calendar.status.confirmed',\n waiting: 'calendar.status.waiting',\n in_care: 'calendar.status.inCare',\n done: 'calendar.status.done',\n cancelled: 'calendar.status.cancelled',\n absent: 'calendar.status.absent',\n};\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst calendarEventCardVariants = cva(\n [\n // layout — verbatim from the Calendar's former eventCardVariants base,\n // plus ds:relative for the accent bar's positioning context\n 'ds:relative ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]',\n 'ds:w-full ds:h-full',\n 'ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-[length:var(--font-size-sm)]',\n 'ds:font-[var(--font-weight-medium)]',\n 'ds:overflow-hidden',\n // kept verbatim from the former base (inert on a non-focusable div\n // inside FC; harmless)\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-[var(--ring)]',\n 'ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n // SINGLE PAINTED SURFACE — always present, never conditional. One\n // declaration per paint channel; value chain = \"caller custom prop,\n // else token\". This structurally eliminates the CVA-vs-override\n // specificity race (the old double-paint bug) — stylesheet order\n // becomes irrelevant.\n 'ds:[background-color:var(--calendar-event-bg,var(--primary))]',\n 'ds:[color:var(--calendar-event-text,var(--primary-foreground))]',\n 'ds:border ds:[border-color:var(--calendar-event-border,transparent)]',\n ].join(' '),\n {\n variants: {\n // Do not add colour classes to this axis — status is icon + accent\n // + aria only; a unit test asserts identical computed background\n // across all six statuses.\n status: {\n none: '',\n confirmed: '',\n waiting: '',\n in_care: '',\n done: '',\n cancelled: 'ds:line-through',\n absent: '',\n },\n bookedOnline: {\n // class name kept as a stable inert DOM hook; the stripe paint\n // lives here (moved from fullcalendar-theme.css) so it works in\n // the card's own stories, outside .fc-theme-alfadocs.\n // currentcolor = resolved ink, so stripes stay visible over any\n // picker colour.\n true: 'event-booked-online ds:bg-[image:repeating-linear-gradient(45deg,transparent,transparent_4px,color-mix(in_srgb,currentcolor_10%,transparent)_4px,color-mix(in_srgb,currentcolor_10%,transparent)_8px)]',\n false: '',\n },\n },\n defaultVariants: { status: 'none', bookedOnline: false },\n },\n);\n\n/* Status accent — a SEPARATE absolutely-positioned decorative element,\n not a border, so it can never collide with the caller's borderColor on\n the inline-start edge. The 3px width literal is the same\n decorative-geometry category as the former done-variant border-s-[3px]. */\nconst statusAccentVariants = cva(\n 'ds:absolute ds:inset-y-0 ds:start-0 ds:w-[3px]',\n {\n variants: {\n status: {\n confirmed: 'ds:[background-color:var(--success)]',\n waiting: 'ds:[background-color:var(--info)]',\n in_care: 'ds:[background-color:var(--primary)]',\n done: 'ds:[background-color:var(--success)]',\n cancelled: 'ds:[background-color:var(--destructive)]',\n absent: 'ds:[background-color:var(--warning)]',\n },\n },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\n/**\n * The single painted surface of a calendar event.\n *\n * Colour model (platform parity): the caller's picker hex\n * (`backgroundColor` / `textColor` / `borderColor`) is the ONLY thing that\n * paints the card. `status` never paints the surface — it selects an icon,\n * an optional decorative accent bar, and (for `cancelled`) a line-through.\n *\n * Non-interactive by design: inside FullCalendar the outer harness anchor\n * owns click/drag/focus; standalone consumers wrap the card in their own\n * button/link. No onClick in the contract.\n */\nexport interface CalendarEventCardProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title'\n> {\n /**\n * Primary line. Pass the ALREADY-MASKED title when privacy applies — the\n * card never receives a name it must not render, so it cannot leak it\n * (visually or via the composed aria-label).\n */\n title: string;\n /**\n * Secondary description line, normal weight, truncated. Note: the\n * Calendar's privacy mode does NOT mask the suffix (current behaviour,\n * preserved deliberately).\n */\n suffix?: string;\n /**\n * Pre-formatted, localised time range (e.g. \"09:00 – 09:45\"). The\n * Calendar adapter computes it via Intl.DateTimeFormat.formatRange.\n * Included in the composed aria-label whenever present (even when the\n * visual time line is suppressed via showTime/allDay — matches today's\n * Calendar behaviour byte-for-byte).\n */\n rangeText?: string;\n /**\n * Gates the VISUAL time line only (aria keeps rangeText). Mirrors\n * CalendarProps.showTime. @default true\n */\n showTime?: boolean;\n /**\n * All-day events suppress the visual time line (aria keeps rangeText).\n * @default false\n */\n allDay?: boolean;\n\n /**\n * Lifecycle state (6-state, matches the platform DoctorAppointment\n * lifecycle) → status icon + optional accent bar + line-through for\n * `cancelled` + localised label in the aria-label. NEVER paints the\n * card surface.\n */\n status?: CalendarEventStatus;\n /**\n * Render the 3px inline-start accent bar in the status's semantic token\n * colour. Purely decorative (aria-hidden) — the icon and aria-label carry\n * status regardless. The platform (colour = picker, status = icons only)\n * passes false via CalendarProps.eventStatusAccent. @default true\n */\n statusAccent?: boolean;\n\n /**\n * Runtime hex (#rgb or #rrggbb) from the consumer's colour picker — THE\n * painted surface. Injected as `--calendar-event-bg` via the sanctioned\n * inline custom-property pattern (23-constraints §inline-style exception).\n */\n backgroundColor?: string;\n /**\n * Runtime hex paired with backgroundColor. When omitted while\n * backgroundColor is set, the card auto-derives black/white ink by\n * luminance (provably WCAG AA ≥ 4.58:1 for any opaque colour).\n */\n textColor?: string;\n /**\n * Runtime hex border for delineating light surfaces. The platform sends\n * '#cccccc' when backgroundColor is '#ffffff' and omits it otherwise.\n * Falls back to transparent; border-width is constant (1px always\n * rendered), so toggling never shifts layout and event boundaries\n * survive forced-colors / Windows High Contrast for free.\n */\n borderColor?: string;\n\n /* Indicator icons — names identical to CalendarEvent fields (1:1 map). */\n /** Globe icon + diagonal stripe overlay. */\n isBookedOnline?: boolean;\n /** AlertTriangle icon. */\n hasUnassignedPatient?: boolean;\n /** HeartPulse icon. */\n hasHighlightedAnamnesis?: boolean;\n /** Euro icon. */\n hasBillableAmount?: boolean;\n /** Video icon. */\n isTelehealth?: boolean;\n\n /**\n * Resource title (chair/operator) woven into the composed aria-label\n * only — never rendered visually. The Calendar adapter resolves\n * resourceId → title before passing it.\n */\n resourceLabel?: string;\n /**\n * Stable event id → emitted as `data-event-id` (Calendar.focusEvent\n * targets it) and used as the contrast-warning dedup context.\n */\n eventId?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport const CalendarEventCard = forwardRef<\n HTMLDivElement,\n CalendarEventCardProps\n>(\n (\n {\n title,\n suffix,\n rangeText,\n showTime = true,\n allDay = false,\n status,\n statusAccent = true,\n backgroundColor,\n textColor,\n borderColor,\n isBookedOnline = false,\n hasUnassignedPatient,\n hasHighlightedAnamnesis,\n hasBillableAmount,\n isTelehealth,\n resourceLabel,\n eventId,\n className,\n style,\n 'aria-label': ariaLabelProp,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const StatusIcon = status ? STATUS_ICON[status] : null;\n const statusLabel = status ? t(STATUS_LABEL_KEYS[status]) : undefined;\n\n /* Accessible name — exactly the Calendar's historical composition.\n An explicit consumer-supplied aria-label wins. rangeText is always\n included when present, even when the visual time line is hidden. */\n const ariaLabel =\n ariaLabelProp ??\n [title, rangeText, resourceLabel, statusLabel].filter(Boolean).join(', ');\n\n /* Ink derivation — only when the caller paints the surface without\n pairing a text colour. */\n const ink =\n !textColor && backgroundColor ? resolveInk(backgroundColor) : null;\n\n /* DEV-only guardrails — every helper no-ops in production and dedupes\n per session, so calling during render is safe. */\n const warnContext = eventId ? `event ${eventId}` : 'calendar-event-card';\n warnLowContrast(backgroundColor, textColor, warnContext);\n if (backgroundColor && !textColor) {\n // no-ops when the hex is parseable (i.e. when resolveInk succeeded)\n warnUnparseableBackground(backgroundColor, warnContext);\n }\n if (backgroundColor && !borderColor) {\n // no-ops unless the background is near-white (luminance > 0.9)\n warnLowDelineation(backgroundColor, warnContext);\n }\n\n /* Per-event colour override: the consuming app passes runtime hex from\n its colour picker. 23-constraints permits inline `style` only as a\n CSS custom-property setter for runtime values that can't be\n enumerated at build time — the consuming background-color / color /\n border-color declarations live in the CVA base as Tailwind arbitrary\n values with token fallbacks. */\n const colourOverrides: CSSProperties | undefined =\n backgroundColor || textColor || borderColor\n ? ({\n ...(backgroundColor\n ? { '--calendar-event-bg': backgroundColor }\n : {}),\n ...(textColor\n ? { '--calendar-event-text': textColor }\n : ink === 'on-light'\n ? { '--calendar-event-text': 'var(--event-ink-on-light)' }\n : ink === 'on-dark'\n ? { '--calendar-event-text': 'var(--event-ink-on-dark)' }\n : {}),\n ...(borderColor ? { '--calendar-event-border': borderColor } : {}),\n } as CSSProperties)\n : undefined;\n\n const mergedStyle: CSSProperties | undefined =\n style || colourOverrides ? { ...style, ...colourOverrides } : undefined;\n\n return (\n <div\n ref={ref}\n {...rest}\n className={calendarEventCardVariants({\n status: status ?? 'none',\n bookedOnline: isBookedOnline,\n className,\n })}\n // eslint-disable-next-line react/forbid-dom-props -- caller-supplied event bg/text/border hex injected via CSS variables (23-constraints §inline-style exception)\n style={mergedStyle}\n aria-label={ariaLabel}\n data-component=\"calendar-event-card\"\n data-event-id={eventId}\n data-status={status ?? 'none'}\n data-contrast={textColor ? 'custom' : (ink ?? 'default')}\n >\n {status && statusAccent ? (\n <span\n aria-hidden=\"true\"\n data-slot=\"status-accent\"\n className={statusAccentVariants({ status })}\n />\n ) : null}\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:self-end\">\n {/* All icons render in currentcolor — they inherit the resolved\n ink, so the ≥ 4.5:1 text guarantee makes every icon exceed the\n 3:1 graphics minimum (WCAG 1.4.11) on any picker surface.\n Never tint icons with status colours. */}\n {StatusIcon ? <StatusIcon size={14} aria-hidden=\"true\" /> : null}\n {isBookedOnline ? <Globe size={12} aria-hidden=\"true\" /> : null}\n {hasUnassignedPatient ? (\n <TriangleAlert size={12} aria-hidden=\"true\" />\n ) : null}\n {hasHighlightedAnamnesis ? (\n <HeartPulse size={12} aria-hidden=\"true\" />\n ) : null}\n {hasBillableAmount ? <Euro size={12} aria-hidden=\"true\" /> : null}\n {isTelehealth ? <Video size={12} aria-hidden=\"true\" /> : null}\n </div>\n {showTime && !allDay && rangeText ? (\n // No opacity here — composing 70% over saturated bgs drops\n // effective contrast below WCAG AA. The smaller font-size-xs vs\n // the title's font-weight-semibold provides sufficient visual\n // hierarchy.\n <span className=\"ds:text-[length:var(--font-size-xs)]\">\n {rangeText}\n </span>\n ) : null}\n <span className=\"ds:font-[var(--font-weight-semibold)] ds:truncate ds:text-start\">\n {title}\n </span>\n {suffix ? (\n <span className=\"ds:truncate ds:text-start ds:text-[length:var(--font-size-xs)]\">\n {suffix}\n </span>\n ) : null}\n </div>\n );\n },\n);\nCalendarEventCard.displayName = 'CalendarEventCard';\n"],"names":["__iconNode","Ban","createLucideIcon","Euro","ThumbsUp","Zap","parseHex","hex","trimmed","body","r","g","b","relativeLuminance","lin","c","warnLowContrast","bgHex","fgHex","contextLabel","resolveInk","bg","STATUS_ICON","Clock","Stethoscope","Check","STATUS_LABEL_KEYS","calendarEventCardVariants","cva","statusAccentVariants","CalendarEventCard","forwardRef","title","suffix","rangeText","showTime","allDay","status","statusAccent","backgroundColor","textColor","borderColor","isBookedOnline","hasUnassignedPatient","hasHighlightedAnamnesis","hasBillableAmount","isTelehealth","resourceLabel","eventId","className","style","ariaLabelProp","rest","ref","t","useTranslation","StatusIcon","statusLabel","ariaLabel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BAAAyB;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,eAAY;AAAA,cACZ,aAAU;AAAA,cACV,WAAWlC,GAAqB,EAAE,QAAAQ,EAAA,CAAQ;AAAA,YAAA;AAAA,UAAA,IAE1C;AAAA,UACJ,gBAAAyB,EAAC,OAAA,EAAI,WAAU,kEAKZ,UAAA;AAAA,YAAAN,sBAAcA,GAAA,EAAW,MAAM,IAAI,eAAY,QAAO,IAAK;AAAA,YAC3Dd,IAAiB,gBAAAqB,EAACC,GAAA,EAAM,MAAM,IAAI,eAAY,QAAO,IAAK;AAAA,YAC1DrB,IACC,gBAAAoB,EAACE,GAAA,EAAc,MAAM,IAAI,eAAY,QAAO,IAC1C;AAAA,YACHrB,IACC,gBAAAmB,EAACG,GAAA,EAAW,MAAM,IAAI,eAAY,QAAO,IACvC;AAAA,YACHrB,IAAoB,gBAAAkB,EAAC5D,GAAA,EAAK,MAAM,IAAI,eAAY,QAAO,IAAK;AAAA,YAC5D2C,IAAe,gBAAAiB,EAACI,GAAA,EAAM,MAAM,IAAI,eAAY,QAAO,IAAK;AAAA,UAAA,GAC3D;AAAA,UACChC,KAAY,CAACC,KAAUF;AAAA;AAAA;AAAA;AAAA;AAAA,YAKtB,gBAAA6B,EAAC,QAAA,EAAK,WAAU,wCACb,UAAA7B,EAAA,CACH;AAAA,cACE;AAAA,UACJ,gBAAA6B,EAAC,QAAA,EAAK,WAAU,mEACb,UAAA/B,GACH;AAAA,UACCC,IACC,gBAAA8B,EAAC,QAAA,EAAK,WAAU,kEACb,aACH,IACE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACAjC,GAAkB,cAAc;","x_google_ignoreList":[0,1,2,3]}
@@ -1 +1 @@
1
- {"version":3,"file":"chat-input-QpHxBEnN.js","sources":["../../node_modules/lucide-react/dist/esm/icons/paperclip.mjs","../../src/components/chat-input/chat-input.agent.ts","../../src/components/chat-input/chat-input.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 [\n \"path\",\n {\n d: \"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\",\n key: \"1miecu\"\n }\n ]\n];\nconst Paperclip = createLucideIcon(\"paperclip\", __iconNode);\n\nexport { __iconNode, Paperclip as default };\n//# sourceMappingURL=paperclip.mjs.map\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — ChatInput. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { ChatInputHandle } from './chat-input';\n\nexport const chatInputAgent: AgentAdapter<ChatInputHandle> = {\n id: 'chat-input',\n capabilities: ['edit_inline', 'submit'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.chatInput.state.value',\n description: 'Current text in the composer.',\n read: (handle) => handle.getValue(),\n },\n isEmpty: {\n type: 'boolean',\n descriptionKey: 'ui.agent.chatInput.state.isEmpty',\n description: 'True when the composer has no text.',\n read: (handle) => handle.isEmpty(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: string }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: 'string',\n description: 'New composer text, replacing the current value.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.chatInput.actions.setValue',\n description: 'Replace the composer text.',\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n clear: {\n // Discards whatever the user has typed — irreversible from this UI.\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.chatInput.actions.clear',\n description: 'Clear the composer. Irreversible from the same UI.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n submit: {\n safety: 'write',\n // Hands the composer text to the host `onSubmit` callback, which sends\n // the message to a backend / model — an external side effect.\n openWorld: true,\n descriptionKey: 'ui.agent.chatInput.actions.submit',\n description: 'Submit the current composer state via onSubmit.',\n invoke: (handle) => {\n handle.submit();\n },\n },\n focus: {\n safety: 'read',\n descriptionKey: 'ui.agent.chatInput.actions.focus',\n description: 'Move keyboard focus into the textarea.',\n invoke: (handle) => {\n handle.focus();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'chat-input',\n description: 'Marks the ChatInput wrapper.',\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 useCallback,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n type ChangeEvent,\n type CompositionEvent,\n type KeyboardEvent,\n type ReactNode,\n type TextareaHTMLAttributes,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { AlertCircle, Paperclip, Send } from 'lucide-react';\nimport { IconButton } from '../button';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { chatInputAgent } from './chat-input.agent';\n\nconst rootVariants = cva(\n [\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:w-full',\n // Uses the kit's shared input-chrome tokens — `--input` for fill,\n // `--shadow-input` for the halo. Border stays at 1px (`--border`,\n // softened to `grey-700` in light) so the focus-within override and\n // forced-colors fallback both still paint a visible edge.\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border',\n 'ds:bg-input ds:shadow-[var(--shadow-input)]',\n 'ds:focus-within:border-[color:var(--primary)]',\n 'ds:transition-[border-color,box-shadow] ds:duration-[var(--animation-duration)]',\n 'ds:motion-reduce:transition-none',\n 'ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:text-[length:var(--font-size-sm)]',\n md: 'ds:text-[length:var(--font-size-base)]',\n lg: 'ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\ntype NativeTextareaProps = Omit<\n TextareaHTMLAttributes<HTMLTextAreaElement>,\n 'size' | 'onSubmit' | 'children'\n>;\n\n/** Curated imperative handle for agent / external automation. */\nexport interface ChatInputHandle {\n getValue: () => string;\n isEmpty: () => boolean;\n setValue: (value: string) => void;\n clear: () => void;\n submit: () => void;\n focus: () => void;\n}\n\nexport interface ChatInputProps\n extends NativeTextareaProps, VariantProps<typeof rootVariants> {\n /** Invoked when the user submits (Cmd/Ctrl+Enter, or send button). */\n onSubmit?: (text: string) => void;\n /** Maximum allowed characters (grapheme clusters via Intl.Segmenter when available). */\n maxLength?: number;\n /** When true, plain Enter submits and Shift+Enter inserts a newline.\n * Default false (Enter inserts newline; Cmd/Ctrl+Enter submits). */\n submitOnEnter?: boolean;\n /** Minimum visible rows. Default 1. */\n minRows?: number;\n /** Maximum visible rows before the field scrolls. Default 8. */\n maxRows?: number;\n /** Optional attachment handler — when provided, renders the attachment button. */\n onAttach?: (files: FileList) => void;\n /** `accept` forwarded to the hidden file input. */\n accept?: string;\n /** Controls whether the textarea is disabled and submit is blocked. */\n disabled?: boolean;\n /** Optional slot placed between the textarea and the send button. */\n toolbar?: ReactNode;\n /** Visible label above the textarea. When omitted, a visually-hidden label is used. */\n label?: string;\n}\n\nfunction graphemeCount(value: string, locale: string): number {\n if (typeof Intl !== 'undefined' && typeof Intl.Segmenter === 'function') {\n try {\n const seg = new Intl.Segmenter(locale, { granularity: 'grapheme' });\n let n = 0;\n for (const _s of seg.segment(value)) n += 1;\n return n;\n } catch {\n /* fall through to Array.from */\n }\n }\n return Array.from(value).length;\n}\n\n/** Truncate `value` to at most `max` graphemes. Returns the original\n * string when it already fits so callers can compare references. */\nfunction truncateToGraphemes(\n value: string,\n max: number,\n locale: string,\n): string {\n if (typeof Intl !== 'undefined' && typeof Intl.Segmenter === 'function') {\n try {\n const seg = new Intl.Segmenter(locale, { granularity: 'grapheme' });\n const parts: string[] = [];\n for (const s of seg.segment(value)) {\n parts.push(s.segment);\n if (parts.length >= max) break;\n }\n const joined = parts.join('');\n return joined.length === value.length ? value : joined;\n } catch {\n /* fall through to code-point split */\n }\n }\n const cps = Array.from(value);\n return cps.length <= max ? value : cps.slice(0, max).join('');\n}\n\nexport const ChatInput = forwardRef<HTMLDivElement, ChatInputProps>(\n (\n {\n size = 'md',\n value,\n defaultValue,\n maxLength,\n submitOnEnter = false,\n minRows = 1,\n maxRows = 8,\n onSubmit,\n onAttach,\n accept,\n disabled,\n toolbar,\n label,\n placeholder,\n className,\n onChange,\n onKeyDown,\n onCompositionStart,\n onCompositionEnd,\n id,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const textareaId = useId();\n const composingRef = useRef(false);\n const fileInputRef = useRef<HTMLInputElement>(null);\n const innerRef = useRef<HTMLTextAreaElement | null>(null);\n\n const setRefs = useCallback((node: HTMLTextAreaElement | null) => {\n innerRef.current = node;\n }, []);\n\n const [currentValueRaw, setChatValue] = useControllableState<string>({\n value: value === undefined ? undefined : String(value),\n defaultValue: String(defaultValue ?? ''),\n });\n const currentValue = currentValueRaw ?? '';\n\n const count = graphemeCount(currentValue, i18n.language);\n const hasMaxLength = typeof maxLength === 'number' && maxLength > 0;\n const remaining = hasMaxLength ? Math.max(0, maxLength - count) : 0;\n const showCounter = hasMaxLength && count > (maxLength as number) * 0.9;\n const atLimit = hasMaxLength && count >= maxLength;\n\n /* Auto-grow — compute height from scrollHeight, clamped to [minRows, maxRows].\n Imperative `.style` write is permitted per 23-constraints\n §Runtime-computed dimensions (textarea scrollHeight measurement). */\n const resize = useCallback(() => {\n const el = innerRef.current;\n if (!el) return;\n const styles = window.getComputedStyle(el);\n const lineHeight = parseFloat(styles.lineHeight) || 24;\n const padTop = parseFloat(styles.paddingTop) || 0;\n const padBot = parseFloat(styles.paddingBottom) || 0;\n const borderTop = parseFloat(styles.borderTopWidth) || 0;\n const borderBot = parseFloat(styles.borderBottomWidth) || 0;\n const chrome = padTop + padBot + borderTop + borderBot;\n const minH = lineHeight * minRows + chrome;\n const maxH = lineHeight * maxRows + chrome;\n el.style.height = 'auto';\n const next = Math.max(minH, Math.min(el.scrollHeight, maxH));\n el.style.height = `${next}px`;\n el.style.overflowY = el.scrollHeight > maxH ? 'auto' : 'hidden';\n }, [minRows, maxRows]);\n\n useIsomorphicLayoutEffect(() => {\n resize();\n }, [resize, currentValue]);\n\n const handleChange = (e: ChangeEvent<HTMLTextAreaElement>) => {\n let next = e.target.value;\n // Enforce a grapheme cap so emoji like 👨‍👩‍👧 (1 grapheme, 11 UTF-16\n // units) stay aligned with the visible counter. Skip during IME\n // composition so the in-progress text is preserved verbatim.\n if (hasMaxLength && !composingRef.current) {\n next = truncateToGraphemes(next, maxLength as number, i18n.language);\n }\n setChatValue(next);\n if (composingRef.current) return;\n onChange?.(e);\n };\n\n const handleCompositionStart = (\n e: CompositionEvent<HTMLTextAreaElement>,\n ) => {\n composingRef.current = true;\n onCompositionStart?.(e);\n };\n const handleCompositionEnd = (e: CompositionEvent<HTMLTextAreaElement>) => {\n composingRef.current = false;\n onCompositionEnd?.(e);\n };\n\n const isIMEKey = (e: KeyboardEvent<HTMLTextAreaElement>) =>\n e.nativeEvent.isComposing || e.keyCode === 229 || composingRef.current;\n\n const submit = () => {\n const text = currentValue.trim();\n if (!text || disabled || atLimit) return;\n onSubmit?.(currentValue);\n setChatValue('');\n // Keep focus in the composer after a send. Activating the Send *button*\n // (click, or keyboard Enter/Space) otherwise strands focus: clearing the\n // value re-disables the button on the next render, so focus falls to\n // <body> and a keyboard user must re-traverse back to the textarea.\n // Refocusing leaves the composer ready for the next message — a no-op for\n // the Enter-to-send path, where focus is already in the textarea.\n innerRef.current?.focus();\n };\n\n const rootRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => rootRef.current as HTMLDivElement, []);\n\n const agentHandle = useMemo<ChatInputHandle>(\n () => ({\n getValue: () => currentValue,\n isEmpty: () => !currentValue.trim(),\n setValue: (next: string) => {\n setChatValue(next);\n },\n clear: () => {\n setChatValue('');\n },\n submit: () => {\n submit();\n },\n focus: () => {\n innerRef.current?.focus();\n },\n }),\n // `submit` is a local closure that always sees the latest currentValue\n // via React's render cycle — depend on currentValue so the handle\n // picks up new values across renders.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentValue, setChatValue],\n );\n useAgentRegistration(chatInputAgent, agentHandle, id);\n\n const handleKeyDown = (e: KeyboardEvent<HTMLTextAreaElement>) => {\n onKeyDown?.(e);\n if (e.defaultPrevented) return;\n if (isIMEKey(e)) return;\n\n if (e.key === 'Enter') {\n const explicitSubmit = e.metaKey || e.ctrlKey;\n const plainEnterSubmits = submitOnEnter && !e.shiftKey;\n if (explicitSubmit || plainEnterSubmits) {\n e.preventDefault();\n submit();\n }\n }\n };\n\n const handleAttach = () => {\n fileInputRef.current?.click();\n };\n\n const handleFilePick = (e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.files && e.target.files.length > 0) {\n onAttach?.(e.target.files);\n }\n // Reset so picking the same file twice still fires change.\n e.target.value = '';\n };\n\n const effectiveId = id ?? textareaId;\n const labelId = `${effectiveId}-label`;\n const counterId = hasMaxLength ? `${effectiveId}-counter` : undefined;\n const hintId = `${effectiveId}-hint`;\n\n const resolvedPlaceholder = placeholder ?? t('chat.input.placeholder');\n const resolvedLabel = label ?? t('chat.prompt');\n\n return (\n <div\n ref={rootRef}\n data-component=\"chat-input\"\n data-component-id={id}\n className={rootVariants({ size, className })}\n >\n <label\n id={labelId}\n htmlFor={effectiveId}\n className={\n label\n ? 'type-label ds:ps-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)]'\n : 'ds:sr-only'\n }\n >\n {resolvedLabel}\n </label>\n <textarea\n ref={setRefs}\n id={effectiveId}\n value={currentValue}\n disabled={disabled}\n rows={minRows}\n placeholder={resolvedPlaceholder}\n aria-labelledby={labelId}\n aria-describedby={\n [counterId, hintId].filter(Boolean).join(' ') || undefined\n }\n aria-invalid={atLimit || undefined}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n className={[\n 'ds:w-full ds:resize-none ds:bg-transparent',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-xs)]',\n 'ds:placeholder:text-[color:var(--muted-foreground)]',\n 'ds:leading-[var(--line-height-base)]',\n 'ds:disabled:opacity-50 ds:disabled:cursor-not-allowed',\n // Tokenised focus ring on the textarea itself — the 1px border\n // shift on the wrapper alone fails the 3px accessible-theme\n // requirement. See a11y-critical-fixes.mdx.\n 'ds:outline-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n ].join(' ')}\n {...rest}\n />\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]\">\n {onAttach ? (\n <>\n <input\n ref={fileInputRef}\n type=\"file\"\n className=\"ds:sr-only\"\n multiple\n accept={accept}\n onChange={handleFilePick}\n aria-label={t('chat.input.attach')}\n tabIndex={-1}\n />\n <IconButton\n icon={<Paperclip />}\n aria-label={t('chat.input.attach')}\n intent=\"ghost\"\n size=\"sm\"\n onClick={handleAttach}\n disabled={disabled}\n />\n </>\n ) : null}\n {toolbar}\n <div className=\"ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {showCounter ? (\n <span\n id={counterId}\n aria-live=\"polite\"\n className={[\n 'ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]',\n 'type-meta ds:tabular-nums',\n atLimit\n ? 'ds:text-[color:var(--destructive)]'\n : 'ds:text-[color:var(--muted-foreground)]',\n ].join(' ')}\n >\n {atLimit ? (\n // Icon pairs with --destructive colour so the at-limit\n // state is not conveyed by hue alone (WCAG 1.4.1).\n <AlertCircle aria-hidden=\"true\" className=\"ds:size-3.5\" />\n ) : null}\n {t('chat.input.remaining', { count: remaining })}\n </span>\n ) : null}\n <span id={hintId} className=\"ds:sr-only\">\n {t('chat.input.sendHint')}\n </span>\n <IconButton\n icon={<Send />}\n aria-label={t('chat.send')}\n intent=\"primary\"\n size=\"sm\"\n disabled={disabled || !currentValue.trim() || atLimit}\n onClick={submit}\n aria-keyshortcuts=\"Meta+Enter Control+Enter\"\n />\n </div>\n </div>\n </div>\n );\n },\n);\n\nChatInput.displayName = 'ChatInput';\n"],"names":["__iconNode","Paperclip","createLucideIcon","chatInputAgent","handle","args","rootVariants","cva","graphemeCount","value","locale","seg","n","_s","truncateToGraphemes","max","parts","s","joined","cps","ChatInput","forwardRef","size","defaultValue","maxLength","submitOnEnter","minRows","maxRows","onSubmit","onAttach","accept","disabled","toolbar","label","placeholder","className","onChange","onKeyDown","onCompositionStart","onCompositionEnd","id","rest","ref","t","i18n","useTranslation","textareaId","useId","composingRef","useRef","fileInputRef","innerRef","setRefs","useCallback","node","currentValueRaw","setChatValue","useControllableState","currentValue","count","hasMaxLength","remaining","showCounter","atLimit","resize","el","styles","lineHeight","padTop","padBot","borderTop","borderBot","chrome","minH","maxH","next","useIsomorphicLayoutEffect","handleChange","handleCompositionStart","handleCompositionEnd","isIMEKey","submit","_a","rootRef","useImperativeHandle","agentHandle","useMemo","useAgentRegistration","handleKeyDown","explicitSubmit","plainEnterSubmits","handleAttach","handleFilePick","effectiveId","labelId","counterId","hintId","resolvedPlaceholder","resolvedLabel","jsxs","jsx","Fragment","IconButton","AlertCircle","Send"],"mappings":";;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB;AAAA,IACE;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AA;AAAA,gBAAA;AAAA,cAAA,IAE/C;AAAA,cACJ,gBAAAuC,EAAC,UAAK,IAAIJ,GAAQ,WAAU,cACzB,UAAArD,EAAE,qBAAqB,GAC1B;AAAA,cACA,gBAAAyD;AAAA,gBAACE;AAAA,gBAAA;AAAA,kBACC,wBAAOE,IAAA,EAAK;AAAA,kBACZ,cAAY7D,EAAE,WAAW;AAAA,kBACzB,QAAO;AAAA,kBACP,MAAK;AAAA,kBACL,UAAUZ,KAAY,CAAC2B,EAAa,UAAUK;AAAA,kBAC9C,SAASkB;AAAA,kBACT,qBAAkB;AAAA,gBAAA;AAAA,cAAA;AAAA,YACpB,EAAA,CACF;AAAA,UAAA,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA7D,GAAU,cAAc;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"chat-input-QpHxBEnN.js","sources":["../../node_modules/lucide-react/dist/esm/icons/paperclip.mjs","../../src/components/chat-input/chat-input.agent.ts","../../src/components/chat-input/chat-input.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 [\n \"path\",\n {\n d: \"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\",\n key: \"1miecu\"\n }\n ]\n];\nconst Paperclip = createLucideIcon(\"paperclip\", __iconNode);\n\nexport { __iconNode, Paperclip as default };\n//# sourceMappingURL=paperclip.mjs.map\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — ChatInput. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { ChatInputHandle } from './chat-input';\n\nexport const chatInputAgent: AgentAdapter<ChatInputHandle> = {\n id: 'chat-input',\n capabilities: ['edit_inline', 'submit'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.chatInput.state.value',\n description: 'Current text in the composer.',\n read: (handle) => handle.getValue(),\n },\n isEmpty: {\n type: 'boolean',\n descriptionKey: 'ui.agent.chatInput.state.isEmpty',\n description: 'True when the composer has no text.',\n read: (handle) => handle.isEmpty(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: string }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: 'string',\n description: 'New composer text, replacing the current value.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.chatInput.actions.setValue',\n description: 'Replace the composer text.',\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n clear: {\n // Discards whatever the user has typed — irreversible from this UI.\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.chatInput.actions.clear',\n description: 'Clear the composer. Irreversible from the same UI.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n submit: {\n safety: 'write',\n // Hands the composer text to the host `onSubmit` callback, which sends\n // the message to a backend / model — an external side effect.\n openWorld: true,\n descriptionKey: 'ui.agent.chatInput.actions.submit',\n description: 'Submit the current composer state via onSubmit.',\n invoke: (handle) => {\n handle.submit();\n },\n },\n focus: {\n safety: 'read',\n descriptionKey: 'ui.agent.chatInput.actions.focus',\n description: 'Move keyboard focus into the textarea.',\n invoke: (handle) => {\n handle.focus();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'chat-input',\n description: 'Marks the ChatInput wrapper.',\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 useCallback,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n type ChangeEvent,\n type CompositionEvent,\n type KeyboardEvent,\n type ReactNode,\n type TextareaHTMLAttributes,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { CircleAlert, Paperclip, Send } from 'lucide-react';\nimport { IconButton } from '../button';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { chatInputAgent } from './chat-input.agent';\n\nconst rootVariants = cva(\n [\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:w-full',\n // Uses the kit's shared input-chrome tokens — `--input` for fill,\n // `--shadow-input` for the halo. Border stays at 1px (`--border`,\n // softened to `grey-700` in light) so the focus-within override and\n // forced-colors fallback both still paint a visible edge.\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border',\n 'ds:bg-input ds:shadow-[var(--shadow-input)]',\n 'ds:focus-within:border-[color:var(--primary)]',\n 'ds:transition-[border-color,box-shadow] ds:duration-[var(--animation-duration)]',\n 'ds:motion-reduce:transition-none',\n 'ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:text-[length:var(--font-size-sm)]',\n md: 'ds:text-[length:var(--font-size-base)]',\n lg: 'ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\ntype NativeTextareaProps = Omit<\n TextareaHTMLAttributes<HTMLTextAreaElement>,\n 'size' | 'onSubmit' | 'children'\n>;\n\n/** Curated imperative handle for agent / external automation. */\nexport interface ChatInputHandle {\n getValue: () => string;\n isEmpty: () => boolean;\n setValue: (value: string) => void;\n clear: () => void;\n submit: () => void;\n focus: () => void;\n}\n\nexport interface ChatInputProps\n extends NativeTextareaProps, VariantProps<typeof rootVariants> {\n /** Invoked when the user submits (Cmd/Ctrl+Enter, or send button). */\n onSubmit?: (text: string) => void;\n /** Maximum allowed characters (grapheme clusters via Intl.Segmenter when available). */\n maxLength?: number;\n /** When true, plain Enter submits and Shift+Enter inserts a newline.\n * Default false (Enter inserts newline; Cmd/Ctrl+Enter submits). */\n submitOnEnter?: boolean;\n /** Minimum visible rows. Default 1. */\n minRows?: number;\n /** Maximum visible rows before the field scrolls. Default 8. */\n maxRows?: number;\n /** Optional attachment handler — when provided, renders the attachment button. */\n onAttach?: (files: FileList) => void;\n /** `accept` forwarded to the hidden file input. */\n accept?: string;\n /** Controls whether the textarea is disabled and submit is blocked. */\n disabled?: boolean;\n /** Optional slot placed between the textarea and the send button. */\n toolbar?: ReactNode;\n /** Visible label above the textarea. When omitted, a visually-hidden label is used. */\n label?: string;\n}\n\nfunction graphemeCount(value: string, locale: string): number {\n if (typeof Intl !== 'undefined' && typeof Intl.Segmenter === 'function') {\n try {\n const seg = new Intl.Segmenter(locale, { granularity: 'grapheme' });\n let n = 0;\n for (const _s of seg.segment(value)) n += 1;\n return n;\n } catch {\n /* fall through to Array.from */\n }\n }\n return Array.from(value).length;\n}\n\n/** Truncate `value` to at most `max` graphemes. Returns the original\n * string when it already fits so callers can compare references. */\nfunction truncateToGraphemes(\n value: string,\n max: number,\n locale: string,\n): string {\n if (typeof Intl !== 'undefined' && typeof Intl.Segmenter === 'function') {\n try {\n const seg = new Intl.Segmenter(locale, { granularity: 'grapheme' });\n const parts: string[] = [];\n for (const s of seg.segment(value)) {\n parts.push(s.segment);\n if (parts.length >= max) break;\n }\n const joined = parts.join('');\n return joined.length === value.length ? value : joined;\n } catch {\n /* fall through to code-point split */\n }\n }\n const cps = Array.from(value);\n return cps.length <= max ? value : cps.slice(0, max).join('');\n}\n\nexport const ChatInput = forwardRef<HTMLDivElement, ChatInputProps>(\n (\n {\n size = 'md',\n value,\n defaultValue,\n maxLength,\n submitOnEnter = false,\n minRows = 1,\n maxRows = 8,\n onSubmit,\n onAttach,\n accept,\n disabled,\n toolbar,\n label,\n placeholder,\n className,\n onChange,\n onKeyDown,\n onCompositionStart,\n onCompositionEnd,\n id,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const textareaId = useId();\n const composingRef = useRef(false);\n const fileInputRef = useRef<HTMLInputElement>(null);\n const innerRef = useRef<HTMLTextAreaElement | null>(null);\n\n const setRefs = useCallback((node: HTMLTextAreaElement | null) => {\n innerRef.current = node;\n }, []);\n\n const [currentValueRaw, setChatValue] = useControllableState<string>({\n value: value === undefined ? undefined : String(value),\n defaultValue: String(defaultValue ?? ''),\n });\n const currentValue = currentValueRaw ?? '';\n\n const count = graphemeCount(currentValue, i18n.language);\n const hasMaxLength = typeof maxLength === 'number' && maxLength > 0;\n const remaining = hasMaxLength ? Math.max(0, maxLength - count) : 0;\n const showCounter = hasMaxLength && count > (maxLength as number) * 0.9;\n const atLimit = hasMaxLength && count >= maxLength;\n\n /* Auto-grow — compute height from scrollHeight, clamped to [minRows, maxRows].\n Imperative `.style` write is permitted per 23-constraints\n §Runtime-computed dimensions (textarea scrollHeight measurement). */\n const resize = useCallback(() => {\n const el = innerRef.current;\n if (!el) return;\n const styles = window.getComputedStyle(el);\n const lineHeight = parseFloat(styles.lineHeight) || 24;\n const padTop = parseFloat(styles.paddingTop) || 0;\n const padBot = parseFloat(styles.paddingBottom) || 0;\n const borderTop = parseFloat(styles.borderTopWidth) || 0;\n const borderBot = parseFloat(styles.borderBottomWidth) || 0;\n const chrome = padTop + padBot + borderTop + borderBot;\n const minH = lineHeight * minRows + chrome;\n const maxH = lineHeight * maxRows + chrome;\n el.style.height = 'auto';\n const next = Math.max(minH, Math.min(el.scrollHeight, maxH));\n el.style.height = `${next}px`;\n el.style.overflowY = el.scrollHeight > maxH ? 'auto' : 'hidden';\n }, [minRows, maxRows]);\n\n useIsomorphicLayoutEffect(() => {\n resize();\n }, [resize, currentValue]);\n\n const handleChange = (e: ChangeEvent<HTMLTextAreaElement>) => {\n let next = e.target.value;\n // Enforce a grapheme cap so emoji like 👨‍👩‍👧 (1 grapheme, 11 UTF-16\n // units) stay aligned with the visible counter. Skip during IME\n // composition so the in-progress text is preserved verbatim.\n if (hasMaxLength && !composingRef.current) {\n next = truncateToGraphemes(next, maxLength as number, i18n.language);\n }\n setChatValue(next);\n if (composingRef.current) return;\n onChange?.(e);\n };\n\n const handleCompositionStart = (\n e: CompositionEvent<HTMLTextAreaElement>,\n ) => {\n composingRef.current = true;\n onCompositionStart?.(e);\n };\n const handleCompositionEnd = (e: CompositionEvent<HTMLTextAreaElement>) => {\n composingRef.current = false;\n onCompositionEnd?.(e);\n };\n\n const isIMEKey = (e: KeyboardEvent<HTMLTextAreaElement>) =>\n e.nativeEvent.isComposing || e.keyCode === 229 || composingRef.current;\n\n const submit = () => {\n const text = currentValue.trim();\n if (!text || disabled || atLimit) return;\n onSubmit?.(currentValue);\n setChatValue('');\n // Keep focus in the composer after a send. Activating the Send *button*\n // (click, or keyboard Enter/Space) otherwise strands focus: clearing the\n // value re-disables the button on the next render, so focus falls to\n // <body> and a keyboard user must re-traverse back to the textarea.\n // Refocusing leaves the composer ready for the next message — a no-op for\n // the Enter-to-send path, where focus is already in the textarea.\n innerRef.current?.focus();\n };\n\n const rootRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => rootRef.current as HTMLDivElement, []);\n\n const agentHandle = useMemo<ChatInputHandle>(\n () => ({\n getValue: () => currentValue,\n isEmpty: () => !currentValue.trim(),\n setValue: (next: string) => {\n setChatValue(next);\n },\n clear: () => {\n setChatValue('');\n },\n submit: () => {\n submit();\n },\n focus: () => {\n innerRef.current?.focus();\n },\n }),\n // `submit` is a local closure that always sees the latest currentValue\n // via React's render cycle — depend on currentValue so the handle\n // picks up new values across renders.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentValue, setChatValue],\n );\n useAgentRegistration(chatInputAgent, agentHandle, id);\n\n const handleKeyDown = (e: KeyboardEvent<HTMLTextAreaElement>) => {\n onKeyDown?.(e);\n if (e.defaultPrevented) return;\n if (isIMEKey(e)) return;\n\n if (e.key === 'Enter') {\n const explicitSubmit = e.metaKey || e.ctrlKey;\n const plainEnterSubmits = submitOnEnter && !e.shiftKey;\n if (explicitSubmit || plainEnterSubmits) {\n e.preventDefault();\n submit();\n }\n }\n };\n\n const handleAttach = () => {\n fileInputRef.current?.click();\n };\n\n const handleFilePick = (e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.files && e.target.files.length > 0) {\n onAttach?.(e.target.files);\n }\n // Reset so picking the same file twice still fires change.\n e.target.value = '';\n };\n\n const effectiveId = id ?? textareaId;\n const labelId = `${effectiveId}-label`;\n const counterId = hasMaxLength ? `${effectiveId}-counter` : undefined;\n const hintId = `${effectiveId}-hint`;\n\n const resolvedPlaceholder = placeholder ?? t('chat.input.placeholder');\n const resolvedLabel = label ?? t('chat.prompt');\n\n return (\n <div\n ref={rootRef}\n data-component=\"chat-input\"\n data-component-id={id}\n className={rootVariants({ size, className })}\n >\n <label\n id={labelId}\n htmlFor={effectiveId}\n className={\n label\n ? 'type-label ds:ps-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)]'\n : 'ds:sr-only'\n }\n >\n {resolvedLabel}\n </label>\n <textarea\n ref={setRefs}\n id={effectiveId}\n value={currentValue}\n disabled={disabled}\n rows={minRows}\n placeholder={resolvedPlaceholder}\n aria-labelledby={labelId}\n aria-describedby={\n [counterId, hintId].filter(Boolean).join(' ') || undefined\n }\n aria-invalid={atLimit || undefined}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n className={[\n 'ds:w-full ds:resize-none ds:bg-transparent',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-xs)]',\n 'ds:placeholder:text-[color:var(--muted-foreground)]',\n 'ds:leading-[var(--line-height-base)]',\n 'ds:disabled:opacity-50 ds:disabled:cursor-not-allowed',\n // Tokenised focus ring on the textarea itself — the 1px border\n // shift on the wrapper alone fails the 3px accessible-theme\n // requirement. See a11y-critical-fixes.mdx.\n 'ds:outline-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n ].join(' ')}\n {...rest}\n />\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]\">\n {onAttach ? (\n <>\n <input\n ref={fileInputRef}\n type=\"file\"\n className=\"ds:sr-only\"\n multiple\n accept={accept}\n onChange={handleFilePick}\n aria-label={t('chat.input.attach')}\n tabIndex={-1}\n />\n <IconButton\n icon={<Paperclip />}\n aria-label={t('chat.input.attach')}\n intent=\"ghost\"\n size=\"sm\"\n onClick={handleAttach}\n disabled={disabled}\n />\n </>\n ) : null}\n {toolbar}\n <div className=\"ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {showCounter ? (\n <span\n id={counterId}\n aria-live=\"polite\"\n className={[\n 'ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]',\n 'type-meta ds:tabular-nums',\n atLimit\n ? 'ds:text-[color:var(--destructive)]'\n : 'ds:text-[color:var(--muted-foreground)]',\n ].join(' ')}\n >\n {atLimit ? (\n // Icon pairs with --destructive colour so the at-limit\n // state is not conveyed by hue alone (WCAG 1.4.1).\n <CircleAlert aria-hidden=\"true\" className=\"ds:size-3.5\" />\n ) : null}\n {t('chat.input.remaining', { count: remaining })}\n </span>\n ) : null}\n <span id={hintId} className=\"ds:sr-only\">\n {t('chat.input.sendHint')}\n </span>\n <IconButton\n icon={<Send />}\n aria-label={t('chat.send')}\n intent=\"primary\"\n size=\"sm\"\n disabled={disabled || !currentValue.trim() || atLimit}\n onClick={submit}\n aria-keyshortcuts=\"Meta+Enter Control+Enter\"\n />\n </div>\n </div>\n </div>\n );\n },\n);\n\nChatInput.displayName = 'ChatInput';\n"],"names":["__iconNode","Paperclip","createLucideIcon","chatInputAgent","handle","args","rootVariants","cva","graphemeCount","value","locale","seg","n","_s","truncateToGraphemes","max","parts","s","joined","cps","ChatInput","forwardRef","size","defaultValue","maxLength","submitOnEnter","minRows","maxRows","onSubmit","onAttach","accept","disabled","toolbar","label","placeholder","className","onChange","onKeyDown","onCompositionStart","onCompositionEnd","id","rest","ref","t","i18n","useTranslation","textareaId","useId","composingRef","useRef","fileInputRef","innerRef","setRefs","useCallback","node","currentValueRaw","setChatValue","useControllableState","currentValue","count","hasMaxLength","remaining","showCounter","atLimit","resize","el","styles","lineHeight","padTop","padBot","borderTop","borderBot","chrome","minH","maxH","next","useIsomorphicLayoutEffect","handleChange","handleCompositionStart","handleCompositionEnd","isIMEKey","submit","_a","rootRef","useImperativeHandle","agentHandle","useMemo","useAgentRegistration","handleKeyDown","explicitSubmit","plainEnterSubmits","handleAttach","handleFilePick","effectiveId","labelId","counterId","hintId","resolvedPlaceholder","resolvedLabel","jsxs","jsx","Fragment","IconButton","CircleAlert","Send"],"mappings":";;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AACA,GACMC,KAAYC,GAAiB,aAAaF,EAAU,GCX7CG,KAAgD;AAAA,EAC3D,IAAI;AAAA,EACJ,cAAc,CAAC,eAAe,QAAQ;AAAA,EACtC,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,SAAS;AAAA,MACP,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,QAAA;AAAA,IAAQ;AAAA,EACnC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YA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