@nvidia-elements/core 2.0.1 → 2.0.2

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 (167) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +1 -1
  3. package/dist/_virtual/{_@oxc-project_runtime@0.132.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/decorate.js +1 -1
  4. package/dist/accordion/accordion2.js +5 -5
  5. package/dist/alert/alert-group2.js +2 -2
  6. package/dist/alert/alert2.js +2 -2
  7. package/dist/avatar/avatar-group2.js +1 -1
  8. package/dist/avatar/avatar2.js +2 -2
  9. package/dist/badge/badge2.js +2 -2
  10. package/dist/breadcrumb/breadcrumb2.js +2 -2
  11. package/dist/bundles/index.d.ts +1 -11
  12. package/dist/bundles/index.js +6 -6
  13. package/dist/button/button2.js +2 -2
  14. package/dist/button-group/button-group2.js +2 -2
  15. package/dist/card/card2.js +5 -5
  16. package/dist/chat-message/chat-message2.js +2 -2
  17. package/dist/checkbox/checkbox-group2.js +2 -2
  18. package/dist/checkbox/checkbox2.js +2 -2
  19. package/dist/color/color2.js +2 -2
  20. package/dist/combobox/combobox2.js +8 -8
  21. package/dist/copy-button/copy-button2.js +2 -2
  22. package/dist/custom-elements.json +168 -733
  23. package/dist/data.snippets.json +27 -27
  24. package/dist/date/date2.js +2 -2
  25. package/dist/datetime/datetime2.js +2 -2
  26. package/dist/dialog/dialog-footer2.js +2 -2
  27. package/dist/dialog/dialog-header2.js +2 -2
  28. package/dist/dialog/dialog2.js +2 -2
  29. package/dist/divider/divider2.js +2 -2
  30. package/dist/dot/dot2.js +2 -2
  31. package/dist/drawer/drawer-content2.js +2 -2
  32. package/dist/drawer/drawer-footer2.js +2 -2
  33. package/dist/drawer/drawer-header2.js +2 -2
  34. package/dist/drawer/drawer2.js +2 -2
  35. package/dist/dropdown/dropdown-footer2.js +2 -2
  36. package/dist/dropdown/dropdown-header2.js +2 -2
  37. package/dist/dropdown/dropdown2.js +2 -2
  38. package/dist/dropdown-group/dropdown-group.js +2 -2
  39. package/dist/dropzone/dropzone2.js +2 -2
  40. package/dist/file/file2.js +1 -1
  41. package/dist/format-datetime/format-datetime2.js +2 -2
  42. package/dist/format-number/format-number2.js +2 -2
  43. package/dist/format-relative-time/format-relative-time2.js +6 -3
  44. package/dist/format-relative-time/format-relative-time2.js.map +1 -1
  45. package/dist/forms/control/control.js +1 -1
  46. package/dist/forms/control/control.js.map +1 -1
  47. package/dist/forms/control/control2.js +39 -21
  48. package/dist/forms/control/control2.js.map +1 -1
  49. package/dist/forms/control-group/control-group.js +1 -1
  50. package/dist/forms/control-group/control-group.js.map +1 -1
  51. package/dist/forms/control-group/control-group2.js +2 -2
  52. package/dist/forms/control-group/control-group2.js.map +1 -1
  53. package/dist/forms/control-message/control-message2.js +2 -2
  54. package/dist/forms/utils/states.d.ts +6 -3
  55. package/dist/forms/utils/states.js +40 -32
  56. package/dist/forms/utils/states.js.map +1 -1
  57. package/dist/grid/cell/cell2.js +1 -1
  58. package/dist/grid/column/column2.js +2 -2
  59. package/dist/grid/footer/footer2.js +2 -2
  60. package/dist/grid/grid2.js +2 -2
  61. package/dist/grid/header/header2.js +2 -2
  62. package/dist/grid/placeholder/placeholder2.js +1 -1
  63. package/dist/grid/row/row2.js +2 -2
  64. package/dist/icon/icon2.js +3 -3
  65. package/dist/icon-button/icon-button2.js +2 -2
  66. package/dist/index.js +1 -1
  67. package/dist/input/input-group2.js +1 -1
  68. package/dist/input/input2.js +2 -2
  69. package/dist/internal/controllers/keynav-grid.controller.js +22 -18
  70. package/dist/internal/controllers/keynav-grid.controller.js.map +1 -1
  71. package/dist/internal/controllers/keynav-list.controller.d.ts +1 -0
  72. package/dist/internal/controllers/keynav-list.controller.js +6 -1
  73. package/dist/internal/controllers/keynav-list.controller.js.map +1 -1
  74. package/dist/internal/controllers/type-native-popover.controller.js +70 -40
  75. package/dist/internal/controllers/type-native-popover.controller.js.map +1 -1
  76. package/dist/internal/index.d.ts +0 -9
  77. package/dist/internal/index.js +20 -29
  78. package/dist/internal/services/global.service.js +1 -1
  79. package/dist/internal/services/log.service.js +1 -1
  80. package/dist/internal/services/log.service.js.map +1 -1
  81. package/dist/internal/types/index.d.ts +3 -0
  82. package/dist/internal/types/index.js.map +1 -1
  83. package/dist/internal/utils/dom.d.ts +1 -1
  84. package/dist/internal/utils/dom.js +71 -54
  85. package/dist/internal/utils/dom.js.map +1 -1
  86. package/dist/logo/logo2.js +2 -2
  87. package/dist/menu/menu-item2.js +2 -2
  88. package/dist/menu/menu2.js +2 -2
  89. package/dist/month/month2.js +2 -2
  90. package/dist/notification/notification-group2.js +2 -2
  91. package/dist/notification/notification2.js +2 -2
  92. package/dist/page/page-panel/page-panel-content2.js +1 -1
  93. package/dist/page/page-panel/page-panel-footer2.js +2 -2
  94. package/dist/page/page-panel/page-panel-header2.js +2 -2
  95. package/dist/page/page-panel/page-panel2.js +2 -2
  96. package/dist/page/page2.js +2 -2
  97. package/dist/page-header/page-header2.js +1 -1
  98. package/dist/page-loader/page-loader2.js +2 -2
  99. package/dist/pagination/pagination2.js +2 -2
  100. package/dist/panel/panel2.js +5 -5
  101. package/dist/password/password2.js +2 -2
  102. package/dist/preferences-input/preferences-input2.js +2 -2
  103. package/dist/progress-bar/progress-bar2.js +2 -2
  104. package/dist/progress-ring/progress-ring2.js +2 -2
  105. package/dist/progressive-filter-chip/progressive-filter-chip2.js +2 -2
  106. package/dist/pulse/pulse2.js +2 -2
  107. package/dist/radio/radio-group2.js +2 -2
  108. package/dist/radio/radio2.js +2 -2
  109. package/dist/range/range2.js +2 -2
  110. package/dist/resize-handle/resize-handle2.js +2 -2
  111. package/dist/search/search2.js +2 -2
  112. package/dist/select/select2.js +35 -21
  113. package/dist/select/select2.js.map +1 -1
  114. package/dist/skeleton/skeleton2.js +2 -2
  115. package/dist/sort-button/sort-button2.js +2 -2
  116. package/dist/sparkline/sparkline.utils.js +4 -2
  117. package/dist/sparkline/sparkline.utils.js.map +1 -1
  118. package/dist/sparkline/sparkline2.js +2 -2
  119. package/dist/star-rating/star-rating2.js +2 -2
  120. package/dist/steps/steps2.js +3 -3
  121. package/dist/switch/switch-group2.js +2 -2
  122. package/dist/switch/switch2.js +2 -2
  123. package/dist/tabs/tabs-group2.js +2 -2
  124. package/dist/tabs/tabs2.js +3 -3
  125. package/dist/tag/tag2.js +2 -2
  126. package/dist/textarea/textarea2.js +1 -1
  127. package/dist/time/time2.js +2 -2
  128. package/dist/toast/toast2.js +2 -2
  129. package/dist/toggletip/toggletip-footer2.js +2 -2
  130. package/dist/toggletip/toggletip-header2.js +2 -2
  131. package/dist/toggletip/toggletip2.js +2 -2
  132. package/dist/toolbar/toolbar2.js +2 -2
  133. package/dist/tooltip/tooltip2.js +2 -2
  134. package/dist/tree/tree-node2.js +2 -2
  135. package/dist/tree/tree2.js +2 -2
  136. package/dist/week/week2.js +2 -2
  137. package/package.json +9 -9
  138. package/dist/internal/controllers/state-active.controller.d.ts +0 -18
  139. package/dist/internal/controllers/state-active.controller.js +0 -29
  140. package/dist/internal/controllers/state-active.controller.js.map +0 -1
  141. package/dist/internal/controllers/state-current.controller.d.ts +0 -18
  142. package/dist/internal/controllers/state-current.controller.js +0 -28
  143. package/dist/internal/controllers/state-current.controller.js.map +0 -1
  144. package/dist/internal/controllers/state-disabled.controller.d.ts +0 -18
  145. package/dist/internal/controllers/state-disabled.controller.js +0 -20
  146. package/dist/internal/controllers/state-disabled.controller.js.map +0 -1
  147. package/dist/internal/controllers/state-pressed.controller.d.ts +0 -18
  148. package/dist/internal/controllers/state-pressed.controller.js +0 -20
  149. package/dist/internal/controllers/state-pressed.controller.js.map +0 -1
  150. package/dist/internal/controllers/type-button.controller.d.ts +0 -18
  151. package/dist/internal/controllers/type-button.controller.examples.js +0 -6
  152. package/dist/internal/controllers/type-button.controller.examples.js.map +0 -1
  153. package/dist/internal/controllers/type-button.controller.examples.json +0 -16
  154. package/dist/internal/controllers/type-button.controller.js +0 -21
  155. package/dist/internal/controllers/type-button.controller.js.map +0 -1
  156. package/dist/internal/controllers/type-command.controller.d.ts +0 -25
  157. package/dist/internal/controllers/type-command.controller.js +0 -38
  158. package/dist/internal/controllers/type-command.controller.js.map +0 -1
  159. package/dist/internal/controllers/type-interest.controller.d.ts +0 -23
  160. package/dist/internal/controllers/type-interest.controller.js +0 -51
  161. package/dist/internal/controllers/type-interest.controller.js.map +0 -1
  162. package/dist/internal/controllers/type-native-popover-trigger.controller.d.ts +0 -16
  163. package/dist/internal/controllers/type-native-popover-trigger.controller.js +0 -25
  164. package/dist/internal/controllers/type-native-popover-trigger.controller.js.map +0 -1
  165. package/dist/internal/controllers/type-submit.controller.d.ts +0 -22
  166. package/dist/internal/controllers/type-submit.controller.js +0 -49
  167. package/dist/internal/controllers/type-submit.controller.js.map +0 -1
@@ -12,32 +12,23 @@ import { KeynavCode as N, appendAnchorName as P, appendRootNodeStyle as F, apply
12
12
  import { KeyNavigationGridController as _e, getNextKeyGridItem as ve, keyNavigationGrid as ye } from "./controllers/keynav-grid.controller.js";
13
13
  import { KeyNavigationListController as be, getNextKeyListItem as xe, keyNavigationList as Se } from "./controllers/keynav-list.controller.js";
14
14
  import { associateAriaDescribedBy as Ce, associateAriaLabel as we, associateControlGroup as Te, associateDataList as Ee, associateLabel as De, attachInternals as Oe } from "./utils/a11y.js";
15
- import { StateActiveController as ke, stateActive as Ae } from "./controllers/state-active.controller.js";
16
- import { StateCurrentController as je, stateCurrent as Me } from "./controllers/state-current.controller.js";
17
- import { StateDisabledController as Ne, stateDisabled as Pe } from "./controllers/state-disabled.controller.js";
18
- import { StateExpandedController as Fe, stateExpanded as Ie } from "./controllers/state-expanded.controller.js";
19
- import { StateHighlightedController as Le, stateHighlighted as Re } from "./controllers/state-highlighted.controller.js";
20
- import { StateScrollController as ze, stateScroll as Be } from "./controllers/state-scroll.controller.js";
21
- import { StateSelectedController as Ve, stateSelected as He } from "./controllers/state-selected.controller.js";
22
- import { StatePressedController as Ue, statePressed as We } from "./controllers/state-pressed.controller.js";
23
- import { TypeAnchorController as Ge, typeAnchor as Ke } from "./controllers/type-anchor.controller.js";
24
- import { TypeClosableController as qe } from "./controllers/type-closable.controller.js";
25
- import { TypeCommandController as Je, typeCommand as Ye } from "./controllers/type-command.controller.js";
26
- import { TypeInterestController as Xe, typeInterest as Ze } from "./controllers/type-interest.controller.js";
27
- import { TypeExpandableController as Qe } from "./controllers/type-expandable.controller.js";
28
- import { TypeSelectableController as $e } from "./controllers/type-selectable.controller.js";
29
- import { TypeButtonController as et, typeButton as tt } from "./controllers/type-button.controller.js";
30
- import { TypeNativePopoverTriggerController as nt, typeNativePopoverTrigger as rt } from "./controllers/type-native-popover-trigger.controller.js";
31
- import { TypeNativePopoverController as it } from "./controllers/type-native-popover.controller.js";
32
- import { TypeSSRController as at, typeSSR as ot } from "./controllers/type-ssr.controller.js";
33
- import { createLightDismiss as st, onKeys as ct } from "./utils/keynav.js";
34
- import { TypeSubmitController as lt, typeSubmit as ut } from "./controllers/type-submit.controller.js";
35
- import { NveTouchEvent as dt, TypeTouchController as ft, typeTouch as pt } from "./controllers/type-touch.controller.js";
36
- import { hostAttr as mt } from "./decorators/host-attr.js";
37
- import { scopedRegistry as ht } from "./decorators/scoped-registry.js";
38
- import { colorStateStyles as gt, statusStateStyles as _t, supportStateStyles as vt, useStyles as yt } from "./styles/index.js";
39
- import { supportsCSSLegacyInsetArea as bt, supportsCSSPositionArea as xt, supportsNativeCSSAnchorPosition as St } from "./utils/supports.js";
40
- import { popoverStyles as Ct } from "./styles/popover2.js";
41
- import { TransitionService as wt } from "./services/transition.service.js";
42
- import { statusIcons as Tt } from "./types/index.js";
43
- export { p as AuditController, e as DOCS_URL, l as GlobalState, u as GlobalStateService, v as I18nController, g as I18nService, _ as I18nService_, _e as KeyNavigationGridController, be as KeyNavigationListController, N as KeynavCode, w as LogService, dt as NveTouchEvent, ke as StateActiveController, je as StateCurrentController, Ne as StateDisabledController, Fe as StateExpandedController, Le as StateHighlightedController, Ue as StatePressedController, ze as StateScrollController, Ve as StateSelectedController, wt as TransitionService, Ge as TypeAnchorController, et as TypeButtonController, qe as TypeClosableController, Je as TypeCommandController, Qe as TypeExpandableController, Xe as TypeInterestController, it as TypeNativePopoverController, nt as TypeNativePopoverTriggerController, at as TypeSSRController, $e as TypeSelectableController, lt as TypeSubmitController, ft as TypeTouchController, P as appendAnchorName, F as appendRootNodeStyle, I as applySlotContentStates, Ce as associateAriaDescribedBy, we as associateAriaLabel, Te as associateControlGroup, Ee as associateDataList, De as associateLabel, Oe as attachInternals, m as audit, d as auditParentElement, f as auditSlots, L as clickOutsideElementBounds, gt as colorStateStyles, R as createGhostElement, st as createLightDismiss, b as debounce, r as deepMerge, z as define, B as defineElement, V as endOfScrollBox, h as excessiveInstanceLimit, T as focusElement, E as focusElementTimeout, t as formatFileSize, i as formatStandardNumber, H as generateId, D as getActiveElement, U as getAnchorNames, W as getAttributeChanges, G as getAttributeListChanges, K as getChildren, a as getDifference, q as getDisplayValue, J as getElementUpdate, Y as getFlattenedDOMTree, X as getFlattenedFocusableItems, ve as getNextKeyGridItem, xe as getNextKeyListItem, Z as getPropertyChanges, Q as getThemeTokens, $ as hasHorizontalScrollBar, ee as hasInvalidDOMGrid, te as hasScrollBar, mt as hostAttr, y as i18n, O as initializeKeyListItems, ne as isContextMenuClick, k as isFocusable, o as isObject, s as isObjectLiteral, A as isSimpleFocusable, ye as keyNavigationGrid, Se as keyNavigationList, re as matchesElementName, x as onChildListMutation, ct as onKeys, j as onListboxActivate, ie as openEyeDropper, ae as parseTokenNumber, c as parseVersion, Ct as popoverStyles, oe as removeAnchorName, se as removeEmptySlotWhitespace, ce as removeEmptyTextNode, le as sameOrderedStringArray, ue as sameRenderRoot, ht as scopedRegistry, de as scrollBarWidth, M as setActiveKeyListItem, n as shiftLeft, fe as slotContainsOnlyWhitespace, Ae as stateActive, Me as stateCurrent, Pe as stateDisabled, Ie as stateExpanded, Re as stateHighlighted, We as statePressed, Be as stateScroll, He as stateSelected, Tt as statusIcons, _t as statusStateStyles, S as stopEvent, pe as styleSheetToString, vt as supportStateStyles, bt as supportsCSSLegacyInsetArea, xt as supportsCSSPositionArea, St as supportsNativeCSSAnchorPosition, me as supportsScopedRegistry, C as throttle, Ke as typeAnchor, tt as typeButton, Ye as typeCommand, Ze as typeInterest, rt as typeNativePopoverTrigger, ot as typeSSR, ut as typeSubmit, pt as typeTouch, he as uniqueNonEmptyStrings, yt as useStyles, ge as validKeyNavigationCode };
15
+ import { StateExpandedController as ke, stateExpanded as Ae } from "./controllers/state-expanded.controller.js";
16
+ import { StateHighlightedController as je, stateHighlighted as Me } from "./controllers/state-highlighted.controller.js";
17
+ import { StateScrollController as Ne, stateScroll as Pe } from "./controllers/state-scroll.controller.js";
18
+ import { StateSelectedController as Fe, stateSelected as Ie } from "./controllers/state-selected.controller.js";
19
+ import { TypeAnchorController as Le, typeAnchor as Re } from "./controllers/type-anchor.controller.js";
20
+ import { TypeClosableController as ze } from "./controllers/type-closable.controller.js";
21
+ import { TypeExpandableController as Be } from "./controllers/type-expandable.controller.js";
22
+ import { TypeSelectableController as Ve } from "./controllers/type-selectable.controller.js";
23
+ import { TypeNativePopoverController as He } from "./controllers/type-native-popover.controller.js";
24
+ import { TypeSSRController as Ue, typeSSR as We } from "./controllers/type-ssr.controller.js";
25
+ import { NveTouchEvent as Ge, TypeTouchController as Ke, typeTouch as qe } from "./controllers/type-touch.controller.js";
26
+ import { hostAttr as Je } from "./decorators/host-attr.js";
27
+ import { scopedRegistry as Ye } from "./decorators/scoped-registry.js";
28
+ import { colorStateStyles as Xe, statusStateStyles as Ze, supportStateStyles as Qe, useStyles as $e } from "./styles/index.js";
29
+ import { supportsCSSLegacyInsetArea as et, supportsCSSPositionArea as tt, supportsNativeCSSAnchorPosition as nt } from "./utils/supports.js";
30
+ import { popoverStyles as rt } from "./styles/popover2.js";
31
+ import { TransitionService as it } from "./services/transition.service.js";
32
+ import { statusIcons as at } from "./types/index.js";
33
+ import { createLightDismiss as ot, onKeys as st } from "./utils/keynav.js";
34
+ export { p as AuditController, e as DOCS_URL, l as GlobalState, u as GlobalStateService, v as I18nController, g as I18nService, _ as I18nService_, _e as KeyNavigationGridController, be as KeyNavigationListController, N as KeynavCode, w as LogService, Ge as NveTouchEvent, ke as StateExpandedController, je as StateHighlightedController, Ne as StateScrollController, Fe as StateSelectedController, it as TransitionService, Le as TypeAnchorController, ze as TypeClosableController, Be as TypeExpandableController, He as TypeNativePopoverController, Ue as TypeSSRController, Ve as TypeSelectableController, Ke as TypeTouchController, P as appendAnchorName, F as appendRootNodeStyle, I as applySlotContentStates, Ce as associateAriaDescribedBy, we as associateAriaLabel, Te as associateControlGroup, Ee as associateDataList, De as associateLabel, Oe as attachInternals, m as audit, d as auditParentElement, f as auditSlots, L as clickOutsideElementBounds, Xe as colorStateStyles, R as createGhostElement, ot as createLightDismiss, b as debounce, r as deepMerge, z as define, B as defineElement, V as endOfScrollBox, h as excessiveInstanceLimit, T as focusElement, E as focusElementTimeout, t as formatFileSize, i as formatStandardNumber, H as generateId, D as getActiveElement, U as getAnchorNames, W as getAttributeChanges, G as getAttributeListChanges, K as getChildren, a as getDifference, q as getDisplayValue, J as getElementUpdate, Y as getFlattenedDOMTree, X as getFlattenedFocusableItems, ve as getNextKeyGridItem, xe as getNextKeyListItem, Z as getPropertyChanges, Q as getThemeTokens, $ as hasHorizontalScrollBar, ee as hasInvalidDOMGrid, te as hasScrollBar, Je as hostAttr, y as i18n, O as initializeKeyListItems, ne as isContextMenuClick, k as isFocusable, o as isObject, s as isObjectLiteral, A as isSimpleFocusable, ye as keyNavigationGrid, Se as keyNavigationList, re as matchesElementName, x as onChildListMutation, st as onKeys, j as onListboxActivate, ie as openEyeDropper, ae as parseTokenNumber, c as parseVersion, rt as popoverStyles, oe as removeAnchorName, se as removeEmptySlotWhitespace, ce as removeEmptyTextNode, le as sameOrderedStringArray, ue as sameRenderRoot, Ye as scopedRegistry, de as scrollBarWidth, M as setActiveKeyListItem, n as shiftLeft, fe as slotContainsOnlyWhitespace, Ae as stateExpanded, Me as stateHighlighted, Pe as stateScroll, Ie as stateSelected, at as statusIcons, Ze as statusStateStyles, S as stopEvent, pe as styleSheetToString, Qe as supportStateStyles, et as supportsCSSLegacyInsetArea, tt as supportsCSSPositionArea, nt as supportsNativeCSSAnchorPosition, me as supportsScopedRegistry, C as throttle, Re as typeAnchor, We as typeSSR, qe as typeTouch, he as uniqueNonEmptyStrings, $e as useStyles, ge as validKeyNavigationCode };
@@ -19,7 +19,7 @@ var a = class {
19
19
  i18nRegistry: {},
20
20
  audit: {}
21
21
  }
22
- }, globalThis.NVE_ELEMENTS.state.versions = Array.from(new Set([...globalThis.NVE_ELEMENTS.state.versions, "2.0.1"])), globalThis.NVE_ELEMENTS.state.scopedRegistry ??= {}, globalThis.NVE_ELEMENTS.state.scopedRegistry["2.0.1"] = i(), globalThis.NVE_ELEMENTS.state.versions.length > 1 && globalThis.NVE_ELEMENTS.state.env !== "production" && console.warn(e(), `\n\n${JSON.stringify(globalThis.NVE_ELEMENTS.state.versions, null, 2)}`);
22
+ }, globalThis.NVE_ELEMENTS.state.versions = Array.from(new Set([...globalThis.NVE_ELEMENTS.state.versions, "2.0.2"])), globalThis.NVE_ELEMENTS.state.scopedRegistry ??= {}, globalThis.NVE_ELEMENTS.state.scopedRegistry["2.0.2"] = i(), globalThis.NVE_ELEMENTS.state.versions.length > 1 && globalThis.NVE_ELEMENTS.state.env !== "production" && console.warn(e(), `\n\n${JSON.stringify(globalThis.NVE_ELEMENTS.state.versions, null, 2)}`);
23
23
  }
24
24
  get state() {
25
25
  return globalThis.NVE_ELEMENTS.state;
@@ -11,7 +11,7 @@ var t = "@nve: ", n = class {
11
11
  e.state.env !== "production" && (console.error(`${t}${n}`, ...r), this.#e("error", n, ...r));
12
12
  }
13
13
  static #e(e, t, ...n) {
14
- globalThis.document.dispatchEvent(new CustomEvent("NVE_ELEMENTS_LOG", { detail: {
14
+ globalThis.document?.dispatchEvent(new CustomEvent("NVE_ELEMENTS_LOG", { detail: {
15
15
  type: e,
16
16
  value: t,
17
17
  args: n
@@ -1 +1 @@
1
- {"version":3,"file":"log.service.js","names":["#dispatch"],"sources":["../../../src/internal/services/log.service.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { GlobalStateService } from './global.service.js';\n\nconst prefix = '@nve: ';\n\nexport class LogService {\n static log(value: string, ...args: unknown[]) {\n if (GlobalStateService.state.env !== 'production') {\n console.log(`${prefix}${value}`, ...args);\n }\n }\n\n static warn(value: string, ...args: unknown[]) {\n if (GlobalStateService.state.env !== 'production') {\n console.warn(`${prefix}${value}`, ...args);\n this.#dispatch('warn', value, ...args);\n }\n }\n\n static error(value: string, ...args: unknown[]) {\n if (GlobalStateService.state.env !== 'production') {\n console.error(`${prefix}${value}`, ...args);\n this.#dispatch('error', value, ...args);\n }\n }\n\n static #dispatch(type: 'warn' | 'error', value: string, ...args: unknown[]) {\n globalThis.document.dispatchEvent(new CustomEvent('NVE_ELEMENTS_LOG', { detail: { type, value, args } }));\n }\n}\n"],"mappings":";;AAKA,IAAM,IAAS,UAEF,IAAb,MAAwB;CACtB,OAAO,IAAI,GAAe,GAAG,GAAiB;EAC5C,AAAI,EAAmB,MAAM,QAAQ,gBACnC,QAAQ,IAAI,GAAG,IAAS,KAAS,GAAG,CAAI;CAE5C;CAEA,OAAO,KAAK,GAAe,GAAG,GAAiB;EAC7C,AAAI,EAAmB,MAAM,QAAQ,iBACnC,QAAQ,KAAK,GAAG,IAAS,KAAS,GAAG,CAAI,GACzC,KAAKA,GAAU,QAAQ,GAAO,GAAG,CAAI;CAEzC;CAEA,OAAO,MAAM,GAAe,GAAG,GAAiB;EAC9C,AAAI,EAAmB,MAAM,QAAQ,iBACnC,QAAQ,MAAM,GAAG,IAAS,KAAS,GAAG,CAAI,GAC1C,KAAKA,GAAU,SAAS,GAAO,GAAG,CAAI;CAE1C;CAEA,OAAOA,GAAU,GAAwB,GAAe,GAAG,GAAiB;EAC1E,WAAW,SAAS,cAAc,IAAI,YAAY,oBAAoB,EAAE,QAAQ;GAAE;GAAM;GAAO;EAAK,EAAE,CAAC,CAAC;CAC1G;AACF"}
1
+ {"version":3,"file":"log.service.js","names":["#dispatch"],"sources":["../../../src/internal/services/log.service.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { GlobalStateService } from './global.service.js';\n\nconst prefix = '@nve: ';\n\nexport class LogService {\n static log(value: string, ...args: unknown[]) {\n if (GlobalStateService.state.env !== 'production') {\n console.log(`${prefix}${value}`, ...args);\n }\n }\n\n static warn(value: string, ...args: unknown[]) {\n if (GlobalStateService.state.env !== 'production') {\n console.warn(`${prefix}${value}`, ...args);\n this.#dispatch('warn', value, ...args);\n }\n }\n\n static error(value: string, ...args: unknown[]) {\n if (GlobalStateService.state.env !== 'production') {\n console.error(`${prefix}${value}`, ...args);\n this.#dispatch('error', value, ...args);\n }\n }\n\n static #dispatch(type: 'warn' | 'error', value: string, ...args: unknown[]) {\n globalThis.document?.dispatchEvent(new CustomEvent('NVE_ELEMENTS_LOG', { detail: { type, value, args } }));\n }\n}\n"],"mappings":";;AAKA,IAAM,IAAS,UAEF,IAAb,MAAwB;CACtB,OAAO,IAAI,GAAe,GAAG,GAAiB;EAC5C,AAAI,EAAmB,MAAM,QAAQ,gBACnC,QAAQ,IAAI,GAAG,IAAS,KAAS,GAAG,CAAI;CAE5C;CAEA,OAAO,KAAK,GAAe,GAAG,GAAiB;EAC7C,AAAI,EAAmB,MAAM,QAAQ,iBACnC,QAAQ,KAAK,GAAG,IAAS,KAAS,GAAG,CAAI,GACzC,KAAKA,GAAU,QAAQ,GAAO,GAAG,CAAI;CAEzC;CAEA,OAAO,MAAM,GAAe,GAAG,GAAiB;EAC9C,AAAI,EAAmB,MAAM,QAAQ,iBACnC,QAAQ,MAAM,GAAG,IAAS,KAAS,GAAG,CAAI,GAC1C,KAAKA,GAAU,SAAS,GAAO,GAAG,CAAI;CAE1C;CAEA,OAAOA,GAAU,GAAwB,GAAe,GAAG,GAAiB;EAC1E,WAAW,UAAU,cAAc,IAAI,YAAY,oBAAoB,EAAE,QAAQ;GAAE;GAAM;GAAO;EAAK,EAAE,CAAC,CAAC;CAC3G;AACF"}
@@ -66,6 +66,9 @@ export type TaskStatus = 'scheduled' | 'queued' | 'pending' | 'starting' | 'runn
66
66
  * - `hint` no light dismiss, no auto focus, open/close on hover/focus
67
67
  */
68
68
  export type PopoverType = 'auto' | 'manual' | 'hint' | 'inline';
69
+ export type InterestEvent = Event & {
70
+ source: HTMLElement;
71
+ };
69
72
  /** Controls how the popover aligns along the edge of its anchor element.
70
73
  * - `start` - Aligns the popover to the beginning edge of the anchor for left or top alignment.
71
74
  * - `end` - Aligns the popover to the ending edge of the anchor for right or bottom alignment.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/internal/types/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { TemplateResult } from 'lit';\nimport type { IconName } from '@nvidia-elements/core/icon';\nimport type { I18nStrings } from '../services/i18n.service.js';\n\nexport type Color =\n | 'red-cardinal'\n | 'gray-slate'\n | 'gray-denim'\n | 'blue-indigo'\n | 'blue-cobalt'\n | 'blue-sky'\n | 'teal-cyan'\n | 'green-mint'\n | 'teal-seafoam'\n | 'green-grass'\n | 'yellow-amber'\n | 'orange-pumpkin'\n | 'red-tomato'\n | 'pink-magenta'\n | 'purple-plum'\n | 'purple-violet'\n | 'purple-lavender'\n | 'pink-rose'\n | 'green-jade'\n | 'lime-pear'\n | 'yellow-nova'\n | 'brand-green';\n\n/** Controls the visual scale of an element to match its importance and available space.\n * - `sm` - Compact size for dense layouts or secondary elements with less visual prominence.\n * - `md` - Standard size that works well in most contexts and provides balanced visibility.\n * - `lg` - Larger size for emphasizing important elements or improving touch targets in spacious layouts.\n */\nexport type Size = 'sm' | 'md' | 'lg';\n\n/** Controls the visual scale of an element to match its importance and available space.\n * - `xs` - Extra small size for minimal elements or highly dense layouts.\n * - `sm` - Compact size for dense layouts or secondary elements with less visual prominence.\n * - `md` - Standard size that works well in most contexts and provides balanced visibility.\n * - `lg` - Larger size for emphasizing important elements or improving touch targets in spacious layouts.\n * - `xl` - Extra large size for emphasizing elements or sparse layouts.\n */\nexport type SizeExpanded = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/** Controls the visual prominence to establish hierarchy and guide user attention.\n * - `emphasis` - Increases visual weight to draw attention and highlight important elements.\n * - `muted` - Reduces visual weight for supporting content that should remain subtle and unobtrusive.\n */\nexport type Prominence = 'emphasis' | 'muted';\n\n/**\n * Determines the container bounds of the element\n * - `flat` Element has white space bounds but reduced visual container.\n * - `inline` Element container reduces to fit within inline content such as a block of text.\n * - `inset` Element container optimizes for embedding or inset placement inside another containing element.\n * - `full` Element container optimizes for filling its container bounds.\n * - `condensed` Element container optimizes for small, summarized or contained spaces.\n */\nexport type Container = 'inline' | 'flat' | 'inset' | 'full' | 'condensed';\n\n/** Communicates the intent and semantic meaning of an element to help users understand the outcome of their actions.\n * - `accent` - Highlights important actions or draws attention to primary interactive elements.\n * - `warning` - Indicates cautionary actions that require careful consideration before proceeding.\n * - `success` - Represents positive outcomes, confirmations, or constructive actions.\n * - `danger` - Signals destructive or irreversible actions that need extra attention and confirmation.\n */\nexport type SupportStatus = 'accent' | 'warning' | 'success' | 'danger';\n\n/** Controls how the chart connects intermediate values between points in a data series.\n * - `linear` - Connects points with straight line segments.\n * - `smooth` - Connects points with smooth bezier curves.\n * - `step` - Connects points with horizontal and vertical step segments.\n */\nexport type Interpolation = 'linear' | 'smooth' | 'step';\n\n/** Determines the orientation of an element. */\nexport type Orientation = 'vertical' | 'horizontal';\n\n/** Communicates the current state of a task or process to keep users informed of progress and outcomes.\n * - `scheduled` - Task has a scheduled future execution at a specific time.\n * - `queued` - Task is waiting in line to begin after other tasks complete.\n * - `pending` - Task is awaiting approval, user input, or external conditions before proceeding.\n * - `starting` - Task is initializing and preparing to begin active execution.\n * - `running` - Task is actively executing and making progress.\n * - `restarting` - Task restarts after an interruption or reset.\n * - `stopping` - Task is gracefully shutting down and completing cleanup operations.\n * - `finished` - Task has completed successfully with the expected outcome.\n * - `failed` - Task encountered an error and did not complete as intended.\n * - `unknown` - Task status remains unknown or unavailable.\n * - `ignored` - Task was intentionally skipped or excluded from execution.\n */\nexport type TaskStatus =\n | 'scheduled'\n | 'queued'\n | 'pending'\n | 'starting'\n | 'running'\n | 'restarting'\n | 'stopping'\n | 'finished'\n | 'failed'\n | 'unknown'\n | 'ignored';\n\n/**\n * https://open-ui.org/components/popup.research.explainer#api-shape\n * - `auto` light dismiss, focus on open, return to trigger\n * - `manual` no light dismiss, no auto focus\n * - `hint` no light dismiss, no auto focus, open/close on hover/focus\n */\nexport type PopoverType = 'auto' | 'manual' | 'hint' | 'inline';\n\n/** Controls how the popover aligns along the edge of its anchor element.\n * - `start` - Aligns the popover to the beginning edge of the anchor for left or top alignment.\n * - `end` - Aligns the popover to the ending edge of the anchor for right or bottom alignment.\n * - `center` - Centers the popover along the anchor's edge for balanced positioning.\n */\nexport type PopoverAlign = 'start' | 'end' | 'center';\n\n/** Determines the popover position relative to its assigned anchor and alignment.\n * - `top` - Positions the popover above the anchor element.\n * - `bottom` - Positions the popover below the anchor element.\n * - `left` - Positions the popover to the left side of the anchor element.\n * - `right` - Positions the popover to the right side of the anchor element.\n */\nexport type PopoverSides = 'top' | 'bottom' | 'left' | 'right';\n\n/** Controls the placement of the popover relative to its anchor element.\n * - `center` - Centers the popover directly over the anchor element.\n * - `top` - Positions the popover above the anchor element.\n * - `bottom` - Positions the popover below the anchor element.\n * - `left` - Positions the popover to the left side of the anchor element.\n * - `right` - Positions the popover to the right side of the anchor element.\n */\nexport type PopoverPosition = 'center' | 'top' | 'bottom' | 'left' | 'right';\n\n/** Determines the position of an element relative to its anchor */\nexport type Placement = PopoverPosition | `${PopoverSides}-${PopoverAlign}`;\n\n/** Controls the directional arrangement and spacing behavior of the element's content.\n * - `vertical` - Arranges content in a vertical stack with block-level spacing.\n * - `vertical-inline` - Arranges content vertically with compact inline spacing for dense layouts.\n * - `horizontal` - Arranges content in a horizontal row with block-level spacing.\n * - `horizontal-inline` - Arranges content horizontally with compact inline spacing.\n */\nexport type ControlLayout = 'vertical' | 'vertical-inline' | 'horizontal' | 'horizontal-inline';\n\n/** Indicates the element that represents the user's current location or position within a set. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)\n * - `page` - Marks the current page within a set of navigation links.\n * - `step` - Marks the current step within a multi-step process or workflow.\n */\nexport type Current = 'page' | 'step';\n\n/** Controls how data points are visually encoded in a sparkline chart.\n * - `line` - Renders data as a connected line to emphasize macro trend.\n * - `area` - Renders data as a filled area beneath a line to emphasize magnitude over time.\n * - `gradient` - Renders a line with gradient color treatment to communicate value intensity across the series.\n * - `column` - Renders data as vertical columns for easy comparison of discrete values.\n * - `winloss` - Renders outcomes as binary or ternary bars to highlight wins, losses, and optional ties.\n */\nexport type SparklineMark = 'line' | 'area' | 'gradient' | 'column' | 'winloss';\n\nexport interface NveElement {\n /**\n * This Boolean attribute prevents the user from interacting with the element: it cannot receive press or focus events. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled)\n * - `true` - The element has a disabled state and does not accept interaction.\n * - `false` - The element has an enabled state and accepts interaction.\n */\n disabled?: boolean;\n\n /** Indicates whether the element is currently actively engaged through user interaction. [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/:active)\n * - `true` - The user is pressing or activating the element (mousedown, keydown, or touch).\n * - `false` - No active user engagement on the element.\n */\n active?: boolean;\n\n /** Indicates whether collapsible content is currently visible or hidden from the user. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded)\n * - `true` - The associated content expands and becomes visible to the user.\n * - `false` - The associated content collapses and hides from the user.\n */\n expanded?: boolean;\n\n /** Indicates the current state of a toggle button that switches on or off. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed)\n * - `true` - The button is in the pressed (on) state and the associated action or setting is active.\n * - `false` - The button is in the unpressed (off) state and the associated action or setting is inactive.\n */\n pressed?: boolean;\n\n /** Indicates whether an element currently holds selection within a multi-option selection group. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected)\n * - `true` - The element holds selection and represents the user's current choice within the group.\n * - `false` - The element does not hold selection and the user can choose it.\n */\n selected?: boolean;\n\n /** Indicates whether the user can change the element's value while it remains visible and focusable. [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly)\n * - `true` - The element has a readonly state: the user cannot change its value, but can still focus and copy it.\n * - `false` - The element allows editing and the user can change its value through interaction.\n */\n readOnly?: boolean;\n\n /** Defines the value associated with the element's name when submitting the form data. The server receives this value in params when the form submits through this button. [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value) */\n value?: string;\n\n /** The name of the element, submitted as a pair with the element value as part of the form data. [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-name) */\n name?: string;\n\n /** Indicates whether the user can dismiss or close the element.\n * - `true` - The element displays a close control and the user can dismiss it.\n * - `false` - The user cannot close the element and must dismiss it programmatically.\n */\n closable?: boolean;\n\n /** Enables updating internal string values for internationalization. */\n i18n?: Partial<I18nStrings & { __set: boolean }>;\n\n /** Indicates the element that represents the user's current location or position within a set. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)\n * - `page` - Marks the current page within a set of navigation links.\n * - `step` - Marks the current step within a multi-step process or workflow.\n */\n current?: 'page' | 'step';\n\n /** Controls the horizontal alignment of the element within its container, respecting the text direction. [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout/Box_alignment_in_grid_layout#the_two_axes_of_a_grid_layout)\n * - `start` - Aligns the element to the beginning of the inline axis (left in LTR, right in RTL).\n * - `center` - Centers the element along the inline axis for balanced visual positioning.\n * - `end` - Aligns the element to the end of the inline axis (right in LTR, left in RTL).\n */\n inlinePosition?: 'start' | 'center' | 'end';\n\n /** Controls the vertical alignment of the element within its container. [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout/Box_alignment_in_grid_layout#the_two_axes_of_a_grid_layout)\n * - `start` - Aligns the element to the top of the block axis for top-aligned positioning.\n * - `center` - Centers the element along the block axis for balanced vertical positioning.\n * - `end` - Aligns the element to the bottom of the block axis for bottom-aligned positioning.\n */\n blockPosition?: 'start' | 'center' | 'end';\n\n /** Controls the directional arrangement and spacing behavior of the element's content.\n * - `vertical` - Arranges content in a vertical stack with block-level spacing.\n * - `vertical-inline` - Arranges content vertically with compact inline spacing for dense layouts.\n * - `horizontal` - Arranges content in a horizontal row with block-level spacing.\n * - `horizontal-inline` - Arranges content horizontally with compact inline spacing.\n */\n layout?: 'vertical' | 'vertical-inline' | 'horizontal' | 'horizontal-inline';\n\n /** Controls the directional flow of the element's layout and interaction pattern.\n * - `vertical` - Element orients vertically with top-to-bottom flow.\n * - `horizontal` - Element orients horizontally with left-to-right flow.\n */\n orientation?: 'vertical' | 'horizontal';\n\n /** Controls the visual prominence to establish hierarchy and guide user attention.\n * - `emphasis` - Increases visual weight to draw attention and highlight important elements.\n * - `muted` - Reduces visual weight for supporting content that should remain subtle and unobtrusive.\n */\n prominence?: 'emphasis' | 'muted';\n\n /** The Interaction type provides a way to show the intent of an interactive element. This can help users quickly understand what each interaction does and reduce the potential for confusion or errors.\n * - `emphasis` Shows the interaction targets emphasis or highlighting primary actions.\n * - `destructive` Shows the interaction targets destructive actions such as deleting or removing.\n */\n interaction?: 'emphasis' | 'destructive';\n\n /** Defines a base color from the theme color palette */\n color?:\n | 'red-cardinal'\n | 'gray-slate'\n | 'gray-denim'\n | 'blue-indigo'\n | 'blue-cobalt'\n | 'blue-sky'\n | 'teal-cyan'\n | 'green-mint'\n | 'teal-seafoam'\n | 'green-grass'\n | 'yellow-amber'\n | 'orange-pumpkin'\n | 'red-tomato'\n | 'pink-magenta'\n | 'purple-plum'\n | 'purple-violet'\n | 'purple-lavender'\n | 'pink-rose'\n | 'green-jade'\n | 'lime-pear'\n | 'yellow-nova'\n | 'brand-green';\n\n /** Communicates the intent and semantic meaning of an element to help users understand the outcome of their actions.\n * - `accent` - Highlights important actions or draws attention to primary interactive elements.\n * - `warning` - Indicates cautionary actions that require careful consideration before proceeding.\n * - `success` - Represents positive outcomes, confirmations, or constructive actions.\n * - `danger` - Signals destructive or irreversible actions that need extra attention and confirmation.\n */\n status?: 'accent' | 'warning' | 'success' | 'danger';\n\n /** Controls the visual scale of an element to match its importance and available space.\n * - `sm` - Compact size for dense layouts or secondary elements with less visual prominence.\n * - `md` - Standard size that works well in most contexts and provides balanced visibility.\n * - `lg` - Larger size for emphasizing important elements or improving touch targets in spacious layouts.\n */\n size?: 'sm' | 'md' | 'lg';\n\n /**\n * Demonstrates different container styles to accommodate visual weight and context.\n * - `flat` Element has white space bounds but reduced visual container.\n * - `inline` Element container reduces to fit within inline content such as a block of text.\n * - `inset` Element container optimizes for embedding or inset placement inside another containing element.\n * - `full` Element container optimizes for filling its container bounds.\n */\n container?: 'inline' | 'flat' | 'inset' | 'full';\n\n /** Determines the position of an element along both inline and block axis. [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout/Box_alignment_in_grid_layout#the_two_axes_of_a_grid_layout) */\n position?:\n | 'top-start'\n | 'top-end'\n | 'top-center'\n | 'bottom-start'\n | 'bottom-end'\n | 'bottom-center'\n | 'left-start'\n | 'left-end'\n | 'left-center'\n | 'right-start'\n | 'right-end'\n | 'right-center';\n\n /** Determines the alignment of the popover relative to the provided anchor element. */\n alignment?: 'start' | 'end' | 'center';\n\n /** Provides the element that the popover should position relative to. Anchor can accept a idref string within the same render root or a HTMLElement DOM reference. */\n anchor?: string | HTMLElement;\n\n /** Defines what element triggers an `open` interaction event. A trigger can accept a idref string within the same render root or a HTMLElement DOM reference. */\n trigger?: string | HTMLElement;\n\n /** Defines named content areas where users can insert custom markup into the element.\n * - `default` - The primary content area for the element.\n * - `prefix` - Content that appears before the main element content.\n * - `suffix` - Content that appears after the main element content.\n * - `header` - Content that appears at the top of the element, used for titles or introductory information.\n * - `footer` - Content that appears at the bottom of the element, used for supplementary information or actions.\n * - `actions` - Content area specifically for interactive controls like buttons or links.\n * - `icon` - Content area for displaying an icon that represents the element's purpose or state.\n */\n slots?: 'default' | 'prefix' | 'suffix' | 'header' | 'footer' | 'actions' | 'icon';\n\n /**\n * Sets the automatic dismissal time in milliseconds before the element emits a `close` event. Allow ~200-250ms per word for comfortable reading.\n * - `0` - Warning or error messages requiring immediate acknowledgment.\n * - `3000` - Brief success or confirmation messages.\n * - `7000` - Standard informational messages.\n * - `10000` - Messages with actions or requiring user decision.\n */\n closeTimeout?: number;\n\n /**\n * Sets the delay in milliseconds before the element emits a `open` event.\n * - `0` - Keyboard focus interactions (always immediate for accessibility).\n * - `500` - Dense interfaces with many tooltips to reduce visual noise and prevent accidental triggers.\n */\n openDelay?: number;\n\n /** @private An instance of `ElementInternals` that decorators/controllers set dynamically */\n _internals: ElementInternals;\n\n render: TemplateResult;\n}\n\n/** Defines named content areas where users can insert custom markup into the element.\n * - `default` - The primary content area for the element.\n * - `prefix` - Content that appears before the main element content.\n * - `suffix` - Content that appears after the main element content.\n * - `header` - Content that appears at the top of the element, used for titles or introductory information.\n * - `footer` - Content that appears at the bottom of the element, used for supplementary information or actions.\n * - `actions` - Content area specifically for interactive controls like buttons or links.\n * - `icon` - Content area for displaying an icon that represents the element's purpose or state.\n */\nexport type SlotName = 'default' | 'prefix' | 'suffix' | 'header' | 'footer' | 'actions' | 'icon';\n\n/** The Interaction type provides a way to show the intent of an interactive element. This can help users quickly understand what each interaction does and reduce the potential for confusion or errors.\n * - `emphasis` Shows the interaction targets emphasis or highlighting primary actions.\n * - `destructive` Shows the interaction targets destructive actions such as deleting or removing.\n */\nexport type Interaction = 'emphasis' | 'destructive';\n\nexport interface ContainerElement {\n container?: Partial<Container>;\n}\n\n/** An element that renders complex data structures (e.g., arrays, series, matrices) rather than composable UI content and values expressible with primitive attributes. */\nexport interface DataElement<T extends unknown[] | Record<string, unknown>> {\n data?: T;\n}\n\nexport const statusIcons: { [key: string]: IconName } = {\n '': 'information-circle-stroke',\n undefined: 'information-circle-stroke',\n default: 'information-circle-stroke',\n accent: 'information-circle-stroke',\n warning: 'exclamation-triangle',\n success: 'checkmark-circle',\n danger: 'exclamation-circle',\n scheduled: 'clock',\n failed: 'x-circle',\n finished: 'checkmark-circle',\n unknown: 'question-mark-circle',\n queued: 'bar-pill-stack',\n running: 'running',\n restarting: 'refresh',\n stopping: 'stop-sign',\n pending: 'circle-dash',\n starting: 'circle-dot',\n ignored: 'circle-angled-line'\n} as const;\n\ndeclare global {\n var NVE_ELEMENTS: {\n state: {\n bundle: boolean;\n env: 'watch' | 'production' | 'development';\n pageHost: string;\n moduleHost: string;\n versions: string[];\n scopedRegistry: { [key: string]: CustomElementRegistry };\n elementRegistry: Readonly<{ [key: string]: string }>;\n i18nRegistry: Readonly<{ [key: string]: string }>;\n audit: Readonly<{\n [key: string]: {\n count?: number;\n excessiveInstanceLimitAudited?: boolean;\n };\n }>;\n };\n debug: (log?: (...args: unknown[]) => void) => void;\n };\n\n interface HTMLElement {\n 'nve-text': string;\n 'nve-layout': string;\n }\n\n interface CustomElementRegistry {\n initialize(root: ShadowRoot | Document): void;\n }\n\n var CustomElementRegistry: {\n new (): CustomElementRegistry;\n prototype: CustomElementRegistry;\n };\n}\n\nexport interface ElementDefinition extends CustomElementConstructor {\n metadata: { version: string; tag: string };\n elementDefinitions?: { [key: string]: ElementDefinition };\n shadowRootOptions?: { customElementRegistry?: CustomElementRegistry | null };\n}\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport interface OffsetPoint {\n offsetX: number;\n offsetY: number;\n}\n\nexport interface Dimensions {\n width: number;\n height: number;\n}\n\nexport type Rect = Point & Dimensions;\n\nexport interface Scale {\n min: number;\n max: number;\n}\n\n/** https://github.com/tc39/proposal-decorators */\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nexport type LegacyDecoratorTarget = Function & {\n addInitializer?: (initializer: (instance: any) => void) => void; // eslint-disable-line @typescript-eslint/no-explicit-any\n};\n"],"mappings":";AA4YA,IAAa,IAA2C;CACtD,IAAI;CACJ,WAAW;CACX,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACT,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,UAAU;CACV,SAAS;CACT,QAAQ;CACR,SAAS;CACT,YAAY;CACZ,UAAU;CACV,SAAS;CACT,UAAU;CACV,SAAS;AACX"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/internal/types/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { TemplateResult } from 'lit';\nimport type { IconName } from '@nvidia-elements/core/icon';\nimport type { I18nStrings } from '../services/i18n.service.js';\n\nexport type Color =\n | 'red-cardinal'\n | 'gray-slate'\n | 'gray-denim'\n | 'blue-indigo'\n | 'blue-cobalt'\n | 'blue-sky'\n | 'teal-cyan'\n | 'green-mint'\n | 'teal-seafoam'\n | 'green-grass'\n | 'yellow-amber'\n | 'orange-pumpkin'\n | 'red-tomato'\n | 'pink-magenta'\n | 'purple-plum'\n | 'purple-violet'\n | 'purple-lavender'\n | 'pink-rose'\n | 'green-jade'\n | 'lime-pear'\n | 'yellow-nova'\n | 'brand-green';\n\n/** Controls the visual scale of an element to match its importance and available space.\n * - `sm` - Compact size for dense layouts or secondary elements with less visual prominence.\n * - `md` - Standard size that works well in most contexts and provides balanced visibility.\n * - `lg` - Larger size for emphasizing important elements or improving touch targets in spacious layouts.\n */\nexport type Size = 'sm' | 'md' | 'lg';\n\n/** Controls the visual scale of an element to match its importance and available space.\n * - `xs` - Extra small size for minimal elements or highly dense layouts.\n * - `sm` - Compact size for dense layouts or secondary elements with less visual prominence.\n * - `md` - Standard size that works well in most contexts and provides balanced visibility.\n * - `lg` - Larger size for emphasizing important elements or improving touch targets in spacious layouts.\n * - `xl` - Extra large size for emphasizing elements or sparse layouts.\n */\nexport type SizeExpanded = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/** Controls the visual prominence to establish hierarchy and guide user attention.\n * - `emphasis` - Increases visual weight to draw attention and highlight important elements.\n * - `muted` - Reduces visual weight for supporting content that should remain subtle and unobtrusive.\n */\nexport type Prominence = 'emphasis' | 'muted';\n\n/**\n * Determines the container bounds of the element\n * - `flat` Element has white space bounds but reduced visual container.\n * - `inline` Element container reduces to fit within inline content such as a block of text.\n * - `inset` Element container optimizes for embedding or inset placement inside another containing element.\n * - `full` Element container optimizes for filling its container bounds.\n * - `condensed` Element container optimizes for small, summarized or contained spaces.\n */\nexport type Container = 'inline' | 'flat' | 'inset' | 'full' | 'condensed';\n\n/** Communicates the intent and semantic meaning of an element to help users understand the outcome of their actions.\n * - `accent` - Highlights important actions or draws attention to primary interactive elements.\n * - `warning` - Indicates cautionary actions that require careful consideration before proceeding.\n * - `success` - Represents positive outcomes, confirmations, or constructive actions.\n * - `danger` - Signals destructive or irreversible actions that need extra attention and confirmation.\n */\nexport type SupportStatus = 'accent' | 'warning' | 'success' | 'danger';\n\n/** Controls how the chart connects intermediate values between points in a data series.\n * - `linear` - Connects points with straight line segments.\n * - `smooth` - Connects points with smooth bezier curves.\n * - `step` - Connects points with horizontal and vertical step segments.\n */\nexport type Interpolation = 'linear' | 'smooth' | 'step';\n\n/** Determines the orientation of an element. */\nexport type Orientation = 'vertical' | 'horizontal';\n\n/** Communicates the current state of a task or process to keep users informed of progress and outcomes.\n * - `scheduled` - Task has a scheduled future execution at a specific time.\n * - `queued` - Task is waiting in line to begin after other tasks complete.\n * - `pending` - Task is awaiting approval, user input, or external conditions before proceeding.\n * - `starting` - Task is initializing and preparing to begin active execution.\n * - `running` - Task is actively executing and making progress.\n * - `restarting` - Task restarts after an interruption or reset.\n * - `stopping` - Task is gracefully shutting down and completing cleanup operations.\n * - `finished` - Task has completed successfully with the expected outcome.\n * - `failed` - Task encountered an error and did not complete as intended.\n * - `unknown` - Task status remains unknown or unavailable.\n * - `ignored` - Task was intentionally skipped or excluded from execution.\n */\nexport type TaskStatus =\n | 'scheduled'\n | 'queued'\n | 'pending'\n | 'starting'\n | 'running'\n | 'restarting'\n | 'stopping'\n | 'finished'\n | 'failed'\n | 'unknown'\n | 'ignored';\n\n/**\n * https://open-ui.org/components/popup.research.explainer#api-shape\n * - `auto` light dismiss, focus on open, return to trigger\n * - `manual` no light dismiss, no auto focus\n * - `hint` no light dismiss, no auto focus, open/close on hover/focus\n */\nexport type PopoverType = 'auto' | 'manual' | 'hint' | 'inline';\n\nexport type InterestEvent = Event & {\n source: HTMLElement;\n};\n\n/** Controls how the popover aligns along the edge of its anchor element.\n * - `start` - Aligns the popover to the beginning edge of the anchor for left or top alignment.\n * - `end` - Aligns the popover to the ending edge of the anchor for right or bottom alignment.\n * - `center` - Centers the popover along the anchor's edge for balanced positioning.\n */\nexport type PopoverAlign = 'start' | 'end' | 'center';\n\n/** Determines the popover position relative to its assigned anchor and alignment.\n * - `top` - Positions the popover above the anchor element.\n * - `bottom` - Positions the popover below the anchor element.\n * - `left` - Positions the popover to the left side of the anchor element.\n * - `right` - Positions the popover to the right side of the anchor element.\n */\nexport type PopoverSides = 'top' | 'bottom' | 'left' | 'right';\n\n/** Controls the placement of the popover relative to its anchor element.\n * - `center` - Centers the popover directly over the anchor element.\n * - `top` - Positions the popover above the anchor element.\n * - `bottom` - Positions the popover below the anchor element.\n * - `left` - Positions the popover to the left side of the anchor element.\n * - `right` - Positions the popover to the right side of the anchor element.\n */\nexport type PopoverPosition = 'center' | 'top' | 'bottom' | 'left' | 'right';\n\n/** Determines the position of an element relative to its anchor */\nexport type Placement = PopoverPosition | `${PopoverSides}-${PopoverAlign}`;\n\n/** Controls the directional arrangement and spacing behavior of the element's content.\n * - `vertical` - Arranges content in a vertical stack with block-level spacing.\n * - `vertical-inline` - Arranges content vertically with compact inline spacing for dense layouts.\n * - `horizontal` - Arranges content in a horizontal row with block-level spacing.\n * - `horizontal-inline` - Arranges content horizontally with compact inline spacing.\n */\nexport type ControlLayout = 'vertical' | 'vertical-inline' | 'horizontal' | 'horizontal-inline';\n\n/** Indicates the element that represents the user's current location or position within a set. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)\n * - `page` - Marks the current page within a set of navigation links.\n * - `step` - Marks the current step within a multi-step process or workflow.\n */\nexport type Current = 'page' | 'step';\n\n/** Controls how data points are visually encoded in a sparkline chart.\n * - `line` - Renders data as a connected line to emphasize macro trend.\n * - `area` - Renders data as a filled area beneath a line to emphasize magnitude over time.\n * - `gradient` - Renders a line with gradient color treatment to communicate value intensity across the series.\n * - `column` - Renders data as vertical columns for easy comparison of discrete values.\n * - `winloss` - Renders outcomes as binary or ternary bars to highlight wins, losses, and optional ties.\n */\nexport type SparklineMark = 'line' | 'area' | 'gradient' | 'column' | 'winloss';\n\nexport interface NveElement {\n /**\n * This Boolean attribute prevents the user from interacting with the element: it cannot receive press or focus events. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled)\n * - `true` - The element has a disabled state and does not accept interaction.\n * - `false` - The element has an enabled state and accepts interaction.\n */\n disabled?: boolean;\n\n /** Indicates whether the element is currently actively engaged through user interaction. [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/:active)\n * - `true` - The user is pressing or activating the element (mousedown, keydown, or touch).\n * - `false` - No active user engagement on the element.\n */\n active?: boolean;\n\n /** Indicates whether collapsible content is currently visible or hidden from the user. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded)\n * - `true` - The associated content expands and becomes visible to the user.\n * - `false` - The associated content collapses and hides from the user.\n */\n expanded?: boolean;\n\n /** Indicates the current state of a toggle button that switches on or off. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed)\n * - `true` - The button is in the pressed (on) state and the associated action or setting is active.\n * - `false` - The button is in the unpressed (off) state and the associated action or setting is inactive.\n */\n pressed?: boolean;\n\n /** Indicates whether an element currently holds selection within a multi-option selection group. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected)\n * - `true` - The element holds selection and represents the user's current choice within the group.\n * - `false` - The element does not hold selection and the user can choose it.\n */\n selected?: boolean;\n\n /** Indicates whether the user can change the element's value while it remains visible and focusable. [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly)\n * - `true` - The element has a readonly state: the user cannot change its value, but can still focus and copy it.\n * - `false` - The element allows editing and the user can change its value through interaction.\n */\n readOnly?: boolean;\n\n /** Defines the value associated with the element's name when submitting the form data. The server receives this value in params when the form submits through this button. [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value) */\n value?: string;\n\n /** The name of the element, submitted as a pair with the element value as part of the form data. [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-name) */\n name?: string;\n\n /** Indicates whether the user can dismiss or close the element.\n * - `true` - The element displays a close control and the user can dismiss it.\n * - `false` - The user cannot close the element and must dismiss it programmatically.\n */\n closable?: boolean;\n\n /** Enables updating internal string values for internationalization. */\n i18n?: Partial<I18nStrings & { __set: boolean }>;\n\n /** Indicates the element that represents the user's current location or position within a set. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)\n * - `page` - Marks the current page within a set of navigation links.\n * - `step` - Marks the current step within a multi-step process or workflow.\n */\n current?: 'page' | 'step';\n\n /** Controls the horizontal alignment of the element within its container, respecting the text direction. [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout/Box_alignment_in_grid_layout#the_two_axes_of_a_grid_layout)\n * - `start` - Aligns the element to the beginning of the inline axis (left in LTR, right in RTL).\n * - `center` - Centers the element along the inline axis for balanced visual positioning.\n * - `end` - Aligns the element to the end of the inline axis (right in LTR, left in RTL).\n */\n inlinePosition?: 'start' | 'center' | 'end';\n\n /** Controls the vertical alignment of the element within its container. [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout/Box_alignment_in_grid_layout#the_two_axes_of_a_grid_layout)\n * - `start` - Aligns the element to the top of the block axis for top-aligned positioning.\n * - `center` - Centers the element along the block axis for balanced vertical positioning.\n * - `end` - Aligns the element to the bottom of the block axis for bottom-aligned positioning.\n */\n blockPosition?: 'start' | 'center' | 'end';\n\n /** Controls the directional arrangement and spacing behavior of the element's content.\n * - `vertical` - Arranges content in a vertical stack with block-level spacing.\n * - `vertical-inline` - Arranges content vertically with compact inline spacing for dense layouts.\n * - `horizontal` - Arranges content in a horizontal row with block-level spacing.\n * - `horizontal-inline` - Arranges content horizontally with compact inline spacing.\n */\n layout?: 'vertical' | 'vertical-inline' | 'horizontal' | 'horizontal-inline';\n\n /** Controls the directional flow of the element's layout and interaction pattern.\n * - `vertical` - Element orients vertically with top-to-bottom flow.\n * - `horizontal` - Element orients horizontally with left-to-right flow.\n */\n orientation?: 'vertical' | 'horizontal';\n\n /** Controls the visual prominence to establish hierarchy and guide user attention.\n * - `emphasis` - Increases visual weight to draw attention and highlight important elements.\n * - `muted` - Reduces visual weight for supporting content that should remain subtle and unobtrusive.\n */\n prominence?: 'emphasis' | 'muted';\n\n /** The Interaction type provides a way to show the intent of an interactive element. This can help users quickly understand what each interaction does and reduce the potential for confusion or errors.\n * - `emphasis` Shows the interaction targets emphasis or highlighting primary actions.\n * - `destructive` Shows the interaction targets destructive actions such as deleting or removing.\n */\n interaction?: 'emphasis' | 'destructive';\n\n /** Defines a base color from the theme color palette */\n color?:\n | 'red-cardinal'\n | 'gray-slate'\n | 'gray-denim'\n | 'blue-indigo'\n | 'blue-cobalt'\n | 'blue-sky'\n | 'teal-cyan'\n | 'green-mint'\n | 'teal-seafoam'\n | 'green-grass'\n | 'yellow-amber'\n | 'orange-pumpkin'\n | 'red-tomato'\n | 'pink-magenta'\n | 'purple-plum'\n | 'purple-violet'\n | 'purple-lavender'\n | 'pink-rose'\n | 'green-jade'\n | 'lime-pear'\n | 'yellow-nova'\n | 'brand-green';\n\n /** Communicates the intent and semantic meaning of an element to help users understand the outcome of their actions.\n * - `accent` - Highlights important actions or draws attention to primary interactive elements.\n * - `warning` - Indicates cautionary actions that require careful consideration before proceeding.\n * - `success` - Represents positive outcomes, confirmations, or constructive actions.\n * - `danger` - Signals destructive or irreversible actions that need extra attention and confirmation.\n */\n status?: 'accent' | 'warning' | 'success' | 'danger';\n\n /** Controls the visual scale of an element to match its importance and available space.\n * - `sm` - Compact size for dense layouts or secondary elements with less visual prominence.\n * - `md` - Standard size that works well in most contexts and provides balanced visibility.\n * - `lg` - Larger size for emphasizing important elements or improving touch targets in spacious layouts.\n */\n size?: 'sm' | 'md' | 'lg';\n\n /**\n * Demonstrates different container styles to accommodate visual weight and context.\n * - `flat` Element has white space bounds but reduced visual container.\n * - `inline` Element container reduces to fit within inline content such as a block of text.\n * - `inset` Element container optimizes for embedding or inset placement inside another containing element.\n * - `full` Element container optimizes for filling its container bounds.\n */\n container?: 'inline' | 'flat' | 'inset' | 'full';\n\n /** Determines the position of an element along both inline and block axis. [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout/Box_alignment_in_grid_layout#the_two_axes_of_a_grid_layout) */\n position?:\n | 'top-start'\n | 'top-end'\n | 'top-center'\n | 'bottom-start'\n | 'bottom-end'\n | 'bottom-center'\n | 'left-start'\n | 'left-end'\n | 'left-center'\n | 'right-start'\n | 'right-end'\n | 'right-center';\n\n /** Determines the alignment of the popover relative to the provided anchor element. */\n alignment?: 'start' | 'end' | 'center';\n\n /** Provides the element that the popover should position relative to. Anchor can accept a idref string within the same render root or a HTMLElement DOM reference. */\n anchor?: string | HTMLElement;\n\n /** Defines what element triggers an `open` interaction event. A trigger can accept a idref string within the same render root or a HTMLElement DOM reference. */\n trigger?: string | HTMLElement;\n\n /** Defines named content areas where users can insert custom markup into the element.\n * - `default` - The primary content area for the element.\n * - `prefix` - Content that appears before the main element content.\n * - `suffix` - Content that appears after the main element content.\n * - `header` - Content that appears at the top of the element, used for titles or introductory information.\n * - `footer` - Content that appears at the bottom of the element, used for supplementary information or actions.\n * - `actions` - Content area specifically for interactive controls like buttons or links.\n * - `icon` - Content area for displaying an icon that represents the element's purpose or state.\n */\n slots?: 'default' | 'prefix' | 'suffix' | 'header' | 'footer' | 'actions' | 'icon';\n\n /**\n * Sets the automatic dismissal time in milliseconds before the element emits a `close` event. Allow ~200-250ms per word for comfortable reading.\n * - `0` - Warning or error messages requiring immediate acknowledgment.\n * - `3000` - Brief success or confirmation messages.\n * - `7000` - Standard informational messages.\n * - `10000` - Messages with actions or requiring user decision.\n */\n closeTimeout?: number;\n\n /**\n * Sets the delay in milliseconds before the element emits a `open` event.\n * - `0` - Keyboard focus interactions (always immediate for accessibility).\n * - `500` - Dense interfaces with many tooltips to reduce visual noise and prevent accidental triggers.\n */\n openDelay?: number;\n\n /** @private An instance of `ElementInternals` that decorators/controllers set dynamically */\n _internals: ElementInternals;\n\n render: TemplateResult;\n}\n\n/** Defines named content areas where users can insert custom markup into the element.\n * - `default` - The primary content area for the element.\n * - `prefix` - Content that appears before the main element content.\n * - `suffix` - Content that appears after the main element content.\n * - `header` - Content that appears at the top of the element, used for titles or introductory information.\n * - `footer` - Content that appears at the bottom of the element, used for supplementary information or actions.\n * - `actions` - Content area specifically for interactive controls like buttons or links.\n * - `icon` - Content area for displaying an icon that represents the element's purpose or state.\n */\nexport type SlotName = 'default' | 'prefix' | 'suffix' | 'header' | 'footer' | 'actions' | 'icon';\n\n/** The Interaction type provides a way to show the intent of an interactive element. This can help users quickly understand what each interaction does and reduce the potential for confusion or errors.\n * - `emphasis` Shows the interaction targets emphasis or highlighting primary actions.\n * - `destructive` Shows the interaction targets destructive actions such as deleting or removing.\n */\nexport type Interaction = 'emphasis' | 'destructive';\n\nexport interface ContainerElement {\n container?: Partial<Container>;\n}\n\n/** An element that renders complex data structures (e.g., arrays, series, matrices) rather than composable UI content and values expressible with primitive attributes. */\nexport interface DataElement<T extends unknown[] | Record<string, unknown>> {\n data?: T;\n}\n\nexport const statusIcons: { [key: string]: IconName } = {\n '': 'information-circle-stroke',\n undefined: 'information-circle-stroke',\n default: 'information-circle-stroke',\n accent: 'information-circle-stroke',\n warning: 'exclamation-triangle',\n success: 'checkmark-circle',\n danger: 'exclamation-circle',\n scheduled: 'clock',\n failed: 'x-circle',\n finished: 'checkmark-circle',\n unknown: 'question-mark-circle',\n queued: 'bar-pill-stack',\n running: 'running',\n restarting: 'refresh',\n stopping: 'stop-sign',\n pending: 'circle-dash',\n starting: 'circle-dot',\n ignored: 'circle-angled-line'\n} as const;\n\ndeclare global {\n var NVE_ELEMENTS: {\n state: {\n bundle: boolean;\n env: 'watch' | 'production' | 'development';\n pageHost: string;\n moduleHost: string;\n versions: string[];\n scopedRegistry: { [key: string]: CustomElementRegistry };\n elementRegistry: Readonly<{ [key: string]: string }>;\n i18nRegistry: Readonly<{ [key: string]: string }>;\n audit: Readonly<{\n [key: string]: {\n count?: number;\n excessiveInstanceLimitAudited?: boolean;\n };\n }>;\n };\n debug: (log?: (...args: unknown[]) => void) => void;\n };\n\n interface HTMLElement {\n 'nve-text': string;\n 'nve-layout': string;\n }\n\n interface CustomElementRegistry {\n initialize(root: ShadowRoot | Document): void;\n }\n\n var CustomElementRegistry: {\n new (): CustomElementRegistry;\n prototype: CustomElementRegistry;\n };\n}\n\nexport interface ElementDefinition extends CustomElementConstructor {\n metadata: { version: string; tag: string };\n elementDefinitions?: { [key: string]: ElementDefinition };\n shadowRootOptions?: { customElementRegistry?: CustomElementRegistry | null };\n}\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport interface OffsetPoint {\n offsetX: number;\n offsetY: number;\n}\n\nexport interface Dimensions {\n width: number;\n height: number;\n}\n\nexport type Rect = Point & Dimensions;\n\nexport interface Scale {\n min: number;\n max: number;\n}\n\n/** https://github.com/tc39/proposal-decorators */\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nexport type LegacyDecoratorTarget = Function & {\n addInitializer?: (initializer: (instance: any) => void) => void; // eslint-disable-line @typescript-eslint/no-explicit-any\n};\n"],"mappings":";AAgZA,IAAa,IAA2C;CACtD,IAAI;CACJ,WAAW;CACX,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACT,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,UAAU;CACV,SAAS;CACT,QAAQ;CACR,SAAS;CACT,YAAY;CACZ,UAAU;CACV,SAAS;CACT,UAAU;CACV,SAAS;AACX"}
@@ -11,7 +11,7 @@ export declare function getAttributeListChanges(element: HTMLElement, attrs: str
11
11
  export declare function appendRootNodeStyle(host: HTMLElement, styles: string): CSSStyleSheet;
12
12
  export declare function styleSheetToString(stylesheet: CSSStyleSheet): string;
13
13
  /** Intercepts a property setter on an element so `callback` fires on every assignment. Does not use a MutationObserver. */
14
- export declare function getPropertyChanges(element: HTMLElement, key: string, callback: (value: unknown) => void): void;
14
+ export declare function getPropertyChanges(element: HTMLElement, key: string, callback: (value: unknown) => void): (() => void) | undefined;
15
15
  export declare function getElementUpdate(element: HTMLElement, key: string, callback: (value: unknown) => void): MutationObserver;
16
16
  export declare function clickOutsideElementBounds(event: PointerEvent | MouseEvent, element: HTMLElement): boolean;
17
17
  /** parses number out of basic calc generated by the design tokens */
@@ -1,7 +1,8 @@
1
1
  import { GlobalStateService as e } from "../services/global.service.js";
2
- import { isFocusable as t } from "./focus.js";
2
+ import { LogService as t } from "../services/log.service.js";
3
+ import { isFocusable as n } from "./focus.js";
3
4
  //#region src/internal/utils/dom.ts
4
- function n(e) {
5
+ function r(e) {
5
6
  if (e instanceof Document && e.documentElement) return Array.from(e.documentElement.children);
6
7
  if (e instanceof HTMLElement && e.shadowRoot) return Array.from(e.shadowRoot.children);
7
8
  if (e instanceof HTMLSlotElement && e.assignedElements) {
@@ -9,10 +10,10 @@ function n(e) {
9
10
  return t.length ? t : Array.from(e.children);
10
11
  } else return Array.from(e.children);
11
12
  }
12
- function r() {
13
+ function i() {
13
14
  return `_${self.crypto.getRandomValues(new Uint32Array(1))[0].toString(16)}`;
14
15
  }
15
- function i(e, t, n) {
16
+ function a(e, t, n) {
16
17
  n(e.getAttribute(t));
17
18
  let r = new MutationObserver((e) => {
18
19
  e.forEach((e) => {
@@ -24,7 +25,7 @@ function i(e, t, n) {
24
25
  subtree: !0
25
26
  }), r;
26
27
  }
27
- function a(e, t, n) {
28
+ function o(e, t, n) {
28
29
  let r = new MutationObserver((e) => {
29
30
  e.forEach((e) => {
30
31
  e.attributeName && t.includes(e.attributeName) && n(e);
@@ -35,87 +36,103 @@ function a(e, t, n) {
35
36
  subtree: !0
36
37
  }), r;
37
38
  }
38
- function o(e, t) {
39
+ function s(e, t) {
39
40
  let n = new CSSStyleSheet();
40
41
  n.replaceSync(t);
41
42
  let r = e.getRootNode();
42
- return r.adoptedStyleSheets && (r.adoptedStyleSheets.map((e) => s(e)).find((e) => e === s(n)) || (r.adoptedStyleSheets = [...Array.from(r.adoptedStyleSheets), n])), n;
43
+ return r.adoptedStyleSheets && (r.adoptedStyleSheets.map((e) => c(e)).find((e) => e === c(n)) || (r.adoptedStyleSheets = [...Array.from(r.adoptedStyleSheets), n])), n;
43
44
  }
44
- function s(e) {
45
+ function c(e) {
45
46
  return e.cssRules ? Array.from(e.cssRules).map((e) => e.cssText || "").join("\n") : "";
46
47
  }
47
- function c(e, t, n) {
48
+ function l(e, t, n) {
48
49
  let r = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e), t);
49
50
  if (!r) return;
50
51
  let i = Object.getOwnPropertyDescriptor(e, t);
51
- i && i.configurable === !1 || Object.defineProperty(e, t, {
52
+ if (!(i && i.configurable === !1)) return Object.defineProperty(e, t, {
52
53
  configurable: !0,
53
54
  get: r.get,
54
55
  set: (t) => {
55
56
  r.set.call(e, t), n(t);
56
57
  }
57
- });
58
+ }), () => {
59
+ if (i) {
60
+ Object.defineProperty(e, t, i);
61
+ return;
62
+ }
63
+ Reflect.deleteProperty(e, t);
64
+ };
58
65
  }
59
- function l(e, t, n) {
60
- return e.hasAttribute(t) ? n(e.getAttribute(t)) : e[t] !== void 0 && n(e[t]), c(e, t, n), i(e, t, (e) => n(e));
66
+ function u(e, t, n) {
67
+ e.hasAttribute(t) ? n(e.getAttribute(t)) : e[t] !== void 0 && n(e[t]);
68
+ let r = l(e, t, n), i = a(e, t, (e) => n(e)), o = i.disconnect.bind(i);
69
+ return i.disconnect = () => {
70
+ r?.(), o();
71
+ }, i;
61
72
  }
62
- function u(e, t) {
73
+ function d(e, t) {
63
74
  let { left: n, right: r, top: i, bottom: a } = t.getBoundingClientRect();
64
75
  return e.clientX < n || e.clientX > r || e.clientY < i || e.clientY > a;
65
76
  }
66
- function d(e) {
77
+ function f(e) {
67
78
  return parseInt(e.includes("calc") ? e.split("*")[1].replace("px)", "").trim() : e, 10) || 0;
68
79
  }
69
- var f = globalThis.CustomElementRegistry && "initialize" in CustomElementRegistry.prototype;
70
- function p(t, n) {
80
+ var p = globalThis.CustomElementRegistry && "initialize" in CustomElementRegistry.prototype;
81
+ function m(t, n) {
71
82
  Object.entries(t.elementDefinitions ?? {}).filter(([e, t]) => !n.get(t.metadata.tag)).forEach(([e, t]) => {
72
- p(t, n);
83
+ m(t, n);
73
84
  }), n.get(t.metadata.tag) || (n.define(t.metadata.tag, t), n === customElements && e.dispatch("NVE_ELEMENT_DEFINE", { elementRegistry: { [t.metadata.tag]: t.metadata.version } }));
74
85
  }
75
- function m(t) {
86
+ function h(t) {
76
87
  let { version: n } = t.metadata;
77
- f && !customElements.get(t.metadata.tag) ? (customElements.define(t.metadata.tag, t), e.dispatch("NVE_ELEMENT_DEFINE", { elementRegistry: { [t.metadata.tag]: t.metadata.version } })) : p(t, customElements), e.state.elementRegistry[t.metadata.tag] !== n && globalThis?.location?.hostname === "localhost" && import("./audit-logs.js").then((e) => console.warn(e.getDuplicatePackageVersionWarning(t.metadata.tag, n)));
88
+ p && !customElements.get(t.metadata.tag) ? (customElements.define(t.metadata.tag, t), e.dispatch("NVE_ELEMENT_DEFINE", { elementRegistry: { [t.metadata.tag]: t.metadata.version } })) : m(t, customElements), e.state.elementRegistry[t.metadata.tag] !== n && globalThis?.location?.hostname === "localhost" && import("./audit-logs.js").then((e) => console.warn(e.getDuplicatePackageVersionWarning(t.metadata.tag, n)));
78
89
  }
79
- function h(e) {
90
+ function g(e) {
80
91
  return e.buttons === 2 && !e.ctrlKey || e.buttons === 1 && e.ctrlKey;
81
92
  }
82
- function g(e, n = 10) {
83
- return _(e, n).filter((e) => t(e));
84
- }
85
93
  function _(e, t = 10) {
86
- return Array.from(n(e)).reduce((e, r) => [...e, [r, [...Array.from(n(r)).map((e) => [e, _(e, t)])]]], []).flat(t);
94
+ return v(e, t).filter((e) => n(e));
95
+ }
96
+ function v(e, t = 10) {
97
+ return Array.from(r(e)).reduce((e, n) => [...e, [n, [...Array.from(r(n)).map((e) => [e, v(e, t)])]]], []).flat(t);
87
98
  }
88
- function v(e) {
89
- return b.has(e.code);
99
+ function y(e) {
100
+ return x.has(e.code);
90
101
  }
91
- var y = /* @__PURE__ */ function(e) {
102
+ var b = /* @__PURE__ */ function(e) {
92
103
  return e.End = "End", e.Home = "Home", e.PageUp = "PageUp", e.PageDown = "PageDown", e.ArrowUp = "ArrowUp", e.ArrowDown = "ArrowDown", e.ArrowLeft = "ArrowLeft", e.ArrowRight = "ArrowRight", e;
93
- }({}), b = new Set(Object.values(y));
94
- function x(e) {
104
+ }({}), x = new Set(Object.values(b));
105
+ function S(e) {
95
106
  return e.some((t) => t.children.length !== e[0].children.length);
96
107
  }
97
- function S(e) {
108
+ function C(e) {
98
109
  e?.wholeText?.trim() === "" && e.remove();
99
110
  }
100
- function C() {
111
+ function w() {
101
112
  let e = globalThis.document.createElement("div");
102
113
  e.style.setProperty("width", "100px"), e.style.setProperty("height", "100px"), e.style.setProperty("overflow", "scroll"), e.style.setProperty("position", "absolute"), e.style.setProperty("top", "-9999px"), globalThis.document.body.appendChild(e);
103
114
  let t = e.offsetWidth - e.clientWidth;
104
115
  return globalThis.document.body.removeChild(e), t;
105
116
  }
106
- function w(e) {
117
+ function T(e) {
107
118
  return e.scrollHeight > e.clientHeight;
108
119
  }
109
- function T(e) {
120
+ function E(e) {
110
121
  return e.scrollWidth > e.clientWidth;
111
122
  }
112
- function E(e, t = 0) {
123
+ function D(e, t = 0) {
113
124
  return e.scrollTop + e.offsetHeight + t >= e.scrollHeight;
114
125
  }
115
- async function D() {
116
- return await new globalThis.EyeDropper().open().then((e) => e.sRGBHex);
126
+ async function O() {
127
+ let e = globalThis.EyeDropper;
128
+ if (!e) return t.warn("EyeDropper API is unavailable"), "";
129
+ try {
130
+ return (await new e().open()).sRGBHex;
131
+ } catch (e) {
132
+ return t.warn(`EyeDropper selection failed: ${e.message}`), "";
133
+ }
117
134
  }
118
- function O(e = globalThis.document.querySelector(":root")) {
135
+ function k(e = globalThis.document.querySelector(":root")) {
119
136
  let t = getComputedStyle(e), n = [];
120
137
  try {
121
138
  n = Array.from(globalThis.parent.document.styleSheets);
@@ -134,48 +151,48 @@ function O(e = globalThis.document.querySelector(":root")) {
134
151
  [n[0]]: t.getPropertyValue(n[0])
135
152
  }), {});
136
153
  }
137
- function k(e) {
138
- A(e) && e.assignedNodes().forEach((e) => e.parentNode?.removeChild(e));
139
- }
140
154
  function A(e) {
155
+ j(e) && e.assignedNodes().forEach((e) => e.parentNode?.removeChild(e));
156
+ }
157
+ function j(e) {
141
158
  let t = !e.assignedNodes().find((e) => e.nodeType !== Node.TEXT_NODE), n = !e.assignedNodes().find((e) => e.nodeType === Node.TEXT_NODE && (e.textContent ?? "").trim() !== "");
142
159
  return t && n;
143
160
  }
144
- function j(e, t) {
161
+ function M(e, t) {
145
162
  let n = e.assignedNodes(), r = e.name ?? "slot";
146
163
  n.length ? t._internals.states.add(`has-${r}`) : t._internals.states.delete(`has-${r}`);
147
164
  }
148
- function M(e) {
165
+ function N(e) {
149
166
  return e?.label || e?.value || "";
150
167
  }
151
- function N(e, t) {
168
+ function P(e, t) {
152
169
  return e.localName === t.metadata.tag;
153
170
  }
154
- function P(e) {
171
+ function F(e) {
155
172
  let t = globalThis.document.createElement("div"), { width: n } = e.getBoundingClientRect();
156
173
  return t.setAttribute("nve-ghost", ""), t.style.minWidth = `${n}px`, t.style.maxWidth = `${n}px`, t.style.height = "1px", t.slot = e.slot, t;
157
174
  }
158
- function F(e, t) {
175
+ function I(e, t) {
159
176
  let n = e.getRootNode(), r = t.getRootNode(), i = n instanceof ShadowRoot && r instanceof ShadowRoot && n === r, a = n === globalThis.document && r === globalThis.document;
160
177
  return i || a || n === r;
161
178
  }
162
- function I(e) {
179
+ function L(e) {
163
180
  return e.style.anchorName?.split(",")?.map((e) => e.trim())?.filter((e) => e !== "none" && e !== "") ?? [];
164
181
  }
165
- function L(e, t) {
166
- let n = I(e);
167
- e.style.anchorName = n.filter((e) => e !== t).join(",");
168
- }
169
182
  function R(e, t) {
170
- e.style.anchorName = Array.from(new Set([...I(e), t])).join(",");
183
+ let n = L(e);
184
+ e.style.anchorName = n.filter((e) => e !== t).join(",");
171
185
  }
172
186
  function z(e, t) {
187
+ e.style.anchorName = Array.from(new Set([...L(e), t])).join(",");
188
+ }
189
+ function B(e, t) {
173
190
  return e.length === t.length && e.every((e, n) => e === t[n]);
174
191
  }
175
- function B(e) {
192
+ function V(e) {
176
193
  return Array.from(new Set(Array.from(e).filter((e) => typeof e == "string" && e.length > 0)));
177
194
  }
178
195
  //#endregion
179
- export { y as KeynavCode, R as appendAnchorName, o as appendRootNodeStyle, j as applySlotContentStates, u as clickOutsideElementBounds, P as createGhostElement, m as define, p as defineElement, E as endOfScrollBox, r as generateId, I as getAnchorNames, i as getAttributeChanges, a as getAttributeListChanges, n as getChildren, M as getDisplayValue, l as getElementUpdate, _ as getFlattenedDOMTree, g as getFlattenedFocusableItems, c as getPropertyChanges, O as getThemeTokens, T as hasHorizontalScrollBar, x as hasInvalidDOMGrid, w as hasScrollBar, h as isContextMenuClick, N as matchesElementName, D as openEyeDropper, d as parseTokenNumber, L as removeAnchorName, k as removeEmptySlotWhitespace, S as removeEmptyTextNode, z as sameOrderedStringArray, F as sameRenderRoot, C as scrollBarWidth, A as slotContainsOnlyWhitespace, s as styleSheetToString, f as supportsScopedRegistry, B as uniqueNonEmptyStrings, v as validKeyNavigationCode };
196
+ export { b as KeynavCode, z as appendAnchorName, s as appendRootNodeStyle, M as applySlotContentStates, d as clickOutsideElementBounds, F as createGhostElement, h as define, m as defineElement, D as endOfScrollBox, i as generateId, L as getAnchorNames, a as getAttributeChanges, o as getAttributeListChanges, r as getChildren, N as getDisplayValue, u as getElementUpdate, v as getFlattenedDOMTree, _ as getFlattenedFocusableItems, l as getPropertyChanges, k as getThemeTokens, E as hasHorizontalScrollBar, S as hasInvalidDOMGrid, T as hasScrollBar, g as isContextMenuClick, P as matchesElementName, O as openEyeDropper, f as parseTokenNumber, R as removeAnchorName, A as removeEmptySlotWhitespace, C as removeEmptyTextNode, B as sameOrderedStringArray, I as sameRenderRoot, w as scrollBarWidth, j as slotContainsOnlyWhitespace, c as styleSheetToString, p as supportsScopedRegistry, V as uniqueNonEmptyStrings, y as validKeyNavigationCode };
180
197
 
181
198
  //# sourceMappingURL=dom.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom.js","names":[],"sources":["../../../src/internal/utils/dom.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { GlobalStateService } from '../services/global.service.js';\nimport type { ElementDefinition } from '../types/index.js';\nimport { isFocusable } from './focus.js';\n\nexport function getChildren(node: Document | Node | HTMLElement): Element[] {\n if (node instanceof Document && node.documentElement) {\n return Array.from(node.documentElement.children); // root document children\n } else if (node instanceof HTMLElement && node.shadowRoot) {\n return Array.from(node.shadowRoot.children); // shadow root direct children\n } else if (node instanceof HTMLSlotElement && node.assignedElements) {\n const slotted = node.assignedElements(); // slotted elements\n return slotted.length ? slotted : Array.from(node.children); // slot fallback\n } else {\n return Array.from((node as HTMLElement).children); // light DOM direct children\n }\n}\n\nexport function generateId() {\n const uint32 = self.crypto.getRandomValues(new Uint32Array(1))[0]!;\n return `_${uint32.toString(16)}`;\n}\n\nexport function getAttributeChanges(element: HTMLElement, attr: string, fn: (attrValue: string | null) => void) {\n fn(element.getAttribute(attr));\n const observer = new MutationObserver(mutations => {\n mutations.forEach(mutation => {\n if (mutation.attributeName === attr) {\n fn((mutation.target as HTMLElement).getAttribute(attr));\n }\n });\n });\n observer.observe(element, { attributes: true, subtree: true });\n return observer;\n}\n\nexport function getAttributeListChanges(element: HTMLElement, attrs: string[], fn: (mutation: MutationRecord) => void) {\n const observer = new MutationObserver(mutations => {\n mutations.forEach(mutation => {\n if (mutation.attributeName && attrs.includes(mutation.attributeName)) {\n fn(mutation);\n }\n });\n });\n observer.observe(element, { attributes: true, subtree: true });\n return observer;\n}\n\n/**\n * Appends styles to the render root of a given element. This is useful for\n * styles that apply outside the scope of the element's shadow\n * root such as UA styles --webkit-* that won't work in a ::slotted selector\n */\nexport function appendRootNodeStyle(host: HTMLElement, styles: string) {\n const stylesheet = new CSSStyleSheet();\n stylesheet.replaceSync(styles);\n const root = host.getRootNode() as Document | ShadowRoot;\n if (root.adoptedStyleSheets) {\n const hasStyleSheet = root.adoptedStyleSheets\n .map(s => styleSheetToString(s))\n .find(s => s === styleSheetToString(stylesheet));\n if (!hasStyleSheet) {\n root.adoptedStyleSheets = [...Array.from(root.adoptedStyleSheets), stylesheet];\n }\n }\n return stylesheet;\n}\n\nexport function styleSheetToString(stylesheet: CSSStyleSheet) {\n return stylesheet.cssRules\n ? Array.from(stylesheet.cssRules)\n .map(rule => rule.cssText || '')\n .join('\\n')\n : '';\n}\n\n/** Intercepts a property setter on an element so `callback` fires on every assignment. Does not use a MutationObserver. */\nexport function getPropertyChanges(element: HTMLElement, key: string, callback: (value: unknown) => void) {\n const proto = Object.getPrototypeOf(element);\n const descriptor = Object.getOwnPropertyDescriptor(proto, key);\n if (!descriptor) return;\n const own = Object.getOwnPropertyDescriptor(element, key);\n if (own && own.configurable === false) return;\n Object.defineProperty(element, key, {\n configurable: true,\n get: descriptor.get,\n set: (val: unknown) => {\n descriptor.set!.call(element, val);\n callback(val);\n }\n });\n}\n\n/* used for cases of needing to know a property update outside of lit, example a native input value prop change */\nexport function getElementUpdate(element: HTMLElement, key: string, callback: (value: unknown) => void) {\n if (element.hasAttribute(key)) {\n callback(element.getAttribute(key));\n } else if ((element as unknown as Record<string, unknown>)[key] !== undefined) {\n callback((element as unknown as Record<string, unknown>)[key]);\n }\n\n getPropertyChanges(element, key, callback);\n return getAttributeChanges(element, key, val => callback(val));\n}\n\nexport function clickOutsideElementBounds(event: PointerEvent | MouseEvent, element: HTMLElement) {\n const { left, right, top, bottom } = element.getBoundingClientRect();\n return event.clientX < left || event.clientX > right || event.clientY < top || event.clientY > bottom;\n}\n\n/** parses number out of basic calc generated by the design tokens */\nexport function parseTokenNumber(value: string) {\n return parseInt(value.includes('calc') ? value.split('*')[1]!.replace('px)', '').trim() : value, 10) || 0;\n}\n\n/** true if the browser supports scoped custom element registries */\nexport const supportsScopedRegistry =\n globalThis.CustomElementRegistry && 'initialize' in CustomElementRegistry.prototype;\n\n/** defines an element with the given custom element registry */\nexport function defineElement(element: ElementDefinition, customElementRegistry: CustomElementRegistry) {\n Object.entries(element.elementDefinitions ?? {})\n .filter(([_tag, e]) => !customElementRegistry.get(e.metadata.tag))\n .forEach(([_tag, e]) => {\n defineElement(e, customElementRegistry);\n });\n\n if (!customElementRegistry.get(element.metadata.tag)) {\n customElementRegistry.define(element.metadata.tag, element);\n\n if (customElementRegistry === customElements) {\n GlobalStateService.dispatch('NVE_ELEMENT_DEFINE', {\n elementRegistry: { [element.metadata.tag]: element.metadata.version }\n });\n }\n }\n}\n\n/** defines an element with the global custom element registry */\nexport function define(element: ElementDefinition) {\n const { version } = element.metadata;\n\n // if scoped registry supported, register only the root element to global registry\n if (supportsScopedRegistry && !customElements.get(element.metadata.tag)) {\n customElements.define(element.metadata.tag, element);\n GlobalStateService.dispatch('NVE_ELEMENT_DEFINE', {\n elementRegistry: { [element.metadata.tag]: element.metadata.version }\n });\n } else {\n // if scoped registry not supported, register the element and all its children to the global registry\n defineElement(element, customElements);\n }\n\n // warn on duplicate version\n if (\n GlobalStateService.state.elementRegistry[element.metadata.tag] !== version &&\n globalThis?.location?.hostname === 'localhost'\n ) {\n void import('./audit-logs.js').then(m =>\n console.warn(m.getDuplicatePackageVersionWarning(element.metadata.tag, version))\n );\n }\n}\n\nexport function isContextMenuClick(event: MouseEvent) {\n return (event.buttons === 2 && !event.ctrlKey) || (event.buttons === 1 && event.ctrlKey);\n}\n\nexport function getFlattenedFocusableItems(element: Node, depth = 10) {\n return getFlattenedDOMTree(element, depth).filter((e: HTMLElement) => isFocusable(e)) as HTMLElement[];\n}\n\n/**\n * Preserves visual DOM ordering when using slots within Shadow DOM\n * See more information/resources on Shadow DOM linear traversal\n * https://nolanlawson.com/2021/02/13/managing-focus-in-the-shadow-dom/\n * https://www.abeautifulsite.net/posts/querying-through-shadow-roots/\n */\nexport function getFlattenedDOMTree(node: Node, depth = 10): HTMLElement[] {\n return (\n Array.from(getChildren(node)).reduce(\n (p: unknown[], n: Node) => [\n ...p,\n [n, [...Array.from(getChildren(n)).map(i => [i, getFlattenedDOMTree(i, depth)])]]\n ],\n []\n ) as unknown as HTMLElement[]\n ).flat(depth);\n}\n\nexport function validKeyNavigationCode(e: KeyboardEvent) {\n return keynavCodes.has(e.code);\n}\n\nexport enum KeynavCode {\n End = 'End',\n Home = 'Home',\n PageUp = 'PageUp',\n PageDown = 'PageDown',\n ArrowUp = 'ArrowUp',\n ArrowDown = 'ArrowDown',\n ArrowLeft = 'ArrowLeft',\n ArrowRight = 'ArrowRight'\n}\n\nconst keynavCodes: Set<string> = new Set(Object.values(KeynavCode));\n\nexport function hasInvalidDOMGrid(rows: HTMLElement[]) {\n return rows.some(row => row.children.length !== rows[0]!.children.length);\n}\n\nexport function removeEmptyTextNode(node: Node) {\n if ((node as Text)?.wholeText?.trim() === '') {\n (node as Text).remove();\n }\n}\n\nexport function scrollBarWidth() {\n const div = globalThis.document.createElement('div');\n div.style.setProperty('width', '100px');\n div.style.setProperty('height', '100px');\n div.style.setProperty('overflow', 'scroll');\n div.style.setProperty('position', 'absolute');\n div.style.setProperty('top', '-9999px');\n globalThis.document.body.appendChild(div);\n const width = div.offsetWidth - div.clientWidth;\n globalThis.document.body.removeChild(div);\n return width;\n}\n\nexport function hasScrollBar(el: HTMLElement) {\n return el.scrollHeight > el.clientHeight;\n}\n\nexport function hasHorizontalScrollBar(el: HTMLElement) {\n return el.scrollWidth > el.clientWidth;\n}\n\nexport function endOfScrollBox(element: HTMLElement, offset = 0) {\n return element.scrollTop + element.offsetHeight + offset >= element.scrollHeight;\n}\n\nexport async function openEyeDropper(): Promise<string> {\n return await new (\n globalThis as unknown as { EyeDropper: new () => { open: () => Promise<{ sRGBHex: string }> } }\n ).EyeDropper()\n .open()\n .then((color: { sRGBHex: string }) => color.sRGBHex);\n}\n\n/**\n * provides a object with key/value of the currently applied design tokens\n */\nexport function getThemeTokens(element = globalThis.document.querySelector(':root')!) {\n // default root or provided element\n const styles = getComputedStyle(element);\n let parent: CSSStyleSheet[] = [];\n\n // check for parent iframe, same domain iframes change how the browser accesses style sheets\n try {\n parent = Array.from(globalThis.parent.document.styleSheets);\n } catch {\n // if not accessible, skip\n }\n\n return [...parent, ...Array.from(globalThis.document.styleSheets)]\n .reduce((finalArr: string[][], sheet) => {\n let rules: CSSRule[] = [];\n try {\n rules = [...sheet.cssRules];\n } catch {\n // if the style sheet is not accessible, skip\n }\n return finalArr.concat(\n rules\n .filter(rule => rule.type === 1)\n .reduce((propValArr: string[][], rule) => {\n const props = [...(rule as CSSStyleRule).style]\n .filter((p: string) => p.trim().includes('--nve'))\n .map((propName: string) => [\n propName.trim(),\n (rule as CSSStyleRule).style.getPropertyValue(propName).trim()\n ]);\n return [...propValArr, ...props];\n }, [])\n );\n }, [])\n .reduce(\n (p: Record<string, string>, token: string[]) => ({ ...p, [token[0]!]: styles.getPropertyValue(token[0]!) }),\n {}\n );\n}\n\nexport function removeEmptySlotWhitespace(slot: HTMLSlotElement) {\n if (slotContainsOnlyWhitespace(slot)) {\n slot.assignedNodes().forEach((node: Node) => node.parentNode?.removeChild(node));\n }\n}\n\nexport function slotContainsOnlyWhitespace(slot: HTMLSlotElement) {\n const hasNoElements = !slot.assignedNodes().find(i => i.nodeType !== Node.TEXT_NODE);\n const hasOnlyEmptyTextNodes = !slot\n .assignedNodes()\n .find(i => i.nodeType === Node.TEXT_NODE && (i.textContent ?? '').trim() !== '');\n return hasNoElements && hasOnlyEmptyTextNodes;\n}\n\nexport function applySlotContentStates(slot: HTMLSlotElement, element: HTMLElement & { _internals: ElementInternals }) {\n const nodes = slot.assignedNodes();\n const name = slot.name ?? 'slot';\n\n if (nodes.length) {\n element._internals.states.add(`has-${name}`);\n } else {\n element._internals.states.delete(`has-${name}`);\n }\n}\n\nexport function getDisplayValue(option?: { label?: string; value?: string }): string {\n return option?.label || option?.value || '';\n}\n\n/** determines if HTML element matches the given component tag */\nexport function matchesElementName(element: Partial<HTMLElement>, component: { metadata: { tag: string } }) {\n return element.localName === component.metadata.tag;\n}\n\nexport function createGhostElement(sourceElement: HTMLElement) {\n const ghost = globalThis.document.createElement('div');\n const { width } = sourceElement.getBoundingClientRect();\n ghost.setAttribute('nve-ghost', '');\n ghost.style.minWidth = `${width}px`;\n ghost.style.maxWidth = `${width}px`;\n ghost.style.height = '1px';\n ghost.slot = sourceElement.slot;\n return ghost;\n}\n\nexport function sameRenderRoot(element1: HTMLElement, element2: HTMLElement) {\n const root1 = element1.getRootNode();\n const root2 = element2.getRootNode();\n const sameShadowRoot = root1 instanceof ShadowRoot && root2 instanceof ShadowRoot && root1 === root2;\n const sameDocumentRoot = root1 === globalThis.document && root2 === globalThis.document;\n const sameUnattachedRoot = root1 === root2;\n return sameShadowRoot || sameDocumentRoot || sameUnattachedRoot;\n}\n\nexport function getAnchorNames(element: HTMLElement): string[] {\n return (\n element.style.anchorName\n ?.split(',')\n ?.map(name => name.trim())\n ?.filter(name => name !== 'none' && name !== '') ?? []\n );\n}\n\nexport function removeAnchorName(element: HTMLElement, name: string) {\n const anchorNames = getAnchorNames(element);\n element.style.anchorName = anchorNames.filter(i => i !== name).join(',');\n}\n\nexport function appendAnchorName(element: HTMLElement, name: string) {\n element.style.anchorName = Array.from(new Set([...getAnchorNames(element), name])).join(',');\n}\n\n/**\n * Returns true when both arrays have the same length and each index is strictly equal (`===`).\n */\nexport function sameOrderedStringArray(a: readonly string[], b: readonly string[]): boolean {\n return a.length === b.length && a.every((value, index) => value === b[index]);\n}\n\n/**\n * Returns unique non-empty strings in first-seen order (insertion order of a `Set` over the filtered list).\n */\nexport function uniqueNonEmptyStrings(values: Iterable<string | null | undefined>): string[] {\n return Array.from(\n new Set(Array.from(values).filter((value): value is string => typeof value === 'string' && value.length > 0))\n );\n}\n"],"mappings":";;;AAOA,SAAgB,EAAY,GAAgD;CAC1E,IAAI,aAAgB,YAAY,EAAK,iBACnC,OAAO,MAAM,KAAK,EAAK,gBAAgB,QAAQ;CAC1C,IAAI,aAAgB,eAAe,EAAK,YAC7C,OAAO,MAAM,KAAK,EAAK,WAAW,QAAQ;CACrC,IAAI,aAAgB,mBAAmB,EAAK,kBAAkB;EACnE,IAAM,IAAU,EAAK,iBAAiB;EACtC,OAAO,EAAQ,SAAS,IAAU,MAAM,KAAK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AC,EAAE,KAAK,GAAG;AAC7F;AAKA,SAAgB,EAAuB,GAAsB,GAA+B;CAC1F,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,GAAO,MAAU,MAAU,EAAE,EAAM;AAC9E;AAKA,SAAgB,EAAsB,GAAuD;CAC3F,OAAO,MAAM,KACX,IAAI,IAAI,MAAM,KAAK,CAAM,EAAE,QAAQ,MAA2B,OAAO,KAAU,YAAY,EAAM,SAAS,CAAC,CAAC,CAC9G;AACF"}
1
+ {"version":3,"file":"dom.js","names":[],"sources":["../../../src/internal/utils/dom.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { GlobalStateService } from '../services/global.service.js';\nimport { LogService } from '../services/log.service.js';\nimport type { ElementDefinition } from '../types/index.js';\nimport { isFocusable } from './focus.js';\n\nexport function getChildren(node: Document | Node | HTMLElement): Element[] {\n if (node instanceof Document && node.documentElement) {\n return Array.from(node.documentElement.children); // root document children\n } else if (node instanceof HTMLElement && node.shadowRoot) {\n return Array.from(node.shadowRoot.children); // shadow root direct children\n } else if (node instanceof HTMLSlotElement && node.assignedElements) {\n const slotted = node.assignedElements(); // slotted elements\n return slotted.length ? slotted : Array.from(node.children); // slot fallback\n } else {\n return Array.from((node as HTMLElement).children); // light DOM direct children\n }\n}\n\nexport function generateId() {\n const uint32 = self.crypto.getRandomValues(new Uint32Array(1))[0]!;\n return `_${uint32.toString(16)}`;\n}\n\nexport function getAttributeChanges(element: HTMLElement, attr: string, fn: (attrValue: string | null) => void) {\n fn(element.getAttribute(attr));\n const observer = new MutationObserver(mutations => {\n mutations.forEach(mutation => {\n if (mutation.attributeName === attr) {\n fn((mutation.target as HTMLElement).getAttribute(attr));\n }\n });\n });\n observer.observe(element, { attributes: true, subtree: true });\n return observer;\n}\n\nexport function getAttributeListChanges(element: HTMLElement, attrs: string[], fn: (mutation: MutationRecord) => void) {\n const observer = new MutationObserver(mutations => {\n mutations.forEach(mutation => {\n if (mutation.attributeName && attrs.includes(mutation.attributeName)) {\n fn(mutation);\n }\n });\n });\n observer.observe(element, { attributes: true, subtree: true });\n return observer;\n}\n\n/**\n * Appends styles to the render root of a given element. This is useful for\n * styles that apply outside the scope of the element's shadow\n * root such as UA styles --webkit-* that won't work in a ::slotted selector\n */\nexport function appendRootNodeStyle(host: HTMLElement, styles: string) {\n const stylesheet = new CSSStyleSheet();\n stylesheet.replaceSync(styles);\n const root = host.getRootNode() as Document | ShadowRoot;\n if (root.adoptedStyleSheets) {\n const hasStyleSheet = root.adoptedStyleSheets\n .map(s => styleSheetToString(s))\n .find(s => s === styleSheetToString(stylesheet));\n if (!hasStyleSheet) {\n root.adoptedStyleSheets = [...Array.from(root.adoptedStyleSheets), stylesheet];\n }\n }\n return stylesheet;\n}\n\nexport function styleSheetToString(stylesheet: CSSStyleSheet) {\n return stylesheet.cssRules\n ? Array.from(stylesheet.cssRules)\n .map(rule => rule.cssText || '')\n .join('\\n')\n : '';\n}\n\n/** Intercepts a property setter on an element so `callback` fires on every assignment. Does not use a MutationObserver. */\nexport function getPropertyChanges(element: HTMLElement, key: string, callback: (value: unknown) => void) {\n const proto = Object.getPrototypeOf(element);\n const descriptor = Object.getOwnPropertyDescriptor(proto, key);\n if (!descriptor) return;\n const own = Object.getOwnPropertyDescriptor(element, key);\n if (own && own.configurable === false) return;\n Object.defineProperty(element, key, {\n configurable: true,\n get: descriptor.get,\n set: (val: unknown) => {\n descriptor.set!.call(element, val);\n callback(val);\n }\n });\n\n return () => {\n if (own) {\n Object.defineProperty(element, key, own);\n return;\n }\n\n Reflect.deleteProperty(element, key);\n };\n}\n\n/* used for cases of needing to know a property update outside of lit, example a native input value prop change */\nexport function getElementUpdate(element: HTMLElement, key: string, callback: (value: unknown) => void) {\n if (element.hasAttribute(key)) {\n callback(element.getAttribute(key));\n } else if ((element as unknown as Record<string, unknown>)[key] !== undefined) {\n callback((element as unknown as Record<string, unknown>)[key]);\n }\n\n const cleanupPropertyChanges = getPropertyChanges(element, key, callback);\n const observer = getAttributeChanges(element, key, val => callback(val));\n const disconnect = observer.disconnect.bind(observer);\n\n observer.disconnect = () => {\n cleanupPropertyChanges?.();\n disconnect();\n };\n\n return observer;\n}\n\nexport function clickOutsideElementBounds(event: PointerEvent | MouseEvent, element: HTMLElement) {\n const { left, right, top, bottom } = element.getBoundingClientRect();\n return event.clientX < left || event.clientX > right || event.clientY < top || event.clientY > bottom;\n}\n\n/** parses number out of basic calc generated by the design tokens */\nexport function parseTokenNumber(value: string) {\n return parseInt(value.includes('calc') ? value.split('*')[1]!.replace('px)', '').trim() : value, 10) || 0;\n}\n\n/** true if the browser supports scoped custom element registries */\nexport const supportsScopedRegistry =\n globalThis.CustomElementRegistry && 'initialize' in CustomElementRegistry.prototype;\n\n/** defines an element with the given custom element registry */\nexport function defineElement(element: ElementDefinition, customElementRegistry: CustomElementRegistry) {\n Object.entries(element.elementDefinitions ?? {})\n .filter(([_tag, e]) => !customElementRegistry.get(e.metadata.tag))\n .forEach(([_tag, e]) => {\n defineElement(e, customElementRegistry);\n });\n\n if (!customElementRegistry.get(element.metadata.tag)) {\n customElementRegistry.define(element.metadata.tag, element);\n\n if (customElementRegistry === customElements) {\n GlobalStateService.dispatch('NVE_ELEMENT_DEFINE', {\n elementRegistry: { [element.metadata.tag]: element.metadata.version }\n });\n }\n }\n}\n\n/** defines an element with the global custom element registry */\nexport function define(element: ElementDefinition) {\n const { version } = element.metadata;\n\n // if scoped registry supported, register only the root element to global registry\n if (supportsScopedRegistry && !customElements.get(element.metadata.tag)) {\n customElements.define(element.metadata.tag, element);\n GlobalStateService.dispatch('NVE_ELEMENT_DEFINE', {\n elementRegistry: { [element.metadata.tag]: element.metadata.version }\n });\n } else {\n // if scoped registry not supported, register the element and all its children to the global registry\n defineElement(element, customElements);\n }\n\n // warn on duplicate version\n if (\n GlobalStateService.state.elementRegistry[element.metadata.tag] !== version &&\n globalThis?.location?.hostname === 'localhost'\n ) {\n void import('./audit-logs.js').then(m =>\n console.warn(m.getDuplicatePackageVersionWarning(element.metadata.tag, version))\n );\n }\n}\n\nexport function isContextMenuClick(event: MouseEvent) {\n return (event.buttons === 2 && !event.ctrlKey) || (event.buttons === 1 && event.ctrlKey);\n}\n\nexport function getFlattenedFocusableItems(element: Node, depth = 10) {\n return getFlattenedDOMTree(element, depth).filter((e: HTMLElement) => isFocusable(e)) as HTMLElement[];\n}\n\n/**\n * Preserves visual DOM ordering when using slots within Shadow DOM\n * See more information/resources on Shadow DOM linear traversal\n * https://nolanlawson.com/2021/02/13/managing-focus-in-the-shadow-dom/\n * https://www.abeautifulsite.net/posts/querying-through-shadow-roots/\n */\nexport function getFlattenedDOMTree(node: Node, depth = 10): HTMLElement[] {\n return (\n Array.from(getChildren(node)).reduce(\n (p: unknown[], n: Node) => [\n ...p,\n [n, [...Array.from(getChildren(n)).map(i => [i, getFlattenedDOMTree(i, depth)])]]\n ],\n []\n ) as unknown as HTMLElement[]\n ).flat(depth);\n}\n\nexport function validKeyNavigationCode(e: KeyboardEvent) {\n return keynavCodes.has(e.code);\n}\n\nexport enum KeynavCode {\n End = 'End',\n Home = 'Home',\n PageUp = 'PageUp',\n PageDown = 'PageDown',\n ArrowUp = 'ArrowUp',\n ArrowDown = 'ArrowDown',\n ArrowLeft = 'ArrowLeft',\n ArrowRight = 'ArrowRight'\n}\n\nconst keynavCodes: Set<string> = new Set(Object.values(KeynavCode));\n\nexport function hasInvalidDOMGrid(rows: HTMLElement[]) {\n return rows.some(row => row.children.length !== rows[0]!.children.length);\n}\n\nexport function removeEmptyTextNode(node: Node) {\n if ((node as Text)?.wholeText?.trim() === '') {\n (node as Text).remove();\n }\n}\n\nexport function scrollBarWidth() {\n const div = globalThis.document.createElement('div');\n div.style.setProperty('width', '100px');\n div.style.setProperty('height', '100px');\n div.style.setProperty('overflow', 'scroll');\n div.style.setProperty('position', 'absolute');\n div.style.setProperty('top', '-9999px');\n globalThis.document.body.appendChild(div);\n const width = div.offsetWidth - div.clientWidth;\n globalThis.document.body.removeChild(div);\n return width;\n}\n\nexport function hasScrollBar(el: HTMLElement) {\n return el.scrollHeight > el.clientHeight;\n}\n\nexport function hasHorizontalScrollBar(el: HTMLElement) {\n return el.scrollWidth > el.clientWidth;\n}\n\nexport function endOfScrollBox(element: HTMLElement, offset = 0) {\n return element.scrollTop + element.offsetHeight + offset >= element.scrollHeight;\n}\n\nexport async function openEyeDropper(): Promise<string> {\n const EyeDropperConstructor = (\n globalThis as unknown as { EyeDropper?: new () => { open: () => Promise<{ sRGBHex: string }> } }\n ).EyeDropper;\n\n if (!EyeDropperConstructor) {\n LogService.warn('EyeDropper API is unavailable');\n return '';\n }\n\n try {\n return (await new EyeDropperConstructor().open()).sRGBHex;\n } catch (e) {\n LogService.warn(`EyeDropper selection failed: ${(e as Error).message}`);\n return '';\n }\n}\n\n/**\n * provides a object with key/value of the currently applied design tokens\n */\nexport function getThemeTokens(element = globalThis.document.querySelector(':root')!) {\n // default root or provided element\n const styles = getComputedStyle(element);\n let parent: CSSStyleSheet[] = [];\n\n // check for parent iframe, same domain iframes change how the browser accesses style sheets\n try {\n parent = Array.from(globalThis.parent.document.styleSheets);\n } catch {\n // if not accessible, skip\n }\n\n return [...parent, ...Array.from(globalThis.document.styleSheets)]\n .reduce((finalArr: string[][], sheet) => {\n let rules: CSSRule[] = [];\n try {\n rules = [...sheet.cssRules];\n } catch {\n // if the style sheet is not accessible, skip\n }\n return finalArr.concat(\n rules\n .filter(rule => rule.type === 1)\n .reduce((propValArr: string[][], rule) => {\n const props = [...(rule as CSSStyleRule).style]\n .filter((p: string) => p.trim().includes('--nve'))\n .map((propName: string) => [\n propName.trim(),\n (rule as CSSStyleRule).style.getPropertyValue(propName).trim()\n ]);\n return [...propValArr, ...props];\n }, [])\n );\n }, [])\n .reduce(\n (p: Record<string, string>, token: string[]) => ({ ...p, [token[0]!]: styles.getPropertyValue(token[0]!) }),\n {}\n );\n}\n\nexport function removeEmptySlotWhitespace(slot: HTMLSlotElement) {\n if (slotContainsOnlyWhitespace(slot)) {\n slot.assignedNodes().forEach((node: Node) => node.parentNode?.removeChild(node));\n }\n}\n\nexport function slotContainsOnlyWhitespace(slot: HTMLSlotElement) {\n const hasNoElements = !slot.assignedNodes().find(i => i.nodeType !== Node.TEXT_NODE);\n const hasOnlyEmptyTextNodes = !slot\n .assignedNodes()\n .find(i => i.nodeType === Node.TEXT_NODE && (i.textContent ?? '').trim() !== '');\n return hasNoElements && hasOnlyEmptyTextNodes;\n}\n\nexport function applySlotContentStates(slot: HTMLSlotElement, element: HTMLElement & { _internals: ElementInternals }) {\n const nodes = slot.assignedNodes();\n const name = slot.name ?? 'slot';\n\n if (nodes.length) {\n element._internals.states.add(`has-${name}`);\n } else {\n element._internals.states.delete(`has-${name}`);\n }\n}\n\nexport function getDisplayValue(option?: { label?: string; value?: string }): string {\n return option?.label || option?.value || '';\n}\n\n/** determines if HTML element matches the given component tag */\nexport function matchesElementName(element: Partial<HTMLElement>, component: { metadata: { tag: string } }) {\n return element.localName === component.metadata.tag;\n}\n\nexport function createGhostElement(sourceElement: HTMLElement) {\n const ghost = globalThis.document.createElement('div');\n const { width } = sourceElement.getBoundingClientRect();\n ghost.setAttribute('nve-ghost', '');\n ghost.style.minWidth = `${width}px`;\n ghost.style.maxWidth = `${width}px`;\n ghost.style.height = '1px';\n ghost.slot = sourceElement.slot;\n return ghost;\n}\n\nexport function sameRenderRoot(element1: HTMLElement, element2: HTMLElement) {\n const root1 = element1.getRootNode();\n const root2 = element2.getRootNode();\n const sameShadowRoot = root1 instanceof ShadowRoot && root2 instanceof ShadowRoot && root1 === root2;\n const sameDocumentRoot = root1 === globalThis.document && root2 === globalThis.document;\n const sameUnattachedRoot = root1 === root2;\n return sameShadowRoot || sameDocumentRoot || sameUnattachedRoot;\n}\n\nexport function getAnchorNames(element: HTMLElement): string[] {\n return (\n element.style.anchorName\n ?.split(',')\n ?.map(name => name.trim())\n ?.filter(name => name !== 'none' && name !== '') ?? []\n );\n}\n\nexport function removeAnchorName(element: HTMLElement, name: string) {\n const anchorNames = getAnchorNames(element);\n element.style.anchorName = anchorNames.filter(i => i !== name).join(',');\n}\n\nexport function appendAnchorName(element: HTMLElement, name: string) {\n element.style.anchorName = Array.from(new Set([...getAnchorNames(element), name])).join(',');\n}\n\n/**\n * Returns true when both arrays have the same length and each index is strictly equal (`===`).\n */\nexport function sameOrderedStringArray(a: readonly string[], b: readonly string[]): boolean {\n return a.length === b.length && a.every((value, index) => value === b[index]);\n}\n\n/**\n * Returns unique non-empty strings in first-seen order (insertion order of a `Set` over the filtered list).\n */\nexport function uniqueNonEmptyStrings(values: Iterable<string | null | undefined>): string[] {\n return Array.from(\n new Set(Array.from(values).filter((value): value is string => typeof value === 'string' && value.length > 0))\n );\n}\n"],"mappings":";;;;AAQA,SAAgB,EAAY,GAAgD;CAC1E,IAAI,aAAgB,YAAY,EAAK,iBACnC,OAAO,MAAM,KAAK,EAAK,gBAAgB,QAAQ;CAC1C,IAAI,aAAgB,eAAe,EAAK,YAC7C,OAAO,MAAM,KAAK,EAAK,WAAW,QAAQ;CACrC,IAAI,aAAgB,mBAAmB,EAAK,kBAAkB;EACnE,IAAM,IAAU,EAAK,iBAAiB;EACtC,OAAO,EAAQ,SAAS,IAAU,MAAM,KAAK,EAAK,QAAQ;CAC5D,OACE,OAAO,MAAM,KAAM,EAAqB,QAAQ;AAEpD;AAEA,SAAgB,IAAa;CAE3B,OAAO,IADQ,KAAK,OAAO,gBAAgB,IAAI,YAAY,CAAC,CAAC,EAAE,GAC7C,SAAS,EAAE;AAC/B;AAEA,SAAgB,EAAoB,GAAsB,GAAc,GAAwC;CAC9G,EAAG,EAAQ,aAAa,CAAI,CAAC;CAC7B,IAAM,IAAW,IAAI,kBAAiB,MAAa;EACjD,EAAU,SAAQ,MAAY;GAC5B,AAAI,EAAS,kBAAkB,KAC7B,EAAI,EAAS,OAAuB,aAAa,CAAI,CAAC;EAE1D,CAAC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