@aceshooting/lyra-ui 9.1.1 → 11.0.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 (585) hide show
  1. package/CHANGELOG.md +785 -0
  2. package/custom-elements.json +1 -1
  3. package/design-tokens.json +13 -0
  4. package/dist/cli/migrate-wa.mjs +216 -1
  5. package/dist/cli/migration-contract.json +1 -1
  6. package/dist/components/agent-tools/activity-feed/activity-feed.class.js +1 -1
  7. package/dist/components/agent-tools/activity-feed/activity-feed.styles.js +0 -16
  8. package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.class.js +1 -1
  9. package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.styles.js +7 -5
  10. package/dist/components/agent-tools/agent-run/agent-run.class.js +2 -2
  11. package/dist/components/agent-tools/agent-run/agent-run.styles.js +0 -13
  12. package/dist/components/agent-tools/agent-trace/agent-trace.styles.js +7 -4
  13. package/dist/components/agent-tools/approval-queue/approval-queue.styles.js +7 -5
  14. package/dist/components/agent-tools/artifact-panel/artifact-panel.styles.js +0 -3
  15. package/dist/components/agent-tools/browser-frame/browser-frame.styles.js +3 -5
  16. package/dist/components/agent-tools/commit-card/commit-card.styles.js +0 -10
  17. package/dist/components/agent-tools/compare-panel/compare-panel.styles.js +11 -6
  18. package/dist/components/agent-tools/confirm-bar/confirm-bar.styles.js +0 -46
  19. package/dist/components/agent-tools/eval-dataset/eval-dataset.styles.js +0 -7
  20. package/dist/components/agent-tools/evaluation-run/evaluation-run.class.js +2 -2
  21. package/dist/components/agent-tools/prompt-studio/prompt-studio.styles.js +0 -15
  22. package/dist/components/agent-tools/result-card/result-card.styles.js +0 -7
  23. package/dist/components/agent-tools/result-card/result-field.styles.js +0 -5
  24. package/dist/components/agent-tools/schema-viewer/schema-viewer.styles.js +0 -3
  25. package/dist/components/agent-tools/span-waterfall/span-waterfall.styles.js +0 -15
  26. package/dist/components/agent-tools/stack-trace/stack-trace.styles.js +0 -20
  27. package/dist/components/agent-tools/subagent-panel/subagent-panel.class.js +2 -2
  28. package/dist/components/agent-tools/subagent-panel/subagent-panel.styles.js +0 -3
  29. package/dist/components/agent-tools/task-list/task-list.styles.js +0 -15
  30. package/dist/components/agent-tools/terminal/terminal.class.d.ts +11 -6
  31. package/dist/components/agent-tools/terminal/terminal.class.js +4 -4
  32. package/dist/components/agent-tools/terminal/terminal.styles.js +0 -46
  33. package/dist/components/agent-tools/test-results/test-results.class.js +2 -2
  34. package/dist/components/agent-tools/test-results/test-results.styles.js +0 -5
  35. package/dist/components/agent-tools/thinking-panel/thinking-panel.styles.js +0 -41
  36. package/dist/components/agent-tools/tool-approval-dialog/tool-approval-dialog.styles.js +0 -41
  37. package/dist/components/agent-tools/tool-call-chip/tool-call-chip.styles.js +0 -30
  38. package/dist/components/agent-tools/tool-param-form/tool-param-form.class.js +6 -6
  39. package/dist/components/agent-tools/tool-param-form/tool-param-form.styles.js +0 -5
  40. package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.styles.js +0 -20
  41. package/dist/components/agent-tools/tool-result-view/tool-result-view.styles.js +0 -4
  42. package/dist/components/agent-tools/tool-select-dialog/tool-select-dialog.styles.js +0 -21
  43. package/dist/components/agent-tools/trace-tree/trace-tree.styles.js +7 -31
  44. package/dist/components/charts/chart/box-plot.class.d.ts +27 -0
  45. package/dist/components/charts/chart/box-plot.class.js +14 -4
  46. package/dist/components/charts/chart/box-plot.styles.js +28 -20
  47. package/dist/components/charts/chart/chart-colors.d.ts +1 -1
  48. package/dist/components/charts/chart/chart-colors.js +1 -1
  49. package/dist/components/charts/chart/chart-core-loader.d.ts +1 -0
  50. package/dist/components/charts/chart/chart-core-loader.js +1 -1
  51. package/dist/components/charts/chart/chart-feature-loader.d.ts +35 -0
  52. package/dist/components/charts/chart/chart-feature-loader.js +1 -1
  53. package/dist/components/charts/chart/chart.class.d.ts +120 -0
  54. package/dist/components/charts/chart/chart.class.js +16 -6
  55. package/dist/components/charts/chart/chart.styles.js +28 -27
  56. package/dist/components/charts/chart/lite-chart.class.d.ts +20 -1
  57. package/dist/components/charts/chart/lite-chart.class.js +4 -4
  58. package/dist/components/charts/chart/lite-chart.styles.js +0 -27
  59. package/dist/components/conversation/agent-workspace/agent-workspace.class.d.ts +20 -0
  60. package/dist/components/conversation/agent-workspace/agent-workspace.class.js +3 -1
  61. package/dist/components/conversation/agent-workspace/agent-workspace.styles.js +3 -0
  62. package/dist/components/conversation/audio-visualizer/audio-visualizer.styles.js +0 -7
  63. package/dist/components/conversation/branch-picker/branch-picker.styles.js +0 -3
  64. package/dist/components/conversation/chat-composer/chat-composer.styles.js +0 -51
  65. package/dist/components/conversation/chat-message/chat-message.styles.js +7 -35
  66. package/dist/components/conversation/chat-viewport/chat-viewport.class.js +1 -1
  67. package/dist/components/conversation/chat-viewport/chat-viewport.styles.js +0 -33
  68. package/dist/components/conversation/checkpoint/checkpoint.class.js +1 -1
  69. package/dist/components/conversation/checkpoint/checkpoint.styles.js +0 -3
  70. package/dist/components/conversation/code-block/code-block-shared.d.ts +5 -2
  71. package/dist/components/conversation/code-block/code-block.class.js +1 -1
  72. package/dist/components/conversation/code-block/code-block.styles.js +4 -95
  73. package/dist/components/conversation/code-block/code-loader.d.ts +11 -0
  74. package/dist/components/conversation/code-block/code-loader.js +1 -1
  75. package/dist/components/conversation/code-block/shiki-types.d.ts +12 -0
  76. package/dist/components/conversation/code-block/shiki-types.js +1 -1
  77. package/dist/components/conversation/conversation-item/conversation-item.styles.js +8 -54
  78. package/dist/components/conversation/generation-metrics/generation-metrics.class.js +2 -2
  79. package/dist/components/conversation/generation-metrics/generation-metrics.styles.js +0 -17
  80. package/dist/components/conversation/markdown/markdown-base.class.js +1 -1
  81. package/dist/components/conversation/markdown/markdown.styles.js +0 -41
  82. package/dist/components/conversation/message-actions/message-actions.styles.js +0 -3
  83. package/dist/components/conversation/message-feedback/message-feedback.styles.js +0 -35
  84. package/dist/components/conversation/message-parts/message-parts.class.d.ts +1 -1
  85. package/dist/components/conversation/message-parts/message-parts.styles.js +0 -5
  86. package/dist/components/conversation/model-select/model-select.class.js +3 -3
  87. package/dist/components/conversation/model-select/model-select.styles.js +12 -47
  88. package/dist/components/conversation/model-settings-panel/model-settings-panel.styles.js +0 -6
  89. package/dist/components/conversation/prompt-input/prompt-input.class.d.ts +3 -0
  90. package/dist/components/conversation/prompt-input/prompt-input.styles.js +0 -10
  91. package/dist/components/conversation/push-to-talk/push-to-talk.styles.js +0 -8
  92. package/dist/components/conversation/selection-toolbar/selection-toolbar.styles.js +1 -11
  93. package/dist/components/conversation/stream-status/stream-status.styles.js +0 -16
  94. package/dist/components/conversation/streaming-text/streaming-text.styles.js +0 -15
  95. package/dist/components/conversation/suggestion-chips/suggestion-chips.styles.js +0 -5
  96. package/dist/components/conversation/thread-list/thread-list.styles.js +0 -23
  97. package/dist/components/conversation/transcript-feed/transcript-feed.class.d.ts +16 -4
  98. package/dist/components/conversation/transcript-feed/transcript-feed.class.js +1 -1
  99. package/dist/components/conversation/transcript-feed/transcript-feed.styles.js +0 -1
  100. package/dist/components/conversation/typing-indicator/typing-indicator.styles.js +0 -23
  101. package/dist/components/conversation/usage-badge/usage-badge.styles.js +0 -3
  102. package/dist/components/conversation/voice-picker/voice-picker.class.js +3 -3
  103. package/dist/components/conversation/voice-picker/voice-picker.styles.js +9 -29
  104. package/dist/components/conversation/widget-renderer/resolve.d.ts +2 -0
  105. package/dist/components/conversation/widget-renderer/resolve.js +1 -1
  106. package/dist/components/data/calendar/calendar.class.d.ts +15 -2
  107. package/dist/components/data/calendar/calendar.class.js +2 -2
  108. package/dist/components/data/calendar/calendar.styles.js +2 -28
  109. package/dist/components/data/condition-builder/condition-builder.class.d.ts +10 -6
  110. package/dist/components/data/condition-builder/condition-builder.class.js +2 -2
  111. package/dist/components/data/condition-builder/condition-builder.styles.js +0 -6
  112. package/dist/components/data/context-meter/context-meter.styles.js +0 -24
  113. package/dist/components/data/data-grid/data-grid.class.js +3 -3
  114. package/dist/components/data/data-grid/data-grid.styles.js +0 -22
  115. package/dist/components/data/document-library/document-library.class.js +2 -2
  116. package/dist/components/data/document-library/document-library.styles.js +0 -4
  117. package/dist/components/data/env-list/env-list.class.js +1 -1
  118. package/dist/components/data/env-list/env-list.styles.js +7 -4
  119. package/dist/components/data/file-tree/file-tree.class.d.ts +12 -0
  120. package/dist/components/data/flow-canvas/flow-canvas.styles.js +12 -19
  121. package/dist/components/data/flow-controls/flow-controls.class.js +2 -2
  122. package/dist/components/data/flow-controls/flow-controls.styles.js +3 -36
  123. package/dist/components/data/flow-minimap/flow-minimap.class.js +1 -1
  124. package/dist/components/data/flow-minimap/flow-minimap.styles.js +0 -9
  125. package/dist/components/data/flow-node/flow-node.styles.js +0 -23
  126. package/dist/components/data/flow-run-status/flow-run-status.class.js +1 -1
  127. package/dist/components/data/flow-run-status/flow-run-status.styles.js +0 -7
  128. package/dist/components/data/graph-query-builder/graph-query-builder.class.d.ts +0 -7
  129. package/dist/components/data/graph-query-builder/graph-query-builder.class.js +1 -1
  130. package/dist/components/data/graph-query-builder/graph-query-builder.styles.js +0 -10
  131. package/dist/components/data/heatmap/heatmap-scale.d.ts +20 -0
  132. package/dist/components/data/heatmap/heatmap-scale.js +1 -1
  133. package/dist/components/data/heatmap/heatmap.class.d.ts +117 -1
  134. package/dist/components/data/heatmap/heatmap.class.js +2 -2
  135. package/dist/components/data/heatmap/heatmap.styles.js +0 -54
  136. package/dist/components/data/pagination/pagination.styles.js +23 -46
  137. package/dist/components/data/sequence-strip/sequence-strip.class.d.ts +34 -1
  138. package/dist/components/data/sequence-strip/sequence-strip.class.js +5 -2
  139. package/dist/components/data/sequence-strip/sequence-strip.styles.js +14 -20
  140. package/dist/components/data/sparkline/sparkline.class.js +1 -1
  141. package/dist/components/data/stat/stat.styles.js +0 -67
  142. package/dist/components/data/table/table.class.d.ts +42 -3
  143. package/dist/components/data/table/table.class.js +4 -4
  144. package/dist/components/data/table/table.styles.js +20 -91
  145. package/dist/components/data/timeline/timeline-item.styles.js +0 -30
  146. package/dist/components/data/timeline/timeline.class.d.ts +89 -1
  147. package/dist/components/data/timeline/timeline.class.js +2 -2
  148. package/dist/components/data/timeline/timeline.styles.js +111 -31
  149. package/dist/components/data/tree/tree-item.styles.js +1 -28
  150. package/dist/components/data/tree/tree.class.js +2 -2
  151. package/dist/components/data/tree/tree.styles.js +0 -6
  152. package/dist/components/data/word-cloud/word-cloud.styles.js +0 -5
  153. package/dist/components/forms/button/button.class.js +1 -1
  154. package/dist/components/forms/button/button.styles.js +0 -105
  155. package/dist/components/forms/checkbox/checkbox.class.d.ts +3 -0
  156. package/dist/components/forms/checkbox/checkbox.class.js +1 -1
  157. package/dist/components/forms/checkbox/checkbox.styles.js +0 -39
  158. package/dist/components/forms/checkbox-group/checkbox-group.class.d.ts +21 -2
  159. package/dist/components/forms/checkbox-group/checkbox-group.class.js +1 -1
  160. package/dist/components/forms/checkbox-group/checkbox-group.styles.js +0 -18
  161. package/dist/components/forms/code-editor/code-editor.styles.js +0 -30
  162. package/dist/components/forms/color-picker/color-picker.class.js +2 -2
  163. package/dist/components/forms/color-picker/color-picker.styles.js +0 -69
  164. package/dist/components/forms/combobox/combobox.class.d.ts +71 -3
  165. package/dist/components/forms/combobox/combobox.class.js +5 -3
  166. package/dist/components/forms/combobox/combobox.styles.js +31 -111
  167. package/dist/components/forms/combobox/option.styles.js +7 -1
  168. package/dist/components/forms/date-picker/date-input.class.js +1 -1
  169. package/dist/components/forms/date-picker/date-input.styles.js +12 -67
  170. package/dist/components/forms/date-picker/date-picker.class.d.ts +47 -0
  171. package/dist/components/forms/date-picker/date-picker.class.js +36 -22
  172. package/dist/components/forms/date-picker/date-picker.styles.js +82 -29
  173. package/dist/components/forms/emoji-picker/emoji-data-loader.d.ts +6 -3
  174. package/dist/components/forms/emoji-picker/emoji-data-loader.js +1 -1
  175. package/dist/components/forms/emoji-picker/emoji-picker.class.d.ts +8 -1
  176. package/dist/components/forms/emoji-picker/emoji-picker.class.js +1 -1
  177. package/dist/components/forms/emoji-picker/emoji-picker.styles.js +3 -41
  178. package/dist/components/forms/icon-button/icon-button.class.js +1 -1
  179. package/dist/components/forms/icon-button/icon-button.styles.js +0 -16
  180. package/dist/components/forms/input/input.styles.js +0 -54
  181. package/dist/components/forms/input/number-input.styles.d.ts +4 -5
  182. package/dist/components/forms/input/number-input.styles.js +0 -11
  183. package/dist/components/forms/input/time-input-shared.d.ts +11 -0
  184. package/dist/components/forms/input/time-input-shared.js +1 -1
  185. package/dist/components/forms/input/time-input.class.d.ts +11 -2
  186. package/dist/components/forms/input/time-input.class.js +1 -1
  187. package/dist/components/forms/input/time-input.styles.js +0 -6
  188. package/dist/components/forms/locale-picker/locale-picker.class.js +2 -2
  189. package/dist/components/forms/locale-picker/locale-picker.styles.js +1 -26
  190. package/dist/components/forms/otp-input/otp-input.class.js +3 -3
  191. package/dist/components/forms/otp-input/otp-input.styles.js +0 -16
  192. package/dist/components/forms/phone-input/phone-input.class.d.ts +9 -1
  193. package/dist/components/forms/phone-input/phone-input.class.js +2 -2
  194. package/dist/components/forms/phone-input/phone-input.styles.js +0 -37
  195. package/dist/components/forms/radio/radio-button.styles.js +1 -30
  196. package/dist/components/forms/radio/radio-group.styles.js +0 -4
  197. package/dist/components/forms/radio/radio.styles.js +0 -44
  198. package/dist/components/forms/rubric-form/rubric-form.styles.js +0 -5
  199. package/dist/components/forms/select/select.class.js +1 -1
  200. package/dist/components/forms/select/select.styles.js +14 -114
  201. package/dist/components/forms/slider/slider.styles.js +0 -55
  202. package/dist/components/forms/swatch-picker/swatch-picker.class.d.ts +0 -11
  203. package/dist/components/forms/swatch-picker/swatch-picker.class.js +2 -2
  204. package/dist/components/forms/swatch-picker/swatch-picker.styles.js +0 -77
  205. package/dist/components/forms/switch/switch.class.d.ts +3 -0
  206. package/dist/components/forms/switch/switch.class.js +1 -1
  207. package/dist/components/forms/switch/switch.styles.js +0 -37
  208. package/dist/components/forms/textarea/textarea.styles.js +0 -28
  209. package/dist/components/forms/time-range/time-range.styles.js +12 -84
  210. package/dist/components/forms/token-input/token-input.class.d.ts +23 -9
  211. package/dist/components/forms/token-input/token-input.class.js +1 -1
  212. package/dist/components/forms/token-input/token-input.styles.js +1 -54
  213. package/dist/components/layout/app-rail/app-rail-item.class.js +2 -2
  214. package/dist/components/layout/app-rail/app-rail-item.styles.js +0 -13
  215. package/dist/components/layout/app-rail/app-rail.class.d.ts +5 -0
  216. package/dist/components/layout/app-rail/app-rail.class.js +1 -1
  217. package/dist/components/layout/app-rail/app-rail.styles.js +0 -46
  218. package/dist/components/layout/button-group/button-group.styles.js +0 -6
  219. package/dist/components/layout/card/card.class.d.ts +12 -0
  220. package/dist/components/layout/card/card.styles.js +3 -11
  221. package/dist/components/layout/carousel/carousel.styles.js +0 -1
  222. package/dist/components/layout/command-palette/command-palette.class.d.ts +8 -0
  223. package/dist/components/layout/command-palette/command-palette.class.js +3 -1
  224. package/dist/components/layout/command-palette/command-palette.styles.js +1 -13
  225. package/dist/components/layout/control-group/control-group.styles.js +0 -7
  226. package/dist/components/layout/dashboard-grid/dashboard-grid.styles.js +6 -25
  227. package/dist/components/layout/details/accordion.class.d.ts +13 -0
  228. package/dist/components/layout/details/accordion.class.js +1 -1
  229. package/dist/components/layout/details/details.class.js +1 -1
  230. package/dist/components/layout/details/details.styles.js +0 -12
  231. package/dist/components/layout/dock-panel/dock-panel.styles.js +0 -45
  232. package/dist/components/layout/drilldown-panel/drilldown-panel.class.d.ts +2 -0
  233. package/dist/components/layout/drilldown-panel/drilldown-panel.class.js +2 -2
  234. package/dist/components/layout/drilldown-panel/drilldown-panel.styles.js +0 -4
  235. package/dist/components/layout/filter-bar/filter-bar.class.js +1 -1
  236. package/dist/components/layout/filter-bar/filter-bar.styles.js +0 -9
  237. package/dist/components/layout/menu/menu-item.class.d.ts +5 -0
  238. package/dist/components/layout/menu/menu-item.class.js +1 -1
  239. package/dist/components/layout/menu/menu-item.styles.js +0 -49
  240. package/dist/components/layout/menu/menu-label.styles.js +0 -2
  241. package/dist/components/layout/menu/menu.styles.js +0 -18
  242. package/dist/components/layout/multi-split/multi-split.styles.js +0 -63
  243. package/dist/components/layout/page/page.class.d.ts +4 -0
  244. package/dist/components/layout/page/page.class.js +1 -1
  245. package/dist/components/layout/reorder-list/reorder-item.styles.js +0 -4
  246. package/dist/components/layout/responsive-panel/responsive-panel.styles.js +0 -27
  247. package/dist/components/layout/scroller/scroller.styles.js +0 -20
  248. package/dist/components/layout/segmented/segmented.class.d.ts +7 -1
  249. package/dist/components/layout/segmented/segmented.class.js +1 -1
  250. package/dist/components/layout/segmented/segmented.styles.js +69 -37
  251. package/dist/components/layout/split-panel/split-panel.styles.js +1 -7
  252. package/dist/components/layout/stepper/stepper.class.d.ts +8 -1
  253. package/dist/components/layout/stepper/stepper.class.js +1 -1
  254. package/dist/components/layout/stepper/stepper.styles.js +140 -41
  255. package/dist/components/layout/tab-group/tab-group.class.d.ts +4 -1
  256. package/dist/components/layout/tab-group/tab-group.styles.js +9 -75
  257. package/dist/components/layout/tab-group/tab.styles.js +0 -2
  258. package/dist/components/layout/virtual-list/virtual-list.class.d.ts +4 -4
  259. package/dist/components/layout/virtual-list/virtual-list.class.js +1 -1
  260. package/dist/components/layout/virtual-list/virtual-list.styles.js +0 -68
  261. package/dist/components/layout/widget/widget.class.d.ts +5 -1
  262. package/dist/components/layout/widget/widget.class.js +1 -1
  263. package/dist/components/layout/widget/widget.styles.js +97 -40
  264. package/dist/components/media/animated-image/animated-image.class.d.ts +3 -0
  265. package/dist/components/media/animated-image/animated-image.class.js +1 -1
  266. package/dist/components/media/animated-image/animated-image.styles.js +0 -28
  267. package/dist/components/media/attachment-chip/attachment-chip.class.d.ts +1 -1
  268. package/dist/components/media/attachment-chip/attachment-chip.class.js +1 -1
  269. package/dist/components/media/attachment-chip/attachment-chip.styles.js +0 -31
  270. package/dist/components/media/attachment-trigger/attachment-trigger.class.js +3 -3
  271. package/dist/components/media/attachment-trigger/attachment-trigger.styles.js +0 -40
  272. package/dist/components/media/av-player/av-player.class.d.ts +5 -6
  273. package/dist/components/media/av-player/av-player.class.js +1 -1
  274. package/dist/components/media/av-player/av-player.styles.js +0 -45
  275. package/dist/components/media/avatar/avatar.styles.js +3 -16
  276. package/dist/components/media/file-icon/file-icon.class.d.ts +1 -2
  277. package/dist/components/media/file-icon/file-icon.class.js +1 -1
  278. package/dist/components/media/file-input/file-input.class.d.ts +12 -0
  279. package/dist/components/media/file-input/file-input.styles.js +3 -24
  280. package/dist/components/media/flag/flag.class.d.ts +23 -1
  281. package/dist/components/media/flag/flag.class.js +4 -2
  282. package/dist/components/media/flag/flag.styles.js +7 -1
  283. package/dist/components/media/flag/language-map.d.ts +10 -0
  284. package/dist/components/media/flag/language-map.js +1 -1
  285. package/dist/components/media/image-comparer/image-comparer.styles.js +4 -33
  286. package/dist/components/media/image-viewer/image-viewer.class.js +0 -2
  287. package/dist/components/media/image-viewer/image-viewer.styles.js +7 -27
  288. package/dist/components/media/lightbox/lightbox.class.js +0 -2
  289. package/dist/components/media/lightbox/lightbox.styles.js +0 -21
  290. package/dist/components/media/map/map-loader.d.ts +19 -1
  291. package/dist/components/media/map/map-loader.js +1 -1
  292. package/dist/components/media/map/map.class.d.ts +178 -1
  293. package/dist/components/media/map/map.class.js +15 -3
  294. package/dist/components/media/map/map.styles.js +20 -17
  295. package/dist/components/media/media-card/media-card.class.d.ts +14 -3
  296. package/dist/components/media/media-card/media-card.class.js +1 -1
  297. package/dist/components/media/media-card/media-card.styles.js +2 -28
  298. package/dist/components/media/pan-zoom/pan-zoom.styles.js +0 -3
  299. package/dist/components/media/qr-code/qr-code.class.d.ts +3 -2
  300. package/dist/components/media/qr-code/qr-code.class.js +2 -2
  301. package/dist/components/media/qr-code/qr-code.styles.js +0 -3
  302. package/dist/components/media/sequence-playback/sequence-playback.class.d.ts +2 -0
  303. package/dist/components/media/sequence-playback/sequence-playback.class.js +2 -1
  304. package/dist/components/media/sequence-playback/sequence-playback.styles.js +0 -19
  305. package/dist/components/media/video/video.class.d.ts +23 -2
  306. package/dist/components/media/video/video.class.js +3 -3
  307. package/dist/components/media/video/video.styles.js +4 -2
  308. package/dist/components/media/zoomable-frame/zoomable-frame.class.d.ts +3 -2
  309. package/dist/components/media/zoomable-frame/zoomable-frame.class.js +2 -2
  310. package/dist/components/media/zoomable-frame/zoomable-frame.styles.js +0 -5
  311. package/dist/components/overlays/alert/alert.styles.js +4 -2
  312. package/dist/components/overlays/badge/badge.styles.js +4 -48
  313. package/dist/components/overlays/badge/tag.styles.js +0 -14
  314. package/dist/components/overlays/callout/callout.styles.js +0 -11
  315. package/dist/components/overlays/chip/chip-group.styles.js +0 -18
  316. package/dist/components/overlays/chip/chip.styles.js +6 -69
  317. package/dist/components/overlays/dialog/confirm.d.ts +1 -4
  318. package/dist/components/overlays/dialog/confirm.js +1 -1
  319. package/dist/components/overlays/dialog/dialog.class.d.ts +32 -9
  320. package/dist/components/overlays/dialog/dialog.class.js +1 -1
  321. package/dist/components/overlays/dialog/dialog.styles.js +0 -43
  322. package/dist/components/overlays/drawer/drawer.class.d.ts +2 -2
  323. package/dist/components/overlays/drawer/drawer.styles.js +0 -9
  324. package/dist/components/overlays/empty/empty.styles.js +0 -12
  325. package/dist/components/overlays/kbd/kbd.styles.js +0 -8
  326. package/dist/components/overlays/overlay/dropdown.class.d.ts +1 -6
  327. package/dist/components/overlays/overlay/dropdown.class.js +2 -2
  328. package/dist/components/overlays/overlay/overlay.styles.js +0 -28
  329. package/dist/components/overlays/overlay/popover.class.d.ts +28 -4
  330. package/dist/components/overlays/overlay/popover.class.js +2 -2
  331. package/dist/components/overlays/overlay/tooltip.class.d.ts +10 -0
  332. package/dist/components/overlays/overlay/tooltip.class.js +1 -1
  333. package/dist/components/overlays/popup/popup.class.d.ts +1 -0
  334. package/dist/components/overlays/popup/popup.class.js +1 -1
  335. package/dist/components/overlays/popup/popup.styles.js +0 -15
  336. package/dist/components/overlays/progress/progress-ring.class.d.ts +9 -1
  337. package/dist/components/overlays/progress/progress-ring.class.js +3 -3
  338. package/dist/components/overlays/progress/progress.styles.js +0 -21
  339. package/dist/components/overlays/rating/rating.styles.js +0 -25
  340. package/dist/components/overlays/skeleton/skeleton.styles.js +0 -4
  341. package/dist/components/overlays/spinner/spinner.styles.js +0 -3
  342. package/dist/components/overlays/toast/toast-item.styles.js +3 -45
  343. package/dist/components/retrieval/chunk-inspector/chunk-inspector.styles.js +0 -35
  344. package/dist/components/retrieval/citation-badge/citation-badge.class.d.ts +2 -2
  345. package/dist/components/retrieval/citation-badge/citation-badge.class.js +3 -3
  346. package/dist/components/retrieval/citation-badge/citation-badge.styles.js +0 -20
  347. package/dist/components/retrieval/claim-evidence/claim-evidence.styles.js +0 -8
  348. package/dist/components/retrieval/community-card/community-card.class.d.ts +1 -0
  349. package/dist/components/retrieval/community-card/community-card.styles.js +0 -6
  350. package/dist/components/retrieval/embedding-explorer/embedding-explorer.styles.js +8 -12
  351. package/dist/components/retrieval/entity-card/entity-card.class.d.ts +4 -3
  352. package/dist/components/retrieval/entity-card/entity-card.class.js +1 -1
  353. package/dist/components/retrieval/entity-card/entity-card.styles.js +0 -12
  354. package/dist/components/retrieval/entity-chip/entity-chip.class.d.ts +10 -4
  355. package/dist/components/retrieval/entity-chip/entity-chip.class.js +3 -3
  356. package/dist/components/retrieval/entity-chip/entity-chip.styles.js +6 -9
  357. package/dist/components/retrieval/entity-dossier/entity-dossier.class.d.ts +19 -5
  358. package/dist/components/retrieval/graph/graph.class.d.ts +5 -0
  359. package/dist/components/retrieval/graph/graph.class.js +1 -1
  360. package/dist/components/retrieval/graph/graph.styles.js +0 -30
  361. package/dist/components/retrieval/graph-legend/graph-legend.styles.js +0 -3
  362. package/dist/components/retrieval/ingestion-queue/ingestion-queue.styles.js +0 -25
  363. package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.class.d.ts +2 -0
  364. package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.styles.js +0 -7
  365. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.d.ts +20 -6
  366. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.js +2 -2
  367. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.styles.js +0 -16
  368. package/dist/components/retrieval/mind-map/mind-map.class.d.ts +5 -3
  369. package/dist/components/retrieval/mind-map/mind-map.class.js +1 -1
  370. package/dist/components/retrieval/mind-map/mind-map.styles.js +0 -2
  371. package/dist/components/retrieval/neighbor-list/neighbor-list.class.d.ts +3 -2
  372. package/dist/components/retrieval/neighbor-list/neighbor-list.class.js +1 -1
  373. package/dist/components/retrieval/neighbor-list/neighbor-list.styles.js +0 -30
  374. package/dist/components/retrieval/node-palette/node-palette.styles.js +0 -11
  375. package/dist/components/retrieval/path-strip/path-strip.styles.js +0 -10
  376. package/dist/components/retrieval/provenance-panel/provenance-panel.class.d.ts +12 -3
  377. package/dist/components/retrieval/provenance-panel/provenance-panel.styles.js +0 -2
  378. package/dist/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.class.d.ts +3 -2
  379. package/dist/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.class.js +2 -2
  380. package/dist/components/retrieval/retrieval-results/retrieval-results.styles.js +0 -28
  381. package/dist/components/retrieval/retrieval-search/retrieval-search.styles.js +0 -4
  382. package/dist/components/retrieval/retrieval-trace/retrieval-trace.styles.js +0 -2
  383. package/dist/components/retrieval/source-card/source-card.styles.js +0 -13
  384. package/dist/components/retrieval/source-list/source-list.styles.js +0 -7
  385. package/dist/components/retrieval/source-picker/source-picker.styles.js +0 -7
  386. package/dist/components/utility/copy-button/copy-button.styles.js +0 -10
  387. package/dist/components/utility/diff-view/diff-view.styles.js +0 -14
  388. package/dist/components/utility/export-button/export-button.styles.js +0 -22
  389. package/dist/components/utility/icon/icon.styles.js +0 -6
  390. package/dist/components/utility/json-viewer/json-viewer.styles.js +2 -48
  391. package/dist/components/utility/known-date/known-date.class.d.ts +7 -3
  392. package/dist/components/utility/known-date/known-date.styles.js +10 -51
  393. package/dist/components/utility/live-region/live-region.styles.js +0 -4
  394. package/dist/components/utility/mention-popover/mention-popover.styles.js +0 -25
  395. package/dist/components/utility/poll-status/poll-status.styles.js +0 -4
  396. package/dist/components/utility/random-content/random-content.class.d.ts +22 -0
  397. package/dist/components/utility/random-content/random-content.class.js +3 -2
  398. package/dist/components/utility/random-content/random-content.styles.js +6 -13
  399. package/dist/components/utility/tour/tour.class.d.ts +4 -2
  400. package/dist/components/utility/tour/tour.class.js +3 -3
  401. package/dist/components/utility/tour/tour.styles.js +0 -13
  402. package/dist/components/utility/visually-hidden/visually-hidden.styles.js +0 -5
  403. package/dist/components/viewers/archive-viewer/archive-viewer.class.js +1 -1
  404. package/dist/components/viewers/archive-viewer/archive-viewer.styles.d.ts +2 -2
  405. package/dist/components/viewers/archive-viewer/archive-viewer.styles.js +0 -10
  406. package/dist/components/viewers/csv-viewer/csv-viewer.class.js +1 -1
  407. package/dist/components/viewers/csv-viewer/csv-viewer.styles.js +0 -19
  408. package/dist/components/viewers/dataset-viewer/dataset-viewer.class.js +1 -1
  409. package/dist/components/viewers/dataset-viewer/dataset-viewer.styles.js +0 -15
  410. package/dist/components/viewers/document-compare/document-compare.styles.js +0 -3
  411. package/dist/components/viewers/document-preview/document-preview.styles.js +0 -25
  412. package/dist/components/viewers/document-viewer/document-viewer.class.d.ts +2 -1
  413. package/dist/components/viewers/document-viewer/document-viewer.class.js +1 -1
  414. package/dist/components/viewers/document-viewer/document-viewer.styles.js +0 -5
  415. package/dist/components/viewers/docx-viewer/docx-viewer.styles.js +0 -17
  416. package/dist/components/viewers/ebook-viewer/ebook-viewer.styles.js +0 -4
  417. package/dist/components/viewers/email-viewer/email-viewer.styles.js +0 -7
  418. package/dist/components/viewers/geojson-view/geojson-view.styles.js +0 -5
  419. package/dist/components/viewers/highlight-layer/highlight-layer.styles.js +0 -3
  420. package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js +1 -1
  421. package/dist/components/viewers/notebook-viewer/notebook-viewer.styles.js +0 -38
  422. package/dist/components/viewers/page-rail/page-rail.class.js +1 -1
  423. package/dist/components/viewers/page-rail/page-rail.styles.js +0 -13
  424. package/dist/components/viewers/pdf-viewer/pdf-loader.d.ts +13 -2
  425. package/dist/components/viewers/pdf-viewer/pdf-loader.js +1 -1
  426. package/dist/components/viewers/pdf-viewer/pdf-viewer.class.d.ts +32 -2
  427. package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js +4 -4
  428. package/dist/components/viewers/pdf-viewer/pdf-viewer.styles.js +1 -27
  429. package/dist/components/viewers/pptx-viewer/pptx-viewer.styles.js +0 -3
  430. package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.class.js +1 -1
  431. package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.styles.js +0 -14
  432. package/dist/components/viewers/svg-viewer/svg-viewer.styles.js +0 -7
  433. package/dist/components/viewers/xml-viewer/xml-viewer.styles.js +2 -24
  434. package/dist/custom-elements-jsx.d.ts +72 -40
  435. package/dist/events.d.ts +43 -33
  436. package/dist/internal/agent-status-variants.d.ts +18 -0
  437. package/dist/internal/agent-status-variants.js +1 -0
  438. package/dist/internal/announcer.d.ts +8 -3
  439. package/dist/internal/announcer.js +1 -1
  440. package/dist/internal/autoloader-manifest.js +1 -1
  441. package/dist/internal/canvas-color.d.ts +16 -0
  442. package/dist/internal/canvas-color.js +1 -1
  443. package/dist/internal/catalog-picker.d.ts +0 -1
  444. package/dist/internal/catalog-picker.js +1 -1
  445. package/dist/internal/default-strings.generated.d.ts +1 -0
  446. package/dist/internal/default-strings.generated.js +1 -1
  447. package/dist/internal/dev-mode-attribute-warning.d.ts +27 -4
  448. package/dist/internal/dev-mode-attribute-warning.js +1 -1
  449. package/dist/internal/localization-runtime.js +1 -1
  450. package/dist/internal/localization-types.d.ts +1 -1
  451. package/dist/internal/localization.js +1 -1
  452. package/dist/internal/lyra-element.d.ts +13 -0
  453. package/dist/internal/lyra-element.js +1 -1
  454. package/dist/internal/media-controller.js +1 -1
  455. package/dist/internal/package-metadata.d.ts +1 -1
  456. package/dist/internal/package-metadata.js +1 -1
  457. package/dist/internal/scroll-overflow.d.ts +35 -13
  458. package/dist/internal/scroll-overflow.js +1 -1
  459. package/dist/internal/sizes.styles.js +0 -2
  460. package/dist/internal/specialist-tokens.styles.js +6 -11
  461. package/dist/internal/text-highlights.d.ts +4 -1
  462. package/dist/internal/text-highlights.js +1 -1
  463. package/dist/internal/tokens/palette.styles.js +0 -15
  464. package/dist/internal/tokens.styles.js +20 -113
  465. package/dist/lyra.d.ts +9 -6
  466. package/dist/styles/reservations.css +82 -0
  467. package/dist/svelte.d.ts +72 -40
  468. package/dist/translations/ar.js +1 -1
  469. package/dist/translations/de.js +1 -1
  470. package/dist/translations/es.js +1 -1
  471. package/dist/translations/fa.js +1 -1
  472. package/dist/translations/fr.js +1 -1
  473. package/dist/translations/he.js +1 -1
  474. package/dist/translations/ja.js +1 -1
  475. package/dist/translations/pt-BR.js +1 -1
  476. package/dist/translations/ru.js +1 -1
  477. package/dist/translations/zh-CN.js +1 -1
  478. package/dist/vue.d.ts +72 -40
  479. package/llms/components/lr-accordion-item.md +12 -3
  480. package/llms/components/lr-accordion.md +11 -2
  481. package/llms/components/lr-agent-eval-dashboard.md +1 -1
  482. package/llms/components/lr-agent-trace.md +3 -1
  483. package/llms/components/lr-agent-workspace.md +20 -0
  484. package/llms/components/lr-artifact-panel.md +10 -4
  485. package/llms/components/lr-attachment-chip.md +7 -4
  486. package/llms/components/lr-attachment-trigger.md +7 -4
  487. package/llms/components/lr-av-player.md +3 -1
  488. package/llms/components/lr-avatar.md +6 -6
  489. package/llms/components/lr-bar-chart.md +8 -6
  490. package/llms/components/lr-box-plot.md +15 -4
  491. package/llms/components/lr-browser-frame.md +7 -3
  492. package/llms/components/lr-bubble-chart.md +8 -6
  493. package/llms/components/lr-calendar.md +9 -2
  494. package/llms/components/lr-card.md +24 -0
  495. package/llms/components/lr-chart.md +45 -11
  496. package/llms/components/lr-chat-viewport.md +7 -2
  497. package/llms/components/lr-checkbox-group.md +13 -5
  498. package/llms/components/lr-checkbox.md +5 -2
  499. package/llms/components/lr-checkpoint.md +6 -2
  500. package/llms/components/lr-combobox.md +47 -8
  501. package/llms/components/lr-command-palette.md +4 -1
  502. package/llms/components/lr-confirm-bar.md +7 -3
  503. package/llms/components/lr-context-meter.md +12 -11
  504. package/llms/components/lr-conversation-item.md +7 -4
  505. package/llms/components/lr-date-input.md +22 -2
  506. package/llms/components/lr-date-picker.md +23 -3
  507. package/llms/components/lr-details.md +11 -2
  508. package/llms/components/lr-dialog.md +16 -10
  509. package/llms/components/lr-dock-panel.md +7 -10
  510. package/llms/components/lr-document-preview.md +6 -1
  511. package/llms/components/lr-document-viewer.md +3 -2
  512. package/llms/components/lr-doughnut-chart.md +8 -6
  513. package/llms/components/lr-drawer.md +3 -3
  514. package/llms/components/lr-entity-card.md +3 -3
  515. package/llms/components/lr-entity-chip.md +1 -1
  516. package/llms/components/lr-entity-dossier.md +4 -1
  517. package/llms/components/lr-file-input.md +2 -2
  518. package/llms/components/lr-flag.md +30 -8
  519. package/llms/components/lr-heatmap.md +46 -0
  520. package/llms/components/lr-histogram.md +7 -4
  521. package/llms/components/lr-icon.md +1 -1
  522. package/llms/components/lr-json-schema-viewer.md +2 -1
  523. package/llms/components/lr-knowledge-graph-explorer.md +8 -3
  524. package/llms/components/lr-known-date.md +4 -2
  525. package/llms/components/lr-line-chart.md +8 -6
  526. package/llms/components/lr-lite-chart.md +16 -6
  527. package/llms/components/lr-map.md +91 -10
  528. package/llms/components/lr-markdown-core.md +3 -2
  529. package/llms/components/lr-media-card.md +28 -12
  530. package/llms/components/lr-message-parts.md +2 -1
  531. package/llms/components/lr-model-select.md +9 -10
  532. package/llms/components/lr-model-settings-panel.md +9 -9
  533. package/llms/components/lr-neighbor-list.md +1 -1
  534. package/llms/components/lr-notebook-viewer.md +6 -3
  535. package/llms/components/lr-option.md +46 -7
  536. package/llms/components/lr-pdf-viewer.md +62 -2
  537. package/llms/components/lr-pie-chart.md +8 -6
  538. package/llms/components/lr-polar-area-chart.md +8 -6
  539. package/llms/components/lr-popover.md +25 -1
  540. package/llms/components/lr-progress-ring.md +8 -1
  541. package/llms/components/lr-prompt-studio.md +1 -1
  542. package/llms/components/lr-provenance-panel.md +4 -2
  543. package/llms/components/lr-qr-code.md +1 -1
  544. package/llms/components/lr-radar-chart.md +8 -6
  545. package/llms/components/lr-rag-eval-dashboard.md +2 -2
  546. package/llms/components/lr-random-content.md +13 -0
  547. package/llms/components/lr-reorder-item.md +6 -1
  548. package/llms/components/lr-reorder-list.md +6 -1
  549. package/llms/components/lr-responsive-panel.md +11 -7
  550. package/llms/components/lr-scatter-chart.md +8 -6
  551. package/llms/components/lr-sequence-strip.md +16 -2
  552. package/llms/components/lr-slider.md +12 -5
  553. package/llms/components/lr-sparkline.md +1 -1
  554. package/llms/components/lr-suggestion-chips.md +7 -2
  555. package/llms/components/lr-swatch-picker.md +5 -5
  556. package/llms/components/lr-switch.md +5 -2
  557. package/llms/components/lr-table.md +30 -4
  558. package/llms/components/lr-terminal.md +3 -1
  559. package/llms/components/lr-thread-list.md +8 -8
  560. package/llms/components/lr-time-input.md +6 -1
  561. package/llms/components/lr-timeline-item.md +24 -0
  562. package/llms/components/lr-timeline.md +25 -1
  563. package/llms/components/lr-token-input.md +7 -2
  564. package/llms/components/lr-tool-approval-dialog.md +7 -8
  565. package/llms/components/lr-tool-call-chip.md +5 -1
  566. package/llms/components/lr-tool-param-form.md +14 -12
  567. package/llms/components/lr-tool-result-dialog.md +11 -9
  568. package/llms/components/lr-tool-result-view.md +7 -6
  569. package/llms/components/lr-tool-select-dialog.md +18 -16
  570. package/llms/components/lr-trace-tree.md +3 -1
  571. package/llms/components/lr-usage-badge.md +4 -1
  572. package/llms/components/lr-video-playlist.md +1 -1
  573. package/llms/components/lr-virtual-list.md +22 -14
  574. package/llms/components/lr-voice-picker.md +8 -5
  575. package/llms/components/lr-widget-renderer.md +3 -3
  576. package/llms/components/lr-widget.md +1 -1
  577. package/llms/components/lr-word-cloud.md +6 -2
  578. package/llms/peers.md +12 -2
  579. package/llms/shared.md +70 -2
  580. package/llms/tokens.md +15 -1
  581. package/llms-full.txt +1335 -306
  582. package/package.json +17 -5
  583. package/vscode-css-data.json +93 -2
  584. package/vscode-html-data.json +513 -59
  585. package/web-types.json +457 -72
@@ -1,4 +1,4 @@
1
- var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{styleMap}from"lit/directives/style-map.js";import{LyraElement}from"../../../internal/lyra-element.js";import{place}from"../../../internal/positioner.js";import{nextId}from"../../../internal/a11y.js";import{chevronIcon,closeIcon}from"../../../internal/icons.js";import{AnchoredValidityController,VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{setCustomState,syncValidityStates}from"../../../internal/custom-states.js";import{submitOnEnter}from"../../../internal/submit-on-enter.js";import{finiteCount,finiteDuration}from"../../../internal/numbers.js";import{sizes}from"../../../internal/sizes.styles.js";import{styles}from"./combobox.styles.js";import"./option.class.js";import{autocorrectConverter,omittedEmptyStringConverter,spellcheckConverter}from"../../../internal/converters.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{sanitizeCssColor}from"../../../internal/safe-css.js";import{attachInternalsSafely,getFormOwner,installCustomErrorProperty,isBarredFromValidation,setFormOwner}from"../../../internal/form-associated.js";import{installInvalidEventAlias}from"../../../internal/invalid-event-alias.js";import{tag}from"../../../internal/prefix.js";import{renderInertPresentation}from"../../../internal/inert-presentation.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{acquireAnnouncementSink}from"../../../internal/announcer.js";import{activateOverlay}from"../../../internal/overlay-manager.js";import{isOptionSelectedDirty,wasOptionInitiallySelected,RESET_OPTION_SELECTED_FROM_OWNER,SET_OPTION_SELECTED_FROM_OWNER}from"../../../internal/option-selection.js";import{isHtmlElement}from"../../../internal/dom-guards.js";import{relayNativeEvent}from"../../../internal/native-event-relay.js";import{LYRA_DEFAULT_clear,LYRA_DEFAULT_collapse,LYRA_DEFAULT_comboboxCreate,LYRA_DEFAULT_comboboxLabel,LYRA_DEFAULT_comboboxLoadError,LYRA_DEFAULT_comboboxOverflow,LYRA_DEFAULT_comboboxRequired,LYRA_DEFAULT_comboboxSelectedOverflow,LYRA_DEFAULT_date,LYRA_DEFAULT_details,LYRA_DEFAULT_fieldRequired,LYRA_DEFAULT_loading,LYRA_DEFAULT_map,LYRA_DEFAULT_navigation,LYRA_DEFAULT_noMatches,LYRA_DEFAULT_open,LYRA_DEFAULT_popover,LYRA_DEFAULT_progress,LYRA_DEFAULT_removeWithContext,LYRA_DEFAULT_restore,LYRA_DEFAULT_search,LYRA_DEFAULT_select,LYRA_DEFAULT_valueInvalid}from"../../../internal/default-strings.generated.js";function isLyraOptionElement(value){return isHtmlElement(value)&&value.localName===tag("option")}const VALIDITY_FLAG_KEYS=new Set(["badInput","customError","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing"]),comboboxSpellcheckConverter={...spellcheckConverter,fromAttribute:(value,type)=>value===null?void 0:spellcheckConverter.fromAttribute?.(value,type)};function isValidityFlagKey(value){return typeof value=="string"&&VALIDITY_FLAG_KEYS.has(value)}const MAX_SOURCE_ROWS=2e3,MAX_SOURCE_TEXT_UNITS=25e4,MAX_SOURCE_FIELD_UNITS=4096,MAX_RENDER_ROWS=1e3;function normalizeSourceResult(input){let candidateRows,candidateTotal;try{Array.isArray(input)?candidateRows=input:typeof input=="object"&&input!==null&&(candidateRows=input.rows,candidateTotal=input.total)}catch{throw new TypeError("Invalid combobox source result")}if(!Array.isArray(candidateRows))throw new TypeError("Invalid combobox source result");const providerTotal=typeof candidateTotal=="number"&&Number.isFinite(candidateTotal)&&candidateTotal>=0?Math.trunc(candidateTotal):candidateRows.length,rows=[];let textUnits=0;const limit=Math.min(candidateRows.length,MAX_SOURCE_ROWS);for(let index=0;index<limit;index++)try{const value=candidateRows[index]?.value,label=candidateRows[index]?.label;if(typeof value!="string"||typeof label!="string"||value.length>MAX_SOURCE_FIELD_UNITS||label.length>MAX_SOURCE_FIELD_UNITS)continue;const source=candidateRows[index],optionalText=key=>{const candidate=source[key];return typeof candidate=="string"&&candidate.length<=MAX_SOURCE_FIELD_UNITS?candidate:void 0},sub=optionalText("sub"),accessibleLabel=optionalText("accessibleLabel"),dotColor=optionalText("dotColor"),group=optionalText("group"),badgeCandidate=source.badge,badge=typeof badgeCandidate=="string"&&badgeCandidate.length<=MAX_SOURCE_FIELD_UNITS||typeof badgeCandidate=="number"&&Number.isFinite(badgeCandidate)?badgeCandidate:void 0,units=value.length+label.length+(sub?.length??0)+(accessibleLabel?.length??0)+(dotColor?.length??0)+(group?.length??0)+(typeof badge=="string"?badge.length:0);if(textUnits+units>MAX_SOURCE_TEXT_UNITS)break;textUnits+=units,rows.push({value,label,...sub===void 0?{}:{sub},...source.icon===void 0?{}:{icon:source.icon},...badge===void 0?{}:{badge},...accessibleLabel===void 0?{}:{accessibleLabel},...source.data===void 0?{}:{data:source.data},...dotColor===void 0?{}:{dotColor},...group===void 0?{}:{group},...typeof source.disabled=="boolean"?{disabled:source.disabled}:{}})}catch{}const total=Math.max(providerTotal,candidateRows.length);return{rows,total,truncated:total>rows.length}}class LyraCombobox extends LyraElement{static{this.defaultStrings={...super.defaultStrings,clear:LYRA_DEFAULT_clear,collapse:LYRA_DEFAULT_collapse,comboboxCreate:LYRA_DEFAULT_comboboxCreate,comboboxLabel:LYRA_DEFAULT_comboboxLabel,comboboxLoadError:LYRA_DEFAULT_comboboxLoadError,comboboxOverflow:LYRA_DEFAULT_comboboxOverflow,comboboxRequired:LYRA_DEFAULT_comboboxRequired,comboboxSelectedOverflow:LYRA_DEFAULT_comboboxSelectedOverflow,date:LYRA_DEFAULT_date,details:LYRA_DEFAULT_details,fieldRequired:LYRA_DEFAULT_fieldRequired,loading:LYRA_DEFAULT_loading,map:LYRA_DEFAULT_map,navigation:LYRA_DEFAULT_navigation,noMatches:LYRA_DEFAULT_noMatches,open:LYRA_DEFAULT_open,popover:LYRA_DEFAULT_popover,progress:LYRA_DEFAULT_progress,removeWithContext:LYRA_DEFAULT_removeWithContext,restore:LYRA_DEFAULT_restore,search:LYRA_DEFAULT_search,select:LYRA_DEFAULT_select,valueInvalid:LYRA_DEFAULT_valueInvalid}}static{this.immutableEventDetails=Object.freeze(["lr-change","input","change"])}static{this.formAssociated=!0}static{this.styles=[LyraElement.styles,sizes,styles]}static{this.properties={customError:{attribute:"custom-error",reflect:!0,noAccessor:!0},multiple:{type:Boolean,reflect:!0,noAccessor:!0},disabled:{type:Boolean,reflect:!0,noAccessor:!0},required:{type:Boolean,reflect:!0,noAccessor:!0},value:{noAccessor:!0},name:{reflect:!0,noAccessor:!0,converter:omittedEmptyStringConverter},maxOptionsVisible:{type:Number,attribute:"max-options-visible",noAccessor:!0},maxRender:{type:Number,attribute:"max-render",noAccessor:!0},sourceDelay:{type:Number,attribute:"source-delay",noAccessor:!0}}}get open(){return this._open}set open(next){const old=this._open,liveDisabled=this.effectiveDisabled||typeof this.matches=="function"&&this.matches(":disabled");if(this._open=!!next&&!liveDisabled,this._open===old){next&&!this._open&&this.hasAttribute("open")&&this.removeAttribute("open");return}this.requestUpdate("open",old)}get autocorrect(){return this.autocorrectValue}set autocorrect(next){this.autocorrectValue=!!next,this.requestUpdate()}get inputmode(){return this.inputMode}set inputmode(next){this.inputMode=next??""}get enterkeyhint(){return this.enterKeyHint}set enterkeyhint(next){this.enterKeyHint=next??""}get inputValue(){return this.query}set inputValue(next){this.explicitInputValue=!0,this.query=next??"",this.activeIndex=-1,this.source&&this.runSource(this.query),this.requestUpdate()}constructor(){super(),this.placeholder="",this.label="",this.hint="",this.errorText="",this.allowCreate=!1,this.allowCustomValue=!1,this.appearance="outlined",this.placement="bottom",this.size="m",this.pill=!1,this.clearable=!1,this.withClear=!1,this.withLabel=!1,this.withHint=!1,this.validators=[],this.autocomplete="off",this.inputMode="",this.enterKeyHint="",this.spellcheck=!1,this.autocapitalize="",this.autocorrectValue=!0,this.filter=null,this.source=null,this.query="",this.explicitInputValue=!1,this.activeIndex=-1,this.options=[],this.touched=!1,this.validityRevision=0,this.slotPresence=new SlotPresenceController(this),this.loading=!1,this.sourceFailed=!1,this.asyncRows=[],this._sourceTotal=0,this._sourceTruncated=!1,this.sourceToken=0,this._sourceWarmed=!1,this._selectedLabelCache=new Map,this._selectedRowCache=new Map,this._rowsByValue=new Map,this._open=!1,this._fieldsetDisabled=!1,this.listId=nextId("combobox-list"),this.inputId=nextId("combobox-input"),this.restoreFocusOnClose=!0,this.restoringOverlayFocus=!1,this._isFirstUpdate=!0,this.openVetoed=!1,this.closeCleanupPending=!1,this.transitionToken=0,this.transitionWaiters=new Map,this._selected=[],this._valueDirty=!1,this._multiple=!1,this._disabled=!1,this._required=!1,this._defaultSelected=[],this._defaultCaptured=!1,this._restoredStateActive=!1,this._name="",this._maxOptionsVisible=3,this._maxRender=200,this._sourceDelay=200,this.collectOptions=e=>{const slot=e.target,previous=new Set(this.options);if(this.options=slot.assignedElements({flatten:!0}).filter(isLyraOptionElement),this.normalizeActiveIndex(),this._defaultCaptured){const newDefaults=this.options.filter(option=>!previous.has(option)&&option.defaultSelected),newLive=this.options.filter(option=>!previous.has(option)&&option.selected&&!option.defaultSelected);this.refreshOptionDefaults();const eligible=[...!this._restoredStateActive&&!this._valueDirty?newDefaults:[],...this._restoredStateActive?[]:newLive];if(eligible.length){const values=eligible.map(option=>option.value),next=this.multiple?[...new Set([...this._selected,...values])]:values[values.length-1];newLive.length>0?this.value=next:this.setValue(next,!1);return}}else{this._defaultCaptured=!0;const allDefaults=this.options.filter(option=>option.defaultSelected).map(option=>option.value),allLive=this.options.filter(option=>option.selected).map(option=>option.value),defaults=this.multiple?allDefaults:allDefaults.slice(0,1),live=this.multiple?allLive:allLive.slice(0,1),initialLive=this.options.filter(option=>wasOptionInitiallySelected(option)).map(option=>option.value),optionDirty=this.options.some(option=>isOptionSelectedDirty(option)),dirtyValues=this.options.filter(option=>isOptionSelectedDirty(option)&&option.selected).map(option=>option.value);this._defaultSelected=[...defaults.length>0?defaults:initialLive.length>0?initialLive:live];const fromDefaults=defaults.length>0,initial=optionDirty?this.multiple?allLive:dirtyValues.slice(-1)[0]?dirtyValues.slice(-1):live:fromDefaults?defaults:live;if(initial.length&&!this._restoredStateActive&&!this._valueDirty){const next=this.multiple?initial:initial[0];fromDefaults&&!optionDirty?this.setValue(next,!1):this.value=next;return}optionDirty&&(this._valueDirty=!0)}this.reflectSelected()},this.onOptionChange=()=>{queueMicrotask(()=>{this.refreshOptionDefaults(),this.reflectSelected(),this.options=[...this.options],this.normalizeActiveIndex()})},this.onDocPointer=e=>{if(!e.composedPath().includes(this)){if(this.overlayHandle?.isActive()){this.overlayHandle.dismissBackdrop();return}this.restoreFocusOnClose=!1,this.hide()}},this.onInput=e=>{this.liveDisabled||(this.explicitInputValue=!1,this.query=e.target.value,this.activeIndex=-1,this.show(),this.source&&this.runSource(this.query),this.emit("lr-filter",{value:this.query}))},this.onInputBlur=event=>{this.liveDisabled||(this.touched=!0),this.syncCustomStates(),this.restoreFocusOnClose=!1,this.hide(),relayNativeEvent(this,event)},this.onInputFocus=event=>{if(this.liveDisabled){event.stopPropagation();return}this.restoringOverlayFocus||this.show(),relayNativeEvent(this,event)},this.onKeyDown=e=>{if(this.liveDisabled)return;const navigable=this.renderedRows.rows.filter(r=>!r.disabled);switch(e.key){case"ArrowDown":if(e.preventDefault(),!this.open){this.show();return}this.activeIndex=Math.min(navigable.length-1,this.activeIndex+1);break;case"ArrowUp":if(e.preventDefault(),!this.open){this.show();return}this.activeIndex=Math.max(0,this.activeIndex-1);break;case"Enter":{const activeRow=navigable[this.activeIndex];if(this.open&&this.activeIndex>=0&&activeRow){e.preventDefault(),this.pickRow(activeRow);break}const create=this.createRow;if(this.open&&create){e.preventDefault(),this.createOption(create.createInput);break}if(this.open&&this.allowCustomValue&&!this.multiple&&this.query.trim()){e.preventDefault(),this.commitCustomValue(this.query.trim());break}submitOnEnter(this,e);break}case"Escape":this.open&&(!this.overlayHandle?.isActive()||this.overlayHandle.isTopmost())&&(e.preventDefault(),this.hide());break;case"Home":this.open&&(e.preventDefault(),this.activeIndex=0);break;case"End":this.open&&(e.preventDefault(),this.activeIndex=navigable.length-1);break;case"Backspace":this.multiple&&!this.query&&this._selected.length&&this.removeValue(this._selected[this._selected.length-1]);break}},this.onComboMouseDown=e=>{this.liveDisabled||e.target.closest("button")||(e.preventDefault(),this.renderRoot.querySelector('[part="combobox-input"]')?.focus(),this.show())},this.onListboxMouseDown=e=>{e.preventDefault()},this.onListboxClick=e=>{const value=e.target.closest('[part="option"]')?.dataset.value;if(value===void 0)return;const row=this._rowsByValue.get(value);row&&this.pickRow(row)},this.internals=attachInternalsSafely(this),this.validityController=new AnchoredValidityController(this,this.internals,()=>this[VALIDITY_ANCHOR]()),installCustomErrorProperty(this,()=>this.validityController.customValidityMessage),installInvalidEventAlias(this,init=>this.emit("lr-invalid",null,init))}get form(){return getFormOwner(this.internals)}set form(owner){setFormOwner(this,owner)}getForm(){return getFormOwner(this.internals)}get labels(){return this.internals.labels}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}get validationTarget(){return this.validationTargetOverride??this.inputEl??void 0}set validationTarget(next){this.validationTargetOverride=next??void 0,this.validityController.refreshAnchor()}resetValidity(){this.validityController.setCustomValidity(""),this.updateValidity()}get input(){return this.inputEl??null}get selectionStart(){return this.inputEl?.selectionStart??null}set selectionStart(value){this.inputEl&&(this.inputEl.selectionStart=value)}get selectionEnd(){return this.inputEl?.selectionEnd??null}set selectionEnd(value){this.inputEl&&(this.inputEl.selectionEnd=value)}get selectionDirection(){return this.inputEl?.selectionDirection}set selectionDirection(value){this.inputEl&&(this.inputEl.selectionDirection=value)}get liveDisabled(){return this.effectiveDisabled||this.matches(":disabled")}focus(options){this.liveDisabled||this.inputEl?.focus(options)}blur(){this.inputEl?.blur()}click(){this.liveDisabled||(this.inputEl?.focus(),this.show())}select(){this.inputEl?.select()}setSelectionRange(start,end,direction){this.inputEl?.setSelectionRange(start,end,direction)}setRangeText(replacement,start,end,selectMode){const input=this.inputEl;input&&(start===void 0||end===void 0?input.setRangeText(replacement):input.setRangeText(replacement,start,end,selectMode),this.explicitInputValue=!0,this.query=input.value,this.activeIndex=-1,this.source&&this.runSource(this.query))}[VALIDITY_ANCHOR](){return this.validationTarget}connectedCallback(){super.connectedCallback(),this.syncSourceErrorAnnouncementSink(),this.updateValidity(),this.hasUpdated&&this.syncValidatorAttributeObserver(),this.hasUpdated&&queueMicrotask(()=>{this.open?this.reconnectOpenPopup():this.source&&this._selected.length&&this.asyncRows.length===0&&this.runSource("")})}adoptedCallback(){super.adoptedCallback(),this.cleanup?.(),this.cleanup=void 0,this.overlayHandle?.deactivate({restoreFocus:!1}),this.overlayHandle=void 0,this.unbindDocumentPointer(),this.clearSourceTimer(),this.sourceToken+=1,this.sourceAbort?.abort(),this.sourceAbort=void 0,this.releaseSourceErrorAnnouncementSink(),this.syncSourceErrorAnnouncementSink()}syncSourceErrorAnnouncementSink(){this.isConnected&&this.sourceErrorAnnouncementSink?.element.ownerDocument!==this.ownerDocument&&(this.releaseSourceErrorAnnouncementSink(),this.sourceErrorAnnouncementSink=acquireAnnouncementSink("assertive",{document:this.ownerDocument,source:this}))}releaseSourceErrorAnnouncementSink(){this.sourceErrorAnnouncementSink?.release(),this.sourceErrorAnnouncementSink=void 0}willUpdate(changed){super.willUpdate(changed),this._isFirstUpdate=!this.hasUpdated,this.announceOpenTransition(changed),changed.has("open")&&this.openVetoed?this.closeCleanupPending=!1:changed.has("open")&&!this.open&&this.finalizeCloseState(),changed.has("source")&&(this.clearSourceTimer(),this.sourceAbort?.abort(),this.sourceAbort=void 0,this.sourceToken++,this.loading=!1,this.sourceFailed=!1,this.asyncRows=[],this._sourceTotal=0,this._sourceTruncated=!1,this.activeIndex=-1,this._sourceWarmed=!1,this.source&&this.open&&this.runSource(this.query)),!this._sourceWarmed&&this.source&&this._selected.length&&this.asyncRows.length===0&&(this._sourceWarmed=!0,this.runSource(""))}get name(){return this._name}set name(next){const old=this._name;this._name=next??"",this._name?this.setAttribute("name",this._name):this.removeAttribute("name"),this.syncFormValue(),this.requestUpdate("name",old)}get multiple(){return this._multiple}set multiple(next){const old=this._multiple;this._multiple=!!next,this.toggleAttribute("multiple",this._multiple),this.syncFormValue(),this.requestUpdate("multiple",old)}get disabled(){return this._disabled}set disabled(next){const old=this._disabled;this._disabled=!!next,this.toggleAttribute("disabled",this._disabled),this._disabled&&this.hide(),this.updateValidity(),this.requestUpdate("disabled",old)}get required(){return this._required}set required(next){const old=this._required;this._required=!!next,this.toggleAttribute("required",this._required),this.updateValidity(),this.requestUpdate("required",old)}get value(){return this.multiple?[...this._selected]:this._selected[0]??""}set value(next){this.setValue(next,!0)}setValue(next,dirty){const old=this._selected;dirty&&(this._restoredStateActive=!1,this._valueDirty=!0),this._selected=Array.isArray(next)?[...next]:next?[next]:[];const selected=new Set(this._selected);for(const value of selected){const row=this.effectiveRows.find(candidate=>candidate.value===value)??this.asyncRows.find(candidate=>candidate.value===value);row&&this._selectedRowCache.set(value,row)}for(const value of this._selectedRowCache.keys())selected.has(value)||this._selectedRowCache.delete(value);for(const value of this._selectedLabelCache.keys())selected.has(value)||this._selectedLabelCache.delete(value);this.syncFormValue(),this.reflectSelected(),this.updateValidity(),this.requestUpdate("value",old)}get maxOptionsVisible(){return this._maxOptionsVisible}set maxOptionsVisible(next){const old=this._maxOptionsVisible;this._maxOptionsVisible=finiteCount(next,3),this.requestUpdate("maxOptionsVisible",old)}get maxRender(){return this._maxRender}get sourceDelay(){return this._sourceDelay}set sourceDelay(next){const old=this._sourceDelay;this._sourceDelay=finiteDuration(next,200),this.requestUpdate("sourceDelay",old)}set maxRender(next){const old=this._maxRender;this._maxRender=Math.min(finiteCount(next,200),MAX_RENDER_ROWS),this.requestUpdate("maxRender",old)}get sourceTotal(){return this._sourceTotal}get sourceTruncated(){return this._sourceTruncated}get selectedRows(){return this._selected.map(value=>this._selectedRowCache.get(value)??this.effectiveRows.find(row=>row.value===value)??this.asyncRows.find(row=>row.value===value)).filter(row=>row!=null).map(row=>({...row}))}get barredFromValidation(){return isBarredFromValidation(this,this.internals)}validatorResult(){for(const validator of Array.isArray(this.validators)?this.validators:[]){let result;try{if(typeof validator=="object"&&validator!==null&&"checkValidity"in validator){const checked=validator.checkValidity(this);if(checked?.isValid===!0)continue;const flags={};for(const key of Array.isArray(checked?.invalidKeys)?checked.invalidKeys:[])isValidityFlagKey(key)&&(flags[key]=!0);Object.values(flags).some(Boolean)||(flags.customError=!0);let message=typeof checked?.message=="string"?checked.message:"";return!message&&typeof validator.message=="string"&&(message=validator.message),!message&&typeof validator.message=="function"&&(message=validator.message(this)),{flags,message:message||this.localize("valueInvalid")}}result=typeof validator=="function"?validator(this.value,this):validator?.validate(this.value,this)}catch{return{flags:{customError:!0},message:this.localize("valueInvalid")}}if(!(result===void 0||result===!0)){if(typeof result=="string")return{flags:{customError:!0},message:result};if(result===!1)return{flags:{customError:!0},message:this.localize("valueInvalid")};if(result&&typeof result=="object"&&Object.values(result).some(Boolean))return{flags:result,message:this.localize("valueInvalid")}}}return{}}syncValidatorAttributeObserver(){this.disconnectValidatorAttributeObserver();const owner=this.ownerDocument.defaultView,MutationObserverCtor=owner?.MutationObserver;if(!this.isConnected||!owner||typeof MutationObserverCtor!="function")return;const attributes=new Set;for(const validator of Array.isArray(this.validators)?this.validators:[]){if(typeof validator!="object"||validator===null||!("checkValidity"in validator))continue;let observed;try{observed=validator.observedAttributes}catch{continue}if(Array.isArray(observed))for(const name of observed)typeof name=="string"&&name.length>0&&attributes.add(name)}if(attributes.size===0)return;const binding={},observer=new MutationObserverCtor(()=>{this.validatorAttributeObserver!==binding||!this.isConnected||this.ownerDocument.defaultView!==owner||(this.updateValidity(),this.validityRevision++)});binding.observer=observer,binding.owner=owner;try{observer.observe(this,{attributes:!0,attributeFilter:[...attributes]}),this.validatorAttributeObserver=binding}catch{observer.disconnect()}}disconnectValidatorAttributeObserver(){const binding=this.validatorAttributeObserver;this.validatorAttributeObserver=void 0,binding?.observer.disconnect()}updateValidity(){if(this.barredFromValidation){this.validityController.setValidity({}),this.syncCustomStates();return}const flags={};let message="";this.required&&this._selected.length===0&&(flags.valueMissing=!0,message=this.localize("comboboxRequired"));const configured=this.validatorResult();configured.flags&&Object.assign(flags,configured.flags),configured.message&&(message=configured.message),this.validityController.setValidity(flags,message),this.syncCustomStates()}syncCustomStates(){syncValidityStates(this.internals,{required:this.required,hasInteracted:this.touched,barred:this.barredFromValidation}),setCustomState(this.internals,"blank",this._selected.length===0),setCustomState(this.internals,"disabled",this.effectiveDisabled)}syncFormValue(){const state2=JSON.stringify(this._selected);if(this.multiple){if(!this.name){this.internals.setFormValue(null,state2);return}const fd=new FormData;for(const v of this._selected)fd.append(this.name,v);this.internals.setFormValue(fd,state2)}else this.internals.setFormValue(this._selected[0]??"",state2)}get effectiveDisabled(){return this.disabled||this._fieldsetDisabled}formResetCallback(){this.touched=!1,this._restoredStateActive=!1,this._valueDirty=!1;const resetValues=this._defaultSelected.length>0?this._defaultSelected:this.options.filter(option=>wasOptionInitiallySelected(option)).map(option=>option.value);this._defaultSelected.length===0&&resetValues.length>0&&(this._defaultSelected=[...resetValues]);const defaults=new Set(resetValues);for(const option of this.options)option[RESET_OPTION_SELECTED_FROM_OWNER](defaults.has(option.value));this.setValue(this.multiple?[...resetValues]:resetValues[0]??"",!1),this.query="",this.explicitInputValue=!1}formStateRestoreCallback(state2,reason){let selected=[];if(typeof state2=="string")try{const parsed=JSON.parse(state2);Array.isArray(parsed)&&parsed.every(value=>typeof value=="string")&&(selected=parsed)}catch{}this.value=this.multiple?selected:selected[0]??"",this._restoredStateActive=!0}formDisabledCallback(disabled){this._fieldsetDisabled=disabled,disabled&&this.hide(),this.updateValidity(),this.requestUpdate()}checkValidity(){return this.updateValidity(),this.internals.checkValidity()}reportValidity(){return this.touched=!0,this.updateValidity(),this.syncCustomStates(),this.internals.reportValidity()}setCustomValidity(message){this.validityController.setCustomValidity(message??""),this.syncCustomStates()}disconnectedCallback(){this.transitionToken++,this.releaseSourceErrorAnnouncementSink(),this.disconnectValidatorAttributeObserver(),super.disconnectedCallback(),this.cleanup?.(),this.cleanup=void 0,this.clearSourceTimer(),this.sourceToken+=1,this.sourceAbort?.abort(),this.sourceAbort=void 0,this.overlayHandle?.deactivate({restoreFocus:!1}),this.overlayHandle=void 0,this.unbindDocumentPointer(),this.resolveTransitionWaiters("lr-after-show"),this.resolveTransitionWaiters("lr-after-hide"),this.open=!1}refreshOptionDefaults(){const declared=this.options.filter(option=>option.defaultSelected).map(option=>option.value);this._defaultSelected=this.multiple?declared:declared.slice(0,1),!this._valueDirty&&!this._restoredStateActive&&this.setValue(this.multiple?[...this._defaultSelected]:this._defaultSelected[0]??"",!1)}reflectSelected(){const sel=new Set(this._selected);for(const option of this.options)option[SET_OPTION_SELECTED_FROM_OWNER](sel.has(option.value))}labelFor(value){return this._selectedLabelCache.get(value)??this.options.find(o=>o.value===value)?.label??this.asyncRows.find(r=>r.value===value)?.label??value}get effectiveRows(){return this.source?this.asyncRows:this.filtered.map(o=>({value:o.value,label:o.label,sub:o.sub||void 0,dotColor:o.dotColor||void 0,group:o.group||void 0,disabled:o.disabled}))}get createRow(){if(!this.allowCreate)return;const inputValue=this.query.trim();if(!inputValue)return;const locale=this.effectiveLocale,folded=inputValue.toLocaleLowerCase(locale);if(!(this.source?this.asyncRows:this.options.map(option=>({value:option.value,label:option.label}))).some(row=>row.value.toLocaleLowerCase(locale)===folded||row.label.toLocaleLowerCase(locale)===folded))return{value:inputValue,label:this.localize("comboboxCreate",void 0,{value:inputValue}),createInput:inputValue}}get renderedRows(){const all=this.effectiveRows,create=this.createRow,sourceOverflow=this.source?Math.max(0,this._sourceTotal-all.length):0;if(all.length<=this.maxRender)return{rows:create?[...all,create]:all,overflow:sourceOverflow};const originalIndex=new Map(all.map((r,i)=>[r,i])),capped=all.slice(0,this.maxRender),cappedValues=new Set(capped.map(r=>r.value));let appendedOutOfCap=!1;for(const v of this._selected)if(!cappedValues.has(v)){const selectedRow=all.find(r=>r.value===v);selectedRow&&(capped.push(selectedRow),appendedOutOfCap=!0)}return appendedOutOfCap&&capped.sort((a,b)=>originalIndex.get(a)-originalIndex.get(b)),create&&capped.push(create),{rows:capped,overflow:all.length-capped.length+(create?1:0)+sourceOverflow}}normalizeActiveIndex(){if(this.activeIndex<0)return;const navigableCount=this.renderedRows.rows.filter(row=>!row.disabled).length,next=navigableCount>0?Math.min(this.activeIndex,navigableCount-1):-1;next!==this.activeIndex&&(this.activeIndex=next)}get filtered(){const locale=this.effectiveLocale,q=this.query.trim().toLocaleLowerCase(locale),selectedLabel=this.multiple?"":this.labelFor(this._selected[0]??"")??"",effective=q&&q===selectedLabel.toLocaleLowerCase(locale)?"":q;if(!effective)return this.options;const fn=this.filter??((o,query2)=>o.label.toLocaleLowerCase(locale).includes(query2)||o.searchText.toLocaleLowerCase(locale).includes(query2));return this.options.filter(o=>fn(o,effective))}get displayValue(){return this.multiple||this.open||this.explicitInputValue?this.query:this._selected[0]?this.labelFor(this._selected[0]):""}announceOpenTransition(changed){if(this.openVetoed=!1,!changed.has("open")||this._isFirstUpdate)return;const name=this.open?"lr-show":"lr-hide";if(!this.isConnected){this.emit("lr-hide");return}this.emit(name,null,{cancelable:!0}).defaultPrevented&&(this.openVetoed=!0,this.open=!this.open,this.resolveTransitionWaiters(this.open?"lr-after-hide":"lr-after-show"))}show(){if(this.open||this.liveDisabled)return Promise.resolve();this.resolveTransitionWaiters("lr-after-hide");const settled=this.waitForTransition("lr-after-show");return this.open=!0,settled}hide(){if(!this.open)return Promise.resolve();this.resolveTransitionWaiters("lr-after-show");const settled=this.waitForTransition("lr-after-hide");return this.closeCleanupPending=!0,this.open=!1,settled}finalizeCloseState(){if(this.closeCleanupPending&&(this.closeCleanupPending=!1,this.activeIndex=-1,!this.multiple)){const queryChanged=this.query!=="";this.query="",this.explicitInputValue=!1,queryChanged&&this.source&&(this.asyncRows=[],this.sourceFailed=!1,this._sourceTotal=0,this._sourceTruncated=!1)}}activateListboxOverlay(){this.cleanup?.(),this.cleanup=void 0,this.overlayHandle?.deactivate({restoreFocus:!1}),this.restoreFocusOnClose=!0,this.overlayHandle=activateOverlay({host:this,panel:()=>this.renderRoot.querySelector('[part="listbox"]'),onEscape:()=>{this.hide()},onBackdrop:()=>{this.restoreFocusOnClose=!1,this.hide()},restoreFocusTo:this.inputEl??null,modal:!1,trapFocus:!1}),this.bindDocumentPointer();const anchor=this.renderRoot.querySelector('[part="combobox"]'),listbox=this.renderRoot.querySelector('[part="listbox"]');anchor&&listbox&&(this.cleanup=place(anchor,listbox,{placement:`${this.placement}-start`}))}teardownListboxOverlay(restoreFocus=this.restoreFocusOnClose){this.cleanup?.(),this.cleanup=void 0,this.restoringOverlayFocus=restoreFocus;try{this.overlayHandle?.deactivate({restoreFocus})}finally{this.restoringOverlayFocus=!1}this.overlayHandle=void 0,this.unbindDocumentPointer(),this.restoreFocusOnClose=!0}bindDocumentPointer(){if(!this.isConnected)return;const ownerDocument=this.ownerDocument;if(this.pointerListenerDocument===ownerDocument&&this.pointerListener)return;this.unbindDocumentPointer();const listener=event=>{this.pointerListener!==listener||this.pointerListenerDocument!==ownerDocument||!this.isConnected||this.ownerDocument!==ownerDocument||this.onDocPointer(event)};this.pointerListenerDocument=ownerDocument,this.pointerListener=listener,ownerDocument.addEventListener("pointerdown",listener,!0)}unbindDocumentPointer(){this.pointerListenerDocument&&this.pointerListener&&this.pointerListenerDocument.removeEventListener("pointerdown",this.pointerListener,!0),this.pointerListenerDocument=void 0,this.pointerListener=void 0}reconnectOpenPopup(){!this.isConnected||!this.open||(this.activateListboxOverlay(),this.source&&this.asyncRows.length===0&&this.runSource(this.query))}updated(changed){super.updated(changed),changed.has("open")&&!this.openVetoed?this.open&&this.isConnected?(this.activateListboxOverlay(),this._isFirstUpdate||this.settleTransition("lr-after-show"),this.source&&this.asyncRows.length===0&&this.runSource(this.query)):this.open?this.teardownListboxOverlay(!1):(this.teardownListboxOverlay(),this._isFirstUpdate||this.settleTransition("lr-after-hide")):changed.has("open")&&this.openVetoed&&(this.restoreFocusOnClose=!0),changed.has("name")&&this.syncFormValue(),changed.has("validators")&&(this.updateValidity(),this.syncValidatorAttributeObserver()),(changed.has("touched")||changed.has("required")||changed.has("value")||changed.has("validators")||changed.has("validityRevision"))&&this.toggleAttribute("data-invalid",this.touched&&!this.internals.validity.valid),changed.has("activeIndex")&&this.renderRoot.querySelector('[part="option"][data-active]')?.scrollIntoView({block:"nearest"})}async settleTransition(event){const token=++this.transitionToken;if(await this.updateComplete,this.transitionToken===token){if(this.isConnected){const view=this.ownerDocument.defaultView;if(view&&await new Promise(resolve=>view.requestAnimationFrame(()=>resolve())),this.transitionToken!==token)return;const animations=this.renderRoot.querySelector('[part="listbox"]')?.getAnimations({subtree:!0})??[];if(await Promise.all(animations.map(animation=>animation.finished.catch(()=>{}))),this.transitionToken!==token)return}this.emit(event),this.resolveTransitionWaiters(event)}}waitForTransition(event){return new Promise(resolve=>{const waiters=this.transitionWaiters.get(event)??new Set;waiters.add(resolve),this.transitionWaiters.set(event,waiters)})}resolveTransitionWaiters(event){const waiters=this.transitionWaiters.get(event);if(waiters){this.transitionWaiters.delete(event);for(const resolve of waiters)resolve()}}emitValueEvents(){this.emit("input",{value:this.value}),this.emit("change",{value:this.value}),this.emit("lr-change",{value:this.value})}createOption(inputValue){if(this.liveDisabled||this.emit("lr-create",{inputValue},{cancelable:!0}).defaultPrevented)return;const option=this.ownerDocument.createElement(tag("option"));option.setAttribute("value",inputValue),option.textContent=inputValue,this.append(option),this.pickRow({value:inputValue,label:inputValue})}commitCustomValue(inputValue){if(this.liveDisabled||this.multiple||!inputValue)return;const selectionChanged=this._selected[0]!==inputValue;this._selectedLabelCache.set(inputValue,inputValue),this.value=inputValue,this.query="",this.explicitInputValue=!1,this.hide(),selectionChanged&&this.emitValueEvents()}pickRow(row){if(this.liveDisabled||row.disabled)return;if(row.createInput!==void 0){this.createOption(row.createInput);return}const selectionChanged=this.multiple||this._selected[0]!==row.value;if(this.multiple){const set=new Set(this._selected);set.has(row.value)?(set.delete(row.value),this._selectedRowCache.delete(row.value)):(set.add(row.value),this._selectedLabelCache.set(row.value,row.label),this._selectedRowCache.set(row.value,row)),this.value=[...set],this.query="",this.explicitInputValue=!1}else this._selectedLabelCache.set(row.value,row.label),this._selectedRowCache.clear(),this._selectedRowCache.set(row.value,row),this.value=row.value,this.query="",this.explicitInputValue=!1,this.hide();this.source&&this.runSource(this.query),selectionChanged&&this.emitValueEvents()}removeValue(value){if(this.liveDisabled)return;const next=this._selected.filter(v=>v!==value);next.length!==this._selected.length&&(this.value=next,this.emitValueEvents())}clear(){if(this.liveDisabled)return;const hadSelection=this._selected.length>0,queryChanged=this.query!=="";!hadSelection&&!queryChanged||(hadSelection&&(this.value=[]),this.query="",this.explicitInputValue=!1,this.source&&this.runSource(this.query),hadSelection&&(this.emitValueEvents(),this.emit("lr-clear")),queryChanged&&this.emit("lr-filter",{value:this.query}))}runSource(query2){const source=this.source;if(!source)return;this.clearSourceTimer(),this.sourceAbort?.abort(),this.sourceAbort=void 0;const token=++this.sourceToken,ownerWindow=this.ownerDocument.defaultView;if(!this.isConnected||!ownerWindow)return;const timer={owner:ownerWindow,handle:0,token};timer.handle=ownerWindow.setTimeout(()=>{if(this.sourceTimer!==timer||token!==this.sourceToken||!this.isConnected||this.ownerDocument.defaultView!==ownerWindow)return;this.sourceTimer=void 0;const controller=new ownerWindow.AbortController;this.sourceAbort=controller,this.loading=!0,this.sourceFailed=!1,Promise.resolve().then(()=>source(query2,{signal:controller.signal,limit:MAX_SOURCE_ROWS})).then(result=>{if(token!==this.sourceToken||!this.isConnected||this.ownerDocument.defaultView!==ownerWindow)return;const normalized=normalizeSourceResult(result);this._sourceTotal=normalized.total,this._sourceTruncated=normalized.truncated,this.asyncRows=normalized.rows,this.sourceFailed=!1,this.normalizeActiveIndex();const selected=new Set(this._selected);for(const row of normalized.rows)selected.has(row.value)&&this._selectedRowCache.set(row.value,row)}).catch(err=>{token!==this.sourceToken||!this.isConnected||this.ownerDocument.defaultView!==ownerWindow||typeof err=="object"&&err!==null&&"name"in err&&err.name==="AbortError"||(this.asyncRows=[],this._sourceTotal=0,this._sourceTruncated=!1,this.activeIndex=-1,this.sourceFailed=!0,this.sourceErrorAnnouncementSink?.announce(this.localize("comboboxLoadError")),console.warn("<lr-combobox> source() rejected:",err))}).finally(()=>{token===this.sourceToken&&(this.loading=!1)})},this._sourceDelay),this.sourceTimer=timer}clearSourceTimer(){const timer=this.sourceTimer;this.sourceTimer=void 0,timer&&timer.owner.clearTimeout(timer.handle)}renderRows(rows,activeId){const out=[];let currentGroup,currentGroupRows=[],groupIndex=0;const selectedSet=new Set(this._selected),flushGroup=()=>{if(currentGroupRows.length){if(currentGroup){const labelId=`${this.listId}-group-${groupIndex++}`;out.push(html`<div role="group" aria-labelledby=${labelId}>
1
+ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{styleMap}from"lit/directives/style-map.js";import{LyraElement}from"../../../internal/lyra-element.js";import{place}from"../../../internal/positioner.js";import{hostAriaLabel,nextId}from"../../../internal/a11y.js";import{chevronIcon,closeIcon}from"../../../internal/icons.js";import{AnchoredValidityController,VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{setCustomState,syncValidityStates}from"../../../internal/custom-states.js";import{submitOnEnter}from"../../../internal/submit-on-enter.js";import{finiteCount,finiteDuration}from"../../../internal/numbers.js";import{sizes}from"../../../internal/sizes.styles.js";import{styles}from"./combobox.styles.js";import"./option.class.js";import{autocorrectConverter,omittedEmptyStringConverter,spellcheckConverter}from"../../../internal/converters.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{sanitizeCssColor}from"../../../internal/safe-css.js";import{attachInternalsSafely,getFormOwner,installCustomErrorProperty,isBarredFromValidation,setFormOwner}from"../../../internal/form-associated.js";import{installInvalidEventAlias}from"../../../internal/invalid-event-alias.js";import{tag}from"../../../internal/prefix.js";import{renderInertPresentation}from"../../../internal/inert-presentation.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{acquireAnnouncementSink}from"../../../internal/announcer.js";import{activateOverlay}from"../../../internal/overlay-manager.js";import{isOptionSelectedDirty,wasOptionInitiallySelected,RESET_OPTION_SELECTED_FROM_OWNER,SET_OPTION_SELECTED_FROM_OWNER}from"../../../internal/option-selection.js";import{isHtmlElement}from"../../../internal/dom-guards.js";import{relayNativeEvent}from"../../../internal/native-event-relay.js";import{LYRA_DEFAULT_clear,LYRA_DEFAULT_collapse,LYRA_DEFAULT_comboboxCreate,LYRA_DEFAULT_comboboxLabel,LYRA_DEFAULT_comboboxLoadError,LYRA_DEFAULT_comboboxOverflow,LYRA_DEFAULT_comboboxRequired,LYRA_DEFAULT_comboboxSelectedOverflow,LYRA_DEFAULT_date,LYRA_DEFAULT_details,LYRA_DEFAULT_fieldRequired,LYRA_DEFAULT_loading,LYRA_DEFAULT_map,LYRA_DEFAULT_navigation,LYRA_DEFAULT_noMatches,LYRA_DEFAULT_open,LYRA_DEFAULT_popover,LYRA_DEFAULT_progress,LYRA_DEFAULT_removeWithContext,LYRA_DEFAULT_restore,LYRA_DEFAULT_search,LYRA_DEFAULT_select,LYRA_DEFAULT_valueInvalid}from"../../../internal/default-strings.generated.js";function isLyraOptionElement(value){return isHtmlElement(value)&&value.localName===tag("option")}const VALIDITY_FLAG_KEYS=new Set(["badInput","customError","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing"]),comboboxSpellcheckConverter={...spellcheckConverter,fromAttribute:(value,type)=>value===null?void 0:spellcheckConverter.fromAttribute?.(value,type)};function isValidityFlagKey(value){return typeof value=="string"&&VALIDITY_FLAG_KEYS.has(value)}const MAX_SOURCE_ROWS=2e3,MAX_SOURCE_TEXT_UNITS=25e4,MAX_SOURCE_FIELD_UNITS=4096,MAX_RENDER_ROWS=1e3;function normalizeSourceResult(input){let candidateRows,candidateTotal;try{Array.isArray(input)?candidateRows=input:typeof input=="object"&&input!==null&&(candidateRows=input.rows,candidateTotal=input.total)}catch{throw new TypeError("Invalid combobox source result")}if(!Array.isArray(candidateRows))throw new TypeError("Invalid combobox source result");const providerTotal=typeof candidateTotal=="number"&&Number.isFinite(candidateTotal)&&candidateTotal>=0?Math.trunc(candidateTotal):candidateRows.length,rows=[];let textUnits=0;const limit=Math.min(candidateRows.length,MAX_SOURCE_ROWS);for(let index=0;index<limit;index++)try{const value=candidateRows[index]?.value,label=candidateRows[index]?.label;if(typeof value!="string"||typeof label!="string"||value.length>MAX_SOURCE_FIELD_UNITS||label.length>MAX_SOURCE_FIELD_UNITS)continue;const source=candidateRows[index],optionalText=key=>{const candidate=source[key];return typeof candidate=="string"&&candidate.length<=MAX_SOURCE_FIELD_UNITS?candidate:void 0},sub=optionalText("sub"),accessibleLabel=optionalText("accessibleLabel"),dotColor=optionalText("dotColor"),group=optionalText("group"),badgeCandidate=source.badge,badge=typeof badgeCandidate=="string"&&badgeCandidate.length<=MAX_SOURCE_FIELD_UNITS||typeof badgeCandidate=="number"&&Number.isFinite(badgeCandidate)?badgeCandidate:void 0,units=value.length+label.length+(sub?.length??0)+(accessibleLabel?.length??0)+(dotColor?.length??0)+(group?.length??0)+(typeof badge=="string"?badge.length:0);if(textUnits+units>MAX_SOURCE_TEXT_UNITS)break;textUnits+=units,rows.push({value,label,...sub===void 0?{}:{sub},...source.icon===void 0?{}:{icon:source.icon},...source.start===void 0?{}:{start:source.start},...source.end===void 0?{}:{end:source.end},...badge===void 0?{}:{badge},...accessibleLabel===void 0?{}:{accessibleLabel},...source.data===void 0?{}:{data:source.data},...dotColor===void 0?{}:{dotColor},...group===void 0?{}:{group},...typeof source.disabled=="boolean"?{disabled:source.disabled}:{}})}catch{}const total=Math.max(providerTotal,candidateRows.length);return{rows,total,truncated:total>rows.length}}class LyraCombobox extends LyraElement{static{this.defaultStrings={...super.defaultStrings,clear:LYRA_DEFAULT_clear,collapse:LYRA_DEFAULT_collapse,comboboxCreate:LYRA_DEFAULT_comboboxCreate,comboboxLabel:LYRA_DEFAULT_comboboxLabel,comboboxLoadError:LYRA_DEFAULT_comboboxLoadError,comboboxOverflow:LYRA_DEFAULT_comboboxOverflow,comboboxRequired:LYRA_DEFAULT_comboboxRequired,comboboxSelectedOverflow:LYRA_DEFAULT_comboboxSelectedOverflow,date:LYRA_DEFAULT_date,details:LYRA_DEFAULT_details,fieldRequired:LYRA_DEFAULT_fieldRequired,loading:LYRA_DEFAULT_loading,map:LYRA_DEFAULT_map,navigation:LYRA_DEFAULT_navigation,noMatches:LYRA_DEFAULT_noMatches,open:LYRA_DEFAULT_open,popover:LYRA_DEFAULT_popover,progress:LYRA_DEFAULT_progress,removeWithContext:LYRA_DEFAULT_removeWithContext,restore:LYRA_DEFAULT_restore,search:LYRA_DEFAULT_search,select:LYRA_DEFAULT_select,valueInvalid:LYRA_DEFAULT_valueInvalid}}static{this.immutableEventDetails=Object.freeze(["lr-change","input","change"])}static{this.formAssociated=!0}static{this.styles=[LyraElement.styles,sizes,styles]}static{this.properties={customError:{attribute:"custom-error",reflect:!0,noAccessor:!0},multiple:{type:Boolean,reflect:!0,noAccessor:!0},disabled:{type:Boolean,reflect:!0,noAccessor:!0},required:{type:Boolean,reflect:!0,noAccessor:!0},value:{noAccessor:!0},name:{reflect:!0,noAccessor:!0,converter:omittedEmptyStringConverter},maxOptionsVisible:{type:Number,attribute:"max-options-visible",noAccessor:!0},maxRender:{type:Number,attribute:"max-render",noAccessor:!0},sourceDelay:{type:Number,attribute:"source-delay",noAccessor:!0}}}get open(){return this._open}set open(next){const old=this._open,liveDisabled=this.effectiveDisabled||typeof this.matches=="function"&&this.matches(":disabled");if(this._open=!!next&&!liveDisabled,this._open===old){next&&!this._open&&this.hasAttribute("open")&&this.removeAttribute("open");return}this.requestUpdate("open",old)}get autocorrect(){return this.autocorrectValue}set autocorrect(next){this.autocorrectValue=!!next,this.requestUpdate()}get inputmode(){return this.inputMode}set inputmode(next){this.inputMode=next??""}get enterkeyhint(){return this.enterKeyHint}set enterkeyhint(next){this.enterKeyHint=next??""}get inputValue(){return this.query}set inputValue(next){this.explicitInputValue=!0,this.query=next??"",this.activeIndex=-1,this.source&&this.runSource(this.query),this.requestUpdate()}constructor(){super(),this.placeholder="",this.label="",this.hint="",this.errorText="",this.allowCreate=!1,this.allowCustomValue=!1,this.appearance="outlined",this.placement="bottom",this.size="m",this.pill=!1,this.clearable=!1,this.withClear=!1,this.withLabel=!1,this.withHint=!1,this.validators=[],this.autocomplete="off",this.inputMode="",this.enterKeyHint="",this.spellcheck=!1,this.autocapitalize="",this.autocorrectValue=!0,this.filter=null,this.source=null,this.query="",this.explicitInputValue=!1,this.activeIndex=-1,this.options=[],this.touched=!1,this.validityRevision=0,this.slotPresence=new SlotPresenceController(this),this.loading=!1,this.sourceFailed=!1,this.asyncRows=[],this._sourceTotal=0,this._sourceTruncated=!1,this.sourceToken=0,this._sourceWarmed=!1,this._selectedLabelCache=new Map,this._selectedRowCache=new Map,this._rowsByValue=new Map,this._open=!1,this._fieldsetDisabled=!1,this.listId=nextId("combobox-list"),this.inputId=nextId("combobox-input"),this.restoreFocusOnClose=!0,this.restoringOverlayFocus=!1,this._isFirstUpdate=!0,this.openVetoed=!1,this.closeCleanupPending=!1,this.transitionToken=0,this.transitionWaiters=new Map,this._selected=[],this._valueDirty=!1,this._multiple=!1,this._disabled=!1,this._required=!1,this._defaultSelected=[],this._defaultCaptured=!1,this._restoredStateActive=!1,this._name="",this._maxOptionsVisible=3,this._maxRender=200,this._sourceDelay=200,this.collectOptions=e=>{const slot=e.target,previous=new Set(this.options);if(this.options=slot.assignedElements({flatten:!0}).filter(isLyraOptionElement),this.adornmentClones=new WeakMap,this.normalizeActiveIndex(),this._defaultCaptured){const newDefaults=this.options.filter(option=>!previous.has(option)&&option.defaultSelected),newLive=this.options.filter(option=>!previous.has(option)&&option.selected&&!option.defaultSelected);this.refreshOptionDefaults();const eligible=[...!this._restoredStateActive&&!this._valueDirty?newDefaults:[],...this._restoredStateActive?[]:newLive];if(eligible.length){const values=eligible.map(option=>option.value),next=this.multiple?[...new Set([...this._selected,...values])]:values[values.length-1];newLive.length>0?this.value=next:this.setValue(next,!1);return}}else{this._defaultCaptured=!0;const allDefaults=this.options.filter(option=>option.defaultSelected).map(option=>option.value),allLive=this.options.filter(option=>option.selected).map(option=>option.value),defaults=this.multiple?allDefaults:allDefaults.slice(0,1),live=this.multiple?allLive:allLive.slice(0,1),initialLive=this.options.filter(option=>wasOptionInitiallySelected(option)).map(option=>option.value),optionDirty=this.options.some(option=>isOptionSelectedDirty(option)),dirtyValues=this.options.filter(option=>isOptionSelectedDirty(option)&&option.selected).map(option=>option.value);this._defaultSelected=[...defaults.length>0?defaults:initialLive.length>0?initialLive:live];const fromDefaults=defaults.length>0,initial=optionDirty?this.multiple?allLive:dirtyValues.slice(-1)[0]?dirtyValues.slice(-1):live:fromDefaults?defaults:live;if(initial.length&&!this._restoredStateActive&&!this._valueDirty){const next=this.multiple?initial:initial[0];fromDefaults&&!optionDirty?this.setValue(next,!1):this.value=next;return}optionDirty&&(this._valueDirty=!0)}this.reflectSelected()},this.onOptionChange=e=>{e.stopPropagation(),queueMicrotask(()=>{this.refreshOptionDefaults(),this.reflectSelected(),this.options=[...this.options],this.normalizeActiveIndex()})},this.adornmentClones=new WeakMap,this.onDocPointer=e=>{if(!e.composedPath().includes(this)){if(this.overlayHandle?.isActive()){this.overlayHandle.dismissBackdrop();return}this.restoreFocusOnClose=!1,this.hide()}},this.onInput=e=>{this.liveDisabled||(this.explicitInputValue=!1,this.query=e.target.value,this.activeIndex=-1,this.show(),this.source&&this.runSource(this.query),this.emit("lr-filter",{value:this.query}))},this.onInputBlur=event=>{this.liveDisabled||(this.touched=!0),this.syncCustomStates(),this.restoreFocusOnClose=!1,this.hide(),relayNativeEvent(this,event)},this.onInputFocus=event=>{if(this.liveDisabled){event.stopPropagation();return}this.restoringOverlayFocus||this.show(),relayNativeEvent(this,event)},this.onKeyDown=e=>{if(this.liveDisabled)return;const navigable=this.renderedRows.rows.filter(r=>!r.disabled);switch(e.key){case"ArrowDown":if(e.preventDefault(),!this.open){this.show();return}this.activeIndex=Math.min(navigable.length-1,this.activeIndex+1);break;case"ArrowUp":if(e.preventDefault(),!this.open){this.show();return}this.activeIndex=Math.max(0,this.activeIndex-1);break;case"Enter":{const activeRow=navigable[this.activeIndex];if(this.open&&this.activeIndex>=0&&activeRow){e.preventDefault(),this.pickRow(activeRow);break}const create=this.createRow;if(this.open&&create){e.preventDefault(),this.createOption(create.createInput);break}if(this.open&&this.allowCustomValue&&!this.multiple&&this.query.trim()){e.preventDefault(),this.commitCustomValue(this.query.trim());break}submitOnEnter(this,e);break}case"Escape":this.open&&(!this.overlayHandle?.isActive()||this.overlayHandle.isTopmost())&&(e.preventDefault(),this.hide());break;case"Home":this.open&&(e.preventDefault(),this.activeIndex=0);break;case"End":this.open&&(e.preventDefault(),this.activeIndex=navigable.length-1);break;case"Backspace":this.multiple&&!this.query&&this._selected.length&&this.removeValue(this._selected[this._selected.length-1]);break}},this.onComboMouseDown=e=>{this.liveDisabled||e.composedPath()[0]!==this.inputEl&&(e.target.closest("button")||(e.preventDefault(),this.inputEl?.focus(),this.show()))},this.onListboxMouseDown=e=>{e.preventDefault()},this.onListboxClick=e=>{const value=e.target.closest('[part="option"]')?.dataset.value;if(value===void 0)return;const row=this._rowsByValue.get(value);row&&this.pickRow(row)},this.internals=attachInternalsSafely(this),this.validityController=new AnchoredValidityController(this,this.internals,()=>this[VALIDITY_ANCHOR]()),installCustomErrorProperty(this,()=>this.validityController.customValidityMessage),installInvalidEventAlias(this,init=>this.emit("lr-invalid",null,init))}get form(){return getFormOwner(this.internals)}set form(owner){setFormOwner(this,owner)}getForm(){return getFormOwner(this.internals)}get labels(){return this.internals.labels}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}get validationTarget(){return this.validationTargetOverride??this.inputEl??void 0}set validationTarget(next){this.validationTargetOverride=next??void 0,this.validityController.refreshAnchor()}resetValidity(){this.validityController.setCustomValidity(""),this.updateValidity()}get input(){return this.inputEl??null}get selectionStart(){return this.inputEl?.selectionStart??null}set selectionStart(value){this.inputEl&&(this.inputEl.selectionStart=value)}get selectionEnd(){return this.inputEl?.selectionEnd??null}set selectionEnd(value){this.inputEl&&(this.inputEl.selectionEnd=value)}get selectionDirection(){return this.inputEl?.selectionDirection}set selectionDirection(value){this.inputEl&&(this.inputEl.selectionDirection=value)}get liveDisabled(){return this.effectiveDisabled||this.matches(":disabled")}focus(options){this.liveDisabled||this.inputEl?.focus(options)}blur(){this.inputEl?.blur()}click(){this.liveDisabled||(this.inputEl?.focus(),this.show())}select(){this.inputEl?.select()}setSelectionRange(start,end,direction){this.inputEl?.setSelectionRange(start,end,direction)}setRangeText(replacement,start,end,selectMode){const input=this.inputEl;input&&(start===void 0||end===void 0?input.setRangeText(replacement):input.setRangeText(replacement,start,end,selectMode),this.explicitInputValue=!0,this.query=input.value,this.activeIndex=-1,this.source&&this.runSource(this.query))}[VALIDITY_ANCHOR](){return this.validationTarget}connectedCallback(){super.connectedCallback(),this.syncSourceErrorAnnouncementSink(),this.updateValidity(),this.hasUpdated&&this.syncValidatorAttributeObserver(),this.hasUpdated&&queueMicrotask(()=>{this.open?this.reconnectOpenPopup():this.source&&this._selected.length&&this.asyncRows.length===0&&this.runSource("")})}adoptedCallback(){super.adoptedCallback(),this.cleanup?.(),this.cleanup=void 0,this.overlayHandle?.deactivate({restoreFocus:!1}),this.overlayHandle=void 0,this.unbindDocumentPointer(),this.clearSourceTimer(),this.sourceToken+=1,this.sourceAbort?.abort(),this.sourceAbort=void 0,this.releaseSourceErrorAnnouncementSink(),this.syncSourceErrorAnnouncementSink()}syncSourceErrorAnnouncementSink(){this.isConnected&&this.sourceErrorAnnouncementSink?.element.ownerDocument!==this.ownerDocument&&(this.releaseSourceErrorAnnouncementSink(),this.sourceErrorAnnouncementSink=acquireAnnouncementSink("assertive",{document:this.ownerDocument,source:this}))}releaseSourceErrorAnnouncementSink(){this.sourceErrorAnnouncementSink?.release(),this.sourceErrorAnnouncementSink=void 0}willUpdate(changed){super.willUpdate(changed),this._isFirstUpdate=!this.hasUpdated,this.announceOpenTransition(changed),changed.has("open")&&this.openVetoed?this.closeCleanupPending=!1:changed.has("open")&&!this.open&&this.finalizeCloseState(),changed.has("source")&&(this.clearSourceTimer(),this.sourceAbort?.abort(),this.sourceAbort=void 0,this.sourceToken++,this.loading=!1,this.sourceFailed=!1,this.asyncRows=[],this._sourceTotal=0,this._sourceTruncated=!1,this.activeIndex=-1,this._sourceWarmed=!1,this.source&&this.open&&this.runSource(this.query)),!this._sourceWarmed&&this.source&&this._selected.length&&this.asyncRows.length===0&&(this._sourceWarmed=!0,this.runSource(""))}get name(){return this._name}set name(next){const old=this._name;this._name=next??"",this._name?this.setAttribute("name",this._name):this.removeAttribute("name"),this.syncFormValue(),this.requestUpdate("name",old)}get multiple(){return this._multiple}set multiple(next){const old=this._multiple;this._multiple=!!next,this.toggleAttribute("multiple",this._multiple),this.syncFormValue(),this.requestUpdate("multiple",old)}get disabled(){return this._disabled}set disabled(next){const old=this._disabled;this._disabled=!!next,this.toggleAttribute("disabled",this._disabled),this._disabled&&this.hide(),this.updateValidity(),this.requestUpdate("disabled",old)}get required(){return this._required}set required(next){const old=this._required;this._required=!!next,this.toggleAttribute("required",this._required),this.updateValidity(),this.requestUpdate("required",old)}get value(){return this.multiple?[...this._selected]:this._selected[0]??""}set value(next){this.setValue(next,!0)}setValue(next,dirty){const old=this._selected;dirty&&(this._restoredStateActive=!1,this._valueDirty=!0),this._selected=Array.isArray(next)?[...next]:next?[next]:[];const selected=new Set(this._selected);for(const value of selected){const row=this.effectiveRows.find(candidate=>candidate.value===value)??this.asyncRows.find(candidate=>candidate.value===value);row&&this._selectedRowCache.set(value,row)}for(const value of this._selectedRowCache.keys())selected.has(value)||this._selectedRowCache.delete(value);for(const value of this._selectedLabelCache.keys())selected.has(value)||this._selectedLabelCache.delete(value);this.syncFormValue(),this.reflectSelected(),this.updateValidity(),this.requestUpdate("value",old)}get maxOptionsVisible(){return this._maxOptionsVisible}set maxOptionsVisible(next){const old=this._maxOptionsVisible;this._maxOptionsVisible=finiteCount(next,3),this.requestUpdate("maxOptionsVisible",old)}get maxRender(){return this._maxRender}get sourceDelay(){return this._sourceDelay}set sourceDelay(next){const old=this._sourceDelay;this._sourceDelay=finiteDuration(next,200),this.requestUpdate("sourceDelay",old)}set maxRender(next){const old=this._maxRender;this._maxRender=Math.min(finiteCount(next,200),MAX_RENDER_ROWS),this.requestUpdate("maxRender",old)}get sourceTotal(){return this._sourceTotal}get sourceTruncated(){return this._sourceTruncated}get selectedRows(){return this._selected.map(value=>this._selectedRowCache.get(value)??this.effectiveRows.find(row=>row.value===value)??this.asyncRows.find(row=>row.value===value)).filter(row=>row!=null).map(row=>({...row}))}get barredFromValidation(){return isBarredFromValidation(this,this.internals)}validatorResult(){for(const validator of Array.isArray(this.validators)?this.validators:[]){let result;try{if(typeof validator=="object"&&validator!==null&&"checkValidity"in validator){const checked=validator.checkValidity(this);if(checked?.isValid===!0)continue;const flags={};for(const key of Array.isArray(checked?.invalidKeys)?checked.invalidKeys:[])isValidityFlagKey(key)&&(flags[key]=!0);Object.values(flags).some(Boolean)||(flags.customError=!0);let message=typeof checked?.message=="string"?checked.message:"";return!message&&typeof validator.message=="string"&&(message=validator.message),!message&&typeof validator.message=="function"&&(message=validator.message(this)),{flags,message:message||this.localize("valueInvalid")}}result=typeof validator=="function"?validator(this.value,this):validator?.validate(this.value,this)}catch{return{flags:{customError:!0},message:this.localize("valueInvalid")}}if(!(result===void 0||result===!0)){if(typeof result=="string")return{flags:{customError:!0},message:result};if(result===!1)return{flags:{customError:!0},message:this.localize("valueInvalid")};if(result&&typeof result=="object"&&Object.values(result).some(Boolean))return{flags:result,message:this.localize("valueInvalid")}}}return{}}syncValidatorAttributeObserver(){this.disconnectValidatorAttributeObserver();const owner=this.ownerDocument.defaultView,MutationObserverCtor=owner?.MutationObserver;if(!this.isConnected||!owner||typeof MutationObserverCtor!="function")return;const attributes=new Set;for(const validator of Array.isArray(this.validators)?this.validators:[]){if(typeof validator!="object"||validator===null||!("checkValidity"in validator))continue;let observed;try{observed=validator.observedAttributes}catch{continue}if(Array.isArray(observed))for(const name of observed)typeof name=="string"&&name.length>0&&attributes.add(name)}if(attributes.size===0)return;const binding={},observer=new MutationObserverCtor(()=>{this.validatorAttributeObserver!==binding||!this.isConnected||this.ownerDocument.defaultView!==owner||(this.updateValidity(),this.validityRevision++)});binding.observer=observer,binding.owner=owner;try{observer.observe(this,{attributes:!0,attributeFilter:[...attributes]}),this.validatorAttributeObserver=binding}catch{observer.disconnect()}}disconnectValidatorAttributeObserver(){const binding=this.validatorAttributeObserver;this.validatorAttributeObserver=void 0,binding?.observer.disconnect()}updateValidity(){if(this.barredFromValidation){this.validityController.setValidity({}),this.syncCustomStates();return}const flags={};let message="";this.required&&this._selected.length===0&&(flags.valueMissing=!0,message=this.localize("comboboxRequired"));const configured=this.validatorResult();configured.flags&&Object.assign(flags,configured.flags),configured.message&&(message=configured.message),this.validityController.setValidity(flags,message),this.syncCustomStates()}syncCustomStates(){syncValidityStates(this.internals,{required:this.required,hasInteracted:this.touched,barred:this.barredFromValidation}),setCustomState(this.internals,"blank",this._selected.length===0),setCustomState(this.internals,"disabled",this.effectiveDisabled)}syncFormValue(){const state2=JSON.stringify(this._selected);if(this.multiple){if(!this.name){this.internals.setFormValue(null,state2);return}const fd=new FormData;for(const v of this._selected)fd.append(this.name,v);this.internals.setFormValue(fd,state2)}else this.internals.setFormValue(this._selected[0]??"",state2)}get effectiveDisabled(){return this.disabled||this._fieldsetDisabled}formResetCallback(){this.touched=!1,this._restoredStateActive=!1,this._valueDirty=!1;const resetValues=this._defaultSelected.length>0?this._defaultSelected:this.options.filter(option=>wasOptionInitiallySelected(option)).map(option=>option.value);this._defaultSelected.length===0&&resetValues.length>0&&(this._defaultSelected=[...resetValues]);const defaults=new Set(resetValues);for(const option of this.options)option[RESET_OPTION_SELECTED_FROM_OWNER](defaults.has(option.value));this.setValue(this.multiple?[...resetValues]:resetValues[0]??"",!1),this.query="",this.explicitInputValue=!1}formStateRestoreCallback(state2,reason){let selected=[];if(typeof state2=="string")try{const parsed=JSON.parse(state2);Array.isArray(parsed)&&parsed.every(value=>typeof value=="string")&&(selected=parsed)}catch{}this.value=this.multiple?selected:selected[0]??"",this._restoredStateActive=!0}formDisabledCallback(disabled){this._fieldsetDisabled=disabled,disabled&&this.hide(),this.updateValidity(),this.requestUpdate()}checkValidity(){return this.updateValidity(),this.internals.checkValidity()}reportValidity(){return this.touched=!0,this.updateValidity(),this.syncCustomStates(),this.internals.reportValidity()}setCustomValidity(message){this.validityController.setCustomValidity(message??""),this.syncCustomStates()}disconnectedCallback(){this.transitionToken++,this.releaseSourceErrorAnnouncementSink(),this.disconnectValidatorAttributeObserver(),super.disconnectedCallback(),this.cleanup?.(),this.cleanup=void 0,this.clearSourceTimer(),this.sourceToken+=1,this.sourceAbort?.abort(),this.sourceAbort=void 0,this.overlayHandle?.deactivate({restoreFocus:!1}),this.overlayHandle=void 0,this.unbindDocumentPointer(),this.resolveTransitionWaiters("lr-after-show"),this.resolveTransitionWaiters("lr-after-hide"),this.open=!1}refreshOptionDefaults(){const declared=this.options.filter(option=>option.defaultSelected).map(option=>option.value);this._defaultSelected=this.multiple?declared:declared.slice(0,1),!this._valueDirty&&!this._restoredStateActive&&this.setValue(this.multiple?[...this._defaultSelected]:this._defaultSelected[0]??"",!1)}reflectSelected(){const sel=new Set(this._selected);for(const option of this.options)option[SET_OPTION_SELECTED_FROM_OWNER](sel.has(option.value))}labelFor(value){return this._selectedLabelCache.get(value)??this.options.find(o=>o.value===value)?.label??this.asyncRows.find(r=>r.value===value)?.label??value}adornmentsFor(option){const cached=this.adornmentClones.get(option);if(cached)return cached;const cloneSlot=selector=>{const nodes=Array.from(option.querySelectorAll(selector));if(nodes.length!==0)return nodes.map(node=>node.cloneNode(!0))},resolved={start:cloneSlot(':scope > [slot="start"], :scope > [slot="prefix"]'),end:cloneSlot(':scope > [slot="end"], :scope > [slot="suffix"]')};return this.adornmentClones.set(option,resolved),resolved}get effectiveRows(){return this.source?this.asyncRows:this.filtered.map(o=>{const adornments=this.adornmentsFor(o);return{value:o.value,label:o.label,sub:o.sub||void 0,dotColor:o.dotColor||void 0,group:o.group||void 0,disabled:o.disabled,...adornments.start===void 0?{}:{start:adornments.start},...adornments.end===void 0?{}:{end:adornments.end}}})}get createRow(){if(!this.allowCreate)return;const inputValue=this.query.trim();if(!inputValue)return;const locale=this.effectiveLocale,folded=inputValue.toLocaleLowerCase(locale);if(!(this.source?this.asyncRows:this.options.map(option=>({value:option.value,label:option.label}))).some(row=>row.value.toLocaleLowerCase(locale)===folded||row.label.toLocaleLowerCase(locale)===folded))return{value:inputValue,label:this.localize("comboboxCreate",void 0,{value:inputValue}),createInput:inputValue}}get renderedRows(){const all=this.effectiveRows,create=this.createRow,sourceOverflow=this.source?Math.max(0,this._sourceTotal-all.length):0;if(all.length<=this.maxRender)return{rows:create?[...all,create]:all,overflow:sourceOverflow};const originalIndex=new Map(all.map((r,i)=>[r,i])),capped=all.slice(0,this.maxRender),cappedValues=new Set(capped.map(r=>r.value));let appendedOutOfCap=!1;for(const v of this._selected)if(!cappedValues.has(v)){const selectedRow=all.find(r=>r.value===v);selectedRow&&(capped.push(selectedRow),appendedOutOfCap=!0)}return appendedOutOfCap&&capped.sort((a,b)=>originalIndex.get(a)-originalIndex.get(b)),create&&capped.push(create),{rows:capped,overflow:all.length-capped.length+(create?1:0)+sourceOverflow}}normalizeActiveIndex(){if(this.activeIndex<0)return;const navigableCount=this.renderedRows.rows.filter(row=>!row.disabled).length,next=navigableCount>0?Math.min(this.activeIndex,navigableCount-1):-1;next!==this.activeIndex&&(this.activeIndex=next)}get filtered(){const locale=this.effectiveLocale,q=this.query.trim().toLocaleLowerCase(locale),selectedLabel=this.multiple?"":this.labelFor(this._selected[0]??"")??"",effective=q&&q===selectedLabel.toLocaleLowerCase(locale)?"":q;if(!effective)return this.options;const fn=this.filter??((o,query2)=>o.label.toLocaleLowerCase(locale).includes(query2)||o.searchText.toLocaleLowerCase(locale).includes(query2));return this.options.filter(o=>fn(o,effective))}get displayValue(){return this.multiple||this.open||this.explicitInputValue?this.query:this._selected[0]?this.labelFor(this._selected[0]):""}announceOpenTransition(changed){if(this.openVetoed=!1,!changed.has("open")||this._isFirstUpdate)return;const name=this.open?"lr-show":"lr-hide";if(!this.isConnected){this.emit("lr-hide");return}this.emit(name,null,{cancelable:!0}).defaultPrevented&&(this.openVetoed=!0,this.open=!this.open,this.resolveTransitionWaiters(this.open?"lr-after-hide":"lr-after-show"))}show(){if(this.open||this.liveDisabled)return Promise.resolve();this.resolveTransitionWaiters("lr-after-hide");const settled=this.waitForTransition("lr-after-show");return this.open=!0,settled}hide(){if(!this.open)return Promise.resolve();this.resolveTransitionWaiters("lr-after-show");const settled=this.waitForTransition("lr-after-hide");return this.closeCleanupPending=!0,this.open=!1,settled}finalizeCloseState(){if(this.closeCleanupPending&&(this.closeCleanupPending=!1,this.activeIndex=-1,!this.multiple)){const queryChanged=this.query!=="";this.query="",this.explicitInputValue=!1,queryChanged&&this.source&&(this.asyncRows=[],this.sourceFailed=!1,this._sourceTotal=0,this._sourceTruncated=!1)}}activateListboxOverlay(){this.cleanup?.(),this.cleanup=void 0,this.overlayHandle?.deactivate({restoreFocus:!1}),this.restoreFocusOnClose=!0,this.overlayHandle=activateOverlay({host:this,panel:()=>this.renderRoot.querySelector('[part="listbox"]'),onEscape:()=>{this.hide()},onBackdrop:()=>{this.restoreFocusOnClose=!1,this.hide()},restoreFocusTo:this.inputEl??null,modal:!1,trapFocus:!1}),this.bindDocumentPointer();const anchor=this.renderRoot.querySelector('[part="combobox"]'),listbox=this.renderRoot.querySelector('[part="listbox"]');anchor&&listbox&&(this.cleanup=place(anchor,listbox,{placement:`${this.placement}-start`}))}teardownListboxOverlay(restoreFocus=this.restoreFocusOnClose){this.cleanup?.(),this.cleanup=void 0,this.restoringOverlayFocus=restoreFocus;try{this.overlayHandle?.deactivate({restoreFocus})}finally{this.restoringOverlayFocus=!1}this.overlayHandle=void 0,this.unbindDocumentPointer(),this.restoreFocusOnClose=!0}bindDocumentPointer(){if(!this.isConnected)return;const ownerDocument=this.ownerDocument;if(this.pointerListenerDocument===ownerDocument&&this.pointerListener)return;this.unbindDocumentPointer();const listener=event=>{this.pointerListener!==listener||this.pointerListenerDocument!==ownerDocument||!this.isConnected||this.ownerDocument!==ownerDocument||this.onDocPointer(event)};this.pointerListenerDocument=ownerDocument,this.pointerListener=listener,ownerDocument.addEventListener("pointerdown",listener,!0)}unbindDocumentPointer(){this.pointerListenerDocument&&this.pointerListener&&this.pointerListenerDocument.removeEventListener("pointerdown",this.pointerListener,!0),this.pointerListenerDocument=void 0,this.pointerListener=void 0}reconnectOpenPopup(){!this.isConnected||!this.open||(this.activateListboxOverlay(),this.source&&this.asyncRows.length===0&&this.runSource(this.query))}syncVisibleOptionsCap(){const listbox=this.renderRoot?.querySelector('[part="listbox"]');if(!listbox)return;const clear=()=>{listbox.style.removeProperty("max-block-size")},requested=typeof this.visibleOptions=="number"?finiteCount(this.visibleOptions,0):0;if(requested<=0)return clear();const rows=listbox.querySelectorAll('[part="option"]');if(rows.length<=requested)return clear();const boundary=rows[requested];if(!boundary)return clear();const cap=boundary.getBoundingClientRect().top-listbox.getBoundingClientRect().top;if(!Number.isFinite(cap)||cap<=0)return clear();listbox.style.setProperty("max-block-size",`min(${Math.ceil(cap)}px, var(--lr-positioner-available-block-size, var(--lr-size-18rem)))`)}updated(changed){super.updated(changed),this.syncVisibleOptionsCap(),changed.has("open")&&!this.openVetoed?this.open&&this.isConnected?(this.activateListboxOverlay(),this._isFirstUpdate||this.settleTransition("lr-after-show"),this.source&&this.asyncRows.length===0&&this.runSource(this.query)):this.open?this.teardownListboxOverlay(!1):(this.teardownListboxOverlay(),this._isFirstUpdate||this.settleTransition("lr-after-hide")):changed.has("open")&&this.openVetoed&&(this.restoreFocusOnClose=!0),changed.has("name")&&this.syncFormValue(),changed.has("validators")&&(this.updateValidity(),this.syncValidatorAttributeObserver()),(changed.has("touched")||changed.has("required")||changed.has("value")||changed.has("validators")||changed.has("validityRevision"))&&this.toggleAttribute("data-invalid",this.touched&&!this.internals.validity.valid),changed.has("activeIndex")&&this.renderRoot.querySelector('[part="option"][data-active]')?.scrollIntoView({block:"nearest"})}async settleTransition(event){const token=++this.transitionToken;if(await this.updateComplete,this.transitionToken===token){if(this.isConnected){const view=this.ownerDocument.defaultView;if(view&&await new Promise(resolve=>view.requestAnimationFrame(()=>resolve())),this.transitionToken!==token)return;const animations=this.renderRoot.querySelector('[part="listbox"]')?.getAnimations({subtree:!0})??[];if(await Promise.all(animations.map(animation=>animation.finished.catch(()=>{}))),this.transitionToken!==token)return}this.emit(event),this.resolveTransitionWaiters(event)}}waitForTransition(event){return new Promise(resolve=>{const waiters=this.transitionWaiters.get(event)??new Set;waiters.add(resolve),this.transitionWaiters.set(event,waiters)})}resolveTransitionWaiters(event){const waiters=this.transitionWaiters.get(event);if(waiters){this.transitionWaiters.delete(event);for(const resolve of waiters)resolve()}}emitValueEvents(){this.emit("input",{value:this.value}),this.emit("change",{value:this.value}),this.emit("lr-change",{value:this.value})}createOption(inputValue){if(this.liveDisabled||this.emit("lr-create",{inputValue},{cancelable:!0}).defaultPrevented)return;const option=this.ownerDocument.createElement(tag("option"));option.setAttribute("value",inputValue),option.textContent=inputValue,this.append(option),this.pickRow({value:inputValue,label:inputValue})}commitCustomValue(inputValue){if(this.liveDisabled||this.multiple||!inputValue)return;const selectionChanged=this._selected[0]!==inputValue;this._selectedLabelCache.set(inputValue,inputValue),this.value=inputValue,this.query="",this.explicitInputValue=!1,this.hide(),selectionChanged&&this.emitValueEvents()}pickRow(row){if(this.liveDisabled||row.disabled)return;if(row.createInput!==void 0){this.createOption(row.createInput);return}const selectionChanged=this.multiple||this._selected[0]!==row.value;if(this.multiple){const set=new Set(this._selected);set.has(row.value)?(set.delete(row.value),this._selectedRowCache.delete(row.value)):(set.add(row.value),this._selectedLabelCache.set(row.value,row.label),this._selectedRowCache.set(row.value,row)),this.value=[...set],this.query="",this.explicitInputValue=!1}else this._selectedLabelCache.set(row.value,row.label),this._selectedRowCache.clear(),this._selectedRowCache.set(row.value,row),this.value=row.value,this.query="",this.explicitInputValue=!1,this.hide();this.source&&this.runSource(this.query),selectionChanged&&this.emitValueEvents()}removeValue(value){if(this.liveDisabled)return;const next=this._selected.filter(v=>v!==value);next.length!==this._selected.length&&(this.value=next,this.emitValueEvents())}clear(){if(this.liveDisabled)return;const hadSelection=this._selected.length>0,queryChanged=this.query!=="";!hadSelection&&!queryChanged||(hadSelection&&(this.value=[]),this.query="",this.explicitInputValue=!1,this.source&&this.runSource(this.query),hadSelection&&(this.emitValueEvents(),this.emit("lr-clear")),queryChanged&&this.emit("lr-filter",{value:this.query}))}runSource(query2){const source=this.source;if(!source)return;this.clearSourceTimer(),this.sourceAbort?.abort(),this.sourceAbort=void 0;const token=++this.sourceToken,ownerWindow=this.ownerDocument.defaultView;if(!this.isConnected||!ownerWindow)return;const timer={owner:ownerWindow,handle:0,token};timer.handle=ownerWindow.setTimeout(()=>{if(this.sourceTimer!==timer||token!==this.sourceToken||!this.isConnected||this.ownerDocument.defaultView!==ownerWindow)return;this.sourceTimer=void 0;const controller=new ownerWindow.AbortController;this.sourceAbort=controller,this.loading=!0,this.sourceFailed=!1,Promise.resolve().then(()=>source(query2,{signal:controller.signal,limit:MAX_SOURCE_ROWS})).then(result=>{if(token!==this.sourceToken||!this.isConnected||this.ownerDocument.defaultView!==ownerWindow)return;const normalized=normalizeSourceResult(result);this._sourceTotal=normalized.total,this._sourceTruncated=normalized.truncated,this.asyncRows=normalized.rows,this.sourceFailed=!1,this.normalizeActiveIndex();const selected=new Set(this._selected);for(const row of normalized.rows)selected.has(row.value)&&this._selectedRowCache.set(row.value,row)}).catch(err=>{token!==this.sourceToken||!this.isConnected||this.ownerDocument.defaultView!==ownerWindow||typeof err=="object"&&err!==null&&"name"in err&&err.name==="AbortError"||(this.asyncRows=[],this._sourceTotal=0,this._sourceTruncated=!1,this.activeIndex=-1,this.sourceFailed=!0,this.sourceErrorAnnouncementSink?.announce(this.localize("comboboxLoadError")),console.warn("<lr-combobox> source() rejected:",err))}).finally(()=>{token===this.sourceToken&&(this.loading=!1)})},this._sourceDelay),this.sourceTimer=timer}clearSourceTimer(){const timer=this.sourceTimer;this.sourceTimer=void 0,timer&&timer.owner.clearTimeout(timer.handle)}renderRows(rows,activeId){const out=[];let currentGroup,currentGroupRows=[],groupIndex=0;const selectedSet=new Set(this._selected),flushGroup=()=>{if(currentGroupRows.length){if(currentGroup){const labelId=`${this.listId}-group-${groupIndex++}`;out.push(html`<div role="group" aria-labelledby=${labelId}>
2
2
  <div id=${labelId} part="group-label" class="group-label">${currentGroup}</div>
3
3
  ${currentGroupRows}
4
4
  </div>`)}else out.push(...currentGroupRows);currentGroupRows=[]}};return rows.forEach((o,i)=>{o.group!==currentGroup&&(flushGroup(),currentGroup=o.group);const id=`${this.listId}-opt-${i}`,selected=selectedSet.has(o.value);currentGroupRows.push(html`<div
@@ -12,6 +12,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
12
12
  aria-label=${o.accessibleLabel||nothing}
13
13
  ?data-active=${id===activeId}
14
14
  >
15
+ ${o.start?renderInertPresentation(o.start,{part:"option-start"}):""}
15
16
  ${o.icon?renderInertPresentation(o.icon,{part:"option-icon"}):""}
16
17
  ${o.dotColor?html`<span
17
18
  part="option-dot"
@@ -22,6 +23,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
22
23
  ${o.sub?html`<span part="option-sub">${o.sub}</span>`:""}
23
24
  </span>
24
25
  ${o.badge!=null?html`<span part="option-badge">${o.badge}</span>`:""}
26
+ ${o.end?renderInertPresentation(o.end,{part:"option-end"}):""}
25
27
  </div>`)}),flushGroup(),out}renderTag(value,index){const option=this.options.find(candidate=>candidate.value===value);if(this.getTag&&option)return this.getTag(option,index);const label=this.labelFor(value);return html`<span part="tag">
26
28
  <span part="tag-label"><span part="tag__content">${label}</span></span>
27
29
  <button
@@ -57,7 +59,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
57
59
  id=${this.inputId}
58
60
  part="combobox-input"
59
61
  role="combobox"
60
- aria-label=${this.getAttribute("aria-label")||(hasLabel?nothing:this.placeholder||this.localize("comboboxLabel"))}
62
+ aria-label=${hostAriaLabel(this)??(hasLabel?nothing:this.placeholder||this.localize("comboboxLabel"))}
61
63
  aria-describedby=${describedBy||nothing}
62
64
  aria-expanded=${this.open?"true":"false"}
63
65
  aria-controls=${this.listId}
@@ -132,4 +134,4 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
132
134
  @lr-option-change=${this.onOptionChange}
133
135
  hidden
134
136
  ></slot>
135
- `}}__decorate([property()],LyraCombobox.prototype,"placeholder",void 0),__decorate([property()],LyraCombobox.prototype,"label",void 0),__decorate([property()],LyraCombobox.prototype,"hint",void 0),__decorate([property({attribute:"error-text"})],LyraCombobox.prototype,"errorText",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraCombobox.prototype,"open",null),__decorate([property({type:Boolean,attribute:"allow-create"})],LyraCombobox.prototype,"allowCreate",void 0),__decorate([property({type:Boolean,attribute:"allow-custom-value"})],LyraCombobox.prototype,"allowCustomValue",void 0),__decorate([property({reflect:!0})],LyraCombobox.prototype,"appearance",void 0),__decorate([property({reflect:!0})],LyraCombobox.prototype,"placement",void 0),__decorate([property({reflect:!0})],LyraCombobox.prototype,"size",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraCombobox.prototype,"pill",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraCombobox.prototype,"clearable",void 0),__decorate([property({type:Boolean,attribute:"with-clear"})],LyraCombobox.prototype,"withClear",void 0),__decorate([property({type:Boolean,attribute:"with-label"})],LyraCombobox.prototype,"withLabel",void 0),__decorate([property({type:Boolean,attribute:"with-hint"})],LyraCombobox.prototype,"withHint",void 0),__decorate([property({attribute:!1})],LyraCombobox.prototype,"getTag",void 0),__decorate([property({attribute:!1})],LyraCombobox.prototype,"validators",void 0),__decorate([property()],LyraCombobox.prototype,"autocomplete",void 0),__decorate([property({attribute:"inputmode"})],LyraCombobox.prototype,"inputMode",void 0),__decorate([property({attribute:"enterkeyhint"})],LyraCombobox.prototype,"enterKeyHint",void 0),__decorate([property({converter:comboboxSpellcheckConverter,useDefault:!0})],LyraCombobox.prototype,"spellcheck",void 0),__decorate([property()],LyraCombobox.prototype,"autocapitalize",void 0),__decorate([property({attribute:"empty-text"})],LyraCombobox.prototype,"emptyText",void 0),__decorate([property({attribute:"loading-text"})],LyraCombobox.prototype,"loadingText",void 0),__decorate([property({attribute:"overflow-text"})],LyraCombobox.prototype,"overflowText",void 0),__decorate([property({attribute:!1})],LyraCombobox.prototype,"filter",void 0),__decorate([property({attribute:!1})],LyraCombobox.prototype,"source",void 0),__decorate([property({converter:autocorrectConverter})],LyraCombobox.prototype,"autocorrect",null),__decorate([state()],LyraCombobox.prototype,"query",void 0),__decorate([state()],LyraCombobox.prototype,"activeIndex",void 0),__decorate([state()],LyraCombobox.prototype,"options",void 0),__decorate([state()],LyraCombobox.prototype,"touched",void 0),__decorate([state()],LyraCombobox.prototype,"validityRevision",void 0),__decorate([state()],LyraCombobox.prototype,"loading",void 0),__decorate([state()],LyraCombobox.prototype,"sourceFailed",void 0),__decorate([state()],LyraCombobox.prototype,"asyncRows",void 0),__decorate([query('[part="combobox-input"]')],LyraCombobox.prototype,"inputEl",void 0);export{LyraCombobox};
137
+ `}}__decorate([property()],LyraCombobox.prototype,"placeholder",void 0),__decorate([property()],LyraCombobox.prototype,"label",void 0),__decorate([property()],LyraCombobox.prototype,"hint",void 0),__decorate([property({attribute:"error-text"})],LyraCombobox.prototype,"errorText",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraCombobox.prototype,"open",null),__decorate([property({type:Boolean,attribute:"allow-create"})],LyraCombobox.prototype,"allowCreate",void 0),__decorate([property({type:Boolean,attribute:"allow-custom-value"})],LyraCombobox.prototype,"allowCustomValue",void 0),__decorate([property({reflect:!0})],LyraCombobox.prototype,"appearance",void 0),__decorate([property({reflect:!0})],LyraCombobox.prototype,"placement",void 0),__decorate([property({reflect:!0})],LyraCombobox.prototype,"size",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraCombobox.prototype,"pill",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraCombobox.prototype,"clearable",void 0),__decorate([property({type:Boolean,attribute:"with-clear"})],LyraCombobox.prototype,"withClear",void 0),__decorate([property({type:Boolean,attribute:"with-label"})],LyraCombobox.prototype,"withLabel",void 0),__decorate([property({type:Boolean,attribute:"with-hint"})],LyraCombobox.prototype,"withHint",void 0),__decorate([property({attribute:!1})],LyraCombobox.prototype,"getTag",void 0),__decorate([property({attribute:!1})],LyraCombobox.prototype,"validators",void 0),__decorate([property()],LyraCombobox.prototype,"autocomplete",void 0),__decorate([property({attribute:"inputmode"})],LyraCombobox.prototype,"inputMode",void 0),__decorate([property({attribute:"enterkeyhint"})],LyraCombobox.prototype,"enterKeyHint",void 0),__decorate([property({converter:comboboxSpellcheckConverter,useDefault:!0})],LyraCombobox.prototype,"spellcheck",void 0),__decorate([property()],LyraCombobox.prototype,"autocapitalize",void 0),__decorate([property({attribute:"empty-text"})],LyraCombobox.prototype,"emptyText",void 0),__decorate([property({attribute:"loading-text"})],LyraCombobox.prototype,"loadingText",void 0),__decorate([property({attribute:"overflow-text"})],LyraCombobox.prototype,"overflowText",void 0),__decorate([property({attribute:!1})],LyraCombobox.prototype,"filter",void 0),__decorate([property({attribute:!1})],LyraCombobox.prototype,"source",void 0),__decorate([property({converter:autocorrectConverter})],LyraCombobox.prototype,"autocorrect",null),__decorate([state()],LyraCombobox.prototype,"query",void 0),__decorate([state()],LyraCombobox.prototype,"activeIndex",void 0),__decorate([state()],LyraCombobox.prototype,"options",void 0),__decorate([state()],LyraCombobox.prototype,"touched",void 0),__decorate([state()],LyraCombobox.prototype,"validityRevision",void 0),__decorate([state()],LyraCombobox.prototype,"loading",void 0),__decorate([state()],LyraCombobox.prototype,"sourceFailed",void 0),__decorate([state()],LyraCombobox.prototype,"asyncRows",void 0),__decorate([query('[part="combobox-input"]')],LyraCombobox.prototype,"inputEl",void 0),__decorate([property({type:Number,attribute:"visible-options"})],LyraCombobox.prototype,"visibleOptions",void 0);export{LyraCombobox};
@@ -1,49 +1,28 @@
1
1
  import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/form-control.styles.js";const styles=css`
2
2
  :host {
3
3
  display: block;
4
- /* Two-value shorthand, block axis first. Only the INLINE half is this component's own per-tier
5
- geometry; the BLOCK half is the shared ladder's --lr-form-control-padding-block at every tier,
6
- because that axis is the one the trigger's height floor has to pay for -- see the
7
- [part='combobox'] comment below. */
8
4
  --_lr-combobox-trigger-padding: var(--lr-form-control-padding-block)
9
5
  var(--lr-space-s);
10
- /* Height and text size come from the ONE shared form-control ladder (internal/sizes.styles.ts)
11
- rather than a sixth private copy of the same six values. The ladder matches both spellings of
12
- every tier in one selector list, so size="small" and size="s" resolve identically here with
13
- no per-component alias rules. */
14
6
  --_lr-combobox-trigger-min-height: var(--lr-form-control-height);
15
7
  --_lr-combobox-font-size: var(--lr-form-control-font-size);
16
8
  --_lr-combobox-tag-padding: var(--lr-size-0-1rem) var(--lr-size-0-4rem);
17
9
  --_lr-combobox-tag-font-size: var(--lr-font-size-sm);
18
10
  --_lr-combobox-expand-size: var(--lr-size-1-75rem);
19
- /* Gap and radius don't vary by size tier (unlike the knobs above), so each is declared once
20
- here rather than re-assigned per :host([size='…']) block -- mirrors lr-button's identical
21
- --lr-button-gap/--lr-button-radius. */
22
11
  --_lr-combobox-gap: var(--lr-space-xs);
23
12
  --_lr-combobox-radius: var(--lr-form-control-radius);
24
- /* --lr-combobox-trigger-height is intentionally NOT declared here. It is a consumer-facing
25
- escape hatch consumed only through the two var() fallbacks on [part='combobox'] below;
26
- declaring any value for it (even 'auto') would make those fallback arms unreachable and
27
- silently turn --lr-combobox-trigger-min-height into dead code. Left undeclared, both arms
28
- stay live: the per-tier floor falls out of the fallback with no extra specificity rules, and
29
- setting the property from anywhere (inline style, an ancestor, an outer-tree rule) pins an
30
- exact height. */
13
+ --_lr-combobox-fill: var(--lr-color-surface);
14
+ --_lr-combobox-border-color: var(--lr-color-border);
31
15
  }
32
16
  :host([pill]) {
33
17
  --_lr-combobox-radius: var(--lr-radius-pill);
34
18
  }
35
- :host([appearance="filled"]) [part="combobox"] {
36
- background: var(--lr-color-surface-raised);
37
- border-color: transparent;
19
+ :host([appearance="filled"]) {
20
+ --_lr-combobox-fill: var(--lr-color-surface-raised);
21
+ --_lr-combobox-border-color: transparent;
38
22
  }
39
- :host([appearance="filled-outlined"]) [part="combobox"] {
40
- background: var(--lr-color-surface-raised);
23
+ :host([appearance="filled-outlined"]) {
24
+ --_lr-combobox-fill: var(--lr-color-surface-raised);
41
25
  }
42
- /* What remains per tier is this component's OWN geometry -- the selected-tag chip and the
43
- decorative expand glyph -- which is not a form-control height/text ladder and so is not part of
44
- the shared one. Each tier matches both spellings for the same reason sizes.styles.ts does: the
45
- shared ladder accepts size="small", and a control whose tags silently ignored it would be worse
46
- than one that never accepted it. */
47
26
  :host([size="2xs"]) {
48
27
  --_lr-combobox-trigger-padding: var(--lr-form-control-padding-block)
49
28
  var(--lr-space-2xs);
@@ -85,25 +64,11 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
85
64
  font-size: var(--lr-font-size-md-sm);
86
65
  font-weight: var(--lr-font-weight-semibold);
87
66
  }
88
- /* :empty never matches here -- the part always contains a literal slot
89
- child element regardless of assigned/text content -- so real emptiness
90
- is tracked by SlotPresenceController and reflected via the hidden attribute
91
- instead (same fix as [part='hint']/[part='error'] below). Without this,
92
- the required-asterisk ::after below (which attaches to this box)
93
- renders a stray ' *' with nothing before it whenever label is unset. */
94
67
  [part="form-control-label"][hidden] {
95
68
  display: none;
96
69
  }
97
70
  ${formControlRequiredMarker}
98
71
 
99
- /* min-block-size is a FLOOR on a border-box, so it only decides the rendered height while this
100
- row's own content stays under it -- and that content includes the search input, whose text box
101
- is line-height: normal, i.e. a metric of whatever font family the ambient stack resolves to. Two
102
- machines resolve system-ui to different fonts, so any tier whose content sits at or above the
103
- floor renders a different height on each of them. Keeping the block padding on the shared
104
- ladder (and zeroing the input's UA block padding below) is what holds the content under the
105
- floor at every tier, which is what makes this trigger line up with lr-input/lr-select/lr-button
106
- in a toolbar row -- the promise sizes.styles.ts makes. */
107
72
  [part='combobox'] {
108
73
  display: flex;
109
74
  flex-wrap: wrap;
@@ -118,16 +83,14 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
118
83
  )
119
84
  );
120
85
  box-sizing: border-box;
121
- /* Pinned only when --lr-combobox-trigger-height is set; 'auto' otherwise, so the row keeps
122
- growing to fit its own content (and, in multiple mode, a wrapping tag row). */
123
86
  block-size: var(--lr-combobox-trigger-height, auto);
124
87
  padding: var(
125
88
  --lr-combobox-trigger-padding,
126
89
  var(--_lr-combobox-trigger-padding)
127
90
  );
128
- border: var(--lr-border-width-thin) solid var(--lr-color-border);
91
+ border: var(--lr-border-width-thin) solid var(--_lr-combobox-border-color);
129
92
  border-radius: var(--lr-combobox-radius, var(--_lr-combobox-radius));
130
- background: var(--lr-color-surface);
93
+ background: var(--_lr-combobox-fill);
131
94
  font-size: var(--lr-combobox-font-size, var(--_lr-combobox-font-size));
132
95
  cursor: text;
133
96
  }
@@ -136,8 +99,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
136
99
  outline: var(--lr-border-width-medium) solid transparent;
137
100
  }
138
101
  :host(:disabled) [part="combobox"] {
139
- /* was a literal 0.5; now the shared library-wide disabled-state token
140
- (still 0.5 by default fallback, so no visual change here). */
141
102
  opacity: var(--lr-opacity-disabled);
142
103
  cursor: not-allowed;
143
104
  }
@@ -179,17 +140,9 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
179
140
  [part="tag-label"] {
180
141
  min-inline-size: 0;
181
142
  overflow: hidden;
182
- overflow-wrap: anywhere;
183
143
  text-overflow: ellipsis;
144
+ white-space: nowrap;
184
145
  }
185
- /* Same compact-chip-remove pattern as lr-chip's [part='remove-button']: the interactive hit
186
- target meets the shared --lr-icon-button-size floor, while the visible glyph stays a
187
- compact 1rem close icon (font-size: var(--lr-font-size-m), independent of the tag's own
188
- --lr-combobox-tag-font-size, which shrinks well below that at size="xs"/"s") -- a selected
189
- tag is a small inline pill, so growing its whole box to 40px would visually balloon the tags
190
- row. The negative margin pulls the enlarged hit area back in so the *visible* tag footprint
191
- is unchanged; it overlaps into the tag's own padding/background rather than expanding the
192
- row's layout box. */
193
146
  [part="tag__remove-button"] {
194
147
  display: inline-flex;
195
148
  align-items: center;
@@ -209,10 +162,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
209
162
  [part="combobox-input"] {
210
163
  flex: 1 1 var(--lr-size-6ch);
211
164
  min-inline-size: var(--lr-size-4ch);
212
- /* 0, not the UA's own 1px default -- same neutralisation lr-input applies to its [part='input'].
213
- The trigger row above already owns this control's block padding; leaving the UA's on as well
214
- spent two more pixels of the height floor's budget at every tier, which is what used to push
215
- the dense tiers over their floor and hand the rendered height to the ambient font. */
216
165
  padding-block: 0;
217
166
  border: none;
218
167
  outline: none;
@@ -238,11 +187,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
238
187
  padding: var(--lr-space-xs);
239
188
  line-height: var(--lr-line-height-none);
240
189
  }
241
- /* [part='expand-icon'] is a decorative aria-hidden dropdown indicator, not an independently
242
- clickable target of its own -- the whole [part='combobox'] row opens the listbox via
243
- onComboMouseDown, so this keeps its existing compact box rather than the interactive floor
244
- below (which would force every size variant's trigger row taller just to fit a glyph nobody
245
- taps directly). */
246
190
  [part="expand-icon"] {
247
191
  box-sizing: border-box;
248
192
  min-inline-size: min(
@@ -255,9 +199,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
255
199
  );
256
200
  padding: 0;
257
201
  }
258
- /* Unlike [part='expand-icon'], [part='clear-button'] is a real, independently-focusable
259
- <button> (see combobox.class.ts's @click) -- it gets the full shared icon-button hit-area
260
- floor instead of the capped box above. */
261
202
  [part="clear-button"] {
262
203
  min-inline-size: var(--lr-icon-button-size);
263
204
  min-block-size: var(--lr-icon-button-size);
@@ -265,15 +206,9 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
265
206
  [part="expand-icon"] svg {
266
207
  transform: rotate(90deg);
267
208
  }
268
- /* Mirrors <lr-input>'s own [part='clear-button']:hover -- darkens the same quiet-to-full text
269
- token step so mouse users get the same "this is interactive" feedback keyboard users already
270
- get from the focus ring below. */
271
209
  [part="clear-button"]:hover {
272
210
  color: var(--lr-color-text);
273
211
  }
274
- /* Pressed adds what hover cannot: hover has already spent the colour step (quiet -> full text),
275
- so the press is a background pad mixed off the row's own surface. Stronger than hover by
276
- construction -- --lr-color-mix-active is the larger of the two shared knobs. */
277
212
  [part="clear-button"]:active {
278
213
  background: color-mix(
279
214
  in oklab,
@@ -282,14 +217,9 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
282
217
  );
283
218
  border-radius: var(--lr-radius);
284
219
  }
285
- /* Mirrors <lr-chip>'s own [part='remove-button']:hover -- a currentColor-derived tint rather
286
- than a fixed token, since this part's rest-state color is 'inherit' (the tag's own text
287
- color), not a dedicated quiet token to darken. */
288
220
  [part="tag__remove-button"]:hover {
289
221
  background: color-mix(in srgb, currentColor 16%, transparent);
290
222
  }
291
- /* Same currentColor idiom as the hover above (this part's rest color is the tag's inherited text
292
- color, not a token), taken to the shared pressed strength -- 22% against the hover's 16%. */
293
223
  [part="tag__remove-button"]:active {
294
224
  background: color-mix(
295
225
  in srgb,
@@ -327,11 +257,7 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
327
257
  background: var(--lr-color-surface);
328
258
  border: var(--lr-border-width-thin) solid var(--lr-color-border);
329
259
  border-radius: var(--lr-radius);
330
- /* Anchored overlay: a positioner-placed listbox floating over page content, not a modal layer. */
331
260
  box-shadow: var(--lr-shadow-m);
332
- /* Closed state: invisible + slightly raised. visibility (not
333
- display:none) so opacity/transform can actually transition; hit-testing
334
- and a11y exposure stay off since this part is already position:fixed. */
335
261
  visibility: hidden;
336
262
  opacity: 0;
337
263
  transform: translateY(var(--lr-size-neg-0-25rem));
@@ -373,6 +299,18 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
373
299
  text-align: start;
374
300
  cursor: pointer;
375
301
  }
302
+ [part="option"][aria-selected="true"] {
303
+ background: var(--lr-combobox-option-selected-bg, transparent);
304
+ border-color: var(
305
+ --lr-combobox-option-selected-border,
306
+ var(--lr-color-brand)
307
+ );
308
+ color: var(--lr-combobox-option-selected-color, var(--lr-color-brand));
309
+ font-weight: var(
310
+ --lr-combobox-option-selected-font-weight,
311
+ var(--lr-font-weight-semibold)
312
+ );
313
+ }
376
314
  [part="option"]:hover,
377
315
  [part="option"][data-active] {
378
316
  background: var(
@@ -380,9 +318,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
380
318
  var(--lr-color-brand-quiet)
381
319
  );
382
320
  }
383
- /* Mixing the hover tint itself (not the bare token) keeps a consumer who retinted
384
- --lr-combobox-option-active-bg in charge of both states: the pressed row is always their
385
- colour, one shared step further toward the text colour. */
386
321
  [part="option"]:active {
387
322
  background: color-mix(
388
323
  in oklab,
@@ -390,24 +325,7 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
390
325
  var(--lr-color-mix-partner) var(--lr-color-mix-active)
391
326
  );
392
327
  }
393
- [part="option"][aria-selected="true"] {
394
- /* Per-component indirection (inline var() fallbacks to the shared brand tokens, so unset
395
- rendering is byte-for-byte unchanged) -- so a consumer can retheme just the selected row
396
- without hijacking --lr-color-brand library-wide. */
397
- background: var(--lr-combobox-option-selected-bg, transparent);
398
- border-color: var(
399
- --lr-combobox-option-selected-border,
400
- var(--lr-color-brand)
401
- );
402
- color: var(--lr-combobox-option-selected-color, var(--lr-color-brand));
403
- font-weight: var(
404
- --lr-combobox-option-selected-font-weight,
405
- var(--lr-font-weight-semibold)
406
- );
407
- }
408
328
  [part="option"][aria-disabled="true"] {
409
- /* was a literal 0.4; unified with the rest of the library's single
410
- disabled-state opacity token (intentionally changes 0.4 -> 0.5). */
411
329
  opacity: var(--lr-opacity-disabled);
412
330
  cursor: not-allowed;
413
331
  }
@@ -424,6 +342,15 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
424
342
  flex: 0 0 auto;
425
343
  color: var(--lr-color-text-quiet);
426
344
  }
345
+ [part="option-start"],
346
+ [part="option-end"] {
347
+ display: inline-flex;
348
+ align-items: center;
349
+ justify-content: center;
350
+ flex: 0 0 auto;
351
+ max-inline-size: 40%;
352
+ overflow: hidden;
353
+ }
427
354
  [part="option-label"] {
428
355
  display: flex;
429
356
  flex-direction: column;
@@ -439,9 +366,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
439
366
  padding: 0 var(--lr-space-xs);
440
367
  border-radius: var(--lr-radius-pill);
441
368
  background: var(--lr-color-brand-quiet);
442
- /* Full-strength text, not the quiet tone: quiet-on-quiet measured 4.25:1, under WCAG 1.4.3's
443
- 4.5:1. The badge already reads as secondary from its size and its tinted pill; borrowing the
444
- muted text colour on top of a tinted fill was double de-emphasis that cost legibility. */
445
369
  color: var(--lr-color-text);
446
370
  font-size: var(--lr-font-size-xs);
447
371
  }
@@ -470,10 +394,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
470
394
  font-size: var(--lr-font-size-sm);
471
395
  color: var(--lr-color-text-quiet);
472
396
  }
473
- /* :empty never matches here -- the part always contains a literal
474
- slot child element regardless of assigned/text content -- so real
475
- emptiness is tracked by SlotPresenceController and reflected via
476
- the hidden attribute instead (same fix as lr-stat's icon/caption). */
477
397
  [part="hint"][hidden] {
478
398
  display: none;
479
399
  }
@@ -25,7 +25,13 @@ import{css}from"lit";const styles=css`
25
25
  background: var(--lr-option-hover-bg, var(--lr-color-brand-quiet));
26
26
  }
27
27
 
28
- [part~='base']:active {
28
+ :host(:state(current):state(hover)) [part~='base'],
29
+ :host(:state(current)) [part~='base']:hover {
30
+ background: var(--lr-option-hover-bg, var(--lr-color-brand-quiet));
31
+ }
32
+
33
+ [part~='base']:active,
34
+ :host(:state(current)) [part~='base']:active {
29
35
  background: var(
30
36
  --lr-option-active-bg,
31
37
  color-mix(