@govtechsg/sgds-web-component 3.6.0-rc.2 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/base/button.js +1 -1
  2. package/components/Alert/index.umd.min.js +17 -17
  3. package/components/Alert/index.umd.min.js.map +1 -1
  4. package/components/Alert/sgds-alert.d.ts +1 -1
  5. package/components/Alert/sgds-alert.js +2 -2
  6. package/components/Alert/sgds-alert.js.map +1 -1
  7. package/components/Badge/index.umd.min.js +16 -16
  8. package/components/Badge/index.umd.min.js.map +1 -1
  9. package/components/Badge/sgds-badge.d.ts +1 -1
  10. package/components/Badge/sgds-badge.js +2 -2
  11. package/components/Badge/sgds-badge.js.map +1 -1
  12. package/components/Breadcrumb/index.umd.min.js +17 -17
  13. package/components/Breadcrumb/index.umd.min.js.map +1 -1
  14. package/components/Breadcrumb/sgds-breadcrumb-item.d.ts +1 -0
  15. package/components/Breadcrumb/sgds-breadcrumb-item.js +5 -2
  16. package/components/Breadcrumb/sgds-breadcrumb-item.js.map +1 -1
  17. package/components/Button/index.umd.min.js +1 -1
  18. package/components/Card/index.umd.min.js.map +1 -1
  19. package/components/Card/sgds-card.js.map +1 -1
  20. package/components/CloseButton/close-button.js +6 -0
  21. package/components/CloseButton/index.js +5 -0
  22. package/components/CloseButton/index.js.map +1 -0
  23. package/components/CloseButton/index.umd.min.js +50 -0
  24. package/components/CloseButton/index.umd.min.js.map +1 -0
  25. package/{internals → components}/CloseButton/sgds-close-button.d.ts +2 -4
  26. package/{internals → components}/CloseButton/sgds-close-button.js +4 -10
  27. package/components/CloseButton/sgds-close-button.js.map +1 -0
  28. package/components/ComboBox/index.umd.min.js +18 -18
  29. package/components/ComboBox/index.umd.min.js.map +1 -1
  30. package/components/Datepicker/index.umd.min.js +1 -1
  31. package/components/Datepicker/index.umd.min.js.map +1 -1
  32. package/components/Drawer/index.umd.min.js +6 -11
  33. package/components/Drawer/index.umd.min.js.map +1 -1
  34. package/components/Drawer/sgds-drawer.d.ts +1 -1
  35. package/components/Drawer/sgds-drawer.js +1 -1
  36. package/components/Drawer/sgds-drawer.js.map +1 -1
  37. package/components/FileUpload/index.umd.min.js +26 -26
  38. package/components/FileUpload/index.umd.min.js.map +1 -1
  39. package/components/FileUpload/sgds-file-upload.d.ts +1 -1
  40. package/components/FileUpload/sgds-file-upload.js +1 -1
  41. package/components/FileUpload/sgds-file-upload.js.map +1 -1
  42. package/components/Footer/footer-item.js +1 -1
  43. package/components/Footer/footer.js +1 -1
  44. package/components/Footer/index.umd.min.js +17 -17
  45. package/components/Footer/index.umd.min.js.map +1 -1
  46. package/components/Footer/sgds-footer-item.d.ts +1 -0
  47. package/components/Footer/sgds-footer-item.js +11 -1
  48. package/components/Footer/sgds-footer-item.js.map +1 -1
  49. package/components/Footer/sgds-footer.js +7 -7
  50. package/components/Footer/sgds-footer.js.map +1 -1
  51. package/components/IconButton/index.umd.min.js +1 -1
  52. package/components/IconCard/index.umd.min.js.map +1 -1
  53. package/components/IconCard/sgds-icon-card.js.map +1 -1
  54. package/components/ImageCard/index.umd.min.js.map +1 -1
  55. package/components/ImageCard/sgds-image-card.js.map +1 -1
  56. package/components/Input/index.umd.min.js.map +1 -1
  57. package/components/Input/sgds-input.js.map +1 -1
  58. package/components/Link/index.umd.min.js +9 -9
  59. package/components/Link/index.umd.min.js.map +1 -1
  60. package/components/Link/link.js +1 -1
  61. package/components/Link/sgds-link.d.ts +7 -1
  62. package/components/Link/sgds-link.js +28 -2
  63. package/components/Link/sgds-link.js.map +1 -1
  64. package/components/Mainnav/index.umd.min.js +1 -1
  65. package/components/Modal/index.umd.min.js +4 -4
  66. package/components/Modal/index.umd.min.js.map +1 -1
  67. package/components/Modal/sgds-modal.d.ts +1 -1
  68. package/components/Modal/sgds-modal.js +2 -2
  69. package/components/Modal/sgds-modal.js.map +1 -1
  70. package/components/Pagination/index.umd.min.js +1 -1
  71. package/components/QuantityToggle/index.umd.min.js +1 -1
  72. package/components/QuantityToggle/index.umd.min.js.map +1 -1
  73. package/components/Subnav/index.umd.min.js +11 -9
  74. package/components/Subnav/index.umd.min.js.map +1 -1
  75. package/components/Subnav/sgds-subnav.d.ts +4 -0
  76. package/components/Subnav/sgds-subnav.js +18 -2
  77. package/components/Subnav/sgds-subnav.js.map +1 -1
  78. package/components/Subnav/subnav.js +1 -1
  79. package/components/SystemBanner/index.d.ts +6 -0
  80. package/components/SystemBanner/index.js +6 -0
  81. package/components/SystemBanner/index.js.map +1 -0
  82. package/components/SystemBanner/index.umd.min.js +2101 -0
  83. package/components/SystemBanner/index.umd.min.js.map +1 -0
  84. package/components/SystemBanner/sgds-system-banner-item.d.ts +24 -0
  85. package/components/SystemBanner/sgds-system-banner-item.js +93 -0
  86. package/components/SystemBanner/sgds-system-banner-item.js.map +1 -0
  87. package/components/SystemBanner/sgds-system-banner.d.ts +51 -0
  88. package/components/SystemBanner/sgds-system-banner.js +224 -0
  89. package/components/SystemBanner/sgds-system-banner.js.map +1 -0
  90. package/components/SystemBanner/system-banner-context.d.ts +3 -0
  91. package/components/SystemBanner/system-banner-context.js +6 -0
  92. package/components/SystemBanner/system-banner-context.js.map +1 -0
  93. package/components/SystemBanner/system-banner-item.js +6 -0
  94. package/components/SystemBanner/system-banner-item.js.map +1 -0
  95. package/components/SystemBanner/system-banner.js +6 -0
  96. package/components/SystemBanner/system-banner.js.map +1 -0
  97. package/components/Toast/index.umd.min.js +12 -12
  98. package/components/Toast/index.umd.min.js.map +1 -1
  99. package/components/Toast/sgds-toast.d.ts +1 -1
  100. package/components/Toast/sgds-toast.js +2 -2
  101. package/components/Toast/sgds-toast.js.map +1 -1
  102. package/components/index.d.ts +2 -0
  103. package/components/index.js +2 -0
  104. package/components/index.js.map +1 -1
  105. package/components/index.umd.min.js +168 -136
  106. package/components/index.umd.min.js.map +1 -1
  107. package/css/fouc.css +3 -0
  108. package/index.d.ts +3 -1
  109. package/index.js +3 -1
  110. package/index.js.map +1 -1
  111. package/index.umd.min.js +212 -161
  112. package/index.umd.min.js.map +1 -1
  113. package/package.json +1 -1
  114. package/react/base/button.cjs.js +1 -1
  115. package/react/base/button.js +1 -1
  116. package/react/close-button/index.cjs.js +40 -0
  117. package/react/close-button/index.cjs.js.map +1 -0
  118. package/react/close-button/index.d.ts +2 -0
  119. package/react/close-button/index.js +16 -0
  120. package/react/close-button/index.js.map +1 -0
  121. package/react/components/Alert/sgds-alert.cjs.js +2 -2
  122. package/react/components/Alert/sgds-alert.cjs.js.map +1 -1
  123. package/react/components/Alert/sgds-alert.js +2 -2
  124. package/react/components/Alert/sgds-alert.js.map +1 -1
  125. package/react/components/Badge/sgds-badge.cjs.js +2 -2
  126. package/react/components/Badge/sgds-badge.cjs.js.map +1 -1
  127. package/react/components/Badge/sgds-badge.js +2 -2
  128. package/react/components/Badge/sgds-badge.js.map +1 -1
  129. package/react/components/Breadcrumb/sgds-breadcrumb-item.cjs.js +5 -2
  130. package/react/components/Breadcrumb/sgds-breadcrumb-item.cjs.js.map +1 -1
  131. package/react/components/Breadcrumb/sgds-breadcrumb-item.js +5 -2
  132. package/react/components/Breadcrumb/sgds-breadcrumb-item.js.map +1 -1
  133. package/react/components/Card/sgds-card.cjs.js.map +1 -1
  134. package/react/components/Card/sgds-card.js.map +1 -1
  135. package/react/components/CloseButton/close-button.cjs.js +11 -0
  136. package/react/components/CloseButton/close-button.js +7 -0
  137. package/react/{internals → components}/CloseButton/sgds-close-button.cjs.js +4 -10
  138. package/react/components/CloseButton/sgds-close-button.cjs.js.map +1 -0
  139. package/react/{internals → components}/CloseButton/sgds-close-button.js +4 -10
  140. package/react/components/CloseButton/sgds-close-button.js.map +1 -0
  141. package/react/components/Drawer/sgds-drawer.cjs.js +1 -1
  142. package/react/components/Drawer/sgds-drawer.cjs.js.map +1 -1
  143. package/react/components/Drawer/sgds-drawer.js +1 -1
  144. package/react/components/Drawer/sgds-drawer.js.map +1 -1
  145. package/react/components/FileUpload/sgds-file-upload.cjs.js +1 -1
  146. package/react/components/FileUpload/sgds-file-upload.cjs.js.map +1 -1
  147. package/react/components/FileUpload/sgds-file-upload.js +1 -1
  148. package/react/components/FileUpload/sgds-file-upload.js.map +1 -1
  149. package/react/components/Footer/footer-item.cjs.js +1 -1
  150. package/react/components/Footer/footer-item.js +1 -1
  151. package/react/components/Footer/footer.cjs.js +1 -1
  152. package/react/components/Footer/footer.js +1 -1
  153. package/react/components/Footer/sgds-footer-item.cjs.js +11 -1
  154. package/react/components/Footer/sgds-footer-item.cjs.js.map +1 -1
  155. package/react/components/Footer/sgds-footer-item.js +11 -1
  156. package/react/components/Footer/sgds-footer-item.js.map +1 -1
  157. package/react/components/Footer/sgds-footer.cjs.js +7 -7
  158. package/react/components/Footer/sgds-footer.cjs.js.map +1 -1
  159. package/react/components/Footer/sgds-footer.js +7 -7
  160. package/react/components/Footer/sgds-footer.js.map +1 -1
  161. package/react/components/IconCard/sgds-icon-card.cjs.js.map +1 -1
  162. package/react/components/IconCard/sgds-icon-card.js.map +1 -1
  163. package/react/components/ImageCard/sgds-image-card.cjs.js.map +1 -1
  164. package/react/components/ImageCard/sgds-image-card.js.map +1 -1
  165. package/react/components/Input/sgds-input.cjs.js.map +1 -1
  166. package/react/components/Input/sgds-input.js.map +1 -1
  167. package/react/components/Link/link.cjs.js +1 -1
  168. package/react/components/Link/link.js +1 -1
  169. package/react/components/Link/sgds-link.cjs.js +28 -2
  170. package/react/components/Link/sgds-link.cjs.js.map +1 -1
  171. package/react/components/Link/sgds-link.js +28 -2
  172. package/react/components/Link/sgds-link.js.map +1 -1
  173. package/react/components/Modal/sgds-modal.cjs.js +2 -2
  174. package/react/components/Modal/sgds-modal.cjs.js.map +1 -1
  175. package/react/components/Modal/sgds-modal.js +2 -2
  176. package/react/components/Modal/sgds-modal.js.map +1 -1
  177. package/react/components/Subnav/sgds-subnav.cjs.js +17 -1
  178. package/react/components/Subnav/sgds-subnav.cjs.js.map +1 -1
  179. package/react/components/Subnav/sgds-subnav.js +18 -2
  180. package/react/components/Subnav/sgds-subnav.js.map +1 -1
  181. package/react/components/Subnav/subnav.cjs.js +1 -1
  182. package/react/components/Subnav/subnav.js +1 -1
  183. package/react/components/SystemBanner/sgds-system-banner-item.cjs.js +99 -0
  184. package/react/components/SystemBanner/sgds-system-banner-item.cjs.js.map +1 -0
  185. package/react/components/SystemBanner/sgds-system-banner-item.js +94 -0
  186. package/react/components/SystemBanner/sgds-system-banner-item.js.map +1 -0
  187. package/react/components/SystemBanner/sgds-system-banner.cjs.js +230 -0
  188. package/react/components/SystemBanner/sgds-system-banner.cjs.js.map +1 -0
  189. package/react/components/SystemBanner/sgds-system-banner.js +225 -0
  190. package/react/components/SystemBanner/sgds-system-banner.js.map +1 -0
  191. package/react/components/SystemBanner/system-banner-context.cjs.js +11 -0
  192. package/react/components/SystemBanner/system-banner-context.cjs.js.map +1 -0
  193. package/react/components/SystemBanner/system-banner-context.js +7 -0
  194. package/react/components/SystemBanner/system-banner-context.js.map +1 -0
  195. package/react/components/SystemBanner/system-banner-item.cjs.js +11 -0
  196. package/react/components/SystemBanner/system-banner-item.cjs.js.map +1 -0
  197. package/react/components/SystemBanner/system-banner-item.js +7 -0
  198. package/react/components/SystemBanner/system-banner-item.js.map +1 -0
  199. package/react/components/SystemBanner/system-banner.cjs.js +11 -0
  200. package/react/components/SystemBanner/system-banner.cjs.js.map +1 -0
  201. package/react/components/SystemBanner/system-banner.js +7 -0
  202. package/react/components/SystemBanner/system-banner.js.map +1 -0
  203. package/react/components/Toast/sgds-toast.cjs.js +2 -2
  204. package/react/components/Toast/sgds-toast.cjs.js.map +1 -1
  205. package/react/components/Toast/sgds-toast.js +2 -2
  206. package/react/components/Toast/sgds-toast.js.map +1 -1
  207. package/react/index.cjs.js +114 -108
  208. package/react/index.cjs.js.map +1 -1
  209. package/react/index.d.ts +3 -0
  210. package/react/index.js +3 -0
  211. package/react/index.js.map +1 -1
  212. package/react/system-banner/index.cjs.js +43 -0
  213. package/react/system-banner/index.cjs.js.map +1 -0
  214. package/react/system-banner/index.d.ts +2 -0
  215. package/react/system-banner/index.js +19 -0
  216. package/react/system-banner/index.js.map +1 -0
  217. package/react/system-banner-item/index.cjs.js +42 -0
  218. package/react/system-banner-item/index.cjs.js.map +1 -0
  219. package/react/system-banner-item/index.d.ts +2 -0
  220. package/react/system-banner-item/index.js +18 -0
  221. package/react/system-banner-item/index.js.map +1 -0
  222. package/themes/root.css +14 -2
  223. package/internals/CloseButton/close-button.js +0 -6
  224. package/internals/CloseButton/sgds-close-button.js.map +0 -1
  225. package/react/internals/CloseButton/close-button.cjs.js +0 -11
  226. package/react/internals/CloseButton/close-button.js +0 -7
  227. package/react/internals/CloseButton/sgds-close-button.cjs.js.map +0 -1
  228. package/react/internals/CloseButton/sgds-close-button.js.map +0 -1
  229. package/utils/test.d.ts +0 -28
  230. /package/{internals → components}/CloseButton/close-button.js.map +0 -0
  231. /package/{internals → components}/CloseButton/index.d.ts +0 -0
  232. /package/react/{internals → components}/CloseButton/close-button.cjs.js.map +0 -0
  233. /package/react/{internals → components}/CloseButton/close-button.js.map +0 -0
@@ -1,6 +1,6 @@
1
1
  import { PropertyValueMap } from "lit";
2
2
  import SgdsElement from "../../base/sgds-element";
3
- import SgdsCloseButton from "../../internals/CloseButton/sgds-close-button";
3
+ import SgdsCloseButton from "../CloseButton/sgds-close-button";
4
4
  /**
5
5
  * @summary Drawers slide in from a container to expose additional options and information.
6
6
  *
@@ -9,7 +9,7 @@ import { waitForEvent } from '../../utils/event.js';
9
9
  import { lockBodyScrolling, unlockBodyScrolling } from '../../utils/scroll.js';
10
10
  import { watch } from '../../utils/watch.js';
11
11
  import css_248z from './drawer.js';
12
- import { SgdsCloseButton } from '../../internals/CloseButton/sgds-close-button.js';
12
+ import { SgdsCloseButton } from '../CloseButton/sgds-close-button.js';
13
13
 
14
14
  /**
15
15
  * @summary Drawers slide in from a container to expose additional options and information.
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-drawer.js","sources":["../../../src/components/Drawer/sgds-drawer.ts"],"sourcesContent":["import { html, PropertyValueMap } from \"lit\";\nimport { property, query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { animateTo, stopAnimations } from \"../../utils/animate.js\";\nimport { getAnimation, setDefaultAnimation } from \"../../utils/animation-registry.js\";\nimport { waitForEvent } from \"../../utils/event.js\";\nimport { lockBodyScrolling, unlockBodyScrolling } from \"../../utils/scroll.js\";\nimport { watch } from \"../../utils/watch.js\";\nimport drawerStyles from \"./drawer.css\";\nimport SgdsCloseButton from \"../../internals/CloseButton/sgds-close-button\";\n\n/**\n * @summary Drawers slide in from a container to expose additional options and information.\n *\n * @slot default - The drawer's main content\n * @slot title - The title of the drawer\n * @slot description - The description of the drawer\n * @slot footer - The footer of the drawer\n *\n * @event sgds-show - Emitted when the drawer opens.\n * @event sgds-after-show - Emitted after the drawer opens and all animations are complete.\n * @event sgds-hide - Emitted when the drawer closes.\n * @event sgds-after-hide - Emitted after the drawer closes and all animations are complete.\n * @event sgds-initial-focus - Emitted when the drawer opens and is ready to receive focus. Calling\n * `event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input.\n * @event {{ source: 'close-button' | 'keyboard' | 'overlay' }} sgds-request-close - Emitted when the user attempts to\n * close the drawer by clicking the close button, clicking the overlay, or pressing escape. Calling\n * `event.preventDefault()` will keep the drawer open. Avoid using this unless closing the drawer will result in\n * destructive behavior such as data loss.\n *\n */\nexport class SgdsDrawer extends SgdsElement {\n static styles = [...SgdsElement.styles, drawerStyles];\n /**@internal */\n static dependencies = {\n \"sgds-close-button\": SgdsCloseButton\n };\n\n /** @internal */\n private originalTrigger: HTMLElement | null;\n /** @internal */\n @query(\".drawer\") drawer: HTMLElement;\n /** @internal */\n @query(\".drawer-panel\") panel: HTMLElement;\n /** @internal */\n @query(\".drawer-overlay\") overlay: HTMLElement;\n\n /**\n * Indicates whether or not the drawer is open. You can toggle this attribute to show and hide the drawer, or you can\n * use the `show()` and `hide()` methods and this attribute will reflect the drawer's open state.\n */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /**\n * Defines the size of the drawer panel.\n * For drawers placed on the left or right (`start`/`end`), this controls the drawer's width.\n * For drawers placed on the top or bottom, this controls the drawer's height.\n * Accepts `small`, `medium`, or `large`. Defaults to `small`.\n */\n @property({ type: String, reflect: true }) size: \"sm\" | \"md\" | \"lg\" = \"sm\";\n\n /** The direction from which the drawer will open. */\n @property({ type: String, reflect: true }) placement: \"top\" | \"end\" | \"bottom\" | \"start\" = \"end\";\n\n /**\n * By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of\n * its parent element, set this attribute and add `position: relative` to the parent.\n */\n @property({ type: Boolean, reflect: true }) contained = false;\n\n firstUpdated(changedProperties: PropertyValueMap<this>) {\n super.firstUpdated(changedProperties);\n\n if (this.open) {\n this.addOpenListeners();\n\n if (!this.contained) {\n lockBodyScrolling(this);\n }\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n unlockBodyScrolling(this);\n }\n\n private uppercaseFirstLetter(string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }\n\n private requestClose(source: \"close-button\" | \"keyboard\" | \"overlay\") {\n const slRequestClose = this.emit(\"sgds-request-close\", {\n cancelable: true,\n detail: { source }\n });\n\n if (slRequestClose.defaultPrevented) {\n const animation = getAnimation(this, \"drawer.denyClose\");\n animateTo(this.panel, animation.keyframes, animation.options);\n return;\n }\n\n this.hide();\n }\n\n private addOpenListeners() {\n document.addEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n private removeOpenListeners() {\n document.removeEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n private handleDocumentKeyDown = (event: KeyboardEvent) => {\n if (this.open && !this.contained && event.key === \"Escape\") {\n event.stopPropagation();\n this.requestClose(\"keyboard\");\n }\n };\n\n @watch(\"open\", { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n // Show\n this.emit(\"sgds-show\");\n this.addOpenListeners();\n this.originalTrigger = document.activeElement as HTMLElement;\n\n // Lock body scrolling only if the drawer isn't contained\n if (!this.contained) {\n lockBodyScrolling(this);\n }\n\n // When the drawer is shown, Safari will attempt to set focus on whatever element has autofocus. This causes the\n // drawer's animation to jitter, so we'll temporarily remove the attribute, call `focus({ preventScroll: true })`\n // ourselves, and add the attribute back afterwards.\n //\n // Related: https://github.com/shoelace-style/shoelace/issues/693\n //\n const autoFocusTarget = this.querySelector(\"[autofocus]\");\n if (autoFocusTarget) {\n autoFocusTarget.removeAttribute(\"autofocus\");\n }\n\n await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);\n this.drawer.hidden = false;\n\n // Set initial focus\n requestAnimationFrame(() => {\n const slInitialFocus = this.emit(\"sgds-initial-focus\", { cancelable: true });\n\n if (!slInitialFocus.defaultPrevented) {\n // Set focus to the autofocus target and restore the attribute\n if (autoFocusTarget) {\n (autoFocusTarget as HTMLInputElement).focus({ preventScroll: true });\n } else {\n this.panel.focus({ preventScroll: true });\n }\n }\n\n // Restore the autofocus attribute\n if (autoFocusTarget) {\n autoFocusTarget.setAttribute(\"autofocus\", \"\");\n }\n });\n\n const panelAnimation = getAnimation(this, `drawer.show${this.uppercaseFirstLetter(this.placement)}`);\n const overlayAnimation = getAnimation(this, \"drawer.overlay.show\");\n await Promise.all([\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)\n ]);\n\n this.emit(\"sgds-after-show\");\n } else {\n // Hide\n this.emit(\"sgds-hide\");\n this.removeOpenListeners();\n\n if (!this.contained) {\n unlockBodyScrolling(this);\n }\n\n await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);\n const panelAnimation = getAnimation(this, `drawer.hide${this.uppercaseFirstLetter(this.placement)}`);\n const overlayAnimation = getAnimation(this, \"drawer.overlay.hide\");\n\n // Animate the overlay and the panel at the same time. Because animation durations might be different, we need to\n // hide each one individually when the animation finishes, otherwise the first one that finishes will reappear\n // unexpectedly. We'll unhide them after all animations have completed.\n await Promise.all([\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options).then(() => {\n this.overlay.hidden = true;\n }),\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options).then(() => {\n this.panel.hidden = true;\n })\n ]);\n\n this.drawer.hidden = true;\n\n // Now that the dialog is hidden, restore the overlay and panel for next time\n this.overlay.hidden = false;\n this.panel.hidden = false;\n\n // Restore focus to the original trigger\n const trigger = this.originalTrigger;\n if (typeof trigger?.focus === \"function\") {\n setTimeout(() => trigger.focus());\n }\n\n this.emit(\"sgds-after-hide\");\n }\n }\n\n @watch(\"contained\", { waitUntilFirstUpdate: true })\n handleNoModalChange() {\n if (this.open && !this.contained) {\n lockBodyScrolling(this);\n }\n\n if (this.open && this.contained) {\n unlockBodyScrolling(this);\n }\n }\n\n /** Shows the drawer. */\n public async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, \"sgds-after-show\");\n }\n\n /** Hides the drawer */\n public async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, \"sgds-after-hide\");\n }\n\n render() {\n const isHydrated = this.hasUpdated;\n const shouldHide = !this.open && !isHydrated;\n\n return html`\n <div\n class=${classMap({\n drawer: true,\n \"drawer-top\": this.placement === \"top\",\n \"drawer-end\": this.placement === \"end\",\n \"drawer-bottom\": this.placement === \"bottom\",\n \"drawer-start\": this.placement === \"start\",\n \"drawer-contained\": this.contained,\n \"drawer-fixed\": !this.contained\n })}\n ?hidden=${shouldHide}\n >\n <div class=\"drawer-overlay\" @click=${() => this.requestClose(\"overlay\")} tabindex=\"-1\"></div>\n\n <div\n class=\"drawer-panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden=${this.open ? \"false\" : \"true\"}\n tabindex=\"0\"\n >\n <header class=\"drawer-header\">\n <slot name=\"title\"></slot>\n <slot name=\"description\"></slot>\n <sgds-close-button\n class=\"drawer-close\"\n aria-label=\"close drawer\"\n @click=\"${() => this.requestClose(\"close-button\")}\"\n ></sgds-close-button>\n </header>\n <slot class=\"drawer-body\"></slot>\n <slot name=\"footer\"></slot>\n </div>\n </div>\n `;\n }\n}\n\n// Top\nsetDefaultAnimation(\"drawer.showTop\", {\n keyframes: [\n { opacity: 0, translate: \"0 -100%\" },\n { opacity: 1, translate: \"0 0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideTop\", {\n keyframes: [\n { opacity: 1, translate: \"0 0\" },\n { opacity: 0, translate: \"0 -100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// End\nsetDefaultAnimation(\"drawer.showEnd\", {\n keyframes: [\n { opacity: 0, translate: \"100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n rtlKeyframes: [\n { opacity: 0, translate: \"-100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideEnd\", {\n keyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"100%\" }\n ],\n rtlKeyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"-100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Bottom\nsetDefaultAnimation(\"drawer.showBottom\", {\n keyframes: [\n { opacity: 0, translate: \"0 100%\" },\n { opacity: 1, translate: \"0 0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideBottom\", {\n keyframes: [\n { opacity: 1, translate: \"0 0\" },\n { opacity: 0, translate: \"0 100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Start\nsetDefaultAnimation(\"drawer.showStart\", {\n keyframes: [\n { opacity: 0, translate: \"-100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n rtlKeyframes: [\n { opacity: 0, translate: \"100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideStart\", {\n keyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"-100%\" }\n ],\n rtlKeyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Deny close\nsetDefaultAnimation(\"drawer.denyClose\", {\n keyframes: [{ scale: 1 }, { scale: 1.01 }, { scale: 1 }],\n options: { duration: 250 }\n});\n\n// Overlay\nsetDefaultAnimation(\"drawer.overlay.show\", {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n options: { duration: 250 }\n});\n\nsetDefaultAnimation(\"drawer.overlay.hide\", {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n options: { duration: 250 }\n});\n\nexport default SgdsDrawer;\n"],"names":["drawerStyles"],"mappings":";;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;AAmBG;AACG,MAAO,UAAW,SAAQ,WAAW,CAAA;AAA3C,IAAA,WAAA,GAAA;;AAgBE;;;AAGG;QACyC,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;AAEzD;;;;;AAKG;QACwC,IAAI,CAAA,IAAA,GAAuB,IAAI,CAAC;;QAGhC,IAAS,CAAA,SAAA,GAAuC,KAAK,CAAC;AAEjG;;;AAGG;QACyC,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;AA+CtD,QAAA,IAAA,CAAA,qBAAqB,GAAG,CAAC,KAAoB,KAAI;AACvD,YAAA,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,EAAE;gBAC1D,KAAK,CAAC,eAAe,EAAE,CAAC;AACxB,gBAAA,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;aAC/B;AACH,SAAC,CAAC;KAyKH;AA3NC,IAAA,YAAY,CAAC,iBAAyC,EAAA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E,CAAC,EAAE,CAAC;AAC3C,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC,CAAC;AAEH,mBAAmB,CAAC,qBAAqB,EAAE;AACzC,IAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAC3C,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"sgds-drawer.js","sources":["../../../src/components/Drawer/sgds-drawer.ts"],"sourcesContent":["import { html, PropertyValueMap } from \"lit\";\nimport { property, query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { animateTo, stopAnimations } from \"../../utils/animate.js\";\nimport { getAnimation, setDefaultAnimation } from \"../../utils/animation-registry.js\";\nimport { waitForEvent } from \"../../utils/event.js\";\nimport { lockBodyScrolling, unlockBodyScrolling } from \"../../utils/scroll.js\";\nimport { watch } from \"../../utils/watch.js\";\nimport drawerStyles from \"./drawer.css\";\nimport SgdsCloseButton from \"../CloseButton/sgds-close-button\";\n\n/**\n * @summary Drawers slide in from a container to expose additional options and information.\n *\n * @slot default - The drawer's main content\n * @slot title - The title of the drawer\n * @slot description - The description of the drawer\n * @slot footer - The footer of the drawer\n *\n * @event sgds-show - Emitted when the drawer opens.\n * @event sgds-after-show - Emitted after the drawer opens and all animations are complete.\n * @event sgds-hide - Emitted when the drawer closes.\n * @event sgds-after-hide - Emitted after the drawer closes and all animations are complete.\n * @event sgds-initial-focus - Emitted when the drawer opens and is ready to receive focus. Calling\n * `event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input.\n * @event {{ source: 'close-button' | 'keyboard' | 'overlay' }} sgds-request-close - Emitted when the user attempts to\n * close the drawer by clicking the close button, clicking the overlay, or pressing escape. Calling\n * `event.preventDefault()` will keep the drawer open. Avoid using this unless closing the drawer will result in\n * destructive behavior such as data loss.\n *\n */\nexport class SgdsDrawer extends SgdsElement {\n static styles = [...SgdsElement.styles, drawerStyles];\n /**@internal */\n static dependencies = {\n \"sgds-close-button\": SgdsCloseButton\n };\n\n /** @internal */\n private originalTrigger: HTMLElement | null;\n /** @internal */\n @query(\".drawer\") drawer: HTMLElement;\n /** @internal */\n @query(\".drawer-panel\") panel: HTMLElement;\n /** @internal */\n @query(\".drawer-overlay\") overlay: HTMLElement;\n\n /**\n * Indicates whether or not the drawer is open. You can toggle this attribute to show and hide the drawer, or you can\n * use the `show()` and `hide()` methods and this attribute will reflect the drawer's open state.\n */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /**\n * Defines the size of the drawer panel.\n * For drawers placed on the left or right (`start`/`end`), this controls the drawer's width.\n * For drawers placed on the top or bottom, this controls the drawer's height.\n * Accepts `small`, `medium`, or `large`. Defaults to `small`.\n */\n @property({ type: String, reflect: true }) size: \"sm\" | \"md\" | \"lg\" = \"sm\";\n\n /** The direction from which the drawer will open. */\n @property({ type: String, reflect: true }) placement: \"top\" | \"end\" | \"bottom\" | \"start\" = \"end\";\n\n /**\n * By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of\n * its parent element, set this attribute and add `position: relative` to the parent.\n */\n @property({ type: Boolean, reflect: true }) contained = false;\n\n firstUpdated(changedProperties: PropertyValueMap<this>) {\n super.firstUpdated(changedProperties);\n\n if (this.open) {\n this.addOpenListeners();\n\n if (!this.contained) {\n lockBodyScrolling(this);\n }\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n unlockBodyScrolling(this);\n }\n\n private uppercaseFirstLetter(string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }\n\n private requestClose(source: \"close-button\" | \"keyboard\" | \"overlay\") {\n const slRequestClose = this.emit(\"sgds-request-close\", {\n cancelable: true,\n detail: { source }\n });\n\n if (slRequestClose.defaultPrevented) {\n const animation = getAnimation(this, \"drawer.denyClose\");\n animateTo(this.panel, animation.keyframes, animation.options);\n return;\n }\n\n this.hide();\n }\n\n private addOpenListeners() {\n document.addEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n private removeOpenListeners() {\n document.removeEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n private handleDocumentKeyDown = (event: KeyboardEvent) => {\n if (this.open && !this.contained && event.key === \"Escape\") {\n event.stopPropagation();\n this.requestClose(\"keyboard\");\n }\n };\n\n @watch(\"open\", { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n // Show\n this.emit(\"sgds-show\");\n this.addOpenListeners();\n this.originalTrigger = document.activeElement as HTMLElement;\n\n // Lock body scrolling only if the drawer isn't contained\n if (!this.contained) {\n lockBodyScrolling(this);\n }\n\n // When the drawer is shown, Safari will attempt to set focus on whatever element has autofocus. This causes the\n // drawer's animation to jitter, so we'll temporarily remove the attribute, call `focus({ preventScroll: true })`\n // ourselves, and add the attribute back afterwards.\n //\n // Related: https://github.com/shoelace-style/shoelace/issues/693\n //\n const autoFocusTarget = this.querySelector(\"[autofocus]\");\n if (autoFocusTarget) {\n autoFocusTarget.removeAttribute(\"autofocus\");\n }\n\n await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);\n this.drawer.hidden = false;\n\n // Set initial focus\n requestAnimationFrame(() => {\n const slInitialFocus = this.emit(\"sgds-initial-focus\", { cancelable: true });\n\n if (!slInitialFocus.defaultPrevented) {\n // Set focus to the autofocus target and restore the attribute\n if (autoFocusTarget) {\n (autoFocusTarget as HTMLInputElement).focus({ preventScroll: true });\n } else {\n this.panel.focus({ preventScroll: true });\n }\n }\n\n // Restore the autofocus attribute\n if (autoFocusTarget) {\n autoFocusTarget.setAttribute(\"autofocus\", \"\");\n }\n });\n\n const panelAnimation = getAnimation(this, `drawer.show${this.uppercaseFirstLetter(this.placement)}`);\n const overlayAnimation = getAnimation(this, \"drawer.overlay.show\");\n await Promise.all([\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)\n ]);\n\n this.emit(\"sgds-after-show\");\n } else {\n // Hide\n this.emit(\"sgds-hide\");\n this.removeOpenListeners();\n\n if (!this.contained) {\n unlockBodyScrolling(this);\n }\n\n await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);\n const panelAnimation = getAnimation(this, `drawer.hide${this.uppercaseFirstLetter(this.placement)}`);\n const overlayAnimation = getAnimation(this, \"drawer.overlay.hide\");\n\n // Animate the overlay and the panel at the same time. Because animation durations might be different, we need to\n // hide each one individually when the animation finishes, otherwise the first one that finishes will reappear\n // unexpectedly. We'll unhide them after all animations have completed.\n await Promise.all([\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options).then(() => {\n this.overlay.hidden = true;\n }),\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options).then(() => {\n this.panel.hidden = true;\n })\n ]);\n\n this.drawer.hidden = true;\n\n // Now that the dialog is hidden, restore the overlay and panel for next time\n this.overlay.hidden = false;\n this.panel.hidden = false;\n\n // Restore focus to the original trigger\n const trigger = this.originalTrigger;\n if (typeof trigger?.focus === \"function\") {\n setTimeout(() => trigger.focus());\n }\n\n this.emit(\"sgds-after-hide\");\n }\n }\n\n @watch(\"contained\", { waitUntilFirstUpdate: true })\n handleNoModalChange() {\n if (this.open && !this.contained) {\n lockBodyScrolling(this);\n }\n\n if (this.open && this.contained) {\n unlockBodyScrolling(this);\n }\n }\n\n /** Shows the drawer. */\n public async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, \"sgds-after-show\");\n }\n\n /** Hides the drawer */\n public async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, \"sgds-after-hide\");\n }\n\n render() {\n const isHydrated = this.hasUpdated;\n const shouldHide = !this.open && !isHydrated;\n\n return html`\n <div\n class=${classMap({\n drawer: true,\n \"drawer-top\": this.placement === \"top\",\n \"drawer-end\": this.placement === \"end\",\n \"drawer-bottom\": this.placement === \"bottom\",\n \"drawer-start\": this.placement === \"start\",\n \"drawer-contained\": this.contained,\n \"drawer-fixed\": !this.contained\n })}\n ?hidden=${shouldHide}\n >\n <div class=\"drawer-overlay\" @click=${() => this.requestClose(\"overlay\")} tabindex=\"-1\"></div>\n\n <div\n class=\"drawer-panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden=${this.open ? \"false\" : \"true\"}\n tabindex=\"0\"\n >\n <header class=\"drawer-header\">\n <slot name=\"title\"></slot>\n <slot name=\"description\"></slot>\n <sgds-close-button\n class=\"drawer-close\"\n aria-label=\"close drawer\"\n @click=\"${() => this.requestClose(\"close-button\")}\"\n ></sgds-close-button>\n </header>\n <slot class=\"drawer-body\"></slot>\n <slot name=\"footer\"></slot>\n </div>\n </div>\n `;\n }\n}\n\n// Top\nsetDefaultAnimation(\"drawer.showTop\", {\n keyframes: [\n { opacity: 0, translate: \"0 -100%\" },\n { opacity: 1, translate: \"0 0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideTop\", {\n keyframes: [\n { opacity: 1, translate: \"0 0\" },\n { opacity: 0, translate: \"0 -100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// End\nsetDefaultAnimation(\"drawer.showEnd\", {\n keyframes: [\n { opacity: 0, translate: \"100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n rtlKeyframes: [\n { opacity: 0, translate: \"-100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideEnd\", {\n keyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"100%\" }\n ],\n rtlKeyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"-100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Bottom\nsetDefaultAnimation(\"drawer.showBottom\", {\n keyframes: [\n { opacity: 0, translate: \"0 100%\" },\n { opacity: 1, translate: \"0 0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideBottom\", {\n keyframes: [\n { opacity: 1, translate: \"0 0\" },\n { opacity: 0, translate: \"0 100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Start\nsetDefaultAnimation(\"drawer.showStart\", {\n keyframes: [\n { opacity: 0, translate: \"-100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n rtlKeyframes: [\n { opacity: 0, translate: \"100%\" },\n { opacity: 1, translate: \"0\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"drawer.hideStart\", {\n keyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"-100%\" }\n ],\n rtlKeyframes: [\n { opacity: 1, translate: \"0\" },\n { opacity: 0, translate: \"100%\" }\n ],\n options: { duration: 250, easing: \"ease\" }\n});\n\n// Deny close\nsetDefaultAnimation(\"drawer.denyClose\", {\n keyframes: [{ scale: 1 }, { scale: 1.01 }, { scale: 1 }],\n options: { duration: 250 }\n});\n\n// Overlay\nsetDefaultAnimation(\"drawer.overlay.show\", {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n options: { duration: 250 }\n});\n\nsetDefaultAnimation(\"drawer.overlay.hide\", {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n options: { duration: 250 }\n});\n\nexport default SgdsDrawer;\n"],"names":["drawerStyles"],"mappings":";;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;AAmBG;AACG,MAAO,UAAW,SAAQ,WAAW,CAAA;AAA3C,IAAA,WAAA,GAAA;;AAgBE;;;AAGG;QACyC,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;AAEzD;;;;;AAKG;QACwC,IAAI,CAAA,IAAA,GAAuB,IAAI,CAAC;;QAGhC,IAAS,CAAA,SAAA,GAAuC,KAAK,CAAC;AAEjG;;;AAGG;QACy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A,mBAAmB,CAAC,kBAAkB,EAAE;AACtC,IAAA,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AACxD,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC,CAAC;AAEH;AACA,mBAAmB,CAAC,qBAAqB,EAAE;AACzC,IAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAC3C,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC,CAAC;AAEH,mBAAmB,CAAC,qBAAqB,EAAE;AACzC,IAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAC3C,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC;;;;"}
@@ -15,7 +15,7 @@ const t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
15
15
  * Copyright 2017 Google LLC
16
16
  * SPDX-License-Identifier: BSD-3-Clause
17
17
  */
18
- const _=globalThis,M=e=>{_.emitLitDebugLogEvents&&_.dispatchEvent(new CustomEvent("lit-debug",{detail:e}))};let V,H=0;_.litIssuedWarnings??=new Set,V=(e,t)=>{t+=e?` See https://lit.dev/msg/${e} for more information.`:"",_.litIssuedWarnings.has(t)||(console.warn(t),_.litIssuedWarnings.add(t))},V("dev-mode","Lit is in dev mode. Not recommended for production!");const S=_.ShadyDOM?.inUse&&!0===_.ShadyDOM?.noPatch?_.ShadyDOM.wrap:e=>e,$=_.trustedTypes,B=$?$.createPolicy("lit-html",{createHTML:e=>e}):void 0,k=e=>e,P=(e,t,i)=>k,L=e=>{if(ae!==P)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");ae=e},A=()=>{ae=P},E=(e,t,i)=>ae(e,t,i),T="$lit$",z=`lit$${Math.random().toFixed(9).slice(2)}$`,U="?"+z,N=`<${U}>`,R=document,O=()=>R.createComment(""),I=e=>null===e||"object"!=typeof e&&"function"!=typeof e,D=Array.isArray,F="[ \t\n\f\r]",W=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,q=/-->/g,j=/>/g,J=new RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),G=/'/g,K=/"/g,X=/^(?:script|style|textarea|title)$/i,Y=(Q=1,(e,...t)=>(e.some((e=>void 0===e))&&console.warn("Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences."),t.some((e=>e?._$litStatic$))&&V("","Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\nPlease use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions"),{_$litType$:Q,strings:e,values:t}));var Q;const ee=Symbol.for("lit-noChange"),te=Symbol.for("lit-nothing"),ie=new WeakMap,le=R.createTreeWalker(R,129);let ae=P;function re(e,t){if(!D(e)||!e.hasOwnProperty("raw")){let e="invalid template strings array";throw e="\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n ".trim().replace(/\n */g,"\n"),new Error(e)}return void 0!==B?B.createHTML(t):t}class oe{constructor({strings:e,_$litType$:t},i){let l;this.parts=[];let a=0,r=0;const o=e.length-1,s=this.parts,[n,c]=((e,t)=>{const i=e.length-1,l=[];let a,r=2===t?"<svg>":3===t?"<math>":"",o=W;for(let t=0;t<i;t++){const i=e[t];let s,n,c=-1,d=0;for(;d<i.length&&(o.lastIndex=d,n=o.exec(i),null!==n);)if(d=o.lastIndex,o===W){if("!--"===n[1])o=q;else if(void 0!==n[1])o=j;else if(void 0!==n[2])X.test(n[2])&&(a=new RegExp(`</${n[2]}`,"g")),o=J;else if(void 0!==n[3])throw new Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions")}else o===J?">"===n[0]?(o=a??W,c=-1):void 0===n[1]?c=-2:(c=o.lastIndex-n[2].length,s=n[1],o=void 0===n[3]?J:'"'===n[3]?K:G):o===K||o===G?o=J:o===q||o===j?o=W:(o=J,a=void 0);console.assert(-1===c||o===J||o===G||o===K,"unexpected parse state B");const h=o===J&&e[t+1].startsWith("/>")?" ":"";r+=o===W?i+N:c>=0?(l.push(s),i.slice(0,c)+T+i.slice(c)+z+h):i+z+(-2===c?t:h)}return[re(e,r+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),l]})(e,t);if(this.el=oe.createElement(n,i),le.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(l=le.nextNode())&&s.length<o;){if(1===l.nodeType){{const e=l.localName;if(/^(?:textarea|template)$/i.test(e)&&l.innerHTML.includes(z)){const t=`Expressions are not supported inside \`${e}\` elements. See https://lit.dev/msg/expression-in-${e} for more information.`;if("template"===e)throw new Error(t);V("",t)}}if(l.hasAttributes())for(const e of l.getAttributeNames())if(e.endsWith(T)){const t=c[r++],i=l.getAttribute(e).split(z),o=/([.?@])?(.*)/.exec(t);s.push({type:1,index:a,name:o[2],strings:i,ctor:"."===o[1]?he:"?"===o[1]?ve:"@"===o[1]?pe:de}),l.removeAttribute(e)}else e.startsWith(z)&&(s.push({type:6,index:a}),l.removeAttribute(e));if(X.test(l.tagName)){const e=l.textContent.split(z),t=e.length-1;if(t>0){l.textContent=$?$.emptyScript:"";for(let i=0;i<t;i++)l.append(e[i],O()),le.nextNode(),s.push({type:2,index:++a});l.append(e[t],O())}}}else if(8===l.nodeType){if(l.data===U)s.push({type:2,index:a});else{let e=-1;for(;-1!==(e=l.data.indexOf(z,e+1));)s.push({type:7,index:a}),e+=z.length-1}}a++}if(c.length!==r)throw new Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+e.join("${...}")+"`");M&&M({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:e})}static createElement(e,t){const i=R.createElement("template");return i.innerHTML=e,i}}function se(e,t,i=e,l){if(t===ee)return t;let a=void 0!==l?i.__directives?.[l]:i.__directive;const r=I(t)?void 0:t._$litDirective$;return a?.constructor!==r&&(a?._$notifyDirectiveConnectionChanged?.(!1),void 0===r?a=void 0:(a=new r(e),a._$initialize(e,i,l)),void 0!==l?(i.__directives??=[])[l]=a:i.__directive=a),void 0!==a&&(t=se(e,a._$resolve(e,t.values),a,l)),t}class ne{constructor(e,t){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=e,this._$parent=t}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(e){const{el:{content:t},parts:i}=this._$template,l=(e?.creationScope??R).importNode(t,!0);le.currentNode=l;let a=le.nextNode(),r=0,o=0,s=i[0];for(;void 0!==s;){if(r===s.index){let t;2===s.type?t=new ce(a,a.nextSibling,this,e):1===s.type?t=new s.ctor(a,s.name,s.strings,this,e):6===s.type&&(t=new ge(a,this,e)),this._$parts.push(t),s=i[++o]}r!==s?.index&&(a=le.nextNode(),r++)}return le.currentNode=R,l}_update(e){let t=0;for(const i of this._$parts)void 0!==i&&(M&&M({kind:"set part",part:i,value:e[t],valueIndex:t,values:e,templateInstance:this}),void 0!==i.strings?(i._$setValue(e,i,t),t+=i.strings.length-2):i._$setValue(e[t])),t++}}class ce{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(e,t,i,l){this.type=2,this._$committedValue=te,this._$disconnectableChildren=void 0,this._$startNode=e,this._$endNode=t,this._$parent=i,this.options=l,this.__isConnected=l?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let e=S(this._$startNode).parentNode;const t=this._$parent;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(e,t=this){if(null===this.parentNode)throw new Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");if(e=se(this,e,t),I(e))e===te||null==e||""===e?(this._$committedValue!==te&&(M&&M({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=te):e!==this._$committedValue&&e!==ee&&this._commitText(e);else if(void 0!==e._$litType$)this._commitTemplateResult(e);else if(void 0!==e.nodeType){if(this.options?.host===e)return this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"),void console.warn("Attempted to render the template host",e,"inside itself. This is almost always a mistake, and in dev mode ","we render some warning text. In production however, we'll ","render it, which will usually result in an error, and sometimes ","in the element disappearing from the DOM.");this._commitNode(e)}else(e=>D(e)||"function"==typeof e?.[Symbol.iterator])(e)?this._commitIterable(e):this._commitText(e)}_insert(e){return S(S(this._$startNode).parentNode).insertBefore(e,this._$endNode)}_commitNode(e){if(this._$committedValue!==e){if(this._$clear(),ae!==P){const e=this._$startNode.parentNode?.nodeName;if("STYLE"===e||"SCRIPT"===e){let t="Forbidden";throw t="STYLE"===e?"Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets.":"Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.",new Error(t)}}M&&M({kind:"commit node",start:this._$startNode,parent:this._$parent,value:e,options:this.options}),this._$committedValue=this._insert(e)}}_commitText(e){if(this._$committedValue!==te&&I(this._$committedValue)){const t=S(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=E(t,"data","property")),e=this._textSanitizer(e),M&&M({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}else{const t=R.createTextNode("");this._commitNode(t),void 0===this._textSanitizer&&(this._textSanitizer=E(t,"data","property")),e=this._textSanitizer(e),M&&M({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}this._$committedValue=e}_commitTemplateResult(e){const{values:t,_$litType$:i}=e,l="number"==typeof i?this._$getTemplate(e):(void 0===i.el&&(i.el=oe.createElement(re(i.h,i.h[0]),this.options)),i);if(this._$committedValue?._$template===l)M&&M({kind:"template updating",template:l,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:t}),this._$committedValue._update(t);else{const e=new ne(l,this),i=e._clone(this.options);M&&M({kind:"template instantiated",template:l,instance:e,parts:e._$parts,options:this.options,fragment:i,values:t}),e._update(t),M&&M({kind:"template instantiated and updated",template:l,instance:e,parts:e._$parts,options:this.options,fragment:i,values:t}),this._commitNode(i),this._$committedValue=e}}_$getTemplate(e){let t=ie.get(e.strings);return void 0===t&&ie.set(e.strings,t=new oe(e)),t}_commitIterable(e){D(this._$committedValue)||(this._$committedValue=[],this._$clear());const t=this._$committedValue;let i,l=0;for(const a of e)l===t.length?t.push(i=new ce(this._insert(O()),this._insert(O()),this,this.options)):i=t[l],i._$setValue(a),l++;l<t.length&&(this._$clear(i&&S(i._$endNode).nextSibling,l),t.length=l)}_$clear(e=S(this._$startNode).nextSibling,t){for(this._$notifyConnectionChanged?.(!1,!0,t);e&&e!==this._$endNode;){const t=S(e).nextSibling;S(e).remove(),e=t}}setConnected(e){if(void 0!==this._$parent)throw new Error("part.setConnected() may only be called on a RootPart returned from render().");this.__isConnected=e,this._$notifyConnectionChanged?.(e)}}class de{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(e,t,i,l,a){this.type=1,this._$committedValue=te,this._$disconnectableChildren=void 0,this.element=e,this.name=t,this._$parent=l,this.options=a,i.length>2||""!==i[0]||""!==i[1]?(this._$committedValue=new Array(i.length-1).fill(new String),this.strings=i):this._$committedValue=te,this._sanitizer=void 0}_$setValue(e,t=this,i,l){const a=this.strings;let r=!1;if(void 0===a)e=se(this,e,t,0),r=!I(e)||e!==this._$committedValue&&e!==ee,r&&(this._$committedValue=e);else{const l=e;let o,s;for(e=a[0],o=0;o<a.length-1;o++)s=se(this,l[i+o],t,o),s===ee&&(s=this._$committedValue[o]),r||=!I(s)||s!==this._$committedValue[o],s===te?e=te:e!==te&&(e+=(s??"")+a[o+1]),this._$committedValue[o]=s}r&&!l&&this._commitValue(e)}_commitValue(e){e===te?S(this.element).removeAttribute(this.name):(void 0===this._sanitizer&&(this._sanitizer=ae(this.element,this.name,"attribute")),e=this._sanitizer(e??""),M&&M({kind:"commit attribute",element:this.element,name:this.name,value:e,options:this.options}),S(this.element).setAttribute(this.name,e??""))}}class he extends de{constructor(){super(...arguments),this.type=3}_commitValue(e){void 0===this._sanitizer&&(this._sanitizer=ae(this.element,this.name,"property")),e=this._sanitizer(e),M&&M({kind:"commit property",element:this.element,name:this.name,value:e,options:this.options}),this.element[this.name]=e===te?void 0:e}}class ve extends de{constructor(){super(...arguments),this.type=4}_commitValue(e){M&&M({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!e||e===te),options:this.options}),S(this.element).toggleAttribute(this.name,!!e&&e!==te)}}class pe extends de{constructor(e,t,i,l,a){if(super(e,t,i,l,a),this.type=5,void 0!==this.strings)throw new Error(`A \`<${e.localName}>\` has a \`@${t}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(e,t=this){if((e=se(this,e,t,0)??te)===ee)return;const i=this._$committedValue,l=e===te&&i!==te||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,a=e!==te&&(i===te||l);M&&M({kind:"commit event listener",element:this.element,name:this.name,value:e,options:this.options,removeListener:l,addListener:a,oldListener:i}),l&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,e),this._$committedValue=e}handleEvent(e){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,e):this._$committedValue.handleEvent(e)}}class ge{constructor(e,t,i){this.element=e,this.type=6,this._$disconnectableChildren=void 0,this._$parent=t,this.options=i}get _$isConnected(){return this._$parent._$isConnected}_$setValue(e){M&&M({kind:"commit to element binding",element:this.element,value:e,options:this.options}),se(this,e)}}const ue=_.litHtmlPolyfillSupportDevMode;ue?.(oe,ce),(_.litHtmlVersions??=[]).push("3.2.0"),_.litHtmlVersions.length>1&&V("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.");const fe=(e,t,i)=>{if(null==t)throw new TypeError(`The container to render into may not be ${t}`);const l=H++,a=i?.renderBefore??t;let r=a._$litPart$;if(M&&M({kind:"begin render",id:l,value:e,container:t,options:i,part:r}),void 0===r){const e=i?.renderBefore??null;a._$litPart$=r=new ce(t.insertBefore(O(),e),e,void 0,i??{})}return r._$setValue(e),M&&M({kind:"end render",id:l,value:e,container:t,options:i,part:r}),r};fe.setSanitizer=L,fe.createSanitizer=E,fe._testOnlyClearSanitizerFactoryDoNotCallOrElse=A;
18
+ const _=globalThis,M=e=>{_.emitLitDebugLogEvents&&_.dispatchEvent(new CustomEvent("lit-debug",{detail:e}))};let V,H=0;_.litIssuedWarnings??=new Set,V=(e,t)=>{t+=e?` See https://lit.dev/msg/${e} for more information.`:"",_.litIssuedWarnings.has(t)||(console.warn(t),_.litIssuedWarnings.add(t))},V("dev-mode","Lit is in dev mode. Not recommended for production!");const S=_.ShadyDOM?.inUse&&!0===_.ShadyDOM?.noPatch?_.ShadyDOM.wrap:e=>e,$=_.trustedTypes,k=$?$.createPolicy("lit-html",{createHTML:e=>e}):void 0,B=e=>e,P=(e,t,i)=>B,L=e=>{if(ae!==P)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");ae=e},A=()=>{ae=P},E=(e,t,i)=>ae(e,t,i),T="$lit$",z=`lit$${Math.random().toFixed(9).slice(2)}$`,U="?"+z,N=`<${U}>`,R=document,O=()=>R.createComment(""),I=e=>null===e||"object"!=typeof e&&"function"!=typeof e,D=Array.isArray,F="[ \t\n\f\r]",W=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,q=/-->/g,j=/>/g,J=new RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),G=/'/g,K=/"/g,X=/^(?:script|style|textarea|title)$/i,Y=(Q=1,(e,...t)=>(e.some((e=>void 0===e))&&console.warn("Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences."),t.some((e=>e?._$litStatic$))&&V("","Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\nPlease use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions"),{_$litType$:Q,strings:e,values:t}));var Q;const ee=Symbol.for("lit-noChange"),te=Symbol.for("lit-nothing"),ie=new WeakMap,le=R.createTreeWalker(R,129);let ae=P;function re(e,t){if(!D(e)||!e.hasOwnProperty("raw")){let e="invalid template strings array";throw e="\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n ".trim().replace(/\n */g,"\n"),new Error(e)}return void 0!==k?k.createHTML(t):t}class oe{constructor({strings:e,_$litType$:t},i){let l;this.parts=[];let a=0,r=0;const o=e.length-1,s=this.parts,[n,c]=((e,t)=>{const i=e.length-1,l=[];let a,r=2===t?"<svg>":3===t?"<math>":"",o=W;for(let t=0;t<i;t++){const i=e[t];let s,n,c=-1,d=0;for(;d<i.length&&(o.lastIndex=d,n=o.exec(i),null!==n);)if(d=o.lastIndex,o===W){if("!--"===n[1])o=q;else if(void 0!==n[1])o=j;else if(void 0!==n[2])X.test(n[2])&&(a=new RegExp(`</${n[2]}`,"g")),o=J;else if(void 0!==n[3])throw new Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions")}else o===J?">"===n[0]?(o=a??W,c=-1):void 0===n[1]?c=-2:(c=o.lastIndex-n[2].length,s=n[1],o=void 0===n[3]?J:'"'===n[3]?K:G):o===K||o===G?o=J:o===q||o===j?o=W:(o=J,a=void 0);console.assert(-1===c||o===J||o===G||o===K,"unexpected parse state B");const h=o===J&&e[t+1].startsWith("/>")?" ":"";r+=o===W?i+N:c>=0?(l.push(s),i.slice(0,c)+T+i.slice(c)+z+h):i+z+(-2===c?t:h)}return[re(e,r+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),l]})(e,t);if(this.el=oe.createElement(n,i),le.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(l=le.nextNode())&&s.length<o;){if(1===l.nodeType){{const e=l.localName;if(/^(?:textarea|template)$/i.test(e)&&l.innerHTML.includes(z)){const t=`Expressions are not supported inside \`${e}\` elements. See https://lit.dev/msg/expression-in-${e} for more information.`;if("template"===e)throw new Error(t);V("",t)}}if(l.hasAttributes())for(const e of l.getAttributeNames())if(e.endsWith(T)){const t=c[r++],i=l.getAttribute(e).split(z),o=/([.?@])?(.*)/.exec(t);s.push({type:1,index:a,name:o[2],strings:i,ctor:"."===o[1]?he:"?"===o[1]?ve:"@"===o[1]?pe:de}),l.removeAttribute(e)}else e.startsWith(z)&&(s.push({type:6,index:a}),l.removeAttribute(e));if(X.test(l.tagName)){const e=l.textContent.split(z),t=e.length-1;if(t>0){l.textContent=$?$.emptyScript:"";for(let i=0;i<t;i++)l.append(e[i],O()),le.nextNode(),s.push({type:2,index:++a});l.append(e[t],O())}}}else if(8===l.nodeType){if(l.data===U)s.push({type:2,index:a});else{let e=-1;for(;-1!==(e=l.data.indexOf(z,e+1));)s.push({type:7,index:a}),e+=z.length-1}}a++}if(c.length!==r)throw new Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+e.join("${...}")+"`");M&&M({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:e})}static createElement(e,t){const i=R.createElement("template");return i.innerHTML=e,i}}function se(e,t,i=e,l){if(t===ee)return t;let a=void 0!==l?i.__directives?.[l]:i.__directive;const r=I(t)?void 0:t._$litDirective$;return a?.constructor!==r&&(a?._$notifyDirectiveConnectionChanged?.(!1),void 0===r?a=void 0:(a=new r(e),a._$initialize(e,i,l)),void 0!==l?(i.__directives??=[])[l]=a:i.__directive=a),void 0!==a&&(t=se(e,a._$resolve(e,t.values),a,l)),t}class ne{constructor(e,t){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=e,this._$parent=t}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(e){const{el:{content:t},parts:i}=this._$template,l=(e?.creationScope??R).importNode(t,!0);le.currentNode=l;let a=le.nextNode(),r=0,o=0,s=i[0];for(;void 0!==s;){if(r===s.index){let t;2===s.type?t=new ce(a,a.nextSibling,this,e):1===s.type?t=new s.ctor(a,s.name,s.strings,this,e):6===s.type&&(t=new ge(a,this,e)),this._$parts.push(t),s=i[++o]}r!==s?.index&&(a=le.nextNode(),r++)}return le.currentNode=R,l}_update(e){let t=0;for(const i of this._$parts)void 0!==i&&(M&&M({kind:"set part",part:i,value:e[t],valueIndex:t,values:e,templateInstance:this}),void 0!==i.strings?(i._$setValue(e,i,t),t+=i.strings.length-2):i._$setValue(e[t])),t++}}class ce{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(e,t,i,l){this.type=2,this._$committedValue=te,this._$disconnectableChildren=void 0,this._$startNode=e,this._$endNode=t,this._$parent=i,this.options=l,this.__isConnected=l?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let e=S(this._$startNode).parentNode;const t=this._$parent;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(e,t=this){if(null===this.parentNode)throw new Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");if(e=se(this,e,t),I(e))e===te||null==e||""===e?(this._$committedValue!==te&&(M&&M({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=te):e!==this._$committedValue&&e!==ee&&this._commitText(e);else if(void 0!==e._$litType$)this._commitTemplateResult(e);else if(void 0!==e.nodeType){if(this.options?.host===e)return this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"),void console.warn("Attempted to render the template host",e,"inside itself. This is almost always a mistake, and in dev mode ","we render some warning text. In production however, we'll ","render it, which will usually result in an error, and sometimes ","in the element disappearing from the DOM.");this._commitNode(e)}else(e=>D(e)||"function"==typeof e?.[Symbol.iterator])(e)?this._commitIterable(e):this._commitText(e)}_insert(e){return S(S(this._$startNode).parentNode).insertBefore(e,this._$endNode)}_commitNode(e){if(this._$committedValue!==e){if(this._$clear(),ae!==P){const e=this._$startNode.parentNode?.nodeName;if("STYLE"===e||"SCRIPT"===e){let t="Forbidden";throw t="STYLE"===e?"Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets.":"Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.",new Error(t)}}M&&M({kind:"commit node",start:this._$startNode,parent:this._$parent,value:e,options:this.options}),this._$committedValue=this._insert(e)}}_commitText(e){if(this._$committedValue!==te&&I(this._$committedValue)){const t=S(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=E(t,"data","property")),e=this._textSanitizer(e),M&&M({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}else{const t=R.createTextNode("");this._commitNode(t),void 0===this._textSanitizer&&(this._textSanitizer=E(t,"data","property")),e=this._textSanitizer(e),M&&M({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}this._$committedValue=e}_commitTemplateResult(e){const{values:t,_$litType$:i}=e,l="number"==typeof i?this._$getTemplate(e):(void 0===i.el&&(i.el=oe.createElement(re(i.h,i.h[0]),this.options)),i);if(this._$committedValue?._$template===l)M&&M({kind:"template updating",template:l,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:t}),this._$committedValue._update(t);else{const e=new ne(l,this),i=e._clone(this.options);M&&M({kind:"template instantiated",template:l,instance:e,parts:e._$parts,options:this.options,fragment:i,values:t}),e._update(t),M&&M({kind:"template instantiated and updated",template:l,instance:e,parts:e._$parts,options:this.options,fragment:i,values:t}),this._commitNode(i),this._$committedValue=e}}_$getTemplate(e){let t=ie.get(e.strings);return void 0===t&&ie.set(e.strings,t=new oe(e)),t}_commitIterable(e){D(this._$committedValue)||(this._$committedValue=[],this._$clear());const t=this._$committedValue;let i,l=0;for(const a of e)l===t.length?t.push(i=new ce(this._insert(O()),this._insert(O()),this,this.options)):i=t[l],i._$setValue(a),l++;l<t.length&&(this._$clear(i&&S(i._$endNode).nextSibling,l),t.length=l)}_$clear(e=S(this._$startNode).nextSibling,t){for(this._$notifyConnectionChanged?.(!1,!0,t);e&&e!==this._$endNode;){const t=S(e).nextSibling;S(e).remove(),e=t}}setConnected(e){if(void 0!==this._$parent)throw new Error("part.setConnected() may only be called on a RootPart returned from render().");this.__isConnected=e,this._$notifyConnectionChanged?.(e)}}class de{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(e,t,i,l,a){this.type=1,this._$committedValue=te,this._$disconnectableChildren=void 0,this.element=e,this.name=t,this._$parent=l,this.options=a,i.length>2||""!==i[0]||""!==i[1]?(this._$committedValue=new Array(i.length-1).fill(new String),this.strings=i):this._$committedValue=te,this._sanitizer=void 0}_$setValue(e,t=this,i,l){const a=this.strings;let r=!1;if(void 0===a)e=se(this,e,t,0),r=!I(e)||e!==this._$committedValue&&e!==ee,r&&(this._$committedValue=e);else{const l=e;let o,s;for(e=a[0],o=0;o<a.length-1;o++)s=se(this,l[i+o],t,o),s===ee&&(s=this._$committedValue[o]),r||=!I(s)||s!==this._$committedValue[o],s===te?e=te:e!==te&&(e+=(s??"")+a[o+1]),this._$committedValue[o]=s}r&&!l&&this._commitValue(e)}_commitValue(e){e===te?S(this.element).removeAttribute(this.name):(void 0===this._sanitizer&&(this._sanitizer=ae(this.element,this.name,"attribute")),e=this._sanitizer(e??""),M&&M({kind:"commit attribute",element:this.element,name:this.name,value:e,options:this.options}),S(this.element).setAttribute(this.name,e??""))}}class he extends de{constructor(){super(...arguments),this.type=3}_commitValue(e){void 0===this._sanitizer&&(this._sanitizer=ae(this.element,this.name,"property")),e=this._sanitizer(e),M&&M({kind:"commit property",element:this.element,name:this.name,value:e,options:this.options}),this.element[this.name]=e===te?void 0:e}}class ve extends de{constructor(){super(...arguments),this.type=4}_commitValue(e){M&&M({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!e||e===te),options:this.options}),S(this.element).toggleAttribute(this.name,!!e&&e!==te)}}class pe extends de{constructor(e,t,i,l,a){if(super(e,t,i,l,a),this.type=5,void 0!==this.strings)throw new Error(`A \`<${e.localName}>\` has a \`@${t}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(e,t=this){if((e=se(this,e,t,0)??te)===ee)return;const i=this._$committedValue,l=e===te&&i!==te||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,a=e!==te&&(i===te||l);M&&M({kind:"commit event listener",element:this.element,name:this.name,value:e,options:this.options,removeListener:l,addListener:a,oldListener:i}),l&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,e),this._$committedValue=e}handleEvent(e){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,e):this._$committedValue.handleEvent(e)}}class ge{constructor(e,t,i){this.element=e,this.type=6,this._$disconnectableChildren=void 0,this._$parent=t,this.options=i}get _$isConnected(){return this._$parent._$isConnected}_$setValue(e){M&&M({kind:"commit to element binding",element:this.element,value:e,options:this.options}),se(this,e)}}const ue=_.litHtmlPolyfillSupportDevMode;ue?.(oe,ce),(_.litHtmlVersions??=[]).push("3.2.0"),_.litHtmlVersions.length>1&&V("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.");const fe=(e,t,i)=>{if(null==t)throw new TypeError(`The container to render into may not be ${t}`);const l=H++,a=i?.renderBefore??t;let r=a._$litPart$;if(M&&M({kind:"begin render",id:l,value:e,container:t,options:i,part:r}),void 0===r){const e=i?.renderBefore??null;a._$litPart$=r=new ce(t.insertBefore(O(),e),e,void 0,i??{})}return r._$setValue(e),M&&M({kind:"end render",id:l,value:e,container:t,options:i,part:r}),r};fe.setSanitizer=L,fe.createSanitizer=E,fe._testOnlyClearSanitizerFactoryDoNotCallOrElse=A;
19
19
  /**
20
20
  * @license
21
21
  * Copyright 2019 Google LLC
@@ -26,7 +26,7 @@ const we=globalThis,me=we.ShadowRoot&&(void 0===we.ShadyCSS||we.ShadyCSS.nativeS
26
26
  * @license
27
27
  * Copyright 2017 Google LLC
28
28
  * SPDX-License-Identifier: BSD-3-Clause
29
- */,{is:Me,defineProperty:Ve,getOwnPropertyDescriptor:He,getOwnPropertyNames:Se,getOwnPropertySymbols:$e,getPrototypeOf:Be}=Object,ke=globalThis;let Pe;const Le=ke.trustedTypes,Ae=Le?Le.emptyScript:"",Ee=ke.reactiveElementPolyfillSupportDevMode;{const e=ke.litIssuedWarnings??=new Set;Pe=(t,i)=>{i+=` See https://lit.dev/msg/${t} for more information.`,e.has(i)||(console.warn(i),e.add(i))},Pe("dev-mode","Lit is in dev mode. Not recommended for production!"),ke.ShadyDOM?.inUse&&void 0===Ee&&Pe("polyfill-support-missing","Shadow DOM is being polyfilled via `ShadyDOM` but the `polyfill-support` module has not been loaded.")}const Te=(e,t)=>e,ze={toAttribute(e,t){switch(t){case Boolean:e=e?Ae:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},Ue=(e,t)=>!Me(e,t),Ne={attribute:!0,type:String,converter:ze,reflect:!1,hasChanged:Ue};Symbol.metadata??=Symbol("metadata"),ke.litPropertyMetadata??=new WeakMap;class Re extends HTMLElement{static addInitializer(e){this.__prepare(),(this._initializers??=[]).push(e)}static get observedAttributes(){return this.finalize(),this.__attributeToPropertyMap&&[...this.__attributeToPropertyMap.keys()]}static createProperty(e,t=Ne){if(t.state&&(t.attribute=!1),this.__prepare(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol.for(`${String(e)} (@property() cache)`),l=this.getPropertyDescriptor(e,i,t);void 0!==l&&Ve(this.prototype,e,l)}}static getPropertyDescriptor(e,t,i){const{get:l,set:a}=He(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};if(null==l){if("value"in(He(this.prototype,e)??{}))throw new Error(`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it's actually declared as a value on the prototype. Usually this is due to using @property or @state on a method.`);Pe("reactive-property-without-getter",`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it does not have a getter. This will be an error in a future version of Lit.`)}return{get(){return l?.call(this)},set(t){const r=l?.call(this);a.call(this,t),this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ne}static __prepare(){if(this.hasOwnProperty(Te("elementProperties")))return;const e=Be(this);e.finalize(),void 0!==e._initializers&&(this._initializers=[...e._initializers]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Te("finalized")))return;if(this.finalized=!0,this.__prepare(),this.hasOwnProperty(Te("properties"))){const e=this.properties,t=[...Se(e),...$e(e)];for(const i of t)this.createProperty(i,e[i])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,i]of t)this.elementProperties.set(e,i)}this.__attributeToPropertyMap=new Map;for(const[e,t]of this.elementProperties){const i=this.__attributeNameForProperty(e,t);void 0!==i&&this.__attributeToPropertyMap.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles),this.hasOwnProperty("createProperty")&&Pe("no-override-create-property","Overriding ReactiveElement.createProperty() is deprecated. The override will not be called with standard decorators"),this.hasOwnProperty("getPropertyDescriptor")&&Pe("no-override-get-property-descriptor","Overriding ReactiveElement.getPropertyDescriptor() is deprecated. The override will not be called with standard decorators")}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(_e(e))}else void 0!==e&&t.push(_e(e));return t}static __attributeNameForProperty(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this.__instanceProperties=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.__reflectingProperty=null,this.__initialize()}__initialize(){this.__updatePromise=new Promise((e=>this.enableUpdating=e)),this._$changedProperties=new Map,this.__saveInstanceProperties(),this.requestUpdate(),this.constructor._initializers?.forEach((e=>e(this)))}addController(e){(this.__controllers??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this.__controllers?.delete(e)}__saveInstanceProperties(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this.__instanceProperties=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(me)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const i of t){const t=document.createElement("style"),l=we.litNonce;void 0!==l&&t.setAttribute("nonce",l),t.textContent=i.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this.__controllers?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this.__controllers?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,i){this._$attributeToProperty(e,i)}__propertyToAttribute(e,t){const i=this.constructor.elementProperties.get(e),l=this.constructor.__attributeNameForProperty(e,i);if(void 0!==l&&!0===i.reflect){const a=(void 0!==i.converter?.toAttribute?i.converter:ze).toAttribute(t,i.type);this.constructor.enabledWarnings.includes("migration")&&void 0===a&&Pe("undefined-attribute-value",`The attribute value for the ${e} property is undefined on element ${this.localName}. The attribute will be removed, but in the previous version of \`ReactiveElement\`, the attribute would not have changed.`),this.__reflectingProperty=e,null==a?this.removeAttribute(l):this.setAttribute(l,a),this.__reflectingProperty=null}}_$attributeToProperty(e,t){const i=this.constructor,l=i.__attributeToPropertyMap.get(e);if(void 0!==l&&this.__reflectingProperty!==l){const e=i.getPropertyOptions(l),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:ze;this.__reflectingProperty=l,this[l]=a.fromAttribute(t,e.type),this.__reflectingProperty=null}}requestUpdate(e,t,i){if(void 0!==e){e instanceof Event&&Pe("","The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()"),i??=this.constructor.getPropertyOptions(e);if(!(i.hasChanged??Ue)(this[e],t))return;this._$changeProperty(e,t,i)}!1===this.isUpdatePending&&(this.__updatePromise=this.__enqueueUpdate())}_$changeProperty(e,t,i){this._$changedProperties.has(e)||this._$changedProperties.set(e,t),!0===i.reflect&&this.__reflectingProperty!==e&&(this.__reflectingProperties??=new Set).add(e)}async __enqueueUpdate(){this.isUpdatePending=!0;try{await this.__updatePromise}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){const e=this.performUpdate();return this.constructor.enabledWarnings.includes("async-perform-update")&&"function"==typeof e?.then&&Pe("async-perform-update",`Element ${this.localName} returned a Promise from performUpdate(). This behavior is deprecated and will be removed in a future version of ReactiveElement.`),e}performUpdate(){if(!this.isUpdatePending)return;var e;if(e={kind:"update"},ke.emitLitDebugLogEvents&&ke.dispatchEvent(new CustomEvent("lit-debug",{detail:e})),!this.hasUpdated){this.renderRoot??=this.createRenderRoot();{const e=[...this.constructor.elementProperties.keys()].filter((e=>this.hasOwnProperty(e)&&e in Be(this)));if(e.length)throw new Error(`The following properties on element ${this.localName} will not trigger updates as expected because they are set using class fields: ${e.join(", ")}. Native class fields and some compiled output will overwrite accessors used for detecting changes. See https://lit.dev/msg/class-field-shadowing for more information.`)}if(this.__instanceProperties){for(const[e,t]of this.__instanceProperties)this[e]=t;this.__instanceProperties=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,i]of e)!0!==i.wrapped||this._$changedProperties.has(t)||void 0===this[t]||this._$changeProperty(t,this[t],i)}let t=!1;const i=this._$changedProperties;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),this.__controllers?.forEach((e=>e.hostUpdate?.())),this.update(i)):this.__markUpdated()}catch(e){throw t=!1,this.__markUpdated(),e}t&&this._$didUpdate(i)}willUpdate(e){}_$didUpdate(e){this.__controllers?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e),this.isUpdatePending&&this.constructor.enabledWarnings.includes("change-in-update")&&Pe("change-in-update",`Element ${this.localName} scheduled an update (generally because a property was set) after an update completed, causing a new update to be scheduled. This is inefficient and should be avoided unless the next update can only be scheduled as a side effect of the previous update.`)}__markUpdated(){this._$changedProperties=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.__updatePromise}shouldUpdate(e){return!0}update(e){this.__reflectingProperties&&=this.__reflectingProperties.forEach((e=>this.__propertyToAttribute(e,this[e]))),this.__markUpdated()}updated(e){}firstUpdated(e){}}Re.elementStyles=[],Re.shadowRootOptions={mode:"open"},Re[Te("elementProperties")]=new Map,Re[Te("finalized")]=new Map,Ee?.({ReactiveElement:Re});{Re.enabledWarnings=["change-in-update","async-perform-update"];const e=function(e){e.hasOwnProperty(Te("enabledWarnings"))||(e.enabledWarnings=e.enabledWarnings.slice())};Re.enableWarning=function(t){e(this),this.enabledWarnings.includes(t)||this.enabledWarnings.push(t)},Re.disableWarning=function(t){e(this);const i=this.enabledWarnings.indexOf(t);i>=0&&this.enabledWarnings.splice(i,1)}}(ke.reactiveElementVersions??=[]).push("2.0.4"),ke.reactiveElementVersions.length>1&&Pe("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")
29
+ */,{is:Me,defineProperty:Ve,getOwnPropertyDescriptor:He,getOwnPropertyNames:Se,getOwnPropertySymbols:$e,getPrototypeOf:ke}=Object,Be=globalThis;let Pe;const Le=Be.trustedTypes,Ae=Le?Le.emptyScript:"",Ee=Be.reactiveElementPolyfillSupportDevMode;{const e=Be.litIssuedWarnings??=new Set;Pe=(t,i)=>{i+=` See https://lit.dev/msg/${t} for more information.`,e.has(i)||(console.warn(i),e.add(i))},Pe("dev-mode","Lit is in dev mode. Not recommended for production!"),Be.ShadyDOM?.inUse&&void 0===Ee&&Pe("polyfill-support-missing","Shadow DOM is being polyfilled via `ShadyDOM` but the `polyfill-support` module has not been loaded.")}const Te=(e,t)=>e,ze={toAttribute(e,t){switch(t){case Boolean:e=e?Ae:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},Ue=(e,t)=>!Me(e,t),Ne={attribute:!0,type:String,converter:ze,reflect:!1,hasChanged:Ue};Symbol.metadata??=Symbol("metadata"),Be.litPropertyMetadata??=new WeakMap;class Re extends HTMLElement{static addInitializer(e){this.__prepare(),(this._initializers??=[]).push(e)}static get observedAttributes(){return this.finalize(),this.__attributeToPropertyMap&&[...this.__attributeToPropertyMap.keys()]}static createProperty(e,t=Ne){if(t.state&&(t.attribute=!1),this.__prepare(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol.for(`${String(e)} (@property() cache)`),l=this.getPropertyDescriptor(e,i,t);void 0!==l&&Ve(this.prototype,e,l)}}static getPropertyDescriptor(e,t,i){const{get:l,set:a}=He(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};if(null==l){if("value"in(He(this.prototype,e)??{}))throw new Error(`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it's actually declared as a value on the prototype. Usually this is due to using @property or @state on a method.`);Pe("reactive-property-without-getter",`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it does not have a getter. This will be an error in a future version of Lit.`)}return{get(){return l?.call(this)},set(t){const r=l?.call(this);a.call(this,t),this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ne}static __prepare(){if(this.hasOwnProperty(Te("elementProperties")))return;const e=ke(this);e.finalize(),void 0!==e._initializers&&(this._initializers=[...e._initializers]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Te("finalized")))return;if(this.finalized=!0,this.__prepare(),this.hasOwnProperty(Te("properties"))){const e=this.properties,t=[...Se(e),...$e(e)];for(const i of t)this.createProperty(i,e[i])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,i]of t)this.elementProperties.set(e,i)}this.__attributeToPropertyMap=new Map;for(const[e,t]of this.elementProperties){const i=this.__attributeNameForProperty(e,t);void 0!==i&&this.__attributeToPropertyMap.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles),this.hasOwnProperty("createProperty")&&Pe("no-override-create-property","Overriding ReactiveElement.createProperty() is deprecated. The override will not be called with standard decorators"),this.hasOwnProperty("getPropertyDescriptor")&&Pe("no-override-get-property-descriptor","Overriding ReactiveElement.getPropertyDescriptor() is deprecated. The override will not be called with standard decorators")}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(_e(e))}else void 0!==e&&t.push(_e(e));return t}static __attributeNameForProperty(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this.__instanceProperties=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.__reflectingProperty=null,this.__initialize()}__initialize(){this.__updatePromise=new Promise((e=>this.enableUpdating=e)),this._$changedProperties=new Map,this.__saveInstanceProperties(),this.requestUpdate(),this.constructor._initializers?.forEach((e=>e(this)))}addController(e){(this.__controllers??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this.__controllers?.delete(e)}__saveInstanceProperties(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this.__instanceProperties=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(me)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const i of t){const t=document.createElement("style"),l=we.litNonce;void 0!==l&&t.setAttribute("nonce",l),t.textContent=i.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this.__controllers?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this.__controllers?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,i){this._$attributeToProperty(e,i)}__propertyToAttribute(e,t){const i=this.constructor.elementProperties.get(e),l=this.constructor.__attributeNameForProperty(e,i);if(void 0!==l&&!0===i.reflect){const a=(void 0!==i.converter?.toAttribute?i.converter:ze).toAttribute(t,i.type);this.constructor.enabledWarnings.includes("migration")&&void 0===a&&Pe("undefined-attribute-value",`The attribute value for the ${e} property is undefined on element ${this.localName}. The attribute will be removed, but in the previous version of \`ReactiveElement\`, the attribute would not have changed.`),this.__reflectingProperty=e,null==a?this.removeAttribute(l):this.setAttribute(l,a),this.__reflectingProperty=null}}_$attributeToProperty(e,t){const i=this.constructor,l=i.__attributeToPropertyMap.get(e);if(void 0!==l&&this.__reflectingProperty!==l){const e=i.getPropertyOptions(l),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:ze;this.__reflectingProperty=l,this[l]=a.fromAttribute(t,e.type),this.__reflectingProperty=null}}requestUpdate(e,t,i){if(void 0!==e){e instanceof Event&&Pe("","The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()"),i??=this.constructor.getPropertyOptions(e);if(!(i.hasChanged??Ue)(this[e],t))return;this._$changeProperty(e,t,i)}!1===this.isUpdatePending&&(this.__updatePromise=this.__enqueueUpdate())}_$changeProperty(e,t,i){this._$changedProperties.has(e)||this._$changedProperties.set(e,t),!0===i.reflect&&this.__reflectingProperty!==e&&(this.__reflectingProperties??=new Set).add(e)}async __enqueueUpdate(){this.isUpdatePending=!0;try{await this.__updatePromise}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){const e=this.performUpdate();return this.constructor.enabledWarnings.includes("async-perform-update")&&"function"==typeof e?.then&&Pe("async-perform-update",`Element ${this.localName} returned a Promise from performUpdate(). This behavior is deprecated and will be removed in a future version of ReactiveElement.`),e}performUpdate(){if(!this.isUpdatePending)return;var e;if(e={kind:"update"},Be.emitLitDebugLogEvents&&Be.dispatchEvent(new CustomEvent("lit-debug",{detail:e})),!this.hasUpdated){this.renderRoot??=this.createRenderRoot();{const e=[...this.constructor.elementProperties.keys()].filter((e=>this.hasOwnProperty(e)&&e in ke(this)));if(e.length)throw new Error(`The following properties on element ${this.localName} will not trigger updates as expected because they are set using class fields: ${e.join(", ")}. Native class fields and some compiled output will overwrite accessors used for detecting changes. See https://lit.dev/msg/class-field-shadowing for more information.`)}if(this.__instanceProperties){for(const[e,t]of this.__instanceProperties)this[e]=t;this.__instanceProperties=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,i]of e)!0!==i.wrapped||this._$changedProperties.has(t)||void 0===this[t]||this._$changeProperty(t,this[t],i)}let t=!1;const i=this._$changedProperties;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),this.__controllers?.forEach((e=>e.hostUpdate?.())),this.update(i)):this.__markUpdated()}catch(e){throw t=!1,this.__markUpdated(),e}t&&this._$didUpdate(i)}willUpdate(e){}_$didUpdate(e){this.__controllers?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e),this.isUpdatePending&&this.constructor.enabledWarnings.includes("change-in-update")&&Pe("change-in-update",`Element ${this.localName} scheduled an update (generally because a property was set) after an update completed, causing a new update to be scheduled. This is inefficient and should be avoided unless the next update can only be scheduled as a side effect of the previous update.`)}__markUpdated(){this._$changedProperties=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.__updatePromise}shouldUpdate(e){return!0}update(e){this.__reflectingProperties&&=this.__reflectingProperties.forEach((e=>this.__propertyToAttribute(e,this[e]))),this.__markUpdated()}updated(e){}firstUpdated(e){}}Re.elementStyles=[],Re.shadowRootOptions={mode:"open"},Re[Te("elementProperties")]=new Map,Re[Te("finalized")]=new Map,Ee?.({ReactiveElement:Re});{Re.enabledWarnings=["change-in-update","async-perform-update"];const e=function(e){e.hasOwnProperty(Te("enabledWarnings"))||(e.enabledWarnings=e.enabledWarnings.slice())};Re.enableWarning=function(t){e(this),this.enabledWarnings.includes(t)||this.enabledWarnings.push(t)},Re.disableWarning=function(t){e(this);const i=this.enabledWarnings.indexOf(t);i>=0&&this.enabledWarnings.splice(i,1)}}(Be.reactiveElementVersions??=[]).push("2.0.4"),Be.reactiveElementVersions.length>1&&Pe("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")
30
30
  /**
31
31
  * @license
32
32
  * Copyright 2017 Google LLC
@@ -79,53 +79,53 @@ function Ye(e){return(t,i)=>Ke(t,i,{async get(){return await this.updateComplete
79
79
  * @license
80
80
  * Copyright 2020 Google LLC
81
81
  * SPDX-License-Identifier: BSD-3-Clause
82
- */class dt{}const ht=new WeakMap;const vt=tt(class extends ct{render(e){return te}update(e,[t]){const i=t!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),te}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let i=ht.get(t);void 0===i&&(i=new WeakMap,ht.set(t,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,e),void 0!==e&&this._ref.call(this._context,e)}else this._ref.value=e}get _lastElementForRef(){return"function"==typeof this._ref?ht.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),pt=e=>e??te;
83
- /**
84
- * @license
85
- * Copyright 2018 Google LLC
86
- * SPDX-License-Identifier: BSD-3-Clause
87
- */var gt=Ze`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-2);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-24);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:var(--sgds-icon-size-lg);margin-left:.25rem;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:bottom;width:var(--sgds-icon-size-lg)}::slotted(svg){vertical-align:middle}}`;class ut extends Ie{emit(e,t){const i=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){if(customElements.get(e));else try{customElements.define(e,t,i)}catch(l){customElements.define(e,class extends t{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach((([e,t])=>{this.constructor.define(e,t)}))}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach((e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))})))}}ut.styles=[gt],ut.dependencies={},e([Ge({type:Boolean,reflect:!0})],ut.prototype,"ssr",void 0);var ft=Ze`:host{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm);display:inline-flex}:host([size=sm]) .btn-close{height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}:host([variant=light]) .btn-close{color:var(--sgds-color-fixed-light)}:host([variant=dark]) .btn-close{color:var(--sgds-color-fixed-dark)}.btn-close{align-items:center;background-color:var(--sgds-bg-transparent);border:0;border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-close-btn-border-radius);cursor:pointer;display:flex;height:var(--sgds-dimension-32);justify-content:center;padding:0;position:relative;width:var(--sgds-dimension-32)}.btn-close:hover{background-color:var(--sgds-bg-translucent)}.btn-close:focus,.btn-close:focus-visible{background-color:var(--sgds-bg-translucent)}.btn-close:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.btn-close-sm{height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}.btn-close.btn-close-sm{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}`;function wt(e){return!!function(e){return!!customElements.get(e)}(e)||(console.error(`Custom element of name : ${e} is not registered. Remember to import the component file for custom element registration`),!1)}class mt extends ut{constructor(){super(...arguments),this.ariaLabel="Close button",this.size="md",this.variant="default",this._clickHandler=()=>{}}_handleClick(){this.removeEventListener("click",this._clickHandler),this.addEventListener("click",this._clickHandler)}firstUpdated(e){super.firstUpdated(e),wt("sgds-icon")}render(){return Y`
88
- <button class="btn-close" aria-label=${pt(this.ariaLabel)} @click=${this._handleClick}>
82
+ */class dt{}const ht=new WeakMap;const vt=tt(class extends ct{render(e){return te}update(e,[t]){const i=t!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),te}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let i=ht.get(t);void 0===i&&(i=new WeakMap,ht.set(t,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,e),void 0!==e&&this._ref.call(this._context,e)}else this._ref.value=e}get _lastElementForRef(){return"function"==typeof this._ref?ht.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}});var pt=Ze`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-2);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-24);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:var(--sgds-icon-size-lg);margin-left:.25rem;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:bottom;width:var(--sgds-icon-size-lg)}::slotted(svg){vertical-align:middle}}`;class gt extends Ie{emit(e,t){const i=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){if(customElements.get(e));else try{customElements.define(e,t,i)}catch(l){customElements.define(e,class extends t{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach((([e,t])=>{this.constructor.define(e,t)}))}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach((e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))})))}}gt.styles=[pt],gt.dependencies={},e([Ge({type:Boolean,reflect:!0})],gt.prototype,"ssr",void 0);var ut=Ze`:host{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm);display:inline-flex}:host([size=sm]) .btn-close{height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}:host([tone=fixed-light]) .btn-close{color:var(--sgds-color-fixed-light)}:host([tone=fixed-dark]) .btn-close{color:var(--sgds-color-fixed-dark)}.btn-close{align-items:center;background-color:var(--sgds-bg-transparent);border:0;border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-close-btn-border-radius);cursor:pointer;display:flex;height:var(--sgds-dimension-32);justify-content:center;padding:0;position:relative;width:var(--sgds-dimension-32)}.btn-close:focus,.btn-close:focus-visible,.btn-close:hover{background-color:var(--sgds-bg-translucent)}:host([tone=fixed-light]) .btn-close:focus,:host([tone=fixed-light]) .btn-close:focus-visible,:host([tone=fixed-light]) .btn-close:hover{background-color:var(--sgds-bg-translucent-fixed-light)}:host([tone=fixed-dark]) .btn-close:focus,:host([tone=fixed-dark]) .btn-close:focus-visible,:host([tone=fixed-dark]) .btn-close:hover{background-color:var(--sgds-bg-translucent-fixed-dark)}.btn-close:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.btn-close-sm{height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}.btn-close.btn-close-sm{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}`;function ft(e){return!!function(e){return!!customElements.get(e)}(e)||(console.error(`Custom element of name : ${e} is not registered. Remember to import the component file for custom element registration`),!1)}class wt extends gt{constructor(){super(...arguments),this.size="md",this.tone="default",this._clickHandler=()=>{}}_handleClick(){this.removeEventListener("click",this._clickHandler),this.addEventListener("click",this._clickHandler)}firstUpdated(e){super.firstUpdated(e),ft("sgds-icon")}render(){return Y`
83
+ <button class="btn-close" aria-label="Close button" @click=${this._handleClick}>
89
84
  <sgds-icon name="cross" size=${this.size}></sgds-icon>
90
85
  </button>
91
- `}}mt.styles=[...ut.styles,ft],e([Ge({type:String})],mt.prototype,"ariaLabel",void 0),e([Ge({type:String,reflect:!0})],mt.prototype,"size",void 0),e([Ge({type:String,reflect:!0})],mt.prototype,"variant",void 0);const bt=tt(
86
+ `}}wt.styles=[...gt.styles,ut],e([Ge({type:String,reflect:!0})],wt.prototype,"size",void 0),e([Ge({type:String,reflect:!0})],wt.prototype,"tone",void 0);const mt=tt(
92
87
  /**
93
88
  * @license
94
89
  * Copyright 2018 Google LLC
95
90
  * SPDX-License-Identifier: BSD-3-Clause
96
91
  */
97
- class extends it{constructor(e){if(super(e),e.type!==Qe||"class"!==e.name||e.strings?.length>2)throw new Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t=>e[t])).join(" ")+" "}update(e,[t]){if(void 0===this._previousClasses){this._previousClasses=new Set,void 0!==e.strings&&(this._staticClasses=new Set(e.strings.join(" ").split(/\s/).filter((e=>""!==e))));for(const e in t)t[e]&&!this._staticClasses?.has(e)&&this._previousClasses.add(e);return this.render(t)}const i=e.element.classList;for(const e of this._previousClasses)e in t||(i.remove(e),this._previousClasses.delete(e));for(const e in t){const l=!!t[e];l===this._previousClasses.has(e)||this._staticClasses?.has(e)||(l?(i.add(e),this._previousClasses.add(e)):(i.remove(e),this._previousClasses.delete(e)))}return ee}}),Ct=Symbol.for(""),xt=e=>{if(e?.r===Ct)return e?._$litStatic$},Zt=(e,...t)=>({_$litStatic$:t.reduce(((t,i,l)=>t+(e=>{if(void 0!==e._$litStatic$)return e._$litStatic$;throw new Error(`Value passed to 'literal' function must be a 'literal' result: ${e}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(i)+e[l+1]),e[0]),r:Ct}),yt=new Map,_t=(Mt=Y,(e,...t)=>{const i=t.length;let l,a;const r=[],o=[];let s,n=0,c=!1;for(;n<i;){for(s=e[n];n<i&&void 0!==(a=t[n],l=xt(a));)s+=l+e[++n],c=!0;n!==i&&o.push(a),r.push(s),n++}if(n===i&&r.push(e[i]),c){const i=r.join("$$lit$$");void 0===(e=yt.get(i))&&(r.raw=r,yt.set(i,e=r)),t=o}return Mt(e,...t)});
92
+ class extends it{constructor(e){if(super(e),e.type!==Qe||"class"!==e.name||e.strings?.length>2)throw new Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t=>e[t])).join(" ")+" "}update(e,[t]){if(void 0===this._previousClasses){this._previousClasses=new Set,void 0!==e.strings&&(this._staticClasses=new Set(e.strings.join(" ").split(/\s/).filter((e=>""!==e))));for(const e in t)t[e]&&!this._staticClasses?.has(e)&&this._previousClasses.add(e);return this.render(t)}const i=e.element.classList;for(const e of this._previousClasses)e in t||(i.remove(e),this._previousClasses.delete(e));for(const e in t){const l=!!t[e];l===this._previousClasses.has(e)||this._staticClasses?.has(e)||(l?(i.add(e),this._previousClasses.add(e)):(i.remove(e),this._previousClasses.delete(e)))}return ee}}),bt=e=>e??te
98
93
  /**
99
94
  * @license
100
95
  * Copyright 2020 Google LLC
101
96
  * SPDX-License-Identifier: BSD-3-Clause
102
- */var Mt,Vt,Ht,St=Ze`:host{--btn-font-weight:var(--sgds-font-weight-regular);--btn-color:var(--sgds-color-fixed-light);--btn-bg:var(--sgds-primary-surface-default);--btn-hover-bg:var(--sgds-primary-surface-emphasis);--btn-border-radius:var(--sgds-border-radius-md);--btn-opacity:var(--sgds-opacity-100,1)}:host([variant=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=primary][tone=brand]){--btn-bg:var(--sgds-primary-surface-default);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline]){--btn-border-width:var(--sgds-border-width-1)}:host([variant=outline][tone=brand]){--btn-border-color:var(--sgds-primary-border-color-default);--btn-bg:var(--sgds-bg-transparent);--btn-color:var(--sgds-primary-color-default);--btn-hover-bg:var(--sgds-primary-bg-translucent)}:host([variant=ghost][tone=brand]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-primary-surface-translucent);--btn-color:var(--sgds-primary-color-default)}:host([variant=primary][tone=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline][tone=danger]){--btn-border-color:var(--sgds-danger-border-color-default);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-danger-surface-translucent);--btn-color:var(--sgds-danger-color-default)}:host([variant=ghost][tone=danger]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-danger-surface-translucent);--btn-color:var(--sgds-danger-color-default)}:host([variant=primary][tone=fixed-light]){--btn-bg:var(--sgds-surface-fixed-light);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark,hsla(0,0%,5%,.2)) 0%,var(--sgds-bg-translucent-fixed-dark,hsla(0,0%,5%,.2)) 100%),var(--sgds-surface-fixed-light,#fff);--btn-color:var(--sgds-color-fixed-dark)}:host([variant=outline][tone=fixed-light]){--btn-border-color:var(--sgds-border-color-fixed-light);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark) 0%,var(--sgds-bg-translucent-fixed-dark) 100%),var(--sgds-bg-transparent);--btn-color:var(--sgds-color-fixed-light)}:host([variant=ghost][tone=fixed-light]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark) 0%,var(--sgds-bg-translucent-fixed-dark) 100%),var(--sgds-bg-transparent);--btn-color:var(--sgds-color-fixed-light)}:host([variant=primary][tone=neutral]){--btn-bg:var(--sgds-surface-inverse);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-inverse) 0%,var(--sgds-bg-translucent-inverse) 100%),var(--sgds-surface-inverse);--btn-color:var(--sgds-color-inverse)}:host([variant=outline][tone=neutral]){--btn-border-color:var(--sgds-border-color-emphasis);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-inverse) 0%,var(--sgds-bg-translucent-inverse) 100%),var(--sgds-bg-translucent-subtle);--btn-color:var(--sgds-color-default)}:host([variant=ghost][tone=neutral]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-bg-translucent-subtle);--btn-color:var(--sgds-color-default)}:host([variant=ghost]) .btn,:host([variant=outline]) .btn,:host([variant=primary]) .btn{color:var(--btn-color)}:host([variant=outline]) .btn{border:var(--btn-border-width) solid var(--btn-border-color)}:host([size=lg]) .btn{font-size:var(--sgds-font-size-3);height:var(--sgds-dimension-56);line-height:var(--sgds-line-height-32);min-width:var(--sgds-dimension-112);padding:var(--sgds-padding-none) var(--sgds-padding-xl)}:host([size=sm]) .btn{font-size:var(--sgds-font-size-1);height:var(--sgds-dimension-40);line-height:var(--sgds-line-height-20);min-width:var(--sgds-dimension-80);padding:var(--sgds-padding-none) var(--sgds-padding-md)}:host([size=xs]) .btn{font-size:var(--sgds-font-size-1);height:var(--sgds-dimension-32);line-height:var(--sgds-line-height-16);min-width:var(--sgds-dimension-64);padding:var(--sgds-padding-none) var(--sgds-padding-sm)}.btn{align-items:center;background-color:var(--btn-bg);border:1px solid var(--sgds-border-color-transparent);border-radius:var(--btn-border-radius);color:var(--sgds-color-fixed-light);cursor:pointer;display:inline-flex;font-size:var(--sgds-font-size-2);font-weight:var(--btn-font-weight);gap:var(--sgds-gap-2-xs);height:var(--sgds-dimension-48);justify-content:center;line-height:var(--sgds-line-height-24);min-width:var(--sgds-dimension-96);opacity:var(--btn-opacity);padding:var(--sgds-padding-none) var(--sgds-padding-lg);text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;user-select:none;vertical-align:middle;white-space:nowrap;width:inherit}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn.active,.btn:hover{background:var(--btn-hover-bg)}.btn:focus,.btn:focus-visible{background:var(--btn-hover-bg);border-color:transparent;outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.btn.disabled,.btn:disabled{color:var(--btn-color);cursor:not-allowed;opacity:var(--sgds-opacity-40)}.btn.loading{cursor:default}.btn slot::slotted(*){color:var(--btn-color)}`;class $t extends ut{constructor(){super(...arguments),this.variant="primary",this.tone="brand",this.size="md",this.active=!1,this.disabled=!1,this.target="_self"}focus(e){this.button.focus(e)}click(){this.button.click()}blur(){this.button.blur()}_handleBlur(){this.emit("sgds-blur")}_handleFocus(){this.emit("sgds-focus")}_handleClick(e){if(this.disabled||this.loading)return e.preventDefault(),void e.stopPropagation()}_handleKeydown(e){if("Enter"===e.key&&this.loading)return e.preventDefault(),void e.stopPropagation()}_assignSpinnerSize(e){return"xs"===e||"sm"===e?"xs":"md"===e||"lg"===e?"sm":void 0}_assignSpinnerTone(e,t){return"fixed-light"===e&&"primary"===t?"fixed-dark":"neutral"===e&&"primary"===t?"inverse":"fixed-light"===e||"primary"===t?"fixed-light":"neutral"!==e||"outline"!==t&&"ghost"!==t?"brand":"neutral"}}$t.styles=[...ut.styles,St],e([(Vt=".btn",(e,t,i)=>{const l=e=>{const i=e.renderRoot?.querySelector(Vt)??null;if(null===i&&Ht&&!e.hasUpdated){const e="object"==typeof t?t.name:t;Xe("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${Vt}' has been accessed before the first update and returned null. This is expected if the renderRoot tree has not been provided beforehand (e.g. via Declarative Shadow DOM). Therefore the value hasn't been cached.`)}return i};if(Ht){const{get:a,set:r}="object"==typeof t?e:i??(()=>{const e=Symbol(`${String(t)} (@query() cache)`);return{get(){return this[e]},set(t){this[e]=t}}})();return Ke(e,t,{get(){let e=a.call(this);return void 0===e&&(e=l(this),(null!==e||this.hasUpdated)&&r.call(this,e)),e}})}return Ke(e,t,{get(){return l(this)}})})],$t.prototype,"button",void 0),e([Ge({reflect:!0})],$t.prototype,"variant",void 0),e([Ge({reflect:!0})],$t.prototype,"tone",void 0),e([Ge({reflect:!0})],$t.prototype,"size",void 0),e([Ge({type:Boolean,reflect:!0})],$t.prototype,"active",void 0),e([Ge({type:Boolean,reflect:!0})],$t.prototype,"disabled",void 0),e([Ge({type:String,reflect:!0})],$t.prototype,"href",void 0),e([Ge({type:String,reflect:!0})],$t.prototype,"target",void 0),e([Ge({type:String,reflect:!0})],$t.prototype,"download",void 0),e([Ge({type:String})],$t.prototype,"ariaLabel",void 0),e([Ge({type:Boolean})],$t.prototype,"loading",void 0);class Bt{constructor(e,...t){this.slotNames=[],(this.host=e).addController(this),this.slotNames=t,this.handleSlotChange=this.handleSlotChange.bind(this)}hasDefaultSlot(){return[...this.host.childNodes].some((e=>{var t;if(e.nodeType===e.TEXT_NODE&&""!==(null===(t=e.textContent)||void 0===t?void 0:t.trim()))return!0;if(e.nodeType===e.ELEMENT_NODE){const t=e;if("sl-visually-hidden"===t.tagName.toLowerCase())return!1;if(!t.hasAttribute("slot"))return!0}return!1}))}hasNamedSlot(e){return null!==this.host.querySelector(`:scope > [slot="${e}"]`)}test(e){return"[default]"===e?this.hasDefaultSlot():this.hasNamedSlot(e)}hostConnected(){var e;null===(e=this.host.shadowRoot)||void 0===e||e.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){var e;null===(e=this.host.shadowRoot)||void 0===e||e.removeEventListener("slotchange",this.handleSlotChange)}handleSlotChange(e){const t=e.target;(this.slotNames.includes("[default]")&&!t.name||t.name&&this.slotNames.includes(t.name))&&this.host.requestUpdate()}}class kt{constructor(e,t){(this.host=e).addController(this),this.options=Object.assign({form:e=>e.closest("form")},t)}hostConnected(){this.form=this.options.form(this.host)}hostDisconnected(){this.form&&(this.form=void 0)}doAction(e,t){if(this.form){const i=document.createElement("button");i.type=e,i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.clipPath="inset(50%)",i.style.overflow="hidden",i.style.whiteSpace="nowrap",t&&["formaction","formmethod","formnovalidate","formtarget"].forEach((e=>{t.hasAttribute(e)&&i.setAttribute(e,t.getAttribute(e))})),this.form.append(i),i.click(),i.remove()}}reset(e){this.doAction("reset",e)}submit(e){this.doAction("submit",e)}}var Pt=Ze`::slotted(a[target=_blank]:after),a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;margin:0 .125rem;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.274 3.9H9.3a.6.6 0 0 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.361 6.41c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v5.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h5.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.469-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.274c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.524-.042-1.175-.042-1.993V9.274c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C7.805 3.9 8.456 3.9 9.274 3.9Zm3.626.6a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V5.949l-5.976 5.975a.6.6 0 0 1-.848-.848L18.05 5.1H13.5a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.274 3.9H9.3a.6.6 0 0 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.361 6.41c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v5.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h5.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.469-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.274c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.524-.042-1.175-.042-1.993V9.274c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C7.805 3.9 8.456 3.9 9.274 3.9Zm3.626.6a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V5.949l-5.976 5.975a.6.6 0 0 1-.848-.848L18.05 5.1H13.5a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;mask-size:73%;-webkit-mask-size:73%;padding:0 .45em}`,Lt=Ze`:host{display:inline-block}:host([fullWidth]),:host([fullWidth]) .btn{width:100%}:host([fullWidth]) .btn.has-left-icon{justify-content:flex-start}:host([fullWidth]) .btn.has-right-icon{justify-content:space-between}:host([fullWidth]) .btn.has-left-icon.has-right-icon{justify-content:center}.btn span{padding:0 var(--sgds-padding-2-xs)}.btn.no-icon{gap:var(--sgds-gap-none)}.loading{cursor:default}`;class At extends $t{constructor(){super(...arguments),this.formSubmitController=new kt(this,{form:e=>{if(e.hasAttribute("form")){const t=e.getRootNode(),i=e.getAttribute("form");return t.getElementById(i)}return e.closest("form")}}),this.type="button",this.fullWidth=!1,this.hasLeftIconSlot=!1,this.hasRightIconSlot=!1,this.hasSlotController=new Bt(this,"leftIcon","rightIcon"),this._clickHandler=()=>{"submit"===this.type&&this.formSubmitController.submit(this),"reset"===this.type&&this.formSubmitController.reset(this)}}updated(){this.hasLeftIconSlot||(this.hasLeftIconSlot=this.hasSlotController.test("leftIcon")),this.hasRightIconSlot||(this.hasRightIconSlot=this.hasSlotController.test("rightIcon"))}_handleClick(e){if(this.disabled||this.loading)return e.preventDefault(),void e.stopPropagation();this.removeEventListener("click",this._clickHandler),this.addEventListener("click",this._clickHandler)}render(){const e=this.href,t=e?Zt`a`:Zt`button`,i=!this.hasLeftIconSlot&&!this.hasRightIconSlot;return _t`
97
+ */,Ct=Symbol.for(""),xt=e=>{if(e?.r===Ct)return e?._$litStatic$},Zt=(e,...t)=>({_$litStatic$:t.reduce(((t,i,l)=>t+(e=>{if(void 0!==e._$litStatic$)return e._$litStatic$;throw new Error(`Value passed to 'literal' function must be a 'literal' result: ${e}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(i)+e[l+1]),e[0]),r:Ct}),yt=new Map,_t=(Mt=Y,(e,...t)=>{const i=t.length;let l,a;const r=[],o=[];let s,n=0,c=!1;for(;n<i;){for(s=e[n];n<i&&void 0!==(a=t[n],l=xt(a));)s+=l+e[++n],c=!0;n!==i&&o.push(a),r.push(s),n++}if(n===i&&r.push(e[i]),c){const i=r.join("$$lit$$");void 0===(e=yt.get(i))&&(r.raw=r,yt.set(i,e=r)),t=o}return Mt(e,...t)});
98
+ /**
99
+ * @license
100
+ * Copyright 2018 Google LLC
101
+ * SPDX-License-Identifier: BSD-3-Clause
102
+ */var Mt,Vt,Ht,St=Ze`:host{--btn-font-weight:var(--sgds-font-weight-regular);--btn-color:var(--sgds-color-fixed-light);--btn-bg:var(--sgds-primary-surface-default);--btn-hover-bg:var(--sgds-primary-surface-emphasis);--btn-border-radius:var(--sgds-border-radius-md);--btn-opacity:var(--sgds-opacity-100,1)}:host([variant=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=primary][tone=brand]){--btn-bg:var(--sgds-primary-surface-default);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline]){--btn-border-width:var(--sgds-border-width-1)}:host([variant=outline][tone=brand]){--btn-border-color:var(--sgds-primary-border-color-default);--btn-bg:var(--sgds-bg-transparent);--btn-color:var(--sgds-primary-color-default);--btn-hover-bg:var(--sgds-primary-bg-translucent)}:host([variant=ghost][tone=brand]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-primary-surface-translucent);--btn-color:var(--sgds-primary-color-default)}:host([variant=primary][tone=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline][tone=danger]){--btn-border-color:var(--sgds-danger-border-color-default);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-danger-surface-translucent);--btn-color:var(--sgds-danger-color-default)}:host([variant=ghost][tone=danger]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-danger-surface-translucent);--btn-color:var(--sgds-danger-color-default)}:host([variant=primary][tone=fixed-light]){--btn-bg:var(--sgds-surface-fixed-light);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark,hsla(0,0%,5%,.2)) 0%,var(--sgds-bg-translucent-fixed-dark,hsla(0,0%,5%,.2)) 100%),var(--sgds-surface-fixed-light,#fff);--btn-color:var(--sgds-color-fixed-dark)}:host([variant=outline][tone=fixed-light]){--btn-border-color:var(--sgds-border-color-fixed-light);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark) 0%,var(--sgds-bg-translucent-fixed-dark) 100%),var(--sgds-bg-transparent);--btn-color:var(--sgds-color-fixed-light)}:host([variant=ghost][tone=fixed-light]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark) 0%,var(--sgds-bg-translucent-fixed-dark) 100%),var(--sgds-bg-transparent);--btn-color:var(--sgds-color-fixed-light)}:host([variant=primary][tone=neutral]){--btn-bg:var(--sgds-surface-inverse);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-inverse) 0%,var(--sgds-bg-translucent-inverse) 100%),var(--sgds-surface-inverse);--btn-color:var(--sgds-color-inverse)}:host([variant=outline][tone=neutral]){--btn-border-color:var(--sgds-border-color-emphasis);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-inverse) 0%,var(--sgds-bg-translucent-inverse) 100%),var(--sgds-bg-translucent-subtle);--btn-color:var(--sgds-color-default)}:host([variant=ghost][tone=neutral]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-bg-translucent-subtle);--btn-color:var(--sgds-color-default)}:host([variant=ghost]) .btn,:host([variant=outline]) .btn,:host([variant=primary]) .btn{color:var(--btn-color)}:host([variant=outline]) .btn{border:var(--btn-border-width) solid var(--btn-border-color)}:host([size=lg]) .btn{font-size:var(--sgds-font-size-3);height:var(--sgds-dimension-56);line-height:var(--sgds-line-height-32);min-width:var(--sgds-dimension-112);padding:var(--sgds-padding-none) var(--sgds-padding-xl)}:host([size=sm]) .btn{font-size:var(--sgds-font-size-1);height:var(--sgds-dimension-40);line-height:var(--sgds-line-height-20);min-width:var(--sgds-dimension-80);padding:var(--sgds-padding-none) var(--sgds-padding-md)}:host([size=xs]) .btn{font-size:var(--sgds-font-size-0);height:var(--sgds-dimension-32);line-height:var(--sgds-line-height-16);min-width:var(--sgds-dimension-64);padding:var(--sgds-padding-none) var(--sgds-padding-sm)}.btn{align-items:center;background-color:var(--btn-bg);border:1px solid var(--sgds-border-color-transparent);border-radius:var(--btn-border-radius);color:var(--sgds-color-fixed-light);cursor:pointer;display:inline-flex;font-size:var(--sgds-font-size-2);font-weight:var(--btn-font-weight);gap:var(--sgds-gap-2-xs);height:var(--sgds-dimension-48);justify-content:center;line-height:var(--sgds-line-height-24);min-width:var(--sgds-dimension-96);opacity:var(--btn-opacity);padding:var(--sgds-padding-none) var(--sgds-padding-lg);text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;user-select:none;vertical-align:middle;white-space:nowrap;width:inherit}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn.active,.btn:hover{background:var(--btn-hover-bg)}.btn:focus,.btn:focus-visible{background:var(--btn-hover-bg);border-color:transparent;outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.btn.disabled,.btn:disabled{color:var(--btn-color);cursor:not-allowed;opacity:var(--sgds-opacity-40)}.btn.loading{cursor:default}.btn slot::slotted(*){color:var(--btn-color)}`;class $t extends gt{constructor(){super(...arguments),this.variant="primary",this.tone="brand",this.size="md",this.active=!1,this.disabled=!1,this.target="_self"}focus(e){this.button.focus(e)}click(){this.button.click()}blur(){this.button.blur()}_handleBlur(){this.emit("sgds-blur")}_handleFocus(){this.emit("sgds-focus")}_handleClick(e){if(this.disabled||this.loading)return e.preventDefault(),void e.stopPropagation()}_handleKeydown(e){if("Enter"===e.key&&this.loading)return e.preventDefault(),void e.stopPropagation()}_assignSpinnerSize(e){return"xs"===e||"sm"===e?"xs":"md"===e||"lg"===e?"sm":void 0}_assignSpinnerTone(e,t){return"fixed-light"===e&&"primary"===t?"fixed-dark":"neutral"===e&&"primary"===t?"inverse":"fixed-light"===e||"primary"===t?"fixed-light":"neutral"!==e||"outline"!==t&&"ghost"!==t?"brand":"neutral"}}$t.styles=[...gt.styles,St],e([(Vt=".btn",(e,t,i)=>{const l=e=>{const i=e.renderRoot?.querySelector(Vt)??null;if(null===i&&Ht&&!e.hasUpdated){const e="object"==typeof t?t.name:t;Xe("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${Vt}' has been accessed before the first update and returned null. This is expected if the renderRoot tree has not been provided beforehand (e.g. via Declarative Shadow DOM). Therefore the value hasn't been cached.`)}return i};if(Ht){const{get:a,set:r}="object"==typeof t?e:i??(()=>{const e=Symbol(`${String(t)} (@query() cache)`);return{get(){return this[e]},set(t){this[e]=t}}})();return Ke(e,t,{get(){let e=a.call(this);return void 0===e&&(e=l(this),(null!==e||this.hasUpdated)&&r.call(this,e)),e}})}return Ke(e,t,{get(){return l(this)}})})],$t.prototype,"button",void 0),e([Ge({reflect:!0})],$t.prototype,"variant",void 0),e([Ge({reflect:!0})],$t.prototype,"tone",void 0),e([Ge({reflect:!0})],$t.prototype,"size",void 0),e([Ge({type:Boolean,reflect:!0})],$t.prototype,"active",void 0),e([Ge({type:Boolean,reflect:!0})],$t.prototype,"disabled",void 0),e([Ge({type:String,reflect:!0})],$t.prototype,"href",void 0),e([Ge({type:String,reflect:!0})],$t.prototype,"target",void 0),e([Ge({type:String,reflect:!0})],$t.prototype,"download",void 0),e([Ge({type:String})],$t.prototype,"ariaLabel",void 0),e([Ge({type:Boolean})],$t.prototype,"loading",void 0);class kt{constructor(e,...t){this.slotNames=[],(this.host=e).addController(this),this.slotNames=t,this.handleSlotChange=this.handleSlotChange.bind(this)}hasDefaultSlot(){return[...this.host.childNodes].some((e=>{var t;if(e.nodeType===e.TEXT_NODE&&""!==(null===(t=e.textContent)||void 0===t?void 0:t.trim()))return!0;if(e.nodeType===e.ELEMENT_NODE){const t=e;if("sl-visually-hidden"===t.tagName.toLowerCase())return!1;if(!t.hasAttribute("slot"))return!0}return!1}))}hasNamedSlot(e){return null!==this.host.querySelector(`:scope > [slot="${e}"]`)}test(e){return"[default]"===e?this.hasDefaultSlot():this.hasNamedSlot(e)}hostConnected(){var e;null===(e=this.host.shadowRoot)||void 0===e||e.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){var e;null===(e=this.host.shadowRoot)||void 0===e||e.removeEventListener("slotchange",this.handleSlotChange)}handleSlotChange(e){const t=e.target;(this.slotNames.includes("[default]")&&!t.name||t.name&&this.slotNames.includes(t.name))&&this.host.requestUpdate()}}class Bt{constructor(e,t){(this.host=e).addController(this),this.options=Object.assign({form:e=>e.closest("form")},t)}hostConnected(){this.form=this.options.form(this.host)}hostDisconnected(){this.form&&(this.form=void 0)}doAction(e,t){if(this.form){const i=document.createElement("button");i.type=e,i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.clipPath="inset(50%)",i.style.overflow="hidden",i.style.whiteSpace="nowrap",t&&["formaction","formmethod","formnovalidate","formtarget"].forEach((e=>{t.hasAttribute(e)&&i.setAttribute(e,t.getAttribute(e))})),this.form.append(i),i.click(),i.remove()}}reset(e){this.doAction("reset",e)}submit(e){this.doAction("submit",e)}}var Pt=Ze`::slotted(a[target=_blank]:after),a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;margin:0 .125rem;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.274 3.9H9.3a.6.6 0 0 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.361 6.41c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v5.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h5.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.469-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.274c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.524-.042-1.175-.042-1.993V9.274c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C7.805 3.9 8.456 3.9 9.274 3.9Zm3.626.6a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V5.949l-5.976 5.975a.6.6 0 0 1-.848-.848L18.05 5.1H13.5a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.274 3.9H9.3a.6.6 0 0 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.361 6.41c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v5.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h5.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.469-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.274c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.524-.042-1.175-.042-1.993V9.274c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C7.805 3.9 8.456 3.9 9.274 3.9Zm3.626.6a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V5.949l-5.976 5.975a.6.6 0 0 1-.848-.848L18.05 5.1H13.5a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;mask-size:73%;-webkit-mask-size:73%;padding:0 .45em}`,Lt=Ze`:host{display:inline-block}:host([fullWidth]),:host([fullWidth]) .btn{width:100%}:host([fullWidth]) .btn.has-left-icon{justify-content:flex-start}:host([fullWidth]) .btn.has-right-icon{justify-content:space-between}:host([fullWidth]) .btn.has-left-icon.has-right-icon{justify-content:center}.btn span{padding:0 var(--sgds-padding-2-xs)}.btn.no-icon{gap:var(--sgds-gap-none)}.loading{cursor:default}`;class At extends $t{constructor(){super(...arguments),this.formSubmitController=new Bt(this,{form:e=>{if(e.hasAttribute("form")){const t=e.getRootNode(),i=e.getAttribute("form");return t.getElementById(i)}return e.closest("form")}}),this.type="button",this.fullWidth=!1,this.hasLeftIconSlot=!1,this.hasRightIconSlot=!1,this.hasSlotController=new kt(this,"leftIcon","rightIcon"),this._clickHandler=()=>{"submit"===this.type&&this.formSubmitController.submit(this),"reset"===this.type&&this.formSubmitController.reset(this)}}updated(){this.hasLeftIconSlot||(this.hasLeftIconSlot=this.hasSlotController.test("leftIcon")),this.hasRightIconSlot||(this.hasRightIconSlot=this.hasSlotController.test("rightIcon"))}_handleClick(e){if(this.disabled||this.loading)return e.preventDefault(),void e.stopPropagation();this.removeEventListener("click",this._clickHandler),this.addEventListener("click",this._clickHandler)}render(){const e=this.href,t=e?Zt`a`:Zt`button`,i=!this.hasLeftIconSlot&&!this.hasRightIconSlot;return _t`
103
103
  <${t}
104
- class="btn ${bt({disabled:this.disabled,active:this.active,"has-left-icon":this.hasLeftIconSlot,"has-right-icon":this.hasRightIconSlot,"no-icon":i,loading:this.loading})}"
105
- ?disabled=${pt(e?void 0:this.disabled)}
106
- type=${pt(e?void 0:this.type)}
107
- href=${pt(e?this.href:void 0)}
108
- target=${pt(e?this.target:void 0)}
109
- download=${pt(e?this.download:void 0)}
110
- rel=${pt(e&&"_blank"===this.target?"noreferrer noopener":void 0)}
111
- role=${pt(e?"button":void 0)}
104
+ class="btn ${mt({disabled:this.disabled,active:this.active,"has-left-icon":this.hasLeftIconSlot,"has-right-icon":this.hasRightIconSlot,"no-icon":i,loading:this.loading})}"
105
+ ?disabled=${bt(e?void 0:this.disabled)}
106
+ type=${bt(e?void 0:this.type)}
107
+ href=${bt(e?this.href:void 0)}
108
+ target=${bt(e?this.target:void 0)}
109
+ download=${bt(e?this.download:void 0)}
110
+ rel=${bt(e&&"_blank"===this.target?"noreferrer noopener":void 0)}
111
+ role=${bt(e?"button":void 0)}
112
112
  aria-disabled=${this.disabled||this.loading?"true":"false"}
113
113
  tabindex=${this.disabled?"-1":"0"}
114
114
  @click=${this._handleClick}
115
115
  @keydown=${this._handleKeydown}
116
116
  @focus=${this._handleFocus}
117
117
  @blur=${this._handleBlur}
118
- aria-label=${pt(this.loading?"Loading":this.ariaLabel)}
118
+ aria-label=${bt(this.loading?"Loading":this.ariaLabel)}
119
119
  >
120
120
  ${this.loading?_t`<sgds-spinner
121
- size=${pt(this._assignSpinnerSize(this.size))}
122
- tone=${pt(this._assignSpinnerTone(this.tone,this.variant))}
121
+ size=${bt(this._assignSpinnerSize(this.size))}
122
+ tone=${bt(this._assignSpinnerTone(this.tone,this.variant))}
123
123
  ></sgds-spinner>`:_t`<slot name="leftIcon"></slot>
124
124
  <span><slot></slot></span>
125
125
  <slot name="rightIcon"></slot>`}
126
126
 
127
127
  </${t}>
128
- `}}At.styles=[...$t.styles,Pt,Lt],e([Ge({type:String,reflect:!0})],At.prototype,"type",void 0),e([Ge({type:String,reflect:!0})],At.prototype,"form",void 0),e([Ge({type:String,reflect:!0,attribute:"formaction"})],At.prototype,"formAction",void 0),e([Ge({type:String,reflect:!0,attribute:"formmethod"})],At.prototype,"formMethod",void 0),e([Ge({attribute:"formnovalidate",type:Boolean,reflect:!0})],At.prototype,"formNoValidate",void 0),e([Ge({type:String,reflect:!0,attribute:"formtarget"})],At.prototype,"formTarget",void 0),e([Ge({type:Boolean,reflect:!0})],At.prototype,"fullWidth",void 0),e([Ge({type:Boolean})],At.prototype,"hasLeftIconSlot",void 0),e([Ge({type:Boolean})],At.prototype,"hasRightIconSlot",void 0);var Et=Ze`.file-upload{display:flex;flex-direction:column;gap:var(--sgds-form-gap-2-xl)}.file-upload-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.file-upload-list{display:flex;flex-direction:column;gap:var(--sgds-form-gap-xl);list-style-type:none}.file-upload-list-item{align-items:center;background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-muted);border-radius:var(--sgds-form-border-radius-md);display:flex;gap:var(--sgds-form-gap-lg);padding:var(--sgds-form-padding-y) var(--sgds-form-padding-x)}.file-upload-list-item span:not(:first-of-type){cursor:pointer}ul{margin:0;padding:0}input{display:none}label,sgds-button{cursor:pointer}sgds-close-button{margin-left:auto}sgds-icon.valid{color:var(--sgds-form-success-color-default)}sgds-icon.invalid{color:var(--sgds-color-muted)}`,Tt=Ze`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-1);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,zt=Ze`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-1);line-height:var(--sgds-line-height-20)}.form-text.disabled{opacity:var(--sgds-opacity-50)}`,Ut=Ze`.form-label{color:var(--sgds-form-color-default);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-50)}.form-check-label{color:var(--sgds-form-color-default)}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:not-allowed}`,Nt=Ze`.form-control::placeholder{color:var(--sgds-form-color-subtle);font-family:var(--sgds-font-family-brand);font-weight:var(--sgds-font-weight-light);line-height:var(--sgds-line-height-24)}`;function Rt(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class Ot extends ut{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=Rt("input"),this._labelId=Rt("label")}setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}}Ot.styles=[...ut.styles,Tt,zt,Ut,Nt],e([Ge({reflect:!0})],Ot.prototype,"label",void 0),e([Ge({reflect:!0})],Ot.prototype,"hintText",void 0),e([Ge({reflect:!0})],Ot.prototype,"name",void 0),e([Ge({type:Boolean,reflect:!0})],Ot.prototype,"disabled",void 0),e([Ge({type:Boolean,reflect:!0})],Ot.prototype,"invalid",void 0);class It{constructor(e,t){(this.host=e).addController(this),this._internals=this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",(e=>this.handleInvalid(e)))}hostDisconnected(){this.host.removeEventListener("invalid",(e=>this.handleInvalid(e)))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,i){return this._internals.setValidity(e,t,i)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const i in t)t[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const Dt=t=>{class i extends t{constructor(){super(...arguments),this._isTouched=!1}connectedCallback(){var e;super.connectedCallback(),this._mixinShouldSkipSgdsValidation()||null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new It(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this.inputValidationController.validateInput(e),this._isTouched&&(this._isTouched=!1)}_mixinValidate(e){this.inputValidationController.validateInput(e)}_mixinSetFormValue(){this.inputValidationController.setFormValue()}_mixinCheckValidity(){return this.inputValidationController.checkValidity()}_mixinReportValidity(){return this.inputValidationController.reportValidity()}_mixinGetValidity(){return this.inputValidationController.validity}_mixinGetValidationMessage(){return this.inputValidationController.validationMessage}_mixinSetValidity(e,t,i){return this.inputValidationController.setValidity(e,t,i)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return i.formAssociated=!0,e([Ye("sgds-input")],i.prototype,"sgdsInput",void 0),e([Ye("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};const Ft={archive:Y`
128
+ `}}At.styles=[...$t.styles,Pt,Lt],e([Ge({type:String,reflect:!0})],At.prototype,"type",void 0),e([Ge({type:String,reflect:!0})],At.prototype,"form",void 0),e([Ge({type:String,reflect:!0,attribute:"formaction"})],At.prototype,"formAction",void 0),e([Ge({type:String,reflect:!0,attribute:"formmethod"})],At.prototype,"formMethod",void 0),e([Ge({attribute:"formnovalidate",type:Boolean,reflect:!0})],At.prototype,"formNoValidate",void 0),e([Ge({type:String,reflect:!0,attribute:"formtarget"})],At.prototype,"formTarget",void 0),e([Ge({type:Boolean,reflect:!0})],At.prototype,"fullWidth",void 0),e([Ge({type:Boolean})],At.prototype,"hasLeftIconSlot",void 0),e([Ge({type:Boolean})],At.prototype,"hasRightIconSlot",void 0);var Et=Ze`.file-upload{display:flex;flex-direction:column;gap:var(--sgds-form-gap-2-xl)}.file-upload-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.file-upload-list{display:flex;flex-direction:column;gap:var(--sgds-form-gap-xl);list-style-type:none}.file-upload-list-item{align-items:center;background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-muted);border-radius:var(--sgds-form-border-radius-md);display:flex;gap:var(--sgds-form-gap-lg);padding:var(--sgds-form-padding-y) var(--sgds-form-padding-x)}.file-upload-list-item span:not(:first-of-type){cursor:pointer}ul{margin:0;padding:0}input{display:none}label,sgds-button{cursor:pointer}sgds-close-button{margin-left:auto}sgds-icon.valid{color:var(--sgds-form-success-color-default)}sgds-icon.invalid{color:var(--sgds-color-muted)}`,Tt=Ze`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-1);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,zt=Ze`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-1);line-height:var(--sgds-line-height-20)}.form-text.disabled{opacity:var(--sgds-opacity-50)}`,Ut=Ze`.form-label{color:var(--sgds-form-color-default);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-50)}.form-check-label{color:var(--sgds-form-color-default)}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:not-allowed}`,Nt=Ze`.form-control::placeholder{color:var(--sgds-form-color-subtle);font-family:var(--sgds-font-family-brand);font-weight:var(--sgds-font-weight-light);line-height:var(--sgds-line-height-24)}`;function Rt(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class Ot extends gt{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=Rt("input"),this._labelId=Rt("label")}setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}}Ot.styles=[...gt.styles,Tt,zt,Ut,Nt],e([Ge({reflect:!0})],Ot.prototype,"label",void 0),e([Ge({reflect:!0})],Ot.prototype,"hintText",void 0),e([Ge({reflect:!0})],Ot.prototype,"name",void 0),e([Ge({type:Boolean,reflect:!0})],Ot.prototype,"disabled",void 0),e([Ge({type:Boolean,reflect:!0})],Ot.prototype,"invalid",void 0);class It{constructor(e,t){(this.host=e).addController(this),this._internals=this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",(e=>this.handleInvalid(e)))}hostDisconnected(){this.host.removeEventListener("invalid",(e=>this.handleInvalid(e)))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,i){return this._internals.setValidity(e,t,i)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const i in t)t[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const Dt=t=>{class i extends t{constructor(){super(...arguments),this._isTouched=!1}connectedCallback(){var e;super.connectedCallback(),this._mixinShouldSkipSgdsValidation()||null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new It(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this.inputValidationController.validateInput(e),this._isTouched&&(this._isTouched=!1)}_mixinValidate(e){this.inputValidationController.validateInput(e)}_mixinSetFormValue(){this.inputValidationController.setFormValue()}_mixinCheckValidity(){return this.inputValidationController.checkValidity()}_mixinReportValidity(){return this.inputValidationController.reportValidity()}_mixinGetValidity(){return this.inputValidationController.validity}_mixinGetValidationMessage(){return this.inputValidationController.validationMessage}_mixinSetValidity(e,t,i){return this.inputValidationController.setValidity(e,t,i)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return i.formAssociated=!0,e([Ye("sgds-input")],i.prototype,"sgdsInput",void 0),e([Ye("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};const Ft={archive:Y`
129
129
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
130
130
  <path
131
131
  fill="currentColor"
@@ -2014,7 +2014,7 @@ class extends it{constructor(e){if(super(e),e.type!==Qe||"class"!==e.name||e.str
2014
2014
  clip-rule="evenodd"
2015
2015
  />
2016
2016
  </svg>
2017
- `};var Wt,qt,jt,Jt=Ze`:host{color:inherit;display:inline-flex;vertical-align:bottom}:host(.icon-left){margin-right:.25rem}:host(.icon-right){margin-left:.25rem}:host([size=xs]) svg{height:var(--sgds-icon-size-xs);width:var(--sgds-icon-size-xs)}:host([size=sm]) svg{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}:host([size=md]) svg{height:var(--sgds-icon-size-md);width:var(--sgds-icon-size-md)}:host([size=xl]) svg{height:var(--sgds-icon-size-xl);width:var(--sgds-icon-size-xl)}:host([size="2-xl"]) svg{height:var(--sgds-icon-size-2-xl);width:var(--sgds-icon-size-2-xl)}:host([size="3-xl"]) svg{height:var(--sgds-icon-size-3-xl);width:var(--sgds-icon-size-3-xl)}svg{display:inline-block;height:var(--sgds-icon-size-lg);width:var(--sgds-icon-size-lg)}`;class Gt extends ut{constructor(){super(...arguments),this.size="lg"}_getIconByName(e){if(!e)return;const t=Ft[e];if(t)return t;console.warn(`Icon not found: ${e}`)}render(){const e=this._getIconByName(this.name);return e||te}}Gt.styles=[...ut.styles,Jt],e([Ge({type:String,reflect:!0})],Gt.prototype,"name",void 0),e([Ge({type:String,reflect:!0})],Gt.prototype,"size",void 0);class Kt extends(Dt(Ot)){constructor(){super(...arguments),this.multiple=!1,this.accept="",this.hasFeedback=!1,this.required=!1,this.selectedFiles=[],this.inputRef=new dt}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}get files(){return this.selectedFiles}_setFileList(e){this.emit("sgds-files-selected",{detail:e})}_handleClick(e){if(e.preventDefault(),!this.disabled){this.inputRef.value.click()}}_handleChange(e){const t=e.target.files;t.length>0&&(this.selectedFiles=Array.from(t)),this._setFileList(t),this.requestUpdate(),super._mixinHandleChange(e)}_removeFileHandler(e){const t=this.inputRef.value,i=t.files,l=new DataTransfer;for(let t=0;t<i.length;t++)e!==t&&l.items.add(i[t]);t.files=l.files,this._setFileList(l.files),this.selectedFiles=Array.from(l.files),this.requestUpdate(),this._mixinValidate(this.input)}_clearAllFiles(){const e=this.inputRef.value,t=new DataTransfer;e.files=t.files,this._setFileList(t.files),this.selectedFiles=Array.from(t.files)}_mixinResetFormControl(){this._clearAllFiles(),this._mixinResetValidity(this.input)}_handleDisabledChange(){this.setInvalid(!1)}_renderLabel(){const e=Y`
2017
+ `};var Wt,qt,jt,Jt=Ze`:host{color:inherit;display:inline-flex;vertical-align:bottom}:host(.icon-left){margin-right:.25rem}:host(.icon-right){margin-left:.25rem}:host([size=xs]) svg{height:var(--sgds-icon-size-xs);width:var(--sgds-icon-size-xs)}:host([size=sm]) svg{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}:host([size=md]) svg{height:var(--sgds-icon-size-md);width:var(--sgds-icon-size-md)}:host([size=xl]) svg{height:var(--sgds-icon-size-xl);width:var(--sgds-icon-size-xl)}:host([size="2-xl"]) svg{height:var(--sgds-icon-size-2-xl);width:var(--sgds-icon-size-2-xl)}:host([size="3-xl"]) svg{height:var(--sgds-icon-size-3-xl);width:var(--sgds-icon-size-3-xl)}svg{display:inline-block;height:var(--sgds-icon-size-lg);width:var(--sgds-icon-size-lg)}`;class Gt extends gt{constructor(){super(...arguments),this.size="lg"}_getIconByName(e){if(!e)return;const t=Ft[e];if(t)return t;console.warn(`Icon not found: ${e}`)}render(){const e=this._getIconByName(this.name);return e||te}}Gt.styles=[...gt.styles,Jt],e([Ge({type:String,reflect:!0})],Gt.prototype,"name",void 0),e([Ge({type:String,reflect:!0})],Gt.prototype,"size",void 0);class Kt extends(Dt(Ot)){constructor(){super(...arguments),this.multiple=!1,this.accept="",this.hasFeedback=!1,this.required=!1,this.selectedFiles=[],this.inputRef=new dt}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}get files(){return this.selectedFiles}_setFileList(e){this.emit("sgds-files-selected",{detail:e})}_handleClick(e){if(e.preventDefault(),!this.disabled){this.inputRef.value.click()}}_handleChange(e){const t=e.target.files;t.length>0&&(this.selectedFiles=Array.from(t)),this._setFileList(t),this.requestUpdate(),super._mixinHandleChange(e)}_removeFileHandler(e){const t=this.inputRef.value,i=t.files,l=new DataTransfer;for(let t=0;t<i.length;t++)e!==t&&l.items.add(i[t]);t.files=l.files,this._setFileList(l.files),this.selectedFiles=Array.from(l.files),this.requestUpdate(),this._mixinValidate(this.input)}_clearAllFiles(){const e=this.inputRef.value,t=new DataTransfer;e.files=t.files,this._setFileList(t.files),this.selectedFiles=Array.from(t.files)}_mixinResetFormControl(){this._clearAllFiles(),this._mixinResetValidity(this.input)}_handleDisabledChange(){this.setInvalid(!1)}_renderLabel(){const e=Y`
2018
2018
  <label for=${this._controlId} id=${this._labelId} class="form-label"> ${this.label} </label>
2019
2019
  `;return this.label&&e}_renderHintText(){const e=Y` <div id="${this._controlId}Help" class="form-text">${this.hintText}</div> `;return this.hintText&&e}_renderFeedback(){return Y`
2020
2020
  <div class="invalid-feedback-container">
@@ -2056,5 +2056,5 @@ class extends it{constructor(e){if(super(e),e.type!==Qe||"class"!==e.name||e.str
2056
2056
  ${t}
2057
2057
  </ul>
2058
2058
  </div>
2059
- `}}Kt.styles=[...Ot.styles,Et],Kt.dependencies={"sgds-button":At,"sgds-close-button":mt,"sgds-icon":Gt},e([Ge({type:Boolean,reflect:!0})],Kt.prototype,"multiple",void 0),e([Ge({type:String,reflect:!0})],Kt.prototype,"accept",void 0),e([Ge({type:Boolean,reflect:!0})],Kt.prototype,"hasFeedback",void 0),e([Ge({type:String,reflect:!0})],Kt.prototype,"invalidFeedback",void 0),e([Ge({type:Boolean,reflect:!0})],Kt.prototype,"required",void 0),e([Ge({...Wt,state:!0,attribute:!1})],Kt.prototype,"selectedFiles",void 0),e([function(e,t){const i=Object.assign({waitUntilFirstUpdate:!1},t);return(t,l)=>{const{update:a}=t;if(e in t){const r=e;t.update=function(e){if(e.has(r)){const t=e.get(r),a=this[r];t!==a&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[l](t,a))}a.call(this,e)}}}}("disabled",{waitUntilFirstUpdate:!0})],Kt.prototype,"_handleDisabledChange",null),qt="sgds-file-upload",jt=Kt,customElements.get(qt)||customElements.define(qt,jt)}));
2059
+ `}}Kt.styles=[...Ot.styles,Et],Kt.dependencies={"sgds-button":At,"sgds-close-button":wt,"sgds-icon":Gt},e([Ge({type:Boolean,reflect:!0})],Kt.prototype,"multiple",void 0),e([Ge({type:String,reflect:!0})],Kt.prototype,"accept",void 0),e([Ge({type:Boolean,reflect:!0})],Kt.prototype,"hasFeedback",void 0),e([Ge({type:String,reflect:!0})],Kt.prototype,"invalidFeedback",void 0),e([Ge({type:Boolean,reflect:!0})],Kt.prototype,"required",void 0),e([Ge({...Wt,state:!0,attribute:!1})],Kt.prototype,"selectedFiles",void 0),e([function(e,t){const i=Object.assign({waitUntilFirstUpdate:!1},t);return(t,l)=>{const{update:a}=t;if(e in t){const r=e;t.update=function(e){if(e.has(r)){const t=e.get(r),a=this[r];t!==a&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[l](t,a))}a.call(this,e)}}}}("disabled",{waitUntilFirstUpdate:!0})],Kt.prototype,"_handleDisabledChange",null),qt="sgds-file-upload",jt=Kt,customElements.get(qt)||customElements.define(qt,jt)}));
2060
2060
  //# sourceMappingURL=index.umd.min.js.map