@sovereignsquad/gds-core 3.9.0 → 6.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/GdsBadge-DqTdnomt.d.mts +417 -0
  2. package/dist/GdsBadge-DqTdnomt.d.ts +417 -0
  3. package/dist/PartnerDiscovery-As_-JKtb.d.ts +732 -0
  4. package/dist/PartnerDiscovery-Bwxixtka.d.mts +732 -0
  5. package/dist/QuickStartCard-CB7r-85z.d.ts +17500 -0
  6. package/dist/QuickStartCard-xIP1gbCL.d.mts +17500 -0
  7. package/dist/chunk-2AX4NCID.mjs +9 -0
  8. package/dist/chunk-2IUOZG4C.mjs +9 -0
  9. package/dist/chunk-2XZMNT7I.mjs +338 -0
  10. package/dist/chunk-3D7BVS7D.mjs +9 -0
  11. package/dist/chunk-4LG6EED4.mjs +338 -0
  12. package/dist/chunk-6LULEPIE.mjs +9 -0
  13. package/dist/chunk-6PBDLFSF.mjs +338 -0
  14. package/dist/{chunk-TQ7ZYMEA.mjs → chunk-BH2SMTND.mjs} +2258 -4014
  15. package/dist/chunk-BHR4A3C6.mjs +338 -0
  16. package/dist/chunk-CNTTKK3H.mjs +338 -0
  17. package/dist/chunk-GGDCO5HR.mjs +338 -0
  18. package/dist/chunk-GKNSUUUE.mjs +338 -0
  19. package/dist/chunk-GMK5GXWR.mjs +338 -0
  20. package/dist/chunk-H2QNW4D5.mjs +1768 -0
  21. package/dist/chunk-IHPZ7BNV.mjs +338 -0
  22. package/dist/chunk-J66ITCXC.mjs +473 -0
  23. package/dist/chunk-J6MXKFIM.mjs +9 -0
  24. package/dist/chunk-JTMPFTCK.mjs +338 -0
  25. package/dist/{chunk-BUC7QXRO.mjs → chunk-KFEPREUF.mjs} +13 -5
  26. package/dist/chunk-LNVLXOLI.mjs +9 -0
  27. package/dist/chunk-MAIU557K.mjs +9 -0
  28. package/dist/chunk-MPZFCWWS.mjs +210 -0
  29. package/dist/chunk-NWS7KJ2G.mjs +245 -0
  30. package/dist/chunk-OC3M4CZY.mjs +9 -0
  31. package/dist/chunk-QO653DAE.mjs +338 -0
  32. package/dist/chunk-RCLWUNMR.mjs +9 -0
  33. package/dist/chunk-SHQDVHGR.mjs +338 -0
  34. package/dist/{chunk-5AJJNRZF.mjs → chunk-TJ3WMH25.mjs} +1916 -2026
  35. package/dist/chunk-VU2JLVD3.mjs +89 -0
  36. package/dist/chunk-W5O2JSVK.mjs +20 -0
  37. package/dist/chunk-WNOWHB26.mjs +9 -0
  38. package/dist/chunk-XLPTCIXT.mjs +9 -0
  39. package/dist/chunk-ZCQXBKDM.mjs +24 -0
  40. package/dist/chunk-ZFGYQSNR.mjs +33 -0
  41. package/dist/client.d.mts +1296 -37
  42. package/dist/client.d.ts +1296 -37
  43. package/dist/client.js +11039 -6379
  44. package/dist/client.mjs +273 -58
  45. package/dist/en-Dd7uvXnv.d.mts +336 -0
  46. package/dist/en-Dd7uvXnv.d.ts +336 -0
  47. package/dist/index.d.mts +632 -5
  48. package/dist/index.d.ts +632 -5
  49. package/dist/index.js +21618 -14851
  50. package/dist/index.mjs +2138 -59
  51. package/dist/locales/lazy/all.d.mts +2 -0
  52. package/dist/locales/lazy/all.d.ts +2 -0
  53. package/dist/locales/lazy/all.js +1 -0
  54. package/dist/locales/lazy/all.mjs +24 -0
  55. package/dist/locales/lazy/ar.d.mts +2 -0
  56. package/dist/locales/lazy/ar.d.ts +2 -0
  57. package/dist/locales/lazy/ar.js +683 -0
  58. package/dist/locales/lazy/ar.mjs +4 -0
  59. package/dist/locales/lazy/de.d.mts +2 -0
  60. package/dist/locales/lazy/de.d.ts +2 -0
  61. package/dist/locales/lazy/de.js +683 -0
  62. package/dist/locales/lazy/de.mjs +4 -0
  63. package/dist/locales/lazy/es.d.mts +2 -0
  64. package/dist/locales/lazy/es.d.ts +2 -0
  65. package/dist/locales/lazy/es.js +683 -0
  66. package/dist/locales/lazy/es.mjs +4 -0
  67. package/dist/locales/lazy/fr.d.mts +2 -0
  68. package/dist/locales/lazy/fr.d.ts +2 -0
  69. package/dist/locales/lazy/fr.js +683 -0
  70. package/dist/locales/lazy/fr.mjs +4 -0
  71. package/dist/locales/lazy/he.d.mts +2 -0
  72. package/dist/locales/lazy/he.d.ts +2 -0
  73. package/dist/locales/lazy/he.js +683 -0
  74. package/dist/locales/lazy/he.mjs +4 -0
  75. package/dist/locales/lazy/hu.d.mts +2 -0
  76. package/dist/locales/lazy/hu.d.ts +2 -0
  77. package/dist/locales/lazy/hu.js +683 -0
  78. package/dist/locales/lazy/hu.mjs +4 -0
  79. package/dist/locales/lazy/index.d.mts +25 -0
  80. package/dist/locales/lazy/index.d.ts +25 -0
  81. package/dist/locales/lazy/index.js +384 -0
  82. package/dist/locales/lazy/index.mjs +9 -0
  83. package/dist/locales/lazy/it.d.mts +2 -0
  84. package/dist/locales/lazy/it.d.ts +2 -0
  85. package/dist/locales/lazy/it.js +683 -0
  86. package/dist/locales/lazy/it.mjs +4 -0
  87. package/dist/locales/lazy/ja.d.mts +2 -0
  88. package/dist/locales/lazy/ja.d.ts +2 -0
  89. package/dist/locales/lazy/ja.js +683 -0
  90. package/dist/locales/lazy/ja.mjs +4 -0
  91. package/dist/locales/lazy/ko.d.mts +2 -0
  92. package/dist/locales/lazy/ko.d.ts +2 -0
  93. package/dist/locales/lazy/ko.js +683 -0
  94. package/dist/locales/lazy/ko.mjs +4 -0
  95. package/dist/locales/lazy/ru.d.mts +2 -0
  96. package/dist/locales/lazy/ru.d.ts +2 -0
  97. package/dist/locales/lazy/ru.js +683 -0
  98. package/dist/locales/lazy/ru.mjs +4 -0
  99. package/dist/locales/lazy/zh.d.mts +2 -0
  100. package/dist/locales/lazy/zh.d.ts +2 -0
  101. package/dist/locales/lazy/zh.js +683 -0
  102. package/dist/locales/lazy/zh.mjs +4 -0
  103. package/dist/map.css +664 -0
  104. package/dist/map.d.mts +118 -0
  105. package/dist/map.d.ts +118 -0
  106. package/dist/map.js +777 -0
  107. package/dist/map.mjs +395 -0
  108. package/dist/reference-theme-explorer.d.mts +34 -0
  109. package/dist/reference-theme-explorer.d.ts +34 -0
  110. package/dist/reference-theme-explorer.js +8322 -0
  111. package/dist/reference-theme-explorer.mjs +1988 -0
  112. package/dist/rich-text-editor.d.mts +32 -0
  113. package/dist/rich-text-editor.d.ts +32 -0
  114. package/dist/rich-text-editor.js +469 -0
  115. package/dist/rich-text-editor.mjs +115 -0
  116. package/dist/server.d.mts +112 -248
  117. package/dist/server.d.ts +112 -248
  118. package/dist/server.js +6797 -1679
  119. package/dist/server.mjs +588 -55
  120. package/package.json +104 -9
  121. package/dist/AISearchCard-Bbnsd-yl.d.mts +0 -7786
  122. package/dist/AISearchCard-Bbnsd-yl.d.ts +0 -7786
@@ -0,0 +1,1768 @@
1
+ import {
2
+ GdsBadgeShapes,
3
+ GdsBadgeStack,
4
+ GdsBadgeStackLayer,
5
+ StateBlock,
6
+ resolveSurfacePresentationStyles
7
+ } from "./chunk-MPZFCWWS.mjs";
8
+ import {
9
+ GdsIcon,
10
+ GdsIcons
11
+ } from "./chunk-J66ITCXC.mjs";
12
+ import {
13
+ ko
14
+ } from "./chunk-IHPZ7BNV.mjs";
15
+ import {
16
+ ru
17
+ } from "./chunk-BHR4A3C6.mjs";
18
+ import {
19
+ zh
20
+ } from "./chunk-4LG6EED4.mjs";
21
+ import {
22
+ de
23
+ } from "./chunk-GKNSUUUE.mjs";
24
+ import {
25
+ es
26
+ } from "./chunk-JTMPFTCK.mjs";
27
+ import {
28
+ fr
29
+ } from "./chunk-6PBDLFSF.mjs";
30
+ import {
31
+ he
32
+ } from "./chunk-CNTTKK3H.mjs";
33
+ import {
34
+ hu
35
+ } from "./chunk-GMK5GXWR.mjs";
36
+ import {
37
+ it
38
+ } from "./chunk-SHQDVHGR.mjs";
39
+ import {
40
+ ja
41
+ } from "./chunk-2XZMNT7I.mjs";
42
+ import {
43
+ ar
44
+ } from "./chunk-QO653DAE.mjs";
45
+ import {
46
+ en
47
+ } from "./chunk-GGDCO5HR.mjs";
48
+
49
+ // src/vocabulary.ts
50
+ var GdsVocabulary = {
51
+ settings: { id: "gds.action.settings", defaultMessage: "Settings", icon: GdsIcons.Settings, feedback: { icon: GdsIcons.Settings, color: "teal", messageId: "gds.feedback.saved" } },
52
+ analytics: { id: "gds.action.analytics", defaultMessage: "Analytics", icon: GdsIcons.Analytics, feedback: { icon: GdsIcons.Analytics, color: "teal", messageId: "gds.feedback.loaded" } },
53
+ dashboard: { id: "gds.action.dashboard", defaultMessage: "Dashboard", icon: GdsIcons.Dashboard, feedback: { icon: GdsIcons.Dashboard, color: "teal", messageId: "gds.feedback.loaded" } },
54
+ play: { id: "gds.action.play", defaultMessage: "Play", icon: GdsIcons.Play, feedback: { icon: GdsIcons.Play, color: "teal", messageId: "gds.feedback.started" } },
55
+ start: { id: "gds.action.start", defaultMessage: "Start", icon: GdsIcons.Start, feedback: { icon: GdsIcons.Start, color: "teal", messageId: "gds.feedback.started" } },
56
+ users: { id: "gds.action.users", defaultMessage: "Users", icon: GdsIcons.Users, feedback: { icon: GdsIcons.Users, color: "teal", messageId: "gds.feedback.loaded" } },
57
+ add: { id: "gds.action.add", defaultMessage: "Add", icon: GdsIcons.Add, feedback: { icon: GdsIcons.Add, color: "teal", messageId: "gds.feedback.added" } },
58
+ edit: { id: "gds.action.edit", defaultMessage: "Edit", icon: GdsIcons.Edit, feedback: { icon: GdsIcons.Edit, color: "teal", messageId: "gds.feedback.edited" } },
59
+ delete: { id: "gds.action.delete", defaultMessage: "Delete", icon: GdsIcons.Delete, feedback: { icon: GdsIcons.Delete, color: "red", messageId: "gds.feedback.deleted" } },
60
+ save: { id: "gds.action.save", defaultMessage: "Save", icon: GdsIcons.Save, feedback: { icon: GdsIcons.Save, color: "teal", messageId: "gds.feedback.saved" } },
61
+ cancel: { id: "gds.action.cancel", defaultMessage: "Cancel", icon: GdsIcons.Cancel, feedback: { icon: GdsIcons.Cancel, color: "red", messageId: "gds.feedback.canceled" } },
62
+ confirm: { id: "gds.action.confirm", defaultMessage: "Confirm", icon: GdsIcons.Confirm, feedback: { icon: GdsIcons.Confirm, color: "teal", messageId: "gds.feedback.confirmed" } },
63
+ close: { id: "gds.action.close", defaultMessage: "Close", icon: GdsIcons.Close, feedback: { icon: GdsIcons.Close, color: "gray", messageId: "gds.feedback.closed" } },
64
+ language: { id: "gds.action.language", defaultMessage: "Language", icon: GdsIcons.Language, feedback: { icon: GdsIcons.Language, color: "teal", messageId: "gds.feedback.changed" } },
65
+ theme: { id: "gds.action.theme", defaultMessage: "Theme", icon: GdsIcons.Theme, feedback: { icon: GdsIcons.Theme, color: "teal", messageId: "gds.feedback.changed" } },
66
+ home: { id: "gds.action.home", defaultMessage: "Home", icon: GdsIcons.Home, feedback: { icon: GdsIcons.Home, color: "teal", messageId: "gds.feedback.opened" } },
67
+ inbox: { id: "gds.action.inbox", defaultMessage: "Inbox", icon: GdsIcons.Inbox, feedback: { icon: GdsIcons.Inbox, color: "teal", messageId: "gds.feedback.opened" } },
68
+ calendar: { id: "gds.action.calendar", defaultMessage: "Calendar", icon: GdsIcons.Calendar, feedback: { icon: GdsIcons.Calendar, color: "teal", messageId: "gds.feedback.opened" } },
69
+ gallery: { id: "gds.action.gallery", defaultMessage: "Gallery", icon: GdsIcons.Gallery, feedback: { icon: GdsIcons.Gallery, color: "teal", messageId: "gds.feedback.opened" } },
70
+ history: { id: "gds.action.history", defaultMessage: "History", icon: GdsIcons.History, feedback: { icon: GdsIcons.History, color: "teal", messageId: "gds.feedback.opened" } },
71
+ profile: { id: "gds.action.profile", defaultMessage: "Profile", icon: GdsIcons.Profile, feedback: { icon: GdsIcons.Profile, color: "teal", messageId: "gds.feedback.opened" } },
72
+ send: { id: "gds.action.send", defaultMessage: "Send", icon: GdsIcons.Send, feedback: { icon: GdsIcons.Send, color: "blue", messageId: "gds.feedback.sent" } },
73
+ reply: { id: "gds.action.reply", defaultMessage: "Reply", icon: GdsIcons.Reply, feedback: { icon: GdsIcons.Reply, color: "blue", messageId: "gds.feedback.replied" } },
74
+ forward: { id: "gds.action.forward", defaultMessage: "Forward", icon: GdsIcons.Forward, feedback: { icon: GdsIcons.Forward, color: "blue", messageId: "gds.feedback.forwarded" } },
75
+ attach: { id: "gds.action.attach", defaultMessage: "Attach", icon: GdsIcons.Attach, feedback: { icon: GdsIcons.Attach, color: "teal", messageId: "gds.feedback.attached" } },
76
+ upload: { id: "gds.action.upload", defaultMessage: "Upload", icon: GdsIcons.Upload, feedback: { icon: GdsIcons.Upload, color: "teal", messageId: "gds.feedback.uploaded" } },
77
+ download: { id: "gds.action.download", defaultMessage: "Download", icon: GdsIcons.Download, feedback: { icon: GdsIcons.Download, color: "teal", messageId: "gds.feedback.downloaded" } },
78
+ print: { id: "gds.action.print", defaultMessage: "Print", icon: GdsIcons.Print, feedback: { icon: GdsIcons.Print, color: "teal", messageId: "gds.feedback.printed" } },
79
+ copy: { id: "gds.action.copy", defaultMessage: "Copy", icon: GdsIcons.Copy, feedback: { icon: GdsIcons.Copy, color: "teal", messageId: "gds.feedback.copied" } },
80
+ duplicate: { id: "gds.action.duplicate", defaultMessage: "Duplicate", icon: GdsIcons.Duplicate, feedback: { icon: GdsIcons.Duplicate, color: "teal", messageId: "gds.feedback.duplicated" } },
81
+ check: { id: "gds.action.check", defaultMessage: "Check", icon: GdsIcons.Check, feedback: { icon: GdsIcons.Check, color: "teal", messageId: "gds.feedback.checked" } },
82
+ uncheck: { id: "gds.action.uncheck", defaultMessage: "Uncheck", icon: GdsIcons.Uncheck, feedback: { icon: GdsIcons.Uncheck, color: "red", messageId: "gds.feedback.unchecked" } },
83
+ complete: { id: "gds.action.complete", defaultMessage: "Complete", icon: GdsIcons.Complete, feedback: { icon: GdsIcons.Complete, color: "teal", messageId: "gds.feedback.completed" } },
84
+ clear: { id: "gds.action.clear", defaultMessage: "Clear", icon: GdsIcons.Clear, feedback: { icon: GdsIcons.Clear, color: "red", messageId: "gds.feedback.cleared" } },
85
+ capture: { id: "gds.action.capture", defaultMessage: "Capture", icon: GdsIcons.Capture, feedback: { icon: GdsIcons.Capture, color: "teal", messageId: "gds.feedback.captured" } },
86
+ record: { id: "gds.action.record", defaultMessage: "Record", icon: GdsIcons.Record, feedback: { icon: GdsIcons.Record, color: "teal", messageId: "gds.feedback.recorded" } },
87
+ flip: { id: "gds.action.flip", defaultMessage: "Flip", icon: GdsIcons.Flip, feedback: { icon: GdsIcons.Flip, color: "teal", messageId: "gds.feedback.flipped" } },
88
+ flash: { id: "gds.action.flash", defaultMessage: "Flash", icon: GdsIcons.Flash, feedback: { icon: GdsIcons.Flash, color: "teal", messageId: "gds.feedback.flashed" } },
89
+ course: { id: "gds.action.course", defaultMessage: "Course", icon: GdsIcons.Course, feedback: { icon: GdsIcons.Course, color: "teal", messageId: "gds.feedback.done" } },
90
+ lesson: { id: "gds.action.lesson", defaultMessage: "Lesson", icon: GdsIcons.Lesson, feedback: { icon: GdsIcons.Lesson, color: "teal", messageId: "gds.feedback.done" } },
91
+ certificate: { id: "gds.action.certificate", defaultMessage: "Certificate", icon: GdsIcons.Certificate, feedback: { icon: GdsIcons.Certificate, color: "teal", messageId: "gds.feedback.done" } },
92
+ student: { id: "gds.action.student", defaultMessage: "Student", icon: GdsIcons.Student, feedback: { icon: GdsIcons.Student, color: "teal", messageId: "gds.feedback.done" } },
93
+ class: { id: "gds.action.class", defaultMessage: "Class", icon: GdsIcons.Class, feedback: { icon: GdsIcons.Class, color: "teal", messageId: "gds.feedback.done" } },
94
+ grade: { id: "gds.action.grade", defaultMessage: "Grade", icon: GdsIcons.Grade, feedback: { icon: GdsIcons.Grade, color: "teal", messageId: "gds.feedback.done" } },
95
+ child: { id: "gds.action.child", defaultMessage: "Child", icon: GdsIcons.Child, feedback: { icon: GdsIcons.Child, color: "teal", messageId: "gds.feedback.done" } },
96
+ family: { id: "gds.action.family", defaultMessage: "Family", icon: GdsIcons.Family, feedback: { icon: GdsIcons.Family, color: "teal", messageId: "gds.feedback.done" } },
97
+ habit: { id: "gds.action.habit", defaultMessage: "Habit", icon: GdsIcons.Habit, feedback: { icon: GdsIcons.Habit, color: "teal", messageId: "gds.feedback.done" } },
98
+ goal: { id: "gds.action.goal", defaultMessage: "Goal", icon: GdsIcons.Goal, feedback: { icon: GdsIcons.Goal, color: "teal", messageId: "gds.feedback.done" } },
99
+ streak: { id: "gds.action.streak", defaultMessage: "Streak", icon: GdsIcons.Streak, feedback: { icon: GdsIcons.Streak, color: "teal", messageId: "gds.feedback.done" } },
100
+ reward: { id: "gds.action.reward", defaultMessage: "Reward", icon: GdsIcons.Reward, feedback: { icon: GdsIcons.Reward, color: "yellow", messageId: "gds.feedback.rewarded" } },
101
+ trophy: { id: "gds.action.trophy", defaultMessage: "Trophy", icon: GdsIcons.Trophy, feedback: { icon: GdsIcons.Trophy, color: "yellow", messageId: "gds.feedback.rewarded" } },
102
+ crown: { id: "gds.action.crown", defaultMessage: "Crown", icon: GdsIcons.Crown, feedback: { icon: GdsIcons.Crown, color: "yellow", messageId: "gds.feedback.rewarded" } },
103
+ pause: { id: "gds.action.pause", defaultMessage: "Pause", icon: GdsIcons.Pause, feedback: { icon: GdsIcons.Pause, color: "teal", messageId: "gds.feedback.paused" } },
104
+ message: { id: "gds.action.message", defaultMessage: "Message", icon: GdsIcons.Message, feedback: { icon: GdsIcons.Message, color: "blue", messageId: "gds.feedback.sent" } },
105
+ mail: { id: "gds.action.mail", defaultMessage: "Mail", icon: GdsIcons.Mail, feedback: { icon: GdsIcons.Mail, color: "blue", messageId: "gds.feedback.mailed" } },
106
+ refresh: { id: "gds.action.refresh", defaultMessage: "Refresh", icon: GdsIcons.Refresh, feedback: { icon: GdsIcons.Refresh, color: "teal", messageId: "gds.feedback.refreshed" } },
107
+ trendingUp: { id: "gds.action.trendingUp", defaultMessage: "Trending Up", icon: GdsIcons.TrendingUp, feedback: { icon: GdsIcons.TrendingUp, color: "teal", messageId: "gds.feedback.done" } },
108
+ trendingDown: { id: "gds.action.trendingDown", defaultMessage: "Trending Down", icon: GdsIcons.TrendingDown, feedback: { icon: GdsIcons.TrendingDown, color: "teal", messageId: "gds.feedback.done" } },
109
+ currency: { id: "gds.action.currency", defaultMessage: "Currency", icon: GdsIcons.Currency, feedback: { icon: GdsIcons.Currency, color: "teal", messageId: "gds.feedback.done" } },
110
+ grid: { id: "gds.action.grid", defaultMessage: "Grid", icon: GdsIcons.Grid, feedback: { icon: GdsIcons.Grid, color: "teal", messageId: "gds.feedback.done" } },
111
+ list: { id: "gds.action.list", defaultMessage: "List", icon: GdsIcons.List, feedback: { icon: GdsIcons.List, color: "teal", messageId: "gds.feedback.done" } },
112
+ logout: { id: "gds.action.logout", defaultMessage: "Logout", icon: GdsIcons.Logout, feedback: { icon: GdsIcons.Logout, color: "teal", messageId: "gds.feedback.loggedOut" } },
113
+ notifications: { id: "gds.action.notifications", defaultMessage: "Notifications", icon: GdsIcons.Notifications, feedback: { icon: GdsIcons.Notifications, color: "teal", messageId: "gds.feedback.done" } },
114
+ back: { id: "gds.action.back", defaultMessage: "Back", icon: GdsIcons.Back, feedback: { icon: GdsIcons.Back, color: "teal", messageId: "gds.feedback.done" } },
115
+ eye: { id: "gds.action.eye", defaultMessage: "View", icon: GdsIcons.Eye, feedback: { icon: GdsIcons.Eye, color: "teal", messageId: "gds.feedback.done" } },
116
+ eyeOff: { id: "gds.action.eyeOff", defaultMessage: "Hide", icon: GdsIcons.EyeOff, feedback: { icon: GdsIcons.EyeOff, color: "teal", messageId: "gds.feedback.done" } },
117
+ help: { id: "gds.action.help", defaultMessage: "Help", icon: GdsIcons.Help, feedback: { icon: GdsIcons.Help, color: "teal", messageId: "gds.feedback.done" } },
118
+ filter: { id: "gds.action.filter", defaultMessage: "Filter", icon: GdsIcons.Filter, feedback: { icon: GdsIcons.Filter, color: "teal", messageId: "gds.feedback.filtered" } },
119
+ sort: { id: "gds.action.sort", defaultMessage: "Sort", icon: GdsIcons.Sort, feedback: { icon: GdsIcons.Sort, color: "teal", messageId: "gds.feedback.sorted" } },
120
+ export: { id: "gds.action.export", defaultMessage: "Export", icon: GdsIcons.Export, feedback: { icon: GdsIcons.Export, color: "teal", messageId: "gds.feedback.exported" } },
121
+ import: { id: "gds.action.import", defaultMessage: "Import", icon: GdsIcons.Import, feedback: { icon: GdsIcons.Import, color: "teal", messageId: "gds.feedback.imported" } },
122
+ preview: { id: "gds.action.preview", defaultMessage: "Preview", icon: GdsIcons.Preview, feedback: { icon: GdsIcons.Preview, color: "teal", messageId: "gds.feedback.previewed" } },
123
+ clone: { id: "gds.action.clone", defaultMessage: "Clone", icon: GdsIcons.Clone, feedback: { icon: GdsIcons.Clone, color: "teal", messageId: "gds.feedback.cloned" } },
124
+ restore: { id: "gds.action.restore", defaultMessage: "Restore", icon: GdsIcons.Restore, feedback: { icon: GdsIcons.Restore, color: "teal", messageId: "gds.feedback.restored" } },
125
+ toggle: { id: "gds.action.toggle", defaultMessage: "Toggle", icon: GdsIcons.Toggle, feedback: { icon: GdsIcons.Toggle, color: "teal", messageId: "gds.feedback.toggled" } },
126
+ search: { id: "gds.action.search", defaultMessage: "Search", icon: GdsIcons.Search, feedback: { icon: GdsIcons.Search, color: "teal", messageId: "gds.feedback.searched" } },
127
+ submit: { id: "gds.action.submit", defaultMessage: "Submit", icon: GdsIcons.Submit, feedback: { icon: GdsIcons.Submit, color: "teal", messageId: "gds.feedback.submitted" } },
128
+ reset: { id: "gds.action.reset", defaultMessage: "Reset", icon: GdsIcons.Reset, feedback: { icon: GdsIcons.Reset, color: "red", messageId: "gds.feedback.reset" } },
129
+ login: { id: "gds.action.login", defaultMessage: "Login", icon: GdsIcons.Login, feedback: { icon: GdsIcons.Login, color: "teal", messageId: "gds.feedback.loggedIn" } },
130
+ register: { id: "gds.action.register", defaultMessage: "Register", icon: GdsIcons.Register, feedback: { icon: GdsIcons.Register, color: "teal", messageId: "gds.feedback.registered" } },
131
+ verify: { id: "gds.action.verify", defaultMessage: "Verify", icon: GdsIcons.Verify, feedback: { icon: GdsIcons.Verify, color: "teal", messageId: "gds.feedback.verified" } },
132
+ launch: { id: "gds.action.launch", defaultMessage: "Launch", icon: GdsIcons.Launch, feedback: { icon: GdsIcons.Launch, color: "purple", messageId: "gds.feedback.launched" } },
133
+ draft: { id: "gds.action.draft", defaultMessage: "Draft", icon: GdsIcons.Draft, feedback: { icon: GdsIcons.Draft, color: "teal", messageId: "gds.feedback.drafted" } },
134
+ refer: { id: "gds.action.refer", defaultMessage: "Refer", icon: GdsIcons.Refer, feedback: { icon: GdsIcons.Refer, color: "teal", messageId: "gds.feedback.referred" } },
135
+ evidence: { id: "gds.action.evidence", defaultMessage: "Evidence", icon: GdsIcons.Evidence, feedback: { icon: GdsIcons.Evidence, color: "teal", messageId: "gds.feedback.added" } }
136
+ };
137
+ function createGdsVocabularyPack(namespace, actions) {
138
+ return {
139
+ namespace,
140
+ actions: Object.fromEntries(
141
+ Object.entries(actions).map(([key, definition]) => [
142
+ `${namespace}:${key}`,
143
+ {
144
+ ...definition,
145
+ id: `gds.action.${namespace}.${key}`
146
+ }
147
+ ])
148
+ )
149
+ };
150
+ }
151
+ function mergeGdsVocabularyPacks(packs = []) {
152
+ return packs.reduce((acc, pack) => {
153
+ for (const [key, definition] of Object.entries(pack.actions)) {
154
+ acc[key] = definition;
155
+ }
156
+ return acc;
157
+ }, {});
158
+ }
159
+ function resolveSemanticActionConfig(action, packs = []) {
160
+ const baseConfig = GdsVocabulary[action];
161
+ if (baseConfig) {
162
+ return baseConfig;
163
+ }
164
+ const merged = mergeGdsVocabularyPacks(packs);
165
+ const packConfig = merged[action];
166
+ if (packConfig) {
167
+ return packConfig;
168
+ }
169
+ throw new Error(`Unknown semantic action: ${action}`);
170
+ }
171
+ function getSemanticActionConfig(action, packs = []) {
172
+ return resolveSemanticActionConfig(action, packs);
173
+ }
174
+ function getSemanticActionLabel(action, translate, packs = []) {
175
+ const config = resolveSemanticActionConfig(action, packs);
176
+ return translate ? translate(config.id, config.defaultMessage) : config.defaultMessage;
177
+ }
178
+
179
+ // src/GdsBadge.tsx
180
+ import { Badge } from "@mantine/core";
181
+ import { GDS_ACCENT_NAMES, GDS_ACCENT_SHADES, gdsDevWarnOnce, resolveGdsAccentTokens, useGdsBadgeIconStyle } from "@sovereignsquad/gds-theme";
182
+ import { jsx, jsxs } from "react/jsx-runtime";
183
+ var toneColors = {
184
+ success: { bg: "var(--gds-badge-solid-success)", fg: "var(--gds-badge-solid-success-fg)" },
185
+ warning: { bg: "var(--gds-badge-solid-warning)", fg: "var(--gds-badge-solid-warning-fg)" },
186
+ danger: { bg: "var(--gds-badge-solid-danger)", fg: "var(--gds-badge-solid-danger-fg)" },
187
+ info: { bg: "var(--gds-badge-solid-info)", fg: "var(--gds-badge-solid-info-fg)" },
188
+ neutral: {
189
+ bg: "var(--gds-bg-card, var(--mantine-color-gray-1, #f1f3f5))",
190
+ fg: "var(--gds-text-primary, var(--mantine-color-dark-7, #1f2937))",
191
+ border: "1px solid var(--gds-border-card, var(--mantine-color-gray-4, #ced4da))"
192
+ }
193
+ };
194
+ var gdsResolvedAccentTokens = resolveGdsAccentTokens(void 0, "light");
195
+ var accentToken = (accent, shade = "base") => `var(--gds-accent-${accent}-${shade}, ${gdsResolvedAccentTokens[`--gds-accent-${accent}-${shade}`]})`;
196
+ var gdsBadgeAccentColors = Object.fromEntries(
197
+ GDS_ACCENT_NAMES.map((name) => [name, gdsResolvedAccentTokens[`--gds-accent-${name}-base`]])
198
+ );
199
+ var gdsBadgeAccentShades = Object.fromEntries(
200
+ GDS_ACCENT_NAMES.map((name) => [
201
+ name,
202
+ Object.fromEntries(GDS_ACCENT_SHADES.map((shade) => [shade, gdsResolvedAccentTokens[`--gds-accent-${name}-${shade}`]]))
203
+ ])
204
+ );
205
+ function GdsBadgeEmojiCoin({ emoji }) {
206
+ return /* @__PURE__ */ jsx(
207
+ "span",
208
+ {
209
+ "data-gds-badge-emoji-coin": "",
210
+ "aria-hidden": "true",
211
+ style: {
212
+ display: "inline-flex",
213
+ alignItems: "center",
214
+ justifyContent: "center",
215
+ width: "1.35em",
216
+ height: "1.35em",
217
+ borderRadius: "50%",
218
+ background: "var(--mantine-color-dark-7, #1f2937)",
219
+ fontSize: "0.75em",
220
+ lineHeight: 1,
221
+ flexShrink: 0
222
+ },
223
+ children: emoji
224
+ }
225
+ );
226
+ }
227
+ function GdsBadge(props) {
228
+ const { label, icon, shape, tone, accent, emoji, iconStyle, style, ...rest } = props;
229
+ const resolvedIconStyle = useGdsBadgeIconStyle(iconStyle);
230
+ if (!label) {
231
+ return null;
232
+ }
233
+ const colors = accent ? { bg: accentToken(accent), fg: `var(--gds-accent-${accent}-on, #ffffff)` } : toneColors[tone ?? "neutral"];
234
+ const useEmoji = resolvedIconStyle === "emoji" && Boolean(emoji);
235
+ let leading = null;
236
+ if (useEmoji) {
237
+ if (shape) {
238
+ gdsDevWarnOnce(
239
+ "GdsBadge:emoji-with-shape",
240
+ "GdsBadge received both `shape` and an active `emoji` glyph \u2014 shape composition is not supported in emoji mode yet, so `shape` is ignored and the emoji renders on its own disc instead."
241
+ );
242
+ }
243
+ leading = /* @__PURE__ */ jsx(GdsBadgeEmojiCoin, { emoji });
244
+ } else if (shape) {
245
+ const Shape = GdsBadgeShapes[shape];
246
+ leading = /* @__PURE__ */ jsxs(GdsBadgeStack, { size: "1.1em", children: [
247
+ /* @__PURE__ */ jsx(GdsBadgeStackLayer, { children: /* @__PURE__ */ jsx(Shape, { size: "100%", stroke: 1.75, "aria-hidden": "true" }) }),
248
+ icon ? /* @__PURE__ */ jsx(
249
+ GdsBadgeStackLayer,
250
+ {
251
+ scale: shape === "pin" ? 0.42 : 0.55,
252
+ style: shape === "pin" ? { transform: "translateY(-4.1667%) scale(0.42)" } : void 0,
253
+ children: /* @__PURE__ */ jsx(GdsIcon, { icon, size: "100%" })
254
+ }
255
+ ) : null
256
+ ] });
257
+ } else if (icon) {
258
+ leading = /* @__PURE__ */ jsx(GdsIcon, { icon, size: "xs" });
259
+ }
260
+ return /* @__PURE__ */ jsx(
261
+ Badge,
262
+ {
263
+ "data-gds-badge": "",
264
+ "data-gds-badge-fixed-tone": "true",
265
+ variant: "filled",
266
+ leftSection: leading,
267
+ ...rest,
268
+ style: { backgroundColor: colors.bg, color: colors.fg, border: colors.border ?? "none", ...style },
269
+ children: label
270
+ }
271
+ );
272
+ }
273
+
274
+ // src/SectionPanel.tsx
275
+ import { Box, Divider, Group, Paper, Stack, Text, Title } from "@mantine/core";
276
+ import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
277
+ var toneBackgrounds = {
278
+ default: "var(--mantine-color-body)",
279
+ supporting: "light-dark(var(--mantine-color-gray-0), color-mix(in srgb, var(--mantine-color-dark-7) 92%, black))",
280
+ warning: "light-dark(var(--mantine-color-yellow-0), color-mix(in srgb, var(--mantine-color-yellow-9) 18%, var(--mantine-color-body)))",
281
+ critical: "light-dark(var(--mantine-color-red-0), color-mix(in srgb, var(--mantine-color-red-9) 18%, var(--mantine-color-body)))"
282
+ };
283
+ function SectionPanel({
284
+ eyebrow,
285
+ title,
286
+ description,
287
+ action,
288
+ children,
289
+ tone = "default",
290
+ id,
291
+ divided = true,
292
+ presentation = "inline",
293
+ minHeight,
294
+ contentAlign,
295
+ contentJustify
296
+ }) {
297
+ const bodyLayout = resolveSurfacePresentationStyles({
298
+ presentation,
299
+ minHeight,
300
+ contentAlign,
301
+ contentJustify
302
+ });
303
+ return (
304
+ // Responsive padding, not a flat `p="lg"`: this Paper is the outer shell
305
+ // every SectionPanel consumer nests further Paper-based cards inside (see
306
+ // ReferenceThemeExplorer's grid cards). Two flat-`lg` Paper shells
307
+ // stacking their own full padding ate up to ~35% of a narrow mobile
308
+ // viewport in unusable side margin before either card's own content
309
+ // started — confirmed live on a 390px viewport. `radius` drops one token
310
+ // (`xl` → `lg`) rather than going responsive: Mantine's `radius` prop is
311
+ // typed as a single `MantineRadius`, not the breakpoint-object `StyleProp`
312
+ // that spacing props like `p` accept, and a flat `lg` still keeps the
313
+ // corner proportional enough not to visually clip content at the new
314
+ // smaller mobile padding (the original `xl` would, at `xs` padding).
315
+ /* @__PURE__ */ jsx2(
316
+ Paper,
317
+ {
318
+ id,
319
+ withBorder: true,
320
+ radius: "lg",
321
+ p: { base: "xs", sm: "sm", md: "lg" },
322
+ style: { background: toneBackgrounds[tone] },
323
+ children: /* @__PURE__ */ jsxs2(Stack, { gap: "md", children: [
324
+ eyebrow || title || description || action ? /* @__PURE__ */ jsxs2(Fragment, { children: [
325
+ /* @__PURE__ */ jsxs2(Group, { justify: "space-between", align: "flex-start", gap: "md", wrap: "wrap", children: [
326
+ eyebrow || title || description ? /* @__PURE__ */ jsxs2(Stack, { gap: 4, children: [
327
+ eyebrow ? /* @__PURE__ */ jsx2(Text, { size: "xs", fw: 700, c: "dimmed", children: eyebrow }) : null,
328
+ title ? /* @__PURE__ */ jsx2(Title, { order: 3, children: title }) : null,
329
+ description ? /* @__PURE__ */ jsx2(Text, { size: "sm", c: "dimmed", children: description }) : null
330
+ ] }) : null,
331
+ action
332
+ ] }),
333
+ divided ? /* @__PURE__ */ jsx2(Divider, {}) : null
334
+ ] }) : null,
335
+ /* @__PURE__ */ jsx2(Box, { style: bodyLayout, children })
336
+ ] })
337
+ }
338
+ )
339
+ );
340
+ }
341
+
342
+ // src/ReferenceSection.tsx
343
+ import { Anchor } from "@mantine/core";
344
+ import { useGdsTranslation } from "@sovereignsquad/gds-theme";
345
+ import { jsx as jsx3 } from "react/jsx-runtime";
346
+ function ReferenceSection({
347
+ title,
348
+ description,
349
+ eyebrow,
350
+ action,
351
+ href,
352
+ linkLabel,
353
+ tone = "default",
354
+ id,
355
+ children
356
+ }) {
357
+ const { t } = useGdsTranslation();
358
+ return /* @__PURE__ */ jsx3(
359
+ SectionPanel,
360
+ {
361
+ id,
362
+ tone,
363
+ eyebrow,
364
+ title,
365
+ description,
366
+ action: action ?? (href ? /* @__PURE__ */ jsx3(Anchor, { href, fw: 600, children: linkLabel ?? t("gds.reference.openSection", "Open section") }) : null),
367
+ divided: false,
368
+ children
369
+ }
370
+ );
371
+ }
372
+
373
+ // src/ActionBar.tsx
374
+ import { ActionIcon, Button, Group as Group2, Stack as Stack2 } from "@mantine/core";
375
+ import { useGdsTranslation as useGdsTranslation2 } from "@sovereignsquad/gds-theme";
376
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
377
+ function renderSemanticAction(action, slot, vocabularyPacks, t) {
378
+ const { action: actionId, variant, ariaLabel, ...props } = action;
379
+ const fallbackVariant = slot === "primary" ? "filled" : slot === "secondary" ? "default" : "subtle";
380
+ const config = resolveSemanticActionConfig(actionId, vocabularyPacks);
381
+ const Icon = config.icon;
382
+ const label = getSemanticActionLabel(actionId, t, vocabularyPacks);
383
+ return /* @__PURE__ */ jsx4(
384
+ Button,
385
+ {
386
+ leftSection: /* @__PURE__ */ jsx4(Icon, { size: "1rem", stroke: 1.75 }),
387
+ "aria-label": ariaLabel ?? label,
388
+ variant: variant ?? fallbackVariant,
389
+ ...props,
390
+ children: label
391
+ },
392
+ `${slot}-${actionId}`
393
+ );
394
+ }
395
+ function ActionBar({
396
+ primary,
397
+ secondary = [],
398
+ tertiary = [],
399
+ iconOnly = [],
400
+ gap = "sm",
401
+ vocabularyPacks = []
402
+ }) {
403
+ const { t } = useGdsTranslation2();
404
+ return /* @__PURE__ */ jsx4(Stack2, { gap, children: /* @__PURE__ */ jsxs3(Group2, { justify: "space-between", align: "center", gap, wrap: "wrap", children: [
405
+ /* @__PURE__ */ jsxs3(Group2, { gap, wrap: "wrap", children: [
406
+ secondary.map((action) => renderSemanticAction(action, "secondary", vocabularyPacks, t)),
407
+ tertiary.map((action) => renderSemanticAction(action, "tertiary", vocabularyPacks, t))
408
+ ] }),
409
+ /* @__PURE__ */ jsxs3(Group2, { gap, wrap: "wrap", justify: "flex-end", children: [
410
+ iconOnly.map(({ action, ariaLabel, ...props }) => {
411
+ const config = resolveSemanticActionConfig(action, vocabularyPacks);
412
+ const Icon = config.icon;
413
+ return /* @__PURE__ */ jsx4(
414
+ ActionIcon,
415
+ {
416
+ variant: "subtle",
417
+ size: "lg",
418
+ "aria-label": ariaLabel ?? getSemanticActionLabel(action, t, vocabularyPacks),
419
+ ...props,
420
+ children: /* @__PURE__ */ jsx4(Icon, { size: "1rem", stroke: 1.75 })
421
+ },
422
+ `icon-${action}`
423
+ );
424
+ }),
425
+ primary ? renderSemanticAction(primary, "primary", vocabularyPacks, t) : null
426
+ ] })
427
+ ] }) });
428
+ }
429
+
430
+ // src/generated-art-engine.ts
431
+ import { mixCssColors, resolveGdsAccentTokens as resolveGdsAccentTokens2 } from "@sovereignsquad/gds-theme";
432
+ import { getGdsVibeThemeCssVariables, resolveGdsVibeTheme } from "@sovereignsquad/gds-theme";
433
+ var gdsResolvedAccentFallback = resolveGdsAccentTokens2(void 0, "light");
434
+ function gdsSeededRandom(seed) {
435
+ let hash = 2166136261;
436
+ for (let i = 0; i < seed.length; i += 1) {
437
+ hash ^= seed.charCodeAt(i);
438
+ hash = Math.imul(hash, 16777619);
439
+ }
440
+ let state = hash >>> 0;
441
+ return () => {
442
+ state |= 0;
443
+ state = state + 1831565813 | 0;
444
+ let t = Math.imul(state ^ state >>> 15, 1 | state);
445
+ t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t;
446
+ return ((t ^ t >>> 14) >>> 0) / 4294967296;
447
+ };
448
+ }
449
+ var DEFAULT_VIBE = resolveGdsVibeTheme("default");
450
+ function resolveCategoryColorToken(options) {
451
+ if (!options.category) {
452
+ throw new Error("gds-core generated-art-engine: paletteSource 'category' requires a `category` option (a GdsBadgeAccentName).");
453
+ }
454
+ const shade = options.shade ?? "base";
455
+ return `var(--gds-accent-${options.category}-${shade}, ${gdsResolvedAccentFallback[`--gds-accent-${options.category}-${shade}`]})`;
456
+ }
457
+ function resolveCategoryColorHex(options) {
458
+ if (!options.category) {
459
+ throw new Error("gds-core generated-art-engine: paletteSource 'category' requires a `category` option (a GdsBadgeAccentName).");
460
+ }
461
+ const shade = options.shade ?? "base";
462
+ const tokens = options.themePresetId ? getGdsVibeThemeCssVariables(options.themePresetId, options.colorScheme ?? "light") : gdsResolvedAccentFallback;
463
+ const resolved = tokens[`--gds-accent-${options.category}-${shade}`];
464
+ if (!resolved) {
465
+ throw new Error(
466
+ `gds-core generated-art-engine: no resolved value for --gds-accent-${options.category}-${shade}. A missing accent token must fail here rather than emit an unpainted shape.`
467
+ );
468
+ }
469
+ return resolved;
470
+ }
471
+ function applyCssTint(color, options) {
472
+ if (!options.tintWithBackground || options.mixRatio === void 0) {
473
+ return color;
474
+ }
475
+ return `color-mix(in srgb, ${color} ${Math.round(options.mixRatio * 100)}%, ${options.tintWithBackground})`;
476
+ }
477
+ function gdsGeneratedPaletteCssRefs(options = {}) {
478
+ if (options.colors) {
479
+ return { ...options.colors, source: "override" };
480
+ }
481
+ const source = options.paletteSource ?? "theme";
482
+ if (source === "category") {
483
+ const color = applyCssTint(resolveCategoryColorToken(options), options);
484
+ return { primary: color, accent: color, source: "category" };
485
+ }
486
+ return {
487
+ primary: applyCssTint(`var(--gds-brand-primary, ${DEFAULT_VIBE.primary})`, options),
488
+ accent: applyCssTint(`var(--gds-brand-accent, ${DEFAULT_VIBE.accent})`, options),
489
+ source: "theme"
490
+ };
491
+ }
492
+ function applyHexTint(color, options) {
493
+ if (!options.tintWithBackground || options.mixRatio === void 0) {
494
+ return color;
495
+ }
496
+ return mixCssColors(color, options.tintWithBackground, options.mixRatio, "#ffffff");
497
+ }
498
+ function resolveGdsGeneratedPaletteHex(options = {}) {
499
+ if (options.colors) {
500
+ return { ...options.colors, source: "override" };
501
+ }
502
+ const source = options.paletteSource ?? "theme";
503
+ if (source === "category") {
504
+ const color = applyHexTint(resolveCategoryColorHex(options), options);
505
+ return { primary: color, accent: color, source: "category" };
506
+ }
507
+ if (!options.themePresetId) {
508
+ throw new Error(
509
+ "gds-core generated-art-engine: resolveGdsGeneratedPaletteHex with paletteSource 'theme' requires either `themePresetId` (one of the built-in presets) or an explicit `colors` override for a custom brand theme \u2014 there is no live DOM to read CSS variables from outside a browser."
510
+ );
511
+ }
512
+ const variables = getGdsVibeThemeCssVariables(options.themePresetId, options.colorScheme ?? "light");
513
+ return {
514
+ primary: applyHexTint(variables["--gds-brand-primary"] ?? DEFAULT_VIBE.primary, options),
515
+ accent: applyHexTint(variables["--gds-brand-accent"] ?? DEFAULT_VIBE.accent, options),
516
+ source: "theme"
517
+ };
518
+ }
519
+
520
+ // src/GdsGeneratedThumbnail.tsx
521
+ import { cloneElement, isValidElement, useId, useMemo } from "react";
522
+ import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
523
+ var ASPECT_RATIO_VIEWBOX = {
524
+ "3:2": { width: 300, height: 200 },
525
+ "16:9": { width: 320, height: 180 },
526
+ "4:3": { width: 320, height: 240 },
527
+ "1:1": { width: 240, height: 240 }
528
+ };
529
+ var isIconKey = (icon) => typeof icon === "string";
530
+ function renderIcon(icon, size = "100%") {
531
+ if (isIconKey(icon)) {
532
+ return /* @__PURE__ */ jsx5(GdsIcon, { icon, size, tone: "default" });
533
+ }
534
+ if (isValidElement(icon)) {
535
+ return cloneElement(icon, { stroke: 1.75 });
536
+ }
537
+ return icon;
538
+ }
539
+ function darkSurface(colorRef) {
540
+ return `color-mix(in srgb, ${colorRef} 30%, black)`;
541
+ }
542
+ function computeMotifTransform(seed, viewBoxWidth, viewBoxHeight) {
543
+ const next = gdsSeededRandom(seed);
544
+ const rotationDeg = (next() - 0.5) * 26;
545
+ const scale = viewBoxHeight / 24 * (1.7 + next() * 0.3);
546
+ const centerX = viewBoxWidth * (0.78 + (next() - 0.5) * 0.12);
547
+ const centerY = viewBoxHeight * (0.28 + (next() - 0.5) * 0.14);
548
+ return { rotationDeg, scale, centerX, centerY };
549
+ }
550
+ function computeMosaicTiles(seed, viewBoxWidth, viewBoxHeight) {
551
+ const next = gdsSeededRandom(`${seed}:mosaic`);
552
+ const columns = 9;
553
+ const rows = 4;
554
+ const cellWidth = viewBoxWidth / columns;
555
+ const cellHeight = viewBoxHeight / rows;
556
+ const tiles = [];
557
+ for (let row = 0; row < rows; row += 1) {
558
+ for (let col = 0; col < columns; col += 1) {
559
+ if (next() < 0.32) {
560
+ continue;
561
+ }
562
+ const inset = 0.08 + next() * 0.1;
563
+ tiles.push({
564
+ x: col * cellWidth + cellWidth * inset,
565
+ y: row * cellHeight + cellHeight * inset,
566
+ width: cellWidth * (1 - inset * 2),
567
+ height: cellHeight * (1 - inset * 2),
568
+ opacity: 0.05 + next() * 0.11,
569
+ usePrimary: next() < 0.5
570
+ });
571
+ }
572
+ }
573
+ return tiles;
574
+ }
575
+ function computeIconFieldPlacements(seed, count, viewBoxWidth, viewBoxHeight) {
576
+ const next = gdsSeededRandom(`${seed}:icon-field`);
577
+ return Array.from({ length: count }, () => ({
578
+ x: viewBoxWidth * (0.08 + next() * 0.84),
579
+ y: viewBoxHeight * (0.1 + next() * 0.8),
580
+ size: viewBoxHeight * (0.22 + next() * 0.16),
581
+ rotationDeg: (next() - 0.5) * 40
582
+ }));
583
+ }
584
+ function renderBackground(background, categories, seed, palette, viewBoxWidth, viewBoxHeight) {
585
+ if (background === "mosaic-abstract") {
586
+ const tiles = computeMosaicTiles(seed, viewBoxWidth, viewBoxHeight);
587
+ return /* @__PURE__ */ jsx5(Fragment2, { children: tiles.map((tile, index) => /* @__PURE__ */ jsx5(
588
+ "rect",
589
+ {
590
+ x: tile.x,
591
+ y: tile.y,
592
+ width: tile.width,
593
+ height: tile.height,
594
+ rx: Math.min(tile.width, tile.height) * 0.12,
595
+ fill: tile.usePrimary ? palette.primary : palette.accent,
596
+ opacity: tile.opacity
597
+ },
598
+ index
599
+ )) });
600
+ }
601
+ if (background === "icon-field") {
602
+ if (categories.length === 0) {
603
+ return null;
604
+ }
605
+ const next = gdsSeededRandom(`${seed}:icon-field-pick`);
606
+ const placements = computeIconFieldPlacements(seed, Math.min(categories.length, 8), viewBoxWidth, viewBoxHeight);
607
+ return /* @__PURE__ */ jsx5(Fragment2, { children: placements.map((placement, index) => {
608
+ const entry = categories[Math.floor(next() * categories.length)];
609
+ return /* @__PURE__ */ jsx5(
610
+ "g",
611
+ {
612
+ transform: `translate(${placement.x} ${placement.y}) rotate(${placement.rotationDeg}) scale(${placement.size / 24})`,
613
+ opacity: 0.1,
614
+ style: { color: "var(--gds-text-on-inverse, var(--mantine-color-white))" },
615
+ children: /* @__PURE__ */ jsx5("svg", { x: -12, y: -12, width: 24, height: 24, viewBox: "0 0 24 24", children: renderIcon(entry.icon) })
616
+ },
617
+ index
618
+ );
619
+ }) });
620
+ }
621
+ return /* @__PURE__ */ jsx5(Fragment2, { children: background.regions.map((region, index) => {
622
+ const weight = region.weight ?? 1;
623
+ return /* @__PURE__ */ jsx5(
624
+ "rect",
625
+ {
626
+ x: region.x0 * viewBoxWidth,
627
+ y: region.y0 * viewBoxHeight,
628
+ width: (region.x1 - region.x0) * viewBoxWidth,
629
+ height: (region.y1 - region.y0) * viewBoxHeight,
630
+ fill: palette.accent,
631
+ opacity: Math.min(0.85, 0.06 + weight * 0.05)
632
+ },
633
+ index
634
+ );
635
+ }) });
636
+ }
637
+ function GdsGeneratedThumbnail({
638
+ seed,
639
+ categories,
640
+ paletteSource,
641
+ category,
642
+ shade,
643
+ colors,
644
+ tintWithBackground,
645
+ mixRatio,
646
+ aspectRatio = "3:2",
647
+ maxBadges = 3,
648
+ badges = "ranked",
649
+ motifOpacity = 0.14,
650
+ background = "wash",
651
+ label,
652
+ className,
653
+ style
654
+ }) {
655
+ if (categories.length === 0) {
656
+ throw new Error("GdsGeneratedThumbnail: `categories` must contain at least one entry.");
657
+ }
658
+ const gradientId = useId();
659
+ const palette = useMemo(
660
+ () => gdsGeneratedPaletteCssRefs({ paletteSource, category, shade, colors, tintWithBackground, mixRatio }),
661
+ [paletteSource, category, shade, colors, tintWithBackground, mixRatio]
662
+ );
663
+ const { width: viewBoxWidth, height: viewBoxHeight } = ASPECT_RATIO_VIEWBOX[aspectRatio];
664
+ const motif = useMemo(() => computeMotifTransform(seed, viewBoxWidth, viewBoxHeight), [seed, viewBoxWidth, viewBoxHeight]);
665
+ const lead = categories[0];
666
+ const secondary = categories.slice(1, Math.max(maxBadges, 1));
667
+ const inverseColor = "var(--gds-text-on-inverse, var(--mantine-color-white))";
668
+ const pillBg = darkSurface(palette.accent);
669
+ return /* @__PURE__ */ jsxs4(
670
+ "div",
671
+ {
672
+ "data-gds-generated-thumbnail": "",
673
+ role: label ? "group" : void 0,
674
+ "aria-label": label || void 0,
675
+ className,
676
+ style: {
677
+ position: "relative",
678
+ aspectRatio: aspectRatio.replace(":", " / "),
679
+ overflow: "hidden",
680
+ borderRadius: "var(--mantine-radius-md, 12px)",
681
+ ...style
682
+ },
683
+ children: [
684
+ /* @__PURE__ */ jsxs4(
685
+ "svg",
686
+ {
687
+ viewBox: `0 0 ${viewBoxWidth} ${viewBoxHeight}`,
688
+ preserveAspectRatio: "xMidYMid slice",
689
+ "aria-hidden": "true",
690
+ style: { position: "absolute", inset: 0, width: "100%", height: "100%", display: "block" },
691
+ children: [
692
+ /* @__PURE__ */ jsx5("defs", { children: /* @__PURE__ */ jsxs4("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
693
+ /* @__PURE__ */ jsx5("stop", { offset: "0%", stopColor: palette.primary }),
694
+ /* @__PURE__ */ jsx5("stop", { offset: "100%", stopColor: darkSurface(palette.primary) })
695
+ ] }) }),
696
+ /* @__PURE__ */ jsx5("rect", { width: viewBoxWidth, height: viewBoxHeight, fill: `url(#${gradientId})` }),
697
+ background === "wash" ? /* @__PURE__ */ jsx5(
698
+ "g",
699
+ {
700
+ transform: `translate(${motif.centerX} ${motif.centerY}) rotate(${motif.rotationDeg}) scale(${motif.scale})`,
701
+ opacity: motifOpacity,
702
+ style: { color: inverseColor },
703
+ children: /* @__PURE__ */ jsx5("svg", { x: -12, y: -12, width: 24, height: 24, viewBox: "0 0 24 24", children: renderIcon(lead.icon) })
704
+ }
705
+ ) : renderBackground(background, categories, seed, palette, viewBoxWidth, viewBoxHeight)
706
+ ]
707
+ }
708
+ ),
709
+ badges === "none" ? null : /* @__PURE__ */ jsxs4(
710
+ "div",
711
+ {
712
+ style: {
713
+ position: "absolute",
714
+ insetInline: 0,
715
+ insetBlockEnd: 0,
716
+ padding: "var(--gds-space-xs) var(--gds-space-sm)",
717
+ display: "flex",
718
+ alignItems: "center",
719
+ background: `linear-gradient(to top, ${darkSurface(palette.primary)} 0%, transparent 100%)`
720
+ },
721
+ children: [
722
+ (() => {
723
+ const LeadTag = lead.onSelect ? "button" : "span";
724
+ return /* @__PURE__ */ jsxs4(
725
+ LeadTag,
726
+ {
727
+ "data-gds-generated-thumbnail-badge": "lead",
728
+ type: lead.onSelect ? "button" : void 0,
729
+ onClick: lead.onSelect ? () => lead.onSelect?.(lead.key) : void 0,
730
+ style: {
731
+ display: "inline-flex",
732
+ alignItems: "center",
733
+ gap: "0.35em",
734
+ padding: "0.3em 0.65em 0.3em 0.45em",
735
+ borderRadius: "var(--gds-radius-pill)",
736
+ background: pillBg,
737
+ color: inverseColor,
738
+ fontSize: "13px",
739
+ fontWeight: 600,
740
+ lineHeight: 1.2,
741
+ whiteSpace: "nowrap",
742
+ border: "none",
743
+ font: lead.onSelect ? "inherit" : void 0,
744
+ cursor: lead.onSelect ? "pointer" : void 0
745
+ },
746
+ children: [
747
+ /* @__PURE__ */ jsx5("span", { "aria-hidden": "true", style: { width: "1.1em", height: "1.1em", display: "inline-flex" }, children: renderIcon(lead.icon, "100%") }),
748
+ lead.label
749
+ ]
750
+ }
751
+ );
752
+ })(),
753
+ secondary.map((entry, index) => {
754
+ const SecondaryTag = entry.onSelect ? "button" : "span";
755
+ return /* @__PURE__ */ jsx5(
756
+ SecondaryTag,
757
+ {
758
+ "data-gds-generated-thumbnail-badge": "secondary",
759
+ type: entry.onSelect ? "button" : void 0,
760
+ onClick: entry.onSelect ? () => entry.onSelect?.(entry.key) : void 0,
761
+ role: entry.onSelect ? void 0 : "img",
762
+ "aria-label": entry.label,
763
+ title: entry.onSelect ? void 0 : entry.label,
764
+ style: {
765
+ display: "inline-flex",
766
+ alignItems: "center",
767
+ justifyContent: "center",
768
+ width: "1.9em",
769
+ height: "1.9em",
770
+ marginInlineStart: index === 0 ? "-0.3em" : "-0.5em",
771
+ borderRadius: "50%",
772
+ background: pillBg,
773
+ color: inverseColor,
774
+ border: "2px solid " + darkSurface(palette.primary),
775
+ opacity: 1 - index * 0.12,
776
+ flexShrink: 0,
777
+ font: entry.onSelect ? "inherit" : void 0,
778
+ cursor: entry.onSelect ? "pointer" : void 0
779
+ },
780
+ children: /* @__PURE__ */ jsx5("span", { "aria-hidden": "true", style: { width: "1em", height: "1em", display: "inline-flex" }, children: renderIcon(entry.icon, "100%") })
781
+ },
782
+ entry.key
783
+ );
784
+ })
785
+ ]
786
+ }
787
+ )
788
+ ]
789
+ }
790
+ );
791
+ }
792
+
793
+ // src/CardContracts.ts
794
+ var gdsCardSizePaddingMap = {
795
+ xs: "xs",
796
+ sm: "sm",
797
+ md: "md",
798
+ lg: "lg",
799
+ xl: "xl"
800
+ };
801
+ var gdsCardDensityPaddingMap = {
802
+ xs: { compact: "xs", comfortable: "xs", spacious: "sm" },
803
+ sm: { compact: "xs", comfortable: "sm", spacious: "md" },
804
+ md: { compact: "sm", comfortable: "md", spacious: "lg" },
805
+ lg: { compact: "md", comfortable: "lg", spacious: "xl" },
806
+ xl: { compact: "lg", comfortable: "xl", spacious: "xl" }
807
+ };
808
+ var gdsCardTitleOrderMap = {
809
+ xs: 6,
810
+ sm: 5,
811
+ md: 4,
812
+ lg: 4,
813
+ xl: 3
814
+ };
815
+ var gdsCardGapMap = {
816
+ compact: "sm",
817
+ comfortable: "md",
818
+ spacious: "lg"
819
+ };
820
+ var gdsCardMediaRatioMap = {
821
+ default: 4 / 3,
822
+ "media-top": 4 / 3,
823
+ "media-left": 1,
824
+ compact: 16 / 9
825
+ };
826
+ function resolveGdsCardContract({
827
+ size = "md",
828
+ density = "comfortable",
829
+ variant = "default",
830
+ compact = false
831
+ } = {}) {
832
+ const resolvedSize = compact ? "sm" : size;
833
+ const resolvedDensity = compact ? "compact" : density;
834
+ const resolvedVariant = compact ? "compact" : variant;
835
+ return {
836
+ size: resolvedSize,
837
+ density: resolvedDensity,
838
+ variant: resolvedVariant,
839
+ padding: gdsCardDensityPaddingMap[resolvedSize][resolvedDensity],
840
+ gap: gdsCardGapMap[resolvedDensity],
841
+ titleOrder: gdsCardTitleOrderMap[resolvedSize],
842
+ descriptionClamp: resolvedDensity === "compact" ? 2 : resolvedSize === "xl" ? 4 : 3,
843
+ mediaRatio: gdsCardMediaRatioMap[resolvedVariant],
844
+ mediaPlacement: resolvedVariant === "media-left" ? "left" : "top",
845
+ actionWrap: resolvedDensity === "compact" ? "nowrap" : "wrap",
846
+ minTouchTarget: resolvedDensity === "compact" ? 40 : 44,
847
+ dataAttributes: {
848
+ "data-gds-card-size": resolvedSize,
849
+ "data-gds-card-density": resolvedDensity,
850
+ "data-gds-card-variant": resolvedVariant
851
+ }
852
+ };
853
+ }
854
+
855
+ // src/ListingCard.tsx
856
+ import { useState } from "react";
857
+ import { useGdsTranslation as useGdsTranslation3 } from "@sovereignsquad/gds-theme";
858
+ import { ActionIcon as ActionIcon2, Badge as Badge2, Box as Box2, Card, Group as Group3, Stack as Stack3, Text as Text2, Title as Title2 } from "@mantine/core";
859
+ import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
860
+ var toneColorMap = {
861
+ default: void 0,
862
+ positive: "teal",
863
+ warning: "orange",
864
+ muted: "gray"
865
+ };
866
+ var MAX_LISTING_CARD_ACTIONS = 4;
867
+ var GDS_LISTING_TILE_SIZE_PX = 96;
868
+ var GDS_LISTING_PICK_BADGE_INSET_PX = 6;
869
+ var GDS_LISTING_PICK_BADGE_ICON_PX = 9;
870
+ var GDS_LISTING_PICK_BADGE_FONT_SIZE_PX = 9;
871
+ var GDS_LISTING_PICK_BADGE_LINE_HEIGHT_PX = 13.5;
872
+ var GDS_LISTING_PICK_BADGE_PADDING_BLOCK_PX = 2;
873
+ var GDS_LISTING_PICK_BADGE_PADDING_INLINE_PX = 6;
874
+ function resolveCardActions(actions) {
875
+ if (!actions || actions.length === 0) {
876
+ return null;
877
+ }
878
+ if (actions.length > MAX_LISTING_CARD_ACTIONS) {
879
+ throw new Error(`ListingCard supports at most ${MAX_LISTING_CARD_ACTIONS} actions, received ${actions.length}.`);
880
+ }
881
+ return actions;
882
+ }
883
+ function isNestedInteractiveTarget(eventTarget, currentTarget) {
884
+ if (!(eventTarget instanceof Element) || !(currentTarget instanceof Element)) {
885
+ return false;
886
+ }
887
+ const nestedInteractive = eventTarget.closest('a, button, input, select, textarea, [role="button"], [role="link"]');
888
+ return Boolean(nestedInteractive && nestedInteractive !== currentTarget);
889
+ }
890
+ function ListingImageFallback({
891
+ mediaRatio,
892
+ seed,
893
+ title
894
+ }) {
895
+ return /* @__PURE__ */ jsx6(
896
+ GdsGeneratedThumbnail,
897
+ {
898
+ seed,
899
+ categories: [{ key: "listing", label: title, icon: "Gallery" }],
900
+ badges: "none",
901
+ aspectRatio: mediaRatio === "1:1" ? "1:1" : mediaRatio === "16:9" ? "16:9" : "4:3"
902
+ }
903
+ );
904
+ }
905
+ function ListingAffordance({ affordance }) {
906
+ const config = GdsVocabulary[affordance.action];
907
+ const Icon = config.icon;
908
+ const label = affordance.ariaLabel ?? getSemanticActionLabel(affordance.action);
909
+ const onMedia = affordance.presentation === "outline-on-media";
910
+ const mediaStyle = onMedia ? {
911
+ background: "transparent",
912
+ color: "var(--gds-text-on-inverse, var(--mantine-color-white))",
913
+ filter: "drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55))"
914
+ } : void 0;
915
+ const activeStyle = affordance.active ? {
916
+ // Accent on its own tint is 1.60:1 in high-contrast dark; use the tint's derived foreground.
917
+ color: "var(--gds-brand-accent-tint-fg, var(--gds-brand-accent-action, var(--gds-vibe-accent, var(--mantine-primary-color-filled))))",
918
+ background: "var(--gds-brand-accent-tint, var(--mantine-color-default-hover))"
919
+ } : void 0;
920
+ if (affordance.href) {
921
+ return /* @__PURE__ */ jsx6(
922
+ ActionIcon2,
923
+ {
924
+ component: "a",
925
+ href: affordance.href,
926
+ variant: onMedia ? "transparent" : "subtle",
927
+ size: "xl",
928
+ "aria-label": label,
929
+ "data-gds-active": affordance.active ? "true" : void 0,
930
+ style: { ...mediaStyle, ...activeStyle },
931
+ disabled: affordance.disabled,
932
+ children: /* @__PURE__ */ jsx6(Icon, { size: "1rem", stroke: 1.75 })
933
+ }
934
+ );
935
+ }
936
+ return /* @__PURE__ */ jsx6(
937
+ ActionIcon2,
938
+ {
939
+ variant: onMedia ? "transparent" : "subtle",
940
+ size: "xl",
941
+ "aria-label": label,
942
+ onClick: affordance.onClick,
943
+ "data-gds-active": affordance.active ? "true" : void 0,
944
+ style: { ...mediaStyle, ...activeStyle },
945
+ disabled: affordance.disabled,
946
+ children: /* @__PURE__ */ jsx6(Icon, { size: "1rem", stroke: 1.75 })
947
+ }
948
+ );
949
+ }
950
+ function ListingPickBadge({
951
+ config,
952
+ defaultLabel
953
+ }) {
954
+ const override = typeof config === "object" ? config : void 0;
955
+ const label = override?.label ?? defaultLabel;
956
+ const ariaLabel = override?.ariaLabel ?? (typeof label === "string" ? label : defaultLabel);
957
+ return /* @__PURE__ */ jsxs5(
958
+ Group3,
959
+ {
960
+ gap: 4,
961
+ wrap: "nowrap",
962
+ align: "center",
963
+ role: "group",
964
+ "aria-label": ariaLabel,
965
+ "data-gds-listing-pick-badge": true,
966
+ style: {
967
+ width: "fit-content",
968
+ borderRadius: "var(--gds-radius-pill)",
969
+ backgroundColor: "var(--gds-badge-pick-bg, color-mix(in srgb, var(--gds-text-primary) 60%, transparent))",
970
+ color: "var(--gds-text-on-inverse, var(--mantine-color-white))",
971
+ fontSize: `${GDS_LISTING_PICK_BADGE_FONT_SIZE_PX}px`,
972
+ lineHeight: `${GDS_LISTING_PICK_BADGE_LINE_HEIGHT_PX}px`,
973
+ fontWeight: 700,
974
+ paddingBlock: `${GDS_LISTING_PICK_BADGE_PADDING_BLOCK_PX}px`,
975
+ paddingInline: `${GDS_LISTING_PICK_BADGE_PADDING_INLINE_PX}px`
976
+ },
977
+ children: [
978
+ /* @__PURE__ */ jsx6(GdsIcons.Star, { size: GDS_LISTING_PICK_BADGE_ICON_PX, stroke: 1.75, fill: "currentColor", "aria-hidden": "true" }),
979
+ /* @__PURE__ */ jsx6("span", { children: label })
980
+ ]
981
+ }
982
+ );
983
+ }
984
+ function ListingCard({
985
+ title,
986
+ href,
987
+ description,
988
+ image,
989
+ imageAlt,
990
+ mediaSeed,
991
+ mediaRatio = "4:3",
992
+ metadata = [],
993
+ featured = false,
994
+ selected = false,
995
+ sponsoredDisclosure,
996
+ price,
997
+ rating,
998
+ ratingLabel: ratingLabelProp,
999
+ primaryAction,
1000
+ reason,
1001
+ reasonLabel: reasonLabelProp,
1002
+ score,
1003
+ actions,
1004
+ mediaOverlay,
1005
+ mediaAffordance,
1006
+ pickBadge,
1007
+ saveAction,
1008
+ saved = false,
1009
+ shareAction,
1010
+ compact = false,
1011
+ size = "md",
1012
+ density = "comfortable",
1013
+ variant = "default",
1014
+ interactiveMode = "none",
1015
+ revealContent,
1016
+ onSurfaceActivate,
1017
+ defaultFlipped = false
1018
+ }) {
1019
+ const { t } = useGdsTranslation3();
1020
+ const ratingLabel = ratingLabelProp ?? t("gds.listingCard.ratingLabel", "Rating");
1021
+ const reasonLabel = reasonLabelProp ?? t("gds.listingCard.reasonLabel", "Why this fits");
1022
+ const featuredLabel = t("gds.listingCard.featuredLabel", "Featured");
1023
+ const pickLabel = t("gds.listingCard.pickLabel", "Pick");
1024
+ const [flipped, setFlipped] = useState(defaultFlipped);
1025
+ const resolvedActions = resolveCardActions(actions);
1026
+ const contract = resolveGdsCardContract({ compact, size, density, variant });
1027
+ const resolvedSaveAction = saveAction ? { ...saveAction, active: saveAction.active ?? saved } : void 0;
1028
+ const cardPadding = contract.padding;
1029
+ const isInteractive = interactiveMode !== "none";
1030
+ const isFlipMode = interactiveMode === "flip" && Boolean(revealContent);
1031
+ const isRowTile = contract.mediaPlacement === "left";
1032
+ const emphasized = featured || selected;
1033
+ const titleContent = href && typeof title === "string" && interactiveMode === "none" ? /* @__PURE__ */ jsx6(Text2, { component: "a", href, inherit: true, td: "none", children: title }) : title;
1034
+ const activateSurface = (event) => {
1035
+ if (isNestedInteractiveTarget(event.target, event.currentTarget)) {
1036
+ return;
1037
+ }
1038
+ if (isFlipMode) {
1039
+ setFlipped((current) => !current);
1040
+ onSurfaceActivate?.();
1041
+ return;
1042
+ }
1043
+ if (interactiveMode === "surface-button") {
1044
+ onSurfaceActivate?.();
1045
+ return;
1046
+ }
1047
+ if (interactiveMode === "surface-link" && href) {
1048
+ onSurfaceActivate?.();
1049
+ if (typeof window !== "undefined") {
1050
+ window.location.assign(href);
1051
+ }
1052
+ }
1053
+ };
1054
+ const handleKeyDown = (event) => {
1055
+ if (!isInteractive || isNestedInteractiveTarget(event.target, event.currentTarget)) {
1056
+ return;
1057
+ }
1058
+ if (event.key === "Enter" || event.key === " ") {
1059
+ event.preventDefault();
1060
+ activateSurface(event);
1061
+ }
1062
+ };
1063
+ const surfaceLabel = typeof title === "string" ? title : "listing";
1064
+ const interactiveProps = isInteractive ? {
1065
+ role: interactiveMode === "surface-link" ? "link" : "button",
1066
+ tabIndex: 0,
1067
+ onClick: activateSurface,
1068
+ onKeyDown: handleKeyDown,
1069
+ "aria-expanded": isFlipMode ? flipped : void 0,
1070
+ "aria-current": selected && interactiveMode === "surface-link" ? "true" : void 0,
1071
+ "aria-label": isFlipMode ? `Toggle details for ${surfaceLabel}` : surfaceLabel
1072
+ } : {};
1073
+ const mediaSeedValue = mediaSeed ?? href ?? imageAlt ?? (typeof title === "string" ? title : "gds-listing");
1074
+ const fallbackTitle = typeof title === "string" ? title : imageAlt ?? "Listing";
1075
+ const mediaContent = image ?? /* @__PURE__ */ jsx6(
1076
+ ListingImageFallback,
1077
+ {
1078
+ mediaRatio: isRowTile ? "1:1" : mediaRatio,
1079
+ seed: mediaSeedValue,
1080
+ title: fallbackTitle
1081
+ }
1082
+ );
1083
+ const pickBadgeElement = pickBadge ? /* @__PURE__ */ jsx6(ListingPickBadge, { config: pickBadge, defaultLabel: pickLabel }) : null;
1084
+ const topLeftOverlay = pickBadgeElement ? /* @__PURE__ */ jsx6(
1085
+ Box2,
1086
+ {
1087
+ style: {
1088
+ position: "absolute",
1089
+ insetBlockStart: `${GDS_LISTING_PICK_BADGE_INSET_PX}px`,
1090
+ insetInlineStart: `${GDS_LISTING_PICK_BADGE_INSET_PX}px`,
1091
+ zIndex: 1
1092
+ },
1093
+ children: mediaOverlay ? /* @__PURE__ */ jsxs5(Stack3, { gap: "xs", children: [
1094
+ pickBadgeElement,
1095
+ mediaOverlay
1096
+ ] }) : pickBadgeElement
1097
+ }
1098
+ ) : mediaOverlay ? /* @__PURE__ */ jsx6(Box2, { style: { position: "absolute", top: "var(--mantine-spacing-xs)", left: "var(--mantine-spacing-xs)", zIndex: 1 }, children: mediaOverlay }) : null;
1099
+ const affordanceOverlay = mediaAffordance ? /* @__PURE__ */ jsx6(Box2, { style: { position: "absolute", top: 0, right: 0, zIndex: 1 }, children: /* @__PURE__ */ jsx6(ListingAffordance, { affordance: mediaAffordance }) }) : null;
1100
+ const hasMediaOverlayContent = Boolean(mediaOverlay || mediaAffordance || pickBadge);
1101
+ const mediaBlock = isRowTile ? /* @__PURE__ */ jsxs5(
1102
+ Box2,
1103
+ {
1104
+ "data-gds-listing-row-tile": true,
1105
+ style: {
1106
+ position: "relative",
1107
+ flex: `0 0 ${GDS_LISTING_TILE_SIZE_PX}px`,
1108
+ width: GDS_LISTING_TILE_SIZE_PX,
1109
+ height: GDS_LISTING_TILE_SIZE_PX,
1110
+ overflow: "hidden",
1111
+ borderRadius: "var(--gds-radius-thumbnail)"
1112
+ },
1113
+ children: [
1114
+ mediaContent,
1115
+ topLeftOverlay,
1116
+ affordanceOverlay
1117
+ ]
1118
+ }
1119
+ ) : hasMediaOverlayContent ? (
1120
+ // Positioned wrapper only when something is actually overlaid, so a card without
1121
+ // overlays keeps its previous DOM exactly (issue 679).
1122
+ /* @__PURE__ */ jsxs5(Box2, { style: { position: "relative" }, children: [
1123
+ mediaContent,
1124
+ topLeftOverlay,
1125
+ affordanceOverlay
1126
+ ] })
1127
+ ) : mediaContent;
1128
+ const contentItems = /* @__PURE__ */ jsxs5(Fragment3, { children: [
1129
+ featured || sponsoredDisclosure ? /* @__PURE__ */ jsxs5(Group3, { justify: "space-between", gap: "sm", wrap: "wrap", children: [
1130
+ featured ? /* @__PURE__ */ jsx6(
1131
+ Badge2,
1132
+ {
1133
+ variant: "light",
1134
+ style: {
1135
+ color: "var(--gds-brand-accent-tint-fg, var(--gds-brand-accent-action, var(--gds-vibe-accent, var(--mantine-primary-color-filled))))",
1136
+ backgroundColor: "var(--gds-brand-accent-tint, var(--mantine-color-default-hover))"
1137
+ },
1138
+ children: featuredLabel
1139
+ }
1140
+ ) : /* @__PURE__ */ jsx6("span", {}),
1141
+ sponsoredDisclosure ? /* @__PURE__ */ jsx6(Text2, { size: "xs", c: "dimmed", children: sponsoredDisclosure }) : null
1142
+ ] }) : null,
1143
+ /* @__PURE__ */ jsxs5(Stack3, { gap: 4, children: [
1144
+ /* @__PURE__ */ jsx6(Title2, { order: contract.titleOrder, lineClamp: 2, children: titleContent }),
1145
+ description ? /* @__PURE__ */ jsx6(Text2, { size: "sm", c: "dimmed", lineClamp: contract.descriptionClamp, children: description }) : null
1146
+ ] }),
1147
+ metadata.length ? /* @__PURE__ */ jsx6(Stack3, { gap: "xs", children: metadata.map((item) => /* @__PURE__ */ jsxs5(Group3, { justify: "space-between", align: "flex-start", gap: "sm", wrap: "nowrap", children: [
1148
+ /* @__PURE__ */ jsxs5(Group3, { gap: "xs", wrap: "nowrap", style: { minWidth: 0, flex: 1 }, children: [
1149
+ item.icon,
1150
+ /* @__PURE__ */ jsx6(Text2, { size: "sm", c: item.tone ? toneColorMap[item.tone] : "dimmed", lineClamp: 1, children: item.label })
1151
+ ] }),
1152
+ item.value ? /* @__PURE__ */ jsx6(Text2, { size: "sm", fw: 500, ta: "right", children: item.value }) : null
1153
+ ] }, item.id)) }) : null,
1154
+ reason ? /* @__PURE__ */ jsxs5(Stack3, { gap: 4, role: "group", "aria-label": reasonLabel, children: [
1155
+ /* @__PURE__ */ jsx6(Text2, { size: "xs", fw: 700, tt: "uppercase", c: "dimmed", children: reasonLabel }),
1156
+ reason
1157
+ ] }) : null,
1158
+ /* @__PURE__ */ jsxs5(Group3, { justify: "space-between", align: "center", gap: "sm", wrap: "wrap", children: [
1159
+ /* @__PURE__ */ jsxs5(Stack3, { gap: 2, style: { minWidth: 0, flex: 1 }, children: [
1160
+ price ? /* @__PURE__ */ jsx6(
1161
+ Text2,
1162
+ {
1163
+ fw: 700,
1164
+ size: contract.size === "xs" || contract.size === "sm" ? "md" : "lg",
1165
+ style: { color: "var(--gds-price, var(--gds-brand-accent-action, var(--gds-vibe-accent, var(--mantine-primary-color-filled))))" },
1166
+ children: price
1167
+ }
1168
+ ) : null,
1169
+ rating ? /* @__PURE__ */ jsxs5(Group3, { gap: 4, wrap: "nowrap", "aria-label": ratingLabel, children: [
1170
+ /* @__PURE__ */ jsx6(
1171
+ GdsIcons.Star,
1172
+ {
1173
+ size: "1rem",
1174
+ stroke: 1.75,
1175
+ fill: "currentColor",
1176
+ style: { color: "var(--gds-star, var(--gds-brand-accent-action, var(--gds-vibe-accent, var(--mantine-primary-color-filled))))" }
1177
+ }
1178
+ ),
1179
+ /* @__PURE__ */ jsx6(Text2, { size: "sm", fw: 600, style: { color: "var(--gds-star, var(--gds-brand-accent-action, var(--gds-vibe-accent, var(--mantine-primary-color-filled))))" }, children: rating })
1180
+ ] }) : null
1181
+ ] }),
1182
+ score ? /* @__PURE__ */ jsx6(Group3, { gap: "xs", wrap: "nowrap", children: score }) : null,
1183
+ /* @__PURE__ */ jsxs5(Group3, { gap: "xs", wrap: "nowrap", justify: "flex-end", style: { marginInlineStart: "auto" }, children: [
1184
+ resolvedSaveAction ? /* @__PURE__ */ jsx6(ListingAffordance, { affordance: resolvedSaveAction }) : null,
1185
+ shareAction ? /* @__PURE__ */ jsx6(ListingAffordance, { affordance: shareAction }) : null,
1186
+ resolvedActions ? null : primaryAction,
1187
+ isFlipMode ? /* @__PURE__ */ jsx6(Text2, { size: "xs", c: "dimmed", children: "Press Enter or Space to reveal details." }) : null
1188
+ ] })
1189
+ ] }),
1190
+ resolvedActions ? /* @__PURE__ */ jsx6(Group3, { gap: "sm", wrap: "wrap", role: "group", "aria-label": "Listing actions", children: resolvedActions.map((action, index) => (
1191
+ // eslint-disable-next-line react/no-array-index-key
1192
+ /* @__PURE__ */ jsx6("span", { children: action }, index)
1193
+ )) }) : null
1194
+ ] });
1195
+ return /* @__PURE__ */ jsx6(
1196
+ Card,
1197
+ {
1198
+ withBorder: true,
1199
+ radius: "lg",
1200
+ padding: cardPadding,
1201
+ ...contract.dataAttributes,
1202
+ "data-gds-listing-card": true,
1203
+ "data-gds-card-interactive-mode": interactiveMode,
1204
+ "data-gds-card-flipped": isFlipMode ? String(flipped) : void 0,
1205
+ "data-gds-listing-featured": featured ? "true" : void 0,
1206
+ "data-gds-listing-selected": selected ? "true" : void 0,
1207
+ style: {
1208
+ background: "var(--gds-bg-card, var(--gds-vibe-surface, var(--mantine-color-body)))",
1209
+ borderColor: "var(--gds-border-card, var(--gds-vibe-border, var(--mantine-color-default-border)))",
1210
+ ...isInteractive ? { cursor: "pointer", transition: "transform var(--gds-motion-duration-fast) var(--gds-motion-ease-standard), box-shadow var(--gds-motion-duration-fast) var(--gds-motion-ease-standard)" } : {},
1211
+ // Emphasis is a ring, never a lift: no transform is set here, in any state.
1212
+ ...emphasized ? {
1213
+ borderColor: "var(--gds-listing-featured-border, var(--gds-brand-accent-action, var(--gds-vibe-accent, var(--mantine-primary-color-filled))))",
1214
+ boxShadow: "var(--gds-ring-featured, 0 0 0 3px color-mix(in srgb, var(--gds-vibe-accent) 14%, transparent)), var(--gds-elevation-panel)"
1215
+ } : {}
1216
+ },
1217
+ ...interactiveProps,
1218
+ children: /* @__PURE__ */ jsx6(Stack3, { gap: contract.gap, children: isFlipMode && flipped ? revealContent : isRowTile ? /* @__PURE__ */ jsxs5(Group3, { gap: contract.gap, wrap: "nowrap", align: "flex-start", "data-gds-listing-row": true, children: [
1219
+ mediaBlock,
1220
+ /* @__PURE__ */ jsx6(Stack3, { gap: contract.gap, style: { minWidth: 0, flex: 1 }, children: contentItems })
1221
+ ] }) : /* @__PURE__ */ jsxs5(Fragment3, { children: [
1222
+ mediaBlock,
1223
+ contentItems
1224
+ ] }) })
1225
+ }
1226
+ );
1227
+ }
1228
+
1229
+ // src/OwnedContrastSurface.tsx
1230
+ function createGdsOwnedContrastTokens(vibe, options) {
1231
+ const text = options.text ?? vibe.textLight;
1232
+ const muted = options.muted ?? vibe.mutedLight;
1233
+ const surface = options.surface ?? vibe.surfaceLight;
1234
+ const border = options.border ?? vibe.borderLight;
1235
+ return {
1236
+ text,
1237
+ muted,
1238
+ background: options.background,
1239
+ radius: options.radius,
1240
+ primary: vibe.primary,
1241
+ accent: vibe.accent,
1242
+ surface,
1243
+ border,
1244
+ link: options.link ?? `color-mix(in srgb, ${vibe.primary} 64%, ${text})`,
1245
+ control: options.control ?? `color-mix(in srgb, ${surface} 88%, ${vibe.primary} 8%)`,
1246
+ controlText: options.controlText ?? text,
1247
+ backgroundColor: options.backgroundColor ?? surface,
1248
+ borderColor: options.borderColor ?? border,
1249
+ boxShadow: options.boxShadow
1250
+ };
1251
+ }
1252
+ function getGdsOwnedContrastProps({ role, tokens }) {
1253
+ const style = {
1254
+ "--mantine-color-text": tokens.text,
1255
+ "--mantine-color-dimmed": tokens.muted,
1256
+ "--gds-local-background": tokens.background,
1257
+ "--gds-local-radius": tokens.radius,
1258
+ "--gds-vibe-primary": tokens.primary,
1259
+ "--gds-vibe-accent": tokens.accent,
1260
+ "--gds-vibe-surface": tokens.surface,
1261
+ "--gds-vibe-border": tokens.border,
1262
+ "--gds-vibe-text": tokens.text,
1263
+ "--gds-vibe-muted": tokens.muted,
1264
+ "--gds-vibe-link": tokens.link,
1265
+ "--gds-vibe-control": tokens.control,
1266
+ "--gds-vibe-control-text": tokens.controlText,
1267
+ color: tokens.text,
1268
+ backgroundColor: tokens.backgroundColor,
1269
+ backgroundImage: "var(--gds-local-background)",
1270
+ borderColor: tokens.borderColor,
1271
+ boxShadow: tokens.boxShadow
1272
+ };
1273
+ return {
1274
+ "data-gds-owned-contrast": role,
1275
+ "data-gds-local-contrast": role,
1276
+ style
1277
+ };
1278
+ }
1279
+
1280
+ // src/FormField.tsx
1281
+ import { Box as Box3, Stack as Stack4, Text as Text3 } from "@mantine/core";
1282
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
1283
+ function FormField({ label, description, error, children }) {
1284
+ return /* @__PURE__ */ jsx7(Box3, { component: "label", children: /* @__PURE__ */ jsxs6(Stack4, { gap: 4, children: [
1285
+ typeof label === "string" ? /* @__PURE__ */ jsx7(Text3, { size: "xs", fw: 600, c: "dimmed", children: label }) : label,
1286
+ description ? typeof description === "string" ? /* @__PURE__ */ jsx7(Text3, { size: "xs", c: "dimmed", children: description }) : description : null,
1287
+ children,
1288
+ error ? typeof error === "string" ? /* @__PURE__ */ jsx7(Text3, { size: "xs", c: "red.7", children: error }) : error : null
1289
+ ] }) });
1290
+ }
1291
+
1292
+ // src/SimpleDataTable.tsx
1293
+ import { useGdsTranslation as useGdsTranslation4 } from "@sovereignsquad/gds-theme";
1294
+ import { ScrollArea, Table } from "@mantine/core";
1295
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
1296
+ function SimpleDataTable({
1297
+ columns,
1298
+ rows,
1299
+ loading = false,
1300
+ error = null,
1301
+ emptyTitle: emptyTitleProp,
1302
+ emptyDescription: emptyDescriptionProp,
1303
+ getRowKey
1304
+ }) {
1305
+ const { t } = useGdsTranslation4();
1306
+ const emptyTitle = emptyTitleProp ?? t("gds.simpleDataTable.emptyTitle", "No data available");
1307
+ const emptyDescription = emptyDescriptionProp ?? t("gds.simpleDataTable.emptyDescription", "There is no live data to show yet.");
1308
+ if (error) {
1309
+ return /* @__PURE__ */ jsx8(StateBlock, { variant: "error", title: "Unable to load data", description: error, compact: true });
1310
+ }
1311
+ if (loading) {
1312
+ return /* @__PURE__ */ jsx8(StateBlock, { variant: "loading", title: "Loading data", description: "Please wait while the shared dataset is prepared.", compact: true });
1313
+ }
1314
+ if (!rows.length) {
1315
+ return /* @__PURE__ */ jsx8(StateBlock, { variant: "empty", title: emptyTitle, description: emptyDescription, compact: true });
1316
+ }
1317
+ return /* @__PURE__ */ jsx8(ScrollArea, { children: /* @__PURE__ */ jsxs7(Table, { striped: true, highlightOnHover: true, withTableBorder: true, withColumnBorders: true, children: [
1318
+ /* @__PURE__ */ jsx8(Table.Thead, { children: /* @__PURE__ */ jsx8(Table.Tr, { children: columns.map((column) => /* @__PURE__ */ jsx8(Table.Th, { children: column.header }, String(column.key))) }) }),
1319
+ /* @__PURE__ */ jsx8(Table.Tbody, { children: rows.map((row, index) => /* @__PURE__ */ jsx8(Table.Tr, { children: columns.map((column) => /* @__PURE__ */ jsx8(Table.Td, { children: column.render ? column.render(row) : String(row[column.key] ?? "") }, String(column.key))) }, getRowKey ? getRowKey(row, index) : index)) })
1320
+ ] }) });
1321
+ }
1322
+
1323
+ // src/ChartTokenPanel.tsx
1324
+ import { Badge as Badge3, Group as Group4, Paper as Paper2, Stack as Stack5, Text as Text4, Title as Title3 } from "@mantine/core";
1325
+ import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
1326
+ function ChartTokenPanel({
1327
+ title,
1328
+ description,
1329
+ summary,
1330
+ state = "ready",
1331
+ legend = [],
1332
+ children,
1333
+ tableFallback,
1334
+ retryAction
1335
+ }) {
1336
+ if (state === "loading") {
1337
+ return /* @__PURE__ */ jsx9(StateBlock, { variant: "loading", title: "Loading chart", description: summary, compact: true, action: retryAction });
1338
+ }
1339
+ if (state === "empty") {
1340
+ return /* @__PURE__ */ jsx9(StateBlock, { variant: "empty", title: "No chart data", description: summary, compact: true, action: retryAction });
1341
+ }
1342
+ if (state === "below-threshold") {
1343
+ return /* @__PURE__ */ jsx9(StateBlock, { variant: "not-enough-data", title: "Not enough data for chart", description: summary, compact: true, action: retryAction });
1344
+ }
1345
+ if (state === "error") {
1346
+ return /* @__PURE__ */ jsx9(StateBlock, { variant: "error", title: "Unable to load chart", description: summary, compact: true, action: retryAction });
1347
+ }
1348
+ return /* @__PURE__ */ jsx9(Paper2, { withBorder: true, radius: "xl", p: "lg", children: /* @__PURE__ */ jsxs8(Stack5, { gap: "md", children: [
1349
+ /* @__PURE__ */ jsxs8(Group4, { justify: "space-between", align: "flex-start", gap: "sm", children: [
1350
+ /* @__PURE__ */ jsxs8(Stack5, { gap: 4, children: [
1351
+ /* @__PURE__ */ jsx9(Title3, { order: 4, children: title }),
1352
+ description ? /* @__PURE__ */ jsx9(Text4, { size: "sm", c: "dimmed", children: description }) : null
1353
+ ] }),
1354
+ state !== "ready" ? /* @__PURE__ */ jsx9(Badge3, { variant: "light", color: state === "permission-limited" ? "grape" : "yellow", children: state.replace("-", " ") }) : null
1355
+ ] }),
1356
+ /* @__PURE__ */ jsx9(Text4, { size: "sm", children: summary }),
1357
+ legend.length ? /* @__PURE__ */ jsx9(Group4, { gap: "xs", wrap: "wrap", "aria-label": "Chart legend", children: legend.map((item, index) => /* @__PURE__ */ jsxs8(Badge3, { variant: "outline", color: "gray", title: typeof item.description === "string" ? item.description : void 0, children: [
1358
+ item.label,
1359
+ ": ",
1360
+ item.token
1361
+ ] }, `${String(item.label)}-${index}`)) }) : null,
1362
+ children,
1363
+ tableFallback ? /* @__PURE__ */ jsxs8(Stack5, { gap: "xs", children: [
1364
+ /* @__PURE__ */ jsx9(Text4, { size: "sm", fw: 600, children: "Accessible data fallback" }),
1365
+ tableFallback
1366
+ ] }) : null
1367
+ ] }) });
1368
+ }
1369
+
1370
+ // src/GdsChart.tsx
1371
+ import { useId as useId2 } from "react";
1372
+ import { Badge as Badge4, Group as Group5, Paper as Paper3, Stack as Stack6, Text as Text5 } from "@mantine/core";
1373
+ import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
1374
+ var gdsChartTypeRegistry = {
1375
+ line: { type: "line", label: "Line", family: "cartesian", minDataPoints: 2, maxDataPoints: 500, summaryHint: "Trend over an ordered series." },
1376
+ area: { type: "area", label: "Area", family: "cartesian", minDataPoints: 2, maxDataPoints: 500, summaryHint: "Filled trend over an ordered series." },
1377
+ bar: { type: "bar", label: "Bar", family: "cartesian", minDataPoints: 1, maxDataPoints: 200, summaryHint: "Category comparison." },
1378
+ "stacked-bar": { type: "stacked-bar", label: "Stacked bar", family: "cartesian", minDataPoints: 2, maxDataPoints: 300, requiresGroup: true, summaryHint: "Grouped category contribution." },
1379
+ pie: { type: "pie", label: "Pie", family: "part-to-whole", minDataPoints: 2, maxDataPoints: 12, summaryHint: "Part-to-whole split." },
1380
+ donut: { type: "donut", label: "Donut", family: "part-to-whole", minDataPoints: 2, maxDataPoints: 12, summaryHint: "Part-to-whole split with center context." },
1381
+ radar: { type: "radar", label: "Radar", family: "radial", minDataPoints: 3, maxDataPoints: 24, summaryHint: "Multi-dimension profile." },
1382
+ scatter: { type: "scatter", label: "Scatter", family: "cartesian", minDataPoints: 2, maxDataPoints: 500, supportsSecondaryValue: true, summaryHint: "Correlation or distribution map." },
1383
+ bubble: { type: "bubble", label: "Bubble", family: "cartesian", minDataPoints: 2, maxDataPoints: 300, supportsSecondaryValue: true, summaryHint: "Weighted distribution map." },
1384
+ heatmap: { type: "heatmap", label: "Heatmap", family: "matrix", minDataPoints: 2, maxDataPoints: 400, summaryHint: "Intensity matrix." },
1385
+ funnel: { type: "funnel", label: "Funnel", family: "process", minDataPoints: 2, maxDataPoints: 12, summaryHint: "Stage conversion progression." },
1386
+ treemap: { type: "treemap", label: "Treemap", family: "hierarchy", minDataPoints: 2, maxDataPoints: 200, summaryHint: "Hierarchical distribution." },
1387
+ candlestick: { type: "candlestick", label: "Candlestick", family: "cartesian", minDataPoints: 1, maxDataPoints: 500, summaryHint: "Open-high-low-close price movement over time." },
1388
+ sankey: { type: "sankey", label: "Sankey", family: "process", minDataPoints: 1, maxDataPoints: 200, requiresGroup: false, summaryHint: "Flow volume between source and target stages." }
1389
+ };
1390
+ var gdsDefaultChartLegend = [
1391
+ { label: "Primary series", token: "brand.primary", description: "Primary measured value" },
1392
+ { label: "Secondary series", token: "support", description: "Grouped or comparative value" }
1393
+ ];
1394
+ var gdsChartSetATypeRegistry = {
1395
+ line: gdsChartTypeRegistry.line,
1396
+ area: gdsChartTypeRegistry.area,
1397
+ bar: gdsChartTypeRegistry.bar,
1398
+ "stacked-bar": gdsChartTypeRegistry["stacked-bar"],
1399
+ pie: gdsChartTypeRegistry.pie,
1400
+ donut: gdsChartTypeRegistry.donut,
1401
+ radar: gdsChartTypeRegistry.radar,
1402
+ scatter: gdsChartTypeRegistry.scatter
1403
+ };
1404
+ var gdsChartSetBTypeRegistry = {
1405
+ bubble: gdsChartTypeRegistry.bubble,
1406
+ heatmap: gdsChartTypeRegistry.heatmap,
1407
+ funnel: gdsChartTypeRegistry.funnel,
1408
+ treemap: gdsChartTypeRegistry.treemap
1409
+ };
1410
+ var gdsChartSetCTypeRegistry = {
1411
+ candlestick: gdsChartTypeRegistry.candlestick,
1412
+ sankey: gdsChartTypeRegistry.sankey
1413
+ };
1414
+ function isGdsChartSetAType(type) {
1415
+ return type in gdsChartSetATypeRegistry;
1416
+ }
1417
+ function isGdsChartSetBType(type) {
1418
+ return type in gdsChartSetBTypeRegistry;
1419
+ }
1420
+ function isGdsChartSetCType(type) {
1421
+ return type in gdsChartSetCTypeRegistry;
1422
+ }
1423
+ function isFiniteNumber(value) {
1424
+ return typeof value === "number" && Number.isFinite(value);
1425
+ }
1426
+ function decimateGdsChartData(data, maxDataPoints) {
1427
+ if (data.length <= maxDataPoints) {
1428
+ return data;
1429
+ }
1430
+ if (maxDataPoints <= 1) {
1431
+ return data.slice(0, 1);
1432
+ }
1433
+ const lastIndex = data.length - 1;
1434
+ const selectedIndexes = /* @__PURE__ */ new Set();
1435
+ for (let index = 0; index < maxDataPoints; index += 1) {
1436
+ selectedIndexes.add(Math.round(index * lastIndex / (maxDataPoints - 1)));
1437
+ }
1438
+ return Array.from(selectedIndexes).sort((a, b) => a - b).map((index) => data[index]);
1439
+ }
1440
+ function getSetARendererLabel(type) {
1441
+ const labels = {
1442
+ line: "ordered trend path",
1443
+ area: "filled trend surface",
1444
+ bar: "category bars",
1445
+ "stacked-bar": "grouped category stacks",
1446
+ pie: "part-to-whole slices",
1447
+ donut: "part-to-whole ring",
1448
+ radar: "radial dimension profile",
1449
+ scatter: "x/y point field"
1450
+ };
1451
+ return labels[type] ?? "vendor-neutral chart surface";
1452
+ }
1453
+ function getSetBRendererLabel(type) {
1454
+ const labels = {
1455
+ bubble: "weighted x/y bubble field",
1456
+ heatmap: "row/column intensity matrix",
1457
+ funnel: "stage conversion progression",
1458
+ treemap: "hierarchical area distribution"
1459
+ };
1460
+ return labels[type] ?? "advanced chart surface";
1461
+ }
1462
+ function getSetCRendererLabel(type) {
1463
+ const labels = {
1464
+ candlestick: "open-high-low-close price series",
1465
+ sankey: "source-to-target flow diagram"
1466
+ };
1467
+ return labels[type] ?? "specialized chart surface";
1468
+ }
1469
+ function validateGdsChartData(type, data, config = {}) {
1470
+ const definition = gdsChartTypeRegistry[type];
1471
+ const minDataPoints = config.minDataPoints ?? definition.minDataPoints;
1472
+ const maxDataPoints = config.maxDataPoints ?? definition.maxDataPoints;
1473
+ const issues = [];
1474
+ let visibleData = data;
1475
+ let decimated = false;
1476
+ if (!data.length) {
1477
+ return { state: "empty", issues: ["Dataset is empty."], visibleData: [], definition };
1478
+ }
1479
+ if (data.length < minDataPoints) {
1480
+ return {
1481
+ state: "below-threshold",
1482
+ issues: [`${definition.label} charts require at least ${minDataPoints} data points.`],
1483
+ visibleData: data,
1484
+ definition
1485
+ };
1486
+ }
1487
+ if (data.length > maxDataPoints) {
1488
+ if (!config.decimateLargeSeries) {
1489
+ return {
1490
+ state: "error",
1491
+ issues: [`Dataset has ${data.length} points, above the ${maxDataPoints} point rendering budget.`],
1492
+ visibleData: data.slice(0, maxDataPoints),
1493
+ definition
1494
+ };
1495
+ }
1496
+ visibleData = decimateGdsChartData(data, maxDataPoints);
1497
+ decimated = true;
1498
+ issues.push(`Dataset has ${data.length} points and was decimated to ${visibleData.length} points for rendering.`);
1499
+ }
1500
+ visibleData.forEach((item, index) => {
1501
+ if (!item.label.trim()) {
1502
+ issues.push(`Point ${index + 1} is missing a visible label.`);
1503
+ }
1504
+ if (item.value === null && (type === "line" || type === "area") && "connectNulls" in config && config.connectNulls) {
1505
+ return;
1506
+ }
1507
+ if (type === "candlestick") {
1508
+ return;
1509
+ }
1510
+ if (!isFiniteNumber(item.value)) {
1511
+ issues.push(`Point ${index + 1} has an invalid numeric value.`);
1512
+ }
1513
+ });
1514
+ if (definition.requiresGroup && visibleData.some((item) => !item.group)) {
1515
+ issues.push(`${definition.label} charts require a group value for every data point.`);
1516
+ }
1517
+ if (type === "pie" || type === "donut") {
1518
+ const numericValues = visibleData.map((item) => item.value).filter(isFiniteNumber);
1519
+ const total = numericValues.reduce((sum, value) => sum + value, 0);
1520
+ if (numericValues.some((value) => value < 0)) {
1521
+ issues.push(`${definition.label} charts cannot render negative slice values.`);
1522
+ }
1523
+ if (total <= 0) {
1524
+ issues.push(`${definition.label} charts require a positive total.`);
1525
+ }
1526
+ }
1527
+ if (type === "radar") {
1528
+ const numericValues = visibleData.map((item) => item.value).filter(isFiniteNumber);
1529
+ if (numericValues.some((value) => value < 0)) {
1530
+ issues.push("Radar charts cannot render negative axis values.");
1531
+ }
1532
+ }
1533
+ if (type === "scatter" && (!("requireSecondaryValue" in config) || config.requireSecondaryValue !== false)) {
1534
+ visibleData.forEach((item, index) => {
1535
+ if (!isFiniteNumber(item.secondaryValue)) {
1536
+ issues.push(`Scatter point ${index + 1} requires a numeric secondaryValue.`);
1537
+ }
1538
+ });
1539
+ }
1540
+ if (type === "bubble") {
1541
+ visibleData.forEach((item, index) => {
1542
+ if (!isFiniteNumber(item.secondaryValue)) {
1543
+ issues.push(`Bubble point ${index + 1} requires a numeric secondaryValue for bubble size.`);
1544
+ } else if (item.secondaryValue <= 0) {
1545
+ issues.push(`Bubble point ${index + 1} requires a positive secondaryValue for bubble size.`);
1546
+ }
1547
+ });
1548
+ }
1549
+ if (type === "heatmap") {
1550
+ visibleData.forEach((item, index) => {
1551
+ if (!item.group) {
1552
+ issues.push(`Heatmap cell ${index + 1} requires a group value for the matrix row.`);
1553
+ }
1554
+ });
1555
+ }
1556
+ if (type === "funnel") {
1557
+ const numericValues = visibleData.map((item) => item.value).filter(isFiniteNumber);
1558
+ if (numericValues.some((value) => value < 0)) {
1559
+ issues.push("Funnel charts cannot render negative stage values.");
1560
+ }
1561
+ const shouldEnforceDescending = !("enforceDescending" in config) || config.enforceDescending !== false;
1562
+ if (shouldEnforceDescending) {
1563
+ numericValues.forEach((value, index) => {
1564
+ const previousValue = numericValues[index - 1];
1565
+ if (index > 0 && value > previousValue) {
1566
+ issues.push(`Funnel stage ${index + 1} cannot be greater than the previous stage.`);
1567
+ }
1568
+ });
1569
+ }
1570
+ }
1571
+ if (type === "treemap") {
1572
+ visibleData.forEach((item, index) => {
1573
+ if (isFiniteNumber(item.value) && item.value <= 0) {
1574
+ issues.push(`Treemap node ${index + 1} requires a positive area value.`);
1575
+ }
1576
+ });
1577
+ }
1578
+ if (type === "candlestick") {
1579
+ visibleData.forEach((item, index) => {
1580
+ const { open, high, low, close } = item;
1581
+ if (![open, high, low, close].every(isFiniteNumber)) {
1582
+ issues.push(`Candlestick point ${index + 1} requires numeric open, high, low, and close values.`);
1583
+ return;
1584
+ }
1585
+ if (high < Math.max(open, close) || low > Math.min(open, close)) {
1586
+ issues.push(`Candlestick point ${index + 1} has a high/low range that doesn't contain its open/close values.`);
1587
+ }
1588
+ });
1589
+ }
1590
+ if (type === "sankey") {
1591
+ visibleData.forEach((item, index) => {
1592
+ if (!item.source || !item.target) {
1593
+ issues.push(`Sankey flow ${index + 1} requires both a source and a target node.`);
1594
+ }
1595
+ if (isFiniteNumber(item.value) && item.value < 0) {
1596
+ issues.push(`Sankey flow ${index + 1} cannot render a negative flow value.`);
1597
+ }
1598
+ });
1599
+ }
1600
+ return {
1601
+ state: issues.length ? decimated && issues.length === 1 ? "partial" : "error" : "ready",
1602
+ issues,
1603
+ visibleData,
1604
+ definition
1605
+ };
1606
+ }
1607
+ function DefaultChartRenderer({ type, title, summary, data, definition, labelledBy, describedBy }) {
1608
+ return /* @__PURE__ */ jsx10(Paper3, { withBorder: true, radius: "md", p: "md", role: "img", "aria-labelledby": labelledBy, "aria-describedby": describedBy, children: /* @__PURE__ */ jsxs9(Stack6, { gap: "sm", children: [
1609
+ /* @__PURE__ */ jsxs9(Group5, { justify: "space-between", children: [
1610
+ /* @__PURE__ */ jsx10(Text5, { id: labelledBy, fw: 700, children: title }),
1611
+ /* @__PURE__ */ jsx10(Badge4, { variant: "light", children: type })
1612
+ ] }),
1613
+ /* @__PURE__ */ jsx10(Text5, { id: describedBy, size: "sm", c: "dimmed", children: summary }),
1614
+ /* @__PURE__ */ jsxs9(Text5, { size: "xs", c: "dimmed", children: [
1615
+ "Type lane: ",
1616
+ type
1617
+ ] }),
1618
+ /* @__PURE__ */ jsxs9(Text5, { size: "xs", c: "dimmed", children: [
1619
+ "Registry family: ",
1620
+ definition.family
1621
+ ] }),
1622
+ isGdsChartSetAType(type) ? /* @__PURE__ */ jsxs9(Text5, { size: "xs", c: "dimmed", children: [
1623
+ "Set A primitive: ",
1624
+ getSetARendererLabel(type)
1625
+ ] }) : null,
1626
+ isGdsChartSetBType(type) ? /* @__PURE__ */ jsxs9(Text5, { size: "xs", c: "dimmed", children: [
1627
+ "Set B primitive: ",
1628
+ getSetBRendererLabel(type)
1629
+ ] }) : null,
1630
+ isGdsChartSetCType(type) ? /* @__PURE__ */ jsxs9(Text5, { size: "xs", c: "dimmed", children: [
1631
+ "Set C primitive: ",
1632
+ getSetCRendererLabel(type)
1633
+ ] }) : null,
1634
+ /* @__PURE__ */ jsxs9(Text5, { size: "xs", c: "dimmed", children: [
1635
+ "Data points: ",
1636
+ data.length
1637
+ ] })
1638
+ ] }) });
1639
+ }
1640
+ function GdsChart({
1641
+ type,
1642
+ title,
1643
+ summary,
1644
+ data,
1645
+ config = {},
1646
+ legend = gdsDefaultChartLegend,
1647
+ state,
1648
+ retryAction,
1649
+ renderer
1650
+ }) {
1651
+ const labelledBy = useId2();
1652
+ const describedBy = useId2();
1653
+ const validation = validateGdsChartData(type, data, config);
1654
+ const resolvedState = state ?? validation.state;
1655
+ const tableRows = validation.visibleData.map((item) => ({
1656
+ label: item.label,
1657
+ value: config.valueFormatter ? config.valueFormatter(item.value) : String(item.value ?? "missing"),
1658
+ secondaryValue: item.secondaryValue === void 0 || item.secondaryValue === null ? "-" : String(item.secondaryValue),
1659
+ group: item.group ?? "-"
1660
+ }));
1661
+ const Renderer = renderer ?? DefaultChartRenderer;
1662
+ return /* @__PURE__ */ jsx10(
1663
+ ChartTokenPanel,
1664
+ {
1665
+ title,
1666
+ description: `${validation.definition.label} chart. ${validation.definition.summaryHint}`,
1667
+ summary: validation.issues.length ? `${summary} ${validation.issues.join(" ")}` : summary,
1668
+ state: resolvedState,
1669
+ retryAction,
1670
+ legend,
1671
+ tableFallback: /* @__PURE__ */ jsx10(
1672
+ SimpleDataTable,
1673
+ {
1674
+ columns: [
1675
+ { key: "label", header: "Label" },
1676
+ { key: "value", header: config.tableValueHeader ?? "Value" },
1677
+ { key: "secondaryValue", header: "Secondary value" },
1678
+ { key: "group", header: config.groupLabel ?? "Group" }
1679
+ ],
1680
+ rows: tableRows
1681
+ }
1682
+ ),
1683
+ children: resolvedState === "ready" || resolvedState === "partial" || resolvedState === "permission-limited" ? /* @__PURE__ */ jsx10(
1684
+ Renderer,
1685
+ {
1686
+ type,
1687
+ title,
1688
+ summary,
1689
+ data: validation.visibleData,
1690
+ config,
1691
+ definition: validation.definition,
1692
+ labelledBy,
1693
+ describedBy
1694
+ }
1695
+ ) : null
1696
+ }
1697
+ );
1698
+ }
1699
+
1700
+ // src/locales/index.ts
1701
+ var gdsLocales = {
1702
+ en,
1703
+ es,
1704
+ hu,
1705
+ de,
1706
+ fr,
1707
+ it,
1708
+ ru,
1709
+ he,
1710
+ ar,
1711
+ zh,
1712
+ ja,
1713
+ ko
1714
+ };
1715
+ function getGdsMessages(locale) {
1716
+ return gdsLocales[locale] ?? en;
1717
+ }
1718
+
1719
+ export {
1720
+ GdsVocabulary,
1721
+ createGdsVocabularyPack,
1722
+ mergeGdsVocabularyPacks,
1723
+ resolveSemanticActionConfig,
1724
+ getSemanticActionConfig,
1725
+ getSemanticActionLabel,
1726
+ gdsBadgeAccentColors,
1727
+ gdsBadgeAccentShades,
1728
+ GdsBadge,
1729
+ SectionPanel,
1730
+ ReferenceSection,
1731
+ ActionBar,
1732
+ gdsSeededRandom,
1733
+ gdsGeneratedPaletteCssRefs,
1734
+ resolveGdsGeneratedPaletteHex,
1735
+ GdsGeneratedThumbnail,
1736
+ gdsCardSizePaddingMap,
1737
+ gdsCardDensityPaddingMap,
1738
+ gdsCardTitleOrderMap,
1739
+ gdsCardGapMap,
1740
+ gdsCardMediaRatioMap,
1741
+ resolveGdsCardContract,
1742
+ MAX_LISTING_CARD_ACTIONS,
1743
+ GDS_LISTING_TILE_SIZE_PX,
1744
+ GDS_LISTING_PICK_BADGE_INSET_PX,
1745
+ GDS_LISTING_PICK_BADGE_ICON_PX,
1746
+ GDS_LISTING_PICK_BADGE_FONT_SIZE_PX,
1747
+ GDS_LISTING_PICK_BADGE_LINE_HEIGHT_PX,
1748
+ GDS_LISTING_PICK_BADGE_PADDING_BLOCK_PX,
1749
+ GDS_LISTING_PICK_BADGE_PADDING_INLINE_PX,
1750
+ ListingCard,
1751
+ createGdsOwnedContrastTokens,
1752
+ getGdsOwnedContrastProps,
1753
+ FormField,
1754
+ SimpleDataTable,
1755
+ ChartTokenPanel,
1756
+ gdsChartTypeRegistry,
1757
+ gdsDefaultChartLegend,
1758
+ gdsChartSetATypeRegistry,
1759
+ gdsChartSetBTypeRegistry,
1760
+ gdsChartSetCTypeRegistry,
1761
+ isGdsChartSetAType,
1762
+ isGdsChartSetBType,
1763
+ isGdsChartSetCType,
1764
+ validateGdsChartData,
1765
+ GdsChart,
1766
+ gdsLocales,
1767
+ getGdsMessages
1768
+ };