@aceshooting/lyra-ui 30.9.0 → 31.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/CHANGELOG.md +236 -339
  2. package/dist/ai/adapters/ag-ui.js +1 -1
  3. package/dist/components/agent-tools/activity-feed/activity-feed.class.js +1 -1
  4. package/dist/components/agent-tools/compare-panel/compare-panel.class.js +1 -1
  5. package/dist/components/agent-tools/eval-dataset/eval-dataset.class.js +1 -1
  6. package/dist/components/agent-tools/thinking-panel/thinking-panel.class.js +1 -1
  7. package/dist/components/agent-tools/tool-select-dialog/tool-select-dialog.class.js +1 -1
  8. package/dist/components/charts/chart/box-plot.class.js +2 -2
  9. package/dist/components/charts/chart/chart-sync.js +1 -1
  10. package/dist/components/charts/chart/chart.class.d.ts +1 -1
  11. package/dist/components/charts/chart/chart.class.js +4 -4
  12. package/dist/components/charts/chart/lite-chart-axis-layout.js +1 -1
  13. package/dist/components/charts/chart/lite-chart.class.js +1 -1
  14. package/dist/components/conversation/chat-composer/chat-composer.class.d.ts +9 -4
  15. package/dist/components/conversation/chat-composer/chat-composer.class.js +1 -1
  16. package/dist/components/conversation/chat-composer/chat-composer.styles.js +1 -1
  17. package/dist/components/conversation/chat-message/chat-message.class.d.ts +27 -3
  18. package/dist/components/conversation/chat-message/chat-message.class.js +14 -12
  19. package/dist/components/conversation/chat-message/chat-message.styles.js +1 -1
  20. package/dist/components/conversation/chat-viewport/chat-viewport.class.d.ts +29 -2
  21. package/dist/components/conversation/chat-viewport/chat-viewport.class.js +2 -2
  22. package/dist/components/conversation/chat-viewport/chat-viewport.styles.js +1 -1
  23. package/dist/components/conversation/code-block/code-block-shared.js +1 -1
  24. package/dist/components/conversation/markdown/markdown-base.class.d.ts +1 -1
  25. package/dist/components/conversation/markdown/markdown-base.class.js +1 -1
  26. package/dist/components/conversation/markdown/markdown-code-header.js +1 -1
  27. package/dist/components/conversation/markdown/markdown-core.class.d.ts +10 -0
  28. package/dist/components/conversation/markdown/markdown-core.class.js +1 -1
  29. package/dist/components/conversation/markdown/markdown-shared.d.ts +7 -2
  30. package/dist/components/conversation/markdown/markdown-shared.js +3 -3
  31. package/dist/components/conversation/markdown/markdown.class.d.ts +10 -0
  32. package/dist/components/conversation/markdown/markdown.class.js +1 -1
  33. package/dist/components/conversation/message-feedback/message-feedback.class.js +2 -2
  34. package/dist/components/conversation/message-parts/message-parts.class.js +1 -1
  35. package/dist/components/conversation/prompt-input/prompt-input.class.d.ts +2 -1
  36. package/dist/components/conversation/streaming-text/streaming-text-base.class.d.ts +4 -0
  37. package/dist/components/conversation/streaming-text/streaming-text-base.class.js +1 -1
  38. package/dist/components/conversation/streaming-text/streaming-text-core.class.d.ts +1 -1
  39. package/dist/components/conversation/streaming-text/streaming-text-core.class.js +1 -0
  40. package/dist/components/conversation/streaming-text/streaming-text.class.d.ts +1 -1
  41. package/dist/components/conversation/streaming-text/streaming-text.class.js +1 -0
  42. package/dist/components/conversation/suggestion-chips/suggestion-chips.class.d.ts +17 -3
  43. package/dist/components/conversation/suggestion-chips/suggestion-chips.class.js +3 -3
  44. package/dist/components/conversation/suggestion-chips/suggestion-chips.d.ts +1 -1
  45. package/dist/components/conversation/suggestion-chips/suggestion-chips.js +1 -1
  46. package/dist/components/conversation/suggestion-chips/suggestion-chips.styles.js +1 -1
  47. package/dist/components/conversation/thread-list/thread-list.class.js +2 -2
  48. package/dist/components/conversation/transcript-feed/transcript-feed.class.js +1 -1
  49. package/dist/components/data/data-grid/data-grid.class.d.ts +10 -10
  50. package/dist/components/data/data-grid/data-grid.class.js +1 -1
  51. package/dist/components/data/file-tree/file-tree.class.js +1 -1
  52. package/dist/components/data/flow-canvas/flow-canvas.class.js +1 -1
  53. package/dist/components/data/heatmap/heatmap.class.d.ts +1 -1
  54. package/dist/components/data/heatmap/heatmap.class.js +1 -1
  55. package/dist/components/data/pagination/pagination.class.js +1 -1
  56. package/dist/components/data/table/table.class.d.ts +31 -2
  57. package/dist/components/data/table/table.class.js +3 -3
  58. package/dist/components/data/table/table.styles.js +1 -1
  59. package/dist/components/data/timeline/timeline-cluster.js +1 -1
  60. package/dist/components/data/timeline/timeline-item.class.d.ts +10 -3
  61. package/dist/components/data/timeline/timeline-item.class.js +16 -12
  62. package/dist/components/data/timeline/timeline-item.styles.js +1 -1
  63. package/dist/components/data/timeline/timeline.class.d.ts +14 -2
  64. package/dist/components/data/timeline/timeline.class.js +9 -5
  65. package/dist/components/data/tree/tree-item.class.js +1 -1
  66. package/dist/components/data/tree/tree.class.d.ts +2 -0
  67. package/dist/components/data/tree/tree.class.js +1 -1
  68. package/dist/components/forms/button/button.class.d.ts +8 -6
  69. package/dist/components/forms/button/button.class.js +2 -2
  70. package/dist/components/forms/checkbox-group/checkbox-group.class.js +1 -1
  71. package/dist/components/forms/color-picker/color-core.js +1 -1
  72. package/dist/components/forms/date-picker/date-input.class.d.ts +1 -1
  73. package/dist/components/forms/date-picker/date-input.class.js +1 -1
  74. package/dist/components/forms/icon-button/icon-button.class.d.ts +4 -2
  75. package/dist/components/forms/icon-button/icon-button.class.js +2 -2
  76. package/dist/components/forms/input/input-shared.js +2 -2
  77. package/dist/components/forms/input/number-input-locale.js +1 -0
  78. package/dist/components/forms/input/number-input.class.d.ts +19 -2
  79. package/dist/components/forms/input/number-input.class.js +2 -2
  80. package/dist/components/forms/locale-picker/locale-picker.class.d.ts +3 -3
  81. package/dist/components/forms/locale-picker/locale-picker.class.js +1 -1
  82. package/dist/components/layout/app-rail-group/app-rail-group.class.js +1 -1
  83. package/dist/components/layout/details/accordion-item.class.js +1 -1
  84. package/dist/components/layout/menu/menu.class.js +1 -1
  85. package/dist/components/layout/multi-split/multi-split.class.js +1 -1
  86. package/dist/components/layout/navigation-menu-item/navigation-menu-item.class.js +1 -1
  87. package/dist/components/layout/tab-group/tab-group.class.d.ts +8 -1
  88. package/dist/components/layout/tab-group/tab-group.class.js +1 -1
  89. package/dist/components/layout/tab-group/tab.class.d.ts +7 -1
  90. package/dist/components/layout/tab-group/tab.class.js +1 -1
  91. package/dist/components/layout/virtual-list/virtual-list.class.d.ts +2 -2
  92. package/dist/components/layout/virtual-list/virtual-list.class.js +1 -1
  93. package/dist/components/media/animated-image/animated-image.class.js +1 -1
  94. package/dist/components/media/attachment-chip/attachment-chip.class.d.ts +21 -14
  95. package/dist/components/media/attachment-chip/attachment-chip.class.js +1 -1
  96. package/dist/components/media/attachment-trigger/attachment-trigger.class.d.ts +36 -12
  97. package/dist/components/media/attachment-trigger/attachment-trigger.class.js +3 -3
  98. package/dist/components/media/drop-zone/drop-zone.class.d.ts +23 -5
  99. package/dist/components/media/drop-zone/drop-zone.class.js +2 -2
  100. package/dist/components/media/drop-zone/drop-zone.styles.js +1 -1
  101. package/dist/components/media/file-icon/file-icon.class.js +1 -1
  102. package/dist/components/media/flag/flag-url-resolver.js +1 -1
  103. package/dist/components/media/image-viewer/image-viewer.class.d.ts +2 -2
  104. package/dist/components/media/image-viewer/image-viewer.class.js +1 -1
  105. package/dist/components/media/map/map-owned-features.js +1 -1
  106. package/dist/components/media/map/map-scene-elevated-lines.js +2 -2
  107. package/dist/components/media/map/map-scene-render-controller.js +1 -1
  108. package/dist/components/media/map/map.class.d.ts +5 -5
  109. package/dist/components/media/map/map.class.js +3 -3
  110. package/dist/components/media/pan-zoom/pan-zoom.class.js +1 -1
  111. package/dist/components/media/video/video.class.d.ts +3 -3
  112. package/dist/components/media/video/video.class.js +3 -1
  113. package/dist/components/media/video-playlist/video-playlist.class.js +1 -1
  114. package/dist/components/overlays/chip/chip.class.js +1 -1
  115. package/dist/components/overlays/overlay/dropdown.class.js +1 -1
  116. package/dist/components/overlays/overlay/tooltip.class.d.ts +5 -1
  117. package/dist/components/overlays/overlay/tooltip.class.js +3 -3
  118. package/dist/components/retrieval/embedding-explorer/embedding-explorer-engine.js +1 -1
  119. package/dist/components/retrieval/graph/graph-node-renderer.js +1 -1
  120. package/dist/components/retrieval/graph/graph-spatial-controller.js +1 -1
  121. package/dist/components/retrieval/graph/graph.class.d.ts +1 -1
  122. package/dist/components/retrieval/graph/graph.class.js +1 -1
  123. package/dist/components/retrieval/mind-map/mind-map.class.js +1 -1
  124. package/dist/components/retrieval/neighbor-list/neighbor-list.class.d.ts +1 -1
  125. package/dist/components/retrieval/neighbor-list/neighbor-list.class.js +3 -3
  126. package/dist/components/retrieval/retrieval-results/retrieval-results.class.js +1 -1
  127. package/dist/components/utility/json-viewer/json-viewer.class.d.ts +16 -1
  128. package/dist/components/utility/json-viewer/json-viewer.class.js +4 -4
  129. package/dist/components/utility/json-viewer/json-viewer.styles.js +1 -1
  130. package/dist/components/utility/known-date/known-date.class.js +1 -1
  131. package/dist/components/utility/mention-popover/mention-popover.class.js +1 -1
  132. package/dist/components/viewers/calendar-viewer/calendar-viewer.class.js +1 -1
  133. package/dist/components/viewers/contact-viewer/contact-viewer.class.js +1 -1
  134. package/dist/components/viewers/csv-viewer/csv-viewer.class.js +1 -1
  135. package/dist/components/viewers/dataset-viewer/dataset-viewer.class.js +1 -1
  136. package/dist/components/viewers/docx-viewer/docx-viewer.class.js +1 -1
  137. package/dist/components/viewers/ebook-viewer/ebook-viewer.class.js +1 -1
  138. package/dist/components/viewers/include/include.class.js +1 -1
  139. package/dist/components/viewers/model-viewer/model-viewer.class.js +1 -1
  140. package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js +1 -1
  141. package/dist/components/viewers/pdf-viewer/pdf-viewer.class.d.ts +2 -2
  142. package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js +2 -2
  143. package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.class.js +1 -1
  144. package/dist/components/viewers/table-viewer-shared.js +4 -4
  145. package/dist/framework-types.d.ts +1 -1
  146. package/dist/internal/anchored-overlay-runtime.js +1 -1
  147. package/dist/internal/catalog-picker.js +1 -1
  148. package/dist/internal/document-tokens.js +2 -2
  149. package/dist/internal/drop-session-controller.js +1 -1
  150. package/dist/internal/engine-3d.js +1 -1
  151. package/dist/internal/icon-only-content.js +1 -1
  152. package/dist/internal/layered-layout.js +1 -1
  153. package/dist/internal/map-custom-layer-controller.js +1 -1
  154. package/dist/internal/media-panorama.js +1 -1
  155. package/dist/internal/package-metadata.js +1 -1
  156. package/dist/internal/safe-url.js +1 -1
  157. package/dist/internal/scoped-definitions.generated.js +1 -1
  158. package/dist/internal/scroll-overflow.js +1 -1
  159. package/dist/internal/source-window-controller.js +1 -1
  160. package/dist/internal/text-quote.js +1 -1
  161. package/dist/internal/viewer-search.js +1 -1
  162. package/dist/lyra.d.ts +1 -1
  163. package/dist/sequence-time-binding.js +1 -1
  164. package/dist/simulation-clock.js +1 -1
  165. package/dist/styles/reservations.css +1 -1
  166. package/dist/styles/reservations.styles.js +1 -1
  167. package/dist/testing/happy-dom-shims.js +1 -1
  168. package/dist/theme/theme.js +1 -1
  169. package/llms/components/lr-attachment-chip.md +27 -12
  170. package/llms/components/lr-attachment-trigger.md +27 -7
  171. package/llms/components/lr-button.md +6 -4
  172. package/llms/components/lr-chat-composer.md +13 -7
  173. package/llms/components/lr-chat-message.md +44 -3
  174. package/llms/components/lr-chat-viewport.md +39 -2
  175. package/llms/components/lr-data-grid.md +2 -0
  176. package/llms/components/lr-dialog.md +10 -0
  177. package/llms/components/lr-drop-zone.md +26 -2
  178. package/llms/components/lr-icon-button.md +2 -1
  179. package/llms/components/lr-json-viewer.md +17 -0
  180. package/llms/components/lr-locale-picker.md +5 -0
  181. package/llms/components/lr-markdown-core.md +2 -1
  182. package/llms/components/lr-markdown.md +20 -4
  183. package/llms/components/lr-menu.md +3 -1
  184. package/llms/components/lr-number-input.md +28 -1
  185. package/llms/components/lr-prompt-input.md +1 -1
  186. package/llms/components/lr-streaming-text-core.md +3 -2
  187. package/llms/components/lr-streaming-text.md +4 -1
  188. package/llms/components/lr-suggestion-chips.md +28 -5
  189. package/llms/components/lr-tab-group.md +13 -1
  190. package/llms/components/lr-tab.md +5 -0
  191. package/llms/components/lr-table.md +25 -4
  192. package/llms/components/lr-timeline-item.md +1 -1
  193. package/llms/components/lr-timeline.md +38 -4
  194. package/llms/components/lr-tooltip.md +3 -1
  195. package/llms/components/lr-tree.md +4 -0
  196. package/llms/components/lr-virtual-list.md +1 -0
  197. package/llms/peers.md +2 -2
  198. package/llms/shared/forms-and-accessibility.md +21 -4
  199. package/llms/shared.md +21 -4
  200. package/package.json +21 -20
  201. package/registrations.json +1 -1
@@ -1 +1 @@
1
- const defaultRuntimeLoader=()=>import("./positioner.js").then(runtime=>({place:runtime.placeAnchoredSurface,placeSession:runtime.placeAnchoredSurfaceSession,trackRect:runtime.trackRect,releaseTopLayer:runtime.releaseTopLayer}));let runtimeLoader=defaultRuntimeLoader,runtimePromise;function loadAnchoredOverlayRuntime(){if(runtimePromise)return runtimePromise;const pending=runtimeLoader().catch(error=>{throw runtimePromise===pending&&(runtimePromise=void 0),error});return runtimePromise=pending}const activePlacementByPopup=new WeakMap;function concealPendingPopup(popup,strategy){activePlacementByPopup.get(popup)?.(),popup.style.position=strategy??"fixed";const pending=[popup.style.visibility,popup.style.getPropertyPriority("visibility")];return popup.style.setProperty("visibility","hidden","important"),pending}function releasePendingPopup(popup,pending){const[value,priority]=pending;popup.style.visibility!=="hidden"||popup.style.getPropertyPriority("visibility")!=="important"||popup.style.setProperty("visibility",value,priority)}function deferredPlace(...args){const[anchor,popup,options={}]=args,pendingVisibility=concealPendingPopup(popup,options.strategy);let active=!0,cleanup,positioned=!1;const dispose=()=>{active&&(active=!1,activePlacementByPopup.delete(popup),cleanup?.(),releasePendingPopup(popup,pendingVisibility))};return activePlacementByPopup.set(popup,dispose),loadAnchoredOverlayRuntime().then(runtime=>{if(active)try{cleanup=runtime.place(anchor,popup,{...options,onPlaced:result=>{active&&(positioned||(positioned=!0,releasePendingPopup(popup,pendingVisibility)),options.onPlaced?.(result))}})}catch{}},()=>{}),dispose}function deferredPlaceReady(...args){const[anchor,popup,options={}]=args,pendingVisibility=concealPendingPopup(popup,options.strategy);let active=!0,cleanup,settle;const ready=new Promise(resolve=>{settle=resolve}),dispose=(()=>{active&&(active=!1,activePlacementByPopup.delete(popup),cleanup?.(),releasePendingPopup(popup,pendingVisibility),settle?.(!1))});return activePlacementByPopup.set(popup,dispose),loadAnchoredOverlayRuntime().then(runtime=>{if(active)try{cleanup=runtime.place(anchor,popup,{...options,onPlaced:result=>{active&&(settle&&(releasePendingPopup(popup,pendingVisibility),settle(!0),settle=void 0),options.onPlaced?.(result))}})}catch{settle?.(!1)}},()=>settle?.(!1)),dispose.ready=ready,dispose}function deferredPlaceSession(...args){const[anchor,popup,options={}]=args,pendingVisibility=concealPendingPopup(popup,options.strategy);let active=!0,suspended=!1,starting=!1,failed=!1,generation=0,runtime,cleanup,retained,settle;const ready=new Promise(resolve=>{settle=resolve}),finish=value=>{settle?.(value),settle=void 0},dispose=()=>{if(!active)return;active=!1,activePlacementByPopup.get(popup)===dispose&&activePlacementByPopup.delete(popup);const stop=cleanup;cleanup=void 0,retained=void 0,stop?.(),releasePendingPopup(popup,pendingVisibility),finish(!1)};activePlacementByPopup.set(popup,dispose);const start=(propagateFailure=!1)=>{if(!active||suspended||starting||failed||cleanup||!runtime)return;const installed=generation,capability=runtime.placeSession;starting=!0;try{const placementOptions={...options,onPlaced:result=>{!active||suspended||!capability&&installed!==generation||(settle&&(releasePendingPopup(popup,pendingVisibility),finish(!0)),options.onPlaced?.(result))}},next=capability?capability.call(runtime,anchor,popup,placementOptions):runtime.place(anchor,popup,placementOptions);if(!active){next();return}cleanup=next,retained=capability?next:void 0,(suspended||installed!==generation)&&(retained?retained.invalidate():(cleanup=void 0,next()))}catch(error){if(failed=!0,finish(!1),propagateFailure)throw error}finally{starting=!1}active&&!suspended&&installed!==generation&&(retained?retained.update():start(propagateFailure))},operation=Object.assign(dispose,{ready,isActive(){return active&&!failed&&(retained?.isActive()??!0)},invalidate(){if(active)if(suspended=!0,generation++,retained)retained.invalidate();else{const stop=cleanup;cleanup=void 0,stop?.()}},update(){active&&(suspended=!1,retained?retained.update():start(!0))}});return loadAnchoredOverlayRuntime().then(value=>{runtime=value,start()},()=>{failed=!0,finish(!1)}),operation}async function waitForDeferredPlacement(current){let operation;for(;operation=current();){const positioned=await operation.ready;if(operation===current())return!!positioned}return!0}async function awaitPopupAnimations(host,popup,isCurrent){const ownerDocument=host.ownerDocument;if(!isCurrent())return!1;if(!host.isConnected)return!0;const view=ownerDocument.defaultView;if(view&&await new Promise(resolve=>view.requestAnimationFrame(()=>resolve())),host.ownerDocument!==ownerDocument||!isCurrent())return!1;const animations=popup()?.getAnimations({subtree:!0})??[];return await Promise.all(animations.map(animation=>animation.finished.catch(()=>{}))),host.ownerDocument===ownerDocument&&isCurrent()}async function settlePopupTransition(options){const{host,isCurrent}=options,ownerDocument=host.ownerDocument,current=()=>host.ownerDocument===ownerDocument&&isCurrent();await host.updateComplete,current()&&(options.waitForPosition&&(!await options.waitForPosition()||!current()||(await host.updateComplete,!current()))||await awaitPopupAnimations(host,options.popup,current)&&(options.conceal&&(options.conceal(),await host.updateComplete,!current())||options.onSettled()))}class PopupTransitionWaiters{#waiters=new Map;wait(event){return new Promise(resolve=>{const waiters=this.#waiters.get(event)??new Set;waiters.add(resolve),this.#waiters.set(event,waiters)})}resolve(event){const waiters=this.#waiters.get(event);if(waiters){this.#waiters.delete(event);for(const resolve of waiters)resolve()}}}function deferredTrackRect(...args){let active=!0,cleanup;return loadAnchoredOverlayRuntime().then(runtime=>{active&&(cleanup=runtime.trackRect(...args))}).catch(()=>{}),()=>{active=!1,cleanup?.(),cleanup=void 0}}function __setAnchoredOverlayRuntimeLoaderForTesting(loader){runtimeLoader=loader??defaultRuntimeLoader,runtimePromise=void 0}function topLayerPlacement(topLayer,strategy){return{strategy:topLayer?"fixed":strategy,topLayer}}function syncTopLayerRelease(popup,wasPromoted,topLayer,runtime){if(wasPromoted&&!topLayer){if(runtime)return runtime.releaseTopLayer?.(popup),topLayer;loadAnchoredOverlayRuntime().then(runtime2=>runtime2.releaseTopLayer?.(popup),()=>{})}return topLayer}export{PopupTransitionWaiters,__setAnchoredOverlayRuntimeLoaderForTesting,awaitPopupAnimations,deferredPlace,deferredPlaceReady,deferredPlaceSession,deferredTrackRect,loadAnchoredOverlayRuntime,settlePopupTransition,syncTopLayerRelease,topLayerPlacement,waitForDeferredPlacement};
1
+ const defaultRuntimeLoader=()=>import("./positioner.js").then(runtime=>({place:runtime.placeAnchoredSurface,placeSession:runtime.placeAnchoredSurfaceSession,trackRect:runtime.trackRect,releaseTopLayer:runtime.releaseTopLayer}));let runtimeLoader=defaultRuntimeLoader,runtimePromise;function loadAnchoredOverlayRuntime(){if(runtimePromise)return runtimePromise;const pending=runtimeLoader().catch(error=>{throw runtimePromise===pending&&(runtimePromise=void 0),error});return runtimePromise=pending}const activePlacementByPopup=new WeakMap;function concealPendingPopup(popup,strategy){activePlacementByPopup.get(popup)?.(),popup.style.position=strategy??"fixed";const pending=[popup.style.visibility,popup.style.getPropertyPriority("visibility")];return popup.style.setProperty("visibility","hidden","important"),pending}function releasePendingPopup(popup,pending){const[value,priority]=pending;popup.style.visibility!=="hidden"||popup.style.getPropertyPriority("visibility")!=="important"||popup.style.setProperty("visibility",value,priority)}function deferredPlace(...args){const[anchor,popup,options={}]=args,pendingVisibility=concealPendingPopup(popup,options.strategy);let active=!0,cleanup,positioned=!1;const dispose=()=>{active&&(active=!1,activePlacementByPopup.delete(popup),cleanup?.(),releasePendingPopup(popup,pendingVisibility))};return activePlacementByPopup.set(popup,dispose),loadAnchoredOverlayRuntime().then(runtime=>{if(active)try{const next=runtime.place(anchor,popup,{...options,onPlaced:result=>{active&&(positioned||(positioned=!0,releasePendingPopup(popup,pendingVisibility)),options.onPlaced?.(result))}});active?cleanup=next:next()}catch{}},()=>{}),dispose}function deferredPlaceReady(...args){const[anchor,popup,options={}]=args,pendingVisibility=concealPendingPopup(popup,options.strategy);let active=!0,cleanup,settle;const ready=new Promise(resolve=>{settle=resolve}),dispose=(()=>{active&&(active=!1,activePlacementByPopup.delete(popup),cleanup?.(),releasePendingPopup(popup,pendingVisibility),settle?.(!1))});return activePlacementByPopup.set(popup,dispose),loadAnchoredOverlayRuntime().then(runtime=>{if(active)try{const next=runtime.place(anchor,popup,{...options,onPlaced:result=>{active&&(settle&&(releasePendingPopup(popup,pendingVisibility),settle(!0),settle=void 0),options.onPlaced?.(result))}});active?cleanup=next:next()}catch{settle?.(!1)}},()=>settle?.(!1)),dispose.ready=ready,dispose}function deferredPlaceSession(...args){const[anchor,popup,options={}]=args,pendingVisibility=concealPendingPopup(popup,options.strategy);let active=!0,suspended=!1,starting=!1,failed=!1,generation=0,runtime,cleanup,retained,settle;const ready=new Promise(resolve=>{settle=resolve}),finish=value=>{settle?.(value),settle=void 0},dispose=()=>{if(!active)return;active=!1,activePlacementByPopup.get(popup)===dispose&&activePlacementByPopup.delete(popup);const stop=cleanup;cleanup=void 0,retained=void 0,stop?.(),releasePendingPopup(popup,pendingVisibility),finish(!1)};activePlacementByPopup.set(popup,dispose);const start=(propagateFailure=!1)=>{if(!active||suspended||starting||failed||cleanup||!runtime)return;const installed=generation,capability=runtime.placeSession;starting=!0;try{const placementOptions={...options,onPlaced:result=>{!active||suspended||!capability&&installed!==generation||(settle&&(releasePendingPopup(popup,pendingVisibility),finish(!0)),options.onPlaced?.(result))}},next=capability?capability.call(runtime,anchor,popup,placementOptions):runtime.place(anchor,popup,placementOptions);if(!active){next();return}cleanup=next,retained=capability?next:void 0,(suspended||installed!==generation)&&(retained?retained.invalidate():(cleanup=void 0,next()))}catch(error){if(failed=!0,finish(!1),propagateFailure)throw error}finally{starting=!1}active&&!suspended&&installed!==generation&&(retained?retained.update():start(propagateFailure))},operation=Object.assign(dispose,{ready,isActive(){return active&&!failed&&(retained?.isActive()??!0)},invalidate(){if(active)if(suspended=!0,generation++,retained)retained.invalidate();else{const stop=cleanup;cleanup=void 0,stop?.()}},update(){active&&(suspended=!1,retained?retained.update():start(!0))}});return loadAnchoredOverlayRuntime().then(value=>{runtime=value,start()},()=>{failed=!0,finish(!1)}),operation}async function waitForDeferredPlacement(current){let operation;for(;operation=current();){const positioned=await operation.ready;if(operation===current())return!!positioned}return!0}async function awaitPopupAnimations(host,popup,isCurrent){const ownerDocument=host.ownerDocument;if(!isCurrent())return!1;if(!host.isConnected)return!0;const view=ownerDocument.defaultView;if(view&&await new Promise(resolve=>view.requestAnimationFrame(()=>resolve())),host.ownerDocument!==ownerDocument||!isCurrent())return!1;const animations=popup()?.getAnimations({subtree:!0})??[];return await Promise.all(animations.map(animation=>animation.finished.catch(()=>{}))),host.ownerDocument===ownerDocument&&isCurrent()}async function settlePopupTransition(options){const{host,isCurrent}=options,ownerDocument=host.ownerDocument,current=()=>host.ownerDocument===ownerDocument&&isCurrent();await host.updateComplete,current()&&(options.waitForPosition&&(!await options.waitForPosition()||!current()||(await host.updateComplete,!current()))||await awaitPopupAnimations(host,options.popup,current)&&(options.conceal&&(options.conceal(),await host.updateComplete,!current())||options.onSettled()))}class PopupTransitionWaiters{#waiters=new Map;wait(event){return new Promise(resolve=>{const waiters=this.#waiters.get(event)??new Set;waiters.add(resolve),this.#waiters.set(event,waiters)})}resolve(event){const waiters=this.#waiters.get(event);if(waiters){this.#waiters.delete(event);for(const resolve of waiters)resolve()}}}function deferredTrackRect(...args){let active=!0,cleanup;return loadAnchoredOverlayRuntime().then(runtime=>{if(!active)return;const next=runtime.trackRect(...args);active?cleanup=next:next()}).catch(()=>{}),()=>{active&&(active=!1,cleanup?.(),cleanup=void 0)}}function __setAnchoredOverlayRuntimeLoaderForTesting(loader){runtimeLoader=loader??defaultRuntimeLoader,runtimePromise=void 0}function topLayerPlacement(topLayer,strategy){return{strategy:topLayer?"fixed":strategy,topLayer}}function syncTopLayerRelease(popup,wasPromoted,topLayer,runtime){if(wasPromoted&&!topLayer){if(runtime)return runtime.releaseTopLayer?.(popup),topLayer;loadAnchoredOverlayRuntime().then(runtime2=>runtime2.releaseTopLayer?.(popup),()=>{})}return topLayer}export{PopupTransitionWaiters,__setAnchoredOverlayRuntimeLoaderForTesting,awaitPopupAnimations,deferredPlace,deferredPlaceReady,deferredPlaceSession,deferredTrackRect,loadAnchoredOverlayRuntime,settlePopupTransition,syncTopLayerRelease,topLayerPlacement,waitForDeferredPlacement};
@@ -1 +1 @@
1
- import{setNativeRangeText}from"./native-text-control.js";import{waitForTransitionSettle}from"./css-motion-time.js";import{getOwnDataDescriptor}from"./data-descriptors.js";import{CATALOG_ROW_LIMIT}from"./selection-catalog.js";import{AnchoredPopoverController}from"./anchored-popover-controller.js";import{deferredPlace}from"./anchored-overlay-runtime.js";import{resolveIntlLocale}from"./intl-cache.js";import{prefersReducedMotion}from"./motion.js";import{dispatchNativeEvent,relayNativeEvent}from"./native-event-relay.js";import{activateNonmodalOverlay}from"./nonmodal-overlay-manager.js";import{resolveEffectivePositioningStrategy}from"./positioning-strategy.js";import{TypeAheadBuffer}from"./type-ahead-buffer.js";import{resolveListMove}from"./list-navigation.js";import{PopupController}from"./popup-controller.js";const normalizedCatalogs=new WeakMap;function ownDataValue(target,key){const descriptor=getOwnDataDescriptor(target,key);return typeof descriptor=="symbol"?void 0:descriptor.value}function ownDataCopy(entry){const copy={};let keys=[];try{keys=Object.keys(entry)}catch{}for(const key of keys){const descriptor=getOwnDataDescriptor(entry,key);typeof descriptor!="symbol"&&(copy[key]=descriptor.value)}return Object.freeze(copy)}function normalizeCatalog(catalog){let frozen;try{if(!Array.isArray(catalog))return[];frozen=Object.isFrozen(catalog)}catch{return[]}const known=frozen?normalizedCatalogs.get(catalog):void 0;if(known)return known;const normalized=[],seen=new Set,length=ownDataValue(catalog,"length"),count=typeof length=="number"?Math.min(length,CATALOG_ROW_LIMIT):0;for(let index=0;index<count;index+=1){const entry=ownDataValue(catalog,String(index));let record,id,label;if(typeof entry=="string")record={id:entry,label:entry},id=label=entry;else if(entry!==null&&typeof entry=="object")record=ownDataCopy(entry),id=ownDataValue(entry,"id"),label=ownDataValue(entry,"label");else continue;typeof id!="string"||id.trim()===""||typeof label!="string"||label.trim()===""||seen.has(id)||(seen.add(id),normalized.push(record))}return frozen&&normalizedCatalogs.set(catalog,Object.freeze(normalized)),normalized}function withSyntheticCatalogValue(catalog,value){const entries=catalog.map(entry=>({...entry,synthetic:!1}));return catalog.length&&value.trim()!==""&&!catalog.some(entry=>entry.id===value)&&entries.push({id:value,label:value,synthetic:!0}),entries}function filterCatalogEntries(entries,query,locale,fields){const intlLocale=resolveIntlLocale(locale),normalized=query.trim().toLocaleLowerCase(intlLocale);return normalized?entries.filter(entry=>fields(entry).some(value=>value.toLocaleLowerCase(intlLocale).includes(normalized))):[...entries]}class CatalogPickerController{constructor(host,options){this.host=host,this.options=options,this._activeIndex=-1,this.revealPending=!1,this._query="",this._open=!1,this._value="",this._defaultValue="",this.valueDirty=!1,this.settingDefaultValue=!1,this.reflectingDefaultValue=!1,this._listboxHidden=!0,this.suppressControlEvents=!1,this.rowIndexes=new WeakMap,this.typeBuffer=new TypeAheadBuffer(host),this.popupController=new PopupController({host,onPointer:event=>{event.composedPath().includes(host)||this.overlay?.dismissBackdrop()}}),this.popupPosition=new AnchoredPopoverController((anchor,popup)=>deferredPlace(anchor,popup,{strategy:resolveEffectivePositioningStrategy(this.host,void 0,"fixed")}))}get normalizedCatalog(){const source=this.options.catalog(),memo=this.normalizedMemo;if(memo&&memo.source===source)return memo.rows;const rows=normalizeCatalog(source);return this.normalizedMemo={source,rows},rows}get closedMode(){return this.normalizedCatalog.length>0&&!this.options.allowCustom()}get isReadonly(){return this.options.isReadonly()}get effectiveEntries(){const rows=this.normalizedCatalog,memo=this.effectiveMemo;if(memo&&memo.rows===rows&&memo.value===this._value)return memo.entries;const entries=withSyntheticCatalogValue(rows,this._value);return this.effectiveMemo={rows,value:this._value,entries},entries}get filteredEntries(){const entries=this.effectiveEntries,query=this._query,locale=this.options.locale(),memo=this.filteredMemo;if(memo&&memo.entries===entries&&memo.query===query&&memo.locale===locale)return memo.result;const intlLocale=resolveIntlLocale(locale),needle=query.trim().toLocaleLowerCase(intlLocale);let result;if(!needle)result=[...entries];else{let keys=this.searchKeysMemo;(!keys||keys.entries!==entries||keys.locale!==intlLocale)&&(keys={entries,locale:intlLocale,keys:entries.map(entry=>this.options.searchableFields(entry).map(value=>value.toLocaleLowerCase(intlLocale)))},this.searchKeysMemo=keys);const rowKeys=keys.keys;result=entries.filter((_,index)=>rowKeys[index].some(value=>value.includes(needle)))}return this.filteredMemo={entries,query,locale,result},result}get visibleEntries(){return this.closedMode?this.effectiveEntries:this.filteredEntries}indexesFor(rows){let indexes=this.rowIndexes.get(rows);return indexes||(indexes=new Map,rows.forEach((entry,index)=>{indexes.has(entry.id)||indexes.set(entry.id,index)}),this.rowIndexes.set(rows,indexes)),indexes}entryFor(id){const rows=this.effectiveEntries,index=this.indexesFor(rows).get(id);return index===void 0?void 0:rows[index]}labelFor(id){return id?this.entryFor(id)?.label??id:""}get activeIndex(){return this._activeIndex}setActiveIndex(next){if(next===this._activeIndex)return;const old=this._activeIndex;this.options.beforeActiveIndexChange?.(next,old),this._activeIndex=next,this.revealPending=!0,this.options.onStateChange("activeIndex",old)}revealActiveRow(){const listbox=this.host.renderRoot.querySelector('[part="listbox"]'),row=listbox?.querySelector('[part="option"][data-active]');if(!listbox||row?.offsetParent!==listbox)return;const top=row.offsetTop,bottom=top+row.offsetHeight;top<listbox.scrollTop?listbox.scrollTop=top:bottom>listbox.scrollTop+listbox.clientHeight&&(listbox.scrollTop=bottom-listbox.clientHeight)}get query(){return this._query}setQuery(next){if(next===this._query)return;const old=this._query;this._query=next,this.options.afterQueryChange?.(next,old),this.options.onStateChange("query",old)}get open(){return this._open}get listboxHidden(){return this._listboxHidden}setListboxHidden(next){if(next===this._listboxHidden)return;const old=this._listboxHidden;this._listboxHidden=next,this.options.onStateChange("listboxHidden",old)}cancelListboxHideWatch(){this.listboxHideWatcher?.(),this.listboxHideWatcher=void 0}scheduleListboxHide(){this.cancelListboxHideWatch();const listbox=this.host.renderRoot.querySelector('[part="listbox"]'),watch=waitForTransitionSettle(listbox,this.host,{reducedMotion:prefersReducedMotion(this.host)});if(!watch.pending){this.setListboxHidden(!0);return}const cancel=()=>watch.cancel();this.listboxHideWatcher=cancel,watch.finished.then(()=>{this.listboxHideWatcher===cancel&&(this.listboxHideWatcher=void 0,this.setListboxHidden(!0))})}setOpen(next){const liveDisabled=this.host.effectiveDisabled||typeof this.host.matches=="function"&&this.host.matches(":disabled"),resolved=!!next&&!liveDisabled;if(resolved===this._open){resolved||this.deactivateOverlay(!1),next&&!resolved&&this.host.hasAttribute("open")&&this.host.removeAttribute("open");return}const old=this._open;resolved||(this.setActiveIndex(-1),this.deactivateOverlay(!1)),this._open=resolved,resolved?(this.cancelListboxHideWatch(),this.setListboxHidden(!1),this.closedMode&&this.setActiveIndex(this.entryFor(this._value)?.disabled===!0?-1:this.indexesFor(this.effectiveEntries).get(this._value)??-1)):this.host.updateComplete.then(()=>{this._open||!this.host.isConnected||this.scheduleListboxHide()}),this.options.onStateChange("open",old)}show(){!this._open&&!this.host.effectiveDisabled&&this.setOpen(!0)}hide(){this._open&&this.setOpen(!1)}get value(){return this._value}set value(next){const normalized=next??"";if(this.options.beforeValueChange?.(normalized,this._value),normalized===this._value){this.settingDefaultValue||(this.valueDirty=!0);return}const old=this._value;this.settingDefaultValue||(this.valueDirty=!0),this._value=normalized,this.options.onValueChange(normalized,old)}get defaultValue(){return this._defaultValue}set defaultValue(next){if(this.reflectingDefaultValue)return;const normalized=next??"",old=this._defaultValue;this._defaultValue=normalized,this.reflectDefaultValue(),this.valueDirty||this.restoreLiveValueFromDefault(),this.options.onDefaultValueChange(normalized,old)}resetValue(){this.restoreLiveValueFromDefault()}restoreState(state){this.value=typeof state=="string"?state:""}restoreLiveValueFromDefault(){this.settingDefaultValue=!0;try{this.value=this._defaultValue}finally{this.settingDefaultValue=!1}this.valueDirty=!1}reflectDefaultValue(){this.reflectingDefaultValue=!0;try{this._defaultValue?this.host.setAttribute("value",this._defaultValue):this.host.removeAttribute("value")}finally{this.reflectingDefaultValue=!1}}commitValue(next){if(this.isReadonly)return;const inCatalog=this.indexesFor(this.normalizedCatalog).has(next);this.value=next,this.hide(),this.options.emitChange({value:next,inCatalog}),this.emitValueEvents({value:next,inCatalog})}emitValueEvents(detail={value:this._value,inCatalog:this.indexesFor(this.normalizedCatalog).has(this._value)}){dispatchNativeEvent(this.host,"input"),this.options.emitInput(detail),dispatchNativeEvent(this.host,"change")}commitFreeText(){const active=this.filteredEntries[this._activeIndex],useActive=this._activeIndex>=0&&!!active&&active?.disabled!==!0;this.commitValue(useActive?active.id:this._query.trim())}selectEntry(entry){entry.disabled!==!0&&this.commitValue(entry.id)}reconcileRows(activeValue,rebaseQuery,clampMissing=!0){const rows=this.visibleEntries,remapped=activeValue?this.indexesFor(rows).get(activeValue)??-1:-1;this.setActiveIndex(remapped>=0?remapped:clampMissing?Math.min(this._activeIndex,Math.max(-1,rows.length-1)):-1),rebaseQuery&&this.setQuery(this.labelFor(this._value))}typeAhead(event){const{key}=event;if(!this.typeBuffer.accepts(event)||key===" "&&this.typeBuffer.text==="")return!1;key===" "&&event.preventDefault();const locale=this.options.locale();this.typeBuffer.add(key,locale);const rows=this.effectiveEntries,current=this._open?this._activeIndex:this.indexesFor(rows).get(this._value)??-1,index=this.typeBuffer.match(rows,current,row=>row.label,locale,row=>row.disabled!==!0);if(index!==null){const row=rows[index];this._open?this.setActiveIndex(index):this.selectEntry(row)}return!0}moveIndex(rows,event){return resolveListMove(event,{count:rows.length,current:this._activeIndex,orientation:"vertical",wrap:!1,clamp:!0,backwardFromMissing:"first",isAvailable:index=>rows[index]?.disabled!==!0})??-1}handleTriggerKeyDown(event){if(event.isComposing||event.keyCode===229||event.altKey||event.ctrlKey||event.metaKey||this.typeAhead(event))return;const rows=this.effectiveEntries;switch(event.key){case"ArrowDown":if(event.preventDefault(),!this._open)return this.show();this.setActiveIndex(this.moveIndex(rows,event));break;case"ArrowUp":if(event.preventDefault(),!this._open)return this.show();this.setActiveIndex(this.moveIndex(rows,event));break;case"Enter":case" ":if(this._open){event.preventDefault();const active=rows[this._activeIndex];this._activeIndex>=0&&active?this.selectEntry(active):this.hide()}break;case"Home":this._open&&(event.preventDefault(),this.setActiveIndex(this.moveIndex(rows,event)));break;case"End":this._open&&(event.preventDefault(),this.setActiveIndex(this.moveIndex(rows,event)));break}}handleInputKeyDown(event){if(event.isComposing||event.keyCode===229)return;const rows=this.filteredEntries;switch(event.key){case"ArrowDown":if(event.preventDefault(),!this._open)return this.show();this.setActiveIndex(this.moveIndex(rows,event));break;case"ArrowUp":if(event.preventDefault(),!this._open)return this.show();this.setActiveIndex(this.moveIndex(rows,event));break;case"Enter":this._open&&(event.preventDefault(),this.commitFreeText());break;case"Home":this._open&&(event.preventDefault(),this.setActiveIndex(this.moveIndex(rows,event)));break;case"End":this._open&&(event.preventDefault(),this.setActiveIndex(this.moveIndex(rows,event)));break}}handleInput(event){const input=event.currentTarget;if(!input)return;if(this.isReadonly){input.value=this._open?this._query:this.labelFor(this._value),event.stopPropagation();return}this.setQuery(input.value),this.setActiveIndex(-1),this.show();const detail={value:this._value,inCatalog:this.indexesFor(this.normalizedCatalog).has(this._value)};relayNativeEvent(this.host,event),this.options.emitInput(detail)}handleInputFocus(event){if(this.suppressControlEvents){event.stopPropagation();return}this._open||this.setQuery(this.labelFor(this._value)),this.show(),this.handleControlFocus(event)}handleControlFocus(event){if(this.suppressControlEvents){event.stopPropagation();return}if(this.containsFocusTarget(event.relatedTarget)){event.stopPropagation();return}this.options.onControlFocus?.(event),relayNativeEvent(this.host,event)}handleControlBlur(event){if(this.suppressControlEvents){event.stopPropagation();return}if(this.containsFocusTarget(event.relatedTarget)){event.stopPropagation();return}this.options.onControlBlur?.(event),this.hide(),relayNativeEvent(this.host,event)}handleComboMouseDown(event){this.host.effectiveDisabled||event.composedPath()[0]!==this.input&&(event.preventDefault(),this.input?.focus())}handleListboxMouseDown(event){event.target.closest('[part="option"]')&&event.preventDefault()}handleListboxClick(event){if(this.host.effectiveDisabled)return;const value=event.target.closest('[part="option"]')?.dataset.value;if(value===void 0)return;const rows=this.visibleEntries,index=this.indexesFor(rows).get(value),entry=index===void 0?void 0:rows[index];entry&&this.selectEntry(entry)}get input(){return this.host.renderRoot?.querySelector('[part="combobox-input"]')??null}click(){if(this.host.effectiveDisabled)return;const trigger=this.host.renderRoot?.querySelector('[part="trigger"]');if(trigger){trigger.click();return}const input=this.input;this.options.forwardFreeInputClick&&input?.click(),input?.focus()}focus(options){if(this.host.effectiveDisabled)return;this.host.renderRoot?.querySelector('[part="trigger"], [part="combobox-input"]')?.focus(options)}blur(){this.host.renderRoot?.querySelector('[part="trigger"], [part="combobox-input"]')?.blur()}select(){this.input?.select()}setSelectionRange(start,end,direction){this.input?.setSelectionRange(start,end,direction)}setRangeText(replacement,start,end,selectMode){const input=this.input;input&&(setNativeRangeText(input,replacement,start,end,selectMode),this.setQuery(input.value),this.setActiveIndex(-1),this.value=input.value)}connected(hasUpdated){hasUpdated&&this._open&&queueMicrotask(()=>this.syncPopup())}disconnected(){this.typeBuffer.clear(),this.popupPosition.disconnect(),this.deactivateOverlay(!1),this.cancelListboxHideWatch(),this.setListboxHidden(!0),this.setOpen(!1)}adopted(){this.typeBuffer.clear(),this.popupPosition.disconnect(),this.popupController.unbindPointer(),this.overlay?.suspend(),this._open&&queueMicrotask(()=>this.syncPopup())}updated(reposition){const previous=this.host.renderRoot.querySelector('[part="option"][data-active]'),listbox=this.host.renderRoot.querySelector('[part="listbox"]'),activeId=this._open&&this._activeIndex>=0?`${listbox?.id}-opt-${this._activeIndex}`:"";previous?.id!==activeId&&previous?.removeAttribute("data-active"),activeId&&this.host.renderRoot.querySelector(`[id="${activeId}"]`)?.setAttribute("data-active",""),reposition&&this.syncPopup(),this.revealPending&&this._open&&this.revealActiveRow(),this.revealPending=!1}containsFocusTarget(target){if(this.options.containsFocusTarget)return this.options.containsFocusTarget(target);if(!target||typeof target.nodeType!="number")return!1;const node=target;return this.host.renderRoot.contains(node)||this.host.contains(node)}activatePopupOverlay(){if(this.overlay?.isActive()){this.overlay.resume();return}this.overlay=activateNonmodalOverlay({host:this.host,panel:()=>this.host.renderRoot.querySelector('[part="listbox"]')??null,onEscape:()=>this.dismissFromEscape(),onBackdrop:()=>this.hide()})}deactivateOverlay(restoreFocus){const overlay=this.overlay;this.overlay=void 0,overlay?.deactivate({restoreFocus}),this.popupController.unbindPointer()}dismissFromEscape(){this._open&&(this.closedMode||this.setQuery(this.labelFor(this._value)),this.deactivateOverlay(!0),this.setOpen(!1))}syncPopup(){if(this.popupPosition.disconnect(),!this._open||!this.host.isConnected){this.deactivateOverlay(!1);return}this.activatePopupOverlay(),this.popupController.bindPointer();const anchor=this.host.renderRoot.querySelector(this.closedMode?'[part="trigger"]':'[part="combobox"]'),listbox=this.host.renderRoot.querySelector('[part="listbox"]');anchor&&listbox&&this.popupPosition.reposition(anchor,listbox)}}export{CatalogPickerController,filterCatalogEntries,normalizeCatalog,withSyntheticCatalogValue};
1
+ import{setNativeRangeText}from"./native-text-control.js";import{waitForTransitionSettle}from"./css-motion-time.js";import{getOwnDataDescriptor}from"./data-descriptors.js";import{CATALOG_ROW_LIMIT}from"./selection-catalog.js";import{AnchoredPopoverController}from"./anchored-popover-controller.js";import{deferredPlace}from"./anchored-overlay-runtime.js";import{resolveIntlLocale}from"./intl-cache.js";import{prefersReducedMotion}from"./motion.js";import{dispatchNativeEvent,relayNativeEvent}from"./native-event-relay.js";import{activateNonmodalOverlay}from"./nonmodal-overlay-manager.js";import{resolveEffectivePositioningStrategy}from"./positioning-strategy.js";import{TypeAheadBuffer}from"./type-ahead-buffer.js";import{resolveListMove}from"./list-navigation.js";import{PopupController}from"./popup-controller.js";const normalizedCatalogs=new WeakMap;function ownDataValue(target,key){const descriptor=getOwnDataDescriptor(target,key);return typeof descriptor=="symbol"?void 0:descriptor.value}function ownDataCopy(entry,id,label){const copy={id,label};let keys=[];try{keys=Object.keys(entry)}catch{}for(const key of keys){if(key==="id"||key==="label")continue;const descriptor=getOwnDataDescriptor(entry,key);typeof descriptor!="symbol"&&Object.defineProperty(copy,key,{value:descriptor.value,enumerable:!0,configurable:!0,writable:!0})}return Object.freeze(copy)}function normalizeCatalog(catalog){let frozen;try{if(!Array.isArray(catalog))return[];frozen=Object.isFrozen(catalog)}catch{return[]}const known=frozen?normalizedCatalogs.get(catalog):void 0;if(known)return known;const normalized=[],seen=new Set,length=ownDataValue(catalog,"length"),count=typeof length=="number"?Math.min(length,CATALOG_ROW_LIMIT):0;for(let index=0;index<count;index+=1){const entry=ownDataValue(catalog,String(index));let id,label;if(typeof entry=="string")id=label=entry;else if(entry!==null&&typeof entry=="object")id=ownDataValue(entry,"id"),label=ownDataValue(entry,"label");else continue;typeof id!="string"||id.trim()===""||typeof label!="string"||label.trim()===""||seen.has(id)||(seen.add(id),normalized.push(typeof entry=="string"?{id,label}:ownDataCopy(entry,id,label)))}return frozen&&normalizedCatalogs.set(catalog,Object.freeze(normalized)),normalized}function withSyntheticCatalogValue(catalog,value){const entries=catalog.map(entry=>({...entry,synthetic:!1}));return catalog.length&&value.trim()!==""&&!catalog.some(entry=>entry.id===value)&&entries.push({id:value,label:value,synthetic:!0}),entries}function filterCatalogEntries(entries,query,locale,fields){const intlLocale=resolveIntlLocale(locale),normalized=query.trim().toLocaleLowerCase(intlLocale);return normalized?entries.filter(entry=>fields(entry).some(value=>value.toLocaleLowerCase(intlLocale).includes(normalized))):[...entries]}class CatalogPickerController{constructor(host,options){this.host=host,this.options=options,this._activeIndex=-1,this.revealPending=!1,this._query="",this._open=!1,this._value="",this._defaultValue="",this.valueDirty=!1,this.settingDefaultValue=!1,this.reflectingDefaultValue=!1,this._listboxHidden=!0,this.suppressControlEvents=!1,this.rowIndexes=new WeakMap,this.typeBuffer=new TypeAheadBuffer(host),this.popupController=new PopupController({host,onPointer:event=>{event.composedPath().includes(host)||this.overlay?.dismissBackdrop()}}),this.popupPosition=new AnchoredPopoverController((anchor,popup)=>deferredPlace(anchor,popup,{strategy:resolveEffectivePositioningStrategy(this.host,void 0,"fixed")}))}get normalizedCatalog(){const source=this.options.catalog(),memo=this.normalizedMemo;if(memo&&memo.source===source)return memo.rows;const rows=normalizeCatalog(source);return this.normalizedMemo={source,rows},rows}get closedMode(){return this.normalizedCatalog.length>0&&!this.options.allowCustom()}get isReadonly(){return this.options.isReadonly()}get effectiveEntries(){const rows=this.normalizedCatalog,memo=this.effectiveMemo;if(memo&&memo.rows===rows&&memo.value===this._value)return memo.entries;const entries=withSyntheticCatalogValue(rows,this._value);return this.effectiveMemo={rows,value:this._value,entries},entries}get filteredEntries(){const entries=this.effectiveEntries,query=this._query,locale=this.options.locale(),memo=this.filteredMemo;if(memo&&memo.entries===entries&&memo.query===query&&memo.locale===locale)return memo.result;const intlLocale=resolveIntlLocale(locale),needle=query.trim().toLocaleLowerCase(intlLocale);let result;if(!needle)result=[...entries];else{let keys=this.searchKeysMemo;(!keys||keys.entries!==entries||keys.locale!==intlLocale)&&(keys={entries,locale:intlLocale,keys:entries.map(entry=>this.options.searchableFields(entry).map(value=>value.toLocaleLowerCase(intlLocale)))},this.searchKeysMemo=keys);const rowKeys=keys.keys;result=entries.filter((_,index)=>rowKeys[index].some(value=>value.includes(needle)))}return this.filteredMemo={entries,query,locale,result},result}get visibleEntries(){return this.closedMode?this.effectiveEntries:this.filteredEntries}indexesFor(rows){let indexes=this.rowIndexes.get(rows);return indexes||(indexes=new Map,rows.forEach((entry,index)=>{indexes.has(entry.id)||indexes.set(entry.id,index)}),this.rowIndexes.set(rows,indexes)),indexes}entryFor(id){const rows=this.effectiveEntries,index=this.indexesFor(rows).get(id);return index===void 0?void 0:rows[index]}labelFor(id){return id?this.entryFor(id)?.label??id:""}get activeIndex(){return this._activeIndex}setActiveIndex(next){if(next===this._activeIndex)return;const old=this._activeIndex;this.options.beforeActiveIndexChange?.(next,old),this._activeIndex=next,this.revealPending=!0,this.options.onStateChange("activeIndex",old)}revealActiveRow(){const listbox=this.host.renderRoot.querySelector('[part="listbox"]'),row=listbox?.querySelector('[part="option"][data-active]');if(!listbox||row?.offsetParent!==listbox)return;const top=row.offsetTop,bottom=top+row.offsetHeight;top<listbox.scrollTop?listbox.scrollTop=top:bottom>listbox.scrollTop+listbox.clientHeight&&(listbox.scrollTop=bottom-listbox.clientHeight)}get query(){return this._query}setQuery(next){if(next===this._query)return;const old=this._query;this._query=next,this.options.afterQueryChange?.(next,old),this.options.onStateChange("query",old)}get open(){return this._open}get listboxHidden(){return this._listboxHidden}setListboxHidden(next){if(next===this._listboxHidden)return;const old=this._listboxHidden;this._listboxHidden=next,this.options.onStateChange("listboxHidden",old)}cancelListboxHideWatch(){this.listboxHideWatcher?.(),this.listboxHideWatcher=void 0}scheduleListboxHide(){this.cancelListboxHideWatch();const listbox=this.host.renderRoot.querySelector('[part="listbox"]'),watch=waitForTransitionSettle(listbox,this.host,{reducedMotion:prefersReducedMotion(this.host)});if(!watch.pending){this.setListboxHidden(!0);return}const cancel=()=>watch.cancel();this.listboxHideWatcher=cancel,watch.finished.then(()=>{this.listboxHideWatcher===cancel&&(this.listboxHideWatcher=void 0,this.setListboxHidden(!0))})}setOpen(next){const liveDisabled=this.host.effectiveDisabled||typeof this.host.matches=="function"&&this.host.matches(":disabled"),resolved=!!next&&!liveDisabled;if(resolved===this._open){resolved||this.deactivateOverlay(!1),next&&!resolved&&this.host.hasAttribute("open")&&this.host.removeAttribute("open");return}const old=this._open;resolved||(this.setActiveIndex(-1),this.deactivateOverlay(!1)),this._open=resolved,resolved?(this.cancelListboxHideWatch(),this.setListboxHidden(!1),this.closedMode&&this.setActiveIndex(this.entryFor(this._value)?.disabled===!0?-1:this.indexesFor(this.effectiveEntries).get(this._value)??-1)):this.host.updateComplete.then(()=>{this._open||!this.host.isConnected||this.scheduleListboxHide()}),this.options.onStateChange("open",old)}show(){!this._open&&!this.host.effectiveDisabled&&this.setOpen(!0)}hide(){this._open&&this.setOpen(!1)}get value(){return this._value}set value(next){const normalized=next??"";if(this.options.beforeValueChange?.(normalized,this._value),normalized===this._value){this.settingDefaultValue||(this.valueDirty=!0);return}const old=this._value;this.settingDefaultValue||(this.valueDirty=!0),this._value=normalized,this.options.onValueChange(normalized,old)}get defaultValue(){return this._defaultValue}set defaultValue(next){if(this.reflectingDefaultValue)return;const normalized=next??"",old=this._defaultValue;this._defaultValue=normalized,this.reflectDefaultValue(),this.valueDirty||this.restoreLiveValueFromDefault(),this.options.onDefaultValueChange(normalized,old)}resetValue(){this.restoreLiveValueFromDefault()}restoreState(state){this.value=typeof state=="string"?state:""}restoreLiveValueFromDefault(){this.settingDefaultValue=!0;try{this.value=this._defaultValue}finally{this.settingDefaultValue=!1}this.valueDirty=!1}reflectDefaultValue(){this.reflectingDefaultValue=!0;try{this._defaultValue?this.host.setAttribute("value",this._defaultValue):this.host.removeAttribute("value")}finally{this.reflectingDefaultValue=!1}}commitValue(next){if(this.isReadonly)return;const inCatalog=this.indexesFor(this.normalizedCatalog).has(next);this.value=next,this.hide(),this.options.emitChange({value:next,inCatalog}),this.emitValueEvents({value:next,inCatalog})}emitValueEvents(detail={value:this._value,inCatalog:this.indexesFor(this.normalizedCatalog).has(this._value)}){dispatchNativeEvent(this.host,"input"),this.options.emitInput(detail),dispatchNativeEvent(this.host,"change")}commitFreeText(){const active=this.filteredEntries[this._activeIndex],useActive=this._activeIndex>=0&&!!active&&active?.disabled!==!0;this.commitValue(useActive?active.id:this._query.trim())}selectEntry(entry){entry.disabled!==!0&&this.commitValue(entry.id)}reconcileRows(activeValue,rebaseQuery,clampMissing=!0){const rows=this.visibleEntries,remapped=activeValue?this.indexesFor(rows).get(activeValue)??-1:-1;this.setActiveIndex(remapped>=0?remapped:clampMissing?Math.min(this._activeIndex,Math.max(-1,rows.length-1)):-1),rebaseQuery&&this.setQuery(this.labelFor(this._value))}typeAhead(event){const{key}=event;if(!this.typeBuffer.accepts(event)||key===" "&&this.typeBuffer.text==="")return!1;key===" "&&event.preventDefault();const locale=this.options.locale();this.typeBuffer.add(key,locale);const rows=this.effectiveEntries,current=this._open?this._activeIndex:this.indexesFor(rows).get(this._value)??-1,index=this.typeBuffer.match(rows,current,row=>row.label,locale,row=>row.disabled!==!0);if(index!==null){const row=rows[index];this._open?this.setActiveIndex(index):this.selectEntry(row)}return!0}moveIndex(rows,event){return resolveListMove(event,{count:rows.length,current:this._activeIndex,orientation:"vertical",wrap:!1,clamp:!0,backwardFromMissing:"first",isAvailable:index=>rows[index]?.disabled!==!0})??-1}handleTriggerKeyDown(event){if(event.isComposing||event.keyCode===229||event.altKey||event.ctrlKey||event.metaKey||this.typeAhead(event))return;const rows=this.effectiveEntries;switch(event.key){case"ArrowDown":if(event.preventDefault(),!this._open)return this.show();this.setActiveIndex(this.moveIndex(rows,event));break;case"ArrowUp":if(event.preventDefault(),!this._open)return this.show();this.setActiveIndex(this.moveIndex(rows,event));break;case"Enter":case" ":if(this._open){event.preventDefault();const active=rows[this._activeIndex];this._activeIndex>=0&&active?this.selectEntry(active):this.hide()}break;case"Home":this._open&&(event.preventDefault(),this.setActiveIndex(this.moveIndex(rows,event)));break;case"End":this._open&&(event.preventDefault(),this.setActiveIndex(this.moveIndex(rows,event)));break}}handleInputKeyDown(event){if(event.isComposing||event.keyCode===229)return;const rows=this.filteredEntries;switch(event.key){case"ArrowDown":if(event.preventDefault(),!this._open)return this.show();this.setActiveIndex(this.moveIndex(rows,event));break;case"ArrowUp":if(event.preventDefault(),!this._open)return this.show();this.setActiveIndex(this.moveIndex(rows,event));break;case"Enter":this._open&&(event.preventDefault(),this.commitFreeText());break;case"Home":this._open&&(event.preventDefault(),this.setActiveIndex(this.moveIndex(rows,event)));break;case"End":this._open&&(event.preventDefault(),this.setActiveIndex(this.moveIndex(rows,event)));break}}handleInput(event){const input=event.currentTarget;if(!input)return;if(this.isReadonly){input.value=this._open?this._query:this.labelFor(this._value),event.stopPropagation();return}this.setQuery(input.value),this.setActiveIndex(-1),this.show();const detail={value:this._value,inCatalog:this.indexesFor(this.normalizedCatalog).has(this._value)};relayNativeEvent(this.host,event),this.options.emitInput(detail)}handleInputFocus(event){if(this.suppressControlEvents){event.stopPropagation();return}this._open||this.setQuery(this.labelFor(this._value)),this.show(),this.handleControlFocus(event)}handleControlFocus(event){if(this.suppressControlEvents){event.stopPropagation();return}if(this.containsFocusTarget(event.relatedTarget)){event.stopPropagation();return}this.options.onControlFocus?.(event),relayNativeEvent(this.host,event)}handleControlBlur(event){if(this.suppressControlEvents){event.stopPropagation();return}if(this.containsFocusTarget(event.relatedTarget)){event.stopPropagation();return}this.options.onControlBlur?.(event),this.hide(),relayNativeEvent(this.host,event)}handleComboMouseDown(event){this.host.effectiveDisabled||event.composedPath()[0]!==this.input&&(event.preventDefault(),this.input?.focus())}handleListboxMouseDown(event){event.target.closest('[part="option"]')&&event.preventDefault()}handleListboxClick(event){if(this.host.effectiveDisabled)return;const value=event.target.closest('[part="option"]')?.dataset.value;if(value===void 0)return;const rows=this.visibleEntries,index=this.indexesFor(rows).get(value),entry=index===void 0?void 0:rows[index];entry&&this.selectEntry(entry)}get input(){return this.host.renderRoot?.querySelector('[part="combobox-input"]')??null}click(){if(this.host.effectiveDisabled)return;const trigger=this.host.renderRoot?.querySelector('[part="trigger"]');if(trigger){trigger.click();return}const input=this.input;this.options.forwardFreeInputClick&&input?.click(),input?.focus()}focus(options){if(this.host.effectiveDisabled)return;this.host.renderRoot?.querySelector('[part="trigger"], [part="combobox-input"]')?.focus(options)}blur(){this.host.renderRoot?.querySelector('[part="trigger"], [part="combobox-input"]')?.blur()}select(){this.input?.select()}setSelectionRange(start,end,direction){this.input?.setSelectionRange(start,end,direction)}setRangeText(replacement,start,end,selectMode){const input=this.input;input&&(setNativeRangeText(input,replacement,start,end,selectMode),this.setQuery(input.value),this.setActiveIndex(-1),this.value=input.value)}connected(hasUpdated){hasUpdated&&this._open&&queueMicrotask(()=>this.syncPopup())}disconnected(){this.typeBuffer.clear(),this.popupPosition.disconnect(),this.deactivateOverlay(!1),this.cancelListboxHideWatch(),this.setListboxHidden(!0),this.setOpen(!1)}adopted(){this.typeBuffer.clear(),this.popupPosition.disconnect(),this.popupController.unbindPointer(),this.overlay?.suspend(),this._open&&queueMicrotask(()=>this.syncPopup())}updated(reposition){const previous=this.host.renderRoot.querySelector('[part="option"][data-active]'),listbox=this.host.renderRoot.querySelector('[part="listbox"]'),activeId=this._open&&this._activeIndex>=0?`${listbox?.id}-opt-${this._activeIndex}`:"";previous?.id!==activeId&&previous?.removeAttribute("data-active"),activeId&&this.host.renderRoot.querySelector(`[id="${activeId}"]`)?.setAttribute("data-active",""),reposition&&this.syncPopup(),this.revealPending&&this._open&&this.revealActiveRow(),this.revealPending=!1}containsFocusTarget(target){if(this.options.containsFocusTarget)return this.options.containsFocusTarget(target);if(!target||typeof target.nodeType!="number")return!1;const node=target;return this.host.renderRoot.contains(node)||this.host.contains(node)}activatePopupOverlay(){if(this.overlay?.isActive()){this.overlay.resume();return}this.overlay=activateNonmodalOverlay({host:this.host,panel:()=>this.host.renderRoot.querySelector('[part="listbox"]')??null,onEscape:()=>this.dismissFromEscape(),onBackdrop:()=>this.hide()})}deactivateOverlay(restoreFocus){const overlay=this.overlay;this.overlay=void 0,overlay?.deactivate({restoreFocus}),this.popupController.unbindPointer()}dismissFromEscape(){this._open&&(this.closedMode||this.setQuery(this.labelFor(this._value)),this.deactivateOverlay(!0),this.setOpen(!1))}syncPopup(){if(this.popupPosition.disconnect(),!this._open||!this.host.isConnected){this.deactivateOverlay(!1);return}this.activatePopupOverlay(),this.popupController.bindPointer();const anchor=this.host.renderRoot.querySelector(this.closedMode?'[part="trigger"]':'[part="combobox"]'),listbox=this.host.renderRoot.querySelector('[part="listbox"]');anchor&&listbox&&this.popupPosition.reposition(anchor,listbox)}}export{CatalogPickerController,filterCatalogEntries,normalizeCatalog,withSyntheticCatalogValue};
@@ -1,3 +1,3 @@
1
- import{DOCUMENT_TOKEN_CSS,DOCUMENT_TOKEN_LAYER_ID,DOCUMENT_TOKEN_SCOPE_SELECTOR,DOCUMENT_TOKEN_SENTINEL}from"./document-tokens.generated.js";import{isRegisteredLyraElement}from"./prefix.js";const documentStates=new WeakMap,rootStates=new WeakMap,verifiedSinceCheckpoint=new WeakSet,carrierCache=new WeakMap,libraryRoots=new WeakMap,LAYER_NAME="lr-theme",MAX_SLOT_HOPS=8,mediaLists=new WeakMap;function onceSinceCheckpoint(scope){return verifiedSinceCheckpoint.has(scope)?!1:(verifiedSinceCheckpoint.add(scope),queueMicrotask(()=>verifiedSinceCheckpoint.delete(scope)),!0)}function styleDeclaresSentinel(rule){const style=rule?.style;return!!style&&style.getPropertyValue(DOCUMENT_TOKEN_SENTINEL).trim()===DOCUMENT_TOKEN_LAYER_ID}function declaresSentinel(rule,anywhere=!1){const nested=rule.cssRules;if(!nested)return styleDeclaresSentinel(rule);const count=anywhere?nested.length:Math.min(1,nested.length);for(let index=0;index<count;index++)if(styleDeclaresSentinel(nested[index]))return!0;return!1}function containsLayerBlock(rules,depth){for(let index=0;index<rules.length;index++){const rule=rules[index];if(!(rule.type!==0||typeof rule.name!="string"||!rule.cssRules)&&(rule.name===LAYER_NAME?declaresSentinel(rule,!0):depth<2&&containsLayerBlock(rule.cssRules,depth+1)))return!0}return!1}function carriesLayer(sheet,thorough,depth=0){const known=carrierCache.get(sheet);if(known===!0||known===!1||known==="tail"&&!thorough)return known===!0;let rules;try{rules=sheet.cssRules}catch{return!1}let found=!1;if(known!=="tail")for(let index=rules.length-1;!found&&index>=Math.max(0,rules.length-3);index--)found=declaresSentinel(rules[index]);for(let index=0;!found&&depth<3&&index<rules.length;index++){const rule=rules[index];if(rule.type!==3)break;rule.styleSheet&&(found=carriesLayer(rule.styleSheet,thorough,depth+1))}return!found&&thorough&&(found=containsLayerBlock(rules,0)),carrierCache.set(sheet,found?!0:thorough?!1:"tail"),found}function topSheet(sheet){let current=sheet;for(;current.parentStyleSheet;)current=current.parentStyleSheet;return current}function mediaMatches(view,media){let lists=mediaLists.get(view);lists||mediaLists.set(view,lists=new Map);let list=lists.get(media);return list||lists.set(media,list=view.matchMedia(media)),list.matches}function staticSheetApplies(sheet){if(sheet.disabled)return!1;const owner=sheet.ownerNode;if(!owner||!owner.isConnected||"sheet"in owner&&owner.sheet!==sheet)return!1;const media=sheet.media?.mediaText.trim()??"";if(media===""||media==="all")return!0;const view=owner.ownerDocument?.defaultView;return view&&typeof view.matchMedia=="function"?mediaMatches(view,media):/\bscreen\b/.test(media)}function providerApplies(scope,provider){const top=topSheet(provider);return top.ownerNode?staticSheetApplies(top):scope.adoptedStyleSheets.includes(top)}function findProvider(scope,own,thorough){const linked=scope.styleSheets;for(let index=linked.length-1;index>=0;index--){const sheet=linked[index];if(staticSheetApplies(sheet)&&carriesLayer(sheet,thorough))return sheet}const adopted=scope.adoptedStyleSheets;for(let index=adopted.length-1;index>=0;index--){const sheet=adopted[index];if(sheet!==own&&carriesLayer(sheet,thorough))return sheet}}function resolvedSentinel(doc){try{return doc.documentElement?doc.defaultView.getComputedStyle(doc.documentElement).getPropertyValue(DOCUMENT_TOKEN_SENTINEL).trim():""}catch{return""}}function layerState(doc){const known=documentStates.get(doc);if(known)return known;const view=doc.defaultView;if(!view||typeof view.CSSStyleSheet!="function"||!("adoptedStyleSheets"in doc))return;const state={unreadableProvider:!1,arrivedLate:!1};if(state.provider=findProvider(doc,void 0,!1),!state.provider){const found=resolvedSentinel(doc);found===DOCUMENT_TOKEN_LAYER_ID?(state.provider=findProvider(doc,void 0,!0),state.unreadableProvider=!state.provider):found&&(state.foreignLayer=found)}return documentStates.set(doc,state),doc.readyState!=="complete"&&view.addEventListener("load",()=>verifyDocument(doc,state,"load"),{once:!0}),state}function layerSheet(doc,state){if(!state.sheet){const sheet=new doc.defaultView.CSSStyleSheet;sheet.replaceSync(DOCUMENT_TOKEN_CSS),carrierCache.set(sheet,!0),state.sheet=sheet}return state.sheet}function shadowRootLayerCss(css){let text=css.replace(/@layer [^{;]*;/g,""),unwrapped="";const layerOpen=/@layer [^{;]*\{/y;for(let index=0;index<text.length;){layerOpen.lastIndex=index;const open=layerOpen.exec(text);if(!open){unwrapped+=text[index++];continue}let depth=1;const start=index+=open[0].length;for(;index<text.length&&depth;){const char=text[index++];char==="{"?depth++:char==="}"&&depth--}unwrapped+=text.slice(start,index-1)}const sentinel=`${DOCUMENT_TOKEN_SENTINEL}:${DOCUMENT_TOKEN_LAYER_ID}`;return text=unwrapped.replace(`:root{${sentinel}}`,"").replaceAll(":where(:root),","").replaceAll(":root,",""),text=text.replace(/(^|[{}\n])([^@{}\n][^{}]*)\{/g,(_,lead,selector)=>`${lead}:where(${selector.trim()}){`),`${text}
1
+ import{DOCUMENT_TOKEN_CSS,DOCUMENT_TOKEN_LAYER_ID,DOCUMENT_TOKEN_SCOPE_SELECTOR,DOCUMENT_TOKEN_SENTINEL}from"./document-tokens.generated.js";import{isRegisteredLyraElement}from"./prefix.js";const documentStates=new WeakMap,rootStates=new WeakMap,verifiedSinceCheckpoint=new WeakSet,carrierCache=new WeakMap,libraryRoots=new WeakMap,LAYER_NAME="lr-theme",MAX_SLOT_HOPS=8,mediaLists=new WeakMap;function onceSinceCheckpoint(scope){return verifiedSinceCheckpoint.has(scope)?!1:(verifiedSinceCheckpoint.add(scope),queueMicrotask(()=>verifiedSinceCheckpoint.delete(scope)),!0)}function styleDeclaresSentinel(rule){const style=rule?.style;return!!style&&style.getPropertyValue(DOCUMENT_TOKEN_SENTINEL).trim()===DOCUMENT_TOKEN_LAYER_ID}function declaresSentinel(rule,anywhere=!1){const nested=rule.cssRules;if(!nested)return styleDeclaresSentinel(rule);const count=anywhere?nested.length:Math.min(1,nested.length);for(let index=0;index<count;index++)if(styleDeclaresSentinel(nested[index]))return!0;return!1}function containsLayerBlock(rules,depth){for(let index=0;index<rules.length;index++){const rule=rules[index];if(!(rule.type!==0||typeof rule.name!="string"||!rule.cssRules)&&(rule.name===LAYER_NAME?declaresSentinel(rule,!0):depth<2&&containsLayerBlock(rule.cssRules,depth+1)))return!0}return!1}function layerProvider(sheet,view,thorough,depth=0,refresh=!1){if(refresh&&carrierCache.delete(sheet),sheet.disabled)return;const known=carrierCache.get(sheet);if(known===!0||known===!1||known==="tail"&&!thorough)return known===!0?sheet:void 0;let rules;try{rules=sheet.cssRules}catch{return}let found=!1;if(known!=="tail")for(let index=rules.length-1;!found&&index>=Math.max(0,rules.length-3);index--)found=declaresSentinel(rules[index]);let hasImports=!1;for(let index=0;!found&&depth<3&&index<rules.length;index++){const rule=rules[index];if(!(rule.type===0&&"nameList"in rule)){if(rule.type!==3)break;if(hasImports=!0,rule.styleSheet&&importApplies(rule,view)){const imported=layerProvider(rule.styleSheet,view,thorough,depth+1,refresh);if(imported)return imported}}}return!found&&thorough&&(found=containsLayerBlock(rules,0)),(found||!hasImports)&&carrierCache.set(sheet,found?!0:thorough?!1:"tail"),found?sheet:void 0}function topSheet(sheet){let current=sheet;for(;current.parentStyleSheet;)current=current.parentStyleSheet;return current}function mediaMatches(view,media){let lists=mediaLists.get(view);lists||mediaLists.set(view,lists=new Map);let list=lists.get(media);return list||lists.set(media,list=view.matchMedia(media)),list.matches}function importApplies(rule,view){const media=rule.media.mediaText.trim();return(media===""||media==="all"||mediaMatches(view,media))&&(!rule.supportsText||CSS.supports(`(${rule.supportsText})`))}function staticSheetApplies(sheet){if(sheet.disabled)return!1;const owner=sheet.ownerNode;if(!owner||!owner.isConnected||"sheet"in owner&&owner.sheet!==sheet)return!1;const media=sheet.media?.mediaText.trim()??"";if(media===""||media==="all")return!0;const view=owner.ownerDocument?.defaultView;return view&&typeof view.matchMedia=="function"?mediaMatches(view,media):/\bscreen\b/.test(media)}function providerApplies(scope,provider){const view=documentOf(scope).defaultView;let current=provider;for(;current.parentStyleSheet;){if(current.disabled||!importApplies(current.ownerRule,view))return!1;current=current.parentStyleSheet}const top=current;return top.ownerNode?staticSheetApplies(top):!top.disabled&&scope.adoptedStyleSheets.includes(top)}function findProvider(scope,own,thorough,refresh=!1){const view=documentOf(scope).defaultView,linked=scope.styleSheets;for(let index=linked.length-1;index>=0;index--){const sheet=linked[index];if(staticSheetApplies(sheet)){const provider=layerProvider(sheet,view,thorough,0,refresh);if(provider)return provider}}const adopted=scope.adoptedStyleSheets;for(let index=adopted.length-1;index>=0;index--){const sheet=adopted[index];if(sheet!==own){const provider=layerProvider(sheet,view,thorough,0,refresh);if(provider)return provider}}}function resolvedSentinel(doc){try{return doc.documentElement?doc.defaultView.getComputedStyle(doc.documentElement).getPropertyValue(DOCUMENT_TOKEN_SENTINEL).trim():""}catch{return""}}function layerState(doc){const known=documentStates.get(doc);if(known)return known;const view=doc.defaultView;if(!view||typeof view.CSSStyleSheet!="function"||!("adoptedStyleSheets"in doc))return;const state={unreadableProvider:!1,arrivedLate:!1};if(state.provider=findProvider(doc,void 0,!1),!state.provider){const found=resolvedSentinel(doc);found===DOCUMENT_TOKEN_LAYER_ID?(state.provider=findProvider(doc,void 0,!0),state.unreadableProvider=!state.provider):found&&(state.foreignLayer=found)}return documentStates.set(doc,state),doc.readyState!=="complete"&&view.addEventListener("load",()=>verifyDocument(doc,state,"load"),{once:!0}),state}function layerSheet(doc,state){if(!state.sheet){const sheet=new doc.defaultView.CSSStyleSheet;sheet.replaceSync(DOCUMENT_TOKEN_CSS),carrierCache.set(sheet,!0),state.sheet=sheet}return state.sheet}function shadowRootLayerCss(css){let text=css.replace(/@layer [^{;]*;/g,""),unwrapped="";const layerOpen=/@layer [^{;]*\{/y;for(let index=0;index<text.length;){layerOpen.lastIndex=index;const open=layerOpen.exec(text);if(!open){unwrapped+=text[index++];continue}let depth=1;const start=index+=open[0].length;for(;index<text.length&&depth;){const char=text[index++];char==="{"?depth++:char==="}"&&depth--}unwrapped+=text.slice(start,index-1)}const sentinel=`${DOCUMENT_TOKEN_SENTINEL}:${DOCUMENT_TOKEN_LAYER_ID}`;return text=unwrapped.replace(`:root{${sentinel}}`,"").replaceAll(":where(:root),","").replaceAll(":root,",""),text=text.replace(/(^|[{}\n])([^@{}\n][^{}]*)\{/g,(_,lead,selector)=>`${lead}:where(${selector.trim()}){`),`${text}
2
2
  :where(:root){${sentinel}}
3
- `}function rootLayerSheet(doc,state){if(!state.rootSheet){const sheet=new doc.defaultView.CSSStyleSheet;sheet.replaceSync(shadowRootLayerCss(DOCUMENT_TOKEN_CSS)),carrierCache.set(sheet,!0),state.rootSheet=sheet}return state.rootSheet}function adopt(root,...add){if(!add.length)return;const sheets=root.adoptedStyleSheets,missing=add.filter(sheet=>!sheets.includes(sheet));missing.length&&(root.adoptedStyleSheets=[...sheets,...missing])}function withdraw(root,sheet){if(!sheet)return!1;const sheets=root.adoptedStyleSheets;return sheets.includes(sheet)?(root.adoptedStyleSheets=sheets.filter(entry=>entry!==sheet),!0):!1}function rootKeySheet(doc,state){if(state.rootKey===void 0){const view=doc.defaultView,brands=view.navigator.userAgentData?.brands;if(state.rootKey=null,brands?.some(entry=>entry.brand==="Chromium")){const names=new Set(Array.from(DOCUMENT_TOKEN_CSS.matchAll(/var\((--(?:lr-theme-|_lr-)[\w-]+)/g),match=>match[1])),sheet=new view.CSSStyleSheet;sheet.replaceSync(`:root{--_lr-root-inputs:${Array.from(names,name=>`var(${name},0)`).join("")}}`),state.rootKey=sheet,(state.provider||state.unreadableProvider)&&awaitRootChange(doc,state,sheet)}}return state.rootKey}function awaitRootChange(doc,state,key){const view=doc.defaultView,root=doc.documentElement;if(!root||typeof view.MutationObserver!="function"){state.rootKeyLive=!0;return}const observer=new view.MutationObserver(()=>{observer.disconnect(),!state.rootKeyLive&&(state.rootKeyLive=!0,adopt(doc,key))});observer.observe(root,{attributes:!0})}function verifyDocument(doc,state,check){const key=rootKeySheet(doc,state),keyNow=key&&state.rootKeyLive&&check!=="connect"?[key]:[];if(state.provider&&!providerApplies(doc,state.provider)&&(state.provider=void 0),!state.provider&&check!=="connect"&&(state.provider=findProvider(doc,state.sheet,!0)),state.provider){state.unreadableProvider=!1,withdraw(doc,state.sheet)&&topSheet(state.provider).ownerNode&&(state.arrivedLate=!0),adopt(doc,...keyNow);return}if(state.unreadableProvider){if(check!=="explicit"||resolvedSentinel(doc)===DOCUMENT_TOKEN_LAYER_ID){adopt(doc,...keyNow);return}state.unreadableProvider=!1}key&&(state.rootKeyLive=!0),adopt(doc,layerSheet(doc,state),...key?[key]:[])}function verifyRoot(root,doc,state){let local=rootStates.get(root);local||rootStates.set(root,local={}),local.provider&&!providerApplies(root,local.provider)&&(local.provider=void 0),local.provider||(local.provider=findProvider(root,state.rootSheet,!0)),local.provider?withdraw(root,state.rootSheet):adopt(root,rootLayerSheet(doc,state))}function isShadowRoot(node){return node.nodeType===11&&"host"in node&&node.host!==null}function isLibraryRoot(root){let known=libraryRoots.get(root);return known===void 0&&(known=isRegisteredLyraElement(root.host),libraryRoots.set(root,known)),known}function ensureLyraTokens(element){shareAdopter();const doc=element.ownerDocument,state=layerState(doc);state&&(onceSinceCheckpoint(doc)&&verifyDocument(doc,state,"connect"),ensureAlongTrees(element,doc,state,0))}function ensureAlongTrees(start,doc,state,hops){let node=start;for(;;){const root=node.getRootNode(),shadow=isShadowRoot(root);if(shadow&&isLibraryRoot(root)||(followAssignedSlot(node,doc,state,hops),!shadow))return;!verifiedSinceCheckpoint.has(root)&&node.closest(DOCUMENT_TOKEN_SCOPE_SELECTOR)&&(onceSinceCheckpoint(root),verifyRoot(root,doc,state)),node=root.host}}function followAssignedSlot(node,doc,state,hops){const slotRoot=node.parentElement?.shadowRoot;if(!slotRoot||hops>=MAX_SLOT_HOPS||isLibraryRoot(slotRoot))return;const slot=node.assignedSlot;if(slot){ensureAlongTrees(slot,doc,state,hops+1);return}queueMicrotask(()=>{const late=node.isConnected&&node.ownerDocument===doc?node.assignedSlot:null;late&&ensureAlongTrees(late,doc,state,hops+1)})}let primed=!1;function primeLyraTokens(){if(primed||typeof document>"u")return;primed=!0;const doc=document,state=layerState(doc);state&&onceSinceCheckpoint(doc)&&verifyDocument(doc,state,"connect")}const ADOPTER_KEY=Symbol.for("@aceshooting/lyra-ui.adopt-lyra-tokens.v1");let adopterShared=!1;function shareAdopter(){if(adopterShared)return;adopterShared=!0;const scope=globalThis,existing=scope[ADOPTER_KEY];if(typeof existing=="function"&&existing.layerId===DOCUMENT_TOKEN_LAYER_ID)return;const adopter=Object.assign(root=>adoptLyraTokens(root),{layerId:DOCUMENT_TOKEN_LAYER_ID});try{Object.defineProperty(scope,ADOPTER_KEY,{configurable:!0,enumerable:!1,writable:!1,value:adopter})}catch{}}function documentOf(root){return root.nodeType===9?root:root.ownerDocument}function hasLyraTokens(root){const doc=documentOf(root),state=documentStates.get(doc);if(!state)return!1;const local=root===doc?state:rootStates.get(root);if(local?.provider&&providerApplies(root,local.provider)||root===doc&&state.unreadableProvider)return!0;const own=root===doc?state.sheet:state.rootSheet;return!!own&&root.adoptedStyleSheets.includes(own)}function adoptLyraTokens(root){if(typeof document>"u"||!root)return;const doc=documentOf(root),state=layerState(doc);state&&(root===doc?verifyDocument(doc,state,"explicit"):isShadowRoot(root)&&verifyRoot(root,doc,state))}function foreignLyraTokenLayer(doc){return documentStates.get(doc)?.foreignLayer}function lyraTokenLayerArrivedLate(doc){return documentStates.get(doc)?.arrivedLate??!1}export{adoptLyraTokens,ensureLyraTokens,foreignLyraTokenLayer,hasLyraTokens,lyraTokenLayerArrivedLate,primeLyraTokens};
3
+ `}function rootLayerSheet(doc,state){if(!state.rootSheet){const sheet=new doc.defaultView.CSSStyleSheet;sheet.replaceSync(shadowRootLayerCss(DOCUMENT_TOKEN_CSS)),carrierCache.set(sheet,!0),state.rootSheet=sheet}return state.rootSheet}function adopt(root,...add){if(!add.length)return;const sheets=root.adoptedStyleSheets,missing=add.filter(sheet=>!sheets.includes(sheet));missing.length&&(root.adoptedStyleSheets=[...sheets,...missing])}function withdraw(root,sheet){if(!sheet)return!1;const sheets=root.adoptedStyleSheets;return sheets.includes(sheet)?(root.adoptedStyleSheets=sheets.filter(entry=>entry!==sheet),!0):!1}function rootKeySheet(doc,state){if(state.rootKey===void 0){const view=doc.defaultView,brands=view.navigator.userAgentData?.brands;if(state.rootKey=null,brands?.some(entry=>entry.brand==="Chromium")){const names=new Set(Array.from(DOCUMENT_TOKEN_CSS.matchAll(/var\((--(?:lr-theme-|_lr-)[\w-]+)/g),match=>match[1])),sheet=new view.CSSStyleSheet;sheet.replaceSync(`:root{--_lr-root-inputs:${Array.from(names,name=>`var(${name},0)`).join("")}}`),state.rootKey=sheet,(state.provider||state.unreadableProvider)&&awaitRootChange(doc,state,sheet)}}return state.rootKey}function awaitRootChange(doc,state,key){const view=doc.defaultView,root=doc.documentElement;if(!root||typeof view.MutationObserver!="function"){state.rootKeyLive=!0;return}const observer=new view.MutationObserver(()=>{observer.disconnect(),!state.rootKeyLive&&(state.rootKeyLive=!0,adopt(doc,key))});observer.observe(root,{attributes:!0})}function verifyDocument(doc,state,check){const key=rootKeySheet(doc,state),keyNow=key&&state.rootKeyLive&&check!=="connect"?[key]:[];if(check==="explicit"&&(state.provider=void 0),state.provider&&!providerApplies(doc,state.provider)&&(state.provider=void 0),!state.provider&&check!=="connect"&&(state.provider=findProvider(doc,state.sheet,!0,check==="explicit")),state.provider){state.unreadableProvider=!1,withdraw(doc,state.sheet)&&topSheet(state.provider).ownerNode&&(state.arrivedLate=!0),adopt(doc,...keyNow);return}if(state.unreadableProvider){if(check!=="explicit"||resolvedSentinel(doc)===DOCUMENT_TOKEN_LAYER_ID){adopt(doc,...keyNow);return}state.unreadableProvider=!1}key&&(state.rootKeyLive=!0),adopt(doc,layerSheet(doc,state),...key?[key]:[])}function verifyRoot(root,doc,state,refresh=!1){let local=rootStates.get(root);local||rootStates.set(root,local={}),(refresh||local.provider&&!providerApplies(root,local.provider))&&(local.provider=void 0),local.provider||(local.provider=findProvider(root,state.rootSheet,!0,refresh)),local.provider?withdraw(root,state.rootSheet):adopt(root,rootLayerSheet(doc,state))}function isShadowRoot(node){return node.nodeType===11&&"host"in node&&node.host!==null}function isLibraryRoot(root){let known=libraryRoots.get(root);return known===void 0&&(known=isRegisteredLyraElement(root.host),libraryRoots.set(root,known)),known}function ensureLyraTokens(element){shareAdopter();const doc=element.ownerDocument,state=layerState(doc);state&&(onceSinceCheckpoint(doc)&&verifyDocument(doc,state,"connect"),ensureAlongTrees(element,doc,state,0))}function ensureAlongTrees(start,doc,state,hops){let node=start;for(;;){const root=node.getRootNode(),shadow=isShadowRoot(root);if(shadow&&isLibraryRoot(root)||(followAssignedSlot(node,doc,state,hops),!shadow))return;!verifiedSinceCheckpoint.has(root)&&node.closest(DOCUMENT_TOKEN_SCOPE_SELECTOR)&&(onceSinceCheckpoint(root),verifyRoot(root,doc,state)),node=root.host}}function followAssignedSlot(node,doc,state,hops){const slotRoot=node.parentElement?.shadowRoot;if(!slotRoot||hops>=MAX_SLOT_HOPS||isLibraryRoot(slotRoot))return;const slot=node.assignedSlot;if(slot){ensureAlongTrees(slot,doc,state,hops+1);return}queueMicrotask(()=>{const late=node.isConnected&&node.ownerDocument===doc?node.assignedSlot:null;late&&ensureAlongTrees(late,doc,state,hops+1)})}let primed=!1;function primeLyraTokens(){if(primed||typeof document>"u")return;primed=!0;const doc=document,state=layerState(doc);state&&onceSinceCheckpoint(doc)&&verifyDocument(doc,state,"connect")}const ADOPTER_KEY=Symbol.for("@aceshooting/lyra-ui.adopt-lyra-tokens.v1");let adopterShared=!1;function shareAdopter(){if(adopterShared)return;adopterShared=!0;const scope=globalThis,existing=scope[ADOPTER_KEY];if(typeof existing=="function"&&existing.layerId===DOCUMENT_TOKEN_LAYER_ID)return;const adopter=Object.assign(root=>adoptLyraTokens(root),{layerId:DOCUMENT_TOKEN_LAYER_ID});try{Object.defineProperty(scope,ADOPTER_KEY,{configurable:!0,enumerable:!1,writable:!1,value:adopter})}catch{}}function documentOf(root){return root.nodeType===9?root:root.ownerDocument}function hasLyraTokens(root){const doc=documentOf(root),state=documentStates.get(doc);if(!state)return!1;const local=root===doc?state:rootStates.get(root);if(local?.provider&&providerApplies(root,local.provider)||root===doc&&state.unreadableProvider)return!0;const own=root===doc?state.sheet:state.rootSheet;return!!own&&root.adoptedStyleSheets.includes(own)}function adoptLyraTokens(root){if(typeof document>"u"||!root)return;const doc=documentOf(root),state=layerState(doc);state&&(root===doc?verifyDocument(doc,state,"explicit"):isShadowRoot(root)&&verifyRoot(root,doc,state,!0))}function foreignLyraTokenLayer(doc){return documentStates.get(doc)?.foreignLayer}function lyraTokenLayerArrivedLate(doc){return documentStates.get(doc)?.arrivedLate??!1}export{adoptLyraTokens,ensureLyraTokens,foreignLyraTokenLayer,hasLyraTokens,lyraTokenLayerArrivedLate,primeLyraTokens};
@@ -1 +1 @@
1
- const MAX_DROPPED_FOLDER_ENTRIES=1e4;function isFileValue(value){if(value===null||typeof value!="object")return!1;try{if(typeof File!="function")return!1;const nameGetter=Object.getOwnPropertyDescriptor(File.prototype,"name")?.get;if(!nameGetter)return!1;nameGetter.call(value);const candidate=value;return Object.prototype.toString.call(value)==="[object File]"&&typeof candidate.name=="string"&&typeof candidate.lastModified=="number"&&typeof candidate.size=="number"&&typeof candidate.type=="string"&&typeof candidate.slice=="function"}catch{return!1}}class DropSessionController{constructor(host,callbacks){this.host=host,this.callbacks=callbacks,this.counter=0,this.token=0,this.sessionState="default",this.onDragEnter=e=>{if(e.preventDefault(),this.callbacks.isDisabled())return;this.counter++;const items=e.dataTransfer?[...e.dataTransfer.items].filter(i=>i.kind==="file"):[];this.sessionState=items.length?this.callbacks.previewRejects(items)?"reject":"accept":"default",this.callbacks.onStateChange()},this.onDragOver=e=>{e.preventDefault()},this.onDragLeave=e=>{this.callbacks.isDisabled()||(e.preventDefault(),this.counter=Math.max(0,this.counter-1),this.counter===0&&(this.sessionState="default",this.callbacks.onStateChange()))},host.addController(this)}get state(){return this.sessionState}get dragging(){return this.sessionState!=="default"}hostDisconnected(){this.reset()}reset(){this.token++,this.counter=0,this.sessionState="default",this.callbacks.onStateChange()}beginDrop(e){if(e.preventDefault(),this.callbacks.isDisabled())return;this.reset();const token=this.token,files=readFileList(e.dataTransfer?.files),folders=[],items=e.dataTransfer?.items,itemCount=Math.min(items?.length??0,10001);for(let index=0;index<itemCount;index++){const entry=items?.[index]?.webkitGetAsEntry?.();entry?.isDirectory&&folders.push(entry)}const overLimit=(items?.length??0)>1e4;return{token,files,folders,overLimit}}isCurrent(token){return token===this.token&&this.host.isConnected&&!this.callbacks.isDisabled()}readDroppedFile(entry,isCurrent){return isCurrent()?new Promise(resolve=>{try{entry.file(file=>resolve(isCurrent()?{status:"complete",file}:{status:"cancelled"}),()=>resolve(isCurrent()?{status:"error"}:{status:"cancelled"}))}catch{resolve(isCurrent()?{status:"error"}:{status:"cancelled"})}}):Promise.resolve({status:"cancelled"})}readDroppedDirectoryBatch(reader,isCurrent){return isCurrent()?new Promise(resolve=>{try{reader.readEntries(entries=>resolve(isCurrent()?{status:"complete",entries}:{status:"cancelled"}),()=>resolve(isCurrent()?{status:"error"}:{status:"cancelled"}))}catch{resolve(isCurrent()?{status:"error"}:{status:"cancelled"})}}):Promise.resolve({status:"cancelled"})}async readFolders(folders,token){const isCurrent=()=>this.isCurrent(token),files=[],queue=[];let entryCount=0;const enqueue=entry=>entryCount>=1e4?!1:(entryCount++,queue.push(entry),!0);for(const folder of folders){if(!isCurrent())return{status:"cancelled"};if(!enqueue(folder))return{status:"limit",name:folder.name}}for(let index=0;index<queue.length;index++){if(!isCurrent())return{status:"cancelled"};const entry=queue[index];if(entry.isFile){const result=await this.readDroppedFile(entry,isCurrent);if(result.status==="cancelled"||!isCurrent())return{status:"cancelled"};if(result.status==="error")return{status:"error",name:entry.name};files.push(result.file);continue}if(!entry.isDirectory)continue;let reader;try{reader=entry.createReader()}catch{return{status:"error",name:entry.name}}for(;;){if(!isCurrent())return{status:"cancelled"};const batch=await this.readDroppedDirectoryBatch(reader,isCurrent);if(batch.status==="cancelled"||!isCurrent())return{status:"cancelled"};if(batch.status==="error")return{status:"error",name:entry.name};if(!batch.entries.length)break;for(const child of batch.entries){if(!isCurrent())return{status:"cancelled"};if(!enqueue(child))return{status:"limit",name:entry.name}}}}return{status:"complete",files}}}function readFileList(list){const files=[];if(!list)return files;for(let index=0;index<list.length;index++){const file=list[index];isFileValue(file)&&files.push(file)}return files}export{DropSessionController,isFileValue,readFileList};
1
+ const MAX_DROPPED_FOLDER_ENTRIES=1e4;function isFileValue(value){if(value===null||typeof value!="object")return!1;try{if(typeof File!="function")return!1;const nameGetter=Object.getOwnPropertyDescriptor(File.prototype,"name")?.get;if(!nameGetter)return!1;nameGetter.call(value);const candidate=value;return Object.prototype.toString.call(value)==="[object File]"&&typeof candidate.name=="string"&&typeof candidate.lastModified=="number"&&typeof candidate.size=="number"&&typeof candidate.type=="string"&&typeof candidate.slice=="function"}catch{return!1}}class DropSessionController{constructor(host,callbacks){this.host=host,this.callbacks=callbacks,this.counter=0,this.token=0,this.sessionState="default",this.onDragEnter=e=>{if(e.preventDefault(),this.callbacks.isDisabled())return;this.counter++;const items=e.dataTransfer?[...e.dataTransfer.items].filter(i=>i.kind==="file"):[];this.sessionState=items.length?this.callbacks.previewRejects(items)?"reject":"accept":"default",this.callbacks.onStateChange()},this.onDragOver=e=>{e.preventDefault()},this.onDragLeave=e=>{this.callbacks.isDisabled()||(e.preventDefault(),this.counter=Math.max(0,this.counter-1),this.counter===0&&(this.sessionState="default",this.callbacks.onStateChange()))},host.addController(this)}get state(){return this.sessionState}get dragging(){return this.sessionState!=="default"}hostDisconnected(){this.reset()}reset(){this.token++,this.counter=0,this.sessionState="default",this.callbacks.onStateChange()}beginDrop(e){if(e.preventDefault(),this.callbacks.isDisabled())return;this.reset();const token=this.token,files=readFileList(e.dataTransfer?.files),folders=[],items=e.dataTransfer?.items,itemCount=Math.min(items?.length??0,10001);for(let index=0;index<itemCount;index++){const entry=items?.[index]?.webkitGetAsEntry?.();entry?.isDirectory&&folders.push(entry)}const overLimit=(items?.length??0)>1e4;return{token,files,folders,overLimit}}isCurrent(token){return token===this.token&&this.host.isConnected&&!this.callbacks.isDisabled()}readDroppedFile(entry,isCurrent){return isCurrent()?new Promise(resolve=>{try{entry.file(file=>resolve(isCurrent()?{status:"complete",file}:{status:"cancelled"}),()=>resolve(isCurrent()?{status:"error"}:{status:"cancelled"}))}catch{resolve(isCurrent()?{status:"error"}:{status:"cancelled"})}}):Promise.resolve({status:"cancelled"})}readDroppedDirectoryBatch(reader,isCurrent){return isCurrent()?new Promise(resolve=>{try{reader.readEntries(entries=>resolve(isCurrent()?{status:"complete",entries}:{status:"cancelled"}),()=>resolve(isCurrent()?{status:"error"}:{status:"cancelled"}))}catch{resolve(isCurrent()?{status:"error"}:{status:"cancelled"})}}):Promise.resolve({status:"cancelled"})}async readFolders(folders,token){const isCurrent=()=>this.isCurrent(token),files=[],queue=[];let entryCount=0;const enqueue=entry=>entryCount>=1e4?!1:(entryCount++,queue.push(entry),!0);for(const folder of folders){if(!isCurrent())return{status:"cancelled"};if(!enqueue(folder))return{status:"limit",name:folder.name}}for(let index=0;index<queue.length;index++){if(!isCurrent())return{status:"cancelled"};const entry=queue[index];if(entry.isFile){const result=await this.readDroppedFile(entry,isCurrent);if(result.status==="cancelled"||!isCurrent())return{status:"cancelled"};if(result.status==="error")return{status:"error",name:entry.name};files.push(result.file);continue}if(!entry.isDirectory)continue;let reader;try{reader=entry.createReader()}catch{return isCurrent()?{status:"error",name:entry.name}:{status:"cancelled"}}for(;;){if(!isCurrent())return{status:"cancelled"};const batch=await this.readDroppedDirectoryBatch(reader,isCurrent);if(batch.status==="cancelled"||!isCurrent())return{status:"cancelled"};if(batch.status==="error")return{status:"error",name:entry.name};if(!batch.entries.length)break;for(const child of batch.entries){if(!isCurrent())return{status:"cancelled"};if(!enqueue(child))return{status:"limit",name:entry.name}}}}return{status:"complete",files}}}function readFileList(list){const files=[];if(!list)return files;for(let index=0;index<list.length;index++){const file=list[index];isFileValue(file)&&files.push(file)}return files}export{DropSessionController,isFileValue,readFileList};
@@ -1 +1 @@
1
- import{literalSetConverter}from"./converters.js";import{LYRA_DEFAULT_engine3dContextLost,LYRA_DEFAULT_engine3dError,LYRA_DEFAULT_engine3dLoading,LYRA_DEFAULT_engine3dShowingBuiltin,LYRA_DEFAULT_engine3dShowingList,LYRA_DEFAULT_engine3dSoftwareRendering,LYRA_DEFAULT_engine3dUnavailable,LYRA_DEFAULT_engine3dUnsupported}from"./default-strings/shared.generated.js";const ENGINE_3D_PREFERENCE=literalSetConverter(["builtin","webgl"],"builtin"),ENGINE_3D_DEFAULT_STRINGS=Object.freeze({engine3dLoading:LYRA_DEFAULT_engine3dLoading,engine3dUnavailable:LYRA_DEFAULT_engine3dUnavailable,engine3dUnsupported:LYRA_DEFAULT_engine3dUnsupported,engine3dContextLost:LYRA_DEFAULT_engine3dContextLost,engine3dError:LYRA_DEFAULT_engine3dError,engine3dSoftwareRendering:LYRA_DEFAULT_engine3dSoftwareRendering,engine3dShowingBuiltin:LYRA_DEFAULT_engine3dShowingBuiltin,engine3dShowingList:LYRA_DEFAULT_engine3dShowingList}),ENGINE_3D_REASON_MESSAGE={unavailable:"engine3dUnavailable",unsupported:"engine3dUnsupported","context-lost":"engine3dContextLost",error:"engine3dError"},ENGINE_3D_SHOWING_MESSAGE={webgl:"engine3dShowingList",builtin:"engine3dShowingBuiltin",list:"engine3dShowingList"};function engine3dFallbackNotice(detail){return{reason:ENGINE_3D_REASON_MESSAGE[detail.reason],showing:ENGINE_3D_SHOWING_MESSAGE[detail.to]}}function engine3dFailureReason(error){return typeof error=="object"&&error!==null&&error.code==="webgl-unavailable"?"unsupported":"error"}function webgl2Available(createCanvas=()=>document.createElement("canvas")){try{const context=createCanvas().getContext("webgl2");return context?.getExtension("WEBGL_lose_context")?.loseContext(),context!==null}catch{return!1}}class Engine3dSelection{constructor(hasBuiltin){this.hasBuiltin=hasBuiltin,this.currentPreference="builtin",this.currentRenderer=hasBuiltin?"builtin":"list"}get preference(){return this.currentPreference}get renderer(){return this.currentRenderer}prefer(value){const preference=ENGINE_3D_PREFERENCE.normalize(value),previous=this.currentRenderer;return this.currentPreference=preference,this.currentRenderer=preference==="webgl"?"webgl":this.hasBuiltin?"builtin":"list",previous!==this.currentRenderer}fail(reason){const from=this.currentRenderer,to=from==="webgl"?this.hasBuiltin?"builtin":"list":from==="builtin"?"list":null;return to===null?null:(this.currentRenderer=to,Object.freeze({from,to,reason}))}restore(){return this.currentPreference!=="webgl"||this.currentRenderer==="webgl"?!1:(this.currentRenderer="webgl",!0)}}export{ENGINE_3D_DEFAULT_STRINGS,ENGINE_3D_PREFERENCE,ENGINE_3D_REASON_MESSAGE,ENGINE_3D_SHOWING_MESSAGE,Engine3dSelection,engine3dFailureReason,engine3dFallbackNotice,webgl2Available};
1
+ import{literalSetConverter}from"./converters.js";import{LYRA_DEFAULT_engine3dContextLost,LYRA_DEFAULT_engine3dError,LYRA_DEFAULT_engine3dLoading,LYRA_DEFAULT_engine3dShowingBuiltin,LYRA_DEFAULT_engine3dShowingList,LYRA_DEFAULT_engine3dSoftwareRendering,LYRA_DEFAULT_engine3dUnavailable,LYRA_DEFAULT_engine3dUnsupported}from"./default-strings/shared.generated.js";const ENGINE_3D_PREFERENCE=literalSetConverter(["builtin","webgl"],"builtin"),ENGINE_3D_DEFAULT_STRINGS=Object.freeze({engine3dLoading:LYRA_DEFAULT_engine3dLoading,engine3dUnavailable:LYRA_DEFAULT_engine3dUnavailable,engine3dUnsupported:LYRA_DEFAULT_engine3dUnsupported,engine3dContextLost:LYRA_DEFAULT_engine3dContextLost,engine3dError:LYRA_DEFAULT_engine3dError,engine3dSoftwareRendering:LYRA_DEFAULT_engine3dSoftwareRendering,engine3dShowingBuiltin:LYRA_DEFAULT_engine3dShowingBuiltin,engine3dShowingList:LYRA_DEFAULT_engine3dShowingList}),ENGINE_3D_REASON_MESSAGE={unavailable:"engine3dUnavailable",unsupported:"engine3dUnsupported","context-lost":"engine3dContextLost",error:"engine3dError"},ENGINE_3D_SHOWING_MESSAGE={webgl:"engine3dShowingList",builtin:"engine3dShowingBuiltin",list:"engine3dShowingList"};function engine3dFallbackNotice(detail){return{reason:ENGINE_3D_REASON_MESSAGE[detail.reason],showing:ENGINE_3D_SHOWING_MESSAGE[detail.to]}}function engine3dFailureReason(error){try{return typeof error=="object"&&error!==null&&error.code==="webgl-unavailable"?"unsupported":"error"}catch{return"error"}}function webgl2Available(createCanvas=()=>document.createElement("canvas")){try{const context=createCanvas().getContext("webgl2");return context?.getExtension("WEBGL_lose_context")?.loseContext(),context!==null}catch{return!1}}class Engine3dSelection{constructor(hasBuiltin){this.hasBuiltin=hasBuiltin,this.currentPreference="builtin",this.currentRenderer=hasBuiltin?"builtin":"list"}get preference(){return this.currentPreference}get renderer(){return this.currentRenderer}prefer(value){const preference=ENGINE_3D_PREFERENCE.normalize(value),previous=this.currentRenderer;return this.currentPreference=preference,this.currentRenderer=preference==="webgl"?"webgl":this.hasBuiltin?"builtin":"list",previous!==this.currentRenderer}fail(reason){const from=this.currentRenderer,to=from==="webgl"?this.hasBuiltin?"builtin":"list":from==="builtin"?"list":null;return to===null?null:(this.currentRenderer=to,Object.freeze({from,to,reason}))}restore(){return this.currentPreference!=="webgl"||this.currentRenderer==="webgl"?!1:(this.currentRenderer="webgl",!0)}}export{ENGINE_3D_DEFAULT_STRINGS,ENGINE_3D_PREFERENCE,ENGINE_3D_REASON_MESSAGE,ENGINE_3D_SHOWING_MESSAGE,Engine3dSelection,engine3dFailureReason,engine3dFallbackNotice,webgl2Available};
@@ -1 +1 @@
1
- import{tag}from"./prefix.js";function isVisuallyHidden(element){if(element.localName===tag("visually-hidden"))return!0;const view=element.ownerDocument.defaultView;if(!view)return!1;const style=view.getComputedStyle(element);return style.display==="none"||style.visibility==="hidden"?!0:style.position==="absolute"&&style.clipPath.startsWith("inset(50%")}function hasIconOnlyDefaultContent(host){const childElements=host.children,elements=(childElements?Array.from(childElements):[]).filter(element=>!element.getAttribute("slot")).filter(element=>!isVisuallyHidden(element));if(elements.length!==1)return!1;const childNodes=host.childNodes;return(childNodes?Array.from(childNodes):[]).filter(node=>node.nodeType===3).map(node=>node.textContent??"").join("").trim()===""&&(elements[0]?.textContent??"").trim()===""}class IconOnlyLabelObserver{constructor(host,label,current,onChange){this.host=host,this.label=label,this.current=current,this.onChange=onChange}arm(){const label=this.label();if(!label||label===this.watched)return;const view=this.host.ownerDocument.defaultView,Ctor=view?.ResizeObserver;!view||!Ctor||(this.watched&&this.observer?.unobserve(this.watched),this.observer??=new Ctor(()=>{!this.host.isConnected||this.host.ownerDocument.defaultView!==view||(this.cancelFrame(),this.rafOwner=view,this.raf=view.requestAnimationFrame(()=>{if(this.raf=void 0,this.rafOwner=void 0,!this.host.isConnected||this.host.ownerDocument.defaultView!==view)return;const next=hasIconOnlyDefaultContent(this.host);next!==this.current()&&this.onChange(next)}))}),this.observer.observe(this.watched=label))}disarm(){this.observer?.disconnect(),this.observer=this.watched=void 0,this.cancelFrame()}cancelFrame(){this.raf!==void 0&&this.rafOwner?.cancelAnimationFrame(this.raf),this.raf=void 0,this.rafOwner=void 0}}export{IconOnlyLabelObserver,hasIconOnlyDefaultContent};
1
+ import{tag}from"./prefix.js";function isVisuallyHidden(element){if(element.localName===tag("visually-hidden"))return!0;const view=element.ownerDocument.defaultView;if(!view)return!1;const style=view.getComputedStyle(element);return style.display==="none"||style.visibility==="hidden"?!0:style.position==="absolute"&&style.clipPath.startsWith("inset(50%")}function hasIconOnlyDefaultContent(host){const childElements=host.children,elements=(childElements?Array.from(childElements):[]).filter(element=>!element.getAttribute("slot")).filter(element=>!isVisuallyHidden(element));if(elements.length!==1)return!1;const childNodes=host.childNodes;return(childNodes?Array.from(childNodes):[]).filter(node=>node.nodeType===3).map(node=>node.textContent??"").join("").trim()===""&&(elements[0]?.textContent??"").trim()===""}class IconOnlyLabelObserver{constructor(host,label,current,onChange){this.host=host,this.label=label,this.current=current,this.onChange=onChange}arm(){if(!this.host.isConnected)return;const label=this.label();if(!label||label===this.watched)return;const view=this.host.ownerDocument.defaultView,Ctor=view?.ResizeObserver;!view||!Ctor||(this.watched&&this.observer?.unobserve(this.watched),this.observer??=new Ctor(()=>{!this.host.isConnected||this.host.ownerDocument.defaultView!==view||(this.cancelFrame(),this.rafOwner=view,this.raf=view.requestAnimationFrame(()=>{if(this.raf=void 0,this.rafOwner=void 0,!this.host.isConnected||this.host.ownerDocument.defaultView!==view)return;const next=hasIconOnlyDefaultContent(this.host);next!==this.current()&&this.onChange(next)}))}),this.observer.observe(this.watched=label))}disarm(){this.observer?.disconnect(),this.observer=this.watched=void 0,this.cancelFrame()}cancelFrame(){this.raf!==void 0&&this.rafOwner?.cancelAnimationFrame(this.raf),this.raf=void 0,this.rafOwner=void 0}}export{IconOnlyLabelObserver,hasIconOnlyDefaultContent};
@@ -1 +1 @@
1
- import{finiteInteger}from"./numbers.js";function getOrInit(map,key,init){let value=map.get(key);return value===void 0&&(value=init(),map.set(key,value)),value}const DEFAULT_MAX_VIRTUAL_WAYPOINTS=1e4,MAX_LAYOUT_VALUE=Number.MAX_SAFE_INTEGER;function checkedLayoutValue(value,label){if(!Number.isFinite(value)||value<0||value>MAX_LAYOUT_VALUE)throw new RangeError(`layeredLayout(): ${label} must be a finite, non-negative number no greater than Number.MAX_SAFE_INTEGER.`);return value}function checkedLayoutSum(label,...values){const result=values.reduce((sum,value)=>sum+value,0);if(!Number.isFinite(result)||result>MAX_LAYOUT_VALUE)throw new RangeError(`layeredLayout(): ${label} exceeds the supported numeric range.`);return result}function nextRepresentableNumber(value){if(value===0)return Number.MIN_VALUE;const buffer=new ArrayBuffer(8),view=new DataView(buffer);return view.setFloat64(0,value),view.setBigUint64(0,view.getBigUint64(0)+1n),view.getFloat64(0)}function checkedGapAfter(edge,gap,label){let next=checkedLayoutSum(label,edge,gap);for(;next-edge<gap;)if(next=nextRepresentableNumber(next),!Number.isFinite(next)||next>MAX_LAYOUT_VALUE)throw new RangeError(`layeredLayout(): ${label} exceeds the supported numeric range.`);return next}function checkedBoxFromStart(start,size,label){const half=size/2;let center=checkedLayoutSum(`${label} center`,start,half);for(;center-half<start;)if(center=nextRepresentableNumber(center),!Number.isFinite(center)||center>MAX_LAYOUT_VALUE)throw new RangeError(`layeredLayout(): ${label} exceeds the supported numeric range.`);return Object.freeze({center,end:checkedLayoutSum(`${label} end`,center,half)})}function layeredLayout(input){const{edges}=input,gapX=checkedLayoutValue(input.options?.gapX??24,"options.gapX"),gapY=checkedLayoutValue(input.options?.gapY??100,"options.gapY"),nodes=input.nodes.map((node,index)=>({id:node.id,width:checkedLayoutValue(node.width,`nodes[${index}].width`),height:checkedLayoutValue(node.height,`nodes[${index}].height`)})),fixed=input.options?.fixedPositions?new Map([...input.options.fixedPositions].map(([id,position])=>[id,Object.freeze({x:checkedLayoutValue(position.x,`options.fixedPositions["${id}"].x`),y:checkedLayoutValue(position.y,`options.fixedPositions["${id}"].y`)})])):void 0,maxVirtualWaypoints=finiteInteger(input.options?.maxVirtualWaypoints??DEFAULT_MAX_VIRTUAL_WAYPOINTS,DEFAULT_MAX_VIRTUAL_WAYPOINTS,0),positions=new Map;if(!nodes.length)return Object.freeze({positions,truncated:!1,virtualWaypointCount:0});const nodeById=new Map(nodes.map(n=>[n.id,n])),order=nodes.map(n=>n.id);let fixedInlineRight;for(const node of nodes){const fixedPosition=fixed?.get(node.id);if(!fixedPosition)continue;const right=checkedLayoutSum(`fixed inline extent for "${node.id}"`,fixedPosition.x,node.width/2);checkedLayoutSum(`fixed block extent for "${node.id}"`,fixedPosition.y,node.height/2),fixedInlineRight=Math.max(fixedInlineRight??0,right)}const rawEdges=edges.filter(e=>nodeById.has(e.source)&&nodeById.has(e.target)&&e.source!==e.target),adjacency=new Map(order.map(id=>[id,[]]));for(const e of rawEdges)adjacency.get(e.source).push(e.target);const UNVISITED=0,ON_STACK=1,DONE=2,state=new Map(order.map(id=>[id,UNVISITED])),dagEdges=[],dagKeys=new Set,addDagEdge=(source,target)=>{const key=`${source}\0${target}`;dagKeys.has(key)||(dagKeys.add(key),dagEdges.push({source,target}))};for(const root of order){if(state.get(root)!==UNVISITED)continue;state.set(root,ON_STACK);const stack=[{id:root,nextTarget:0}];for(;stack.length>0;){const frame=stack[stack.length-1],target=(adjacency.get(frame.id)??[])[frame.nextTarget];if(target===void 0){state.set(frame.id,DONE),stack.pop();continue}frame.nextTarget+=1;const targetState=state.get(target);targetState===UNVISITED?(addDagEdge(frame.id,target),state.set(target,ON_STACK),stack.push({id:target,nextTarget:0})):targetState===ON_STACK?addDagEdge(target,frame.id):addDagEdge(frame.id,target)}}const dagAdjacency=new Map(order.map(id=>[id,[]])),indegree=new Map(order.map(id=>[id,0]));for(const e of dagEdges)dagAdjacency.get(e.source).push(e.target),indegree.set(e.target,(indegree.get(e.target)??0)+1);const layer=new Map(order.map(id=>[id,0])),remaining=new Map(indegree),queue=order.filter(id=>indegree.get(id)===0);for(let qi=0;qi<queue.length;qi++){const id=queue[qi];for(const target of dagAdjacency.get(id)??[]){layer.set(target,Math.max(layer.get(target)??0,(layer.get(id)??0)+1));const left=(remaining.get(target)??0)-1;remaining.set(target,left),left===0&&queue.push(target)}}let maxLayer=0;for(const id of order)maxLayer=Math.max(maxLayer,layer.get(id)??0);const layers=Array.from({length:maxLayer+1},()=>[]);for(const id of order){const node=nodeById.get(id);layers[layer.get(id)??0].push({id,virtual:!1,width:node.width,height:node.height})}let waypointCounter=0,truncated=!1;const waypointChains=new Map;for(const e of dagEdges){const sourceLayer=layer.get(e.source)??0,targetLayer=layer.get(e.target)??0,waypointCount=targetLayer-sourceLayer-1;if(waypointCount<=0)continue;if(waypointCounter+waypointCount>maxVirtualWaypoints){truncated=!0;continue}const chain=[];for(let l=sourceLayer+1;l<targetLayer;l++){const waypointId=`__waypoint_${waypointCounter++}__`;layers[l].push({id:waypointId,virtual:!0,width:1,height:1}),chain.push(waypointId)}waypointChains.set(e,chain)}const orderingDown=new Map,orderingUp=new Map,addOrderingEdge=(a,b)=>{getOrInit(orderingDown,a,()=>[]).push(b),getOrInit(orderingUp,b,()=>[]).push(a)};for(const e of dagEdges){const span=(layer.get(e.target)??0)-(layer.get(e.source)??0);if(span===1)addOrderingEdge(e.source,e.target);else if(span>1){const hops=[e.source,...waypointChains.get(e)??[],e.target];for(let i=0;i<hops.length-1;i++)addOrderingEdge(hops[i],hops[i+1])}}const positionInLayer=new Map;layers.forEach(slots=>slots.forEach((s,i)=>positionInLayer.set(s.id,i)));function sweep(forward){const range=forward?Array.from({length:layers.length-1},(_,i)=>i+1):Array.from({length:layers.length-1},(_,i)=>layers.length-2-i),neighborsOf=forward?orderingUp:orderingDown;for(const l of range){const withBary=layers[l].map((slot,idx)=>{const neighborPositions=(neighborsOf.get(slot.id)??[]).map(id=>positionInLayer.get(id)).filter(p=>p!=null),bary=neighborPositions.length?neighborPositions.reduce((sum,p)=>sum+p,0)/neighborPositions.length:idx;return{slot,bary,idx}});withBary.sort((a,b)=>a.bary-b.bary||a.idx-b.idx),layers[l]=withBary.map(w=>w.slot),layers[l].forEach((s,i)=>positionInLayer.set(s.id,i))}}sweep(!0),sweep(!1),sweep(!0),sweep(!1);let previousLayerBottom;for(const slots of layers){let layerHeight=0,fixedLayerBottom=0;for(const slot of slots){const fixedPosition=slot.virtual?void 0:fixed?.get(slot.id);fixedPosition?fixedLayerBottom=Math.max(fixedLayerBottom,checkedLayoutSum(`fixed block extent for "${slot.id}"`,fixedPosition.y,slot.height/2)):layerHeight=Math.max(layerHeight,slot.height)}const layerTop=previousLayerBottom===void 0?0:checkedGapAfter(previousLayerBottom,gapY,"layer block gap"),layerBox=checkedBoxFromStart(layerTop,layerHeight,"computed layer");let previousInlineRight=fixedInlineRight;for(const slot of slots){const fixedPos=slot.virtual?void 0:fixed?.get(slot.id);if(fixedPos){positions.set(slot.id,Object.freeze({x:fixedPos.x,y:fixedPos.y}));continue}const slotStart=previousInlineRight===void 0?0:checkedGapAfter(previousInlineRight,gapX,`inline gap before "${slot.id}"`),slotBox=checkedBoxFromStart(slotStart,slot.width,`inline box for "${slot.id}"`);slot.virtual||positions.set(slot.id,Object.freeze({x:slotBox.center,y:layerBox.center})),previousInlineRight=slotBox.end}previousLayerBottom=Math.max(layerBox.end,fixedLayerBottom)}return Object.freeze({positions,truncated,virtualWaypointCount:waypointCounter})}export{layeredLayout};
1
+ import{finiteInteger}from"./numbers.js";function getOrInit(map,key,init){let value=map.get(key);return value===void 0&&(value=init(),map.set(key,value)),value}const DEFAULT_MAX_VIRTUAL_WAYPOINTS=1e4,MAX_LAYOUT_VALUE=Number.MAX_SAFE_INTEGER;function checkedLayoutValue(value,label){if(!Number.isFinite(value)||value<0||value>MAX_LAYOUT_VALUE)throw new RangeError(`layeredLayout(): ${label} must be a finite, non-negative number no greater than Number.MAX_SAFE_INTEGER.`);return value}function checkedLayoutSum(label,...values){const result=values.reduce((sum,value)=>sum+value,0);if(!Number.isFinite(result)||result>MAX_LAYOUT_VALUE)throw new RangeError(`layeredLayout(): ${label} exceeds the supported numeric range.`);return result}function nextRepresentableNumber(value){if(value===0)return Number.MIN_VALUE;const buffer=new ArrayBuffer(8),view=new DataView(buffer);return view.setFloat64(0,value),view.setBigUint64(0,view.getBigUint64(0)+1n),view.getFloat64(0)}function checkedGapAfter(edge,gap,label){let next=checkedLayoutSum(label,edge,gap);for(;next-edge<gap;)if(next=nextRepresentableNumber(next),!Number.isFinite(next)||next>MAX_LAYOUT_VALUE)throw new RangeError(`layeredLayout(): ${label} exceeds the supported numeric range.`);return next}function checkedBoxFromStart(start,size,label){const half=size/2;let center=checkedLayoutSum(`${label} center`,start,half);for(;center-half<start;)if(center=nextRepresentableNumber(center),!Number.isFinite(center)||center>MAX_LAYOUT_VALUE)throw new RangeError(`layeredLayout(): ${label} exceeds the supported numeric range.`);return Object.freeze({center,end:checkedLayoutSum(`${label} end`,center,half)})}function layeredLayout(input){const{edges}=input,gapX=checkedLayoutValue(input.options?.gapX??24,"options.gapX"),gapY=checkedLayoutValue(input.options?.gapY??100,"options.gapY"),nodes=input.nodes.map((node,index)=>({id:node.id,width:checkedLayoutValue(node.width,`nodes[${index}].width`),height:checkedLayoutValue(node.height,`nodes[${index}].height`)})),fixed=input.options?.fixedPositions?new Map([...input.options.fixedPositions].map(([id,position])=>[id,Object.freeze({x:checkedLayoutValue(position.x,`options.fixedPositions["${id}"].x`),y:checkedLayoutValue(position.y,`options.fixedPositions["${id}"].y`)})])):void 0,maxVirtualWaypoints=finiteInteger(input.options?.maxVirtualWaypoints??DEFAULT_MAX_VIRTUAL_WAYPOINTS,DEFAULT_MAX_VIRTUAL_WAYPOINTS,0),positions=new Map;if(!nodes.length)return Object.freeze({positions,truncated:!1,virtualWaypointCount:0});const nodeById=new Map(nodes.map(n=>[n.id,n])),order=nodes.map(n=>n.id);let fixedInlineRight;for(const node of nodes){const fixedPosition=fixed?.get(node.id);if(!fixedPosition)continue;const right=checkedLayoutSum(`fixed inline extent for "${node.id}"`,fixedPosition.x,node.width/2);checkedLayoutSum(`fixed block extent for "${node.id}"`,fixedPosition.y,node.height/2),fixedInlineRight=Math.max(fixedInlineRight??0,right)}const rawEdges=edges.filter(e=>nodeById.has(e.source)&&nodeById.has(e.target)&&e.source!==e.target),adjacency=new Map(order.map(id=>[id,[]]));for(const e of rawEdges)adjacency.get(e.source).push(e.target);const UNVISITED=0,ON_STACK=1,DONE=2,state=new Map(order.map(id=>[id,UNVISITED])),dagEdges=[],dagTargets=new Map,addDagEdge=(source,target)=>{const targets=getOrInit(dagTargets,source,()=>new Set);targets.has(target)||(targets.add(target),dagEdges.push({source,target}))};for(const root of order){if(state.get(root)!==UNVISITED)continue;state.set(root,ON_STACK);const stack=[{id:root,nextTarget:0}];for(;stack.length>0;){const frame=stack[stack.length-1],target=(adjacency.get(frame.id)??[])[frame.nextTarget];if(target===void 0){state.set(frame.id,DONE),stack.pop();continue}frame.nextTarget+=1;const targetState=state.get(target);targetState===UNVISITED?(addDagEdge(frame.id,target),state.set(target,ON_STACK),stack.push({id:target,nextTarget:0})):targetState===ON_STACK?addDagEdge(target,frame.id):addDagEdge(frame.id,target)}}const dagAdjacency=new Map(order.map(id=>[id,[]])),indegree=new Map(order.map(id=>[id,0]));for(const e of dagEdges)dagAdjacency.get(e.source).push(e.target),indegree.set(e.target,(indegree.get(e.target)??0)+1);const layer=new Map(order.map(id=>[id,0])),remaining=new Map(indegree),queue=order.filter(id=>indegree.get(id)===0);for(let qi=0;qi<queue.length;qi++){const id=queue[qi];for(const target of dagAdjacency.get(id)??[]){layer.set(target,Math.max(layer.get(target)??0,(layer.get(id)??0)+1));const left=(remaining.get(target)??0)-1;remaining.set(target,left),left===0&&queue.push(target)}}let maxLayer=0;for(const id of order)maxLayer=Math.max(maxLayer,layer.get(id)??0);const layers=Array.from({length:maxLayer+1},()=>[]);for(const id of order){const node=nodeById.get(id);layers[layer.get(id)??0].push({id,virtual:!1,width:node.width,height:node.height})}let waypointCounter=0,truncated=!1;const waypointChains=new Map;for(const e of dagEdges){const sourceLayer=layer.get(e.source)??0,targetLayer=layer.get(e.target)??0,waypointCount=targetLayer-sourceLayer-1;if(waypointCount<=0)continue;if(waypointCounter+waypointCount>maxVirtualWaypoints){truncated=!0;continue}const chain=[];for(let l=sourceLayer+1;l<targetLayer;l++){const waypointId=Symbol(`waypoint-${waypointCounter++}`);layers[l].push({id:waypointId,virtual:!0,width:1,height:1}),chain.push(waypointId)}waypointChains.set(e,chain)}const orderingDown=new Map,orderingUp=new Map,addOrderingEdge=(a,b)=>{getOrInit(orderingDown,a,()=>[]).push(b),getOrInit(orderingUp,b,()=>[]).push(a)};for(const e of dagEdges){const span=(layer.get(e.target)??0)-(layer.get(e.source)??0);if(span===1)addOrderingEdge(e.source,e.target);else if(span>1){const hops=[e.source,...waypointChains.get(e)??[],e.target];for(let i=0;i<hops.length-1;i++)addOrderingEdge(hops[i],hops[i+1])}}const positionInLayer=new Map;layers.forEach(slots=>slots.forEach((s,i)=>positionInLayer.set(s.id,i)));function sweep(forward){const range=forward?Array.from({length:layers.length-1},(_,i)=>i+1):Array.from({length:layers.length-1},(_,i)=>layers.length-2-i),neighborsOf=forward?orderingUp:orderingDown;for(const l of range){const withBary=layers[l].map((slot,idx)=>{const neighborPositions=(neighborsOf.get(slot.id)??[]).map(id=>positionInLayer.get(id)).filter(p=>p!=null),bary=neighborPositions.length?neighborPositions.reduce((sum,p)=>sum+p,0)/neighborPositions.length:idx;return{slot,bary,idx}});withBary.sort((a,b)=>a.bary-b.bary||a.idx-b.idx),layers[l]=withBary.map(w=>w.slot),layers[l].forEach((s,i)=>positionInLayer.set(s.id,i))}}sweep(!0),sweep(!1),sweep(!0),sweep(!1);let previousLayerBottom;for(const slots of layers){let layerHeight=0,fixedLayerBottom=0;for(const slot of slots){const fixedPosition=slot.virtual?void 0:fixed?.get(slot.id);fixedPosition?fixedLayerBottom=Math.max(fixedLayerBottom,checkedLayoutSum(`fixed block extent for "${String(slot.id)}"`,fixedPosition.y,slot.height/2)):layerHeight=Math.max(layerHeight,slot.height)}const layerTop=previousLayerBottom===void 0?0:checkedGapAfter(previousLayerBottom,gapY,"layer block gap"),layerBox=checkedBoxFromStart(layerTop,layerHeight,"computed layer");let previousInlineRight=fixedInlineRight;for(const slot of slots){if(!slot.virtual){const fixedPos=fixed?.get(slot.id);if(fixedPos){positions.set(slot.id,Object.freeze({x:fixedPos.x,y:fixedPos.y}));continue}}const slotStart=previousInlineRight===void 0?0:checkedGapAfter(previousInlineRight,gapX,`inline gap before "${String(slot.id)}"`),slotBox=checkedBoxFromStart(slotStart,slot.width,`inline box for "${String(slot.id)}"`);slot.virtual||positions.set(slot.id,Object.freeze({x:slotBox.center,y:layerBox.center})),previousInlineRight=slotBox.end}previousLayerBottom=Math.max(layerBox.end,fixedLayerBottom)}return Object.freeze({positions,truncated,virtualWaypointCount:waypointCounter})}export{layeredLayout};
@@ -1 +1 @@
1
- import{mapCustomLayerAttachment}from"./map-custom-layer-attachment.js";import{isMapSceneLayerHandle,loadMapSceneLayerRuntime}from"./map-scene-layer-runtime.js";const text=value=>typeof value=="string"&&value.trim().length>0;function ownValue(record,key){const descriptor=Object.getOwnPropertyDescriptor(record,key);if(descriptor&&!("value"in descriptor))throw new TypeError(`Map custom layer ${key} must be a data property.`);return descriptor?.value}function admitLayer(layer){if(typeof layer!="object"||layer===null)throw new TypeError("A map custom layer must be an object.");const id=ownValue(layer,"id"),label=ownValue(layer,"label"),before=ownValue(layer,"before"),create=layer.create;if(!text(id)||!text(label)||typeof create!="function"||before!==void 0&&!text(before))throw new TypeError("A map custom layer needs a nonblank id and label, a create() function and an optional nonblank before.");return Object.freeze({id,label,...before===void 0?{}:{before},create:context=>Reflect.apply(create,layer,[context])})}function nativeCall(map,method,name,listener){const callable=Reflect.get(map,method);typeof callable=="function"&&Reflect.apply(callable,map,[name,listener])}function eventPoint(event){if(typeof event!="object"||event===null)return;const point=Reflect.get(event,"point");if(typeof point!="object"||point===null)return;const x=Reflect.get(point,"x"),y=Reflect.get(point,"y");return typeof x=="number"&&typeof y=="number"&&Number.isFinite(x)&&Number.isFinite(y)?[x,y]:void 0}function createMapCustomLayerController(element,input,options={}){const layer=admitLayer(input),attachment=mapCustomLayerAttachment(element);if(!attachment)throw new TypeError("addMapCustomLayer() requires a connected lr-map.");const onStateChange=options.onStateChange;let status=Object.freeze({state:"loading"}),removed=!1,visible=!0,attempt=0,engine,engineMap,abort,lease;function setStatus(state,code){if(!(removed&&state!=="removed")&&!(status.state===state&&status.code===code)){status=Object.freeze(code===void 0?{state}:{state,code});try{onStateChange?.(status)}catch{}}}const onClick=event=>{const target=engine,point=eventPoint(event);!target||!visible||removed||!point||target.pick(point).then(hit=>{!hit||target!==engine||removed||typeof event!="object"||event===null||lease?.activate({id:hit.id,layerId:layer.id,...hit.position?{position:hit.position}:{}},event)},()=>{})};function stop(){attempt++,abort?.abort(),abort=void 0;const previous=engine;engine=void 0;try{previous?.dispose()}catch{}if(engineMap)try{nativeCall(engineMap,"off","click",onClick)}catch{}engineMap=void 0}function start(map){stop();const ticket=attempt,controller=abort=new AbortController;engineMap=map,setStatus("loading");try{nativeCall(map,"on","click",onClick)}catch{}loadMapSceneLayerRuntime().then(runtime=>{if(removed||ticket!==attempt)return;let created;try{if(created=runtime.createSceneLayer(map,layer,{signal:controller.signal,onState:(state,code)=>{!removed&&ticket===attempt&&setStatus(state,code)},reducedMotion:()=>lease?.reducedMotion()??!1}),!isMapSceneLayerHandle(created))throw new TypeError("Map custom layers are unavailable")}catch{if(controller.abort(),isMapSceneLayerHandle(created))try{created.dispose()}catch{}ticket===attempt&&setStatus("unavailable","engine");return}if(removed||ticket!==attempt){created.dispose();return}engine=created,visible||created.setVisible(!1)},()=>{!removed&&ticket===attempt&&setStatus("unavailable","engine")})}function remove(){if(removed)return;stop(),removed=!0;const owned=lease;lease=void 0,owned?.release(),status=Object.freeze({state:"removed"});try{onStateChange?.(status)}catch{}}lease=attachment.acquire({styleReady(map){if(!removed){if(engineMap===map){engine?.styleReady();return}start(map)}},styleInvalidated(){removed||engine?.invalidateStyle()},mapRemoved(){removed||(stop(),setStatus("loading"))},released:remove});const initial=lease.nativeMap();return initial&&start(initial),Object.freeze({id:layer.id,get status(){return status},requestRender(){removed||engine?.requestFrame()},setVisible(value){visible=!!value,removed||engine?.setVisible(visible)},async pick(point){const target=engine;if(!target||removed)return null;const hit=await target.pick(point);return target===engine&&!removed?hit:null},remove})}export{createMapCustomLayerController};
1
+ import{mapCustomLayerAttachment}from"./map-custom-layer-attachment.js";import{isMapSceneLayerHandle,loadMapSceneLayerRuntime}from"./map-scene-layer-runtime.js";const text=value=>typeof value=="string"&&value.trim().length>0;function ownValue(record,key){const descriptor=Object.getOwnPropertyDescriptor(record,key);if(descriptor&&!("value"in descriptor))throw new TypeError(`Map custom layer ${key} must be a data property.`);return descriptor?.value}function admitLayer(layer){if(typeof layer!="object"||layer===null)throw new TypeError("A map custom layer must be an object.");const id=ownValue(layer,"id"),label=ownValue(layer,"label"),before=ownValue(layer,"before"),create=layer.create;if(!text(id)||!text(label)||typeof create!="function"||before!==void 0&&!text(before))throw new TypeError("A map custom layer needs a nonblank id and label, a create() function and an optional nonblank before.");return Object.freeze({id,label,...before===void 0?{}:{before},create:context=>Reflect.apply(create,layer,[context])})}function nativeCall(map,method,name,listener){const callable=Reflect.get(map,method);typeof callable=="function"&&Reflect.apply(callable,map,[name,listener])}function eventPoint(event){if(typeof event!="object"||event===null)return;const point=Reflect.get(event,"point");if(typeof point!="object"||point===null)return;const x=Reflect.get(point,"x"),y=Reflect.get(point,"y");return typeof x=="number"&&typeof y=="number"&&Number.isFinite(x)&&Number.isFinite(y)?[x,y]:void 0}function createMapCustomLayerController(element,input,options={}){const layer=admitLayer(input),attachment=mapCustomLayerAttachment(element);if(!attachment)throw new TypeError("addMapCustomLayer() requires a connected lr-map.");const onStateChange=options.onStateChange;let status=Object.freeze({state:"loading"}),removed=!1,visible=!0,attempt=0,engine,engineMap,abort,lease;function setStatus(state,code){if(!(removed&&state!=="removed")&&!(status.state===state&&status.code===code)){status=Object.freeze(code===void 0?{state}:{state,code});try{onStateChange?.(status)}catch{}}}const onClick=event=>{const target=engine,point=eventPoint(event);!target||!visible||removed||!point||target.pick(point).then(hit=>{!hit||target!==engine||removed||typeof event!="object"||event===null||lease?.activate({id:hit.id,layerId:layer.id,...hit.position?{position:hit.position}:{}},event)},()=>{})};function stop(){attempt++,abort?.abort(),abort=void 0;const previous=engine;engine=void 0;try{previous?.dispose()}catch{}if(engineMap)try{nativeCall(engineMap,"off","click",onClick)}catch{}engineMap=void 0}function start(map){stop();const ticket=attempt,controller=abort=new AbortController;engineMap=map,setStatus("loading");try{nativeCall(map,"on","click",onClick)}catch{}loadMapSceneLayerRuntime().then(runtime=>{if(removed||ticket!==attempt)return;let created;try{if(created=runtime.createSceneLayer(map,layer,{signal:controller.signal,onState:(state,code)=>{!removed&&ticket===attempt&&setStatus(state,code)},reducedMotion:()=>lease?.reducedMotion()??!1}),!isMapSceneLayerHandle(created))throw new TypeError("Map custom layers are unavailable")}catch{if(controller.abort(),typeof created=="object"&&created!==null)try{const dispose=Reflect.get(created,"dispose");typeof dispose=="function"&&Reflect.apply(dispose,created,[])}catch{}ticket===attempt&&setStatus("unavailable","engine");return}if(removed||ticket!==attempt){created.dispose();return}engine=created,visible||created.setVisible(!1)},()=>{!removed&&ticket===attempt&&setStatus("unavailable","engine")})}function remove(){if(removed)return;stop(),removed=!0;const owned=lease;lease=void 0,owned?.release(),status=Object.freeze({state:"removed"});try{onStateChange?.(status)}catch{}}lease=attachment.acquire({styleReady(map){if(!removed){if(engineMap===map){engine?.styleReady();return}start(map)}},styleInvalidated(){removed||engine?.invalidateStyle()},mapRemoved(){removed||(stop(),setStatus("loading"))},released:remove});const initial=lease.nativeMap();return initial&&start(initial),Object.freeze({id:layer.id,get status(){return status},requestRender(){removed||engine?.requestFrame()},setVisible(value){visible=!!value,removed||engine?.setVisible(visible)},async pick(point){const target=engine;if(!target||removed)return null;const hit=await target.pick(point);return target===engine&&!removed?hit:null},remove})}export{createMapCustomLayerController};
@@ -1,4 +1,4 @@
1
- import{html,nothing}from"lit";import{literalSetConverter}from"./converters.js";import{snapshotPublicCollection}from"./collection-snapshot.js";import{isObjectValue,readOwnDataValue}from"./data-descriptors.js";import{finiteRange}from"./numbers.js";import{createEngine3dLoader}from"./engine-3d-loader.js";import{Engine3dSelection,ENGINE_3D_REASON_MESSAGE,ENGINE_3D_SHOWING_MESSAGE,engine3dFailureReason,webgl2Available}from"./engine-3d.js";import{AnnouncementSinkController}from"./announcer.js";import{isAccessibilityVisible}from"./accessibility-visibility.js";import{resolveCanvasColor}from"./canvas-color.js";import{tag}from"./prefix.js";const PANORAMA_PROJECTION=literalSetConverter(["flat","equirectangular"],"flat"),PANORAMA_DEFAULT_CAMERA=Object.freeze({yaw:0,pitch:0,fieldOfView:75}),panoramaLoader=createEngine3dLoader({entry:"panorama",tag:tag("image-viewer"),load:()=>(async()=>{try{return await import("@aceshooting/lyra-3d/panorama")}catch(e){throw e}})()}),panoramaEnvironment={available:owner=>webgl2Available(()=>owner.createElement("canvas"))};function normalizePanoramaCamera(value){if(!isObjectValue(value))return PANORAMA_DEFAULT_CAMERA;const number=key=>{const entry=readOwnDataValue(value,key);return typeof entry=="number"?entry:NaN},yaw=finiteRange(number("yaw"),0);return Object.freeze({yaw:((yaw+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI,pitch:finiteRange(number("pitch"),0,-Math.PI/2+.01,Math.PI/2-.01),fieldOfView:finiteRange(number("fieldOfView"),75,20,100)})}function snapshotPanoramaHotspots(value,owner){const source=snapshotPublicCollection(value,owner);if(!Array.isArray(source))return Object.freeze([]);const seen=new Set,result=[];for(const item of source){const id=readOwnDataValue(item,"id"),yaw=readOwnDataValue(item,"yaw"),pitch=readOwnDataValue(item,"pitch"),label=readOwnDataValue(item,"label");typeof id!="string"||!id.trim()||seen.has(id)||typeof yaw!="number"||!Number.isFinite(yaw)||typeof pitch!="number"||!Number.isFinite(pitch)||Math.abs(pitch)>Math.PI/2||(seen.add(id),result.push(Object.freeze({id,yaw:normalizePanoramaCamera({yaw}).yaw,pitch,...typeof label=="string"?{label}:{}})))}return Object.freeze(result)}class PanoramaController{constructor(host,options){this.host=host,this.options=options,this.selection=new Engine3dSelection(!0),this.ready=!1,this.loading=!1,this.notice=null,this.software=!1,this.enabled=!1,this.media=null,this.mediaRevision=-1,this.hotspots=[],this.camera=PANORAMA_DEFAULT_CAMERA,this.container=null,this.generation=0,this.revision=0,this.attempted=!1,this.pending=!1,this.intersecting=!1,this.cleanups=[],this.cursor=0,this.announcements=new AnnouncementSinkController(host,{eager:["assertive"]})}release(){this.generation++,this.intersection?.disconnect(),this.intersection=void 0,this.eligibility?.disconnect(),this.eligibility=void 0,this.intersecting=!1,this.resize?.disconnect(),this.resize=void 0,this.theme?.disconnect(),this.theme=void 0;for(const cleanup of this.cleanups)cleanup();this.cleanups=[];const engine=this.engine;this.engine=void 0,this.ready=this.loading=this.pending=!1,engine?.dispose()}invalidate(){this.release(),this.attempted=!1,this.notice=null,this.software=!1,this.selection.prefer(this.enabled?"webgl":"builtin")}disconnect(){this.invalidate(),this.media=null,this.container=null}adopted(){this.disconnect(),this.announcements.adopted()}update(enabled,media,mediaRevision,hotspots,camera,container){(enabled!==this.enabled||media!==this.media||mediaRevision!==this.mediaRevision||hotspots!==this.hotspots||container!==this.container)&&(this.invalidate(),this.enabled=enabled,this.media=media,this.mediaRevision=mediaRevision,this.hotspots=hotspots,this.container=container,this.cursor=Math.min(this.cursor,Math.max(0,hotspots.length-1)),this.selection.prefer(enabled?"webgl":"builtin"),this.options.changed());const cameraChanged=camera!==this.camera;if(this.camera=camera,!enabled||!media||!container||!this.host.isConnected)return;if(this.ready){cameraChanged&&this.command(()=>this.engine?.setCamera(camera));return}if(this.pending||this.attempted||this.intersection||this.eligibility)return;const view=this.host.ownerDocument.defaultView,generation=this.generation;this.intersecting=view?.IntersectionObserver===void 0;const admit=()=>{generation!==this.generation||this.pending||this.attempted||!this.intersecting||!isAccessibilityVisible(this.host)||(this.intersection?.disconnect(),this.intersection=void 0,this.eligibility?.disconnect(),this.eligibility=void 0,this.start())};if(view?.IntersectionObserver&&(this.intersection=new view.IntersectionObserver(entries=>{if(generation===this.generation){for(const entry of entries)entry.target===container&&(this.intersecting=entry.isIntersecting);admit()}}),this.intersection.observe(container)),view?.MutationObserver){this.eligibility=new view.MutationObserver(admit);let ancestor=this.host,depth=0;for(;ancestor&&depth++<=256;){this.eligibility.observe(ancestor,{attributes:!0,attributeFilter:["aria-hidden","inert","hidden","style","class","open"]});const root=ancestor.getRootNode();ancestor=ancestor.assignedSlot??ancestor.parentElement??(root instanceof view.ShadowRoot?root.host:null)}}admit()}fail(reason){const detail=this.selection.renderer==="webgl"?this.selection.fail(reason):null;this.ready=this.loading=!1,reason!=="context-lost"&&(this.release(),this.attempted=!0),detail&&(this.notice=detail,this.options.changed(),this.announcements.announceAssertive(this.options.localize(ENGINE_3D_REASON_MESSAGE[detail.reason])),this.announcements.announcePolite(this.options.localize(ENGINE_3D_SHOWING_MESSAGE[detail.to])),this.options.fallback(detail))}command(run){const generation=this.generation,engine=this.engine;try{run()}catch{generation===this.generation&&engine===this.engine&&this.fail("error")}}async start(){const owner=this.host.ownerDocument,container=this.container,media=this.media,hotspots=this.hotspots;if(!this.enabled||!container||!media||!this.host.isConnected)return;const generation=this.generation,current=()=>generation===this.generation&&this.host.isConnected&&this.host.ownerDocument===owner;if(this.pending=this.attempted=!0,!panoramaEnvironment.available(owner)){this.fail("unsupported");return}this.loading=!0,this.options.changed();let engine=null,owned=!1;try{if(engine=await panoramaLoader.create(),!current()){engine?.dispose();return}if(!engine){this.fail("unavailable");return}if(this.engine=engine,owned=!0,await engine.mount(container,{hover:index=>{current()&&this.ready&&this.command(()=>engine.setState?.({selected:new Set,dimmed:new Set,hover:index??-1,focus:this.cursor}))},pick:index=>{current()&&this.ready&&index!==null&&this.activate(index)},camera:value=>{current()&&this.ready&&(this.camera=normalizePanoramaCamera(value),this.options.camera(this.camera))},lost:reason=>{current()&&this.fail(reason)},restored:()=>{!current()||!this.engine||!this.selection.restore()||this.command(()=>{engine.setStyle(this.style()),current()&&(engine.setCamera(this.camera),current()&&(engine.setState?.({selected:new Set,dimmed:new Set,hover:-1,focus:this.cursor}),current()&&(this.ready=!0,this.notice=null,this.options.changed())))})},rendering:value=>{current()&&(this.software=value.software,this.options.changed())}}),!current()||(engine.setStyle(this.style()),!current()))return;const angles=new Float32Array(hotspots.length*2);if(hotspots.forEach((hotspot,index)=>{angles[index*2]=hotspot.yaw,angles[index*2+1]=hotspot.pitch}),engine.setData({source:media.localName==="video"?{kind:"video",video:media}:{kind:"image",image:media},hotspotAngles:angles},++this.revision),!current()||(engine.setCamera(this.camera),!current()))return;const resize=()=>{if(!current())return;const box=container.getBoundingClientRect();engine.resize(Math.max(1,box.width),Math.max(1,box.height))};if(resize(),!current())return;const view=owner.defaultView;view?.ResizeObserver&&(this.resize=new view.ResizeObserver(()=>{current()&&this.ready&&this.command(resize)}),this.resize.observe(container));const restyle=()=>{current()&&this.ready&&this.command(()=>engine.setStyle(this.style()))};if(view?.MutationObserver){this.theme=new view.MutationObserver(restyle);let ancestor=this.host;for(;ancestor;){this.theme.observe(ancestor,{attributes:!0});const root=ancestor.getRootNode();ancestor=ancestor.parentElement??(root instanceof view.ShadowRoot?root.host:null)}}for(const query of["(prefers-reduced-motion: reduce)","(forced-colors: active)","(prefers-color-scheme: dark)"]){const mediaQuery=view?.matchMedia(query);mediaQuery?.addEventListener("change",restyle),mediaQuery&&this.cleanups.push(()=>mediaQuery.removeEventListener("change",restyle))}this.pending=this.loading=!1,this.ready=this.selection.renderer==="webgl",this.options.changed()}catch(error){if(!current()){owned||engine?.dispose();return}this.fail(engine3dFailureReason(error))}}style(){const view=this.host.ownerDocument.defaultView,computed=view.getComputedStyle(this.host),canvas=this.host.ownerDocument.createElement("canvas");canvas.width=canvas.height=1;const context=canvas.getContext("2d",{willReadFrequently:!0}),color=name=>{const value=resolveCanvasColor(this.host,`var(${name})`,computed.color);if(!context)return value;context.clearRect(0,0,1,1),context.fillStyle=value,context.fillRect(0,0,1,1);const rgba=context.getImageData(0,0,1,1).data;return`rgba(${rgba[0]}, ${rgba[1]}, ${rgba[2]}, ${rgba[3]/255})`};return{background:color("--lr-color-surface"),foreground:color("--lr-color-text"),muted:color("--lr-color-text-quiet"),accent:color("--lr-color-brand"),focus:color("--lr-focus-ring-color"),palette:[color("--lr-color-brand")],fontFamily:computed.fontFamily,fontSize:finiteRange(Number.parseFloat(computed.fontSize),14,1,128),pointSize:24,lineWidth:1,devicePixelRatio:finiteRange(view.devicePixelRatio,1,.25,4),reducedMotion:view.matchMedia("(prefers-reduced-motion: reduce)").matches,forcedColors:view.matchMedia("(forced-colors: active)").matches}}activate(index){const hotspot=this.hotspots[index];!hotspot||!Number.isSafeInteger(index)||(this.cursor=index,this.options.changed(),this.options.pick({hotspot,id:hotspot.id,index}))}keydown(event,direction){if(!this.ready||event.target!==event.currentTarget)return;const sign=direction==="rtl"?-1:1;let{yaw,pitch,fieldOfView}=this.camera;switch(event.key){case"ArrowLeft":yaw-=sign*Math.PI/18;break;case"ArrowRight":yaw+=sign*Math.PI/18;break;case"ArrowUp":pitch+=Math.PI/18;break;case"ArrowDown":pitch-=Math.PI/18;break;case"+":case"=":fieldOfView-=5;break;case"-":case"_":fieldOfView+=5;break;case"Home":yaw=pitch=0,fieldOfView=75;break;default:return}event.preventDefault(),event.stopPropagation(),this.camera=normalizePanoramaCamera({yaw,pitch,fieldOfView});const generation=this.generation;this.command(()=>this.engine?.setCamera(this.camera)),generation===this.generation&&this.ready&&this.options.camera(this.camera)}renderViewport(label,enabled){return enabled?html`<div part="panorama" role="group" aria-label=${label} aria-description=${this.options.localize("panoramaInstructions")}
1
+ import{html,nothing}from"lit";import{literalSetConverter}from"./converters.js";import{snapshotPublicCollection}from"./collection-snapshot.js";import{isObjectValue,readOwnDataValue}from"./data-descriptors.js";import{finiteRange}from"./numbers.js";import{createEngine3dLoader}from"./engine-3d-loader.js";import{Engine3dSelection,ENGINE_3D_REASON_MESSAGE,ENGINE_3D_SHOWING_MESSAGE,engine3dFailureReason,webgl2Available}from"./engine-3d.js";import{AnnouncementSinkController}from"./announcer.js";import{isAccessibilityVisible}from"./accessibility-visibility.js";import{resolveCanvasColor}from"./canvas-color.js";import{tag}from"./prefix.js";const PANORAMA_PROJECTION=literalSetConverter(["flat","equirectangular"],"flat"),PANORAMA_DEFAULT_CAMERA=Object.freeze({yaw:0,pitch:0,fieldOfView:75}),panoramaLoader=createEngine3dLoader({entry:"panorama",tag:tag("image-viewer"),load:()=>(async()=>{try{return await import("@aceshooting/lyra-3d/panorama")}catch(e){throw e}})()}),panoramaEnvironment={available:owner=>webgl2Available(()=>owner.createElement("canvas"))};function normalizePanoramaCamera(value){if(!isObjectValue(value))return PANORAMA_DEFAULT_CAMERA;const number=key=>{const entry=readOwnDataValue(value,key);return typeof entry=="number"?entry:NaN},yaw=finiteRange(number("yaw"),0);return Object.freeze({yaw:((yaw+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI,pitch:finiteRange(number("pitch"),0,-Math.PI/2+.01,Math.PI/2-.01),fieldOfView:finiteRange(number("fieldOfView"),75,20,100)})}function snapshotPanoramaHotspots(value,owner){const source=snapshotPublicCollection(value,owner);if(!Array.isArray(source))return Object.freeze([]);const seen=new Set,result=[];for(const item of source){const id=readOwnDataValue(item,"id"),yaw=readOwnDataValue(item,"yaw"),pitch=readOwnDataValue(item,"pitch"),label=readOwnDataValue(item,"label");typeof id!="string"||!id.trim()||seen.has(id)||typeof yaw!="number"||!Number.isFinite(yaw)||typeof pitch!="number"||!Number.isFinite(pitch)||Math.abs(pitch)>Math.PI/2||(seen.add(id),result.push(Object.freeze({id,yaw:normalizePanoramaCamera({yaw}).yaw,pitch,...typeof label=="string"?{label}:{}})))}return Object.freeze(result)}function disposePanoramaEngine(engine){try{engine?.dispose()}catch{}}class PanoramaController{constructor(host,options){this.host=host,this.options=options,this.selection=new Engine3dSelection(!0),this.ready=!1,this.loading=!1,this.notice=null,this.software=!1,this.enabled=!1,this.media=null,this.mediaRevision=-1,this.hotspots=[],this.camera=PANORAMA_DEFAULT_CAMERA,this.container=null,this.generation=0,this.revision=0,this.attempted=!1,this.pending=!1,this.intersecting=!1,this.cleanups=[],this.cursor=0,this.announcements=new AnnouncementSinkController(host,{eager:["assertive"]})}release(){this.generation++,this.intersection?.disconnect(),this.intersection=void 0,this.eligibility?.disconnect(),this.eligibility=void 0,this.intersecting=!1,this.resize?.disconnect(),this.resize=void 0,this.theme?.disconnect(),this.theme=void 0;for(const cleanup of this.cleanups)cleanup();this.cleanups=[];const engine=this.engine;this.engine=void 0,this.ready=this.loading=this.pending=!1,disposePanoramaEngine(engine)}invalidate(){this.release(),this.attempted=!1,this.notice=null,this.software=!1,this.selection.prefer(this.enabled?"webgl":"builtin")}disconnect(){this.invalidate(),this.media=null,this.container=null}adopted(){this.disconnect(),this.announcements.adopted()}update(enabled,media,mediaRevision,hotspots,camera,container){(enabled!==this.enabled||media!==this.media||mediaRevision!==this.mediaRevision||hotspots!==this.hotspots||container!==this.container)&&(this.invalidate(),this.enabled=enabled,this.media=media,this.mediaRevision=mediaRevision,this.hotspots=hotspots,this.container=container,this.cursor=Math.min(this.cursor,Math.max(0,hotspots.length-1)),this.selection.prefer(enabled?"webgl":"builtin"),this.options.changed());const cameraChanged=camera!==this.camera;if(this.camera=camera,!enabled||!media||!container||!this.host.isConnected)return;if(this.ready){cameraChanged&&this.command(()=>this.engine?.setCamera(camera));return}if(this.pending||this.attempted||this.intersection||this.eligibility)return;const view=this.host.ownerDocument.defaultView,generation=this.generation;this.intersecting=view?.IntersectionObserver===void 0;const admit=()=>{generation!==this.generation||this.pending||this.attempted||!this.intersecting||!isAccessibilityVisible(this.host)||(this.intersection?.disconnect(),this.intersection=void 0,this.eligibility?.disconnect(),this.eligibility=void 0,this.start())};if(view?.IntersectionObserver&&(this.intersection=new view.IntersectionObserver(entries=>{if(generation===this.generation){for(const entry of entries)entry.target===container&&(this.intersecting=entry.isIntersecting);admit()}}),this.intersection.observe(container)),view?.MutationObserver){this.eligibility=new view.MutationObserver(admit);let ancestor=this.host,depth=0;for(;ancestor&&depth++<=256;){this.eligibility.observe(ancestor,{attributes:!0,attributeFilter:["aria-hidden","inert","hidden","style","class","open"]});const root=ancestor.getRootNode();ancestor=ancestor.assignedSlot??ancestor.parentElement??(root instanceof view.ShadowRoot?root.host:null)}}admit()}fail(reason){const detail=this.selection.renderer==="webgl"?this.selection.fail(reason):null;this.ready=this.loading=!1,reason!=="context-lost"&&(this.release(),this.attempted=!0),detail&&(this.notice=detail,this.options.changed(),this.announcements.announceAssertive(this.options.localize(ENGINE_3D_REASON_MESSAGE[detail.reason])),this.announcements.announcePolite(this.options.localize(ENGINE_3D_SHOWING_MESSAGE[detail.to])),this.options.fallback(detail))}command(run){const generation=this.generation,engine=this.engine;try{run()}catch{generation===this.generation&&engine===this.engine&&this.fail("error")}}async start(){const owner=this.host.ownerDocument,container=this.container,media=this.media,hotspots=this.hotspots;if(!this.enabled||!container||!media||!this.host.isConnected)return;const generation=this.generation,current=()=>generation===this.generation&&this.host.isConnected&&this.host.ownerDocument===owner;if(this.pending=this.attempted=!0,!panoramaEnvironment.available(owner)){this.fail("unsupported");return}this.loading=!0,this.options.changed();let engine=null,owned=!1;try{if(engine=await panoramaLoader.create(),!current()){disposePanoramaEngine(engine);return}if(!engine){this.fail("unavailable");return}if(this.engine=engine,owned=!0,await engine.mount(container,{hover:index=>{current()&&this.ready&&this.command(()=>engine.setState?.({selected:new Set,dimmed:new Set,hover:index??-1,focus:this.cursor}))},pick:index=>{current()&&this.ready&&index!==null&&this.activate(index)},camera:value=>{current()&&this.ready&&(this.camera=normalizePanoramaCamera(value),this.options.camera(this.camera))},lost:reason=>{current()&&this.fail(reason)},restored:()=>{!current()||!this.engine||!this.selection.restore()||this.command(()=>{engine.setStyle(this.style()),current()&&(engine.setCamera(this.camera),current()&&(engine.setState?.({selected:new Set,dimmed:new Set,hover:-1,focus:this.cursor}),current()&&(this.ready=!0,this.notice=null,this.options.changed())))})},rendering:value=>{current()&&(this.software=value.software,this.options.changed())}}),!current()||(engine.setStyle(this.style()),!current()))return;const angles=new Float32Array(hotspots.length*2);if(hotspots.forEach((hotspot,index)=>{angles[index*2]=hotspot.yaw,angles[index*2+1]=hotspot.pitch}),engine.setData({source:media.localName==="video"?{kind:"video",video:media}:{kind:"image",image:media},hotspotAngles:angles},++this.revision),!current()||(engine.setCamera(this.camera),!current()))return;const resize=()=>{if(!current())return;const box=container.getBoundingClientRect();engine.resize(Math.max(1,box.width),Math.max(1,box.height))};if(resize(),!current())return;const view=owner.defaultView;view?.ResizeObserver&&(this.resize=new view.ResizeObserver(()=>{current()&&this.ready&&this.command(resize)}),this.resize.observe(container));const restyle=()=>{current()&&this.ready&&this.command(()=>engine.setStyle(this.style()))};if(view?.MutationObserver){this.theme=new view.MutationObserver(restyle);let ancestor=this.host;for(;ancestor;){this.theme.observe(ancestor,{attributes:!0});const root=ancestor.getRootNode();ancestor=ancestor.parentElement??(root instanceof view.ShadowRoot?root.host:null)}}for(const query of["(prefers-reduced-motion: reduce)","(forced-colors: active)","(prefers-color-scheme: dark)"]){const mediaQuery=view?.matchMedia(query);mediaQuery?.addEventListener("change",restyle),mediaQuery&&this.cleanups.push(()=>mediaQuery.removeEventListener("change",restyle))}this.pending=this.loading=!1,this.ready=this.selection.renderer==="webgl",this.options.changed()}catch(error){if(!current()){owned||disposePanoramaEngine(engine);return}this.fail(engine3dFailureReason(error))}}style(){const view=this.host.ownerDocument.defaultView,computed=view.getComputedStyle(this.host),canvas=this.host.ownerDocument.createElement("canvas");canvas.width=canvas.height=1;const context=canvas.getContext("2d",{willReadFrequently:!0}),color=name=>{const value=resolveCanvasColor(this.host,`var(${name})`,computed.color);if(!context)return value;context.clearRect(0,0,1,1),context.fillStyle=value,context.fillRect(0,0,1,1);const rgba=context.getImageData(0,0,1,1).data;return`rgba(${rgba[0]}, ${rgba[1]}, ${rgba[2]}, ${rgba[3]/255})`};return{background:color("--lr-color-surface"),foreground:color("--lr-color-text"),muted:color("--lr-color-text-quiet"),accent:color("--lr-color-brand"),focus:color("--lr-focus-ring-color"),palette:[color("--lr-color-brand")],fontFamily:computed.fontFamily,fontSize:finiteRange(Number.parseFloat(computed.fontSize),14,1,128),pointSize:24,lineWidth:1,devicePixelRatio:finiteRange(view.devicePixelRatio,1,.25,4),reducedMotion:view.matchMedia("(prefers-reduced-motion: reduce)").matches,forcedColors:view.matchMedia("(forced-colors: active)").matches}}activate(index){const hotspot=this.hotspots[index];!hotspot||!Number.isSafeInteger(index)||(this.cursor=index,this.options.changed(),this.options.pick({hotspot,id:hotspot.id,index}))}keydown(event,direction){if(!this.ready||event.target!==event.currentTarget)return;const sign=direction==="rtl"?-1:1;let{yaw,pitch,fieldOfView}=this.camera;switch(event.key){case"ArrowLeft":yaw-=sign*Math.PI/18;break;case"ArrowRight":yaw+=sign*Math.PI/18;break;case"ArrowUp":pitch+=Math.PI/18;break;case"ArrowDown":pitch-=Math.PI/18;break;case"+":case"=":fieldOfView-=5;break;case"-":case"_":fieldOfView+=5;break;case"Home":yaw=pitch=0,fieldOfView=75;break;default:return}event.preventDefault(),event.stopPropagation(),this.camera=normalizePanoramaCamera({yaw,pitch,fieldOfView});const generation=this.generation;this.command(()=>this.engine?.setCamera(this.camera)),generation===this.generation&&this.ready&&this.options.camera(this.camera)}renderViewport(label,enabled){return enabled?html`<div part="panorama" role="group" aria-label=${label} aria-description=${this.options.localize("panoramaInstructions")}
2
2
  tabindex=${this.ready?"0":"-1"} ?data-ready=${this.ready} ?hidden=${this.notice!==null}
3
3
  @keydown=${event=>this.keydown(event,this.options.direction())}><div part="panorama-engine" aria-hidden="true"></div></div>`:nothing}renderNotice(){const notice=this.notice;return notice?html`<div part="panorama-notice"><p>${this.options.localize(ENGINE_3D_REASON_MESSAGE[notice.reason])}</p><p>${this.options.localize(ENGINE_3D_SHOWING_MESSAGE[notice.to])}</p></div>`:!this.loading&&!this.software?nothing:html`<p part="panorama-notice">${this.options.localize(this.loading?"engine3dLoading":"engine3dSoftwareRendering")}</p>`}renderHotspots(enabled){if(!enabled||!this.hotspots.length)return nothing;const start=Math.floor(this.cursor/200)*200,end=Math.min(this.hotspots.length,start+200),generation=this.generation,current=()=>this.host.isConnected&&generation===this.generation,move=(index,focus=!1)=>{current()&&(this.cursor=Math.max(0,Math.min(this.hotspots.length-1,index)),this.options.changed(),this.ready&&this.command(()=>this.engine?.setState?.({selected:new Set,dimmed:new Set,hover:-1,focus:this.cursor})),focus&&this.options.updated().then(()=>{current()&&this.host.shadowRoot?.querySelector(`[data-panorama-index="${this.cursor}"]`)?.focus()}))};return html`<div part="panorama-hotspots" role="group" aria-label=${this.options.localize("panoramaHotspotsLabel")}>
4
4
  ${this.hotspots.slice(start,end).map((hotspot,offset)=>{const index=start+offset;return html`<button part="panorama-hotspot" type="button" data-panorama-index=${index} tabindex=${index===this.cursor?"0":"-1"}
@@ -1 +1 @@
1
- const LYRA_PACKAGE_NAME="@aceshooting/lyra-ui",LYRA_PACKAGE_VERSION="30.9.0";export{LYRA_PACKAGE_NAME,LYRA_PACKAGE_VERSION};
1
+ const LYRA_PACKAGE_NAME="@aceshooting/lyra-ui",LYRA_PACKAGE_VERSION="31.0.0";export{LYRA_PACKAGE_NAME,LYRA_PACKAGE_VERSION};
@@ -1 +1 @@
1
- const SAFE_RESOURCE_SCHEMES=new Set(["http:","https:","blob:","data:"]),SAFE_DOWNLOAD_SCHEMES=new Set(["http:","https:","blob:"]),SAFE_LINK_SCHEMES=new Set(["http:","https:","blob:","mailto:"]),PARSE_BASE="https://lyra.invalid/";function safeUrlOrNull(url,allowedSchemes,URLCtor){if(typeof url!="string")return null;const trimmed=url.trim();if(trimmed==="")return null;try{const protocol=new URLCtor(trimmed,PARSE_BASE).protocol;return allowedSchemes.has(protocol)?trimmed:null}catch{return null}}function safeMediaSrc(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_RESOURCE_SCHEMES,URLCtor)}function safeFetchUrl(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_RESOURCE_SCHEMES,URLCtor)}function safeLinkHref(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_LINK_SCHEMES,URLCtor)}function safeDownloadHref(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_DOWNLOAD_SCHEMES,URLCtor)}const SAFE_DOCUMENT_NAVIGATION_SCHEMES=new Set(["http:","https:"]);function safeDocumentNavigationUrl(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_DOCUMENT_NAVIGATION_SCHEMES,URLCtor)}function safeFrameSrc(url,URLCtor=URL){return safeDocumentNavigationUrl(url,URLCtor)}export{safeDocumentNavigationUrl,safeDownloadHref,safeFetchUrl,safeFrameSrc,safeLinkHref,safeMediaSrc};
1
+ const SAFE_RESOURCE_SCHEMES=new Set(["http:","https:","blob:","data:"]),SAFE_DOWNLOAD_SCHEMES=new Set(["http:","https:","blob:"]),SAFE_LINK_SCHEMES=new Set(["http:","https:","blob:","mailto:"]),PARSE_BASE="https://lyra.invalid/";function safeUrlOrNull(url,allowedSchemes,URLCtor){if(typeof url!="string")return null;const trimmed=url.trim();if(trimmed==="")return null;try{const protocol=new URLCtor(trimmed,PARSE_BASE).protocol;return allowedSchemes.has(protocol)?trimmed:null}catch{return null}}function safeMediaSrc(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_RESOURCE_SCHEMES,URLCtor)}function safeFetchUrl(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_RESOURCE_SCHEMES,URLCtor)}function safeLinkHref(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_LINK_SCHEMES,URLCtor)}function safeDownloadHref(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_DOWNLOAD_SCHEMES,URLCtor)}const SAFE_ACTION_LINK_SCHEMES=new Set([...SAFE_LINK_SCHEMES,"tel:","sms:"]);function safeActionLinkHref(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_ACTION_LINK_SCHEMES,URLCtor)}const SAFE_DOCUMENT_NAVIGATION_SCHEMES=new Set(["http:","https:"]);function safeDocumentNavigationUrl(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_DOCUMENT_NAVIGATION_SCHEMES,URLCtor)}function safeFrameSrc(url,URLCtor=URL){return safeDocumentNavigationUrl(url,URLCtor)}const RELATIVE_LINK_TOKEN="relative";function parseLinkSchemes(value){if(value==null)return null;const allowed=new Set;for(const raw of String(value).split(/[\s,]+/)){const token=raw.trim().toLowerCase().replace(/:$/,"");token===RELATIVE_LINK_TOKEN?allowed.add(RELATIVE_LINK_TOKEN):token!==""&&SAFE_LINK_SCHEMES.has(`${token}:`)&&allowed.add(`${token}:`)}return allowed}function safeLinkHrefWithin(url,allowed,URLCtor=URL){const safe=safeUrlOrNull(url,SAFE_LINK_SCHEMES,URLCtor);if(safe===null)return null;let protocol;try{protocol=new URLCtor(safe).protocol}catch{protocol=null}return protocol===null?allowed.has(RELATIVE_LINK_TOKEN)?safe:null:allowed.has(protocol)?safe:null}export{parseLinkSchemes,safeActionLinkHref,safeDocumentNavigationUrl,safeDownloadHref,safeFetchUrl,safeFrameSrc,safeLinkHref,safeLinkHrefWithin,safeMediaSrc};
@@ -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-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-chart-3d":["lr-chart-3d"],"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-map-anchor":["lr-map-anchor"],"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-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-model-viewer":["lr-model-viewer"],"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};
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-chart-3d":["lr-chart-3d"],"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-map-anchor":["lr-map-anchor"],"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-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-model-viewer":["lr-model-viewer"],"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-icon","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};
@@ -1 +1 @@
1
- import{isRtl}from"./rtl.js";const SCROLL_OVERFLOW_ATTRIBUTE="data-scroll-overflow",SCROLL_START_ATTRIBUTE="data-scroll-start",SCROLL_END_ATTRIBUTE="data-scroll-end",TOLERANCE_PX=1;class ScrollOverflowController{#observer;#observed;#ownerWindow;#scrollTarget;#onScroll=()=>this.measure();constructor(host,resolve,onResize){this.resolve=resolve,this.onResize=onResize,host.addController(this)}hostConnected(){this.sync()}hostUpdated(){this.sync()}sync(){const element=this.resolve(),ownerWindow=element?.ownerDocument.defaultView??void 0;if(element!==this.#observed||ownerWindow!==this.#ownerWindow){this.resetObservation(),this.#observed=element??void 0,this.#ownerWindow=ownerWindow,element&&(element.addEventListener("scroll",this.#onScroll,{passive:!0}),this.#scrollTarget=element);const ResizeObserverConstructor=ownerWindow?.ResizeObserver;if(element&&ResizeObserverConstructor){const observer=new ResizeObserverConstructor(()=>{this.#observer!==observer||this.#observed!==element||element.ownerDocument.defaultView!==ownerWindow||(this.measure(),this.onResize?.())});this.#observer=observer,observer.observe(element)}}this.measure()}hostDisconnected(){this.resetObservation()}resetObservation(){this.#observer?.disconnect(),this.#observer=void 0,this.#observed=void 0,this.#ownerWindow=void 0,this.#scrollTarget?.removeEventListener("scroll",this.#onScroll),this.#scrollTarget=void 0}measure(){const element=this.#observed;if(!element)return;const extent=Math.max(0,element.scrollWidth-element.clientWidth),overflows=extent>TOLERANCE_PX;if(element.toggleAttribute(SCROLL_OVERFLOW_ATTRIBUTE,overflows),!overflows){element.toggleAttribute(SCROLL_START_ATTRIBUTE,!1),element.toggleAttribute(SCROLL_END_ATTRIBUTE,!1);return}const raw=isRtl(element)?-element.scrollLeft:element.scrollLeft,position=Math.max(0,Math.min(extent,raw));element.toggleAttribute(SCROLL_START_ATTRIBUTE,position>TOLERANCE_PX),element.toggleAttribute(SCROLL_END_ATTRIBUTE,position<extent-TOLERANCE_PX)}observeExtra(elements){if(this.#observer)for(const element of elements)this.#observer.observe(element)}}function observeScrollOverflow(host,resolve,onResize){return new ScrollOverflowController(host,resolve,onResize)}export{SCROLL_END_ATTRIBUTE,SCROLL_OVERFLOW_ATTRIBUTE,SCROLL_START_ATTRIBUTE,ScrollOverflowController,observeScrollOverflow};
1
+ import{isRtl}from"./rtl.js";const SCROLL_OVERFLOW_ATTRIBUTE="data-scroll-overflow",SCROLL_START_ATTRIBUTE="data-scroll-start",SCROLL_END_ATTRIBUTE="data-scroll-end",TOLERANCE_PX=1;class ScrollOverflowController{#observer;#observed;#ownerWindow;#scrollTarget;#onScroll=()=>this.measure();constructor(host,resolve,onResize){this.resolve=resolve,this.onResize=onResize,host.addController(this)}hostConnected(){this.sync()}hostUpdated(){this.sync()}sync(){const resolved=this.resolve(),element=resolved?.isConnected?resolved:void 0,ownerWindow=element?.ownerDocument.defaultView??void 0;if(element!==this.#observed||ownerWindow!==this.#ownerWindow){this.resetObservation(),this.#observed=element??void 0,this.#ownerWindow=ownerWindow,element&&(element.addEventListener("scroll",this.#onScroll,{passive:!0}),this.#scrollTarget=element);const ResizeObserverConstructor=ownerWindow?.ResizeObserver;if(element&&ResizeObserverConstructor){const observer=new ResizeObserverConstructor(()=>{this.#observer!==observer||this.#observed!==element||element.ownerDocument.defaultView!==ownerWindow||(this.measure(),this.onResize?.())});this.#observer=observer,observer.observe(element)}}this.measure()}hostDisconnected(){this.resetObservation()}resetObservation(){this.#observer?.disconnect(),this.#observer=void 0,this.#observed=void 0,this.#ownerWindow=void 0,this.#scrollTarget?.removeEventListener("scroll",this.#onScroll),this.#scrollTarget=void 0}measure(){const element=this.#observed;if(!element)return;const extent=Math.max(0,element.scrollWidth-element.clientWidth),overflows=extent>TOLERANCE_PX;if(element.toggleAttribute(SCROLL_OVERFLOW_ATTRIBUTE,overflows),!overflows){element.toggleAttribute(SCROLL_START_ATTRIBUTE,!1),element.toggleAttribute(SCROLL_END_ATTRIBUTE,!1);return}const raw=isRtl(element)?-element.scrollLeft:element.scrollLeft,position=Math.max(0,Math.min(extent,raw));element.toggleAttribute(SCROLL_START_ATTRIBUTE,position>TOLERANCE_PX),element.toggleAttribute(SCROLL_END_ATTRIBUTE,position<extent-TOLERANCE_PX)}observeExtra(elements){if(this.#observer)for(const element of elements)this.#observer.observe(element)}}function observeScrollOverflow(host,resolve,onResize){return new ScrollOverflowController(host,resolve,onResize)}export{SCROLL_END_ATTRIBUTE,SCROLL_OVERFLOW_ATTRIBUTE,SCROLL_START_ATTRIBUTE,ScrollOverflowController,observeScrollOverflow};