themelia-react-ui 1.0.2 → 2.0.1

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 (748) hide show
  1. package/CHANGELOG.md +632 -1
  2. package/README.md +31 -13
  3. package/dist/accordion-B6a3vVgA.js +207 -0
  4. package/dist/accordion-B6a3vVgA.js.map +1 -0
  5. package/dist/action-menu-TzCoSlwL.js +280 -0
  6. package/dist/action-menu-TzCoSlwL.js.map +1 -0
  7. package/dist/{affordance-geometry.generated-CL84ZN9A.js → affordance-geometry.generated-B5iu-Mkr.js} +9 -3
  8. package/dist/affordance-geometry.generated-B5iu-Mkr.js.map +1 -0
  9. package/dist/{ai-artifact-DLVdK0Py.js → ai-artifact-BMJdv-6q.js} +389 -391
  10. package/dist/ai-artifact-BMJdv-6q.js.map +1 -0
  11. package/dist/{app-shell-C_fKpljx.js → app-shell-ZK5RWdo6.js} +4 -4
  12. package/dist/{app-shell-C_fKpljx.js.map → app-shell-ZK5RWdo6.js.map} +1 -1
  13. package/dist/attachment-BtfhGm8i.js +245 -0
  14. package/dist/attachment-BtfhGm8i.js.map +1 -0
  15. package/dist/{auth-CAQcasMV.js → auth-CYxKfo69.js} +239 -237
  16. package/dist/auth-CYxKfo69.js.map +1 -0
  17. package/dist/{avatar-Bu2HhitA.js → avatar-BBnEJIx8.js} +71 -68
  18. package/dist/avatar-BBnEJIx8.js.map +1 -0
  19. package/dist/badge-MrKVNzW9.js +93 -0
  20. package/dist/badge-MrKVNzW9.js.map +1 -0
  21. package/dist/base/accordion.js +1 -1
  22. package/dist/base/action-menu.js +1 -1
  23. package/dist/base/attachment.js +1 -1
  24. package/dist/base/avatar.js +1 -1
  25. package/dist/base/badge.js +1 -1
  26. package/dist/base/batch-action-bar.js +3 -0
  27. package/dist/base/buttons.js +2 -3
  28. package/dist/base/cards.js +2 -2
  29. package/dist/base/carousel.js +19 -19
  30. package/dist/base/carousel.js.map +1 -1
  31. package/dist/base/cascader.js +234 -224
  32. package/dist/base/cascader.js.map +1 -1
  33. package/dist/base/chart.js +1 -1
  34. package/dist/base/choice-inputs.js +3 -3
  35. package/dist/base/code-block.js +1 -1
  36. package/dist/base/combobox.js +1 -1
  37. package/dist/base/command.js +1 -1
  38. package/dist/base/copyable.js +1 -1
  39. package/dist/base/date-pickers.js +2 -2
  40. package/dist/base/display.js +7 -7
  41. package/dist/base/feedback.js +3 -3
  42. package/dist/base/forms-numeric.js +1 -1
  43. package/dist/base/forms.js +2 -2
  44. package/dist/base/inline-edit.js +81 -76
  45. package/dist/base/inline-edit.js.map +1 -1
  46. package/dist/base/item.js +1 -1
  47. package/dist/base/media-gallery.js +1 -1
  48. package/dist/base/metadata-list.js +3 -0
  49. package/dist/base/navigation.js +7 -7
  50. package/dist/base/popover-menu.js +1 -1
  51. package/dist/base/popover.js +1 -1
  52. package/dist/base/qr-code.js +7 -4
  53. package/dist/base/qr-code.js.map +1 -1
  54. package/dist/base/repeaters.js +175 -174
  55. package/dist/base/repeaters.js.map +1 -1
  56. package/dist/base/sheet.js +1 -1
  57. package/dist/base/sidebar.js +1 -1
  58. package/dist/base/signature-pad.js +148 -138
  59. package/dist/base/signature-pad.js.map +1 -1
  60. package/dist/base/skeleton.js +1 -1
  61. package/dist/base/spinner.js +1 -1
  62. package/dist/base/structure.js +1 -1
  63. package/dist/base/table.js +1 -1
  64. package/dist/base/text-inputs.js +2 -2
  65. package/dist/base/toaster.js +4 -4
  66. package/dist/base/toaster.js.map +1 -1
  67. package/dist/base/tree.js +1 -1
  68. package/dist/base/upload-queue.js +1 -1
  69. package/dist/base/upload.js +3 -3
  70. package/dist/base/value-inputs.js +2 -2
  71. package/dist/batch-action-bar-BZGDG-Si.js +104 -0
  72. package/dist/batch-action-bar-BZGDG-Si.js.map +1 -0
  73. package/dist/blocks/admin.js +264 -253
  74. package/dist/blocks/admin.js.map +1 -1
  75. package/dist/blocks/ai.js +293 -323
  76. package/dist/blocks/ai.js.map +1 -1
  77. package/dist/blocks/analytics/usage-card.js +1 -1
  78. package/dist/blocks/analytics.js +596 -587
  79. package/dist/blocks/analytics.js.map +1 -1
  80. package/dist/blocks/collaboration.js +1 -1
  81. package/dist/blocks/commerce/receipt.js +1 -1
  82. package/dist/blocks/commerce.js +2246 -1693
  83. package/dist/blocks/commerce.js.map +1 -1
  84. package/dist/blocks/data-display.js +3 -2
  85. package/dist/blocks/onboarding.js +50 -49
  86. package/dist/blocks/onboarding.js.map +1 -1
  87. package/dist/blocks/planning.js +82 -91
  88. package/dist/blocks/planning.js.map +1 -1
  89. package/dist/blocks/timelines.js +1 -1
  90. package/dist/breadcrumbs-D5t7I023.js +129 -0
  91. package/dist/breadcrumbs-D5t7I023.js.map +1 -0
  92. package/dist/{button-BZyfTvwm.js → button-QYwiyhD2.js} +15 -14
  93. package/dist/button-QYwiyhD2.js.map +1 -0
  94. package/dist/buttons-SbIcm1HJ.js +661 -0
  95. package/dist/buttons-SbIcm1HJ.js.map +1 -0
  96. package/dist/{cards-qGSErLw_.js → cards-CiiHpKYd.js} +8 -8
  97. package/dist/cards-CiiHpKYd.js.map +1 -0
  98. package/dist/{chart-Bsc5BICK.js → chart-QfrARkXl.js} +17 -15
  99. package/dist/chart-QfrARkXl.js.map +1 -0
  100. package/dist/checkbox-DhB6K0bK.js +36 -0
  101. package/dist/checkbox-DhB6K0bK.js.map +1 -0
  102. package/dist/choice-inputs-t6w3ATNz.js +766 -0
  103. package/dist/choice-inputs-t6w3ATNz.js.map +1 -0
  104. package/dist/code-block-Dgbu-CU3.js +185 -0
  105. package/dist/code-block-Dgbu-CU3.js.map +1 -0
  106. package/dist/{collapsible-ClvC7Bj3.js → collapsible-D8AEGU1-.js} +4 -4
  107. package/dist/{collapsible-ClvC7Bj3.js.map → collapsible-D8AEGU1-.js.map} +1 -1
  108. package/dist/{collection-content-D6S8cv_n.js → collection-content-uK16Grv0.js} +3 -3
  109. package/dist/{collection-content-D6S8cv_n.js.map → collection-content-uK16Grv0.js.map} +1 -1
  110. package/dist/{combobox-BFnbJJp3.js → combobox-2Ic8N9bL.js} +103 -98
  111. package/dist/combobox-2Ic8N9bL.js.map +1 -0
  112. package/dist/combobox-DLl0bfiq.js +867 -0
  113. package/dist/combobox-DLl0bfiq.js.map +1 -0
  114. package/dist/{command-BnmSchli.js → command-kNR20o7x.js} +34 -30
  115. package/dist/command-kNR20o7x.js.map +1 -0
  116. package/dist/{comments-u5L0OGip.js → comments-BpDuCUUu.js} +304 -301
  117. package/dist/comments-BpDuCUUu.js.map +1 -0
  118. package/dist/components/base/accordion/accordion-variants.d.ts +3 -3
  119. package/dist/components/base/action-menu/action-menu.d.ts +27 -5
  120. package/dist/components/base/action-menu/action-menu.recipes.d.ts +21 -0
  121. package/dist/components/base/action-menu/index.d.ts +1 -0
  122. package/dist/components/base/avatar/stacked-avatars.d.ts +5 -4
  123. package/dist/components/base/badge/badge.d.ts +1 -1
  124. package/dist/components/base/badge/badge.recipes.d.ts +6 -6
  125. package/dist/components/base/batch-action-bar/batch-action-bar.d.ts +50 -0
  126. package/dist/components/base/batch-action-bar/batch-action-bar.strings.d.ts +20 -0
  127. package/dist/components/base/batch-action-bar/index.d.ts +8 -0
  128. package/dist/components/base/buttons/base-button.d.ts +7 -0
  129. package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
  130. package/dist/components/base/buttons/button.recipes.d.ts +2 -2
  131. package/dist/components/base/buttons/button.variants.d.ts +1 -0
  132. package/dist/components/base/buttons/loader-button.d.ts +3 -1
  133. package/dist/components/base/buttons/text-button.d.ts +2 -2
  134. package/dist/components/base/carousel/carousel.d.ts +3 -1
  135. package/dist/components/base/chart/chart.d.ts +7 -7
  136. package/dist/components/base/choice-inputs/checkbox.d.ts +6 -7
  137. package/dist/components/base/choice-inputs/choice-types.d.ts +24 -3
  138. package/dist/components/base/choice-inputs/pill-radio-group.d.ts +9 -0
  139. package/dist/components/base/choice-inputs/select-popup.d.ts +9 -1
  140. package/dist/components/base/choice-inputs/switch-card.d.ts +1 -1
  141. package/dist/components/base/date-pickers/date-picker-field.d.ts +23 -0
  142. package/dist/components/base/date-pickers/datepicker.types.d.ts +13 -3
  143. package/dist/components/base/display/alert-dialog.d.ts +10 -3
  144. package/dist/components/base/display/content-block.d.ts +4 -2
  145. package/dist/components/base/display/date-block.d.ts +1 -1
  146. package/dist/components/base/display/dialog.d.ts +8 -5
  147. package/dist/components/base/display/icon-badge/icon-badge.d.ts +1 -1
  148. package/dist/components/base/display/surface-title.d.ts +6 -1
  149. package/dist/components/base/feedback/alert.d.ts +1 -1
  150. package/dist/components/base/feedback/state-display.d.ts +5 -4
  151. package/dist/components/base/forms/form-sizing.d.ts +43 -8
  152. package/dist/components/base/forms/workflow.d.ts +2 -0
  153. package/dist/components/base/forms-numeric/coordinates-input.d.ts +3 -0
  154. package/dist/components/base/forms-numeric/rounding-mode-select.d.ts +4 -1
  155. package/dist/components/base/metadata-list/index.d.ts +12 -0
  156. package/dist/components/{blocks/data-display/metadata → base/metadata-list}/metadata-list.d.ts +28 -25
  157. package/dist/components/{blocks/data-display/metadata → base/metadata-list}/metadata-value.d.ts +2 -2
  158. package/dist/components/base/navigation/dropdown-menu.d.ts +2 -2
  159. package/dist/components/base/navigation/index.d.ts +1 -1
  160. package/dist/components/base/navigation/language-switcher.d.ts +4 -1
  161. package/dist/components/base/navigation/overflow-tab-bar.d.ts +7 -0
  162. package/dist/components/base/navigation/page-header/index.d.ts +1 -0
  163. package/dist/components/base/navigation/page-header/page-header-commands.d.ts +73 -0
  164. package/dist/components/base/navigation/page-header/page-header.d.ts +30 -4
  165. package/dist/components/base/qr-code/qr-code.d.ts +2 -0
  166. package/dist/components/base/sheet/index.d.ts +29 -1
  167. package/dist/components/base/sheet/sheet.d.ts +10 -5
  168. package/dist/components/base/signature-pad/signature-pad.types.d.ts +5 -1
  169. package/dist/components/base/signature-pad/signature-pad.utils.d.ts +11 -3
  170. package/dist/components/base/spinner/spinner.d.ts +3 -2
  171. package/dist/components/base/structure/structure.types.d.ts +1 -1
  172. package/dist/components/base/text-inputs/field-clear-button.d.ts +6 -0
  173. package/dist/components/base/text-inputs/input-group.d.ts +2 -2
  174. package/dist/components/base/upload/upload.recipes.d.ts +33 -0
  175. package/dist/components/base/value-inputs/date-time-input.d.ts +4 -2
  176. package/dist/components/base/value-inputs/index.d.ts +5 -5
  177. package/dist/components/base/value-inputs/tags-input.d.ts +38 -12
  178. package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +1 -1
  179. package/dist/components/blocks/analytics/format-metric-value.d.ts +11 -1
  180. package/dist/components/blocks/analytics/index.d.ts +1 -1
  181. package/dist/components/blocks/analytics/use-metric-format-options.d.ts +3 -0
  182. package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
  183. package/dist/components/blocks/commerce/address-card/types.d.ts +4 -1
  184. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +4 -0
  185. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +2 -2
  186. package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +3 -1
  187. package/dist/components/blocks/commerce/cart-summary/index.d.ts +2 -2
  188. package/dist/components/blocks/commerce/cart-summary/types.d.ts +6 -1
  189. package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +3 -1
  190. package/dist/components/blocks/commerce/discount-stack/index.d.ts +2 -2
  191. package/dist/components/blocks/commerce/discount-stack/types.d.ts +16 -4
  192. package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +5 -0
  193. package/dist/components/blocks/commerce/fulfillment-group/index.d.ts +2 -0
  194. package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +43 -0
  195. package/dist/components/blocks/commerce/index.d.ts +13 -5
  196. package/dist/components/blocks/commerce/inventory-section/types.d.ts +4 -1
  197. package/dist/components/blocks/commerce/invoice-header/invoice-header.d.ts +1 -1
  198. package/dist/components/blocks/commerce/invoice-header/types.d.ts +4 -2
  199. package/dist/components/blocks/commerce/invoice-mini/invoice-mini.d.ts +1 -1
  200. package/dist/components/blocks/commerce/invoice-mini/types.d.ts +2 -1
  201. package/dist/components/blocks/commerce/loyalty-points/types.d.ts +1 -1
  202. package/dist/components/blocks/commerce/order-customer/index.d.ts +2 -0
  203. package/dist/components/blocks/commerce/order-customer/order-customer.d.ts +5 -0
  204. package/dist/components/blocks/commerce/order-customer/types.d.ts +48 -0
  205. package/dist/components/blocks/commerce/order-header/index.d.ts +2 -0
  206. package/dist/components/blocks/commerce/order-header/order-header.d.ts +5 -0
  207. package/dist/components/blocks/commerce/order-header/types.d.ts +37 -0
  208. package/dist/components/blocks/commerce/order-line-item/index.d.ts +2 -0
  209. package/dist/components/blocks/commerce/order-line-item/order-line-item.d.ts +5 -0
  210. package/dist/components/blocks/commerce/order-line-item/types.d.ts +46 -0
  211. package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
  212. package/dist/components/blocks/commerce/order-summary/index.d.ts +2 -0
  213. package/dist/components/blocks/commerce/order-summary/order-summary.d.ts +5 -0
  214. package/dist/components/blocks/commerce/order-summary/types.d.ts +42 -0
  215. package/dist/components/blocks/commerce/order-transactions/index.d.ts +2 -0
  216. package/dist/components/blocks/commerce/order-transactions/order-transactions.d.ts +5 -0
  217. package/dist/components/blocks/commerce/order-transactions/types.d.ts +46 -0
  218. package/dist/components/blocks/commerce/payment-method/index.d.ts +2 -2
  219. package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +9 -1
  220. package/dist/components/blocks/commerce/payment-method/types.d.ts +14 -1
  221. package/dist/components/blocks/commerce/refund-status/index.d.ts +2 -2
  222. package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +3 -1
  223. package/dist/components/blocks/commerce/refund-status/types.d.ts +6 -3
  224. package/dist/components/blocks/commerce/seo-listing/seo-listing-card.d.ts +1 -1
  225. package/dist/components/blocks/commerce/seo-listing/types.d.ts +3 -1
  226. package/dist/components/blocks/commerce/shared/address-lines.d.ts +21 -0
  227. package/dist/components/blocks/commerce/shared/line-thumbnail.d.ts +9 -0
  228. package/dist/components/blocks/commerce/shared/order-status.d.ts +51 -0
  229. package/dist/components/blocks/commerce/shipment-tracking/shipment-tracking.d.ts +1 -1
  230. package/dist/components/blocks/commerce/shipment-tracking/types.d.ts +27 -6
  231. package/dist/components/blocks/commerce/summary-panel/amount-row.d.ts +2 -0
  232. package/dist/components/blocks/commerce/summary-panel/index.d.ts +3 -0
  233. package/dist/components/blocks/commerce/summary-panel/summary-panel.d.ts +2 -0
  234. package/dist/components/blocks/commerce/summary-panel/types.d.ts +26 -0
  235. package/dist/components/blocks/commerce/tax-breakdown/tax-breakdown.d.ts +1 -1
  236. package/dist/components/blocks/commerce/tax-breakdown/types.d.ts +2 -1
  237. package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -1
  238. package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +4 -1
  239. package/dist/components/blocks/data-display/inline-stat/inline-stat.d.ts +4 -1
  240. package/dist/components/blocks/data-display/metadata/index.d.ts +30 -4
  241. package/dist/components/features/activities/partials/activity-row.d.ts +6 -2
  242. package/dist/components/features/activities/partials/tone-tokens.d.ts +0 -6
  243. package/dist/components/features/global-search/partials/global-search-group-heading.d.ts +15 -0
  244. package/dist/components/features/global-search/partials/global-search-idle-state.d.ts +1 -1
  245. package/dist/components/features/global-search/partials/tone-palettes.d.ts +0 -5
  246. package/dist/components/features/kanban/kanban.d.ts +1 -1
  247. package/dist/components/features/kanban/kanban.strings.d.ts +1 -1
  248. package/dist/components/features/kanban/kanban.types.d.ts +2 -2
  249. package/dist/components/features/media-library/hooks/use-media-library.d.ts +1 -1
  250. package/dist/components/features/media-library/index.d.ts +1 -1
  251. package/dist/components/features/media-library/media-library.d.ts +1 -1
  252. package/dist/components/features/media-library/media-library.strings.d.ts +4 -0
  253. package/dist/components/features/media-library/media-library.types.d.ts +74 -1
  254. package/dist/components/features/media-library/partials/media-library-partials.d.ts +3 -3
  255. package/dist/components/features/mentions/partials/mention-kind-toggles.d.ts +16 -0
  256. package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
  257. package/dist/components/features/overlays/dialog.d.ts +1 -1
  258. package/dist/components/features/overlays/drawer.d.ts +1 -1
  259. package/dist/components/features/overlays/hooks/use-overlay-actions.d.ts +2 -2
  260. package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +11 -4
  261. package/dist/components/features/overlays/index.d.ts +1 -1
  262. package/dist/components/features/overlays/overlay-tone-icon.d.ts +37 -0
  263. package/dist/components/features/overlays/overlays.types.d.ts +62 -19
  264. package/dist/components/features/products/components/product-contract-overview.d.ts +5 -0
  265. package/dist/components/features/products/components/product-details-card.d.ts +5 -0
  266. package/dist/components/features/products/components/product-operations-card.d.ts +5 -0
  267. package/dist/components/features/products/components/product-option-action-menu.d.ts +5 -0
  268. package/dist/components/features/products/components/product-options-summary.d.ts +5 -0
  269. package/dist/components/features/products/components/product-policies-card.d.ts +5 -0
  270. package/dist/components/features/products/components/product-quote-preview-card.d.ts +5 -0
  271. package/dist/components/features/products/components/product-readiness-card.d.ts +5 -0
  272. package/dist/components/features/products/components/product-structure-card.d.ts +5 -0
  273. package/dist/components/features/products/components/product-variant-action-menu.d.ts +23 -1
  274. package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
  275. package/dist/components/features/products/partials/index.d.ts +1 -1
  276. package/dist/components/features/products/partials/product-metric-tile.d.ts +6 -0
  277. package/dist/components/features/products/partials/product-tone.d.ts +11 -1
  278. package/dist/components/features/products/products.types.d.ts +11 -3
  279. package/dist/components/features/resource/index.d.ts +1 -1
  280. package/dist/components/features/resource/resource.d.ts +1 -1
  281. package/dist/components/features/resource/resource.types.d.ts +34 -6
  282. package/dist/components/features/rich-text-editor/index.d.ts +2 -1
  283. package/dist/components/features/rich-text-editor/partials/image-nodes.d.ts +13 -0
  284. package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +66 -0
  285. package/dist/components/features/rich-text-editor/partials/inline-reference-node.d.ts +19 -0
  286. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +1 -1
  287. package/dist/components/features/rich-text-editor/rich-text-editor.strings.d.ts +14 -0
  288. package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +45 -0
  289. package/dist/components/features/rich-text-editor/use-rich-text-images.d.ts +18 -0
  290. package/dist/components/features/sync/index.d.ts +26 -3
  291. package/dist/components/features/table/data-table.d.ts +1 -1
  292. package/dist/components/features/table/partials/cell-renderers.d.ts +1 -1
  293. package/dist/components/features/table/table.types.d.ts +32 -7
  294. package/dist/components/layout/page/index.d.ts +1 -1
  295. package/dist/components/layout/page/page.types.d.ts +51 -4
  296. package/dist/components/layout/page/partials/page-actions.d.ts +1 -0
  297. package/dist/components/layout/page/partials/page-header.d.ts +1 -1
  298. package/dist/components/layout/settings/settings.d.ts +16 -2
  299. package/dist/components/layout/workspace/workspace.types.d.ts +21 -4
  300. package/dist/components/primitives/date.d.ts +16 -3
  301. package/dist/components/primitives/dimensions.d.ts +6 -0
  302. package/dist/components/primitives/duration.d.ts +6 -0
  303. package/dist/components/primitives/file-size.d.ts +6 -0
  304. package/dist/components/primitives/index.d.ts +1 -1
  305. package/dist/components/primitives/initials.d.ts +11 -2
  306. package/dist/components/primitives/link.d.ts +7 -0
  307. package/dist/components/primitives/money.d.ts +29 -7
  308. package/dist/components/primitives/number.d.ts +17 -0
  309. package/dist/components/primitives/value-typography.d.ts +54 -0
  310. package/dist/components/primitives/value.d.ts +31 -6
  311. package/dist/components/typography/heading.d.ts +9 -1
  312. package/dist/components/typography/label.d.ts +3 -0
  313. package/dist/components/typography/rich-text/index.d.ts +1 -1
  314. package/dist/components/typography/rich-text/rich-text-tree.d.ts +19 -0
  315. package/dist/components/typography/rich-text/rich-text.d.ts +16 -0
  316. package/dist/components/typography/running-text.d.ts +12 -0
  317. package/dist/components/typography/text-link.d.ts +24 -1
  318. package/dist/components/typography/text.d.ts +12 -0
  319. package/dist/components/typography/text.styles.d.ts +35 -13
  320. package/dist/components/ui/button.d.ts +1 -1
  321. package/dist/components/ui/checkbox.d.ts +6 -0
  322. package/dist/components/ui/overlay.recipes.d.ts +6 -2
  323. package/dist/components/ui/select.d.ts +3 -1
  324. package/dist/components/ui/switch.d.ts +5 -0
  325. package/dist/{containers-DqB-bSYE.js → containers-DmWiJa2I.js} +36 -35
  326. package/dist/containers-DmWiJa2I.js.map +1 -0
  327. package/dist/{copyable-BTSByfmq.js → copyable-B3Gwgdqc.js} +6 -6
  328. package/dist/{copyable-BTSByfmq.js.map → copyable-B3Gwgdqc.js.map} +1 -1
  329. package/dist/data-display-DafIvCl5.js +960 -0
  330. package/dist/data-display-DafIvCl5.js.map +1 -0
  331. package/dist/date-BgK3bTdo.js +144 -0
  332. package/dist/date-BgK3bTdo.js.map +1 -0
  333. package/dist/date-picker-CF-DtUpF.js +1529 -0
  334. package/dist/date-picker-CF-DtUpF.js.map +1 -0
  335. package/dist/date-pickers-BmzxJl5l.js +174 -0
  336. package/dist/date-pickers-BmzxJl5l.js.map +1 -0
  337. package/dist/{display-CS6Hbk18.js → display-DsQTVzMz.js} +88 -87
  338. package/dist/display-DsQTVzMz.js.map +1 -0
  339. package/dist/{dropdown-menu-D-boNgGO.js → dropdown-menu-E2qmdC7o.js} +23 -16
  340. package/dist/dropdown-menu-E2qmdC7o.js.map +1 -0
  341. package/dist/features/activities.js +437 -521
  342. package/dist/features/activities.js.map +1 -1
  343. package/dist/features/ai-chat.js +174 -172
  344. package/dist/features/ai-chat.js.map +1 -1
  345. package/dist/features/async-preview.js +8 -8
  346. package/dist/features/async-preview.js.map +1 -1
  347. package/dist/features/combobox.js +1 -1
  348. package/dist/features/comments.js +1 -1
  349. package/dist/features/data-view.js +139 -138
  350. package/dist/features/data-view.js.map +1 -1
  351. package/dist/features/email-composer/engine.js +1 -1
  352. package/dist/features/email-composer.js +353 -352
  353. package/dist/features/email-composer.js.map +1 -1
  354. package/dist/features/event-calendar.js +262 -269
  355. package/dist/features/event-calendar.js.map +1 -1
  356. package/dist/features/filters.js +1 -1
  357. package/dist/features/global-search.js +307 -310
  358. package/dist/features/global-search.js.map +1 -1
  359. package/dist/features/kanban.js +95 -97
  360. package/dist/features/kanban.js.map +1 -1
  361. package/dist/features/map.js +56 -57
  362. package/dist/features/map.js.map +1 -1
  363. package/dist/features/media-library.js +914 -824
  364. package/dist/features/media-library.js.map +1 -1
  365. package/dist/features/mentions.js +1 -1
  366. package/dist/features/overlays.js +1 -1
  367. package/dist/features/products.js +1272 -1311
  368. package/dist/features/products.js.map +1 -1
  369. package/dist/features/questionnaire.js +204 -194
  370. package/dist/features/questionnaire.js.map +1 -1
  371. package/dist/features/resource-assignment.js +103 -95
  372. package/dist/features/resource-assignment.js.map +1 -1
  373. package/dist/features/resource.js +77 -69
  374. package/dist/features/resource.js.map +1 -1
  375. package/dist/features/rich-text-editor.js +30 -11
  376. package/dist/features/rich-text-editor.js.map +1 -1
  377. package/dist/features/schema-form.js +193 -189
  378. package/dist/features/schema-form.js.map +1 -1
  379. package/dist/features/suggestions.js +3 -3
  380. package/dist/features/sync.js +7 -7
  381. package/dist/features/sync.js.map +1 -1
  382. package/dist/features/table.js +1 -1
  383. package/dist/features/theme-tweaker.js +455 -455
  384. package/dist/features/theme-tweaker.js.map +1 -1
  385. package/dist/feedback-qNuMBtRH.js +233 -0
  386. package/dist/feedback-qNuMBtRH.js.map +1 -0
  387. package/dist/field-affordance-recipes-qQeIf4lG.js +48 -0
  388. package/dist/field-affordance-recipes-qQeIf4lG.js.map +1 -0
  389. package/dist/field-state-recipes-BVA2CWHo.js +12 -0
  390. package/dist/field-state-recipes-BVA2CWHo.js.map +1 -0
  391. package/dist/{filters-D6FF8L6s.js → filters-BkHH53uv.js} +414 -412
  392. package/dist/filters-BkHH53uv.js.map +1 -0
  393. package/dist/focus-recipes-B653VaLq.js +12 -0
  394. package/dist/focus-recipes-B653VaLq.js.map +1 -0
  395. package/dist/{form-field-CZwrkP7m.js → form-field-DUt4UxSV.js} +7 -7
  396. package/dist/{form-field-CZwrkP7m.js.map → form-field-DUt4UxSV.js.map} +1 -1
  397. package/dist/form-sizing-By94KzXE.js +130 -0
  398. package/dist/form-sizing-By94KzXE.js.map +1 -0
  399. package/dist/{forms-B5NCbkSC.js → forms-Bzha-Y3B.js} +25 -25
  400. package/dist/forms-Bzha-Y3B.js.map +1 -0
  401. package/dist/forms-numeric-C0bvjRPZ.js +906 -0
  402. package/dist/forms-numeric-C0bvjRPZ.js.map +1 -0
  403. package/dist/{header-kxruN3RM.js → header-BOefOKd1.js} +38 -41
  404. package/dist/header-BOefOKd1.js.map +1 -0
  405. package/dist/{hooks-BrlnCwQd.js → hooks-9k_TtmKh.js} +2 -2
  406. package/dist/{hooks-BrlnCwQd.js.map → hooks-9k_TtmKh.js.map} +1 -1
  407. package/dist/{http-CdEIHyQf.js → http-D_6rOnzU.js} +2 -2
  408. package/dist/{http-CdEIHyQf.js.map → http-D_6rOnzU.js.map} +1 -1
  409. package/dist/icon-badge-CAuKupo9.js +55 -0
  410. package/dist/icon-badge-CAuKupo9.js.map +1 -0
  411. package/dist/index.js +7 -7
  412. package/dist/input-DWhBBBww.js +262 -0
  413. package/dist/input-DWhBBBww.js.map +1 -0
  414. package/dist/{input-vxcaNCYC.js → input-Ddi_LSYv.js} +3 -3
  415. package/dist/{input-vxcaNCYC.js.map → input-Ddi_LSYv.js.map} +1 -1
  416. package/dist/interaction-recipes-CHr0dJUs.js +24 -0
  417. package/dist/interaction-recipes-CHr0dJUs.js.map +1 -0
  418. package/dist/item-DEmDiTlD.js +265 -0
  419. package/dist/item-DEmDiTlD.js.map +1 -0
  420. package/dist/layer-recipes-CCpklYME.js +13 -0
  421. package/dist/layer-recipes-CCpklYME.js.map +1 -0
  422. package/dist/layout/app-shell.js +1 -1
  423. package/dist/layout/auth.js +1 -1
  424. package/dist/layout/containers.js +1 -1
  425. package/dist/layout/header.js +1 -1
  426. package/dist/layout/hooks.js +1 -1
  427. package/dist/layout/navigation.js +1 -1
  428. package/dist/layout/page.js +1 -1
  429. package/dist/layout/settings.js +1 -1
  430. package/dist/layout/sidebar.js +2 -2
  431. package/dist/layout/workspace.js +1 -1
  432. package/dist/layout.js +10 -10
  433. package/dist/lib/affordance-geometry.generated.d.ts +7 -1
  434. package/dist/lib/field-affordance-recipes.d.ts +41 -1
  435. package/dist/lib/field-state-recipes.d.ts +9 -6
  436. package/dist/lib/focus-recipes.d.ts +24 -0
  437. package/dist/lib/format.d.ts +9 -0
  438. package/dist/lib/interaction-recipes.d.ts +35 -0
  439. package/dist/lib/layer-recipes.d.ts +19 -0
  440. package/dist/lib/money-format.d.ts +30 -0
  441. package/dist/lib/motion-recipes.d.ts +1 -0
  442. package/dist/lib/overlay-anatomy-recipes.d.ts +2 -1
  443. package/dist/lib/safe-image-src.d.ts +10 -0
  444. package/dist/lib/sanitize-html.d.ts +15 -3
  445. package/dist/lib/surface-recipes.d.ts +48 -6
  446. package/dist/lib/token-merge.generated.d.ts +17 -14
  447. package/dist/lib/tone-recipes.d.ts +79 -0
  448. package/dist/lib/track-recipes.d.ts +1 -1
  449. package/dist/lib/ui-provider/hooks.d.ts +2 -1
  450. package/dist/lib/ui-provider/index.d.ts +2 -2
  451. package/dist/lib/ui-provider/provider.d.ts +7 -2
  452. package/dist/lib/ui-provider/store.d.ts +6 -2
  453. package/dist/lib/ui-provider/types.d.ts +14 -2
  454. package/dist/lib/utils.js +1 -1
  455. package/dist/media-gallery-DcTtAaeC.js +203 -0
  456. package/dist/media-gallery-DcTtAaeC.js.map +1 -0
  457. package/dist/mentions-D-uyCh01.js +568 -0
  458. package/dist/mentions-D-uyCh01.js.map +1 -0
  459. package/dist/{message-SZUNB1eX.js → message-CdHgIWKf.js} +5 -5
  460. package/dist/{message-SZUNB1eX.js.map → message-CdHgIWKf.js.map} +1 -1
  461. package/dist/metadata-list-X5rYAKSB.js +394 -0
  462. package/dist/metadata-list-X5rYAKSB.js.map +1 -0
  463. package/dist/{motion-recipes-B6jKXEcN.js → motion-recipes-ChBg4HBq.js} +3 -2
  464. package/dist/{motion-recipes-B6jKXEcN.js.map → motion-recipes-ChBg4HBq.js.map} +1 -1
  465. package/dist/navigation-D3KwXmaq.js +145 -0
  466. package/dist/navigation-D3KwXmaq.js.map +1 -0
  467. package/dist/navigation-HJf5zxlH.js +268 -0
  468. package/dist/navigation-HJf5zxlH.js.map +1 -0
  469. package/dist/{navigation-row-recipes-DQEXQcqY.js → navigation-row-recipes-BVowojQw.js} +2 -2
  470. package/dist/{navigation-row-recipes-DQEXQcqY.js.map → navigation-row-recipes-BVowojQw.js.map} +1 -1
  471. package/dist/number-DMhe-Vsk.js +352 -0
  472. package/dist/number-DMhe-Vsk.js.map +1 -0
  473. package/dist/overflow-tab-bar-sQHXLlwQ.js +280 -0
  474. package/dist/overflow-tab-bar-sQHXLlwQ.js.map +1 -0
  475. package/dist/overlay.recipes-8GHqmlb4.js +6 -0
  476. package/dist/overlay.recipes-8GHqmlb4.js.map +1 -0
  477. package/dist/overlays-I0axtYA6.js +999 -0
  478. package/dist/overlays-I0axtYA6.js.map +1 -0
  479. package/dist/{page-hGmT4nWK.js → page-B5dTH9gE.js} +79 -68
  480. package/dist/page-B5dTH9gE.js.map +1 -0
  481. package/dist/page-header-commands-DjzFEq3E.js +126 -0
  482. package/dist/page-header-commands-DjzFEq3E.js.map +1 -0
  483. package/dist/{pagination-NLGqRirf.js → pagination-3bPA_a6K.js} +19 -19
  484. package/dist/{pagination-NLGqRirf.js.map → pagination-3bPA_a6K.js.map} +1 -1
  485. package/dist/{popover-CghIYdQf.js → popover-Di55PyAI.js} +8 -8
  486. package/dist/popover-Di55PyAI.js.map +1 -0
  487. package/dist/{popover-menu-B4PoWhRl.js → popover-menu-B71Tn2Qz.js} +6 -6
  488. package/dist/{popover-menu-B4PoWhRl.js.map → popover-menu-B71Tn2Qz.js.map} +1 -1
  489. package/dist/{popover.recipes-QlD4JenO.js → popover.recipes-Bdyhj2db.js} +2 -2
  490. package/dist/{popover.recipes-QlD4JenO.js.map → popover.recipes-Bdyhj2db.js.map} +1 -1
  491. package/dist/primitives-B-CkiEMU.js +379 -0
  492. package/dist/primitives-B-CkiEMU.js.map +1 -0
  493. package/dist/primitives.js +5 -5
  494. package/dist/{progress-BroqrAyV.js → progress-rnS8-uAW.js} +11 -11
  495. package/dist/progress-rnS8-uAW.js.map +1 -0
  496. package/dist/{receipt-BuJynLgf.js → receipt-D0oswZ0p.js} +6 -6
  497. package/dist/{receipt-BuJynLgf.js.map → receipt-D0oswZ0p.js.map} +1 -1
  498. package/dist/rich-text-DvGulsNJ.js +78 -0
  499. package/dist/rich-text-DvGulsNJ.js.map +1 -0
  500. package/dist/rich-text-editor-sMU_Scqm.js +1204 -0
  501. package/dist/rich-text-editor-sMU_Scqm.js.map +1 -0
  502. package/dist/rich-text-editor.recipes-CadiF_Uu.js +88 -0
  503. package/dist/rich-text-editor.recipes-CadiF_Uu.js.map +1 -0
  504. package/dist/rich-text-editor.strings-CB59ekH2.js +38 -0
  505. package/dist/rich-text-editor.strings-CB59ekH2.js.map +1 -0
  506. package/dist/safe-image-src-C6kQSMBZ.js +17 -0
  507. package/dist/safe-image-src-C6kQSMBZ.js.map +1 -0
  508. package/dist/sanitize-html-DsQmI48u.js +92 -0
  509. package/dist/sanitize-html-DsQmI48u.js.map +1 -0
  510. package/dist/scroll-area-Bt_vXY2b.js +48 -0
  511. package/dist/scroll-area-Bt_vXY2b.js.map +1 -0
  512. package/dist/{separator-BNIgG3au.js → separator-C8DlRGwF.js} +4 -4
  513. package/dist/separator-C8DlRGwF.js.map +1 -0
  514. package/dist/{separator-BhtFyo4x.js → separator-CYHnjsAb.js} +2 -2
  515. package/dist/{separator-BhtFyo4x.js.map → separator-CYHnjsAb.js.map} +1 -1
  516. package/dist/services/actions/action-adapters.d.ts +22 -0
  517. package/dist/services/actions/index.d.ts +1 -1
  518. package/dist/services/actions.js +23 -6
  519. package/dist/services/actions.js.map +1 -1
  520. package/dist/settings-CQW3b-Cu.js +170 -0
  521. package/dist/settings-CQW3b-Cu.js.map +1 -0
  522. package/dist/sheet-4SEvVYzA.js +210 -0
  523. package/dist/sheet-4SEvVYzA.js.map +1 -0
  524. package/dist/{sidebar-CyR4XKwR.js → sidebar-C7WWR29L.js} +181 -180
  525. package/dist/sidebar-C7WWR29L.js.map +1 -0
  526. package/dist/sidebar-d7Dg80ln.js +511 -0
  527. package/dist/sidebar-d7Dg80ln.js.map +1 -0
  528. package/dist/{skeleton-3F0uhYn3.js → skeleton-Cz890JZF.js} +10 -10
  529. package/dist/skeleton-Cz890JZF.js.map +1 -0
  530. package/dist/smart-card-lFKxn5Hu.js +595 -0
  531. package/dist/smart-card-lFKxn5Hu.js.map +1 -0
  532. package/dist/{spinner-Cpf7oRkF.js → spinner-fa3h1Aif.js} +10 -8
  533. package/dist/spinner-fa3h1Aif.js.map +1 -0
  534. package/dist/{structure-CRdqVawd.js → structure-DC2dygdA.js} +3 -3
  535. package/dist/{structure-CRdqVawd.js.map → structure-DC2dygdA.js.map} +1 -1
  536. package/dist/{structure.recipes-Bqhf9oIh.js → structure.recipes-EPz60cU8.js} +37 -19
  537. package/dist/structure.recipes-EPz60cU8.js.map +1 -0
  538. package/dist/style.css +1 -1
  539. package/dist/surface-recipes-BKRVW8Os.js +43 -0
  540. package/dist/surface-recipes-BKRVW8Os.js.map +1 -0
  541. package/dist/table-CIKyLUsy.js +163 -0
  542. package/dist/table-CIKyLUsy.js.map +1 -0
  543. package/dist/{table-CcRDZiLP.js → table-CrcLN9Io.js} +544 -530
  544. package/dist/table-CrcLN9Io.js.map +1 -0
  545. package/dist/tabs-DwBJfjxX.js +190 -0
  546. package/dist/tabs-DwBJfjxX.js.map +1 -0
  547. package/dist/{text-inputs-DsR56TR-.js → text-inputs-aaK9wcDT.js} +151 -155
  548. package/dist/text-inputs-aaK9wcDT.js.map +1 -0
  549. package/dist/{text.styles-Q4sGAIgA.js → text.styles-g4He6UIW.js} +17 -14
  550. package/dist/text.styles-g4He6UIW.js.map +1 -0
  551. package/dist/theme.css +16 -12
  552. package/dist/themes/green.css +24 -0
  553. package/dist/{timelines-D1pkt3se.js → timelines-C_SBwHNP.js} +154 -164
  554. package/dist/timelines-C_SBwHNP.js.map +1 -0
  555. package/dist/tone-recipes-CPoExcTE.js +70 -0
  556. package/dist/tone-recipes-CPoExcTE.js.map +1 -0
  557. package/dist/tooltip-CsfgrfS7.js +111 -0
  558. package/dist/tooltip-CsfgrfS7.js.map +1 -0
  559. package/dist/track-recipes-CDcKmndW.js +10 -0
  560. package/dist/track-recipes-CDcKmndW.js.map +1 -0
  561. package/dist/{tree-BtmYyMZV.js → tree-BiKhg8AY.js} +72 -70
  562. package/dist/tree-BiKhg8AY.js.map +1 -0
  563. package/dist/typography/rich-text.js +1 -1
  564. package/dist/typography-DTRkE9zL.js +117 -0
  565. package/dist/typography-DTRkE9zL.js.map +1 -0
  566. package/dist/typography.js +2 -2
  567. package/dist/{ui-provider-DRPn3qNl.js → ui-provider-1D_NSYzO.js} +30 -23
  568. package/dist/ui-provider-1D_NSYzO.js.map +1 -0
  569. package/dist/ui-provider.js +3 -3
  570. package/dist/{upload-CDbYw1WN.js → upload-BO8-CLN6.js} +294 -293
  571. package/dist/upload-BO8-CLN6.js.map +1 -0
  572. package/dist/{upload-queue-CNd_hH_a.js → upload-queue-EOC8g1gf.js} +133 -138
  573. package/dist/upload-queue-EOC8g1gf.js.map +1 -0
  574. package/dist/upload.recipes-BbxTqrCT.js +61 -0
  575. package/dist/upload.recipes-BbxTqrCT.js.map +1 -0
  576. package/dist/{usage-card-VyJLUwRr.js → usage-card-obRaBskq.js} +42 -43
  577. package/dist/{usage-card-VyJLUwRr.js.map → usage-card-obRaBskq.js.map} +1 -1
  578. package/dist/{utils-BvH9PSmq.js → utils-l5LpDw2z.js} +264 -62
  579. package/dist/utils-l5LpDw2z.js.map +1 -0
  580. package/dist/value-inputs-TAYMX111.js +947 -0
  581. package/dist/value-inputs-TAYMX111.js.map +1 -0
  582. package/dist/value-typography-b8wpz1eX.js +116 -0
  583. package/dist/value-typography-b8wpz1eX.js.map +1 -0
  584. package/dist/workspace-DH0v0KcB.js +407 -0
  585. package/dist/workspace-DH0v0KcB.js.map +1 -0
  586. package/docs/consumer-skill/SKILL.md +62 -50
  587. package/docs/consumer-skill/examples/app-layout.tsx +3 -5
  588. package/docs/consumer-skill/examples/composition.tsx +3 -3
  589. package/docs/consumer-skill/examples/detail.tsx +59 -13
  590. package/docs/consumer-skill/examples/edit.tsx +2 -2
  591. package/docs/consumer-skill/examples/layout-blocks.tsx +20 -0
  592. package/docs/consumer-skill/examples/manifest.json +28 -6
  593. package/docs/consumer-skill/examples/receipt.tsx +2 -2
  594. package/docs/consumer-skill/examples/scoped-directory.tsx +3 -3
  595. package/docs/consumer-skill/examples/website.tsx +1 -1
  596. package/docs/consumer-skill/references/agents-md.md +33 -0
  597. package/docs/consumer-skill/references/analytics.md +1 -1
  598. package/docs/consumer-skill/references/composition.md +139 -24
  599. package/docs/consumer-skill/references/design-contract.md +12 -3
  600. package/docs/consumer-skill/references/discovery.md +4 -0
  601. package/docs/consumer-skill/references/installation.md +33 -1
  602. package/docs/consumer-skill/references/integration.md +32 -1
  603. package/docs/consumer-skill/references/public-api.json +1051 -610
  604. package/docs/consumer-skill/references/review.md +44 -8
  605. package/docs/consumer-skill/references/theming.md +14 -4
  606. package/docs/consumer-skill/references/tokens.json +5 -2
  607. package/docs/consumer-skill/references/workflows.md +30 -9
  608. package/docs/consumer-skill/scripts/composition-policy.mjs +127 -6
  609. package/docs/consumer-skill/scripts/discovery.mjs +11 -3
  610. package/docs/consumer-skill/scripts/pin-button-defaults.mjs +95 -0
  611. package/docs/consumer-skill/scripts/surface-policy.mjs +139 -5
  612. package/package.json +13 -3
  613. package/dist/accordion-BRTcsp8J.js +0 -205
  614. package/dist/accordion-BRTcsp8J.js.map +0 -1
  615. package/dist/action-menu-Drxw_vJk.js +0 -265
  616. package/dist/action-menu-Drxw_vJk.js.map +0 -1
  617. package/dist/affordance-geometry.generated-CL84ZN9A.js.map +0 -1
  618. package/dist/ai-artifact-DLVdK0Py.js.map +0 -1
  619. package/dist/attachment-DbjUWsP0.js +0 -244
  620. package/dist/attachment-DbjUWsP0.js.map +0 -1
  621. package/dist/auth-CAQcasMV.js.map +0 -1
  622. package/dist/avatar-Bu2HhitA.js.map +0 -1
  623. package/dist/badge-CzId1Wlm.js +0 -92
  624. package/dist/badge-CzId1Wlm.js.map +0 -1
  625. package/dist/breadcrumbs-BuYz5SDU.js +0 -128
  626. package/dist/breadcrumbs-BuYz5SDU.js.map +0 -1
  627. package/dist/button-BZDasD04.js +0 -651
  628. package/dist/button-BZDasD04.js.map +0 -1
  629. package/dist/button-BZyfTvwm.js.map +0 -1
  630. package/dist/buttons-D_6KJvEE.js +0 -99
  631. package/dist/buttons-D_6KJvEE.js.map +0 -1
  632. package/dist/cards-qGSErLw_.js.map +0 -1
  633. package/dist/chart-Bsc5BICK.js.map +0 -1
  634. package/dist/checkbox-BQNDjUCh.js +0 -34
  635. package/dist/checkbox-BQNDjUCh.js.map +0 -1
  636. package/dist/choice-inputs-Mk3iWbhr.js +0 -725
  637. package/dist/choice-inputs-Mk3iWbhr.js.map +0 -1
  638. package/dist/code-block-DzHKRybS.js +0 -183
  639. package/dist/code-block-DzHKRybS.js.map +0 -1
  640. package/dist/combobox-BFnbJJp3.js.map +0 -1
  641. package/dist/combobox-hozNwUcc.js +0 -847
  642. package/dist/combobox-hozNwUcc.js.map +0 -1
  643. package/dist/command-BnmSchli.js.map +0 -1
  644. package/dist/comments-u5L0OGip.js.map +0 -1
  645. package/dist/containers-DqB-bSYE.js.map +0 -1
  646. package/dist/data-display-Bihs9Ven.js +0 -1342
  647. package/dist/data-display-Bihs9Ven.js.map +0 -1
  648. package/dist/date-DOKhJPu7.js +0 -140
  649. package/dist/date-DOKhJPu7.js.map +0 -1
  650. package/dist/date-picker-DzP5HQq7.js +0 -1541
  651. package/dist/date-picker-DzP5HQq7.js.map +0 -1
  652. package/dist/date-pickers-BpgGz7S-.js +0 -196
  653. package/dist/date-pickers-BpgGz7S-.js.map +0 -1
  654. package/dist/display-CS6Hbk18.js.map +0 -1
  655. package/dist/dropdown-menu-D-boNgGO.js.map +0 -1
  656. package/dist/feedback-CJkUAapr.js +0 -233
  657. package/dist/feedback-CJkUAapr.js.map +0 -1
  658. package/dist/field-affordance-recipes-uKY4MsZ_.js +0 -25
  659. package/dist/field-affordance-recipes-uKY4MsZ_.js.map +0 -1
  660. package/dist/field-state-recipes-DQQpiLWC.js +0 -11
  661. package/dist/field-state-recipes-DQQpiLWC.js.map +0 -1
  662. package/dist/filters-D6FF8L6s.js.map +0 -1
  663. package/dist/form-sizing-QP8aIRaW.js +0 -103
  664. package/dist/form-sizing-QP8aIRaW.js.map +0 -1
  665. package/dist/format-iamDSqs2.js +0 -110
  666. package/dist/format-iamDSqs2.js.map +0 -1
  667. package/dist/forms-B5NCbkSC.js.map +0 -1
  668. package/dist/forms-numeric-Crrm80Lm.js +0 -867
  669. package/dist/forms-numeric-Crrm80Lm.js.map +0 -1
  670. package/dist/header-kxruN3RM.js.map +0 -1
  671. package/dist/icon-badge-Btc6pQrp.js +0 -53
  672. package/dist/icon-badge-Btc6pQrp.js.map +0 -1
  673. package/dist/input-SX9V0AL3.js +0 -255
  674. package/dist/input-SX9V0AL3.js.map +0 -1
  675. package/dist/item-DE4YnuJx.js +0 -258
  676. package/dist/item-DE4YnuJx.js.map +0 -1
  677. package/dist/media-gallery-DLp3HAz0.js +0 -201
  678. package/dist/media-gallery-DLp3HAz0.js.map +0 -1
  679. package/dist/mentions-Cl0Kt_Pd.js +0 -565
  680. package/dist/mentions-Cl0Kt_Pd.js.map +0 -1
  681. package/dist/navigation-DnQSNMT0.js +0 -276
  682. package/dist/navigation-DnQSNMT0.js.map +0 -1
  683. package/dist/navigation-DyytsLRB.js +0 -265
  684. package/dist/navigation-DyytsLRB.js.map +0 -1
  685. package/dist/number-DasMFWEG.js +0 -269
  686. package/dist/number-DasMFWEG.js.map +0 -1
  687. package/dist/overlay.recipes-BxW5FIfK.js +0 -6
  688. package/dist/overlay.recipes-BxW5FIfK.js.map +0 -1
  689. package/dist/overlays-DUbs1KEi.js +0 -1011
  690. package/dist/overlays-DUbs1KEi.js.map +0 -1
  691. package/dist/page-hGmT4nWK.js.map +0 -1
  692. package/dist/page-header-D8nERkn5.js +0 -112
  693. package/dist/page-header-D8nERkn5.js.map +0 -1
  694. package/dist/popover-CghIYdQf.js.map +0 -1
  695. package/dist/primitives-C7ff0QaI.js +0 -337
  696. package/dist/primitives-C7ff0QaI.js.map +0 -1
  697. package/dist/progress-BroqrAyV.js.map +0 -1
  698. package/dist/rich-text-DlxDOtf4.js +0 -32
  699. package/dist/rich-text-DlxDOtf4.js.map +0 -1
  700. package/dist/rich-text-editor-BKyG7rWz.js +0 -574
  701. package/dist/rich-text-editor-BKyG7rWz.js.map +0 -1
  702. package/dist/rich-text-editor.recipes-B72Nfuze.js +0 -81
  703. package/dist/rich-text-editor.recipes-B72Nfuze.js.map +0 -1
  704. package/dist/rich-text-editor.strings-BpnIQgMl.js +0 -25
  705. package/dist/rich-text-editor.strings-BpnIQgMl.js.map +0 -1
  706. package/dist/sanitize-html-BG9FGe-j.js +0 -64
  707. package/dist/sanitize-html-BG9FGe-j.js.map +0 -1
  708. package/dist/scroll-area-D-pIhEKl.js +0 -47
  709. package/dist/scroll-area-D-pIhEKl.js.map +0 -1
  710. package/dist/separator-BNIgG3au.js.map +0 -1
  711. package/dist/settings-DOTOzeZ2.js +0 -161
  712. package/dist/settings-DOTOzeZ2.js.map +0 -1
  713. package/dist/sheet-BFhrNehm.js +0 -205
  714. package/dist/sheet-BFhrNehm.js.map +0 -1
  715. package/dist/sidebar-CyR4XKwR.js.map +0 -1
  716. package/dist/sidebar-SvGJ0Zwi.js +0 -506
  717. package/dist/sidebar-SvGJ0Zwi.js.map +0 -1
  718. package/dist/skeleton-3F0uhYn3.js.map +0 -1
  719. package/dist/smart-card-DjGVV2xr.js +0 -584
  720. package/dist/smart-card-DjGVV2xr.js.map +0 -1
  721. package/dist/spinner-Cpf7oRkF.js.map +0 -1
  722. package/dist/structure.recipes-Bqhf9oIh.js.map +0 -1
  723. package/dist/surface-recipes-Dd__PD-w.js +0 -28
  724. package/dist/surface-recipes-Dd__PD-w.js.map +0 -1
  725. package/dist/table-CLtJTxoR.js +0 -147
  726. package/dist/table-CLtJTxoR.js.map +0 -1
  727. package/dist/table-CcRDZiLP.js.map +0 -1
  728. package/dist/tabs-BNgu7g0u.js +0 -188
  729. package/dist/tabs-BNgu7g0u.js.map +0 -1
  730. package/dist/text-inputs-DsR56TR-.js.map +0 -1
  731. package/dist/text.styles-Q4sGAIgA.js.map +0 -1
  732. package/dist/timelines-D1pkt3se.js.map +0 -1
  733. package/dist/track-recipes-LLPNVwFg.js +0 -10
  734. package/dist/track-recipes-LLPNVwFg.js.map +0 -1
  735. package/dist/tree-BtmYyMZV.js.map +0 -1
  736. package/dist/typography-BxQgiZyw.js +0 -96
  737. package/dist/typography-BxQgiZyw.js.map +0 -1
  738. package/dist/ui-provider-DRPn3qNl.js.map +0 -1
  739. package/dist/upload-CDbYw1WN.js.map +0 -1
  740. package/dist/upload-queue-CNd_hH_a.js.map +0 -1
  741. package/dist/use-file-drop-target-BX7GnhoQ.js +0 -39
  742. package/dist/use-file-drop-target-BX7GnhoQ.js.map +0 -1
  743. package/dist/utils-BvH9PSmq.js.map +0 -1
  744. package/dist/value-inputs-D0KCrfVC.js +0 -840
  745. package/dist/value-inputs-D0KCrfVC.js.map +0 -1
  746. package/dist/workspace-CcR8r-Nt.js +0 -395
  747. package/dist/workspace-CcR8r-Nt.js.map +0 -1
  748. /package/dist/components/{blocks/data-display/metadata → base/metadata-list}/metadata-list.strings.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"commerce.js","names":["NumberValue","_Fragment","_Fragment","_Fragment","NumberValue","Receipt","NumberValue","_Fragment","normalizeCode","NumberValue","_Fragment","NumberValue","NumberValue","_Fragment","useMoneyConfig","cn","Text","Heading","DisplayLabel","TextLink","Button","Grid","Stack","Card","Progress","CardPrimaryAction","Value","Phone","SecondaryValue","MonoValue","Initials","Percent","Money","Number$1","IconBadge","AvatarFallback","Avatar","AvatarImage","Badge","Separator","Input","ToggleField","Select","CardRadioGroup","DateBlock","ContentBlock","FormField","TagsInput","DecimalInput","WeightInput","ItemFooter","ItemMedia","ItemDescription","ItemActions","ItemGroup","ItemContent","Item","ItemTitle","TabsTrigger","TabsContent","TabsList","Tabs","InlineStat","MetadataList","Receipt","ReceiptItems","Timeline","Fragment$1","Receipt$1","UpcomingBookingRow","className","bookings","b","timePlacement","dateTone","dateVariant","idx","renderItemValue","value","BookingCalendarEventCard","status","contentClassName","items","item","onAction","actionLabel","defaultLoyaltyPointsStrings","LoyaltyPoints","stringsProp","strings","useStrings","tierTone","Trophy","tier","balance","history","entry","Gift","onRedeem","stripLeadingMinus","formatDeduction","defaultDiscountStackStrings","DiscountStackPreview","discounts","d","index","totalSavings","shipmentStatusDotTone","defaultShipmentTrackingStrings","ShipmentTracking","trackingNumber","carrier","steps","step","i","details","detail","defaultGiftcardStrings","giftcardStatusTone","inverseGradient","gradientMap","compactGradientMap","accentColorMap","headerGradientMap","GiftcardCompact","statusLabel","statusTone","isPartiallyUsed","remainingAmount","amount","displayAmount","gradient","code","recipientName","GiftcardCopyButton","copyStrings","generation","useRef","result","setResult","useState","state","previous","label","Icon","Check","X","Loader2","Copy","copy","request","inverse","GiftcardCardDark","metadataItems","expiresAt","onView","Eye","GiftcardFull","_createdAt","_template","senderName","pattern","message","GiftcardCardIllustrated","headerColor","GiftcardCardMinimal","accent","color","ArrowRight","GiftcardCard","props","defaultVendorProfileStrings","CHANGE_VARIANTS","ChangeBadge","hasRenderableContent","children","tone","VendorProfileCard","forwardRef","internalView","setInternalView","defaultView","isViewControlled","view","hasEarnings","earnings","hasOverviewContent","metrics","hasStatsContent","stats","availableTabs","requestedView","activeView","hasBody","hasActions","onMessage","onHire","handleViewChange","nextValue","onViewChange","overviewContent","earningsChangeTone","earningsChange","metric","statsContent","stat","profileBody","avatarUrl","name","initials","role","verified","MessageSquare","ChevronRight","defaultInventoryLevelStrings","InventoryLevel","pct","stock","maxStock","isLow","reorderLevel","isCritical","badgeTone","badgeLabel","productName","variant","lastRestocked","defaultTaxBreakdownStrings","TaxBreakdownCard","subtotal","taxes","tax","totalTax","total","defaultSubscriptionSummaryStrings","SubscriptionSummaryCard","Repeat","planName","priceLabel","cycleLabel","Calendar","nextBillingDate","perks","perk","onManage","onUpgrade","defaultRefundStatusStrings","STAGE_ORDER","RefundStatusCard","currentIdx","stage","RotateCcw","requestedAt","done","current","s","reason","method","eta","defaultAddressCardStrings","AddressCard","defaultAddress","titleByKind","cityLine","city","region","postalCode","actions","onEdit","Edit2","onMakeDefault","Star","onRemove","Trash2","MapPin","kind","line1","line2","country","phone","defaultVoucherEntryStrings","normalizeCode$1","VoucherEntry","inputId","useId","setCode","trimmedCode","appliedCode","event","onCheck","error","defaultCartSummaryStrings","resolveCartLineTitle","resolveCartLineImageSrc","CartLineImagePlaceholder","title","CartSummaryCard","hasBreakdown","shipping","discount","ShoppingBag","it","imageSrc","onCheckout","defaultCouponInputStrings","normalizeCode","CouponInputCard","TicketPercent","appliedDiscount","Sparkles","onApply","defaultOrderStatusStrings","VARIANT_BY_STATUS","OrderStatusCard","lastCompleteIdx","events","e","acc","latestEvent","nextEvent","Package","orderNumber","currentEta","isLast","isCurrent","CalendarClock","Circle","defaultPaymentMethodStrings","BRAND_LABEL","BRAND_SURFACE","BRAND_GRADIENT","PaymentMethod","defaultMethod","brandLabel","brand","CreditCard","onChange","last4","holderName","expiry","DEFAULT_SEO_LISTING_LIMITS","resolveLimits","limits","clampScore","getCheckStatus","maxScore","ratio","score","makeCheck","scoreRatio","range","lengthScore","length","min","max","overBy","getSeoPermalinkPath","permalink","getSeoPermalinkSlug","permalinkScore","path","slugScore","slug","urlScore","baseUrl","keywordScore","keyword","input","haystack","calculateSeoListingScore","description","permalinkPath","checks","sum","check","defaultSeoListingCardStrings","SCORE_BADGE_TONE","SCORE_PROGRESS_CLASS","SCORE_PANEL_CLASS","SCORE_ICON_CLASS","CHECK_ICON","CheckCircle2","TriangleAlert","CircleAlert","CHECK_ICON_CLASS","CHECK_ROW_CLASS","trimSlashes","buildUrlParts","permalinkParts","pathSegments","buildHref","base","getCheckDetail","SeoCheckRow","SeoListingCard","resolvedBaseUrl","resolvedSiteName","siteName","resolvedTitle","resolvedDescription","scoreResult","href","urlParts","Search","Pencil","ExternalLink","part","price","Gauge","showChecks","defaultInvoiceMiniStrings","count","invoiceStatusTone","InvoiceMini","mergeStrings","labelByStatus","invoice","defaultInvoiceHeaderStrings","PartyBlock","eyebrow","location","InvoiceHeader","resolvedStatusTone","invoiceNumber","from","to","issuedDate","dueDate","defaultInvoiceLineItemsStrings","wrapperGlass","ALIGN_CLASS","InvoiceCurrencyValue","buildDefaultColumns","buildDefaultFooterRows","taxRate","InvoiceLineItems","resolvedCurrency","currency","defaultCurrency","resolvedColumns","columns","resolvedFooterRows","footerRows","gridTemplate","c","defaultGrid","col","row","isSimpleText","OrderTimeline","PaymentTimeline","defaultInventorySectionStrings","STATUS_VARIANT","METRIC_TONE_CLASS","parseQuantity","parsed","getInventoryStatus","available","threshold","getMetricTone","metricId","SectionHeading","SummaryMetric","InventorySectionCard","isDisabled","disabled","readOnly","isTracked","requiresShipping","shippingFieldsDisabled","isSectionVisible","visibleSections","section","isFieldVisible","visibleFields","field","updateField","previousValue","next","handleGenerateSku","onGenerateSku","generatedSku","PackageCheck","onRestock","RefreshCw","errors","Barcode","checked","locationOptions","unit","countryOptions","nextTags","tagRecommendations","maxTags"],"sources":["../../src/components/blocks/commerce/upcoming-booking/upcoming-booking.tsx","../../src/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.tsx","../../src/components/blocks/commerce/loyalty-points/types.ts","../../src/components/blocks/commerce/loyalty-points/loyalty-points.tsx","../../src/components/blocks/commerce/format-signed-amount.ts","../../src/components/blocks/commerce/discount-stack/types.ts","../../src/components/blocks/commerce/discount-stack/discount-stack.tsx","../../src/components/blocks/commerce/shipment-tracking/types.ts","../../src/components/blocks/commerce/shipment-tracking/shipment-tracking.tsx","../../src/components/blocks/commerce/giftcard-card/types.ts","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-compact.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-copy-button.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-dark.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-full.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-illustrated.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-minimal.tsx","../../src/components/blocks/commerce/giftcard-card/giftcard-card.tsx","../../src/components/blocks/commerce/vendor-profile/types.ts","../../src/components/blocks/commerce/vendor-profile/vendor-profile.tsx","../../src/components/blocks/commerce/inventory-level/inventory-level.strings.ts","../../src/components/blocks/commerce/inventory-level/inventory-level.tsx","../../src/components/blocks/commerce/tax-breakdown/types.ts","../../src/components/blocks/commerce/tax-breakdown/tax-breakdown.tsx","../../src/components/blocks/commerce/subscription-summary/types.ts","../../src/components/blocks/commerce/subscription-summary/subscription-summary.tsx","../../src/components/blocks/commerce/refund-status/types.ts","../../src/components/blocks/commerce/refund-status/refund-status.tsx","../../src/components/blocks/commerce/address-card/types.ts","../../src/components/blocks/commerce/address-card/address-card.tsx","../../src/components/blocks/commerce/voucher-entry/types.ts","../../src/components/blocks/commerce/voucher-entry/voucher-entry.tsx","../../src/components/blocks/commerce/cart-summary/types.ts","../../src/components/blocks/commerce/cart-summary/cart-summary.tsx","../../src/components/blocks/commerce/coupon-input/types.ts","../../src/components/blocks/commerce/coupon-input/coupon-input.tsx","../../src/components/blocks/commerce/order-status/types.ts","../../src/components/blocks/commerce/order-status/order-status.tsx","../../src/components/blocks/commerce/payment-method/types.ts","../../src/components/blocks/commerce/payment-method/payment-method.tsx","../../src/components/blocks/commerce/seo-listing/seo-listing-score.ts","../../src/components/blocks/commerce/seo-listing/types.ts","../../src/components/blocks/commerce/seo-listing/seo-listing-card.tsx","../../src/components/blocks/commerce/invoice-mini/types.ts","../../src/components/blocks/commerce/invoice-mini/invoice-mini.tsx","../../src/components/blocks/commerce/invoice-header/types.ts","../../src/components/blocks/commerce/invoice-header/invoice-header.tsx","../../src/components/blocks/commerce/invoice-line-items/types.ts","../../src/components/blocks/commerce/invoice-line-items/invoice-line-items.tsx","../../src/components/blocks/commerce/order-timeline/order-timeline.tsx","../../src/components/blocks/commerce/payment-timeline/payment-timeline.tsx","../../src/components/blocks/commerce/inventory-section/types.ts","../../src/components/blocks/commerce/inventory-section/inventory-section.tsx"],"sourcesContent":["/**\n * UpcomingBookingRow — compact booking list. Each row shows a `DateBlock`\n * (weekday / day / month / time) on the left, service + customer in the\n * middle, and trailing amount. Locale and date-tone are configurable.\n *\n * Time is placed BELOW the date block by default (matches the date block\n * vertical rhythm); pass `timePlacement=\"inline-trailing\"` to use a\n * separate trailing time column.\n */\nimport { DateBlock } from '../../../base/display/date-block';\nimport { SecondaryValue, Value } from '../../../primitives';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemGroup,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\n\nimport type { UpcomingBookingRowProps } from './types';\n\nimport { cn } from '../../../../lib/utils';\n\nexport function UpcomingBookingRow({\n\tbookings,\n\tclassName,\n\tlocale,\n\t// `inverse` paints a near-black tile in the light theme, which reads as a\n\t// heavy foreign block in an otherwise soft admin list and does not match how\n\t// DateBlock renders anywhere else. Neutral by default; pass\n\t// `dateVariant=\"inverse\"` for the inverted treatment deliberately.\n\tdateTone = 'neutral',\n\tdateVariant = 'default',\n\ttimePlacement = 'below',\n}: UpcomingBookingRowProps) {\n\treturn (\n\t\t<ItemGroup className={cn('upcoming-booking--component w-full gap-space-md', className)}>\n\t\t\t{bookings.map((b, idx) => (\n\t\t\t\t\t<Item key={b.id ?? `${b.service}-${b.time}-${idx}`} className=\"items-center\">\n\t\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t\t<DateBlock\n\t\t\t\t\t\t\t\tdate={b.date}\n\t\t\t\t\t\t\t\ttime={timePlacement === 'below' ? b.time : undefined}\n\t\t\t\t\t\t\t\ttone={dateTone}\n\t\t\t\t\t\t\t\tvariant={dateVariant}\n\t\t\t\t\t\t\t\tlocale={locale}\n\t\t\t\t\t\t\t\ttimePlacement=\"below\"\n\t\t\t\t\t\t\t\tlayout=\"stacked\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t<ItemContent className=\"min-w-0 sm:min-w-48\">\n\t\t\t\t\t\t\t<ItemTitle>{b.service}</ItemTitle>\n\t\t\t\t\t\t\t<ItemDescription clamp={1}>{b.customer}</ItemDescription>\n\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t<ItemActions className=\"ml-auto shrink-0 flex-wrap justify-end\">\n\t\t\t\t\t\t\t{timePlacement === 'inline-trailing' && (\n\t\t\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"shrink-0 tabular-nums\">\n\t\t\t\t\t\t\t\t\t{b.time}\n\t\t\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Value weight=\"semibold\" className=\"shrink-0 tabular-nums\">\n\t\t\t\t\t\t\t\t{b.amount}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t</ItemActions>\n\t\t\t\t\t</Item>\n\t\t\t))}\n\t\t</ItemGroup>\n\t);\n}\n\nUpcomingBookingRow.displayName = 'UpcomingBookingRow';\n","import type { ReactNode } from 'react';\n\nimport { CardPrimaryAction } from '../../../base/cards';\nimport { ContentBlock } from '../../../base/display';\nimport { Value } from '../../../primitives';\nimport { DisplayLabel } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport type { BookingCalendarEventCardProps } from './booking-calendar-event-card.types';\n\nfunction renderItemValue(value: ReactNode): ReactNode {\n\tif (\n\t\ttypeof value === 'string' ||\n\t\ttypeof value === 'number' ||\n\t\ttypeof value === 'bigint'\n\t) {\n\t\treturn <Value>{String(value)}</Value>;\n\t}\n\n\treturn value;\n}\n\n/**\n * Compact, card-free booking detail composition.\n *\n * All visible copy is supplied by props, so this component intentionally has\n * no strings file. Frame it with `Card` only when the page needs card\n * chrome.\n */\nexport function BookingCalendarEventCard({\n\ttitle,\n\tdescription,\n\tstatus,\n\titems,\n\tactionLabel,\n\tonAction,\n\tclassName,\n\tcontentClassName,\n}: BookingCalendarEventCardProps) {\n\treturn (\n\t\t<ContentBlock\n\t\t\ttitle={title}\n\t\t\tdescription={description}\n\t\t\theaderEnd={status}\n\t\t\theaderDivider\n\t\t\tclassName={cn('booking-calendar-event-card--component @container/booking-calendar-event-card', className)}\n\t\t\tcontentClassName={cn('grid gap-space-lg', contentClassName)}\n\t\t>\n\t\t\t<dl className=\"booking-calendar-event-card--details grid gap-space-lg @md/booking-calendar-event-card:grid-cols-2\">\n\t\t\t\t{items.map((item) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'grid min-w-0 gap-space-sm',\n\t\t\t\t\t\t\titem.fullWidth === true &&\n\t\t\t\t\t\t\t\t'@md/booking-calendar-event-card:col-span-2 rounded-radius bg-muted/45 p-surface-xs',\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<dt><DisplayLabel>{item.label}</DisplayLabel></dt>\n\t\t\t\t\t\t<dd className=\"min-w-0\">{renderItemValue(item.value)}</dd>\n\t\t\t\t\t</div>\n\t\t\t\t))}\n\t\t\t</dl>\n\n\t\t\t<div className=\"booking-calendar-event-card--action flex justify-end border-t border-border/60 pt-space-lg\">\n\t\t\t\t<CardPrimaryAction\n\t\t\t\t\tfullWidth={false}\n\t\t\t\t\tclassName=\"w-full @md/booking-calendar-event-card:w-auto\"\n\t\t\t\t\tonClick={onAction}\n\t\t\t\t>\n\t\t\t\t\t{actionLabel}\n\t\t\t\t</CardPrimaryAction>\n\t\t\t</div>\n\t\t</ContentBlock>\n\t);\n}\n\nBookingCalendarEventCard.displayName = 'BookingCalendarEventCard';\n","import type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface LoyaltyHistoryEntry {\n\t/** Display label. */\n\tlabel: string;\n\tpoints: string;\n\tdate: string;\n\tpositive: boolean;\n}\n\nexport interface LoyaltyPointsStrings {\n\tbalanceLabel: string;\n\tpointsAvailable: string;\n\tredeem: string;\n\t/** Tier chip label used when `tier` is not passed. */\n\ttier: string;\n}\n\nexport const defaultLoyaltyPointsStrings: LoyaltyPointsStrings = {\n\tbalanceLabel: 'Loyalty Balance',\n\tpointsAvailable: 'points available',\n\tredeem: 'Redeem Points',\n\ttier: 'Gold Tier',\n};\n\nexport interface LoyaltyPointsProps {\n\t/** Points currently available. */\n\tbalance: number | string;\n\t/** Membership tier name. Defaults to `strings.tier`. */\n\ttier?: string;\n\t/** Badge tone for the tier chip. @default 'warning' */\n\ttierTone?: BadgeTone;\n\t/** Recent point movements. */\n\thistory?: LoyaltyHistoryEntry[];\n\tonRedeem?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<LoyaltyPointsStrings>;\n}\n","/**\n * LoyaltyPoints — current balance, tier badge, recent history rows\n * (label / date / signed-points), and a redemption CTA. Strings overridable\n * for i18n.\n */\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { ContentBlock } from '../../../base/display';\nimport { Number as NumberValue } from '../../../primitives';\nimport { Heading } from '../../../typography/heading';\nimport { Text } from '../../../typography/text';\nimport { InlineStat } from '../../data-display';\nimport { Separator } from '../../../base/display/separator';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemGroup,\n\tItemTitle,\n} from '../../../base/item';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\nimport { Gift, Trophy } from 'lucide-react';\n\nimport { defaultLoyaltyPointsStrings, type LoyaltyPointsProps } from './types';\n\nexport function LoyaltyPoints({\n\tbalance,\n\ttier,\n\ttierTone = 'warning',\n\thistory = [],\n\tonRedeem,\n\tclassName,\n\tstrings: stringsProp,\n}: LoyaltyPointsProps) {\n\tconst strings = useStrings(defaultLoyaltyPointsStrings, stringsProp);\n\treturn (\n\t\t<ContentBlock className={cn('loyalty-points--component w-full', className)}>\n\t\t\t<InlineStat\n\t\t\t\tlabel={strings.balanceLabel}\n\t\t\t\tvalue={\n\t\t\t\t\t<Badge tone={tierTone}>\n\t\t\t\t\t\t<Trophy className=\"mr-1 inline size-icon-sm\" />\n\t\t\t\t\t\t{tier ?? strings.tier}\n\t\t\t\t\t</Badge>\n\t\t\t\t}\n\t\t\t/>\n\n\t\t\t<Heading tag=\"h3\" className=\"text-base tabular-nums tracking-tight\">\n\t\t\t\t{typeof balance === 'number' ? (\n\t\t\t\t\t<NumberValue value={balance} size=\"base\" weight=\"bold\" align=\"left\" />\n\t\t\t\t) : balance}\n\t\t\t</Heading>\n\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t{strings.pointsAvailable}\n\t\t\t</Text>\n\n\t\t\t<Separator className=\"my-space-xl\" />\n\n\t\t\t<ItemGroup>\n\t\t\t\t{history.map((entry) => (\n\t\t\t\t\t<Item key={entry.date + entry.label} size=\"sm\">\n\t\t\t\t\t\t<ItemContent>\n\t\t\t\t\t\t\t<ItemTitle bold={false}>{entry.label}</ItemTitle>\n\t\t\t\t\t\t\t<ItemDescription clamp={1}>{entry.date}</ItemDescription>\n\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t<ItemActions>\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t'tabular-nums',\n\t\t\t\t\t\t\t\t\tentry.positive ? 'text-success' : 'text-destructive',\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{entry.points}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</ItemActions>\n\t\t\t\t\t</Item>\n\t\t\t\t))}\n\t\t\t</ItemGroup>\n\n\t\t\t<Button\n\t\t\t\ticon={Gift}\n\t\t\t\tfullWidth\n\t\t\t\tclassName=\"mt-space-xl\"\n\t\t\t\tonClick={onRedeem}\n\t\t\t>\n\t\t\t\t{strings.redeem}\n\t\t\t</Button>\n\t\t</ContentBlock>\n\t);\n}\n\nLoyaltyPoints.displayName = 'LoyaltyPoints';\n","/**\n * Negative-amount presentation shared across commerce surfaces.\n *\n * Consumers pass amounts as opaque preformatted strings, sometimes already\n * carrying a leading \"-\" and sometimes not. Rendering those raw meant the same\n * concept — money coming off a total — appeared with a HYPHEN-MINUS in one card\n * and a MINUS SIGN in the next.\n *\n * U+2212 is the correct glyph: it is drawn to the width of a digit and sits on\n * the maths axis, so it aligns in a tabular-figures column where the narrower,\n * lower hyphen does not.\n */\n\n/** U+2212 MINUS SIGN. */\nexport const MINUS_SIGN = '−';\n\n/** Drop any leading sign or whitespace a consumer already supplied. */\nexport function stripLeadingMinus(value: string): string {\n\treturn value.replace(/^[\\s−-]+/, '');\n}\n\n/**\n * Present an amount as a deduction: exactly one U+2212, whatever the caller\n * passed in. An empty or whitespace-only value is returned untouched so the\n * caller's own empty handling still applies.\n */\nexport function formatDeduction(value: string): string {\n\tif (!value.trim()) return value;\n\treturn `${MINUS_SIGN}${stripLeadingMinus(value)}`;\n}\n","import type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface Discount {\n\ttype: string;\n\t/** Display label. */\n\tlabel: string;\n\tamount: string;\n\t/** Chip rendered beside the label. */\n\tbadge: BadgeTone;\n}\n\nexport interface DiscountStackStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Formatted sum of every discount. */\n\ttotalSavings: string;\n}\n\nexport const defaultDiscountStackStrings: DiscountStackStrings = {\n\ttitle: 'Applied Discounts',\n\ttotalSavings: 'Total Savings',\n};\n\nexport interface DiscountStackPreviewProps {\n\t/** Discounts applied, in the order they stack. */\n\tdiscounts: Discount[];\n\t/** Formatted sum of every discount. */\n\ttotalSavings: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<DiscountStackStrings>;\n}\n","/**\n * DiscountStackPreview — list of applied discounts (type chip + label +\n * amount) with a total-savings summary line. Strings overridable for i18n.\n */\nimport { Badge } from '../../../base/badge';\nimport { ContentBlock } from '../../../base/display';\nimport { Heading, Text } from '../../../typography';\nimport { InlineStat } from '../../data-display';\nimport { Separator } from '../../../base/display/separator';\nimport { Value } from '../../../primitives';\nimport { formatDeduction } from '../format-signed-amount';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemGroup,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { useStrings } from '../../../../lib/strings';\n\nimport { defaultDiscountStackStrings, type DiscountStackPreviewProps } from './types';\n\nimport { cn } from '../../../../lib/utils';\nexport function DiscountStackPreview({\n\tdiscounts,\n\ttotalSavings,\n\tclassName,\n\tstrings: stringsProp,\n}: DiscountStackPreviewProps) {\n\tconst strings = useStrings(defaultDiscountStackStrings, stringsProp);\n\treturn (\n\t\t<ContentBlock title={strings.title} className={cn('discount-stack--component w-full', className)}>\n\t\t\t<ItemGroup className=\"mt-space-xl\">\n\t\t\t\t{/* `type` is a chip label, not an identity — two \"SEASONAL\" rows\n\t\t\t\t collided on it and React dropped one. Index-suffixing keeps the\n\t\t\t\t key unique without inventing a required `id` prop. */}\n\t\t\t\t{discounts.map((d, index) => (\n\t\t\t\t\t<Item key={`${d.type}-${d.label}-${String(index)}`} size=\"sm\">\n\t\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t\t<Badge tone={d.badge} className=\"w-16 justify-center\">\n\t\t\t\t\t\t\t\t{d.type}\n\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t<ItemContent>\n\t\t\t\t\t\t\t<ItemTitle bold={false}>{d.label}</ItemTitle>\n\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t<ItemActions>\n\t\t\t\t\t\t\t<Value weight=\"semibold\" className=\"tabular-nums text-success\">\n\t\t\t\t\t\t\t\t{formatDeduction(d.amount)}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t</ItemActions>\n\t\t\t\t\t</Item>\n\t\t\t\t))}\n\t\t\t</ItemGroup>\n\n\t\t\t<Separator className=\"my-space-xl\" />\n\n\t\t\t<InlineStat\n\t\t\t\tlabel={<Text tag=\"span\" weight=\"semibold\" lineHeight=\"tight\">{strings.totalSavings}</Text>}\n\t\t\t\tvalue={\n\t\t\t\t\t<Heading tag=\"h4\" className=\"text-base tabular-nums tracking-tight text-success border-none pb-0\">\n\t\t\t\t\t\t{formatDeduction(totalSavings)}\n\t\t\t\t\t</Heading>\n\t\t\t\t}\n\t\t\t/>\n\t\t</ContentBlock>\n\t);\n}\n\nDiscountStackPreview.displayName = 'DiscountStackPreview';\n","import type { StringsProp } from '../../../../lib/strings';\n\n/**\n * Transit stage. Drives the status label (through `strings`) and the tone of\n * the status dot, so a delayed shipment can never be painted as a healthy one.\n */\nexport type ShipmentStatus = 'pending' | 'in_transit' | 'delivered' | 'delayed';\n\n/** Dot tone per stage. Semantic state tokens only — never a raw palette colour. */\nexport const shipmentStatusDotTone: Record<ShipmentStatus, string> = {\n\tpending: 'bg-muted-foreground',\n\tin_transit: 'bg-info',\n\tdelivered: 'bg-success',\n\tdelayed: 'bg-warning',\n};\n\nexport interface TrackingStep {\n\t/** Display label. */\n\tlabel: string;\n\tdone: boolean;\n}\n\nexport interface ShipmentDetail {\n\t/** Display label. */\n\tlabel: string;\n\tvalue: string;\n}\n\nexport interface ShipmentTrackingStrings {\n\t/** Accessible name for the surface. */\n\ttitle: string;\n\t/** Status label for each `ShipmentStatus`. */\n\tpending: string;\n\tin_transit: string;\n\tdelivered: string;\n\tdelayed: string;\n}\n\nexport const defaultShipmentTrackingStrings: ShipmentTrackingStrings = {\n\ttitle: 'Shipment tracking',\n\tpending: 'Pending',\n\tin_transit: 'In transit',\n\tdelivered: 'Delivered',\n\tdelayed: 'Delayed',\n};\n\nexport interface ShipmentTrackingProps {\n\t/** Carrier tracking reference. */\n\ttrackingNumber: string;\n\t/** Carrier handling the shipment. */\n\tcarrier?: string;\n\t/** Current transit stage. */\n\tstatus: ShipmentStatus;\n\t/** Tracking checkpoints, oldest first. */\n\tsteps: TrackingStep[];\n\t/** Label/value facts about the shipment. */\n\tdetails?: ShipmentDetail[];\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<ShipmentTrackingStrings>;\n}\n","/**\n * ShipmentTracking — tracking number + carrier header, current status\n * with a status dot, horizontal step progress bar, and an optional details row\n * grid (e.g. weight, ETA, recipient). Step and detail labels are\n * consumer-supplied; the status label and its dot tone are both derived from\n * `status`, with the labels overridable through `strings`.\n */\nimport { Badge } from '../../../base/badge';\nimport { ContentBlock } from '../../../base/display';\nimport { Text } from '../../../typography/text';\nimport { InlineStat } from '../../data-display';\nimport { Separator } from '../../../base/display/separator';\nimport { MonoValue } from '../../../primitives';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultShipmentTrackingStrings,\n\tshipmentStatusDotTone,\n\ttype ShipmentTrackingProps,\n} from './types';\n\nexport function ShipmentTracking({\n\ttrackingNumber,\n\tcarrier,\n\tstatus,\n\tsteps,\n\tdetails = [],\n\tclassName,\n\tstrings: stringsProp,\n}: ShipmentTrackingProps) {\n\tconst strings = useStrings(defaultShipmentTrackingStrings, stringsProp);\n\n\treturn (\n\t\t<ContentBlock\n\t\t\taria-label={strings.title}\n\t\t\tclassName={cn('shipment-tracking--component w-full', className)}\n\t\t>\n\t\t\t<div className=\"flex items-center justify-between\">\n\t\t\t\t<MonoValue className=\"text-muted-foreground tracking-wide\">\n\t\t\t\t\t{trackingNumber}\n\t\t\t\t</MonoValue>\n\t\t\t\t{!!carrier && <Badge tone=\"info\">{carrier}</Badge>}\n\t\t\t</div>\n\n\t\t\t<div className=\"shipment-tracking--status mt-space-xl flex items-center gap-space-sm\">\n\t\t\t\t<span\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'shipment-tracking--status-dot h-2 w-2 rounded-full',\n\t\t\t\t\t\tshipmentStatusDotTone[status],\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t\t<Text weight=\"semibold\">\n\t\t\t\t\t{strings[status]}\n\t\t\t\t</Text>\n\t\t\t</div>\n\n\t\t\t<div className=\"mt-space-xl flex items-center justify-between\">\n\t\t\t\t{steps.map((step, i) => (\n\t\t\t\t\t// The dot leads its column and the connector fills the remainder,\n\t\t\t\t\t// so the node sits at the column's left edge. The label has to\n\t\t\t\t\t// start there too — centring it in the column pushed every label\n\t\t\t\t\t// half a column right of the dot it names, which read as if the\n\t\t\t\t\t// labels belonged to the segments between nodes.\n\t\t\t\t\t<div key={step.label} className=\"flex flex-1 flex-col items-start gap-space-md\">\n\t\t\t\t\t\t<div className=\"flex w-full items-center\">\n\t\t\t\t\t\t\t<div className={cn('size-icon-sm shrink-0 rounded-full', step.done ? 'bg-success' : 'bg-muted')} />\n\t\t\t\t\t\t\t{i < steps.length - 1 && (\n\t\t\t\t\t\t\t\t<div className={cn('h-0.5 flex-1', step.done ? 'bg-success' : 'bg-muted')} />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"text-left leading-tight\">\n\t\t\t\t\t\t\t{step.label}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</div>\n\t\t\t\t))}\n\t\t\t</div>\n\n\t\t\t{details.length > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<Separator className=\"my-space-xl\" />\n\t\t\t\t\t<div className=\"space-y-space-md\">\n\t\t\t\t\t\t{details.map((detail) => (\n\t\t\t\t\t\t\t<InlineStat\n\t\t\t\t\t\t\t\tkey={detail.label}\n\t\t\t\t\t\t\t\tlabel={detail.label}\n\t\t\t\t\t\t\t\tvalue={detail.value}\n\t\t\t\t\t\t\t\tvalueClassName=\"font-medium truncate max-w-[180px]\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</ContentBlock>\n\t);\n}\n\nShipmentTracking.displayName = 'ShipmentTracking';\n","import type { StringsProp } from '../../../../lib/strings';\n\n/**\n * The card's content, shared by all five presentations. Every field is\n * pre-formatted display copy — this family renders what it is handed and does\n * no currency or date formatting of its own, so localisation stays with the\n * consumer.\n */\nexport interface GiftcardData {\n\t/** Redemption code, shown in a monospace run. */\n\tcode: string;\n\t/** Formatted face value, e.g. `\"$50.00\"`. */\n\tamount: string;\n\t/** Formatted balance left. Omit for a card that shows only its face value. */\n\tremainingAmount?: string;\n\t/** Currency label shown beside the amount when the formatted values omit it. */\n\tcurrency?: string;\n\t/** Lifecycle state, driving the status chip's tone. */\n\tstatus: 'active' | 'redeemed' | 'expired' | 'disabled';\n\t/** Who the card is for. */\n\trecipientName?: string;\n\t/** Who sent it. */\n\tsenderName?: string;\n\t/** Personal note from the sender. */\n\tmessage?: string;\n\t/** Formatted expiry date. */\n\texpiresAt?: string;\n\t/** Formatted issue date. */\n\tcreatedAt?: string;\n\t/** Design name shown as the card's template label. */\n\ttemplate?: string;\n\t/** Fired by the card's view action. Omit to render the card without it. */\n\tonView?: () => void;\n}\n\n/** Background gradient for the illustrated and full presentations. */\nexport type GradientVariant = 'purple' | 'green' | 'warm';\n/** Decorative overlay drawn on top of the gradient. */\nexport type PatternVariant = 'none' | 'circles' | 'waves';\n/** Accent used for the minimal presentation's rule and highlights. */\nexport type AccentColor = 'green' | 'purple' | 'warm';\n/** Header band colour for the compact presentation. */\nexport type HeaderColor = 'green' | 'blue' | 'amber';\n\nexport type GiftcardStatus = GiftcardData['status'];\n\n/**\n * Localised labels for giftcard cards. Covers status chips, the recurring\n * field labels rendered by all five partials (full / dark / illustrated /\n * minimal / compact), and the inline button labels.\n *\n * Override per-instance via `strings`.\n */\nexport interface GiftcardStrings {\n\tstatus: Record<GiftcardStatus, string>;\n\tgiftCard: string;\n\tbalance: string;\n\tpersonalMessage: string;\n\tto: string;\n\tfrom: string;\n\texpires: string;\n\trecipient: string;\n\tviewDetails: string;\n\tcopyCode: string;\n\t/** Successful code-copy feedback. */\n\tcopiedCode?: string;\n\t/** Failed code-copy feedback and retry affordance. */\n\tcopyFailed?: string;\n\t/** Pending code-copy label. */\n\tcopyingCode?: string;\n}\n\nexport const defaultGiftcardStrings: Required<GiftcardStrings> = {\n\tstatus: {\n\t\tactive: 'Active',\n\t\tredeemed: 'Redeemed',\n\t\texpired: 'Expired',\n\t\tdisabled: 'Disabled',\n\t},\n\tgiftCard: 'Gift Card',\n\tbalance: 'Balance',\n\tpersonalMessage: 'Personal Message',\n\tto: 'To',\n\tfrom: 'From',\n\texpires: 'Expires',\n\trecipient: 'Recipient',\n\tviewDetails: 'View Details',\n\tcopyCode: 'Copy code',\n\tcopiedCode: 'Code copied',\n\tcopyFailed: 'Could not copy code. Try again.',\n\tcopyingCode: 'Copying code…',\n};\n\nexport interface GiftcardCommonProps {\n\t/** Override default English giftcard strings. */\n\tstrings?: StringsProp<GiftcardStrings>;\n}\n\nexport const giftcardStatusTone: Record<\n\tGiftcardStatus,\n\t'success' | 'secondary' | 'destructive' | 'warning'\n> = {\n\tactive: 'success',\n\tredeemed: 'secondary',\n\texpired: 'destructive',\n\tdisabled: 'warning',\n};\n\n// Reading regions stay inverse; preset colors belong to their decorative strip.\nconst inverseGradient = 'bg-inverse-background from-inverse-background via-inverse-surface to-inverse-background';\n\nexport const gradientMap: Record<GradientVariant, { card: string; strip: string }> = {\n\tpurple: {\n\t\tcard: inverseGradient,\n\t\tstrip: 'from-primary via-primary/90 to-info',\n\t},\n\tgreen: {\n\t\tcard: inverseGradient,\n\t\tstrip: 'from-success via-info to-success',\n\t},\n\twarm: {\n\t\tcard: inverseGradient,\n\t\tstrip: 'from-warning via-warning/90 to-destructive',\n\t},\n};\n\nexport const compactGradientMap: Record<GradientVariant, string> = {\n\tpurple: 'from-primary to-info',\n\tgreen: 'from-success to-info',\n\twarm: 'from-warning to-destructive',\n};\n\nexport const accentColorMap: Record<AccentColor, { line: string; iconBg: string }> = {\n\tgreen: { line: 'bg-success', iconBg: 'bg-success/15 text-success' },\n\tpurple: { line: 'bg-primary', iconBg: 'bg-primary/15 text-primary-accent' },\n\twarm: { line: 'bg-warning', iconBg: 'bg-warning/15 text-warning-accent' },\n};\n\nexport const headerGradientMap: Record<HeaderColor, string> = {\n\tgreen: 'from-success to-info',\n\tblue: 'from-info to-primary',\n\tamber: 'from-warning to-destructive',\n};\n\n","/**\n * GiftcardCompact — single-row compact layout. Square gradient gift icon on\n * the left, code + recipient in the middle, amount + status badge on the\n * right. Use for inline lists / tables of giftcards. Strings overridable.\n */\nimport { Badge } from '../../../../base/badge';\nimport { MonoValue, Value } from '../../../../primitives';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemMedia,\n\tItemTitle,\n} from '../../../../base/item';\nimport { Stack } from '../../../../base/structure';\nimport { useStrings } from '../../../../../lib/strings';\nimport { cn } from '../../../../../lib/utils';\nimport { Gift } from 'lucide-react';\nimport {\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\ttype GradientVariant,\n\tcompactGradientMap,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n} from '../types';\n\nexport function GiftcardCompact({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\tgradient = 'purple',\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData & GiftcardCommonProps & {\n\t/** Background gradient for the leading block. */\n\tgradient?: GradientVariant;\n\t/** Merged onto the row root. */\n\tclassName?: string;\n}) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\n\treturn (\n\t\t<Item\n\t\t\tsize=\"sm\"\n\t\t\tvariant=\"outline\"\n\t\t\tpadding=\"default\"\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component giftcard-compact--component flex-nowrap shadow-sm transition-colors duration-150 hover:border-border',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<ItemMedia variant=\"image\">\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'flex size-full items-center justify-center bg-gradient-to-br p-space-2xs',\n\t\t\t\t\t\tcompactGradientMap[gradient],\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<span className=\"flex size-full items-center justify-center rounded-inner bg-inverse-background\"><Gift className=\"h-4 w-4 text-inverse-foreground\" /></span>\n\t\t\t\t</div>\n\t\t\t</ItemMedia>\n\n\t\t\t<ItemContent className=\"min-w-0\">\n\t\t\t\t<ItemTitle className=\"w-full max-w-full truncate whitespace-nowrap\">\n\t\t\t\t\t<MonoValue>{code}</MonoValue>\n\t\t\t\t</ItemTitle>\n\t\t\t\t{!!recipientName && <ItemDescription clamp={1}>{recipientName}</ItemDescription>}\n\t\t\t</ItemContent>\n\n\t\t\t<ItemActions className=\"shrink-0\">\n\t\t\t\t<Stack gap=\"2xs\" align=\"end\" className=\"shrink-0\">\n\t\t\t\t\t<div className=\"flex items-baseline gap-space-xs\">\n\t\t\t\t\t\t<Value weight=\"bold\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t\t<Value size=\"xs\" className=\"line-through tabular-nums text-muted-foreground\">\n\t\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t<Badge tone={statusTone} size=\"sm\">{statusLabel}</Badge>\n\t\t\t\t</Stack>\n\t\t\t</ItemActions>\n\t\t</Item>\n\t);\n}\n\nGiftcardCompact.displayName = 'GiftcardCompact';\n","import { useEffect, useRef, useState } from 'react';\nimport { Check, Copy, Loader2, X } from 'lucide-react';\nimport { Button } from '../../../../base/buttons';\nimport { Text } from '../../../../typography';\nimport { cn } from '../../../../../lib/utils';\nimport { defaultGiftcardStrings, type GiftcardStrings } from '../types';\nimport { useStrings } from '../../../../../lib/strings';\n\ntype CopyState = 'idle' | 'pending' | 'copied' | 'failed';\n\n/** Owns the four giftcard code actions without changing their display strips. */\nexport function GiftcardCopyButton({ code, strings, inverse = false, className }: {\n code: string;\n strings: Pick<GiftcardStrings, 'copyCode' | 'copiedCode' | 'copyFailed' | 'copyingCode'>;\n /** Explicit inverse reading surface, independent of the surrounding page theme. */\n inverse?: boolean;\n className?: string;\n}) {\n const copyStrings = useStrings<Required<GiftcardStrings>>(defaultGiftcardStrings, strings);\n const generation = useRef(0);\n const [result, setResult] = useState<{ code: string; state: CopyState }>({code, state: 'idle'});\n const state = result.code === code ? result.state : 'idle';\n useEffect(() => {\n generation.current++;\n setResult(previous => previous.code === code ? previous : {code, state: 'idle'});\n return () => { generation.current++; };\n }, [code]);\n const label = state === 'copied' ? copyStrings.copiedCode : state === 'failed' ? copyStrings.copyFailed : state === 'pending' ? copyStrings.copyingCode : copyStrings.copyCode;\n const Icon = state === 'copied' ? Check : state === 'failed' ? X : state === 'pending' ? Loader2 : Copy;\n const copy = async () => {\n if (!code || state === 'pending') return;\n const request = generation.current;\n setResult({code, state: 'pending'});\n try {\n await navigator.clipboard.writeText(code);\n if (generation.current === request) setResult({code, state: 'copied'});\n } catch {\n if (generation.current === request) setResult({code, state: 'failed'});\n }\n };\n return <>\n <Button\n type=\"button\" tone=\"secondary\" buttonStyle=\"ghost\" size=\"sm\" iconOnly\n disabled={!code || state === 'pending'} aria-busy={state === 'pending'}\n aria-label={label} withTooltip={label}\n className={cn(\n 'giftcard-copy--component', className,\n // Use the same complete state selector as the shared Button recipe so cn\n // replaces its page-themed fill instead of leaving a more specific rule.\n inverse && 'text-inverse-foreground [&:hover:not(:active):not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-inverse-surface [&:hover:not(:active):not(:disabled):not([data-disabled]):not([aria-disabled=true])]:text-inverse-foreground [&:active:not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-inverse-surface-strong focus-visible:bg-inverse-surface focus-visible:ring-offset-inverse-background',\n )}\n onClick={() => void copy()}\n >\n <Icon aria-hidden className={cn('size-icon-sm', state === 'pending' && 'animate-spin')} />\n </Button>\n {(state === 'copied' || state === 'failed') && <Text tag=\"span\" role=\"status\" className=\"sr-only\">{label}</Text>}\n </>;\n}\n","import { GiftcardCopyButton } from './giftcard-copy-button';\n/**\n * GiftcardCardDark — premium dark variant. Header with chart-2 gift icon,\n * status chip, balance + strike-through line, code strip, metadata rows\n * (recipient / expires), and an outline call-to-action footer. Strings\n * overridable for i18n.\n */\nimport { Heading } from '../../../../typography/heading';\nimport { Text } from '../../../../typography/text';\nimport { Badge } from '../../../../base/badge';\nimport { Button } from '../../../../base/buttons';\nimport { MetadataList, type MetadataListItem } from '../../../data-display/metadata';\nimport { MonoValue, Value } from '../../../../primitives';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemMedia,\n\tItemTitle,\n} from '../../../../base/item';\nimport { useStrings } from '../../../../../lib/strings';\nimport { Stack } from '../../../../base/structure';\nimport { cn } from '../../../../../lib/utils';\nimport { Gift, Eye } from 'lucide-react';\nimport {\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n} from '../types';\n\nexport function GiftcardCardDark({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\texpiresAt,\n\tonView,\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData & GiftcardCommonProps & { className?: string }) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\tconst metadataItems: MetadataListItem[] = [\n\t\t...(recipientName ? [{ label: strings.recipient, value: recipientName }] : []),\n\t\t...(expiresAt ? [{ label: strings.expires, value: expiresAt }] : []),\n\t];\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component giftcard-dark--component dark w-full max-w-sm overflow-hidden rounded-radius bg-card text-card-foreground shadow-sm ring-1 ring-border',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<Item size=\"sm\" className=\"p-surface\">\n\t\t\t\t<ItemMedia>\n\t\t\t\t\t<div className=\"flex h-8 w-8 items-center justify-center rounded-full bg-warning/15\">\n\t\t\t\t\t\t<Gift className=\"h-4 w-4 text-warning-accent\" />\n\t\t\t\t\t</div>\n\t\t\t\t</ItemMedia>\n\t\t\t\t<ItemContent>\n\t\t\t\t\t<ItemTitle bold={false}>\n\t\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" className=\"text-inverse-muted\">\n\t\t\t\t\t\t\t{strings.giftCard}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</ItemTitle>\n\t\t\t\t</ItemContent>\n\t\t\t\t<ItemActions>\n\t\t\t\t\t<Badge tone={statusTone}>{statusLabel}</Badge>\n\t\t\t\t</ItemActions>\n\t\t\t</Item>\n\n\t\t\t{/* Amount */}\n\t\t\t<div className=\"px-surface pb-surface-xs pt-space-sm\">\n\t\t\t\t<div className=\"flex items-baseline gap-space-md\">\n\t\t\t\t\t<Heading tag=\"h2\" size=\"2xl\" className=\"border-none pb-0 tabular-nums text-inverse-foreground\">\n\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t<Value className=\"line-through tabular-nums text-inverse-disabled\">\n\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t{/* Code strip */}\n\t\t\t<div className=\"mx-space-xl rounded-inner border border-inverse-border bg-inverse-surface p-surface-xs\">\n\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"md\">\n\t\t\t\t<MonoValue className=\"flex-1 tracking-[0.15em] text-inverse-foreground\">\n\t\t\t\t\t{code}\n\t\t\t\t</MonoValue>\n\t\t\t\t<GiftcardCopyButton code={code} strings={strings} inverse />\n\t\t\t</Stack>\n\t\t\t</div>\n\n\t\t\t<MetadataList\n\t\t\t\titems={metadataItems}\n\t\t\t\tcolumns={1}\n\t\t\t\tclassName=\"px-surface pb-surface-xs pt-surface-xs [&_.metadata-list--label]:text-inverse-muted [&_.metadata-list--value]:text-inverse-foreground\"\n\t\t\t/>\n\n\t\t\t{/* Footer — inverse button on the dark surface so the label\n\t\t\t always reads without raw palette overrides. */}\n\t\t\t{!!onView && (\n\t\t\t\t<div className=\"px-surface pb-surface pt-space-sm\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttone=\"neutral\"\n\t\t\t\t\t\tbuttonStyle=\"solid\"\n\t\t\t\t\t\ticon={Eye}\n\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\tonClick={onView}\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.viewDetails}\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nGiftcardCardDark.displayName = 'GiftcardCardDark';\n","import { GiftcardCopyButton } from './giftcard-copy-button';\n/**\n * GiftcardCard (full) — premium gradient layout with optional\n * pattern overlay (circles / waves), header status chip, balance / strike-\n * through line, copyable code strip, personal message block, and metadata\n * grid (To / From / Expires). Strings overridable for i18n.\n */\nimport { DisplayLabel } from '../../../../typography/display-label';\nimport { Text } from '../../../../typography/text';\nimport { Heading } from '../../../../typography/heading';\nimport { Badge } from '../../../../base/badge';\nimport { Button } from '../../../../base/buttons';\nimport { Stack } from '../../../../base/structure';\nimport { MetadataList, type MetadataListItem } from '../../../data-display/metadata';\nimport { MonoValue, Value } from '../../../../primitives';\nimport { useStrings } from '../../../../../lib/strings';\nimport { cn } from '../../../../../lib/utils';\nimport {\n\tGift,\n\tEye,\n} from 'lucide-react';\nimport {\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\ttype GradientVariant,\n\ttype PatternVariant,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n\tgradientMap,\n} from '../types';\n\nexport function GiftcardFull({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\tsenderName,\n\tmessage,\n\texpiresAt,\n\tcreatedAt: _createdAt,\n\ttemplate: _template,\n\tonView,\n\tgradient = 'purple',\n\tpattern = 'none',\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData &\n\tGiftcardCommonProps & {\n\t\t/** Background gradient. */\n\t\tgradient?: GradientVariant;\n\t\t/** Decorative overlay on the gradient. */\n\t\tpattern?: PatternVariant;\n\t\tclassName?: string;\n\t}) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\tconst metadataItems: MetadataListItem[] = [\n\t\t...(recipientName ? [{ label: strings.to, value: recipientName }] : []),\n\t\t...(senderName ? [{ label: strings.from, value: senderName }] : []),\n\t\t...(expiresAt ? [{ label: strings.expires, value: expiresAt }] : []),\n\t];\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component w-full max-w-sm transition-shadow duration-300 ease-out',\n\t\t\t\t'hover:shadow-md hover:shadow-foreground/10',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{/* Gift card header */}\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'relative overflow-hidden rounded-t-radius bg-gradient-to-br p-surface',\n\t\t\t\t\tgradientMap[gradient].card,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<div aria-hidden className={cn('absolute inset-x-0 top-0 z-10 h-1 bg-gradient-to-r', gradientMap[gradient].strip)} />\n\t\t\t\t{/* Pattern: circles */}\n\t\t\t\t{pattern === 'circles' && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"absolute -top-8 -right-8 h-32 w-32 rounded-full bg-inverse-decoration\" aria-hidden=\"true\" />\n\t\t\t\t\t\t<div className=\"absolute -bottom-4 -left-4 h-20 w-20 rounded-full bg-inverse-decoration\" aria-hidden=\"true\" />\n\t\t\t\t\t</>\n\t\t\t\t)}\n\n\t\t\t\t{/* Pattern: waves */}\n\t\t\t\t{pattern === 'waves' && (\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclassName=\"absolute inset-0 h-full w-full opacity-5\"\n\t\t\t\t\t\tviewBox=\"0 0 400 200\"\n\t\t\t\t\t\tpreserveAspectRatio=\"none\"\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path d=\"M0 80 C100 20, 200 140, 400 60 L400 200 L0 200 Z\" className=\"fill-inverse-foreground\" />\n\t\t\t\t\t\t<path d=\"M0 120 C120 60, 280 180, 400 100 L400 200 L0 200 Z\" className=\"fill-inverse-foreground\" />\n\t\t\t\t\t</svg>\n\t\t\t\t)}\n\n\t\t\t\t<div className=\"absolute top-4 right-4 z-20\">\n\t\t\t\t\t<Badge\n\t\t\t\t\t\ttone={statusTone}\n\t\t\t\t\t\tinline\n\t\t\t\t\t\tdot\n\t\t\t\t\t\tclassName=\"border border-inverse-border bg-inverse-background text-inverse-foreground shadow-sm backdrop-blur-md\"\n\t\t\t\t\t\tdata-status={statusTone}\n\t\t\t\t\t>\n\t\t\t\t\t\t{statusLabel}\n\t\t\t\t\t</Badge>\n\t\t\t\t</div>\n\n\t\t\t\t<Stack gap=\"xl\" className=\"relative z-10\">\n\t\t\t\t\t<div className=\"flex items-center gap-space-md\">\n\t\t\t\t\t\t<Gift className=\"h-5 w-5 text-inverse-muted\" />\n\t\t\t\t\t\t<Text weight=\"medium\" className=\"text-inverse-muted\">{strings.giftCard}</Text>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<Stack gap=\"dense\">\n\t\t\t\t\t\t<DisplayLabel tone=\"inverse\">{strings.balance}</DisplayLabel>\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"baseline\" gap=\"lg\">\n\t\t\t\t\t\t\t<Heading tag=\"h2\" size=\"2xl\" className=\"border-none pb-0 text-inverse-foreground tabular-nums drop-shadow-sm\">\n\t\t\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t\t\t<Value className=\"line-through tabular-nums text-inverse-disabled\">{amount}</Value>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</Stack>\n\n\t\t\t\t\t{/* Code strip — premium feel */}\n\t\t\t\t\t<div className={cn(\n\t\t\t\t\t\t\t'giftcard-full--code',\n\t\t\t\t\t\t\t'rounded-radius p-surface-xs',\n\t\t\t\t\t\t\t'bg-inverse-surface backdrop-blur-sm',\n\t\t\t\t\t\t\t'border border-inverse-border',\n\t\t\t\t\t\t\t'shadow-sm',\n\t\t\t\t\t\t)}>\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"md\">\n\t\t\t\t\t\t<MonoValue weight=\"semibold\" className=\"flex-1 tracking-[0.2em] text-inverse-foreground\">\n\t\t\t\t\t\t\t{code}\n\t\t\t\t\t\t</MonoValue>\n\t\t\t\t\t\t<GiftcardCopyButton code={code} strings={strings} inverse />\n\t\t\t\t\t</Stack>\n\t\t\t\t\t</div>\n\t\t\t\t</Stack>\n\t\t\t</div>\n\n\t\t\t{/* Details section — structured metadata grid */}\n\t\t\t\t<div className=\"rounded-b-radius bg-card p-surface shadow-sm border border-t-0 border-border/50\">\n\t\t\t\t<Stack gap=\"xl\">\n\t\t\t\t{!!message && (\n\t\t\t\t\t<Stack gap=\"normal\" className=\"giftcard-full--message rounded-radius bg-muted/50 p-surface-xs border border-border/30\">\n\t\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t\t{strings.personalMessage}\n\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t<Text type=\"secondary\" className=\"italic leading-relaxed\">\n\t\t\t\t\t\t\t&ldquo;{message}&rdquo;\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\n\t\t\t\t<MetadataList\n\t\t\t\t\titems={metadataItems}\n\t\t\t\t\tcolumns={{ base: 1, sm: 2 }}\n\t\t\t\t/>\n\n\t\t\t\t{!!onView && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\ticon={Eye}\n\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\tonClick={onView}\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.viewDetails}\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nGiftcardFull.displayName = 'GiftcardFull';\n","import { GiftcardCopyButton } from './giftcard-copy-button';\n/**\n * GiftcardCardIllustrated — gift-card surface with a compact illustrated\n * header, balance + status row, code strip, details, and a footer action.\n * Strings are overridable for i18n.\n */\nimport { DisplayLabel } from '../../../../typography/display-label';\nimport { Text } from '../../../../typography/text';\nimport { Heading } from '../../../../typography/heading';\nimport { Badge } from '../../../../base/badge';\nimport { Button } from '../../../../base/buttons';\nimport { IconBadge } from '../../../../base/display';\nimport { Stack } from '../../../../base/structure';\nimport { MetadataList, type MetadataListItem } from '../../../data-display/metadata';\nimport { MonoValue, Value } from '../../../../primitives';\nimport { useStrings } from '../../../../../lib/strings';\nimport { cn } from '../../../../../lib/utils';\nimport { Gift, Eye } from 'lucide-react';\nimport {\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\ttype HeaderColor,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n\theaderGradientMap,\n} from '../types';\n\nexport function GiftcardCardIllustrated({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\texpiresAt,\n\tonView,\n\theaderColor = 'green',\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData & GiftcardCommonProps & {\n\t/** Colour of the header band. */\n\theaderColor?: HeaderColor;\n\t/** Merged onto the card root. */\n\tclassName?: string;\n}) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\tconst metadataItems: MetadataListItem[] = [\n\t\t...(recipientName ? [{ label: strings.recipient, value: recipientName }] : []),\n\t\t...(expiresAt ? [{ label: strings.expires, value: expiresAt }] : []),\n\t];\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component giftcard-illustrated--component w-full max-w-sm overflow-hidden rounded-radius border border-border bg-card shadow-sm',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<div className=\"relative flex h-16 items-center justify-between overflow-hidden bg-inverse-background bg-gradient-to-br from-inverse-background via-inverse-surface to-inverse-background px-surface\">\n\t\t\t\t<div aria-hidden className={cn('absolute inset-x-0 top-0 h-1 bg-gradient-to-r', headerGradientMap[headerColor])} />\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"absolute inset-0 opacity-80\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbackgroundImage:\n\t\t\t\t\t\t\t'repeating-linear-gradient(45deg, transparent 0 10px, color-mix(in oklch, var(--inverse-foreground) 3%, transparent) 10px 20px)',\n\t\t\t\t\t}}\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t/>\n\t\t\t\t<IconBadge\n\t\t\t\t\ticon={Gift}\n\t\t\t\t\tsize=\"md\"\n\t\t\t\t\tshape=\"square\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'relative rounded-inner bg-inverse-surface text-inverse-foreground ring-1 ring-inverse-border',\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t\t<DisplayLabel tone=\"inverse\" className=\"relative\">\n\t\t\t\t\t{strings.giftCard}\n\t\t\t\t</DisplayLabel>\n\t\t\t</div>\n\n\t\t\t\t<div className=\"p-surface\">\n\t\t\t\t<Stack gap=\"lg\">\n\t\t\t\t<div className=\"flex items-start justify-between\">\n\t\t\t\t\t<Stack gap=\"dense\">\n\t\t\t\t\t\t<div className=\"flex items-baseline gap-space-md\">\n\t\t\t\t\t\t\t<Heading tag=\"h2\" size=\"2xl\" className=\"border-none pb-0 tabular-nums\">\n\t\t\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t\t\t<Value className=\"line-through tabular-nums text-muted-foreground\">\n\t\t\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t{strings.balance}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Badge tone={statusTone}>{statusLabel}</Badge>\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"giftcard-illustrated--code rounded-inner border border-border/50 bg-muted/40 p-surface-xs\">\n\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"md\">\n\t\t\t\t\t<MonoValue className=\"flex-1 tracking-[0.15em]\">\n\t\t\t\t\t\t{code}\n\t\t\t\t\t</MonoValue>\n\t\t\t\t\t<GiftcardCopyButton code={code} strings={strings} />\n\t\t\t\t\t</Stack>\n\t\t\t\t</div>\n\n\t\t\t\t<MetadataList items={metadataItems} columns={2} />\n\n\t\t\t\t{!!onView && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\ticon={Eye}\n\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\tonClick={onView}\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.viewDetails}\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nGiftcardCardIllustrated.displayName = 'GiftcardCardIllustrated';\n","import { GiftcardCopyButton } from './giftcard-copy-button';\n/**\n * GiftcardCardMinimal — clean minimal layout. A small accent line (driven by\n * `color`) sits above the header icon + label, balance, code strip, and\n * metadata rows. Footer \"View details\" link uses an arrow affordance.\n * Strings overridable for i18n.\n */\nimport { Heading } from '../../../../typography/heading';\nimport { Text } from '../../../../typography/text';\nimport { Badge } from '../../../../base/badge';\nimport { Button } from '../../../../base/buttons';\nimport { MetadataList, type MetadataListItem } from '../../../data-display/metadata';\nimport { MonoValue, Value } from '../../../../primitives';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemMedia,\n\tItemTitle,\n} from '../../../../base/item';\nimport { useStrings } from '../../../../../lib/strings';\nimport { Stack } from '../../../../base/structure';\nimport { cn } from '../../../../../lib/utils';\nimport { Gift, ArrowRight } from 'lucide-react';\nimport {\n\ttype AccentColor,\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\taccentColorMap,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n} from '../types';\n\nexport function GiftcardCardMinimal({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\texpiresAt,\n\tonView,\n\tcolor = 'green',\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData & GiftcardCommonProps & {\n\t/** Accent for the rule and highlights. */\n\tcolor?: AccentColor;\n\t/** Merged onto the card root. */\n\tclassName?: string;\n}) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\tconst accent = accentColorMap[color];\n\tconst metadataItems: MetadataListItem[] = [\n\t\t...(recipientName ? [{ label: strings.recipient, value: recipientName }] : []),\n\t\t...(expiresAt ? [{ label: strings.expires, value: expiresAt }] : []),\n\t];\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component giftcard-minimal--component w-full max-w-sm overflow-hidden rounded-radius border border-border bg-card shadow-sm',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<div className={cn('mx-space-xl mt-space-lg h-1 w-12 rounded-radius-sm', accent.line)} />\n\n\t\t\t<Item size=\"sm\" className=\"flex-nowrap items-center p-surface-xs\">\n\t\t\t\t<ItemMedia>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'flex h-7 w-7 items-center justify-center rounded-full',\n\t\t\t\t\t\t\taccent.iconBg,\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Gift className=\"h-3.5 w-3.5\" />\n\t\t\t\t\t</div>\n\t\t\t\t</ItemMedia>\n\t\t\t\t<ItemContent>\n\t\t\t\t\t<ItemTitle bold={false}>\n\t\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" type=\"secondary\">\n\t\t\t\t\t\t\t{strings.giftCard}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</ItemTitle>\n\t\t\t\t</ItemContent>\n\t\t\t\t<ItemActions className=\"shrink-0\">\n\t\t\t\t\t<Badge tone={statusTone} size=\"sm\">{statusLabel}</Badge>\n\t\t\t\t</ItemActions>\n\t\t\t</Item>\n\n\t\t\t<div className=\"px-surface pb-surface-xs pt-0\">\n\t\t\t\t<div className=\"flex items-baseline gap-space-md\">\n\t\t\t\t\t<Heading tag=\"h2\" size=\"2xl\" className=\"border-none pb-0 tabular-nums\">\n\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t<Value className=\"line-through tabular-nums text-muted-foreground\">\n\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div className=\"giftcard-minimal--code mx-space-xl rounded-inner border border-border/30 bg-muted/50 p-surface-xs\">\n\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"sm\">\n\t\t\t\t<MonoValue className=\"flex-1 tracking-[0.15em]\">\n\t\t\t\t\t{code}\n\t\t\t\t</MonoValue>\n\t\t\t\t<GiftcardCopyButton code={code} strings={strings} className=\"shrink-0\" />\n\t\t\t</Stack>\n\t\t\t</div>\n\n\t\t\t<MetadataList\n\t\t\t\titems={metadataItems}\n\t\t\t\tcolumns={1}\n\t\t\t\tdensity=\"compact\"\n\t\t\t\tclassName=\"px-surface pb-space-sm pt-space-md [&_.metadata-list--grid]:gap-space-sm\"\n\t\t\t/>\n\n\t\t\t{!!onView && (\n\t\t\t\t<div className=\"mt-1 border-t border-border/30 p-surface-xs\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\tonClick={onView}\n\t\t\t\t\t\tclassName=\"group/link\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.viewDetails}\n\t\t\t\t\t\t<ArrowRight className=\"ml-1 h-3.5 w-3.5 transition-transform group-hover/link:translate-x-0.5\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nGiftcardCardMinimal.displayName = 'GiftcardCardMinimal';\n","import { GiftcardCompact } from './partials/giftcard-compact';\nimport { GiftcardCardDark } from './partials/giftcard-dark';\nimport { GiftcardFull } from './partials/giftcard-full';\nimport { GiftcardCardIllustrated } from './partials/giftcard-illustrated';\nimport { GiftcardCardMinimal } from './partials/giftcard-minimal';\nimport type {\n\tAccentColor,\n\tGiftcardCommonProps,\n\tGiftcardData,\n\tGradientVariant,\n\tHeaderColor,\n\tPatternVariant,\n} from './types';\nimport { cn } from '../../../../lib/utils';\n\nexport type GiftcardCardVariant =\n\t| 'gradient'\n\t| 'compact'\n\t| 'minimal'\n\t| 'dark'\n\t| 'illustrated';\n\ninterface GiftcardCardSharedProps extends GiftcardData, GiftcardCommonProps {\n\t/** Merged onto the card root. */\n\tclassName?: string;\n}\n\n/**\n * Each variant admits only the styling prop it can actually use; the others are\n * typed `never`, so passing `headerColor` to the gradient card is a type error\n * rather than a silently ignored prop.\n */\nexport type GiftcardCardProps = GiftcardCardSharedProps & (\n\t| {\n\t\t/** Premium gradient card. The default presentation. */\n\t\tvariant?: 'gradient';\n\t\t/** Background gradient. Default: `purple`. */\n\t\tgradient?: GradientVariant;\n\t\t/** Decorative overlay on the gradient. Default: `none`. */\n\t\tpattern?: PatternVariant;\n\t\tcolor?: never;\n\t\theaderColor?: never;\n\t}\n\t| {\n\t\t/** Short row for collections and lists. */\n\t\tvariant: 'compact';\n\t\t/** Background gradient for the row's leading block. */\n\t\tgradient?: GradientVariant;\n\t\tpattern?: never;\n\t\tcolor?: never;\n\t\theaderColor?: never;\n\t}\n\t| {\n\t\t/** Restrained card that inherits the surrounding surface. */\n\t\tvariant: 'minimal';\n\t\t/** Accent for the rule and highlights. */\n\t\tcolor?: AccentColor;\n\t\tgradient?: never;\n\t\tpattern?: never;\n\t\theaderColor?: never;\n\t}\n\t| {\n\t\t/** Solid dark card, for light surfaces that need contrast. */\n\t\tvariant: 'dark';\n\t\tgradient?: never;\n\t\tpattern?: never;\n\t\tcolor?: never;\n\t\theaderColor?: never;\n\t}\n\t| {\n\t\t/** Illustrated card with a coloured header band. */\n\t\tvariant: 'illustrated';\n\t\t/** Colour of the header band. */\n\t\theaderColor?: HeaderColor;\n\t\tgradient?: never;\n\t\tpattern?: never;\n\t\tcolor?: never;\n\t}\n);\n\n/**\n * GiftcardCard — one gift-card data contract with five deliberate visual\n * variants. The premium gradient card is the useful default; compact is for\n * collection rows, while minimal, dark, and illustrated are explicit styles.\n */\nexport function GiftcardCard(props: GiftcardCardProps) {\n\tconst className = cn('giftcard-card--component', props.className);\n\tswitch (props.variant) {\n\t\tcase 'compact':\n\t\t\treturn <GiftcardCompact {...props} className={className} />;\n\t\tcase 'minimal':\n\t\t\treturn <GiftcardCardMinimal {...props} className={className} />;\n\t\tcase 'dark':\n\t\t\treturn <GiftcardCardDark {...props} className={className} />;\n\t\tcase 'illustrated':\n\t\t\treturn <GiftcardCardIllustrated {...props} className={className} />;\n\t\tdefault:\n\t\t\treturn <GiftcardFull {...props} className={className} />;\n\t}\n}\n\nGiftcardCard.displayName = 'GiftcardCard';\n","import type { SmartCardSurface } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\nimport type { ReactNode } from 'react';\nimport type { SemanticTone } from '../../../../lib/component-vocabulary';\n\nexport type VendorProfileChangeTone = Extract<\n\tSemanticTone,\n\t'secondary' | 'success' | 'warning' | 'destructive'\n>;\n\n/** The two data views available when a dossier has overview and performance data. */\nexport type VendorProfileView = 'overview' | 'stats';\n\n/** A performance tile shown in the stats view. */\nexport interface VendorProfileStat {\n\t/** Stable key used when the stat collection changes order. */\n\tid?: string;\n\t/** Consumer-owned stat label. */\n\tlabel: ReactNode;\n\t/** Display value; prefer package primitives such as Money, Number, or Percent. */\n\tvalue: ReactNode;\n\t/** Optional comparison value rendered as a badge. */\n\tchange?: ReactNode;\n\t/** Explicit semantic meaning of the comparison. Defaults to neutral secondary. */\n\tchangeTone?: VendorProfileChangeTone;\n}\n\n/** An operational label/value row shown in the overview view. */\nexport interface VendorProfileMetric {\n\t/** Stable key used when the metric collection changes order. */\n\tid?: string;\n\t/** Consumer-owned metric label. */\n\tlabel: ReactNode;\n\t/** Display value; prefer a semantic package primitive when one exists. */\n\tvalue: ReactNode;\n}\n\n/**\n * Localised labels for VendorProfileCard. Override per-instance via `strings`.\n */\nexport interface VendorProfileStrings {\n\t/** Label for the operating overview tab. */\n\ttabOverview: string;\n\t/** Label for the performance statistics tab. */\n\ttabStats: string;\n\t/** Label above the primary earnings value. */\n\ttotalEarnings: string;\n\t/** Label for the message action. */\n\tmessage: string;\n\t/** Label for the engagement action. */\n\thire: string;\n\t/** Accessible and visible label for the verified badge. */\n\tverifiedAriaLabel: string;\n}\n\nexport const defaultVendorProfileStrings: VendorProfileStrings = {\n\ttabOverview: 'Overview',\n\ttabStats: 'Stats',\n\ttotalEarnings: 'Total earnings',\n\tmessage: 'Message',\n\thire: 'Hire vendor',\n\tverifiedAriaLabel: 'Verified',\n};\n\nexport interface VendorProfileCardProps {\n\t/** Vendor display name used by the identity header and avatar fallback. */\n\tname: string;\n\t/** Explicit avatar fallback text. Derived from `name` when omitted. */\n\tinitials?: string;\n\t/** Optional vendor avatar URL. */\n\tavatarUrl?: string;\n\t/** Secondary identity context such as category, market, or location. */\n\trole?: ReactNode;\n\t/** Shows the localized verified badge when true. */\n\tverified?: boolean;\n\t/** Primary earnings display; prefer the canonical Money primitive. */\n\tearnings?: ReactNode;\n\t/** Optional comparison rendered beside earnings. */\n\tearningsChange?: ReactNode;\n\t/** Explicit semantic meaning of `earningsChange`. Defaults to neutral secondary. */\n\tearningsChangeTone?: VendorProfileChangeTone;\n\t/** Operational rows rendered in the overview view. */\n\tmetrics?: VendorProfileMetric[];\n\t/** Performance tiles rendered in the stats view. */\n\tstats?: VendorProfileStat[];\n\t/** Controlled active view. Only used when both overview and stats exist. */\n\tview?: VendorProfileView;\n\t/** Initial active view for uncontrolled usage. Defaults to `overview`. */\n\tdefaultView?: VendorProfileView;\n\t/** Called when the user requests a different view in either state mode. */\n\tonViewChange?: (view: VendorProfileView) => void;\n\t/** Shows the message action and delegates its behavior to the consumer. */\n\tonMessage?: () => void;\n\t/** Shows the engagement action and delegates its behavior to the consumer. */\n\tonHire?: () => void;\n\t/** Card surface override. Defaults through the shared SmartCard configuration. */\n\tsurface?: SmartCardSurface;\n\t/** Card density override. Defaults through the shared SmartCard configuration. */\n\t/** Additional classes applied to the outer SmartCard element. */\n\tclassName?: string;\n\t/** Deep-partial localized label overrides. */\n\tstrings?: StringsProp<VendorProfileStrings>;\n}\n","/**\n * VendorProfileCard — a compact vendor dossier with identity, earnings,\n * operating metrics, performance stats, and callback-driven actions.\n *\n * The component owns card chrome because it is a fixed-format profile card.\n * Consumers can still opt into `surface=\"flat\"` when embedding the dossier in\n * a larger surface. Its overview/stats view supports controlled and\n * uncontrolled state. Tabs only render when both content views are available;\n * an identity-only profile never grows dead controls or actions.\n */\nimport { Check, ChevronRight, MessageSquare } from 'lucide-react';\nimport { forwardRef, type ReactNode, useState } from 'react';\n\nimport { Avatar, AvatarFallback, AvatarImage } from '../../../base/avatar';\nimport { Badge, type BadgeProps } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { hasRenderableContent, Card } from '../../../base/cards';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from '../../../base/navigation/tabs';\nimport { Grid, Stack } from '../../../base/structure';\nimport { InlineStat } from '../../data-display';\nimport { Initials, Value } from '../../../primitives';\nimport { DisplayLabel } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultVendorProfileStrings,\n\ttype VendorProfileCardProps,\n\ttype VendorProfileChangeTone,\n\ttype VendorProfileView,\n} from './types';\n\nconst CHANGE_VARIANTS: Record<\n\tVendorProfileChangeTone,\n\tNonNullable<BadgeProps['tone']>\n> = {\n\tsecondary: 'secondary',\n\tsuccess: 'success',\n\twarning: 'warning',\n\tdestructive: 'destructive',\n};\n\nfunction ChangeBadge({\n\tchildren,\n\ttone,\n}: {\n\tchildren?: ReactNode;\n\ttone?: VendorProfileChangeTone;\n}) {\n\tif (!hasRenderableContent(children)) return null;\n\n\treturn (\n\t\t<Badge\n\t\t\ttone={CHANGE_VARIANTS[tone ?? 'secondary']}\n\t\t\tclassName=\"vendor-profile--change shrink-0 tabular-nums\"\n\t\t>\n\t\t\t{children}\n\t\t</Badge>\n\t);\n}\n\nexport const VendorProfileCard = forwardRef<HTMLDivElement, VendorProfileCardProps>(\n\tfunction VendorProfileCard(\n\t\t{\n\t\t\tname,\n\t\t\tinitials,\n\t\t\tavatarUrl,\n\t\t\trole,\n\t\t\tverified = false,\n\t\t\tearnings,\n\t\t\tearningsChange,\n\t\t\tearningsChangeTone,\n\t\t\tmetrics = [],\n\t\t\tstats = [],\n\t\t\tview,\n\t\t\tdefaultView = 'overview',\n\t\t\tonViewChange,\n\t\t\tonMessage,\n\t\t\tonHire,\n\t\t\tsurface,\n\t\t\tclassName,\n\t\t\tstrings: stringsProp,\n\t\t}: VendorProfileCardProps,\n\t\tref,\n\t) {\n\t\tconst strings = useStrings(defaultVendorProfileStrings, stringsProp);\n\t\tconst [internalView, setInternalView] = useState<VendorProfileView>(defaultView);\n\t\tconst isViewControlled = view !== undefined;\n\n\t\tconst hasEarnings = hasRenderableContent(earnings);\n\t\tconst hasOverviewContent = hasEarnings || metrics.length > 0;\n\t\tconst hasStatsContent = stats.length > 0;\n\t\tconst availableTabs: VendorProfileView[] = [\n\t\t\t...(hasOverviewContent ? (['overview'] as const) : []),\n\t\t\t...(hasStatsContent ? (['stats'] as const) : []),\n\t\t];\n\t\tconst requestedView = isViewControlled ? view : internalView;\n\t\tconst activeView = availableTabs.includes(requestedView)\n\t\t\t? requestedView\n\t\t\t: availableTabs[0] ?? 'overview';\n\t\tconst hasBody = availableTabs.length > 0;\n\t\tconst hasActions = Boolean(onMessage || onHire);\n\t\tconst handleViewChange = (nextValue: string) => {\n\t\t\tif (nextValue !== 'overview' && nextValue !== 'stats') return;\n\t\t\tif (!availableTabs.includes(nextValue)) return;\n\t\t\tif (!isViewControlled) setInternalView(nextValue);\n\t\t\tonViewChange?.(nextValue);\n\t\t};\n\n\t\tconst overviewContent = (\n\t\t\t<Stack gap=\"lg\" className=\"vendor-profile--overview\">\n\t\t\t\t{hasEarnings && (\n\t\t\t\t\t<div className=\"vendor-profile--earnings rounded-radius bg-muted/45 p-surface-xs\">\n\t\t\t\t\t\t<DisplayLabel>{strings.totalEarnings}</DisplayLabel>\n\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"md\" align=\"baseline\" justify=\"between\" className=\"mt-space-sm\">\n\t\t\t\t\t\t\t<Value size=\"base\" weight=\"semibold\" className=\"tabular-nums tracking-tight\">\n\t\t\t\t\t\t\t\t{earnings}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t<ChangeBadge tone={earningsChangeTone}>{earningsChange}</ChangeBadge>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\n\t\t\t\t{metrics.length > 0 && (\n\t\t\t\t\t<div className=\"vendor-profile--metrics divide-y divide-border/60\">\n\t\t\t\t\t\t{metrics.map((metric, index) => (\n\t\t\t\t\t\t\t<InlineStat\n\t\t\t\t\t\t\t\tkey={metric.id ?? index}\n\t\t\t\t\t\t\t\tclassName=\"py-row-y first:pt-0 last:pb-0\"\n\t\t\t\t\t\t\t\tlabel={metric.label}\n\t\t\t\t\t\t\t\tvalue={metric.value}\n\t\t\t\t\t\t\t\tvalueClassName=\"font-medium\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t);\n\n\t\tconst statsContent = (\n\t\t\t<Grid columns={{ base: 1, sm: 2 }} gap=\"sm\" className=\"vendor-profile--stats\">\n\t\t\t\t{stats.map((stat, index) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={stat.id ?? index}\n\t\t\t\t\t\tclassName=\"vendor-profile--stat rounded-radius bg-muted/45 p-surface-xs\"\n\t\t\t\t\t>\n\t\t\t\t\t<Stack gap=\"sm\">\n\t\t\t\t\t\t<DisplayLabel className=\"truncate\">{stat.label}</DisplayLabel>\n\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"baseline\" justify=\"between\">\n\t\t\t\t\t\t\t<Value weight=\"semibold\" className=\"min-w-0 tabular-nums\">\n\t\t\t\t\t\t\t\t{stat.value}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t<ChangeBadge tone={stat.changeTone}>{stat.change}</ChangeBadge>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t</div>\n\t\t\t\t))}\n\t\t\t</Grid>\n\t\t);\n\n\t\tconst profileBody = availableTabs.length > 1 ? (\n\t\t\t<Tabs\n\t\t\t\tvalue={activeView}\n\t\t\t\tonValueChange={handleViewChange}\n\t\t\t\tclassName=\"vendor-profile--tabs gap-space-lg\"\n\t\t\t>\n\t\t\t\t<TabsList className=\"grid h-auto w-full grid-cols-2 rounded-inner p-space-xs\">\n\t\t\t\t\t<TabsTrigger value=\"overview\" className=\"h-action-sm rounded-inner px-control-sm text-pxs\">\n\t\t\t\t\t\t{strings.tabOverview}\n\t\t\t\t\t</TabsTrigger>\n\t\t\t\t\t<TabsTrigger value=\"stats\" className=\"h-action-sm rounded-inner px-control-sm text-pxs\">\n\t\t\t\t\t\t{strings.tabStats}\n\t\t\t\t\t</TabsTrigger>\n\t\t\t\t</TabsList>\n\t\t\t\t<TabsContent value=\"overview\" className=\"mt-0\">\n\t\t\t\t\t{overviewContent}\n\t\t\t\t</TabsContent>\n\t\t\t\t<TabsContent value=\"stats\" className=\"mt-0\">\n\t\t\t\t\t{statsContent}\n\t\t\t\t</TabsContent>\n\t\t\t</Tabs>\n\t\t) : activeView === 'stats' ? (\n\t\t\tstatsContent\n\t\t) : (\n\t\t\toverviewContent\n\t\t);\n\n\t\treturn (\n\t\t\t<Card\n\t\t\t\tref={ref}\n\t\t\t\tsurface={surface}\n\t\t\t\theaderStart={\n\t\t\t\t\t<Item className=\"vendor-profile--identity flex-nowrap py-0\">\n\t\t\t\t\t\t<ItemMedia variant=\"avatar\">\n\t\t\t\t\t\t\t<Avatar>\n\t\t\t\t\t\t\t\t{!!avatarUrl && <AvatarImage src={avatarUrl} alt={name} />}\n\t\t\t\t\t\t\t\t<AvatarFallback className=\"bg-primary/12 text-primary-accent\">\n\t\t\t\t\t\t\t\t\t{initials ?? <Initials value={name} strategy=\"first-words\" />}\n\t\t\t\t\t\t\t\t</AvatarFallback>\n\t\t\t\t\t\t\t</Avatar>\n\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t<ItemContent>\n\t\t\t\t\t\t\t<ItemTitle>{name}</ItemTitle>\n\t\t\t\t\t\t\t{!!role && <ItemDescription clamp={2}>{role}</ItemDescription>}\n\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t{!!verified && (\n\t\t\t\t\t\t\t<ItemActions>\n\t\t\t\t\t\t\t\t<Badge tone=\"success\" aria-label={strings.verifiedAriaLabel}>\n\t\t\t\t\t\t\t\t\t<Check className=\"size-icon-sm\" aria-hidden=\"true\" />\n\t\t\t\t\t\t\t\t\t{strings.verifiedAriaLabel}\n\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t</ItemActions>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Item>\n\t\t\t\t}\n\t\t\t\theaderDivider={hasBody}\n\t\t\t\tfooterDivider={hasActions}\n\t\t\t\tfooterSlot={\n\t\t\t\t\thasActions ? (\n\t\t\t\t\t\t<div className=\"vendor-profile--actions flex flex-wrap gap-space-sm\">\n\t\t\t\t\t\t\t{!!onMessage && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\t\t\tclassName=\"min-w-0 flex-1\"\n\t\t\t\t\t\t\t\t\tonClick={onMessage}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<MessageSquare className=\"size-icon-sm\" aria-hidden=\"true\" />\n\t\t\t\t\t\t\t\t\t{strings.message}\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{!!onHire && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\ttone=\"primary\"\n\t\t\t\t\t\t\t\t\tclassName=\"min-w-0 flex-1\"\n\t\t\t\t\t\t\t\t\tonClick={onHire}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{strings.hire}\n\t\t\t\t\t\t\t\t\t<ChevronRight className=\"size-icon-sm\" aria-hidden=\"true\" />\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : undefined\n\t\t\t\t}\n\t\t\t\tcontentClassName={cn(!hasBody && 'hidden')}\n\t\t\t\tclassName={cn('vendor-profile--component', className)}\n\t\t\t>\n\t\t\t\t{hasBody ? profileBody : null}\n\t\t\t</Card>\n\t\t);\n\t},\n);\n\nVendorProfileCard.displayName = 'VendorProfileCard';\n","export interface InventoryLevelStrings {\n\tstatusInStock: string;\n\tstatusLowStock: string;\n\tstatusCritical: string;\n\tvariantLabel: string;\n\tunitsAvailable: string;\n\treorderAtLabel: string;\n\tlastRestockedLabel: string;\n}\n\nexport const defaultInventoryLevelStrings: InventoryLevelStrings = {\n\tstatusInStock: 'In Stock',\n\tstatusLowStock: 'Low Stock',\n\tstatusCritical: 'Critical',\n\tvariantLabel: 'Variant',\n\tunitsAvailable: 'units available',\n\treorderAtLabel: 'Reorder at',\n\tlastRestockedLabel: 'Last restocked',\n};\n","/**\n * InventoryLevel — single-product inventory snapshot with stock total,\n * reorder threshold, and a status pill (Critical / Low Stock / In Stock).\n *\n * Status thresholds are computed from `stock`, `reorderLevel`, and the\n * critical threshold (50% of `reorderLevel`). Status pill labels flow via\n * the `strings` prop so consumers can localise without forking the file.\n */\nimport { Badge } from '../../../base/badge';\nimport { Item } from '../../../base/item';\nimport { Stack } from '../../../base/structure';\nimport { Number as NumberValue, SecondaryValue } from '../../../primitives';\nimport { Text } from '../../../typography/text';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultInventoryLevelStrings } from './inventory-level.strings';\nimport type { InventoryLevelProps } from './types';\n\nexport function InventoryLevel({\n\tproductName,\n\tvariant,\n\tstock,\n\treorderLevel,\n\tmaxStock,\n\tlastRestocked,\n\tclassName,\n\tstrings: stringsProp,\n}: InventoryLevelProps) {\n\tconst strings = useStrings(defaultInventoryLevelStrings, stringsProp);\n\tconst pct = Math.round((stock / maxStock) * 100);\n\tconst isLow = stock <= reorderLevel;\n\tconst isCritical = stock <= reorderLevel * 0.5;\n\n\tconst badgeTone = isCritical ? 'destructive' : isLow ? 'warning' : 'success';\n\tconst badgeLabel = isCritical\n\t\t? strings.statusCritical\n\t\t: isLow\n\t\t\t? strings.statusLowStock\n\t\t\t: strings.statusInStock;\n\n\treturn (\n\t\t<Stack\n\t\t\tdata-component=\"inventory-level\"\n\t\t\tdata-slot=\"inventory-level\"\n\t\t\tgap=\"md\"\n\t\t\tclassName={cn('inventory-level--component', className)}\n\t\t>\n\t\t\t<Item\n\t\t\t\tsize=\"sm\"\n\t\t\t\ttitle={productName}\n\t\t\t\tdescription={variant ? `${strings.variantLabel}: ${variant}` : undefined}\n\t\t\t\tdescriptionClamp={1}\n\t\t\t\ttrailing={<Badge tone={badgeTone}>{badgeLabel}</Badge>}\n\t\t\t/>\n\n\t\t\t<NumberValue value={stock} weight=\"semibold\" align=\"left\" className=\"tracking-tight\" />\n\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t{strings.unitsAvailable}\n\t\t\t</Text>\n\n\t\t\t<Stack gap=\"md\" className=\"mt-space-xl\">\n\t\t\t\t<div className=\"h-1.5 overflow-hidden rounded-full bg-muted\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'h-full rounded-full transition-all',\n\t\t\t\t\t\t\tisCritical ? 'bg-destructive' : isLow ? 'bg-warning' : 'bg-success',\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tstyle={{ width: `${pct}%` }}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"flex items-center justify-between\">\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{/* `size=\"xs\"` keeps the value inside its own 12px line: without\n\t\t\t\t\t\t it the number inherits the 14px provider default and reads\n\t\t\t\t\t\t a size larger than the label it belongs to, and than the\n\t\t\t\t\t\t last-restocked value beside it. `weight` still carries the\n\t\t\t\t\t\t emphasis. */}\n\t\t\t\t\t\t{strings.reorderAtLabel}: <NumberValue value={reorderLevel} size=\"xs\" weight=\"medium\" align=\"left\" />\n\t\t\t\t\t</Text>\n\t\t\t\t\t{!!lastRestocked && (\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t{strings.lastRestockedLabel}: <SecondaryValue size=\"xs\">{lastRestocked}</SecondaryValue>\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Stack>\n\t\t</Stack>\n\t);\n}\n\nInventoryLevel.displayName = 'InventoryLevel';\n","import type { StringsProp } from '../../../../lib/strings';\n\nexport interface TaxLineItem {\n\t/** Stable identity for this entry. */\n\tid?: string;\n\t/** Display label. */\n\tlabel: string;\n\trate?: string;\n\tamount: string;\n}\n\nexport interface TaxBreakdownStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Formatted amount before tax. */\n\tsubtotal: string;\n\t/** Formatted sum of every tax line. */\n\ttotalTax: string;\n\t/** Formatted grand total, including tax. */\n\ttotal: string;\n}\n\nexport const defaultTaxBreakdownStrings: TaxBreakdownStrings = {\n\ttitle: 'Tax Breakdown',\n\tsubtotal: 'Subtotal',\n\ttotalTax: 'Total Tax',\n\ttotal: 'Total',\n};\n\nexport interface TaxBreakdownCardProps {\n\t/** Formatted amount before tax. */\n\tsubtotal: string;\n\t/** Individual tax lines making up the total. */\n\ttaxes: TaxLineItem[];\n\t/** Formatted sum of every tax line. */\n\ttotalTax?: string;\n\t/** Formatted grand total, including tax. */\n\ttotal: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<TaxBreakdownStrings>;\n}\n","/**\n * TaxBreakdownCard — itemised tax breakdown for an order or invoice. Shows a\n * subtotal, one row per tax line (with optional rate suffix), an optional\n * \"Total tax\" rollup, and a final total. Pairs with `CartSummaryCard` when\n * consumers need to expose VAT / regional tax detail. Strings overridable\n * for i18n.\n */\nimport { Receipt } from 'lucide-react';\nimport { ContentBlock } from '../../../base/display';\nimport { Stack } from '../../../base/structure';\nimport { Text } from '../../../typography';\nimport { InlineStat } from '../../data-display';\nimport { Separator } from '../../../base/display/separator';\nimport { Value } from '../../../primitives';\nimport { useStrings } from '../../../../lib/strings';\n\nimport { defaultTaxBreakdownStrings, type TaxBreakdownCardProps } from './types';\n\nimport { cn } from '../../../../lib/utils';\nexport function TaxBreakdownCard({\n\tsubtotal,\n\ttaxes,\n\ttotalTax,\n\ttotal,\n\tclassName,\n\tstrings: stringsProp,\n}: TaxBreakdownCardProps) {\n\tconst strings = useStrings(defaultTaxBreakdownStrings, stringsProp);\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ticon={<Receipt className=\"size-icon\" />}\n\t\t\ttitle={strings.title}\n\t\t\tclassName={cn('tax-breakdown--component w-full', className)}\n\t\t>\n\t\t\t<InlineStat\n\t\t\t\tlabel={strings.subtotal}\n\t\t\t\tvalue={subtotal}\n\t\t\t\tmono\n\t\t\t\tvalueClassName=\"text-sm font-medium\"\n\t\t\t/>\n\n\t\t\t\t<div className=\"mt-space-lg rounded-radius border border-border/50 bg-muted/30 p-surface\">\n\t\t\t\t<Stack gap=\"sm\">\n\t\t\t\t{taxes.map((tax, i) => (\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tkey={tax.id ?? `${tax.label}-${i}`}\n\t\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\t\talign=\"baseline\"\n\t\t\t\t\t\tjustify=\"between\"\n\t\t\t\t\t\tgap=\"lg\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"baseline\" gap=\"sm\" className=\"min-w-0\">\n\t\t\t\t\t\t\t<Text className=\"truncate\">{tax.label}</Text>\n\t\t\t\t\t\t\t{!!tax.rate && (\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"discrete\" className=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t{tax.rate}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t<Value weight=\"medium\" className=\"shrink-0 tabular-nums\">\n\t\t\t\t\t\t\t\t{tax.amount}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t))}\n\t\t\t\t{!!totalTax && taxes.length > 1 && (\n\t\t\t\t\t<InlineStat\n\t\t\t\t\t\tlabel={strings.totalTax}\n\t\t\t\t\t\tvalue={totalTax}\n\t\t\t\t\t\tmono\n\t\t\t\t\t\tclassName=\"border-t border-border/50 pt-space-sm mt-space-2xs\"\n\t\t\t\t\t\tvalueClassName=\"text-sm font-semibold\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t\t</div>\n\n\t\t\t<Separator className=\"my-space-lg\" />\n\n\t\t\t<InlineStat\n\t\t\t\tlabel={<Text tag=\"span\" weight=\"semibold\" lineHeight=\"tight\">{strings.total}</Text>}\n\t\t\t\tvalue={total}\n\t\t\t\tmono\n\t\t\t\tvalueClassName=\"text-base font-bold\"\n\t\t\t/>\n\t\t</ContentBlock>\n\t);\n}\n\nTaxBreakdownCard.displayName = 'TaxBreakdownCard';\n","import type { LucideIcon } from 'lucide-react';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface SubscriptionPerk {\n\t/** Leading glyph. */\n\ticon?: LucideIcon;\n\t/** Display label. */\n\tlabel: string;\n}\n\nexport interface SubscriptionSummaryStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tplan: string;\n\tnextBilling: string;\n\t/** Benefits included in the plan. */\n\tperks: string;\n\tmanage: string;\n\tupgrade: string;\n}\n\nexport const defaultSubscriptionSummaryStrings: SubscriptionSummaryStrings = {\n\ttitle: 'Subscription',\n\tplan: 'Plan',\n\tnextBilling: 'Next billing',\n\tperks: 'Included',\n\tmanage: 'Manage',\n\tupgrade: 'Upgrade',\n};\n\nexport interface SubscriptionSummaryCardProps {\n\t/** Name of the subscribed plan. */\n\tplanName: string;\n\t/** Formatted recurring price. */\n\tpriceLabel: string;\n\t/** Billing interval, e.g. monthly or yearly. */\n\tcycleLabel: string;\n\t/** Formatted date of the next charge. */\n\tnextBillingDate: string;\n\t/** Current subscription state. */\n\tstatusLabel?: string;\n\t/** Benefits included in the plan. */\n\tperks?: SubscriptionPerk[];\n\tonManage?: () => void;\n\tonUpgrade?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<SubscriptionSummaryStrings>;\n}\n","/**\n * SubscriptionSummaryCard — at-a-glance subscription card with the active\n * plan name as the hero heading, an inline price + cycle, the next billing\n * date in a meta row, an optional perks list, and trailing\n * Manage / Upgrade actions. Strings overridable for i18n.\n */\nimport {\n\tCalendar,\n\tCheck,\n\tChevronRight,\n\tRepeat } from 'lucide-react';\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { ContentBlock } from '../../../base/display';\nimport { IconBadge,\n} from '../../../base/display';\nimport {\n\tItem,\n\tItemContent,\n\tItemGroup,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { Stack } from '../../../base/structure';\nimport { Value } from '../../../primitives';\nimport { Heading } from '../../../typography/heading';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\n\nimport {\n\tdefaultSubscriptionSummaryStrings,\n\ttype SubscriptionSummaryCardProps,\n} from './types';\n\nimport { cn } from '../../../../lib/utils';\nexport function SubscriptionSummaryCard({\n\tplanName,\n\tpriceLabel,\n\tcycleLabel,\n\tnextBillingDate,\n\tstatusLabel,\n\tperks = [],\n\tonManage,\n\tonUpgrade,\n\tclassName,\n\tstrings: stringsProp,\n}: SubscriptionSummaryCardProps) {\n\tconst strings = useStrings(defaultSubscriptionSummaryStrings, stringsProp);\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ticon={<Repeat className=\"size-icon\" />}\n\t\t\ttitle={strings.title}\n\t\t\theaderEnd={statusLabel ? <Badge tone=\"success\">{statusLabel}</Badge> : null}\n\t\t\tclassName={cn('subscription-summary--component w-full', className)}\n\t\t>\n\t\t\t{/* Plan identity left, price right — the same label/value idiom the\n\t\t\t \"next billing\" row below uses, and the one tax-breakdown and\n\t\t\t order-status use inside their panels. Stacking all three lines on\n\t\t\t the left instead left ~80% of this panel empty. */}\n\t\t\t<div className=\"rounded-radius border border-border/60 bg-muted/30 p-surface\">\n\t\t\t\t<Stack direction=\"horizontal\" justify=\"between\" align=\"start\" gap=\"lg\">\n\t\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0\">\n\t\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t\t{strings.plan}\n\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t<Heading tag=\"h3\" className=\"text-base font-semibold tracking-tight border-none pb-0\">\n\t\t\t\t\t\t\t{planName}\n\t\t\t\t\t\t</Heading>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"baseline\" gap=\"xs\" className=\"shrink-0\">\n\t\t\t\t\t\t<Value weight=\"bold\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t{priceLabel}\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t<Text type=\"secondary\">\n\t\t\t\t\t\t\t{cycleLabel}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Stack>\n\t\t\t\t</Stack>\n\t\t\t</div>\n\n\t\t\t<div className=\"mt-space-lg flex items-center justify-between rounded-radius bg-card px-space-xs\">\n\t\t\t\t<div className=\"flex items-center gap-space-md\">\n\t\t\t\t\t<Calendar className=\"size-icon-md text-muted-foreground\" />\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">{strings.nextBilling}</Text>\n\t\t\t\t</div>\n\t\t\t\t<Value weight=\"semibold\" className=\"tabular-nums\">{nextBillingDate}</Value>\n\t\t\t</div>\n\n\t\t\t{perks.length > 0 && (\n\t\t\t\t\t<Stack gap=\"md\" className=\"mt-space-xl\">\n\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t{strings.perks}\n\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t{perks.map((perk, i) => {\n\t\t\t\t\t\t\tconst Icon = perk.icon ?? Check;\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Item key={`${perk.label}-${i}`} size=\"sm\">\n\t\t\t\t\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t\t\t\t\t<IconBadge icon={Icon} tone=\"success\" size=\"sm\" />\n\t\t\t\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t\t\t\t<ItemContent>\n\t\t\t\t\t\t\t\t\t\t<ItemTitle bold={false}>{perk.label}</ItemTitle>\n\t\t\t\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{(onManage || onUpgrade) && (\n\t\t\t\t<div className=\"mt-space-xl flex items-center gap-space-md\">\n\t\t\t\t\t{!!onManage && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\tonClick={onManage}\n\t\t\t\t\t\t\tclassName=\"flex-1\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.manage}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!onUpgrade && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttone=\"primary\"\n\t\t\t\t\t\t\tonClick={onUpgrade}\n\t\t\t\t\t\t\tclassName=\"flex-1\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.upgrade}\n\t\t\t\t\t\t\t<ChevronRight className=\"ml-1 size-icon-md\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</ContentBlock>\n\t);\n}\n\nSubscriptionSummaryCard.displayName = 'SubscriptionSummaryCard';\n","import type { StringsProp } from '../../../../lib/strings';\n\nexport type RefundStage = 'requested' | 'approved' | 'processing' | 'completed';\n\nexport interface RefundStatusStrings {\n\t/** Surface title. */\n\ttitle: string;\n\trequested: string;\n\tapproved: string;\n\tprocessing: string;\n\tcompleted: string;\n\t/** Formatted refund amount. */\n\tamount: string;\n\t/** Why the refund was requested. */\n\treason: string;\n\t/** Formatted estimate for the funds landing. */\n\teta: string;\n\t/** Where the money is being returned to. */\n\tmethod: string;\n}\n\nexport const defaultRefundStatusStrings: RefundStatusStrings = {\n\ttitle: 'Refund Status',\n\trequested: 'Requested',\n\tapproved: 'Approved',\n\tprocessing: 'Processing',\n\tcompleted: 'Completed',\n\tamount: 'Refund amount',\n\treason: 'Reason',\n\teta: 'Expected by',\n\tmethod: 'Refund to',\n};\n\nexport interface RefundStatusCardProps {\n\t/** How far the refund has progressed. */\n\tstage: RefundStage;\n\t/** Formatted refund amount. */\n\tamount: string;\n\t/** Why the refund was requested. */\n\treason?: string;\n\t/** Where the money is being returned to. */\n\tmethod?: string;\n\t/** Formatted estimate for the funds landing. */\n\teta?: string;\n\t/** Formatted date the refund was raised. */\n\trequestedAt?: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<RefundStatusStrings>;\n}\n","/**\n * RefundStatusCard — refund-flow tracker. Shows the four canonical refund\n * stages (Requested → Approved → Processing → Completed) as a horizontal\n * progress bar, with refund amount as the lead figure and an optional reason\n * / method / ETA detail block. Strings overridable for i18n.\n */\nimport {\n\tCheck,\n\tRotateCcw } from 'lucide-react';\nimport { ContentBlock } from '../../../base/display';\nimport { Stack } from '../../../base/structure';\nimport { Number as NumberValue, SecondaryValue, Value } from '../../../primitives';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { InlineStat } from '../../data-display';\nimport { Separator } from '../../../base/display/separator';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultRefundStatusStrings,\n\ttype RefundStage,\n\ttype RefundStatusCardProps,\n} from './types';\n\nconst STAGE_ORDER: RefundStage[] = ['requested', 'approved', 'processing', 'completed'];\n\nexport function RefundStatusCard({\n\tstage,\n\tamount,\n\treason,\n\tmethod,\n\teta,\n\trequestedAt,\n\tclassName,\n\tstrings: stringsProp,\n}: RefundStatusCardProps) {\n\tconst strings = useStrings(defaultRefundStatusStrings, stringsProp);\n\tconst currentIdx = STAGE_ORDER.indexOf(stage);\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ticon={<RotateCcw className=\"size-icon\" />}\n\t\t\ttitle={strings.title}\n\t\t\tclassName={cn('refund-status--component w-full', className)}\n\t\t>\n\t\t\t<Stack gap=\"dense\" className=\"rounded-radius bg-muted/40 p-surface\">\n\t\t\t\t{/* `DisplayLabel` is block and `Value` is inline, so stacking them\n\t\t\t\t bare rendered \"Refund amount180.00 USD\" with no separation at\n\t\t\t\t all. Pair them as label-left / value-right, the idiom the rest\n\t\t\t\t of the commerce panels use. */}\n\t\t\t\t<Stack direction=\"horizontal\" justify=\"between\" align=\"baseline\" gap=\"lg\">\n\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t{strings.amount}\n\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t<Value size=\"base\" weight=\"bold\" className=\"tabular-nums tracking-tight\">\n\t\t\t\t\t\t{amount}\n\t\t\t\t\t</Value>\n\t\t\t\t</Stack>\n\t\t\t\t{!!requestedAt && (\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{strings.requested}: <SecondaryValue size=\"xs\">{requestedAt}</SecondaryValue>\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t</Stack>\n\n\t\t\t{/* Stages */}\n\t\t\t<div className=\"mt-space-xl flex items-center justify-between\">\n\t\t\t\t{STAGE_ORDER.map((s, i) => {\n\t\t\t\t\tconst done = i <= currentIdx;\n\t\t\t\t\tconst current = i === currentIdx;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t// The dot leads its column and the connector fills the rest, so\n\t\t\t\t\t\t// the node sits at the column's left edge; the label has to\n\t\t\t\t\t\t// start there too. Centring it pushed every label ~46px right\n\t\t\t\t\t\t// of the stage it names. Same fix as ShipmentTracking.\n\t\t\t\t\t\t<div key={s} className=\"flex flex-1 flex-col items-start gap-space-sm\">\n\t\t\t\t\t\t\t<div className=\"flex w-full items-center\">\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t'relative flex size-icon-lg shrink-0 items-center justify-center rounded-full',\n\t\t\t\t\t\t\t\t\t\tdone\n\t\t\t\t\t\t\t\t\t\t\t? 'bg-success text-success-foreground'\n\t\t\t\t\t\t\t\t\t\t\t: 'border border-border bg-card text-muted-foreground',\n\t\t\t\t\t\t\t\t\t\tcurrent && 'ring-2 ring-success/30 ring-offset-2 ring-offset-background',\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{done ? (\n\t\t\t\t\t\t\t\t\t\t<Check className=\"size-icon-sm\" />\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<NumberValue value={i + 1} size=\"xs\" weight=\"medium\" align=\"center\" />\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{i < STAGE_ORDER.length - 1 && (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t'h-0.5 flex-1',\n\t\t\t\t\t\t\t\t\t\t\ti < currentIdx ? 'bg-success' : 'bg-border',\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\tweight={current ? 'semibold' : 'medium'}\n\t\t\t\t\t\t\t\ttype={done ? 'main' : 'secondary'}\n\t\t\t\t\t\t\t\tclassName=\"text-left leading-tight\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{strings[s]}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\n\t\t\t{(reason || method || eta) && (\n\t\t\t\t<>\n\t\t\t\t\t<Separator className=\"my-space-xl\" />\n\t\t\t\t\t<div className=\"space-y-space-md\">\n\t\t\t\t\t\t{!!reason && (\n\t\t\t\t\t\t\t<InlineStat label={strings.reason} value={reason} className=\"items-start\" valueClassName=\"text-sm font-medium text-right\" />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!method && (\n\t\t\t\t\t\t\t<InlineStat label={strings.method} value={method} valueClassName=\"text-sm font-medium\" />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!eta && (\n\t\t\t\t\t\t\t<InlineStat label={strings.eta} value={eta} mono valueClassName=\"text-sm font-medium\" />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</ContentBlock>\n\t);\n}\n\nRefundStatusCard.displayName = 'RefundStatusCard';\n","import type { StringsProp } from '../../../../lib/strings';\n\nexport type AddressKind = 'shipping' | 'billing' | 'pickup';\n\nexport interface AddressCardStrings {\n\tdefaultBadge: string;\n\tedit: string;\n\tremove: string;\n\tmakeDefault: string;\n\tshipping: string;\n\tbilling: string;\n\tpickup: string;\n}\n\nexport const defaultAddressCardStrings: AddressCardStrings = {\n\tdefaultBadge: 'Default',\n\tedit: 'Edit',\n\tremove: 'Remove',\n\tmakeDefault: 'Make default',\n\tshipping: 'Shipping address',\n\tbilling: 'Billing address',\n\tpickup: 'Pickup address',\n};\n\nexport interface AddressCardProps {\n\t/** What the address is for — billing, shipping, or both. */\n\tkind?: AddressKind;\n\t/** Display name. */\n\tname: string;\n\t/** Street address. */\n\tline1: string;\n\t/** Apartment, suite, or unit. */\n\tline2?: string;\n\t/** City or town. */\n\tcity: string;\n\t/** State, province, or region. */\n\tregion?: string;\n\t/** Postal or ZIP code. */\n\tpostalCode?: string;\n\t/** Country name or code. */\n\tcountry: string;\n\t/** Contact number for the delivery. */\n\tphone?: string;\n\t/** Marks this as the account's default address. */\n\tdefault?: boolean;\n\t/** Fired when an entry is edited. */\n\tonEdit?: () => void;\n\t/** Fired when an entry is removed. */\n\tonRemove?: () => void;\n\tonMakeDefault?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AddressCardStrings>;\n}\n","/**\n * AddressCard — saved postal address surface. Title varies by `kind`\n * (shipping / billing / pickup); shows recipient name, address lines, phone,\n * and a \"Default\" badge when applicable.\n *\n * Edit / remove / make-default actions ride through the centralized action\n * menu instead of inline footer buttons.\n */\nimport { Edit2, MapPin, Star, Trash2 } from 'lucide-react';\nimport { Badge } from '../../../base/badge';\nimport { ContentBlock } from '../../../base/display';\nimport { Stack } from '../../../base/structure';\nimport type { ActionMenuAction } from '../../../base/action-menu';\nimport { Phone } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\n\nimport {\n\tdefaultAddressCardStrings,\n\ttype AddressCardProps,\n\ttype AddressKind,\n} from './types';\n\nimport { cn } from '../../../../lib/utils';\nexport function AddressCard({\n\tkind = 'shipping',\n\tname,\n\tline1,\n\tline2,\n\tcity,\n\tregion,\n\tpostalCode,\n\tcountry,\n\tphone,\n\tdefault: defaultAddress = false,\n\tonEdit,\n\tonRemove,\n\tonMakeDefault,\n\tclassName,\n\tstrings: stringsProp,\n}: AddressCardProps) {\n\tconst strings = useStrings(defaultAddressCardStrings, stringsProp);\n\tconst titleByKind: Record<AddressKind, string> = {\n\t\tshipping: strings.shipping,\n\t\tbilling: strings.billing,\n\t\tpickup: strings.pickup,\n\t};\n\n\tconst cityLine = [city, region, postalCode].filter(Boolean).join(', ');\n\n\tconst actions: ActionMenuAction[] = [];\n\tif (onEdit) {\n\t\tactions.push({\n\t\t\tid: 'edit',\n\t\t\tlabel: strings.edit,\n\t\t\ticon: <Edit2 className=\"size-icon-md\" />,\n\t\t\tonClick: onEdit,\n\t\t});\n\t}\n\tif (onMakeDefault && !defaultAddress) {\n\t\tactions.push({\n\t\t\tid: 'make-default',\n\t\t\tlabel: strings.makeDefault,\n\t\t\ticon: <Star className=\"size-icon-md\" />,\n\t\t\tonClick: onMakeDefault,\n\t\t});\n\t}\n\tif (onRemove) {\n\t\tactions.push({\n\t\t\tid: 'remove',\n\t\t\tlabel: strings.remove,\n\t\t\ticon: <Trash2 className=\"size-icon-md\" />,\n\t\t\tonClick: onRemove,\n\t\t});\n\t}\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ticon={<MapPin className=\"size-icon\" />}\n\t\t\ttitle={titleByKind[kind]}\n\t\t\ttitleSuffix={\n\t\t\t\tdefaultAddress ? <Badge tone=\"primary\">{strings.defaultBadge}</Badge> : null\n\t\t\t}\n\t\t\tactions={actions.length > 0 ? actions : undefined}\n\t\t\tclassName={cn('address-card--component w-full', className)}\n\t\t>\n\t\t\t\t<Stack gap=\"2xs\">\n\t\t\t\t<Text weight=\"semibold\">{name}</Text>\n\t\t\t\t<Text>{line1}</Text>\n\t\t\t\t{!!line2 && <Text>{line2}</Text>}\n\t\t\t\t{!!cityLine && <Text>{cityLine}</Text>}\n\t\t\t\t<Text type=\"secondary\">{country}</Text>\n\t\t\t\t{!!phone && (\n\t\t\t\t\t<Phone\n\t\t\t\t\t\tvalue={phone}\n\t\t\t\t\t\tdisplay={<Text tag=\"span\" size=\"xs\">{phone}</Text>}\n\t\t\t\t\t\tclassName=\"mt-space-sm inline-flex\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t</ContentBlock>\n\t);\n}\n\nAddressCard.displayName = 'AddressCard';\n","import type { StringsProp } from '../../../../lib/strings';\n\nexport interface VoucherEntryStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tinputLabel: string;\n\tplaceholder: string;\n\thelperText: string;\n\tcheck: string;\n\tremove: string;\n\t/** Formatted remaining value on the voucher. */\n\tbalance: string;\n\tapplied: string;\n\tnotFound: string;\n}\n\nexport const defaultVoucherEntryStrings: VoucherEntryStrings = {\n\ttitle: 'Redeem a gift card',\n\tinputLabel: 'Gift card code',\n\tplaceholder: 'Enter gift card code',\n\thelperText: 'Apply one gift card or voucher to this order.',\n\tcheck: 'Check balance',\n\tremove: 'Remove',\n\tbalance: 'Available balance',\n\tapplied: 'Applied',\n\tnotFound: 'That gift card code is not valid.',\n};\n\nexport interface VoucherEntryProps {\n\t/** Voucher currently applied, if any. */\n\tappliedCode?: string;\n\t/** Formatted remaining value on the voucher. */\n\tbalance?: string;\n\t/** Validation message for a rejected code. */\n\terror?: string;\n\t/** Whether a code is being checked. */\n\tloading?: boolean;\n\t/** Fired with the trimmed, upper-cased code when the form is submitted. */\n\tonCheck?: (code: string) => void;\n\t/** Fired when an entry is removed. */\n\tonRemove?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<VoucherEntryStrings>;\n}\n","/**\n * VoucherEntry — gift-card / voucher redemption entry.\n *\n * Empty state — leading gift icon input + check button, helper line surfacing\n * errors. Applied state — success-tinted row with check medallion, code,\n * balance amount, and a destructive remove icon.\n *\n * The component owns the input's draft state and nothing else. Submitting the\n * form — by the check button or by Enter — calls `onCheck(code)` with the\n * trimmed, upper-cased code; the consumer looks it up and drives the applied\n * state back in through `appliedCode`, `balance`, `error`, and `loading`.\n * `onRemove` clears an applied voucher.\n */\nimport {\n\ttype FormEvent,\n\tuseId,\n\tuseState } from 'react';\nimport { Check,\n\tGift,\n\tX } from 'lucide-react';\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { ContentBlock } from '../../../base/display';\nimport { IconBadge,\n} from '../../../base/display';\nimport { FormField } from '../../../base/forms';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemFooter,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { Input } from '../../../base/text-inputs';\nimport { MonoValue, Value } from '../../../primitives';\nimport { useStrings } from '../../../../lib/strings';\n\nimport { defaultVoucherEntryStrings, type VoucherEntryProps } from './types';\n\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\nconst normalizeCode = (value: string): string => value.toUpperCase();\n\nexport function VoucherEntry({\n\tappliedCode,\n\tbalance,\n\terror,\n\tloading,\n\tonCheck,\n\tonRemove,\n\tclassName,\n\tstrings: stringsProp,\n}: VoucherEntryProps) {\n\tconst strings = useStrings(defaultVoucherEntryStrings, stringsProp);\n\tconst inputId = useId();\n\tconst [code, setCode] = useState('');\n\tconst trimmedCode = code.trim();\n\tconst handleSubmit = (event: FormEvent<HTMLFormElement>) => {\n\t\tevent.preventDefault();\n\t\tif (!trimmedCode) return;\n\t\tonCheck?.(trimmedCode);\n\t};\n\n\tif (appliedCode) {\n\t\treturn (\n\t\t\t<ContentBlock\n\t\t\t\ticon={<Gift className=\"size-icon\" />}\n\t\t\t\ttitle={strings.title}\n\t\t\t\tclassName={cn('voucher-entry--component w-full', className)}\n\t\t\t>\n\t\t\t\t<Item size=\"sm\" variant=\"outline\" className=\"items-center gap-y-space-sm border-success/30 bg-success/5\">\n\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t<IconBadge icon={Check} tone=\"success\" size=\"md\" className=\"ring-1 ring-success/20\" />\n\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t<ItemContent className=\"min-w-0\">\n\t\t\t\t\t\t<Stack direction=\"horizontal\" wrap align=\"center\" gap=\"sm\">\n\t\t\t\t\t\t\t<ItemTitle className=\"max-w-full\">\n\t\t\t\t\t\t\t\t<MonoValue className=\"tracking-wider\">{appliedCode}</MonoValue>\n\t\t\t\t\t\t\t</ItemTitle>\n\t\t\t\t\t\t\t<Badge tone=\"success\" size=\"sm\">{strings.applied}</Badge>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t<ItemDescription clamp={1}>{strings.balance}</ItemDescription>\n\t\t\t\t\t</ItemContent>\n\t\t\t\t\t<ItemFooter className=\"border-t border-success/15 pt-space-xs\">\n\t\t\t\t\t\t<span />\n\t\t\t\t\t\t<ItemActions className=\"shrink-0 gap-space-sm\">\n\t\t\t\t\t\t\t{!!balance && (\n\t\t\t\t\t\t\t\t<Value weight=\"semibold\" className=\"shrink-0 tabular-nums text-success\">\n\t\t\t\t\t\t\t\t\t{balance}\n\t\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{!!onRemove && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\ttone=\"destructive\"\n\t\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\t\tonClick={onRemove}\n\t\t\t\t\t\t\t\t\taria-label={strings.remove}\n\t\t\t\t\t\t\t\t\tclassName=\"size-action-xs shrink-0 text-muted-foreground hover:text-destructive\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<X className=\"size-icon-sm\" />\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</ItemActions>\n\t\t\t\t\t</ItemFooter>\n\t\t\t\t</Item>\n\t\t\t</ContentBlock>\n\t\t);\n\t}\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ticon={<Gift className=\"size-icon\" />}\n\t\t\ttitle={strings.title}\n\t\t\tclassName={cn('voucher-entry--component w-full', className)}\n\t\t>\n\t\t\t<form onSubmit={handleSubmit}>\n\t\t\t\t<FormField\n\t\t\t\t\tlabel={strings.inputLabel}\n\t\t\t\t\thtmlFor={inputId}\n\t\t\t\t\terror={error}\n\t\t\t\t\thint={error ? undefined : strings.helperText}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"flex flex-wrap gap-space-md\">\n\t\t\t\t\t\t<div className=\"min-w-48 flex-1\">\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tid={inputId}\n\t\t\t\t\t\t\t\tvalue={code}\n\t\t\t\t\t\t\t\tonChange={(e) => setCode(normalizeCode((e.target as HTMLInputElement).value))}\n\t\t\t\t\t\t\t\tplaceholder={strings.placeholder}\n\t\t\t\t\t\t\t\tstartIcon={Gift}\n\t\t\t\t\t\t\t\tautoCapitalize=\"characters\"\n\t\t\t\t\t\t\t\tspellCheck={false}\n\t\t\t\t\t\t\t\tclassName=\"font-mono\"\n\t\t\t\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\t\tdisabled={!trimmedCode}\n\t\t\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.check}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</FormField>\n\t\t\t</form>\n\t\t</ContentBlock>\n\t);\n}\n\nVoucherEntry.displayName = 'VoucherEntry';\n","import type { StringsProp } from '../../../../lib/strings';\n\nexport interface CartLineItem {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Display name. */\n\tname?: string;\n\tproductTitle?: string;\n\t/** Surface title. */\n\ttitle?: string;\n\tvariantTitle?: string;\n\tqty: number;\n\tprice: string;\n\timageUrl?: string;\n\timageSrc?: string;\n\tsrc?: string;\n\turl?: string;\n\timageAlt?: string;\n}\n\nexport interface CartSummaryStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Formatted total before tax, shipping, and discounts. */\n\tsubtotal: string;\n\t/** Formatted tax amount. */\n\ttax: string;\n\t/** Formatted shipping cost. */\n\tshipping: string;\n\t/** Formatted discount, shown as a deduction. */\n\tdiscount: string;\n\t/** Formatted order total. */\n\ttotal: string;\n\tcheckout: string;\n}\n\nexport const defaultCartSummaryStrings: CartSummaryStrings = {\n\ttitle: 'Cart',\n\tsubtotal: 'Subtotal',\n\ttax: 'Tax',\n\tshipping: 'Shipping',\n\tdiscount: 'Discount',\n\ttotal: 'Total',\n\tcheckout: 'Checkout',\n};\n\nexport interface CartSummaryCardProps {\n\t/** Line items in the cart. */\n\titems: CartLineItem[];\n\t/** Formatted total before tax, shipping, and discounts. */\n\tsubtotal?: string;\n\t/** Formatted tax amount. */\n\ttax?: string;\n\t/** Formatted shipping cost. */\n\tshipping?: string;\n\t/** Formatted discount, shown as a deduction. */\n\tdiscount?: string;\n\t/** Formatted order total. */\n\ttotal: string;\n\tonCheckout?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<CartSummaryStrings>;\n}\n","/**\n * CartSummaryCard — line-item list with optional subtotal / tax / shipping /\n * discount breakdown and a primary \"Checkout\" action. Items render through\n * `<ItemGroup>` for density consistency; the breakdown rows sit in a tight\n * summary block above the total. The discount value is shown as a signed\n * delta in success colour.\n */\nimport { ShoppingBag } from 'lucide-react';\nimport { ContentBlock } from '../../../base/display';\nimport { Button } from '../../../base/buttons';\nimport { InlineStat } from '../../data-display';\nimport { Separator } from '../../../base/display/separator';\nimport { Stack } from '../../../base/structure';\nimport { Initials, Number as NumberValue, Value } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemGroup,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { useStrings } from '../../../../lib/strings';\n\nimport { defaultCartSummaryStrings, type CartLineItem, type CartSummaryCardProps } from './types';\n\nimport { cn } from '../../../../lib/utils';\nimport { formatDeduction } from '../format-signed-amount';\n\nconst resolveCartLineTitle = (item: CartLineItem): string => {\n\treturn [item.productTitle, item.title, item.name].find((value) => !!value?.trim()) ?? item.id;\n};\n\nconst resolveCartLineImageSrc = (item: CartLineItem): string | undefined => {\n\treturn [item.imageUrl, item.imageSrc, item.src, item.url].find((value) => !!value?.trim());\n};\n\nfunction CartLineImagePlaceholder({ title }: { title: string }) {\n\treturn (\n\t\t<div\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName=\"flex size-full items-center justify-center rounded-[inherit] bg-muted ring-1 ring-border/60\"\n\t\t>\n\t\t\t<Initials\n\t\t\t\tvalue={title}\n\t\t\t\tstrategy=\"first-words\"\n\t\t\t\tfallback={title.trim().slice(0, 2).toUpperCase()}\n\t\t\t\tsize=\"xs\"\n\t\t\t\tweight=\"semibold\"\n\t\t\t\ttype=\"secondary\"\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport function CartSummaryCard({\n\titems,\n\tsubtotal,\n\ttax,\n\tshipping,\n\tdiscount,\n\ttotal,\n\tonCheckout,\n\tclassName,\n\tstrings: stringsProp,\n}: CartSummaryCardProps) {\n\tconst strings = useStrings(defaultCartSummaryStrings, stringsProp);\n\tconst hasBreakdown = !!(subtotal || tax || shipping || discount);\n\n\treturn (\n\t\t<ContentBlock icon={<ShoppingBag className=\"size-icon\" />} title={strings.title} className={cn('cart-summary--component w-full', className)}>\n\t\t\t<ItemGroup>\n\t\t\t\t{items.map((it) => {\n\t\t\t\t\tconst title = resolveCartLineTitle(it);\n\t\t\t\t\tconst imageSrc = resolveCartLineImageSrc(it);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Item key={it.id} className=\"cart-summary--item\">\n\t\t\t\t\t\t\t<ItemMedia variant=\"image\" className=\"cart-summary--item-media\">\n\t\t\t\t\t\t\t\t{imageSrc ? (\n\t\t\t\t\t\t\t\t\t<img src={imageSrc} alt={it.imageAlt ?? title} />\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<CartLineImagePlaceholder title={title} />\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t\t<ItemContent className=\"cart-summary--item-content\">\n\t\t\t\t\t\t\t\t<ItemTitle>{title}</ItemTitle>\n\t\t\t\t\t\t\t\t{!!it.variantTitle && (\n\t\t\t\t\t\t\t\t\t<ItemDescription clamp={1}>{it.variantTitle}</ItemDescription>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t\t<ItemActions className=\"cart-summary--item-actions\">\n\t\t\t\t\t\t\t\t<Stack gap=\"2xs\" align=\"end\" className=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t\t\t\tx<NumberValue value={it.qty} size=\"xs\" type=\"secondary\" align=\"left\" />\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t<Value weight=\"semibold\" className=\"tabular-nums\">{it.price}</Value>\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t</ItemActions>\n\t\t\t\t\t\t</Item>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ItemGroup>\n\n\t\t\t{!!hasBreakdown && (\n\t\t\t\t\t<div className=\"mt-space-lg rounded-radius bg-muted/30 p-surface\">\n\t\t\t\t\t<Stack gap=\"sm\">\n\t\t\t\t\t{!!subtotal && (\n\t\t\t\t\t\t<InlineStat label={strings.subtotal} value={subtotal} mono valueClassName=\"font-medium\" />\n\t\t\t\t\t)}\n\t\t\t\t\t{!!tax && (\n\t\t\t\t\t\t<InlineStat label={strings.tax} value={tax} mono valueClassName=\"font-medium\" />\n\t\t\t\t\t)}\n\t\t\t\t\t{!!shipping && (\n\t\t\t\t\t\t<InlineStat label={strings.shipping} value={shipping} mono valueClassName=\"font-medium\" />\n\t\t\t\t\t)}\n\t\t\t\t\t{!!discount && (\n\t\t\t\t\t\t<InlineStat\n\t\t\t\t\t\t\tlabel={strings.discount}\n\t\t\t\t\t\t\tvalue={formatDeduction(discount)}\n\t\t\t\t\t\t\tmono\n\t\t\t\t\t\t\tvalueClassName=\"font-semibold text-success\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\t\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t<Separator className=\"my-space-lg\" />\n\n\t\t\t<InlineStat\n\t\t\t\tlabel={<Text tag=\"span\" weight=\"semibold\" lineHeight=\"tight\">{strings.total}</Text>}\n\t\t\t\tvalue={total}\n\t\t\t\tmono\n\t\t\t\tvalueClassName=\"text-base font-bold\"\n\t\t\t/>\n\n\t\t\t{!!onCheckout && (\n\t\t\t\t<Button onClick={onCheckout} fullWidth className=\"mt-space-xl\">{strings.checkout}</Button>\n\t\t\t)}\n\t\t</ContentBlock>\n\t);\n}\n\nCartSummaryCard.displayName = 'CartSummaryCard';\n","import type { StringsProp } from '../../../../lib/strings';\n\nexport interface CouponInputStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/**\n\t * Accessible name for the code field. The card shows no visible label — the\n\t * placeholder carries the hint — so this is the field's only accessible\n\t * name, and a placeholder alone is not one: it is not reliably announced and\n\t * disappears as soon as the user types.\n\t */\n\tfieldLabel: string;\n\tplaceholder: string;\n\tapply: string;\n\tremove: string;\n\tapplied: string;\n\tinvalid: string;\n}\n\nexport const defaultCouponInputStrings: CouponInputStrings = {\n\ttitle: 'Have a code?',\n\tfieldLabel: 'Coupon code',\n\tplaceholder: 'Enter coupon code',\n\tapply: 'Apply',\n\tremove: 'Remove',\n\tapplied: 'Applied',\n\tinvalid: 'That code is not valid',\n};\n\nexport interface CouponInputCardProps {\n\t/** Coupon currently applied, if any. */\n\tappliedCode?: string;\n\t/** Formatted discount the coupon grants. */\n\tappliedDiscount?: string;\n\t/** Validation message for a rejected code. */\n\terror?: string;\n\tonApply?: (code: string) => void;\n\t/** Fired when an entry is removed. */\n\tonRemove?: () => void;\n\t/** Whether a code is being checked. */\n\tloading?: boolean;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<CouponInputStrings>;\n}\n","/**\n * CouponInputCard — promo / coupon code entry with an applied state and\n * inline error messaging.\n *\n * Empty state — leading-icon input + apply button, helper line for\n * placeholders or errors. Applied state — success-tinted row with a check\n * medallion, monospaced code, discount delta, and a destructive remove icon.\n */\nimport {\n\tuseState } from 'react';\nimport { Check,\n\tSparkles,\n\tTicketPercent,\n\tX } from 'lucide-react';\nimport { ContentBlock } from '../../../base/display';\nimport { Button } from '../../../base/buttons';\nimport { IconBadge,\n} from '../../../base/display';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { Input } from '../../../base/text-inputs';\nimport { Stack } from '../../../base/structure';\nimport { useStrings } from '../../../../lib/strings';\n\nimport { defaultCouponInputStrings, type CouponInputCardProps } from './types';\n\nimport { cn } from '../../../../lib/utils';\nimport { formatDeduction } from '../format-signed-amount';\nconst normalizeCode = (value: string): string => value.toUpperCase();\n\nexport function CouponInputCard({\n\tappliedCode,\n\tappliedDiscount,\n\terror,\n\tonApply,\n\tonRemove,\n\tloading,\n\tclassName,\n\tstrings: stringsProp,\n}: CouponInputCardProps) {\n\tconst strings = useStrings(defaultCouponInputStrings, stringsProp);\n\tconst [code, setCode] = useState('');\n\tconst trimmedCode = code.trim();\n\n\tif (appliedCode) {\n\t\treturn (\n\t\t\t<ContentBlock icon={<TicketPercent className=\"size-icon\" />} title={strings.title} className={cn('coupon-input--component w-full', className)}>\n\t\t\t\t<Item size=\"sm\" variant=\"muted\" className=\"items-center gap-y-space-sm border border-success/30 bg-success/8\">\n\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t<IconBadge icon={Check} tone=\"success\" size=\"md\" className=\"ring-1 ring-success/20\" />\n\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t{/*\n\t\t\t\t\t\tCode and status share one line so the applied panel matches the\n\t\t\t\t\t\tempty state's control height. Stacking them made this state ~20px\n\t\t\t\t\t\ttaller than the input it replaces, so applying a coupon shifted\n\t\t\t\t\t\teverything below it in the surrounding checkout column.\n\t\t\t\t\t*/}\n\t\t\t\t\t<ItemContent className=\"min-w-0\">\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"sm\" wrap={false} className=\"min-w-0\">\n\t\t\t\t\t\t\t<ItemTitle className=\"min-w-0 truncate font-mono tracking-wider\">{appliedCode}</ItemTitle>\n\t\t\t\t\t\t\t<DisplayLabel className=\"shrink-0\">\n\t\t\t\t\t\t\t\t{strings.applied}\n\t\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</ItemContent>\n\t\t\t\t\t<ItemActions className=\"ml-auto shrink-0 gap-space-sm\">\n\t\t\t\t\t\t{!!appliedDiscount && (\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\t\t\ttype=\"success\"\n\t\t\t\t\t\t\t\tclassName=\"tabular-nums shrink-0\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{formatDeduction(appliedDiscount)}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!onRemove && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\ttone=\"destructive\"\n\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\tonClick={onRemove}\n\t\t\t\t\t\t\t\taria-label={strings.remove}\n\t\t\t\t\t\t\t\tclassName=\"size-action-xs shrink-0 text-muted-foreground hover:text-destructive\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<X className=\"size-icon-sm\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ItemActions>\n\t\t\t\t</Item>\n\t\t\t</ContentBlock>\n\t\t);\n\t}\n\n\treturn (\n\t\t<ContentBlock icon={<TicketPercent className=\"size-icon\" />} title={strings.title} className={cn('coupon-input--component w-full', className)}>\n\t\t\t<Stack gap=\"md\">\n\t\t\t\t<div className=\"flex flex-wrap gap-space-md\">\n\t\t\t\t\t<div className=\"min-w-44 flex-1\">\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tvalue={code}\n\t\t\t\t\t\t\tonChange={(e) => setCode(normalizeCode((e.target as HTMLInputElement).value))}\n\t\t\t\t\t\t\taria-label={strings.fieldLabel}\n\t\t\t\t\t\t\tplaceholder={strings.placeholder}\n\t\t\t\t\t\t\tstartIcon={Sparkles}\n\t\t\t\t\t\t\tautoCapitalize=\"characters\"\n\t\t\t\t\t\t\tspellCheck={false}\n\t\t\t\t\t\t\tclassName=\"font-mono\"\n\t\t\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"md\"\n\t\t\t\t\t\tonClick={() => onApply?.(trimmedCode)}\n\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\tdisabled={!trimmedCode}\n\t\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.apply}\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t{!!error && (\n\t\t\t\t\t<Text size=\"xs\" type=\"error\">{error || strings.invalid}</Text>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</ContentBlock>\n\t);\n}\n\nCouponInputCard.displayName = 'CouponInputCard';\n","import type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type OrderStatusKind = 'pending' | 'paid' | 'fulfilled' | 'shipped' | 'delivered' | 'cancelled';\n\nexport interface OrderStatusEvent {\n\t/** Display label. */\n\tlabel: string;\n\t/** Formatted time for the entry. */\n\ttimestamp?: string;\n\tcomplete: boolean;\n}\n\nexport interface OrderStatusStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tstatusLabel: string;\n\teta: string;\n\tlatestEvent: string;\n\tcurrentStep: string;\n}\n\nexport const defaultOrderStatusStrings: OrderStatusStrings = {\n\ttitle: 'Order status',\n\tstatusLabel: 'Current status',\n\teta: 'ETA',\n\tlatestEvent: 'Latest event',\n\tcurrentStep: 'Current step',\n};\n\nexport interface OrderStatusCardProps {\n\t/** Human-facing order reference. */\n\torderNumber: string;\n\t/** Current fulfilment stage. */\n\tstatus: OrderStatusKind;\n\t/** Badge tone for the status chip. */\n\tstatusTone?: BadgeTone;\n\t/** Timeline entries, oldest first. */\n\tevents: OrderStatusEvent[];\n\t/** Formatted delivery estimate. */\n\tcurrentEta?: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<OrderStatusStrings>;\n}\n","import { Stack } from '../../../base/structure';\n/**\n * OrderStatusCard — order number + status badge + readable event timeline.\n * Ideal for dashboards / receipt summaries. Strings overridable for i18n.\n */\nimport { CalendarClock, Check, Circle, Package } from 'lucide-react';\nimport { ContentBlock } from '../../../base/display';\nimport { SecondaryValue, Value } from '../../../primitives';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { Badge } from '../../../base/badge';\nimport { Grid } from '../../../base/structure';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultOrderStatusStrings,\n\ttype OrderStatusCardProps,\n\ttype OrderStatusKind,\n} from './types';\n\nconst VARIANT_BY_STATUS: Record<OrderStatusKind, 'primary' | 'success' | 'warning' | 'destructive' | 'info' | 'secondary'> = {\n\tpending: 'warning',\n\tpaid: 'info',\n\tfulfilled: 'info',\n\tshipped: 'primary',\n\tdelivered: 'success',\n\tcancelled: 'destructive',\n};\n\nexport function OrderStatusCard({\n\torderNumber,\n\tstatus,\n\tstatusTone,\n\tevents,\n\tcurrentEta,\n\tclassName,\n\tstrings: stringsProp,\n}: OrderStatusCardProps) {\n\tconst strings = useStrings(defaultOrderStatusStrings, stringsProp);\n\tconst variant = statusTone ?? VARIANT_BY_STATUS[status];\n\tconst lastCompleteIdx = events.reduce((acc, e, i) => (e.complete ? i : acc), -1);\n\tconst latestEvent = events[lastCompleteIdx] ?? events[0];\n\tconst nextEvent = events.find((event) => !event.complete);\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ticon={<Package className=\"size-icon\" />}\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={<Badge tone={variant} className=\"capitalize\">{status}</Badge>}\n\t\t\tdescription={`#${orderNumber}`}\n\t\t\tclassName={cn('order-status--component w-full', className)}\n\t\t>\n\t\t\t<div className=\"rounded-radius border border-border bg-muted/20 p-surface\">\n\t\t\t\t<Grid columns={{ base: 1, sm: 3 }} gap=\"lg\">\n\t\t\t\t\t<Stack gap=\"dense\">\n\t\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t\t{strings.statusLabel}\n\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t<Text weight=\"semibold\" className=\"capitalize\">\n\t\t\t\t\t\t\t{status}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t{!!latestEvent && (\n\t\t\t\t\t\t<Stack gap=\"dense\">\n\t\t\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t\t\t{latestEvent.complete ? strings.latestEvent : strings.currentStep}\n\t\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t\t<Text weight=\"semibold\">\n\t\t\t\t\t\t\t\t{latestEvent.label}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!currentEta && (\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t\t\t{strings.eta}\n\t\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t\t{/* `Value` is inline by default, so without `block` the date\n\t\t\t\t\t\t\t runs straight on from its label (\"ETAMar 29, 2026\") and\n\t\t\t\t\t\t\t the top margin is dropped — the two sibling cells use\n\t\t\t\t\t\t\t block-level `Text` and stack correctly. */}\n\t\t\t\t\t\t\t<Value weight=\"semibold\" className=\"mt-0.5 block tabular-nums\">\n\t\t\t\t\t\t\t\t{currentEta}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Grid>\n\t\t\t</div>\n\n\t\t\t{events.length > 0 && (\n\t\t\t\t<ol className=\"m-0 p-0 list-none mt-space-xl\">\n\t\t\t\t\t{events.map((event, index) => {\n\t\t\t\t\t\tconst isLast = index === events.length - 1;\n\t\t\t\t\t\tconst isCurrent = nextEvent ? event === nextEvent : index === lastCompleteIdx;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={`${event.label}-${index}`} className=\"relative flex gap-space-lg\">\n\t\t\t\t\t\t\t\t<div className=\"flex flex-col items-center\">\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t'flex size-6 shrink-0 items-center justify-center rounded-full border',\n\t\t\t\t\t\t\t\t\t\t\tevent.complete\n\t\t\t\t\t\t\t\t\t\t\t\t? 'border-success bg-success text-success-foreground'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'border-border bg-card text-muted-foreground',\n\t\t\t\t\t\t\t\t\t\t\t// The up-next marker sits directly beneath success-filled steps,\n\t\t\t\t\t\t\t\t\t\t\t// and primary is a neighbouring hue to success in this theme, so a\n\t\t\t\t\t\t\t\t\t\t\t// 10% ring read as the same state at a glance. A tinted fill plus a\n\t\t\t\t\t\t\t\t\t\t\t// heavier border and ring separate it by weight rather than by hue,\n\t\t\t\t\t\t\t\t\t\t\t// which survives a retheme that moves primary closer to success.\n\t\t\t\t\t\t\t\t\t\t\tisCurrent && !event.complete && 'border-2 border-primary-accent bg-primary/10 text-primary-accent ring-4 ring-primary/30',\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{event.complete ? (\n\t\t\t\t\t\t\t\t\t\t\t<Check className=\"size-icon-md\" strokeWidth={2.5} />\n\t\t\t\t\t\t\t\t\t\t) : isCurrent ? (\n\t\t\t\t\t\t\t\t\t\t\t<CalendarClock className=\"size-icon-md\" />\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<Circle className=\"size-icon-sm\" />\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{!isLast && (\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t'min-h-6 w-px flex-1',\n\t\t\t\t\t\t\t\t\t\t\t\tindex < lastCompleteIdx ? 'bg-success' : 'bg-border',\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div className={cn('min-w-0 flex-1 pb-space-xl', isLast && 'pb-0')}>\n\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\tweight={event.complete || isCurrent ? 'semibold' : 'medium'}\n\t\t\t\t\t\t\t\t\t\tclassName={cn(!event.complete && !isCurrent && 'text-muted-foreground')}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{event.label}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t{!!event.timestamp && (\n\t\t\t\t\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"mt-0.5 tabular-nums\">\n\t\t\t\t\t\t\t\t\t\t\t{event.timestamp}\n\t\t\t\t\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</ol>\n\t\t\t)}\n\t\t</ContentBlock>\n\t);\n}\n\nOrderStatusCard.displayName = 'OrderStatusCard';\n","import type { StringsProp } from '../../../../lib/strings';\n\nexport type PaymentBrand = 'visa' | 'mastercard' | 'amex' | 'paypal' | 'applepay' | 'googlepay' | 'unknown';\n\nexport interface PaymentMethodStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tdefault: string;\n\tcardHolder: string;\n\texpires: string;\n\tchange: string;\n}\n\nexport const defaultPaymentMethodStrings: PaymentMethodStrings = {\n\ttitle: 'Payment method',\n\tdefault: 'Default',\n\tcardHolder: 'Card holder',\n\texpires: 'Expires',\n\tchange: 'Change',\n};\n\nexport interface PaymentMethodProps {\n\t/** Card network or wallet. */\n\tbrand: PaymentBrand;\n\t/** Last four digits, the only card number this component accepts. */\n\tlast4: string;\n\t/** Expiry in MM/YY form. */\n\texpiry?: string; // MM/YY\n\t/** Name printed on the card. */\n\tholderName?: string;\n\t/** Marks this as the account's default method. */\n\tdefault?: boolean;\n\t/**\n\t * Fired when the \"Change\" action is pressed. It carries no value — the\n\t * component never holds a payment method to hand back — so treat it as a\n\t * request to open your own method picker.\n\t */\n\tonChange?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<PaymentMethodStrings>;\n}\n","/**\n * PaymentMethod — saved-card surface. The hero block is rendered as a\n * mini credit-card mock with real card proportions, brand chip top-right, and\n * holder + expiry on the bottom row. The centre line is drawn as a full PAN\n * but only `last4` is ever supplied — the leading digits are decorative\n * bullets, and the component neither accepts nor stores a full card number.\n * `onChange` is a request to open the consumer's own method picker; it\n * carries no value.\n */\nimport { CreditCard } from 'lucide-react';\nimport { ContentBlock } from '../../../base/display';\nimport { Button } from '../../../base/buttons';\nimport { Value } from '../../../primitives';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { Badge } from '../../../base/badge';\nimport { useStrings } from '../../../../lib/strings';\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultPaymentMethodStrings, type PaymentBrand, type PaymentMethodProps } from './types';\n\nconst BRAND_LABEL: Record<PaymentBrand, string> = {\n\tvisa: 'VISA',\n\tmastercard: 'MasterCard',\n\tamex: 'AMEX',\n\tpaypal: 'PayPal',\n\tapplepay: 'Apple Pay',\n\tgooglepay: 'Google Pay',\n\tunknown: 'Card',\n};\n\n/**\n * The card face is an artwork-backed surface, which `--inverse-*` exists for.\n * Brands previously borrowed semantic state colours — a Visa painted `info`,\n * Google Pay `success` — so retheming an alert colour would have repainted\n * every stored card. Those tokens mean states, not brands. Identity comes from\n * the brand label and mark; the surface stays canonical, which also matches how\n * real cards read in an admin list.\n */\n// Translucent gloss composites over its explicit inverse base in both themes.\nconst BRAND_SURFACE = 'bg-inverse-background from-inverse-background via-inverse-surface-strong to-inverse-background';\n\nconst BRAND_GRADIENT: Record<PaymentBrand, string> = {\n\tvisa: BRAND_SURFACE,\n\tmastercard: BRAND_SURFACE,\n\tamex: BRAND_SURFACE,\n\tpaypal: BRAND_SURFACE,\n\tapplepay: BRAND_SURFACE,\n\tgooglepay: BRAND_SURFACE,\n\tunknown: BRAND_SURFACE,\n};\n\nexport function PaymentMethod({\n\tbrand,\n\tlast4,\n\texpiry,\n\tholderName,\n\tdefault: defaultMethod = false,\n\tonChange,\n\tclassName,\n\tstrings: stringsProp,\n}: PaymentMethodProps) {\n\tconst strings = useStrings(defaultPaymentMethodStrings, stringsProp);\n\tconst brandLabel = BRAND_LABEL[brand];\n\tconst gradient = BRAND_GRADIENT[brand];\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ticon={<CreditCard className=\"size-icon\" />}\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={defaultMethod ? <Badge tone=\"primary\">{strings.default}</Badge> : null}\n\t\t\theaderAction={onChange ? (\n\t\t\t\t<Button buttonStyle=\"ghost\" tone=\"secondary\" onClick={onChange}>\n\t\t\t\t\t{strings.change}\n\t\t\t\t</Button>\n\t\t\t) : undefined}\n\t\t\tclassName={cn('payment-method--component w-full', className)}\n\t\t>\n\t\t\t{/* Mini card mock */}\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'relative mx-auto flex aspect-[85.6/53.98] w-full max-w-[22rem] flex-col justify-between overflow-hidden rounded-radius bg-gradient-to-br p-surface text-inverse-foreground shadow-sm ring-1 ring-inverse-border',\n\t\t\t\t\tgradient,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<div className=\"relative flex items-start justify-between\">\n\t\t\t\t\t<div className=\"flex size-7 items-center justify-center rounded-radius-md bg-gradient-to-br from-muted to-muted-foreground/60 shadow-sm\">\n\t\t\t\t\t\t<div className=\"size-icon rounded-radius-sm border border-warning-foreground/25 bg-warning-foreground/15\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<Text\n\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\tweight=\"bold\"\n\t\t\t\t\t\tclassName=\"rounded bg-inverse-surface px-space-md py-space-2xs tracking-[0.15em] text-inverse-foreground backdrop-blur-sm\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{brandLabel}\n\t\t\t\t\t</Text>\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"relative\">\n\t\t\t\t\t<Text\n\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\tsize=\"base\"\n\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\tclassName=\"block font-mono tracking-[0.25em] text-inverse-foreground\"\n\t\t\t\t\t>\n\t\t\t\t\t\t•••• •••• •••• {last4}\n\t\t\t\t\t</Text>\n\t\t\t\t</div>\n\n\t\t\t\t<Stack direction=\"horizontal\" align=\"end\" justify=\"between\" gap=\"lg\" className=\"relative\">\n\t\t\t\t\t<div className=\"min-w-0\">\n\t\t\t\t\t\t{!!holderName && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<DisplayLabel tone=\"inverse\" className=\"block\">{strings.cardHolder}</DisplayLabel>\n\t\t\t\t\t\t\t\t<Text weight=\"semibold\" className=\"truncate text-inverse-foreground\">{holderName}</Text>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t{!!expiry && (\n\t\t\t\t\t\t<div className=\"text-right shrink-0\">\n\t\t\t\t\t\t\t<DisplayLabel tone=\"inverse\" className=\"block\">{strings.expires}</DisplayLabel>\n\t\t\t\t\t\t\t<Value weight=\"semibold\" className=\"tabular-nums text-inverse-foreground\">{expiry}</Value>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t</div>\n\n\t\t</ContentBlock>\n\t);\n}\n\nPaymentMethod.displayName = 'PaymentMethod';\n","import type {\n\tSeoListingCheckId,\n\tSeoListingCheckResult,\n\tSeoListingCheckStatus,\n\tSeoListingScoreInput,\n\tSeoListingScoreLimits,\n\tSeoListingScoreResult,\n} from './types';\n\nexport const DEFAULT_SEO_LISTING_LIMITS: Required<SeoListingScoreLimits> = {\n\ttitleMin: 35,\n\ttitleMax: 60,\n\tdescriptionMin: 120,\n\tdescriptionMax: 160,\n\tpermalinkMax: 75,\n};\n\nfunction resolveLimits(limits?: SeoListingScoreLimits): Required<SeoListingScoreLimits> {\n\treturn {\n\t\t...DEFAULT_SEO_LISTING_LIMITS,\n\t\t...limits,\n\t};\n}\n\nfunction clampScore(value: number): number {\n\tif (!Number.isFinite(value)) return 0;\n\treturn Math.max(0, Math.min(1, value));\n}\n\nfunction getCheckStatus(score: number, maxScore: number): SeoListingCheckStatus {\n\tif (maxScore <= 0) return 'missing';\n\tconst ratio = score / maxScore;\n\tif (ratio >= 0.9) return 'good';\n\tif (ratio >= 0.5) return 'review';\n\treturn 'missing';\n}\n\nfunction makeCheck(\n\tid: SeoListingCheckId,\n\tscoreRatio: number,\n\tmaxScore: number,\n\tactual: number,\n\trange?: Pick<SeoListingCheckResult, 'min' | 'max'>,\n): SeoListingCheckResult {\n\tconst score = Math.round(clampScore(scoreRatio) * maxScore);\n\treturn {\n\t\tid,\n\t\tscore,\n\t\tmaxScore,\n\t\tactual,\n\t\tstatus: getCheckStatus(score, maxScore),\n\t\t...range,\n\t};\n}\n\nfunction lengthScore(value: string, min: number, max: number): number {\n\tconst length = value.trim().length;\n\tif (length === 0) return 0;\n\tif (length >= min && length <= max) return 1;\n\tif (length < min) return Math.max(0.35, length / min);\n\tif (length > max * 2) return 0.35;\n\tconst overBy = length - max;\n\treturn Math.max(0.55, 1 - overBy / max);\n}\n\nexport function getSeoPermalinkPath(permalink?: string): string {\n\tconst value = permalink?.trim() ?? '';\n\tif (!value) return '';\n\n\tconst withoutHash = value.split('#')[0] ?? '';\n\tconst withoutQuery = withoutHash.split('?')[0] ?? '';\n\tconst withoutProtocol = withoutQuery.replace(/^https?:\\/\\/[^/]+/i, '');\n\n\treturn withoutProtocol.replace(/^\\/+|\\/+$/g, '');\n}\n\nexport function getSeoPermalinkSlug(permalink?: string): string {\n\tconst path = getSeoPermalinkPath(permalink);\n\tconst parts = path.split('/').filter(Boolean);\n\treturn parts.at(-1) ?? '';\n}\n\nfunction permalinkScore(permalink?: string, max = DEFAULT_SEO_LISTING_LIMITS.permalinkMax): number {\n\tconst path = getSeoPermalinkPath(permalink);\n\tif (!path) return 0;\n\tif (path.length <= max) return 1;\n\tif (path.length > max * 2) return 0.35;\n\treturn Math.max(0.55, 1 - (path.length - max) / max);\n}\n\nfunction slugScore(permalink?: string): number {\n\tconst slug = getSeoPermalinkSlug(permalink);\n\tif (!slug) return 0;\n\tif (/^[\\p{L}\\p{N}]+(?:-[\\p{L}\\p{N}]+)*$/u.test(slug) && slug === slug.toLowerCase()) {\n\t\treturn 1;\n\t}\n\tif (!/\\s/.test(slug) && !/[?#]/.test(slug)) return 0.65;\n\treturn 0.25;\n}\n\nfunction urlScore(baseUrl?: string): number {\n\tconst value = baseUrl?.trim() ?? '';\n\tif (!value) return 0;\n\tif (/^https:\\/\\//i.test(value)) return 1;\n\tif (/^http:\\/\\//i.test(value)) return 0.6;\n\treturn 0.45;\n}\n\nfunction keywordScore(input: SeoListingScoreInput): number | null {\n\tconst keyword = input.keyword?.trim().toLowerCase();\n\tif (!keyword) return null;\n\n\tconst haystack = [\n\t\tinput.title,\n\t\tinput.description,\n\t\tgetSeoPermalinkPath(input.permalink),\n\t]\n\t\t.filter(Boolean)\n\t\t.join(' ')\n\t\t.toLowerCase();\n\n\tif (!haystack) return 0;\n\treturn haystack.includes(keyword) ? 1 : 0.35;\n}\n\nexport function calculateSeoListingScore(input: SeoListingScoreInput): SeoListingScoreResult {\n\tconst limits = resolveLimits(input.limits);\n\tconst title = input.title?.trim() ?? '';\n\tconst description = input.description?.trim() ?? '';\n\tconst permalinkPath = getSeoPermalinkPath(input.permalink);\n\tconst slug = getSeoPermalinkSlug(input.permalink);\n\tconst checks: SeoListingCheckResult[] = [\n\t\tmakeCheck('title', lengthScore(title, limits.titleMin, limits.titleMax), 30, title.length, {\n\t\t\tmin: limits.titleMin,\n\t\t\tmax: limits.titleMax,\n\t\t}),\n\t\tmakeCheck(\n\t\t\t'description',\n\t\t\tlengthScore(description, limits.descriptionMin, limits.descriptionMax),\n\t\t\t30,\n\t\t\tdescription.length,\n\t\t\t{\n\t\t\t\tmin: limits.descriptionMin,\n\t\t\t\tmax: limits.descriptionMax,\n\t\t\t},\n\t\t),\n\t\tmakeCheck('permalink', permalinkScore(input.permalink, limits.permalinkMax), 15, permalinkPath.length, {\n\t\t\tmax: limits.permalinkMax,\n\t\t}),\n\t\tmakeCheck('slug', slugScore(input.permalink), 10, slug.length),\n\t\tmakeCheck('url', urlScore(input.baseUrl), 10, input.baseUrl?.trim().length ?? 0),\n\t];\n\n\tconst keyword = keywordScore(input);\n\tif (keyword !== null) {\n\t\tchecks.push(makeCheck('keyword', keyword, 5, input.keyword?.trim().length ?? 0));\n\t}\n\n\tconst score = Math.round(\n\t\t(checks.reduce((sum, check) => sum + check.score, 0) /\n\t\t\tchecks.reduce((sum, check) => sum + check.maxScore, 0)) *\n\t\t\t100,\n\t);\n\n\treturn {\n\t\tscore,\n\t\tstatus: getCheckStatus(score, 100),\n\t\tchecks,\n\t\tlimits,\n\t};\n}\n","import type { ReactNode } from 'react';\n\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type SeoListingCheckId =\n\t| 'title'\n\t| 'description'\n\t| 'permalink'\n\t| 'slug'\n\t| 'url'\n\t| 'keyword';\n\nexport type SeoListingCheckStatus = 'good' | 'review' | 'missing';\n\nexport interface SeoListingScoreLimits {\n\ttitleMin?: number;\n\ttitleMax?: number;\n\tdescriptionMin?: number;\n\tdescriptionMax?: number;\n\tpermalinkMax?: number;\n}\n\nexport interface SeoListingScoreInput {\n\t/** Surface title. */\n\ttitle?: string;\n\t/** Supporting copy shown under the label. */\n\tdescription?: string;\n\t/** Full URL shown under the title. */\n\tpermalink?: string;\n\t/** Origin the permalink is built on. */\n\tbaseUrl?: string;\n\t/** Target keyword the copy is scored against. */\n\tkeyword?: string;\n\t/** Character caps for the title and description. */\n\tlimits?: SeoListingScoreLimits;\n}\n\nexport interface SeoListingCheckResult {\n\t/** Stable identity for this entry. */\n\tid: SeoListingCheckId;\n\tstatus: SeoListingCheckStatus;\n\t/** Overall SEO score, 0-100. */\n\tscore: number;\n\tmaxScore: number;\n\tactual: number;\n\tmin?: number;\n\tmax?: number;\n}\n\nexport interface SeoListingScoreResult {\n\t/** Overall SEO score, 0-100. */\n\tscore: number;\n\tstatus: SeoListingCheckStatus;\n\tchecks: SeoListingCheckResult[];\n\t/** Character caps for the title and description. */\n\tlimits: Required<SeoListingScoreLimits>;\n}\n\nexport interface SeoListingCardStrings {\n\t/** Surface title. */\n\ttitle: string;\n\teditLabel: string;\n\tscoreLabel: string;\n\tchecksLabel: string;\n\tsiteFallback: string;\n\ttitleFallback: string;\n\tdescriptionFallback: string;\n\turlFallback: string;\n\tcharacters: string;\n\tmaxLabel: string;\n\ttargetLabel: string;\n\tstatus: Record<SeoListingCheckStatus, string>;\n\tcheckLabels: Record<SeoListingCheckId, string>;\n\tcheckHints: Record<SeoListingCheckId, string>;\n}\n\nexport const defaultSeoListingCardStrings: SeoListingCardStrings = {\n\ttitle: 'Search engine listing',\n\teditLabel: 'Edit search listing',\n\tscoreLabel: 'SEO score',\n\tchecksLabel: 'SEO checks',\n\tsiteFallback: 'Website',\n\ttitleFallback: 'Add an SEO title',\n\tdescriptionFallback: 'Add a meta description to control the search snippet.',\n\turlFallback: 'https://example.com',\n\tcharacters: 'characters',\n\tmaxLabel: 'max',\n\ttargetLabel: 'target',\n\tstatus: {\n\t\tgood: 'Good',\n\t\treview: 'Review',\n\t\tmissing: 'Missing',\n\t},\n\tcheckLabels: {\n\t\ttitle: 'Title',\n\t\tdescription: 'Description',\n\t\tpermalink: 'Permalink',\n\t\tslug: 'Slug format',\n\t\turl: 'URL',\n\t\tkeyword: 'Keyword',\n\t},\n\tcheckHints: {\n\t\ttitle: 'Keep the title inside the target range.',\n\t\tdescription: 'Use a complete meta description inside the target range.',\n\t\tpermalink: 'Keep the permalink readable and below the maximum length.',\n\t\tslug: 'Use lowercase words separated by hyphens.',\n\t\turl: 'Prefer a secure canonical URL.',\n\t\tkeyword: 'Use the focus keyword in the title, description, or permalink.',\n\t},\n};\n\nexport interface SeoListingCardProps {\n\t/** Site name shown in the search preview. */\n\tsiteName?: string;\n\t/** Origin the permalink is built on. */\n\tbaseUrl?: string;\n\t/** Path parts appended to the base URL. */\n\tpathSegments?: string[];\n\t/** Full URL shown under the title. */\n\tpermalink?: string;\n\t/** Surface title. */\n\ttitle?: string;\n\t/** Supporting copy shown under the label. */\n\tdescription?: string;\n\t/** Formatted price shown in the rich result. */\n\tprice?: ReactNode;\n\t/** Target keyword the copy is scored against. */\n\tkeyword?: string;\n\t/** Overall SEO score, 0-100. */\n\tscore?: SeoListingScoreResult;\n\t/** Character caps for the title and description. */\n\tlimits?: SeoListingScoreLimits;\n\t/** Renders the checks. */\n\tshowChecks?: boolean;\n\t/** Fired when an entry is edited. */\n\tonEdit?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<SeoListingCardStrings>;\n}\n","/**\n * SeoListingCard — search-result preview with a reusable SEO score.\n *\n * The card is render-only: consumers own form state and call `onEdit` or\n * compose their own editor around the exported `calculateSeoListingScore`\n * helper. Scoring is intentionally configurable through `limits` so apps can\n * tune their own title, description, and permalink thresholds.\n */\nimport {\n\tCheckCircle2,\n\tCircleAlert,\n\tExternalLink,\n\tGauge,\n\tPencil,\n\tSearch,\n\tTriangleAlert,\n\ttype LucideIcon,\n} from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport { Badge, type BadgeTone } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { ContentBlock } from '../../../base/display';\nimport { Progress } from '../../../base/feedback';\nimport { Stack } from '../../../base/structure';\nimport { Number as NumberValue, SecondaryValue, Value } from '../../../primitives';\nimport { Text, TextLink } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tcalculateSeoListingScore,\n\tgetSeoPermalinkPath,\n} from './seo-listing-score';\nimport {\n\tdefaultSeoListingCardStrings,\n\ttype SeoListingCardProps,\n\ttype SeoListingCardStrings,\n\ttype SeoListingCheckResult,\n\ttype SeoListingCheckStatus,\n} from './types';\n\n// `good` is success, not info: the row already carries a CheckCircle2, and\n// every other commerce surface (order status, inventory level, discount\n// stack, applied coupon, refund stages) signals a passing state in success\n// green. The review/missing rungs already matched the shared vocabulary.\nconst SCORE_BADGE_TONE: Record<SeoListingCheckStatus, BadgeTone> = {\n\tgood: 'success',\n\treview: 'warning',\n\tmissing: 'destructive',\n};\n\nconst SCORE_PROGRESS_CLASS: Record<SeoListingCheckStatus, string> = {\n\tgood: '[&_[data-slot=progress-indicator]]:bg-success',\n\treview: '[&_[data-slot=progress-indicator]]:bg-warning',\n\tmissing: '[&_[data-slot=progress-indicator]]:bg-destructive',\n};\n\nconst SCORE_PANEL_CLASS: Record<SeoListingCheckStatus, string> = {\n\tgood: 'border-success/20 bg-success/5',\n\treview: 'border-warning/30 bg-warning/10',\n\tmissing: 'border-destructive/20 bg-destructive/5',\n};\n\nconst SCORE_ICON_CLASS: Record<SeoListingCheckStatus, string> = {\n\tgood: 'bg-success/10 text-success',\n\treview: 'bg-warning/10 text-warning-accent',\n\tmissing: 'bg-destructive/10 text-destructive',\n};\n\nconst CHECK_ICON: Record<SeoListingCheckStatus, LucideIcon> = {\n\tgood: CheckCircle2,\n\treview: TriangleAlert,\n\tmissing: CircleAlert,\n};\n\nconst CHECK_ICON_CLASS: Record<SeoListingCheckStatus, string> = {\n\tgood: 'bg-success/10 text-success',\n\treview: 'bg-warning/10 text-warning-accent',\n\tmissing: 'bg-destructive/10 text-destructive',\n};\n\nconst CHECK_ROW_CLASS: Record<SeoListingCheckStatus, string> = {\n\tgood: 'border-success/25 bg-success/5',\n\treview: 'border-warning/30 bg-warning/10',\n\tmissing: 'border-destructive/20 bg-destructive/5',\n};\n\nfunction trimSlashes(value: string): string {\n\treturn value.replace(/^\\/+|\\/+$/g, '');\n}\n\nfunction buildUrlParts(baseUrl: string, pathSegments: string[], permalink?: string): string[] {\n\tconst path = getSeoPermalinkPath(permalink);\n\tconst permalinkParts = path.split('/').filter(Boolean);\n\treturn [\n\t\tbaseUrl,\n\t\t...pathSegments.map(trimSlashes).filter(Boolean),\n\t\t...permalinkParts,\n\t].filter(Boolean);\n}\n\nfunction buildHref(baseUrl: string, pathSegments: string[], permalink?: string): string | undefined {\n\tif (!baseUrl.trim()) return undefined;\n\tconst base = baseUrl.replace(/\\/+$/g, '');\n\tconst path = [\n\t\t...pathSegments.map(trimSlashes).filter(Boolean),\n\t\t...getSeoPermalinkPath(permalink).split('/').filter(Boolean),\n\t].join('/');\n\n\treturn path ? `${base}/${path}` : base;\n}\n\nfunction getCheckDetail(check: SeoListingCheckResult, strings: SeoListingCardStrings): string {\n\tif (check.id === 'title' || check.id === 'description') {\n\t\treturn `${check.actual}/${check.max} ${strings.characters} · ${strings.targetLabel} ${check.min}-${check.max}`;\n\t}\n\tif (check.id === 'permalink') {\n\t\treturn `${check.actual}/${check.max} ${strings.characters} ${strings.maxLabel}`;\n\t}\n\treturn strings.checkHints[check.id];\n}\n\nfunction SeoCheckRow({\n\tcheck,\n\tdetail,\n\tstrings,\n}: {\n\tcheck: SeoListingCheckResult;\n\tdetail: ReactNode;\n\tstrings: SeoListingCardStrings;\n}) {\n\tconst Icon = CHECK_ICON[check.status];\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'seo-listing-card--check min-w-0 rounded-radius border px-space-lg py-space-md',\n\t\t\t\tCHECK_ROW_CLASS[check.status],\n\t\t\t)}\n\t\t>\n\t\t\t<Stack direction=\"horizontal\" gap=\"lg\" align=\"start\" wrap={false}>\n\t\t\t\t<span\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'seo-listing-card--check-icon inline-flex size-icon-lg shrink-0 items-center justify-center rounded-inner',\n\t\t\t\t\t\tCHECK_ICON_CLASS[check.status],\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<Icon className=\"size-icon-sm\" aria-hidden=\"true\" />\n\t\t\t\t</span>\n\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0 flex-1\">\n\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" justify=\"between\" wrap={false}>\n\t\t\t\t\t\t<Text tag=\"span\" weight=\"medium\" className=\"truncate\">\n\t\t\t\t\t\t\t{strings.checkLabels[check.id]}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<Badge\n\t\t\t\t\t\t\ttone={SCORE_BADGE_TONE[check.status]}\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tinline\n\t\t\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.status[check.status]}\n\t\t\t\t\t\t</Badge>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" lineHeight=\"snug\">\n\t\t\t\t\t\t{detail}\n\t\t\t\t\t</Text>\n\t\t\t\t</Stack>\n\t\t\t</Stack>\n\t\t</div>\n\t);\n}\n\nexport function SeoListingCard({\n\tsiteName,\n\tbaseUrl,\n\tpathSegments = [],\n\tpermalink,\n\ttitle,\n\tdescription,\n\tprice,\n\tkeyword,\n\tscore,\n\tlimits,\n\tshowChecks = true,\n\tonEdit,\n\tclassName,\n\tstrings: stringsProp,\n}: SeoListingCardProps) {\n\tconst strings = useStrings(defaultSeoListingCardStrings, stringsProp);\n\tconst resolvedBaseUrl = baseUrl?.trim() || strings.urlFallback;\n\tconst resolvedSiteName = siteName?.trim() || strings.siteFallback;\n\tconst resolvedTitle = title?.trim() || strings.titleFallback;\n\tconst resolvedDescription = description?.trim() || strings.descriptionFallback;\n\tconst scoreResult = score ?? calculateSeoListingScore({\n\t\ttitle,\n\t\tdescription,\n\t\tpermalink,\n\t\tbaseUrl,\n\t\tkeyword,\n\t\tlimits,\n\t});\n\tconst href = buildHref(resolvedBaseUrl, pathSegments, permalink);\n\tconst urlParts = buildUrlParts(resolvedBaseUrl, pathSegments, permalink);\n\tconst statusTone = SCORE_BADGE_TONE[scoreResult.status];\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ticon={<Search className=\"size-icon\" />}\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={(\n\t\t\t\t<Badge tone={statusTone} size=\"sm\" inline className=\"shrink-0\">\n\t\t\t\t\t{scoreResult.score}/100 {strings.status[scoreResult.status]}\n\t\t\t\t</Badge>\n\t\t\t)}\n\t\t\tclassName={cn('seo-listing-card--component @container/seo-listing-card w-full', className)}\n\t\t\tcontentGap=\"xl\"\n\t\t\theaderAction={\n\t\t\t\tonEdit ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\taria-label={strings.editLabel}\n\t\t\t\t\t\tonClick={onEdit}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Pencil className=\"size-icon-sm\" />\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{/*\n\t\t\t\t\t`data-artwork` marks this subtree as a depiction of an external\n\t\t\t\t\tproduct rather than part of the consumer's theme. A search result\n\t\t\t\t\tmust look like a search result whatever colour the admin is themed,\n\t\t\t\t\tso the snippet title states Google's link blue outright instead of\n\t\t\t\t\tborrowing `--color-info`, which would have repainted the preview\n\t\t\t\t\twhenever someone retuned their informational-message colour.\n\t\t\t\t*/}\n\t\t\t\t<div data-artwork=\"serp\" className=\"seo-listing-card--preview min-w-0 rounded-radius border border-border/60 bg-background p-surface shadow-xs\">\n\t\t\t\t<Stack gap=\"sm\" className=\"min-w-0\">\n\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap={false}>\n\t\t\t\t\t\t<Text weight=\"medium\" className=\"truncate\">\n\t\t\t\t\t\t\t{resolvedSiteName}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t{!!href && <ExternalLink className=\"size-icon-sm shrink-0 text-muted-foreground\" aria-hidden=\"true\" />}\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<div className=\"seo-listing-card--url flex min-w-0 flex-wrap items-center gap-x-space-sm gap-y-space-2xs\">\n\t\t\t\t\t\t{urlParts.map((part, index) => (\n\t\t\t\t\t\t\t<span key={`${part}-${index}`} className=\"inline-flex min-w-0 items-center gap-space-sm\">\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"truncate\">\n\t\t\t\t\t\t\t\t\t{part}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t{index < urlParts.length - 1 && (\n\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t›\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t\t{href ? (\n\t\t\t\t\t\t<TextLink\n\t\t\t\t\t\t\thref={href}\n\t\t\t\t\t\t\tsize=\"base\"\n\t\t\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\t\t\tunderline={false}\n\t\t\t\t\t\t\tclassName=\"seo-listing-card--snippet-title block text-[#1a0dab] dark:text-[#8ab4f8]\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{resolvedTitle}\n\t\t\t\t\t\t</TextLink>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tsize=\"base\"\n\t\t\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\t\t\tclassName=\"seo-listing-card--snippet-title text-[#1a0dab] dark:text-[#8ab4f8]\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{resolvedTitle}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t)}\n\t\t\t\t\t<Text type=\"secondary\" lineHeight=\"relaxed\" className=\"seo-listing-card--description max-w-4xl\">\n\t\t\t\t\t\t{resolvedDescription}\n\t\t\t\t\t</Text>\n\t\t\t\t\t{!!price && (\n\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"seo-listing-card--price block tabular-nums\">\n\t\t\t\t\t\t\t{price}\n\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t</div>\n\n\t\t\t<div className={cn('seo-listing-card--score overflow-hidden rounded-radius border', SCORE_PANEL_CLASS[scoreResult.status])}>\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"lg\" justify=\"between\" wrap={false} className=\"border-b border-border/60 p-surface-xs\">\n\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap={false}>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t'seo-listing-card--score-icon inline-flex size-icon-lg shrink-0 items-center justify-center rounded-inner',\n\t\t\t\t\t\t\t\tSCORE_ICON_CLASS[scoreResult.status],\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Gauge className=\"size-icon-sm\" aria-hidden=\"true\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<div className=\"min-w-0\">\n\t\t\t\t\t\t\t<Text weight=\"semibold\">{strings.scoreLabel}</Text>\n\t\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t<NumberValue value={scoreResult.checks.length} size=\"xs\" type=\"secondary\" align=\"left\" /> {strings.checksLabel}\n\t\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap={false} className=\"shrink-0\">\n\t\t\t\t\t\t<Value weight=\"semibold\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t{scoreResult.score}/100\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t<Badge tone={statusTone} size=\"sm\" inline>\n\t\t\t\t\t\t\t{strings.status[scoreResult.status]}\n\t\t\t\t\t\t</Badge>\n\t\t\t\t\t</Stack>\n\t\t\t\t</Stack>\n\t\t\t\t<Stack gap=\"lg\" className=\"p-surface-xs\">\n\t\t\t\t\t<Progress\n\t\t\t\t\t\tvalue={scoreResult.score}\n\t\t\t\t\t\taria-label={strings.scoreLabel}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'seo-listing-card--score-progress',\n\t\t\t\t\t\t\t'[&_[data-slot=progress-track]]:h-space-md',\n\t\t\t\t\t\t\tSCORE_PROGRESS_CLASS[scoreResult.status],\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t\t{!!showChecks && (\n\t\t\t\t\t\t<div className=\"seo-listing-card--checks grid gap-x-space-lg gap-y-space-lg @xl/seo-listing-card:grid-cols-2\">\n\t\t\t\t\t\t\t{scoreResult.checks.map((check) => (\n\t\t\t\t\t\t\t\t<SeoCheckRow\n\t\t\t\t\t\t\t\t\tkey={check.id}\n\t\t\t\t\t\t\t\t\tcheck={check}\n\t\t\t\t\t\t\t\t\tdetail={getCheckDetail(check, strings)}\n\t\t\t\t\t\t\t\t\tstrings={strings}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t</div>\n\t\t</ContentBlock>\n\t);\n}\n\nSeoListingCard.displayName = 'SeoListingCard';\n","import type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type InvoiceStatus = 'paid' | 'pending' | 'overdue';\n\nexport interface InvoiceMiniData {\n\tinvoiceNumber: string;\n\tcustomerName: string;\n\tlineItemsCount: number;\n\ttotalAmount: string;\n\tstatus: InvoiceStatus;\n\tdueDate: string;\n}\n\nexport interface InvoiceMiniStrings {\n\tpaid: string;\n\tpending: string;\n\toverdue: string;\n\titems: (count: number) => string;\n\tdue: string;\n}\n\nexport const defaultInvoiceMiniStrings: InvoiceMiniStrings = {\n\tpaid: 'Paid',\n\tpending: 'Pending',\n\toverdue: 'Overdue',\n\titems: (count) => (count === 1 ? '1 line item' : `${count} line items`),\n\tdue: 'Due',\n};\n\nexport interface InvoiceMiniProps {\n\t/** The invoice to summarise. */\n\tinvoice: InvoiceMiniData;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<InvoiceMiniStrings>;\n}\n\nexport const invoiceStatusTone: Record<InvoiceStatus, BadgeTone> = {\n\tpaid: 'success',\n\tpending: 'warning',\n\toverdue: 'destructive',\n};\n","/**\n * InvoiceMini — compact invoice tile for lists / dashboards. Header\n * (number + status chip), customer name, footer split between items-count /\n * due date and the total amount. Strings (status labels, \"Due\", item count\n * pluralisation) overridable for i18n via the `strings` prop.\n */\nimport { Badge } from '../../../base/badge';\nimport { Stack } from '../../../base/structure';\nimport { MonoValue, SecondaryValue, Value } from '../../../primitives';\nimport { Text } from '../../../typography/text';\nimport { mergeStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultInvoiceMiniStrings,\n\tinvoiceStatusTone,\n\ttype InvoiceMiniProps,\n\ttype InvoiceStatus,\n} from './types';\n\nexport function InvoiceMini({\n\tinvoice,\n\tclassName,\n\tstrings: stringsProp,\n}: InvoiceMiniProps) {\n\tconst strings = mergeStrings(defaultInvoiceMiniStrings, stringsProp);\n\tconst labelByStatus: Record<InvoiceStatus, string> = {\n\t\tpaid: strings.paid,\n\t\tpending: strings.pending,\n\t\toverdue: strings.overdue,\n\t};\n\n\treturn (\n\t\t<Stack\n\t\t\tgap=\"md\"\n\t\t\tdata-component=\"invoice-mini\"\n\t\t\tdata-slot=\"invoice-mini\"\n\t\t\tclassName={cn('invoice-mini--component', className)}\n\t\t>\n\t\t\t<Stack direction=\"horizontal\" gap=\"md\" justify=\"between\" wrap={false}>\n\t\t\t\t<MonoValue className=\"min-w-0 flex-1 truncate tracking-wide\">\n\t\t\t\t\t{invoice.invoiceNumber}\n\t\t\t\t</MonoValue>\n\t\t\t\t<Badge\n\t\t\t\t\ttone={invoiceStatusTone[invoice.status]}\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tdot\n\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t>\n\t\t\t\t\t{labelByStatus[invoice.status]}\n\t\t\t\t</Badge>\n\t\t\t</Stack>\n\n\t\t\t<Text type=\"secondary\" className=\"truncate\">\n\t\t\t\t{invoice.customerName}\n\t\t\t</Text>\n\n\t\t\t<Stack direction=\"horizontal\" gap=\"lg\" align=\"end\" justify=\"between\" className=\"pt-space-xs\">\n\t\t\t\t<Stack gap=\"2xs\" className=\"min-w-0\">\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{strings.items(invoice.lineItemsCount)}\n\t\t\t\t\t</Text>\n\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"whitespace-nowrap tabular-nums\">\n\t\t\t\t\t\t{strings.due} {invoice.dueDate}\n\t\t\t\t\t</SecondaryValue>\n\t\t\t\t</Stack>\n\t\t\t\t<Value\n\t\t\t\t\tsize=\"base\"\n\t\t\t\t\tweight=\"bold\"\n\t\t\t\t\tclassName={cn('ml-auto shrink-0 tabular-nums leading-none')}\n\t\t\t\t>\n\t\t\t\t\t{invoice.totalAmount}\n\t\t\t\t</Value>\n\t\t\t</Stack>\n\t\t</Stack>\n\t);\n}\n\nInvoiceMini.displayName = 'InvoiceMini';\n","import type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport type { InvoiceStatus } from '../invoice-mini/types';\n\nexport interface InvoiceParty {\n\t/** Display name. */\n\tname: string;\n\tlocation?: string;\n}\n\nexport interface InvoiceHeaderStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tbillFrom: string;\n\tbillTo: string;\n\tissued: string;\n\tdue: string;\n\tamountDue: string;\n\t/** Chip label for each `InvoiceStatus`. */\n\tpaid: string;\n\tpending: string;\n\toverdue: string;\n}\n\nexport const defaultInvoiceHeaderStrings: InvoiceHeaderStrings = {\n\ttitle: 'Invoice',\n\tbillFrom: 'Bill From',\n\tbillTo: 'Bill To',\n\tissued: 'Issued',\n\tdue: 'Due',\n\tamountDue: 'Amount Due',\n\tpaid: 'Paid',\n\tpending: 'Pending',\n\toverdue: 'Overdue',\n};\n\nexport interface InvoiceHeaderProps {\n\t/** Human-facing invoice reference. */\n\tinvoiceNumber: string;\n\t/**\n\t * Payment state. Drives both the chip label (through `strings`) and its\n\t * tone, so the two can never disagree. Shares the `InvoiceStatus` union\n\t * with `InvoiceMini`.\n\t */\n\tstatus: InvoiceStatus;\n\t/**\n\t * Overrides the badge tone derived from `status`. Reach for it only when\n\t * the surrounding surface needs a tone the status does not imply.\n\t */\n\tstatusTone?: BadgeTone;\n\t/** Issuing party. */\n\tfrom: InvoiceParty;\n\t/** Billed party. */\n\tto: InvoiceParty;\n\t/** Formatted issue date. */\n\tissuedDate?: string;\n\t/** Formatted due date. */\n\tdueDate?: string;\n\t/** Formatted invoice total. */\n\tamount: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<InvoiceHeaderStrings>;\n}\n","/**\n * InvoiceHeader — invoice document header.\n *\n * Top row: invoice number (mono, prominent) + status chip.\n * Middle: Bill-from / Bill-to parties as a 2-col grid that stacks on small\n * screens and uses an uppercase-tracking-wider eyebrow + name + secondary\n * location.\n * Bottom: dates on the leading edge + amount-due block on the trailing edge.\n *\n * Strings overridable for i18n via the `strings` prop.\n */\nimport { Badge } from '../../../base/badge';\nimport { Heading } from '../../../typography/heading';\nimport { DisplayLabel } from '../../../typography/display-label';\nimport { Text } from '../../../typography/text';\nimport { InlineStat } from '../../data-display';\nimport { Separator } from '../../../base/display/separator';\nimport { Grid, Stack } from '../../../base/structure';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { invoiceStatusTone, type InvoiceStatus } from '../invoice-mini/types';\nimport { defaultInvoiceHeaderStrings, type InvoiceHeaderProps } from './types';\n\nfunction PartyBlock({\n\teyebrow,\n\tname,\n\tlocation,\n}: {\n\teyebrow: string;\n\tname: string;\n\tlocation?: string;\n}) {\n\treturn (\n\t\t<Stack gap=\"xs\" className=\"invoice-header--party\">\n\t\t\t<DisplayLabel>\n\t\t\t\t{eyebrow}\n\t\t\t</DisplayLabel>\n\t\t\t<Text weight=\"semibold\" className=\"leading-snug\">\n\t\t\t\t{name}\n\t\t\t</Text>\n\t\t\t{!!location && (\n\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"leading-snug\">\n\t\t\t\t\t{location}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nexport function InvoiceHeader({\n\tinvoiceNumber,\n\tstatus,\n\tstatusTone,\n\tfrom,\n\tto,\n\tissuedDate,\n\tdueDate,\n\tamount,\n\tclassName,\n\tstrings: stringsProp,\n}: InvoiceHeaderProps) {\n\tconst strings = useStrings(defaultInvoiceHeaderStrings, stringsProp);\n\tconst labelByStatus: Record<InvoiceStatus, string> = {\n\t\tpaid: strings.paid,\n\t\tpending: strings.pending,\n\t\toverdue: strings.overdue,\n\t};\n\t// The tone follows the status the same way `InvoiceMini` resolves it, so\n\t// an overdue invoice can no longer inherit a green chip from a default.\n\tconst resolvedStatusTone = statusTone ?? invoiceStatusTone[status];\n\n\treturn (\n\t\t<Stack\n\t\t\tgap=\"2xl\"\n\t\t\tdata-component=\"invoice-header\"\n\t\t\tdata-slot=\"invoice-header\"\n\t\t\tclassName={cn('invoice-header--component min-w-0', className)}\n\t\t\taria-label={strings.title}\n\t\t>\n\t\t\t<Stack direction=\"horizontal\" align=\"center\" justify=\"between\" gap=\"lg\">\n\t\t\t\t<Text\n\t\t\t\t\tweight=\"bold\"\n\t\t\t\t\tclassName=\"font-mono tracking-wide\"\n\t\t\t\t>\n\t\t\t\t\t{invoiceNumber}\n\t\t\t\t</Text>\n\t\t\t\t<Badge tone={resolvedStatusTone}>{labelByStatus[status]}</Badge>\n\t\t\t</Stack>\n\n\t\t\t<Grid columns={{ base: 1, sm: 2 }} gap={{ base: 'xl', sm: '2xl' }}>\n\t\t\t\t<PartyBlock eyebrow={strings.billFrom} name={from.name} location={from.location} />\n\t\t\t\t<PartyBlock eyebrow={strings.billTo} name={to.name} location={to.location} />\n\t\t\t</Grid>\n\n\t\t\t<Separator />\n\n\t\t\t<Stack direction=\"horizontal\" gap=\"xl\" align=\"end\" justify=\"between\">\n\t\t\t\t<Stack gap=\"xs\">\n\t\t\t\t\t{!!issuedDate && (\n\t\t\t\t\t\t<InlineStat\n\t\t\t\t\t\t\tlayout=\"inline\"\n\t\t\t\t\t\t\tlabel={strings.issued}\n\t\t\t\t\t\t\tvalue={issuedDate}\n\t\t\t\t\t\t\tmono\n\t\t\t\t\t\t\tvalueClassName=\"font-medium\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!dueDate && (\n\t\t\t\t\t\t<InlineStat\n\t\t\t\t\t\t\tlayout=\"inline\"\n\t\t\t\t\t\t\tlabel={strings.due}\n\t\t\t\t\t\t\tvalue={dueDate}\n\t\t\t\t\t\t\tmono\n\t\t\t\t\t\t\tvalueClassName=\"font-medium\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t\t<Stack gap=\"dense\" className=\"text-right\">\n\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t{strings.amountDue}\n\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t<Heading\n\t\t\t\t\t\ttag=\"h3\"\n\t\t\t\t\t\tclassName={cn('text-base tabular-nums leading-none tracking-tight border-none pb-0')}\n\t\t\t\t\t>\n\t\t\t\t\t\t{amount}\n\t\t\t\t\t</Heading>\n\t\t\t\t</Stack>\n\t\t\t</Stack>\n\t\t</Stack>\n\t);\n}\n\nInvoiceHeader.displayName = 'InvoiceHeader';\n","import type { ReactNode } from 'react';\nimport type { StringsProp } from '../../../../lib/strings';\n\n/** Default line-item shape used by the concise InvoiceLineItems mode. */\nexport interface InvoiceLineItem {\n\t/** Supporting copy shown under the label. */\n\tdescription: string;\n\tqty: number;\n\tprice: number;\n\t/** Total number of records across all pages. */\n\ttotal: number;\n}\n\n/**\n * Per-column definition. Each column declares how to render its header label\n * and a row's cell. Generic over the row type so consumers can pass arbitrary\n * data without losing type safety.\n */\nexport interface InvoiceColumn<TItem = InvoiceLineItem> {\n\t/** Stable identity for this entry. */\n\tid: string;\n\theader: ReactNode;\n\t/** Tailwind class for the column's grid track (e.g. `'1fr'`, `'80px'`). */\n\twidth?: string;\n\talign?: 'left' | 'right' | 'center';\n\tcell: (item: TItem, index: number) => ReactNode;\n\t/** Class names appended to header cell. */\n\theaderClassName?: string;\n\t/** Class names appended to each row cell of this column. */\n\tcellClassName?: string;\n}\n\n/** A footer row (totals, taxes, etc.). Ordered as written. */\nexport interface InvoiceLineItemsFooterRow {\n\t/** Display label. */\n\tlabel: ReactNode;\n\tvalue: ReactNode;\n\t/** Emphasis for the row. `total` renders bold + thicker top spacing. */\n\temphasis?: 'normal' | 'total';\n}\n\nexport interface InvoiceLineItemsStrings {\n\titem: string;\n\tquantity: string;\n\tprice: string;\n\tsubtotal: string;\n\ttax: string;\n\t/** Total number of records across all pages. */\n\ttotal: string;\n}\n\nexport const defaultInvoiceLineItemsStrings: InvoiceLineItemsStrings = {\n\titem: 'Item',\n\tquantity: 'Qty',\n\tprice: 'Price',\n\tsubtotal: 'Subtotal',\n\ttax: 'Tax',\n\ttotal: 'Total',\n};\n\nexport interface InvoiceLineItemsProps<TItem = InvoiceLineItem> {\n\t/** Line items on the invoice. */\n\titems: TItem[];\n\t/** Optional custom columns. Defaults to Description / Qty / Price / Total. */\n\tcolumns?: InvoiceColumn<TItem>[];\n\t/** Optional custom footer rows. When omitted with the default columns, an\n\t * auto-computed subtotal / tax / total footer is used. */\n\tfooterRows?: InvoiceLineItemsFooterRow[];\n\t/** Tax ratio for the default footer (`0.2` means 20%). @default 0.2 */\n\ttaxRate?: number;\n\t/** ISO 4217 code for default monetary cells. Falls back to UIProvider. */\n\tcurrency?: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<InvoiceLineItemsStrings>;\n}\n","/**\n * InvoiceLineItems — flexible invoice line-item table.\n *\n * Generic over the row type. Pass custom `columns` and `footerRows` for any\n * shape of data. Without those, uses the concise default\n * `InvoiceLineItem` shape (description / qty / price / total) with an\n * auto-computed subtotal / tax / total footer.\n */\nimport type { ReactNode } from 'react';\n\nimport { DisplayLabel } from '../../../typography/display-label';\nimport { Text } from '../../../typography/text';\nimport { Separator } from '../../../base/display/separator';\nimport { Stack } from '../../../base/structure';\nimport { Money, Number as NumberValue, Percent, Value } from '../../../primitives';\nimport { useStrings } from '../../../../lib/strings';\nimport { useMoneyConfig } from '../../../../lib/ui-provider';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultInvoiceLineItemsStrings,\n\ttype InvoiceColumn,\n\ttype InvoiceLineItem,\n\ttype InvoiceLineItemsFooterRow,\n\ttype InvoiceLineItemsProps,\n} from './types';\n\nconst wrapperGlass = 'border border-border shadow-sm';\n\nconst ALIGN_CLASS = {\n\tleft: 'text-left justify-start',\n\tright: 'text-right justify-end',\n\tcenter: 'text-center justify-center',\n} as const;\n\nfunction InvoiceCurrencyValue({\n\tamount,\n\tcurrency,\n\tweight = 'regular',\n}: {\n\tamount: number;\n\tcurrency: string;\n\tweight?: 'regular' | 'bold';\n}) {\n\treturn (\n\t\t<Money\n\t\t\tamount={amount}\n\t\t\tcurrency={currency}\n\t\t\tminimumFractionDigits={2}\n\t\t\tmaximumFractionDigits={2}\n\t\t\tweight={weight}\n\t\t/>\n\t);\n}\n\nfunction buildDefaultColumns(\n\tcurrency: string,\n\tstrings: typeof defaultInvoiceLineItemsStrings,\n): InvoiceColumn<InvoiceLineItem>[] {\n\treturn [\n\t\t{\n\t\t\tid: 'description',\n\t\t\theader: strings.item,\n\t\t\twidth: 'minmax(0,1fr)',\n\t\t\tcell: (item) => <Text className=\"break-words\">{item.description}</Text>,\n\t\t},\n\t\t{\n\t\t\tid: 'qty',\n\t\t\theader: strings.quantity,\n\t\t\twidth: '36px',\n\t\t\talign: 'center',\n\t\t\tcell: (item) => <NumberValue value={item.qty} align=\"center\" />,\n\t\t},\n\t\t{\n\t\t\tid: 'price',\n\t\t\theader: strings.price,\n\t\t\twidth: '82px',\n\t\t\talign: 'right',\n\t\t\tcell: (item) => <InvoiceCurrencyValue amount={item.price} currency={currency} />,\n\t\t},\n\t\t{\n\t\t\tid: 'total',\n\t\t\theader: strings.total,\n\t\t\twidth: '82px',\n\t\t\talign: 'right',\n\t\t\tcell: (item) => <InvoiceCurrencyValue amount={item.total} currency={currency} />,\n\t\t},\n\t];\n}\n\nfunction buildDefaultFooterRows(\n\titems: InvoiceLineItem[],\n\ttaxRate: number,\n\tcurrency: string,\n\tstrings: typeof defaultInvoiceLineItemsStrings,\n): InvoiceLineItemsFooterRow[] {\n\tconst subtotal = items.reduce((s, i) => s + i.total, 0);\n\tconst tax = Math.round(subtotal * taxRate * 100) / 100;\n\tconst total = subtotal + tax;\n\treturn [\n\t\t{ label: strings.subtotal, value: <InvoiceCurrencyValue amount={subtotal} currency={currency} /> },\n\t\t{\n\t\t\tlabel: <>{strings.tax} (<Percent value={taxRate} />)</>,\n\t\t\tvalue: <InvoiceCurrencyValue amount={tax} currency={currency} />,\n\t\t},\n\t\t{ label: strings.total, value: <InvoiceCurrencyValue amount={total} currency={currency} weight=\"bold\" />, emphasis: 'total' },\n\t];\n}\n\nexport function InvoiceLineItems<TItem = InvoiceLineItem>({\n\titems,\n\tcolumns,\n\tfooterRows,\n\ttaxRate = 0.2,\n\tcurrency,\n\tclassName,\n\tstrings: stringsProp,\n}: InvoiceLineItemsProps<TItem>) {\n\tconst strings = useStrings(defaultInvoiceLineItemsStrings, stringsProp);\n\tconst { defaultCurrency } = useMoneyConfig();\n\tconst resolvedCurrency = currency ?? defaultCurrency ?? '€';\n\n\t// Boundary casts: the default builders are intentionally non-generic and\n\t// only run in concise default mode where the consumer didn't pass\n\t// `columns`. In that mode the runtime row shape IS `InvoiceLineItem` —\n\t// the cast is the documented bridge between the generic `<TItem>` API\n\t// and the concrete default shape.\n\tconst resolvedColumns: InvoiceColumn<TItem>[] =\n\t\tcolumns ?? (buildDefaultColumns(resolvedCurrency, strings) as unknown as InvoiceColumn<TItem>[]);\n\n\tconst resolvedFooterRows: InvoiceLineItemsFooterRow[] = footerRows\n\t\t?? (columns\n\t\t\t? []\n\t\t\t: buildDefaultFooterRows(items as unknown as InvoiceLineItem[], taxRate, resolvedCurrency, strings));\n\n\tconst gridTemplate = columns ? resolvedColumns.map((c) => c.width ?? '1fr').join(' ') : undefined;\n\tconst defaultGrid = 'grid-cols-3 @lg/invoice-line-items:grid-cols-[minmax(0,1fr)_36px_82px_82px]';\n\n\treturn (\n\t\t<div className={cn('invoice-line-items--component', '@container/invoice-line-items w-full min-w-0 max-w-full overflow-hidden rounded-radius bg-card', wrapperGlass, className)}>\n\t\t\t{/* Header */}\n\t\t\t<div\n\t\t\t\tclassName={cn('invoice-line-items--header min-w-0 gap-space-md bg-muted/40 px-row-x py-row-y', columns ? 'grid' : ['hidden @lg/invoice-line-items:grid', defaultGrid])}\n\t\t\t\tstyle={{ gridTemplateColumns: gridTemplate }}\n\t\t\t>\n\t\t\t\t{resolvedColumns.map((col) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={col.id}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'flex min-w-0',\n\t\t\t\t\t\t\tALIGN_CLASS[col.align ?? 'left'],\n\t\t\t\t\t\t\tcol.headerClassName,\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DisplayLabel className=\"min-w-0 truncate\">\n\t\t\t\t\t\t\t{col.header}\n\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t</div>\n\t\t\t\t))}\n\t\t\t</div>\n\n\t\t\t{/* Rows */}\n\t\t\t{items.map((item, i) => (\n\t\t\t\t<div\n\t\t\t\t\tkey={i}\n\t\t\t\t\tclassName={cn('invoice-line-items--row grid min-w-0 gap-space-md px-row-x py-row-y', !columns && defaultGrid, i % 2 === 1 && 'bg-muted/20')}\n\t\t\t\t\tstyle={{ gridTemplateColumns: gridTemplate }}\n\t\t\t\t>\n\t\t\t\t\t{resolvedColumns.map((col) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={col.id}\n\t\t\t\t\t\t\tdata-column={col.id}\n\t\t\t\t\t\t\tclassName={cn('min-w-0', columns ? ['flex items-center', ALIGN_CLASS[col.align ?? 'left']] : col.id === 'description' ? 'col-span-full @lg/invoice-line-items:col-span-1' : ['grid gap-space-xs', col.align === 'center' ? 'text-center justify-items-center' : 'text-right justify-items-end'], col.cellClassName)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!columns && col.id !== 'description' && <DisplayLabel className=\"@lg/invoice-line-items:hidden\">{col.header}</DisplayLabel>}\n\t\t\t\t\t\t\t{col.cell(item, i)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t))}\n\n\t\t\t{/* Footer */}\n\t\t\t{resolvedFooterRows.length > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<Separator />\n\t\t\t\t\t<div className=\"invoice-line-items--footer p-surface\">\n\t\t\t\t\t<Stack gap=\"sm\">\n\t\t\t\t\t\t{resolvedFooterRows.map((row, idx) => (\n\t\t\t\t\t\t\t<Stack\n\t\t\t\t\t\t\t\tkey={idx}\n\t\t\t\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\t\t\tjustify=\"between\"\n\t\t\t\t\t\t\t\talign=\"baseline\"\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\trow.emphasis === 'total' && 'pt-space-md',\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\ttype={row.emphasis === 'total' ? undefined : 'secondary'}\n\t\t\t\t\t\t\t\t\tweight={row.emphasis === 'total' ? 'bold' : 'regular'}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{row.label}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t{isSimpleText(row.value) ? (\n\t\t\t\t\t\t\t\t\t<Value weight={row.emphasis === 'total' ? 'bold' : 'regular'}>\n\t\t\t\t\t\t\t\t\t\t{row.value}\n\t\t\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<div className=\"invoice-line-items--footer-value shrink-0\">{row.value}</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Stack>\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nInvoiceLineItems.displayName = 'InvoiceLineItems';\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n","import { ContentBlock } from '../../../base/display';\nimport { cn } from '../../../../lib/utils';\n\nimport { Timeline, type TimelineItem } from '../../timelines';\nimport type { OrderTimelineProps } from './types';\n\nexport function OrderTimeline({\n\ttitle,\n\tdescription,\n\tevents,\n\tfooterText,\n\tclassName,\n}: OrderTimelineProps) {\n\tconst items: TimelineItem[] = events.map((event) => ({\n\t\tid: event.id,\n\t\ttitle: event.title,\n\t\tdescription: event.description,\n\t\ttimestamp: event.timestamp,\n\t\tstatus: event.status,\n\t}));\n\n\treturn (\n\t\t<ContentBlock\n\t\t\tdata-component=\"order-timeline\"\n\t\t\tdata-slot=\"order-timeline\"\n\t\t\ttitle={title}\n\t\t\tdescription={description}\n\t\t\tfooterText={footerText}\n\t\t\tclassName={cn('order-timeline--component', className)}\n\t\t>\n\t\t\t<Timeline items={items} />\n\t\t</ContentBlock>\n\t);\n}\n\nOrderTimeline.displayName = 'OrderTimeline';\n","import { Value } from '../../../primitives';\nimport { cn } from '../../../../lib/utils';\n\nimport { Timeline, type TimelineItem } from '../../timelines';\nimport type { PaymentTimelineProps } from './types';\n\nexport function PaymentTimeline({ events, className }: PaymentTimelineProps) {\n\tconst items: TimelineItem[] = events.map((event, index) => ({\n\t\tid: `${event.label}-${String(index)}`,\n\t\ttitle: event.label,\n\t\tdescription: event.date,\n\t\ticon: event.icon,\n\t\tstatus: event.done ? 'success' : 'pending',\n\t\tchildren: event.amount ? (\n\t\t\t<Value weight=\"medium\" className=\"tabular-nums text-success\">\n\t\t\t\t{event.amount}\n\t\t\t</Value>\n\t\t) : undefined,\n\t}));\n\n\treturn (\n\t\t<div\n\t\t\tdata-component=\"payment-timeline\"\n\t\t\tdata-slot=\"payment-timeline\"\n\t\t\tclassName={cn('payment-timeline--component min-w-0', className)}\n\t\t>\n\t\t\t<Timeline items={items} dotSize=\"lg\" />\n\t\t</div>\n\t);\n}\n\nPaymentTimeline.displayName = 'PaymentTimeline';\n","import type { SelectOption } from '../../../base/choice-inputs';\nimport type { WeightUnit } from '../../../base/forms-numeric';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type InventoryPolicy = 'deny' | 'continue';\nexport type InventoryStatus = 'in_stock' | 'low_stock' | 'out_of_stock' | 'untracked';\n\nexport interface InventorySectionValue {\n\tsku?: string;\n\tbarcode?: string;\n\ttrackQuantity?: boolean;\n\tavailable?: string;\n\tcommitted?: string;\n\tincoming?: string;\n\tlowStockThreshold?: string;\n\tinventoryPolicy?: InventoryPolicy;\n\tlocationId?: string;\n\tbinLocation?: string;\n\trequiresShipping?: boolean;\n\tweight?: string;\n\tweightUnit?: WeightUnit;\n\tcountryOfOrigin?: string;\n\thsCode?: string;\n\ttags?: string[];\n}\n\nexport type InventorySectionField = keyof InventorySectionValue;\n\nexport type InventorySectionName =\n\t| 'summary'\n\t| 'identity'\n\t| 'tracking'\n\t| 'location'\n\t| 'shipping'\n\t| 'customs'\n\t| 'tags';\n\nexport interface InventorySectionChange {\n\tfield: InventorySectionField;\n\tvalue: InventorySectionValue[InventorySectionField];\n\tpreviousValue: InventorySectionValue[InventorySectionField];\n}\n\nexport interface InventorySectionMetric {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Display label. */\n\tlabel: string;\n\tvalue: string;\n\t/** Supporting copy shown under the label. */\n\tdescription?: string;\n\t/** Semantic tone driving the entry's colour. */\n\ttone?: 'default' | 'success' | 'warning' | 'error' | 'info';\n}\n\nexport interface InventorySectionStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Supporting copy shown under the label. */\n\tdescription: string;\n\tstatus: Record<InventoryStatus, string>;\n\tsections: Record<Exclude<InventorySectionName, 'summary'>, string>;\n\tfields: Record<InventorySectionField, string>;\n\tplaceholders: Partial<Record<InventorySectionField, string>>;\n\thints: Partial<Record<InventorySectionField, string>>;\n\t/** Overflow menu for the surface as a whole. */\n\tactions: {\n\t\tgenerateSku: string;\n\t\trestock: string;\n\t};\n\tpolicyOptions: Record<InventoryPolicy, {\n\t\tlabel: string;\n\t\tdescription: string;\n\t}>;\n\tsummary: {\n\t\tavailable: string;\n\t\tcommitted: string;\n\t\tincoming: string;\n\t\tthreshold: string;\n\t\tuntracked: string;\n\t};\n\ttagInput: {\n\t\tplaceholder: string;\n\t\temptyRecommendations: string;\n\t\tclearAll: string;\n\t\tsummary: (current: number, max: number) => string;\n\t};\n}\n\nexport const defaultInventorySectionStrings: InventorySectionStrings = {\n\ttitle: 'Inventory',\n\tdescription: 'Manage stock tracking, availability, fulfillment, and compliance details.',\n\tstatus: {\n\t\tin_stock: 'In stock',\n\t\tlow_stock: 'Low stock',\n\t\tout_of_stock: 'Out of stock',\n\t\tuntracked: 'Not tracked',\n\t},\n\tsections: {\n\t\tidentity: 'Identifiers',\n\t\ttracking: 'Stock tracking',\n\t\tlocation: 'Location',\n\t\tshipping: 'Shipping',\n\t\tcustoms: 'Customs',\n\t\ttags: 'Tags',\n\t},\n\tfields: {\n\t\tsku: 'SKU',\n\t\tbarcode: 'Barcode',\n\t\ttrackQuantity: 'Track quantity',\n\t\tavailable: 'Available',\n\t\tcommitted: 'Committed',\n\t\tincoming: 'Incoming',\n\t\tlowStockThreshold: 'Low-stock threshold',\n\t\tinventoryPolicy: 'When sold out',\n\t\tlocationId: 'Stock location',\n\t\tbinLocation: 'Bin / shelf',\n\t\trequiresShipping: 'Requires shipping',\n\t\tweight: 'Weight',\n\t\tweightUnit: 'Weight unit',\n\t\tcountryOfOrigin: 'Country of origin',\n\t\thsCode: 'HS code',\n\t\ttags: 'Inventory tags',\n\t},\n\tplaceholders: {\n\t\tsku: 'BAL-750-CL',\n\t\tbarcode: 'Scan or enter barcode',\n\t\tavailable: '0',\n\t\tcommitted: '0',\n\t\tincoming: '0',\n\t\tlowStockThreshold: '5',\n\t\tlocationId: 'Select location',\n\t\tbinLocation: 'Aisle / shelf / bin',\n\t\tweight: '0.00',\n\t\tcountryOfOrigin: 'Country code or name',\n\t\thsCode: 'e.g. 2204.21',\n\t\ttags: 'Add tag...',\n\t},\n\thints: {\n\t\tsku: 'Internal stock keeping unit.',\n\t\tbarcode: 'GTIN, UPC, EAN, ISBN, or internal scan code.',\n\t\tavailable: 'Units currently sellable at this location.',\n\t\tcommitted: 'Units already reserved by open orders.',\n\t\tincoming: 'Units expected from transfers, suppliers, or production.',\n\t\tlowStockThreshold: 'Used for low-stock warnings.',\n\t\tinventoryPolicy: 'Choose whether checkout should block when inventory reaches zero.',\n\t\tlocationId: 'Where this inventory is stocked or fulfilled from.',\n\t\tbinLocation: 'Optional warehouse shelf, bay, or bin reference.',\n\t\tweight: 'Used for shipping rates and fulfillment labels.',\n\t\tcountryOfOrigin: 'Required for international customs in many markets.',\n\t\thsCode: 'Harmonized System tariff code for customs.',\n\t\ttags: 'Optional operational labels such as preorder, seasonal, or batch codes.',\n\t},\n\tactions: {\n\t\tgenerateSku: 'Generate SKU',\n\t\trestock: 'Restock',\n\t},\n\tpolicyOptions: {\n\t\tdeny: {\n\t\t\tlabel: 'Stop selling',\n\t\t\tdescription: 'Block checkout when available inventory reaches zero.',\n\t\t},\n\t\tcontinue: {\n\t\t\tlabel: 'Continue selling',\n\t\t\tdescription: 'Allow backorders or made-to-order fulfillment.',\n\t\t},\n\t},\n\tsummary: {\n\t\tavailable: 'Available',\n\t\tcommitted: 'Committed',\n\t\tincoming: 'Incoming',\n\t\tthreshold: 'Low-stock at',\n\t\tuntracked: 'Inventory is not tracked for this product.',\n\t},\n\ttagInput: {\n\t\tplaceholder: 'Add inventory tag...',\n\t\temptyRecommendations: 'No matching tags.',\n\t\tclearAll: 'Clear tags',\n\t\tsummary: (current, max) => `${current} / ${max} tags`,\n\t},\n};\n\nexport interface InventorySectionCardProps {\n\t/** Current field values for every inventory section. Controlled. */\n\tvalue: InventorySectionValue;\n\t/** Fired with the next value. */\n\tonValueChange?: (value: InventorySectionValue, change: InventorySectionChange) => void;\n\t/** Validation messages keyed by field, rendered under the matching control. */\n\terrors?: Partial<Record<InventorySectionField, string>>;\n\t/** Renders the entry as unselectable. */\n\tdisabled?: boolean;\n\t/** Renders every field as read-only text instead of an editable control. */\n\treadOnly?: boolean;\n\t/** Which sections are shown. Omitted sections default to visible. */\n\tvisibleSections?: Partial<Record<InventorySectionName, boolean>>;\n\t/** Which individual fields are shown. Omitted fields default to visible. */\n\tvisibleFields?: Partial<Record<InventorySectionField, boolean>>;\n\t/** Choices for the stock-location select. */\n\tlocationOptions?: SelectOption[];\n\t/** Choices for the country-of-origin select. */\n\tcountryOptions?: SelectOption[];\n\t/** Suggested tags offered beneath the tag input. */\n\ttagRecommendations?: string[];\n\t/** Caps how many tags may be added. */\n\tmaxTags?: number;\n\tonGenerateSku?: (value: InventorySectionValue) => string | void;\n\tonRestock?: (value: InventorySectionValue) => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<InventorySectionStrings>;\n}\n","/**\n * InventorySectionCard — controlled commerce inventory form card.\n *\n * The component owns no persistence and performs no routing. Consumers pass a\n * `value` object, receive field-level `onValueChange` updates, and decide how to\n * submit or validate. Section and field visibility props let apps reuse the\n * same surface for physical products, digital products, variants, and location\n * level inventory without forking the component.\n */\nimport { Barcode, PackageCheck, RefreshCw, Sparkles } from 'lucide-react';\n\nimport { Badge, type BadgeTone } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { ContentBlock } from '../../../base/display';\nimport { CardRadioGroup, Select, ToggleField } from '../../../base/choice-inputs';\nimport { FormField } from '../../../base/forms';\nimport { Input } from '../../../base/text-inputs';\nimport { TagsInput } from '../../../base/value-inputs';\nimport { DecimalInput, WeightInput } from '../../../base/forms-numeric';\nimport { Grid, Stack } from '../../../base/structure';\nimport { Value } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultInventorySectionStrings,\n\ttype InventoryPolicy,\n\ttype InventorySectionCardProps,\n\ttype InventorySectionField,\n\ttype InventorySectionMetric,\n\ttype InventorySectionName,\n\ttype InventorySectionValue,\n\ttype InventoryStatus,\n} from './types';\n\nconst STATUS_VARIANT: Record<InventoryStatus, BadgeTone> = {\n\tin_stock: 'success',\n\tlow_stock: 'warning',\n\tout_of_stock: 'destructive',\n\tuntracked: 'secondary',\n};\n\nconst METRIC_TONE_CLASS: Record<NonNullable<InventorySectionMetric['tone']>, string> = {\n\tdefault: 'border-border/60 bg-muted/20',\n\tsuccess: 'border-success/20 bg-success/5',\n\twarning: 'border-warning/30 bg-warning/10',\n\terror: 'border-destructive/20 bg-destructive/5',\n\tinfo: 'border-info/20 bg-info/5',\n};\n\nfunction parseQuantity(value?: string): number | undefined {\n\tif (value === undefined || value.trim() === '') return undefined;\n\tconst parsed = Number(value);\n\treturn Number.isFinite(parsed) ? parsed : undefined;\n}\n\nfunction getInventoryStatus(value: InventorySectionValue): InventoryStatus {\n\tconst isTracked = value.trackQuantity ?? true;\n\tif (!isTracked) return 'untracked';\n\n\tconst available = parseQuantity(value.available) ?? 0;\n\tif (available <= 0) return 'out_of_stock';\n\n\tconst threshold = parseQuantity(value.lowStockThreshold);\n\tif (threshold !== undefined && available <= threshold) return 'low_stock';\n\n\treturn 'in_stock';\n}\n\nfunction getMetricTone(metricId: string, status: InventoryStatus): InventorySectionMetric['tone'] {\n\tif (metricId === 'available') {\n\t\tif (status === 'in_stock') return 'success';\n\t\tif (status === 'low_stock') return 'warning';\n\t\tif (status === 'out_of_stock') return 'error';\n\t\treturn 'default';\n\t}\n\t// `available` above is the only metric carrying a state: it tracks the actual\n\t// stock status and turns amber, then red, as that degrades. `incoming` was\n\t// tinted `info` unconditionally — a fixed decoration wearing a state token,\n\t// which left two of four tiles coloured for no reason a reader could infer.\n\t// A pending restock is a plain number until something is wrong with it.\n\treturn 'default';\n}\n\nfunction SectionHeading({ children, className }: { children: string; className?: string }) {\n\treturn (\n\t\t<Text weight=\"semibold\" className={cn('inventory-section-card--section-title', className)}>\n\t\t\t{children}\n\t\t</Text>\n\t);\n}\n\nfunction SummaryMetric({ metric }: { metric: InventorySectionMetric }) {\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'inventory-section-card--metric min-w-0 rounded-radius border px-space-lg py-space-md',\n\t\t\t\tMETRIC_TONE_CLASS[metric.tone ?? 'default'],\n\t\t\t)}\n\t\t>\n\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t{metric.label}\n\t\t\t</Text>\n\t\t\t<Value weight=\"semibold\" className=\"tabular-nums\">\n\t\t\t\t{metric.value}\n\t\t\t</Value>\n\t\t\t{!!metric.description && (\n\t\t\t\t<Text size=\"xs\" type=\"secondary\" lineHeight=\"snug\">\n\t\t\t\t\t{metric.description}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nexport function InventorySectionCard({\n\tvalue,\n\tonValueChange,\n\terrors,\n\tdisabled = false,\n\treadOnly = false,\n\tvisibleSections,\n\tvisibleFields,\n\tlocationOptions = [],\n\tcountryOptions = [],\n\ttagRecommendations,\n\tmaxTags,\n\tonGenerateSku,\n\tonRestock,\n\tclassName,\n\tstrings: stringsProp,\n}: InventorySectionCardProps) {\n\tconst strings = useStrings(defaultInventorySectionStrings, stringsProp);\n\tconst status = getInventoryStatus(value);\n\tconst isDisabled = disabled || readOnly;\n\tconst isTracked = value.trackQuantity ?? true;\n\tconst requiresShipping = value.requiresShipping ?? true;\n\tconst shippingFieldsDisabled = isDisabled || !requiresShipping;\n\n\tconst isSectionVisible = (section: InventorySectionName) => visibleSections?.[section] !== false;\n\tconst isFieldVisible = (field: InventorySectionField) => visibleFields?.[field] !== false;\n\n\tconst updateField = <TField extends InventorySectionField>(\n\t\tfield: TField,\n\t\tnextValue: InventorySectionValue[TField],\n\t) => {\n\t\tconst previousValue = value[field];\n\t\tconst next = {\n\t\t\t...value,\n\t\t\t[field]: nextValue,\n\t\t};\n\n\t\tonValueChange?.(next, {\n\t\t\tfield,\n\t\t\tvalue: nextValue,\n\t\t\tpreviousValue,\n\t\t});\n\t};\n\n\tconst handleGenerateSku = () => {\n\t\tif (!onGenerateSku || isDisabled) return;\n\t\tconst generatedSku = onGenerateSku(value);\n\t\tif (typeof generatedSku === 'string') {\n\t\t\tupdateField('sku', generatedSku);\n\t\t}\n\t};\n\n\tconst metrics: InventorySectionMetric[] = [\n\t\t{\n\t\t\tid: 'available',\n\t\t\tlabel: strings.summary.available,\n\t\t\tvalue: isTracked ? value.available || '0' : '-',\n\t\t\t// `summary.threshold` is the *label* of the low-stock tile, not a\n\t\t\t// sentence — using it here rendered a dangling \"Low-stock at\" under\n\t\t\t// the available count with no number attached, duplicating a tile\n\t\t\t// that already carries both. Only the untracked case needs a caption,\n\t\t\t// to explain why the value reads \"-\".\n\t\t\tdescription: isTracked ? undefined : strings.summary.untracked,\n\t\t\ttone: getMetricTone('available', status),\n\t\t},\n\t\t{\n\t\t\tid: 'committed',\n\t\t\tlabel: strings.summary.committed,\n\t\t\tvalue: value.committed || '0',\n\t\t\ttone: getMetricTone('committed', status),\n\t\t},\n\t\t{\n\t\t\tid: 'incoming',\n\t\t\tlabel: strings.summary.incoming,\n\t\t\tvalue: value.incoming || '0',\n\t\t\ttone: getMetricTone('incoming', status),\n\t\t},\n\t\t{\n\t\t\tid: 'threshold',\n\t\t\tlabel: strings.summary.threshold,\n\t\t\tvalue: value.lowStockThreshold || '-',\n\t\t\ttone: getMetricTone('threshold', status),\n\t\t},\n\t];\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ticon={<PackageCheck className=\"size-icon\" />}\n\t\t\ttitle={strings.title}\n\t\t\tdescription={strings.description}\n\t\t\ttitleSuffix={<Badge tone={STATUS_VARIANT[status]}>{strings.status[status]}</Badge>}\n\t\t\theaderAction={\n\t\t\t\t<Stack\n\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\tclassName=\"w-full @md/inventory-section-card:w-auto @md/inventory-section-card:justify-end\"\n\t\t\t\t>\n\t\t\t\t\t{!!onGenerateSku && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tonClick={handleGenerateSku}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Sparkles className=\"size-icon-sm\" aria-hidden=\"true\" />\n\t\t\t\t\t\t\t{strings.actions.generateSku}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!onRestock && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tonClick={() => onRestock(value)}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RefreshCw className=\"size-icon-sm\" aria-hidden=\"true\" />\n\t\t\t\t\t\t\t{strings.actions.restock}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t}\n\t\t\theaderDivider\n\t\t\tclassName={cn('inventory-section-card--component @container/inventory-section-card w-full', className)}\n\t\t\tcontentGap=\"xl\"\n\t\t>\n\t\t\t{!!isSectionVisible('summary') && (\n\t\t\t\t<div className=\"inventory-section-card--summary grid min-w-0 grid-cols-1 gap-space-md @md/inventory-section-card:grid-cols-2 @3xl/inventory-section-card:grid-cols-4\">\n\t\t\t\t\t{metrics.map((metric) => (\n\t\t\t\t\t\t<SummaryMetric key={metric.id} metric={metric} />\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('identity') && (\n\t\t\t\t<Stack render={<section />} gap=\"md\" className=\"inventory-section-card--identity\">\n\t\t\t\t\t<SectionHeading>{strings.sections.identity}</SectionHeading>\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t{!!isFieldVisible('sku') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.sku} error={errors?.sku} hint={strings.hints.sku}>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tvalue={value.sku ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('sku', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.sku}\n\t\t\t\t\t\t\t\t\tstartIcon={PackageCheck}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.sku}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('barcode') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.barcode} error={errors?.barcode} hint={strings.hints.barcode}>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tvalue={value.barcode ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('barcode', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.barcode}\n\t\t\t\t\t\t\t\t\tstartIcon={Barcode}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.barcode}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Grid>\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('tracking') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--tracking border-t border-border/60 pt-space-xl\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.tracking}</SectionHeading>\n\t\t\t\t\t{!!isFieldVisible('trackQuantity') && (\n\t\t\t\t\t\t<ToggleField\n\t\t\t\t\t\t\tlabel={strings.fields.trackQuantity}\n\t\t\t\t\t\t\tdescription={strings.hints.available}\n\t\t\t\t\t\t\tvalue={isTracked}\n\t\t\t\t\t\t\tonValueChange={(checked) => updateField('trackQuantity', checked)}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t<div className=\"inventory-section-card--tracking-grid grid min-w-0 grid-cols-1 gap-space-xl @md/inventory-section-card:grid-cols-2 @3xl/inventory-section-card:grid-cols-4\">\n\t\t\t\t\t\t{!!isFieldVisible('available') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.available} error={errors?.available} hint={strings.hints.available}>\n\t\t\t\t\t\t\t\t<DecimalInput\n\t\t\t\t\t\t\t\t\tvalue={value.available ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('available', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.available}\n\t\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\t\tdecimalPlaces={0}\n\t\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.available}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('committed') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.committed} error={errors?.committed} hint={strings.hints.committed}>\n\t\t\t\t\t\t\t\t<DecimalInput\n\t\t\t\t\t\t\t\t\tvalue={value.committed ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('committed', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.committed}\n\t\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\t\tdecimalPlaces={0}\n\t\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.committed}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('incoming') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.incoming} error={errors?.incoming} hint={strings.hints.incoming}>\n\t\t\t\t\t\t\t\t<DecimalInput\n\t\t\t\t\t\t\t\t\tvalue={value.incoming ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('incoming', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.incoming}\n\t\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\t\tdecimalPlaces={0}\n\t\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.incoming}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('lowStockThreshold') && (\n\t\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\t\tlabel={strings.fields.lowStockThreshold}\n\t\t\t\t\t\t\t\terror={errors?.lowStockThreshold}\n\t\t\t\t\t\t\t\thint={strings.hints.lowStockThreshold}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<DecimalInput\n\t\t\t\t\t\t\t\t\tvalue={value.lowStockThreshold ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('lowStockThreshold', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.lowStockThreshold}\n\t\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\t\tdecimalPlaces={0}\n\t\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.lowStockThreshold}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t{!!isFieldVisible('inventoryPolicy') && (\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tlabel={strings.fields.inventoryPolicy}\n\t\t\t\t\t\t\terror={errors?.inventoryPolicy}\n\t\t\t\t\t\t\thint={strings.hints.inventoryPolicy}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CardRadioGroup\n\t\t\t\t\t\t\t\tcolumns={2}\n\t\t\t\t\t\t\t\tvalue={value.inventoryPolicy ?? 'deny'}\n\t\t\t\t\t\t\t\tonValueChange={(nextValue) => updateField('inventoryPolicy', nextValue as InventoryPolicy)}\n\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\tinvalid={!!errors?.inventoryPolicy}\n\t\t\t\t\t\t\t\toptions={[\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvalue: 'deny',\n\t\t\t\t\t\t\t\t\t\tlabel: strings.policyOptions.deny.label,\n\t\t\t\t\t\t\t\t\t\tdescription: strings.policyOptions.deny.description,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvalue: 'continue',\n\t\t\t\t\t\t\t\t\t\tlabel: strings.policyOptions.continue.label,\n\t\t\t\t\t\t\t\t\t\tdescription: strings.policyOptions.continue.description,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FormField>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('location') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--location border-t border-border/60 pt-space-xl\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.location}</SectionHeading>\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t{!!isFieldVisible('locationId') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.locationId} error={errors?.locationId} hint={strings.hints.locationId}>\n\t\t\t\t\t\t\t\t{locationOptions.length > 0 ? (\n\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\tvalue={value.locationId ?? null}\n\t\t\t\t\t\t\t\t\t\tonValueChange={(nextValue) => updateField('locationId', nextValue)}\n\t\t\t\t\t\t\t\t\t\toptions={locationOptions}\n\t\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.locationId}\n\t\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\t\tinvalid={!!errors?.locationId}\n\t\t\t\t\t\t\t\t\t\tallowClear\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\tvalue={value.locationId ?? ''}\n\t\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('locationId', event.target.value)}\n\t\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.locationId}\n\t\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\t\tinvalid={!!errors?.locationId}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('binLocation') && (\n\t\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\t\tlabel={strings.fields.binLocation}\n\t\t\t\t\t\t\t\terror={errors?.binLocation}\n\t\t\t\t\t\t\t\thint={strings.hints.binLocation}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tvalue={value.binLocation ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('binLocation', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.binLocation}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.binLocation}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Grid>\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('shipping') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--shipping border-t border-border/60 pt-space-xl\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.shipping}</SectionHeading>\n\t\t\t\t\t{!!isFieldVisible('requiresShipping') && (\n\t\t\t\t\t\t<ToggleField\n\t\t\t\t\t\t\tlabel={strings.fields.requiresShipping}\n\t\t\t\t\t\t\tdescription={strings.hints.weight}\n\t\t\t\t\t\t\tvalue={requiresShipping}\n\t\t\t\t\t\t\tonValueChange={(checked) => updateField('requiresShipping', checked)}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!isFieldVisible('weight') && (\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tlabel={strings.fields.weight}\n\t\t\t\t\t\t\terror={errors?.weight ?? errors?.weightUnit}\n\t\t\t\t\t\t\thint={strings.hints.weight}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<WeightInput\n\t\t\t\t\t\t\t\tvalue={value.weight ?? ''}\n\t\t\t\t\t\t\t\tunit={value.weightUnit ?? 'kg'}\n\t\t\t\t\t\t\t\tonChange={(event) => updateField('weight', event.target.value)}\n\t\t\t\t\t\t\t\tonUnitChange={(unit) => updateField('weightUnit', unit)}\n\t\t\t\t\t\t\t\tdisabled={shippingFieldsDisabled}\n\t\t\t\t\t\t\t\tinvalid={!!errors?.weight || !!errors?.weightUnit}\n\t\t\t\t\t\t\t\tdecimalPlaces={2}\n\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FormField>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('customs') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--customs border-t border-border/60 pt-space-xl\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.customs}</SectionHeading>\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t{!!isFieldVisible('countryOfOrigin') && (\n\t\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\t\tlabel={strings.fields.countryOfOrigin}\n\t\t\t\t\t\t\t\terror={errors?.countryOfOrigin}\n\t\t\t\t\t\t\t\thint={strings.hints.countryOfOrigin}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{countryOptions.length > 0 ? (\n\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\tvalue={value.countryOfOrigin ?? null}\n\t\t\t\t\t\t\t\t\t\tonValueChange={(nextValue) => updateField('countryOfOrigin', nextValue)}\n\t\t\t\t\t\t\t\t\t\toptions={countryOptions}\n\t\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.countryOfOrigin}\n\t\t\t\t\t\t\t\t\t\tdisabled={shippingFieldsDisabled}\n\t\t\t\t\t\t\t\t\t\tinvalid={!!errors?.countryOfOrigin}\n\t\t\t\t\t\t\t\t\t\tallowClear\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\tvalue={value.countryOfOrigin ?? ''}\n\t\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('countryOfOrigin', event.target.value)}\n\t\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.countryOfOrigin}\n\t\t\t\t\t\t\t\t\t\tdisabled={shippingFieldsDisabled}\n\t\t\t\t\t\t\t\t\t\tinvalid={!!errors?.countryOfOrigin}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('hsCode') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.hsCode} error={errors?.hsCode} hint={strings.hints.hsCode}>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tvalue={value.hsCode ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('hsCode', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.hsCode}\n\t\t\t\t\t\t\t\t\tdisabled={shippingFieldsDisabled}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.hsCode}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Grid>\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('tags') && !!isFieldVisible('tags') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--tags border-t border-border/60 pt-space-xl\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.tags}</SectionHeading>\n\t\t\t\t\t<FormField label={strings.fields.tags} error={errors?.tags} hint={strings.hints.tags}>\n\t\t\t\t\t\t<TagsInput\n\t\t\t\t\t\t\tvalue={value.tags ?? []}\n\t\t\t\t\t\t\tonValueChange={(nextTags) => updateField('tags', nextTags)}\n\t\t\t\t\t\t\trecommendations={tagRecommendations}\n\t\t\t\t\t\t\tmaxTags={maxTags}\n\t\t\t\t\t\t\tshowMaxTags={maxTags !== undefined}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\tinvalid={!!errors?.tags}\n\t\t\t\t\t\t\tstrings={strings.tagInput}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FormField>\n\t\t\t\t</Stack>\n\t\t\t)}\n\t\t</ContentBlock>\n\t);\n}\n\nInventorySectionCard.displayName = 'InventorySectionCard';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgBqE,GAAmB,EAClC,aACA,cACA,WAKA,cAAW,WACX,iBAAc,WACd,mBAAgB,WACW;CAC3B,OACC,kBAACf,GAAD;EAAW,WAAWvC,EAAG,mDAAmDuD,CAAS;EACnF,UAAAC,EAAS,KAAK,GAAG,MAChB,kBAACf,GAAD;GAAoD,WAAU;GAA9D,UAAA;IACC,kBAACL,GAAD,EAAA,UACC,kBAACP,GAAD;KACC,MAAM4B,EAAE;KACR,MAAMC,MAAkB,UA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AAK;MAC7D,aAAavM,EAAQ,aAAa;MAClC,UAAU4X;MACV,SAAS,CAAC,CAACgB,GAAQ;KACnB,CAAA;IACS,CAAA,CAEP,EAAA,CAAA,CACA;;GAGP,CAAC,CAACf,EAAiB,MAAM,KAAK,CAAC,CAACG,EAAe,MAAM,KACrD,kBAACnc,GAAD;IACC,QAAQ,kBAAC,WAAD,CAAU,CAAA;IAClB,KAAI;IACJ,WAAU;IAHX,UAAA,CAKC,kBAACub,GAAD,EAAA,UAAiBpX,EAAQ,SAAS,KAAqB,CAAA,GACvD,kBAAC3C,GAAD;KAAW,OAAO2C,EAAQ,OAAO;KAAM,OAAO4Y,GAAQ;KAAM,MAAM5Y,EAAQ,MAAM;KAC/E,UAAA,kBAAC1C,IAAD;MACC,OAAO+B,EAAM,QAAQ,CAAC;MACtB,gBAAgB,MAAa8Y,EAAY,QAAQe,CAAQ;MACzD,iBAAiBC;MACR;MACT,aAAaC,MAAY,KAAA;MACzB,UAAU7B;MACV,SAAS,CAAC,CAACqB,GAAQ;MACnB,SAAS5Y,EAAQ;KACjB,CAAA;IACS,CAAA,CACL;;EAEK;;AAEhB;AAEA,GAAqB,cAAc"}
1
+ {"version":3,"file":"commerce.js","names":["NumberValue","_Fragment","_Fragment","NumberValue","NumberValue","normalizeCode","_Fragment","NumberValue","NumberValue","_Fragment","useMoneyConfig","cn","Button","TextButton","DisplayLabel","Heading","Text","TextLink","AdaptiveGrid","Grid","Stack","toneRecipes","hasRenderableContent","Alert","Card","Progress","ActionMenu","ActionButtons","CardPrimaryAction","interactionRecipes","Value","Phone","SecondaryValue","MonoValue","Email","Initials","formatInitials","Percent","Money","Number$1","IconBadge","AvatarFallback","Avatar","AvatarImage","Badge","Separator","Input","Copyable","FormField","ToggleField","Select","CardRadioGroup","DateBlock","ContentBlock","VisuallyHidden","TagsInput","DecimalInput","WeightInput","ItemMedia","ItemDescription","ItemActions","ItemGroup","ItemContent","Item","ItemTitle","MetadataList","TabsTrigger","TabsContent","TabsList","Tabs","InlineStat","EmptyState","Receipt","ReceiptItems","Timeline","Fragment$1","UpcomingBookingRow","className","bookings","b","timePlacement","dateTone","dateVariant","idx","renderItemValue","value","BookingCalendarEventCard","status","contentClassName","items","item","onAction","actionLabel","defaultLoyaltyPointsStrings","LoyaltyPoints","stringsProp","strings","useStrings","tierTone","tier","balance","history","entry","onRedeem","stripLeadingMinus","formatDeduction","isText","AmountRow","forwardRef","props","hasNote","note","total","deduction","rollup","label","amount","SummaryPanel","defaultDiscountStackStrings","discountKind","kind","discount","DiscountStackPreview","discounts","index","totalSavings","DiscountStack","shipmentStatusTone","defaultShipmentTrackingStrings","latestReachedIndex","steps","ShipmentTracking","current","rail","step","trackingNumber","onCopyTracking","carrier","details","detail","defaultGiftcardStrings","giftcardStatusTone","inverseGradient","gradientMap","compactGradientMap","accentColorMap","headerGradientMap","GiftcardCompact","statusLabel","statusTone","isPartiallyUsed","remainingAmount","displayAmount","gradient","code","recipientName","GiftcardCopyButton","copyStrings","generation","useRef","result","setResult","useState","state","previous","Icon","Check","X","Loader2","Copy","copy","request","inverse","GiftcardCardDark","metadataItems","expiresAt","onView","GiftcardFull","_createdAt","_template","senderName","pattern","message","GiftcardCardIllustrated","headerColor","GiftcardCardMinimal","accent","color","ArrowRight","GiftcardCard","defaultVendorProfileStrings","CHANGE_VARIANTS","ChangeBadge","children","tone","VendorProfileCard","internalView","setInternalView","defaultView","isViewControlled","view","hasEarnings","earnings","hasOverviewContent","metrics","hasStatsContent","stats","availableTabs","requestedView","activeView","hasBody","hasActions","onMessage","onHire","handleViewChange","nextValue","onViewChange","overviewContent","earningsChangeTone","earningsChange","metric","statsContent","stat","profileBody","surface","avatarUrl","name","initials","verified","role","ChevronRight","defaultInventoryLevelStrings","InventoryLevel","pct","stock","maxStock","isLow","reorderLevel","isCritical","badgeTone","badgeLabel","productName","variant","lastRestocked","defaultTaxBreakdownStrings","TaxBreakdownCard","subtotal","taxes","tax","totalTax","defaultSubscriptionSummaryStrings","SubscriptionSummaryCard","planName","priceLabel","cycleLabel","nextBillingDate","perks","perk","i","onManage","onUpgrade","defaultRefundStatusStrings","STAGE_ORDER","hasContent","RefundStatusCard","currentIdx","stage","hasFacts","reason","method","eta","requestedAt","done","s","RefundStatus","AddressLines","cityLine","address","prominent","defaultAddressCardStrings","AddressCard","defaultAddress","titleByKind","actions","onEdit","Edit2","onMakeDefault","Star","onRemove","Trash2","phone","defaultVoucherEntryStrings","normalizeCode$1","VoucherEntry","inputId","useId","setCode","trimmedCode","appliedCode","event","onCheck","error","LineThumbnailPlaceholder","title","LineThumbnail","failedSrc","setFailedSrc","source","src","alt","defaultCartSummaryStrings","quantity","resolveCartLineTitle","resolveCartLineImageSrc","CartSummaryCard","hasBreakdown","shipping","it","imageSrc","onCheckout","CartSummary","defaultCouponInputStrings","normalizeCode","CouponInputCard","appliedDiscount","onApply","defaultOrderStatusStrings","VARIANT_BY_STATUS","OrderStatusCard","lastCompleteIdx","events","e","acc","nextEvent","orderNumber","currentEta","isLast","isCurrent","CalendarClock","Circle","defaultPaymentMethodStrings","brand","last4","BRAND_LABEL","BRAND_SURFACE","PaymentMethod","defaultMethod","spokenName","onChange","CreditCard","holderName","expiry","PaymentMethodCard","DEFAULT_SEO_LISTING_LIMITS","resolveLimits","limits","clampScore","getCheckStatus","maxScore","ratio","score","makeCheck","scoreRatio","range","lengthScore","length","min","max","overBy","getSeoPermalinkPath","permalink","getSeoPermalinkSlug","permalinkScore","path","slugScore","slug","urlScore","baseUrl","keywordScore","keyword","input","haystack","calculateSeoListingScore","description","permalinkPath","checks","sum","check","defaultSeoListingCardStrings","SCORE_BADGE_TONE","SCORE_PROGRESS_CLASS","CHECK_ICON","CheckCircle2","TriangleAlert","CircleAlert","CHECK_ICON_CLASS","trimSlashes","buildUrlParts","permalinkParts","pathSegments","buildHref","base","getCheckDetail","SeoCheckRow","SeoListingCard","resolvedBaseUrl","resolvedSiteName","siteName","resolvedTitle","resolvedDescription","scoreResult","href","urlParts","Pencil","ExternalLink","part","price","showChecks","defaultInvoiceMiniStrings","count","invoiceStatusTone","InvoiceMini","mergeStrings","labelByStatus","invoice","defaultInvoiceHeaderStrings","PartyBlock","eyebrow","location","InvoiceHeader","resolvedStatusTone","invoiceNumber","from","to","issuedDate","dueDate","defaultInvoiceLineItemsStrings","wrapperGlass","ALIGN_CLASS","InvoiceCurrencyValue","buildDefaultColumns","buildDefaultFooterRows","taxRate","InvoiceLineItems","resolvedCurrency","currency","defaultCurrency","resolvedColumns","columns","resolvedFooterRows","footerRows","gridTemplate","c","defaultGrid","col","row","isSimpleText","OrderTimeline","PaymentTimeline","defaultInventorySectionStrings","STATUS_VARIANT","parseQuantity","parsed","getInventoryStatus","available","threshold","SectionHeading","SummaryMetric","InventorySectionCard","isDisabled","disabled","readOnly","isTracked","requiresShipping","shippingFieldsDisabled","isSectionVisible","visibleSections","section","isFieldVisible","visibleFields","field","updateField","previousValue","next","handleGenerateSku","onGenerateSku","generatedSku","onRestock","errors","checked","locationOptions","unit","countryOptions","nextTags","tagRecommendations","maxTags","fulfillmentStatusTone","paymentStatusTone","transactionStatusTone","outgoingTransactionKinds","defaultOrderStatusVocabulary","defaultOrderHeaderStrings","placedAt","OrderHeader","origin","headingTag","paymentStatus","fulfillmentStatus","defaultOrderLineItemStrings","unitPrice","OrderLineItem","hasMeta","variantTitle","sku","id","imageAlt","properties","property","defaultFulfillmentGroupStrings","FulfillmentGroup","NoticeIcon","lineStrings","useMemo","heading","firstAction","overflowActions","action","hasLocation","hasNotice","notice","line","defaultOrderSummaryStrings","LedgerRow","OrderSummary","hasAlert","alert","AlertDescription","goods","payments","defaultOrderTransactionsStrings","KIND_ICON","ShieldCheck","Download","RotateCcw","Ban","OrderTransactions","transactions","outgoing","transaction","failed","markTone","meta","defaultOrderCustomerStrings","AddressSection","editLabel","replacement","emptyLabel","OrderCustomer","hasContact","email","onOpenCustomer","orderCount","shippingAddress","onEditShipping","billingAddress","onEditBilling","billingSameAsShipping"],"sources":["../../src/components/blocks/commerce/upcoming-booking/upcoming-booking.tsx","../../src/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.tsx","../../src/components/blocks/commerce/loyalty-points/types.ts","../../src/components/blocks/commerce/loyalty-points/loyalty-points.tsx","../../src/components/blocks/commerce/format-signed-amount.ts","../../src/components/blocks/commerce/summary-panel/amount-row.tsx","../../src/components/blocks/commerce/summary-panel/summary-panel.tsx","../../src/components/blocks/commerce/discount-stack/types.ts","../../src/components/blocks/commerce/discount-stack/discount-stack.tsx","../../src/components/blocks/commerce/shipment-tracking/types.ts","../../src/components/blocks/commerce/shipment-tracking/shipment-tracking.tsx","../../src/components/blocks/commerce/giftcard-card/types.ts","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-compact.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-copy-button.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-dark.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-full.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-illustrated.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-minimal.tsx","../../src/components/blocks/commerce/giftcard-card/giftcard-card.tsx","../../src/components/blocks/commerce/vendor-profile/types.ts","../../src/components/blocks/commerce/vendor-profile/vendor-profile.tsx","../../src/components/blocks/commerce/inventory-level/inventory-level.strings.ts","../../src/components/blocks/commerce/inventory-level/inventory-level.tsx","../../src/components/blocks/commerce/tax-breakdown/types.ts","../../src/components/blocks/commerce/tax-breakdown/tax-breakdown.tsx","../../src/components/blocks/commerce/subscription-summary/types.ts","../../src/components/blocks/commerce/subscription-summary/subscription-summary.tsx","../../src/components/blocks/commerce/refund-status/types.ts","../../src/components/blocks/commerce/refund-status/refund-status.tsx","../../src/components/blocks/commerce/shared/address-lines.tsx","../../src/components/blocks/commerce/address-card/types.ts","../../src/components/blocks/commerce/address-card/address-card.tsx","../../src/components/blocks/commerce/voucher-entry/types.ts","../../src/components/blocks/commerce/voucher-entry/voucher-entry.tsx","../../src/components/blocks/commerce/shared/line-thumbnail.tsx","../../src/components/blocks/commerce/cart-summary/types.ts","../../src/components/blocks/commerce/cart-summary/cart-summary.tsx","../../src/components/blocks/commerce/coupon-input/types.ts","../../src/components/blocks/commerce/coupon-input/coupon-input.tsx","../../src/components/blocks/commerce/order-status/types.ts","../../src/components/blocks/commerce/order-status/order-status.tsx","../../src/components/blocks/commerce/payment-method/types.ts","../../src/components/blocks/commerce/payment-method/payment-method.tsx","../../src/components/blocks/commerce/seo-listing/seo-listing-score.ts","../../src/components/blocks/commerce/seo-listing/types.ts","../../src/components/blocks/commerce/seo-listing/seo-listing-card.tsx","../../src/components/blocks/commerce/invoice-mini/types.ts","../../src/components/blocks/commerce/invoice-mini/invoice-mini.tsx","../../src/components/blocks/commerce/invoice-header/types.ts","../../src/components/blocks/commerce/invoice-header/invoice-header.tsx","../../src/components/blocks/commerce/invoice-line-items/types.ts","../../src/components/blocks/commerce/invoice-line-items/invoice-line-items.tsx","../../src/components/blocks/commerce/order-timeline/order-timeline.tsx","../../src/components/blocks/commerce/payment-timeline/payment-timeline.tsx","../../src/components/blocks/commerce/inventory-section/types.ts","../../src/components/blocks/commerce/inventory-section/inventory-section.tsx","../../src/components/blocks/commerce/shared/order-status.ts","../../src/components/blocks/commerce/order-header/types.ts","../../src/components/blocks/commerce/order-header/order-header.tsx","../../src/components/blocks/commerce/order-line-item/types.ts","../../src/components/blocks/commerce/order-line-item/order-line-item.tsx","../../src/components/blocks/commerce/fulfillment-group/types.ts","../../src/components/blocks/commerce/fulfillment-group/fulfillment-group.tsx","../../src/components/blocks/commerce/order-summary/types.ts","../../src/components/blocks/commerce/order-summary/order-summary.tsx","../../src/components/blocks/commerce/order-transactions/types.ts","../../src/components/blocks/commerce/order-transactions/order-transactions.tsx","../../src/components/blocks/commerce/order-customer/types.ts","../../src/components/blocks/commerce/order-customer/order-customer.tsx"],"sourcesContent":["/**\n * UpcomingBookingRow — compact booking list. Each row shows a `DateBlock`\n * (weekday / day / month / time) on the left, service + customer in the\n * middle, and trailing amount. Locale and date-tone are configurable.\n *\n * Time is placed BELOW the date block by default (matches the date block\n * vertical rhythm); pass `timePlacement=\"inline-trailing\"` to use a\n * separate trailing time column.\n */\nimport { DateBlock } from '../../../base/display/date-block';\nimport { SecondaryValue, Value } from '../../../primitives';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemGroup,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\n\nimport type { UpcomingBookingRowProps } from './types';\n\nimport { cn } from '../../../../lib/utils';\n\nexport function UpcomingBookingRow({\n\tbookings,\n\tclassName,\n\tlocale,\n\t// `inverse` paints a near-black tile in the light theme, which reads as a\n\t// heavy foreign block in an otherwise soft admin list and does not match how\n\t// DateBlock renders anywhere else. Neutral by default; pass\n\t// `dateVariant=\"inverse\"` for the inverted treatment deliberately.\n\tdateTone = 'neutral',\n\tdateVariant = 'default',\n\ttimePlacement = 'below',\n}: UpcomingBookingRowProps) {\n\treturn (\n\t\t// Plain rows touch: each row's density padding is the space between them.\n\t\t<ItemGroup className={cn('upcoming-booking--component w-full', className)}>\n\t\t\t{bookings.map((b, idx) => (\n\t\t\t\t\t<Item key={b.id ?? `${b.service}-${b.time}-${idx}`} className=\"items-center\">\n\t\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t\t<DateBlock\n\t\t\t\t\t\t\t\tdate={b.date}\n\t\t\t\t\t\t\t\ttime={timePlacement === 'below' ? b.time : undefined}\n\t\t\t\t\t\t\t\ttone={dateTone}\n\t\t\t\t\t\t\t\tvariant={dateVariant}\n\t\t\t\t\t\t\t\tlocale={locale}\n\t\t\t\t\t\t\t\ttimePlacement=\"below\"\n\t\t\t\t\t\t\t\tlayout=\"stacked\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t<ItemContent className=\"min-w-0 sm:min-w-48\">\n\t\t\t\t\t\t\t<ItemTitle>{b.service}</ItemTitle>\n\t\t\t\t\t\t\t<ItemDescription clamp={1}>{b.customer}</ItemDescription>\n\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t<ItemActions className=\"ml-auto shrink-0 flex-wrap justify-end\">\n\t\t\t\t\t\t\t{timePlacement === 'inline-trailing' && (\n\t\t\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"shrink-0 tabular-nums\">\n\t\t\t\t\t\t\t\t\t{b.time}\n\t\t\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Value weight=\"semibold\" className=\"shrink-0 tabular-nums\">\n\t\t\t\t\t\t\t\t{b.amount}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t</ItemActions>\n\t\t\t\t\t</Item>\n\t\t\t))}\n\t\t</ItemGroup>\n\t);\n}\n\nUpcomingBookingRow.displayName = 'UpcomingBookingRow';\n","import type { ReactNode } from 'react';\n\nimport { CardPrimaryAction } from '../../../base/cards';\nimport { ContentBlock } from '../../../base/display';\nimport { Value } from '../../../primitives';\nimport { DisplayLabel } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport type { BookingCalendarEventCardProps } from './booking-calendar-event-card.types';\n\nfunction renderItemValue(value: ReactNode): ReactNode {\n\tif (\n\t\ttypeof value === 'string' ||\n\t\ttypeof value === 'number' ||\n\t\ttypeof value === 'bigint'\n\t) {\n\t\treturn <Value>{String(value)}</Value>;\n\t}\n\n\treturn value;\n}\n\n/**\n * Compact, card-free booking detail composition.\n *\n * The status sits beside the title, the facts share one label-above-value\n * layout, and spacing alone separates them from the action: no header rule,\n * no inset note panel and no rule above the action.\n *\n * All visible copy is supplied by props, so this component intentionally has\n * no strings file. Frame it with `Card` only when the page needs card\n * chrome.\n */\nexport function BookingCalendarEventCard({\n\ttitle,\n\tdescription,\n\tstatus,\n\titems,\n\tactionLabel,\n\tonAction,\n\tclassName,\n\tcontentClassName,\n}: BookingCalendarEventCardProps) {\n\treturn (\n\t\t<ContentBlock\n\t\t\ttitle={title}\n\t\t\ttitleSuffix={status}\n\t\t\tdescription={description}\n\t\t\tclassName={cn('booking-calendar-event-card--component @container/booking-calendar-event-card', className)}\n\t\t\tcontentClassName={cn('grid gap-space-2xl', contentClassName)}\n\t\t>\n\t\t\t<dl className=\"booking-calendar-event-card--details grid gap-space-lg @md/booking-calendar-event-card:grid-cols-2\">\n\t\t\t\t{items.map((item) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t// Label-to-value rhythm matches MetadataList's fact layout.\n\t\t\t\t\t\t\t'grid min-w-0 gap-normal',\n\t\t\t\t\t\t\titem.fullWidth === true && '@md/booking-calendar-event-card:col-span-2',\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* The definition cells would otherwise keep the page's taller\n\t\t\t\t\t\t line box around 14px copy and pad the label/value gap. */}\n\t\t\t\t\t\t<dt className=\"flex\"><DisplayLabel>{item.label}</DisplayLabel></dt>\n\t\t\t\t\t\t<dd className=\"min-w-0 leading-normal\">{renderItemValue(item.value)}</dd>\n\t\t\t\t\t</div>\n\t\t\t\t))}\n\t\t\t</dl>\n\n\t\t\t<div className=\"booking-calendar-event-card--action flex justify-end\">\n\t\t\t\t<CardPrimaryAction\n\t\t\t\t\tfullWidth={false}\n\t\t\t\t\tclassName=\"w-full @md/booking-calendar-event-card:w-auto\"\n\t\t\t\t\tonClick={onAction}\n\t\t\t\t>\n\t\t\t\t\t{actionLabel}\n\t\t\t\t</CardPrimaryAction>\n\t\t\t</div>\n\t\t</ContentBlock>\n\t);\n}\n\nBookingCalendarEventCard.displayName = 'BookingCalendarEventCard';\n","import type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface LoyaltyHistoryEntry {\n\t/** Display label. */\n\tlabel: string;\n\tpoints: string;\n\tdate: string;\n\tpositive: boolean;\n}\n\nexport interface LoyaltyPointsStrings {\n\tbalanceLabel: string;\n\tpointsAvailable: string;\n\tredeem: string;\n\t/** Tier chip label used when `tier` is not passed. */\n\ttier: string;\n}\n\nexport const defaultLoyaltyPointsStrings: LoyaltyPointsStrings = {\n\tbalanceLabel: 'Loyalty balance',\n\tpointsAvailable: 'points available',\n\tredeem: 'Redeem points',\n\ttier: 'Gold tier',\n};\n\nexport interface LoyaltyPointsProps {\n\t/** Points currently available. */\n\tbalance: number | string;\n\t/** Membership tier name. Defaults to `strings.tier`. */\n\ttier?: string;\n\t/** Badge tone for the tier chip. A tier is a kind, not a status. @default 'neutral' */\n\ttierTone?: BadgeTone;\n\t/** Recent point movements. */\n\thistory?: LoyaltyHistoryEntry[];\n\tonRedeem?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<LoyaltyPointsStrings>;\n}\n","/**\n * LoyaltyPoints — current balance, tier badge, recent history rows\n * (label / date / signed-points), and a redemption CTA. Strings overridable\n * for i18n.\n */\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { ContentBlock } from '../../../base/display';\nimport { Stack } from '../../../base/structure';\nimport { Number as NumberValue } from '../../../primitives';\nimport { Heading } from '../../../typography/heading';\nimport { Text } from '../../../typography/text';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemGroup,\n\tItemTitle,\n} from '../../../base/item';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultLoyaltyPointsStrings, type LoyaltyPointsProps } from './types';\n\nexport function LoyaltyPoints({\n\tbalance,\n\ttier,\n\ttierTone = 'neutral',\n\thistory = [],\n\tonRedeem,\n\tclassName,\n\tstrings: stringsProp,\n}: LoyaltyPointsProps) {\n\tconst strings = useStrings(defaultLoyaltyPointsStrings, stringsProp);\n\t// The tier is a membership kind, so its chip is neutral by default and sits\n\t// beside the title. Balance, history and the action are separated by the\n\t// content gap rather than a rule.\n\treturn (\n\t\t<ContentBlock\n\t\t\ttitle={strings.balanceLabel}\n\t\t\ttitleSuffix={<Badge tone={tierTone}>{tier ?? strings.tier}</Badge>}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tclassName={cn('loyalty-points--component w-full', className)}\n\t\t>\n\t\t\t<Stack gap=\"dense\" className=\"loyalty-points--balance\">\n\t\t\t\t<Heading tag=\"h3\" className=\"text-base tabular-nums tracking-tight\">\n\t\t\t\t\t{typeof balance === 'number' ? (\n\t\t\t\t\t\t<NumberValue value={balance} size=\"base\" weight=\"bold\" align=\"left\" />\n\t\t\t\t\t) : balance}\n\t\t\t\t</Heading>\n\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t{strings.pointsAvailable}\n\t\t\t\t</Text>\n\t\t\t</Stack>\n\n\t\t\t{history.length > 0 && (\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t{history.map((entry) => (\n\t\t\t\t\t\t<Item key={entry.date + entry.label} size=\"sm\">\n\t\t\t\t\t\t\t<ItemContent>\n\t\t\t\t\t\t\t\t<ItemTitle bold={false}>{entry.label}</ItemTitle>\n\t\t\t\t\t\t\t\t<ItemDescription clamp={1}>{entry.date}</ItemDescription>\n\t\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t\t<ItemActions>\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t'tabular-nums',\n\t\t\t\t\t\t\t\t\t\tentry.positive ? 'text-success' : 'text-destructive',\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{entry.points}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</ItemActions>\n\t\t\t\t\t\t</Item>\n\t\t\t\t\t))}\n\t\t\t\t</ItemGroup>\n\t\t\t)}\n\n\t\t\t{!!onRedeem && (\n\t\t\t\t<Button tone=\"primary\" fullWidth onClick={onRedeem}>\n\t\t\t\t\t{strings.redeem}\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t</ContentBlock>\n\t);\n}\n\nLoyaltyPoints.displayName = 'LoyaltyPoints';\n","/**\n * Negative-amount presentation shared across commerce surfaces.\n *\n * Consumers pass amounts as opaque preformatted strings, sometimes already\n * carrying a leading \"-\" and sometimes not. Rendering those raw meant the same\n * concept — money coming off a total — appeared with a HYPHEN-MINUS in one card\n * and a MINUS SIGN in the next.\n *\n * U+2212 is the correct glyph: it is drawn to the width of a digit and sits on\n * the maths axis, so it aligns in a tabular-figures column where the narrower,\n * lower hyphen does not.\n */\n\n/** U+2212 MINUS SIGN. */\nexport const MINUS_SIGN = '−';\n\n/** Drop any leading sign or whitespace a consumer already supplied. */\nexport function stripLeadingMinus(value: string): string {\n\treturn value.replace(/^[\\s−-]+/, '');\n}\n\n/**\n * Present an amount as a deduction: exactly one U+2212, whatever the caller\n * passed in. An empty or whitespace-only value is returned untouched so the\n * caller's own empty handling still applies.\n */\nexport function formatDeduction(value: string): string {\n\tif (!value.trim()) return value;\n\treturn `${MINUS_SIGN}${stripLeadingMinus(value)}`;\n}\n","/**\n * AmountRow — the ledger row every commerce money surface is built from.\n *\n * Label, an optional quiet note, and the amount, aligned on their baseline. It\n * is not `InlineStat`: this row knows about money. `total` marks the figure the\n * eye should land on, `deduction` rewrites the sign to U+2212 and inks the\n * figure as a gain, and `rollup` rules the row off from the breakdown above\n * it. Amounts use the sans UI font with tabular figures and arrive already\n * formatted; the row does no arithmetic.\n */\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport { formatDeduction } from '../format-signed-amount';\nimport type { AmountRowProps } from './types';\n\nfunction isText(value: ReactNode): value is string | number {\n\treturn typeof value === 'string' || typeof value === 'number';\n}\n\nexport const AmountRow = forwardRef<HTMLDivElement, AmountRowProps>(function AmountRow({\n\tlabel,\n\tamount,\n\tnote,\n\ttotal = false,\n\tdeduction = false,\n\trollup = false,\n\tclassName,\n\t...props\n}, ref) {\n\tconst hasNote = note !== undefined && note !== null && note !== false && note !== '';\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tdata-slot=\"amount-row\"\n\t\t\tdata-total={total ? '' : undefined}\n\t\t\tdata-deduction={deduction ? '' : undefined}\n\t\t\tdata-rollup={rollup ? '' : undefined}\n\t\t\tclassName={cn(\n\t\t\t\t'amount-row--component flex min-w-0 items-baseline gap-space-md',\n\t\t\t\t// One rule, midway between the breakdown and the total it rolls up.\n\t\t\t\trollup && 'mt-space-sm border-t border-border pt-space-lg',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isText(label) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype={total ? 'main' : 'secondary'}\n\t\t\t\t\tweight={total ? 'semibold' : 'regular'}\n\t\t\t\t\t// A total caption shares the summary-total text role used across blocks.\n\t\t\t\t\tlineHeight={total ? 'tight' : 'normal'}\n\t\t\t\t\tclassName=\"amount-row--label min-w-0 flex-1 wrap-anywhere\"\n\t\t\t\t>\n\t\t\t\t\t{label}\n\t\t\t\t</Text>\n\t\t\t) : (\n\t\t\t\t<span className=\"amount-row--label min-w-0 flex-1\">{label}</span>\n\t\t\t)}\n\t\t\t{!!hasNote && (isText(note) ? (\n\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"amount-row--note shrink-0 tabular-nums\">\n\t\t\t\t\t{note}\n\t\t\t\t</Text>\n\t\t\t) : (\n\t\t\t\t<span className=\"amount-row--note inline-flex shrink-0 items-center\">{note}</span>\n\t\t\t))}\n\t\t\t<Text\n\t\t\t\ttag=\"span\"\n\t\t\t\ttype={deduction ? 'success' : 'main'}\n\t\t\t\tweight={total ? 'bold' : 'medium'}\n\t\t\t\tclassName=\"amount-row--value shrink-0 text-end tabular-nums\"\n\t\t\t>\n\t\t\t\t{deduction ? formatDeduction(amount) : amount}\n\t\t\t</Text>\n\t\t</div>\n\t);\n});\n\nAmountRow.displayName = 'AmountRow';\n","/**\n * SummaryPanel — the money ledger most commerce surfaces are made of: a stack\n * of `AmountRow`s, usually ending in the one row that matters more than the\n * rest. A cart, a tax breakdown, an invoice header and an order summary all\n * draw it, so each emphasises its total the same way.\n *\n * The panel draws no ground of its own: it sits directly on the surface that\n * places it, because a tinted box inside a card is a box-in-box. Its only rule\n * is the one a `rollup` row draws above a grand total.\n */\nimport { forwardRef } from 'react';\n\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\n\nimport type { SummaryPanelProps } from './types';\n\nexport const SummaryPanel = forwardRef<HTMLDivElement, SummaryPanelProps>(function SummaryPanel({\n\tclassName,\n\tchildren,\n\t...props\n}, ref) {\n\treturn (\n\t\t<Stack\n\t\t\tref={ref}\n\t\t\tgap=\"sm\"\n\t\t\tdata-slot=\"summary-panel\"\n\t\t\tclassName={cn('summary-panel--component min-w-0', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</Stack>\n\t);\n});\n\nSummaryPanel.displayName = 'SummaryPanel';\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface Discount {\n\t/** Stable identity for this entry. Falls back to the kind, label and position. */\n\tid?: string;\n\t/** Display label. */\n\tlabel: string;\n\t/** Already formatted. Rendered as a deduction whatever sign it carries. */\n\tamount: string;\n\t/** What kind of discount it is (\"Code\", \"Automatic\"), shown quietly beside the amount. */\n\tkind?: ReactNode;\n\t/** The kind as plain text. Kept for existing callers; `kind` wins when both are set. */\n\ttype?: string;\n\t/**\n\t * Draws the kind as a chip in this tone. Discount kinds are categories, so\n\t * pass `neutral` unless the chip states a status. Omit it for the quiet note.\n\t */\n\tbadge?: BadgeTone;\n}\n\nexport interface DiscountStackStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Formatted sum of every discount. */\n\ttotalSavings: string;\n}\n\nexport const defaultDiscountStackStrings: DiscountStackStrings = {\n\ttitle: 'Applied discounts',\n\ttotalSavings: 'Total savings',\n};\n\nexport interface DiscountStackPreviewProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'> {\n\t/** Discounts applied, in the order they stack. */\n\tdiscounts: Discount[];\n\t/** Formatted sum of every discount. */\n\ttotalSavings: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<DiscountStackStrings>;\n}\n\n/** The source kit's name for `DiscountStackPreviewProps`. */\nexport type DiscountStackProps = DiscountStackPreviewProps;\n","/**\n * DiscountStackPreview — the discounts applied to an order, in the order they\n * stack, with the total saved. Every row is a deduction on the shared commerce\n * ledger (`SummaryPanel` + `AmountRow`), so the sign is one U+2212 and the\n * figure is in success ink whatever the caller passed. A discount's kind\n * (\"Code\", \"Automatic\") sits quietly beside the amount; pass a `badge` tone\n * to keep it as a chip instead. The total is ruled off from the rows it sums.\n *\n * `DiscountStack` is the same component under the source kit's name.\n */\nimport type { ReactNode } from 'react';\n\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { AmountRow, SummaryPanel } from '../summary-panel';\nimport { defaultDiscountStackStrings, type Discount, type DiscountStackPreviewProps } from './types';\n\nfunction discountKind(discount: Discount): ReactNode {\n\tconst kind = discount.kind ?? discount.type;\n\tif (kind === undefined || kind === null || kind === '') return undefined;\n\treturn discount.badge ? <Badge tone={discount.badge} size=\"sm\">{kind}</Badge> : kind;\n}\n\nexport function DiscountStackPreview({\n\tdiscounts,\n\ttotalSavings,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: DiscountStackPreviewProps) {\n\tconst strings = useStrings(defaultDiscountStackStrings, stringsProp);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface=\"flat\"\n\t\t\tpadding=\"none\"\n\t\t\ttitle={strings.title}\n\t\t\tdata-slot=\"discount-stack\"\n\t\t\tclassName={cn('discount-stack--component w-full', className)}\n\t\t>\n\t\t\t<SummaryPanel className=\"discount-stack--ledger\">\n\t\t\t\t{/* A kind is a label, not an identity: two \"Seasonal\" rows once\n\t\t\t\t collided on it. An explicit `id` wins; the index keeps the\n\t\t\t\t fallback key unique without requiring one. */}\n\t\t\t\t{discounts.map((discount, index) => (\n\t\t\t\t\t<AmountRow\n\t\t\t\t\t\tkey={discount.id ?? `${discount.type ?? ''}-${discount.label}-${String(index)}`}\n\t\t\t\t\t\tclassName=\"discount-stack--row\"\n\t\t\t\t\t\tlabel={discount.label}\n\t\t\t\t\t\tnote={discountKind(discount)}\n\t\t\t\t\t\tamount={discount.amount}\n\t\t\t\t\t\tdeduction\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t\t<AmountRow\n\t\t\t\t\tclassName=\"discount-stack--total\"\n\t\t\t\t\tlabel={strings.totalSavings}\n\t\t\t\t\tamount={totalSavings}\n\t\t\t\t\ttotal\n\t\t\t\t\tdeduction\n\t\t\t\t\trollup={discounts.length > 0}\n\t\t\t\t/>\n\t\t\t</SummaryPanel>\n\t\t</Card>\n\t);\n}\n\nDiscountStackPreview.displayName = 'DiscountStackPreview';\n\n/** The source kit's name for `DiscountStackPreview`; the same component. */\nexport const DiscountStack = DiscountStackPreview;\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\n/**\n * Transit stage. Drives the status label (through `strings`) and the tone of\n * the status chip, so a delayed shipment can never be painted as a healthy one.\n */\nexport type ShipmentStatus = 'pending' | 'in_transit' | 'delivered' | 'delayed';\n\n/**\n * Chip tone per stage. `delayed` is a warning, not an error: the parcel is\n * still coming. Primary stays off status chips.\n */\nexport const shipmentStatusTone: Record<ShipmentStatus, BadgeTone> = {\n\tpending: 'neutral',\n\tin_transit: 'info',\n\tdelivered: 'success',\n\tdelayed: 'warning',\n};\n\nexport interface TrackingStep {\n\t/** Stable identity. Falls back to the label and position, so repeated labels never collide. */\n\tid?: string;\n\t/** Display label. */\n\tlabel: string;\n\t/**\n\t * Whether the parcel has reached this checkpoint. The latest reached\n\t * checkpoint stays current until the shipment is delivered.\n\t */\n\tdone: boolean;\n\t/** Already formatted. When the checkpoint was reached: a parcel's rail is a log, not a plan. */\n\ttimestamp?: string;\n}\n\nexport interface ShipmentDetail {\n\t/** Display label. */\n\tlabel: string;\n\tvalue: ReactNode;\n}\n\nexport interface ShipmentTrackingStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Label of the tracking-number row. */\n\ttrackingNumber: string;\n\t/** Label of the carrier row. */\n\tcarrier: string;\n\t/** Accessible name of the copy button beside the tracking number. */\n\tcopyTrackingNumber: string;\n\t/** Status label for each `ShipmentStatus`. */\n\tpending: string;\n\tin_transit: string;\n\tdelivered: string;\n\tdelayed: string;\n}\n\nexport const defaultShipmentTrackingStrings: ShipmentTrackingStrings = {\n\ttitle: 'Shipment tracking',\n\ttrackingNumber: 'Tracking number',\n\tcarrier: 'Carrier',\n\tcopyTrackingNumber: 'Copy tracking number',\n\tpending: 'Pending',\n\tin_transit: 'In transit',\n\tdelivered: 'Delivered',\n\tdelayed: 'Delayed',\n};\n\nexport interface ShipmentTrackingProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'> {\n\t/** Carrier tracking reference. */\n\ttrackingNumber: string;\n\t/** Carrier handling the shipment. */\n\tcarrier?: string;\n\t/** Current transit stage. */\n\tstatus: ShipmentStatus;\n\t/** Tracking checkpoints, oldest first. */\n\tsteps: TrackingStep[];\n\t/** Label/value facts about the shipment. */\n\tdetails?: ShipmentDetail[];\n\t/** Fired after the tracking number is copied to the clipboard. */\n\tonCopyTracking?: (trackingNumber: string) => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<ShipmentTrackingStrings>;\n}\n","/**\n * ShipmentTracking — a parcel's tracking number, carrier and checkpoint rail.\n *\n * The title carries the status chip, its tone derived from `status`, so a\n * delayed parcel warns instead of reassuring. The tracking number is a\n * copyable identifier and the carrier a labelled fact, followed by any\n * consumer-supplied details. The checkpoints are a vertical rail drawn by the\n * shared `Timeline` engine with their timestamps: the latest reached\n * checkpoint is the current step (`aria-current=\"step\"`) until the shipment\n * is delivered, and the rail never runs ahead of a checkpoint not yet reached.\n * Carrier polling and checkpoint normalisation stay app-owned.\n */\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { Copyable } from '../../../base/copyable';\nimport { Stack } from '../../../base/structure';\nimport { InlineStat } from '../../data-display';\nimport { Timeline, type TimelineItem } from '../../timelines';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultShipmentTrackingStrings,\n\tshipmentStatusTone,\n\ttype ShipmentTrackingProps,\n\ttype TrackingStep,\n} from './types';\n\nfunction latestReachedIndex(steps: readonly TrackingStep[]) {\n\tfor (let index = steps.length - 1; index >= 0; index -= 1) {\n\t\tif (steps[index]?.done) return index;\n\t}\n\treturn -1;\n}\n\nexport function ShipmentTracking({\n\ttrackingNumber,\n\tcarrier,\n\tstatus,\n\tsteps,\n\tdetails = [],\n\tonCopyTracking,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: ShipmentTrackingProps) {\n\tconst strings = useStrings(defaultShipmentTrackingStrings, stringsProp);\n\n\t// The latest reached checkpoint stays current until delivery; a delivered\n\t// parcel has no current step left.\n\tconst current = status === 'delivered' ? -1 : Math.max(0, latestReachedIndex(steps));\n\tconst rail: TimelineItem[] = steps.map((step, index) => ({\n\t\tid: step.id ?? `${step.label}-${String(index)}`,\n\t\ttitle: step.label,\n\t\ttimestamp: step.timestamp,\n\t\tstatus: index === current ? 'current' : step.done ? 'completed' : 'pending',\n\t}));\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface=\"flat\"\n\t\t\tpadding=\"none\"\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={(\n\t\t\t\t<Badge tone={shipmentStatusTone[status]} className=\"shipment-tracking--status\">\n\t\t\t\t\t{strings[status]}\n\t\t\t\t</Badge>\n\t\t\t)}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tdata-slot=\"shipment-tracking\"\n\t\t\tclassName={cn('shipment-tracking--component w-full', className)}\n\t\t>\n\t\t\t<Stack gap=\"md\" className=\"shipment-tracking--facts\">\n\t\t\t\t<InlineStat\n\t\t\t\t\tlabel={strings.trackingNumber}\n\t\t\t\t\tvalue={(\n\t\t\t\t\t\t<Copyable\n\t\t\t\t\t\t\tvalue={trackingNumber}\n\t\t\t\t\t\t\tmono\n\t\t\t\t\t\t\ttruncate\n\t\t\t\t\t\t\tonCopy={onCopyTracking}\n\t\t\t\t\t\t\tstrings={{ copyLabel: strings.copyTrackingNumber }}\n\t\t\t\t\t\t\tclassName=\"shipment-tracking--tracking-number\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tvalueClassName=\"min-w-0\"\n\t\t\t\t/>\n\t\t\t\t{!!carrier && (\n\t\t\t\t\t<InlineStat label={strings.carrier} value={carrier} valueClassName=\"font-medium\" />\n\t\t\t\t)}\n\t\t\t\t{details.map((detail, index) => (\n\t\t\t\t\t<InlineStat\n\t\t\t\t\t\tkey={`${detail.label}-${String(index)}`}\n\t\t\t\t\t\tlabel={detail.label}\n\t\t\t\t\t\tvalue={detail.value}\n\t\t\t\t\t\tvalueClassName=\"min-w-0 truncate font-medium\"\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</Stack>\n\n\t\t\t{rail.length > 0 && <Timeline items={rail} dotSize=\"sm\" className=\"shipment-tracking--rail\" />}\n\t\t</Card>\n\t);\n}\n\nShipmentTracking.displayName = 'ShipmentTracking';\n","import type { StringsProp } from '../../../../lib/strings';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\n\n/**\n * The card's content, shared by all five presentations. Every field is\n * pre-formatted display copy — this family renders what it is handed and does\n * no currency or date formatting of its own, so localisation stays with the\n * consumer.\n */\nexport interface GiftcardData {\n\t/** Redemption code, shown in a monospace run. */\n\tcode: string;\n\t/** Formatted face value, e.g. `\"$50.00\"`. */\n\tamount: string;\n\t/** Formatted balance left. Omit for a card that shows only its face value. */\n\tremainingAmount?: string;\n\t/** Currency label shown beside the amount when the formatted values omit it. */\n\tcurrency?: string;\n\t/** Lifecycle state, driving the status chip's tone. */\n\tstatus: 'active' | 'redeemed' | 'expired' | 'disabled';\n\t/** Who the card is for. */\n\trecipientName?: string;\n\t/** Who sent it. */\n\tsenderName?: string;\n\t/** Personal note from the sender. */\n\tmessage?: string;\n\t/** Formatted expiry date. */\n\texpiresAt?: string;\n\t/** Formatted issue date. */\n\tcreatedAt?: string;\n\t/** Design name shown as the card's template label. */\n\ttemplate?: string;\n\t/** Fired by the card's view action. Omit to render the card without it. */\n\tonView?: () => void;\n}\n\n/** Background gradient for the illustrated and full presentations. */\nexport type GradientVariant = 'purple' | 'green' | 'warm';\n/** Decorative overlay drawn on top of the gradient. */\nexport type PatternVariant = 'none' | 'circles' | 'waves';\n/** Accent used for the minimal presentation's rule and highlights. */\nexport type AccentColor = 'green' | 'purple' | 'warm';\n/** Header band colour for the compact presentation. */\nexport type HeaderColor = 'green' | 'blue' | 'amber';\n\nexport type GiftcardStatus = GiftcardData['status'];\n\n/**\n * Localised labels for giftcard cards. Covers status chips, the recurring\n * field labels rendered by all five partials (full / dark / illustrated /\n * minimal / compact), and the inline button labels.\n *\n * Override per-instance via `strings`.\n */\nexport interface GiftcardStrings {\n\tstatus: Record<GiftcardStatus, string>;\n\tgiftCard: string;\n\tbalance: string;\n\tpersonalMessage: string;\n\tto: string;\n\tfrom: string;\n\texpires: string;\n\trecipient: string;\n\tviewDetails: string;\n\tcopyCode: string;\n\t/** Successful code-copy feedback. */\n\tcopiedCode?: string;\n\t/** Failed code-copy feedback and retry affordance. */\n\tcopyFailed?: string;\n\t/** Pending code-copy label. */\n\tcopyingCode?: string;\n}\n\nexport const defaultGiftcardStrings: Required<GiftcardStrings> = {\n\tstatus: {\n\t\tactive: 'Active',\n\t\tredeemed: 'Redeemed',\n\t\texpired: 'Expired',\n\t\tdisabled: 'Disabled',\n\t},\n\tgiftCard: 'Gift card',\n\tbalance: 'Balance',\n\tpersonalMessage: 'Personal message',\n\tto: 'To',\n\tfrom: 'From',\n\texpires: 'Expires',\n\trecipient: 'Recipient',\n\tviewDetails: 'View details',\n\tcopyCode: 'Copy code',\n\tcopiedCode: 'Code copied',\n\tcopyFailed: 'Could not copy code. Try again.',\n\tcopyingCode: 'Copying code…',\n};\n\nexport interface GiftcardCommonProps {\n\t/** Override default English giftcard strings. */\n\tstrings?: StringsProp<GiftcardStrings>;\n}\n\nexport const giftcardStatusTone: Record<\n\tGiftcardStatus,\n\t'success' | 'secondary' | 'destructive' | 'warning'\n> = {\n\tactive: 'success',\n\tredeemed: 'secondary',\n\texpired: 'destructive',\n\tdisabled: 'warning',\n};\n\n// Reading regions stay inverse; preset colors belong to their decorative strip.\nconst inverseGradient = 'bg-inverse-background from-inverse-background via-inverse-surface to-inverse-background';\n\nexport const gradientMap: Record<GradientVariant, { card: string; strip: string }> = {\n\tpurple: {\n\t\tcard: inverseGradient,\n\t\tstrip: 'from-primary via-primary/90 to-info',\n\t},\n\tgreen: {\n\t\tcard: inverseGradient,\n\t\tstrip: 'from-success via-info to-success',\n\t},\n\twarm: {\n\t\tcard: inverseGradient,\n\t\tstrip: 'from-warning via-warning/90 to-destructive',\n\t},\n};\n\nexport const compactGradientMap: Record<GradientVariant, string> = {\n\tpurple: 'from-primary to-info',\n\tgreen: 'from-success to-info',\n\twarm: 'from-warning to-destructive',\n};\n\nexport const accentColorMap: Record<AccentColor, { line: string; iconBg: string }> = {\n\tgreen: { line: toneRecipes.success.solid, iconBg: `${toneRecipes.success.tint} ${toneRecipes.success.ink}` },\n\tpurple: { line: toneRecipes.primary.solid, iconBg: `${toneRecipes.primary.tint} ${toneRecipes.primary.ink}` },\n\twarm: { line: toneRecipes.warning.solid, iconBg: `${toneRecipes.warning.tint} ${toneRecipes.warning.ink}` },\n};\n\nexport const headerGradientMap: Record<HeaderColor, string> = {\n\tgreen: 'from-success to-info',\n\tblue: 'from-info to-primary',\n\tamber: 'from-warning to-destructive',\n};\n\n","/**\n * GiftcardCompact — single-row compact layout. A small card-art swatch (the\n * chosen gradient around the inverse card face) on the left, code + recipient\n * in the middle, amount + status badge on the right. Use for inline lists /\n * tables of giftcards. Strings overridable.\n */\nimport { Badge } from '../../../../base/badge';\nimport { MonoValue, Value } from '../../../../primitives';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemMedia,\n\tItemTitle,\n} from '../../../../base/item';\nimport { Stack } from '../../../../base/structure';\nimport { useStrings } from '../../../../../lib/strings';\nimport { cn } from '../../../../../lib/utils';\nimport {\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\ttype GradientVariant,\n\tcompactGradientMap,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n} from '../types';\n\nexport function GiftcardCompact({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\tgradient = 'purple',\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData & GiftcardCommonProps & {\n\t/** Background gradient for the leading block. */\n\tgradient?: GradientVariant;\n\t/** Merged onto the row root. */\n\tclassName?: string;\n}) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\n\treturn (\n\t\t<Item\n\t\t\tsize=\"sm\"\n\t\t\tvariant=\"outline\"\n\t\t\tpadding=\"default\"\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component giftcard-compact--component flex-nowrap shadow-sm transition-colors duration-150 hover:border-border',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<ItemMedia variant=\"image\">\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'flex size-full items-center justify-center bg-gradient-to-br p-space-2xs',\n\t\t\t\t\t\tcompactGradientMap[gradient],\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<span className=\"size-full rounded-inner bg-inverse-background\" />\n\t\t\t\t</div>\n\t\t\t</ItemMedia>\n\n\t\t\t<ItemContent className=\"min-w-0\">\n\t\t\t\t<ItemTitle className=\"w-full max-w-full truncate whitespace-nowrap\">\n\t\t\t\t\t<MonoValue>{code}</MonoValue>\n\t\t\t\t</ItemTitle>\n\t\t\t\t{!!recipientName && <ItemDescription clamp={1}>{recipientName}</ItemDescription>}\n\t\t\t</ItemContent>\n\n\t\t\t<ItemActions className=\"shrink-0\">\n\t\t\t\t<Stack gap=\"2xs\" align=\"end\" className=\"shrink-0\">\n\t\t\t\t\t<div className=\"flex items-baseline gap-space-xs\">\n\t\t\t\t\t\t<Value weight=\"bold\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t\t<Value size=\"xs\" className=\"line-through tabular-nums text-muted-foreground\">\n\t\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t<Badge tone={statusTone} size=\"sm\">{statusLabel}</Badge>\n\t\t\t\t</Stack>\n\t\t\t</ItemActions>\n\t\t</Item>\n\t);\n}\n\nGiftcardCompact.displayName = 'GiftcardCompact';\n","import { useEffect, useRef, useState } from 'react';\nimport { Check, Copy, Loader2, X } from 'lucide-react';\nimport { Button } from '../../../../base/buttons';\nimport { Text } from '../../../../typography';\nimport { cn } from '../../../../../lib/utils';\nimport { defaultGiftcardStrings, type GiftcardStrings } from '../types';\nimport { useStrings } from '../../../../../lib/strings';\n\ntype CopyState = 'idle' | 'pending' | 'copied' | 'failed';\n\n/** Owns the four giftcard code actions without changing their display strips. */\nexport function GiftcardCopyButton({ code, strings, inverse = false, className }: {\n code: string;\n strings: Pick<GiftcardStrings, 'copyCode' | 'copiedCode' | 'copyFailed' | 'copyingCode'>;\n /** Explicit inverse reading surface, independent of the surrounding page theme. */\n inverse?: boolean;\n className?: string;\n}) {\n const copyStrings = useStrings<Required<GiftcardStrings>>(defaultGiftcardStrings, strings);\n const generation = useRef(0);\n const [result, setResult] = useState<{ code: string; state: CopyState }>({code, state: 'idle'});\n const state = result.code === code ? result.state : 'idle';\n useEffect(() => {\n generation.current++;\n setResult(previous => previous.code === code ? previous : {code, state: 'idle'});\n return () => { generation.current++; };\n }, [code]);\n const label = state === 'copied' ? copyStrings.copiedCode : state === 'failed' ? copyStrings.copyFailed : state === 'pending' ? copyStrings.copyingCode : copyStrings.copyCode;\n const Icon = state === 'copied' ? Check : state === 'failed' ? X : state === 'pending' ? Loader2 : Copy;\n const copy = async () => {\n if (!code || state === 'pending') return;\n const request = generation.current;\n setResult({code, state: 'pending'});\n try {\n await navigator.clipboard.writeText(code);\n if (generation.current === request) setResult({code, state: 'copied'});\n } catch {\n if (generation.current === request) setResult({code, state: 'failed'});\n }\n };\n return <>\n <Button\n type=\"button\" tone=\"secondary\" buttonStyle=\"ghost\" size=\"sm\" iconOnly\n disabled={!code || state === 'pending'} aria-busy={state === 'pending'}\n aria-label={label} withTooltip={label}\n className={cn(\n 'giftcard-copy--component', className,\n // Use the same complete state selector as the shared Button recipe so cn\n // replaces its page-themed fill instead of leaving a more specific rule.\n inverse && 'text-inverse-foreground [&:hover:not(:active):not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-inverse-surface [&:hover:not(:active):not(:disabled):not([data-disabled]):not([aria-disabled=true])]:text-inverse-foreground [&:active:not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-inverse-surface-strong focus-visible:bg-inverse-surface',\n )}\n onClick={() => void copy()}\n >\n <Icon aria-hidden className={cn('size-icon-sm', state === 'pending' && 'animate-spin')} />\n </Button>\n {(state === 'copied' || state === 'failed') && <Text tag=\"span\" role=\"status\" className=\"sr-only\">{label}</Text>}\n </>;\n}\n","import { GiftcardCopyButton } from './giftcard-copy-button';\n/**\n * GiftcardCardDark — premium dark variant. Header label and status chip,\n * balance + strike-through line, code strip, metadata rows\n * (recipient / expires), and a full-width call to action. Strings\n * overridable for i18n.\n */\nimport { Heading } from '../../../../typography/heading';\nimport { Text } from '../../../../typography/text';\nimport { Badge } from '../../../../base/badge';\nimport { Button } from '../../../../base/buttons';\nimport { MetadataList, type MetadataListItem } from '../../../../base/metadata-list';\nimport { MonoValue, Value } from '../../../../primitives';\nimport { useStrings } from '../../../../../lib/strings';\nimport { Stack } from '../../../../base/structure';\nimport { cn } from '../../../../../lib/utils';\nimport {\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n} from '../types';\n\nexport function GiftcardCardDark({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\texpiresAt,\n\tonView,\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData & GiftcardCommonProps & { className?: string }) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\tconst metadataItems: MetadataListItem[] = [\n\t\t...(recipientName ? [{ label: strings.recipient, value: recipientName }] : []),\n\t\t...(expiresAt ? [{ label: strings.expires, value: expiresAt }] : []),\n\t];\n\n\t// One inset owner for label, amount, code strip, facts and action, so every\n\t// region starts on the same edge.\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component giftcard-dark--component dark w-full max-w-sm overflow-hidden rounded-radius bg-card text-card-foreground shadow-sm ring-1 ring-border',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<Stack gap=\"lg\" className=\"giftcard-dark--body p-surface\">\n\t\t\t\t<Stack direction=\"horizontal\" justify=\"between\" align=\"center\" gap=\"md\" wrap={false}>\n\t\t\t\t\t<Text tag=\"span\" className=\"text-inverse-muted\">\n\t\t\t\t\t\t{strings.giftCard}\n\t\t\t\t\t</Text>\n\t\t\t\t\t<Badge tone={statusTone} className=\"shrink-0\">{statusLabel}</Badge>\n\t\t\t\t</Stack>\n\n\t\t\t\t<div className=\"flex items-baseline gap-space-md\">\n\t\t\t\t\t<Heading tag=\"h2\" size=\"2xl\" className=\"border-none pb-0 tabular-nums text-inverse-foreground\">\n\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t<Value className=\"line-through tabular-nums text-inverse-disabled\">\n\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"giftcard-dark--code rounded-inner border border-inverse-border bg-inverse-surface p-surface-xs\">\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"md\">\n\t\t\t\t\t\t<MonoValue className=\"flex-1 tracking-[0.15em] text-inverse-foreground\">\n\t\t\t\t\t\t\t{code}\n\t\t\t\t\t\t</MonoValue>\n\t\t\t\t\t\t<GiftcardCopyButton code={code} strings={strings} inverse />\n\t\t\t\t\t</Stack>\n\t\t\t\t</div>\n\n\t\t\t\t<MetadataList\n\t\t\t\t\titems={metadataItems}\n\t\t\t\t\tcolumns={1}\n\t\t\t\t\tclassName=\"[&_.metadata-list--label]:text-inverse-muted [&_.metadata-list--value]:text-inverse-foreground\"\n\t\t\t\t/>\n\n\t\t\t\t{/* Inverse button on the dark surface so the label always reads\n\t\t\t\t without raw palette overrides. */}\n\t\t\t\t{!!onView && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttone=\"neutral\"\n\t\t\t\t\t\tbuttonStyle=\"solid\"\n\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\tonClick={onView}\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.viewDetails}\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</div>\n\t);\n}\n\nGiftcardCardDark.displayName = 'GiftcardCardDark';\n","import { GiftcardCopyButton } from './giftcard-copy-button';\n/**\n * GiftcardCard (full) — premium gradient layout with optional\n * pattern overlay (circles / waves), header status chip, balance / strike-\n * through line, copyable code strip, personal message block, and metadata\n * grid (To / From / Expires). Strings overridable for i18n.\n */\nimport { DisplayLabel } from '../../../../typography/display-label';\nimport { Text } from '../../../../typography/text';\nimport { Heading } from '../../../../typography/heading';\nimport { Badge } from '../../../../base/badge';\nimport { Button } from '../../../../base/buttons';\nimport { Stack } from '../../../../base/structure';\nimport { MetadataList, type MetadataListItem } from '../../../../base/metadata-list';\nimport { MonoValue, Value } from '../../../../primitives';\nimport { useStrings } from '../../../../../lib/strings';\nimport { cn } from '../../../../../lib/utils';\nimport {\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\ttype GradientVariant,\n\ttype PatternVariant,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n\tgradientMap,\n} from '../types';\n\nexport function GiftcardFull({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\tsenderName,\n\tmessage,\n\texpiresAt,\n\tcreatedAt: _createdAt,\n\ttemplate: _template,\n\tonView,\n\tgradient = 'purple',\n\tpattern = 'none',\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData &\n\tGiftcardCommonProps & {\n\t\t/** Background gradient. */\n\t\tgradient?: GradientVariant;\n\t\t/** Decorative overlay on the gradient. */\n\t\tpattern?: PatternVariant;\n\t\tclassName?: string;\n\t}) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\tconst metadataItems: MetadataListItem[] = [\n\t\t...(recipientName ? [{ label: strings.to, value: recipientName }] : []),\n\t\t...(senderName ? [{ label: strings.from, value: senderName }] : []),\n\t\t...(expiresAt ? [{ label: strings.expires, value: expiresAt }] : []),\n\t];\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component w-full max-w-sm transition-shadow',\n\t\t\t\t'hover:shadow-md',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{/* Gift card header */}\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'relative overflow-hidden rounded-t-radius bg-gradient-to-br p-surface',\n\t\t\t\t\tgradientMap[gradient].card,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<div aria-hidden className={cn('absolute inset-x-0 top-0 z-10 h-1 bg-gradient-to-r', gradientMap[gradient].strip)} />\n\t\t\t\t{/* Pattern: circles */}\n\t\t\t\t{pattern === 'circles' && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"absolute -top-8 -right-8 h-32 w-32 rounded-full bg-inverse-decoration\" aria-hidden=\"true\" />\n\t\t\t\t\t\t<div className=\"absolute -bottom-4 -left-4 h-20 w-20 rounded-full bg-inverse-decoration\" aria-hidden=\"true\" />\n\t\t\t\t\t</>\n\t\t\t\t)}\n\n\t\t\t\t{/* Pattern: waves */}\n\t\t\t\t{pattern === 'waves' && (\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclassName=\"absolute inset-0 h-full w-full opacity-5\"\n\t\t\t\t\t\tviewBox=\"0 0 400 200\"\n\t\t\t\t\t\tpreserveAspectRatio=\"none\"\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path d=\"M0 80 C100 20, 200 140, 400 60 L400 200 L0 200 Z\" className=\"fill-inverse-foreground\" />\n\t\t\t\t\t\t<path d=\"M0 120 C120 60, 280 180, 400 100 L400 200 L0 200 Z\" className=\"fill-inverse-foreground\" />\n\t\t\t\t\t</svg>\n\t\t\t\t)}\n\n\t\t\t\t<div className=\"absolute top-4 right-4 z-10\">\n\t\t\t\t\t<Badge\n\t\t\t\t\t\ttone={statusTone}\n\t\t\t\t\t\tinline\n\t\t\t\t\t\tdot\n\t\t\t\t\t\tclassName=\"border border-inverse-border bg-inverse-background text-inverse-foreground shadow-sm\"\n\t\t\t\t\t\tdata-status={statusTone}\n\t\t\t\t\t>\n\t\t\t\t\t\t{statusLabel}\n\t\t\t\t\t</Badge>\n\t\t\t\t</div>\n\n\t\t\t\t<Stack gap=\"xl\" className=\"relative z-10\">\n\t\t\t\t\t<Text weight=\"medium\" className=\"text-inverse-muted\">{strings.giftCard}</Text>\n\n\t\t\t\t\t<Stack gap=\"dense\">\n\t\t\t\t\t\t<DisplayLabel tone=\"inverse\">{strings.balance}</DisplayLabel>\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"baseline\" gap=\"lg\">\n\t\t\t\t\t\t\t<Heading tag=\"h2\" size=\"2xl\" className=\"border-none pb-0 text-inverse-foreground tabular-nums drop-shadow-sm\">\n\t\t\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t\t\t<Value className=\"line-through tabular-nums text-inverse-disabled\">{amount}</Value>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</Stack>\n\n\t\t\t\t\t{/* Code strip — premium feel */}\n\t\t\t\t\t<div className={cn(\n\t\t\t\t\t\t\t'giftcard-full--code',\n\t\t\t\t\t\t\t'rounded-radius p-surface-xs',\n\t\t\t\t\t\t\t'bg-inverse-surface',\n\t\t\t\t\t\t\t'border border-inverse-border',\n\t\t\t\t\t\t\t'shadow-sm',\n\t\t\t\t\t\t)}>\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"md\">\n\t\t\t\t\t\t<MonoValue weight=\"semibold\" className=\"flex-1 tracking-[0.2em] text-inverse-foreground\">\n\t\t\t\t\t\t\t{code}\n\t\t\t\t\t\t</MonoValue>\n\t\t\t\t\t\t<GiftcardCopyButton code={code} strings={strings} inverse />\n\t\t\t\t\t</Stack>\n\t\t\t\t\t</div>\n\t\t\t\t</Stack>\n\t\t\t</div>\n\n\t\t\t{/* Details section — structured metadata grid */}\n\t\t\t\t<div className=\"rounded-b-radius bg-card p-surface shadow-sm border border-t-0 border-border\">\n\t\t\t\t<Stack gap=\"xl\">\n\t\t\t\t{!!message && (\n\t\t\t\t\t<Stack gap=\"normal\" className=\"giftcard-full--message\">\n\t\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t\t{strings.personalMessage}\n\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t<Text type=\"secondary\" className=\"italic leading-relaxed\">\n\t\t\t\t\t\t\t&ldquo;{message}&rdquo;\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\n\t\t\t\t<MetadataList\n\t\t\t\t\titems={metadataItems}\n\t\t\t\t\tcolumns={{ base: 1, sm: 2 }}\n\t\t\t\t/>\n\n\t\t\t\t{!!onView && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\tonClick={onView}\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.viewDetails}\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nGiftcardFull.displayName = 'GiftcardFull';\n","import { GiftcardCopyButton } from './giftcard-copy-button';\n/**\n * GiftcardCardIllustrated — gift-card surface with a compact illustrated\n * header, balance + status row, code strip, details, and a footer action.\n * Strings are overridable for i18n.\n */\nimport { DisplayLabel } from '../../../../typography/display-label';\nimport { Text } from '../../../../typography/text';\nimport { Heading } from '../../../../typography/heading';\nimport { Badge } from '../../../../base/badge';\nimport { Button } from '../../../../base/buttons';\nimport { Stack } from '../../../../base/structure';\nimport { MetadataList, type MetadataListItem } from '../../../../base/metadata-list';\nimport { MonoValue, Value } from '../../../../primitives';\nimport { useStrings } from '../../../../../lib/strings';\nimport { cn } from '../../../../../lib/utils';\nimport {\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\ttype HeaderColor,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n\theaderGradientMap,\n} from '../types';\n\nexport function GiftcardCardIllustrated({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\texpiresAt,\n\tonView,\n\theaderColor = 'green',\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData & GiftcardCommonProps & {\n\t/** Colour of the header band. */\n\theaderColor?: HeaderColor;\n\t/** Merged onto the card root. */\n\tclassName?: string;\n}) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\tconst metadataItems: MetadataListItem[] = [\n\t\t...(recipientName ? [{ label: strings.recipient, value: recipientName }] : []),\n\t\t...(expiresAt ? [{ label: strings.expires, value: expiresAt }] : []),\n\t];\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component giftcard-illustrated--component w-full max-w-sm overflow-hidden rounded-radius border border-border bg-card shadow-sm',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<div className=\"relative flex h-16 items-center justify-between overflow-hidden bg-inverse-background bg-gradient-to-br from-inverse-background via-inverse-surface to-inverse-background px-surface\">\n\t\t\t\t<div aria-hidden className={cn('absolute inset-x-0 top-0 h-1 bg-gradient-to-r', headerGradientMap[headerColor])} />\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"absolute inset-0 opacity-80\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbackgroundImage:\n\t\t\t\t\t\t\t'repeating-linear-gradient(45deg, transparent 0 10px, color-mix(in oklch, var(--inverse-foreground) 3%, transparent) 10px 20px)',\n\t\t\t\t\t}}\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t/>\n\t\t\t\t<DisplayLabel tone=\"inverse\" className=\"relative\">\n\t\t\t\t\t{strings.giftCard}\n\t\t\t\t</DisplayLabel>\n\t\t\t</div>\n\n\t\t\t\t<div className=\"p-surface\">\n\t\t\t\t<Stack gap=\"lg\">\n\t\t\t\t<div className=\"flex items-start justify-between\">\n\t\t\t\t\t<Stack gap=\"dense\">\n\t\t\t\t\t\t<div className=\"flex items-baseline gap-space-md\">\n\t\t\t\t\t\t\t<Heading tag=\"h2\" size=\"2xl\" className=\"border-none pb-0 tabular-nums\">\n\t\t\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t\t\t<Value className=\"line-through tabular-nums text-muted-foreground\">\n\t\t\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t{strings.balance}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Badge tone={statusTone}>{statusLabel}</Badge>\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"giftcard-illustrated--code rounded-inner border border-border bg-muted/30 p-surface-xs\">\n\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"md\">\n\t\t\t\t\t<MonoValue className=\"flex-1 tracking-[0.15em]\">\n\t\t\t\t\t\t{code}\n\t\t\t\t\t</MonoValue>\n\t\t\t\t\t<GiftcardCopyButton code={code} strings={strings} />\n\t\t\t\t\t</Stack>\n\t\t\t\t</div>\n\n\t\t\t\t<MetadataList items={metadataItems} columns={2} />\n\n\t\t\t\t{!!onView && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\tonClick={onView}\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.viewDetails}\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nGiftcardCardIllustrated.displayName = 'GiftcardCardIllustrated';\n","import { GiftcardCopyButton } from './giftcard-copy-button';\n/**\n * GiftcardCardMinimal — clean minimal layout. A small accent line (driven by\n * `color`) sits above the header label, balance, code strip, and metadata\n * rows. Footer \"View details\" link uses an arrow affordance.\n * Strings overridable for i18n.\n */\nimport { Heading } from '../../../../typography/heading';\nimport { Text } from '../../../../typography/text';\nimport { Badge } from '../../../../base/badge';\nimport { TextButton } from '../../../../base/buttons';\nimport { MetadataList, type MetadataListItem } from '../../../../base/metadata-list';\nimport { MonoValue, Value } from '../../../../primitives';\nimport { useStrings } from '../../../../../lib/strings';\nimport { Stack } from '../../../../base/structure';\nimport { cn } from '../../../../../lib/utils';\nimport { ArrowRight } from 'lucide-react';\nimport {\n\ttype AccentColor,\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\taccentColorMap,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n} from '../types';\n\nexport function GiftcardCardMinimal({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\texpiresAt,\n\tonView,\n\tcolor = 'green',\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData & GiftcardCommonProps & {\n\t/** Accent for the rule and highlights. */\n\tcolor?: AccentColor;\n\t/** Merged onto the card root. */\n\tclassName?: string;\n}) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\tconst accent = accentColorMap[color];\n\tconst metadataItems: MetadataListItem[] = [\n\t\t...(recipientName ? [{ label: strings.recipient, value: recipientName }] : []),\n\t\t...(expiresAt ? [{ label: strings.expires, value: expiresAt }] : []),\n\t];\n\n\t// One inset owner: the accent rule, label, amount, code, facts and link all\n\t// start on the same edge. Only the code strip keeps its own inset, because\n\t// it is a distinct copyable object.\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component giftcard-minimal--component w-full max-w-sm overflow-hidden rounded-radius border border-border bg-card shadow-sm',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<Stack gap=\"lg\" className=\"giftcard-minimal--body p-surface\">\n\t\t\t\t<div aria-hidden=\"true\" className={cn('h-1 w-12 rounded-radius-sm', accent.line)} />\n\n\t\t\t\t<Stack direction=\"horizontal\" justify=\"between\" align=\"center\" gap=\"md\" wrap={false}>\n\t\t\t\t\t<Text tag=\"span\" type=\"secondary\">\n\t\t\t\t\t\t{strings.giftCard}\n\t\t\t\t\t</Text>\n\t\t\t\t\t<Badge tone={statusTone} size=\"sm\" className=\"shrink-0\">{statusLabel}</Badge>\n\t\t\t\t</Stack>\n\n\t\t\t\t<div className=\"flex items-baseline gap-space-md\">\n\t\t\t\t\t<Heading tag=\"h2\" size=\"2xl\" className=\"border-none pb-0 tabular-nums\">\n\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t<Value className=\"line-through tabular-nums text-muted-foreground\">\n\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"giftcard-minimal--code rounded-inner border border-border bg-muted/30 p-surface-xs\">\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"sm\">\n\t\t\t\t\t\t<MonoValue className=\"flex-1 tracking-[0.15em]\">\n\t\t\t\t\t\t\t{code}\n\t\t\t\t\t\t</MonoValue>\n\t\t\t\t\t\t<GiftcardCopyButton code={code} strings={strings} className=\"shrink-0\" />\n\t\t\t\t\t</Stack>\n\t\t\t\t</div>\n\n\t\t\t\t<MetadataList\n\t\t\t\t\titems={metadataItems}\n\t\t\t\t\tcolumns={1}\n\t\t\t\t\tdensity=\"compact\"\n\t\t\t\t\tclassName=\"[&_.metadata-list--grid]:gap-space-sm\"\n\t\t\t\t/>\n\n\t\t\t\t{!!onView && (\n\t\t\t\t\t<TextButton onClick={onView} className=\"group/link self-start\">\n\t\t\t\t\t\t{strings.viewDetails}\n\t\t\t\t\t\t<ArrowRight aria-hidden=\"true\" className=\"ml-1 size-icon-sm transition-transform group-hover/link:translate-x-0.5\" />\n\t\t\t\t\t</TextButton>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</div>\n\t);\n}\n\nGiftcardCardMinimal.displayName = 'GiftcardCardMinimal';\n","import { GiftcardCompact } from './partials/giftcard-compact';\nimport { GiftcardCardDark } from './partials/giftcard-dark';\nimport { GiftcardFull } from './partials/giftcard-full';\nimport { GiftcardCardIllustrated } from './partials/giftcard-illustrated';\nimport { GiftcardCardMinimal } from './partials/giftcard-minimal';\nimport type {\n\tAccentColor,\n\tGiftcardCommonProps,\n\tGiftcardData,\n\tGradientVariant,\n\tHeaderColor,\n\tPatternVariant,\n} from './types';\nimport { cn } from '../../../../lib/utils';\n\nexport type GiftcardCardVariant =\n\t| 'gradient'\n\t| 'compact'\n\t| 'minimal'\n\t| 'dark'\n\t| 'illustrated';\n\ninterface GiftcardCardSharedProps extends GiftcardData, GiftcardCommonProps {\n\t/** Merged onto the card root. */\n\tclassName?: string;\n}\n\n/**\n * Each variant admits only the styling prop it can actually use; the others are\n * typed `never`, so passing `headerColor` to the gradient card is a type error\n * rather than a silently ignored prop.\n */\nexport type GiftcardCardProps = GiftcardCardSharedProps & (\n\t| {\n\t\t/** Premium gradient card. The default presentation. */\n\t\tvariant?: 'gradient';\n\t\t/** Background gradient. Default: `purple`. */\n\t\tgradient?: GradientVariant;\n\t\t/** Decorative overlay on the gradient. Default: `none`. */\n\t\tpattern?: PatternVariant;\n\t\tcolor?: never;\n\t\theaderColor?: never;\n\t}\n\t| {\n\t\t/** Short row for collections and lists. */\n\t\tvariant: 'compact';\n\t\t/** Background gradient for the row's leading block. */\n\t\tgradient?: GradientVariant;\n\t\tpattern?: never;\n\t\tcolor?: never;\n\t\theaderColor?: never;\n\t}\n\t| {\n\t\t/** Restrained card that inherits the surrounding surface. */\n\t\tvariant: 'minimal';\n\t\t/** Accent for the rule and highlights. */\n\t\tcolor?: AccentColor;\n\t\tgradient?: never;\n\t\tpattern?: never;\n\t\theaderColor?: never;\n\t}\n\t| {\n\t\t/** Solid dark card, for light surfaces that need contrast. */\n\t\tvariant: 'dark';\n\t\tgradient?: never;\n\t\tpattern?: never;\n\t\tcolor?: never;\n\t\theaderColor?: never;\n\t}\n\t| {\n\t\t/** Illustrated card with a coloured header band. */\n\t\tvariant: 'illustrated';\n\t\t/** Colour of the header band. */\n\t\theaderColor?: HeaderColor;\n\t\tgradient?: never;\n\t\tpattern?: never;\n\t\tcolor?: never;\n\t}\n);\n\n/**\n * GiftcardCard — one gift-card data contract with five deliberate visual\n * variants. The premium gradient card is the useful default; compact is for\n * collection rows, while minimal, dark, and illustrated are explicit styles.\n */\nexport function GiftcardCard(props: GiftcardCardProps) {\n\tconst className = cn('giftcard-card--component', props.className);\n\tswitch (props.variant) {\n\t\tcase 'compact':\n\t\t\treturn <GiftcardCompact {...props} className={className} />;\n\t\tcase 'minimal':\n\t\t\treturn <GiftcardCardMinimal {...props} className={className} />;\n\t\tcase 'dark':\n\t\t\treturn <GiftcardCardDark {...props} className={className} />;\n\t\tcase 'illustrated':\n\t\t\treturn <GiftcardCardIllustrated {...props} className={className} />;\n\t\tdefault:\n\t\t\treturn <GiftcardFull {...props} className={className} />;\n\t}\n}\n\nGiftcardCard.displayName = 'GiftcardCard';\n","import type { SmartCardSurface } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\nimport type { ReactNode } from 'react';\nimport type { SemanticTone } from '../../../../lib/component-vocabulary';\n\nexport type VendorProfileChangeTone = Extract<\n\tSemanticTone,\n\t'secondary' | 'success' | 'warning' | 'destructive'\n>;\n\n/** The two data views available when a dossier has overview and performance data. */\nexport type VendorProfileView = 'overview' | 'stats';\n\n/** A performance tile shown in the stats view. */\nexport interface VendorProfileStat {\n\t/** Stable key used when the stat collection changes order. */\n\tid?: string;\n\t/** Consumer-owned stat label. */\n\tlabel: ReactNode;\n\t/** Display value; prefer package primitives such as Money, Number, or Percent. */\n\tvalue: ReactNode;\n\t/** Optional comparison value rendered as a badge. */\n\tchange?: ReactNode;\n\t/** Explicit semantic meaning of the comparison. Defaults to neutral secondary. */\n\tchangeTone?: VendorProfileChangeTone;\n}\n\n/** An operational label/value row shown in the overview view. */\nexport interface VendorProfileMetric {\n\t/** Stable key used when the metric collection changes order. */\n\tid?: string;\n\t/** Consumer-owned metric label. */\n\tlabel: ReactNode;\n\t/** Display value; prefer a semantic package primitive when one exists. */\n\tvalue: ReactNode;\n}\n\n/**\n * Localised labels for VendorProfileCard. Override per-instance via `strings`.\n */\nexport interface VendorProfileStrings {\n\t/** Label for the operating overview tab. */\n\ttabOverview: string;\n\t/** Label for the performance statistics tab. */\n\ttabStats: string;\n\t/** Label above the primary earnings value. */\n\ttotalEarnings: string;\n\t/** Label for the message action. */\n\tmessage: string;\n\t/** Label for the engagement action. */\n\thire: string;\n\t/** Accessible and visible label for the verified badge. */\n\tverifiedAriaLabel: string;\n}\n\nexport const defaultVendorProfileStrings: VendorProfileStrings = {\n\ttabOverview: 'Overview',\n\ttabStats: 'Stats',\n\ttotalEarnings: 'Total earnings',\n\tmessage: 'Message',\n\thire: 'Hire vendor',\n\tverifiedAriaLabel: 'Verified',\n};\n\nexport interface VendorProfileCardProps {\n\t/** Vendor display name used by the identity header and avatar fallback. */\n\tname: string;\n\t/** Explicit avatar fallback text. Derived from `name` when omitted. */\n\tinitials?: string;\n\t/** Optional vendor avatar URL. */\n\tavatarUrl?: string;\n\t/** Secondary identity context such as category, market, or location. */\n\trole?: ReactNode;\n\t/** Shows the localized verified badge when true. */\n\tverified?: boolean;\n\t/** Primary earnings display; prefer the canonical Money primitive. */\n\tearnings?: ReactNode;\n\t/** Optional comparison rendered beside earnings. */\n\tearningsChange?: ReactNode;\n\t/** Explicit semantic meaning of `earningsChange`. Defaults to neutral secondary. */\n\tearningsChangeTone?: VendorProfileChangeTone;\n\t/** Operational rows rendered in the overview view. */\n\tmetrics?: VendorProfileMetric[];\n\t/** Performance tiles rendered in the stats view. */\n\tstats?: VendorProfileStat[];\n\t/** Controlled active view. Only used when both overview and stats exist. */\n\tview?: VendorProfileView;\n\t/** Initial active view for uncontrolled usage. Defaults to `overview`. */\n\tdefaultView?: VendorProfileView;\n\t/** Called when the user requests a different view in either state mode. */\n\tonViewChange?: (view: VendorProfileView) => void;\n\t/** Shows the message action and delegates its behavior to the consumer. */\n\tonMessage?: () => void;\n\t/** Shows the engagement action and delegates its behavior to the consumer. */\n\tonHire?: () => void;\n\t/**\n\t * Card surface override. Defaults through the shared SmartCard configuration.\n\t * `flat` also drops the dossier's own insets, so the embedding surface owns them.\n\t */\n\tsurface?: SmartCardSurface;\n\t/** Card density override. Defaults through the shared SmartCard configuration. */\n\t/** Additional classes applied to the outer SmartCard element. */\n\tclassName?: string;\n\t/** Deep-partial localized label overrides. */\n\tstrings?: StringsProp<VendorProfileStrings>;\n}\n","/**\n * VendorProfileCard — a compact vendor dossier with identity, earnings,\n * operating metrics, performance stats, and callback-driven actions.\n *\n * The component owns card chrome because it is a fixed-format profile card.\n * Consumers can still opt into `surface=\"flat\"` when embedding the dossier in\n * a larger surface. Its overview/stats view supports controlled and\n * uncontrolled state. Tabs only render when both content views are available;\n * an identity-only profile never grows dead controls or actions.\n */\nimport { ChevronRight } from 'lucide-react';\nimport { forwardRef, type ReactNode, useState } from 'react';\n\nimport { Avatar, AvatarFallback, AvatarImage } from '../../../base/avatar';\nimport { Badge, type BadgeProps } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { hasRenderableContent, Card } from '../../../base/cards';\nimport {\n\tItem,\n\tItemContent,\n\tItemDescription,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from '../../../base/navigation/tabs';\nimport { Grid, Stack } from '../../../base/structure';\nimport { InlineStat } from '../../data-display';\nimport { Initials, Value } from '../../../primitives';\nimport { DisplayLabel } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultVendorProfileStrings,\n\ttype VendorProfileCardProps,\n\ttype VendorProfileChangeTone,\n\ttype VendorProfileView,\n} from './types';\n\nconst CHANGE_VARIANTS: Record<\n\tVendorProfileChangeTone,\n\tNonNullable<BadgeProps['tone']>\n> = {\n\tsecondary: 'secondary',\n\tsuccess: 'success',\n\twarning: 'warning',\n\tdestructive: 'destructive',\n};\n\nfunction ChangeBadge({\n\tchildren,\n\ttone,\n}: {\n\tchildren?: ReactNode;\n\ttone?: VendorProfileChangeTone;\n}) {\n\tif (!hasRenderableContent(children)) return null;\n\n\treturn (\n\t\t<Badge\n\t\t\ttone={CHANGE_VARIANTS[tone ?? 'secondary']}\n\t\t\tclassName=\"vendor-profile--change shrink-0 tabular-nums\"\n\t\t>\n\t\t\t{children}\n\t\t</Badge>\n\t);\n}\n\nexport const VendorProfileCard = forwardRef<HTMLDivElement, VendorProfileCardProps>(\n\tfunction VendorProfileCard(\n\t\t{\n\t\t\tname,\n\t\t\tinitials,\n\t\t\tavatarUrl,\n\t\t\trole,\n\t\t\tverified = false,\n\t\t\tearnings,\n\t\t\tearningsChange,\n\t\t\tearningsChangeTone,\n\t\t\tmetrics = [],\n\t\t\tstats = [],\n\t\t\tview,\n\t\t\tdefaultView = 'overview',\n\t\t\tonViewChange,\n\t\t\tonMessage,\n\t\t\tonHire,\n\t\t\tsurface,\n\t\t\tclassName,\n\t\t\tstrings: stringsProp,\n\t\t}: VendorProfileCardProps,\n\t\tref,\n\t) {\n\t\tconst strings = useStrings(defaultVendorProfileStrings, stringsProp);\n\t\tconst [internalView, setInternalView] = useState<VendorProfileView>(defaultView);\n\t\tconst isViewControlled = view !== undefined;\n\n\t\tconst hasEarnings = hasRenderableContent(earnings);\n\t\tconst hasOverviewContent = hasEarnings || metrics.length > 0;\n\t\tconst hasStatsContent = stats.length > 0;\n\t\tconst availableTabs: VendorProfileView[] = [\n\t\t\t...(hasOverviewContent ? (['overview'] as const) : []),\n\t\t\t...(hasStatsContent ? (['stats'] as const) : []),\n\t\t];\n\t\tconst requestedView = isViewControlled ? view : internalView;\n\t\tconst activeView = availableTabs.includes(requestedView)\n\t\t\t? requestedView\n\t\t\t: availableTabs[0] ?? 'overview';\n\t\tconst hasBody = availableTabs.length > 0;\n\t\tconst hasActions = Boolean(onMessage || onHire);\n\t\tconst handleViewChange = (nextValue: string) => {\n\t\t\tif (nextValue !== 'overview' && nextValue !== 'stats') return;\n\t\t\tif (!availableTabs.includes(nextValue)) return;\n\t\t\tif (!isViewControlled) setInternalView(nextValue);\n\t\t\tonViewChange?.(nextValue);\n\t\t};\n\n\t\t// Earnings and stats are plain label/value facts on the card surface; the\n\t\t// change chip follows its value instead of floating at the far edge.\n\t\tconst overviewContent = (\n\t\t\t<Stack gap=\"xl\" className=\"vendor-profile--overview\">\n\t\t\t\t{hasEarnings && (\n\t\t\t\t\t<Stack gap=\"normal\" className=\"vendor-profile--earnings\">\n\t\t\t\t\t\t<DisplayLabel>{strings.totalEarnings}</DisplayLabel>\n\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"baseline\">\n\t\t\t\t\t\t\t<Value size=\"base\" weight=\"semibold\" className=\"tabular-nums tracking-tight\">\n\t\t\t\t\t\t\t\t{earnings}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t<ChangeBadge tone={earningsChangeTone}>{earningsChange}</ChangeBadge>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\n\t\t\t\t{metrics.length > 0 && (\n\t\t\t\t\t<div className=\"vendor-profile--metrics divide-y divide-border/60\">\n\t\t\t\t\t\t{metrics.map((metric, index) => (\n\t\t\t\t\t\t\t<InlineStat\n\t\t\t\t\t\t\t\tkey={metric.id ?? index}\n\t\t\t\t\t\t\t\tclassName=\"py-row-y first:pt-0 last:pb-0\"\n\t\t\t\t\t\t\t\tlabel={metric.label}\n\t\t\t\t\t\t\t\tvalue={metric.value}\n\t\t\t\t\t\t\t\tvalueClassName=\"font-medium\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t);\n\n\t\tconst statsContent = (\n\t\t\t<Grid columns={{ base: 1, sm: 2 }} gap=\"xl\" className=\"vendor-profile--stats\">\n\t\t\t\t{stats.map((stat, index) => (\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tkey={stat.id ?? index}\n\t\t\t\t\t\tgap=\"normal\"\n\t\t\t\t\t\tclassName=\"vendor-profile--stat\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<DisplayLabel className=\"truncate\">{stat.label}</DisplayLabel>\n\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"baseline\">\n\t\t\t\t\t\t\t<Value weight=\"semibold\" className=\"min-w-0 tabular-nums\">\n\t\t\t\t\t\t\t\t{stat.value}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t<ChangeBadge tone={stat.changeTone}>{stat.change}</ChangeBadge>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</Stack>\n\t\t\t\t))}\n\t\t\t</Grid>\n\t\t);\n\n\t\tconst profileBody = availableTabs.length > 1 ? (\n\t\t\t<Tabs\n\t\t\t\tvalue={activeView}\n\t\t\t\tonValueChange={handleViewChange}\n\t\t\t\tclassName=\"vendor-profile--tabs gap-space-lg\"\n\t\t\t>\n\t\t\t\t<TabsList className=\"grid h-auto w-full grid-cols-2 rounded-inner p-space-xs\">\n\t\t\t\t\t<TabsTrigger value=\"overview\" className=\"h-action-sm rounded-inner px-control-sm text-pxs\">\n\t\t\t\t\t\t{strings.tabOverview}\n\t\t\t\t\t</TabsTrigger>\n\t\t\t\t\t<TabsTrigger value=\"stats\" className=\"h-action-sm rounded-inner px-control-sm text-pxs\">\n\t\t\t\t\t\t{strings.tabStats}\n\t\t\t\t\t</TabsTrigger>\n\t\t\t\t</TabsList>\n\t\t\t\t<TabsContent value=\"overview\" className=\"mt-0\">\n\t\t\t\t\t{overviewContent}\n\t\t\t\t</TabsContent>\n\t\t\t\t<TabsContent value=\"stats\" className=\"mt-0\">\n\t\t\t\t\t{statsContent}\n\t\t\t\t</TabsContent>\n\t\t\t</Tabs>\n\t\t) : activeView === 'stats' ? (\n\t\t\tstatsContent\n\t\t) : (\n\t\t\toverviewContent\n\t\t);\n\n\t\treturn (\n\t\t\t<Card\n\t\t\t\tref={ref}\n\t\t\t\tsurface={surface}\n\t\t\t\t// Embedded flat, the surrounding surface owns the inset, as with the\n\t\t\t\t// other commerce subjects; the region rhythm stays the same.\n\t\t\t\tpadding={surface === 'flat' ? 'none' : 'md'}\n\t\t\t\tgap=\"xl\"\n\t\t\t\theaderStart={\n\t\t\t\t\t<Item className=\"vendor-profile--identity flex-nowrap py-0\">\n\t\t\t\t\t\t<ItemMedia variant=\"avatar\">\n\t\t\t\t\t\t\t<Avatar>\n\t\t\t\t\t\t\t\t{!!avatarUrl && <AvatarImage src={avatarUrl} alt={name} />}\n\t\t\t\t\t\t\t\t<AvatarFallback>\n\t\t\t\t\t\t\t\t\t{initials ?? <Initials value={name} strategy=\"first-words\" />}\n\t\t\t\t\t\t\t\t</AvatarFallback>\n\t\t\t\t\t\t\t</Avatar>\n\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t<ItemContent>\n\t\t\t\t\t\t\t{/* Verification is the name's status, so it sits beside it. */}\n\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap={false} className=\"min-w-0\">\n\t\t\t\t\t\t\t\t<ItemTitle className=\"min-w-0 truncate\">{name}</ItemTitle>\n\t\t\t\t\t\t\t\t{!!verified && (\n\t\t\t\t\t\t\t\t\t<Badge tone=\"success\" className=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t\t{strings.verifiedAriaLabel}\n\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t{!!role && <ItemDescription clamp={2}>{role}</ItemDescription>}\n\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t</Item>\n\t\t\t\t}\n\t\t\t\tfooterSlot={\n\t\t\t\t\thasActions ? (\n\t\t\t\t\t\t<div className=\"vendor-profile--actions flex flex-wrap gap-space-sm\">\n\t\t\t\t\t\t\t{!!onMessage && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\t\t\tclassName=\"min-w-0 flex-1\"\n\t\t\t\t\t\t\t\t\tonClick={onMessage}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{strings.message}\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{!!onHire && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\ttone=\"primary\"\n\t\t\t\t\t\t\t\t\tclassName=\"min-w-0 flex-1\"\n\t\t\t\t\t\t\t\t\tonClick={onHire}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{strings.hire}\n\t\t\t\t\t\t\t\t\t<ChevronRight className=\"size-icon-sm\" aria-hidden=\"true\" />\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : undefined\n\t\t\t\t}\n\t\t\t\tcontentClassName={cn(!hasBody && 'hidden')}\n\t\t\t\tclassName={cn('vendor-profile--component', className)}\n\t\t\t>\n\t\t\t\t{hasBody ? profileBody : null}\n\t\t\t</Card>\n\t\t);\n\t},\n);\n\nVendorProfileCard.displayName = 'VendorProfileCard';\n","export interface InventoryLevelStrings {\n\tstatusInStock: string;\n\tstatusLowStock: string;\n\tstatusCritical: string;\n\tvariantLabel: string;\n\tunitsAvailable: string;\n\treorderAtLabel: string;\n\tlastRestockedLabel: string;\n}\n\nexport const defaultInventoryLevelStrings: InventoryLevelStrings = {\n\tstatusInStock: 'In stock',\n\tstatusLowStock: 'Low stock',\n\tstatusCritical: 'Critical',\n\tvariantLabel: 'Variant',\n\tunitsAvailable: 'units available',\n\treorderAtLabel: 'Reorder at',\n\tlastRestockedLabel: 'Last restocked',\n};\n","/**\n * InventoryLevel — single-product inventory snapshot with stock total,\n * reorder threshold, and a status pill (Critical / Low stock / In stock).\n *\n * Status thresholds are computed from `stock`, `reorderLevel`, and the\n * critical threshold (50% of `reorderLevel`). Status pill labels flow via\n * the `strings` prop so consumers can localise without forking the file.\n */\nimport { Badge } from '../../../base/badge';\nimport { Stack } from '../../../base/structure';\nimport { Number as NumberValue, SecondaryValue } from '../../../primitives';\nimport { Text } from '../../../typography/text';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultInventoryLevelStrings } from './inventory-level.strings';\nimport type { InventoryLevelProps } from './types';\n\nexport function InventoryLevel({\n\tproductName,\n\tvariant,\n\tstock,\n\treorderLevel,\n\tmaxStock,\n\tlastRestocked,\n\tclassName,\n\tstrings: stringsProp,\n}: InventoryLevelProps) {\n\tconst strings = useStrings(defaultInventoryLevelStrings, stringsProp);\n\tconst pct = Math.round((stock / maxStock) * 100);\n\tconst isLow = stock <= reorderLevel;\n\tconst isCritical = stock <= reorderLevel * 0.5;\n\n\tconst badgeTone = isCritical ? 'destructive' : isLow ? 'warning' : 'success';\n\tconst badgeLabel = isCritical\n\t\t? strings.statusCritical\n\t\t: isLow\n\t\t\t? strings.statusLowStock\n\t\t\t: strings.statusInStock;\n\n\t// Three groups — product, stock figure, gauge — spaced by one parent gap.\n\t// The status chip belongs to the product name, so it sits beside it.\n\treturn (\n\t\t<Stack\n\t\t\tdata-component=\"inventory-level\"\n\t\t\tdata-slot=\"inventory-level\"\n\t\t\tgap=\"xl\"\n\t\t\tclassName={cn('inventory-level--component', className)}\n\t\t>\n\t\t\t<Stack gap=\"dense\" className=\"inventory-level--product\">\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap={false} className=\"min-w-0\">\n\t\t\t\t\t<Text weight=\"semibold\" className=\"min-w-0 truncate\">\n\t\t\t\t\t\t{productName}\n\t\t\t\t\t</Text>\n\t\t\t\t\t<Badge tone={badgeTone} className=\"shrink-0\">{badgeLabel}</Badge>\n\t\t\t\t</Stack>\n\t\t\t\t{!!variant && (\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"truncate\">\n\t\t\t\t\t\t{`${strings.variantLabel}: ${variant}`}\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t</Stack>\n\n\t\t\t<Stack gap=\"dense\" className=\"inventory-level--stock\">\n\t\t\t\t<NumberValue value={stock} weight=\"semibold\" align=\"left\" className=\"tracking-tight\" />\n\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t{strings.unitsAvailable}\n\t\t\t\t</Text>\n\t\t\t</Stack>\n\n\t\t\t<Stack gap=\"md\" className=\"inventory-level--gauge\">\n\t\t\t\t<div className=\"h-1.5 overflow-hidden rounded-full bg-muted\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'h-full rounded-full transition-all',\n\t\t\t\t\t\t\tisCritical ? 'bg-destructive' : isLow ? 'bg-warning' : 'bg-success',\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tstyle={{ width: `${pct}%` }}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"flex items-center justify-between\">\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{strings.reorderAtLabel}: <NumberValue value={reorderLevel} weight=\"medium\" align=\"left\" />\n\t\t\t\t\t</Text>\n\t\t\t\t\t{!!lastRestocked && (\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t{strings.lastRestockedLabel}: <SecondaryValue size=\"xs\">{lastRestocked}</SecondaryValue>\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Stack>\n\t\t</Stack>\n\t);\n}\n\nInventoryLevel.displayName = 'InventoryLevel';\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface TaxLineItem {\n\t/** Stable identity for this entry. */\n\tid?: string;\n\t/** Display label. */\n\tlabel: string;\n\trate?: string;\n\tamount: string;\n}\n\nexport interface TaxBreakdownStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Formatted amount before tax. */\n\tsubtotal: string;\n\t/** Formatted sum of every tax line. */\n\ttotalTax: string;\n\t/** Formatted grand total, including tax. */\n\ttotal: string;\n}\n\nexport const defaultTaxBreakdownStrings: TaxBreakdownStrings = {\n\ttitle: 'Tax breakdown',\n\tsubtotal: 'Subtotal',\n\ttotalTax: 'Total tax',\n\ttotal: 'Total',\n};\n\nexport interface TaxBreakdownCardProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'> {\n\t/** Formatted amount before tax. */\n\tsubtotal: string;\n\t/** Individual tax lines making up the total. */\n\ttaxes: TaxLineItem[];\n\t/** Formatted sum of every tax line. */\n\ttotalTax?: string;\n\t/** Formatted grand total, including tax. */\n\ttotal: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<TaxBreakdownStrings>;\n}\n","/**\n * TaxBreakdownCard — itemised tax breakdown for an order or invoice: a\n * subtotal, one row per tax line with its rate beside the amount, an optional\n * \"Total tax\" rollup, and the final total. Drawn on the shared commerce\n * ledger (`SummaryPanel` + `AmountRow`), so it emphasises its total the same\n * way `CartSummaryCard` does. Pairs with `CartSummaryCard` when consumers\n * need to expose VAT / regional tax detail. Strings overridable for i18n.\n */\nimport { Card } from '../../../base/cards';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { AmountRow, SummaryPanel } from '../summary-panel';\nimport { defaultTaxBreakdownStrings, type TaxBreakdownCardProps } from './types';\n\nexport function TaxBreakdownCard({\n\tsubtotal,\n\ttaxes,\n\ttotalTax,\n\ttotal,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: TaxBreakdownCardProps) {\n\tconst strings = useStrings(defaultTaxBreakdownStrings, stringsProp);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface=\"flat\"\n\t\t\tpadding=\"none\"\n\t\t\ttitle={strings.title}\n\t\t\tdata-slot=\"tax-breakdown\"\n\t\t\tclassName={cn('tax-breakdown--component w-full', className)}\n\t\t>\n\t\t\t<SummaryPanel className=\"tax-breakdown--ledger\">\n\t\t\t\t<AmountRow label={strings.subtotal} amount={subtotal} />\n\t\t\t\t{taxes.map((tax, index) => (\n\t\t\t\t\t<AmountRow\n\t\t\t\t\t\tkey={tax.id ?? `${tax.label}-${index}`}\n\t\t\t\t\t\tclassName=\"tax-breakdown--line\"\n\t\t\t\t\t\tlabel={tax.label}\n\t\t\t\t\t\tnote={tax.rate}\n\t\t\t\t\t\tamount={tax.amount}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t\t{/* One tax line is the total tax; a rollup under it would restate the row above. */}\n\t\t\t\t{!!totalTax && taxes.length > 1 && (\n\t\t\t\t\t<AmountRow label={strings.totalTax} amount={totalTax} />\n\t\t\t\t)}\n\t\t\t\t<AmountRow label={strings.total} amount={total} total rollup />\n\t\t\t</SummaryPanel>\n\t\t</Card>\n\t);\n}\n\nTaxBreakdownCard.displayName = 'TaxBreakdownCard';\n","import type { LucideIcon } from 'lucide-react';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface SubscriptionPerk {\n\t/** Leading glyph. */\n\ticon?: LucideIcon;\n\t/** Display label. */\n\tlabel: string;\n}\n\nexport interface SubscriptionSummaryStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tplan: string;\n\tnextBilling: string;\n\t/** Benefits included in the plan. */\n\tperks: string;\n\tmanage: string;\n\tupgrade: string;\n}\n\nexport const defaultSubscriptionSummaryStrings: SubscriptionSummaryStrings = {\n\ttitle: 'Subscription',\n\tplan: 'Plan',\n\tnextBilling: 'Next billing',\n\tperks: 'Included',\n\tmanage: 'Manage',\n\tupgrade: 'Upgrade',\n};\n\nexport interface SubscriptionSummaryCardProps {\n\t/** Name of the subscribed plan. */\n\tplanName: string;\n\t/** Formatted recurring price. */\n\tpriceLabel: string;\n\t/** Billing interval, e.g. monthly or yearly. */\n\tcycleLabel: string;\n\t/** Formatted date of the next charge. */\n\tnextBillingDate: string;\n\t/** Current subscription state. */\n\tstatusLabel?: string;\n\t/** Benefits included in the plan. */\n\tperks?: SubscriptionPerk[];\n\tonManage?: () => void;\n\tonUpgrade?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<SubscriptionSummaryStrings>;\n}\n","/**\n * SubscriptionSummaryCard — at-a-glance subscription card with the active\n * plan name as the hero heading, an inline price + cycle, the next billing\n * date in a meta row, an optional perks list, and trailing\n * Manage / Upgrade actions. Strings overridable for i18n.\n */\nimport { ChevronRight } from 'lucide-react';\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { ContentBlock } from '../../../base/display';\nimport {\n\tItem,\n\tItemContent,\n\tItemGroup,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { Stack } from '../../../base/structure';\nimport { Value } from '../../../primitives';\nimport { Heading } from '../../../typography/heading';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { InlineStat } from '../../data-display';\nimport { useStrings } from '../../../../lib/strings';\n\nimport {\n\tdefaultSubscriptionSummaryStrings,\n\ttype SubscriptionSummaryCardProps,\n} from './types';\n\nimport { cn } from '../../../../lib/utils';\nexport function SubscriptionSummaryCard({\n\tplanName,\n\tpriceLabel,\n\tcycleLabel,\n\tnextBillingDate,\n\tstatusLabel,\n\tperks = [],\n\tonManage,\n\tonUpgrade,\n\tclassName,\n\tstrings: stringsProp,\n}: SubscriptionSummaryCardProps) {\n\tconst strings = useStrings(defaultSubscriptionSummaryStrings, stringsProp);\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={statusLabel ? <Badge tone=\"success\">{statusLabel}</Badge> : null}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tclassName={cn('subscription-summary--component w-full', className)}\n\t\t>\n\t\t\t{/* Plan identity left, price right, then the next charge as the same\n\t\t\t label/value row the other commerce summaries use. Spacing alone\n\t\t\t groups them; no inset panel. */}\n\t\t\t<Stack gap=\"lg\" className=\"subscription-summary--plan\">\n\t\t\t\t<Stack direction=\"horizontal\" justify=\"between\" align=\"end\" gap=\"lg\">\n\t\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0\">\n\t\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t\t{strings.plan}\n\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t<Heading tag=\"h3\" className=\"text-base font-semibold tracking-tight border-none pb-0\">\n\t\t\t\t\t\t\t{planName}\n\t\t\t\t\t\t</Heading>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"baseline\" gap=\"xs\" className=\"shrink-0\">\n\t\t\t\t\t\t<Value weight=\"bold\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t{priceLabel}\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t<Text type=\"secondary\">\n\t\t\t\t\t\t\t{cycleLabel}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Stack>\n\t\t\t\t</Stack>\n\t\t\t\t<InlineStat\n\t\t\t\t\tlabel={strings.nextBilling}\n\t\t\t\t\tvalue={nextBillingDate}\n\t\t\t\t\tvalueClassName=\"font-semibold tabular-nums\"\n\t\t\t\t/>\n\t\t\t</Stack>\n\n\t\t\t{perks.length > 0 && (\n\t\t\t\t<Stack gap=\"md\" className=\"subscription-summary--perks\">\n\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t{strings.perks}\n\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t{perks.map((perk, i) => {\n\t\t\t\t\t\t\t// A consumer-supplied glyph renders plainly; no default glyph\n\t\t\t\t\t\t\t// repeats down the list and no colour suggests a state.\n\t\t\t\t\t\t\tconst Icon = perk.icon;\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Item key={`${perk.label}-${i}`} size=\"sm\" density=\"compact\">\n\t\t\t\t\t\t\t\t\t{!!Icon && (\n\t\t\t\t\t\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t\t\t\t\t\t<Icon aria-hidden=\"true\" className=\"size-icon text-muted-foreground\" />\n\t\t\t\t\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t<ItemContent>\n\t\t\t\t\t\t\t\t\t\t<ItemTitle bold={false}>{perk.label}</ItemTitle>\n\t\t\t\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{(onManage || onUpgrade) && (\n\t\t\t\t<div className=\"flex items-center gap-space-md\">\n\t\t\t\t\t{!!onManage && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\tonClick={onManage}\n\t\t\t\t\t\t\tclassName=\"flex-1\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.manage}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!onUpgrade && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttone=\"primary\"\n\t\t\t\t\t\t\tonClick={onUpgrade}\n\t\t\t\t\t\t\tclassName=\"flex-1\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.upgrade}\n\t\t\t\t\t\t\t<ChevronRight className=\"ml-1 size-icon-md\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</ContentBlock>\n\t);\n}\n\nSubscriptionSummaryCard.displayName = 'SubscriptionSummaryCard';\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type RefundStage = 'requested' | 'approved' | 'processing' | 'completed';\n\nexport interface RefundStatusStrings {\n\t/** Surface title. */\n\ttitle: string;\n\trequested: string;\n\tapproved: string;\n\tprocessing: string;\n\tcompleted: string;\n\t/** Formatted refund amount. */\n\tamount: string;\n\t/** Why the refund was requested. */\n\treason: string;\n\t/** Formatted estimate for the funds landing. */\n\teta: string;\n\t/** Where the money is being returned to. */\n\tmethod: string;\n}\n\nexport const defaultRefundStatusStrings: RefundStatusStrings = {\n\ttitle: 'Refund status',\n\trequested: 'Requested',\n\tapproved: 'Approved',\n\tprocessing: 'Processing',\n\tcompleted: 'Completed',\n\tamount: 'Refund amount',\n\treason: 'Reason',\n\teta: 'Expected by',\n\tmethod: 'Refund to',\n};\n\nexport interface RefundStatusCardProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'> {\n\t/** How far the refund has progressed. */\n\tstage: RefundStage;\n\t/** Formatted refund amount. */\n\tamount: string;\n\t/** Why the refund was requested. */\n\treason?: ReactNode;\n\t/** Where the money is being returned to. */\n\tmethod?: ReactNode;\n\t/** Formatted estimate for the funds landing. */\n\teta?: string;\n\t/** Formatted date the refund was raised. */\n\trequestedAt?: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<RefundStatusStrings>;\n}\n\n/** The source kit's name for `RefundStatusCardProps`. */\nexport type RefundStatusProps = RefundStatusCardProps;\n","/**\n * RefundStatusCard — refund-flow tracker. Shows the four canonical refund\n * stages (Requested → Approved → Processing → Completed) as an ordered list\n * whose current stage carries `aria-current=\"step\"`, so the position is\n * announced independently of its colour. The refund amount leads as the\n * ledger's total row, with an optional reason / method / ETA detail block.\n * Strings overridable for i18n.\n *\n * `RefundStatus` is the same component under the source kit's name.\n */\nimport { Check } from 'lucide-react';\n\nimport { Card } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport { Number as NumberValue, SecondaryValue } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { InlineStat } from '../../data-display';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\n\nimport { AmountRow } from '../summary-panel';\nimport {\n\tdefaultRefundStatusStrings,\n\ttype RefundStage,\n\ttype RefundStatusCardProps,\n} from './types';\n\nconst STAGE_ORDER: RefundStage[] = ['requested', 'approved', 'processing', 'completed'];\n\nfunction hasContent(value: unknown) {\n\treturn value !== undefined && value !== null && value !== false && value !== '';\n}\n\nexport function RefundStatusCard({\n\tstage,\n\tamount,\n\treason,\n\tmethod,\n\teta,\n\trequestedAt,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: RefundStatusCardProps) {\n\tconst strings = useStrings(defaultRefundStatusStrings, stringsProp);\n\tconst currentIdx = STAGE_ORDER.indexOf(stage);\n\tconst hasFacts = hasContent(reason) || hasContent(method) || hasContent(eta);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface=\"flat\"\n\t\t\tpadding=\"none\"\n\t\t\ttitle={strings.title}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tdata-slot=\"refund-status\"\n\t\t\tclassName={cn('refund-status--component w-full', className)}\n\t\t>\n\t\t\t{/* Amount, stages and details are separated by the content gap alone:\n\t\t\t no inset panel around the amount and no rule above the details. */}\n\t\t\t<Stack gap=\"dense\">\n\t\t\t\t<AmountRow label={strings.amount} amount={amount} total className=\"refund-status--amount\" />\n\t\t\t\t{!!requestedAt && (\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{strings.requested}: <SecondaryValue size=\"xs\">{requestedAt}</SecondaryValue>\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t</Stack>\n\n\t\t\t{/* The stages happen in sequence, so they are an ordered list. */}\n\t\t\t<ol className=\"refund-status--stages m-0 flex list-none items-start p-0\">\n\t\t\t\t{STAGE_ORDER.map((s, i) => {\n\t\t\t\t\tconst done = i <= currentIdx;\n\t\t\t\t\tconst current = i === currentIdx;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t// The dot leads its column and the connector fills the rest, so\n\t\t\t\t\t\t// the node sits at the column's left edge; the label starts there too.\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tkey={s}\n\t\t\t\t\t\t\tdata-reached={done ? '' : undefined}\n\t\t\t\t\t\t\tdata-current={current ? '' : undefined}\n\t\t\t\t\t\t\taria-current={current ? 'step' : undefined}\n\t\t\t\t\t\t\tclassName=\"refund-status--stage flex min-w-0 flex-1 flex-col items-start gap-space-sm\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div aria-hidden=\"true\" className=\"flex w-full items-center\">\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t'relative flex size-icon-lg shrink-0 items-center justify-center rounded-full',\n\t\t\t\t\t\t\t\t\t\tdone\n\t\t\t\t\t\t\t\t\t\t\t? 'bg-success text-success-foreground'\n\t\t\t\t\t\t\t\t\t\t\t: 'border border-border bg-card text-muted-foreground',\n\t\t\t\t\t\t\t\t\t\t// The current stage carries the shared halo; an offset ring would paint the\n\t\t\t\t\t\t\t\t\t\t// page background inside a card.\n\t\t\t\t\t\t\t\t\t\tcurrent && cn('ring-4', toneRecipes.success.halo),\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{done ? (\n\t\t\t\t\t\t\t\t\t\t<Check className=\"size-icon-sm\" />\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<NumberValue value={i + 1} size=\"xs\" weight=\"medium\" align=\"center\" />\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{i < STAGE_ORDER.length - 1 && (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t'h-0.5 flex-1',\n\t\t\t\t\t\t\t\t\t\t\ti < currentIdx ? 'bg-success' : 'bg-border',\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\tweight={current ? 'semibold' : 'medium'}\n\t\t\t\t\t\t\t\ttype={done ? 'main' : 'secondary'}\n\t\t\t\t\t\t\t\tclassName=\"refund-status--stage-label text-left leading-tight\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{strings[s]}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ol>\n\n\t\t\t{!!hasFacts && (\n\t\t\t\t<Stack gap=\"md\" className=\"refund-status--facts\">\n\t\t\t\t\t{hasContent(reason) && (\n\t\t\t\t\t\t<InlineStat label={strings.reason} value={reason} className=\"items-start\" valueClassName=\"text-sm font-medium text-right\" />\n\t\t\t\t\t)}\n\t\t\t\t\t{hasContent(method) && (\n\t\t\t\t\t\t<InlineStat label={strings.method} value={method} valueClassName=\"text-sm font-medium\" />\n\t\t\t\t\t)}\n\t\t\t\t\t{hasContent(eta) && (\n\t\t\t\t\t\t<InlineStat label={strings.eta} value={eta} valueClassName=\"text-sm font-medium tabular-nums\" />\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nRefundStatusCard.displayName = 'RefundStatusCard';\n\n/** The source kit's name for `RefundStatusCard`; the same component. */\nexport const RefundStatus = RefundStatusCard;\n","/**\n * AddressLines — the postal block shared by `AddressCard` and `OrderCustomer`.\n *\n * A real `<address>` (with the browser's italic reset), so assistive technology\n * hears contact information rather than loose lines. The recipient leads, the\n * street lines and the city line follow in the main role, and the country\n * recedes; the city line joins only the parts that exist. A phone number, when\n * the address carries one, closes the block as a `Phone` link.\n *\n * Internal to the commerce family: it is the address anatomy, not a public\n * component.\n */\nimport type { ComponentPropsWithoutRef } from 'react';\n\nimport { Stack } from '../../../base/structure';\nimport { Phone } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport type { OrderAddress } from './order-status';\n\nexport interface AddressLinesProps extends Omit<ComponentPropsWithoutRef<'address'>, 'children'> {\n\t/** The address to render. */\n\taddress: OrderAddress;\n\t/** Sets the recipient in semibold, for a surface that leads on the name. */\n\tprominent?: boolean;\n}\n\nexport function AddressLines({ address, prominent = false, className, ...props }: AddressLinesProps) {\n\tconst cityLine = [address.city, address.region, address.postalCode].filter(Boolean).join(', ');\n\n\treturn (\n\t\t<Stack\n\t\t\tgap=\"2xs\"\n\t\t\trender={<address {...props} />}\n\t\t\tclassName={cn('address-lines--component not-italic', className)}\n\t\t>\n\t\t\t{!!address.name && <Text weight={prominent ? 'semibold' : 'regular'}>{address.name}</Text>}\n\t\t\t<Text>{address.line1}</Text>\n\t\t\t{!!address.line2 && <Text>{address.line2}</Text>}\n\t\t\t{!!cityLine && <Text>{cityLine}</Text>}\n\t\t\t<Text type=\"secondary\">{address.country}</Text>\n\t\t\t{!!address.phone && <Phone value={address.phone} className=\"self-start\" />}\n\t\t</Stack>\n\t);\n}\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type AddressKind = 'shipping' | 'billing' | 'pickup';\n\nexport interface AddressCardStrings {\n\tdefaultBadge: string;\n\tedit: string;\n\tremove: string;\n\tmakeDefault: string;\n\tshipping: string;\n\tbilling: string;\n\tpickup: string;\n}\n\nexport const defaultAddressCardStrings: AddressCardStrings = {\n\tdefaultBadge: 'Default',\n\tedit: 'Edit',\n\tremove: 'Remove',\n\tmakeDefault: 'Make default',\n\tshipping: 'Shipping address',\n\tbilling: 'Billing address',\n\tpickup: 'Pickup address',\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface AddressCardProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** What the address is for — billing, shipping, or both. */\n\tkind?: AddressKind;\n\t/** Display name. */\n\tname: string;\n\t/** Street address. */\n\tline1: string;\n\t/** Apartment, suite, or unit. */\n\tline2?: string;\n\t/** City or town. */\n\tcity: string;\n\t/** State, province, or region. */\n\tregion?: string;\n\t/** Postal or ZIP code. */\n\tpostalCode?: string;\n\t/** Country name or code. */\n\tcountry: string;\n\t/** Contact number for the delivery. */\n\tphone?: string;\n\t/** Marks this as the account's default address. */\n\tdefault?: boolean;\n\t/** Fired when an entry is edited. */\n\tonEdit?: () => void;\n\t/** Fired when an entry is removed. */\n\tonRemove?: () => void;\n\tonMakeDefault?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AddressCardStrings>;\n}\n","/**\n * AddressCard — saved postal address surface. Title varies by `kind`\n * (shipping / billing / pickup); shows recipient name, address lines, phone,\n * and a \"Default\" badge when applicable. The lines are the shared commerce\n * `<address>` block, so they read the same here as in `OrderCustomer`.\n *\n * Edit / remove / make-default actions ride through the centralized action\n * menu instead of inline footer buttons.\n */\nimport { Edit2, Star, Trash2 } from 'lucide-react';\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport type { ActionMenuAction } from '../../../base/action-menu';\nimport { Phone } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\n\nimport { AddressLines } from '../shared/address-lines';\nimport {\n\tdefaultAddressCardStrings,\n\ttype AddressCardProps,\n\ttype AddressKind,\n} from './types';\n\nimport { cn } from '../../../../lib/utils';\nexport function AddressCard({\n\tkind = 'shipping',\n\tname,\n\tline1,\n\tline2,\n\tcity,\n\tregion,\n\tpostalCode,\n\tcountry,\n\tphone,\n\tdefault: defaultAddress = false,\n\tonEdit,\n\tonRemove,\n\tonMakeDefault,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider = surface === 'flat' ? false : undefined,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: AddressCardProps) {\n\tconst strings = useStrings(defaultAddressCardStrings, stringsProp);\n\tconst titleByKind: Record<AddressKind, string> = {\n\t\tshipping: strings.shipping,\n\t\tbilling: strings.billing,\n\t\tpickup: strings.pickup,\n\t};\n\n\tconst actions: ActionMenuAction[] = [];\n\tif (onEdit) {\n\t\tactions.push({\n\t\t\tid: 'edit',\n\t\t\tlabel: strings.edit,\n\t\t\ticon: <Edit2 className=\"size-icon-md\" />,\n\t\t\tonClick: onEdit,\n\t\t});\n\t}\n\tif (onMakeDefault && !defaultAddress) {\n\t\tactions.push({\n\t\t\tid: 'make-default',\n\t\t\tlabel: strings.makeDefault,\n\t\t\ticon: <Star className=\"size-icon-md\" />,\n\t\t\tonClick: onMakeDefault,\n\t\t});\n\t}\n\tif (onRemove) {\n\t\tactions.push({\n\t\t\tid: 'remove',\n\t\t\tlabel: strings.remove,\n\t\t\ticon: <Trash2 className=\"size-icon-md\" />,\n\t\t\tonClick: onRemove,\n\t\t});\n\t}\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={titleByKind[kind]}\n\t\t\ttitleSuffix={\n\t\t\t\tdefaultAddress ? <Badge tone=\"neutral\">{strings.defaultBadge}</Badge> : null\n\t\t\t}\n\t\t\tactions={actions.length > 0 ? actions : undefined}\n\t\t\tclassName={cn('address-card--component w-full', className)}\n\t\t>\n\t\t\t{/* The phone is contact detail, not an address line: the outer gap\n\t\t\t separates the two groups, and the number keeps the size of the\n\t\t\t lines it sits under. */}\n\t\t\t<Stack gap=\"md\">\n\t\t\t\t<AddressLines\n\t\t\t\t\taddress={{ name, line1, line2, city, region, postalCode, country }}\n\t\t\t\t\tprominent\n\t\t\t\t/>\n\t\t\t\t{!!phone && (\n\t\t\t\t\t<Phone\n\t\t\t\t\t\tvalue={phone}\n\t\t\t\t\t\tdisplay={<Text tag=\"span\">{phone}</Text>}\n\t\t\t\t\t\tclassName=\"self-start\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\nAddressCard.displayName = 'AddressCard';\n","import type { StringsProp } from '../../../../lib/strings';\n\nexport interface VoucherEntryStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tinputLabel: string;\n\tplaceholder: string;\n\thelperText: string;\n\tcheck: string;\n\tremove: string;\n\t/** Formatted remaining value on the voucher. */\n\tbalance: string;\n\tapplied: string;\n\tnotFound: string;\n}\n\nexport const defaultVoucherEntryStrings: VoucherEntryStrings = {\n\ttitle: 'Redeem a gift card',\n\tinputLabel: 'Gift card code',\n\tplaceholder: 'Enter gift card code',\n\thelperText: 'Apply one gift card or voucher to this order.',\n\tcheck: 'Check balance',\n\tremove: 'Remove',\n\tbalance: 'Available balance',\n\tapplied: 'Applied',\n\tnotFound: 'That gift card code is not valid.',\n};\n\nexport interface VoucherEntryProps {\n\t/** Voucher currently applied, if any. */\n\tappliedCode?: string;\n\t/** Formatted remaining value on the voucher. */\n\tbalance?: string;\n\t/** Validation message for a rejected code. */\n\terror?: string;\n\t/** Whether a code is being checked. */\n\tloading?: boolean;\n\t/** Fired with the trimmed, upper-cased code when the form is submitted. */\n\tonCheck?: (code: string) => void;\n\t/** Fired when an entry is removed. */\n\tonRemove?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<VoucherEntryStrings>;\n}\n","/**\n * VoucherEntry — gift-card / voucher redemption entry.\n *\n * Empty state — code input + check button, helper line surfacing errors.\n * Applied state — the same success-tinted row as CouponInputCard: check\n * medallion, code, balance amount, and a remove control.\n *\n * The component owns the input's draft state and nothing else. Submitting the\n * form — by the check button or by Enter — calls `onCheck(code)` with the\n * trimmed, upper-cased code; the consumer looks it up and drives the applied\n * state back in through `appliedCode`, `balance`, `error`, and `loading`.\n * `onRemove` clears an applied voucher.\n */\nimport {\n\ttype FormEvent,\n\tuseId,\n\tuseState } from 'react';\nimport { Check, X } from 'lucide-react';\nimport { Button } from '../../../base/buttons';\nimport { ContentBlock } from '../../../base/display';\nimport { IconBadge,\n} from '../../../base/display';\nimport { FormField } from '../../../base/forms';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { Input } from '../../../base/text-inputs';\nimport { MonoValue, Value } from '../../../primitives';\nimport { DisplayLabel } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\n\nimport { defaultVoucherEntryStrings, type VoucherEntryProps } from './types';\n\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\nconst normalizeCode = (value: string): string => value.toUpperCase();\n\nexport function VoucherEntry({\n\tappliedCode,\n\tbalance,\n\terror,\n\tloading,\n\tonCheck,\n\tonRemove,\n\tclassName,\n\tstrings: stringsProp,\n}: VoucherEntryProps) {\n\tconst strings = useStrings(defaultVoucherEntryStrings, stringsProp);\n\tconst inputId = useId();\n\tconst [code, setCode] = useState('');\n\tconst trimmedCode = code.trim();\n\tconst handleSubmit = (event: FormEvent<HTMLFormElement>) => {\n\t\tevent.preventDefault();\n\t\tif (!trimmedCode) return;\n\t\tonCheck?.(trimmedCode);\n\t};\n\n\tif (appliedCode) {\n\t\t// Same applied row as CouponInputCard: the check, the code and the\n\t\t// amount share one line, with no inner rule. The balance is a plain\n\t\t// amount, not a signed delta, so it stays in the foreground colour.\n\t\treturn (\n\t\t\t<ContentBlock\n\t\t\t\ttitle={strings.title}\n\t\t\t\tclassName={cn('voucher-entry--component w-full', className)}\n\t\t\t>\n\t\t\t\t<Item size=\"sm\" variant=\"muted\" className={cn('items-center gap-y-space-sm border', toneRecipes.success.edge, toneRecipes.success.wash)}>\n\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t<IconBadge icon={Check} tone=\"success\" size=\"md\" />\n\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t{/* A code never truncates: the label wraps under it, and below the\n\t\t\t\t\t content basis the amount and remove control drop to their own line. */}\n\t\t\t\t\t<ItemContent className=\"min-w-0 basis-48\">\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"sm\" className=\"min-w-0\">\n\t\t\t\t\t\t\t<ItemTitle className=\"max-w-full\">\n\t\t\t\t\t\t\t\t<MonoValue className=\"tracking-wider\">{appliedCode}</MonoValue>\n\t\t\t\t\t\t\t</ItemTitle>\n\t\t\t\t\t\t\t<DisplayLabel className=\"shrink-0\">\n\t\t\t\t\t\t\t\t{strings.applied}\n\t\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t{!!balance && <ItemDescription clamp={1}>{strings.balance}</ItemDescription>}\n\t\t\t\t\t</ItemContent>\n\t\t\t\t\t<ItemActions className=\"ml-auto shrink-0 gap-space-sm\">\n\t\t\t\t\t\t{!!balance && (\n\t\t\t\t\t\t\t<Value weight=\"semibold\" className=\"shrink-0 tabular-nums\">\n\t\t\t\t\t\t\t\t{balance}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!onRemove && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\ttone=\"destructive\"\n\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\tonClick={onRemove}\n\t\t\t\t\t\t\t\taria-label={strings.remove}\n\t\t\t\t\t\t\t\tclassName=\"size-action-xs shrink-0 text-muted-foreground hover:text-destructive\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<X className=\"size-icon-sm\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ItemActions>\n\t\t\t\t</Item>\n\t\t\t</ContentBlock>\n\t\t);\n\t}\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ttitle={strings.title}\n\t\t\tclassName={cn('voucher-entry--component w-full', className)}\n\t\t>\n\t\t\t<form onSubmit={handleSubmit}>\n\t\t\t\t<FormField\n\t\t\t\t\tlabel={strings.inputLabel}\n\t\t\t\t\thtmlFor={inputId}\n\t\t\t\t\terror={error}\n\t\t\t\t\thint={error ? undefined : strings.helperText}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"flex flex-wrap gap-space-md\">\n\t\t\t\t\t\t<div className=\"min-w-48 flex-1\">\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tid={inputId}\n\t\t\t\t\t\t\t\tvalue={code}\n\t\t\t\t\t\t\t\tonChange={(e) => setCode(normalizeCode((e.target as HTMLInputElement).value))}\n\t\t\t\t\t\t\t\tplaceholder={strings.placeholder}\n\t\t\t\t\t\t\t\tautoCapitalize=\"characters\"\n\t\t\t\t\t\t\t\tspellCheck={false}\n\t\t\t\t\t\t\t\tclassName=\"font-mono\"\n\t\t\t\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Button tone=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\t\tdisabled={!trimmedCode}\n\t\t\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.check}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</FormField>\n\t\t\t</form>\n\t\t</ContentBlock>\n\t);\n}\n\nVoucherEntry.displayName = 'VoucherEntry';\n","/**\n * LineThumbnail — the picture of an ordered or carted line.\n *\n * Renders the image while it loads; when it fails, or when there is none, the\n * line's initials stand in on a neutral tile so the row keeps its shape. A new\n * `src` is tried again: the failure is remembered per source, not per mount.\n *\n * Internal to the commerce family; the caller supplies the media frame\n * (`ItemMedia variant=\"image\"`).\n */\nimport { useState } from 'react';\n\nimport { Initials } from '../../../primitives';\n\nexport interface LineThumbnailProps {\n\t/** Image source. Optional: without one the initials show. */\n\tsrc?: string;\n\t/** Alternative text. Defaults to `title`. */\n\talt?: string;\n\t/** The line's name, used for the initials and as the default alt text. */\n\ttitle: string;\n}\n\nfunction LineThumbnailPlaceholder({ title }: { title: string }) {\n\treturn (\n\t\t<div\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName=\"line-thumbnail--placeholder flex size-full items-center justify-center rounded-[inherit] bg-muted ring-1 ring-border/60\"\n\t\t>\n\t\t\t<Initials\n\t\t\t\tvalue={title}\n\t\t\t\tstrategy=\"first-words\"\n\t\t\t\tfallback={title.trim().slice(0, 2).toUpperCase()}\n\t\t\t\tsize=\"xs\"\n\t\t\t\tweight=\"semibold\"\n\t\t\t\ttype=\"secondary\"\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport function LineThumbnail({ src, alt, title }: LineThumbnailProps) {\n\tconst [failedSrc, setFailedSrc] = useState<string | undefined>(undefined);\n\tconst source = src?.trim() ? src : undefined;\n\n\tif (!source || failedSrc === source) return <LineThumbnailPlaceholder title={title} />;\n\n\treturn (\n\t\t<img\n\t\t\tsrc={source}\n\t\t\talt={alt ?? title}\n\t\t\tclassName=\"line-thumbnail--image\"\n\t\t\tonError={() => setFailedSrc(source)}\n\t\t/>\n\t);\n}\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface CartLineItem {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Display name. */\n\tname?: string;\n\tproductTitle?: string;\n\t/** Surface title. */\n\ttitle?: string;\n\tvariantTitle?: string;\n\tqty: number;\n\tprice: string;\n\timageUrl?: string;\n\timageSrc?: string;\n\tsrc?: string;\n\turl?: string;\n\timageAlt?: string;\n}\n\nexport interface CartSummaryStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Formatted total before tax, shipping, and discounts. */\n\tsubtotal: string;\n\t/** Formatted tax amount. */\n\ttax: string;\n\t/** Formatted shipping cost. */\n\tshipping: string;\n\t/** Formatted discount, shown as a deduction. */\n\tdiscount: string;\n\t/** Formatted order total. */\n\ttotal: string;\n\tcheckout: string;\n\t/** Writes a line's quantity, so a translation owns the multiplication sign. */\n\tformatQuantity: (quantity: number) => string;\n}\n\nexport const defaultCartSummaryStrings: CartSummaryStrings = {\n\ttitle: 'Cart',\n\tsubtotal: 'Subtotal',\n\ttax: 'Tax',\n\tshipping: 'Shipping',\n\tdiscount: 'Discount',\n\ttotal: 'Total',\n\tcheckout: 'Checkout',\n\tformatQuantity: (quantity) => `×${quantity}`,\n};\n\nexport interface CartSummaryCardProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'> {\n\t/** Line items in the cart. */\n\titems: CartLineItem[];\n\t/** Formatted total before tax, shipping, and discounts. */\n\tsubtotal?: string;\n\t/** Formatted tax amount. */\n\ttax?: string;\n\t/** Formatted shipping cost. */\n\tshipping?: string;\n\t/** Formatted discount, shown as a deduction. */\n\tdiscount?: string;\n\t/** Formatted order total. */\n\ttotal: string;\n\tonCheckout?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<CartSummaryStrings>;\n}\n\n/** The source kit's name for `CartSummaryCardProps`. */\nexport type CartSummaryProps = CartSummaryCardProps;\n","/**\n * CartSummaryCard — line-item list with optional subtotal / tax / shipping /\n * discount breakdown and a primary \"Checkout\" action. Items render through\n * `<ItemGroup>` for density consistency; a line whose image fails to load\n * shows its initials instead, and a new image source is tried again. The\n * breakdown is the shared commerce ledger (`SummaryPanel` + `AmountRow`): the\n * discount reads as a deduction in success ink, and the total is ruled off\n * only when there is a breakdown above it to roll up.\n *\n * `CartSummary` is the same component under the source kit's name.\n */\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport { Value } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemGroup,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { LineThumbnail } from '../shared/line-thumbnail';\nimport { AmountRow, SummaryPanel } from '../summary-panel';\nimport { defaultCartSummaryStrings, type CartLineItem, type CartSummaryCardProps } from './types';\n\nconst resolveCartLineTitle = (item: CartLineItem): string => {\n\treturn [item.productTitle, item.title, item.name].find((value) => !!value?.trim()) ?? item.id;\n};\n\nconst resolveCartLineImageSrc = (item: CartLineItem): string | undefined => {\n\treturn [item.imageUrl, item.imageSrc, item.src, item.url].find((value) => !!value?.trim());\n};\n\nexport function CartSummaryCard({\n\titems,\n\tsubtotal,\n\ttax,\n\tshipping,\n\tdiscount,\n\ttotal,\n\tonCheckout,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: CartSummaryCardProps) {\n\tconst strings = useStrings(defaultCartSummaryStrings, stringsProp);\n\tconst hasBreakdown = !!(subtotal || tax || shipping || discount);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface=\"flat\"\n\t\t\tpadding=\"none\"\n\t\t\ttitle={strings.title}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tdata-slot=\"cart-summary\"\n\t\t\tclassName={cn('cart-summary--component w-full', className)}\n\t\t>\n\t\t\t<ItemGroup>\n\t\t\t\t{items.map((it) => {\n\t\t\t\t\tconst title = resolveCartLineTitle(it);\n\t\t\t\t\tconst imageSrc = resolveCartLineImageSrc(it);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Item key={it.id} className=\"cart-summary--item\">\n\t\t\t\t\t\t\t<ItemMedia variant=\"image\" className=\"cart-summary--item-media\">\n\t\t\t\t\t\t\t\t<LineThumbnail src={imageSrc} alt={it.imageAlt} title={title} />\n\t\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t\t<ItemContent className=\"cart-summary--item-content\">\n\t\t\t\t\t\t\t\t<ItemTitle>{title}</ItemTitle>\n\t\t\t\t\t\t\t\t{!!it.variantTitle && (\n\t\t\t\t\t\t\t\t\t<ItemDescription clamp={1}>{it.variantTitle}</ItemDescription>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t\t<ItemActions className=\"cart-summary--item-actions\">\n\t\t\t\t\t\t\t\t<Stack gap=\"2xs\" align=\"end\" className=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"cart-summary--quantity tabular-nums\">\n\t\t\t\t\t\t\t\t\t\t{strings.formatQuantity(it.qty)}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t<Value weight=\"semibold\" className=\"tabular-nums\">{it.price}</Value>\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t</ItemActions>\n\t\t\t\t\t\t</Item>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ItemGroup>\n\n\t\t\t<SummaryPanel className=\"cart-summary--totals\">\n\t\t\t\t{!!subtotal && <AmountRow label={strings.subtotal} amount={subtotal} />}\n\t\t\t\t{!!tax && <AmountRow label={strings.tax} amount={tax} />}\n\t\t\t\t{!!shipping && <AmountRow label={strings.shipping} amount={shipping} />}\n\t\t\t\t{!!discount && <AmountRow label={strings.discount} amount={discount} deduction />}\n\t\t\t\t<AmountRow label={strings.total} amount={total} total rollup={hasBreakdown} />\n\t\t\t</SummaryPanel>\n\n\t\t\t{!!onCheckout && (\n\t\t\t\t<Button tone=\"primary\" onClick={onCheckout} fullWidth>{strings.checkout}</Button>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nCartSummaryCard.displayName = 'CartSummaryCard';\n\n/** The source kit's name for `CartSummaryCard`; the same component. */\nexport const CartSummary = CartSummaryCard;\n","import type { StringsProp } from '../../../../lib/strings';\n\nexport interface CouponInputStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/**\n\t * Accessible name for the code field. The card shows no visible label — the\n\t * placeholder carries the hint — so this is the field's only accessible\n\t * name, and a placeholder alone is not one: it is not reliably announced and\n\t * disappears as soon as the user types.\n\t */\n\tfieldLabel: string;\n\tplaceholder: string;\n\tapply: string;\n\tremove: string;\n\tapplied: string;\n\tinvalid: string;\n}\n\nexport const defaultCouponInputStrings: CouponInputStrings = {\n\ttitle: 'Have a code?',\n\tfieldLabel: 'Coupon code',\n\tplaceholder: 'Enter coupon code',\n\tapply: 'Apply',\n\tremove: 'Remove',\n\tapplied: 'Applied',\n\tinvalid: 'That code is not valid',\n};\n\nexport interface CouponInputCardProps {\n\t/** Coupon currently applied, if any. */\n\tappliedCode?: string;\n\t/** Formatted discount the coupon grants. */\n\tappliedDiscount?: string;\n\t/** Validation message for a rejected code. */\n\terror?: string;\n\tonApply?: (code: string) => void;\n\t/** Fired when an entry is removed. */\n\tonRemove?: () => void;\n\t/** Whether a code is being checked. */\n\tloading?: boolean;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<CouponInputStrings>;\n}\n","/**\n * CouponInputCard — promo / coupon code entry with an applied state and\n * inline error messaging.\n *\n * Empty state — code input + apply button, helper line for\n * placeholders or errors. Applied state — success-tinted row with a check\n * medallion, monospaced code, discount delta, and a destructive remove icon.\n */\nimport {\n\tuseState } from 'react';\nimport { Check, X } from 'lucide-react';\nimport { ContentBlock } from '../../../base/display';\nimport { Button } from '../../../base/buttons';\nimport { IconBadge,\n} from '../../../base/display';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { Input } from '../../../base/text-inputs';\nimport { Stack } from '../../../base/structure';\nimport { useStrings } from '../../../../lib/strings';\n\nimport { defaultCouponInputStrings, type CouponInputCardProps } from './types';\n\nimport { cn } from '../../../../lib/utils';\nimport { formatDeduction } from '../format-signed-amount';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\nconst normalizeCode = (value: string): string => value.toUpperCase();\n\nexport function CouponInputCard({\n\tappliedCode,\n\tappliedDiscount,\n\terror,\n\tonApply,\n\tonRemove,\n\tloading,\n\tclassName,\n\tstrings: stringsProp,\n}: CouponInputCardProps) {\n\tconst strings = useStrings(defaultCouponInputStrings, stringsProp);\n\tconst [code, setCode] = useState('');\n\tconst trimmedCode = code.trim();\n\n\tif (appliedCode) {\n\t\treturn (\n\t\t\t<ContentBlock title={strings.title} className={cn('coupon-input--component w-full', className)}>\n\t\t\t\t<Item size=\"sm\" variant=\"muted\" className={cn('items-center gap-y-space-sm border', toneRecipes.success.edge, toneRecipes.success.wash)}>\n\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t<IconBadge icon={Check} tone=\"success\" size=\"md\" />\n\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t{/*\n\t\t\t\t\t\tCode and status share one line so the applied panel matches the\n\t\t\t\t\t\tempty state's control height. Stacking them made this state ~20px\n\t\t\t\t\t\ttaller than the input it replaces, so applying a coupon shifted\n\t\t\t\t\t\teverything below it in the surrounding checkout column.\n\t\t\t\t\t*/}\n\t\t\t\t\t<ItemContent className=\"min-w-0\">\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"sm\" wrap={false} className=\"min-w-0\">\n\t\t\t\t\t\t\t<ItemTitle className=\"min-w-0 truncate font-mono tracking-wider\" title={appliedCode}>{appliedCode}</ItemTitle>\n\t\t\t\t\t\t\t<DisplayLabel className=\"shrink-0\">\n\t\t\t\t\t\t\t\t{strings.applied}\n\t\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</ItemContent>\n\t\t\t\t\t<ItemActions className=\"ml-auto shrink-0 gap-space-sm\">\n\t\t\t\t\t\t{!!appliedDiscount && (\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\t\t\ttype=\"success\"\n\t\t\t\t\t\t\t\tclassName=\"tabular-nums shrink-0\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{formatDeduction(appliedDiscount)}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!onRemove && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\ttone=\"destructive\"\n\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\tonClick={onRemove}\n\t\t\t\t\t\t\t\taria-label={strings.remove}\n\t\t\t\t\t\t\t\tclassName=\"size-action-xs shrink-0 text-muted-foreground hover:text-destructive\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<X className=\"size-icon-sm\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ItemActions>\n\t\t\t\t</Item>\n\t\t\t</ContentBlock>\n\t\t);\n\t}\n\n\treturn (\n\t\t<ContentBlock title={strings.title} className={cn('coupon-input--component w-full', className)}>\n\t\t\t<Stack gap=\"md\">\n\t\t\t\t<div className=\"flex flex-wrap gap-space-md\">\n\t\t\t\t\t<div className=\"min-w-44 flex-1\">\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tvalue={code}\n\t\t\t\t\t\t\tonChange={(e) => setCode(normalizeCode((e.target as HTMLInputElement).value))}\n\t\t\t\t\t\t\taria-label={strings.fieldLabel}\n\t\t\t\t\t\t\tplaceholder={strings.placeholder}\n\t\t\t\t\t\t\tautoCapitalize=\"characters\"\n\t\t\t\t\t\t\tspellCheck={false}\n\t\t\t\t\t\t\tclassName=\"font-mono\"\n\t\t\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Button tone=\"primary\"\n\t\t\t\t\t\tsize=\"md\"\n\t\t\t\t\t\tonClick={() => onApply?.(trimmedCode)}\n\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\tdisabled={!trimmedCode}\n\t\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.apply}\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t{!!error && (\n\t\t\t\t\t<Text size=\"xs\" type=\"error\">{error || strings.invalid}</Text>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</ContentBlock>\n\t);\n}\n\nCouponInputCard.displayName = 'CouponInputCard';\n","import type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type OrderStatusKind = 'pending' | 'paid' | 'fulfilled' | 'shipped' | 'delivered' | 'cancelled';\n\nexport interface OrderStatusEvent {\n\t/** Display label. */\n\tlabel: string;\n\t/** Formatted time for the entry. */\n\ttimestamp?: string;\n\tcomplete: boolean;\n}\n\nexport interface OrderStatusStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Not rendered: the title badge states the status. Kept for existing overrides. */\n\tstatusLabel: string;\n\t/** Label of the delivery-estimate fact. */\n\teta: string;\n\t/** Not rendered: the timeline shows the latest event. Kept for existing overrides. */\n\tlatestEvent: string;\n\t/** Not rendered: the timeline marks the current step. Kept for existing overrides. */\n\tcurrentStep: string;\n}\n\nexport const defaultOrderStatusStrings: OrderStatusStrings = {\n\ttitle: 'Order status',\n\tstatusLabel: 'Current status',\n\teta: 'ETA',\n\tlatestEvent: 'Latest event',\n\tcurrentStep: 'Current step',\n};\n\nexport interface OrderStatusCardProps {\n\t/** Human-facing order reference. */\n\torderNumber: string;\n\t/** Current fulfilment stage. */\n\tstatus: OrderStatusKind;\n\t/** Badge tone for the status chip. */\n\tstatusTone?: BadgeTone;\n\t/** Timeline entries, oldest first. */\n\tevents: OrderStatusEvent[];\n\t/** Formatted delivery estimate. */\n\tcurrentEta?: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<OrderStatusStrings>;\n}\n","/**\n * OrderStatusCard — order number + status badge + readable event timeline.\n * Ideal for dashboards / receipt summaries. Strings overridable for i18n.\n *\n * The badge states the status and the timeline states every event, so the\n * only extra fact is the delivery estimate.\n */\nimport { CalendarClock, Check, Circle } from 'lucide-react';\nimport { Badge, type BadgeTone } from '../../../base/badge';\nimport { ContentBlock } from '../../../base/display';\nimport { SecondaryValue } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { InlineStat } from '../../data-display';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultOrderStatusStrings,\n\ttype OrderStatusCardProps,\n\ttype OrderStatusKind,\n} from './types';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\n\n// Every fulfilment stage is a status, so each maps to a status tone. Primary is\n// reserved for the main command and never paints a status chip.\nconst VARIANT_BY_STATUS: Record<OrderStatusKind, BadgeTone> = {\n\tpending: 'warning',\n\tpaid: 'info',\n\tfulfilled: 'info',\n\tshipped: 'info',\n\tdelivered: 'success',\n\tcancelled: 'destructive',\n};\n\nexport function OrderStatusCard({\n\torderNumber,\n\tstatus,\n\tstatusTone,\n\tevents,\n\tcurrentEta,\n\tclassName,\n\tstrings: stringsProp,\n}: OrderStatusCardProps) {\n\tconst strings = useStrings(defaultOrderStatusStrings, stringsProp);\n\tconst variant = statusTone ?? VARIANT_BY_STATUS[status];\n\tconst lastCompleteIdx = events.reduce((acc, e, i) => (e.complete ? i : acc), -1);\n\tconst nextEvent = events.find((event) => !event.complete);\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={<Badge tone={variant} className=\"capitalize\">{status}</Badge>}\n\t\t\tdescription={`#${orderNumber}`}\n\t\t\tcontentGap=\"xl\"\n\t\t\tclassName={cn('order-status--component w-full', className)}\n\t\t>\n\t\t\t{/* The same label/value row ShipmentTracking uses for its estimate. */}\n\t\t\t{!!currentEta && (\n\t\t\t\t<InlineStat\n\t\t\t\t\tlabel={strings.eta}\n\t\t\t\t\tvalue={currentEta}\n\t\t\t\t\tclassName=\"order-status--eta\"\n\t\t\t\t\tvalueClassName=\"font-medium tabular-nums\"\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{events.length > 0 && (\n\t\t\t\t<ol className=\"m-0 p-0 list-none\">\n\t\t\t\t\t{events.map((event, index) => {\n\t\t\t\t\t\tconst isLast = index === events.length - 1;\n\t\t\t\t\t\tconst isCurrent = nextEvent ? event === nextEvent : index === lastCompleteIdx;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={`${event.label}-${index}`} className=\"relative flex gap-space-lg\">\n\t\t\t\t\t\t\t\t<div className=\"flex flex-col items-center\">\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t'flex size-6 shrink-0 items-center justify-center rounded-full border',\n\t\t\t\t\t\t\t\t\t\t\tevent.complete\n\t\t\t\t\t\t\t\t\t\t\t\t? 'border-success bg-success text-success-foreground'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'border-border bg-card text-muted-foreground',\n\t\t\t\t\t\t\t\t\t\t\t// The up-next marker sits directly beneath success-filled steps,\n\t\t\t\t\t\t\t\t\t\t\t// and primary is a neighbouring hue to success in this theme, so a\n\t\t\t\t\t\t\t\t\t\t\t// 10% ring read as the same state at a glance. A tinted fill plus a\n\t\t\t\t\t\t\t\t\t\t\t// heavier border and ring separate it by weight rather than by hue,\n\t\t\t\t\t\t\t\t\t\t\t// which survives a retheme that moves primary closer to success.\n\t\t\t\t\t\t\t\t\t\t\tisCurrent && !event.complete && cn('border-2 border-primary-accent ring-4', toneRecipes.primary.tint, toneRecipes.primary.ink, toneRecipes.primary.halo),\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{event.complete ? (\n\t\t\t\t\t\t\t\t\t\t\t<Check className=\"size-icon-md\" strokeWidth={2.5} />\n\t\t\t\t\t\t\t\t\t\t) : isCurrent ? (\n\t\t\t\t\t\t\t\t\t\t\t<CalendarClock className=\"size-icon-md\" />\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<Circle className=\"size-icon-sm\" />\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{!isLast && (\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t'min-h-6 w-px flex-1',\n\t\t\t\t\t\t\t\t\t\t\t\tindex < lastCompleteIdx ? 'bg-success' : 'bg-border',\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div className={cn('min-w-0 flex-1 pb-space-xl', isLast && 'pb-0')}>\n\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\tweight={event.complete || isCurrent ? 'semibold' : 'medium'}\n\t\t\t\t\t\t\t\t\t\tclassName={cn(!event.complete && !isCurrent && 'text-muted-foreground')}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{event.label}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t{!!event.timestamp && (\n\t\t\t\t\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t\t\t\t{event.timestamp}\n\t\t\t\t\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</ol>\n\t\t\t)}\n\t\t</ContentBlock>\n\t);\n}\n\nOrderStatusCard.displayName = 'OrderStatusCard';\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type PaymentBrand = 'visa' | 'mastercard' | 'amex' | 'paypal' | 'applepay' | 'googlepay' | 'unknown';\n\n/** `card` draws the card face; `row` the compact identity row. */\nexport type PaymentMethodVariant = 'card' | 'row';\n\nexport interface PaymentMethodStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tdefault: string;\n\tcardHolder: string;\n\texpires: string;\n\tchange: string;\n\t/** Each brand's name as it is read aloud and shown in the `row` form. */\n\tbrands: Record<PaymentBrand, string>;\n\t/** Names the method without reading the number aloud: \"Visa ending 4242\". */\n\tformatCard: (brand: string, last4: string) => string;\n}\n\nexport const defaultPaymentMethodStrings: PaymentMethodStrings = {\n\ttitle: 'Payment method',\n\tdefault: 'Default',\n\tcardHolder: 'Card holder',\n\texpires: 'Expires',\n\tchange: 'Change',\n\tbrands: {\n\t\tvisa: 'Visa',\n\t\tmastercard: 'Mastercard',\n\t\tamex: 'American Express',\n\t\tpaypal: 'PayPal',\n\t\tapplepay: 'Apple Pay',\n\t\tgooglepay: 'Google Pay',\n\t\tunknown: 'Card',\n\t},\n\tformatCard: (brand, last4) => `${brand} ending ${last4}`,\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface PaymentMethodProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title' | 'onChange'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** Card network or wallet. */\n\tbrand: PaymentBrand;\n\t/** Last four digits, the only card number this component accepts. */\n\tlast4: string;\n\t/** Expiry in MM/YY form. */\n\texpiry?: string; // MM/YY\n\t/** Name printed on the card. */\n\tholderName?: string;\n\t/** Marks this as the account's default method. */\n\tdefault?: boolean;\n\t/**\n\t * Fired when the \"Change\" action is pressed. It carries no value — the\n\t * component never holds a payment method to hand back — so treat it as a\n\t * request to open your own method picker.\n\t */\n\tonChange?: () => void;\n\t/** `card` (default) draws the card face; `row` the compact identity row. */\n\tvariant?: PaymentMethodVariant;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<PaymentMethodStrings>;\n}\n\n/** Props of `PaymentMethodCard`: `PaymentMethod` with `variant` defaulting to `row`. */\nexport type PaymentMethodCardProps = PaymentMethodProps;\n","/**\n * PaymentMethod — saved payment-method surface, in two forms.\n *\n * - `card` (default): the hero block is a mini credit-card mock with real card\n * proportions, brand chip top-right, and holder + expiry on the bottom row.\n * The centre line is drawn as a full PAN but only `last4` is ever supplied:\n * the leading digits are decorative bullets, hidden from assistive\n * technology, and the card is named aloud through `strings.formatCard`\n * (\"Visa ending 4242\") instead.\n * - `row`: a compact identity row, the brand glyph tile beside that same\n * spoken name, with the holder and expiry beneath it.\n *\n * The component neither accepts nor stores a full card number. `onChange` is\n * a request to open the consumer's own method picker; it carries no value.\n * `PaymentMethodCard` is this component defaulting to the `row` form.\n */\nimport { CreditCard } from 'lucide-react';\n\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { IconBadge, VisuallyHidden } from '../../../base/display';\nimport { Stack } from '../../../base/structure';\nimport { Value } from '../../../primitives';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultPaymentMethodStrings, type PaymentBrand, type PaymentMethodProps } from './types';\n\n/** The brand chip as printed on a card face. The spoken name comes from `strings.brands`. */\nconst BRAND_LABEL: Record<PaymentBrand, string> = {\n\tvisa: 'VISA',\n\tmastercard: 'MasterCard',\n\tamex: 'AMEX',\n\tpaypal: 'PayPal',\n\tapplepay: 'Apple Pay',\n\tgooglepay: 'Google Pay',\n\tunknown: 'Card',\n};\n\n/**\n * The card face is an artwork-backed surface, which `--inverse-*` exists for.\n * Brands previously borrowed semantic state colours — a Visa painted `info`,\n * Google Pay `success` — so retheming an alert colour would have repainted\n * every stored card. Those tokens mean states, not brands. Identity comes from\n * the brand label and mark; the surface stays canonical, which also matches how\n * real cards read in an admin list.\n */\n// Translucent gloss composites over its explicit inverse base in both themes.\nconst BRAND_SURFACE = 'bg-inverse-background from-inverse-background via-inverse-surface-strong to-inverse-background';\n\nexport function PaymentMethod({\n\tbrand,\n\tlast4,\n\texpiry,\n\tholderName,\n\tdefault: defaultMethod = false,\n\tonChange,\n\tvariant = 'card',\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider = surface === 'flat' ? false : undefined,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: PaymentMethodProps) {\n\tconst strings = useStrings(defaultPaymentMethodStrings, stringsProp);\n\tconst spokenName = strings.formatCard(strings.brands[brand], last4);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={defaultMethod ? <Badge tone=\"neutral\">{strings.default}</Badge> : null}\n\t\t\theaderAction={onChange ? (\n\t\t\t\t<Button buttonStyle=\"ghost\" tone=\"secondary\" onClick={onChange}>\n\t\t\t\t\t{strings.change}\n\t\t\t\t</Button>\n\t\t\t) : undefined}\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn('payment-method--component w-full', className)}\n\t\t>\n\t\t\t{variant === 'row' ? (\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"lg\" align=\"start\" wrap={false} className=\"payment-method--identity\">\n\t\t\t\t\t<IconBadge icon={CreditCard} shape=\"square\" tone=\"neutral\" className=\"payment-method--mark\" />\n\t\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0\">\n\t\t\t\t\t\t<Text weight=\"semibold\" className=\"payment-method--name\">{spokenName}</Text>\n\t\t\t\t\t\t{!!holderName && (\n\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"payment-method--holder truncate\">{holderName}</Text>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!expiry && (\n\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"payment-method--expiry\">\n\t\t\t\t\t\t\t\t{strings.expires} <Value className=\"tabular-nums\">{expiry}</Value>\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\t\t\t\t</Stack>\n\t\t\t) : (\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'payment-method--face relative flex aspect-[85.6/53.98] w-full max-w-[22rem] flex-col justify-between overflow-hidden rounded-radius bg-gradient-to-br p-surface text-inverse-foreground shadow-sm ring-1 ring-inverse-border',\n\t\t\t\t\t\tBRAND_SURFACE,\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<VisuallyHidden>{spokenName}</VisuallyHidden>\n\t\t\t\t\t<div aria-hidden=\"true\" className=\"relative flex items-start justify-between\">\n\t\t\t\t\t\t<div className=\"flex size-7 items-center justify-center rounded-radius-md bg-gradient-to-br from-muted to-muted-foreground/60 shadow-sm\">\n\t\t\t\t\t\t\t<div className=\"size-icon rounded-radius-sm border border-warning-foreground/25 bg-warning-foreground/15\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\tweight=\"bold\"\n\t\t\t\t\t\t\tclassName=\"rounded-radius-xs bg-inverse-surface px-space-md py-space-2xs tracking-[0.15em] text-inverse-foreground\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{BRAND_LABEL[brand]}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div aria-hidden=\"true\" className=\"relative\">\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\t\tclassName=\"payment-method--number block whitespace-nowrap font-mono tracking-widest text-inverse-foreground\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t•••• •••• •••• {last4}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"end\" justify=\"between\" gap=\"lg\" className=\"relative\">\n\t\t\t\t\t\t<div className=\"min-w-0\">\n\t\t\t\t\t\t\t{!!holderName && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<DisplayLabel tone=\"inverse\" className=\"block\">{strings.cardHolder}</DisplayLabel>\n\t\t\t\t\t\t\t\t\t<Text weight=\"semibold\" className=\"truncate text-inverse-foreground\">{holderName}</Text>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{!!expiry && (\n\t\t\t\t\t\t\t<div className=\"text-right shrink-0\">\n\t\t\t\t\t\t\t\t<DisplayLabel tone=\"inverse\" className=\"block\">{strings.expires}</DisplayLabel>\n\t\t\t\t\t\t\t\t<Value weight=\"semibold\" className=\"tabular-nums text-inverse-foreground\">{expiry}</Value>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nPaymentMethod.displayName = 'PaymentMethod';\n\n/**\n * The source kit's `PaymentMethodCard`: `PaymentMethod` defaulting to the\n * compact `row` identity form. Pass `variant=\"card\"` for the card face.\n */\nexport function PaymentMethodCard({ variant = 'row', ...props }: PaymentMethodProps) {\n\treturn <PaymentMethod variant={variant} {...props} />;\n}\n\nPaymentMethodCard.displayName = 'PaymentMethodCard';\n","import type {\n\tSeoListingCheckId,\n\tSeoListingCheckResult,\n\tSeoListingCheckStatus,\n\tSeoListingScoreInput,\n\tSeoListingScoreLimits,\n\tSeoListingScoreResult,\n} from './types';\n\nexport const DEFAULT_SEO_LISTING_LIMITS: Required<SeoListingScoreLimits> = {\n\ttitleMin: 35,\n\ttitleMax: 60,\n\tdescriptionMin: 120,\n\tdescriptionMax: 160,\n\tpermalinkMax: 75,\n};\n\nfunction resolveLimits(limits?: SeoListingScoreLimits): Required<SeoListingScoreLimits> {\n\treturn {\n\t\t...DEFAULT_SEO_LISTING_LIMITS,\n\t\t...limits,\n\t};\n}\n\nfunction clampScore(value: number): number {\n\tif (!Number.isFinite(value)) return 0;\n\treturn Math.max(0, Math.min(1, value));\n}\n\nfunction getCheckStatus(score: number, maxScore: number): SeoListingCheckStatus {\n\tif (maxScore <= 0) return 'missing';\n\tconst ratio = score / maxScore;\n\tif (ratio >= 0.9) return 'good';\n\tif (ratio >= 0.5) return 'review';\n\treturn 'missing';\n}\n\nfunction makeCheck(\n\tid: SeoListingCheckId,\n\tscoreRatio: number,\n\tmaxScore: number,\n\tactual: number,\n\trange?: Pick<SeoListingCheckResult, 'min' | 'max'>,\n): SeoListingCheckResult {\n\tconst score = Math.round(clampScore(scoreRatio) * maxScore);\n\treturn {\n\t\tid,\n\t\tscore,\n\t\tmaxScore,\n\t\tactual,\n\t\tstatus: getCheckStatus(score, maxScore),\n\t\t...range,\n\t};\n}\n\nfunction lengthScore(value: string, min: number, max: number): number {\n\tconst length = value.trim().length;\n\tif (length === 0) return 0;\n\tif (length >= min && length <= max) return 1;\n\tif (length < min) return Math.max(0.35, length / min);\n\tif (length > max * 2) return 0.35;\n\tconst overBy = length - max;\n\treturn Math.max(0.55, 1 - overBy / max);\n}\n\nexport function getSeoPermalinkPath(permalink?: string): string {\n\tconst value = permalink?.trim() ?? '';\n\tif (!value) return '';\n\n\tconst withoutHash = value.split('#')[0] ?? '';\n\tconst withoutQuery = withoutHash.split('?')[0] ?? '';\n\tconst withoutProtocol = withoutQuery.replace(/^https?:\\/\\/[^/]+/i, '');\n\n\treturn withoutProtocol.replace(/^\\/+|\\/+$/g, '');\n}\n\nexport function getSeoPermalinkSlug(permalink?: string): string {\n\tconst path = getSeoPermalinkPath(permalink);\n\tconst parts = path.split('/').filter(Boolean);\n\treturn parts.at(-1) ?? '';\n}\n\nfunction permalinkScore(permalink?: string, max = DEFAULT_SEO_LISTING_LIMITS.permalinkMax): number {\n\tconst path = getSeoPermalinkPath(permalink);\n\tif (!path) return 0;\n\tif (path.length <= max) return 1;\n\tif (path.length > max * 2) return 0.35;\n\treturn Math.max(0.55, 1 - (path.length - max) / max);\n}\n\nfunction slugScore(permalink?: string): number {\n\tconst slug = getSeoPermalinkSlug(permalink);\n\tif (!slug) return 0;\n\tif (/^[\\p{L}\\p{N}]+(?:-[\\p{L}\\p{N}]+)*$/u.test(slug) && slug === slug.toLowerCase()) {\n\t\treturn 1;\n\t}\n\tif (!/\\s/.test(slug) && !/[?#]/.test(slug)) return 0.65;\n\treturn 0.25;\n}\n\nfunction urlScore(baseUrl?: string): number {\n\tconst value = baseUrl?.trim() ?? '';\n\tif (!value) return 0;\n\tif (/^https:\\/\\//i.test(value)) return 1;\n\tif (/^http:\\/\\//i.test(value)) return 0.6;\n\treturn 0.45;\n}\n\nfunction keywordScore(input: SeoListingScoreInput): number | null {\n\tconst keyword = input.keyword?.trim().toLowerCase();\n\tif (!keyword) return null;\n\n\tconst haystack = [\n\t\tinput.title,\n\t\tinput.description,\n\t\tgetSeoPermalinkPath(input.permalink),\n\t]\n\t\t.filter(Boolean)\n\t\t.join(' ')\n\t\t.toLowerCase();\n\n\tif (!haystack) return 0;\n\treturn haystack.includes(keyword) ? 1 : 0.35;\n}\n\nexport function calculateSeoListingScore(input: SeoListingScoreInput): SeoListingScoreResult {\n\tconst limits = resolveLimits(input.limits);\n\tconst title = input.title?.trim() ?? '';\n\tconst description = input.description?.trim() ?? '';\n\tconst permalinkPath = getSeoPermalinkPath(input.permalink);\n\tconst slug = getSeoPermalinkSlug(input.permalink);\n\tconst checks: SeoListingCheckResult[] = [\n\t\tmakeCheck('title', lengthScore(title, limits.titleMin, limits.titleMax), 30, title.length, {\n\t\t\tmin: limits.titleMin,\n\t\t\tmax: limits.titleMax,\n\t\t}),\n\t\tmakeCheck(\n\t\t\t'description',\n\t\t\tlengthScore(description, limits.descriptionMin, limits.descriptionMax),\n\t\t\t30,\n\t\t\tdescription.length,\n\t\t\t{\n\t\t\t\tmin: limits.descriptionMin,\n\t\t\t\tmax: limits.descriptionMax,\n\t\t\t},\n\t\t),\n\t\tmakeCheck('permalink', permalinkScore(input.permalink, limits.permalinkMax), 15, permalinkPath.length, {\n\t\t\tmax: limits.permalinkMax,\n\t\t}),\n\t\tmakeCheck('slug', slugScore(input.permalink), 10, slug.length),\n\t\tmakeCheck('url', urlScore(input.baseUrl), 10, input.baseUrl?.trim().length ?? 0),\n\t];\n\n\tconst keyword = keywordScore(input);\n\tif (keyword !== null) {\n\t\tchecks.push(makeCheck('keyword', keyword, 5, input.keyword?.trim().length ?? 0));\n\t}\n\n\tconst score = Math.round(\n\t\t(checks.reduce((sum, check) => sum + check.score, 0) /\n\t\t\tchecks.reduce((sum, check) => sum + check.maxScore, 0)) *\n\t\t\t100,\n\t);\n\n\treturn {\n\t\tscore,\n\t\tstatus: getCheckStatus(score, 100),\n\t\tchecks,\n\t\tlimits,\n\t};\n}\n","import type { ReactNode } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type SeoListingCheckId =\n\t| 'title'\n\t| 'description'\n\t| 'permalink'\n\t| 'slug'\n\t| 'url'\n\t| 'keyword';\n\nexport type SeoListingCheckStatus = 'good' | 'review' | 'missing';\n\nexport interface SeoListingScoreLimits {\n\ttitleMin?: number;\n\ttitleMax?: number;\n\tdescriptionMin?: number;\n\tdescriptionMax?: number;\n\tpermalinkMax?: number;\n}\n\nexport interface SeoListingScoreInput {\n\t/** Surface title. */\n\ttitle?: string;\n\t/** Supporting copy shown under the label. */\n\tdescription?: string;\n\t/** Full URL shown under the title. */\n\tpermalink?: string;\n\t/** Origin the permalink is built on. */\n\tbaseUrl?: string;\n\t/** Target keyword the copy is scored against. */\n\tkeyword?: string;\n\t/** Character caps for the title and description. */\n\tlimits?: SeoListingScoreLimits;\n}\n\nexport interface SeoListingCheckResult {\n\t/** Stable identity for this entry. */\n\tid: SeoListingCheckId;\n\tstatus: SeoListingCheckStatus;\n\t/** Overall SEO score, 0-100. */\n\tscore: number;\n\tmaxScore: number;\n\tactual: number;\n\tmin?: number;\n\tmax?: number;\n}\n\nexport interface SeoListingScoreResult {\n\t/** Overall SEO score, 0-100. */\n\tscore: number;\n\tstatus: SeoListingCheckStatus;\n\tchecks: SeoListingCheckResult[];\n\t/** Character caps for the title and description. */\n\tlimits: Required<SeoListingScoreLimits>;\n}\n\nexport interface SeoListingCardStrings {\n\t/** Surface title. */\n\ttitle: string;\n\teditLabel: string;\n\tscoreLabel: string;\n\tchecksLabel: string;\n\tsiteFallback: string;\n\ttitleFallback: string;\n\tdescriptionFallback: string;\n\turlFallback: string;\n\tcharacters: string;\n\tmaxLabel: string;\n\ttargetLabel: string;\n\tstatus: Record<SeoListingCheckStatus, string>;\n\tcheckLabels: Record<SeoListingCheckId, string>;\n\tcheckHints: Record<SeoListingCheckId, string>;\n}\n\nexport const defaultSeoListingCardStrings: SeoListingCardStrings = {\n\ttitle: 'Search engine listing',\n\teditLabel: 'Edit search listing',\n\tscoreLabel: 'SEO score',\n\tchecksLabel: 'SEO checks',\n\tsiteFallback: 'Website',\n\ttitleFallback: 'Add an SEO title',\n\tdescriptionFallback: 'Add a meta description to control the search snippet.',\n\turlFallback: 'https://example.com',\n\tcharacters: 'characters',\n\tmaxLabel: 'max',\n\ttargetLabel: 'target',\n\tstatus: {\n\t\tgood: 'Good',\n\t\treview: 'Review',\n\t\tmissing: 'Missing',\n\t},\n\tcheckLabels: {\n\t\ttitle: 'Title',\n\t\tdescription: 'Description',\n\t\tpermalink: 'Permalink',\n\t\tslug: 'Slug format',\n\t\turl: 'URL',\n\t\tkeyword: 'Keyword',\n\t},\n\tcheckHints: {\n\t\ttitle: 'Keep the title inside the target range.',\n\t\tdescription: 'Use a complete meta description inside the target range.',\n\t\tpermalink: 'Keep the permalink readable and below the maximum length.',\n\t\tslug: 'Use lowercase words separated by hyphens.',\n\t\turl: 'Prefer a secure canonical URL.',\n\t\tkeyword: 'Use the focus keyword in the title, description, or permalink.',\n\t},\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface SeoListingCardProps extends Pick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** Site name shown in the search preview. */\n\tsiteName?: string;\n\t/** Origin the permalink is built on. */\n\tbaseUrl?: string;\n\t/** Path parts appended to the base URL. */\n\tpathSegments?: string[];\n\t/** Full URL shown under the title. */\n\tpermalink?: string;\n\t/** Surface title. */\n\ttitle?: string;\n\t/** Supporting copy shown under the label. */\n\tdescription?: string;\n\t/** Formatted price shown in the rich result. */\n\tprice?: ReactNode;\n\t/** Target keyword the copy is scored against. */\n\tkeyword?: string;\n\t/** Overall SEO score, 0-100. */\n\tscore?: SeoListingScoreResult;\n\t/** Character caps for the title and description. */\n\tlimits?: SeoListingScoreLimits;\n\t/** Renders the checks. */\n\tshowChecks?: boolean;\n\t/** Fired when an entry is edited. */\n\tonEdit?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<SeoListingCardStrings>;\n}\n","/**\n * SeoListingCard — search-result preview with a reusable SEO score.\n *\n * The card is render-only: consumers own form state and call `onEdit` or\n * compose their own editor around the exported `calculateSeoListingScore`\n * helper. Scoring is intentionally configurable through `limits` so apps can\n * tune their own title, description, and permalink thresholds.\n */\nimport {\n\tCheckCircle2,\n\tCircleAlert,\n\tExternalLink,\n\tPencil,\n\tTriangleAlert,\n\ttype LucideIcon,\n} from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport { Badge, type BadgeTone } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { Progress } from '../../../base/feedback';\nimport { Stack } from '../../../base/structure';\nimport { Number as NumberValue, SecondaryValue, Value } from '../../../primitives';\nimport { Text, TextLink } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tcalculateSeoListingScore,\n\tgetSeoPermalinkPath,\n} from './seo-listing-score';\nimport {\n\tdefaultSeoListingCardStrings,\n\ttype SeoListingCardProps,\n\ttype SeoListingCardStrings,\n\ttype SeoListingCheckResult,\n\ttype SeoListingCheckStatus,\n} from './types';\n\n// `good` is success, not info: the row already carries a CheckCircle2, and\n// every other commerce surface (order status, inventory level, discount\n// stack, applied coupon, refund stages) signals a passing state in success\n// green. The review/missing rungs already matched the shared vocabulary.\nconst SCORE_BADGE_TONE: Record<SeoListingCheckStatus, BadgeTone> = {\n\tgood: 'success',\n\treview: 'warning',\n\tmissing: 'destructive',\n};\n\nconst SCORE_PROGRESS_CLASS: Record<SeoListingCheckStatus, string> = {\n\tgood: '[&_[data-slot=progress-indicator]]:bg-success',\n\treview: '[&_[data-slot=progress-indicator]]:bg-warning',\n\tmissing: '[&_[data-slot=progress-indicator]]:bg-destructive',\n};\n\nconst CHECK_ICON: Record<SeoListingCheckStatus, LucideIcon> = {\n\tgood: CheckCircle2,\n\treview: TriangleAlert,\n\tmissing: CircleAlert,\n};\n\n// The glyph encodes the check's state, so it carries the status colour and\n// nothing else: no tinted square behind it and no tinted tile around the row.\nconst CHECK_ICON_CLASS: Record<SeoListingCheckStatus, string> = {\n\tgood: 'text-success',\n\treview: 'text-warning-accent',\n\tmissing: 'text-destructive',\n};\n\nfunction trimSlashes(value: string): string {\n\treturn value.replace(/^\\/+|\\/+$/g, '');\n}\n\nfunction buildUrlParts(baseUrl: string, pathSegments: string[], permalink?: string): string[] {\n\tconst path = getSeoPermalinkPath(permalink);\n\tconst permalinkParts = path.split('/').filter(Boolean);\n\treturn [\n\t\tbaseUrl,\n\t\t...pathSegments.map(trimSlashes).filter(Boolean),\n\t\t...permalinkParts,\n\t].filter(Boolean);\n}\n\nfunction buildHref(baseUrl: string, pathSegments: string[], permalink?: string): string | undefined {\n\tif (!baseUrl.trim()) return undefined;\n\tconst base = baseUrl.replace(/\\/+$/g, '');\n\tconst path = [\n\t\t...pathSegments.map(trimSlashes).filter(Boolean),\n\t\t...getSeoPermalinkPath(permalink).split('/').filter(Boolean),\n\t].join('/');\n\n\treturn path ? `${base}/${path}` : base;\n}\n\nfunction getCheckDetail(check: SeoListingCheckResult, strings: SeoListingCardStrings): string {\n\tif (check.id === 'title' || check.id === 'description') {\n\t\treturn `${check.actual}/${check.max} ${strings.characters} · ${strings.targetLabel} ${check.min}-${check.max}`;\n\t}\n\tif (check.id === 'permalink') {\n\t\treturn `${check.actual}/${check.max} ${strings.characters} ${strings.maxLabel}`;\n\t}\n\treturn strings.checkHints[check.id];\n}\n\nfunction SeoCheckRow({\n\tcheck,\n\tdetail,\n\tstrings,\n}: {\n\tcheck: SeoListingCheckResult;\n\tdetail: ReactNode;\n\tstrings: SeoListingCardStrings;\n}) {\n\tconst Icon = CHECK_ICON[check.status];\n\n\treturn (\n\t\t<div className=\"seo-listing-card--check min-w-0\">\n\t\t\t<Stack direction=\"horizontal\" gap=\"md\" align=\"start\" wrap={false}>\n\t\t\t\t{/* Same first-line offset the shared ItemMedia applies beside a description. */}\n\t\t\t\t<Icon\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'seo-listing-card--check-icon size-icon shrink-0 translate-y-0.5',\n\t\t\t\t\t\tCHECK_ICON_CLASS[check.status],\n\t\t\t\t\t)}\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t/>\n\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0 flex-1\">\n\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" justify=\"between\" wrap={false}>\n\t\t\t\t\t\t<Text tag=\"span\" weight=\"medium\" className=\"truncate\">\n\t\t\t\t\t\t\t{strings.checkLabels[check.id]}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<Badge\n\t\t\t\t\t\t\ttone={SCORE_BADGE_TONE[check.status]}\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tinline\n\t\t\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.status[check.status]}\n\t\t\t\t\t\t</Badge>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" lineHeight=\"snug\">\n\t\t\t\t\t\t{detail}\n\t\t\t\t\t</Text>\n\t\t\t\t</Stack>\n\t\t\t</Stack>\n\t\t</div>\n\t);\n}\n\nexport function SeoListingCard({\n\tsiteName,\n\tbaseUrl,\n\tpathSegments = [],\n\tpermalink,\n\ttitle,\n\tdescription,\n\tprice,\n\tkeyword,\n\tscore,\n\tlimits,\n\tshowChecks = true,\n\tonEdit,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider = surface === 'flat' ? false : undefined,\n\tclassName,\n\tstrings: stringsProp,\n}: SeoListingCardProps) {\n\tconst strings = useStrings(defaultSeoListingCardStrings, stringsProp);\n\tconst resolvedBaseUrl = baseUrl?.trim() || strings.urlFallback;\n\tconst resolvedSiteName = siteName?.trim() || strings.siteFallback;\n\tconst resolvedTitle = title?.trim() || strings.titleFallback;\n\tconst resolvedDescription = description?.trim() || strings.descriptionFallback;\n\tconst scoreResult = score ?? calculateSeoListingScore({\n\t\ttitle,\n\t\tdescription,\n\t\tpermalink,\n\t\tbaseUrl,\n\t\tkeyword,\n\t\tlimits,\n\t});\n\tconst href = buildHref(resolvedBaseUrl, pathSegments, permalink);\n\tconst urlParts = buildUrlParts(resolvedBaseUrl, pathSegments, permalink);\n\tconst statusTone = SCORE_BADGE_TONE[scoreResult.status];\n\n\treturn (\n\t\t<Card\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={(\n\t\t\t\t<Badge tone={statusTone} size=\"sm\" inline className=\"shrink-0\">\n\t\t\t\t\t{scoreResult.score}/100 {strings.status[scoreResult.status]}\n\t\t\t\t</Badge>\n\t\t\t)}\n\t\t\tclassName={cn('seo-listing-card--component @container/seo-listing-card w-full', className)}\n\t\t\tcontentGap=\"2xl\"\n\t\t\theaderAction={\n\t\t\t\tonEdit ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\taria-label={strings.editLabel}\n\t\t\t\t\t\tonClick={onEdit}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Pencil className=\"size-icon-sm\" />\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{/*\n\t\t\t\t\t`data-artwork` marks this subtree as a depiction of an external\n\t\t\t\t\tproduct rather than part of the consumer's theme. A search result\n\t\t\t\t\tmust look like a search result whatever colour the admin is themed,\n\t\t\t\t\tso the snippet title states Google's link blue outright instead of\n\t\t\t\t\tborrowing `--color-info`, which would have repainted the preview\n\t\t\t\t\twhenever someone retuned their informational-message colour.\n\t\t\t\t*/}\n\t\t\t\t<div data-artwork=\"serp\" className=\"seo-listing-card--preview min-w-0 rounded-radius border border-border/60 bg-background p-surface shadow-xs\">\n\t\t\t\t<Stack gap=\"sm\" className=\"min-w-0\">\n\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap={false}>\n\t\t\t\t\t\t<Text weight=\"medium\" className=\"truncate\">\n\t\t\t\t\t\t\t{resolvedSiteName}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t{!!href && <ExternalLink className=\"size-icon-sm shrink-0 text-muted-foreground\" aria-hidden=\"true\" />}\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<div className=\"seo-listing-card--url flex min-w-0 flex-wrap items-center gap-x-space-sm gap-y-space-2xs\">\n\t\t\t\t\t\t{urlParts.map((part, index) => (\n\t\t\t\t\t\t\t<span key={`${part}-${index}`} className=\"inline-flex min-w-0 items-center gap-space-sm\">\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"truncate\">\n\t\t\t\t\t\t\t\t\t{part}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t{index < urlParts.length - 1 && (\n\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t›\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t\t{href ? (\n\t\t\t\t\t\t<TextLink\n\t\t\t\t\t\t\thref={href}\n\t\t\t\t\t\t\tsize=\"base\"\n\t\t\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\t\t\tunderline={false}\n\t\t\t\t\t\t\tclassName=\"seo-listing-card--snippet-title block text-[#1a0dab] dark:text-[#8ab4f8]\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{resolvedTitle}\n\t\t\t\t\t\t</TextLink>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tsize=\"base\"\n\t\t\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\t\t\tclassName=\"seo-listing-card--snippet-title text-[#1a0dab] dark:text-[#8ab4f8]\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{resolvedTitle}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t)}\n\t\t\t\t\t<Text type=\"secondary\" lineHeight=\"relaxed\" className=\"seo-listing-card--description max-w-4xl\">\n\t\t\t\t\t\t{resolvedDescription}\n\t\t\t\t\t</Text>\n\t\t\t\t\t{!!price && (\n\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"seo-listing-card--price block tabular-nums\">\n\t\t\t\t\t\t\t{price}\n\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t</div>\n\n\t\t\t{/*\n\t\t\t\tThe score is a section of this card, not a second card: no tinted\n\t\t\t\tpanel, no inner rule and no repeated status badge — the title suffix\n\t\t\t\talready states the status, and the bar and glyphs carry its colour.\n\t\t\t*/}\n\t\t\t<Stack gap=\"lg\" className=\"seo-listing-card--score\">\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"lg\" justify=\"between\" align=\"start\" wrap={false}>\n\t\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0\">\n\t\t\t\t\t\t<Text weight=\"semibold\">{strings.scoreLabel}</Text>\n\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t<NumberValue value={scoreResult.checks.length} size=\"xs\" type=\"secondary\" align=\"left\" /> {strings.checksLabel}\n\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Value weight=\"semibold\" className=\"shrink-0 tabular-nums\">\n\t\t\t\t\t\t{scoreResult.score}/100\n\t\t\t\t\t</Value>\n\t\t\t\t</Stack>\n\t\t\t\t<Progress\n\t\t\t\t\tvalue={scoreResult.score}\n\t\t\t\t\taria-label={strings.scoreLabel}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'seo-listing-card--score-progress',\n\t\t\t\t\t\t'[&_[data-slot=progress-track]]:h-space-md',\n\t\t\t\t\t\tSCORE_PROGRESS_CLASS[scoreResult.status],\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t\t{!!showChecks && (\n\t\t\t\t\t<div className=\"seo-listing-card--checks grid gap-x-space-2xl gap-y-space-lg @xl/seo-listing-card:grid-cols-2\">\n\t\t\t\t\t\t{scoreResult.checks.map((check) => (\n\t\t\t\t\t\t\t<SeoCheckRow\n\t\t\t\t\t\t\t\tkey={check.id}\n\t\t\t\t\t\t\t\tcheck={check}\n\t\t\t\t\t\t\t\tdetail={getCheckDetail(check, strings)}\n\t\t\t\t\t\t\t\tstrings={strings}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\nSeoListingCard.displayName = 'SeoListingCard';\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type InvoiceStatus = 'paid' | 'pending' | 'overdue';\n\nexport interface InvoiceMiniData {\n\tinvoiceNumber: string;\n\tcustomerName: string;\n\tlineItemsCount: number;\n\ttotalAmount: string;\n\tstatus: InvoiceStatus;\n\tdueDate: string;\n}\n\nexport interface InvoiceMiniStrings {\n\tpaid: string;\n\tpending: string;\n\toverdue: string;\n\titems: (count: number) => string;\n\tdue: string;\n}\n\nexport const defaultInvoiceMiniStrings: InvoiceMiniStrings = {\n\tpaid: 'Paid',\n\tpending: 'Pending',\n\toverdue: 'Overdue',\n\titems: (count) => (count === 1 ? '1 line item' : `${count} line items`),\n\tdue: 'Due',\n};\n\nexport interface InvoiceMiniProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {\n\t/** The invoice to summarise. */\n\tinvoice: InvoiceMiniData;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<InvoiceMiniStrings>;\n}\n\nexport const invoiceStatusTone: Record<InvoiceStatus, BadgeTone> = {\n\tpaid: 'success',\n\tpending: 'warning',\n\toverdue: 'destructive',\n};\n","/**\n * InvoiceMini — compact invoice tile for lists / dashboards. Header\n * (number + status chip), customer name, footer split between items-count /\n * due date and the total amount. Strings (status labels, \"Due\", item count\n * pluralisation) overridable for i18n via the `strings` prop.\n */\nimport { Badge } from '../../../base/badge';\nimport { Stack } from '../../../base/structure';\nimport { MonoValue, SecondaryValue, Value } from '../../../primitives';\nimport { Text } from '../../../typography/text';\nimport { mergeStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultInvoiceMiniStrings,\n\tinvoiceStatusTone,\n\ttype InvoiceMiniProps,\n\ttype InvoiceStatus,\n} from './types';\n\nexport function InvoiceMini({\n\tinvoice,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: InvoiceMiniProps) {\n\tconst strings = mergeStrings(defaultInvoiceMiniStrings, stringsProp);\n\tconst labelByStatus: Record<InvoiceStatus, string> = {\n\t\tpaid: strings.paid,\n\t\tpending: strings.pending,\n\t\toverdue: strings.overdue,\n\t};\n\n\treturn (\n\t\t<Stack\n\t\t\t{...props}\n\t\t\tgap=\"md\"\n\t\t\tdata-component=\"invoice-mini\"\n\t\t\tdata-slot=\"invoice-mini\"\n\t\t\tclassName={cn('invoice-mini--component', className)}\n\t\t>\n\t\t\t{/* The status belongs to the invoice number, as in InvoiceHeader: it\n\t\t\t sits beside it rather than at the far edge, and its tone alone\n\t\t\t states the status. */}\n\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap={false}>\n\t\t\t\t<MonoValue className=\"min-w-0 truncate tracking-wide\">\n\t\t\t\t\t{invoice.invoiceNumber}\n\t\t\t\t</MonoValue>\n\t\t\t\t<Badge\n\t\t\t\t\ttone={invoiceStatusTone[invoice.status]}\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t>\n\t\t\t\t\t{labelByStatus[invoice.status]}\n\t\t\t\t</Badge>\n\t\t\t</Stack>\n\n\t\t\t<Text type=\"secondary\" className=\"truncate\">\n\t\t\t\t{invoice.customerName}\n\t\t\t</Text>\n\n\t\t\t<Stack direction=\"horizontal\" gap=\"lg\" align=\"end\" justify=\"between\" className=\"pt-space-xs\">\n\t\t\t\t<Stack gap=\"2xs\" className=\"min-w-0\">\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{strings.items(invoice.lineItemsCount)}\n\t\t\t\t\t</Text>\n\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"whitespace-nowrap tabular-nums\">\n\t\t\t\t\t\t{strings.due} {invoice.dueDate}\n\t\t\t\t\t</SecondaryValue>\n\t\t\t\t</Stack>\n\t\t\t\t<Value\n\t\t\t\t\tsize=\"base\"\n\t\t\t\t\tweight=\"bold\"\n\t\t\t\t\tclassName={cn('ml-auto shrink-0 tabular-nums leading-none')}\n\t\t\t\t>\n\t\t\t\t\t{invoice.totalAmount}\n\t\t\t\t</Value>\n\t\t\t</Stack>\n\t\t</Stack>\n\t);\n}\n\nInvoiceMini.displayName = 'InvoiceMini';\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport type { InvoiceStatus } from '../invoice-mini/types';\n\nexport interface InvoiceParty {\n\t/** Display name. */\n\tname: string;\n\t/** Where the party is: a city line, or a node such as a full address. */\n\tlocation?: ReactNode;\n}\n\nexport interface InvoiceHeaderStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tbillFrom: string;\n\tbillTo: string;\n\tissued: string;\n\tdue: string;\n\tamountDue: string;\n\t/** Chip label for each `InvoiceStatus`. */\n\tpaid: string;\n\tpending: string;\n\toverdue: string;\n}\n\nexport const defaultInvoiceHeaderStrings: InvoiceHeaderStrings = {\n\ttitle: 'Invoice',\n\tbillFrom: 'Bill from',\n\tbillTo: 'Bill to',\n\tissued: 'Issued',\n\tdue: 'Due',\n\tamountDue: 'Amount due',\n\tpaid: 'Paid',\n\tpending: 'Pending',\n\toverdue: 'Overdue',\n};\n\nexport interface InvoiceHeaderProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'> {\n\t/** Human-facing invoice reference. */\n\tinvoiceNumber: string;\n\t/**\n\t * Payment state. Drives both the chip label (through `strings`) and its\n\t * tone, so the two can never disagree. Shares the `InvoiceStatus` union\n\t * with `InvoiceMini`.\n\t */\n\tstatus: InvoiceStatus;\n\t/**\n\t * Overrides the badge tone derived from `status`. Reach for it only when\n\t * the surrounding surface needs a tone the status does not imply.\n\t */\n\tstatusTone?: BadgeTone;\n\t/** Issuing party. */\n\tfrom: InvoiceParty;\n\t/** Billed party. */\n\tto: InvoiceParty;\n\t/** Formatted issue date. */\n\tissuedDate?: string;\n\t/** Formatted due date. */\n\tdueDate?: string;\n\t/** Formatted invoice total. */\n\tamount: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<InvoiceHeaderStrings>;\n}\n","/**\n * InvoiceHeader — invoice document header.\n *\n * A real, visible title (\"Invoice\", a level-2 heading) with the status chip in\n * its suffix and the invoice number as the identifier beneath it. The\n * Bill-from / Bill-to parties sit side by side once the header's own width\n * allows (the grid follows its container, not the viewport) and stack below\n * that. The dates and the amount due close the header on the shared commerce\n * ledger, with the amount due as its total row. The section gap separates the\n * three bands; there is no rule between them.\n *\n * Strings overridable for i18n via the `strings` prop.\n */\nimport type { ReactNode } from 'react';\n\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { AdaptiveGrid, Stack } from '../../../base/structure';\nimport { MonoValue } from '../../../primitives';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { invoiceStatusTone, type InvoiceStatus } from '../invoice-mini/types';\nimport { AmountRow, SummaryPanel } from '../summary-panel';\nimport { defaultInvoiceHeaderStrings, type InvoiceHeaderProps } from './types';\n\nfunction PartyBlock({\n\teyebrow,\n\tname,\n\tlocation,\n}: {\n\teyebrow: string;\n\tname: string;\n\tlocation?: ReactNode;\n}) {\n\treturn (\n\t\t<Stack gap=\"xs\" className=\"invoice-header--party\">\n\t\t\t<DisplayLabel tag=\"div\">{eyebrow}</DisplayLabel>\n\t\t\t<Text weight=\"semibold\" className=\"leading-snug\">\n\t\t\t\t{name}\n\t\t\t</Text>\n\t\t\t{!!location && (\n\t\t\t\t<Text tag=\"div\" size=\"xs\" type=\"secondary\" className=\"leading-snug\">\n\t\t\t\t\t{location}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nexport function InvoiceHeader({\n\tinvoiceNumber,\n\tstatus,\n\tstatusTone,\n\tfrom,\n\tto,\n\tissuedDate,\n\tdueDate,\n\tamount,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: InvoiceHeaderProps) {\n\tconst strings = useStrings(defaultInvoiceHeaderStrings, stringsProp);\n\tconst labelByStatus: Record<InvoiceStatus, string> = {\n\t\tpaid: strings.paid,\n\t\tpending: strings.pending,\n\t\toverdue: strings.overdue,\n\t};\n\t// The tone follows the status the same way `InvoiceMini` resolves it, so\n\t// an overdue invoice can no longer inherit a green chip from a default.\n\tconst resolvedStatusTone = statusTone ?? invoiceStatusTone[status];\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface=\"flat\"\n\t\t\tpadding=\"none\"\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={<Badge tone={resolvedStatusTone}>{labelByStatus[status]}</Badge>}\n\t\t\tdescription={<MonoValue className=\"invoice-header--number tracking-wide\">{invoiceNumber}</MonoValue>}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tdata-component=\"invoice-header\"\n\t\t\tdata-slot=\"invoice-header\"\n\t\t\tclassName={cn('invoice-header--component min-w-0', className)}\n\t\t>\n\t\t\t<AdaptiveGrid minColumnWidth=\"sm\" gap=\"xl\" className=\"invoice-header--parties\">\n\t\t\t\t<PartyBlock eyebrow={strings.billFrom} name={from.name} location={from.location} />\n\t\t\t\t<PartyBlock eyebrow={strings.billTo} name={to.name} location={to.location} />\n\t\t\t</AdaptiveGrid>\n\n\t\t\t<SummaryPanel className=\"invoice-header--amounts\">\n\t\t\t\t{!!issuedDate && <AmountRow label={strings.issued} amount={issuedDate} />}\n\t\t\t\t{!!dueDate && <AmountRow label={strings.due} amount={dueDate} />}\n\t\t\t\t<AmountRow label={strings.amountDue} amount={amount} total />\n\t\t\t</SummaryPanel>\n\t\t</Card>\n\t);\n}\n\nInvoiceHeader.displayName = 'InvoiceHeader';\n","import type { ReactNode } from 'react';\nimport type { StringsProp } from '../../../../lib/strings';\n\n/** Default line-item shape used by the concise InvoiceLineItems mode. */\nexport interface InvoiceLineItem {\n\t/** Supporting copy shown under the label. */\n\tdescription: string;\n\tqty: number;\n\tprice: number;\n\t/** Total number of records across all pages. */\n\ttotal: number;\n}\n\n/**\n * Per-column definition. Each column declares how to render its header label\n * and a row's cell. Generic over the row type so consumers can pass arbitrary\n * data without losing type safety.\n */\nexport interface InvoiceColumn<TItem = InvoiceLineItem> {\n\t/** Stable identity for this entry. */\n\tid: string;\n\theader: ReactNode;\n\t/** Tailwind class for the column's grid track (e.g. `'1fr'`, `'80px'`). */\n\twidth?: string;\n\talign?: 'left' | 'right' | 'center';\n\tcell: (item: TItem, index: number) => ReactNode;\n\t/** Class names appended to header cell. */\n\theaderClassName?: string;\n\t/** Class names appended to each row cell of this column. */\n\tcellClassName?: string;\n}\n\n/** A footer row (totals, taxes, etc.). Ordered as written. */\nexport interface InvoiceLineItemsFooterRow {\n\t/** Display label. */\n\tlabel: ReactNode;\n\tvalue: ReactNode;\n\t/** Emphasis for the row. `total` renders bold + thicker top spacing. */\n\temphasis?: 'normal' | 'total';\n}\n\nexport interface InvoiceLineItemsStrings {\n\titem: string;\n\tquantity: string;\n\tprice: string;\n\tsubtotal: string;\n\ttax: string;\n\t/** Total number of records across all pages. */\n\ttotal: string;\n}\n\nexport const defaultInvoiceLineItemsStrings: InvoiceLineItemsStrings = {\n\titem: 'Item',\n\tquantity: 'Qty',\n\tprice: 'Price',\n\tsubtotal: 'Subtotal',\n\ttax: 'Tax',\n\ttotal: 'Total',\n};\n\nexport interface InvoiceLineItemsProps<TItem = InvoiceLineItem> {\n\t/** Line items on the invoice. */\n\titems: TItem[];\n\t/** Optional custom columns. Defaults to Description / Qty / Price / Total. */\n\tcolumns?: InvoiceColumn<TItem>[];\n\t/** Optional custom footer rows. When omitted with the default columns, an\n\t * auto-computed subtotal / tax / total footer is used. */\n\tfooterRows?: InvoiceLineItemsFooterRow[];\n\t/** Tax ratio for the default footer (`0.2` means 20%). @default 0.2 */\n\ttaxRate?: number;\n\t/** ISO 4217 code for default monetary cells. Falls back to UIProvider. */\n\tcurrency?: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<InvoiceLineItemsStrings>;\n}\n","/**\n * InvoiceLineItems — flexible invoice line-item table.\n *\n * Generic over the row type. Pass custom `columns` and `footerRows` for any\n * shape of data. Without those, uses the concise default\n * `InvoiceLineItem` shape (description / qty / price / total) with an\n * auto-computed subtotal / tax / total footer.\n */\nimport type { ReactNode } from 'react';\n\nimport { DisplayLabel } from '../../../typography/display-label';\nimport { Text } from '../../../typography/text';\nimport { Separator } from '../../../base/display/separator';\nimport { Stack } from '../../../base/structure';\nimport { Money, Number as NumberValue, Percent, Value } from '../../../primitives';\nimport { useStrings } from '../../../../lib/strings';\nimport { useMoneyConfig } from '../../../../lib/ui-provider';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultInvoiceLineItemsStrings,\n\ttype InvoiceColumn,\n\ttype InvoiceLineItem,\n\ttype InvoiceLineItemsFooterRow,\n\ttype InvoiceLineItemsProps,\n} from './types';\n\nconst wrapperGlass = 'border border-border shadow-sm';\n\nconst ALIGN_CLASS = {\n\tleft: 'text-left justify-start',\n\tright: 'text-right justify-end',\n\tcenter: 'text-center justify-center',\n} as const;\n\nfunction InvoiceCurrencyValue({\n\tamount,\n\tcurrency,\n\tweight = 'regular',\n}: {\n\tamount: number;\n\tcurrency: string;\n\tweight?: 'regular' | 'bold';\n}) {\n\treturn (\n\t\t<Money\n\t\t\tamount={amount}\n\t\t\tcurrency={currency}\n\t\t\tminimumFractionDigits={2}\n\t\t\tmaximumFractionDigits={2}\n\t\t\tweight={weight}\n\t\t/>\n\t);\n}\n\nfunction buildDefaultColumns(\n\tcurrency: string,\n\tstrings: typeof defaultInvoiceLineItemsStrings,\n): InvoiceColumn<InvoiceLineItem>[] {\n\treturn [\n\t\t{\n\t\t\tid: 'description',\n\t\t\theader: strings.item,\n\t\t\twidth: 'minmax(0,1fr)',\n\t\t\tcell: (item) => <Text className=\"break-words\">{item.description}</Text>,\n\t\t},\n\t\t{\n\t\t\tid: 'qty',\n\t\t\theader: strings.quantity,\n\t\t\twidth: '36px',\n\t\t\talign: 'center',\n\t\t\tcell: (item) => <NumberValue value={item.qty} align=\"center\" />,\n\t\t},\n\t\t{\n\t\t\tid: 'price',\n\t\t\theader: strings.price,\n\t\t\twidth: '82px',\n\t\t\talign: 'right',\n\t\t\tcell: (item) => <InvoiceCurrencyValue amount={item.price} currency={currency} />,\n\t\t},\n\t\t{\n\t\t\tid: 'total',\n\t\t\theader: strings.total,\n\t\t\twidth: '82px',\n\t\t\talign: 'right',\n\t\t\tcell: (item) => <InvoiceCurrencyValue amount={item.total} currency={currency} />,\n\t\t},\n\t];\n}\n\nfunction buildDefaultFooterRows(\n\titems: InvoiceLineItem[],\n\ttaxRate: number,\n\tcurrency: string,\n\tstrings: typeof defaultInvoiceLineItemsStrings,\n): InvoiceLineItemsFooterRow[] {\n\tconst subtotal = items.reduce((s, i) => s + i.total, 0);\n\tconst tax = Math.round(subtotal * taxRate * 100) / 100;\n\tconst total = subtotal + tax;\n\treturn [\n\t\t{ label: strings.subtotal, value: <InvoiceCurrencyValue amount={subtotal} currency={currency} /> },\n\t\t{\n\t\t\tlabel: <>{strings.tax} (<Percent value={taxRate} />)</>,\n\t\t\tvalue: <InvoiceCurrencyValue amount={tax} currency={currency} />,\n\t\t},\n\t\t{ label: strings.total, value: <InvoiceCurrencyValue amount={total} currency={currency} weight=\"bold\" />, emphasis: 'total' },\n\t];\n}\n\nexport function InvoiceLineItems<TItem = InvoiceLineItem>({\n\titems,\n\tcolumns,\n\tfooterRows,\n\ttaxRate = 0.2,\n\tcurrency,\n\tclassName,\n\tstrings: stringsProp,\n}: InvoiceLineItemsProps<TItem>) {\n\tconst strings = useStrings(defaultInvoiceLineItemsStrings, stringsProp);\n\tconst { defaultCurrency } = useMoneyConfig();\n\tconst resolvedCurrency = currency ?? defaultCurrency ?? '€';\n\n\t// Boundary casts: the default builders are intentionally non-generic and\n\t// only run in concise default mode where the consumer didn't pass\n\t// `columns`. In that mode the runtime row shape IS `InvoiceLineItem` —\n\t// the cast is the documented bridge between the generic `<TItem>` API\n\t// and the concrete default shape.\n\tconst resolvedColumns: InvoiceColumn<TItem>[] =\n\t\tcolumns ?? (buildDefaultColumns(resolvedCurrency, strings) as unknown as InvoiceColumn<TItem>[]);\n\n\tconst resolvedFooterRows: InvoiceLineItemsFooterRow[] = footerRows\n\t\t?? (columns\n\t\t\t? []\n\t\t\t: buildDefaultFooterRows(items as unknown as InvoiceLineItem[], taxRate, resolvedCurrency, strings));\n\n\tconst gridTemplate = columns ? resolvedColumns.map((c) => c.width ?? '1fr').join(' ') : undefined;\n\tconst defaultGrid = 'grid-cols-3 @lg/invoice-line-items:grid-cols-[minmax(0,1fr)_36px_82px_82px]';\n\n\treturn (\n\t\t<div className={cn('invoice-line-items--component', '@container/invoice-line-items w-full min-w-0 max-w-full overflow-hidden rounded-radius bg-card', wrapperGlass, className)}>\n\t\t\t{/* Header */}\n\t\t\t<div\n\t\t\t\tclassName={cn('invoice-line-items--header min-w-0 gap-space-md bg-muted/50 px-row-x py-row-y', columns ? 'grid' : ['hidden @lg/invoice-line-items:grid', defaultGrid])}\n\t\t\t\tstyle={{ gridTemplateColumns: gridTemplate }}\n\t\t\t>\n\t\t\t\t{resolvedColumns.map((col) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={col.id}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'flex min-w-0',\n\t\t\t\t\t\t\tALIGN_CLASS[col.align ?? 'left'],\n\t\t\t\t\t\t\tcol.headerClassName,\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DisplayLabel className=\"min-w-0 truncate\">\n\t\t\t\t\t\t\t{col.header}\n\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t</div>\n\t\t\t\t))}\n\t\t\t</div>\n\n\t\t\t{/* Rows */}\n\t\t\t{items.map((item, i) => (\n\t\t\t\t<div\n\t\t\t\t\tkey={i}\n\t\t\t\t\tclassName={cn('invoice-line-items--row grid min-w-0 gap-space-md px-row-x py-row-y', !columns && defaultGrid, i % 2 === 1 && 'bg-muted/30')}\n\t\t\t\t\tstyle={{ gridTemplateColumns: gridTemplate }}\n\t\t\t\t>\n\t\t\t\t\t{resolvedColumns.map((col) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={col.id}\n\t\t\t\t\t\t\tdata-column={col.id}\n\t\t\t\t\t\t\tclassName={cn('min-w-0', columns ? ['flex items-center', ALIGN_CLASS[col.align ?? 'left']] : col.id === 'description' ? 'col-span-full @lg/invoice-line-items:col-span-1' : ['grid gap-space-xs', col.align === 'center' ? 'text-center justify-items-center' : 'text-right justify-items-end'], col.cellClassName)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!columns && col.id !== 'description' && <DisplayLabel className=\"@lg/invoice-line-items:hidden\">{col.header}</DisplayLabel>}\n\t\t\t\t\t\t\t{col.cell(item, i)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t))}\n\n\t\t\t{/* Footer */}\n\t\t\t{resolvedFooterRows.length > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<Separator />\n\t\t\t\t\t<div className=\"invoice-line-items--footer p-surface\">\n\t\t\t\t\t<Stack gap=\"sm\">\n\t\t\t\t\t\t{resolvedFooterRows.map((row, idx) => (\n\t\t\t\t\t\t\t<Stack\n\t\t\t\t\t\t\t\tkey={idx}\n\t\t\t\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\t\t\tjustify=\"between\"\n\t\t\t\t\t\t\t\talign=\"baseline\"\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\trow.emphasis === 'total' && 'pt-space-md',\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\ttype={row.emphasis === 'total' ? undefined : 'secondary'}\n\t\t\t\t\t\t\t\t\tweight={row.emphasis === 'total' ? 'bold' : 'regular'}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{row.label}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t{isSimpleText(row.value) ? (\n\t\t\t\t\t\t\t\t\t<Value weight={row.emphasis === 'total' ? 'bold' : 'regular'}>\n\t\t\t\t\t\t\t\t\t\t{row.value}\n\t\t\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<div className=\"invoice-line-items--footer-value shrink-0\">{row.value}</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Stack>\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nInvoiceLineItems.displayName = 'InvoiceLineItems';\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n","import { ContentBlock } from '../../../base/display';\nimport { cn } from '../../../../lib/utils';\n\nimport { Timeline, type TimelineItem } from '../../timelines';\nimport type { OrderTimelineProps } from './types';\n\nexport function OrderTimeline({\n\ttitle,\n\tdescription,\n\tevents,\n\tfooterText,\n\tclassName,\n}: OrderTimelineProps) {\n\tconst items: TimelineItem[] = events.map((event) => ({\n\t\tid: event.id,\n\t\ttitle: event.title,\n\t\tdescription: event.description,\n\t\ttimestamp: event.timestamp,\n\t\tstatus: event.status,\n\t}));\n\n\treturn (\n\t\t<ContentBlock\n\t\t\tdata-component=\"order-timeline\"\n\t\t\tdata-slot=\"order-timeline\"\n\t\t\ttitle={title}\n\t\t\tdescription={description}\n\t\t\tfooterText={footerText}\n\t\t\tclassName={cn('order-timeline--component', className)}\n\t\t>\n\t\t\t<Timeline items={items} />\n\t\t</ContentBlock>\n\t);\n}\n\nOrderTimeline.displayName = 'OrderTimeline';\n","import { Value } from '../../../primitives';\nimport { cn } from '../../../../lib/utils';\n\nimport { Timeline, type TimelineItem } from '../../timelines';\nimport type { PaymentTimelineProps } from './types';\n\nexport function PaymentTimeline({ events, className }: PaymentTimelineProps) {\n\tconst items: TimelineItem[] = events.map((event, index) => ({\n\t\tid: `${event.label}-${String(index)}`,\n\t\ttitle: event.label,\n\t\tdescription: event.date,\n\t\ticon: event.icon,\n\t\tstatus: event.done ? 'success' : 'pending',\n\t\tchildren: event.amount ? (\n\t\t\t// An event amount is an ordinary figure, not a signed delta: foreground.\n\t\t\t<Value weight=\"medium\" className=\"tabular-nums\">\n\t\t\t\t{event.amount}\n\t\t\t</Value>\n\t\t) : undefined,\n\t}));\n\n\treturn (\n\t\t<div\n\t\t\tdata-component=\"payment-timeline\"\n\t\t\tdata-slot=\"payment-timeline\"\n\t\t\tclassName={cn('payment-timeline--component min-w-0', className)}\n\t\t>\n\t\t\t<Timeline items={items} dotSize=\"lg\" />\n\t\t</div>\n\t);\n}\n\nPaymentTimeline.displayName = 'PaymentTimeline';\n","import type { SelectOption } from '../../../base/choice-inputs';\nimport type { WeightUnit } from '../../../base/forms-numeric';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type InventoryPolicy = 'deny' | 'continue';\nexport type InventoryStatus = 'in_stock' | 'low_stock' | 'out_of_stock' | 'untracked';\n\nexport interface InventorySectionValue {\n\tsku?: string;\n\tbarcode?: string;\n\ttrackQuantity?: boolean;\n\tavailable?: string;\n\tcommitted?: string;\n\tincoming?: string;\n\tlowStockThreshold?: string;\n\tinventoryPolicy?: InventoryPolicy;\n\tlocationId?: string;\n\tbinLocation?: string;\n\trequiresShipping?: boolean;\n\tweight?: string;\n\tweightUnit?: WeightUnit;\n\tcountryOfOrigin?: string;\n\thsCode?: string;\n\ttags?: string[];\n}\n\nexport type InventorySectionField = keyof InventorySectionValue;\n\nexport type InventorySectionName =\n\t| 'summary'\n\t| 'identity'\n\t| 'tracking'\n\t| 'location'\n\t| 'shipping'\n\t| 'customs'\n\t| 'tags';\n\nexport interface InventorySectionChange {\n\tfield: InventorySectionField;\n\tvalue: InventorySectionValue[InventorySectionField];\n\tpreviousValue: InventorySectionValue[InventorySectionField];\n}\n\nexport interface InventorySectionMetric {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Display label. */\n\tlabel: string;\n\tvalue: string;\n\t/** Supporting copy shown under the label. */\n\tdescription?: string;\n\t/**\n\t * Semantic tone of the entry. Not rendered by the summary: stats are plain\n\t * and the title badge carries the stock state. Kept for type compatibility.\n\t */\n\ttone?: 'default' | 'success' | 'warning' | 'error' | 'info';\n}\n\nexport interface InventorySectionStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Supporting copy shown under the label. */\n\tdescription: string;\n\tstatus: Record<InventoryStatus, string>;\n\tsections: Record<Exclude<InventorySectionName, 'summary'>, string>;\n\tfields: Record<InventorySectionField, string>;\n\tplaceholders: Partial<Record<InventorySectionField, string>>;\n\thints: Partial<Record<InventorySectionField, string>>;\n\t/** Overflow menu for the surface as a whole. */\n\tactions: {\n\t\tgenerateSku: string;\n\t\trestock: string;\n\t};\n\tpolicyOptions: Record<InventoryPolicy, {\n\t\tlabel: string;\n\t\tdescription: string;\n\t}>;\n\tsummary: {\n\t\tavailable: string;\n\t\tcommitted: string;\n\t\tincoming: string;\n\t\tthreshold: string;\n\t\tuntracked: string;\n\t};\n\ttagInput: {\n\t\tplaceholder: string;\n\t\temptyRecommendations: string;\n\t\tclearAll: string;\n\t\tsummary: (current: number, max: number) => string;\n\t};\n}\n\nexport const defaultInventorySectionStrings: InventorySectionStrings = {\n\ttitle: 'Inventory',\n\tdescription: 'Manage stock tracking, availability, fulfillment, and compliance details.',\n\tstatus: {\n\t\tin_stock: 'In stock',\n\t\tlow_stock: 'Low stock',\n\t\tout_of_stock: 'Out of stock',\n\t\tuntracked: 'Not tracked',\n\t},\n\tsections: {\n\t\tidentity: 'Identifiers',\n\t\ttracking: 'Stock tracking',\n\t\tlocation: 'Location',\n\t\tshipping: 'Shipping',\n\t\tcustoms: 'Customs',\n\t\ttags: 'Tags',\n\t},\n\tfields: {\n\t\tsku: 'SKU',\n\t\tbarcode: 'Barcode',\n\t\ttrackQuantity: 'Track quantity',\n\t\tavailable: 'Available',\n\t\tcommitted: 'Committed',\n\t\tincoming: 'Incoming',\n\t\tlowStockThreshold: 'Low-stock threshold',\n\t\tinventoryPolicy: 'When sold out',\n\t\tlocationId: 'Stock location',\n\t\tbinLocation: 'Bin / shelf',\n\t\trequiresShipping: 'Requires shipping',\n\t\tweight: 'Weight',\n\t\tweightUnit: 'Weight unit',\n\t\tcountryOfOrigin: 'Country of origin',\n\t\thsCode: 'HS code',\n\t\ttags: 'Inventory tags',\n\t},\n\tplaceholders: {\n\t\tsku: 'BAL-750-CL',\n\t\tbarcode: 'Scan or enter barcode',\n\t\tavailable: '0',\n\t\tcommitted: '0',\n\t\tincoming: '0',\n\t\tlowStockThreshold: '5',\n\t\tlocationId: 'Select location',\n\t\tbinLocation: 'Aisle / shelf / bin',\n\t\tweight: '0.00',\n\t\tcountryOfOrigin: 'Country code or name',\n\t\thsCode: 'e.g. 2204.21',\n\t\ttags: 'Add tag...',\n\t},\n\thints: {\n\t\tsku: 'Internal stock keeping unit.',\n\t\tbarcode: 'GTIN, UPC, EAN, ISBN, or internal scan code.',\n\t\tavailable: 'Units currently sellable at this location.',\n\t\tcommitted: 'Units already reserved by open orders.',\n\t\tincoming: 'Units expected from transfers, suppliers, or production.',\n\t\tlowStockThreshold: 'Used for low-stock warnings.',\n\t\tinventoryPolicy: 'Choose whether checkout should block when inventory reaches zero.',\n\t\tlocationId: 'Where this inventory is stocked or fulfilled from.',\n\t\tbinLocation: 'Optional warehouse shelf, bay, or bin reference.',\n\t\tweight: 'Used for shipping rates and fulfillment labels.',\n\t\tcountryOfOrigin: 'Required for international customs in many markets.',\n\t\thsCode: 'Harmonized System tariff code for customs.',\n\t\ttags: 'Optional operational labels such as preorder, seasonal, or batch codes.',\n\t},\n\tactions: {\n\t\tgenerateSku: 'Generate SKU',\n\t\trestock: 'Restock',\n\t},\n\tpolicyOptions: {\n\t\tdeny: {\n\t\t\tlabel: 'Stop selling',\n\t\t\tdescription: 'Block checkout when available inventory reaches zero.',\n\t\t},\n\t\tcontinue: {\n\t\t\tlabel: 'Continue selling',\n\t\t\tdescription: 'Allow backorders or made-to-order fulfillment.',\n\t\t},\n\t},\n\tsummary: {\n\t\tavailable: 'Available',\n\t\tcommitted: 'Committed',\n\t\tincoming: 'Incoming',\n\t\tthreshold: 'Low-stock at',\n\t\tuntracked: 'Inventory is not tracked for this product.',\n\t},\n\ttagInput: {\n\t\tplaceholder: 'Add inventory tag...',\n\t\temptyRecommendations: 'No matching tags.',\n\t\tclearAll: 'Clear tags',\n\t\tsummary: (current, max) => `${current} / ${max} tags`,\n\t},\n};\n\nexport interface InventorySectionCardProps {\n\t/** Current field values for every inventory section. Controlled. */\n\tvalue: InventorySectionValue;\n\t/** Fired with the next value. */\n\tonValueChange?: (value: InventorySectionValue, change: InventorySectionChange) => void;\n\t/** Validation messages keyed by field, rendered under the matching control. */\n\terrors?: Partial<Record<InventorySectionField, string>>;\n\t/** Renders the entry as unselectable. */\n\tdisabled?: boolean;\n\t/** Renders every field as read-only text instead of an editable control. */\n\treadOnly?: boolean;\n\t/** Which sections are shown. Omitted sections default to visible. */\n\tvisibleSections?: Partial<Record<InventorySectionName, boolean>>;\n\t/** Which individual fields are shown. Omitted fields default to visible. */\n\tvisibleFields?: Partial<Record<InventorySectionField, boolean>>;\n\t/** Choices for the stock-location select. */\n\tlocationOptions?: SelectOption[];\n\t/** Choices for the country-of-origin select. */\n\tcountryOptions?: SelectOption[];\n\t/** Suggested tags offered beneath the tag input. */\n\ttagRecommendations?: string[];\n\t/** Caps how many tags may be added. */\n\tmaxTags?: number;\n\tonGenerateSku?: (value: InventorySectionValue) => string | void;\n\tonRestock?: (value: InventorySectionValue) => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<InventorySectionStrings>;\n}\n","/**\n * InventorySectionCard — controlled commerce inventory form card.\n *\n * The component owns no persistence and performs no routing. Consumers pass a\n * `value` object, receive field-level `onValueChange` updates, and decide how to\n * submit or validate. Section and field visibility props let apps reuse the\n * same surface for physical products, digital products, variants, and location\n * level inventory without forking the component.\n */\nimport { Badge, type BadgeTone } from '../../../base/badge';\nimport { EMPTY } from '../../../../lib/format';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { CardRadioGroup, Select, ToggleField } from '../../../base/choice-inputs';\nimport { FormField } from '../../../base/forms';\nimport { Input } from '../../../base/text-inputs';\nimport { TagsInput } from '../../../base/value-inputs';\nimport { DecimalInput, WeightInput } from '../../../base/forms-numeric';\nimport { Grid, Stack } from '../../../base/structure';\nimport { Value } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultInventorySectionStrings,\n\ttype InventoryPolicy,\n\ttype InventorySectionCardProps,\n\ttype InventorySectionField,\n\ttype InventorySectionMetric,\n\ttype InventorySectionName,\n\ttype InventorySectionValue,\n\ttype InventoryStatus,\n} from './types';\n\nconst STATUS_VARIANT: Record<InventoryStatus, BadgeTone> = {\n\tin_stock: 'success',\n\tlow_stock: 'warning',\n\tout_of_stock: 'destructive',\n\tuntracked: 'secondary',\n};\n\nfunction parseQuantity(value?: string): number | undefined {\n\tif (value === undefined || value.trim() === '') return undefined;\n\tconst parsed = Number(value);\n\treturn Number.isFinite(parsed) ? parsed : undefined;\n}\n\nfunction getInventoryStatus(value: InventorySectionValue): InventoryStatus {\n\tconst isTracked = value.trackQuantity ?? true;\n\tif (!isTracked) return 'untracked';\n\n\tconst available = parseQuantity(value.available) ?? 0;\n\tif (available <= 0) return 'out_of_stock';\n\n\tconst threshold = parseQuantity(value.lowStockThreshold);\n\tif (threshold !== undefined && available <= threshold) return 'low_stock';\n\n\treturn 'in_stock';\n}\n\nfunction SectionHeading({ children, className }: { children: string; className?: string }) {\n\treturn (\n\t\t<Text weight=\"semibold\" className={cn('inventory-section-card--section-title', className)}>\n\t\t\t{children}\n\t\t</Text>\n\t);\n}\n\n// A plain stat: no tile and no tint. Stock state is stated once, by the\n// status badge beside the title.\nfunction SummaryMetric({ metric }: { metric: InventorySectionMetric }) {\n\treturn (\n\t\t<div className=\"inventory-section-card--metric min-w-0\">\n\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t{metric.label}\n\t\t\t</Text>\n\t\t\t<Value weight=\"semibold\" className=\"tabular-nums\">\n\t\t\t\t{metric.value}\n\t\t\t</Value>\n\t\t\t{!!metric.description && (\n\t\t\t\t<Text size=\"xs\" type=\"secondary\" lineHeight=\"snug\">\n\t\t\t\t\t{metric.description}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nexport function InventorySectionCard({\n\tvalue,\n\tonValueChange,\n\terrors,\n\tdisabled = false,\n\treadOnly = false,\n\tvisibleSections,\n\tvisibleFields,\n\tlocationOptions = [],\n\tcountryOptions = [],\n\ttagRecommendations,\n\tmaxTags,\n\tonGenerateSku,\n\tonRestock,\n\tclassName,\n\tstrings: stringsProp,\n}: InventorySectionCardProps) {\n\tconst strings = useStrings(defaultInventorySectionStrings, stringsProp);\n\tconst status = getInventoryStatus(value);\n\tconst isDisabled = disabled || readOnly;\n\tconst isTracked = value.trackQuantity ?? true;\n\tconst requiresShipping = value.requiresShipping ?? true;\n\tconst shippingFieldsDisabled = isDisabled || !requiresShipping;\n\n\tconst isSectionVisible = (section: InventorySectionName) => visibleSections?.[section] !== false;\n\tconst isFieldVisible = (field: InventorySectionField) => visibleFields?.[field] !== false;\n\n\tconst updateField = <TField extends InventorySectionField>(\n\t\tfield: TField,\n\t\tnextValue: InventorySectionValue[TField],\n\t) => {\n\t\tconst previousValue = value[field];\n\t\tconst next = {\n\t\t\t...value,\n\t\t\t[field]: nextValue,\n\t\t};\n\n\t\tonValueChange?.(next, {\n\t\t\tfield,\n\t\t\tvalue: nextValue,\n\t\t\tpreviousValue,\n\t\t});\n\t};\n\n\tconst handleGenerateSku = () => {\n\t\tif (!onGenerateSku || isDisabled) return;\n\t\tconst generatedSku = onGenerateSku(value);\n\t\tif (typeof generatedSku === 'string') {\n\t\t\tupdateField('sku', generatedSku);\n\t\t}\n\t};\n\n\tconst metrics: InventorySectionMetric[] = [\n\t\t{\n\t\t\tid: 'available',\n\t\t\tlabel: strings.summary.available,\n\t\t\tvalue: isTracked ? value.available || '0' : EMPTY,\n\t\t\t// `summary.threshold` is the *label* of the low-stock tile, not a\n\t\t\t// sentence — using it here rendered a dangling \"Low-stock at\" under\n\t\t\t// the available count with no number attached, duplicating a tile\n\t\t\t// that already carries both. Only the untracked case needs a caption,\n\t\t\t// to explain why the value reads \"-\".\n\t\t\tdescription: isTracked ? undefined : strings.summary.untracked,\n\t\t},\n\t\t{\n\t\t\tid: 'committed',\n\t\t\tlabel: strings.summary.committed,\n\t\t\tvalue: value.committed || '0',\n\t\t},\n\t\t{\n\t\t\tid: 'incoming',\n\t\t\tlabel: strings.summary.incoming,\n\t\t\tvalue: value.incoming || '0',\n\t\t},\n\t\t{\n\t\t\tid: 'threshold',\n\t\t\tlabel: strings.summary.threshold,\n\t\t\tvalue: value.lowStockThreshold || '-',\n\t\t},\n\t];\n\n\treturn (\n\t\t// Card (flat, no inset) instead of the deprecated ContentBlock adapter so\n\t\t// the region gap can replace the old header rule: the header keeps the\n\t\t// framed-card distance from its body, and sections sit a step further\n\t\t// apart than the rows inside them.\n\t\t<Card\n\t\t\tsurface=\"flat\"\n\t\t\tpadding=\"none\"\n\t\t\tgap=\"xl\"\n\t\t\ttitle={strings.title}\n\t\t\tdescription={strings.description}\n\t\t\ttitleSuffix={<Badge tone={STATUS_VARIANT[status]}>{strings.status[status]}</Badge>}\n\t\t\theaderAction={\n\t\t\t\t<Stack\n\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\tclassName=\"w-full @md/inventory-section-card:w-auto @md/inventory-section-card:justify-end\"\n\t\t\t\t>\n\t\t\t\t\t{!!onGenerateSku && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tonClick={handleGenerateSku}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.actions.generateSku}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!onRestock && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tonClick={() => onRestock(value)}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.actions.restock}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t}\n\t\t\tclassName={cn('inventory-section-card--component @container/inventory-section-card w-full', className)}\n\t\t\tcontentGap=\"2xl\"\n\t\t>\n\t\t\t{!!isSectionVisible('summary') && (\n\t\t\t\t<div className=\"inventory-section-card--summary grid min-w-0 grid-cols-1 gap-space-xl @md/inventory-section-card:grid-cols-2 @3xl/inventory-section-card:grid-cols-4\">\n\t\t\t\t\t{metrics.map((metric) => (\n\t\t\t\t\t\t<SummaryMetric key={metric.id} metric={metric} />\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('identity') && (\n\t\t\t\t<Stack render={<section />} gap=\"md\" className=\"inventory-section-card--identity\">\n\t\t\t\t\t<SectionHeading>{strings.sections.identity}</SectionHeading>\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t{!!isFieldVisible('sku') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.sku} error={errors?.sku} hint={strings.hints.sku}>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tvalue={value.sku ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('sku', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.sku}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.sku}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('barcode') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.barcode} error={errors?.barcode} hint={strings.hints.barcode}>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tvalue={value.barcode ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('barcode', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.barcode}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.barcode}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Grid>\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('tracking') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--tracking\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.tracking}</SectionHeading>\n\t\t\t\t\t{!!isFieldVisible('trackQuantity') && (\n\t\t\t\t\t\t<ToggleField\n\t\t\t\t\t\t\tlabel={strings.fields.trackQuantity}\n\t\t\t\t\t\t\tdescription={strings.hints.available}\n\t\t\t\t\t\t\tvalue={isTracked}\n\t\t\t\t\t\t\tonValueChange={(checked) => updateField('trackQuantity', checked)}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t<div className=\"inventory-section-card--tracking-grid grid min-w-0 grid-cols-1 gap-space-xl @md/inventory-section-card:grid-cols-2 @3xl/inventory-section-card:grid-cols-4\">\n\t\t\t\t\t\t{!!isFieldVisible('available') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.available} error={errors?.available} hint={strings.hints.available}>\n\t\t\t\t\t\t\t\t<DecimalInput\n\t\t\t\t\t\t\t\t\tvalue={value.available ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('available', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.available}\n\t\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\t\tdecimalPlaces={0}\n\t\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.available}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('committed') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.committed} error={errors?.committed} hint={strings.hints.committed}>\n\t\t\t\t\t\t\t\t<DecimalInput\n\t\t\t\t\t\t\t\t\tvalue={value.committed ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('committed', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.committed}\n\t\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\t\tdecimalPlaces={0}\n\t\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.committed}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('incoming') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.incoming} error={errors?.incoming} hint={strings.hints.incoming}>\n\t\t\t\t\t\t\t\t<DecimalInput\n\t\t\t\t\t\t\t\t\tvalue={value.incoming ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('incoming', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.incoming}\n\t\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\t\tdecimalPlaces={0}\n\t\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.incoming}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('lowStockThreshold') && (\n\t\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\t\tlabel={strings.fields.lowStockThreshold}\n\t\t\t\t\t\t\t\terror={errors?.lowStockThreshold}\n\t\t\t\t\t\t\t\thint={strings.hints.lowStockThreshold}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<DecimalInput\n\t\t\t\t\t\t\t\t\tvalue={value.lowStockThreshold ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('lowStockThreshold', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.lowStockThreshold}\n\t\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\t\tdecimalPlaces={0}\n\t\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.lowStockThreshold}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t{!!isFieldVisible('inventoryPolicy') && (\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tlabel={strings.fields.inventoryPolicy}\n\t\t\t\t\t\t\terror={errors?.inventoryPolicy}\n\t\t\t\t\t\t\thint={strings.hints.inventoryPolicy}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CardRadioGroup\n\t\t\t\t\t\t\t\tcolumns={2}\n\t\t\t\t\t\t\t\tvalue={value.inventoryPolicy ?? 'deny'}\n\t\t\t\t\t\t\t\tonValueChange={(nextValue) => updateField('inventoryPolicy', nextValue as InventoryPolicy)}\n\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\tinvalid={!!errors?.inventoryPolicy}\n\t\t\t\t\t\t\t\toptions={[\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvalue: 'deny',\n\t\t\t\t\t\t\t\t\t\tlabel: strings.policyOptions.deny.label,\n\t\t\t\t\t\t\t\t\t\tdescription: strings.policyOptions.deny.description,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvalue: 'continue',\n\t\t\t\t\t\t\t\t\t\tlabel: strings.policyOptions.continue.label,\n\t\t\t\t\t\t\t\t\t\tdescription: strings.policyOptions.continue.description,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FormField>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('location') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--location\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.location}</SectionHeading>\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t{!!isFieldVisible('locationId') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.locationId} error={errors?.locationId} hint={strings.hints.locationId}>\n\t\t\t\t\t\t\t\t{locationOptions.length > 0 ? (\n\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\tvalue={value.locationId ?? null}\n\t\t\t\t\t\t\t\t\t\tonValueChange={(nextValue) => updateField('locationId', nextValue)}\n\t\t\t\t\t\t\t\t\t\toptions={locationOptions}\n\t\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.locationId}\n\t\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\t\tinvalid={!!errors?.locationId}\n\t\t\t\t\t\t\t\t\t\tallowClear\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\tvalue={value.locationId ?? ''}\n\t\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('locationId', event.target.value)}\n\t\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.locationId}\n\t\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\t\tinvalid={!!errors?.locationId}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('binLocation') && (\n\t\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\t\tlabel={strings.fields.binLocation}\n\t\t\t\t\t\t\t\terror={errors?.binLocation}\n\t\t\t\t\t\t\t\thint={strings.hints.binLocation}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tvalue={value.binLocation ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('binLocation', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.binLocation}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.binLocation}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Grid>\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('shipping') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--shipping\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.shipping}</SectionHeading>\n\t\t\t\t\t{!!isFieldVisible('requiresShipping') && (\n\t\t\t\t\t\t<ToggleField\n\t\t\t\t\t\t\tlabel={strings.fields.requiresShipping}\n\t\t\t\t\t\t\tdescription={strings.hints.weight}\n\t\t\t\t\t\t\tvalue={requiresShipping}\n\t\t\t\t\t\t\tonValueChange={(checked) => updateField('requiresShipping', checked)}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!isFieldVisible('weight') && (\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tlabel={strings.fields.weight}\n\t\t\t\t\t\t\terror={errors?.weight ?? errors?.weightUnit}\n\t\t\t\t\t\t\thint={strings.hints.weight}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<WeightInput\n\t\t\t\t\t\t\t\tvalue={value.weight ?? ''}\n\t\t\t\t\t\t\t\tunit={value.weightUnit ?? 'kg'}\n\t\t\t\t\t\t\t\tonChange={(event) => updateField('weight', event.target.value)}\n\t\t\t\t\t\t\t\tonUnitChange={(unit) => updateField('weightUnit', unit)}\n\t\t\t\t\t\t\t\tdisabled={shippingFieldsDisabled}\n\t\t\t\t\t\t\t\tinvalid={!!errors?.weight || !!errors?.weightUnit}\n\t\t\t\t\t\t\t\tdecimalPlaces={2}\n\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FormField>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('customs') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--customs\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.customs}</SectionHeading>\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t{!!isFieldVisible('countryOfOrigin') && (\n\t\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\t\tlabel={strings.fields.countryOfOrigin}\n\t\t\t\t\t\t\t\terror={errors?.countryOfOrigin}\n\t\t\t\t\t\t\t\thint={strings.hints.countryOfOrigin}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{countryOptions.length > 0 ? (\n\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\tvalue={value.countryOfOrigin ?? null}\n\t\t\t\t\t\t\t\t\t\tonValueChange={(nextValue) => updateField('countryOfOrigin', nextValue)}\n\t\t\t\t\t\t\t\t\t\toptions={countryOptions}\n\t\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.countryOfOrigin}\n\t\t\t\t\t\t\t\t\t\tdisabled={shippingFieldsDisabled}\n\t\t\t\t\t\t\t\t\t\tinvalid={!!errors?.countryOfOrigin}\n\t\t\t\t\t\t\t\t\t\tallowClear\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\tvalue={value.countryOfOrigin ?? ''}\n\t\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('countryOfOrigin', event.target.value)}\n\t\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.countryOfOrigin}\n\t\t\t\t\t\t\t\t\t\tdisabled={shippingFieldsDisabled}\n\t\t\t\t\t\t\t\t\t\tinvalid={!!errors?.countryOfOrigin}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('hsCode') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.hsCode} error={errors?.hsCode} hint={strings.hints.hsCode}>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tvalue={value.hsCode ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('hsCode', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.hsCode}\n\t\t\t\t\t\t\t\t\tdisabled={shippingFieldsDisabled}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.hsCode}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Grid>\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('tags') && !!isFieldVisible('tags') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--tags\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.tags}</SectionHeading>\n\t\t\t\t\t<FormField label={strings.fields.tags} error={errors?.tags} hint={strings.hints.tags}>\n\t\t\t\t\t\t<TagsInput\n\t\t\t\t\t\t\tvalue={value.tags ?? []}\n\t\t\t\t\t\t\tonValueChange={(nextTags) => updateField('tags', nextTags)}\n\t\t\t\t\t\t\trecommendations={tagRecommendations}\n\t\t\t\t\t\t\tmaxTags={maxTags}\n\t\t\t\t\t\t\tshowMaxTags={maxTags !== undefined}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\tinvalid={!!errors?.tags}\n\t\t\t\t\t\t\tstrings={strings.tagInput}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FormField>\n\t\t\t\t</Stack>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nInventorySectionCard.displayName = 'InventorySectionCard';\n","/**\n * The order vocabularies the order surfaces share. Goods and money move\n * independently (\"refunded, still unfulfilled\"), so an order carries two status\n * axes. Each union has exactly one tone map, and no order surface takes a tone\n * prop that could disagree with its status.\n *\n * Primary stays off every status chip: it is the one main command. A state the\n * order is moving through reads `info`; a starting state that needs attention\n * reads `warning`, not `destructive`.\n */\nimport type { BadgeTone } from '../../../base/badge';\n\n/** Where the goods are. */\nexport type FulfillmentStatus =\n\t| 'unfulfilled'\n\t| 'partiallyFulfilled'\n\t| 'fulfilled'\n\t| 'scheduled'\n\t| 'onHold'\n\t| 'cancelled';\n\nexport const fulfillmentStatusTone: Record<FulfillmentStatus, BadgeTone> = {\n\t// Warning, not destructive: unfulfilled is the starting state, not a failure.\n\tunfulfilled: 'warning',\n\tpartiallyFulfilled: 'warning',\n\tfulfilled: 'success',\n\tscheduled: 'info',\n\tonHold: 'neutral',\n\tcancelled: 'destructive',\n};\n\n/** Where the money is. */\nexport type PaymentStatus =\n\t| 'pending'\n\t| 'authorized'\n\t| 'paid'\n\t| 'partiallyRefunded'\n\t| 'refunded'\n\t| 'voided';\n\nexport const paymentStatusTone: Record<PaymentStatus, BadgeTone> = {\n\tpending: 'warning',\n\t// Authorized is money promised, not money taken: information, not success.\n\tauthorized: 'info',\n\tpaid: 'success',\n\tpartiallyRefunded: 'neutral',\n\trefunded: 'neutral',\n\tvoided: 'neutral',\n};\n\n/** What was attempted against the payment method. */\nexport type TransactionKind =\n\t| 'authorization'\n\t| 'capture'\n\t| 'sale'\n\t| 'refund'\n\t| 'void'\n\t| 'chargeback';\n\n/** Whether the attempt worked. */\nexport type TransactionStatus = 'success' | 'pending' | 'failure';\n\nexport const transactionStatusTone: Record<TransactionStatus, BadgeTone> = {\n\tsuccess: 'success',\n\tpending: 'warning',\n\tfailure: 'destructive',\n};\n\n/** Kinds that take money out of the merchant. They set the sign; callers pass the magnitude. */\nexport const outgoingTransactionKinds: ReadonlySet<TransactionKind> = new Set<TransactionKind>([\n\t'refund',\n\t'void',\n\t'chargeback',\n]);\n\n/** A postal address as an order carries it. `AddressCard` keeps its own flat props. */\nexport interface OrderAddress {\n\t/** Recipient. */\n\tname?: string;\n\t/** Street address. */\n\tline1: string;\n\t/** Apartment, suite, or unit. */\n\tline2?: string;\n\t/** City or town. */\n\tcity: string;\n\t/** State, province, or region. */\n\tregion?: string;\n\t/** Postal or ZIP code. */\n\tpostalCode?: string;\n\t/** Country name or code. */\n\tcountry: string;\n\t/** Contact number for the delivery. */\n\tphone?: string;\n}\n\n/** The words for both status axes. Tones stay derived from the status. */\nexport interface OrderStatusVocabulary {\n\t/** Label for each `FulfillmentStatus`. */\n\tfulfillment: Record<FulfillmentStatus, string>;\n\t/** Label for each `PaymentStatus`. */\n\tpayment: Record<PaymentStatus, string>;\n}\n\nexport const defaultOrderStatusVocabulary: OrderStatusVocabulary = {\n\tfulfillment: {\n\t\tunfulfilled: 'Unfulfilled',\n\t\tpartiallyFulfilled: 'Partially fulfilled',\n\t\tfulfilled: 'Fulfilled',\n\t\tscheduled: 'Scheduled',\n\t\tonHold: 'On hold',\n\t\tcancelled: 'Cancelled',\n\t},\n\tpayment: {\n\t\tpending: 'Pending',\n\t\tauthorized: 'Authorized',\n\t\tpaid: 'Paid',\n\t\tpartiallyRefunded: 'Partially refunded',\n\t\trefunded: 'Refunded',\n\t\tvoided: 'Voided',\n\t},\n};\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { ActionMenuAction, ActionMenuProps } from '../../../base/action-menu';\nimport type { HeadingTag } from '../../../typography';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport {\n\tdefaultOrderStatusVocabulary,\n\ttype FulfillmentStatus,\n\ttype OrderStatusVocabulary,\n\ttype PaymentStatus,\n} from '../shared/order-status';\n\nexport interface OrderHeaderStrings extends OrderStatusVocabulary {\n\t/** Writes the order's own reference: \"#1036\". */\n\tformatOrderNumber: (orderNumber: string) => string;\n\t/** Joins when the order was placed to where it came from. */\n\tformatOrigin: (placedAt: string, source: string) => string;\n\t/** Accessible name of the actions menu trigger. */\n\tmoreActions: string;\n}\n\nexport const defaultOrderHeaderStrings: OrderHeaderStrings = {\n\t...defaultOrderStatusVocabulary,\n\tformatOrderNumber: (orderNumber) => `#${orderNumber}`,\n\tformatOrigin: (placedAt, source) => `${placedAt} from ${source}`,\n\tmoreActions: 'More actions',\n};\n\nexport interface OrderHeaderProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {\n\t/** The order's reference, without the leading sign `formatOrderNumber` adds. */\n\torderNumber: string;\n\t/** Where the goods are. Independent of payment. */\n\tfulfillmentStatus?: FulfillmentStatus;\n\t/**\n\t * Where the money is. Both statuses, one, or neither read correctly: an\n\t * order with nothing to ship has no fulfillment state to state.\n\t */\n\tpaymentStatus?: PaymentStatus;\n\t/** Already formatted. */\n\tplacedAt?: string;\n\t/** Where the order came from: a channel, an app, an import. */\n\tsource?: string;\n\t/** Order commands, offered from one actions menu at the end of the title row. */\n\tactions?: readonly ActionMenuAction[];\n\t/** Renders `href` actions through the consumer's router. */\n\trenderLink?: ActionMenuProps['renderLink'];\n\t/** Heading level of the order number. Defaults to `h1`: the order is the page's subject. */\n\theadingTag?: HeadingTag;\n\t/** Overrides this header's own copy, including the status words. */\n\tstrings?: StringsProp<OrderHeaderStrings>;\n}\n","/**\n * OrderHeader — the order page's title row: the order number as the page\n * heading, a status chip for each axis the order moves on, and the order's\n * commands in one actions menu, with where and when the order was placed\n * beneath.\n *\n * Goods and money move independently (\"refunded, still unfulfilled\"), so the\n * payment and fulfillment chips are separate, and each renders only when its\n * status is given. Their words come from `strings`; their tones are derived\n * from the status and cannot disagree with it.\n */\nimport { ActionMenu } from '../../../base/action-menu';\nimport { Badge } from '../../../base/badge';\nimport { Stack } from '../../../base/structure';\nimport { Heading, Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { fulfillmentStatusTone, paymentStatusTone } from '../shared/order-status';\nimport { defaultOrderHeaderStrings, type OrderHeaderProps } from './types';\n\nexport function OrderHeader({\n\torderNumber,\n\tfulfillmentStatus,\n\tpaymentStatus,\n\tplacedAt,\n\tsource,\n\tactions,\n\trenderLink,\n\theadingTag = 'h1',\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: OrderHeaderProps) {\n\tconst strings = useStrings(defaultOrderHeaderStrings, stringsProp);\n\n\t// Date, source, both or neither.\n\tconst origin =\n\t\tplacedAt && source\n\t\t\t? strings.formatOrigin(placedAt, source)\n\t\t\t: placedAt || source || undefined;\n\n\treturn (\n\t\t<Stack\n\t\t\t{...props}\n\t\t\tgap=\"xs\"\n\t\t\tdata-slot=\"order-header\"\n\t\t\tclassName={cn('order-header--component min-w-0', className)}\n\t\t>\n\t\t\t<Stack direction=\"horizontal\" gap=\"md\" align=\"center\" wrap={false} className=\"order-header--title-row min-w-0\">\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"md\" align=\"center\" wrap className=\"order-header--title-line min-w-0 flex-1\">\n\t\t\t\t\t<Heading tag={headingTag} size=\"lg\" className=\"order-header--number\">\n\t\t\t\t\t\t{strings.formatOrderNumber(orderNumber)}\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{!!paymentStatus && (\n\t\t\t\t\t\t<Badge tone={paymentStatusTone[paymentStatus]} dot data-axis=\"payment\" className=\"order-header--payment\">\n\t\t\t\t\t\t\t{strings.payment[paymentStatus]}\n\t\t\t\t\t\t</Badge>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!fulfillmentStatus && (\n\t\t\t\t\t\t<Badge tone={fulfillmentStatusTone[fulfillmentStatus]} dot data-axis=\"fulfillment\" className=\"order-header--fulfillment\">\n\t\t\t\t\t\t\t{strings.fulfillment[fulfillmentStatus]}\n\t\t\t\t\t\t</Badge>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\n\t\t\t\t{!!actions?.length && (\n\t\t\t\t\t<ActionMenu actions={actions} srText={strings.moreActions} renderLink={renderLink} />\n\t\t\t\t)}\n\t\t\t</Stack>\n\n\t\t\t{!!origin && (\n\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"order-header--origin\">\n\t\t\t\t\t{origin}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nOrderHeader.displayName = 'OrderHeader';\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { StringsProp } from '../../../../lib/strings';\n\n/** A per-line fact the kit did not anticipate: a gift message, an engraving, an interval. */\nexport interface OrderLineProperty {\n\t/** What the fact is. */\n\tlabel: ReactNode;\n\t/** The fact itself. */\n\tvalue: ReactNode;\n}\n\n/** One line of ordered goods, as data. */\nexport interface OrderLine {\n\t/** Stable identity for this line. */\n\tid: string;\n\t/** Product name. */\n\ttitle: string;\n\t/** The chosen option: \"OS / blue\". */\n\tvariantTitle?: string;\n\t/** Stock-keeping unit, shown as an identifier. */\n\tsku?: string;\n\t/** Product image. Without one, or when it fails to load, the line's initials show. */\n\timageSrc?: string;\n\t/** Alternative text for the image. Defaults to the title. */\n\timageAlt?: string;\n\t/** Already formatted, including its currency. */\n\tunitPrice: string;\n\t/** Units ordered. */\n\tquantity: number;\n\t/**\n\t * Already formatted. Passed, never multiplied: discounts, tax and proration\n\t * break `unitPrice × quantity`.\n\t */\n\ttotal: string;\n\t/** Per-line custom data, rendered as label/value pairs under the title. */\n\tproperties?: OrderLineProperty[];\n\t/** Whatever `properties` cannot express, under them. */\n\tchildren?: ReactNode;\n}\n\nexport interface OrderLineItemStrings {\n\t/** Reads the price column aloud: \"€50.00 × 1\". */\n\tformatUnitPrice: (unitPrice: string, quantity: number) => string;\n}\n\nexport const defaultOrderLineItemStrings: OrderLineItemStrings = {\n\tformatUnitPrice: (unitPrice, quantity) => `${unitPrice} × ${quantity}`,\n};\n\n/* `id` and `title` are the line's, not the element's DOM id and tooltip. */\nexport interface OrderLineItemProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'id' | 'title'>,\n\t\tOrderLine {\n\t/** Overrides this row's own copy. */\n\tstrings?: StringsProp<OrderLineItemStrings>;\n}\n","/**\n * OrderLineItem — one row of ordered goods: thumbnail, title, variant, SKU,\n * per-line properties, `unit × quantity`, and the line total.\n *\n * Shared by fulfillment groups, refunds and packing slips. It never computes\n * the total: discounts, tax and proration break `unit × quantity`, so the\n * caller passes it. The row adapts to its own width, not the viewport: below\n * the container `md` step the price and total sit under the text, and from it\n * they take their own columns. The price column is read aloud as one phrase\n * (`strings.formatUnitPrice`) while its visible parts are hidden from\n * assistive technology.\n */\nimport { Badge } from '../../../base/badge';\nimport { VisuallyHidden } from '../../../base/display';\nimport { ItemMedia } from '../../../base/item';\nimport { MetadataList } from '../../../base/metadata-list';\nimport { Stack } from '../../../base/structure';\nimport { MonoValue } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { LineThumbnail } from '../shared/line-thumbnail';\nimport { defaultOrderLineItemStrings, type OrderLineItemProps } from './types';\n\nexport function OrderLineItem({\n\tid,\n\ttitle,\n\tvariantTitle,\n\tsku,\n\timageSrc,\n\timageAlt,\n\tunitPrice,\n\tquantity,\n\ttotal,\n\tproperties,\n\tchildren,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: OrderLineItemProps) {\n\tconst strings = useStrings(defaultOrderLineItemStrings, stringsProp);\n\tconst hasMeta = !!variantTitle || !!sku;\n\n\treturn (\n\t\t<div\n\t\t\t{...props}\n\t\t\tdata-slot=\"order-line-item\"\n\t\t\tdata-line-id={id}\n\t\t\tclassName={cn('order-line-item--component @container/order-line-item min-w-0', className)}\n\t\t>\n\t\t\t<div className=\"flex min-w-0 items-start gap-space-lg\">\n\t\t\t\t<ItemMedia variant=\"image\" className=\"order-line-item--media\">\n\t\t\t\t\t<LineThumbnail src={imageSrc} alt={imageAlt} title={title} />\n\t\t\t\t</ItemMedia>\n\n\t\t\t\t<div className=\"order-line-item--layout grid min-w-0 flex-1 gap-space-sm @md/order-line-item:grid-cols-[minmax(0,1fr)_auto_minmax(5rem,auto)] @md/order-line-item:items-center @md/order-line-item:gap-x-space-xl\">\n\t\t\t\t\t<Stack gap=\"xs\" className=\"order-line-item--body min-w-0\">\n\t\t\t\t\t\t<Text weight=\"medium\" className=\"order-line-item--title wrap-anywhere\">\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</Text>\n\n\t\t\t\t\t\t{!!hasMeta && (\n\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"center\" wrap className=\"order-line-item--meta\">\n\t\t\t\t\t\t\t\t{!!variantTitle && <Badge tone=\"neutral\" size=\"sm\">{variantTitle}</Badge>}\n\t\t\t\t\t\t\t\t{/* An identifier, so monospace. */}\n\t\t\t\t\t\t\t\t{!!sku && <MonoValue size=\"xs\" type=\"secondary\">{sku}</MonoValue>}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{!!properties?.length && (\n\t\t\t\t\t\t\t<MetadataList\n\t\t\t\t\t\t\t\tlayout=\"rows\"\n\t\t\t\t\t\t\t\tdensity=\"compact\"\n\t\t\t\t\t\t\t\tclassName=\"order-line-item--properties\"\n\t\t\t\t\t\t\t\titems={properties.map((property, index) => ({\n\t\t\t\t\t\t\t\t\tid: String(index),\n\t\t\t\t\t\t\t\t\tlabel: property.label,\n\t\t\t\t\t\t\t\t\tvalue: property.value,\n\t\t\t\t\t\t\t\t}))}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</Stack>\n\n\t\t\t\t\t{/* Under the text in a narrow row; their own columns from the container's md step. */}\n\t\t\t\t\t<div className=\"order-line-item--figures flex min-w-0 items-baseline justify-between gap-space-md @md/order-line-item:contents\">\n\t\t\t\t\t\t<span className=\"order-line-item--price inline-flex items-baseline gap-space-xs @md/order-line-item:justify-end\">\n\t\t\t\t\t\t\t{/* One accessible phrase for the price column: an aria-label on a role-less\n\t\t\t\t\t\t\t span is ignored, so the phrase is hidden text and the parts are aria-hidden. */}\n\t\t\t\t\t\t\t<VisuallyHidden>{strings.formatUnitPrice(unitPrice, quantity)}</VisuallyHidden>\n\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" aria-hidden=\"true\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t{unitPrice}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t×\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" weight=\"medium\" aria-hidden=\"true\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t{quantity}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t<Text tag=\"span\" weight=\"medium\" className=\"order-line-item--total text-end tabular-nums\">\n\t\t\t\t\t\t\t{total}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nOrderLineItem.displayName = 'OrderLineItem';\n","import type { ComponentPropsWithoutRef, ComponentType, ReactNode } from 'react';\n\nimport type { ActionMenuAction, ActionMenuProps } from '../../../base/action-menu';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport type { OrderLine, OrderLineItemStrings } from '../order-line-item/types';\nimport { defaultOrderLineItemStrings } from '../order-line-item/types';\nimport { defaultOrderStatusVocabulary, type FulfillmentStatus } from '../shared/order-status';\n\nexport interface FulfillmentGroupStrings extends OrderLineItemStrings {\n\t/** Label for each `FulfillmentStatus`. The tone stays derived from the status. */\n\tfulfillment: Record<FulfillmentStatus, string>;\n\t/** Names the group by state and size: \"Unfulfilled (3)\". */\n\tformatHeading: (status: string, count: number) => string;\n\t/** Accessible name of the overflow menu holding every action after the first. */\n\tmoreActions: string;\n}\n\nexport const defaultFulfillmentGroupStrings: FulfillmentGroupStrings = {\n\t...defaultOrderLineItemStrings,\n\tfulfillment: defaultOrderStatusVocabulary.fulfillment,\n\tformatHeading: (status, count) => `${status} (${count})`,\n\tmoreActions: 'More actions',\n};\n\nexport interface FulfillmentGroupProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'> {\n\t/** Where these goods are. Drives the heading chip's label and tone. */\n\tstatus: FulfillmentStatus;\n\t/** Where the group ships from. */\n\tlocation?: ReactNode;\n\t/** A standing fact about the group: \"Shipping not required\". */\n\tnotice?: ReactNode;\n\t/**\n\t * Glyph beside the notice, sized by the group. A component rather than a\n\t * node, so it arrives at the icon size of the text it annotates.\n\t */\n\tnoticeIcon?: ComponentType<{ className?: string }>;\n\t/** The rows, as data. The heading counts them. */\n\titems?: OrderLine[];\n\t/** Replaces `items` wholesale, for a caller who needs control of a row. The heading then carries no count. */\n\tchildren?: ReactNode;\n\t/**\n\t * The group's commands. The first renders as a button and the rest collapse\n\t * into an overflow menu: one array, so the menu never repeats the button.\n\t * Mark the main command `tone: 'primary'`.\n\t */\n\tactions?: readonly ActionMenuAction[];\n\t/** Renders `href` actions through the consumer's router. */\n\trenderLink?: ActionMenuProps['renderLink'];\n\t/** Overrides this surface's own copy, including the status words. */\n\tstrings?: StringsProp<FulfillmentGroupStrings>;\n}\n","/**\n * FulfillmentGroup — one shipment's worth of an order: the goods that share a\n * fulfillment state and a location, and the commands that move them on.\n *\n * A framed card in three bands. The header names the group by state and size\n * (\"Unfulfilled (3)\", a level-2 heading carried by the status chip, so its\n * tone and words come from `status`) with the location and any standing\n * notice beneath. The items band lists `OrderLineItem` rows, ruled between\n * each other because the lines are tabular. The actions band shows the first\n * action as a button and collapses the rest into an overflow menu.\n */\nimport { useMemo } from 'react';\n\nimport { ActionButtons, ActionMenu } from '../../../base/action-menu';\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { OrderLineItem } from '../order-line-item/order-line-item';\nimport { fulfillmentStatusTone } from '../shared/order-status';\nimport { defaultFulfillmentGroupStrings, type FulfillmentGroupProps } from './types';\n\nexport function FulfillmentGroup({\n\tstatus,\n\tlocation,\n\tnotice,\n\tnoticeIcon: NoticeIcon,\n\titems,\n\tchildren,\n\tactions,\n\trenderLink,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: FulfillmentGroupProps) {\n\tconst strings = useStrings(defaultFulfillmentGroupStrings, stringsProp);\n\tconst lineStrings = useMemo(() => ({ formatUnitPrice: strings.formatUnitPrice }), [strings.formatUnitPrice]);\n\tconst statusLabel = strings.fulfillment[status];\n\t// Counts `items` only; custom `children` are the caller's rows to count.\n\tconst heading = items ? strings.formatHeading(statusLabel, items.length) : statusLabel;\n\n\tconst visibleActions = (actions ?? []).filter((action) => action.visible !== false);\n\tconst [firstAction, ...overflowActions] = visibleActions;\n\n\tconst hasLocation = location !== undefined && location !== null && location !== '';\n\tconst hasNotice = notice !== undefined && notice !== null && notice !== '';\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface=\"card\"\n\t\t\tpadding=\"md\"\n\t\t\theaderDivider\n\t\t\tfooterDivider={!!firstAction}\n\t\t\tdata-status={status}\n\t\t\ttitle={(\n\t\t\t\t<span role=\"heading\" aria-level={2} className=\"fulfillment-group--heading inline-flex max-w-full\">\n\t\t\t\t\t<Badge tone={fulfillmentStatusTone[status]} dot>{heading}</Badge>\n\t\t\t\t</span>\n\t\t\t)}\n\t\t\tdescription={hasLocation || hasNotice ? (\n\t\t\t\t<Stack gap=\"2xs\" className=\"fulfillment-group--context\">\n\t\t\t\t\t{!!hasLocation && (\n\t\t\t\t\t\t<Text tag=\"div\" type=\"secondary\" className=\"fulfillment-group--location\">{location}</Text>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!hasNotice && (\n\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"center\" wrap={false} className=\"fulfillment-group--notice text-muted-foreground\">\n\t\t\t\t\t\t\t{!!NoticeIcon && <NoticeIcon aria-hidden=\"true\" className=\"size-icon-sm shrink-0\" />}\n\t\t\t\t\t\t\t<Text tag=\"span\" type=\"secondary\">{notice}</Text>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t) : undefined}\n\t\t\tfooterSlot={firstAction ? (\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" justify=\"end\" className=\"fulfillment-group--actions\">\n\t\t\t\t\t<ActionButtons actions={[firstAction]} renderLink={renderLink} />\n\t\t\t\t\t{overflowActions.length > 0 && (\n\t\t\t\t\t\t<ActionMenu\n\t\t\t\t\t\t\tactions={overflowActions}\n\t\t\t\t\t\t\tcontext=\"commands\"\n\t\t\t\t\t\t\tsrText={strings.moreActions}\n\t\t\t\t\t\t\tbuttonProps={{ size: 'sm' }}\n\t\t\t\t\t\t\trenderLink={renderLink}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t) : undefined}\n\t\t\tclassName={cn('fulfillment-group--component w-full', className)}\n\t\t>\n\t\t\t{children !== undefined ? (\n\t\t\t\t<div className=\"fulfillment-group--items min-w-0\">{children}</div>\n\t\t\t) : (\n\t\t\t\t<ul className=\"fulfillment-group--items m-0 min-w-0 list-none p-0\">\n\t\t\t\t\t{(items ?? []).map((line) => (\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tkey={line.id}\n\t\t\t\t\t\t\tclassName=\"fulfillment-group--line border-t border-border/60 py-space-lg first:border-t-0 first:pt-0 last:pb-0\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<OrderLineItem {...line} strings={lineStrings} />\n\t\t\t\t\t\t</li>\n\t\t\t\t\t))}\n\t\t\t\t</ul>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nFulfillmentGroup.displayName = 'FulfillmentGroup';\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport { defaultOrderStatusVocabulary, type PaymentStatus } from '../shared/order-status';\n\n/** One row of an order's money ledger. */\nexport interface SummaryLine {\n\t/** Stable identity. Falls back to the row's position. */\n\tid?: string;\n\t/** What the amount is: \"Subtotal\", \"Paid\". */\n\tlabel: ReactNode;\n\t/** A count or rate beside the amount: \"3 items\", \"20%\". */\n\tnote?: ReactNode;\n\t/** Already formatted, including its currency. */\n\tamount: string;\n\t/** Money off the customer's total, shown with one U+2212 in success ink. */\n\tdeduction?: boolean;\n}\n\nexport interface OrderSummaryStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Label for each `PaymentStatus`. The tone stays derived from the status. */\n\tpayment: Record<PaymentStatus, string>;\n}\n\nexport const defaultOrderSummaryStrings: OrderSummaryStrings = {\n\ttitle: 'Payment',\n\tpayment: defaultOrderStatusVocabulary.payment,\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface OrderSummaryProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** What was ordered: subtotal, discount, shipping, tax. */\n\tgoods: SummaryLine[];\n\t/** The line the eye should land on, closing the goods ledger. */\n\ttotal: SummaryLine;\n\t/** What has actually moved: paid, refunded, balance. A separate ledger from the goods. */\n\tpayments?: SummaryLine[];\n\t/** Where the money is, as a chip beside the title. */\n\tpaymentStatus?: PaymentStatus;\n\t/**\n\t * Standing information about the balance, below the ledgers as a warning\n\t * note (`role=\"note\"`): a caveat, not an error.\n\t */\n\talert?: ReactNode;\n\t/** Overrides this surface's own copy, including the status words. */\n\tstrings?: StringsProp<OrderSummaryStrings>;\n}\n","/**\n * OrderSummary — an order's money in two ledgers: what was ordered (ending in\n * the total) and what has actually moved (paid, refunded, balance). They are\n * different questions, so they are separate ledgers, separated by spacing\n * rather than a rule or a tinted box. The payment status chip sits beside the\n * title; standing information about the balance follows the ledgers as a\n * warning note. Every amount arrives formatted: the summary does no arithmetic,\n * and a refund in the payments ledger is money that moved, not a deduction.\n */\nimport { TriangleAlert } from 'lucide-react';\n\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { Alert, AlertDescription } from '../../../base/feedback';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { paymentStatusTone } from '../shared/order-status';\nimport { AmountRow, SummaryPanel } from '../summary-panel';\nimport { defaultOrderSummaryStrings, type OrderSummaryProps, type SummaryLine } from './types';\n\nfunction LedgerRow({ line, total = false, rollup = false }: { line: SummaryLine; total?: boolean; rollup?: boolean }) {\n\treturn (\n\t\t<AmountRow\n\t\t\tlabel={line.label}\n\t\t\tnote={line.note}\n\t\t\tamount={line.amount}\n\t\t\tdeduction={line.deduction}\n\t\t\ttotal={total}\n\t\t\trollup={rollup}\n\t\t/>\n\t);\n}\n\nexport function OrderSummary({\n\tgoods,\n\ttotal,\n\tpayments,\n\tpaymentStatus,\n\talert,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider = surface === 'flat' ? false : undefined,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: OrderSummaryProps) {\n\tconst strings = useStrings(defaultOrderSummaryStrings, stringsProp);\n\tconst hasAlert = alert !== undefined && alert !== null && alert !== false && alert !== '';\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={paymentStatus ? (\n\t\t\t\t<Badge tone={paymentStatusTone[paymentStatus]} className=\"order-summary--status\">\n\t\t\t\t\t{strings.payment[paymentStatus]}\n\t\t\t\t</Badge>\n\t\t\t) : undefined}\n\t\t\tcontentGap=\"xl\"\n\t\t\tcontentBottom={hasAlert ? (\n\t\t\t\t// `note`: standing information, not an error that just happened.\n\t\t\t\t<Alert tone=\"warning\" role=\"note\" className=\"order-summary--alert\">\n\t\t\t\t\t<TriangleAlert aria-hidden=\"true\" />\n\t\t\t\t\t<AlertDescription>{alert}</AlertDescription>\n\t\t\t\t</Alert>\n\t\t\t) : undefined}\n\t\t\tdata-slot=\"order-summary\"\n\t\t\tclassName={cn('order-summary--component w-full', className)}\n\t\t>\n\t\t\t<SummaryPanel className=\"order-summary--goods\">\n\t\t\t\t{goods.map((line, index) => (\n\t\t\t\t\t<LedgerRow key={line.id ?? String(index)} line={line} />\n\t\t\t\t))}\n\t\t\t\t<LedgerRow line={total} total rollup={goods.length > 0} />\n\t\t\t</SummaryPanel>\n\n\t\t\t{!!payments?.length && (\n\t\t\t\t<SummaryPanel className=\"order-summary--payments\">\n\t\t\t\t\t{payments.map((line, index) => (\n\t\t\t\t\t\t<LedgerRow key={line.id ?? String(index)} line={line} />\n\t\t\t\t\t))}\n\t\t\t\t</SummaryPanel>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nOrderSummary.displayName = 'OrderSummary';\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport type { TransactionKind, TransactionStatus } from '../shared/order-status';\n\n/** One attempt against a payment method. */\nexport interface Transaction {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** What was attempted. Sets the sign: refunds, voids and chargebacks take money out. */\n\tkind: TransactionKind;\n\t/** Whether it worked. */\n\tstatus: TransactionStatus;\n\t/** The magnitude, already formatted. The sign comes from `kind`. */\n\tamount: string;\n\t/** Already formatted. */\n\tprocessedAt: string;\n\t/** How it was taken: \"Visa ending 4417\", \"PayPal\". */\n\tmethod?: string;\n\t/** The gateway's own identifier. Monospace: it is compared and copied, not read. */\n\treference?: string;\n\t/** Which gateway processed it. */\n\tgateway?: string;\n}\n\nexport interface OrderTransactionsStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Label for each `TransactionKind`. */\n\tkind: Record<TransactionKind, string>;\n\t/** Chip label for each `TransactionStatus`. A successful attempt shows none. */\n\tstatus: Record<TransactionStatus, string>;\n\t/** Spoken before a gateway reference. */\n\treference: string;\n\t/** Shown, and announced, when there is nothing in the ledger. */\n\tempty: string;\n}\n\nexport const defaultOrderTransactionsStrings: OrderTransactionsStrings = {\n\ttitle: 'Transactions',\n\tkind: {\n\t\tauthorization: 'Authorization',\n\t\tcapture: 'Capture',\n\t\tsale: 'Sale',\n\t\trefund: 'Refund',\n\t\tvoid: 'Void',\n\t\tchargeback: 'Chargeback',\n\t},\n\tstatus: { success: 'Success', pending: 'Pending', failure: 'Failed' },\n\treference: 'Reference',\n\tempty: 'No transactions yet',\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface OrderTransactionsProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/**\n\t * Every attempt, oldest first. A failed attempt stays listed: an order that\n\t * shows only what worked cannot answer why it was never captured.\n\t */\n\ttransactions: Transaction[];\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<OrderTransactionsStrings>;\n}\n","/**\n * OrderTransactions — the payment ledger: every attempt against the order's\n * payment methods, oldest first.\n *\n * Each row names its kind with a glyph tile so the ledger scans without being\n * read, says when and how the attempt was made, and carries the gateway\n * reference as an identifier. Success is the expected case and shows no chip;\n * a pending or failed attempt is why someone opened the ledger, so it gets\n * one, and a failed row is washed in the destructive tone. Unlike a cart's\n * green deduction, a refund here is money going out: its sign comes from the\n * kind and the figure is never tinted. With nothing to list, the ledger says\n * so as a status region.\n */\nimport {\n\tBan,\n\tCreditCard,\n\tDownload,\n\tRotateCcw,\n\tShieldCheck,\n\tTriangleAlert,\n\ttype LucideIcon,\n} from 'lucide-react';\n\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { IconBadge, VisuallyHidden, type IconBadgeTone } from '../../../base/display';\nimport { Stack } from '../../../base/structure';\nimport { MonoValue } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { EmptyState } from '../../data-display';\nimport { useStrings } from '../../../../lib/strings';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\nimport { cn } from '../../../../lib/utils';\n\nimport { MINUS_SIGN, stripLeadingMinus } from '../format-signed-amount';\nimport {\n\toutgoingTransactionKinds,\n\ttransactionStatusTone,\n\ttype TransactionKind,\n} from '../shared/order-status';\nimport { defaultOrderTransactionsStrings, type OrderTransactionsProps } from './types';\n\n/* A glyph per kind, so the ledger scans without being read. */\nconst KIND_ICON: Record<TransactionKind, LucideIcon> = {\n\tauthorization: ShieldCheck,\n\tcapture: Download,\n\tsale: CreditCard,\n\trefund: RotateCcw,\n\tvoid: Ban,\n\tchargeback: TriangleAlert,\n};\n\nexport function OrderTransactions({\n\ttransactions,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider = surface === 'flat' ? false : undefined,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: OrderTransactionsProps) {\n\tconst strings = useStrings(defaultOrderTransactionsStrings, stringsProp);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\tdata-slot=\"order-transactions\"\n\t\t\tclassName={cn('order-transactions--component w-full', className)}\n\t\t>\n\t\t\t{transactions.length === 0 ? (\n\t\t\t\t<EmptyState\n\t\t\t\t\tpadding=\"sm\"\n\t\t\t\t\ttitle={strings.empty}\n\t\t\t\t\tdescription={false}\n\t\t\t\t\tariaLabel={strings.empty}\n\t\t\t\t\tclassName=\"order-transactions--empty\"\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t// The list draws its own frame; rows are ruled because the ledger is tabular.\n\t\t\t\t<ol className=\"order-transactions--list m-0 list-none overflow-hidden rounded-radius border border-border p-0\">\n\t\t\t\t\t{transactions.map((transaction) => {\n\t\t\t\t\t\tconst outgoing = outgoingTransactionKinds.has(transaction.kind);\n\t\t\t\t\t\tconst failed = transaction.status === 'failure';\n\t\t\t\t\t\tconst amount = `${outgoing ? MINUS_SIGN : ''}${stripLeadingMinus(transaction.amount)}`;\n\t\t\t\t\t\t// One tone per mark, so its fill and glyph can never come apart.\n\t\t\t\t\t\tconst markTone: IconBadgeTone = failed ? 'destructive' : outgoing ? 'warning' : 'neutral';\n\t\t\t\t\t\tconst meta = [transaction.processedAt, transaction.method, transaction.gateway]\n\t\t\t\t\t\t\t.filter((part): part is string => !!part);\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\tkey={transaction.id}\n\t\t\t\t\t\t\t\tdata-status={transaction.status}\n\t\t\t\t\t\t\t\tdata-kind={transaction.kind}\n\t\t\t\t\t\t\t\tdata-outgoing={outgoing ? '' : undefined}\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t'order-transactions--row flex min-w-0 items-start gap-space-lg border-t border-border/60 px-row-x py-row-y-lg first:border-t-0',\n\t\t\t\t\t\t\t\t\tfailed && toneRecipes.destructive.wash,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<IconBadge icon={KIND_ICON[transaction.kind]} tone={markTone} shape=\"square\" />\n\n\t\t\t\t\t\t\t\t<Stack gap=\"2xs\" className=\"order-transactions--body min-w-0 flex-1\">\n\t\t\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"center\" wrap className=\"min-w-0\">\n\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" weight=\"medium\">{strings.kind[transaction.kind]}</Text>\n\t\t\t\t\t\t\t\t\t\t{/* Success needs no chip; a pending or failed attempt is the reason to look. */}\n\t\t\t\t\t\t\t\t\t\t{transaction.status !== 'success' && (\n\t\t\t\t\t\t\t\t\t\t\t<Badge tone={transactionStatusTone[transaction.status]} size=\"sm\" className=\"order-transactions--status\">\n\t\t\t\t\t\t\t\t\t\t\t\t{strings.status[transaction.status]}\n\t\t\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</Stack>\n\n\t\t\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"md\" wrap className=\"order-transactions--meta min-w-0\">\n\t\t\t\t\t\t\t\t\t\t{meta.map((part, index) => (\n\t\t\t\t\t\t\t\t\t\t\t<Text key={`${String(index)}-${part}`} tag=\"span\" size=\"xs\" type=\"secondary\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t\t\t\t\t{part}\n\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</Stack>\n\n\t\t\t\t\t\t\t\t\t{!!transaction.reference && (\n\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"order-transactions--reference min-w-0 break-all\">\n\t\t\t\t\t\t\t\t\t\t\t<VisuallyHidden>{`${strings.reference}: `}</VisuallyHidden>\n\t\t\t\t\t\t\t\t\t\t\t<MonoValue>{transaction.reference}</MonoValue>\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Stack>\n\n\t\t\t\t\t\t\t\t<Text tag=\"span\" weight=\"semibold\" className=\"order-transactions--amount shrink-0 text-end tabular-nums\">\n\t\t\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</ol>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nOrderTransactions.displayName = 'OrderTransactions';\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport type { OrderAddress } from '../shared/order-status';\n\nexport interface OrderCustomerStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tshippingAddress: string;\n\tbillingAddress: string;\n\t/**\n\t * One name per edit button: each is the accessible name of a glyph with no\n\t * text beside it, and a single \"Edit\" would announce two controls alike.\n\t */\n\teditShipping: string;\n\teditBilling: string;\n\t/** Shown in place of a repeated billing address. */\n\tsameAsShipping: string;\n\t/** Shown when an address is missing. */\n\tnoAddress: string;\n\t/** How many orders the customer has placed, this one included. */\n\tformatOrderCount: (count: number) => string;\n}\n\nexport const defaultOrderCustomerStrings: OrderCustomerStrings = {\n\ttitle: 'Customer',\n\tshippingAddress: 'Shipping address',\n\tbillingAddress: 'Billing address',\n\teditShipping: 'Edit shipping address',\n\teditBilling: 'Edit billing address',\n\tsameAsShipping: 'Same as shipping address',\n\tnoAddress: 'No address on file',\n\tformatOrderCount: (count) => (count === 1 ? '1 order' : `${count} orders`),\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface OrderCustomerProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** The customer's display name. */\n\tname: string;\n\t/** Contact email, rendered as a mail link. */\n\temail?: string;\n\t/** Contact number, rendered as a call link. */\n\tphone?: string;\n\t/** How many orders this customer has placed, this one included. */\n\torderCount?: number;\n\t/** Where the order ships. */\n\tshippingAddress?: OrderAddress;\n\t/** Where the order is billed. */\n\tbillingAddress?: OrderAddress;\n\t/** Renders one line in place of a repeated billing address. */\n\tbillingSameAsShipping?: boolean;\n\t/** Turns the identity row into a button. The app decides whether it navigates or opens a panel. */\n\tonOpenCustomer?: () => void;\n\t/** Shows an edit button on the shipping address. */\n\tonEditShipping?: () => void;\n\t/** Shows an edit button on the billing address. */\n\tonEditBilling?: () => void;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<OrderCustomerStrings>;\n}\n","/**\n * OrderCustomer — who bought the order and where it goes: a read-only panel,\n * unlike the editable `AddressCard`.\n *\n * The identity row (avatar and name, with the order count) becomes a button\n * when `onOpenCustomer` is given. Contact details follow as mail and call\n * links, then the shipping and billing addresses, side by side once the\n * panel's own width allows. Each address can carry an icon-only edit button\n * with its own accessible name. `billingSameAsShipping` renders one line\n * instead of a repeated address. Groups are separated by spacing, not rules.\n */\nimport { Pencil } from 'lucide-react';\n\nimport { Avatar, AvatarFallback } from '../../../base/avatar';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { Item } from '../../../base/item';\nimport { AdaptiveGrid, Stack } from '../../../base/structure';\nimport { Email, formatInitials, Phone } from '../../../primitives';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { interactionRecipes } from '../../../../lib/interaction-recipes';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { AddressLines } from '../shared/address-lines';\nimport type { OrderAddress } from '../shared/order-status';\nimport { defaultOrderCustomerStrings, type OrderCustomerProps } from './types';\n\ninterface AddressSectionProps {\n\tlabel: string;\n\teditLabel: string;\n\taddress?: OrderAddress;\n\tonEdit?: () => void;\n\treplacement?: string;\n\temptyLabel: string;\n\tclassName: string;\n}\n\nfunction AddressSection({ label, editLabel, address, onEdit, replacement, emptyLabel, className }: AddressSectionProps) {\n\treturn (\n\t\t<Stack gap=\"sm\" className={cn('order-customer--address min-w-0', className)}>\n\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"center\" justify=\"between\" wrap={false} className=\"min-h-action-sm\">\n\t\t\t\t<DisplayLabel tag=\"div\">{label}</DisplayLabel>\n\t\t\t\t{/* Icon only; the accessible name says which address it edits. */}\n\t\t\t\t{!!onEdit && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\ticonOnly\n\t\t\t\t\t\taria-label={editLabel}\n\t\t\t\t\t\tonClick={onEdit}\n\t\t\t\t\t\tclassName=\"order-customer--edit\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Pencil aria-hidden=\"true\" className=\"size-icon-sm\" />\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t\t{replacement ? (\n\t\t\t\t<Text type=\"secondary\">{replacement}</Text>\n\t\t\t) : address ? (\n\t\t\t\t<AddressLines address={address} />\n\t\t\t) : (\n\t\t\t\t<Text type=\"secondary\">{emptyLabel}</Text>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nexport function OrderCustomer({\n\tname,\n\temail,\n\tphone,\n\torderCount,\n\tshippingAddress,\n\tbillingAddress,\n\tbillingSameAsShipping = false,\n\tonOpenCustomer,\n\tonEditShipping,\n\tonEditBilling,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider = surface === 'flat' ? false : undefined,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: OrderCustomerProps) {\n\tconst strings = useStrings(defaultOrderCustomerStrings, stringsProp);\n\tconst hasContact = !!email || !!phone;\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tdata-slot=\"order-customer\"\n\t\t\tclassName={cn('order-customer--component w-full', className)}\n\t\t>\n\t\t\t{/* An identity (avatar and name), not a label and a value. A button when\n\t\t\t the app can open the customer: it decides whether that navigates. */}\n\t\t\t<Item\n\t\t\t\t// A clickable row pays its own inset and bleeds it back out, so the\n\t\t\t\t// avatar stays on the panel's edge while the hover fill has room.\n\t\t\t\t// The name stays beside its avatar in a narrow column instead of wrapping under it.\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'order-customer--identity flex-nowrap',\n\t\t\t\t\t!!onOpenCustomer && cn('-mx-row-x w-auto text-start', interactionRecipes.rowHover),\n\t\t\t\t)}\n\t\t\t\tpadding={onOpenCustomer ? 'default' : 'none'}\n\t\t\t\trender={onOpenCustomer ? <button type=\"button\" onClick={onOpenCustomer} /> : undefined}\n\t\t\t\tmedia={(\n\t\t\t\t\t<Avatar>\n\t\t\t\t\t\t<AvatarFallback>{formatInitials(name)}</AvatarFallback>\n\t\t\t\t\t</Avatar>\n\t\t\t\t)}\n\t\t\t\ttitle={name}\n\t\t\t\tdescription={orderCount !== undefined ? strings.formatOrderCount(orderCount) : undefined}\n\t\t\t/>\n\n\t\t\t{!!hasContact && (\n\t\t\t\t<Stack gap=\"xs\" className=\"order-customer--contact min-w-0\">\n\t\t\t\t\t{!!email && <Email value={email} className=\"self-start\" />}\n\t\t\t\t\t{!!phone && <Phone value={phone} className=\"self-start\" />}\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{/* Side by side once the panel is wide enough, so the two compare at a glance. */}\n\t\t\t<AdaptiveGrid minColumnWidth=\"sm\" gap=\"xl\" className=\"order-customer--addresses\">\n\t\t\t\t<AddressSection\n\t\t\t\t\tlabel={strings.shippingAddress}\n\t\t\t\t\teditLabel={strings.editShipping}\n\t\t\t\t\taddress={shippingAddress}\n\t\t\t\t\tonEdit={onEditShipping}\n\t\t\t\t\temptyLabel={strings.noAddress}\n\t\t\t\t\tclassName=\"order-customer--shipping\"\n\t\t\t\t/>\n\t\t\t\t<AddressSection\n\t\t\t\t\tlabel={strings.billingAddress}\n\t\t\t\t\teditLabel={strings.editBilling}\n\t\t\t\t\taddress={billingAddress}\n\t\t\t\t\tonEdit={onEditBilling}\n\t\t\t\t\treplacement={billingSameAsShipping ? strings.sameAsShipping : undefined}\n\t\t\t\t\temptyLabel={strings.noAddress}\n\t\t\t\t\tclassName=\"order-customer--billing\"\n\t\t\t\t/>\n\t\t\t</AdaptiveGrid>\n\t\t</Card>\n\t);\n}\n\nOrderCustomer.displayName = 'OrderCustomer';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB4E,GAAmB,EAClC,aACA,cACA,WAKA,cAAW,WACX,iBAAc,WACd,mBAAgB,WACW;CAC3B,OAEC,kBAACf,IAAD;EAAW,WAAWlD,EAAG,sCAAsCkE,CAAS;EACtE,UAAAC,EAAS,KAAK,GAAG,MAChB,kBAACf,GAAD;GAAoD,WAAU;GAA9D,UAAA;IACC,kBAACL,GAAD,EAAA,UACC,kBAACN,IAAD;KACC,MAAM2B,EAAE;KACR,MAAMC,MAAkB,UAAUD,EAAE,OAAO,KAAA;KAC3C,MAAME;KACN,SAASC;KACD;KACR,eAAc;KACd,QAAO;IACP,CAAA,EACS,CAAA;IACX,kBAACpB,GAAD;KAAa,WAAU;KAAvB,UAAA,CACC,kBAACE,GAAD,EAAA,UAAYe,EAA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