@alfadocs/ui-kit-debug 1.12.5 → 1.13.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 (138) hide show
  1. package/dist/_chunks/{actions-cell-renderer-DnSLrgQD.js → actions-cell-renderer-ReurEy5i.js} +2 -2
  2. package/dist/_chunks/{actions-cell-renderer-DnSLrgQD.js.map → actions-cell-renderer-ReurEy5i.js.map} +1 -1
  3. package/dist/_chunks/{address-fields-CZP4Wncx.js → address-fields-CZ0pEdEI.js} +4 -4
  4. package/dist/_chunks/{address-fields-CZP4Wncx.js.map → address-fields-CZ0pEdEI.js.map} +1 -1
  5. package/dist/_chunks/{ai-prompt-input-DnbfEJnr.js → ai-prompt-input-CrHr-5H8.js} +2 -2
  6. package/dist/_chunks/{ai-prompt-input-DnbfEJnr.js.map → ai-prompt-input-CrHr-5H8.js.map} +1 -1
  7. package/dist/_chunks/{anamnesis-summary-rows-BfhxWPO3.js → anamnesis-summary-rows-CRWO8x8g.js} +4 -4
  8. package/dist/_chunks/{anamnesis-summary-rows-BfhxWPO3.js.map → anamnesis-summary-rows-CRWO8x8g.js.map} +1 -1
  9. package/dist/_chunks/{audio-recorder-EWBCNIsd.js → audio-recorder-DXG6LTtO.js} +2 -2
  10. package/dist/_chunks/{audio-recorder-EWBCNIsd.js.map → audio-recorder-DXG6LTtO.js.map} +1 -1
  11. package/dist/_chunks/{autocomplete-BrONKN8l.js → autocomplete-MpBhz-fG.js} +86 -74
  12. package/dist/_chunks/{autocomplete-BrONKN8l.js.map → autocomplete-MpBhz-fG.js.map} +1 -1
  13. package/dist/_chunks/{balance-badge-cell-7L6nzB29.js → balance-badge-cell--iQ_gtmi.js} +4 -4
  14. package/dist/_chunks/{balance-badge-cell-7L6nzB29.js.map → balance-badge-cell--iQ_gtmi.js.map} +1 -1
  15. package/dist/_chunks/{bishop-score-Cnu0xs-z.js → bishop-score-CJUVBfAu.js} +2 -2
  16. package/dist/_chunks/{bishop-score-Cnu0xs-z.js.map → bishop-score-CJUVBfAu.js.map} +1 -1
  17. package/dist/_chunks/{booking-CBHKdsZl.js → booking-DQbo6mQF.js} +609 -591
  18. package/dist/_chunks/booking-DQbo6mQF.js.map +1 -0
  19. package/dist/_chunks/{care-plan-card-aDN4oem9.js → care-plan-card-D-FMfDKH.js} +2 -2
  20. package/dist/_chunks/{care-plan-card-aDN4oem9.js.map → care-plan-card-D-FMfDKH.js.map} +1 -1
  21. package/dist/_chunks/{care-plan-entry-card-BEhANdBE.js → care-plan-entry-card-Bvw_9T-d.js} +2 -2
  22. package/dist/_chunks/{care-plan-entry-card-BEhANdBE.js.map → care-plan-entry-card-Bvw_9T-d.js.map} +1 -1
  23. package/dist/_chunks/{care-plan-header-CkpPyQqG.js → care-plan-header-B5CBE0zu.js} +2 -2
  24. package/dist/_chunks/{care-plan-header-CkpPyQqG.js.map → care-plan-header-B5CBE0zu.js.map} +1 -1
  25. package/dist/_chunks/{city-input-towzBenY.js → city-input-DaQc-Hbj.js} +2 -2
  26. package/dist/_chunks/{city-input-towzBenY.js.map → city-input-DaQc-Hbj.js.map} +1 -1
  27. package/dist/_chunks/{combobox-DiMLItyu.js → combobox-D7_NLE2Z.js} +89 -81
  28. package/dist/_chunks/{combobox-DiMLItyu.js.map → combobox-D7_NLE2Z.js.map} +1 -1
  29. package/dist/_chunks/{contact-profile-card-BMIBr5s9.js → contact-profile-card-BZqi8Hck.js} +38 -36
  30. package/dist/_chunks/{contact-profile-card-BMIBr5s9.js.map → contact-profile-card-BZqi8Hck.js.map} +1 -1
  31. package/dist/_chunks/{country-select-UEF9BEeQ.js → country-select-DzbPFktV.js} +2 -2
  32. package/dist/_chunks/{country-select-UEF9BEeQ.js.map → country-select-DzbPFktV.js.map} +1 -1
  33. package/dist/_chunks/{document-preview-oyx9RhCo.js → document-preview-CDb-n_W7.js} +2 -2
  34. package/dist/_chunks/{document-preview-oyx9RhCo.js.map → document-preview-CDb-n_W7.js.map} +1 -1
  35. package/dist/_chunks/{face-scheme-CZaKm6fG.js → face-scheme-DA2vjqaM.js} +2 -2
  36. package/dist/_chunks/{face-scheme-CZaKm6fG.js.map → face-scheme-DA2vjqaM.js.map} +1 -1
  37. package/dist/_chunks/{file-manager-C0y7HBAN.js → file-manager-UsD8e_AB.js} +2 -2
  38. package/dist/_chunks/{file-manager-C0y7HBAN.js.map → file-manager-UsD8e_AB.js.map} +1 -1
  39. package/dist/_chunks/{gestational-age-calculator-CxZelpu2.js → gestational-age-calculator-CiOQjzgx.js} +2 -2
  40. package/dist/_chunks/{gestational-age-calculator-CxZelpu2.js.map → gestational-age-calculator-CiOQjzgx.js.map} +1 -1
  41. package/dist/_chunks/key-value-pair-BIBdZBLg.js +188 -0
  42. package/dist/_chunks/key-value-pair-BIBdZBLg.js.map +1 -0
  43. package/dist/_chunks/{link-cell-renderer-CenJx-_7.js → link-cell-renderer-CIASXsVM.js} +4 -4
  44. package/dist/_chunks/{link-cell-renderer-CenJx-_7.js.map → link-cell-renderer-CIASXsVM.js.map} +1 -1
  45. package/dist/_chunks/{multi-select-DqL4o0qV.js → multi-select-DYOvx2SJ.js} +56 -48
  46. package/dist/_chunks/{multi-select-DqL4o0qV.js.map → multi-select-DYOvx2SJ.js.map} +1 -1
  47. package/dist/_chunks/{muscle-scheme-yfzP_xoJ.js → muscle-scheme-BSJsI4-I.js} +2 -2
  48. package/dist/_chunks/{muscle-scheme-yfzP_xoJ.js.map → muscle-scheme-BSJsI4-I.js.map} +1 -1
  49. package/dist/_chunks/{optical-prescription-Dj3Eh5Ok.js → optical-prescription-BvwuqTpl.js} +2 -2
  50. package/dist/_chunks/{optical-prescription-Dj3Eh5Ok.js.map → optical-prescription-BvwuqTpl.js.map} +1 -1
  51. package/dist/_chunks/{patient-details-xrqe13az.js → patient-details-BQaUzPqp.js} +5 -5
  52. package/dist/_chunks/{patient-details-xrqe13az.js.map → patient-details-BQaUzPqp.js.map} +1 -1
  53. package/dist/_chunks/{patient-search-D5ufYoRc.js → patient-search-HeEUB-_X.js} +2 -2
  54. package/dist/_chunks/{patient-search-D5ufYoRc.js.map → patient-search-HeEUB-_X.js.map} +1 -1
  55. package/dist/_chunks/{patient-summary-card-CBfuDvJ5.js → patient-summary-card-CvDxhbBR.js} +2 -2
  56. package/dist/_chunks/{patient-summary-card-CBfuDvJ5.js.map → patient-summary-card-CvDxhbBR.js.map} +1 -1
  57. package/dist/_chunks/{payment-request-card-YVCcCZ25.js → payment-request-card-lmKLwsDs.js} +2 -2
  58. package/dist/_chunks/{payment-request-card-YVCcCZ25.js.map → payment-request-card-lmKLwsDs.js.map} +1 -1
  59. package/dist/_chunks/{periodontal-chart-BatZEFar.js → periodontal-chart-B9fphroR.js} +2 -2
  60. package/dist/_chunks/{periodontal-chart-BatZEFar.js.map → periodontal-chart-B9fphroR.js.map} +1 -1
  61. package/dist/_chunks/{periodontal-chart-card-BBpY_rBc.js → periodontal-chart-card-qEZPXj83.js} +2 -2
  62. package/dist/_chunks/{periodontal-chart-card-BBpY_rBc.js.map → periodontal-chart-card-qEZPXj83.js.map} +1 -1
  63. package/dist/_chunks/{pregnancy-dating-DtToyMyc.js → pregnancy-dating-D2wchD11.js} +2 -2
  64. package/dist/_chunks/{pregnancy-dating-DtToyMyc.js.map → pregnancy-dating-D2wchD11.js.map} +1 -1
  65. package/dist/_chunks/{province-select-BDywtmL-.js → province-select-BBc7s7vR.js} +2 -2
  66. package/dist/_chunks/{province-select-BDywtmL-.js.map → province-select-BBc7s7vR.js.map} +1 -1
  67. package/dist/_chunks/{select-BW5ecXlX.js → select-Bi8zril7.js} +165 -136
  68. package/dist/_chunks/select-Bi8zril7.js.map +1 -0
  69. package/dist/_chunks/{signature-request-DVDTKLjM.js → signature-request-CUe903hj.js} +2 -2
  70. package/dist/_chunks/{signature-request-DVDTKLjM.js.map → signature-request-CUe903hj.js.map} +1 -1
  71. package/dist/_chunks/{tabs-CBb2AidH.js → tabs-DqKtTIjZ.js} +2 -2
  72. package/dist/_chunks/{tabs-CBb2AidH.js.map → tabs-DqKtTIjZ.js.map} +1 -1
  73. package/dist/_chunks/{tasks-panel-Do5SFp-j.js → tasks-panel-DPCNaRko.js} +2 -2
  74. package/dist/_chunks/{tasks-panel-Do5SFp-j.js.map → tasks-panel-DPCNaRko.js.map} +1 -1
  75. package/dist/_chunks/{tooth-scheme-WdyVymQ1.js → tooth-scheme-2IsmbE6w.js} +2 -2
  76. package/dist/_chunks/{tooth-scheme-WdyVymQ1.js.map → tooth-scheme-2IsmbE6w.js.map} +1 -1
  77. package/dist/_chunks/{unit-converter-BPumXMA6.js → unit-converter-C6jMjqL9.js} +2 -2
  78. package/dist/_chunks/{unit-converter-BPumXMA6.js.map → unit-converter-C6jMjqL9.js.map} +1 -1
  79. package/dist/_chunks/{workflow-map-DE_ribRM.js → workflow-map-wcw3t6g4.js} +2 -2
  80. package/dist/_chunks/{workflow-map-DE_ribRM.js.map → workflow-map-wcw3t6g4.js.map} +1 -1
  81. package/dist/agent-catalog.json +1 -1
  82. package/dist/components/_shared/option.d.ts +1 -0
  83. package/dist/components/_shared/option.d.ts.map +1 -1
  84. package/dist/components/address-fields/index.js +1 -1
  85. package/dist/components/ai-prompt-input/index.js +1 -1
  86. package/dist/components/audio-recorder/index.js +1 -1
  87. package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
  88. package/dist/components/autocomplete/index.js +1 -1
  89. package/dist/components/bishop-score/index.js +1 -1
  90. package/dist/components/booking/booking.d.ts.map +1 -1
  91. package/dist/components/booking/index.js +1 -1
  92. package/dist/components/care-plan-card/index.js +1 -1
  93. package/dist/components/care-plan-entry-card/index.js +1 -1
  94. package/dist/components/care-plan-header/index.js +1 -1
  95. package/dist/components/city-input/index.js +1 -1
  96. package/dist/components/combobox/combobox.d.ts.map +1 -1
  97. package/dist/components/combobox/index.js +1 -1
  98. package/dist/components/contact-profile-card/contact-profile-card.d.ts.map +1 -1
  99. package/dist/components/contact-profile-card/index.js +1 -1
  100. package/dist/components/country-select/index.js +1 -1
  101. package/dist/components/data-table/index.js +2 -2
  102. package/dist/components/document-preview/index.js +1 -1
  103. package/dist/components/face-scheme/index.js +1 -1
  104. package/dist/components/file-manager/index.js +1 -1
  105. package/dist/components/gestational-age-calculator/index.js +1 -1
  106. package/dist/components/key-value-pair/index.js +1 -1
  107. package/dist/components/key-value-pair/key-value-pair.d.ts +16 -0
  108. package/dist/components/key-value-pair/key-value-pair.d.ts.map +1 -1
  109. package/dist/components/multi-select/index.js +1 -1
  110. package/dist/components/multi-select/multi-select.d.ts.map +1 -1
  111. package/dist/components/muscle-scheme/index.js +1 -1
  112. package/dist/components/optical-prescription/index.js +1 -1
  113. package/dist/components/patient-details/index.js +1 -1
  114. package/dist/components/patient-search/index.js +1 -1
  115. package/dist/components/patient-summary-card/index.js +1 -1
  116. package/dist/components/patient-table/index.js +1 -1
  117. package/dist/components/payment-card/index.js +1 -1
  118. package/dist/components/periodontal-chart/index.js +1 -1
  119. package/dist/components/periodontal-chart-card/index.js +1 -1
  120. package/dist/components/pregnancy-dating/index.js +1 -1
  121. package/dist/components/province-select/index.js +1 -1
  122. package/dist/components/select/index.js +1 -1
  123. package/dist/components/select/select.d.ts +24 -0
  124. package/dist/components/select/select.d.ts.map +1 -1
  125. package/dist/components/skeleton-scheme/index.js +1 -1
  126. package/dist/components/tabs/index.js +1 -1
  127. package/dist/components/tasks-panel/index.js +1 -1
  128. package/dist/components/tooth-scheme/index.js +1 -1
  129. package/dist/components/unit-converter/index.js +1 -1
  130. package/dist/components/workflow/index.js +1 -1
  131. package/dist/index.js +40 -40
  132. package/dist/patterns/anamnesis/index.js +1 -1
  133. package/dist/patterns/signature-request/index.js +1 -1
  134. package/package.json +1 -1
  135. package/dist/_chunks/booking-CBHKdsZl.js.map +0 -1
  136. package/dist/_chunks/key-value-pair-BubG4fUa.js +0 -144
  137. package/dist/_chunks/key-value-pair-BubG4fUa.js.map +0 -1
  138. package/dist/_chunks/select-BW5ecXlX.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"patient-summary-card-CBfuDvJ5.js","sources":["../../node_modules/lucide-react/dist/esm/icons/file-exclamation-point.mjs","../../node_modules/lucide-react/dist/esm/icons/message-square-warning.mjs","../../src/components/patient-summary-card/patient-summary-card.agent.ts","../../src/components/patient-summary-card/patient-summary-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 [\n \"path\",\n {\n d: \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\",\n key: \"1oefj6\"\n }\n ],\n [\"path\", { d: \"M12 9v4\", key: \"juzpu7\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst FileExclamationPoint = createLucideIcon(\"file-exclamation-point\", __iconNode);\n\nexport { __iconNode, FileExclamationPoint as default };\n//# sourceMappingURL=file-exclamation-point.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: \"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z\",\n key: \"18887p\"\n }\n ],\n [\"path\", { d: \"M12 15h.01\", key: \"q59x07\" }],\n [\"path\", { d: \"M12 7v4\", key: \"xawao1\" }]\n];\nconst MessageSquareWarning = createLucideIcon(\"message-square-warning\", __iconNode);\n\nexport { __iconNode, MessageSquareWarning as default };\n//# sourceMappingURL=message-square-warning.mjs.map\n","import type { AgentAdapter } from '../../agent/types';\nimport type { PatientSummaryCardHandle } from './patient-summary-card';\n\n/* -------------------------------------------------------------------- */\n/* Agent adapter — PatientSummaryCard */\n/* */\n/* Read-only adapter. Surfaces a STRUCTURAL snapshot of the patient */\n/* overview — counts, flags, and the consumer id only. Never the patient */\n/* name, age, contact details, or any clinical content, so an agent / */\n/* MCP runtime can answer \"does this patient have unpaid balances / */\n/* unsigned documents / AI consent?\" without re-parsing the DOM and */\n/* without leaking PHI (PRS §Security). */\n/* -------------------------------------------------------------------- */\n\nexport const patientSummaryCardAgent: AgentAdapter<PatientSummaryCardHandle> = {\n id: 'patient-summary-card',\n // The agent surface is a structural snapshot only — the single handle method\n // is a getSummary projection. The card MAY be human-customized (the optional\n // per-context \"Customize fields\" cog), but that field reordering is a UI\n // concern and is deliberately NOT exposed as an agent action; programmatic\n // field-set control lives on PatientDetails' adapter (set_field_order).\n capabilities: [],\n state: {\n summary: {\n type: '{ id?: string; hasUnpaid: boolean; unsignedDocumentsCount: number; highlightedAnamnesisCount: number; aiConsentGranted: boolean }',\n descriptionKey: 'ui.agent.patientSummaryCard.state.summary',\n description:\n 'Structural summary of the patient card — identifiers, counts, and consent flags only. Never patient identity or clinical content.',\n read: (handle) => handle.getSummary(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'patient-summary-card',\n description: 'Marks the PatientSummaryCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n useMemo,\n type ComponentPropsWithoutRef,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n CalendarDays,\n FileExclamationPoint,\n Mail,\n MapPin,\n MessageSquareWarning,\n Phone,\n ShieldCheck,\n Astroid,\n Users,\n type LucideIcon,\n} from 'lucide-react';\nimport { Avatar } from '../avatar/avatar';\nimport { Badge } from '../badge/badge';\nimport { Card } from '../card/card';\nimport { KeyValueList, KeyValuePair } from '../key-value-pair/key-value-pair';\nimport { Link } from '../link/link';\nimport { Skeleton } from '../skeleton/skeleton';\nimport { Tag } from '../tag/tag';\nimport { TransactionChip } from '../transaction-chip/transaction-chip';\nimport { isSafeEntityUrl } from '../_shared/is-safe-url';\nimport {\n resolveVisibleFields,\n type PatientField,\n type PatientFieldSection,\n} from '../_shared/patient-fields';\nimport { usePatientFieldVisibility } from '../_shared/field-visibility';\nimport { FieldVisibilityCog } from '../_shared/field-visibility-cog';\nimport {\n AgeChip,\n FieldValue,\n NeutralChip,\n SexChip,\n} from '../_shared/field-value';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { patientSummaryCardAgent } from './patient-summary-card.agent';\n\n/** A section list reference that stays stable across renders (legacy mode). */\nconst NO_SECTIONS: PatientFieldSection[] = [];\n\n/* -------------------------------------------------------------------- */\n/* PatientSummaryCard */\n/* */\n/* The patient-overview profile card every AlfaDocs in-app surface */\n/* composes by hand today (platform patient header, alfascribe patient */\n/* sidebar, check-in landing). Templated on ContactProfileCard: composes */\n/* Card + Avatar + KeyValueList + KeyValuePair + Badge + Tag + */\n/* TransactionChip + Link so the contact rows share a column and every */\n/* row uses the same lucide icon family. */\n/* */\n/* The kit owns the ORDER, ICONS, and LABELS — consumers pass data. No */\n/* free-text clinical content (anamnesis notes, diagnoses) ever lives */\n/* here: only counts/flags/relations are surfaced, so the card stays */\n/* PHI-light and the agent state can be derived without leaking patient */\n/* identity. */\n/* */\n/* All visible text flows through `useTranslation('ui')` against the */\n/* `patientSummaryCard.*` namespace. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA — root */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva('ds:w-full ds:text-[color:var(--foreground)]', {\n variants: {\n // Matches the kit's other `surface` props (ContactProfileCard,\n // OperatorHero). `'elevated'` wraps the content in `<Card>`.\n surface: {\n flat: '',\n elevated: '',\n },\n // Density tunes the avatar size + body padding. `comfortable` reads\n // as a page header; `compact` fits an embedded sidebar / aside.\n density: {\n comfortable: '',\n compact: '',\n },\n },\n defaultVariants: {\n surface: 'elevated',\n density: 'comfortable',\n },\n});\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\n/** Patient phone number — already formatted for display by the consumer. */\nexport interface PatientSummaryCardPhone {\n /** Display string, e.g. `\"+39 055 123 4567\"`. Compiled into a `tel:` link. */\n prefixAndNumber: string;\n /** Optional label that distinguishes this number (e.g. \"Mobile\"). */\n label?: string;\n /** Whether SMS is enabled for this number — shows a small \"SMS\" chip. */\n smsEnabled?: boolean;\n}\n\n/** A family relation row — links one patient to another. */\nexport interface PatientSummaryCardFamilyRelation {\n /** Localised relation label, consumer-supplied (e.g. \"Mother\", \"Child\"). */\n relation: string;\n /** The related patient — name + optional in-app profile URL. */\n relatedPatient: {\n name: string;\n url?: string;\n };\n}\n\n/** Operator the patient is assigned to. */\nexport interface PatientSummaryCardAssignee {\n name: string;\n avatarUrl?: string;\n}\n\n/** AI-consent grant metadata — structural only, never the consented content. */\nexport interface PatientSummaryCardAiConsent {\n /** ISO-8601 / display string of when consent was granted. */\n grantedAt: string;\n /** Optional name of who recorded the grant. */\n grantedBy?: string;\n}\n\n/** Status flags rendered as glyph badges (counts / amounts only — no PHI). */\nexport interface PatientSummaryCardFlags {\n /** Number of anamnesis answers highlighted for clinical attention. */\n highlightedAnamnesisCount?: number;\n /** Outstanding balance in the smallest currency unit (cents). */\n unpaidAmountCents?: number;\n /** Number of documents awaiting the patient's signature. */\n unsignedDocumentsCount?: number;\n}\n\n/** Marketing-consent tri-state. */\nexport type PatientSummaryCardMarketingConsent = 'no' | 'yes' | 'not_specified';\n\nexport interface PatientSummaryCardHandle {\n /** Structural snapshot — identifiers and counts only, never patient identity. */\n getSummary: () => {\n id?: string;\n hasUnpaid: boolean;\n unsignedDocumentsCount: number;\n highlightedAnamnesisCount: number;\n aiConsentGranted: boolean;\n };\n}\n\nexport interface PatientSummaryCardProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children'\n> {\n /** Patient display name. Rendered as the heading. */\n name: string;\n /** Honorific — `'mr'` / `'ms'`. Prepended to the name in the heading. */\n title?: 'mr' | 'ms';\n /** Patient age in whole years — rendered in the identity line. */\n ageYears?: number;\n /** Date of birth — already formatted for display by the consumer. */\n dateOfBirth?: string;\n /** Biological sex marker — `'m'` / `'f'`. Drives the identity-line glyph copy. */\n gender?: 'm' | 'f';\n /** Optional avatar / photo URL. Falls back to initials. */\n avatarUrl?: string;\n /**\n * In-app patient profile URL. When safe, the heading becomes a link.\n * Guarded by the shared `isSafeEntityUrl` allow-list — unsafe URLs are\n * dropped and the heading renders as plain text.\n */\n patientUrl?: string;\n\n /* ----- Shared field model (preferred) ----- */\n\n /**\n * Patient fields in the shared model — the SAME `sections` shape\n * `PatientDetails` consumes (`@alfadocs/ui-kit` `PatientFieldSection`).\n * When provided, the card renders these (honouring `visibleFieldOrder`)\n * instead of the legacy contact props, so a consumer defines its patient-\n * field registry once and reuses it across every patient surface.\n *\n * The card renders each field's `label`, `value`, and `icon` only — it is\n * flat (section headings are not shown in the body) and never inline-edits;\n * `sensitive` / `copyable` / `mono` / `editable` are honoured by\n * `PatientDetails`, not the card (so the PHI lock glyph does not appear here).\n *\n * Pass `onVisibleFieldsChange` alongside `sections` to make THIS placement\n * self-curating (a \"Customize fields\" cog appears — show/hide + drag-and-drop\n * reorder).\n */\n sections?: PatientFieldSection[];\n /**\n * Ordered visible field ids for THIS placement. The order is a\n * per-INSTANCE, per-CONTEXT preference the kit never persists — wire it to\n * whatever scope the consumer wants (e.g. a global per-user setting, or a\n * different config in the care-plan view vs the patient folder). The same\n * field vocabulary can therefore display differently in different parts of\n * the app. Omit (`undefined`) ⇒ show every field; an explicit empty array\n * `[]` ⇒ show none (a card that starts collapsed to name + identity chips and\n * reveals fields via the cog). Also applied to the legacy contact rows (ids\n * `email` / `phone` / `cityProvince` / `marketingConsent` / `aiConsent` /\n * `assignedTo`).\n */\n visibleFieldOrder?: string[];\n /**\n * Make this card's field set user-customizable. When provided alongside\n * `sections`, a \"Customize fields\" cog renders in the header (show/hide +\n * drag-and-drop / Alt+Arrow reorder), and this fires with the next ordered\n * visible set. The consumer owns persistence + its scope — editing here\n * writes only THIS context's preference, never a shared/global one.\n */\n onVisibleFieldsChange?: (orderedIds: string[]) => void;\n\n /* ----- Contact rows (legacy — prefer `sections`) ----- */\n\n /** @deprecated Pass via `sections`. Patient email — `mailto:` link when `emailEnabled`. */\n email?: string;\n /** Whether email contact is enabled — gates the `mailto:` link. */\n emailEnabled?: boolean;\n /** Phone number block. Compiled into a `tel:` link. */\n phone?: PatientSummaryCardPhone;\n /** City / province display string. */\n cityProvince?: string;\n\n /* ----- Consent ----- */\n\n /** Marketing-consent tri-state. */\n marketingConsent?: PatientSummaryCardMarketingConsent;\n /** AI-consent grant metadata. When present, an \"AI consent\" row renders. */\n aiConsent?: PatientSummaryCardAiConsent;\n\n /* ----- Status flags ----- */\n\n /** Counts / amounts surfaced as glyph badges. */\n flags?: PatientSummaryCardFlags;\n\n /* ----- Relations & assignment ----- */\n\n /** Family relations — rendered as `<Tag>` chips, optionally linked. */\n familyRelations?: PatientSummaryCardFamilyRelation[];\n /** Operator the patient is assigned to. */\n assignedTo?: PatientSummaryCardAssignee;\n\n /* ----- Formatting ----- */\n\n /** ISO-4217 currency code for the unpaid-amount chip. Defaults to `EUR`. */\n currency?: string;\n /** BCP-47 locale override. Defaults to the active i18next language. */\n locale?: string;\n\n /* ----- States ----- */\n\n /** Render the skeleton loading placeholder. */\n loading?: boolean;\n\n /* ----- Slots & callbacks ----- */\n\n /** Rendered at the inline-end of the heading row (e.g. an action menu). */\n actionSlot?: ReactNode;\n /** Fires when the whole card / heading is activated. */\n onActivate?: () => void;\n\n /* ----- Styling ----- */\n\n /** `'elevated'` (default) wraps in `<Card>`; `'flat'` drops the chrome. */\n surface?: 'flat' | 'elevated';\n /** `'comfortable'` (default) reads as a header; `'compact'` for asides. */\n density?: 'comfortable' | 'compact';\n\n /* ----- a11y ----- */\n\n /** Override the default region aria-label. */\n 'aria-label'?: string;\n /** Agent-readiness consumer id, surfaced as `data-component-id`. */\n id?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n/** Strip everything except digits + leading `+` for `tel:` URLs. */\nfunction normalisePhone(raw: string): string {\n return raw.replace(/[^\\d+]/g, '');\n}\n\n/* -------------------------------------------------------------------- */\n/* Flag glyphs — the closed set of status indicators */\n/* -------------------------------------------------------------------- */\n\n/** The closed set of status-flag keys (icon + tonal variant defined below). */\ntype FlagKey = 'highlightedAnamnesis' | 'unsignedDocuments';\n\nconst FLAG_ICON: Record<FlagKey, LucideIcon> = {\n highlightedAnamnesis: MessageSquareWarning,\n unsignedDocuments: FileExclamationPoint,\n};\n\nconst FLAG_VARIANT: Record<FlagKey, 'warning' | 'error'> = {\n highlightedAnamnesis: 'warning',\n unsignedDocuments: 'error',\n};\n\n/** English fallbacks for the flag badge accessible names (count-interpolated). */\nconst FLAG_LABEL_DEFAULTS: Record<FlagKey, string> = {\n highlightedAnamnesis: '{{count}} highlighted anamnesis answers',\n unsignedDocuments: '{{count}} unsigned documents',\n};\n\n/** English fallbacks for the marketing-consent tri-state chip. */\nconst MARKETING_CONSENT_DEFAULTS: Record<\n PatientSummaryCardMarketingConsent,\n string\n> = {\n yes: 'Yes',\n no: 'No',\n not_specified: 'Not specified',\n};\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const PatientSummaryCard = forwardRef<\n HTMLDivElement,\n PatientSummaryCardProps\n>(\n (\n {\n name,\n title,\n ageYears,\n dateOfBirth,\n gender,\n avatarUrl,\n patientUrl,\n sections,\n visibleFieldOrder,\n onVisibleFieldsChange,\n email,\n emailEnabled = false,\n phone,\n cityProvince,\n marketingConsent,\n aiConsent,\n flags,\n familyRelations,\n assignedTo,\n currency = 'EUR',\n locale,\n loading = false,\n actionSlot,\n onActivate,\n surface = 'elevated',\n density = 'comfortable',\n 'aria-label': ariaLabel,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const headingId = useId();\n const activeLocale = locale ?? i18n.language ?? 'en';\n\n const unpaidAmountCents = flags?.unpaidAmountCents;\n const unsignedDocumentsCount = flags?.unsignedDocumentsCount ?? 0;\n const highlightedAnamnesisCount = flags?.highlightedAnamnesisCount ?? 0;\n const hasUnpaid = unpaidAmountCents != null && unpaidAmountCents > 0;\n\n // Imperative handle — structural snapshot only (counts/flags/ids),\n // never the patient name or any clinical content.\n const handle = useMemo<PatientSummaryCardHandle>(\n () => ({\n getSummary: () => ({\n id,\n hasUnpaid,\n unsignedDocumentsCount,\n highlightedAnamnesisCount,\n aiConsentGranted: aiConsent != null,\n }),\n }),\n [\n id,\n hasUnpaid,\n unsignedDocumentsCount,\n highlightedAnamnesisCount,\n aiConsent,\n ],\n );\n useAgentRegistration(patientSummaryCardAgent, handle, id);\n\n // Per-context field visibility. The cog (and live reordering) only engages\n // with the shared `sections` model AND an `onVisibleFieldsChange` handler;\n // legacy contact-prop cards stay read-only. The order is this placement's\n // own preference — never shared across surfaces.\n const customizable = !!sections && !!onVisibleFieldsChange;\n const fieldVisibility = usePatientFieldVisibility(sections ?? NO_SECTIONS, {\n value: visibleFieldOrder,\n onChange: onVisibleFieldsChange,\n });\n\n const resolvedAriaLabel =\n ariaLabel ??\n t('patientSummaryCard.regionLabel', { defaultValue: 'Patient overview' });\n\n // Heading text: optional honorific prefix + name.\n const TITLE_DEFAULTS: Record<'mr' | 'ms', string> = {\n mr: 'Mr.',\n ms: 'Ms.',\n };\n const honorific = title\n ? t(`patientSummaryCard.title.${title}`, {\n defaultValue: TITLE_DEFAULTS[title],\n })\n : undefined;\n const headingText = honorific ? `${honorific} ${name}` : name;\n\n // Identity line: the canonical sex / age / dob chips below the name — the\n // SAME chips the field model renders, so the header and the field rows\n // agree. Each chip is added only when its prop is present. (`dateOfBirth`\n // is a consumer-preformatted display string, so it goes through NeutralChip\n // directly rather than the date-parsing `dob` kind.)\n const identityChips: ReactNode[] = [];\n if (gender) {\n identityChips.push(<SexChip key=\"sex\" code={gender} />);\n }\n if (ageYears != null) {\n identityChips.push(<AgeChip key=\"age\" years={ageYears} />);\n }\n if (dateOfBirth) {\n identityChips.push(\n <NeutralChip key=\"dob\" icon={<CalendarDays />}>\n {dateOfBirth}\n </NeutralChip>,\n );\n }\n\n const isUrlSafe = !!patientUrl && isSafeEntityUrl(patientUrl);\n\n const avatarSize = density === 'comfortable' ? 'xl' : 'lg';\n const headingClass =\n density === 'comfortable' ? 'type-title-card' : 'type-title-item';\n const bodyGapClass =\n density === 'comfortable'\n ? 'ds:gap-[var(--spacing-md)]'\n : 'ds:gap-[var(--spacing-sm)]';\n\n /* ---------------------------------------------------------------- */\n /* Contact rows */\n /* ---------------------------------------------------------------- */\n\n const rows: Array<{\n key: string;\n icon: ReactElement;\n label: string;\n value: ReactNode;\n }> = [];\n\n if (email) {\n rows.push({\n key: 'email',\n icon: <Mail aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.email', { defaultValue: 'Email' }),\n value: emailEnabled ? (\n <Link href={`mailto:${email}`} intent=\"default\" onClick={onActivate}>\n {email}\n </Link>\n ) : (\n <span className=\"ds:text-[color:var(--muted-foreground)]\">\n {email}\n </span>\n ),\n });\n }\n\n if (phone) {\n rows.push({\n key: 'phone',\n icon: <Phone aria-hidden=\"true\" />,\n label:\n phone.label ??\n t('patientSummaryCard.label.phone', { defaultValue: 'Phone' }),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-2xs)]\">\n <Link\n href={`tel:${normalisePhone(phone.prefixAndNumber)}`}\n intent=\"default\"\n >\n {phone.prefixAndNumber}\n </Link>\n {phone.smsEnabled ? (\n <Badge variant=\"success\" size=\"sm\">\n {t('patientSummaryCard.value.smsEnabled', {\n defaultValue: 'SMS',\n })}\n </Badge>\n ) : null}\n </span>\n ),\n });\n }\n\n if (cityProvince) {\n rows.push({\n key: 'cityProvince',\n icon: <MapPin aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.cityProvince', {\n defaultValue: 'City / province',\n }),\n value: cityProvince,\n });\n }\n\n if (marketingConsent) {\n rows.push({\n key: 'marketingConsent',\n icon: <ShieldCheck aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.marketingConsent', {\n defaultValue: 'Marketing consent',\n }),\n value: (\n <Badge\n variant={\n marketingConsent === 'yes'\n ? 'success'\n : marketingConsent === 'no'\n ? 'error'\n : 'neutral'\n }\n size=\"sm\"\n withDot\n >\n {t(`patientSummaryCard.marketingConsent.${marketingConsent}`, {\n defaultValue: MARKETING_CONSENT_DEFAULTS[marketingConsent],\n })}\n </Badge>\n ),\n });\n }\n\n if (aiConsent) {\n rows.push({\n key: 'aiConsent',\n icon: <Astroid aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.aiConsent', {\n defaultValue: 'AI consent',\n }),\n value: aiConsent.grantedBy\n ? t('patientSummaryCard.value.aiConsentGrantedBy', {\n date: aiConsent.grantedAt,\n by: aiConsent.grantedBy,\n defaultValue: 'Granted {{date}} by {{by}}',\n })\n : t('patientSummaryCard.value.aiConsentGrantedAt', {\n date: aiConsent.grantedAt,\n defaultValue: 'Granted {{date}}',\n }),\n });\n }\n\n if (assignedTo) {\n rows.push({\n key: 'assignedTo',\n icon: <Users aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.assignedTo', {\n defaultValue: 'Assigned to',\n }),\n value: (\n <span className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <Avatar\n size=\"xs\"\n name={assignedTo.name}\n src={assignedTo.avatarUrl}\n />\n <span>{assignedTo.name}</span>\n </span>\n ),\n });\n }\n\n /* ---------------------------------------------------------------- */\n /* Attention-flag chips (VERBOSE — shown in the identity line) */\n /* */\n /* The unpaid balance + warning counts sit in the chip row under the */\n /* name, BEFORE the sex / age chips, each as a self-describing chip */\n /* (\"2 unsigned documents\") rather than a collapsed count badge in a */\n /* separate strip — the attention signals lead the patient's chips. */\n /* ---------------------------------------------------------------- */\n\n const flagBadges: Array<{ key: FlagKey; count: number }> = [];\n if (highlightedAnamnesisCount > 0) {\n flagBadges.push({\n key: 'highlightedAnamnesis',\n count: highlightedAnamnesisCount,\n });\n }\n if (unsignedDocumentsCount > 0) {\n flagBadges.push({\n key: 'unsignedDocuments',\n count: unsignedDocumentsCount,\n });\n }\n\n const attentionChips: ReactNode[] = [];\n if (hasUnpaid) {\n attentionChips.push(\n <TransactionChip\n key=\"unpaid\"\n state=\"debt\"\n amount={(unpaidAmountCents as number) / 100}\n currency={currency}\n locale={activeLocale}\n size=\"md\"\n showLabel\n />,\n );\n }\n flagBadges.forEach(({ key, count }) => {\n const FlagIcon = FLAG_ICON[key];\n // The Badge's visible text IS the count-interpolated label, so it's its\n // own accessible name — the leading glyph is decorative (aria-hidden).\n attentionChips.push(\n <Badge\n key={key}\n variant={FLAG_VARIANT[key]}\n size=\"md\"\n leading={<FlagIcon aria-hidden=\"true\" />}\n >\n {t(`patientSummaryCard.flag.${key}`, {\n count,\n defaultValue: FLAG_LABEL_DEFAULTS[key],\n })}\n </Badge>,\n );\n });\n\n /* ---------------------------------------------------------------- */\n /* Loading skeleton */\n /* ---------------------------------------------------------------- */\n\n const skeletonBody = (\n <div className={`ds:flex ds:flex-col ${bodyGapClass}`}>\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-md)]\">\n <Skeleton variant=\"circular\" size=\"lg\" />\n <div className=\"ds:flex ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <Skeleton variant=\"text\" width=\"60%\" />\n <Skeleton variant=\"text\" width=\"40%\" />\n </div>\n </div>\n <Skeleton variant=\"text\" lines={3} />\n </div>\n );\n\n /* ---------------------------------------------------------------- */\n /* Header */\n /* ---------------------------------------------------------------- */\n\n const heading = isUrlSafe ? (\n <Link\n href={patientUrl as string}\n intent=\"default\"\n weight=\"strong\"\n onClick={onActivate}\n className={`${headingClass} ds:no-underline`}\n >\n <span id={headingId}>{headingText}</span>\n </Link>\n ) : (\n <span\n id={headingId}\n className={`${headingClass} ds:text-[color:var(--foreground)]`}\n >\n {headingText}\n </span>\n );\n\n const header = (\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-md)]\">\n <Avatar\n size={avatarSize}\n name={name}\n src={avatarUrl}\n className=\"ds:shrink-0\"\n />\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n {heading}\n {attentionChips.length > 0 || identityChips.length > 0 ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]\">\n {/* Attention flags lead, then the sex / age / dob identity chips. */}\n {attentionChips}\n {identityChips}\n </div>\n ) : null}\n </div>\n {customizable || actionSlot ? (\n <div className=\"ds:ms-auto ds:flex ds:shrink-0 ds:items-center ds:gap-[var(--spacing-xs)]\">\n {customizable && sections ? (\n <FieldVisibilityCog\n sections={sections}\n visible={fieldVisibility.visible}\n onToggleField={fieldVisibility.toggleField}\n onToggleSection={fieldVisibility.toggleSection}\n onMoveFieldOnto={fieldVisibility.moveFieldOnto}\n onReset={fieldVisibility.reset}\n />\n ) : null}\n {actionSlot}\n </div>\n ) : null}\n </div>\n );\n\n /* ---------------------------------------------------------------- */\n /* Family relations */\n /* ---------------------------------------------------------------- */\n\n const familyBlock =\n familyRelations && familyRelations.length > 0 ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <span className=\"type-label ds:text-[color:var(--muted-foreground)]\">\n {t('patientSummaryCard.label.familyRelations', {\n defaultValue: 'Family relations',\n })}\n </span>\n <div className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {familyRelations.map((rel, index) => {\n const safeUrl =\n !!rel.relatedPatient.url &&\n isSafeEntityUrl(rel.relatedPatient.url);\n const tagLabel = t('patientSummaryCard.value.familyRelation', {\n relation: rel.relation,\n name: rel.relatedPatient.name,\n defaultValue: '{{relation}}: {{name}}',\n });\n return safeUrl ? (\n <Link\n key={`${rel.relation}-${index}`}\n href={rel.relatedPatient.url as string}\n intent=\"default\"\n className=\"ds:no-underline\"\n >\n <Tag label={tagLabel} variant=\"neutral\" />\n </Link>\n ) : (\n <Tag\n key={`${rel.relation}-${index}`}\n label={tagLabel}\n variant=\"neutral\"\n />\n );\n })}\n </div>\n </div>\n ) : null;\n\n /* ---------------------------------------------------------------- */\n /* Body */\n /* ---------------------------------------------------------------- */\n\n // Field rows resolve through the SHARED model: when the consumer passes\n // `sections` (preferred), render those; otherwise wrap the legacy contact\n // rows as a single section. Either way `resolveVisibleFields` applies the\n // shared `visibleFieldOrder` preference, so the card and PatientDetails\n // always show the same fields, honouring the same per-user choice.\n const legacyFields: PatientField[] = rows.map((row) => ({\n id: row.key,\n label: row.label,\n value: row.value,\n icon: row.icon,\n }));\n const effectiveSections: PatientFieldSection[] = sections ?? [\n { id: 'contact', heading: '', fields: legacyFields },\n ];\n // With the shared `sections` model the order comes from the visibility hook\n // (so a cog reorder reflects live); legacy contact rows honour the raw\n // `visibleFieldOrder` prop.\n const order = sections ? fieldVisibility.visible : visibleFieldOrder;\n const visibleFields = resolveVisibleFields(\n effectiveSections,\n order,\n ).flatMap((resolved) => resolved.fields);\n\n const body = (\n <div className={`ds:flex ds:flex-col ${bodyGapClass}`}>\n {header}\n {visibleFields.length > 0 ? (\n // Container-queried so the fields flow into two columns when the\n // card is wide enough (the banner spans the full folder width), and\n // stay single-column in a narrow rail. The list's KeyValuePair\n // children already `col-span-3`; doubling the parent to six tracks\n // (`repeat(2, …)`) lets grid auto-flow place two fields per row while\n // each column keeps its own subgrid label/value alignment.\n // 672px, not the `@2xl` rem alias: container-query `rem` follows the\n // host root font-size, so a non-16px root moves the threshold.\n <div className=\"ds:@container/pfields\">\n <KeyValueList\n rowGap=\"sm\"\n className=\"ds:@[672px]/pfields:grid-cols-[repeat(2,auto_auto_minmax(0,1fr))]\"\n >\n {visibleFields.map((field) => (\n <KeyValuePair\n key={field.id}\n icon={field.icon ?? undefined}\n label={field.label}\n value={<FieldValue field={field} />}\n />\n ))}\n </KeyValueList>\n </div>\n ) : null}\n {familyBlock}\n </div>\n );\n\n const inner = loading ? skeletonBody : body;\n\n return (\n <div\n ref={ref}\n role=\"region\"\n // When the heading is rendered, the patient name (via\n // aria-labelledby) is the region's accessible name — the more\n // meaningful label than a generic \"Patient overview\". A consumer\n // aria-label still wins; the generic fallback only applies when\n // there is no heading to point at (loading state).\n aria-label={loading || ariaLabel ? resolvedAriaLabel : undefined}\n aria-labelledby={loading || ariaLabel ? undefined : headingId}\n aria-busy={loading || undefined}\n data-component=\"patient-summary-card\"\n data-component-id={id}\n data-density={density}\n id={id}\n className={rootVariants({ surface, density, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">\n <Card.Body>{inner}</Card.Body>\n </Card>\n ) : (\n inner\n )}\n </div>\n );\n },\n);\n\nPatientSummaryCard.displayName = 'PatientSummaryCard';\n\n/** Variant unions re-exported for downstream typing. */\nexport type PatientSummaryCardSurface = NonNullable<\n VariantProps<typeof rootVariants>['surface']\n>;\nexport type PatientSummaryCardDensity = NonNullable<\n VariantProps<typeof rootVariants>['density']\n>;\n"],"names":["__iconNode","FileExclamationPoint","createLucideIcon","MessageSquareWarning","patientSummaryCardAgent","handle","NO_SECTIONS","rootVariants","cva","normalisePhone","raw","FLAG_ICON","FLAG_VARIANT","FLAG_LABEL_DEFAULTS","MARKETING_CONSENT_DEFAULTS","PatientSummaryCard","forwardRef","name","title","ageYears","dateOfBirth","gender","avatarUrl","patientUrl","sections","visibleFieldOrder","onVisibleFieldsChange","email","emailEnabled","phone","cityProvince","marketingConsent","aiConsent","flags","familyRelations","assignedTo","currency","locale","loading","actionSlot","onActivate","surface","density","ariaLabel","id","className","rest","ref","i18n","useTranslation","headingId","useId","activeLocale","unpaidAmountCents","unsignedDocumentsCount","highlightedAnamnesisCount","hasUnpaid","useMemo","useAgentRegistration","customizable","fieldVisibility","usePatientFieldVisibility","resolvedAriaLabel","TITLE_DEFAULTS","honorific","headingText","identityChips","jsx","SexChip","AgeChip","NeutralChip","CalendarDays","isUrlSafe","isSafeEntityUrl","avatarSize","headingClass","bodyGapClass","rows","Mail","Link","Phone","jsxs","Badge","MapPin","ShieldCheck","Astroid","Users","Avatar","flagBadges","attentionChips","TransactionChip","key","count","FlagIcon","skeletonBody","Skeleton","heading","header","FieldVisibilityCog","familyBlock","rel","index","safeUrl","tagLabel","Tag","legacyFields","row","effectiveSections","order","visibleFields","resolveVisibleFields","resolved","body","KeyValueList","field","KeyValuePair","FieldValue","inner","Card"],"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;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAC7C,GACMC,KAAuBC,GAAiB,0BAA0BF,EAAU;ACpBlF;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAAA,EAC3C,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAC1C,GACMG,KAAuBD,GAAiB,0BAA0BF,EAAU,GCNrEI,KAAkE;AAAA,EAC7E,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMJ,cAAc,CAAA;AAAA,EACd,OAAO;AAAA,IACL,SAAS;AAAA,MACP,MAAM;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b,UAAA,gBAAAA;AAAA,UAAC8C;AAAA,UAAA;AAAA,YACC,QAAO;AAAA,YACP,WAAU;AAAA,YAET,UAAAJ,EAAc,IAAI,CAACK,MAClB,gBAAA/C;AAAA,cAACgD;AAAA,cAAA;AAAA,gBAEC,MAAMD,EAAM,QAAQ;AAAA,gBACpB,OAAOA,EAAM;AAAA,gBACb,OAAO,gBAAA/C,EAACiD,IAAA,EAAW,OAAAF,EAAA,CAAc;AAAA,cAAA;AAAA,cAH5BA,EAAM;AAAA,YAAA,CAKd;AAAA,UAAA;AAAA,QAAA,EACH,CACF;AAAA,UACE;AAAA,MACHf;AAAA,IAAA,GACH,GAGIkB,IAAQ/E,IAAUwD,KAAekB;AAEvC,WACE,gBAAA7C;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAApB;AAAA,QACA,MAAK;AAAA,QAML,cAAYT,KAAWK,IAAYmB,KAAoB;AAAA,QACvD,mBAAiBxB,KAAWK,IAAY,SAAYO;AAAA,QACpD,aAAWZ,KAAW;AAAA,QACtB,kBAAe;AAAA,QACf,qBAAmBM;AAAA,QACnB,gBAAcF;AAAA,QACd,IAAAE;AAAA,QACA,WAAWrC,GAAa,EAAE,SAAAkC,GAAS,SAAAC,GAAS,WAAAG,IAAW;AAAA,QACtD,GAAGC;AAAA,QAEH,UAAAL,MAAY,aACX,gBAAA0B,EAACmD,GAAA,EAAK,SAAQ,YACZ,UAAA,gBAAAnD,EAACmD,EAAK,MAAL,EAAW,UAAAD,EAAA,CAAM,EAAA,CACpB,IAEAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAtG,GAAmB,cAAc;","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"patient-summary-card-CvDxhbBR.js","sources":["../../node_modules/lucide-react/dist/esm/icons/file-exclamation-point.mjs","../../node_modules/lucide-react/dist/esm/icons/message-square-warning.mjs","../../src/components/patient-summary-card/patient-summary-card.agent.ts","../../src/components/patient-summary-card/patient-summary-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 [\n \"path\",\n {\n d: \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\",\n key: \"1oefj6\"\n }\n ],\n [\"path\", { d: \"M12 9v4\", key: \"juzpu7\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst FileExclamationPoint = createLucideIcon(\"file-exclamation-point\", __iconNode);\n\nexport { __iconNode, FileExclamationPoint as default };\n//# sourceMappingURL=file-exclamation-point.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: \"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z\",\n key: \"18887p\"\n }\n ],\n [\"path\", { d: \"M12 15h.01\", key: \"q59x07\" }],\n [\"path\", { d: \"M12 7v4\", key: \"xawao1\" }]\n];\nconst MessageSquareWarning = createLucideIcon(\"message-square-warning\", __iconNode);\n\nexport { __iconNode, MessageSquareWarning as default };\n//# sourceMappingURL=message-square-warning.mjs.map\n","import type { AgentAdapter } from '../../agent/types';\nimport type { PatientSummaryCardHandle } from './patient-summary-card';\n\n/* -------------------------------------------------------------------- */\n/* Agent adapter — PatientSummaryCard */\n/* */\n/* Read-only adapter. Surfaces a STRUCTURAL snapshot of the patient */\n/* overview — counts, flags, and the consumer id only. Never the patient */\n/* name, age, contact details, or any clinical content, so an agent / */\n/* MCP runtime can answer \"does this patient have unpaid balances / */\n/* unsigned documents / AI consent?\" without re-parsing the DOM and */\n/* without leaking PHI (PRS §Security). */\n/* -------------------------------------------------------------------- */\n\nexport const patientSummaryCardAgent: AgentAdapter<PatientSummaryCardHandle> = {\n id: 'patient-summary-card',\n // The agent surface is a structural snapshot only — the single handle method\n // is a getSummary projection. The card MAY be human-customized (the optional\n // per-context \"Customize fields\" cog), but that field reordering is a UI\n // concern and is deliberately NOT exposed as an agent action; programmatic\n // field-set control lives on PatientDetails' adapter (set_field_order).\n capabilities: [],\n state: {\n summary: {\n type: '{ id?: string; hasUnpaid: boolean; unsignedDocumentsCount: number; highlightedAnamnesisCount: number; aiConsentGranted: boolean }',\n descriptionKey: 'ui.agent.patientSummaryCard.state.summary',\n description:\n 'Structural summary of the patient card — identifiers, counts, and consent flags only. Never patient identity or clinical content.',\n read: (handle) => handle.getSummary(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'patient-summary-card',\n description: 'Marks the PatientSummaryCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n useMemo,\n type ComponentPropsWithoutRef,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n CalendarDays,\n FileExclamationPoint,\n Mail,\n MapPin,\n MessageSquareWarning,\n Phone,\n ShieldCheck,\n Astroid,\n Users,\n type LucideIcon,\n} from 'lucide-react';\nimport { Avatar } from '../avatar/avatar';\nimport { Badge } from '../badge/badge';\nimport { Card } from '../card/card';\nimport { KeyValueList, KeyValuePair } from '../key-value-pair/key-value-pair';\nimport { Link } from '../link/link';\nimport { Skeleton } from '../skeleton/skeleton';\nimport { Tag } from '../tag/tag';\nimport { TransactionChip } from '../transaction-chip/transaction-chip';\nimport { isSafeEntityUrl } from '../_shared/is-safe-url';\nimport {\n resolveVisibleFields,\n type PatientField,\n type PatientFieldSection,\n} from '../_shared/patient-fields';\nimport { usePatientFieldVisibility } from '../_shared/field-visibility';\nimport { FieldVisibilityCog } from '../_shared/field-visibility-cog';\nimport {\n AgeChip,\n FieldValue,\n NeutralChip,\n SexChip,\n} from '../_shared/field-value';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { patientSummaryCardAgent } from './patient-summary-card.agent';\n\n/** A section list reference that stays stable across renders (legacy mode). */\nconst NO_SECTIONS: PatientFieldSection[] = [];\n\n/* -------------------------------------------------------------------- */\n/* PatientSummaryCard */\n/* */\n/* The patient-overview profile card every AlfaDocs in-app surface */\n/* composes by hand today (platform patient header, alfascribe patient */\n/* sidebar, check-in landing). Templated on ContactProfileCard: composes */\n/* Card + Avatar + KeyValueList + KeyValuePair + Badge + Tag + */\n/* TransactionChip + Link so the contact rows share a column and every */\n/* row uses the same lucide icon family. */\n/* */\n/* The kit owns the ORDER, ICONS, and LABELS — consumers pass data. No */\n/* free-text clinical content (anamnesis notes, diagnoses) ever lives */\n/* here: only counts/flags/relations are surfaced, so the card stays */\n/* PHI-light and the agent state can be derived without leaking patient */\n/* identity. */\n/* */\n/* All visible text flows through `useTranslation('ui')` against the */\n/* `patientSummaryCard.*` namespace. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA — root */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva('ds:w-full ds:text-[color:var(--foreground)]', {\n variants: {\n // Matches the kit's other `surface` props (ContactProfileCard,\n // OperatorHero). `'elevated'` wraps the content in `<Card>`.\n surface: {\n flat: '',\n elevated: '',\n },\n // Density tunes the avatar size + body padding. `comfortable` reads\n // as a page header; `compact` fits an embedded sidebar / aside.\n density: {\n comfortable: '',\n compact: '',\n },\n },\n defaultVariants: {\n surface: 'elevated',\n density: 'comfortable',\n },\n});\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\n/** Patient phone number — already formatted for display by the consumer. */\nexport interface PatientSummaryCardPhone {\n /** Display string, e.g. `\"+39 055 123 4567\"`. Compiled into a `tel:` link. */\n prefixAndNumber: string;\n /** Optional label that distinguishes this number (e.g. \"Mobile\"). */\n label?: string;\n /** Whether SMS is enabled for this number — shows a small \"SMS\" chip. */\n smsEnabled?: boolean;\n}\n\n/** A family relation row — links one patient to another. */\nexport interface PatientSummaryCardFamilyRelation {\n /** Localised relation label, consumer-supplied (e.g. \"Mother\", \"Child\"). */\n relation: string;\n /** The related patient — name + optional in-app profile URL. */\n relatedPatient: {\n name: string;\n url?: string;\n };\n}\n\n/** Operator the patient is assigned to. */\nexport interface PatientSummaryCardAssignee {\n name: string;\n avatarUrl?: string;\n}\n\n/** AI-consent grant metadata — structural only, never the consented content. */\nexport interface PatientSummaryCardAiConsent {\n /** ISO-8601 / display string of when consent was granted. */\n grantedAt: string;\n /** Optional name of who recorded the grant. */\n grantedBy?: string;\n}\n\n/** Status flags rendered as glyph badges (counts / amounts only — no PHI). */\nexport interface PatientSummaryCardFlags {\n /** Number of anamnesis answers highlighted for clinical attention. */\n highlightedAnamnesisCount?: number;\n /** Outstanding balance in the smallest currency unit (cents). */\n unpaidAmountCents?: number;\n /** Number of documents awaiting the patient's signature. */\n unsignedDocumentsCount?: number;\n}\n\n/** Marketing-consent tri-state. */\nexport type PatientSummaryCardMarketingConsent = 'no' | 'yes' | 'not_specified';\n\nexport interface PatientSummaryCardHandle {\n /** Structural snapshot — identifiers and counts only, never patient identity. */\n getSummary: () => {\n id?: string;\n hasUnpaid: boolean;\n unsignedDocumentsCount: number;\n highlightedAnamnesisCount: number;\n aiConsentGranted: boolean;\n };\n}\n\nexport interface PatientSummaryCardProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children'\n> {\n /** Patient display name. Rendered as the heading. */\n name: string;\n /** Honorific — `'mr'` / `'ms'`. Prepended to the name in the heading. */\n title?: 'mr' | 'ms';\n /** Patient age in whole years — rendered in the identity line. */\n ageYears?: number;\n /** Date of birth — already formatted for display by the consumer. */\n dateOfBirth?: string;\n /** Biological sex marker — `'m'` / `'f'`. Drives the identity-line glyph copy. */\n gender?: 'm' | 'f';\n /** Optional avatar / photo URL. Falls back to initials. */\n avatarUrl?: string;\n /**\n * In-app patient profile URL. When safe, the heading becomes a link.\n * Guarded by the shared `isSafeEntityUrl` allow-list — unsafe URLs are\n * dropped and the heading renders as plain text.\n */\n patientUrl?: string;\n\n /* ----- Shared field model (preferred) ----- */\n\n /**\n * Patient fields in the shared model — the SAME `sections` shape\n * `PatientDetails` consumes (`@alfadocs/ui-kit` `PatientFieldSection`).\n * When provided, the card renders these (honouring `visibleFieldOrder`)\n * instead of the legacy contact props, so a consumer defines its patient-\n * field registry once and reuses it across every patient surface.\n *\n * The card renders each field's `label`, `value`, and `icon` only — it is\n * flat (section headings are not shown in the body) and never inline-edits;\n * `sensitive` / `copyable` / `mono` / `editable` are honoured by\n * `PatientDetails`, not the card (so the PHI lock glyph does not appear here).\n *\n * Pass `onVisibleFieldsChange` alongside `sections` to make THIS placement\n * self-curating (a \"Customize fields\" cog appears — show/hide + drag-and-drop\n * reorder).\n */\n sections?: PatientFieldSection[];\n /**\n * Ordered visible field ids for THIS placement. The order is a\n * per-INSTANCE, per-CONTEXT preference the kit never persists — wire it to\n * whatever scope the consumer wants (e.g. a global per-user setting, or a\n * different config in the care-plan view vs the patient folder). The same\n * field vocabulary can therefore display differently in different parts of\n * the app. Omit (`undefined`) ⇒ show every field; an explicit empty array\n * `[]` ⇒ show none (a card that starts collapsed to name + identity chips and\n * reveals fields via the cog). Also applied to the legacy contact rows (ids\n * `email` / `phone` / `cityProvince` / `marketingConsent` / `aiConsent` /\n * `assignedTo`).\n */\n visibleFieldOrder?: string[];\n /**\n * Make this card's field set user-customizable. When provided alongside\n * `sections`, a \"Customize fields\" cog renders in the header (show/hide +\n * drag-and-drop / Alt+Arrow reorder), and this fires with the next ordered\n * visible set. The consumer owns persistence + its scope — editing here\n * writes only THIS context's preference, never a shared/global one.\n */\n onVisibleFieldsChange?: (orderedIds: string[]) => void;\n\n /* ----- Contact rows (legacy — prefer `sections`) ----- */\n\n /** @deprecated Pass via `sections`. Patient email — `mailto:` link when `emailEnabled`. */\n email?: string;\n /** Whether email contact is enabled — gates the `mailto:` link. */\n emailEnabled?: boolean;\n /** Phone number block. Compiled into a `tel:` link. */\n phone?: PatientSummaryCardPhone;\n /** City / province display string. */\n cityProvince?: string;\n\n /* ----- Consent ----- */\n\n /** Marketing-consent tri-state. */\n marketingConsent?: PatientSummaryCardMarketingConsent;\n /** AI-consent grant metadata. When present, an \"AI consent\" row renders. */\n aiConsent?: PatientSummaryCardAiConsent;\n\n /* ----- Status flags ----- */\n\n /** Counts / amounts surfaced as glyph badges. */\n flags?: PatientSummaryCardFlags;\n\n /* ----- Relations & assignment ----- */\n\n /** Family relations — rendered as `<Tag>` chips, optionally linked. */\n familyRelations?: PatientSummaryCardFamilyRelation[];\n /** Operator the patient is assigned to. */\n assignedTo?: PatientSummaryCardAssignee;\n\n /* ----- Formatting ----- */\n\n /** ISO-4217 currency code for the unpaid-amount chip. Defaults to `EUR`. */\n currency?: string;\n /** BCP-47 locale override. Defaults to the active i18next language. */\n locale?: string;\n\n /* ----- States ----- */\n\n /** Render the skeleton loading placeholder. */\n loading?: boolean;\n\n /* ----- Slots & callbacks ----- */\n\n /** Rendered at the inline-end of the heading row (e.g. an action menu). */\n actionSlot?: ReactNode;\n /** Fires when the whole card / heading is activated. */\n onActivate?: () => void;\n\n /* ----- Styling ----- */\n\n /** `'elevated'` (default) wraps in `<Card>`; `'flat'` drops the chrome. */\n surface?: 'flat' | 'elevated';\n /** `'comfortable'` (default) reads as a header; `'compact'` for asides. */\n density?: 'comfortable' | 'compact';\n\n /* ----- a11y ----- */\n\n /** Override the default region aria-label. */\n 'aria-label'?: string;\n /** Agent-readiness consumer id, surfaced as `data-component-id`. */\n id?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n/** Strip everything except digits + leading `+` for `tel:` URLs. */\nfunction normalisePhone(raw: string): string {\n return raw.replace(/[^\\d+]/g, '');\n}\n\n/* -------------------------------------------------------------------- */\n/* Flag glyphs — the closed set of status indicators */\n/* -------------------------------------------------------------------- */\n\n/** The closed set of status-flag keys (icon + tonal variant defined below). */\ntype FlagKey = 'highlightedAnamnesis' | 'unsignedDocuments';\n\nconst FLAG_ICON: Record<FlagKey, LucideIcon> = {\n highlightedAnamnesis: MessageSquareWarning,\n unsignedDocuments: FileExclamationPoint,\n};\n\nconst FLAG_VARIANT: Record<FlagKey, 'warning' | 'error'> = {\n highlightedAnamnesis: 'warning',\n unsignedDocuments: 'error',\n};\n\n/** English fallbacks for the flag badge accessible names (count-interpolated). */\nconst FLAG_LABEL_DEFAULTS: Record<FlagKey, string> = {\n highlightedAnamnesis: '{{count}} highlighted anamnesis answers',\n unsignedDocuments: '{{count}} unsigned documents',\n};\n\n/** English fallbacks for the marketing-consent tri-state chip. */\nconst MARKETING_CONSENT_DEFAULTS: Record<\n PatientSummaryCardMarketingConsent,\n string\n> = {\n yes: 'Yes',\n no: 'No',\n not_specified: 'Not specified',\n};\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const PatientSummaryCard = forwardRef<\n HTMLDivElement,\n PatientSummaryCardProps\n>(\n (\n {\n name,\n title,\n ageYears,\n dateOfBirth,\n gender,\n avatarUrl,\n patientUrl,\n sections,\n visibleFieldOrder,\n onVisibleFieldsChange,\n email,\n emailEnabled = false,\n phone,\n cityProvince,\n marketingConsent,\n aiConsent,\n flags,\n familyRelations,\n assignedTo,\n currency = 'EUR',\n locale,\n loading = false,\n actionSlot,\n onActivate,\n surface = 'elevated',\n density = 'comfortable',\n 'aria-label': ariaLabel,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const headingId = useId();\n const activeLocale = locale ?? i18n.language ?? 'en';\n\n const unpaidAmountCents = flags?.unpaidAmountCents;\n const unsignedDocumentsCount = flags?.unsignedDocumentsCount ?? 0;\n const highlightedAnamnesisCount = flags?.highlightedAnamnesisCount ?? 0;\n const hasUnpaid = unpaidAmountCents != null && unpaidAmountCents > 0;\n\n // Imperative handle — structural snapshot only (counts/flags/ids),\n // never the patient name or any clinical content.\n const handle = useMemo<PatientSummaryCardHandle>(\n () => ({\n getSummary: () => ({\n id,\n hasUnpaid,\n unsignedDocumentsCount,\n highlightedAnamnesisCount,\n aiConsentGranted: aiConsent != null,\n }),\n }),\n [\n id,\n hasUnpaid,\n unsignedDocumentsCount,\n highlightedAnamnesisCount,\n aiConsent,\n ],\n );\n useAgentRegistration(patientSummaryCardAgent, handle, id);\n\n // Per-context field visibility. The cog (and live reordering) only engages\n // with the shared `sections` model AND an `onVisibleFieldsChange` handler;\n // legacy contact-prop cards stay read-only. The order is this placement's\n // own preference — never shared across surfaces.\n const customizable = !!sections && !!onVisibleFieldsChange;\n const fieldVisibility = usePatientFieldVisibility(sections ?? NO_SECTIONS, {\n value: visibleFieldOrder,\n onChange: onVisibleFieldsChange,\n });\n\n const resolvedAriaLabel =\n ariaLabel ??\n t('patientSummaryCard.regionLabel', { defaultValue: 'Patient overview' });\n\n // Heading text: optional honorific prefix + name.\n const TITLE_DEFAULTS: Record<'mr' | 'ms', string> = {\n mr: 'Mr.',\n ms: 'Ms.',\n };\n const honorific = title\n ? t(`patientSummaryCard.title.${title}`, {\n defaultValue: TITLE_DEFAULTS[title],\n })\n : undefined;\n const headingText = honorific ? `${honorific} ${name}` : name;\n\n // Identity line: the canonical sex / age / dob chips below the name — the\n // SAME chips the field model renders, so the header and the field rows\n // agree. Each chip is added only when its prop is present. (`dateOfBirth`\n // is a consumer-preformatted display string, so it goes through NeutralChip\n // directly rather than the date-parsing `dob` kind.)\n const identityChips: ReactNode[] = [];\n if (gender) {\n identityChips.push(<SexChip key=\"sex\" code={gender} />);\n }\n if (ageYears != null) {\n identityChips.push(<AgeChip key=\"age\" years={ageYears} />);\n }\n if (dateOfBirth) {\n identityChips.push(\n <NeutralChip key=\"dob\" icon={<CalendarDays />}>\n {dateOfBirth}\n </NeutralChip>,\n );\n }\n\n const isUrlSafe = !!patientUrl && isSafeEntityUrl(patientUrl);\n\n const avatarSize = density === 'comfortable' ? 'xl' : 'lg';\n const headingClass =\n density === 'comfortable' ? 'type-title-card' : 'type-title-item';\n const bodyGapClass =\n density === 'comfortable'\n ? 'ds:gap-[var(--spacing-md)]'\n : 'ds:gap-[var(--spacing-sm)]';\n\n /* ---------------------------------------------------------------- */\n /* Contact rows */\n /* ---------------------------------------------------------------- */\n\n const rows: Array<{\n key: string;\n icon: ReactElement;\n label: string;\n value: ReactNode;\n }> = [];\n\n if (email) {\n rows.push({\n key: 'email',\n icon: <Mail aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.email', { defaultValue: 'Email' }),\n value: emailEnabled ? (\n <Link href={`mailto:${email}`} intent=\"default\" onClick={onActivate}>\n {email}\n </Link>\n ) : (\n <span className=\"ds:text-[color:var(--muted-foreground)]\">\n {email}\n </span>\n ),\n });\n }\n\n if (phone) {\n rows.push({\n key: 'phone',\n icon: <Phone aria-hidden=\"true\" />,\n label:\n phone.label ??\n t('patientSummaryCard.label.phone', { defaultValue: 'Phone' }),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-2xs)]\">\n <Link\n href={`tel:${normalisePhone(phone.prefixAndNumber)}`}\n intent=\"default\"\n >\n {phone.prefixAndNumber}\n </Link>\n {phone.smsEnabled ? (\n <Badge variant=\"success\" size=\"sm\">\n {t('patientSummaryCard.value.smsEnabled', {\n defaultValue: 'SMS',\n })}\n </Badge>\n ) : null}\n </span>\n ),\n });\n }\n\n if (cityProvince) {\n rows.push({\n key: 'cityProvince',\n icon: <MapPin aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.cityProvince', {\n defaultValue: 'City / province',\n }),\n value: cityProvince,\n });\n }\n\n if (marketingConsent) {\n rows.push({\n key: 'marketingConsent',\n icon: <ShieldCheck aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.marketingConsent', {\n defaultValue: 'Marketing consent',\n }),\n value: (\n <Badge\n variant={\n marketingConsent === 'yes'\n ? 'success'\n : marketingConsent === 'no'\n ? 'error'\n : 'neutral'\n }\n size=\"sm\"\n withDot\n >\n {t(`patientSummaryCard.marketingConsent.${marketingConsent}`, {\n defaultValue: MARKETING_CONSENT_DEFAULTS[marketingConsent],\n })}\n </Badge>\n ),\n });\n }\n\n if (aiConsent) {\n rows.push({\n key: 'aiConsent',\n icon: <Astroid aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.aiConsent', {\n defaultValue: 'AI consent',\n }),\n value: aiConsent.grantedBy\n ? t('patientSummaryCard.value.aiConsentGrantedBy', {\n date: aiConsent.grantedAt,\n by: aiConsent.grantedBy,\n defaultValue: 'Granted {{date}} by {{by}}',\n })\n : t('patientSummaryCard.value.aiConsentGrantedAt', {\n date: aiConsent.grantedAt,\n defaultValue: 'Granted {{date}}',\n }),\n });\n }\n\n if (assignedTo) {\n rows.push({\n key: 'assignedTo',\n icon: <Users aria-hidden=\"true\" />,\n label: t('patientSummaryCard.label.assignedTo', {\n defaultValue: 'Assigned to',\n }),\n value: (\n <span className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <Avatar\n size=\"xs\"\n name={assignedTo.name}\n src={assignedTo.avatarUrl}\n />\n <span>{assignedTo.name}</span>\n </span>\n ),\n });\n }\n\n /* ---------------------------------------------------------------- */\n /* Attention-flag chips (VERBOSE — shown in the identity line) */\n /* */\n /* The unpaid balance + warning counts sit in the chip row under the */\n /* name, BEFORE the sex / age chips, each as a self-describing chip */\n /* (\"2 unsigned documents\") rather than a collapsed count badge in a */\n /* separate strip — the attention signals lead the patient's chips. */\n /* ---------------------------------------------------------------- */\n\n const flagBadges: Array<{ key: FlagKey; count: number }> = [];\n if (highlightedAnamnesisCount > 0) {\n flagBadges.push({\n key: 'highlightedAnamnesis',\n count: highlightedAnamnesisCount,\n });\n }\n if (unsignedDocumentsCount > 0) {\n flagBadges.push({\n key: 'unsignedDocuments',\n count: unsignedDocumentsCount,\n });\n }\n\n const attentionChips: ReactNode[] = [];\n if (hasUnpaid) {\n attentionChips.push(\n <TransactionChip\n key=\"unpaid\"\n state=\"debt\"\n amount={(unpaidAmountCents as number) / 100}\n currency={currency}\n locale={activeLocale}\n size=\"md\"\n showLabel\n />,\n );\n }\n flagBadges.forEach(({ key, count }) => {\n const FlagIcon = FLAG_ICON[key];\n // The Badge's visible text IS the count-interpolated label, so it's its\n // own accessible name — the leading glyph is decorative (aria-hidden).\n attentionChips.push(\n <Badge\n key={key}\n variant={FLAG_VARIANT[key]}\n size=\"md\"\n leading={<FlagIcon aria-hidden=\"true\" />}\n >\n {t(`patientSummaryCard.flag.${key}`, {\n count,\n defaultValue: FLAG_LABEL_DEFAULTS[key],\n })}\n </Badge>,\n );\n });\n\n /* ---------------------------------------------------------------- */\n /* Loading skeleton */\n /* ---------------------------------------------------------------- */\n\n const skeletonBody = (\n <div className={`ds:flex ds:flex-col ${bodyGapClass}`}>\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-md)]\">\n <Skeleton variant=\"circular\" size=\"lg\" />\n <div className=\"ds:flex ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <Skeleton variant=\"text\" width=\"60%\" />\n <Skeleton variant=\"text\" width=\"40%\" />\n </div>\n </div>\n <Skeleton variant=\"text\" lines={3} />\n </div>\n );\n\n /* ---------------------------------------------------------------- */\n /* Header */\n /* ---------------------------------------------------------------- */\n\n const heading = isUrlSafe ? (\n <Link\n href={patientUrl as string}\n intent=\"default\"\n weight=\"strong\"\n onClick={onActivate}\n className={`${headingClass} ds:no-underline`}\n >\n <span id={headingId}>{headingText}</span>\n </Link>\n ) : (\n <span\n id={headingId}\n className={`${headingClass} ds:text-[color:var(--foreground)]`}\n >\n {headingText}\n </span>\n );\n\n const header = (\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-md)]\">\n <Avatar\n size={avatarSize}\n name={name}\n src={avatarUrl}\n className=\"ds:shrink-0\"\n />\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n {heading}\n {attentionChips.length > 0 || identityChips.length > 0 ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]\">\n {/* Attention flags lead, then the sex / age / dob identity chips. */}\n {attentionChips}\n {identityChips}\n </div>\n ) : null}\n </div>\n {customizable || actionSlot ? (\n <div className=\"ds:ms-auto ds:flex ds:shrink-0 ds:items-center ds:gap-[var(--spacing-xs)]\">\n {customizable && sections ? (\n <FieldVisibilityCog\n sections={sections}\n visible={fieldVisibility.visible}\n onToggleField={fieldVisibility.toggleField}\n onToggleSection={fieldVisibility.toggleSection}\n onMoveFieldOnto={fieldVisibility.moveFieldOnto}\n onReset={fieldVisibility.reset}\n />\n ) : null}\n {actionSlot}\n </div>\n ) : null}\n </div>\n );\n\n /* ---------------------------------------------------------------- */\n /* Family relations */\n /* ---------------------------------------------------------------- */\n\n const familyBlock =\n familyRelations && familyRelations.length > 0 ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <span className=\"type-label ds:text-[color:var(--muted-foreground)]\">\n {t('patientSummaryCard.label.familyRelations', {\n defaultValue: 'Family relations',\n })}\n </span>\n <div className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {familyRelations.map((rel, index) => {\n const safeUrl =\n !!rel.relatedPatient.url &&\n isSafeEntityUrl(rel.relatedPatient.url);\n const tagLabel = t('patientSummaryCard.value.familyRelation', {\n relation: rel.relation,\n name: rel.relatedPatient.name,\n defaultValue: '{{relation}}: {{name}}',\n });\n return safeUrl ? (\n <Link\n key={`${rel.relation}-${index}`}\n href={rel.relatedPatient.url as string}\n intent=\"default\"\n className=\"ds:no-underline\"\n >\n <Tag label={tagLabel} variant=\"neutral\" />\n </Link>\n ) : (\n <Tag\n key={`${rel.relation}-${index}`}\n label={tagLabel}\n variant=\"neutral\"\n />\n );\n })}\n </div>\n </div>\n ) : null;\n\n /* ---------------------------------------------------------------- */\n /* Body */\n /* ---------------------------------------------------------------- */\n\n // Field rows resolve through the SHARED model: when the consumer passes\n // `sections` (preferred), render those; otherwise wrap the legacy contact\n // rows as a single section. Either way `resolveVisibleFields` applies the\n // shared `visibleFieldOrder` preference, so the card and PatientDetails\n // always show the same fields, honouring the same per-user choice.\n const legacyFields: PatientField[] = rows.map((row) => ({\n id: row.key,\n label: row.label,\n value: row.value,\n icon: row.icon,\n }));\n const effectiveSections: PatientFieldSection[] = sections ?? [\n { id: 'contact', heading: '', fields: legacyFields },\n ];\n // With the shared `sections` model the order comes from the visibility hook\n // (so a cog reorder reflects live); legacy contact rows honour the raw\n // `visibleFieldOrder` prop.\n const order = sections ? fieldVisibility.visible : visibleFieldOrder;\n const visibleFields = resolveVisibleFields(\n effectiveSections,\n order,\n ).flatMap((resolved) => resolved.fields);\n\n const body = (\n <div className={`ds:flex ds:flex-col ${bodyGapClass}`}>\n {header}\n {visibleFields.length > 0 ? (\n // Container-queried so the fields flow into two columns when the\n // card is wide enough (the banner spans the full folder width), and\n // stay single-column in a narrow rail. The list's KeyValuePair\n // children already `col-span-3`; doubling the parent to six tracks\n // (`repeat(2, …)`) lets grid auto-flow place two fields per row while\n // each column keeps its own subgrid label/value alignment.\n // 672px, not the `@2xl` rem alias: container-query `rem` follows the\n // host root font-size, so a non-16px root moves the threshold.\n <div className=\"ds:@container/pfields\">\n <KeyValueList\n rowGap=\"sm\"\n className=\"ds:@[672px]/pfields:grid-cols-[repeat(2,auto_auto_minmax(0,1fr))]\"\n >\n {visibleFields.map((field) => (\n <KeyValuePair\n key={field.id}\n icon={field.icon ?? undefined}\n label={field.label}\n value={<FieldValue field={field} />}\n />\n ))}\n </KeyValueList>\n </div>\n ) : null}\n {familyBlock}\n </div>\n );\n\n const inner = loading ? skeletonBody : body;\n\n return (\n <div\n ref={ref}\n role=\"region\"\n // When the heading is rendered, the patient name (via\n // aria-labelledby) is the region's accessible name — the more\n // meaningful label than a generic \"Patient overview\". A consumer\n // aria-label still wins; the generic fallback only applies when\n // there is no heading to point at (loading state).\n aria-label={loading || ariaLabel ? resolvedAriaLabel : undefined}\n aria-labelledby={loading || ariaLabel ? undefined : headingId}\n aria-busy={loading || undefined}\n data-component=\"patient-summary-card\"\n data-component-id={id}\n data-density={density}\n id={id}\n className={rootVariants({ surface, density, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">\n <Card.Body>{inner}</Card.Body>\n </Card>\n ) : (\n inner\n )}\n </div>\n );\n },\n);\n\nPatientSummaryCard.displayName = 'PatientSummaryCard';\n\n/** Variant unions re-exported for downstream typing. */\nexport type PatientSummaryCardSurface = NonNullable<\n VariantProps<typeof rootVariants>['surface']\n>;\nexport type PatientSummaryCardDensity = NonNullable<\n VariantProps<typeof rootVariants>['density']\n>;\n"],"names":["__iconNode","FileExclamationPoint","createLucideIcon","MessageSquareWarning","patientSummaryCardAgent","handle","NO_SECTIONS","rootVariants","cva","normalisePhone","raw","FLAG_ICON","FLAG_VARIANT","FLAG_LABEL_DEFAULTS","MARKETING_CONSENT_DEFAULTS","PatientSummaryCard","forwardRef","name","title","ageYears","dateOfBirth","gender","avatarUrl","patientUrl","sections","visibleFieldOrder","onVisibleFieldsChange","email","emailEnabled","phone","cityProvince","marketingConsent","aiConsent","flags","familyRelations","assignedTo","currency","locale","loading","actionSlot","onActivate","surface","density","ariaLabel","id","className","rest","ref","i18n","useTranslation","headingId","useId","activeLocale","unpaidAmountCents","unsignedDocumentsCount","highlightedAnamnesisCount","hasUnpaid","useMemo","useAgentRegistration","customizable","fieldVisibility","usePatientFieldVisibility","resolvedAriaLabel","TITLE_DEFAULTS","honorific","headingText","identityChips","jsx","SexChip","AgeChip","NeutralChip","CalendarDays","isUrlSafe","isSafeEntityUrl","avatarSize","headingClass","bodyGapClass","rows","Mail","Link","Phone","jsxs","Badge","MapPin","ShieldCheck","Astroid","Users","Avatar","flagBadges","attentionChips","TransactionChip","key","count","FlagIcon","skeletonBody","Skeleton","heading","header","FieldVisibilityCog","familyBlock","rel","index","safeUrl","tagLabel","Tag","legacyFields","row","effectiveSections","order","visibleFields","resolveVisibleFields","resolved","body","KeyValueList","field","KeyValuePair","FieldValue","inner","Card"],"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;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAC7C,GACMC,KAAuBC,GAAiB,0BAA0BF,EAAU;ACpBlF;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAAA,EAC3C,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAC1C,GACMG,KAAuBD,GAAiB,0BAA0BF,EAAU,GCNrEI,KAAkE;AAAA,EAC7E,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMJ,cAAc,CAAA;AAAA,EACd,OAAO;AAAA,IACL,SAAS;AAAA,MACP,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,WAAA;AAAA,IAAW;AAAA,EACtC;AAAA,EAEF,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MAC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;AAAA,gBACpB,OAAOA,EAAM;AAAA,gBACb,OAAO,gBAAA/C,EAACiD,IAAA,EAAW,OAAAF,EAAA,CAAc;AAAA,cAAA;AAAA,cAH5BA,EAAM;AAAA,YAAA,CAKd;AAAA,UAAA;AAAA,QAAA,EACH,CACF;AAAA,UACE;AAAA,MACHf;AAAA,IAAA,GACH,GAGIkB,IAAQ/E,IAAUwD,KAAekB;AAEvC,WACE,gBAAA7C;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAApB;AAAA,QACA,MAAK;AAAA,QAML,cAAYT,KAAWK,IAAYmB,KAAoB;AAAA,QACvD,mBAAiBxB,KAAWK,IAAY,SAAYO;AAAA,QACpD,aAAWZ,KAAW;AAAA,QACtB,kBAAe;AAAA,QACf,qBAAmBM;AAAA,QACnB,gBAAcF;AAAA,QACd,IAAAE;AAAA,QACA,WAAWrC,GAAa,EAAE,SAAAkC,GAAS,SAAAC,GAAS,WAAAG,IAAW;AAAA,QACtD,GAAGC;AAAA,QAEH,UAAAL,MAAY,aACX,gBAAA0B,EAACmD,GAAA,EAAK,SAAQ,YACZ,UAAA,gBAAAnD,EAACmD,EAAK,MAAL,EAAW,UAAAD,EAAA,CAAM,EAAA,CACpB,IAEAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAtG,GAAmB,cAAc;","x_google_ignoreList":[0,1]}
@@ -5,7 +5,7 @@ import { useTranslation as M } from "react-i18next";
5
5
  import { B as O } from "./badge-sTusUqZD.js";
6
6
  import { C as D } from "./card-DPmk26CL.js";
7
7
  import { D as d } from "./description-list-CjJqR8WK.js";
8
- import { K as Y, a as H } from "./key-value-pair-BubG4fUa.js";
8
+ import { K as Y, a as H } from "./key-value-pair-BIBdZBLg.js";
9
9
  import { T as j, A as ae } from "./transaction-chip-DJCstquX.js";
10
10
  import { u as W } from "./registry-DvAUVLHh.js";
11
11
  import { H as te } from "./hash-CSQ9SChR.js";
@@ -438,4 +438,4 @@ export {
438
438
  Ce as b,
439
439
  me as p
440
440
  };
441
- //# sourceMappingURL=payment-request-card-YVCcCZ25.js.map
441
+ //# sourceMappingURL=payment-request-card-lmKLwsDs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"payment-request-card-YVCcCZ25.js","sources":["../../src/components/payment-card/payment-card.agent.ts","../../src/components/payment-card/payment-card.tsx","../../src/components/payment-card/payment-request-card.agent.ts","../../src/components/payment-card/payment-request-card.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — PaymentCard. */\n/* */\n/* Read-only financial-record surface. Exposes the payment number */\n/* (identifier) and the resolved headline state (structural) — never */\n/* patient / operator names or any other PHI. No actions: the card is a */\n/* passive presentation surface. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { PaymentCardHandle } from './payment-card';\n\nexport const paymentCardAgent: AgentAdapter<PaymentCardHandle> = {\n id: 'payment-card',\n capabilities: [],\n state: {\n number: {\n type: 'string',\n descriptionKey: 'ui.agent.paymentCard.state.number',\n description: 'Payment number / reference currently rendered.',\n read: (handle) => handle.getNumber(),\n },\n state: {\n type: \"'debt' | 'to-invoice' | 'settled'\",\n descriptionKey: 'ui.agent.paymentCard.state.state',\n description:\n 'Resolved headline financial state. Structural state only — never patient identity.',\n read: (handle) => handle.getState(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'payment-card',\n description: 'Marks the PaymentCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop. Addresses a specific card.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n useMemo,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n ArrowDownLeft,\n ArrowUpRight,\n CalendarDays,\n FileText,\n Hash,\n ReceiptEuro,\n User,\n UserCog,\n} from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Card } from '../card/card';\nimport { DescriptionList } from '../description-list/description-list';\nimport { KeyValueList, KeyValuePair } from '../key-value-pair/key-value-pair';\nimport { TransactionChip } from '../transaction-chip/transaction-chip';\nimport { entitySurfaceVariants } from '../_shared/entity-card';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { paymentCardAgent } from './payment-card.agent';\n\n/* -------------------------------------------------------------------- */\n/* PaymentCard */\n/* */\n/* Financial-record card for a single payment / receipt. Replaces the */\n/* hand-rolled \"Pagamento\" / payment-row cards that the platform's */\n/* care-plan and patient-ledger surfaces compose today. Composes */\n/* TransactionChip (the settled/debt/to-invoice headline) + KeyValueList */\n/* (number, date, type, direction, relations) + DescriptionList (line */\n/* items) + Badge (the payment type). */\n/* */\n/* The component owns the ORDER, ICONS, and LABELS; the consumer passes */\n/* the data. Every visible string flows through `useTranslation('ui')` */\n/* against the `paymentCard.*` namespace. The agent state slot exposes */\n/* identifiers + structural state only — never patient names. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* Vocabulary */\n/* -------------------------------------------------------------------- */\n\n/** Payment type → translation-key segment + Badge variant. */\nexport type PaymentType = 'full' | 'partial' | 'credit' | 'proforma' | 'other';\n\nexport type PaymentDirection = 'incoming' | 'outgoing';\n\ntype BadgeVariant = NonNullable<\n ComponentPropsWithoutRef<typeof Badge>['variant']\n>;\n\nconst PAYMENT_TYPE_BADGE = {\n full: 'success',\n partial: 'warning',\n credit: 'info',\n proforma: 'neutral',\n other: 'neutral',\n} as const satisfies Record<PaymentType, BadgeVariant>;\n\nconst DEFAULT_CURRENCY = 'EUR';\n\n// Inline English fallbacks — belt-and-braces only. The canonical keys\n// live in the locale bundle (`ui.paymentCard.*`); these guard against a\n// stale / not-yet-wired bundle so the card never renders a raw key.\nconst TYPE_DEFAULTS: Record<PaymentType, string> = {\n full: 'Full payment',\n partial: 'Partial payment',\n credit: 'Credit note',\n proforma: 'Proforma',\n other: 'Other',\n};\n\nconst DIRECTION_DEFAULTS: Record<PaymentDirection, string> = {\n incoming: 'Incoming',\n outgoing: 'Outgoing',\n};\n\n/* -------------------------------------------------------------------- */\n/* CVA — root */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva('ds:w-full ds:text-[color:var(--foreground)]', {\n variants: {\n surface: {\n flat: '',\n elevated: '',\n },\n },\n defaultVariants: { surface: 'elevated' },\n});\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\nexport interface PaymentLineItem {\n /** Human-readable description of the line. */\n description: string;\n /** Amount in the smallest currency unit (cents / centesimi). */\n amountCents: number;\n /** Optional VAT percentage (e.g. `22` for 22%). */\n vatPercentage?: number;\n}\n\nexport interface PaymentCardRelations {\n /** Care-plan / treatment-plan number this payment belongs to. */\n carePlanNumber?: string;\n /** Patient display name — rendered, but never exposed to the agent. */\n patientName?: string;\n /** Operator display name — rendered, but never exposed to the agent. */\n operatorName?: string;\n}\n\nexport interface PaymentCardHandle {\n /** Stable payment number currently rendered. Identifier only — no PHI. */\n getNumber: () => string;\n /** Resolved headline financial state. Structural state only. */\n getState: () => TransactionStateValue;\n}\n\n/** The TransactionChip state this card resolves the payment to. */\ntype TransactionStateValue = 'debt' | 'to-invoice' | 'settled';\n\nexport interface PaymentCardProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children'\n> {\n /** Agent-readiness consumer id, surfaced as `data-component-id`. */\n id?: string;\n /** Human-readable payment number / reference. Rendered as the heading. */\n number: string;\n /** ISO-8601 date string for the payment date. */\n dateIso?: string;\n /** Payment type — drives the type Badge + label. */\n type: PaymentType;\n /** Money flow direction — incoming (patient → practice) or outgoing. */\n direction: PaymentDirection;\n /** Gross total in the smallest currency unit (cents). */\n grossCents?: number;\n /** Amount already paid, in cents. */\n paidCents?: number;\n /** Amount still outstanding, in cents. */\n unpaidCents?: number;\n /** Marks the record as written-off — renders a neutral chip. */\n writtenOff?: boolean;\n /** Linked entities (care plan / patient / operator). */\n relations?: PaymentCardRelations;\n /** Itemised breakdown rendered as a DescriptionList. */\n lineItems?: PaymentLineItem[];\n /** BCP-47 locale override. Falls back to the active i18next language. */\n locale?: string;\n /** ISO-4217 currency code. Defaults to `EUR`. */\n currency?: string;\n\n /* ----- Styling ----- */\n\n /**\n * `'elevated'` (default) wraps in `<Card variant=\"elevated\">`. `'flat'`\n * drops the Card — use inside an existing card / sheet.\n */\n surface?: 'flat' | 'elevated';\n\n /* ----- a11y ----- */\n\n /** Override the default region aria-label. */\n 'aria-label'?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n/** Format cents → currency string for the consumer's locale. */\nfunction formatMoney(cents: number, currency: string, locale: string): string {\n try {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n }).format(cents / 100);\n } catch {\n return (cents / 100).toFixed(2);\n }\n}\n\n/** Format an ISO date for the consumer's locale, gracefully degrading. */\nfunction formatDate(iso: string, locale: string): string {\n const date = new Date(iso);\n if (Number.isNaN(date.getTime())) return iso;\n try {\n return new Intl.DateTimeFormat(locale, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n }).format(date);\n } catch {\n return iso;\n }\n}\n\n/**\n * Resolve the headline TransactionChip state from the paid / unpaid /\n * written-off inputs. Written-off → settled chip; an outstanding balance\n * → debt; a proforma with nothing paid → to-invoice; otherwise settled.\n */\nfunction resolveState(\n type: PaymentType,\n paidCents: number | undefined,\n unpaidCents: number | undefined,\n writtenOff: boolean | undefined,\n): TransactionStateValue {\n if (writtenOff) return 'settled';\n if (unpaidCents != null && unpaidCents > 0) return 'debt';\n if (type === 'proforma' && (paidCents == null || paidCents === 0)) {\n return 'to-invoice';\n }\n return 'settled';\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const PaymentCard = forwardRef<HTMLDivElement, PaymentCardProps>(\n (\n {\n id,\n number,\n dateIso,\n type,\n direction,\n grossCents,\n paidCents,\n unpaidCents,\n writtenOff = false,\n relations,\n lineItems,\n locale,\n currency = DEFAULT_CURRENCY,\n surface = 'elevated',\n 'aria-label': ariaLabel,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const headingId = useId();\n const activeLocale = locale ?? i18n.language ?? 'en';\n\n const resolvedAriaLabel =\n ariaLabel ??\n t('paymentCard.regionLabel', {\n number,\n defaultValue: 'Payment {{number}}',\n });\n\n const state = resolveState(type, paidCents, unpaidCents, writtenOff);\n\n // The chip headline reflects the most informative figure: the\n // outstanding balance when there's a debt, otherwise the gross total.\n const chipAmountCents =\n state === 'debt' && unpaidCents != null\n ? unpaidCents\n : (grossCents ?? paidCents ?? unpaidCents ?? 0);\n\n useAgentRegistration(\n paymentCardAgent,\n {\n getNumber: () => number,\n getState: () => state,\n },\n id,\n );\n\n const typeLabel = t(`paymentCard.type.${type}`, {\n defaultValue: TYPE_DEFAULTS[type],\n });\n const directionIcon =\n direction === 'incoming' ? (\n <ArrowDownLeft aria-hidden=\"true\" />\n ) : (\n <ArrowUpRight aria-hidden=\"true\" />\n );\n const directionLabel = t(`paymentCard.direction.${direction}`, {\n defaultValue: DIRECTION_DEFAULTS[direction],\n });\n\n // Compose the metadata rows in display order. Omitting a field omits\n // the row — KeyValueList collapses the subgrid cleanly.\n const rows: Array<{\n key: string;\n icon: ReactNode;\n label: string;\n value: ReactNode;\n }> = [];\n\n rows.push({\n key: 'number',\n icon: <Hash aria-hidden=\"true\" />,\n label: t('paymentCard.label.number', 'Number'),\n value: number,\n });\n\n if (dateIso) {\n rows.push({\n key: 'date',\n icon: <CalendarDays aria-hidden=\"true\" />,\n label: t('paymentCard.label.date', 'Date'),\n value: formatDate(dateIso, activeLocale),\n });\n }\n\n rows.push({\n key: 'type',\n icon: <ReceiptEuro aria-hidden=\"true\" />,\n label: t('paymentCard.label.type', 'Type'),\n value: <Badge variant={PAYMENT_TYPE_BADGE[type]}>{typeLabel}</Badge>,\n });\n\n rows.push({\n key: 'direction',\n icon: directionIcon,\n label: t('paymentCard.label.direction', 'Direction'),\n value: directionLabel,\n });\n\n if (relations?.carePlanNumber) {\n rows.push({\n key: 'carePlan',\n icon: <FileText aria-hidden=\"true\" />,\n label: t('paymentCard.label.carePlan', 'Care plan'),\n value: relations.carePlanNumber,\n });\n }\n\n if (relations?.patientName) {\n rows.push({\n key: 'patient',\n icon: <User aria-hidden=\"true\" />,\n label: t('paymentCard.label.patient', 'Patient'),\n value: relations.patientName,\n });\n }\n\n if (relations?.operatorName) {\n rows.push({\n key: 'operator',\n icon: <UserCog aria-hidden=\"true\" />,\n label: t('paymentCard.label.operator', 'Operator'),\n value: relations.operatorName,\n });\n }\n\n const formattedGross = useMemo(\n () =>\n grossCents != null\n ? formatMoney(grossCents, currency, activeLocale)\n : undefined,\n [grossCents, currency, activeLocale],\n );\n const formattedPaid = useMemo(\n () =>\n paidCents != null\n ? formatMoney(paidCents, currency, activeLocale)\n : undefined,\n [paidCents, currency, activeLocale],\n );\n const formattedUnpaid = useMemo(\n () =>\n unpaidCents != null\n ? formatMoney(unpaidCents, currency, activeLocale)\n : undefined,\n [unpaidCents, currency, activeLocale],\n );\n\n const hasAmounts =\n formattedGross != null ||\n formattedPaid != null ||\n formattedUnpaid != null;\n\n const hasLineItems = !!lineItems && lineItems.length > 0;\n\n const inner = (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {/* Heading row — payment number + headline TransactionChip. */}\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-md)] ds:flex-wrap\">\n <h3\n id={headingId}\n className=\"type-title-card ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {t('paymentCard.heading', {\n number,\n defaultValue: 'Payment {{number}}',\n })}\n </h3>\n <span className=\"ds:ms-auto ds:shrink-0\">\n <TransactionChip\n state={state}\n amount={chipAmountCents / 100}\n currency={currency}\n locale={activeLocale}\n size=\"lg\"\n />\n </span>\n </div>\n\n {/* Metadata rows. */}\n <KeyValueList rowGap=\"sm\">\n {rows.map((row) => (\n <KeyValuePair\n key={row.key}\n icon={row.icon as React.ReactElement}\n label={row.label}\n value={row.value}\n />\n ))}\n </KeyValueList>\n\n {/* Amount summary — gross / paid / outstanding. */}\n {hasAmounts ? (\n <DescriptionList layout=\"inline\" density=\"compact\" labelWidth=\"fixed\">\n {formattedGross != null ? (\n <DescriptionList.Row>\n <DescriptionList.Term>\n {t('paymentCard.label.gross', 'Gross total')}\n </DescriptionList.Term>\n <DescriptionList.Detail numeric>\n {formattedGross}\n </DescriptionList.Detail>\n </DescriptionList.Row>\n ) : null}\n {formattedPaid != null ? (\n <DescriptionList.Row>\n <DescriptionList.Term>\n {t('paymentCard.label.paid', 'Paid')}\n </DescriptionList.Term>\n <DescriptionList.Detail numeric>\n {formattedPaid}\n </DescriptionList.Detail>\n </DescriptionList.Row>\n ) : null}\n {formattedUnpaid != null ? (\n <DescriptionList.Row>\n <DescriptionList.Term>\n {t('paymentCard.label.unpaid', 'Outstanding')}\n </DescriptionList.Term>\n <DescriptionList.Detail numeric>\n {formattedUnpaid}\n </DescriptionList.Detail>\n </DescriptionList.Row>\n ) : null}\n </DescriptionList>\n ) : null}\n\n {/* Line items. */}\n {hasLineItems ? (\n <section\n aria-label={t('paymentCard.lineItems.heading', 'Line items')}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n <h4 className=\"type-eyebrow ds:m-0 ds:text-[color:var(--muted-foreground)]\">\n {t('paymentCard.lineItems.heading', 'Line items')}\n </h4>\n <DescriptionList\n layout=\"inline\"\n density=\"compact\"\n labelWidth=\"auto\"\n >\n {lineItems!.map((item, index) => (\n <DescriptionList.Row key={`${item.description}-${index}`}>\n <DescriptionList.Term>\n {item.vatPercentage != null\n ? t('paymentCard.lineItems.withVat', {\n description: item.description,\n vat: item.vatPercentage,\n defaultValue: '{{description}} (VAT {{vat}}%)',\n })\n : item.description}\n </DescriptionList.Term>\n <DescriptionList.Detail numeric>\n {formatMoney(item.amountCents, currency, activeLocale)}\n </DescriptionList.Detail>\n </DescriptionList.Row>\n ))}\n </DescriptionList>\n </section>\n ) : null}\n </div>\n );\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={resolvedAriaLabel}\n aria-labelledby={headingId}\n data-component=\"payment-card\"\n data-component-id={id}\n data-state={state}\n data-type={type}\n data-direction={direction}\n id={id}\n className={rootVariants({ surface, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">\n <Card.Body>{inner}</Card.Body>\n </Card>\n ) : (\n <div className={entitySurfaceVariants({ surface: 'flat' })}>\n {inner}\n </div>\n )}\n </div>\n );\n },\n);\n\nPaymentCard.displayName = 'PaymentCard';\n\nexport type PaymentCardSurface = NonNullable<\n VariantProps<typeof rootVariants>['surface']\n>;\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — PaymentRequestCard. */\n/* */\n/* Read-only payment-request surface. Exposes the lifecycle status */\n/* (structural state) only — never any patient identity or the hosted */\n/* payment URL. No actions: navigation to the pay link is a user-driven */\n/* affordance, not an agent operation. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { PaymentRequestCardHandle } from './payment-request-card';\n\nexport const paymentRequestCardAgent: AgentAdapter<PaymentRequestCardHandle> = {\n id: 'payment-request-card',\n capabilities: [],\n state: {\n status: {\n type: \"'new' | 'authorization_requested' | 'authorized' | 'paid' | 'failed' | 'cancelled'\",\n descriptionKey: 'ui.agent.paymentRequestCard.state.status',\n description:\n 'Current lifecycle status of the payment request. Structural state only.',\n read: (handle) => handle.getStatus(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'payment-request-card',\n description: 'Marks the PaymentRequestCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Addresses a specific request card.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { CalendarClock, CreditCard, FileText } from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Card } from '../card/card';\nimport { KeyValueList, KeyValuePair } from '../key-value-pair/key-value-pair';\nimport { Link } from '../link/link';\nimport { TransactionChip } from '../transaction-chip/transaction-chip';\nimport { entitySurfaceVariants, isSafeEntityUrl } from '../_shared/entity-card';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { paymentRequestCardAgent } from './payment-request-card.agent';\n\n/* -------------------------------------------------------------------- */\n/* PaymentRequestCard */\n/* */\n/* Companion to PaymentCard: a card for an *outstanding* payment request */\n/* (a Stripe / online-payment ask) rather than a recorded payment. Shows */\n/* the amount as a TransactionChip, the lifecycle status as a Badge, and */\n/* — when a safe `paymentUrl` is supplied — a \"Pay now\" Link. */\n/* */\n/* Every visible string flows through `useTranslation('ui')` against the */\n/* `paymentRequestCard.*` namespace. The agent state exposes the request */\n/* status (structural state) and never any patient identity. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* Vocabulary */\n/* -------------------------------------------------------------------- */\n\nexport type PaymentRequestStatus =\n | 'new'\n | 'authorization_requested'\n | 'authorized'\n | 'paid'\n | 'failed'\n | 'cancelled';\n\ntype BadgeVariant = NonNullable<\n ComponentPropsWithoutRef<typeof Badge>['variant']\n>;\n\nconst STATUS_BADGE = {\n new: 'info',\n authorization_requested: 'warning',\n authorized: 'info',\n paid: 'success',\n failed: 'error',\n cancelled: 'neutral',\n} as const satisfies Record<PaymentRequestStatus, BadgeVariant>;\n\nconst DEFAULT_CURRENCY = 'EUR';\n\n// Inline English fallbacks — belt-and-braces only. The canonical keys\n// live in the locale bundle (`ui.paymentRequestCard.*`); these guard\n// against a stale / not-yet-wired bundle so the card never shows a key.\nconst STATUS_DEFAULTS: Record<PaymentRequestStatus, string> = {\n new: 'New',\n authorization_requested: 'Authorization requested',\n authorized: 'Authorized',\n paid: 'Paid',\n failed: 'Failed',\n cancelled: 'Cancelled',\n};\n\n/* -------------------------------------------------------------------- */\n/* CVA — root */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva('ds:w-full ds:text-[color:var(--foreground)]', {\n variants: {\n surface: {\n flat: '',\n elevated: '',\n },\n },\n defaultVariants: { surface: 'elevated' },\n});\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\nexport interface PaymentRequestCardHandle {\n /** Current lifecycle status. Structural state only — no PHI. */\n getStatus: () => PaymentRequestStatus;\n}\n\nexport interface PaymentRequestCardProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children' | 'title'\n> {\n /** Agent-readiness consumer id, surfaced as `data-component-id`. */\n id?: string;\n /** Heading for the request. Falls back to a localised default. */\n title?: string;\n /** Optional supporting copy rendered beneath the heading. */\n description?: string;\n /** Requested amount in the smallest currency unit (cents). */\n amountCents: number;\n /** ISO-8601 due date. */\n dueDateIso?: string;\n /** Lifecycle status — drives the status Badge and pay-link gating. */\n status: PaymentRequestStatus;\n /** Hosted payment URL. Only rendered when it passes the URL allow-list. */\n paymentUrl?: string;\n /** Care-plan / treatment-plan number this request relates to. */\n carePlanNumber?: string;\n /** BCP-47 locale override. Falls back to the active i18next language. */\n locale?: string;\n /** ISO-4217 currency code. Defaults to `EUR`. */\n currency?: string;\n\n /* ----- Styling ----- */\n\n /**\n * `'elevated'` (default) wraps in `<Card variant=\"elevated\">`. `'flat'`\n * drops the Card — use inside an existing card / sheet.\n */\n surface?: 'flat' | 'elevated';\n\n /* ----- a11y ----- */\n\n /** Override the default region aria-label. */\n 'aria-label'?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\nfunction formatDate(iso: string, locale: string): string {\n const date = new Date(iso);\n if (Number.isNaN(date.getTime())) return iso;\n try {\n return new Intl.DateTimeFormat(locale, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n }).format(date);\n } catch {\n return iso;\n }\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const PaymentRequestCard = forwardRef<\n HTMLDivElement,\n PaymentRequestCardProps\n>(\n (\n {\n id,\n title,\n description,\n amountCents,\n dueDateIso,\n status,\n paymentUrl,\n carePlanNumber,\n locale,\n currency = DEFAULT_CURRENCY,\n surface = 'elevated',\n 'aria-label': ariaLabel,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const headingId = useId();\n const activeLocale = locale ?? i18n.language ?? 'en';\n\n const resolvedTitle =\n title ?? t('paymentRequestCard.heading', 'Payment request');\n const resolvedAriaLabel = ariaLabel ?? resolvedTitle;\n\n useAgentRegistration(\n paymentRequestCardAgent,\n { getStatus: () => status },\n id,\n );\n\n const statusLabel = t(`paymentRequestCard.status.${status}`, {\n defaultValue: STATUS_DEFAULTS[status],\n });\n\n // A paid request settles; an open one is \"to-invoice\" (awaiting money);\n // anything terminal-but-unpaid renders as a debt.\n const chipState: 'to-invoice' | 'settled' | 'debt' =\n status === 'paid'\n ? 'settled'\n : status === 'failed' || status === 'cancelled'\n ? 'debt'\n : 'to-invoice';\n\n // The pay link only renders when the request is still actionable AND\n // the URL passes the shared card-family allow-list (no javascript:,\n // data:, protocol-relative). Otherwise the affordance is suppressed.\n const isActionable =\n status === 'new' ||\n status === 'authorization_requested' ||\n status === 'authorized';\n const showPayLink =\n isActionable && !!paymentUrl && isSafeEntityUrl(paymentUrl);\n\n const rows: Array<{\n key: string;\n icon: ReactNode;\n label: string;\n value: ReactNode;\n }> = [];\n\n rows.push({\n key: 'status',\n icon: <CreditCard aria-hidden=\"true\" />,\n label: t('paymentRequestCard.label.status', 'Status'),\n value: <Badge variant={STATUS_BADGE[status]}>{statusLabel}</Badge>,\n });\n\n if (dueDateIso) {\n rows.push({\n key: 'dueDate',\n icon: <CalendarClock aria-hidden=\"true\" />,\n label: t('paymentRequestCard.label.dueDate', 'Due date'),\n value: formatDate(dueDateIso, activeLocale),\n });\n }\n\n if (carePlanNumber) {\n rows.push({\n key: 'carePlan',\n icon: <FileText aria-hidden=\"true\" />,\n label: t('paymentRequestCard.label.carePlan', 'Care plan'),\n value: carePlanNumber,\n });\n }\n\n const inner = (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {/* Heading row — title + amount TransactionChip. */}\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-md)] ds:flex-wrap\">\n <div className=\"ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <h3\n id={headingId}\n className=\"type-title-card ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {resolvedTitle}\n </h3>\n {description ? (\n <p className=\"type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]\">\n {description}\n </p>\n ) : null}\n </div>\n <span className=\"ds:ms-auto ds:shrink-0\">\n <TransactionChip\n state={chipState}\n amount={amountCents / 100}\n currency={currency}\n locale={activeLocale}\n size=\"lg\"\n />\n </span>\n </div>\n\n {/* Metadata rows. */}\n <KeyValueList rowGap=\"sm\">\n {rows.map((row) => (\n <KeyValuePair\n key={row.key}\n icon={row.icon as React.ReactElement}\n label={row.label}\n value={row.value}\n />\n ))}\n </KeyValueList>\n\n {/* Pay affordance — only when actionable + the URL is safe. */}\n {showPayLink ? (\n <div className=\"ds:flex\">\n <Link href={paymentUrl!} external startIcon={<CreditCard />}>\n {t('paymentRequestCard.pay', 'Pay now')}\n </Link>\n </div>\n ) : null}\n </div>\n );\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={resolvedAriaLabel}\n aria-labelledby={headingId}\n data-component=\"payment-request-card\"\n data-component-id={id}\n data-status={status}\n id={id}\n className={rootVariants({ surface, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">\n <Card.Body>{inner}</Card.Body>\n </Card>\n ) : (\n <div className={entitySurfaceVariants({ surface: 'flat' })}>\n {inner}\n </div>\n )}\n </div>\n );\n },\n);\n\nPaymentRequestCard.displayName = 'PaymentRequestCard';\n\nexport type PaymentRequestCardSurface = NonNullable<\n VariantProps<typeof rootVariants>['surface']\n>;\n"],"names":["paymentCardAgent","handle","PAYMENT_TYPE_BADGE","DEFAULT_CURRENCY","TYPE_DEFAULTS","DIRECTION_DEFAULTS","rootVariants","cva","formatMoney","cents","currency","locale","formatDate","iso","date","resolveState","type","paidCents","unpaidCents","writtenOff","PaymentCard","forwardRef","id","number","dateIso","direction","grossCents","relations","lineItems","surface","ariaLabel","className","rest","ref","i18n","useTranslation","headingId","useId","activeLocale","resolvedAriaLabel","state","chipAmountCents","useAgentRegistration","typeLabel","directionIcon","jsx","ArrowDownLeft","ArrowUpRight","directionLabel","rows","Hash","CalendarDays","ReceiptEuro","Badge","FileText","User","UserCog","formattedGross","useMemo","formattedPaid","formattedUnpaid","hasAmounts","hasLineItems","inner","jsxs","TransactionChip","KeyValueList","row","KeyValuePair","DescriptionList","item","index","Card","entitySurfaceVariants","paymentRequestCardAgent","STATUS_BADGE","STATUS_DEFAULTS","PaymentRequestCard","title","description","amountCents","dueDateIso","status","paymentUrl","carePlanNumber","t","resolvedTitle","statusLabel","chipState","showPayLink","isSafeEntityUrl","CreditCard","CalendarClock","Link"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYO,MAAMA,KAAoD;AAAA,EAC/D,IAAI;AAAA,EACJ,cAAc,CAAA;AAAA,EACd,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,IAErC,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,EACpC;AAAA,EAEF,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aA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B,sBACE,OAAA,EAAI,WAAU,WACb,UAAA,gBAAA5C,EAACgD,IAAA,EAAK,MAAMV,GAAa,UAAQ,IAAC,WAAW,gBAAAtC,EAAC8C,KAAW,GACtD,UAAAN,EAAE,0BAA0B,SAAS,EAAA,CACxC,GACF,IACE;AAAA,IAAA,GACN;AAGF,WACE,gBAAAxC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAZ;AAAA,QACA,MAAK;AAAA,QACL,cAAYM;AAAA,QACZ,mBAAiBH;AAAA,QACjB,kBAAe;AAAA,QACf,qBAAmBd;AAAA,QACnB,eAAa4D;AAAA,QACb,IAAA5D;AAAA,QACA,WAAWhB,GAAa,EAAE,SAAAuB,GAAS,WAAAE,GAAW;AAAA,QAC7C,GAAGC;AAAA,QAEH,UAAAH,MAAY,aACX,gBAAAgB,EAAC2B,GAAA,EAAK,SAAQ,YACZ,UAAA,gBAAA3B,EAAC2B,EAAK,MAAL,EAAW,UAAAT,EAAA,CAAM,GACpB,IAEA,gBAAAlB,EAAC,SAAI,WAAW4B,EAAsB,EAAE,SAAS,OAAA,CAAQ,GACtD,UAAAV,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAc,GAAmB,cAAc;"}
1
+ {"version":3,"file":"payment-request-card-lmKLwsDs.js","sources":["../../src/components/payment-card/payment-card.agent.ts","../../src/components/payment-card/payment-card.tsx","../../src/components/payment-card/payment-request-card.agent.ts","../../src/components/payment-card/payment-request-card.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — PaymentCard. */\n/* */\n/* Read-only financial-record surface. Exposes the payment number */\n/* (identifier) and the resolved headline state (structural) — never */\n/* patient / operator names or any other PHI. No actions: the card is a */\n/* passive presentation surface. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { PaymentCardHandle } from './payment-card';\n\nexport const paymentCardAgent: AgentAdapter<PaymentCardHandle> = {\n id: 'payment-card',\n capabilities: [],\n state: {\n number: {\n type: 'string',\n descriptionKey: 'ui.agent.paymentCard.state.number',\n description: 'Payment number / reference currently rendered.',\n read: (handle) => handle.getNumber(),\n },\n state: {\n type: \"'debt' | 'to-invoice' | 'settled'\",\n descriptionKey: 'ui.agent.paymentCard.state.state',\n description:\n 'Resolved headline financial state. Structural state only — never patient identity.',\n read: (handle) => handle.getState(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'payment-card',\n description: 'Marks the PaymentCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop. Addresses a specific card.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n useMemo,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n ArrowDownLeft,\n ArrowUpRight,\n CalendarDays,\n FileText,\n Hash,\n ReceiptEuro,\n User,\n UserCog,\n} from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Card } from '../card/card';\nimport { DescriptionList } from '../description-list/description-list';\nimport { KeyValueList, KeyValuePair } from '../key-value-pair/key-value-pair';\nimport { TransactionChip } from '../transaction-chip/transaction-chip';\nimport { entitySurfaceVariants } from '../_shared/entity-card';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { paymentCardAgent } from './payment-card.agent';\n\n/* -------------------------------------------------------------------- */\n/* PaymentCard */\n/* */\n/* Financial-record card for a single payment / receipt. Replaces the */\n/* hand-rolled \"Pagamento\" / payment-row cards that the platform's */\n/* care-plan and patient-ledger surfaces compose today. Composes */\n/* TransactionChip (the settled/debt/to-invoice headline) + KeyValueList */\n/* (number, date, type, direction, relations) + DescriptionList (line */\n/* items) + Badge (the payment type). */\n/* */\n/* The component owns the ORDER, ICONS, and LABELS; the consumer passes */\n/* the data. Every visible string flows through `useTranslation('ui')` */\n/* against the `paymentCard.*` namespace. The agent state slot exposes */\n/* identifiers + structural state only — never patient names. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* Vocabulary */\n/* -------------------------------------------------------------------- */\n\n/** Payment type → translation-key segment + Badge variant. */\nexport type PaymentType = 'full' | 'partial' | 'credit' | 'proforma' | 'other';\n\nexport type PaymentDirection = 'incoming' | 'outgoing';\n\ntype BadgeVariant = NonNullable<\n ComponentPropsWithoutRef<typeof Badge>['variant']\n>;\n\nconst PAYMENT_TYPE_BADGE = {\n full: 'success',\n partial: 'warning',\n credit: 'info',\n proforma: 'neutral',\n other: 'neutral',\n} as const satisfies Record<PaymentType, BadgeVariant>;\n\nconst DEFAULT_CURRENCY = 'EUR';\n\n// Inline English fallbacks — belt-and-braces only. The canonical keys\n// live in the locale bundle (`ui.paymentCard.*`); these guard against a\n// stale / not-yet-wired bundle so the card never renders a raw key.\nconst TYPE_DEFAULTS: Record<PaymentType, string> = {\n full: 'Full payment',\n partial: 'Partial payment',\n credit: 'Credit note',\n proforma: 'Proforma',\n other: 'Other',\n};\n\nconst DIRECTION_DEFAULTS: Record<PaymentDirection, string> = {\n incoming: 'Incoming',\n outgoing: 'Outgoing',\n};\n\n/* -------------------------------------------------------------------- */\n/* CVA — root */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva('ds:w-full ds:text-[color:var(--foreground)]', {\n variants: {\n surface: {\n flat: '',\n elevated: '',\n },\n },\n defaultVariants: { surface: 'elevated' },\n});\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\nexport interface PaymentLineItem {\n /** Human-readable description of the line. */\n description: string;\n /** Amount in the smallest currency unit (cents / centesimi). */\n amountCents: number;\n /** Optional VAT percentage (e.g. `22` for 22%). */\n vatPercentage?: number;\n}\n\nexport interface PaymentCardRelations {\n /** Care-plan / treatment-plan number this payment belongs to. */\n carePlanNumber?: string;\n /** Patient display name — rendered, but never exposed to the agent. */\n patientName?: string;\n /** Operator display name — rendered, but never exposed to the agent. */\n operatorName?: string;\n}\n\nexport interface PaymentCardHandle {\n /** Stable payment number currently rendered. Identifier only — no PHI. */\n getNumber: () => string;\n /** Resolved headline financial state. Structural state only. */\n getState: () => TransactionStateValue;\n}\n\n/** The TransactionChip state this card resolves the payment to. */\ntype TransactionStateValue = 'debt' | 'to-invoice' | 'settled';\n\nexport interface PaymentCardProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children'\n> {\n /** Agent-readiness consumer id, surfaced as `data-component-id`. */\n id?: string;\n /** Human-readable payment number / reference. Rendered as the heading. */\n number: string;\n /** ISO-8601 date string for the payment date. */\n dateIso?: string;\n /** Payment type — drives the type Badge + label. */\n type: PaymentType;\n /** Money flow direction — incoming (patient → practice) or outgoing. */\n direction: PaymentDirection;\n /** Gross total in the smallest currency unit (cents). */\n grossCents?: number;\n /** Amount already paid, in cents. */\n paidCents?: number;\n /** Amount still outstanding, in cents. */\n unpaidCents?: number;\n /** Marks the record as written-off — renders a neutral chip. */\n writtenOff?: boolean;\n /** Linked entities (care plan / patient / operator). */\n relations?: PaymentCardRelations;\n /** Itemised breakdown rendered as a DescriptionList. */\n lineItems?: PaymentLineItem[];\n /** BCP-47 locale override. Falls back to the active i18next language. */\n locale?: string;\n /** ISO-4217 currency code. Defaults to `EUR`. */\n currency?: string;\n\n /* ----- Styling ----- */\n\n /**\n * `'elevated'` (default) wraps in `<Card variant=\"elevated\">`. `'flat'`\n * drops the Card — use inside an existing card / sheet.\n */\n surface?: 'flat' | 'elevated';\n\n /* ----- a11y ----- */\n\n /** Override the default region aria-label. */\n 'aria-label'?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n/** Format cents → currency string for the consumer's locale. */\nfunction formatMoney(cents: number, currency: string, locale: string): string {\n try {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n }).format(cents / 100);\n } catch {\n return (cents / 100).toFixed(2);\n }\n}\n\n/** Format an ISO date for the consumer's locale, gracefully degrading. */\nfunction formatDate(iso: string, locale: string): string {\n const date = new Date(iso);\n if (Number.isNaN(date.getTime())) return iso;\n try {\n return new Intl.DateTimeFormat(locale, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n }).format(date);\n } catch {\n return iso;\n }\n}\n\n/**\n * Resolve the headline TransactionChip state from the paid / unpaid /\n * written-off inputs. Written-off → settled chip; an outstanding balance\n * → debt; a proforma with nothing paid → to-invoice; otherwise settled.\n */\nfunction resolveState(\n type: PaymentType,\n paidCents: number | undefined,\n unpaidCents: number | undefined,\n writtenOff: boolean | undefined,\n): TransactionStateValue {\n if (writtenOff) return 'settled';\n if (unpaidCents != null && unpaidCents > 0) return 'debt';\n if (type === 'proforma' && (paidCents == null || paidCents === 0)) {\n return 'to-invoice';\n }\n return 'settled';\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const PaymentCard = forwardRef<HTMLDivElement, PaymentCardProps>(\n (\n {\n id,\n number,\n dateIso,\n type,\n direction,\n grossCents,\n paidCents,\n unpaidCents,\n writtenOff = false,\n relations,\n lineItems,\n locale,\n currency = DEFAULT_CURRENCY,\n surface = 'elevated',\n 'aria-label': ariaLabel,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const headingId = useId();\n const activeLocale = locale ?? i18n.language ?? 'en';\n\n const resolvedAriaLabel =\n ariaLabel ??\n t('paymentCard.regionLabel', {\n number,\n defaultValue: 'Payment {{number}}',\n });\n\n const state = resolveState(type, paidCents, unpaidCents, writtenOff);\n\n // The chip headline reflects the most informative figure: the\n // outstanding balance when there's a debt, otherwise the gross total.\n const chipAmountCents =\n state === 'debt' && unpaidCents != null\n ? unpaidCents\n : (grossCents ?? paidCents ?? unpaidCents ?? 0);\n\n useAgentRegistration(\n paymentCardAgent,\n {\n getNumber: () => number,\n getState: () => state,\n },\n id,\n );\n\n const typeLabel = t(`paymentCard.type.${type}`, {\n defaultValue: TYPE_DEFAULTS[type],\n });\n const directionIcon =\n direction === 'incoming' ? (\n <ArrowDownLeft aria-hidden=\"true\" />\n ) : (\n <ArrowUpRight aria-hidden=\"true\" />\n );\n const directionLabel = t(`paymentCard.direction.${direction}`, {\n defaultValue: DIRECTION_DEFAULTS[direction],\n });\n\n // Compose the metadata rows in display order. Omitting a field omits\n // the row — KeyValueList collapses the subgrid cleanly.\n const rows: Array<{\n key: string;\n icon: ReactNode;\n label: string;\n value: ReactNode;\n }> = [];\n\n rows.push({\n key: 'number',\n icon: <Hash aria-hidden=\"true\" />,\n label: t('paymentCard.label.number', 'Number'),\n value: number,\n });\n\n if (dateIso) {\n rows.push({\n key: 'date',\n icon: <CalendarDays aria-hidden=\"true\" />,\n label: t('paymentCard.label.date', 'Date'),\n value: formatDate(dateIso, activeLocale),\n });\n }\n\n rows.push({\n key: 'type',\n icon: <ReceiptEuro aria-hidden=\"true\" />,\n label: t('paymentCard.label.type', 'Type'),\n value: <Badge variant={PAYMENT_TYPE_BADGE[type]}>{typeLabel}</Badge>,\n });\n\n rows.push({\n key: 'direction',\n icon: directionIcon,\n label: t('paymentCard.label.direction', 'Direction'),\n value: directionLabel,\n });\n\n if (relations?.carePlanNumber) {\n rows.push({\n key: 'carePlan',\n icon: <FileText aria-hidden=\"true\" />,\n label: t('paymentCard.label.carePlan', 'Care plan'),\n value: relations.carePlanNumber,\n });\n }\n\n if (relations?.patientName) {\n rows.push({\n key: 'patient',\n icon: <User aria-hidden=\"true\" />,\n label: t('paymentCard.label.patient', 'Patient'),\n value: relations.patientName,\n });\n }\n\n if (relations?.operatorName) {\n rows.push({\n key: 'operator',\n icon: <UserCog aria-hidden=\"true\" />,\n label: t('paymentCard.label.operator', 'Operator'),\n value: relations.operatorName,\n });\n }\n\n const formattedGross = useMemo(\n () =>\n grossCents != null\n ? formatMoney(grossCents, currency, activeLocale)\n : undefined,\n [grossCents, currency, activeLocale],\n );\n const formattedPaid = useMemo(\n () =>\n paidCents != null\n ? formatMoney(paidCents, currency, activeLocale)\n : undefined,\n [paidCents, currency, activeLocale],\n );\n const formattedUnpaid = useMemo(\n () =>\n unpaidCents != null\n ? formatMoney(unpaidCents, currency, activeLocale)\n : undefined,\n [unpaidCents, currency, activeLocale],\n );\n\n const hasAmounts =\n formattedGross != null ||\n formattedPaid != null ||\n formattedUnpaid != null;\n\n const hasLineItems = !!lineItems && lineItems.length > 0;\n\n const inner = (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {/* Heading row — payment number + headline TransactionChip. */}\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-md)] ds:flex-wrap\">\n <h3\n id={headingId}\n className=\"type-title-card ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {t('paymentCard.heading', {\n number,\n defaultValue: 'Payment {{number}}',\n })}\n </h3>\n <span className=\"ds:ms-auto ds:shrink-0\">\n <TransactionChip\n state={state}\n amount={chipAmountCents / 100}\n currency={currency}\n locale={activeLocale}\n size=\"lg\"\n />\n </span>\n </div>\n\n {/* Metadata rows. */}\n <KeyValueList rowGap=\"sm\">\n {rows.map((row) => (\n <KeyValuePair\n key={row.key}\n icon={row.icon as React.ReactElement}\n label={row.label}\n value={row.value}\n />\n ))}\n </KeyValueList>\n\n {/* Amount summary — gross / paid / outstanding. */}\n {hasAmounts ? (\n <DescriptionList layout=\"inline\" density=\"compact\" labelWidth=\"fixed\">\n {formattedGross != null ? (\n <DescriptionList.Row>\n <DescriptionList.Term>\n {t('paymentCard.label.gross', 'Gross total')}\n </DescriptionList.Term>\n <DescriptionList.Detail numeric>\n {formattedGross}\n </DescriptionList.Detail>\n </DescriptionList.Row>\n ) : null}\n {formattedPaid != null ? (\n <DescriptionList.Row>\n <DescriptionList.Term>\n {t('paymentCard.label.paid', 'Paid')}\n </DescriptionList.Term>\n <DescriptionList.Detail numeric>\n {formattedPaid}\n </DescriptionList.Detail>\n </DescriptionList.Row>\n ) : null}\n {formattedUnpaid != null ? (\n <DescriptionList.Row>\n <DescriptionList.Term>\n {t('paymentCard.label.unpaid', 'Outstanding')}\n </DescriptionList.Term>\n <DescriptionList.Detail numeric>\n {formattedUnpaid}\n </DescriptionList.Detail>\n </DescriptionList.Row>\n ) : null}\n </DescriptionList>\n ) : null}\n\n {/* Line items. */}\n {hasLineItems ? (\n <section\n aria-label={t('paymentCard.lineItems.heading', 'Line items')}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n <h4 className=\"type-eyebrow ds:m-0 ds:text-[color:var(--muted-foreground)]\">\n {t('paymentCard.lineItems.heading', 'Line items')}\n </h4>\n <DescriptionList\n layout=\"inline\"\n density=\"compact\"\n labelWidth=\"auto\"\n >\n {lineItems!.map((item, index) => (\n <DescriptionList.Row key={`${item.description}-${index}`}>\n <DescriptionList.Term>\n {item.vatPercentage != null\n ? t('paymentCard.lineItems.withVat', {\n description: item.description,\n vat: item.vatPercentage,\n defaultValue: '{{description}} (VAT {{vat}}%)',\n })\n : item.description}\n </DescriptionList.Term>\n <DescriptionList.Detail numeric>\n {formatMoney(item.amountCents, currency, activeLocale)}\n </DescriptionList.Detail>\n </DescriptionList.Row>\n ))}\n </DescriptionList>\n </section>\n ) : null}\n </div>\n );\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={resolvedAriaLabel}\n aria-labelledby={headingId}\n data-component=\"payment-card\"\n data-component-id={id}\n data-state={state}\n data-type={type}\n data-direction={direction}\n id={id}\n className={rootVariants({ surface, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">\n <Card.Body>{inner}</Card.Body>\n </Card>\n ) : (\n <div className={entitySurfaceVariants({ surface: 'flat' })}>\n {inner}\n </div>\n )}\n </div>\n );\n },\n);\n\nPaymentCard.displayName = 'PaymentCard';\n\nexport type PaymentCardSurface = NonNullable<\n VariantProps<typeof rootVariants>['surface']\n>;\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — PaymentRequestCard. */\n/* */\n/* Read-only payment-request surface. Exposes the lifecycle status */\n/* (structural state) only — never any patient identity or the hosted */\n/* payment URL. No actions: navigation to the pay link is a user-driven */\n/* affordance, not an agent operation. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { PaymentRequestCardHandle } from './payment-request-card';\n\nexport const paymentRequestCardAgent: AgentAdapter<PaymentRequestCardHandle> = {\n id: 'payment-request-card',\n capabilities: [],\n state: {\n status: {\n type: \"'new' | 'authorization_requested' | 'authorized' | 'paid' | 'failed' | 'cancelled'\",\n descriptionKey: 'ui.agent.paymentRequestCard.state.status',\n description:\n 'Current lifecycle status of the payment request. Structural state only.',\n read: (handle) => handle.getStatus(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'payment-request-card',\n description: 'Marks the PaymentRequestCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Addresses a specific request card.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { CalendarClock, CreditCard, FileText } from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Card } from '../card/card';\nimport { KeyValueList, KeyValuePair } from '../key-value-pair/key-value-pair';\nimport { Link } from '../link/link';\nimport { TransactionChip } from '../transaction-chip/transaction-chip';\nimport { entitySurfaceVariants, isSafeEntityUrl } from '../_shared/entity-card';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { paymentRequestCardAgent } from './payment-request-card.agent';\n\n/* -------------------------------------------------------------------- */\n/* PaymentRequestCard */\n/* */\n/* Companion to PaymentCard: a card for an *outstanding* payment request */\n/* (a Stripe / online-payment ask) rather than a recorded payment. Shows */\n/* the amount as a TransactionChip, the lifecycle status as a Badge, and */\n/* — when a safe `paymentUrl` is supplied — a \"Pay now\" Link. */\n/* */\n/* Every visible string flows through `useTranslation('ui')` against the */\n/* `paymentRequestCard.*` namespace. The agent state exposes the request */\n/* status (structural state) and never any patient identity. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* Vocabulary */\n/* -------------------------------------------------------------------- */\n\nexport type PaymentRequestStatus =\n | 'new'\n | 'authorization_requested'\n | 'authorized'\n | 'paid'\n | 'failed'\n | 'cancelled';\n\ntype BadgeVariant = NonNullable<\n ComponentPropsWithoutRef<typeof Badge>['variant']\n>;\n\nconst STATUS_BADGE = {\n new: 'info',\n authorization_requested: 'warning',\n authorized: 'info',\n paid: 'success',\n failed: 'error',\n cancelled: 'neutral',\n} as const satisfies Record<PaymentRequestStatus, BadgeVariant>;\n\nconst DEFAULT_CURRENCY = 'EUR';\n\n// Inline English fallbacks — belt-and-braces only. The canonical keys\n// live in the locale bundle (`ui.paymentRequestCard.*`); these guard\n// against a stale / not-yet-wired bundle so the card never shows a key.\nconst STATUS_DEFAULTS: Record<PaymentRequestStatus, string> = {\n new: 'New',\n authorization_requested: 'Authorization requested',\n authorized: 'Authorized',\n paid: 'Paid',\n failed: 'Failed',\n cancelled: 'Cancelled',\n};\n\n/* -------------------------------------------------------------------- */\n/* CVA — root */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva('ds:w-full ds:text-[color:var(--foreground)]', {\n variants: {\n surface: {\n flat: '',\n elevated: '',\n },\n },\n defaultVariants: { surface: 'elevated' },\n});\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\nexport interface PaymentRequestCardHandle {\n /** Current lifecycle status. Structural state only — no PHI. */\n getStatus: () => PaymentRequestStatus;\n}\n\nexport interface PaymentRequestCardProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children' | 'title'\n> {\n /** Agent-readiness consumer id, surfaced as `data-component-id`. */\n id?: string;\n /** Heading for the request. Falls back to a localised default. */\n title?: string;\n /** Optional supporting copy rendered beneath the heading. */\n description?: string;\n /** Requested amount in the smallest currency unit (cents). */\n amountCents: number;\n /** ISO-8601 due date. */\n dueDateIso?: string;\n /** Lifecycle status — drives the status Badge and pay-link gating. */\n status: PaymentRequestStatus;\n /** Hosted payment URL. Only rendered when it passes the URL allow-list. */\n paymentUrl?: string;\n /** Care-plan / treatment-plan number this request relates to. */\n carePlanNumber?: string;\n /** BCP-47 locale override. Falls back to the active i18next language. */\n locale?: string;\n /** ISO-4217 currency code. Defaults to `EUR`. */\n currency?: string;\n\n /* ----- Styling ----- */\n\n /**\n * `'elevated'` (default) wraps in `<Card variant=\"elevated\">`. `'flat'`\n * drops the Card — use inside an existing card / sheet.\n */\n surface?: 'flat' | 'elevated';\n\n /* ----- a11y ----- */\n\n /** Override the default region aria-label. */\n 'aria-label'?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\nfunction formatDate(iso: string, locale: string): string {\n const date = new Date(iso);\n if (Number.isNaN(date.getTime())) return iso;\n try {\n return new Intl.DateTimeFormat(locale, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n }).format(date);\n } catch {\n return iso;\n }\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const PaymentRequestCard = forwardRef<\n HTMLDivElement,\n PaymentRequestCardProps\n>(\n (\n {\n id,\n title,\n description,\n amountCents,\n dueDateIso,\n status,\n paymentUrl,\n carePlanNumber,\n locale,\n currency = DEFAULT_CURRENCY,\n surface = 'elevated',\n 'aria-label': ariaLabel,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const headingId = useId();\n const activeLocale = locale ?? i18n.language ?? 'en';\n\n const resolvedTitle =\n title ?? t('paymentRequestCard.heading', 'Payment request');\n const resolvedAriaLabel = ariaLabel ?? resolvedTitle;\n\n useAgentRegistration(\n paymentRequestCardAgent,\n { getStatus: () => status },\n id,\n );\n\n const statusLabel = t(`paymentRequestCard.status.${status}`, {\n defaultValue: STATUS_DEFAULTS[status],\n });\n\n // A paid request settles; an open one is \"to-invoice\" (awaiting money);\n // anything terminal-but-unpaid renders as a debt.\n const chipState: 'to-invoice' | 'settled' | 'debt' =\n status === 'paid'\n ? 'settled'\n : status === 'failed' || status === 'cancelled'\n ? 'debt'\n : 'to-invoice';\n\n // The pay link only renders when the request is still actionable AND\n // the URL passes the shared card-family allow-list (no javascript:,\n // data:, protocol-relative). Otherwise the affordance is suppressed.\n const isActionable =\n status === 'new' ||\n status === 'authorization_requested' ||\n status === 'authorized';\n const showPayLink =\n isActionable && !!paymentUrl && isSafeEntityUrl(paymentUrl);\n\n const rows: Array<{\n key: string;\n icon: ReactNode;\n label: string;\n value: ReactNode;\n }> = [];\n\n rows.push({\n key: 'status',\n icon: <CreditCard aria-hidden=\"true\" />,\n label: t('paymentRequestCard.label.status', 'Status'),\n value: <Badge variant={STATUS_BADGE[status]}>{statusLabel}</Badge>,\n });\n\n if (dueDateIso) {\n rows.push({\n key: 'dueDate',\n icon: <CalendarClock aria-hidden=\"true\" />,\n label: t('paymentRequestCard.label.dueDate', 'Due date'),\n value: formatDate(dueDateIso, activeLocale),\n });\n }\n\n if (carePlanNumber) {\n rows.push({\n key: 'carePlan',\n icon: <FileText aria-hidden=\"true\" />,\n label: t('paymentRequestCard.label.carePlan', 'Care plan'),\n value: carePlanNumber,\n });\n }\n\n const inner = (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {/* Heading row — title + amount TransactionChip. */}\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-md)] ds:flex-wrap\">\n <div className=\"ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <h3\n id={headingId}\n className=\"type-title-card ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {resolvedTitle}\n </h3>\n {description ? (\n <p className=\"type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]\">\n {description}\n </p>\n ) : null}\n </div>\n <span className=\"ds:ms-auto ds:shrink-0\">\n <TransactionChip\n state={chipState}\n amount={amountCents / 100}\n currency={currency}\n locale={activeLocale}\n size=\"lg\"\n />\n </span>\n </div>\n\n {/* Metadata rows. */}\n <KeyValueList rowGap=\"sm\">\n {rows.map((row) => (\n <KeyValuePair\n key={row.key}\n icon={row.icon as React.ReactElement}\n label={row.label}\n value={row.value}\n />\n ))}\n </KeyValueList>\n\n {/* Pay affordance — only when actionable + the URL is safe. */}\n {showPayLink ? (\n <div className=\"ds:flex\">\n <Link href={paymentUrl!} external startIcon={<CreditCard />}>\n {t('paymentRequestCard.pay', 'Pay now')}\n </Link>\n </div>\n ) : null}\n </div>\n );\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={resolvedAriaLabel}\n aria-labelledby={headingId}\n data-component=\"payment-request-card\"\n data-component-id={id}\n data-status={status}\n id={id}\n className={rootVariants({ surface, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">\n <Card.Body>{inner}</Card.Body>\n </Card>\n ) : (\n <div className={entitySurfaceVariants({ surface: 'flat' })}>\n {inner}\n </div>\n )}\n </div>\n );\n },\n);\n\nPaymentRequestCard.displayName = 'PaymentRequestCard';\n\nexport type PaymentRequestCardSurface = NonNullable<\n VariantProps<typeof rootVariants>['surface']\n>;\n"],"names":["paymentCardAgent","handle","PAYMENT_TYPE_BADGE","DEFAULT_CURRENCY","TYPE_DEFAULTS","DIRECTION_DEFAULTS","rootVariants","cva","formatMoney","cents","currency","locale","formatDate","iso","date","resolveState","type","paidCents","unpaidCents","writtenOff","PaymentCard","forwardRef","id","number","dateIso","direction","grossCents","relations","lineItems","surface","ariaLabel","className","rest","ref","i18n","useTranslation","headingId","useId","activeLocale","resolvedAriaLabel","state","chipAmountCents","useAgentRegistration","typeLabel","directionIcon","jsx","ArrowDownLeft","ArrowUpRight","directionLabel","rows","Hash","CalendarDays","ReceiptEuro","Badge","FileText","User","UserCog","formattedGross","useMemo","formattedPaid","formattedUnpaid","hasAmounts","hasLineItems","inner","jsxs","TransactionChip","KeyValueList","row","KeyValuePair","DescriptionList","item","index","Card","entitySurfaceVariants","paymentRequestCardAgent","STATUS_BADGE","STATUS_DEFAULTS","PaymentRequestCard","title","description","amountCents","dueDateIso","status","paymentUrl","carePlanNumber","t","resolvedTitle","statusLabel","chipState","showPayLink","isSafeEntityUrl","CreditCard","CalendarClock","Link"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYO,MAAMA,KAAoD;AAAA,EAC/D,IAAI;AAAA,EACJ,cAAc,CAAA;AAAA,EACd,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,IAErC,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,EACpC;AAAA,EAEF,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,IAEf,YAAY;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GCcMC,KAAqB;AAAA,EACzB,MAAM;AAAA,EACN,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AACT,GAEMC,KAAmB,OAKnBC,KAA6C;AAAA,EACjD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AACT,GAEMC,KAAuD;AAAA,EAC3D,UAAU;AAAA,EACV,UAAU;AACZ,GAMMC,KAAeC,EAAI,+CAA+C;AAAA,EACtE,UAAU;AAAA,IACR,SAAS;AAAA,MACP,MAAM;AAAA,MACN,UAAU;AAAA,IAAA;AAAA,EACZ;AAAA,EAEF,iBAAiB,EAAE,SAAS,WAAA;AAC9B,CAAC;A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AK,MAAL,EAAW,UAAAT,EAAA,CAAM,GACpB,IAEA,gBAAAlB,EAAC,SAAI,WAAW4B,EAAsB,EAAE,SAAS,OAAA,CAAQ,GACtD,UAAAV,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAc,GAAmB,cAAc;"}
@@ -4,7 +4,7 @@ import { c as qe } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as rt } from "react-i18next";
5
5
  import { u as nt } from "./registry-DvAUVLHh.js";
6
6
  import { P as ve, i as ye, h as at, g as it, f as ot, Y as lt } from "./tooth-data-DR8Kdnup.js";
7
- import { P as je } from "./periodontal-chart-card-BBpY_rBc.js";
7
+ import { P as je } from "./periodontal-chart-card-qEZPXj83.js";
8
8
  const j = {
9
9
  type: "string",
10
10
  description: "FDI tooth id ('11'–'48' permanent, '51'–'85' primary)."
@@ -1302,4 +1302,4 @@ export {
1302
1302
  Ae as s,
1303
1303
  $t as t
1304
1304
  };
1305
- //# sourceMappingURL=periodontal-chart-BatZEFar.js.map
1305
+ //# sourceMappingURL=periodontal-chart-B9fphroR.js.map