@aceshooting/lyra-ui 29.0.2 → 29.2.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 (528) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +20 -27
  3. package/design-tokens.json +1 -1
  4. package/dist/cli/migrate-wa.mjs +2 -0
  5. package/dist/components/agent-tools/activity-feed/activity-feed.class.d.ts +5 -3
  6. package/dist/components/agent-tools/activity-feed/activity-feed.class.js +4 -3
  7. package/dist/components/agent-tools/activity-feed/activity-feed.styles.js +1 -1
  8. package/dist/components/agent-tools/agent-trace/agent-trace.class.d.ts +21 -5
  9. package/dist/components/agent-tools/agent-trace/agent-trace.class.js +14 -11
  10. package/dist/components/agent-tools/agent-trace/agent-trace.styles.js +1 -1
  11. package/dist/components/agent-tools/confirm-bar/confirm-bar.class.js +2 -2
  12. package/dist/components/agent-tools/eval-dataset/eval-dataset.class.d.ts +34 -7
  13. package/dist/components/agent-tools/eval-dataset/eval-dataset.class.js +25 -11
  14. package/dist/components/agent-tools/eval-result/eval-result-source.js +1 -0
  15. package/dist/components/agent-tools/eval-result/eval-result.class.d.ts +31 -11
  16. package/dist/components/agent-tools/eval-result/eval-result.class.js +29 -15
  17. package/dist/components/agent-tools/eval-result/eval-result.styles.js +1 -1
  18. package/dist/components/agent-tools/eval-result/eval-run-result.d.ts +10 -0
  19. package/dist/components/agent-tools/span-waterfall/span-waterfall.class.d.ts +26 -5
  20. package/dist/components/agent-tools/span-waterfall/span-waterfall.class.js +16 -6
  21. package/dist/components/agent-tools/span-waterfall/span-waterfall.d.ts +1 -1
  22. package/dist/components/agent-tools/span-waterfall/span-waterfall.js +1 -1
  23. package/dist/components/agent-tools/span-waterfall/span-waterfall.styles.js +1 -1
  24. package/dist/components/agent-tools/task-list/task-list.class.d.ts +29 -6
  25. package/dist/components/agent-tools/task-list/task-list.class.js +13 -7
  26. package/dist/components/agent-tools/task-list/task-list.d.ts +1 -1
  27. package/dist/components/agent-tools/task-list/task-list.js +1 -1
  28. package/dist/components/agent-tools/task-list/task-list.styles.js +1 -1
  29. package/dist/components/agent-tools/terminal/terminal.class.d.ts +9 -5
  30. package/dist/components/agent-tools/terminal/terminal.class.js +8 -8
  31. package/dist/components/agent-tools/test-results/test-results.class.d.ts +16 -4
  32. package/dist/components/agent-tools/test-results/test-results.class.js +15 -6
  33. package/dist/components/agent-tools/test-results/test-results.d.ts +1 -0
  34. package/dist/components/agent-tools/test-results/test-results.js +1 -1
  35. package/dist/components/agent-tools/test-results/test-results.styles.js +1 -1
  36. package/dist/components/agent-tools/tool-timeline/tool-timeline.class.d.ts +7 -4
  37. package/dist/components/agent-tools/tool-timeline/tool-timeline.class.js +2 -1
  38. package/dist/components/agent-tools/trace-tree/span-projection.js +1 -0
  39. package/dist/components/agent-tools/trace-tree/span-shared.d.ts +29 -0
  40. package/dist/components/agent-tools/trace-tree/span-shared.js +1 -0
  41. package/dist/components/agent-tools/trace-tree/span.d.ts +5 -35
  42. package/dist/components/agent-tools/trace-tree/span.js +1 -1
  43. package/dist/components/agent-tools/trace-tree/trace-tree.class.d.ts +27 -5
  44. package/dist/components/agent-tools/trace-tree/trace-tree.class.js +19 -9
  45. package/dist/components/agent-tools/trace-tree/trace-tree.d.ts +1 -1
  46. package/dist/components/agent-tools/trace-tree/trace-tree.js +1 -1
  47. package/dist/components/agent-tools/trace-tree/trace-tree.styles.js +1 -1
  48. package/dist/components/charts/chart/bar-chart.class.d.ts +5 -1
  49. package/dist/components/charts/chart/box-plot.class.d.ts +2 -2
  50. package/dist/components/charts/chart/box-plot.class.js +3 -3
  51. package/dist/components/charts/chart/bubble-chart.class.d.ts +5 -1
  52. package/dist/components/charts/chart/chart-prepared-data.d.ts +9 -0
  53. package/dist/components/charts/chart/chart-prepared-data.js +1 -0
  54. package/dist/components/charts/chart/chart-spatial-data.js +2 -0
  55. package/dist/components/charts/chart/chart-sync.js +1 -1
  56. package/dist/components/charts/chart/chart-table-sampling.js +1 -1
  57. package/dist/components/charts/chart/chart.class.d.ts +56 -6
  58. package/dist/components/charts/chart/chart.class.js +18 -8
  59. package/dist/components/charts/chart/chart.styles.js +1 -1
  60. package/dist/components/charts/chart/doughnut-chart.class.d.ts +5 -1
  61. package/dist/components/charts/chart/histogram-buckets.d.ts +1 -1
  62. package/dist/components/charts/chart/histogram-buckets.js +1 -1
  63. package/dist/components/charts/chart/histogram.class.d.ts +19 -4
  64. package/dist/components/charts/chart/histogram.class.js +1 -1
  65. package/dist/components/charts/chart/line-chart.class.d.ts +5 -1
  66. package/dist/components/charts/chart/lite-chart.class.d.ts +51 -11
  67. package/dist/components/charts/chart/lite-chart.class.js +33 -27
  68. package/dist/components/charts/chart/lite-chart.styles.js +1 -1
  69. package/dist/components/charts/chart/pie-chart.class.d.ts +5 -1
  70. package/dist/components/charts/chart/polar-area-chart.class.d.ts +5 -1
  71. package/dist/components/charts/chart/radar-chart.class.d.ts +5 -1
  72. package/dist/components/charts/chart/scatter-chart.class.d.ts +5 -1
  73. package/dist/components/conversation/agent-workspace/agent-workspace.class.d.ts +6 -3
  74. package/dist/components/conversation/agent-workspace/agent-workspace.class.js +6 -5
  75. package/dist/components/conversation/agent-workspace/agent-workspace.styles.js +1 -1
  76. package/dist/components/conversation/chat-viewport/chat-viewport.class.d.ts +8 -0
  77. package/dist/components/conversation/chat-viewport/chat-viewport.class.js +1 -1
  78. package/dist/components/conversation/code-block/code-block-base.class.d.ts +5 -3
  79. package/dist/components/conversation/code-block/code-block-base.class.js +1 -1
  80. package/dist/components/conversation/code-block/code-block-core.class.d.ts +4 -1
  81. package/dist/components/conversation/code-block/code-block-core.class.js +1 -1
  82. package/dist/components/conversation/code-block/code-block-shared.d.ts +6 -4
  83. package/dist/components/conversation/code-block/code-block-shared.js +3 -2
  84. package/dist/components/conversation/code-block/code-block.class.d.ts +11 -4
  85. package/dist/components/conversation/code-block/code-block.class.js +1 -1
  86. package/dist/components/conversation/code-block/code-block.d.ts +1 -1
  87. package/dist/components/conversation/code-block/code-block.styles.js +1 -1
  88. package/dist/components/conversation/code-block/shiki-types.d.ts +2 -0
  89. package/dist/components/conversation/code-block/shiki-types.js +1 -1
  90. package/dist/components/conversation/markdown/markdown-base.class.d.ts +6 -4
  91. package/dist/components/conversation/markdown/markdown-base.class.js +1 -1
  92. package/dist/components/conversation/markdown/markdown-code-header.d.ts +2 -2
  93. package/dist/components/conversation/markdown/markdown-code-header.js +1 -1
  94. package/dist/components/conversation/markdown/markdown-core.class.d.ts +8 -3
  95. package/dist/components/conversation/markdown/markdown-progressive.js +2 -2
  96. package/dist/components/conversation/markdown/markdown-shared.d.ts +5 -10
  97. package/dist/components/conversation/markdown/markdown-shared.js +5 -5
  98. package/dist/components/conversation/markdown/markdown-streaming-tail.js +1 -1
  99. package/dist/components/conversation/markdown/markdown.class.d.ts +17 -10
  100. package/dist/components/conversation/markdown/markdown.class.js +1 -1
  101. package/dist/components/conversation/markdown/markdown.styles.js +1 -1
  102. package/dist/components/conversation/model-select/model-select.class.d.ts +4 -3
  103. package/dist/components/conversation/model-select/model-select.class.js +3 -2
  104. package/dist/components/conversation/model-select/model-select.styles.js +1 -1
  105. package/dist/components/conversation/model-settings-panel/model-settings-panel.class.d.ts +2 -1
  106. package/dist/components/conversation/model-settings-panel/model-settings-panel.class.js +2 -1
  107. package/dist/components/conversation/model-settings-panel/model-settings-panel.styles.js +1 -1
  108. package/dist/components/conversation/prompt-input/prompt-input.class.d.ts +3 -2
  109. package/dist/components/conversation/prompt-input/prompt-input.class.js +2 -1
  110. package/dist/components/conversation/prompt-input/prompt-input.styles.js +1 -1
  111. package/dist/components/conversation/prompt-queue/prompt-queue.class.d.ts +10 -2
  112. package/dist/components/conversation/prompt-queue/prompt-queue.class.js +15 -6
  113. package/dist/components/conversation/prompt-queue/prompt-queue.styles.js +1 -1
  114. package/dist/components/conversation/realtime-session/realtime-session.class.d.ts +3 -1
  115. package/dist/components/conversation/realtime-session/realtime-session.class.js +2 -1
  116. package/dist/components/conversation/realtime-session/realtime-session.styles.js +1 -1
  117. package/dist/components/conversation/streaming-text/markdown-detection.d.ts +2 -0
  118. package/dist/components/conversation/streaming-text/markdown-detection.js +4 -1
  119. package/dist/components/conversation/streaming-text/streaming-text-base.class.d.ts +6 -2
  120. package/dist/components/conversation/streaming-text/streaming-text-base.class.js +3 -3
  121. package/dist/components/conversation/streaming-text/streaming-text-core.class.js +1 -1
  122. package/dist/components/conversation/streaming-text/streaming-text.class.js +1 -0
  123. package/dist/components/conversation/thread-list/thread-list.class.d.ts +34 -4
  124. package/dist/components/conversation/thread-list/thread-list.class.js +22 -15
  125. package/dist/components/conversation/thread-list/thread-list.d.ts +1 -1
  126. package/dist/components/conversation/thread-list/thread-list.js +1 -1
  127. package/dist/components/conversation/thread-list/thread-list.styles.js +1 -1
  128. package/dist/components/conversation/transcript-feed/transcript-feed.class.d.ts +6 -2
  129. package/dist/components/conversation/transcript-feed/transcript-feed.class.js +3 -2
  130. package/dist/components/conversation/transcript-feed/transcript-feed.styles.js +1 -1
  131. package/dist/components/conversation/voice-picker/voice-picker.class.d.ts +3 -2
  132. package/dist/components/conversation/voice-picker/voice-picker.class.js +3 -2
  133. package/dist/components/conversation/voice-picker/voice-picker.styles.js +1 -1
  134. package/dist/components/data/calendar/calendar.class.d.ts +5 -2
  135. package/dist/components/data/calendar/calendar.class.js +1 -1
  136. package/dist/components/data/data-grid/data-grid-processing.js +2 -2
  137. package/dist/components/data/data-grid/data-grid.class.d.ts +22 -8
  138. package/dist/components/data/data-grid/data-grid.class.js +20 -19
  139. package/dist/components/data/data-grid/data-grid.styles.js +1 -1
  140. package/dist/components/data/document-library/document-library.class.d.ts +31 -4
  141. package/dist/components/data/document-library/document-library.class.js +25 -12
  142. package/dist/components/data/document-library/document-library.styles.js +1 -1
  143. package/dist/components/data/file-tree/file-tree.class.d.ts +30 -6
  144. package/dist/components/data/file-tree/file-tree.class.js +4 -3
  145. package/dist/components/data/file-tree/file-tree.d.ts +1 -0
  146. package/dist/components/data/file-tree/file-tree.js +1 -1
  147. package/dist/components/data/flow-canvas/flow-canvas.class.d.ts +31 -6
  148. package/dist/components/data/flow-canvas/flow-canvas.class.js +40 -19
  149. package/dist/components/data/flow-canvas/flow-canvas.styles.js +1 -1
  150. package/dist/components/data/flow-canvas/flow-model.js +1 -1
  151. package/dist/components/data/flow-canvas/flow-source.js +1 -0
  152. package/dist/components/data/flow-canvas/flow-types.d.ts +4 -2
  153. package/dist/components/data/flow-canvas/flow-viewport-index.js +1 -0
  154. package/dist/components/data/flow-minimap/flow-minimap.class.d.ts +9 -3
  155. package/dist/components/data/flow-minimap/flow-minimap.class.js +11 -2
  156. package/dist/components/data/flow-minimap/flow-minimap.styles.js +1 -1
  157. package/dist/components/data/funnel/funnel.class.d.ts +7 -3
  158. package/dist/components/data/funnel/funnel.class.js +2 -2
  159. package/dist/components/data/heatmap/calendar-grid.d.ts +1 -1
  160. package/dist/components/data/heatmap/calendar-grid.js +1 -1
  161. package/dist/components/data/heatmap/heatmap-grid-navigation.js +1 -1
  162. package/dist/components/data/heatmap/heatmap-limits.d.ts +1 -1
  163. package/dist/components/data/heatmap/heatmap-matrix-source-controller.js +1 -0
  164. package/dist/components/data/heatmap/heatmap-matrix-source.d.ts +5 -0
  165. package/dist/components/data/heatmap/heatmap-matrix-source.js +1 -0
  166. package/dist/components/data/heatmap/heatmap-scale.d.ts +0 -16
  167. package/dist/components/data/heatmap/heatmap-scale.js +1 -1
  168. package/dist/components/data/heatmap/heatmap.class.d.ts +40 -11
  169. package/dist/components/data/heatmap/heatmap.class.js +26 -6
  170. package/dist/components/data/heatmap/heatmap.styles.js +1 -1
  171. package/dist/components/data/pagination/pagination.class.js +1 -1
  172. package/dist/components/data/sequence-strip/sequence-strip-item.d.ts +17 -0
  173. package/dist/components/data/sequence-strip/sequence-strip-source-controller.js +1 -0
  174. package/dist/components/data/sequence-strip/sequence-strip-source.d.ts +5 -0
  175. package/dist/components/data/sequence-strip/sequence-strip-source.js +1 -0
  176. package/dist/components/data/sequence-strip/sequence-strip.class.d.ts +24 -19
  177. package/dist/components/data/sequence-strip/sequence-strip.class.js +23 -4
  178. package/dist/components/data/sequence-strip/sequence-strip.styles.js +1 -1
  179. package/dist/components/data/sparkline/sparkline.class.d.ts +17 -4
  180. package/dist/components/data/sparkline/sparkline.class.js +3 -3
  181. package/dist/components/data/sparkline/sparkline.styles.js +1 -1
  182. package/dist/components/data/table/table.class.d.ts +14 -10
  183. package/dist/components/data/table/table.class.js +17 -16
  184. package/dist/components/data/timeline/timeline.class.d.ts +5 -2
  185. package/dist/components/data/timeline/timeline.class.js +1 -1
  186. package/dist/components/data/tree/tree-item.class.js +1 -1
  187. package/dist/components/data/tree/tree-owner-controller.js +1 -1
  188. package/dist/components/data/tree/tree.class.d.ts +28 -6
  189. package/dist/components/data/tree/tree.class.js +3 -3
  190. package/dist/components/data/tree/tree.d.ts +1 -0
  191. package/dist/components/data/tree/tree.js +1 -1
  192. package/dist/components/data/word-cloud/word-cloud.class.d.ts +17 -7
  193. package/dist/components/data/word-cloud/word-cloud.class.js +6 -4
  194. package/dist/components/data/word-cloud/word-cloud.styles.js +1 -1
  195. package/dist/components/forms/catalog-picker-base.d.ts +1 -1
  196. package/dist/components/forms/catalog-picker-base.js +6 -6
  197. package/dist/components/forms/catalog-picker-base.styles.js +1 -1
  198. package/dist/components/forms/combobox/combobox.class.d.ts +7 -3
  199. package/dist/components/forms/combobox/combobox.class.js +1 -1
  200. package/dist/components/forms/combobox/option.class.d.ts +4 -2
  201. package/dist/components/forms/combobox/option.class.js +2 -2
  202. package/dist/components/forms/country-picker/country-picker.class.d.ts +3 -1
  203. package/dist/components/forms/country-picker/country-picker.class.js +1 -1
  204. package/dist/components/forms/currency-picker/currency-picker.class.d.ts +2 -0
  205. package/dist/components/forms/currency-picker/currency-picker.class.js +1 -1
  206. package/dist/components/forms/currency-picker/currency-presentation.js +1 -1
  207. package/dist/components/forms/emoji-picker/emoji-picker.class.d.ts +6 -2
  208. package/dist/components/forms/emoji-picker/emoji-picker.class.js +3 -2
  209. package/dist/components/forms/emoji-picker/emoji-picker.styles.js +1 -1
  210. package/dist/components/forms/locale-picker/locale-picker.class.d.ts +8 -2
  211. package/dist/components/forms/locale-picker/locale-picker.class.js +5 -4
  212. package/dist/components/forms/locale-picker/locale-picker.styles.js +1 -1
  213. package/dist/components/forms/select/select.class.d.ts +11 -3
  214. package/dist/components/forms/select/select.class.js +4 -4
  215. package/dist/components/forms/time-zone-picker/time-zone-picker.class.d.ts +2 -0
  216. package/dist/components/forms/time-zone-picker/time-zone-picker.class.js +1 -1
  217. package/dist/components/forms/token-input/token-input.class.d.ts +6 -1
  218. package/dist/components/forms/token-input/token-input.class.js +15 -13
  219. package/dist/components/forms/unit-picker/unit-picker.class.d.ts +2 -0
  220. package/dist/components/forms/unit-picker/unit-picker.class.js +1 -1
  221. package/dist/components/layout/app-rail/app-rail.class.d.ts +1 -1
  222. package/dist/components/layout/app-rail/app-rail.class.js +1 -1
  223. package/dist/components/layout/command-palette/command-palette.class.d.ts +5 -2
  224. package/dist/components/layout/command-palette/command-palette.class.js +2 -1
  225. package/dist/components/layout/command-palette/command-palette.styles.js +1 -1
  226. package/dist/components/layout/menu/menu-item.class.d.ts +2 -2
  227. package/dist/components/layout/menu/menu-item.class.js +2 -2
  228. package/dist/components/layout/menu/menu.class.d.ts +1 -1
  229. package/dist/components/layout/menu/menu.class.js +1 -1
  230. package/dist/components/layout/menubar/menubar.class.d.ts +1 -1
  231. package/dist/components/layout/menubar/menubar.class.js +1 -1
  232. package/dist/components/layout/reorder-list/reorder-item.class.d.ts +2 -2
  233. package/dist/components/layout/reorder-list/reorder-item.class.js +2 -2
  234. package/dist/components/layout/reorder-list/reorder-list.class.d.ts +1 -1
  235. package/dist/components/layout/reorder-list/reorder-list.class.js +1 -1
  236. package/dist/components/layout/virtual-list/virtual-list.class.d.ts +13 -9
  237. package/dist/components/layout/virtual-list/virtual-list.class.js +21 -17
  238. package/dist/components/media/av-player/av-cue-index.js +1 -0
  239. package/dist/components/media/av-player/av-cue-source.d.ts +13 -0
  240. package/dist/components/media/av-player/av-cue-source.js +1 -0
  241. package/dist/components/media/av-player/av-metadata.d.ts +2 -2
  242. package/dist/components/media/av-player/av-metadata.js +1 -1
  243. package/dist/components/media/av-player/av-player-cue-source-controller.js +1 -0
  244. package/dist/components/media/av-player/av-player.class.d.ts +34 -12
  245. package/dist/components/media/av-player/av-player.class.js +15 -10
  246. package/dist/components/media/avatar-group/avatar-group.class.js +1 -1
  247. package/dist/components/media/flag/flag.class.js +1 -1
  248. package/dist/components/media/flag/language-map.js +1 -1
  249. package/dist/components/media/lightbox/lightbox-source.js +1 -0
  250. package/dist/components/media/lightbox/lightbox-types.d.ts +15 -0
  251. package/dist/components/media/lightbox/lightbox.class.d.ts +22 -21
  252. package/dist/components/media/lightbox/lightbox.class.js +6 -4
  253. package/dist/components/media/lightbox/lightbox.styles.js +1 -1
  254. package/dist/components/media/map/map-geojson-diff.d.ts +6 -6
  255. package/dist/components/media/map/map-geojson-diff.js +1 -1
  256. package/dist/components/media/map/map-loader.d.ts +5 -1
  257. package/dist/components/media/map/map.class.d.ts +24 -6
  258. package/dist/components/media/map/map.class.js +2 -2
  259. package/dist/components/media/map/map.styles.js +1 -1
  260. package/dist/components/media/video-playlist/video-playlist.class.d.ts +2 -1
  261. package/dist/components/media/video-playlist/video-playlist.class.js +1 -1
  262. package/dist/components/overlays/chip/chip.class.d.ts +1 -1
  263. package/dist/components/overlays/chip/chip.class.js +1 -1
  264. package/dist/components/retrieval/embedding-explorer/embedding-explorer.class.d.ts +30 -8
  265. package/dist/components/retrieval/embedding-explorer/embedding-explorer.class.js +22 -8
  266. package/dist/components/retrieval/embedding-explorer/embedding-explorer.styles.js +1 -1
  267. package/dist/components/retrieval/graph/graph-canvas.js +1 -1
  268. package/dist/components/retrieval/graph/graph-source-composition.js +1 -0
  269. package/dist/components/retrieval/graph/graph-source-controller.js +1 -0
  270. package/dist/components/retrieval/graph/graph-spatial-controller.js +2 -2
  271. package/dist/components/retrieval/graph/graph-spatial-model.js +1 -0
  272. package/dist/components/retrieval/graph/graph-spatial.js +1 -1
  273. package/dist/components/retrieval/graph/graph.class.d.ts +31 -6
  274. package/dist/components/retrieval/graph/graph.class.js +26 -5
  275. package/dist/components/retrieval/graph/graph.d.ts +1 -1
  276. package/dist/components/retrieval/graph/graph.js +1 -1
  277. package/dist/components/retrieval/graph/graph.styles.js +1 -1
  278. package/dist/components/retrieval/ingestion-queue/ingestion-queue.class.d.ts +33 -4
  279. package/dist/components/retrieval/ingestion-queue/ingestion-queue.class.js +27 -17
  280. package/dist/components/retrieval/ingestion-queue/ingestion-queue.d.ts +1 -1
  281. package/dist/components/retrieval/ingestion-queue/ingestion-queue.js +1 -1
  282. package/dist/components/retrieval/ingestion-queue/ingestion-queue.styles.js +1 -1
  283. package/dist/components/retrieval/knowledge-base/knowledge-base.class.d.ts +27 -4
  284. package/dist/components/retrieval/knowledge-base/knowledge-base.class.js +29 -14
  285. package/dist/components/retrieval/knowledge-base/knowledge-base.styles.js +1 -1
  286. package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.class.d.ts +17 -3
  287. package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.class.js +15 -10
  288. package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.styles.js +1 -1
  289. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.d.ts +24 -5
  290. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.js +17 -10
  291. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.d.ts +1 -1
  292. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.js +1 -1
  293. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.styles.js +1 -1
  294. package/dist/components/retrieval/mind-map/mind-map-layout.js +1 -1
  295. package/dist/components/retrieval/mind-map/mind-map-model.js +1 -0
  296. package/dist/components/retrieval/mind-map/mind-map.class.d.ts +27 -4
  297. package/dist/components/retrieval/mind-map/mind-map.class.js +11 -7
  298. package/dist/components/retrieval/mind-map/mind-map.d.ts +1 -0
  299. package/dist/components/retrieval/mind-map/mind-map.js +1 -1
  300. package/dist/components/retrieval/mind-map/mind-map.styles.js +1 -1
  301. package/dist/components/retrieval/neighbor-list/neighbor-list.class.d.ts +24 -2
  302. package/dist/components/retrieval/neighbor-list/neighbor-list.class.js +17 -3
  303. package/dist/components/retrieval/neighbor-list/neighbor-list.d.ts +1 -1
  304. package/dist/components/retrieval/neighbor-list/neighbor-list.js +1 -1
  305. package/dist/components/retrieval/neighbor-list/neighbor-list.styles.js +1 -1
  306. package/dist/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.class.d.ts +8 -4
  307. package/dist/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.class.js +11 -7
  308. package/dist/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.styles.js +1 -1
  309. package/dist/components/retrieval/retrieval-compare/retrieval-compare.class.d.ts +12 -6
  310. package/dist/components/retrieval/retrieval-compare/retrieval-compare.class.js +30 -17
  311. package/dist/components/retrieval/retrieval-compare/retrieval-compare.styles.js +1 -1
  312. package/dist/components/retrieval/retrieval-results/retrieval-results-model.js +1 -0
  313. package/dist/components/retrieval/retrieval-results/retrieval-results.class.d.ts +46 -5
  314. package/dist/components/retrieval/retrieval-results/retrieval-results.class.js +31 -9
  315. package/dist/components/retrieval/retrieval-results/retrieval-results.d.ts +1 -1
  316. package/dist/components/retrieval/retrieval-results/retrieval-results.js +1 -1
  317. package/dist/components/retrieval/retrieval-results/retrieval-results.styles.js +1 -1
  318. package/dist/components/utility/diff-view/diff-view.class.d.ts +16 -8
  319. package/dist/components/utility/diff-view/diff-view.class.js +3 -2
  320. package/dist/components/utility/diff-view/diff-view.styles.js +1 -1
  321. package/dist/components/utility/json-viewer/json-viewer.class.d.ts +31 -3
  322. package/dist/components/utility/json-viewer/json-viewer.class.js +13 -4
  323. package/dist/components/utility/json-viewer/json-viewer.d.ts +1 -0
  324. package/dist/components/utility/json-viewer/json-viewer.js +1 -1
  325. package/dist/components/utility/json-viewer/json-viewer.styles.js +1 -1
  326. package/dist/components/utility/mention-popover/mention-popover.class.d.ts +6 -4
  327. package/dist/components/utility/mention-popover/mention-popover.class.js +6 -5
  328. package/dist/components/viewers/csv-viewer/csv-viewer.class.d.ts +34 -7
  329. package/dist/components/viewers/csv-viewer/csv-viewer.class.js +9 -7
  330. package/dist/components/viewers/dataset-viewer/dataset-viewer.class.d.ts +28 -4
  331. package/dist/components/viewers/dataset-viewer/dataset-viewer.class.js +12 -11
  332. package/dist/components/viewers/geojson-view/geojson-viewer.class.d.ts +3 -1
  333. package/dist/components/viewers/geojson-view/geojson-viewer.class.js +17 -16
  334. package/dist/components/viewers/geojson-view/geojson-viewer.d.ts +1 -1
  335. package/dist/components/viewers/geojson-view/geojson-viewer.js +1 -1
  336. package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.class.d.ts +31 -5
  337. package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.class.js +11 -8
  338. package/dist/components/viewers/table-viewer-shared.js +19 -3
  339. package/dist/components/viewers/viewer-search-limits.js +1 -1
  340. package/dist/components/viewers/xml-viewer/xml-viewer.class.d.ts +35 -3
  341. package/dist/components/viewers/xml-viewer/xml-viewer.class.js +20 -5
  342. package/dist/components/viewers/xml-viewer/xml-viewer.d.ts +1 -1
  343. package/dist/components/viewers/xml-viewer/xml-viewer.js +1 -1
  344. package/dist/components/viewers/xml-viewer/xml-viewer.styles.js +1 -1
  345. package/dist/countries.js +1 -1
  346. package/dist/data-sources.d.ts +34 -0
  347. package/dist/data-sources.js +1 -0
  348. package/dist/events.d.ts +51 -7
  349. package/dist/framework-types.d.ts +1 -1
  350. package/dist/internal/accessibility-visibility.d.ts +4 -2
  351. package/dist/internal/accessibility-visibility.js +1 -1
  352. package/dist/internal/accessible-text-controller.js +1 -1
  353. package/dist/internal/anchor-target.js +2 -2
  354. package/dist/internal/anchored-overlay-runtime.js +1 -1
  355. package/dist/internal/aria-controls.js +1 -1
  356. package/dist/internal/catalog-picker.d.ts +1 -7
  357. package/dist/internal/catalog-picker.js +1 -1
  358. package/dist/internal/collection-snapshot.js +1 -1
  359. package/dist/internal/default-strings/agent-tools.generated.js +1 -1
  360. package/dist/internal/default-strings/charts.generated.js +1 -1
  361. package/dist/internal/default-strings/conversation.generated.js +1 -1
  362. package/dist/internal/default-strings/data.generated.js +1 -1
  363. package/dist/internal/default-strings/forms.generated.js +1 -1
  364. package/dist/internal/default-strings/layout.generated.js +1 -1
  365. package/dist/internal/default-strings/media.generated.js +1 -1
  366. package/dist/internal/default-strings/retrieval.generated.js +1 -1
  367. package/dist/internal/default-strings/shared.generated.js +1 -1
  368. package/dist/internal/default-strings/utility.generated.js +1 -1
  369. package/dist/internal/delimited-data.js +1 -1
  370. package/dist/internal/fixed-containing-block.js +1 -1
  371. package/dist/internal/flow-scene-envelope.js +1 -0
  372. package/dist/internal/graph-scene-controller.js +1 -0
  373. package/dist/internal/hierarchy-source-controller.js +1 -0
  374. package/dist/internal/hierarchy-source-view.js +29 -0
  375. package/dist/internal/hierarchy-source-view.styles.js +1 -0
  376. package/dist/internal/inherited-attribute-hub.d.ts +6 -0
  377. package/dist/internal/inherited-attribute-hub.js +1 -1
  378. package/dist/internal/intl-cache.js +1 -1
  379. package/dist/internal/keyed-index.js +1 -0
  380. package/dist/internal/locale-loaders.generated.js +1 -1
  381. package/dist/internal/localization-types.d.ts +1 -1
  382. package/dist/internal/localization.js +2 -2
  383. package/dist/internal/lyra-element.d.ts +2 -2
  384. package/dist/internal/lyra-element.js +3 -2
  385. package/dist/internal/native-modal-context.js +1 -1
  386. package/dist/internal/option-selection.js +1 -1
  387. package/dist/internal/overlay-manager.js +1 -1
  388. package/dist/internal/overlay-stack.js +1 -1
  389. package/dist/internal/package-metadata.js +1 -1
  390. package/dist/internal/positioner.js +1 -1
  391. package/dist/internal/resource-loader.d.ts +2 -0
  392. package/dist/internal/resource-loader.js +1 -1
  393. package/dist/internal/scoped-definitions.generated.js +1 -1
  394. package/dist/internal/search-haystack.js +1 -0
  395. package/dist/internal/selection-catalog.d.ts +5 -0
  396. package/dist/internal/selection-catalog.js +1 -1
  397. package/dist/internal/shiki-language-sources.js +1 -0
  398. package/dist/internal/source-page-controller.js +1 -0
  399. package/dist/internal/source-page-scope.js +1 -0
  400. package/dist/internal/source-request-controller.js +1 -0
  401. package/dist/internal/source-window-controller.js +1 -0
  402. package/dist/internal/spatial-source-controller.js +1 -0
  403. package/dist/internal/text-quote.d.ts +2 -6
  404. package/dist/internal/text-quote.js +1 -1
  405. package/dist/internal/theme-watcher.js +1 -1
  406. package/dist/internal/virtual-list-composition.js +1 -0
  407. package/dist/lyra.d.ts +1 -1
  408. package/dist/lyra.js +1 -1
  409. package/dist/testing/interaction-drivers.js +1 -1
  410. package/dist/testing/lyra-tag-event-map.js +1 -1
  411. package/dist/theme/theme.js +1 -1
  412. package/dist/units.js +1 -1
  413. package/dist/utilities/data-preparation.d.ts +56 -0
  414. package/dist/utilities/data-preparation.js +1 -0
  415. package/dist/utilities/data-spatial.d.ts +26 -0
  416. package/dist/utilities/data-spatial.js +1 -0
  417. package/dist/utilities/index.d.ts +1 -1
  418. package/dist/utilities/index.js +1 -1
  419. package/llms/components/lr-activity-feed.md +7 -2
  420. package/llms/components/lr-agent-trace.md +49 -9
  421. package/llms/components/lr-agent-workspace.md +15 -8
  422. package/llms/components/lr-av-player.md +180 -10
  423. package/llms/components/lr-bar-chart.md +1 -1
  424. package/llms/components/lr-box-plot.md +8 -0
  425. package/llms/components/lr-bubble-chart.md +1 -1
  426. package/llms/components/lr-calendar.md +26 -3
  427. package/llms/components/lr-chart.md +310 -23
  428. package/llms/components/lr-chat-viewport.md +6 -0
  429. package/llms/components/lr-code-block-core.md +12 -7
  430. package/llms/components/lr-code-block.md +23 -9
  431. package/llms/components/lr-combobox.md +27 -15
  432. package/llms/components/lr-command-palette.md +16 -3
  433. package/llms/components/lr-country-picker.md +23 -6
  434. package/llms/components/lr-csv-viewer.md +95 -12
  435. package/llms/components/lr-currency-picker.md +23 -3
  436. package/llms/components/lr-data-grid.md +24 -6
  437. package/llms/components/lr-dataset-viewer.md +92 -11
  438. package/llms/components/lr-dialog.md +1 -1
  439. package/llms/components/lr-diff-view.md +19 -6
  440. package/llms/components/lr-document-library.md +60 -5
  441. package/llms/components/lr-doughnut-chart.md +1 -1
  442. package/llms/components/lr-embedding-explorer.md +89 -9
  443. package/llms/components/lr-emoji-picker.md +7 -2
  444. package/llms/components/lr-eval-dataset.md +56 -7
  445. package/llms/components/lr-eval-result.md +89 -4
  446. package/llms/components/lr-export-button.md +1 -1
  447. package/llms/components/lr-file-tree.md +60 -6
  448. package/llms/components/lr-flag.md +5 -2
  449. package/llms/components/lr-flow-canvas.md +152 -14
  450. package/llms/components/lr-flow-minimap.md +32 -4
  451. package/llms/components/lr-funnel.md +14 -0
  452. package/llms/components/lr-geojson-viewer.md +27 -10
  453. package/llms/components/lr-graph.md +43 -7
  454. package/llms/components/lr-heatmap.md +161 -5
  455. package/llms/components/lr-histogram.md +55 -9
  456. package/llms/components/lr-ingestion-queue.md +54 -3
  457. package/llms/components/lr-json-viewer.md +87 -7
  458. package/llms/components/lr-knowledge-base-admin.md +60 -4
  459. package/llms/components/lr-knowledge-base.md +121 -9
  460. package/llms/components/lr-knowledge-graph-explorer.md +106 -11
  461. package/llms/components/lr-lightbox.md +42 -6
  462. package/llms/components/lr-line-chart.md +28 -5
  463. package/llms/components/lr-lite-chart.md +96 -31
  464. package/llms/components/lr-locale-picker.md +6 -4
  465. package/llms/components/lr-map.md +67 -8
  466. package/llms/components/lr-markdown-core.md +10 -5
  467. package/llms/components/lr-markdown.md +23 -6
  468. package/llms/components/lr-mention-popover.md +11 -6
  469. package/llms/components/lr-mind-map.md +91 -10
  470. package/llms/components/lr-model-select.md +8 -4
  471. package/llms/components/lr-model-settings-panel.md +10 -2
  472. package/llms/components/lr-navigation-menu.md +1 -1
  473. package/llms/components/lr-neighbor-list.md +69 -2
  474. package/llms/components/lr-pie-chart.md +1 -1
  475. package/llms/components/lr-polar-area-chart.md +1 -1
  476. package/llms/components/lr-prompt-input.md +9 -2
  477. package/llms/components/lr-prompt-queue.md +11 -3
  478. package/llms/components/lr-radar-chart.md +1 -1
  479. package/llms/components/lr-rag-eval-dashboard.md +9 -2
  480. package/llms/components/lr-realtime-session.md +6 -2
  481. package/llms/components/lr-reorder-list.md +4 -0
  482. package/llms/components/lr-retrieval-compare.md +9 -4
  483. package/llms/components/lr-retrieval-results.md +104 -6
  484. package/llms/components/lr-scatter-chart.md +1 -1
  485. package/llms/components/lr-select.md +20 -10
  486. package/llms/components/lr-sequence-strip.md +92 -2
  487. package/llms/components/lr-span-waterfall.md +78 -8
  488. package/llms/components/lr-sparkline.md +42 -11
  489. package/llms/components/lr-spreadsheet-viewer.md +109 -14
  490. package/llms/components/lr-streaming-text-core.md +4 -2
  491. package/llms/components/lr-streaming-text.md +5 -1
  492. package/llms/components/lr-table.md +96 -115
  493. package/llms/components/lr-task-list.md +93 -9
  494. package/llms/components/lr-terminal.md +9 -0
  495. package/llms/components/lr-test-results.md +77 -3
  496. package/llms/components/lr-thread-list.md +86 -1
  497. package/llms/components/lr-time-zone-picker.md +8 -3
  498. package/llms/components/lr-timeline.md +5 -0
  499. package/llms/components/lr-token-input.md +7 -2
  500. package/llms/components/lr-tool-timeline.md +13 -4
  501. package/llms/components/lr-trace-tree.md +96 -10
  502. package/llms/components/lr-transcript-feed.md +9 -2
  503. package/llms/components/lr-tree.md +87 -15
  504. package/llms/components/lr-unit-picker.md +8 -3
  505. package/llms/components/lr-video-playlist.md +2 -0
  506. package/llms/components/lr-virtual-list.md +17 -8
  507. package/llms/components/lr-voice-picker.md +8 -3
  508. package/llms/components/lr-word-cloud.md +128 -12
  509. package/llms/components/lr-xml-viewer.md +106 -9
  510. package/llms/index.md +1 -1
  511. package/llms/peers.md +3 -3
  512. package/llms/shared/events-and-types.md +725 -264
  513. package/llms/shared/forms-and-accessibility.md +3 -17
  514. package/llms/shared/imports-and-registration.md +4 -18
  515. package/llms/shared/localization-and-rtl.md +12 -7
  516. package/llms/shared/styles-and-tokens.md +27 -36
  517. package/llms/shared/testing-and-utilities.md +9 -5
  518. package/llms/shared.md +788 -355
  519. package/llms.txt +1 -2
  520. package/locales.json +264 -139
  521. package/package.json +19 -10
  522. package/registrations.json +1 -1
  523. package/skills/compose-lyra-interfaces/SKILL.md +6 -8
  524. package/skills/lyra-ui/SKILL.md +20 -51
  525. package/skills/lyra-ui/commands/review.md +16 -33
  526. package/skills/lyra-ui/commands/update.md +6 -5
  527. package/skills/lyra-ui/online-api.md +15 -0
  528. package/skills/lyra-ui/reporting.md +2 -1
@@ -1 +1 @@
1
- import{getActiveNativeModal}from"./native-modal-context.js";import{takeOverlayOrder}from"./overlay-order.js";import{deepActiveElementIn}from"./active-element.js";import{composedContains,flattenedParentElement}from"./composed-tree.js";import{scheduleDeferredFocusReturn,cancelDeferredFocusReturn}from"./deferred-focus-return.js";import{collectComposedAutofocusElements,collectComposedFocusTargets,isComposedFocusAvailable}from"./focus-navigation.js";import{isHtmlElement}from"./dom-guards.js";import{leaseInlineStyleProperty}from"./style-property-lease.js";const STACK_PROPERTY="--lr-overlay-stack-index",STACK_BASE=1e3,STACK_STEP=2,states=new WeakMap,hostEntries=new WeakMap;function createInactiveOverlayHandle(){return{focusInitial:()=>{},focusAutofocus:()=>!1,updateRestoreFocusTo:()=>{},deactivate:()=>{},suspend:()=>{},resume:()=>{},isTopmost:()=>!1,isActive:()=>!1,dismissBackdrop:()=>!1}}function deepActiveElement(doc=typeof document>"u"?void 0:document){return deepActiveElementIn(doc)}function collectFocusableElements(root){return collectComposedFocusTargets(root).elements}function collectAutofocusElements(root){return collectComposedAutofocusElements(root).elements}function tryFocus(target){if(!target||!isComposedFocusAvailable(target))return!1;target.focus();const active=deepActiveElement(target.ownerDocument);return active===target||composedContains(target,active)}function focusAutofocusTarget(panel){for(const candidate of collectAutofocusElements(panel)){if(tryFocus(candidate))return!0;for(const inner of collectFocusableElements(candidate))if(tryFocus(inner))return!0}return!1}function auxiliaryRoots(entry){const panel=entry.options.panel();return[...new Set(entry.options.auxiliaryRoots?.()??[])].filter(root=>root.isConnected&&root.ownerDocument===entry.state.document&&(!panel||!composedContains(panel,root)))}function entryContainsFocus(entry,panel,active){return entry.options.auxiliaryRoots?active!==null&&isComposedFocusAvailable(active)&&[panel,...auxiliaryRoots(entry)].some(root=>composedContains(root,active)):composedContains(panel,active)}function entryTabStops(entry,panel){const roots=entry.options.auxiliaryRoots?[panel,...auxiliaryRoots(entry)]:[panel];return[...new Set(roots.flatMap(root=>collectComposedFocusTargets(root,{browserTabOrder:!0}).elements))]}function composedPath(element){const path=[];for(let current=element;current;current=flattenedParentElement(current))path.unshift(current);return path}function precedes(first,second){let index=0;for(;first[index]&&first[index]===second[index];)index+=1;return first[index]?!!(second[index]&&first[index].compareDocumentPosition(second[index])&4):!!second[index]}function focusEntry(entry,preserveCurrent=!0){const panel=entry.options.panel();if(!panel)return;const active=deepActiveElement(entry.state.document);if(preserveCurrent&&entryContainsFocus(entry,panel,active)||(entry.initialFocusDecision===void 0&&(entry.initialFocusDecision=entry.options.beforeInitialFocus?.()!==!1),!entry.initialFocusDecision)||focusAutofocusTarget(panel))return;const preferred=entry.options.preferredInitialFocus?.()??null;if(!(preferred&&composedContains(panel,preferred)&&tryFocus(preferred))){for(const target of collectFocusableElements(panel))if(tryFocus(target))return;panel.focus()}}function handleTab(state,entry,event){const panel=entry.options.panel();if(!panel)return;const focusable=entryTabStops(entry,panel);if(focusable.length===0){event.preventDefault(),panel.focus();return}const active=deepActiveElement(state.document),first=focusable[0],last=focusable[focusable.length-1],activeIndex=active?focusable.indexOf(active):-1;if(activeIndex===-1){let target;const roots=entry.options.auxiliaryRoots?[panel,...auxiliaryRoots(entry)]:[panel];if(active&&roots.some(root=>composedContains(root,active))){const activePath=composedPath(active);if(event.shiftKey)for(let index=focusable.length-1;index>=0&&!target;index-=1)precedes(composedPath(focusable[index]),activePath)&&(target=focusable[index]);else target=focusable.find(stop=>precedes(activePath,composedPath(stop)));if(target&&target.tabIndex>=0&&!entry.options.auxiliaryRoots)return}event.preventDefault(),(target??(event.shiftKey?last:first)).focus()}else if(event.shiftKey&&active===first)event.preventDefault(),last.focus();else if(!event.shiftKey&&active===last)event.preventDefault(),first.focus();else{const next=focusable[activeIndex+(event.shiftKey?-1:1)];next&&(next.tabIndex<0||auxiliaryRoots(entry).length>0)&&(event.preventDefault(),next.focus())}}function nearestTrappingEntryBelowTop(state){for(let index=state.stack.length-2;index>=0;index-=1){const entry=state.stack[index];if(entry&&entry.options.trapFocus!==!1)return entry}}function snapshotFor(state){return{entries:state.stack.map(entry=>({host:entry.options.host,modal:entry.options.modal,modalRoot:entry.options.modalRoot,auxiliaryRoots:entry.options.auxiliaryRoots}))}}function notifyStackObservers(state){if(state.observers.size===0)return;const snapshot=snapshotFor(state);for(const observer of state.observers)observer(snapshot)}function startState(state){state.started||(state.started=!0,state.document.addEventListener("keydown",state.onKeyDown))}function stopState(state){state.started&&(state.started=!1,state.document.removeEventListener("keydown",state.onKeyDown))}function stopStateIfIdle(state){state.stack.length===0&&stopState(state)}function createState(doc){const state={};return state.document=doc,state.stack=[],state.routingSuspensions=new Set,state.observers=new Set,state.started=!1,state.onKeyDown=event=>{if(event.defaultPrevented||event.isComposing||event.keyCode===229||state.routingSuspensions.size>0)return;const entry=state.stack[state.stack.length-1];if(!entry||event.key!=="Escape"&&event.key!=="Tab")return;const nativeModal=getActiveNativeModal(doc),panel=entry.options.panel();if(!(nativeModal&&(!panel||!composedContains(nativeModal,panel)))){if(event.key==="Escape")event.preventDefault(),entry.options.onEscape();else if(event.key==="Tab"){if(entry.options.trapFocus!==!1){handleTab(state,entry,event);return}entry.options.onTab?.();const trapping=nearestTrappingEntryBelowTop(state),trappingPanel=trapping?.options.panel();trapping&&trappingPanel&&!event.defaultPrevented&&(!nativeModal||composedContains(nativeModal,trappingPanel))&&entryContainsFocus(trapping,trappingPanel,deepActiveElement(doc))&&handleTab(state,trapping,event)}}},states.set(doc,state),state}function stateFor(doc){return states.get(doc)??createState(doc)}function observeOverlayStack(doc,observer){const state=stateFor(doc);return state.observers.add(observer),observer(snapshotFor(state)),()=>{state.observers.delete(observer)}}function acquireOverlayRoutingSuspension(doc){const state=stateFor(doc),token=Symbol();let active=!0;return state.routingSuspensions.add(token),()=>{active&&(active=!1,state.routingSuspensions.delete(token))}}function restoreStackStyle(entry){entry.stackStyleLease?.release(),entry.stackStyleLease=void 0}function updateStackStyles(state){state.stack.forEach((entry,index)=>{const value=String(STACK_BASE+index*STACK_STEP);entry.stackStyleLease?entry.stackStyleLease.set(value):entry.stackStyleLease=leaseInlineStyleProperty(entry.options.host,STACK_PROPERTY,value)})}function registerEntry(entry,state,preserveStackOrder=!1){if(entry.registered)return;startState(state),(!preserveStackOrder||entry.state!==state)&&(entry.stackOrder=takeOverlayOrder(state.document)),entry.state=state,entry.registered=!0,entry.options.onRegistered?.(state.document);const nextIndex=state.stack.findIndex(candidate=>candidate.stackOrder>entry.stackOrder);nextIndex===-1?state.stack.push(entry):state.stack.splice(nextIndex,0,entry),updateStackStyles(state),notifyStackObservers(state)}function unregisterEntry(entry,deferResourceRelease=!1){if(!entry.registered){const hasHigherEntry=entry.state.stack.some(candidate=>candidate.stackOrder>entry.stackOrder);return entry.state.routingSuspensions.size===0&&entry.wasTopmostOnSuspend&&!hasHigherEntry}const state=entry.state,index=state.stack.indexOf(entry),wasTopmost=state.routingSuspensions.size===0&&index===state.stack.length-1;return index!==-1&&state.stack.splice(index,1),entry.registered=!1,entry.wasTopmostOnSuspend=wasTopmost,entry.deferredResourceRelease=entry.options.onUnregistered?.(state.document,deferResourceRelease),restoreStackStyle(entry),updateStackStyles(state),notifyStackObservers(state),stopStateIfIdle(state),wasTopmost}function syncEntryRegistration(entry){if(!entry.active||entry.manuallySuspended){unregisterEntry(entry);return}const state=stateFor(entry.options.host.ownerDocument);registerEntry(entry,state,entry.state===state)}function validRestoreFocusElement(value,doc){return isHtmlElement(value)&&value.ownerDocument===doc?value:null}function resolveRestoreFocusTarget(entry){const source=entry.restoreFocusTo;if(typeof source!="function")return validRestoreFocusElement(source,entry.state.document);try{return validRestoreFocusElement(source(),entry.state.document)}catch{return null}}function rebaseReturnTargets(entry){for(const candidate of entry.state.stack){if(candidate===entry||candidate.stackOrder<=entry.stackOrder)continue;const candidateTarget=typeof candidate.restoreFocusTo=="function"?null:validRestoreFocusElement(candidate.restoreFocusTo,entry.state.document);candidateTarget&&composedContains(entry.options.host,candidateTarget)&&(candidate.restoreFocusTo=entry.restoreFocusTo)}}function restoreEntryFocus(entry){if(tryFocus(resolveRestoreFocusTarget(entry)))return;const next=entry.state.stack[entry.state.stack.length-1];next&&focusEntry(next,!1)}function deactivateEntry(entry,restoreFocus,deferResourceRelease=!1){if(!entry.active)return;const host=entry.options.host;cancelDeferredFocusReturn(host);const release=deactivateActiveEntry(entry,restoreFocus,deferResourceRelease);if(restoreFocus){const pass=entry.options.deferredReturn?.();pass&&scheduleDeferredFocusReturn({...pass,host})}return release}function deactivateActiveEntry(entry,restoreFocus,deferResourceRelease){const heldFocus=panelHoldsFocus(entry);rebaseReturnTargets(entry);const wasTopmost=unregisterEntry(entry,deferResourceRelease),deferredResourceRelease=entry.deferredResourceRelease;if(entry.deferredResourceRelease=void 0,entry.active=!1,entry.manuallySuspended=!1,entry.suspendGeneration++,entry.options.onDeactivate?.(),hostEntries.get(entry.options.host)===entry&&hostEntries.delete(entry.options.host),!wasTopmost)return deferredResourceRelease;if(restoreFocus)return restoreEntryFocus(entry),deferredResourceRelease;const next=entry.state.stack[entry.state.stack.length-1];return next&&(heldFocus||next.options.trapFocus)&&focusEntry(next),deferredResourceRelease}function panelHoldsFocus(entry){const panel=entry.options.panel();return panel!==null&&entryContainsFocus(entry,panel,deepActiveElement(entry.state.document))}function activateOverlayStack(options){cancelDeferredFocusReturn(options.host);const previous=hostEntries.get(options.host),inheritedReturnTarget=previous?.active?previous.restoreFocusTo:void 0;previous?.active&&previous.handle.deactivate({restoreFocus:!1});const doc=options.host.ownerDocument;if(!doc)return createInactiveOverlayHandle();const active=deepActiveElement(doc),captured=active&&typeof active.focus=="function"?active:null,entry={};return entry.options=options,entry.restoreFocusTo=options.restoreFocusTo!==void 0?options.restoreFocusTo:inheritedReturnTarget??captured,entry.active=!0,entry.registered=!1,entry.manuallySuspended=options.initiallySuspended===!0,entry.initialFocusDecision=void 0,entry.wasTopmostOnSuspend=!1,entry.suspendGeneration=0,entry.state=stateFor(doc),entry.stackOrder=takeOverlayOrder(doc,options.orderReservation),entry.handle={focusInitial:()=>{entry.active&&entry.registered&&entry.state.routingSuspensions.size===0&&entry.state.stack[entry.state.stack.length-1]===entry&&focusEntry(entry)},focusAutofocus:()=>{if(!entry.active||!entry.registered||entry.state.routingSuspensions.size>0)return!1;const panel=entry.options.panel();if(!panel)return!1;const active2=deepActiveElement(entry.state.document);return entryContainsFocus(entry,panel,active2)?!1:focusAutofocusTarget(panel)},updateRestoreFocusTo:target=>{entry.active&&(entry.restoreFocusTo=target)},deactivate:(deactivateOptions={})=>deactivateEntry(entry,deactivateOptions.restoreFocus!==!1,deactivateOptions.deferScrollLockRelease===!0),suspend:()=>{if(!entry.active||entry.manuallySuspended)return;entry.manuallySuspended=!0,syncEntryRegistration(entry);const generation=++entry.suspendGeneration;queueMicrotask(()=>{entry.active&&!entry.registered&&entry.suspendGeneration===generation&&!entry.options.host.isConnected&&deactivateEntry(entry,!0)})},resume:()=>{!entry.active||!entry.manuallySuspended||(entry.suspendGeneration++,entry.manuallySuspended=!1,syncEntryRegistration(entry))},isTopmost:()=>entry.active&&entry.registered&&entry.state.routingSuspensions.size===0&&entry.state.stack[entry.state.stack.length-1]===entry,isActive:()=>entry.active,dismissBackdrop:()=>!entry.handle.isTopmost()||!entry.options.onBackdrop?!1:(entry.options.onBackdrop(),!0)},hostEntries.set(options.host,entry),entry.manuallySuspended||registerEntry(entry,entry.state,!0),entry.handle}export{acquireOverlayRoutingSuspension,activateOverlayStack,collectAutofocusElements,collectFocusableElements,composedContains,deepActiveElement,observeOverlayStack};
1
+ import{getActiveNativeModal}from"./native-modal-context.js";import{takeOverlayOrder}from"./overlay-order.js";import{deepActiveElementIn}from"./active-element.js";import{composedContains,flattenedParentElement}from"./composed-tree.js";import{scheduleDeferredFocusReturn,cancelDeferredFocusReturn}from"./deferred-focus-return.js";import{collectComposedAutofocusElements,collectComposedFocusTargets,isComposedFocusAvailable}from"./focus-navigation.js";import{isHtmlElement}from"./dom-guards.js";import{leaseInlineStyleProperty}from"./style-property-lease.js";const STACK_PROPERTY="--lr-overlay-stack-index",STACK_BASE=1e3,STACK_STEP=2,states=new WeakMap,hostEntries=new WeakMap;function createInactiveOverlayHandle(){return{focusInitial:()=>{},focusAutofocus:()=>!1,updateRestoreFocusTo:()=>{},deactivate:()=>{},suspend:()=>{},resume:()=>{},isTopmost:()=>!1,isActive:()=>!1,dismissBackdrop:()=>!1}}function deepActiveElement(doc=typeof document>"u"?void 0:document){return deepActiveElementIn(doc)}function collectFocusableElements(root){return collectComposedFocusTargets(root).elements}function collectAutofocusElements(root){return collectComposedAutofocusElements(root).elements}function tryFocus(target){if(!target||!isComposedFocusAvailable(target))return!1;target.focus();const active=deepActiveElement(target.ownerDocument);return active===target||composedContains(target,active)}function focusAutofocusTarget(panel){for(const candidate of collectAutofocusElements(panel)){if(tryFocus(candidate))return!0;for(const inner of collectFocusableElements(candidate))if(tryFocus(inner))return!0}return!1}function auxiliaryRoots(entry){const panel=entry.options.panel();return[...new Set(entry.options.auxiliaryRoots?.()??[])].filter(root=>root.isConnected&&root.ownerDocument===entry.state.document&&(!panel||!composedContains(panel,root)))}function entryContainsFocus(entry,panel,active){return entry.options.auxiliaryRoots?active!==null&&isComposedFocusAvailable(active)&&[panel,...auxiliaryRoots(entry)].some(root=>composedContains(root,active)):composedContains(panel,active)}function entryTabStops(entry,panel){const roots=entry.options.auxiliaryRoots?[panel,...auxiliaryRoots(entry)]:[panel];return[...new Set(roots.flatMap(root=>collectComposedFocusTargets(root,{browserTabOrder:!0}).elements))]}function composedPath(element){const path=[];for(let current=element;current;current=flattenedParentElement(current))path.unshift(current);return path}function precedes(first,second){let index=0;for(;first[index]&&first[index]===second[index];)index+=1;return first[index]?!!(second[index]&&first[index].compareDocumentPosition(second[index])&4):!!second[index]}function focusEntry(entry,preserveCurrent=!0){const panel=entry.options.panel();if(!panel)return;const active=deepActiveElement(entry.state.document);if(preserveCurrent&&entryContainsFocus(entry,panel,active)||(entry.initialFocusDecision===void 0&&(entry.initialFocusDecision=entry.options.beforeInitialFocus?.()!==!1),!entry.initialFocusDecision)||focusAutofocusTarget(panel))return;const preferred=entry.options.preferredInitialFocus?.()??null;if(!(preferred&&composedContains(panel,preferred)&&tryFocus(preferred))){for(const target of collectFocusableElements(panel))if(tryFocus(target))return;panel.focus()}}function handleTab(state,entry,event){const panel=entry.options.panel();if(!panel)return;const focusable=entryTabStops(entry,panel);if(focusable.length===0){event.preventDefault(),panel.focus();return}const active=deepActiveElement(state.document),first=focusable[0],last=focusable[focusable.length-1],activeIndex=active?focusable.indexOf(active):-1;if(activeIndex===-1){let target;const roots=entry.options.auxiliaryRoots?[panel,...auxiliaryRoots(entry)]:[panel];if(active&&roots.some(root=>composedContains(root,active))){const activePath=composedPath(active);if(event.shiftKey)for(let index=focusable.length-1;index>=0&&!target;index-=1)precedes(composedPath(focusable[index]),activePath)&&(target=focusable[index]);else target=focusable.find(stop=>precedes(activePath,composedPath(stop)));if(target&&target.tabIndex>=0&&!entry.options.auxiliaryRoots)return}event.preventDefault(),(target??(event.shiftKey?last:first)).focus()}else if(event.shiftKey&&active===first)event.preventDefault(),last.focus();else if(!event.shiftKey&&active===last)event.preventDefault(),first.focus();else{const next=focusable[activeIndex+(event.shiftKey?-1:1)];next&&(next.tabIndex<0||auxiliaryRoots(entry).length>0)&&(event.preventDefault(),next.focus())}}function nearestTrappingEntryBelowTop(state){for(let index=state.stack.length-2;index>=0;index-=1){const entry=state.stack[index];if(entry&&entry.options.trapFocus!==!1)return entry}}function snapshotFor(state){return{entries:state.stack.map(entry=>({host:entry.options.host,modal:entry.options.modal,modalRoot:entry.options.modalRoot,auxiliaryRoots:entry.options.auxiliaryRoots}))}}function notifyStackObservers(state){if(state.observers.size===0)return;const snapshot=snapshotFor(state);for(const observer of state.observers)observer(snapshot)}function startState(state){state.started||(state.started=!0,state.document.addEventListener("keydown",state.onKeyDown))}function stopState(state){state.started&&(state.started=!1,state.document.removeEventListener("keydown",state.onKeyDown))}function stopStateIfIdle(state){state.stack.length===0&&stopState(state)}function createState(doc){const state={};return state.document=doc,state.stack=[],state.routingSuspensions=new Set,state.observers=new Set,state.started=!1,state.onKeyDown=event=>{if(event.defaultPrevented||event.isComposing||event.keyCode===229||state.routingSuspensions.size>0)return;const entry=state.stack[state.stack.length-1];if(!entry||event.key!=="Escape"&&event.key!=="Tab")return;const nativeModal=getActiveNativeModal(doc),panel=entry.options.panel();if(!(nativeModal&&(!panel||!composedContains(nativeModal,panel)))){if(event.key==="Escape")event.preventDefault(),entry.options.onEscape();else if(event.key==="Tab"){if(entry.options.trapFocus!==!1){handleTab(state,entry,event);return}entry.options.onTab?.();const trapping=nearestTrappingEntryBelowTop(state),trappingPanel=trapping?.options.panel();trapping&&trappingPanel&&!event.defaultPrevented&&(!nativeModal||composedContains(nativeModal,trappingPanel))&&entryContainsFocus(trapping,trappingPanel,deepActiveElement(doc))&&handleTab(state,trapping,event)}}},states.set(doc,state),state}function stateFor(doc){return states.get(doc)??createState(doc)}function observeOverlayStack(doc,observer){const state=stateFor(doc);return state.observers.add(observer),observer(snapshotFor(state)),()=>{state.observers.delete(observer)}}function acquireOverlayRoutingSuspension(doc){const state=stateFor(doc),token=Symbol();let active=!0;return state.routingSuspensions.add(token),()=>{active&&(active=!1,state.routingSuspensions.delete(token))}}function restoreStackStyle(entry){entry.stackStyleLease?.release(),entry.stackStyleLease=void 0}function updateStackStyles(state){state.stack.forEach((entry,index)=>{const value=String(STACK_BASE+index*STACK_STEP);entry.stackStyleLease?entry.stackStyleLease.set(value):entry.stackStyleLease=leaseInlineStyleProperty(entry.options.host,STACK_PROPERTY,value)})}function registerEntry(entry,state,preserveStackOrder=!1){if(entry.registered)return;startState(state),(!preserveStackOrder||entry.state!==state)&&(entry.stackOrder=takeOverlayOrder(state.document)),entry.state=state,entry.registered=!0,entry.options.onRegistered?.(state.document);const nextIndex=state.stack.findIndex(candidate=>candidate.stackOrder>entry.stackOrder);nextIndex===-1?state.stack.push(entry):state.stack.splice(nextIndex,0,entry),updateStackStyles(state),notifyStackObservers(state)}function unregisterEntry(entry,deferResourceRelease=!1){if(!entry.registered){const hasHigherEntry=entry.state.stack.some(candidate=>candidate.stackOrder>entry.stackOrder);return entry.state.routingSuspensions.size===0&&entry.wasTopmostOnSuspend&&!hasHigherEntry}const state=entry.state,index=state.stack.indexOf(entry),wasTopmost=state.routingSuspensions.size===0&&index===state.stack.length-1;return index!==-1&&state.stack.splice(index,1),entry.registered=!1,entry.wasTopmostOnSuspend=wasTopmost,entry.deferredResourceRelease=entry.options.onUnregistered?.(state.document,deferResourceRelease),restoreStackStyle(entry),updateStackStyles(state),notifyStackObservers(state),stopStateIfIdle(state),wasTopmost}function syncEntryRegistration(entry){if(!entry.active||entry.manuallySuspended){unregisterEntry(entry);return}const state=stateFor(entry.options.host.ownerDocument);registerEntry(entry,state,entry.state===state)}function validRestoreFocusElement(value,doc){return isHtmlElement(value)&&value.ownerDocument===doc?value:null}function resolveRestoreFocusTarget(entry){const source=entry.restoreFocusTo;if(typeof source!="function")return validRestoreFocusElement(source,entry.state.document);try{return validRestoreFocusElement(source(),entry.state.document)}catch{return null}}function rebaseReturnTargets(entry){for(const candidate of entry.state.stack){if(candidate===entry||candidate.stackOrder<=entry.stackOrder)continue;const candidateTarget=typeof candidate.restoreFocusTo=="function"?null:validRestoreFocusElement(candidate.restoreFocusTo,entry.state.document);candidateTarget&&composedContains(entry.options.host,candidateTarget)&&(candidate.restoreFocusTo=entry.restoreFocusTo)}}function restoreEntryFocus(entry){if(tryFocus(resolveRestoreFocusTarget(entry)))return;const next=entry.state.stack[entry.state.stack.length-1];next&&focusEntry(next,!1)}function deactivateEntry(entry,restoreFocus,deferResourceRelease=!1){if(!entry.active)return;const host=entry.options.host;cancelDeferredFocusReturn(host);const release=deactivateActiveEntry(entry,restoreFocus,deferResourceRelease);if(restoreFocus){const pass=entry.options.deferredReturn?.();pass&&scheduleDeferredFocusReturn({...pass,host})}return release}function deactivateActiveEntry(entry,restoreFocus,deferResourceRelease){const heldFocus=panelHoldsFocus(entry);rebaseReturnTargets(entry);const wasTopmost=unregisterEntry(entry,deferResourceRelease),deferredResourceRelease=entry.deferredResourceRelease;if(entry.deferredResourceRelease=void 0,entry.active=!1,entry.manuallySuspended=!1,entry.suspendGeneration++,entry.options.onDeactivate?.(),hostEntries.get(entry.options.host)===entry&&hostEntries.delete(entry.options.host),!wasTopmost)return deferredResourceRelease;if(restoreFocus)return restoreEntryFocus(entry),deferredResourceRelease;const next=entry.state.stack[entry.state.stack.length-1];if(!next)return deferredResourceRelease;if(heldFocus)focusEntry(next);else if(next.options.trapFocus){const doc=entry.state.document,active=deepActiveElement(doc);!entry.options.host.isConnected||active&&active!==doc.body&&active!==doc.documentElement?focusEntry(next):setTimeout(()=>{next.active&&next.registered&&entry.state.stack[entry.state.stack.length-1]===next&&focusEntry(next)},0)}return deferredResourceRelease}function panelHoldsFocus(entry){const panel=entry.options.panel();return panel!==null&&entryContainsFocus(entry,panel,deepActiveElement(entry.state.document))}function activateOverlayStack(options){cancelDeferredFocusReturn(options.host);const previous=hostEntries.get(options.host),inheritedReturnTarget=previous?.active?previous.restoreFocusTo:void 0;previous?.active&&previous.handle.deactivate({restoreFocus:!1});const doc=options.host.ownerDocument;if(!doc)return createInactiveOverlayHandle();const active=deepActiveElement(doc),captured=active&&typeof active.focus=="function"?active:null,entry={};return entry.options=options,entry.restoreFocusTo=options.restoreFocusTo!==void 0?options.restoreFocusTo:inheritedReturnTarget??captured,entry.active=!0,entry.registered=!1,entry.manuallySuspended=options.initiallySuspended===!0,entry.initialFocusDecision=void 0,entry.wasTopmostOnSuspend=!1,entry.suspendGeneration=0,entry.state=stateFor(doc),entry.stackOrder=takeOverlayOrder(doc,options.orderReservation),entry.handle={focusInitial:()=>{entry.active&&entry.registered&&entry.state.routingSuspensions.size===0&&entry.state.stack[entry.state.stack.length-1]===entry&&focusEntry(entry)},focusAutofocus:()=>{if(!entry.active||!entry.registered||entry.state.routingSuspensions.size>0)return!1;const panel=entry.options.panel();if(!panel)return!1;const active2=deepActiveElement(entry.state.document);return entryContainsFocus(entry,panel,active2)?!1:focusAutofocusTarget(panel)},updateRestoreFocusTo:target=>{entry.active&&(entry.restoreFocusTo=target)},deactivate:(deactivateOptions={})=>deactivateEntry(entry,deactivateOptions.restoreFocus!==!1,deactivateOptions.deferScrollLockRelease===!0),suspend:()=>{if(!entry.active||entry.manuallySuspended)return;entry.manuallySuspended=!0,syncEntryRegistration(entry);const generation=++entry.suspendGeneration;queueMicrotask(()=>{entry.active&&!entry.registered&&entry.suspendGeneration===generation&&!entry.options.host.isConnected&&deactivateEntry(entry,!0)})},resume:()=>{!entry.active||!entry.manuallySuspended||(entry.suspendGeneration++,entry.manuallySuspended=!1,syncEntryRegistration(entry))},isTopmost:()=>entry.active&&entry.registered&&entry.state.routingSuspensions.size===0&&entry.state.stack[entry.state.stack.length-1]===entry,isActive:()=>entry.active,dismissBackdrop:()=>!entry.handle.isTopmost()||!entry.options.onBackdrop?!1:(entry.options.onBackdrop(),!0)},hostEntries.set(options.host,entry),entry.manuallySuspended||registerEntry(entry,entry.state,!0),entry.handle}export{acquireOverlayRoutingSuspension,activateOverlayStack,collectAutofocusElements,collectFocusableElements,composedContains,deepActiveElement,observeOverlayStack};
@@ -1 +1 @@
1
- const LYRA_PACKAGE_NAME="@aceshooting/lyra-ui",LYRA_PACKAGE_VERSION="29.0.2";export{LYRA_PACKAGE_NAME,LYRA_PACKAGE_VERSION};
1
+ const LYRA_PACKAGE_NAME="@aceshooting/lyra-ui",LYRA_PACKAGE_VERSION="29.2.0";export{LYRA_PACKAGE_NAME,LYRA_PACKAGE_VERSION};
@@ -1 +1 @@
1
- import{computePosition,autoUpdate,getOverflowAncestors,arrow,flip,shift,offset,platform,size,hide}from"@floating-ui/dom";import{establishesFixedContainingBlock,findFixedContainingBlockAncestor,isNativeTopLayerElement,usesWebKitContainingBlockRules}from"./fixed-containing-block.js";import{applyReferenceHidden,ancestorZoom,compensateAncestorZoom,hasTopLayerAncestor,isLibraryPromotedAndShowing,needsTopLayerEscape,promoteToTopLayer,stripStaleTopLayer}from"./top-layer-escape.js";import{finiteGeometry,PositionerGeometryError,validatedClientRect}from"./positioner-geometry.js";import{virtualAnchorFromRect}from"./positioner-geometry.js";import{releaseTopLayer}from"./top-layer-escape.js";const HOVER_BRIDGE_CORNERS=["top-left","top-right","bottom-right","bottom-left"],placementStyleOwners=new WeakMap;function hoverBridgeQuad(anchorRect,popupRect,placement){const side=placement.split("-")[0],onBlockAxis=side==="top"||side==="bottom",[first,second]=(onBlockAxis?anchorRect.top<popupRect.top:anchorRect.left<popupRect.left)?[anchorRect,popupRect]:[popupRect,anchorRect];return onBlockAxis?[[first.left,first.bottom],[first.right,first.bottom],[second.right,second.top],[second.left,second.top]]:[[first.right,first.top],[second.left,second.top],[second.left,second.bottom],[first.right,first.bottom]]}function styleMapFor(store,element){let values=store.get(element);return values||(values=new Map,store.set(element,values)),values}function readInlineStyle(element,property){return{value:element.style.getPropertyValue(property),priority:element.style.getPropertyPriority(property)}}function sameInlineStyle(left,right){return left.value===right.value&&left.priority===right.priority}function writeInlineStyle(element,property,value){element.style.removeProperty(property),value.value&&element.style.setProperty(property,value.value,value.priority)}function createPlacementSyncOwnershipController(){const syncedDimensions=new WeakMap;let nextPlacementGeneration=0;const isOlderThan=(update,current)=>update.placementGeneration<current.placementGeneration||update.placementGeneration===current.placementGeneration&&update.updateGeneration<current.updateGeneration;return{beginPlacement(){return{generation:++nextPlacementGeneration,nextUpdateGeneration:0}},beginUpdate(run){return{placementGeneration:run.generation,updateGeneration:++run.nextUpdateGeneration}},publish(popup,update,dimensions){const current=syncedDimensions.get(popup);current&&isOlderThan(update,current)||syncedDimensions.set(popup,{...dimensions,placementGeneration:update.placementGeneration,updateGeneration:update.updateGeneration})},release(popup,run){const dimensions=syncedDimensions.get(popup);if(!(dimensions&&dimensions.placementGeneration>run.generation)){for(const dimension of["width","height"]){const owned=dimensions?.[dimension];owned&&sameInlineStyle(readInlineStyle(popup,dimension),owned)&&writeInlineStyle(popup,dimension,{value:"",priority:""})}syncedDimensions.set(popup,{placementGeneration:run.generation,updateGeneration:Number.MAX_SAFE_INTEGER})}}}}const placementSyncOwnership=createPlacementSyncOwnershipController();function createPlacementStyleTransaction(){const writes=[],transaction={state:"open"};return{set(element,property,value,priority=""){if(transaction.state!=="open")return;const owners=styleMapFor(placementStyleOwners,element),previous=readInlineStyle(element,property),currentOwner=owners.get(property),write={transaction,element,property,previous,previousOwner:currentOwner&&sameInlineStyle(previous,currentOwner.written)?currentOwner:void 0,written:previous};writes.push(write),writeInlineStyle(element,property,{value,priority}),write.written=readInlineStyle(element,property),owners.set(property,write)},ownedValue(element,property){if(transaction.state!=="open")return;const owner=placementStyleOwners.get(element)?.get(property);if(owner?.transaction!==transaction)return;const current=readInlineStyle(element,property);return sameInlineStyle(current,owner.written)?current:void 0},commit(){if(transaction.state==="open"){transaction.state="committed";for(const write of writes){const owners=placementStyleOwners.get(write.element);owners?.get(write.property)===write&&owners.delete(write.property)}writes.length=0}},rollback(){if(transaction.state==="open"){transaction.state="rolled-back";for(const write of writes.reverse()){const owners=placementStyleOwners.get(write.element);if(owners?.get(write.property)!==write)continue;if(!sameInlineStyle(readInlineStyle(write.element,write.property),write.written)){owners.delete(write.property);continue}let previous=write.previous,previousOwner=write.previousOwner;for(;previousOwner?.transaction.state==="rolled-back";)previous=previousOwner.previous,previousOwner=previousOwner.previousOwner;writeInlineStyle(write.element,write.property,previous),previousOwner?.transaction.state==="open"?owners.set(write.property,previousOwner):owners.delete(write.property)}writes.length=0}}}}function writeHoverBridge(bridge,quad,styleTransaction){HOVER_BRIDGE_CORNERS.forEach((corner,index)=>{const[x,y]=quad[index];styleTransaction.set(bridge,`--lr-positioner-hover-bridge-${corner}-x`,`${x}px`),styleTransaction.set(bridge,`--lr-positioner-hover-bridge-${corner}-y`,`${y}px`)})}async function correctedGetOffsetParent(element,polyfill){const defaultOffsetParent=await platform.getOffsetParent(element,polyfill);if(!(element instanceof HTMLElement))return defaultOffsetParent;const view=element.ownerDocument.defaultView;if(!view)return defaultOffsetParent;if(isNativeTopLayerElement(element))return view;const position=view.getComputedStyle(element).position;return position==="absolute"?findFixedContainingBlockAncestor(element,!0)??(Math.abs(ancestorZoom(element)-1)>1e-6?view:defaultOffsetParent):position!=="fixed"||defaultOffsetParent instanceof Element&&establishesFixedContainingBlock(defaultOffsetParent)?defaultOffsetParent:findFixedContainingBlockAncestor(element)??view}function fixedInlineOriginCorrection(containingBlock,expectedOrigin,scale){const probe=containingBlock.ownerDocument.createElement("span");probe.setAttribute("aria-hidden","true"),probe.style.cssText="all:initial!important;position:fixed!important;left:0!important;top:0!important;width:0!important;height:0!important;visibility:hidden!important";try{if((containingBlock.shadowRoot??containingBlock).appendChild(probe),probe.getClientRects().length===0)return{x:0,y:0};const actualOrigin=validatedClientRect(probe.getBoundingClientRect(),"place() fixed origin");return{x:(expectedOrigin.left-actualOrigin.left)/scale.x,y:(expectedOrigin.top-actualOrigin.top)/scale.y}}finally{probe.remove()}}async function popupRectAtPosition(anchor,popup,strategy,x,y){const currentRect=validatedClientRect(popup.getBoundingClientRect(),"place() popup rect"),offsetParent=await correctedGetOffsetParent(popup),rect=await platform.convertOffsetParentRelativeRectToViewportRelativeRect({elements:{reference:anchor,floating:popup},rect:{x,y,width:currentRect.width,height:currentRect.height},offsetParent,strategy}),{x:left,y:top,width,height}=rect;return validatedClientRect({x:left,y:top,width,height,left,top,right:left+width,bottom:top+height},"place() converted popup rect")}function validatePlaceNumericOptions(opts){["offset","skidding","flipPadding","shiftPadding","padding","autoSizePadding","arrowPadding"].forEach((name,index)=>{const value=opts[name];value!==void 0&&finiteGeometry(value,`place() ${name}`,index>1)})}function validateAnchorBeforeSetup(anchor){try{validatedClientRect(anchor.getBoundingClientRect(),"place() anchor rect")}catch(error){if(error instanceof PositionerGeometryError)throw error}}function place(anchor,popup,opts={}){return placeImpl(anchor,popup,opts)}const MAX_ESCAPE_RERUNS=2;function placeImpl(anchor,popup,opts,hooks){validatePlaceNumericOptions(opts),validateAnchorBeforeSetup(anchor);const placementRun=placementSyncOwnership.beginPlacement(popup),strategy=opts.strategy??"fixed";popup.style.position=strategy,popup.style.margin="0";const padding=opts.padding??8,sync=opts.sync,autoSize=opts.autoSize,hoverBridge=opts.hoverBridge;let disposed=!1,escapeReruns=0,stopAutoUpdate,stopResize,stopScroll,scrollFrame,updateGeneration=0;const openStyleTransactions=new Set,view=popup.ownerDocument.defaultView??window,visualViewport=view.visualViewport,updateFromVisualViewport=()=>update(),cancelScrollFrame=()=>{scrollFrame!==void 0&&(view.cancelAnimationFrame(scrollFrame),scrollFrame=void 0)},updateFromScroll=()=>{disposed||(updateGeneration++,scrollFrame===void 0&&(scrollFrame=view.requestAnimationFrame(()=>{scrollFrame=void 0,update()})))},dispose=()=>{if(!disposed){disposed=!0,updateGeneration++,cancelScrollFrame(),stopScroll?.(),stopResize?.(),stopAutoUpdate?.(),stopAutoUpdate=void 0,visualViewport?.removeEventListener("resize",updateFromVisualViewport);for(const transaction of[...openStyleTransactions].reverse())transaction.rollback();openStyleTransactions.clear()}};sync||placementSyncOwnership.release(popup,placementRun);const middlewareFor=(styleTransaction,stagedStyles,isCurrent)=>[offset({mainAxis:opts.offset??4,crossAxis:opts.skidding??0}),sync?size({apply({rects,elements}){if(!isCurrent())return;const referenceWidth=finiteGeometry(rects.reference.width,"place() reference width",!0),referenceHeight=finiteGeometry(rects.reference.height,"place() reference height",!0);styleTransaction.set(elements.floating,"width",sync==="width"||sync==="both"?`${referenceWidth}px`:""),styleTransaction.set(elements.floating,"height",sync==="height"||sync==="both"?`${referenceHeight}px`:"")}}):void 0,opts.flip===!1?void 0:flip({boundary:opts.flipBoundary??opts.boundary,fallbackPlacements:opts.flipFallbackPlacements,fallbackStrategy:opts.flipFallbackStrategy==="initial-placement"?"initialPlacement":opts.flipFallbackStrategy==="best-fit"?"bestFit":void 0,padding:opts.flipPadding}),opts.shift===!1?void 0:shift({boundary:opts.shiftBoundary??opts.boundary,padding:opts.shiftPadding??padding}),opts.arrow?arrow({element:opts.arrow,padding:opts.arrowPadding??0}):void 0,size({boundary:opts.boundary,padding,apply({availableWidth,availableHeight}){isCurrent()&&(stagedStyles.availableInline=`${Math.max(0,finiteGeometry(availableWidth,"place() available width"))}px`,stagedStyles.availableBlock=`${Math.max(0,finiteGeometry(availableHeight,"place() available height"))}px`)}}),autoSize?size({boundary:opts.autoSizeBoundary??opts.boundary,padding:opts.autoSizePadding??0,apply({availableWidth,availableHeight}){isCurrent()&&((autoSize==="horizontal"||autoSize==="both")&&(stagedStyles.availableInline=`${Math.max(0,finiteGeometry(availableWidth,"place() auto-size available width"))}px`),(autoSize==="vertical"||autoSize==="both")&&(stagedStyles.availableBlock=`${Math.max(0,finiteGeometry(availableHeight,"place() auto-size available height"))}px`))}}):void 0,...hooks?.middleware??[]].filter(entry=>entry!==void 0);function update(){if(disposed)return;cancelScrollFrame();const generation=++updateGeneration,isCurrent=()=>!disposed&&generation===updateGeneration;try{validatedClientRect(anchor.getBoundingClientRect(),"place() anchor rect")}catch{dispose();return}try{hooks?.beforeCompute()}catch{}const updateRun=placementSyncOwnership.beginUpdate(placementRun),styleTransaction=createPlacementStyleTransaction(),stagedStyles={};openStyleTransactions.add(styleTransaction);const rollback=()=>{styleTransaction.rollback(),openStyleTransactions.delete(styleTransaction)};let resolvedOffsetParent;const offsetParents=new Map,recordingGetOffsetParent=async(element,polyfill)=>{let pending=polyfill?void 0:offsetParents.get(element);pending||(pending=correctedGetOffsetParent(element,polyfill),polyfill||offsetParents.set(element,pending));const result=await pending;return element===popup&&(resolvedOffsetParent=result),result};computePosition(anchor,popup,{strategy,placement:opts.placement??"bottom-start",middleware:middlewareFor(styleTransaction,stagedStyles,isCurrent),platform:{...platform,getOffsetParent:recordingGetOffsetParent}}).then(async({x,y,placement,middlewareData})=>{if(!isCurrent()){rollback();return}let bridgeQuad;try{if(finiteGeometry(x,"place() resolved x"),finiteGeometry(y,"place() resolved y"),middlewareData.arrow?.x!==void 0&&finiteGeometry(middlewareData.arrow.x,"place() resolved arrow x"),middlewareData.arrow?.y!==void 0&&finiteGeometry(middlewareData.arrow.y,"place() resolved arrow y"),hooks&&escapeReruns<MAX_ESCAPE_RERUNS){const view2=popup.ownerDocument.defaultView??window;let rerun=!1;try{rerun=hooks.afterResolve(resolvedOffsetParent??view2,middlewareData)}catch{rerun=!1}if(rerun){escapeReruns++,rollback(),update();return}}escapeReruns=0;const calibrateInlineOrigin=strategy==="fixed"&&resolvedOffsetParent instanceof HTMLElement&&!(resolvedOffsetParent instanceof HTMLSlotElement)&&usesWebKitContainingBlockRules()&&getComputedStyle(resolvedOffsetParent).display==="inline"&&["","normal","1"].includes(getComputedStyle(popup).zoom||"");let inlineOriginCorrection;if(calibrateInlineOrigin){const expectedOrigin=await popupRectAtPosition(anchor,popup,strategy,0,0),scale=await platform.getScale(resolvedOffsetParent);if(!isCurrent()){rollback();return}inlineOriginCorrection=fixedInlineOriginCorrection(resolvedOffsetParent,expectedOrigin,scale)}if(hoverBridge){const anchorRect=validatedClientRect(anchor.getBoundingClientRect(),"place() anchor rect"),placedPopupRect=await popupRectAtPosition(anchor,popup,strategy,x,y);if(!isCurrent()){rollback();return}bridgeQuad=hoverBridgeQuad(anchorRect,placedPopupRect,placement)}if(!isCurrent()){rollback();return}stagedStyles.availableInline!==void 0&&styleTransaction.set(popup,"--lr-positioner-available-inline-size",stagedStyles.availableInline),stagedStyles.availableBlock!==void 0&&styleTransaction.set(popup,"--lr-positioner-available-block-size",stagedStyles.availableBlock),styleTransaction.set(popup,"left",`${finiteGeometry(x+(inlineOriginCorrection?.x??0),"place() resolved x")}px`),styleTransaction.set(popup,"top",`${finiteGeometry(y+(inlineOriginCorrection?.y??0),"place() resolved y")}px`),hoverBridge&&bridgeQuad&&writeHoverBridge(hoverBridge,bridgeQuad,styleTransaction);const ownedSyncDimensions=sync?{width:styleTransaction.ownedValue(popup,"width"),height:styleTransaction.ownedValue(popup,"height")}:void 0;styleTransaction.commit(),openStyleTransactions.delete(styleTransaction),sync&&placementSyncOwnership.publish(popup,updateRun,ownedSyncDimensions??{})}catch{isCurrent()?dispose():rollback();return}opts.onPlaced?.({placement,arrow:middlewareData.arrow})},()=>{isCurrent()?dispose():rollback()})}const reference=anchor.nodeType===1?anchor:anchor.contextElement,scrollTargets=new Set([...reference?getOverflowAncestors(reference):[],...getOverflowAncestors(popup),...visualViewport?[visualViewport]:[]]);for(const target of scrollTargets)target.addEventListener("scroll",updateFromScroll,{passive:!0}),target.addEventListener("resize",cancelScrollFrame);stopScroll=()=>{for(const target of scrollTargets)target.removeEventListener("scroll",updateFromScroll),target.removeEventListener("resize",cancelScrollFrame)};const stop=autoUpdate(anchor,popup,()=>{scrollFrame===void 0&&update()},{elementResize:!1,ancestorScroll:!1});return disposed?(stop(),dispose):(stopAutoUpdate=stop,stopResize=observeElementResize(anchor,popup,update),visualViewport?.addEventListener("resize",updateFromVisualViewport),dispose)}function isWindowLike(value){return!(value instanceof Element)}function placeAnchoredSurface(anchor,popup,opts={}){validatePlaceNumericOptions(opts),validateAnchorBeforeSetup(anchor);const bridge=opts.hoverBridge,fixed=(opts.strategy??"fixed")==="fixed",escape=(element,eligible)=>{isLibraryPromotedAndShowing(element)||(eligible&&(opts.topLayer||needsTopLayerEscape(element))?promoteToTopLayer(element,popup):stripStaleTopLayer(element))},referenceHidden=hide({strategy:"referenceHidden"}),referenceElement=anchor instanceof Element?anchor:anchor.contextElement??null,referenceMeasurable=()=>referenceElement!==null&&!hasTopLayerAncestor(referenceElement);return bridge&&escape(bridge,!0),escape(popup,fixed),placeImpl(anchor,popup,opts,{beforeCompute(){bridge&&escape(bridge,!0),fixed&&compensateAncestorZoom(popup,null),bridge&&compensateAncestorZoom(bridge,null,popup)},middleware:[{name:referenceHidden.name,options:referenceHidden.options,fn:async state=>{if(!fixed||!referenceMeasurable())return{};const result=await referenceHidden.fn(state),offsets=result.data?.referenceHiddenOffsets,{width,height}=state.rects.reference;return!offsets||width>0&&height>0?result:{data:{...result.data,referenceHidden:offsets.top>0||offsets.right>0||offsets.bottom>0||offsets.left>0}}}}],afterResolve(offsetParent,data){return applyReferenceHidden(popup,data.hide?.referenceHidden===!0),fixed?isWindowLike(offsetParent)||isLibraryPromotedAndShowing(popup)?!1:promoteToTopLayer(popup):compensateAncestorZoom(popup,isWindowLike(offsetParent)?null:offsetParent)}})}function trackRect(target,onUpdate){const update=()=>onUpdate(target.getBoundingClientRect()),stopAutoUpdate=autoUpdate(target,target,update),visualViewport=target.ownerDocument.defaultView?.visualViewport,onVisualViewportChange=()=>update();return visualViewport?.addEventListener("resize",onVisualViewportChange),visualViewport?.addEventListener("scroll",onVisualViewportChange),()=>{stopAutoUpdate(),visualViewport?.removeEventListener("resize",onVisualViewportChange),visualViewport?.removeEventListener("scroll",onVisualViewportChange)}}function observeElementResize(anchor,popup,update){const view=popup.ownerDocument.defaultView;let active=!0,frame;const observer=view?.ResizeObserver?new view.ResizeObserver(()=>{!active||frame!==void 0||(frame=view.requestAnimationFrame(()=>{frame=void 0,active&&update()}))}):void 0,reference=anchor.nodeType===1?anchor:anchor.contextElement;return reference&&observer?.observe(reference),observer?.observe(popup),()=>{active=!1,observer?.disconnect(),frame!==void 0&&view?.cancelAnimationFrame(frame)}}export{createPlacementStyleTransaction,createPlacementSyncOwnershipController,place,placeAnchoredSurface,releaseTopLayer,trackRect,virtualAnchorFromRect};
1
+ import{computePosition,autoUpdate,getOverflowAncestors,arrow,flip,shift,offset,platform,size,hide}from"@floating-ui/dom";import{establishesFixedContainingBlock,findFixedContainingBlockAncestor,isNativeTopLayerElement}from"./fixed-containing-block.js";import{applyReferenceHidden,ancestorZoom,compensateAncestorZoom,hasTopLayerAncestor,isLibraryPromotedAndShowing,needsTopLayerEscape,promoteToTopLayer,stripStaleTopLayer}from"./top-layer-escape.js";import{finiteGeometry,PositionerGeometryError,validatedClientRect}from"./positioner-geometry.js";import{virtualAnchorFromRect}from"./positioner-geometry.js";import{releaseTopLayer}from"./top-layer-escape.js";const HOVER_BRIDGE_CORNERS=["top-left","top-right","bottom-right","bottom-left"],placementStyleOwners=new WeakMap;function hoverBridgeQuad(anchorRect,popupRect,placement){const side=placement.split("-")[0],onBlockAxis=side==="top"||side==="bottom",[first,second]=(onBlockAxis?anchorRect.top<popupRect.top:anchorRect.left<popupRect.left)?[anchorRect,popupRect]:[popupRect,anchorRect];return onBlockAxis?[[first.left,first.bottom],[first.right,first.bottom],[second.right,second.top],[second.left,second.top]]:[[first.right,first.top],[second.left,second.top],[second.left,second.bottom],[first.right,first.bottom]]}function styleMapFor(store,element){let values=store.get(element);return values||(values=new Map,store.set(element,values)),values}function readInlineStyle(element,property){return{value:element.style.getPropertyValue(property),priority:element.style.getPropertyPriority(property)}}function sameInlineStyle(left,right){return left.value===right.value&&left.priority===right.priority}function writeInlineStyle(element,property,value){element.style.removeProperty(property),value.value&&element.style.setProperty(property,value.value,value.priority)}function createPlacementSyncOwnershipController(){const syncedDimensions=new WeakMap;let nextPlacementGeneration=0;const isOlderThan=(update,current)=>update.placementGeneration<current.placementGeneration||update.placementGeneration===current.placementGeneration&&update.updateGeneration<current.updateGeneration;return{beginPlacement(){return{generation:++nextPlacementGeneration,nextUpdateGeneration:0}},beginUpdate(run){return{placementGeneration:run.generation,updateGeneration:++run.nextUpdateGeneration}},publish(popup,update,dimensions){const current=syncedDimensions.get(popup);current&&isOlderThan(update,current)||syncedDimensions.set(popup,{...dimensions,placementGeneration:update.placementGeneration,updateGeneration:update.updateGeneration})},release(popup,run){const dimensions=syncedDimensions.get(popup);if(!(dimensions&&dimensions.placementGeneration>run.generation)){for(const dimension of["width","height"]){const owned=dimensions?.[dimension];owned&&sameInlineStyle(readInlineStyle(popup,dimension),owned)&&writeInlineStyle(popup,dimension,{value:"",priority:""})}syncedDimensions.set(popup,{placementGeneration:run.generation,updateGeneration:Number.MAX_SAFE_INTEGER})}}}}const placementSyncOwnership=createPlacementSyncOwnershipController();function createPlacementStyleTransaction(){const writes=[],transaction={state:"open"};return{set(element,property,value,priority=""){if(transaction.state!=="open")return;const owners=styleMapFor(placementStyleOwners,element),previous=readInlineStyle(element,property),currentOwner=owners.get(property),write={transaction,element,property,previous,previousOwner:currentOwner&&sameInlineStyle(previous,currentOwner.written)?currentOwner:void 0,written:previous};writes.push(write),writeInlineStyle(element,property,{value,priority}),write.written=readInlineStyle(element,property),owners.set(property,write)},ownedValue(element,property){if(transaction.state!=="open")return;const owner=placementStyleOwners.get(element)?.get(property);if(owner?.transaction!==transaction)return;const current=readInlineStyle(element,property);return sameInlineStyle(current,owner.written)?current:void 0},commit(){if(transaction.state==="open"){transaction.state="committed";for(const write of writes){const owners=placementStyleOwners.get(write.element);owners?.get(write.property)===write&&owners.delete(write.property)}writes.length=0}},rollback(){if(transaction.state==="open"){transaction.state="rolled-back";for(const write of writes.reverse()){const owners=placementStyleOwners.get(write.element);if(owners?.get(write.property)!==write)continue;if(!sameInlineStyle(readInlineStyle(write.element,write.property),write.written)){owners.delete(write.property);continue}let previous=write.previous,previousOwner=write.previousOwner;for(;previousOwner?.transaction.state==="rolled-back";)previous=previousOwner.previous,previousOwner=previousOwner.previousOwner;writeInlineStyle(write.element,write.property,previous),previousOwner?.transaction.state==="open"?owners.set(write.property,previousOwner):owners.delete(write.property)}writes.length=0}}}}function writeHoverBridge(bridge,quad,styleTransaction){HOVER_BRIDGE_CORNERS.forEach((corner,index)=>{const[x,y]=quad[index];styleTransaction.set(bridge,`--lr-positioner-hover-bridge-${corner}-x`,`${x}px`),styleTransaction.set(bridge,`--lr-positioner-hover-bridge-${corner}-y`,`${y}px`)})}async function correctedGetOffsetParent(element,polyfill){const defaultOffsetParent=await platform.getOffsetParent(element,polyfill);if(!(element instanceof HTMLElement))return defaultOffsetParent;const view=element.ownerDocument.defaultView;if(!view)return defaultOffsetParent;if(isNativeTopLayerElement(element))return view;const position=view.getComputedStyle(element).position;if(position==="absolute")return findFixedContainingBlockAncestor(element,!0)??(Math.abs(ancestorZoom(element)-1)>1e-6?view:defaultOffsetParent);if(position!=="fixed")return defaultOffsetParent;const nearestContainingBlock=findFixedContainingBlockAncestor(element);return nearestContainingBlock||(defaultOffsetParent instanceof Element&&establishesFixedContainingBlock(defaultOffsetParent)?defaultOffsetParent:view)}function fixedInlineCoordinates(containingBlock){const probe=containingBlock.ownerDocument.createElement("span");probe.setAttribute("aria-hidden","true"),probe.style.cssText="all:initial!important;position:fixed!important;left:0!important;top:0!important;width:0!important;height:0!important;visibility:hidden!important";try{if((containingBlock.shadowRoot??containingBlock).appendChild(probe),probe.getClientRects().length===0)return;const origin=validatedClientRect(probe.getBoundingClientRect(),"place() fixed origin");probe.style.setProperty("width","100px","important"),probe.style.setProperty("height","100px","important");const size2=validatedClientRect(probe.getBoundingClientRect(),"place() fixed scale"),scale={x:size2.width/100,y:size2.height/100};return scale.x>0&&scale.y>0?{origin,scale}:void 0}finally{probe.remove()}}async function popupRectAtPosition(anchor,popup,strategy,x,y,placementPlatform=platform){const currentRect=validatedClientRect(popup.getBoundingClientRect(),"place() popup rect"),offsetParent=await correctedGetOffsetParent(popup),rect=await placementPlatform.convertOffsetParentRelativeRectToViewportRelativeRect({elements:{reference:anchor,floating:popup},rect:{x,y,width:0,height:0},offsetParent,strategy}),{x:left,y:top}=rect,{width,height}=currentRect;return validatedClientRect({x:left,y:top,width,height,left,top,right:left+width,bottom:top+height},"place() converted popup rect")}function validatePlaceNumericOptions(opts){["offset","skidding","flipPadding","shiftPadding","padding","autoSizePadding","arrowPadding"].forEach((name,index)=>{const value=opts[name];value!==void 0&&finiteGeometry(value,`place() ${name}`,index>1)})}function validateAnchorBeforeSetup(anchor){try{validatedClientRect(anchor.getBoundingClientRect(),"place() anchor rect")}catch(error){if(error instanceof PositionerGeometryError)throw error}}function place(anchor,popup,opts={}){return placeImpl(anchor,popup,opts)}const MAX_ESCAPE_RERUNS=2;function placeImpl(anchor,popup,opts,hooks){validatePlaceNumericOptions(opts),validateAnchorBeforeSetup(anchor);const placementRun=placementSyncOwnership.beginPlacement(popup),strategy=opts.strategy??"fixed";popup.style.position=strategy,popup.style.margin="0";const padding=opts.padding??8,sync=opts.sync,autoSize=opts.autoSize,hoverBridge=opts.hoverBridge;let disposed=!1,escapeReruns=0,stopAutoUpdate,stopResize,stopScroll,scrollFrame,updateGeneration=0;const openStyleTransactions=new Set,view=popup.ownerDocument.defaultView??window,visualViewport=view.visualViewport,updateFromVisualViewport=()=>update(),cancelScrollFrame=()=>{scrollFrame!==void 0&&(view.cancelAnimationFrame(scrollFrame),scrollFrame=void 0)},updateFromScroll=()=>{disposed||(updateGeneration++,scrollFrame===void 0&&(scrollFrame=view.requestAnimationFrame(()=>{scrollFrame=void 0,update()})))},dispose=()=>{if(!disposed){disposed=!0,updateGeneration++,cancelScrollFrame(),stopScroll?.(),stopResize?.(),stopAutoUpdate?.(),stopAutoUpdate=void 0,visualViewport?.removeEventListener("resize",updateFromVisualViewport);for(const transaction of[...openStyleTransactions].reverse())transaction.rollback();openStyleTransactions.clear()}};sync||placementSyncOwnership.release(popup,placementRun);const middlewareFor=(styleTransaction,stagedStyles,isCurrent)=>[offset({mainAxis:opts.offset??4,crossAxis:opts.skidding??0}),sync?size({apply({rects,elements}){if(!isCurrent())return;const referenceWidth=finiteGeometry(rects.reference.width,"place() reference width",!0),referenceHeight=finiteGeometry(rects.reference.height,"place() reference height",!0);styleTransaction.set(elements.floating,"width",sync==="width"||sync==="both"?`${referenceWidth}px`:""),styleTransaction.set(elements.floating,"height",sync==="height"||sync==="both"?`${referenceHeight}px`:"")}}):void 0,opts.flip===!1?void 0:flip({boundary:opts.flipBoundary??opts.boundary,fallbackPlacements:opts.flipFallbackPlacements,fallbackStrategy:opts.flipFallbackStrategy==="initial-placement"?"initialPlacement":opts.flipFallbackStrategy==="best-fit"?"bestFit":void 0,padding:opts.flipPadding}),opts.shift===!1?void 0:shift({boundary:opts.shiftBoundary??opts.boundary,padding:opts.shiftPadding??padding}),opts.arrow?arrow({element:opts.arrow,padding:opts.arrowPadding??0}):void 0,size({boundary:opts.boundary,padding,apply({availableWidth,availableHeight}){isCurrent()&&(stagedStyles.availableInline=`${Math.max(0,finiteGeometry(availableWidth,"place() available width"))}px`,stagedStyles.availableBlock=`${Math.max(0,finiteGeometry(availableHeight,"place() available height"))}px`)}}),autoSize?size({boundary:opts.autoSizeBoundary??opts.boundary,padding:opts.autoSizePadding??0,apply({availableWidth,availableHeight}){isCurrent()&&((autoSize==="horizontal"||autoSize==="both")&&(stagedStyles.availableInline=`${Math.max(0,finiteGeometry(availableWidth,"place() auto-size available width"))}px`),(autoSize==="vertical"||autoSize==="both")&&(stagedStyles.availableBlock=`${Math.max(0,finiteGeometry(availableHeight,"place() auto-size available height"))}px`))}}):void 0,...hooks?.middleware??[]].filter(entry=>entry!==void 0);function update(){if(disposed)return;cancelScrollFrame();const generation=++updateGeneration,isCurrent=()=>!disposed&&generation===updateGeneration;try{validatedClientRect(anchor.getBoundingClientRect(),"place() anchor rect")}catch{dispose();return}try{hooks?.beforeCompute()}catch{}const updateRun=placementSyncOwnership.beginUpdate(placementRun),styleTransaction=createPlacementStyleTransaction(),stagedStyles={};openStyleTransactions.add(styleTransaction);const rollback=()=>{styleTransaction.rollback(),openStyleTransactions.delete(styleTransaction)};let resolvedOffsetParent;const offsetParents=new Map,recordingGetOffsetParent=async(element,polyfill)=>{let pending=polyfill?void 0:offsetParents.get(element);pending||(pending=correctedGetOffsetParent(element,polyfill),polyfill||offsetParents.set(element,pending));const result=await pending;return element===popup&&(resolvedOffsetParent=result),result};let inlineCoordinates,inlineOffsetParent;const placementPlatform={...platform,getOffsetParent:recordingGetOffsetParent,async getElementRects(data){const rects=await platform.getElementRects.call(this,data),parent=resolvedOffsetParent;if(inlineCoordinates=strategy==="fixed"&&parent instanceof HTMLElement&&!(parent instanceof HTMLSlotElement)&&getComputedStyle(parent).display==="inline"&&["","normal","1"].includes(getComputedStyle(popup).zoom||"")?fixedInlineCoordinates(parent):void 0,inlineOffsetParent=inlineCoordinates?parent:void 0,!inlineCoordinates||!inlineOffsetParent)return rects;const viewport=await platform.convertOffsetParentRelativeRectToViewportRelativeRect({elements:{reference:data.reference,floating:data.floating},rect:rects.reference,offsetParent:inlineOffsetParent,strategy}),{origin,scale}=inlineCoordinates;return{...rects,reference:{x:finiteGeometry((viewport.x-origin.left)/scale.x,"place() inline reference x"),y:finiteGeometry((viewport.y-origin.top)/scale.y,"place() inline reference y"),width:finiteGeometry(viewport.width/scale.x,"place() inline reference width"),height:finiteGeometry(viewport.height/scale.y,"place() inline reference height")}}},getScale(element){return inlineCoordinates&&element===inlineOffsetParent?inlineCoordinates.scale:platform.getScale(element)},convertOffsetParentRelativeRectToViewportRelativeRect(data){if(inlineCoordinates&&data.offsetParent===inlineOffsetParent&&data.strategy==="fixed"){const{origin,scale}=inlineCoordinates;return{x:origin.left+data.rect.x*scale.x,y:origin.top+data.rect.y*scale.y,width:data.rect.width*scale.x,height:data.rect.height*scale.y}}return platform.convertOffsetParentRelativeRectToViewportRelativeRect(data)}};computePosition(anchor,popup,{strategy,placement:opts.placement??"bottom-start",middleware:middlewareFor(styleTransaction,stagedStyles,isCurrent),platform:placementPlatform}).then(async({x,y,placement,middlewareData})=>{if(!isCurrent()){rollback();return}let bridgeQuad;try{if(finiteGeometry(x,"place() resolved x"),finiteGeometry(y,"place() resolved y"),middlewareData.arrow?.x!==void 0&&finiteGeometry(middlewareData.arrow.x,"place() resolved arrow x"),middlewareData.arrow?.y!==void 0&&finiteGeometry(middlewareData.arrow.y,"place() resolved arrow y"),hooks&&escapeReruns<MAX_ESCAPE_RERUNS){const view2=popup.ownerDocument.defaultView??window;let rerun=!1;try{rerun=hooks.afterResolve(resolvedOffsetParent??view2,middlewareData)}catch{rerun=!1}if(rerun){escapeReruns++,rollback(),update();return}}if(escapeReruns=0,hoverBridge){const anchorRect=validatedClientRect(anchor.getBoundingClientRect(),"place() anchor rect"),placedPopupRect=await popupRectAtPosition(anchor,popup,strategy,x,y,placementPlatform);if(!isCurrent()){rollback();return}bridgeQuad=hoverBridgeQuad(anchorRect,placedPopupRect,placement)}if(!isCurrent()){rollback();return}stagedStyles.availableInline!==void 0&&styleTransaction.set(popup,"--lr-positioner-available-inline-size",stagedStyles.availableInline),stagedStyles.availableBlock!==void 0&&styleTransaction.set(popup,"--lr-positioner-available-block-size",stagedStyles.availableBlock),styleTransaction.set(popup,"left",`${finiteGeometry(x,"place() resolved x")}px`),styleTransaction.set(popup,"top",`${finiteGeometry(y,"place() resolved y")}px`),hoverBridge&&bridgeQuad&&writeHoverBridge(hoverBridge,bridgeQuad,styleTransaction);const ownedSyncDimensions=sync?{width:styleTransaction.ownedValue(popup,"width"),height:styleTransaction.ownedValue(popup,"height")}:void 0;styleTransaction.commit(),openStyleTransactions.delete(styleTransaction),sync&&placementSyncOwnership.publish(popup,updateRun,ownedSyncDimensions??{})}catch{isCurrent()?dispose():rollback();return}opts.onPlaced?.({placement,arrow:middlewareData.arrow})},()=>{isCurrent()?dispose():rollback()})}const reference=anchor.nodeType===1?anchor:anchor.contextElement,scrollTargets=new Set([...reference?getOverflowAncestors(reference):[],...getOverflowAncestors(popup),...visualViewport?[visualViewport]:[]]);for(const target of scrollTargets)target.addEventListener("scroll",updateFromScroll,{passive:!0}),target.addEventListener("resize",cancelScrollFrame);stopScroll=()=>{for(const target of scrollTargets)target.removeEventListener("scroll",updateFromScroll),target.removeEventListener("resize",cancelScrollFrame)};const stop=autoUpdate(anchor,popup,()=>{scrollFrame===void 0&&update()},{elementResize:!1,ancestorScroll:!1});return disposed?(stop(),dispose):(stopAutoUpdate=stop,stopResize=observeElementResize(anchor,popup,update),visualViewport?.addEventListener("resize",updateFromVisualViewport),dispose)}function isWindowLike(value){return!(value instanceof Element)}function placeAnchoredSurface(anchor,popup,opts={}){validatePlaceNumericOptions(opts),validateAnchorBeforeSetup(anchor);const bridge=opts.hoverBridge,fixed=(opts.strategy??"fixed")==="fixed",escape=(element,eligible)=>{isLibraryPromotedAndShowing(element)||(eligible&&(opts.topLayer||needsTopLayerEscape(element))?promoteToTopLayer(element,popup):stripStaleTopLayer(element))},referenceHidden=hide({strategy:"referenceHidden"}),referenceElement=anchor instanceof Element?anchor:anchor.contextElement??null,referenceMeasurable=()=>referenceElement!==null&&!hasTopLayerAncestor(referenceElement);return bridge&&escape(bridge,!0),escape(popup,fixed),placeImpl(anchor,popup,opts,{beforeCompute(){bridge&&escape(bridge,!0),fixed&&compensateAncestorZoom(popup,null),bridge&&compensateAncestorZoom(bridge,null,popup)},middleware:[{name:referenceHidden.name,options:referenceHidden.options,fn:async state=>{if(!fixed||!referenceMeasurable())return{};const result=await referenceHidden.fn(state),offsets=result.data?.referenceHiddenOffsets,{width,height}=state.rects.reference;return!offsets||width>0&&height>0?result:{data:{...result.data,referenceHidden:offsets.top>0||offsets.right>0||offsets.bottom>0||offsets.left>0}}}}],afterResolve(offsetParent,data){return applyReferenceHidden(popup,data.hide?.referenceHidden===!0),fixed?isWindowLike(offsetParent)||isLibraryPromotedAndShowing(popup)?!1:promoteToTopLayer(popup):compensateAncestorZoom(popup,isWindowLike(offsetParent)?null:offsetParent)}})}function trackRect(target,onUpdate){const update=()=>onUpdate(target.getBoundingClientRect()),stopAutoUpdate=autoUpdate(target,target,update),visualViewport=target.ownerDocument.defaultView?.visualViewport,onVisualViewportChange=()=>update();return visualViewport?.addEventListener("resize",onVisualViewportChange),visualViewport?.addEventListener("scroll",onVisualViewportChange),()=>{stopAutoUpdate(),visualViewport?.removeEventListener("resize",onVisualViewportChange),visualViewport?.removeEventListener("scroll",onVisualViewportChange)}}function observeElementResize(anchor,popup,update){const view=popup.ownerDocument.defaultView;let active=!0,frame;const observer=view?.ResizeObserver?new view.ResizeObserver(()=>{!active||frame!==void 0||(frame=view.requestAnimationFrame(()=>{frame=void 0,active&&update()}))}):void 0,reference=anchor.nodeType===1?anchor:anchor.contextElement;return reference&&observer?.observe(reference),observer?.observe(popup),()=>{active=!1,observer?.disconnect(),frame!==void 0&&view?.cancelAnimationFrame(frame)}}export{createPlacementStyleTransaction,createPlacementSyncOwnershipController,place,placeAnchoredSurface,releaseTopLayer,trackRect,virtualAnchorFromRect};
@@ -22,3 +22,5 @@ export declare function assertTableDimensions(rowCount:number,columnCount:number
22
22
  export declare function assertTableSize(rows:readonly unknown[][],maxRows?:number,maxColumns?:number):void;
23
23
  /** Reads a response with a hard cap, including when the server omits Content-Length. */
24
24
  export declare function readResponseArrayBuffer(response:Response,maxBytes?:number):Promise<ArrayBuffer>;export declare function readResponseText(response:Response,maxBytes?:number):Promise<string>;
25
+ /** Gives rendering and input a turn between bounded parser passes. */
26
+ export declare function yieldViewerTask(view:Window|null,isCurrent:()=>boolean):Promise<void>;
@@ -1 +1 @@
1
- import{safeFetchUrl}from"./safe-url.js";const DEFAULT_MAX_RESOURCE_BYTES=25*1024*1024,MAX_RESOURCE_STREAM_CHUNKS=65536,DEFAULT_MAX_TABLE_ROWS=1e4,DEFAULT_MAX_TABLE_COLUMNS=1e3;class LyraResourceLimitError extends Error{constructor(message="The resource exceeds the configured size limit."){super(message),this.name="LyraResourceLimitError"}}class LyraUserFacingError extends Error{constructor(message){super(message),this.name="LyraUserFacingError"}}function resolveOwnerFetchTarget(element,source){if(!element.isConnected)return null;const view=element.ownerDocument.defaultView;if(!view||typeof view.fetch!="function")return null;const safeSource=safeFetchUrl(source,view.URL);if(safeSource===null)return null;try{const url=safeFetchUrl(new view.URL(safeSource,element.ownerDocument.baseURI).href,view.URL);return url===null?null:{url,view}}catch{return null}}function isAbortError(error){return typeof error=="object"&&error!==null&&"name"in error&&error.name==="AbortError"}function isResourceLimitError(error){return error instanceof LyraResourceLimitError}function validateLimit(limit){return Number.isFinite(limit)&&limit>0?Math.floor(limit):DEFAULT_MAX_RESOURCE_BYTES}function assertTableDimensions(rowCount,columnCount,maxRows=DEFAULT_MAX_TABLE_ROWS,maxColumns=DEFAULT_MAX_TABLE_COLUMNS){if(rowCount>maxRows)throw new LyraResourceLimitError("The table contains too many rows.");if(columnCount>maxColumns)throw new LyraResourceLimitError("The table contains too many columns.")}function assertTableSize(rows,maxRows=DEFAULT_MAX_TABLE_ROWS,maxColumns=DEFAULT_MAX_TABLE_COLUMNS){if(rows.length>maxRows)throw new LyraResourceLimitError("The table contains too many rows.");if(rows.some(row=>row.length>maxColumns))throw new LyraResourceLimitError("The table contains too many columns.")}function checkContentLength(response,limit){const headers=response.headers,contentLength=Number(headers?.get("content-length"));if(Number.isFinite(contentLength)&&contentLength>limit)throw new LyraResourceLimitError}async function readResponseArrayBuffer(response,maxBytes=DEFAULT_MAX_RESOURCE_BYTES){const limit=validateLimit(maxBytes);if(checkContentLength(response,limit),!response.body){const source=response,buffer=source.arrayBuffer?await source.arrayBuffer():new TextEncoder().encode(await source.text?.()??"").buffer;if(buffer.byteLength>limit)throw new LyraResourceLimitError;return buffer}const reader=response.body.getReader();let output=new Uint8Array(0),total=0,chunkCount=0;const rejectStream=async message=>{try{await reader.cancel()}catch{}throw new LyraResourceLimitError(message)};try{for(;;){const{done,value}=await reader.read();if(done)break;chunkCount+=1,chunkCount>MAX_RESOURCE_STREAM_CHUNKS&&await rejectStream("The resource stream contains too many chunks.");const nextTotal=total+value.byteLength;if(nextTotal>limit&&await rejectStream(),nextTotal>output.byteLength){let capacity=output.byteLength||Math.min(limit,Math.max(1024,value.byteLength));for(;capacity<nextTotal;)capacity=Math.min(limit,Math.max(nextTotal,capacity*2));const grown=new Uint8Array(capacity);grown.set(output.subarray(0,total)),output=grown}output.set(value,total),total=nextTotal}}finally{reader.releaseLock()}return output.slice(0,total).buffer}async function readResponseText(response,maxBytes=DEFAULT_MAX_RESOURCE_BYTES){return new TextDecoder().decode(await readResponseArrayBuffer(response,maxBytes))}export{DEFAULT_MAX_RESOURCE_BYTES,DEFAULT_MAX_TABLE_COLUMNS,DEFAULT_MAX_TABLE_ROWS,LyraResourceLimitError,LyraUserFacingError,MAX_RESOURCE_STREAM_CHUNKS,assertTableDimensions,assertTableSize,isAbortError,isResourceLimitError,readResponseArrayBuffer,readResponseText,resolveOwnerFetchTarget};
1
+ import{safeFetchUrl}from"./safe-url.js";const DEFAULT_MAX_RESOURCE_BYTES=25*1024*1024,MAX_RESOURCE_STREAM_CHUNKS=65536,DEFAULT_MAX_TABLE_ROWS=1e4,DEFAULT_MAX_TABLE_COLUMNS=1e3;class LyraResourceLimitError extends Error{constructor(message="The resource exceeds the configured size limit."){super(message),this.name="LyraResourceLimitError"}}class LyraUserFacingError extends Error{constructor(message){super(message),this.name="LyraUserFacingError"}}function resolveOwnerFetchTarget(element,source){if(!element.isConnected)return null;const view=element.ownerDocument.defaultView;if(!view||typeof view.fetch!="function")return null;const safeSource=safeFetchUrl(source,view.URL);if(safeSource===null)return null;try{const url=safeFetchUrl(new view.URL(safeSource,element.ownerDocument.baseURI).href,view.URL);return url===null?null:{url,view}}catch{return null}}function isAbortError(error){return typeof error=="object"&&error!==null&&"name"in error&&error.name==="AbortError"}function isResourceLimitError(error){return error instanceof LyraResourceLimitError}function validateLimit(limit){return Number.isFinite(limit)&&limit>0?Math.floor(limit):DEFAULT_MAX_RESOURCE_BYTES}function assertTableDimensions(rowCount,columnCount,maxRows=DEFAULT_MAX_TABLE_ROWS,maxColumns=DEFAULT_MAX_TABLE_COLUMNS){if(rowCount>maxRows)throw new LyraResourceLimitError("The table contains too many rows.");if(columnCount>maxColumns)throw new LyraResourceLimitError("The table contains too many columns.")}function assertTableSize(rows,maxRows=DEFAULT_MAX_TABLE_ROWS,maxColumns=DEFAULT_MAX_TABLE_COLUMNS){if(rows.length>maxRows)throw new LyraResourceLimitError("The table contains too many rows.");if(rows.some(row=>row.length>maxColumns))throw new LyraResourceLimitError("The table contains too many columns.")}function checkContentLength(response,limit){const headers=response.headers,contentLength=Number(headers?.get("content-length"));if(Number.isFinite(contentLength)&&contentLength>limit)throw new LyraResourceLimitError}async function readResponseArrayBuffer(response,maxBytes=DEFAULT_MAX_RESOURCE_BYTES){const limit=validateLimit(maxBytes);if(checkContentLength(response,limit),!response.body){const source=response,buffer=source.arrayBuffer?await source.arrayBuffer():new TextEncoder().encode(await source.text?.()??"").buffer;if(buffer.byteLength>limit)throw new LyraResourceLimitError;return buffer}const reader=response.body.getReader();let output=new Uint8Array(0),total=0,chunkCount=0;const rejectStream=async message=>{try{await reader.cancel()}catch{}throw new LyraResourceLimitError(message)};try{for(;;){const{done,value}=await reader.read();if(done)break;chunkCount+=1,chunkCount>MAX_RESOURCE_STREAM_CHUNKS&&await rejectStream("The resource stream contains too many chunks.");const nextTotal=total+value.byteLength;if(nextTotal>limit&&await rejectStream(),nextTotal>output.byteLength){let capacity=output.byteLength||Math.min(limit,Math.max(1024,value.byteLength));for(;capacity<nextTotal;)capacity=Math.min(limit,Math.max(nextTotal,capacity*2));const grown=new Uint8Array(capacity);grown.set(output.subarray(0,total)),output=grown}output.set(value,total),total=nextTotal}}finally{reader.releaseLock()}return output.slice(0,total).buffer}async function readResponseText(response,maxBytes=DEFAULT_MAX_RESOURCE_BYTES){return new TextDecoder().decode(await readResponseArrayBuffer(response,maxBytes))}async function yieldViewerTask(view,isCurrent){const scheduler=view?.scheduler;if(scheduler?.yield?await scheduler.yield():view&&"requestIdleCallback"in view?await new Promise(resolve=>view.requestIdleCallback(()=>resolve(),{timeout:50})):await new Promise(resolve=>(view??globalThis).setTimeout(resolve,0)),!isCurrent())throw new DOMException("The viewer source changed.","AbortError")}export{DEFAULT_MAX_RESOURCE_BYTES,DEFAULT_MAX_TABLE_COLUMNS,DEFAULT_MAX_TABLE_ROWS,LyraResourceLimitError,LyraUserFacingError,MAX_RESOURCE_STREAM_CHUNKS,assertTableDimensions,assertTableSize,isAbortError,isResourceLimitError,readResponseArrayBuffer,readResponseText,resolveOwnerFetchTarget,yieldViewerTask};
@@ -1 +1 @@
1
- const scopedDefinitionClosures=Object.freeze({"lr-accordion":["lr-accordion"],"lr-accordion-item":["lr-accordion-item"],"lr-activity-feed":["lr-activity-feed","lr-live-region","lr-virtual-list"],"lr-agent-eval-dashboard":["lr-agent-eval-dashboard","lr-badge","lr-lite-chart","lr-live-region","lr-stat"],"lr-agent-question":["lr-agent-question","lr-number-input","lr-option","lr-select","lr-tool-param-form"],"lr-agent-run":["lr-agent-run","lr-badge","lr-empty","lr-generation-metrics","lr-live-region","lr-task-list","lr-usage-badge"],"lr-agent-trace":["lr-agent-trace","lr-empty","lr-graph-legend","lr-handoff-divider","lr-live-region","lr-trace-tree"],"lr-agent-workspace":["lr-agent-run","lr-agent-workspace","lr-attachment-chip","lr-badge","lr-button","lr-card","lr-chat-composer","lr-chat-message","lr-chat-viewport","lr-checkbox","lr-chunk-inspector","lr-citation-badge","lr-claim-evidence","lr-context-inspector","lr-context-meter","lr-copy-button","lr-details","lr-empty","lr-export-button","lr-generation-metrics","lr-grounding-summary","lr-icon-button","lr-json-viewer","lr-live-region","lr-markdown","lr-media-card","lr-message-parts","lr-result-card","lr-result-field","lr-retrieval-results","lr-skeleton","lr-spinner","lr-stat","lr-task-list","lr-thinking-panel","lr-tool-approval-dialog","lr-tool-call-block","lr-tool-call-chip","lr-tool-result-view","lr-tool-timeline","lr-tooltip","lr-usage-badge","lr-virtual-list","lr-widget-renderer"],"lr-alert":["lr-alert","lr-toast","lr-toast-item"],"lr-animated-image":["lr-animated-image"],"lr-animation":["lr-animation"],"lr-app-rail":["lr-app-rail","lr-app-rail-item"],"lr-app-rail-group":["lr-app-rail-group"],"lr-app-rail-item":["lr-app-rail-item"],"lr-approval-queue":["lr-approval-queue","lr-badge","lr-button","lr-json-viewer","lr-tool-approval-dialog"],"lr-archive-viewer":["lr-archive-viewer","lr-virtual-list"],"lr-artifact-panel":["lr-artifact-panel","lr-live-region"],"lr-attachment-chip":["lr-attachment-chip"],"lr-attachment-trigger":["lr-attachment-trigger","lr-dropdown","lr-icon-button","lr-menu","lr-menu-item"],"lr-audio-visualizer":["lr-audio-visualizer"],"lr-av-player":["lr-av-player","lr-virtual-list"],"lr-avatar":["lr-avatar"],"lr-avatar-group":["lr-avatar-group"],"lr-background-runs":["lr-background-runs"],"lr-badge":["lr-badge"],"lr-bar-chart":["lr-bar-chart","lr-chart","lr-skeleton"],"lr-box-plot":["lr-box-plot","lr-skeleton"],"lr-branch-picker":["lr-branch-picker","lr-live-region"],"lr-breadcrumb":["lr-breadcrumb"],"lr-breadcrumb-item":["lr-breadcrumb-item"],"lr-browser-frame":["lr-browser-frame"],"lr-bubble-chart":["lr-bubble-chart","lr-chart","lr-skeleton"],"lr-budget-meter":["lr-budget-meter"],"lr-button":["lr-button"],"lr-button-group":["lr-button-group"],"lr-calendar":["lr-calendar"],"lr-calendar-viewer":["lr-calendar-viewer"],"lr-callout":["lr-callout","lr-icon-button"],"lr-card":["lr-card"],"lr-carousel":["lr-carousel"],"lr-carousel-item":["lr-carousel-item"],"lr-change-review":["lr-change-review","lr-diff-view"],"lr-chart":["lr-chart","lr-skeleton"],"lr-chat-composer":["lr-chat-composer"],"lr-chat-message":["lr-chat-message"],"lr-chat-viewport":["lr-chat-viewport"],"lr-checkbox":["lr-checkbox"],"lr-checkbox-group":["lr-checkbox-group"],"lr-checkpoint":["lr-checkpoint"],"lr-chip":["lr-chip"],"lr-chip-group":["lr-chip-group"],"lr-chunk-inspector":["lr-chunk-inspector","lr-empty","lr-virtual-list"],"lr-citation-badge":["lr-citation-badge"],"lr-claim-evidence":["lr-badge","lr-citation-badge","lr-claim-evidence","lr-empty"],"lr-code-block":["lr-code-block","lr-icon-button","lr-skeleton"],"lr-code-block-core":["lr-code-block-core","lr-icon-button","lr-skeleton"],"lr-code-editor":["lr-code-editor"],"lr-color-picker":["lr-color-picker"],"lr-combobox":["lr-combobox","lr-empty","lr-option"],"lr-command-palette":["lr-command-palette"],"lr-commit-card":["lr-commit-card"],"lr-community-card":["lr-button","lr-chip","lr-community-card","lr-empty"],"lr-compare-panel":["lr-compare-panel","lr-live-region"],"lr-condition-builder":["lr-button","lr-combobox","lr-condition-builder","lr-date-input","lr-date-picker","lr-empty","lr-icon","lr-icon-button","lr-input","lr-option","lr-select"],"lr-confirm-bar":["lr-button","lr-confirm-bar","lr-details","lr-json-viewer","lr-live-region"],"lr-connector-manager":["lr-button","lr-connector-manager"],"lr-contact-viewer":["lr-contact-viewer"],"lr-context-inspector":["lr-citation-badge","lr-context-inspector","lr-context-meter","lr-copy-button","lr-empty","lr-export-button","lr-icon-button","lr-tooltip"],"lr-context-menu":["lr-context-menu","lr-dropdown","lr-menu","lr-menu-item"],"lr-context-meter":["lr-context-meter"],"lr-control-group":["lr-control-group"],"lr-conversation-item":["lr-conversation-item"],"lr-copy-button":["lr-copy-button","lr-icon-button","lr-tooltip"],"lr-country-picker":["lr-combobox","lr-country-picker","lr-empty","lr-option","lr-select"],"lr-csv-viewer":["lr-csv-viewer","lr-virtual-list"],"lr-currency-picker":["lr-combobox","lr-currency-picker","lr-empty","lr-option","lr-select"],"lr-dashboard-grid":["lr-badge","lr-button","lr-card","lr-dashboard-grid","lr-empty","lr-markdown","lr-media-card","lr-result-card","lr-result-field","lr-stat","lr-widget","lr-widget-renderer"],"lr-data-grid":["lr-button","lr-data-grid","lr-dropdown","lr-dropdown-item","lr-empty","lr-menu","lr-menu-item"],"lr-dataset-viewer":["lr-dataset-viewer","lr-virtual-list"],"lr-date-input":["lr-date-input","lr-date-picker"],"lr-date-picker":["lr-date-picker"],"lr-details":["lr-details"],"lr-dialog":["lr-dialog","lr-icon-button"],"lr-diff-view":["lr-diff-view"],"lr-divider":["lr-divider"],"lr-dock-panel":["lr-dock-panel"],"lr-document-compare":["lr-diff-view","lr-document-compare","lr-document-preview","lr-pan-zoom"],"lr-document-library":["lr-checkbox","lr-chip","lr-chip-group","lr-combobox","lr-document-library","lr-empty","lr-file-icon","lr-input","lr-option","lr-pagination","lr-skeleton","lr-spinner","lr-table"],"lr-document-preview":["lr-document-preview","lr-pan-zoom"],"lr-document-viewer":["lr-dialog","lr-document-preview","lr-document-viewer","lr-icon-button","lr-pan-zoom"],"lr-docx-viewer":["lr-docx-viewer"],"lr-doughnut-chart":["lr-chart","lr-doughnut-chart","lr-skeleton"],"lr-drawer":["lr-drawer","lr-icon-button"],"lr-drilldown-panel":["lr-badge","lr-breadcrumb","lr-breadcrumb-item","lr-button","lr-chip","lr-document-preview","lr-drilldown-panel","lr-empty","lr-entity-card","lr-pan-zoom","lr-result-field","lr-source-card","lr-tab","lr-tab-group","lr-tab-panel"],"lr-drop-zone":["lr-drop-zone"],"lr-dropdown":["lr-dropdown","lr-menu","lr-menu-item"],"lr-dropdown-item":["lr-dropdown-item","lr-menu","lr-menu-item"],"lr-ebook-viewer":["lr-ebook-viewer"],"lr-email-viewer":["lr-email-viewer"],"lr-embedding-explorer":["lr-embedding-explorer"],"lr-emoji-picker":["lr-emoji-picker"],"lr-empty":["lr-empty"],"lr-entity-card":["lr-badge","lr-button","lr-chip","lr-empty","lr-entity-card","lr-result-field"],"lr-entity-chip":["lr-entity-chip"],"lr-entity-dossier":["lr-badge","lr-button","lr-chip","lr-chunk-inspector","lr-community-card","lr-empty","lr-entity-card","lr-entity-chip","lr-entity-dossier","lr-neighbor-list","lr-path-strip","lr-provenance-panel","lr-result-field","lr-scroller","lr-stat","lr-tab","lr-tab-group","lr-tab-panel","lr-virtual-list"],"lr-env-list":["lr-empty","lr-env-list"],"lr-eval-dataset":["lr-chip","lr-chip-group","lr-empty","lr-eval-dataset","lr-export-button","lr-file-input","lr-input","lr-pagination","lr-skeleton","lr-spinner","lr-table"],"lr-eval-result":["lr-checkbox","lr-checkbox-group","lr-diff-view","lr-empty","lr-eval-result","lr-option","lr-pagination","lr-rubric-form","lr-segmented","lr-select","lr-skeleton","lr-slider","lr-spinner","lr-table","lr-textarea"],"lr-eval-run":["lr-badge","lr-button","lr-citation-badge","lr-claim-evidence","lr-code-block","lr-copy-button","lr-details","lr-empty","lr-eval-run","lr-grounding-summary","lr-icon-button","lr-json-viewer","lr-live-region","lr-markdown","lr-progress-bar","lr-skeleton","lr-stat","lr-tool-approval-dialog","lr-tool-call-chip","lr-tool-result-view","lr-tool-timeline","lr-tooltip"],"lr-export-button":["lr-export-button"],"lr-file-icon":["lr-file-icon"],"lr-file-input":["lr-file-input"],"lr-file-tree":["lr-empty","lr-file-icon","lr-file-tree","lr-live-region","lr-tree","lr-tree-item"],"lr-filter-bar":["lr-button","lr-chip","lr-chip-group","lr-combobox","lr-date-input","lr-date-picker","lr-dropdown","lr-dropdown-item","lr-empty","lr-filter-bar","lr-input","lr-menu","lr-menu-item","lr-option","lr-select","lr-spinner"],"lr-flag":["lr-flag","lr-skeleton"],"lr-flow-canvas":["lr-empty","lr-flow-canvas","lr-flow-node"],"lr-flow-controls":["lr-flow-controls"],"lr-flow-minimap":["lr-flow-minimap"],"lr-flow-node":["lr-flow-node"],"lr-flow-run-status":["lr-flow-run-status"],"lr-format-bytes":["lr-format-bytes"],"lr-format-date":["lr-format-date"],"lr-format-number":["lr-format-number"],"lr-funnel":["lr-funnel"],"lr-gauge":["lr-gauge"],"lr-generation-metrics":["lr-generation-metrics"],"lr-geojson-viewer":["lr-geojson-viewer","lr-json-viewer","lr-map","lr-skeleton"],"lr-graph":["lr-graph","lr-skeleton"],"lr-graph-legend":["lr-graph-legend"],"lr-graph-query-builder":["lr-chip","lr-chip-group","lr-graph-query-builder","lr-input","lr-option","lr-select"],"lr-grounding-summary":["lr-badge","lr-citation-badge","lr-claim-evidence","lr-empty","lr-grounding-summary","lr-stat"],"lr-handoff-divider":["lr-handoff-divider"],"lr-heatmap":["lr-heatmap"],"lr-highlight-layer":["lr-highlight-layer"],"lr-histogram":["lr-chart","lr-histogram","lr-skeleton"],"lr-html-viewer":["lr-html-viewer"],"lr-icon":["lr-icon"],"lr-icon-button":["lr-icon","lr-icon-button"],"lr-image-comparer":["lr-image-comparer"],"lr-image-viewer":["lr-image-viewer","lr-live-region","lr-pan-zoom"],"lr-include":["lr-include"],"lr-ingestion-queue":["lr-badge","lr-empty","lr-ingestion-queue","lr-progress-bar","lr-virtual-list"],"lr-input":["lr-input"],"lr-intersection-observer":["lr-intersection-observer"],"lr-json-schema-viewer":["lr-badge","lr-empty","lr-json-schema-viewer"],"lr-json-viewer":["lr-json-viewer"],"lr-kbd":["lr-kbd"],"lr-knowledge-base":["lr-badge","lr-button","lr-dropdown","lr-empty","lr-knowledge-base","lr-menu","lr-menu-item","lr-pagination","lr-skeleton","lr-spinner","lr-stat","lr-table"],"lr-knowledge-base-admin":["lr-badge","lr-button","lr-dropdown","lr-empty","lr-ingestion-queue","lr-knowledge-base","lr-knowledge-base-admin","lr-menu","lr-menu-item","lr-pagination","lr-progress-bar","lr-skeleton","lr-spinner","lr-stat","lr-table","lr-virtual-list"],"lr-knowledge-graph-explorer":["lr-badge","lr-button","lr-chip","lr-empty","lr-entity-card","lr-graph","lr-graph-legend","lr-input","lr-knowledge-graph-explorer","lr-neighbor-list","lr-path-strip","lr-popover","lr-result-field","lr-scroller","lr-skeleton","lr-virtual-list"],"lr-known-date":["lr-known-date"],"lr-lightbox":["lr-lightbox","lr-pan-zoom"],"lr-line-chart":["lr-chart","lr-line-chart","lr-skeleton"],"lr-lite-chart":["lr-lite-chart","lr-live-region"],"lr-live-region":["lr-live-region"],"lr-locale-picker":["lr-flag","lr-locale-picker","lr-skeleton"],"lr-map":["lr-map","lr-skeleton"],"lr-markdown":["lr-markdown"],"lr-markdown-core":["lr-markdown-core"],"lr-mcp-app":["lr-mcp-app"],"lr-media-card":["lr-media-card"],"lr-memory-panel":["lr-button","lr-chip","lr-chunk-inspector","lr-community-card","lr-confirm-bar","lr-details","lr-empty","lr-entity-chip","lr-json-viewer","lr-live-region","lr-memory-panel","lr-path-strip","lr-provenance-panel","lr-scroller","lr-virtual-list"],"lr-mention-popover":["lr-mention-popover"],"lr-menu":["lr-menu","lr-menu-item"],"lr-menu-item":["lr-menu","lr-menu-item"],"lr-menu-label":["lr-menu-label"],"lr-menubar":["lr-menu","lr-menu-item","lr-menubar","lr-menubar-item"],"lr-menubar-item":["lr-menu","lr-menu-item","lr-menubar-item"],"lr-message-actions":["lr-chip","lr-copy-button","lr-icon-button","lr-message-actions","lr-message-feedback","lr-tooltip"],"lr-message-feedback":["lr-chip","lr-message-feedback"],"lr-message-parts":["lr-attachment-chip","lr-badge","lr-button","lr-card","lr-citation-badge","lr-copy-button","lr-details","lr-icon-button","lr-json-viewer","lr-markdown","lr-media-card","lr-message-parts","lr-result-card","lr-result-field","lr-skeleton","lr-stat","lr-thinking-panel","lr-tool-call-block","lr-tool-call-chip","lr-tool-result-view","lr-tooltip","lr-widget-renderer"],"lr-mind-map":["lr-mind-map"],"lr-model-select":["lr-model-select"],"lr-model-settings-panel":["lr-model-select","lr-model-settings-panel","lr-slider"],"lr-multi-split":["lr-multi-split"],"lr-mutation-observer":["lr-mutation-observer"],"lr-native-time-input":["lr-native-time-input"],"lr-navigation-menu":["lr-navigation-menu","lr-navigation-menu-item"],"lr-navigation-menu-item":["lr-navigation-menu-item"],"lr-neighbor-list":["lr-empty","lr-neighbor-list","lr-virtual-list"],"lr-node-palette":["lr-node-palette"],"lr-notebook-viewer":["lr-code-block","lr-icon-button","lr-json-viewer","lr-markdown","lr-notebook-viewer","lr-skeleton","lr-virtual-list"],"lr-number-input":["lr-number-input"],"lr-option":["lr-option"],"lr-otp-input":["lr-otp-input"],"lr-page":["lr-page"],"lr-page-rail":["lr-file-icon","lr-page-rail","lr-skeleton","lr-virtual-list"],"lr-pagination":["lr-pagination"],"lr-pan-zoom":["lr-pan-zoom"],"lr-path-strip":["lr-path-strip","lr-scroller"],"lr-pdf-viewer":["lr-highlight-layer","lr-pdf-viewer","lr-virtual-list"],"lr-permission-grant":["lr-button","lr-permission-grant"],"lr-permission-rules":["lr-permission-rules"],"lr-phone-input":["lr-flag","lr-phone-input","lr-skeleton"],"lr-pie-chart":["lr-chart","lr-pie-chart","lr-skeleton"],"lr-polar-area-chart":["lr-chart","lr-polar-area-chart","lr-skeleton"],"lr-policy-summary":["lr-badge","lr-details","lr-empty","lr-policy-summary"],"lr-poll-status":["lr-live-region","lr-poll-status"],"lr-popover":["lr-popover"],"lr-popup":["lr-popup"],"lr-pptx-viewer":["lr-pptx-viewer"],"lr-progress-bar":["lr-progress-bar"],"lr-progress-ring":["lr-progress-ring"],"lr-prompt-input":["lr-attachment-chip","lr-attachment-trigger","lr-button","lr-chat-composer","lr-checkbox","lr-dropdown","lr-empty","lr-file-icon","lr-icon-button","lr-input","lr-mention-popover","lr-menu","lr-menu-item","lr-model-select","lr-prompt-input","lr-prompt-queue","lr-source-picker","lr-textarea","lr-voice-picker"],"lr-prompt-queue":["lr-button","lr-prompt-queue","lr-textarea"],"lr-prompt-studio":["lr-prompt-studio"],"lr-provenance-panel":["lr-button","lr-chip","lr-chunk-inspector","lr-community-card","lr-empty","lr-entity-chip","lr-path-strip","lr-provenance-panel","lr-scroller","lr-virtual-list"],"lr-push-to-talk":["lr-live-region","lr-push-to-talk"],"lr-qr-code":["lr-qr-code"],"lr-radar-chart":["lr-chart","lr-radar-chart","lr-skeleton"],"lr-radio":["lr-radio"],"lr-radio-button":["lr-radio-button"],"lr-radio-group":["lr-radio-group"],"lr-rag-answer":["lr-badge","lr-button","lr-citation-badge","lr-claim-evidence","lr-empty","lr-grounding-summary","lr-markdown","lr-rag-answer","lr-source-card","lr-source-list","lr-spinner","lr-stat"],"lr-rag-eval-dashboard":["lr-empty","lr-lite-chart","lr-live-region","lr-rag-eval-dashboard","lr-stat"],"lr-random-content":["lr-random-content"],"lr-rating":["lr-rating"],"lr-realtime-session":["lr-audio-visualizer","lr-badge","lr-live-region","lr-push-to-talk","lr-realtime-session","lr-transcript-feed"],"lr-relative-time":["lr-relative-time"],"lr-reorder-item":["lr-icon-button","lr-reorder-item"],"lr-reorder-list":["lr-icon-button","lr-live-region","lr-reorder-item","lr-reorder-list"],"lr-research-progress":["lr-empty","lr-research-progress"],"lr-resize-observer":["lr-resize-observer"],"lr-responsive-panel":["lr-responsive-panel"],"lr-result-card":["lr-result-card"],"lr-result-field":["lr-result-field"],"lr-retrieval-compare":["lr-empty","lr-retrieval-compare"],"lr-retrieval-results":["lr-checkbox","lr-chunk-inspector","lr-empty","lr-retrieval-results","lr-spinner","lr-virtual-list"],"lr-retrieval-search":["lr-chip","lr-chip-group","lr-empty","lr-input","lr-retrieval-search","lr-segmented","lr-spinner"],"lr-retrieval-trace":["lr-chunk-inspector","lr-empty","lr-retrieval-trace","lr-span-waterfall","lr-virtual-list"],"lr-rubric-form":["lr-checkbox","lr-checkbox-group","lr-option","lr-rubric-form","lr-segmented","lr-select","lr-slider","lr-textarea"],"lr-scatter-chart":["lr-chart","lr-scatter-chart","lr-skeleton"],"lr-scroller":["lr-scroller"],"lr-segmented":["lr-segmented"],"lr-select":["lr-option","lr-select"],"lr-selection-toolbar":["lr-button","lr-selection-toolbar"],"lr-sequence-playback":["lr-sequence-playback"],"lr-sequence-strip":["lr-sequence-strip"],"lr-signature-pad":["lr-signature-pad"],"lr-skeleton":["lr-skeleton"],"lr-slider":["lr-slider"],"lr-source-card":["lr-source-card"],"lr-source-list":["lr-source-list"],"lr-source-picker":["lr-checkbox","lr-empty","lr-file-icon","lr-input","lr-source-picker"],"lr-span-waterfall":["lr-empty","lr-span-waterfall"],"lr-sparkline":["lr-sparkline"],"lr-spinner":["lr-spinner"],"lr-split-panel":["lr-split-panel"],"lr-spreadsheet-viewer":["lr-spreadsheet-viewer","lr-tab","lr-tab-group","lr-tab-panel","lr-virtual-list"],"lr-stack-trace":["lr-stack-trace"],"lr-stat":["lr-stat"],"lr-stepper":["lr-stepper"],"lr-stream-status":["lr-live-region","lr-stream-status"],"lr-streaming-text":["lr-markdown","lr-streaming-text"],"lr-streaming-text-core":["lr-markdown-core","lr-streaming-text-core"],"lr-subagent-panel":["lr-badge","lr-empty","lr-subagent-panel"],"lr-suggestion-chips":["lr-scroller","lr-suggestion-chips"],"lr-svg-viewer":["lr-pan-zoom","lr-svg-viewer"],"lr-swatch-picker":["lr-swatch-picker"],"lr-switch":["lr-switch"],"lr-tab":["lr-tab"],"lr-tab-group":["lr-tab-group"],"lr-tab-panel":["lr-tab-panel"],"lr-table":["lr-empty","lr-pagination","lr-skeleton","lr-spinner","lr-table"],"lr-tag":["lr-tag"],"lr-task-list":["lr-live-region","lr-task-list"],"lr-terminal":["lr-terminal","lr-virtual-list"],"lr-test-results":["lr-empty","lr-live-region","lr-spinner","lr-test-results"],"lr-textarea":["lr-textarea"],"lr-thinking-panel":["lr-thinking-panel"],"lr-thread-list":["lr-conversation-item","lr-empty","lr-live-region","lr-thread-list","lr-virtual-list"],"lr-time-input":["lr-time-input"],"lr-time-range":["lr-time-range"],"lr-time-zone-picker":["lr-combobox","lr-empty","lr-option","lr-select","lr-time-zone-picker"],"lr-timeline":["lr-relative-time","lr-timeline","lr-timeline-item"],"lr-timeline-item":["lr-relative-time","lr-timeline-item"],"lr-toast":["lr-toast","lr-toast-item"],"lr-toast-item":["lr-toast-item"],"lr-toggle":["lr-toggle"],"lr-toggle-group":["lr-toggle-group"],"lr-token-input":["lr-token-input"],"lr-tool-approval-dialog":["lr-button","lr-json-viewer","lr-tool-approval-dialog"],"lr-tool-call-block":["lr-copy-button","lr-icon-button","lr-json-viewer","lr-skeleton","lr-tool-call-block","lr-tool-result-view","lr-tooltip"],"lr-tool-call-chip":["lr-tool-call-chip"],"lr-tool-param-form":["lr-number-input","lr-option","lr-select","lr-tool-param-form"],"lr-tool-result-dialog":["lr-tool-result-dialog"],"lr-tool-result-view":["lr-copy-button","lr-icon-button","lr-json-viewer","lr-skeleton","lr-tool-result-view","lr-tooltip"],"lr-tool-select-dialog":["lr-checkbox","lr-switch","lr-tool-select-dialog"],"lr-tool-timeline":["lr-button","lr-copy-button","lr-details","lr-empty","lr-icon-button","lr-json-viewer","lr-skeleton","lr-tool-approval-dialog","lr-tool-call-chip","lr-tool-result-view","lr-tool-timeline","lr-tooltip"],"lr-tooltip":["lr-tooltip"],"lr-tour":["lr-tour"],"lr-trace-tree":["lr-empty","lr-live-region","lr-trace-tree"],"lr-transcript-feed":["lr-transcript-feed"],"lr-tree":["lr-empty","lr-live-region","lr-tree","lr-tree-item"],"lr-tree-item":["lr-tree-item"],"lr-typing-indicator":["lr-typing-indicator"],"lr-unit-picker":["lr-combobox","lr-empty","lr-option","lr-select","lr-unit-picker"],"lr-usage-badge":["lr-usage-badge"],"lr-video":["lr-icon","lr-video"],"lr-video-playlist":["lr-icon","lr-video","lr-video-playlist"],"lr-virtual-list":["lr-virtual-list"],"lr-visually-hidden":["lr-visually-hidden"],"lr-voice-picker":["lr-voice-picker"],"lr-widget":["lr-widget"],"lr-widget-renderer":["lr-badge","lr-button","lr-card","lr-markdown","lr-media-card","lr-result-card","lr-result-field","lr-stat","lr-widget-renderer"],"lr-word-cloud":["lr-word-cloud"],"lr-xml-viewer":["lr-xml-viewer"],"lr-zoomable-frame":["lr-zoomable-frame"]});export{scopedDefinitionClosures};
1
+ const scopedDefinitionClosures=Object.freeze({"lr-accordion":["lr-accordion"],"lr-accordion-item":["lr-accordion-item"],"lr-activity-feed":["lr-activity-feed","lr-live-region","lr-virtual-list"],"lr-agent-eval-dashboard":["lr-agent-eval-dashboard","lr-badge","lr-lite-chart","lr-live-region","lr-stat"],"lr-agent-question":["lr-agent-question","lr-number-input","lr-option","lr-select","lr-tool-param-form"],"lr-agent-run":["lr-agent-run","lr-badge","lr-empty","lr-generation-metrics","lr-live-region","lr-task-list","lr-usage-badge","lr-virtual-list"],"lr-agent-trace":["lr-agent-trace","lr-empty","lr-graph-legend","lr-handoff-divider","lr-live-region","lr-trace-tree","lr-virtual-list"],"lr-agent-workspace":["lr-agent-run","lr-agent-workspace","lr-attachment-chip","lr-badge","lr-button","lr-card","lr-chat-composer","lr-chat-message","lr-chat-viewport","lr-checkbox","lr-chunk-inspector","lr-citation-badge","lr-claim-evidence","lr-context-inspector","lr-context-meter","lr-copy-button","lr-details","lr-empty","lr-export-button","lr-generation-metrics","lr-grounding-summary","lr-icon-button","lr-json-viewer","lr-live-region","lr-markdown","lr-media-card","lr-message-parts","lr-pagination","lr-result-card","lr-result-field","lr-retrieval-results","lr-skeleton","lr-spinner","lr-stat","lr-task-list","lr-thinking-panel","lr-tool-approval-dialog","lr-tool-call-block","lr-tool-call-chip","lr-tool-result-view","lr-tool-timeline","lr-tooltip","lr-usage-badge","lr-virtual-list","lr-widget-renderer"],"lr-alert":["lr-alert","lr-toast","lr-toast-item"],"lr-animated-image":["lr-animated-image"],"lr-animation":["lr-animation"],"lr-app-rail":["lr-app-rail","lr-app-rail-item"],"lr-app-rail-group":["lr-app-rail-group"],"lr-app-rail-item":["lr-app-rail-item"],"lr-approval-queue":["lr-approval-queue","lr-badge","lr-button","lr-json-viewer","lr-tool-approval-dialog","lr-virtual-list"],"lr-archive-viewer":["lr-archive-viewer","lr-virtual-list"],"lr-artifact-panel":["lr-artifact-panel","lr-live-region"],"lr-attachment-chip":["lr-attachment-chip"],"lr-attachment-trigger":["lr-attachment-trigger","lr-dropdown","lr-icon-button","lr-menu","lr-menu-item"],"lr-audio-visualizer":["lr-audio-visualizer"],"lr-av-player":["lr-av-player","lr-virtual-list"],"lr-avatar":["lr-avatar"],"lr-avatar-group":["lr-avatar-group"],"lr-background-runs":["lr-background-runs"],"lr-badge":["lr-badge"],"lr-bar-chart":["lr-bar-chart","lr-chart","lr-skeleton"],"lr-box-plot":["lr-box-plot","lr-skeleton"],"lr-branch-picker":["lr-branch-picker","lr-live-region"],"lr-breadcrumb":["lr-breadcrumb"],"lr-breadcrumb-item":["lr-breadcrumb-item"],"lr-browser-frame":["lr-browser-frame"],"lr-bubble-chart":["lr-bubble-chart","lr-chart","lr-skeleton"],"lr-budget-meter":["lr-budget-meter"],"lr-button":["lr-button"],"lr-button-group":["lr-button-group"],"lr-calendar":["lr-calendar"],"lr-calendar-viewer":["lr-calendar-viewer"],"lr-callout":["lr-callout","lr-icon-button"],"lr-card":["lr-card"],"lr-carousel":["lr-carousel"],"lr-carousel-item":["lr-carousel-item"],"lr-change-review":["lr-change-review","lr-diff-view"],"lr-chart":["lr-chart","lr-skeleton"],"lr-chat-composer":["lr-chat-composer"],"lr-chat-message":["lr-chat-message"],"lr-chat-viewport":["lr-chat-viewport"],"lr-checkbox":["lr-checkbox"],"lr-checkbox-group":["lr-checkbox-group"],"lr-checkpoint":["lr-checkpoint"],"lr-chip":["lr-chip"],"lr-chip-group":["lr-chip-group"],"lr-chunk-inspector":["lr-chunk-inspector","lr-empty","lr-virtual-list"],"lr-citation-badge":["lr-citation-badge"],"lr-claim-evidence":["lr-badge","lr-citation-badge","lr-claim-evidence","lr-empty"],"lr-code-block":["lr-code-block","lr-icon-button","lr-skeleton"],"lr-code-block-core":["lr-code-block-core","lr-icon-button","lr-skeleton"],"lr-code-editor":["lr-code-editor"],"lr-color-picker":["lr-color-picker"],"lr-combobox":["lr-combobox","lr-empty","lr-option"],"lr-command-palette":["lr-command-palette"],"lr-commit-card":["lr-commit-card"],"lr-community-card":["lr-button","lr-chip","lr-community-card","lr-empty"],"lr-compare-panel":["lr-compare-panel","lr-live-region"],"lr-condition-builder":["lr-button","lr-combobox","lr-condition-builder","lr-date-input","lr-date-picker","lr-empty","lr-icon","lr-icon-button","lr-input","lr-option","lr-select"],"lr-confirm-bar":["lr-button","lr-confirm-bar","lr-details","lr-json-viewer","lr-live-region","lr-virtual-list"],"lr-connector-manager":["lr-button","lr-connector-manager"],"lr-contact-viewer":["lr-contact-viewer"],"lr-context-inspector":["lr-citation-badge","lr-context-inspector","lr-context-meter","lr-copy-button","lr-empty","lr-export-button","lr-icon-button","lr-tooltip"],"lr-context-menu":["lr-context-menu","lr-dropdown","lr-menu","lr-menu-item"],"lr-context-meter":["lr-context-meter"],"lr-control-group":["lr-control-group"],"lr-conversation-item":["lr-conversation-item"],"lr-copy-button":["lr-copy-button","lr-icon-button","lr-tooltip"],"lr-country-picker":["lr-combobox","lr-country-picker","lr-empty","lr-option","lr-select"],"lr-csv-viewer":["lr-csv-viewer","lr-virtual-list"],"lr-currency-picker":["lr-combobox","lr-currency-picker","lr-empty","lr-option","lr-select"],"lr-dashboard-grid":["lr-badge","lr-button","lr-card","lr-dashboard-grid","lr-empty","lr-markdown","lr-media-card","lr-result-card","lr-result-field","lr-stat","lr-widget","lr-widget-renderer"],"lr-data-grid":["lr-button","lr-data-grid","lr-dropdown","lr-dropdown-item","lr-empty","lr-menu","lr-menu-item"],"lr-dataset-viewer":["lr-dataset-viewer","lr-virtual-list"],"lr-date-input":["lr-date-input","lr-date-picker"],"lr-date-picker":["lr-date-picker"],"lr-details":["lr-details"],"lr-dialog":["lr-dialog","lr-icon-button"],"lr-diff-view":["lr-diff-view"],"lr-divider":["lr-divider"],"lr-dock-panel":["lr-dock-panel"],"lr-document-compare":["lr-diff-view","lr-document-compare","lr-document-preview","lr-pan-zoom"],"lr-document-library":["lr-checkbox","lr-chip","lr-chip-group","lr-combobox","lr-document-library","lr-empty","lr-file-icon","lr-input","lr-option","lr-pagination","lr-skeleton","lr-spinner","lr-table"],"lr-document-preview":["lr-document-preview","lr-pan-zoom"],"lr-document-viewer":["lr-dialog","lr-document-preview","lr-document-viewer","lr-icon-button","lr-pan-zoom"],"lr-docx-viewer":["lr-docx-viewer"],"lr-doughnut-chart":["lr-chart","lr-doughnut-chart","lr-skeleton"],"lr-drawer":["lr-drawer","lr-icon-button"],"lr-drilldown-panel":["lr-badge","lr-breadcrumb","lr-breadcrumb-item","lr-button","lr-chip","lr-document-preview","lr-drilldown-panel","lr-empty","lr-entity-card","lr-pan-zoom","lr-result-field","lr-source-card","lr-tab","lr-tab-group","lr-tab-panel"],"lr-drop-zone":["lr-drop-zone"],"lr-dropdown":["lr-dropdown","lr-menu","lr-menu-item"],"lr-dropdown-item":["lr-dropdown-item","lr-menu","lr-menu-item"],"lr-ebook-viewer":["lr-ebook-viewer"],"lr-email-viewer":["lr-email-viewer"],"lr-embedding-explorer":["lr-embedding-explorer"],"lr-emoji-picker":["lr-emoji-picker"],"lr-empty":["lr-empty"],"lr-entity-card":["lr-badge","lr-button","lr-chip","lr-empty","lr-entity-card","lr-result-field"],"lr-entity-chip":["lr-entity-chip"],"lr-entity-dossier":["lr-badge","lr-button","lr-chip","lr-chunk-inspector","lr-community-card","lr-empty","lr-entity-card","lr-entity-chip","lr-entity-dossier","lr-neighbor-list","lr-pagination","lr-path-strip","lr-provenance-panel","lr-result-field","lr-scroller","lr-stat","lr-tab","lr-tab-group","lr-tab-panel","lr-virtual-list"],"lr-env-list":["lr-empty","lr-env-list"],"lr-eval-dataset":["lr-chip","lr-chip-group","lr-empty","lr-eval-dataset","lr-export-button","lr-file-input","lr-input","lr-pagination","lr-skeleton","lr-spinner","lr-table"],"lr-eval-result":["lr-checkbox","lr-checkbox-group","lr-diff-view","lr-empty","lr-eval-result","lr-option","lr-pagination","lr-rubric-form","lr-segmented","lr-select","lr-skeleton","lr-slider","lr-spinner","lr-table","lr-textarea"],"lr-eval-run":["lr-badge","lr-button","lr-citation-badge","lr-claim-evidence","lr-code-block","lr-copy-button","lr-details","lr-empty","lr-eval-run","lr-grounding-summary","lr-icon-button","lr-json-viewer","lr-live-region","lr-markdown","lr-progress-bar","lr-skeleton","lr-stat","lr-tool-approval-dialog","lr-tool-call-chip","lr-tool-result-view","lr-tool-timeline","lr-tooltip","lr-virtual-list"],"lr-export-button":["lr-export-button"],"lr-file-icon":["lr-file-icon"],"lr-file-input":["lr-file-input"],"lr-file-tree":["lr-empty","lr-file-icon","lr-file-tree","lr-live-region","lr-tree","lr-tree-item","lr-virtual-list"],"lr-filter-bar":["lr-button","lr-chip","lr-chip-group","lr-combobox","lr-date-input","lr-date-picker","lr-dropdown","lr-dropdown-item","lr-empty","lr-filter-bar","lr-input","lr-menu","lr-menu-item","lr-option","lr-select","lr-spinner"],"lr-flag":["lr-flag","lr-skeleton"],"lr-flow-canvas":["lr-empty","lr-flow-canvas","lr-flow-node"],"lr-flow-controls":["lr-flow-controls"],"lr-flow-minimap":["lr-flow-minimap"],"lr-flow-node":["lr-flow-node"],"lr-flow-run-status":["lr-flow-run-status"],"lr-format-bytes":["lr-format-bytes"],"lr-format-date":["lr-format-date"],"lr-format-number":["lr-format-number"],"lr-funnel":["lr-funnel"],"lr-gauge":["lr-gauge"],"lr-generation-metrics":["lr-generation-metrics"],"lr-geojson-viewer":["lr-geojson-viewer","lr-json-viewer","lr-map","lr-skeleton","lr-virtual-list"],"lr-graph":["lr-graph","lr-pagination","lr-skeleton"],"lr-graph-legend":["lr-graph-legend"],"lr-graph-query-builder":["lr-chip","lr-chip-group","lr-graph-query-builder","lr-input","lr-option","lr-select"],"lr-grounding-summary":["lr-badge","lr-citation-badge","lr-claim-evidence","lr-empty","lr-grounding-summary","lr-stat"],"lr-handoff-divider":["lr-handoff-divider"],"lr-heatmap":["lr-heatmap"],"lr-highlight-layer":["lr-highlight-layer"],"lr-histogram":["lr-chart","lr-histogram","lr-skeleton"],"lr-html-viewer":["lr-html-viewer"],"lr-icon":["lr-icon"],"lr-icon-button":["lr-icon","lr-icon-button"],"lr-image-comparer":["lr-image-comparer"],"lr-image-viewer":["lr-image-viewer","lr-live-region","lr-pan-zoom"],"lr-include":["lr-include"],"lr-ingestion-queue":["lr-badge","lr-empty","lr-ingestion-queue","lr-pagination","lr-progress-bar","lr-virtual-list"],"lr-input":["lr-input"],"lr-intersection-observer":["lr-intersection-observer"],"lr-json-schema-viewer":["lr-badge","lr-empty","lr-json-schema-viewer"],"lr-json-viewer":["lr-json-viewer","lr-virtual-list"],"lr-kbd":["lr-kbd"],"lr-knowledge-base":["lr-badge","lr-button","lr-dropdown","lr-empty","lr-knowledge-base","lr-menu","lr-menu-item","lr-pagination","lr-skeleton","lr-spinner","lr-stat","lr-table"],"lr-knowledge-base-admin":["lr-badge","lr-button","lr-dropdown","lr-empty","lr-ingestion-queue","lr-knowledge-base","lr-knowledge-base-admin","lr-menu","lr-menu-item","lr-pagination","lr-progress-bar","lr-skeleton","lr-spinner","lr-stat","lr-table","lr-virtual-list"],"lr-knowledge-graph-explorer":["lr-badge","lr-button","lr-chip","lr-empty","lr-entity-card","lr-graph","lr-graph-legend","lr-input","lr-knowledge-graph-explorer","lr-neighbor-list","lr-pagination","lr-path-strip","lr-popover","lr-result-field","lr-scroller","lr-skeleton","lr-virtual-list"],"lr-known-date":["lr-known-date"],"lr-lightbox":["lr-lightbox","lr-pan-zoom"],"lr-line-chart":["lr-chart","lr-line-chart","lr-skeleton"],"lr-lite-chart":["lr-lite-chart","lr-live-region"],"lr-live-region":["lr-live-region"],"lr-locale-picker":["lr-flag","lr-locale-picker","lr-skeleton"],"lr-map":["lr-map","lr-skeleton"],"lr-markdown":["lr-markdown"],"lr-markdown-core":["lr-markdown-core"],"lr-mcp-app":["lr-mcp-app"],"lr-media-card":["lr-media-card"],"lr-memory-panel":["lr-button","lr-chip","lr-chunk-inspector","lr-community-card","lr-confirm-bar","lr-details","lr-empty","lr-entity-chip","lr-json-viewer","lr-live-region","lr-memory-panel","lr-path-strip","lr-provenance-panel","lr-scroller","lr-virtual-list"],"lr-mention-popover":["lr-mention-popover"],"lr-menu":["lr-menu","lr-menu-item"],"lr-menu-item":["lr-menu","lr-menu-item"],"lr-menu-label":["lr-menu-label"],"lr-menubar":["lr-menu","lr-menu-item","lr-menubar","lr-menubar-item"],"lr-menubar-item":["lr-menu","lr-menu-item","lr-menubar-item"],"lr-message-actions":["lr-chip","lr-copy-button","lr-icon-button","lr-message-actions","lr-message-feedback","lr-tooltip"],"lr-message-feedback":["lr-chip","lr-message-feedback"],"lr-message-parts":["lr-attachment-chip","lr-badge","lr-button","lr-card","lr-citation-badge","lr-copy-button","lr-details","lr-icon-button","lr-json-viewer","lr-markdown","lr-media-card","lr-message-parts","lr-result-card","lr-result-field","lr-skeleton","lr-stat","lr-thinking-panel","lr-tool-call-block","lr-tool-call-chip","lr-tool-result-view","lr-tooltip","lr-virtual-list","lr-widget-renderer"],"lr-mind-map":["lr-mind-map","lr-virtual-list"],"lr-model-select":["lr-model-select"],"lr-model-settings-panel":["lr-model-select","lr-model-settings-panel","lr-slider"],"lr-multi-split":["lr-multi-split"],"lr-mutation-observer":["lr-mutation-observer"],"lr-native-time-input":["lr-native-time-input"],"lr-navigation-menu":["lr-navigation-menu","lr-navigation-menu-item"],"lr-navigation-menu-item":["lr-navigation-menu-item"],"lr-neighbor-list":["lr-empty","lr-neighbor-list","lr-pagination","lr-virtual-list"],"lr-node-palette":["lr-node-palette"],"lr-notebook-viewer":["lr-code-block","lr-icon-button","lr-json-viewer","lr-markdown","lr-notebook-viewer","lr-skeleton","lr-virtual-list"],"lr-number-input":["lr-number-input"],"lr-option":["lr-option"],"lr-otp-input":["lr-otp-input"],"lr-page":["lr-page"],"lr-page-rail":["lr-file-icon","lr-page-rail","lr-skeleton","lr-virtual-list"],"lr-pagination":["lr-pagination"],"lr-pan-zoom":["lr-pan-zoom"],"lr-path-strip":["lr-path-strip","lr-scroller"],"lr-pdf-viewer":["lr-highlight-layer","lr-pdf-viewer","lr-virtual-list"],"lr-permission-grant":["lr-button","lr-permission-grant"],"lr-permission-rules":["lr-permission-rules"],"lr-phone-input":["lr-flag","lr-phone-input","lr-skeleton"],"lr-pie-chart":["lr-chart","lr-pie-chart","lr-skeleton"],"lr-polar-area-chart":["lr-chart","lr-polar-area-chart","lr-skeleton"],"lr-policy-summary":["lr-badge","lr-details","lr-empty","lr-policy-summary"],"lr-poll-status":["lr-live-region","lr-poll-status"],"lr-popover":["lr-popover"],"lr-popup":["lr-popup"],"lr-pptx-viewer":["lr-pptx-viewer"],"lr-progress-bar":["lr-progress-bar"],"lr-progress-ring":["lr-progress-ring"],"lr-prompt-input":["lr-attachment-chip","lr-attachment-trigger","lr-button","lr-chat-composer","lr-checkbox","lr-dropdown","lr-empty","lr-file-icon","lr-icon-button","lr-input","lr-mention-popover","lr-menu","lr-menu-item","lr-model-select","lr-prompt-input","lr-prompt-queue","lr-source-picker","lr-textarea","lr-voice-picker"],"lr-prompt-queue":["lr-button","lr-prompt-queue","lr-textarea"],"lr-prompt-studio":["lr-prompt-studio"],"lr-provenance-panel":["lr-button","lr-chip","lr-chunk-inspector","lr-community-card","lr-empty","lr-entity-chip","lr-path-strip","lr-provenance-panel","lr-scroller","lr-virtual-list"],"lr-push-to-talk":["lr-live-region","lr-push-to-talk"],"lr-qr-code":["lr-qr-code"],"lr-radar-chart":["lr-chart","lr-radar-chart","lr-skeleton"],"lr-radio":["lr-radio"],"lr-radio-button":["lr-radio-button"],"lr-radio-group":["lr-radio-group"],"lr-rag-answer":["lr-badge","lr-button","lr-citation-badge","lr-claim-evidence","lr-empty","lr-grounding-summary","lr-markdown","lr-rag-answer","lr-source-card","lr-source-list","lr-spinner","lr-stat"],"lr-rag-eval-dashboard":["lr-empty","lr-lite-chart","lr-live-region","lr-rag-eval-dashboard","lr-stat"],"lr-random-content":["lr-random-content"],"lr-rating":["lr-rating"],"lr-realtime-session":["lr-audio-visualizer","lr-badge","lr-live-region","lr-push-to-talk","lr-realtime-session","lr-transcript-feed"],"lr-relative-time":["lr-relative-time"],"lr-reorder-item":["lr-icon-button","lr-reorder-item"],"lr-reorder-list":["lr-icon-button","lr-live-region","lr-reorder-item","lr-reorder-list"],"lr-research-progress":["lr-empty","lr-research-progress"],"lr-resize-observer":["lr-resize-observer"],"lr-responsive-panel":["lr-responsive-panel"],"lr-result-card":["lr-result-card"],"lr-result-field":["lr-result-field"],"lr-retrieval-compare":["lr-empty","lr-retrieval-compare"],"lr-retrieval-results":["lr-checkbox","lr-chunk-inspector","lr-empty","lr-pagination","lr-retrieval-results","lr-spinner","lr-virtual-list"],"lr-retrieval-search":["lr-chip","lr-chip-group","lr-empty","lr-input","lr-retrieval-search","lr-segmented","lr-spinner"],"lr-retrieval-trace":["lr-chunk-inspector","lr-empty","lr-retrieval-trace","lr-span-waterfall","lr-virtual-list"],"lr-rubric-form":["lr-checkbox","lr-checkbox-group","lr-option","lr-rubric-form","lr-segmented","lr-select","lr-slider","lr-textarea"],"lr-scatter-chart":["lr-chart","lr-scatter-chart","lr-skeleton"],"lr-scroller":["lr-scroller"],"lr-segmented":["lr-segmented"],"lr-select":["lr-option","lr-select"],"lr-selection-toolbar":["lr-button","lr-selection-toolbar"],"lr-sequence-playback":["lr-sequence-playback"],"lr-sequence-strip":["lr-sequence-strip"],"lr-signature-pad":["lr-signature-pad"],"lr-skeleton":["lr-skeleton"],"lr-slider":["lr-slider"],"lr-source-card":["lr-source-card"],"lr-source-list":["lr-source-list"],"lr-source-picker":["lr-checkbox","lr-empty","lr-file-icon","lr-input","lr-source-picker"],"lr-span-waterfall":["lr-empty","lr-span-waterfall","lr-virtual-list"],"lr-sparkline":["lr-sparkline"],"lr-spinner":["lr-spinner"],"lr-split-panel":["lr-split-panel"],"lr-spreadsheet-viewer":["lr-spreadsheet-viewer","lr-tab","lr-tab-group","lr-tab-panel","lr-virtual-list"],"lr-stack-trace":["lr-stack-trace"],"lr-stat":["lr-stat"],"lr-stepper":["lr-stepper"],"lr-stream-status":["lr-live-region","lr-stream-status"],"lr-streaming-text":["lr-markdown","lr-streaming-text"],"lr-streaming-text-core":["lr-markdown-core","lr-streaming-text-core"],"lr-subagent-panel":["lr-badge","lr-empty","lr-subagent-panel"],"lr-suggestion-chips":["lr-scroller","lr-suggestion-chips"],"lr-svg-viewer":["lr-pan-zoom","lr-svg-viewer"],"lr-swatch-picker":["lr-swatch-picker"],"lr-switch":["lr-switch"],"lr-tab":["lr-tab"],"lr-tab-group":["lr-tab-group"],"lr-tab-panel":["lr-tab-panel"],"lr-table":["lr-empty","lr-pagination","lr-skeleton","lr-spinner","lr-table"],"lr-tag":["lr-tag"],"lr-task-list":["lr-live-region","lr-task-list","lr-virtual-list"],"lr-terminal":["lr-terminal","lr-virtual-list"],"lr-test-results":["lr-empty","lr-live-region","lr-pagination","lr-spinner","lr-test-results"],"lr-textarea":["lr-textarea"],"lr-thinking-panel":["lr-thinking-panel"],"lr-thread-list":["lr-conversation-item","lr-empty","lr-live-region","lr-pagination","lr-thread-list","lr-virtual-list"],"lr-time-input":["lr-time-input"],"lr-time-range":["lr-time-range"],"lr-time-zone-picker":["lr-combobox","lr-empty","lr-option","lr-select","lr-time-zone-picker"],"lr-timeline":["lr-relative-time","lr-timeline","lr-timeline-item"],"lr-timeline-item":["lr-relative-time","lr-timeline-item"],"lr-toast":["lr-toast","lr-toast-item"],"lr-toast-item":["lr-toast-item"],"lr-toggle":["lr-toggle"],"lr-toggle-group":["lr-toggle-group"],"lr-token-input":["lr-token-input"],"lr-tool-approval-dialog":["lr-button","lr-json-viewer","lr-tool-approval-dialog","lr-virtual-list"],"lr-tool-call-block":["lr-copy-button","lr-icon-button","lr-json-viewer","lr-skeleton","lr-tool-call-block","lr-tool-result-view","lr-tooltip","lr-virtual-list"],"lr-tool-call-chip":["lr-tool-call-chip"],"lr-tool-param-form":["lr-number-input","lr-option","lr-select","lr-tool-param-form"],"lr-tool-result-dialog":["lr-tool-result-dialog"],"lr-tool-result-view":["lr-copy-button","lr-icon-button","lr-json-viewer","lr-skeleton","lr-tool-result-view","lr-tooltip","lr-virtual-list"],"lr-tool-select-dialog":["lr-checkbox","lr-switch","lr-tool-select-dialog"],"lr-tool-timeline":["lr-button","lr-copy-button","lr-details","lr-empty","lr-icon-button","lr-json-viewer","lr-skeleton","lr-tool-approval-dialog","lr-tool-call-chip","lr-tool-result-view","lr-tool-timeline","lr-tooltip","lr-virtual-list"],"lr-tooltip":["lr-tooltip"],"lr-tour":["lr-tour"],"lr-trace-tree":["lr-empty","lr-live-region","lr-trace-tree","lr-virtual-list"],"lr-transcript-feed":["lr-transcript-feed"],"lr-tree":["lr-empty","lr-live-region","lr-tree","lr-tree-item","lr-virtual-list"],"lr-tree-item":["lr-tree-item"],"lr-typing-indicator":["lr-typing-indicator"],"lr-unit-picker":["lr-combobox","lr-empty","lr-option","lr-select","lr-unit-picker"],"lr-usage-badge":["lr-usage-badge"],"lr-video":["lr-icon","lr-video"],"lr-video-playlist":["lr-icon","lr-video","lr-video-playlist"],"lr-virtual-list":["lr-virtual-list"],"lr-visually-hidden":["lr-visually-hidden"],"lr-voice-picker":["lr-voice-picker"],"lr-widget":["lr-widget"],"lr-widget-renderer":["lr-badge","lr-button","lr-card","lr-markdown","lr-media-card","lr-result-card","lr-result-field","lr-stat","lr-widget-renderer"],"lr-word-cloud":["lr-word-cloud"],"lr-xml-viewer":["lr-virtual-list","lr-xml-viewer"],"lr-zoomable-frame":["lr-zoomable-frame"]});export{scopedDefinitionClosures};
@@ -0,0 +1 @@
1
+ import{resolveIntlLocale}from"./intl-cache.js";function foldSearchText(text,locale){return text.toLocaleLowerCase(resolveIntlLocale(locale)).normalize("NFKD").replace(/\p{M}/gu,"")}function prepareNeedle(text,locale){return foldSearchText(text.trim(),locale)}function createHaystackMemo(fold){const cache=new WeakMap;return(entries,locale)=>{const previous=cache.get(entries);if(previous?.locale===locale)return previous.values;const values=entries.map(entry=>fold(entry,locale));return cache.set(entries,{locale,values}),values}}export{createHaystackMemo,foldSearchText,prepareNeedle};
@@ -3,5 +3,10 @@ export interface SelectionCatalogEntry{readonly code:string;readonly label?:stri
3
3
  /** Source rows any catalog-backed picker inspects: the international selectors here, and the
4
4
  * model/voice pickers through `normalizeCatalog()` in `catalog-picker.ts`. */
5
5
  export declare const CATALOG_ROW_LIMIT=1024;
6
+ /** Source positions excluded by the catalog inspection ceiling. Invalid or duplicate rows
7
+ * inside the inspected prefix do not contribute to omitted. */
8
+ export interface SelectionCatalogTruncation{readonly source:number;readonly retained:number;readonly omitted:number;}
9
+ /** Count-only original-input loss retained with an admitted catalog snapshot. */
10
+ export declare function selectionCatalogTruncation(snapshot:unknown):SelectionCatalogTruncation|undefined;
6
11
  /** A bounded catalog boundary that never evaluates caller-owned property getters. */
7
12
  export declare function snapshotSelectionCatalog(source:unknown,normalize:(code:string)=>string,accepts?:(code:string)=>boolean):readonly SelectionCatalogEntry[]|undefined;export declare function normalizeSelectionValue(value:unknown):string;
@@ -1 +1 @@
1
- import{getOwnDataDescriptor,UNSAFE_OWN_DATA_DESCRIPTOR}from"./data-descriptors.js";const CATALOG_ROW_LIMIT=1024;function snapshotSelectionCatalog(source,normalize,accepts=()=>!0){if(source==null)return;try{if(!Array.isArray(source))return Object.freeze([])}catch{return Object.freeze([])}const lengthDescriptor=getOwnDataDescriptor(source,"length"),length=typeof lengthDescriptor=="symbol"?void 0:lengthDescriptor.value;if(typeof length!="number"||!Number.isSafeInteger(length)||length<0)return Object.freeze([]);const result=[],seen=new Set;for(let index=0;index<Math.min(length,CATALOG_ROW_LIMIT);index++){const itemDescriptor=getOwnDataDescriptor(source,String(index));if(typeof itemDescriptor=="symbol")continue;const item=itemDescriptor.value;let rawCode=item;const fields={};if(typeof item!="string"){if(!item||typeof item!="object")continue;const codeDescriptor=getOwnDataDescriptor(item,"code");if(typeof codeDescriptor=="symbol")continue;rawCode=codeDescriptor.value;let unsafe=!1;for(const key of["label","symbol","group","disabled"]){const descriptor=getOwnDataDescriptor(item,key);if(descriptor===UNSAFE_OWN_DATA_DESCRIPTOR){unsafe=!0;break}typeof descriptor!="symbol"&&(fields[key]=descriptor.value)}if(unsafe)continue}if(typeof rawCode!="string")continue;const code=normalize(rawCode);!code||code.length>256||!accepts(code)||seen.has(code)||["label","symbol","group"].some(key=>fields[key]!==void 0&&typeof fields[key]!="string")||fields.disabled!==void 0&&typeof fields.disabled!="boolean"||(seen.add(code),result.push(Object.freeze({code,...fields.label===void 0?{}:{label:fields.label},...fields.symbol===void 0?{}:{symbol:fields.symbol},...fields.group===void 0?{}:{group:fields.group},...fields.disabled===void 0?{}:{disabled:fields.disabled}})))}return Object.freeze(result)}function normalizeSelectionValue(value){return typeof value=="string"?value.trim():""}export{CATALOG_ROW_LIMIT,normalizeSelectionValue,snapshotSelectionCatalog};
1
+ import{getOwnDataDescriptor,UNSAFE_OWN_DATA_DESCRIPTOR}from"./data-descriptors.js";const CATALOG_ROW_LIMIT=1024,acceptAnyCode=_code=>!0,admittedCatalogs=new WeakMap;function selectionCatalogTruncation(snapshot){return snapshot!==null&&typeof snapshot=="object"?admittedCatalogs.get(snapshot)?.truncation:void 0}function snapshotSelectionCatalog(source,normalize,accepts=acceptAnyCode){if(source==null)return;try{if(!Array.isArray(source))return Object.freeze([])}catch{return Object.freeze([])}const admitted=admittedCatalogs.get(source);if(admitted?.normalize===normalize&&admitted.accepts===accepts)return source;const lengthDescriptor=getOwnDataDescriptor(source,"length"),length=typeof lengthDescriptor=="symbol"?void 0:lengthDescriptor.value;if(typeof length!="number"||!Number.isSafeInteger(length)||length<0)return Object.freeze([]);const result=[],seen=new Set;for(let index=0;index<Math.min(length,CATALOG_ROW_LIMIT);index++){const itemDescriptor=getOwnDataDescriptor(source,String(index));if(typeof itemDescriptor=="symbol")continue;const item=itemDescriptor.value;let rawCode=item;const fields={};if(typeof item!="string"){if(!item||typeof item!="object")continue;const codeDescriptor=getOwnDataDescriptor(item,"code");if(typeof codeDescriptor=="symbol")continue;rawCode=codeDescriptor.value;let unsafe=!1;for(const key of["label","symbol","group","disabled"]){const descriptor=getOwnDataDescriptor(item,key);if(descriptor===UNSAFE_OWN_DATA_DESCRIPTOR){unsafe=!0;break}typeof descriptor!="symbol"&&(fields[key]=descriptor.value)}if(unsafe)continue}if(typeof rawCode!="string")continue;const code=normalize(rawCode);!code||code.length>256||!accepts(code)||seen.has(code)||["label","symbol","group"].some(key=>fields[key]!==void 0&&typeof fields[key]!="string")||fields.disabled!==void 0&&typeof fields.disabled!="boolean"||(seen.add(code),result.push(Object.freeze({code,...fields.label===void 0?{}:{label:fields.label},...fields.symbol===void 0?{}:{symbol:fields.symbol},...fields.group===void 0?{}:{group:fields.group},...fields.disabled===void 0?{}:{disabled:fields.disabled}})))}const snapshot=Object.freeze(result),originalLoss=admitted?.truncation,omitted=originalLoss?.omitted??Math.max(0,length-CATALOG_ROW_LIMIT),truncation=omitted>0?Object.freeze({source:originalLoss?.source??length,retained:snapshot.length,omitted}):void 0;return admittedCatalogs.set(snapshot,{normalize,accepts,truncation}),snapshot}function normalizeSelectionValue(value){return typeof value=="string"?value.trim():""}export{CATALOG_ROW_LIMIT,normalizeSelectionValue,selectionCatalogTruncation,snapshotSelectionCatalog};
@@ -0,0 +1 @@
1
+ const emptyLanguages=Object.freeze({}),combinedMaps=new WeakMap;function combineShikiLanguageSources(languages,loaders){if(loaders===null||typeof loaders!="object")return languages;const concrete=languages!==null&&typeof languages=="object"?languages:emptyLanguages;let byConcrete=combinedMaps.get(loaders);byConcrete||(byConcrete=new WeakMap,combinedMaps.set(loaders,byConcrete));const cached=byConcrete.get(concrete);if(cached)return cached;const combined=Object.create(null);for(const source of[concrete,loaders]){let keys;try{keys=Object.getOwnPropertyNames(source)}catch{continue}for(const key of keys){if(Object.hasOwn(combined,key))continue;let descriptor;try{descriptor=Object.getOwnPropertyDescriptor(source,key)}catch{continue}descriptor?.enumerable&&"value"in descriptor&&Object.defineProperty(combined,key,{value:descriptor.value,enumerable:!0,configurable:!0,writable:!0})}}return Object.freeze(combined),byConcrete.set(concrete,combined),combined}export{combineShikiLanguageSources};
@@ -0,0 +1 @@
1
+ import{SourceRequestController,sourceCount,sourceRevision}from"./source-request-controller.js";import{sourcePageScope}from"./source-page-scope.js";const MAX_TEXT=65536,MAX_TEXT_TOTAL=2e6,revoked=new Error("Source operation revoked");function field(value,key,required=!0){if(typeof value!="object"&&typeof value!="function"||value===null)throw new TypeError("Invalid source object");const descriptor=Object.getOwnPropertyDescriptor(value,key);if(!descriptor){if(required)throw new TypeError("Missing source field");return}if(!("value"in descriptor))throw new TypeError("Accessor source field");return descriptor.value}function list(value,max){if(!Array.isArray(value))throw new TypeError("Invalid source collection");const length=sourceCount(field(value,"length"));if(length>max)throw new RangeError("Invalid source collection");const result=[];for(let i=0;i<length;i++)result.push(field(value,i));return result}function textValue(value,budget,nonempty=!1){if(typeof value!="string"||nonempty&&value.length===0||value.length>MAX_TEXT)throw new TypeError("Invalid source text");if(budget.used+=value.length,budget.used>MAX_TEXT_TOTAL)throw new RangeError("Source text budget exceeded");return value}function initialState(){return Object.freeze({page:0,pageSize:100,pending:!1,result:void 0,error:void 0,selectionPending:!1,selectionError:void 0})}class SourcePageController{constructor(host,options){this.host=host,this.snapshot=initialState(),this.bindVersion=0,this.pageVersion=0,this.selectionVersion=0,this.locateVersion=0,this.cache=new Map,this.pageLane={channel:"page",canceled:!1,scheduled:!1},this.selectionLane={channel:"selection",canceled:void 0,scheduled:!1},this.locateLane={channel:"locate",canceled:null,scheduled:!1},this.options=Object.freeze({...options}),this.connected=host.isConnected,this.authority=new SourceRequestController(host,{channels:["page","selection","locate"],onReset:()=>this.reset()}),host.addController(this)}get state(){return this.snapshot}bind(value){const transaction=++this.bindVersion;let candidate;try{if(value&&(candidate=Object.freeze({source:value.source,revision:sourceRevision(value.revision),epoch:sourceCount(value.epoch),locale:value.locale}),!candidate.source||typeof candidate.source.query!="function"||typeof candidate.source.lookup!="function"||typeof candidate.source.locate!="function"||typeof candidate.locale!="string"))throw new TypeError("Invalid page source")}catch(error){throw transaction===this.bindVersion&&(this.binding=void 0,this.lastPage=void 0,this.lastSelection=void 0,this.authority.setSource(void 0,void 0),transaction===this.bindVersion&&this.patch({error})),error}if(transaction!==this.bindVersion)return;const previous=this.binding;if(candidate&&previous&&previous.source===candidate.source&&previous.revision===candidate.revision&&previous.epoch===candidate.epoch){if(previous.locale===candidate.locale)return;this.binding=candidate;const pageTransaction=++this.pageVersion;if(this.locateVersion++,this.patch({pending:!1,result:void 0,error:void 0}),this.stop(this.locateLane),transaction!==this.bindVersion||pageTransaction!==this.pageVersion)return;this.stop(this.pageLane);return}this.binding=void 0,this.lastPage=void 0,this.lastSelection=void 0,this.authority.refresh(),transaction===this.bindVersion&&(this.authority.setSource(candidate?.source,candidate?.revision),transaction===this.bindVersion&&(this.binding=candidate))}request(query,page,pageSize){const transaction=++this.pageVersion;if(this.locateVersion++,this.lastPage={query,page,pageSize},this.patch({page,pageSize,pending:!0,result:void 0,error:void 0}),this.stop(this.locateLane),transaction!==this.pageVersion||(this.stop(this.pageLane),transaction!==this.pageVersion))return Promise.resolve(!1);try{if(sourceCount(page),sourceCount(pageSize),pageSize<1||pageSize>500||!Number.isSafeInteger(page*pageSize))throw new RangeError("Invalid source page");if(!this.usable()||!this.binding)return this.patch({pending:!1}),Promise.resolve(!1)}catch(error){return this.lastPage=void 0,this.patch({pending:!1,error}),Promise.resolve(!1)}const source=this.binding.source;return this.enqueue(this.pageLane,async(context,current)=>{let acceptedPage=page;for(let attempt=0;attempt<2;attempt++){if(!current())return!1;const queryPage=source.query;if(!current())return!1;const raw=await Reflect.apply(queryPage,source,[{...context,page:acceptedPage,pageSize,query}]);if(!current())return!1;const result=this.projectPage(raw,query,acceptedPage,pageSize,current);if(!current())return!1;const last=result.total===0?0:Math.floor((result.total-1)/pageSize);if(acceptedPage>last){if(attempt===1)throw new RangeError("Inconsistent source page total");acceptedPage=last;continue}return this.lastPage={query,page:acceptedPage,pageSize},this.patch({page:acceptedPage,pageSize,pending:!1,result,error:void 0}),!0}return!1},error=>this.patch({pending:!1,result:void 0,error}))}resolveSelection(keys){const transaction=++this.selectionVersion;if(this.patch({selectionPending:!0,selectionError:void 0}),this.stop(this.selectionLane),transaction!==this.selectionVersion)return Promise.resolve(void 0);let accepted;try{const values=list(keys,1e4),budget={used:0},unique=new Set;for(let i=0;i<values.length;i++)unique.add(textValue(field(values,i),budget,!0));if(accepted=Object.freeze([...unique]),transaction!==this.selectionVersion)return Promise.resolve(void 0)}catch(error){return transaction===this.selectionVersion&&(this.lastSelection=void 0,this.patch({selectionPending:!1,selectionError:error})),Promise.resolve(void 0)}this.lastSelection=accepted;const wanted=new Set(accepted);for(const key of this.cache.keys())wanted.has(key)||this.cache.delete(key);if(!this.usable()||!this.binding)return this.patch({selectionPending:!1}),Promise.resolve(void 0);const source=this.binding.source;return this.enqueue(this.selectionLane,async(context,current)=>{const staged=new Map,missing=accepted.filter(key=>!this.cache.has(key)),budget={used:accepted.reduce((sum,key)=>sum+key.length,0)};for(let offset=0;offset<missing.length;offset+=500){if(!current())return;const batch=Object.freeze(missing.slice(offset,offset+500)),lookup=source.lookup;if(!current())return;const raw=await Reflect.apply(lookup,source,[batch,context]);if(!current())return;const rows=list(raw,batch.length),requested=new Set(batch),seen=new Set;for(let i=0;i<rows.length;i++){const item=this.projectRecord(field(rows,i),budget,current);if(!current())return;if(!requested.has(item.key)||seen.has(item.key))throw new TypeError("Invalid selected source key");seen.add(item.key),staged.set(item.key,item)}for(const key of batch)seen.has(key)||staged.set(key,null)}if(!current())return;const result=[],orders=new Set;for(const key of accepted){const item=staged.has(key)?staged.get(key):this.cache.get(key);if(item){if(orders.has(item.order))throw new TypeError("Duplicate selected source order");orders.add(item.order),result.push(item)}}result.sort((a,b)=>a.order-b.order);for(const[key,item]of staged)this.cache.set(key,item);return this.patch({selectionPending:!1,selectionError:void 0}),Object.freeze(result)},error=>this.patch({selectionPending:!1,selectionError:error}))}locate(key){const transaction=++this.locateVersion;if(this.stop(this.locateLane),transaction!==this.locateVersion||!this.binding||!this.lastPage||!this.usable())return Promise.resolve(null);try{textValue(key,{used:0},!0)}catch{return Promise.resolve(null)}const source=this.binding.source,query=this.lastPage.query;return this.enqueue(this.locateLane,async(context,current)=>{const locate=source.locate;if(!current())return null;const index=await Reflect.apply(locate,source,[key,query,context]);if(!current()||index===null)return null;if(sourceCount(index),this.snapshot.result&&index>=this.snapshot.result.total)throw new RangeError("Invalid located source index");return index},()=>{})}projectRecord(raw,budget,current){const key=textValue(field(raw,"key"),budget,!0),order=sourceCount(field(raw,"order")),input=Object.freeze({key,order,value:field(raw,"value")}),result=this.options.normalizeRecord(input,current);if(field(result,"key")!==key||field(result,"order")!==order)throw new TypeError("Source record identity changed");return Object.freeze({key,order,value:field(result,"value")})}projectPage(raw,query,page,pageSize,current){const total=sourceCount(field(raw,"total")),values=list(field(raw,"rows"),pageSize),start=page*pageSize,expected=Math.min(pageSize,Math.max(0,total-start));if(values.length!==expected)throw new RangeError("Invalid source page length");const budget={used:0},keys=new Set,orders=new Set,rows=[];for(let i=0;i<values.length;i++){const item=this.projectRecord(field(values,i),budget,current);if(!current())throw revoked;if(keys.has(item.key)||orders.has(item.order))throw new TypeError("Duplicate source record");keys.add(item.key),orders.add(item.order),rows.push(item)}const rawGroups=field(raw,"groups",!1);let groups;if(rawGroups!==void 0){const values2=list(rawGroups,rows.length),unique=new Set,projected=[];for(let i=0;i<values2.length;i++){const group=field(values2,i),key=textValue(field(group,"key"),budget,!0),label=textValue(field(group,"label"),budget),startIndex=sourceCount(field(group,"startIndex")),itemCount=sourceCount(field(group,"itemCount")),end=startIndex+itemCount;if(!Number.isSafeInteger(end)||itemCount===0||end>total||startIndex>=start+rows.length||end<=start||unique.has(key))throw new RangeError("Invalid source group");unique.add(key),projected.push(Object.freeze({key,label,startIndex,itemCount}))}groups=Object.freeze(projected)}const rawTags=field(raw,"tags",!1);let tags;if(rawTags!==void 0){const values2=list(field(rawTags,"values"),500),unavailable=list(field(rawTags,"unavailableSelected"),500),total2=sourceCount(field(rawTags,"total"));if(total2<values2.length)throw new RangeError("Invalid facet total");const unique=new Set,projected=[];for(let i=0;i<values2.length;i++){const facet=field(values2,i),key=textValue(field(facet,"key"),budget,!0),label=textValue(field(facet,"label"),budget),rawCount=field(facet,"count",!1),count=rawCount===void 0?void 0:sourceCount(rawCount);if(unique.has(key))throw new TypeError("Duplicate source facet");unique.add(key),projected.push(Object.freeze({key,label,...count===void 0?{}:{count}}))}const missing=[];for(let i=0;i<unavailable.length;i++){const key=textValue(field(unavailable,i),budget,!0);if(unique.has(key))throw new TypeError("Conflicting source facet");unique.add(key),missing.push(key)}tags=Object.freeze({total:total2,values:Object.freeze(projected),unavailableSelected:Object.freeze(missing)})}const rawSummary=field(raw,"summary",!1);if(rawSummary!==void 0&&!this.options.normalizeSummary)throw new TypeError("Source summary requires a projection");const summary=this.options.normalizeSummary?.(rawSummary,query);if(!current())throw revoked;const result=Object.freeze({total,rows:Object.freeze(rows),...groups===void 0?{}:{groups},...tags===void 0?{}:{tags},...this.options.normalizeSummary?{summary}:{}});if(this.options.validateMetadata(result,query),!current())throw revoked;return result}enqueue(lane,run,fail){let settle;const done=new Promise(resolve=>{settle=resolve});return lane.current={run,fail,settle},this.schedule(lane),done}stop(lane,abort=!0){const job=lane.current;lane.current=void 0,job?.settle(lane.canceled),abort&&this.authority.invalidate(lane.channel)}schedule(lane){lane.scheduled||(lane.scheduled=!0,queueMicrotask(()=>{lane.scheduled=!1,this.pump(lane)}))}pump(lane){if(lane.running||!lane.current)return;const job=lane.current,binding=this.binding;if(!binding||!this.usable()){this.stop(lane);return}lane.running=job;const epoch=this.authority.epoch,owner=this.host.ownerDocument,lease=this.authority.begin(lane.channel,binding.locale),scope=sourcePageScope(this.host),current=()=>lane.current===job&&this.usable()&&this.host.ownerDocument===owner&&this.authority.epoch===epoch&&lease?.isCurrent()===!0&&(!scope||scope.isCurrent());if(!current()||!lease){job.settle(lane.canceled),lane.current===job&&(lane.current=void 0),lane.running=void 0,this.schedule(lane);return}Promise.resolve().then(async()=>{if(!current())return lane.canceled;const release=scope?await scope.acquire(binding.source,lane.channel,lease.context.signal):void 0;if(scope&&!release)return lane.canceled;try{return current()?await job.run(lease.context,current):lane.canceled}finally{release?.()}}).then(value=>{job.settle(current()?value:lane.canceled)}).catch(error=>{current()&&job.fail(error),job.settle(lane.canceled)}).finally(()=>{lane.current===job&&(lane.current=void 0),lane.running===job&&(lane.running=void 0),this.schedule(lane)})}usable(){return this.connected&&this.host.isConnected}patch(change){this.snapshot=Object.freeze({...this.snapshot,...change}),this.notify()}notify(){if(this.notification)return;const token={},epoch=this.authority.epoch,owner=this.host.ownerDocument;this.notification=token,queueMicrotask(()=>{this.notification===token&&(this.notification=void 0,this.usable()&&this.host.ownerDocument===owner&&this.authority.epoch===epoch&&this.options.onChange())})}reset(){this.pageVersion++,this.selectionVersion++,this.locateVersion++,this.stop(this.pageLane,!1),this.stop(this.selectionLane,!1),this.stop(this.locateLane,!1),this.cache.clear(),this.notification=void 0,this.snapshot=initialState()}adopted(){this.authority.adopted()}hostConnected(){const reconnecting=!this.connected;if(this.connected=!0,reconnecting&&this.binding){const page=this.lastPage,selection=this.lastSelection;page&&this.request(page.query,page.page,page.pageSize),selection&&this.resolveSelection(selection),this.notify()}}hostDisconnected(){this.connected=!1,this.reset()}}export{SourcePageController};
@@ -0,0 +1 @@
1
+ const owners=new WeakMap,hosts=new WeakMap;function setSourcePageScope(host,owner){let scope=owners.get(owner);scope||(scope={sources:new WeakMap,waiting:new Map},owners.set(owner,scope));const previous=hosts.get(host);if(previous?.scope===scope&&scope.current===previous.ticket)return;if(previous&&previous.scope.current===previous.ticket){previous.scope.current=void 0;for(const pending of[...previous.scope.waiting.values()])pending.cancel()}const owned=scope,ticket={},registration={scope:owned,ticket,isCurrent:()=>owned.current===ticket,acquire(source,channel,signal){if(!registration.isCurrent()||signal.aborted)return Promise.resolve(void 0);let lanes=owned.sources.get(source);lanes||(lanes=new Map,owned.sources.set(source,lanes));let slot=lanes.get(channel);slot||(slot={},lanes.set(channel,slot));const physical=slot;return owned.waiting.get(channel)?.cancel(),new Promise(resolve=>{let done=!1;const clear=()=>{physical.waiting===pending&&(physical.waiting=void 0),owned.waiting.get(channel)===pending&&owned.waiting.delete(channel),signal.removeEventListener("abort",cancel)},cancel=()=>{done||(done=!0,clear(),resolve(void 0))},pending={cancel,grant:()=>{if(done)return;if(!registration.isCurrent()||signal.aborted){cancel();return}if(physical.held)return;done=!0,clear();const token=physical.held={};resolve(()=>{physical.held===token&&(physical.held=void 0,physical.waiting?.grant())})}};physical.waiting=pending,owned.waiting.set(channel,pending),signal.addEventListener("abort",cancel,{once:!0}),pending.grant()})}},obsolete=[...owned.waiting.values()];owned.current=ticket,hosts.set(host,registration);for(const pending of obsolete)pending.cancel()}function sourcePageScope(host){return hosts.get(host)}export{setSourcePageScope,sourcePageScope};
@@ -0,0 +1 @@
1
+ function sourceCount(value){if(typeof value!="number"||!Number.isSafeInteger(value)||value<0)throw new RangeError("Invalid source count");return value}function sourceRevision(value){if(typeof value=="string"&&value.length>0||typeof value=="number"&&Number.isFinite(value))return value;throw new TypeError("Invalid source revision")}class SourceRequestController{constructor(host,options){if(this.host=host,this.options=options,this.sourceEpoch=0,this.channels=new Map,options.channels.length<1||options.channels.length>16)throw new RangeError("Invalid source channels");for(const channel of options.channels){if(typeof channel!="string"||channel.length===0||this.channels.has(channel))throw new TypeError("Invalid source channel");this.channels.set(channel,void 0)}this.active=host.isConnected,host.addController(this)}get epoch(){return this.sourceEpoch}setSource(source,revision){if(source===this.source&&revision===this.revision)return!1;let acceptedRevision;try{if(source===void 0){if(revision!==void 0)throw new TypeError("Revision requires a source")}else{if(typeof source!="object"&&typeof source!="function"||source===null)throw new TypeError("Invalid source");acceptedRevision=sourceRevision(revision)}}catch(error){throw this.source=void 0,this.revision=void 0,this.refresh(),error}return this.source=source,this.revision=acceptedRevision,this.refresh(),!0}refresh(){this.sourceEpoch++;const controllers=[...this.channels.values()];for(const channel of this.channels.keys())this.channels.set(channel,void 0);try{this.options.onReset?.()}finally{for(const controller of controllers)controller?.abort()}}invalidate(channel){if(!this.channels.has(channel))throw new TypeError("Unknown source channel");const controller=this.channels.get(channel);this.channels.set(channel,void 0),controller?.abort()}begin(channel,locale){if(!this.channels.has(channel))throw new TypeError("Unknown source channel");const previous=this.channels.get(channel),source=this.source,revision=this.revision;if(!this.active||!this.host.isConnected||source===void 0||revision===void 0){this.channels.set(channel,void 0),previous?.abort();return}const owner=this.host.ownerDocument,controller=new AbortController,epoch=this.sourceEpoch;this.channels.set(channel,controller);const lease={context:Object.freeze({revision,locale,signal:controller.signal}),isCurrent:()=>this.active&&this.host.isConnected&&this.host.ownerDocument===owner&&this.source===source&&this.revision===revision&&this.sourceEpoch===epoch&&this.channels.get(channel)===controller&&!controller.signal.aborted};return previous?.abort(),lease.isCurrent()?lease:void 0}adopted(){this.refresh()}hostConnected(){this.active=!0}hostDisconnected(){this.active=!1,this.refresh()}}export{SourceRequestController,sourceCount,sourceRevision};
@@ -0,0 +1 @@
1
+ import{SourceRequestController,sourceCount,sourceRevision}from"./source-request-controller.js";const MAX_SOURCE_KEY_UNITS=65536,MAX_CACHED_KEY_UNITS=2e6;function validKey(key){return typeof key=="string"&&key.length>0&&key.length<=MAX_SOURCE_KEY_UNITS}function isIndexed(view){return typeof view.itemAt=="function"}class SourceWindowController{constructor(host,options){this.host=host,this.count=0,this.generation=0,this.bindingVersion=0,this.windowVersion=0,this.demandVersion=0,this.lookupVersion=0,this.lookupScheduled=!1,this.pages=new Map,this.local=new Map,this.cachedKeyUnits=0,this.totalWeight=0,this.queue=[],this.running=new Map,this.pumpScheduled=!1,this.options=Object.freeze({...options});const pageSize=sourceCount(options.pageSize),maxRows=sourceCount(options.maxRows),maxPages=sourceCount(options.maxPages);if(pageSize<1||maxRows<1||maxRows>500||pageSize>maxRows||maxPages<1||maxPages>5||options.maxConcurrent!==1&&options.maxConcurrent!==2)throw new RangeError("Invalid source window bounds");if(options.maxWeight===void 0!=(options.weightOf===void 0)||options.maxWeight!==void 0&&(!Number.isSafeInteger(options.maxWeight)||options.maxWeight<1||typeof options.weightOf!="function"))throw new RangeError("Invalid source weight bounds");this.pageCapacity=Math.min(maxPages,Math.floor(maxRows/pageSize)),this.connected=host.isConnected,this.authority=new SourceRequestController(host,{channels:["range-0","range-1","lookup"],onReset:()=>this.clear()});const control=this;this.source={get count(){return control.count},itemAt:index=>this.itemAt(index),keyAt:index=>this.keyAt(index),indexOfKey:key=>typeof key=="string"?this.cachedIndex(key):-1},host.addController(this)}bind(binding){const transaction=++this.bindingVersion,previous=this.binding;let candidate,nextCount=0;try{if(binding){candidate={owner:binding.owner,revision:binding.revision,epoch:binding.epoch,locale:binding.locale,view:binding.view},sourceRevision(candidate.revision),sourceCount(candidate.epoch),nextCount=sourceCount(candidate.view.count);const indexed=isIndexed(candidate.view),ranged=typeof candidate.view.read=="function";if(indexed===ranged)throw new TypeError("Source must provide indexed or ranged access");if(previous&&previous.owner===candidate.owner&&previous.revision===candidate.revision&&previous.epoch===candidate.epoch&&previous.view===candidate.view&&previous.locale===candidate.locale&&nextCount===this.count)return}}catch(error){throw transaction===this.bindingVersion&&(this.binding=void 0,this.count=0,this.requested=void 0,this.authority.setSource(void 0,void 0)),error}transaction===this.bindingVersion&&(this.binding=void 0,this.count=0,this.requested=void 0,this.authority.refresh(),transaction===this.bindingVersion&&(this.authority.setSource(candidate?.owner,candidate?.revision),transaction===this.bindingVersion&&(this.binding=candidate,this.count=nextCount)))}requestRange(start,endExclusive){if(sourceCount(start),sourceCount(endExclusive),endExclusive<start)throw new RangeError("Invalid source range");if(!this.usable()||!this.binding)return;const transaction=++this.windowVersion,binding=this.binding,generation=this.generation,owner=this.host.ownerDocument,boundedEnd=Math.min(endExclusive,this.count,start+this.options.maxRows),boundedStart=Math.min(start,this.count);if((this.requested?.start!==boundedStart||this.requested.end!==boundedEnd)&&this.demandVersion++,this.requested={start:boundedStart,end:boundedEnd},isIndexed(this.binding.view))return;const first=this.pageStart(start),end=Math.min(endExclusive,this.count),size=Math.min(this.pageCapacity,Math.max(0,Math.ceil((end-first)/this.options.pageSize))),wanted=new Set;if(start<end)for(let i=0;i<size;i++)wanted.add(first+i*this.options.pageSize);for(const page of[...this.pages.values()])if((page.state==="queued"||page.state==="loading")&&!wanted.has(page.start)&&this.drop(page),transaction!==this.windowVersion||!this.current(binding,generation,owner))return;for(const offset of wanted){const existing=this.pages.get(offset);existing&&(this.pages.delete(offset),this.pages.set(offset,existing))}for(const offset of wanted)if(this.page(offset,!1,transaction),transaction!==this.windowVersion||!this.current(binding,generation,owner))return}async ensure(index){if(!this.usable()||!this.validIndex(index)||!this.binding)return!1;if(this.rememberIndex(index),isIndexed(this.binding.view))return this.local.get(index)?.slot.state==="error"&&this.removeLocal(index),this.itemAt(index).state==="ready";const generation=this.generation,page=this.page(this.pageStart(index),!0);return page?await page.done&&this.usable()&&this.generation===generation&&this.pages.get(page.start)===page:!1}resolveKey(key){const transaction=++this.lookupVersion,binding=this.binding,generation=this.generation,owner=this.host.ownerDocument;if(this.lookupCurrent?.settle(null),this.lookupCurrent=void 0,this.authority.invalidate("lookup"),!binding||transaction!==this.lookupVersion||!this.current(binding,generation,owner)||!validKey(key))return Promise.resolve(null);let settle;const done=new Promise(resolve=>{settle=resolve});return this.lookupCurrent={key,binding,generation,owner,settle},this.scheduleLookup(),done}scheduleLookup(){this.lookupScheduled||(this.lookupScheduled=!0,queueMicrotask(()=>{this.lookupScheduled=!1,this.pumpLookup()}))}pumpLookup(){if(this.lookupRunning)return;const lookup=this.lookupCurrent;if(!lookup)return;const current=()=>this.lookupCurrent===lookup&&this.current(lookup.binding,lookup.generation,lookup.owner);if(!current()){lookup.settle(null),this.lookupCurrent=void 0;return}this.lookupRunning=lookup;const lease=this.authority.begin("lookup",lookup.binding.locale);if(!lease||!current()||!lease.isCurrent()){lookup.settle(null),this.lookupCurrent===lookup&&(this.lookupCurrent=void 0),this.lookupRunning=void 0,this.scheduleLookup();return}Promise.resolve().then(()=>{if(!current()||!lease.isCurrent())return null;const view=lookup.binding.view;return isIndexed(view)?view.indexOfKey?.(lookup.key):view.indexOfKey?.(lookup.key,lease.context)}).then(index=>{lookup.settle(current()&&lease.isCurrent()&&typeof index=="number"&&this.validIndex(index)?index:null)}).catch(()=>lookup.settle(null)).finally(()=>{this.lookupCurrent===lookup&&(this.lookupCurrent=void 0),this.lookupRunning===lookup&&(this.lookupRunning=void 0),this.scheduleLookup()})}current(binding,generation,owner){return this.binding===binding&&this.generation===generation&&this.host.ownerDocument===owner&&this.usable()}rememberIndex(index){(!this.requested||index<this.requested.start||index>=this.requested.end)&&(this.requested={start:index,end:index+1},this.options.maxWeight!==void 0&&this.demandVersion++)}usable(){return this.connected&&this.host.isConnected}validIndex(index){return Number.isSafeInteger(index)&&index>=0&&index<this.count}pageStart(index){return Math.floor(index/this.options.pageSize)*this.options.pageSize}itemAt(index){if(!this.validIndex(index))return{state:"error",index,error:new RangeError("Invalid source index")};const binding=this.binding;if(!binding||!this.usable())return{state:"loading",index};if(this.rememberIndex(index),isIndexed(binding.view)){const cached=this.local.get(index);if(cached)return this.local.delete(index),this.local.set(index,cached),cached.slot;const generation=this.generation,owner=this.host.ownerDocument,transaction=this.demandVersion,current=()=>this.current(binding,generation,owner)&&(this.options.maxWeight===void 0||transaction===this.demandVersion);let entry;try{const raw=binding.view.itemAt(index);if(!current())return{state:"loading",index};const value=this.options.normalize(raw,index);if(!current())return{state:"loading",index};const key=this.validateKey(value,index);if(!current())return{state:"loading",index};if(binding.view.keyAt&&binding.view.keyAt(index)!==key)throw new TypeError("Source row key mismatch");if(!current())return{state:"loading",index};const weight=this.valueWeight(value,index);if(!current()||!this.admitWeight(weight,current))return{state:"loading",index};for(;this.cachedKeyUnits+key.length>MAX_CACHED_KEY_UNITS;){const oldest=[...this.local.keys()].find(candidate=>this.options.maxWeight===void 0||!this.demands(candidate,1));if(oldest===void 0)throw new RangeError("Source window key budget exceeded");this.removeLocal(oldest)}entry={slot:{state:"ready",index,value},key,weight}}catch(error){entry={slot:{state:"error",index,error:this.options.maxWeight===void 0?error:new Error("Source row admission failed")}}}if(!current())return{state:"loading",index};for(this.removeLocal(index);this.local.size>=this.options.maxRows;)this.removeLocal(this.local.keys().next().value);return this.local.set(index,entry),this.cachedKeyUnits+=entry.key?.length??0,this.totalWeight+=entry.weight??0,entry.slot}const page=this.page(this.pageStart(index),!1);return page?.state==="ready"?page.slots[index-page.start]:page?.state==="error"?{state:"error",index,error:page.error}:{state:"loading",index}}keyAt(index){const binding=this.binding;if(!this.usable()||!this.validIndex(index))return index;if(binding&&isIndexed(binding.view)&&binding.view.keyAt){const generation=this.generation,owner=this.host.ownerDocument;try{const key=binding.view.keyAt(index);if(this.current(binding,generation,owner)&&validKey(key))return key}catch{}return index}const local=this.local.get(index);if(local?.key)return local.key;const page=this.pages.get(this.pageStart(index));return page?.keys?.[index-page.start]??index}cachedIndex(key){const binding=this.binding;if(!binding||!this.usable()||!validKey(key))return-1;const generation=this.generation,owner=this.host.ownerDocument,view=binding.view;if(isIndexed(view)&&view.indexOfKey)try{const index=view.indexOfKey(key);return this.current(binding,generation,owner)&&this.validIndex(index)?index:-1}catch{return-1}for(const[index,entry]of this.local)if(entry.key===key)return index;for(const page of this.pages.values()){const offset=page.keys?.indexOf(key)??-1;if(offset>=0)return page.start+offset}return-1}validateKey(value,index){const key=this.options.keyOf(value);if(!validKey(key))throw new TypeError("Invalid source key");for(const[other,entry]of this.local)if(other!==index&&entry.key===key)throw new TypeError("Duplicate source key");for(const page of this.pages.values()){const offset=page.keys?.indexOf(key)??-1;if(offset>=0&&page.start+offset!==index)throw new TypeError("Duplicate source key")}return key}removeLocal(index){const entry=this.local.get(index);entry&&(this.cachedKeyUnits-=entry.key?.length??0,this.totalWeight-=entry.weight??0,this.local.delete(index))}demands(start,length){return!!this.requested&&start<this.requested.end&&start+length>this.requested.start}valueWeight(value,index){if(this.options.maxWeight===void 0)return 0;const weight=this.options.weightOf(value,index);if(!Number.isSafeInteger(weight)||weight<0||weight>this.options.maxWeight)throw new RangeError("Invalid source row weight");return weight}admitWeight(weight,current,staging){const maximum=this.options.maxWeight;if(maximum===void 0)return current();for(;weight>maximum-this.totalWeight;){const local=[...this.local.entries()].find(([index,entry])=>(entry.weight??0)>0&&!this.demands(index,1));if(local)this.removeLocal(local[0]);else{const page=[...this.pages.values()].find(candidate=>candidate!==staging&&(candidate.weight??0)>0&&!this.demands(candidate.start,candidate.length));if(!page)throw new RangeError("Source window weight budget exceeded");this.drop(page)}if(!current())return!1}return current()}releasePageValues(page){this.cachedKeyUnits-=page.keyUnits??0,this.totalWeight-=page.weight??0,page.staging&&(page.staging.length=0),page.staging=void 0,page.keys=void 0,page.slots=void 0,page.keyUnits=void 0,page.weight=void 0}page(start,retry,transaction=++this.windowVersion){const binding=this.binding,generation=this.generation,owner=this.host.ownerDocument;if(!binding||!this.usable()||!this.validIndex(start))return;const existing=this.pages.get(start);if(existing&&!(retry&&existing.state==="error"))return this.pages.delete(start),this.pages.set(start,existing),existing;if(existing&&this.drop(existing),transaction!==this.windowVersion||!this.current(binding,generation,owner))return;for(;this.pages.size>=this.pageCapacity;)if(this.drop(this.pages.values().next().value),transaction!==this.windowVersion||!this.current(binding,generation,owner))return;let settle;const done=new Promise(resolve=>{settle=resolve}),page={start,length:Math.min(this.options.pageSize,this.count-start),state:"queued",done,settle};return this.pages.set(start,page),this.queue.push(page),this.schedulePump(),page}drop(page){this.pages.get(page.start)===page&&this.pages.delete(page.start),this.releasePageValues(page),this.queue=this.queue.filter(candidate=>candidate!==page),page.channel&&this.running.get(page.channel)===page&&this.authority.invalidate(page.channel),page.settle(!1)}clear(){this.generation++,this.windowVersion++,this.demandVersion++,this.lookupVersion++,this.lookupCurrent?.settle(null),this.lookupCurrent=void 0,this.notification=void 0;const pages=[...this.pages.values()];this.pages.clear(),this.queue=[],this.local.clear(),this.cachedKeyUnits=0,this.totalWeight=0;for(const page of pages)page.staging&&(page.staging.length=0),page.staging=void 0,page.weight=void 0,page.keys=void 0,page.slots=void 0,page.keyUnits=void 0,page.settle(!1),page.channel&&this.running.get(page.channel)===page&&this.authority.invalidate(page.channel)}schedulePump(){this.pumpScheduled||(this.pumpScheduled=!0,queueMicrotask(()=>{this.pumpScheduled=!1,this.pump()}))}pump(){const binding=this.binding;if(!(!binding||!this.usable()||isIndexed(binding.view)))for(let i=0;i<this.options.maxConcurrent;i++){const channel=i===0?"range-0":"range-1";if(this.running.has(channel))continue;const page=this.queue.shift();if(!page)break;const generation=this.generation,owner=this.host.ownerDocument,lease=this.authority.begin(channel,binding.locale);if(!lease||!this.current(binding,generation,owner)){this.drop(page);continue}const view=binding.view;page.state="loading",page.channel=channel,this.running.set(channel,page);const current=()=>lease.isCurrent()&&this.current(binding,generation,owner)&&this.pages.get(page.start)===page;let acceptanceVersion,restart=!1;Promise.resolve().then(()=>current()?view.read({...lease.context,offset:page.start,limit:page.length}):void 0).then(values=>{if(!current())return;if(!Array.isArray(values)||values.length!==page.length)throw new RangeError("Invalid source range response");const transaction=this.demandVersion;acceptanceVersion=transaction;const accepting=()=>current()&&(this.options.maxWeight===void 0||transaction===this.demandVersion),keys=[];let keyUnits=0;const seen=new Set,slots=[];this.options.maxWeight!==void 0&&(page.staging=slots);for(let offset=0;offset<page.length;offset++){const index=page.start+offset,raw=values[offset];if(!accepting())throw new Error("Source demand changed");const value=this.options.normalize(raw,index);if(!accepting())throw new Error("Source demand changed");const key=this.validateKey(value,index);if(!accepting())throw new Error("Source demand changed");if(keyUnits+=key.length,keyUnits>MAX_CACHED_KEY_UNITS)throw new RangeError("Source range key budget exceeded");if(seen.has(key))throw new TypeError("Duplicate source key");const weight=this.valueWeight(value,index);if(!accepting()||!this.admitWeight(weight,accepting,page))throw new Error("Source demand changed");page.weight=(page.weight??0)+weight,this.totalWeight+=weight,seen.add(key),keys.push(key),slots.push({state:"ready",index,value})}if(!accepting())throw new Error("Source demand changed");for(const cached of this.pages.values()){if(this.cachedKeyUnits+keyUnits<=MAX_CACHED_KEY_UNITS)break;if(cached!==page&&cached.keys&&(this.options.maxWeight===void 0||!this.demands(cached.start,cached.length))&&this.drop(cached),!accepting())throw new Error("Source demand changed")}if(this.cachedKeyUnits+keyUnits>MAX_CACHED_KEY_UNITS)throw new RangeError("Source window key budget exceeded");page.keys=keys,page.slots=slots,page.keyUnits=keyUnits,page.staging=void 0,this.cachedKeyUnits+=keyUnits,page.state="ready",page.settle(!0),this.notify()}).catch(error=>{if(current()){if(this.releasePageValues(page),this.options.maxWeight!==void 0&&acceptanceVersion!==void 0&&acceptanceVersion!==this.demandVersion){this.demands(page.start,page.length)?restart=!0:this.drop(page);return}page.error=this.options.maxWeight===void 0?error:new Error("Source range admission failed"),page.state="error",page.settle(!1),this.notify()}}).finally(()=>{this.running.get(channel)===page&&this.running.delete(channel),page.channel=void 0,restart&&current()&&(page.state="queued",this.queue.push(page)),this.schedulePump()})}}notify(){if(this.notification)return;const token={},generation=this.generation,owner=this.host.ownerDocument;this.notification=token,queueMicrotask(()=>{this.notification===token&&(this.notification=void 0,this.usable()&&this.generation===generation&&this.host.ownerDocument===owner&&this.options.onChange())})}adopted(){this.authority.adopted()}hostConnected(){const reconnecting=!this.connected;if(this.connected=!0,reconnecting&&this.binding){const requested=this.requested;requested&&this.requestRange(requested.start,requested.end),this.notify()}}hostDisconnected(){this.connected=!1,this.clear()}}export{SourceWindowController};
@@ -0,0 +1 @@
1
+ import{SourceRequestController,sourceCount,sourceRevision}from"./source-request-controller.js";function own(value,key,guard,optional=!1){if(!guard()||value===null||typeof value!="object")throw new TypeError("Invalid spatial data");const descriptor=Object.getOwnPropertyDescriptor(value,key);if(!guard()||descriptor&&!("value"in descriptor)||!descriptor&&!optional)throw new TypeError("Invalid spatial data");return descriptor?.value}function finite(value){if(typeof value!="number"||!Number.isFinite(value))throw new TypeError("Invalid coordinate");return value}function text(value,max){if(typeof value!="string"||value.length>max)throw new TypeError("Invalid metadata");return value}function spatialBounds(value,guard=()=>!0){const minX=finite(own(value,"minX",guard)),maxX=finite(own(value,"maxX",guard)),minY=finite(own(value,"minY",guard)),maxY=finite(own(value,"maxY",guard));if(minX>maxX||minY>maxY)throw new TypeError("Invalid bounds");return Object.freeze({minX,maxX,minY,maxY})}function spatialContains(bounds,point){return point.x>=bounds.minX&&point.x<=bounds.maxX&&point.y>=bounds.minY&&point.y<=bounds.maxY}function contained(bounds,inner){return spatialContains(bounds,{x:inner.minX,y:inner.minY})&&spatialContains(bounds,{x:inner.maxX,y:inner.maxY})}function viewportBounds(value,global,guard){const result=spatialBounds(value,guard);if(!contained(global,result)||global.minX!==global.maxX&&result.minX===result.maxX||global.minY!==global.maxY&&result.minY===result.maxY)throw new TypeError("Invalid viewport");return result}const chartSeriesIds=new WeakMap;function chartSnapshot(source,policy,count,guard){const type=own(policy,"type",guard);if(type!=="scatter"&&type!=="bubble"||own(source,"kind",guard)!=="spatial")throw new TypeError("Invalid chart source");const rawSeries=own(source,"series",guard);if(!Array.isArray(rawSeries))throw new TypeError("Invalid series");const length=sourceCount(own(rawSeries,"length",guard));if(!length||length>1e3)throw new TypeError("Invalid series count");const ids=new Set,series=[];let metadataUnits=0;for(let index=0;index<length;index++){const raw=own(rawSeries,index,guard),id=text(own(raw,"id",guard),256),label=text(own(raw,"label",guard),1024),rawColor=own(raw,"color",guard,!0),color=rawColor===void 0?void 0:text(rawColor,256);if(metadataUnits+=id.length+label.length+(color?.length??0),!id.trim()||ids.has(id)||metadataUnits>65536)throw new TypeError("Invalid series metadata");ids.add(id),series.push(Object.freeze({id,label,...color===void 0?{}:{color}}))}const rawDomain=own(source,"radiusDomain",guard,type==="scatter");let radiusDomain=null;if(rawDomain!=null){const min=finite(own(rawDomain,"min",guard)),max=finite(own(rawDomain,"max",guard));if(min<0||min>max||count===0)throw new TypeError("Invalid radius domain");radiusDomain=Object.freeze({min,max})}if(type==="bubble"&&(count===0?rawDomain!==null:radiusDomain===null))throw new TypeError("Missing radius domain");const result=Object.freeze({type,series:Object.freeze(series),radiusDomain,metadataUnits});return chartSeriesIds.set(result,ids),result}function pointSnapshot(value,count,bounds,guard,chart){const id=text(own(value,"id",guard),256),sourceIndex=sourceCount(own(value,"sourceIndex",guard)),x=finite(own(value,"x",guard)),y=finite(own(value,"y",guard));if(!id.trim()||sourceIndex>=count||!spatialContains(bounds,{x,y}))throw new TypeError("Invalid point");const label=own(value,"label",guard,!0);if(chart){const seriesId=text(own(value,"seriesId",guard),256);if(!chartSeriesIds.get(chart).has(seriesId))throw new TypeError("Unknown series");const rawRadius=own(value,"radius",guard,chart.type==="scatter"),radius=rawRadius===void 0&&chart.type==="scatter"?void 0:finite(rawRadius);if(radius!==void 0&&(!chart.radiusDomain||radius<chart.radiusDomain.min||radius>chart.radiusDomain.max))throw new TypeError("Invalid radius");return Object.freeze({id,sourceIndex,x,y,seriesId,...label===void 0?{}:{label:text(label,1024)},...radius===void 0?{}:{radius}})}const sourceId=own(value,"sourceId",guard,!0),cluster=own(value,"cluster",guard,!0);return Object.freeze({id,sourceIndex,x,y,...label===void 0?{}:{label:text(label,1024)},...sourceId===void 0?{}:{sourceId:text(sourceId,256)},...cluster===void 0?{}:{cluster:typeof cluster=="number"?finite(cluster):text(cluster,256)}})}function pointUnits(point){return(point.seriesId?.length??0)+point.id.length+(point.label?.length??0)+(point.sourceId?.length??0)+(typeof point.cluster=="string"?point.cluster.length:0)}function validatePartition(bins,points,bounds){const ys=[...new Set([...bins.flatMap(bin=>[bin.bounds.minY,bin.bounds.maxY]),...points.map(point=>point.y)])].sort((a,b)=>a-b);if(!ys.length)return;const indices=new Map(ys.map((value,index)=>[value,index*2])),size=ys.length*2,tree=new Int32Array(size*4),lazy=new Int32Array(size*4),range=(lo,hi,delta,node=1,left=0,right=size-1)=>{if(lo>right||hi<left)return delta===0?-1/0:0;if(lo<=left&&right<=hi)return delta&&(tree[node]=tree[node]+delta,lazy[node]=lazy[node]+delta),tree[node];const mid=left+right>>>1,value=Math.max(range(lo,hi,delta,node*2,left,mid),range(lo,hi,delta,node*2+1,mid+1,right));return delta&&(tree[node]=lazy[node]+Math.max(tree[node*2],tree[node*2+1])),lazy[node]+value},owners=new Int32Array(size+2),represented=new Uint32Array(bins.length),addOwner=(index,value)=>{for(let at=index+1;at<owners.length;at+=at&-at)owners[at]=owners[at]+value},ownerAt=index=>{let result=0;for(let at=index+1;at>0;at-=at&-at)result+=owners[at];return result-1},events=[];for(const[index,bin]of bins.entries()){const b=bin.bounds,lo=indices.get(b.minY),hi=indices.get(b.maxY)-(b.maxY===bounds.maxY?0:1);events.push({x:b.minX,order:1,lo,hi,delta:1,owner:index+1}),events.push({x:b.maxX,order:b.maxX===bounds.maxX?3:0,lo,hi,delta:-1,owner:index+1})}for(const point of points)events.push({x:point.x,order:2,lo:indices.get(point.y),hi:indices.get(point.y),delta:0,owner:0});events.sort((a,b)=>a.x-b.x||a.order-b.order);for(const event of events){const occupied=range(event.lo,event.hi,0);if(event.delta===1&&occupied!==0||event.delta===0&&occupied!==1)throw new TypeError("Invalid spatial partition");if(event.delta)range(event.lo,event.hi,event.delta),addOwner(event.lo,event.owner*event.delta),addOwner(event.hi+1,-event.owner*event.delta);else{const owner=ownerAt(event.lo);if(represented[owner]=represented[owner]+1,represented[owner]>bins[owner].count)throw new TypeError("Too many bin representatives")}}}class SpatialSourceController{constructor(host,changed,locale){this.host=host,this.changed=changed,this.locale=locale,this.error=!1,this.loading=!1,this.bindingToken={},this.configurationToken={},this.queryActive=!1,this.lookupActive=!1,this.lookupToken={},this.selectedId="",this.revealId="",this.selectedDone="",this.revealDone="",this.resultUnits=0,this.pendingUnits=0,this.viewport=null,this.authority=new SourceRequestController(host,{channels:["query","lookup"]})}current(token){return this.bindingToken===token&&this.host.isConnected}reset(){const token=this.bindingToken={};this.configurationToken={},this.binding=void 0,this.result=void 0,this.resultUnits=0,this.view=void 0,this.selected=void 0,this.revealed=void 0,this.selectedDone="",this.revealDone="",this.revealId="",this.queryIntent=void 0,this.lookupToken={},this.error=!1,this.loading=!1;const resolve=this.revealResolve;return this.revealResolve=void 0,this.authority.setSource(void 0,void 0)||this.authority.refresh(),resolve?.(null),token}bind(source,viewport,max,selectedId,chartPolicy){const token=this.reset(),guard=()=>this.current(token);if(guard()){if(source===null||!this.host.isConnected){this.changed();return}try{const revision=sourceRevision(own(source,"revision",guard));typeof revision=="string"&&text(revision,256);const count=sourceCount(own(source,"count",guard)),rawBounds=own(source,"bounds",guard),bounds=rawBounds===null?null:spatialBounds(rawBounds,guard);if(count===0!=(bounds===null))throw new TypeError("Invalid global bounds");const chart=chartPolicy===void 0?void 0:chartSnapshot(source,chartPolicy,count,guard),query=own(source,"query",guard),getPoint=own(source,"getPoint",guard);if(typeof query!="function"||typeof getPoint!="function")throw new TypeError("Invalid spatial methods");if(!guard()||(this.authority.setSource(source,revision),!guard()))return;this.binding={chart,source,revision,count,bounds,query,getPoint},this.selectedId=selectedId,this.configure(viewport,max)}catch{guard()&&(this.error=!0,this.changed())}}}configure(viewport,max){const binding=this.binding,token=this.bindingToken,configuration=this.configurationToken={},guard=()=>this.current(token)&&this.configurationToken===configuration;if(!(!binding||!guard()))try{if(max<3||max>1e4)throw new TypeError("Invalid spatial budget");this.viewport=viewport;const bounds=binding.bounds,view=bounds===null?void 0:viewport===null?bounds:viewportBounds(viewport,bounds,guard);if(!guard()||(this.authority.invalidate("query"),!guard()))return;if(this.error=!1,this.view=view,!view){this.result=Object.freeze({points:Object.freeze([]),bins:Object.freeze([]),matchedCount:0}),this.loading=!1,this.changed();return}const maxBins=Math.ceil((max-2)/2),maxPoints=max-2-maxBins;this.queryIntent={bounds:view,maxBins,maxPoints,token:{}},this.loading=!0,this.changed(),this.pumpQuery(),this.pumpLookup()}catch{guard()&&(this.error=!0,this.loading=!1,this.queryIntent=void 0,this.authority.invalidate("query"),this.changed())}}setSelected(id){this.selectedId=id,this.selectedDone="",this.selected=void 0,this.lookupToken={},this.authority.invalidate("lookup"),this.changed(),this.pumpLookup()}reveal(id){this.revealResolve?.(null),this.revealResolve=void 0,this.revealId=id,this.revealDone="",this.revealed=void 0;const token=this.lookupToken={};return this.authority.invalidate("lookup"),this.lookupToken!==token||typeof id!="string"||!id||!this.binding||!this.host.isConnected||id.length>256||!id.trim()?Promise.resolve(null):new Promise(resolve=>{this.revealResolve=resolve,this.pumpLookup()})}pumpQuery(){if(this.queryActive||!this.queryIntent||!this.binding||!this.host.isConnected)return;const binding=this.binding,intent=this.queryIntent,token=this.bindingToken,lease=this.authority.begin("query",this.locale());if(!lease)return;const guard=()=>this.current(token)&&this.queryIntent===intent&&lease.isCurrent();guard()&&(this.queryActive=!0,(async()=>{try{const request=Object.freeze({bounds:intent.bounds,maxBins:intent.maxBins,maxPoints:intent.maxPoints,signal:lease.context.signal}),response=await binding.query.call(binding.source,request);if(!guard())return;const matchedCount=sourceCount(own(response,"matchedCount",guard));if(matchedCount>binding.count)throw new TypeError("Invalid matched count");const rawBins=own(response,"bins",guard),rawPoints=own(response,"points",guard);if(!Array.isArray(rawBins)||!Array.isArray(rawPoints))throw new TypeError("Invalid spatial arrays");const binCount=sourceCount(own(rawBins,"length",guard)),pointCount=sourceCount(own(rawPoints,"length",guard));if(binCount>intent.maxBins||pointCount>intent.maxPoints||pointCount>matchedCount)throw new TypeError("Spatial budget exceeded");const bins=[],points=[],ids=new Set;let remainder=matchedCount,units=0;for(let index=0;index<binCount;index++){const raw=own(rawBins,index,guard),bounds=spatialBounds(own(raw,"bounds",guard),guard),count=sourceCount(own(raw,"count",guard));if(!count||count>remainder||!contained(intent.bounds,bounds)||intent.bounds.minX!==intent.bounds.maxX&&bounds.minX===bounds.maxX||intent.bounds.minY!==intent.bounds.maxY&&bounds.minY===bounds.maxY)throw new TypeError("Invalid bin");remainder-=count,bins.push(Object.freeze({bounds,count}))}if(remainder)throw new TypeError("Incomplete density");for(let index=0;index<pointCount;index++){const point=pointSnapshot(own(rawPoints,index,guard),binding.count,intent.bounds,guard,binding.chart);if(units+=pointUnits(point),this.pendingUnits=units,units>997e3||!this.metadataFits(units)||ids.has(point.id))throw new TypeError("Invalid spatial metadata");ids.add(point.id),points.push(point);for(const exact of[this.selected,this.revealed])if(exact?.id===point.id&&!this.samePoint(exact,point))throw new TypeError("Inconsistent point")}if(validatePartition(bins,points,intent.bounds),!guard())return;this.resultUnits=units,this.result=Object.freeze({matchedCount,bins:Object.freeze(bins),points:Object.freeze(points)}),this.queryIntent=void 0,this.loading=!1,this.error=!1,this.changed()}catch{guard()&&(this.error=!0,this.loading=!1,this.queryIntent=void 0,this.changed())}finally{this.pendingUnits=0,this.queryActive=!1,this.pumpQuery()}})())}metadataFits(pending=0,lookup=0){const revision=this.binding?.revision;return(this.binding?.chart?.metadataUnits??0)+this.resultUnits+Math.max(this.pendingUnits,pending)+lookup+(this.selected?pointUnits(this.selected):0)+(this.revealed?pointUnits(this.revealed):0)+(typeof revision=="string"?revision.length:0)+this.selectedId.length+this.revealId.length<=2e6}samePoint(a,b){return a.id===b.id&&a.sourceIndex===b.sourceIndex&&a.x===b.x&&a.y===b.y&&a.label===b.label&&a.sourceId===b.sourceId&&a.cluster===b.cluster&&a.seriesId===b.seriesId&&a.radius===b.radius}pumpLookup(){if(this.lookupActive||!this.binding||!this.host.isConnected)return;const isSelected=this.selectedId!==""&&this.selectedDone!==this.selectedId,id=isSelected?this.selectedId:this.revealId;if(!id||!isSelected&&this.revealDone===id)return;const binding=this.binding,token=this.bindingToken,lookupToken=this.lookupToken,lease=this.authority.begin("lookup",this.locale());if(!lease)return;const guard=()=>this.current(token)&&this.lookupToken===lookupToken&&lease.isCurrent();guard()&&(this.lookupActive=!0,(async()=>{let point=null;try{if(text(id,256),!id.trim())throw new TypeError("Invalid ID");const raw=[this.selected,this.revealed,...this.result?.points??[]].find(item=>item?.id===id)??await binding.getPoint.call(binding.source,id,Object.freeze({signal:lease.context.signal}));if(!guard())return;if(raw!==null){if(!binding.bounds)throw new TypeError("Point in empty source");const candidate=pointSnapshot(raw,binding.count,binding.bounds,guard,binding.chart);if(candidate.id!==id||!this.metadataFits(0,pointUnits(candidate)))throw new TypeError("Invalid exact point");if([this.selected,this.revealed,...this.result?.points??[]].some(item=>item?.id===id&&!this.samePoint(item,candidate)))throw new TypeError("Inconsistent exact point");point=candidate}else if([this.selected,this.revealed,...this.result?.points??[]].some(item=>item?.id===id))throw new TypeError("Missing known point")}catch{guard()&&(this.error=!0)}finally{if(guard()){if(isSelected)this.selected=point??void 0,this.selectedDone=id;else{this.revealed=point??void 0,this.revealDone=id;const resolve=this.revealResolve;this.revealResolve=void 0,resolve?.(point)}this.changed()}this.lookupActive=!1,this.pumpLookup()}})())}points(){const points=[...this.result?.points??[]];for(const point of[this.selected,this.revealed])point&&!points.some(item=>item.id===point.id)&&points.push(point);return points}panTo(point){const global=this.binding?.bounds,view=this.view;if(!global||!view)return;if(this.viewport===null||spatialContains(view,point))return this.viewport;const axis=(lo,hi,gLo,gHi,value)=>{if(lo===hi)return[lo,hi];const span=hi-lo;if(!Number.isFinite(span))return;let min=value<lo?value:value>hi?value-span:lo;min=Math.max(gLo,Math.min(min,gHi-span));const max=min+span;return Number.isFinite(min)&&Number.isFinite(max)&&min<=value&&max>=value&&max<=gHi&&max-min===span?[min,max]:void 0},x=axis(view.minX,view.maxX,global.minX,global.maxX,point.x),y=axis(view.minY,view.maxY,global.minY,global.maxY,point.y);return x&&y?Object.freeze({minX:x[0],maxX:x[1],minY:y[0],maxY:y[1]}):void 0}}export{SpatialSourceController,spatialContains};
@@ -44,11 +44,7 @@ export interface TextQuoteScope{text:string;segments:TextQuoteSegment[];truncate
44
44
  /** Sparse mapping from whole-scope NFC offsets back to the per-segment normalized coordinate. */
45
45
  globalNormalization?:TextOffsetMapping;}interface TextOffsetMapping{text:string;
46
46
  /** Packed `[sourceStart, sourceEnd, mappedStart, mappedEnd]` entries. */
47
- expansions:Uint32Array;}
48
- /** Builds a scope by walking `root`'s text nodes in document order (skipping
49
- * script/style/template/noscript), concatenating each node's normalized text. Callers pass their
50
- * *content* element (e.g. markdown's `[part="content"]`) so toolbar chrome never enters the corpus. */
51
- export declare function scopeFromElement(root:Element,limitOverrides?:Partial<TextQuoteLimits>,skipElement?:(element:Element)=>boolean):TextQuoteScope;
47
+ expansions:Uint32Array|number[];}export declare function scopeFromElement(root:Element,limitOverrides?:Partial<TextQuoteLimits>,skipElement?:(element:Element)=>boolean):TextQuoteScope;
52
48
  /** Builds a scope from ordered text-layer items joined in reading order. Normalizes each item's
53
49
  * authoritative `text` and maps offsets into its explicit direct `node`, or into `element`'s first
54
50
  * text child when `node` is omitted. `joinBefore=false` preserves contiguous nested text within
@@ -67,7 +63,7 @@ export declare function emptyTextQuoteMatches():TextQuoteMatches;export interfac
67
63
  /** Reusable per-content/per-locale occurrence index. Cached queries allocate packed offsets; a
68
64
  * caller supplies a fresh work budget for each logical operation so one paint pass cannot turn
69
65
  * N distinct highlights into N full-corpus scans. */
70
- export declare class TextQuoteIndex{readonly locale?:string|undefined;private readonly limits;private readonly occurrenceCache;private cachedMatchCount;private foldedScope?;private _scanCount;private _scope;constructor(scope:TextQuoteScope,locale?:string|undefined,limitOverrides?:Partial<TextQuoteLimits>);get scope():TextQuoteScope;
66
+ export declare class TextQuoteIndex{readonly locale?:string|undefined;private readonly limits;private readonly occurrenceCache;private cachedMatchCount;private foldedScope?;private _scanCount;scannedCodeUnits:number;private _scope;constructor(scope:TextQuoteScope,locale?:string|undefined,limitOverrides?:Partial<TextQuoteLimits>);get scope():TextQuoteScope;
71
67
  /** Rebinds offset-to-node materialization after a structurally different but semantically
72
68
  * identical DOM paint, preserving the folded corpus and occurrence cache. */
73
69
  rebindScope(scope:TextQuoteScope):boolean;get scanCount():number;createWorkBudget(maxCodeUnits?:number):TextQuoteWorkBudget;private consumeWork;private boundedQuery;private foldedFor;private cache;private occurrences;search(query:string,budget?:TextQuoteWorkBudget):TextQuoteMatches;resolve(anchor:{quote:string;prefix?:string;suffix?:string;},budget?:TextQuoteWorkBudget):TextQuoteMatch|null;}export declare function createTextQuoteIndex(scope:TextQuoteScope,locale?:string,limitOverrides?:Partial<TextQuoteLimits>):TextQuoteIndex;