@solid-design-system/components 5.17.0 → 5.17.1

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 (269) hide show
  1. package/cdn/components/datepicker/datepicker.d.ts +3 -0
  2. package/cdn/components/datepicker/datepicker.js +1 -1
  3. package/cdn/custom-elements.json +1 -1
  4. package/cdn/solid-components.bundle.js +2 -2
  5. package/cdn/solid-components.iife.js +1 -1
  6. package/cdn/solid-components.js +1 -1
  7. package/cdn/web-types.json +1 -1
  8. package/cdn-versioned/chunks/chunk.23JJBCLW.js +1 -1
  9. package/cdn-versioned/chunks/chunk.2D3B6W4C.js +1 -1
  10. package/cdn-versioned/chunks/chunk.2RPN4LHN.js +4 -4
  11. package/cdn-versioned/chunks/chunk.2YMJV2KL.js +1 -1
  12. package/cdn-versioned/chunks/{chunk.NZFGKV2I.js → chunk.37O5FAM6.js} +1 -1
  13. package/cdn-versioned/chunks/chunk.3PTWVC7K.js +1 -1
  14. package/cdn-versioned/chunks/chunk.4HEDUSC5.js +1 -1
  15. package/cdn-versioned/chunks/chunk.4THKQ4PC.js +1 -1
  16. package/cdn-versioned/chunks/chunk.4USO2EJG.js +2 -2
  17. package/cdn-versioned/chunks/chunk.5GPPZUNF.js +1 -1
  18. package/cdn-versioned/chunks/chunk.6QNQMWSQ.js +2 -2
  19. package/cdn-versioned/chunks/chunk.6XOV6LQS.js +1 -1
  20. package/cdn-versioned/chunks/chunk.72JQHJ3G.js +1 -1
  21. package/cdn-versioned/chunks/chunk.75UMJKQC.js +1 -1
  22. package/cdn-versioned/chunks/chunk.7FMD6ZWC.js +1 -1
  23. package/cdn-versioned/chunks/chunk.7NHEEBDB.js +1 -1
  24. package/cdn-versioned/chunks/chunk.7SJXKLVN.js +1 -1
  25. package/cdn-versioned/chunks/chunk.ADTHFKFC.js +1 -1
  26. package/cdn-versioned/chunks/chunk.AKJ7U3Y3.js +1 -1
  27. package/cdn-versioned/chunks/chunk.BV42CEWL.js +1 -1
  28. package/cdn-versioned/chunks/chunk.CARQ25VA.js +1 -1
  29. package/cdn-versioned/chunks/chunk.CEVVDV52.js +1 -1
  30. package/cdn-versioned/chunks/chunk.CTOV3B4T.js +1 -1
  31. package/cdn-versioned/chunks/chunk.EIGW4PKE.js +1 -1
  32. package/cdn-versioned/chunks/chunk.EIRHQEOO.js +1 -1
  33. package/cdn-versioned/chunks/chunk.FYOUHXBZ.js +1 -1
  34. package/cdn-versioned/chunks/chunk.H3W4J4F4.js +1 -1
  35. package/cdn-versioned/chunks/chunk.H7I6O5HE.js +1 -1
  36. package/cdn-versioned/chunks/chunk.HJ4O4XQA.js +1 -1
  37. package/cdn-versioned/chunks/chunk.HXUQZXCZ.js +1 -1
  38. package/cdn-versioned/chunks/chunk.KVJJEMOI.js +1 -1
  39. package/cdn-versioned/chunks/chunk.LLJ2OCGM.js +4 -4
  40. package/cdn-versioned/chunks/chunk.M6XINJ52.js +1 -1
  41. package/cdn-versioned/chunks/chunk.MGCXOSRH.js +1 -1
  42. package/cdn-versioned/chunks/chunk.MMM4IMJD.js +1 -1
  43. package/cdn-versioned/chunks/chunk.N4RSYGAV.js +1 -1
  44. package/cdn-versioned/chunks/chunk.NRBNWX7R.js +1 -1
  45. package/cdn-versioned/chunks/chunk.NTP4LLF3.js +1 -1
  46. package/cdn-versioned/chunks/chunk.OCIA2UJP.js +1 -1
  47. package/cdn-versioned/chunks/chunk.OIOXSZHI.js +1 -1
  48. package/cdn-versioned/chunks/chunk.OPMX2Q3A.js +1 -1
  49. package/cdn-versioned/chunks/chunk.OQSPWMNR.js +1 -1
  50. package/cdn-versioned/chunks/chunk.PCAKJGIV.js +1 -1
  51. package/cdn-versioned/chunks/chunk.PIAYQI7K.js +1 -1
  52. package/cdn-versioned/chunks/chunk.QJAN6R4E.js +1 -1
  53. package/cdn-versioned/chunks/chunk.QJFZKBPG.js +1 -1
  54. package/cdn-versioned/chunks/chunk.QJVPLDR4.js +1 -1
  55. package/cdn-versioned/chunks/chunk.RCMXIAQV.js +1 -1
  56. package/cdn-versioned/chunks/chunk.RIOXBQBC.js +1 -1
  57. package/cdn-versioned/chunks/chunk.ROIKKEJQ.js +1 -1
  58. package/cdn-versioned/chunks/chunk.SQ7OLI7Q.js +1 -1
  59. package/cdn-versioned/chunks/chunk.TDRPE2QQ.js +1 -1
  60. package/cdn-versioned/chunks/chunk.TFKNNQ5S.js +1 -1
  61. package/cdn-versioned/chunks/chunk.TTG6Y6QJ.js +1 -1
  62. package/cdn-versioned/chunks/chunk.W2JKI6K3.js +1 -1
  63. package/cdn-versioned/chunks/chunk.W7A3TU2Z.js +1 -1
  64. package/cdn-versioned/chunks/chunk.XAIFQKHV.js +1 -1
  65. package/cdn-versioned/chunks/chunk.YMTUR575.js +1 -1
  66. package/cdn-versioned/chunks/chunk.YVU7BES7.js +1 -1
  67. package/cdn-versioned/chunks/chunk.Z4V7WPTW.js +1 -1
  68. package/cdn-versioned/chunks/chunk.ZENM3WVO.js +1 -1
  69. package/cdn-versioned/chunks/chunk.ZKBX734R.js +1 -1
  70. package/cdn-versioned/chunks/chunk.ZZAPDP7V.js +1 -1
  71. package/cdn-versioned/components/accordion/accordion.d.ts +1 -1
  72. package/cdn-versioned/components/accordion-group/accordion-group.d.ts +1 -1
  73. package/cdn-versioned/components/animation/animation.d.ts +1 -1
  74. package/cdn-versioned/components/audio/audio.d.ts +1 -1
  75. package/cdn-versioned/components/badge/badge.d.ts +1 -1
  76. package/cdn-versioned/components/brandshape/brandshape.d.ts +1 -1
  77. package/cdn-versioned/components/breadcrumb/breadcrumb.d.ts +1 -1
  78. package/cdn-versioned/components/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  79. package/cdn-versioned/components/button/button.d.ts +1 -1
  80. package/cdn-versioned/components/button-group/button-group.d.ts +1 -1
  81. package/cdn-versioned/components/carousel/carousel.d.ts +1 -1
  82. package/cdn-versioned/components/carousel-item/carousel-item.d.ts +1 -1
  83. package/cdn-versioned/components/checkbox/checkbox.d.ts +1 -1
  84. package/cdn-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
  85. package/cdn-versioned/components/combobox/combobox.d.ts +1 -1
  86. package/cdn-versioned/components/datepicker/datepicker.d.ts +4 -1
  87. package/cdn-versioned/components/datepicker/datepicker.js +1 -1
  88. package/cdn-versioned/components/dialog/dialog.d.ts +1 -1
  89. package/cdn-versioned/components/divider/divider.d.ts +1 -1
  90. package/cdn-versioned/components/drawer/drawer.d.ts +1 -1
  91. package/cdn-versioned/components/dropdown/dropdown.d.ts +1 -1
  92. package/cdn-versioned/components/expandable/expandable.d.ts +1 -1
  93. package/cdn-versioned/components/flipcard/flipcard.d.ts +1 -1
  94. package/cdn-versioned/components/header/header.d.ts +1 -1
  95. package/cdn-versioned/components/icon/icon.d.ts +1 -1
  96. package/cdn-versioned/components/include/include.d.ts +1 -1
  97. package/cdn-versioned/components/input/input.d.ts +1 -1
  98. package/cdn-versioned/components/link/link.d.ts +1 -1
  99. package/cdn-versioned/components/loader/loader.d.ts +1 -1
  100. package/cdn-versioned/components/map-marker/map-marker.d.ts +1 -1
  101. package/cdn-versioned/components/menu/menu.d.ts +1 -1
  102. package/cdn-versioned/components/menu-item/menu-item.d.ts +1 -1
  103. package/cdn-versioned/components/navigation-item/navigation-item.d.ts +1 -1
  104. package/cdn-versioned/components/notification/notification.d.ts +1 -1
  105. package/cdn-versioned/components/optgroup/optgroup.d.ts +1 -1
  106. package/cdn-versioned/components/option/option.d.ts +1 -1
  107. package/cdn-versioned/components/popup/popup.d.ts +1 -1
  108. package/cdn-versioned/components/quickfact/quickfact.d.ts +1 -1
  109. package/cdn-versioned/components/radio/radio.d.ts +1 -1
  110. package/cdn-versioned/components/radio-button/radio-button.d.ts +1 -1
  111. package/cdn-versioned/components/radio-group/radio-group.d.ts +1 -1
  112. package/cdn-versioned/components/range/range.d.ts +1 -1
  113. package/cdn-versioned/components/range-tick/range-tick.d.ts +1 -1
  114. package/cdn-versioned/components/scrollable/scrollable.d.ts +1 -1
  115. package/cdn-versioned/components/select/select.d.ts +1 -1
  116. package/cdn-versioned/components/skeleton/skeleton.d.ts +1 -1
  117. package/cdn-versioned/components/spinner/spinner.d.ts +1 -1
  118. package/cdn-versioned/components/step/step.d.ts +1 -1
  119. package/cdn-versioned/components/step-group/step-group.d.ts +1 -1
  120. package/cdn-versioned/components/switch/switch.d.ts +1 -1
  121. package/cdn-versioned/components/tab/tab.d.ts +1 -1
  122. package/cdn-versioned/components/tab-group/tab-group.d.ts +1 -1
  123. package/cdn-versioned/components/tab-panel/tab-panel.d.ts +1 -1
  124. package/cdn-versioned/components/tag/tag.d.ts +1 -1
  125. package/cdn-versioned/components/textarea/textarea.d.ts +1 -1
  126. package/cdn-versioned/components/tooltip/tooltip.d.ts +1 -1
  127. package/cdn-versioned/components/video/video.d.ts +1 -1
  128. package/cdn-versioned/custom-elements.json +248 -248
  129. package/cdn-versioned/internal/form.js +3 -3
  130. package/cdn-versioned/solid-components.bundle.js +14 -14
  131. package/cdn-versioned/solid-components.css +2 -2
  132. package/cdn-versioned/solid-components.iife.js +14 -14
  133. package/cdn-versioned/solid-components.js +1 -1
  134. package/cdn-versioned/vscode.html-custom-data.json +94 -94
  135. package/cdn-versioned/web-types.json +163 -163
  136. package/dist/components/datepicker/datepicker.d.ts +3 -0
  137. package/dist/components/datepicker/datepicker.js +10 -1
  138. package/dist/custom-elements.json +1 -1
  139. package/dist/solid-components.js +7 -7
  140. package/dist/web-types.json +1 -1
  141. package/dist-versioned/chunks/chunk.22DM7THN.js +2 -2
  142. package/dist-versioned/chunks/chunk.246LUIGB.js +1 -1
  143. package/dist-versioned/chunks/chunk.2EN4CJ2E.js +1 -1
  144. package/dist-versioned/chunks/chunk.3CUXBZXY.js +1 -1
  145. package/dist-versioned/chunks/chunk.4D5SPJ27.js +1 -1
  146. package/dist-versioned/chunks/chunk.4VSYGWIQ.js +2 -2
  147. package/dist-versioned/chunks/chunk.5L52M55A.js +3 -3
  148. package/dist-versioned/chunks/chunk.63D5DO3S.js +2 -2
  149. package/dist-versioned/chunks/chunk.6DKXZWRN.js +4 -4
  150. package/dist-versioned/chunks/chunk.6KCL3YWT.js +3 -3
  151. package/dist-versioned/chunks/chunk.6OGLZOU3.js +1 -1
  152. package/dist-versioned/chunks/chunk.A5GKQZGQ.js +2 -2
  153. package/dist-versioned/chunks/chunk.AAK5STGD.js +2 -2
  154. package/dist-versioned/chunks/chunk.ATKLZZWE.js +2 -2
  155. package/dist-versioned/chunks/chunk.AUMWRORX.js +6 -6
  156. package/dist-versioned/chunks/chunk.AWVURKQ3.js +8 -8
  157. package/dist-versioned/chunks/chunk.AZ5YCFXX.js +2 -2
  158. package/dist-versioned/chunks/chunk.DOGMVREV.js +3 -3
  159. package/dist-versioned/chunks/chunk.E4O3LVAZ.js +1 -1
  160. package/dist-versioned/chunks/chunk.FPIRMH7R.js +4 -4
  161. package/dist-versioned/chunks/chunk.FWDG6KMC.js +1 -1
  162. package/dist-versioned/chunks/chunk.HTEXYS4A.js +26 -26
  163. package/dist-versioned/chunks/chunk.IKDVBWFR.js +2 -2
  164. package/dist-versioned/chunks/chunk.J2MPIUT5.js +1 -1
  165. package/dist-versioned/chunks/chunk.JUZY76ML.js +1 -1
  166. package/dist-versioned/chunks/chunk.KEJFWGZI.js +4 -4
  167. package/dist-versioned/chunks/chunk.KHS7FSFX.js +5 -5
  168. package/dist-versioned/chunks/chunk.KMU4KABG.js +2 -2
  169. package/dist-versioned/chunks/chunk.MCUIYSD6.js +2 -2
  170. package/dist-versioned/chunks/chunk.NBHVDDUK.js +4 -4
  171. package/dist-versioned/chunks/chunk.NYOWE72U.js +1 -1
  172. package/dist-versioned/chunks/chunk.OH3W4PGL.js +24 -24
  173. package/dist-versioned/chunks/chunk.OWYDTY46.js +2 -2
  174. package/dist-versioned/chunks/chunk.P2JBJQH6.js +1 -1
  175. package/dist-versioned/chunks/chunk.PKG3F2KC.js +1 -1
  176. package/dist-versioned/chunks/chunk.Q4HWX7FF.js +5 -5
  177. package/dist-versioned/chunks/chunk.QP27BG3Y.js +1 -1
  178. package/dist-versioned/chunks/chunk.QPBHKXL6.js +3 -3
  179. package/dist-versioned/chunks/chunk.QPBJEOPN.js +12 -12
  180. package/dist-versioned/chunks/chunk.QTQEKSJS.js +1 -1
  181. package/dist-versioned/chunks/chunk.QVNC3EJB.js +1 -1
  182. package/dist-versioned/chunks/chunk.RZLBIMEH.js +1 -1
  183. package/dist-versioned/chunks/chunk.S253T7LE.js +11 -11
  184. package/dist-versioned/chunks/chunk.SJZCQ5SU.js +12 -12
  185. package/dist-versioned/chunks/chunk.TD5EDBVC.js +2 -2
  186. package/dist-versioned/chunks/{chunk.3FCBHDPH.js → chunk.TJKIQ2ZR.js} +5 -5
  187. package/dist-versioned/chunks/chunk.TMJN75ST.js +6 -6
  188. package/dist-versioned/chunks/chunk.U5L4ZATG.js +5 -5
  189. package/dist-versioned/chunks/chunk.UIQBHPD3.js +2 -2
  190. package/dist-versioned/chunks/chunk.URTB3C7J.js +3 -3
  191. package/dist-versioned/chunks/chunk.VDSIXERI.js +2 -2
  192. package/dist-versioned/chunks/chunk.VUTMPKYK.js +3 -3
  193. package/dist-versioned/chunks/chunk.W6RMEFFR.js +2 -2
  194. package/dist-versioned/chunks/chunk.WRP3NGPP.js +4 -4
  195. package/dist-versioned/chunks/chunk.WTG2WY6X.js +5 -5
  196. package/dist-versioned/chunks/chunk.WUB4VSXU.js +2 -2
  197. package/dist-versioned/chunks/chunk.XCQC3F3H.js +3 -3
  198. package/dist-versioned/chunks/chunk.XRKSJCLQ.js +6 -6
  199. package/dist-versioned/chunks/chunk.YBAAPYHP.js +14 -14
  200. package/dist-versioned/chunks/chunk.YGHO5R3O.js +3 -3
  201. package/dist-versioned/chunks/chunk.ZAQS4XFO.js +2 -2
  202. package/dist-versioned/chunks/chunk.ZBDFCFOP.js +3 -3
  203. package/dist-versioned/chunks/chunk.ZUL25WD4.js +1 -1
  204. package/dist-versioned/components/accordion/accordion.d.ts +1 -1
  205. package/dist-versioned/components/accordion-group/accordion-group.d.ts +1 -1
  206. package/dist-versioned/components/animation/animation.d.ts +1 -1
  207. package/dist-versioned/components/audio/audio.d.ts +1 -1
  208. package/dist-versioned/components/badge/badge.d.ts +1 -1
  209. package/dist-versioned/components/brandshape/brandshape.d.ts +1 -1
  210. package/dist-versioned/components/breadcrumb/breadcrumb.d.ts +1 -1
  211. package/dist-versioned/components/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  212. package/dist-versioned/components/button/button.d.ts +1 -1
  213. package/dist-versioned/components/button-group/button-group.d.ts +1 -1
  214. package/dist-versioned/components/carousel/carousel.d.ts +1 -1
  215. package/dist-versioned/components/carousel-item/carousel-item.d.ts +1 -1
  216. package/dist-versioned/components/checkbox/checkbox.d.ts +1 -1
  217. package/dist-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
  218. package/dist-versioned/components/combobox/combobox.d.ts +1 -1
  219. package/dist-versioned/components/datepicker/datepicker.d.ts +4 -1
  220. package/dist-versioned/components/datepicker/datepicker.js +10 -1
  221. package/dist-versioned/components/dialog/dialog.d.ts +1 -1
  222. package/dist-versioned/components/divider/divider.d.ts +1 -1
  223. package/dist-versioned/components/drawer/drawer.d.ts +1 -1
  224. package/dist-versioned/components/dropdown/dropdown.d.ts +1 -1
  225. package/dist-versioned/components/expandable/expandable.d.ts +1 -1
  226. package/dist-versioned/components/flipcard/flipcard.d.ts +1 -1
  227. package/dist-versioned/components/header/header.d.ts +1 -1
  228. package/dist-versioned/components/icon/icon.d.ts +1 -1
  229. package/dist-versioned/components/include/include.d.ts +1 -1
  230. package/dist-versioned/components/input/input.d.ts +1 -1
  231. package/dist-versioned/components/link/link.d.ts +1 -1
  232. package/dist-versioned/components/loader/loader.d.ts +1 -1
  233. package/dist-versioned/components/map-marker/map-marker.d.ts +1 -1
  234. package/dist-versioned/components/menu/menu.d.ts +1 -1
  235. package/dist-versioned/components/menu-item/menu-item.d.ts +1 -1
  236. package/dist-versioned/components/navigation-item/navigation-item.d.ts +1 -1
  237. package/dist-versioned/components/notification/notification.d.ts +1 -1
  238. package/dist-versioned/components/optgroup/optgroup.d.ts +1 -1
  239. package/dist-versioned/components/option/option.d.ts +1 -1
  240. package/dist-versioned/components/popup/popup.d.ts +1 -1
  241. package/dist-versioned/components/quickfact/quickfact.d.ts +1 -1
  242. package/dist-versioned/components/radio/radio.d.ts +1 -1
  243. package/dist-versioned/components/radio-button/radio-button.d.ts +1 -1
  244. package/dist-versioned/components/radio-group/radio-group.d.ts +1 -1
  245. package/dist-versioned/components/range/range.d.ts +1 -1
  246. package/dist-versioned/components/range-tick/range-tick.d.ts +1 -1
  247. package/dist-versioned/components/scrollable/scrollable.d.ts +1 -1
  248. package/dist-versioned/components/select/select.d.ts +1 -1
  249. package/dist-versioned/components/skeleton/skeleton.d.ts +1 -1
  250. package/dist-versioned/components/spinner/spinner.d.ts +1 -1
  251. package/dist-versioned/components/step/step.d.ts +1 -1
  252. package/dist-versioned/components/step-group/step-group.d.ts +1 -1
  253. package/dist-versioned/components/switch/switch.d.ts +1 -1
  254. package/dist-versioned/components/tab/tab.d.ts +1 -1
  255. package/dist-versioned/components/tab-group/tab-group.d.ts +1 -1
  256. package/dist-versioned/components/tab-panel/tab-panel.d.ts +1 -1
  257. package/dist-versioned/components/tag/tag.d.ts +1 -1
  258. package/dist-versioned/components/textarea/textarea.d.ts +1 -1
  259. package/dist-versioned/components/tooltip/tooltip.d.ts +1 -1
  260. package/dist-versioned/components/video/video.d.ts +1 -1
  261. package/dist-versioned/custom-elements.json +248 -248
  262. package/dist-versioned/internal/form.js +3 -3
  263. package/dist-versioned/solid-components.css +2 -2
  264. package/dist-versioned/solid-components.js +7 -7
  265. package/dist-versioned/vscode.html-custom-data.json +94 -94
  266. package/dist-versioned/web-types.json +163 -163
  267. package/package.json +1 -1
  268. /package/cdn/chunks/{chunk.NZFGKV2I.js → chunk.37O5FAM6.js} +0 -0
  269. /package/dist/chunks/{chunk.3FCBHDPH.js → chunk.TJKIQ2ZR.js} +0 -0
@@ -134,7 +134,7 @@
134
134
  removable-indicator:tag__removable-indicator,
135
135
  " size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-tag>`]}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().addEventListener("focusin",this.handleDocumentFocusIn)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().removeEventListener("focusin",this.handleDocumentFocusIn)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){(t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleTagMaxOptionsKeyDown(t){(t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleLabelClick(){this.visuallyDisabled||this.displayInput.focus()}handleTagRemove(t,e){t.stopPropagation(),e||this.clearCombobox(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.setOrderedSelectedOptions(e),this.deletedTagLabel="",this.deletedTagLabel=this.localize.term("removed",e.textContent),this.updateComplete.then(()=>{this.selectionChanged(),this.emit("sd-input"),this.emit("sd-change")}))}handleComboboxMouseDown(t){if(this.visuallyDisabled){t.preventDefault(),t.stopPropagation();return}let r=t.composedPath().some(n=>n instanceof HTMLSlotElement&&n.name==="removable-indicator");if(this.disabled||r)return;(this.open?this.hide():this.show()).then(()=>{setTimeout(()=>this.displayInput.focus({preventScroll:!0}))})}handleComboboxKeyDown(t){t.key!=="Tab"&&this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearCombobox()}handleNoResultsClick(t){t.preventDefault(),this.hide()}clearCombobox(){this.value!==""&&(this.value="",this.displayInputValue="",this.selectedTextLabel="",this.lastOption=void 0,this.selectedOptions=[],this.getSlottedOptions().forEach(t=>{t.selected=!1}),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")}))}preventLoosingFocus(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let r=t.target.closest("sd-option"),o=this.value;r&&!r.disabled&&(this.multiple?(this.toggleOptionSelection(r),this.lastOption=r,this.setOrderedSelectedOptions(r),this.updateComplete.then(()=>{this.selectionChanged()})):(this.setOrderedSelectedOptions(r),this.setSelectedOptions(r)),this.updateComplete.then(()=>{this.displayInput.focus({preventScroll:!0}),this.value!==o&&(this.emit("sd-input"),this.emit("sd-change"))}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}selectNextOption(t){let e=this.getAllFilteredOptions();if(e.length===0)return;let r=this.getCurrentOption(),o=e.indexOf(r),n=Math.max(0,o);if(t){let d=o+1;n=d>e.length-1?0:d}else{let d=o-1;n=d<0?e.length-1:d}this.setCurrentOption(e[n],new KeyboardEvent("keydown")),ee(this.getCurrentOption(),this.listbox,"vertical","auto")}getAllFilteredOptions(){return[...this.filteredWrapper.querySelectorAll("sd-option")]}getCurrentOption(){return this.getAllFilteredOptions().find(t=>t.current)}setCurrentOption(t,e){let r=this.getAllFilteredOptions();this.displayInput.removeAttribute("aria-activedescendant"),r.forEach(o=>{o.current=!1,o.setAttribute("aria-selected","false"),o.isKeyboardFocus=!1}),t&&(t.current=!0,t.setAttribute("aria-selected","true"),this.displayInput.setAttribute("aria-activedescendant",t.id)),t&&(e==null?void 0:e.type)==="keydown"&&(t.isKeyboardFocus=!0)}toggleOptionSelection(t,e){let o=this.getSlottedOptions().find(n=>n.value&&t.value?n.value===t.value:n.getTextLabel()===t.getTextLabel());o&&(o.selected=e!=null?e:!o.selected)}findOptionByValue(t,e){if(e)return Array.isArray(e)?t.find(r=>e.includes(r.value)):t.find(r=>r.value===e)}selectedOptionsAndValueSynced(){var t;return!this.value&&this.selectedOptions.length===0?!0:Array.isArray(this.value)?this.value.length===this.selectedOptions.length:this.value===((t=this.selectedOptions[0])==null?void 0:t.value)}isOptionSelected(t){return t.value?this.value.includes(t.value):this.value.includes(t.getTextLabel())}syncSelectedOptionsAndValue(){return this.selectedOptionsAndValueSynced()?void 0:(this.getSlottedOptions().forEach(e=>{e.selected=!1}),this.selectedOptions=this.getSlottedOptions().filter(e=>this.isOptionSelected(e)),this.selectedOptions.forEach(e=>{e&&(e.selected=!0)}),Promise.resolve())}compareOptions(t,e){return t.value&&e.value?t.value===e.value:t.getTextLabel()===e.getTextLabel()}setSelectedOptions(t){this.getSlottedOptions().forEach(r=>{r.selected=this.compareOptions(r,t)}),this.selectionChanged()}setOrderedSelectedOptions(t){let e=this.getSlottedOptions().find(r=>this.compareOptions(r,t));this.multiple?this.selectedOptions.length>0&&e&&this.selectedOptions.find(r=>this.compareOptions(r,e))?this.selectedOptions=this.selectedOptions.filter(r=>!this.compareOptions(r,e)):this.selectedOptions=[...this.selectedOptions,e]:this.selectedOptions=[e]}selectionChanged(){var e,r,o;let t=this.selectedOptions.some(n=>n?this.isOptionSelected(n):!1);this.multiple?(!t&&this.selectedOptions.length>0?this.value=[...this.value,...this.selectedOptions.map(n=>n.value||n.getTextLabel())]:this.value=this.selectedOptions.map(n=>(n==null?void 0:n.value)||(n==null?void 0:n.getTextLabel())||""),this.displayInputValue=""):(this.value=((e=this.selectedOptions[0])==null?void 0:e.value)||((r=this.selectedOptions[0])==null?void 0:r.getTextLabel())||"",this.selectedTextLabel=((o=this.selectedOptions[0])==null?void 0:o.getTextLabel())||"",this.displayInputValue=""),this.updateComplete.then(()=>{this.formControlController.updateValidity()})}createComboboxOptionsFromQuery(t){let e=[];this.filteredOptions=this.getSlottedOptions().filter(r=>this.filter(r,t)||t==="").map(r=>{var f,y,b;let o=r.cloneNode(!0);if(o.current=o.value===((f=this.lastOption)==null?void 0:f.value),o.selected=r.selected,o.checkbox=r.checkbox,o.size=r.size,!(((y=r.parentElement)==null?void 0:y.tagName.toLowerCase())==="sd-optgroup"))return o;let d=r.parentElement,c=(b=d.querySelector('[slot="label"]'))==null?void 0:b.cloneNode(!0),p=e.find(E=>E.id===d.id);if(p){p==null||p.appendChild(o),c&&(p==null||p.appendChild(c));return}let m=d.cloneNode();return m.appendChild(o),c&&m.appendChild(c),e.push(m),m}).filter(Boolean)}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleCurrentPlacement(t){let e=t.detail;e&&(this.currentPlacement=e)}handleFilterChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}handleUseTagsChange(){let t=this.getAllFilteredOptions();customElements.get("sd-option")&&t.forEach(e=>{e.checkbox=this.multiple})}applySizeToOptions(){this.getSlottedOptions().forEach(t=>{t.size=this.size})}handleDisabledChange(){this.formControlController.setValidity(this.disabled),(this.disabled||this.visuallyDisabled)&&(this.open=!1,this.handleOpenChange())}handleValueChange(){this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInput.value):this.createComboboxOptionsFromQuery("")}handleDisplayInputValueChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}async handleOpenChange(){if(this.open&&(!this.disabled||!this.visuallyDisabled)){this.emit("sd-show"),this.addOpenListeners(),await W(this),this.listbox.hidden=!1,this.popup.active=!0;let{keyframes:r,options:o}=q(this,"combobox.show",{dir:this.localize.dir()});await K(this.popup.popup,r,o),this.emit("sd-after-show"),this.filteredOptions.length===0&&this.emit("sd-error");return}this.setCurrentOption(null),this.displayInput.removeAttribute("aria-activedescendant"),this.emit("sd-hide"),this.removeOpenListeners(),await W(this);let{keyframes:t,options:e}=q(this,"combobox.hide",{dir:this.localize.dir()});await K(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}async show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}return this.open=!0,Promise.race([J(this,"sd-after-show"),J(this,"sd-error")])}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.displayInputValue="",this.open=!1,J(this,"sd-after-hide")}checkValidity(){return this.valueInput.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}async handleInput(){let t=this.displayInput.value;this.displayInputValue=t,await this.updateComplete,this.open=this.filteredWrapper.children.length>0,this.formControlController.updateValidity(),this.emit("sd-input")}handleChange(){(!this.selectedOptions||!this.multiple)&&(this.selectedTextLabel=this.displayInput.value,this.updateComplete.then(()=>{this.formControlController.updateValidity()}),this.emit("sd-change"))}getSlottedOptions(){return Fa(Jr(this.defaultSlot)).flat()}getSlottedOptGroups(){return Ba(Jr(this.defaultSlot))}async handleDefaultSlotChange(){if(!customElements.get("sd-option")){customElements.whenDefined("sd-option").then(()=>this.handleDefaultSlotChange());return}let t=this.getSlottedOptions(),e=this.getSlottedOptGroups();this.applySizeToOptions();let r=this.findOptionByValue(t,this.value);this.selectedTextLabel=(r==null?void 0:r.getTextLabel())||"",t.forEach((o,n)=>{this.multiple&&(o.checkbox=!0),o.id=o.id||`sd-combobox-option-${n}`}),e.forEach((o,n)=>{o.id=o.id||`sd-combobox-optgroup-${n}`}),await this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInputValue):this.createComboboxOptionsFromQuery("")}render(){let t={left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right")},e=this.hasSlotController.test("label"),r=this.hasSlotController.test("help-text"),o=this.label?!0:!!e,n=this.helpText?!0:!!r,d=this.clearable&&!this.disabled&&!this.visuallyDisabled,c=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",p=this.disabled||this.visuallyDisabled?"cursor-not-allowed":"cursor-pointer",m=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",f={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],y={sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size],b={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return u`<div part="form-control" class="${h("relative text-left",p,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}"><label id="label" part="form-control-label" class="${o&&"inline-block mb-2"}" aria-hidden="${!o}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label> <span aria-live="polite" class="sr-only">${this.deletedTagLabel}</span><div part="form-control-input" class="relative w-full bg-white text-black"><div part="border" class="${h("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[c],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${h("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
136
136
  popup:popup__content,
137
- "><div part="combobox" class="${h("relative w-full px-4 flex flex-row items-center rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200",this.open&&"shadow transition-shadow duration-medium ease-in-out",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}">${t.left?u`<slot part="left" name="left" class="${h("inline-flex",y,m,b)}"></slot>`:""} ${this.multiple&&this.useTags&&this.tags.length>0?u`<div part="tags" class="${h("flex items-center gap-1",y)}">${this.tags}</div>`:null} <input id="display-input" name="${this.name}" form="${this.form}" part="display-input" class="${h("appearance-none outline-none bg-transparent flex-auto min-w-0",p,this.selectedTextLabel&&!this.multiple?"placeholder-black":"placeholder-neutral-700")}" type="text" placeholder="${this.selectedTextLabel&&!this.multiple?this.selectedTextLabel:this.placeholder||this.localize.term("comboboxDefaultPlaceholder")}" .disabled="${this.disabled}" .value="${this.displayInputValue}" autocomplete="off" spellcheck="false" autocapitalize="off" aria-controls="listbox" aria-expanded="${this.open}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled||this.visuallyDisabled}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-autocomplete="list" aria-owns="listbox" @input="${this.handleInput}" @change="${this.handleChange}"><div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(E=>E==null?void 0:E.getTextLabel()).join(", ")}</div><input class="${h("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",p)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${d?u`<button part="clear-button" class="${h("flex justify-center",f,this.value.length>0?"visible":"invisible")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.preventLoosingFocus}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-icon class="${h("text-neutral-700",b)}" name="closing-round" library="_internal"></sd-icon></slot></button>`:""} ${this.showInvalidStyle?u`<sd-icon part="invalid-icon" class="${h(f,b,"text-error")}" library="_internal" name="risk"></sd-icon>`:""} ${this.styleOnValid&&this.showValidStyle?u`<sd-icon part="valid-icon" class="${h("flex-shrink-0 text-success",f,b)}" library="_internal" name="confirm-circle"></sd-icon>`:""}<slot name="right" part="right" class="${h("inline-flex ml-2 leading-[0]",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",b)}">${this.type!=="search"?u`<sd-icon class="${h("transition-transform duration-medium ease-in-out",this.open?"rotate-180":"rotate-0")}" name="chevron-down" part="chevron" library="_internal" color="currentColor" label="${this.localize.term("open")}"></sd-icon>`:""}</slot>${this.type==="search"?u`<button class="${h("flex items-center sd-interactive",f)}" type="button"><sd-icon class="${h(m,b)}" library="_internal" name="magnifying-glass" label="${this.localize.term("search")}"></sd-icon></button>`:u`<button class="sd-interactive combobox-button absolute top-2" @keydown="${this.handleComboboxMouseDown}" type="button"><span class="sr-only">${this.localize.term("open")}</span></button>`}</div><div id="listbox" role="${C(this.multiple?void 0:"listbox")}" aria-expanded="${this.open}" aria-multiselectable="${this.multiple}" aria-labelledby="label" part="listbox" class="${h("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow transition-shadow duration-medium ease-in-out",this.currentPlacement==="bottom"?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mousedown="${this.preventLoosingFocus}" @mouseup="${this.handleOptionClick}"><div part="filtered-listbox">${this.filteredOptions.length===0?u`<span id="noResults" class="px-4 flex items-center w-full transition-all text-left text-base relative text-black py-3" aria-hidden="true" @click="${this.handleNoResultsClick}">${this.localize.term("noResults")}</span>`:this.options}</div><slot id="defaultOptionsSlot" class="hidden" @slotchange="${this.handleDefaultSlotChange}"></slot></div></sd-popup></div><div part="form-control-help-text" id="help-text" class="text-sm text-neutral-700 mt-1" aria-hidden="${!n}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};z.styles=[...g.styles,x`:host{display:block;position:relative;width:100%}:host([required]) #label:after{content:" *"}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([visually-disabled]) input{caret-color:transparent}:host([size=sm]) .combobox-button{height:var(--sd-spacing-4,1rem);right:var(--sd-spacing-4,1rem);width:var(--sd-spacing-4,1rem)}:host([size=md]) .combobox-button{height:var(--sd-spacing-6,1.5rem);right:.85rem;width:var(--sd-spacing-6,1.5rem)}:host([size=lg]) .combobox-button{height:var(--sd-spacing-8,2rem);right:var(--sd-spacing-3,.75rem);width:var(--sd-spacing-8,2rem)}[part=listbox]{max-height:var(--auto-size-available-height,auto)}sd-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-tag::part(content){display:inline-block;max-width:var(--tag-max-width,15ch);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249)/var(--tw-bg-opacity,1))}[part=filtered-listbox] sd-optgroup:first-of-type{--display-divider:none}mark{background-color:transparent;color:inherit;font-weight:700}`],a([v("sd-popup")],z.prototype,"popup",2),a([v('[part="combobox"]')],z.prototype,"combobox",2),a([v('[part="display-input"]')],z.prototype,"displayInput",2),a([v(".value-input")],z.prototype,"valueInput",2),a([v('[part="listbox"]')],z.prototype,"listbox",2),a([v('[part="tags"]')],z.prototype,"tagWrapper",2),a([v('[part="filtered-listbox"]')],z.prototype,"filteredWrapper",2),a([v("slot:not([name])")],z.prototype,"defaultSlot",2),a([v("#invalid-message")],z.prototype,"invalidMessage",2),a([T()],z.prototype,"hasFocus",2),a([T()],z.prototype,"displayInputValue",2),a([T()],z.prototype,"selectedTextLabel",2),a([T()],z.prototype,"selectedOptions",2),a([T()],z.prototype,"filteredOptions",2),a([T()],z.prototype,"allOptions",2),a([T()],z.prototype,"lastOption",2),a([T()],z.prototype,"showValidStyle",2),a([T()],z.prototype,"showInvalidStyle",2),a([T()],z.prototype,"deletedTagLabel",2),a([l({reflect:!0})],z.prototype,"name",2),a([l({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],z.prototype,"value",2),a([Bt()],z.prototype,"defaultValue",2),a([l({type:String,reflect:!0})],z.prototype,"size",2),a([l({type:String,reflect:!0})],z.prototype,"placeholder",2),a([l({type:String,attribute:"max-options-tag-label",reflect:!0})],z.prototype,"maxOptionsTagLabel",2),a([l({type:Boolean,reflect:!0})],z.prototype,"disabled",2),a([l({type:Boolean,reflect:!0,attribute:"visually-disabled"})],z.prototype,"visuallyDisabled",2),a([l({type:Boolean,reflect:!0})],z.prototype,"clearable",2),a([l({type:Boolean,reflect:!0})],z.prototype,"open",2),a([l({type:Boolean,reflect:!0})],z.prototype,"hoist",2),a([l({type:String,reflect:!0})],z.prototype,"label",2),a([l({type:String,reflect:!0})],z.prototype,"placement",2),a([l({type:String,attribute:"help-text",reflect:!0})],z.prototype,"helpText",2),a([l({type:String,reflect:!0})],z.prototype,"form",2),a([l({type:Boolean,reflect:!0})],z.prototype,"required",2),a([l({type:String,reflect:!0})],z.prototype,"type",2),a([T()],z.prototype,"currentPlacement",2),a([l()],z.prototype,"getOption",2),a([l({type:Boolean,reflect:!0})],z.prototype,"multiple",2),a([l({type:Boolean,reflect:!0})],z.prototype,"useTags",2),a([l({type:Number,reflect:!0,attribute:"max-options-visible"})],z.prototype,"maxOptionsVisible",2),a([l({type:Boolean,reflect:!0,attribute:"style-on-valid"})],z.prototype,"styleOnValid",2),a([l()],z.prototype,"filter",2),a([l()],z.prototype,"getTag",2),a([k("filter",{waitUntilFirstUpdate:!0})],z.prototype,"handleFilterChange",1),a([k("useTags",{waitUntilFirstUpdate:!0})],z.prototype,"handleUseTagsChange",1),a([k("size",{waitUntilFirstUpdate:!0})],z.prototype,"applySizeToOptions",1),a([k(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],z.prototype,"handleDisabledChange",1),a([k("value",{waitUntilFirstUpdate:!0})],z.prototype,"handleValueChange",1),a([k("displayInputValue",{waitUntilFirstUpdate:!0})],z.prototype,"handleDisplayInputValueChange",1),a([k("open",{waitUntilFirstUpdate:!0})],z.prototype,"handleOpenChange",1),z=a([w("sd-combobox")],z);B("combobox.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});B("combobox.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});var $={startOfDayLocal:s=>new Date(s.getFullYear(),s.getMonth(),s.getDate()),isSameDay:(s,i)=>!s||!i?!1:s.getFullYear()===i.getFullYear()&&s.getMonth()===i.getMonth()&&s.getDate()===i.getDate(),clampDateToMonth:(s,i)=>{let t=new Date(i.getFullYear(),i.getMonth(),1),e=new Date(i.getFullYear(),i.getMonth()+1,0);return s<t?t:s>e?e:s},toLocalISODate:s=>{let i=s.getFullYear(),t=(s.getMonth()+1).toString().padStart(2,"0"),e=s.getDate().toString().padStart(2,"0");return`${i}.${t}.${e}`},parseLocalISO:s=>{if(!s)return null;let i=/^(\d{4})\.(\d{2})\.(\d{2})$/.exec(s);if(!i)return null;let t=Number(i[1]),e=Number(i[2])-1,r=Number(i[3]),o=new Date(t,e,r);return Number.isNaN(o.getTime())?null:o},compareDates:(s,i)=>{let t=$.startOfDayLocal(s).getTime(),e=$.startOfDayLocal(i).getTime();return t-e},isBetweenInclusive:(s,i,t)=>{let e=$.compareDates(i,t)<=0?i:t,r=$.compareDates(i,t)<=0?t:i;return $.compareDates(s,e)>=0&&$.compareDates(s,r)<=0}};var _=class extends g{constructor(){super();this.localize=new A(this);this.hasSlotController=new P(this,"label","help-text","tooltip");this.formControlController=new pt(this,{assumeInteractionOn:["sd-blur","sd-input"]});this.locale="en-US";this.value=null;this.range=!1;this.rangeStart=null;this.rangeEnd=null;this.allowSameDayRange=!1;this.min=void 0;this.max=void 0;this.firstDayOfWeek=null;this.disabledWeekends=!1;this.disabledDates=[];this.isDateDisabled=null;this.size="lg";this.alignment="left";this.label="";this.helpText="";this.disabled=!1;this.visuallyDisabled=!1;this.styleOnValid=!1;this.readonly=!1;this.placement="bottom";this.placeholder="";this.name="";this.form="";this.open=!1;this.today=$.startOfDayLocal(new Date);this.disabledDatesSet=new Set;this.previewEnd=null;this.statusNavText="";this.statusSelectText="";this.hasFocus=!1;this.showValidStyle=!1;this.showInvalidStyle=!1;this.currentPlacement=this.placement;this.inputValue="";this.tabbingIntoGrid=!1;this.statusBumpCounter=0;this.onFocusOut=t=>{let e=t.relatedTarget;e&&this.contains(e)||(this.open&&(this.hide(),this.emit("sd-datepicker-close")),this.hasFocus=!1)};this.onFocusIn=t=>{if(this.disabled||this.visuallyDisabled)return;t.composedPath().some(o=>{var n,d;return o instanceof HTMLElement&&(((n=o.classList)==null?void 0:n.contains("nav"))||((d=o.classList)==null?void 0:d.contains("month-label")))})&&(this.tabbingIntoGrid=!0)};this.handleInput=t=>{var d,c,p,m,f;if(this.disabled||this.visuallyDisabled){(d=t.preventDefault)==null||d.call(t),(c=t.stopPropagation)==null||c.call(t);return}let e=t.target,r=e.value,o=(p=e.selectionStart)!=null?p:r.length,n=(m=t.inputType)==null?void 0:m.startsWith("delete");if(this.range){let y=r.replace(/\D/g,""),b=y.slice(0,8),E=y.slice(8,16),L=this.buildDmyFromDigits(b),M=this.buildDmyFromDigits(E),S;b.length===0?S="":b.length<8?S=L:E.length>0?S=`${L} - ${M}`:S=n?L:`${L} -`;let O=this.countDigitsBeforeCaret(r,o),I;if(O<=8){let D=this.digitIndexToDmyCaretPos(Math.min(O,8));I=Math.min(D,L.length)}else{let D=b.length<8?L.length:L.length+3,Y=Math.min(O-8,8),X=this.digitIndexToDmyCaretPos(Y);I=D+Math.min(X,M.length)}this.inputValue=S;let F=!1;if(/^\d{2}\.\d{2}\.\d{4}$/.test(L)){let D=this.dmyToIso(L),Y=D?$.parseLocalISO(D):null;!!Y&&!this.isDisabled(Y)&&this.inMinMax(Y)&&this.rangeStart!==D&&(this.rangeStart=D,this.previewEnd=null,this.viewMonth=new Date(Y.getFullYear(),Y.getMonth(),1),this.focusedDate=$.startOfDayLocal(Y),F=!0)}else this.rangeStart&&(this.rangeStart=null,F=!0),this.rangeEnd&&(this.rangeEnd=null,F=!0);if(/^\d{2}\.\d{2}\.\d{4}$/.test(M)&&this.rangeStart){let D=$.parseLocalISO(this.rangeStart),Y=this.dmyToIso(M),X=Y?$.parseLocalISO(Y):null;if(!!X&&!this.isDisabled(X)&&this.inMinMax(X)){let[xt,st]=$.compareDates(D,X)<=0?[D,X]:[X,D],It=$.isSameDay(xt,st);if((this.allowSameDayRange||!It)&&!this.wouldRangeContainDisabled(xt,st)){let $t=$.toLocalISODate($.startOfDayLocal(xt)),ut=$.toLocalISODate($.startOfDayLocal(st));(this.rangeStart!==$t||this.rangeEnd!==ut)&&(this.rangeStart=$t,this.rangeEnd=ut,this.viewMonth=new Date(st.getFullYear(),st.getMonth(),1),this.focusedDate=$.startOfDayLocal(st),F=!0)}}}else this.rangeEnd&&(this.rangeEnd=null,F=!0);this.showInvalidStyle=!1,this.showValidStyle=!!(this.rangeStart&&this.rangeEnd),F&&(this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})),Promise.resolve().then(()=>{requestAnimationFrame(()=>{var Y;let D=(Y=this.input)!=null?Y:e;D&&(D.value=this.inputValue,D.setSelectionRange(I,I))})})}else{let y=e,b=y.value,E=(f=y.selectionStart)!=null?f:b.length,L=b.replace(/\D/g,"").slice(0,8),M=L.slice(0,2),S=L.slice(2,4),O=L.slice(4,8),I="";M.length>0&&(I+=M,M.length===2&&(I+=".")),S.length>0&&M.length===2&&(I+=S,S.length===2&&(I+=".")),O.length>0&&M.length===2&&S.length===2&&(I+=O),I=I.replace(/\.\.+/g,".");let F=this.inputValue||"";this.inputValue=I;let D=E,Y=tt=>{let $t=[];for(let ut=0;ut<tt.length;ut++)tt[ut]==="."&&$t.push(ut);return $t},X=Y(F),Et=Y(I),xt=X.filter(tt=>tt<E).length,It=Et.filter(tt=>tt<E).length-xt;if(It>0?D+=It:!X.includes(E)&&Et.includes(E)&&(D+=1),D=Math.min(Math.max(0,D),I.length),requestAnimationFrame(()=>{var $t;let tt=($t=this.input)!=null?$t:y;tt&&(tt.value=this.inputValue,tt.setSelectionRange(D,D))}),/^\d{2}\.\d{2}\.\d{4}$/.test(I)){let tt=this.parseInputText(I);this.applyParsedInput(tt)}else this.showInvalidStyle=!1,this.showValidStyle=!1;return}if(!this.open&&this.hasFocus&&!this.disabled&&!this.visuallyDisabled&&this.show(),this.range){let y=this.rangeStart?$.parseLocalISO(this.rangeStart):null,b=this.rangeEnd?$.parseLocalISO(this.rangeEnd):null;y&&!b?this.setNavStatus(`${this.termStartSelected()}: ${this.formatSelectionLabel(y)}`):y&&b&&this.setNavStatus(`${this.termStartSelected()}: ${this.formatSelectionLabel(y)}; ${this.termEndSelected()}: ${this.formatSelectionLabel(b)}`)}else if(this.value){let y=$.parseLocalISO(this.value);this.setNavStatus(`${this.formatSelectionLabel(y)}`)}};this.handleInputBlur=()=>{if(this.disabled||this.visuallyDisabled){this.handleBlur();return}let t=this.parseInputText(this.inputValue);t.valid?this.applyParsedInput(t):(this.inputValue=this.formatInputValue(),this.showInvalidStyle=!!this.inputValue&&!this.value&&!this.rangeStart),this.handleBlur()};this.handleCurrentPlacement=t=>{this.currentPlacement=t.detail.placement};this.handleHeaderKeyDown=(t,e,r,o)=>{if(t.key==="Tab"&&!t.shiftKey){o&&(t.preventDefault(),t.stopPropagation(),this.tabbingIntoGrid=!0,this.focusInitialGridDay());return}(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopPropagation(),e==="month"?this.setMonth(r):this.setYear(r))};this.onKeyDown=t=>{if(this.disabled||this.visuallyDisabled){t.preventDefault(),t.stopPropagation();return}let e=t.key,r=!0,o=new Date(this.focusedDate);switch(e){case"ArrowLeft":o.setDate(o.getDate()-1);break;case"ArrowRight":o.setDate(o.getDate()+1);break;case"ArrowUp":o.setDate(o.getDate()-7);break;case"ArrowDown":o.setDate(o.getDate()+7);break;case"Escape":{this.previewEnd?(this.previewEnd=null,this.setNavStatus(this.localize.term("selectionCleared"))):this.range&&this.rangeStart&&!this.rangeEnd&&(this.rangeStart=null,this.setNavStatus(this.localize.term("selectionCleared")),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}})),this.open&&(this.hide(),this.emit("sd-datepicker-close"));break}case"Enter":case" ":this.selectDate(this.focusedDate);break;default:r=!1}if(r){if(t.preventDefault(),o.getMonth()!==this.viewMonth.getMonth()||o.getFullYear()!==this.viewMonth.getFullYear()){this.viewMonth=new Date(o.getFullYear(),o.getMonth(),1);let p=this.formatMonthYear(this.viewMonth);this.setNavStatus(p)}let d=$.startOfDayLocal(o);(!this.focusedDate||d.getTime()!==this.focusedDate.getTime())&&(this.focusedDate=d);let c=d.toLocaleDateString(this.locale,{weekday:"long",day:"numeric",month:"long",year:"numeric"});this.setNavStatus(c),this.requestUpdate(),requestAnimationFrame(()=>{let p=this.shadowRoot,m=p==null?void 0:p.querySelector("button.day.focused");m==null||m.focus({preventScroll:!0})})}};this.handleInputKeyDown=t=>{if((this.disabled||this.visuallyDisabled)&&t.key!=="Tab"){t.preventDefault(),t.stopPropagation();return}if(!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||t.key==="End"||t.key==="PageUp"||t.key==="PageDown")){if(t.key==="Escape"&&this.open){t.preventDefault(),this.hide(),this.emit("sd-datepicker-close");return}t.key==="Enter"&&!this.open&&!this.disabled&&!this.visuallyDisabled&&(t.preventDefault(),this.show())}};this.handleOutsideClick=this.handleOutsideClick.bind(this)}connectedCallback(){super.connectedCallback(),this.syncDisabledDatesSet(),document.addEventListener("click",this.handleOutsideClick),this.addEventListener("focusout",this.onFocusOut),this.updateComplete.then(()=>{this.formControlController.updateValidity()});let t=this.value?$.parseLocalISO(this.value):null,e=this.rangeStart?$.parseLocalISO(this.rangeStart):null,r=this.range&&e?e:t!=null?t:$.startOfDayLocal(new Date);this.viewMonth=new Date(r.getFullYear(),r.getMonth(),1),this.focusedDate=$.clampDateToMonth(r,this.viewMonth),(this.firstDayOfWeek===null||this.firstDayOfWeek===void 0)&&(this.firstDayOfWeek=1),this.inputValue=this.formatInputValue(),this.setAttribute("role","group"),this.setAttribute("aria-label",this.range?this.localize.term("datePickerRange"):this.localize.term("datePicker")),this.addEventListener("focusin",this.onFocusIn)}firstUpdated(){this.formControlController.updateValidity()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut),document.removeEventListener("click",this.handleOutsideClick)}handleLocaleChange(){this.firstDayOfWeek===null&&(this.firstDayOfWeek=1),this.requestUpdate()}handleDisabledDatesChange(){this.syncDisabledDatesSet(),this.requestUpdate()}handleValueChange(){let t=this.value?$.parseLocalISO(this.value):null;t&&(this.viewMonth=new Date(t.getFullYear(),t.getMonth(),1),this.focusedDate=$.startOfDayLocal(t)),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var r;let e=this.input;if(e){e.value=(r=this.inputValue)!=null?r:"";let o=e.value.length;e.setSelectionRange(o,o)}this.formControlController.updateValidity()}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})}handleRangeChange(){let t=this.rangeStart?$.parseLocalISO(this.rangeStart):null,e=this.rangeEnd?$.parseLocalISO(this.rangeEnd):null,r=t!=null?t:e;r&&(this.viewMonth=new Date(r.getFullYear(),r.getMonth(),1),this.focusedDate=$.startOfDayLocal(r)),this.previewEnd!==null&&(this.previewEnd=null),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var n;let o=this.input;if(o){o.value=(n=this.inputValue)!=null?n:"";let d=o.value.length;o.setSelectionRange(d,d)}this.formControlController.updateValidity()}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})}handleDisabledChange(){this.formControlController.setValidity(this.disabled),(this.disabled||this.visuallyDisabled)&&(this.open=!1)}get validity(){let t={valid:!0};return this.input instanceof HTMLInputElement?this.input.validity:t}get validationMessage(){return(this.input instanceof HTMLInputElement?this.input.validationMessage:"")||""}checkValidity(){return this.input instanceof HTMLInputElement?this.input.checkValidity():!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input instanceof HTMLInputElement?this.input.reportValidity():!0}setCustomValidity(t){var e;(e=this.input)==null||e.setCustomValidity(t),this.formControlController.updateValidity()}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}parseISO(t){return $.parseLocalISO(t)}inMinMax(t){let e=this.parseISO(this.min!==null?String(this.min):null),r=this.parseISO(this.max!==null?String(this.max):null);return!(e&&t<e||r&&t>r)}isInDisabledDates(t){if(!this.disabledDatesSet||this.disabledDatesSet.size===0)return!1;let e=$.toLocalISODate($.startOfDayLocal(t));return this.disabledDatesSet.has(e)}isWeekend(t){let e=t.getDay();return e===0||e===6}isDisabled(t){var e;return!!(!this.inMinMax(t)||this.disabledWeekends&&this.isWeekend(t)||this.isInDisabledDates(t)||(e=this.isDateDisabled)!=null&&e.call(this,t))}setNavStatus(t){this.statusNavText=t}announceSelect(t,e=40){setTimeout(()=>{this.statusBumpCounter++;let r="\u200B".repeat(this.statusBumpCounter%3);this.statusSelectText=t+r},e)}formatSelectionLabel(t){if(this.locale==="de-DE")return t.toLocaleDateString("de-DE",{day:"numeric",month:"long",year:"numeric"});let e=t.getDate(),r=this.ordinal(e),o=t.toLocaleDateString("en-US",{month:"long"}),n=t.getFullYear();return`${r} of ${o} ${n}`}ordinal(t){let e=["th","st","nd","rd"],r=t%100,o=e[(r-20)%10]||e[r]||e[0];return t+o}syncDisabledDatesSet(){let t=[];if(Array.isArray(this.disabledDates))t=this.disabledDates;else if(typeof this.disabledDates=="string"){let e=this.disabledDates.trim();if(e.startsWith("["))try{let r=JSON.parse(e);Array.isArray(r)&&(t=r)}catch(r){t=[]}else e.length>0&&(t=e.split(",").map(r=>r.trim()).filter(Boolean))}this.disabledDatesSet=new Set(t)}wouldRangeContainDisabled(t,e){let r=$.compareDates(t,e)<=0?$.startOfDayLocal(t):$.startOfDayLocal(e),o=$.compareDates(t,e)<=0?$.startOfDayLocal(e):$.startOfDayLocal(t),n=new Date(r);for(;$.compareDates(n,o)<=0;){if(this.isDisabled(n))return!0;n.setDate(n.getDate()+1)}return!1}termStartSelected(){var t,e;return(e=(t=this.localize)==null?void 0:t.term)==null?void 0:e.call(t,"startDateSelected")}termEndSelected(){var t,e;return(e=(t=this.localize)==null?void 0:t.term)==null?void 0:e.call(t,"endDateSelected")}isoToDmy(t){if(!t)return"";let e=$.parseLocalISO(t);if(!e)return"";let r=String(e.getDate()).padStart(2,"0"),o=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getFullYear());return`${r}.${o}.${n}`}dmyToIso(t){if(!t)return null;let e=t.match(/^(\d{2})\.(\d{2})\.(\d{4})$/);if(!e)return null;let r=Number(e[1]),o=Number(e[2]),n=Number(e[3]),d=new Date(n,o-1,r);if(d.getFullYear()!==n||d.getMonth()!==o-1||d.getDate()!==r)return null;let c=$.startOfDayLocal(d);return $.toLocalISODate(c)}formatInputValue(){let t=(this.locale||"").toLowerCase(),e=(this.getAttribute("lang")||"").toLowerCase(),o=t.startsWith("de")||e.startsWith("de")?"\u2013":"-";if(!this.range)return this.isoToDmy(this.value);let n=this.isoToDmy(this.rangeStart),d=this.isoToDmy(this.rangeEnd);return n&&d?`${n} ${o} ${d}`:n&&!d?`${n} ${o}`:""}parseInputText(t){var o,n;let e=t.trim();if(this.range){let d=e.split(/\s*-\s*/);if(d.length===1){let c=d[0];if(!c)return{start:null,end:null,valid:!0};let p=this.dmyToIso(c);return p?{start:p,end:null,valid:!0}:{start:null,end:null,valid:!1}}else if(d.length>=2){let c=(o=d[0])!=null?o:"",p=(n=d[1])!=null?n:"",m=c?this.dmyToIso(c):null,f=p?this.dmyToIso(p):null;return c&&!m?{start:null,end:null,valid:!1}:p&&!f?{start:null,end:null,valid:!1}:{start:m,end:f,valid:!0}}return{start:null,end:null,valid:!1}}if(!e)return{single:null,valid:!0};let r=this.dmyToIso(e);return r?{single:r,valid:!0}:{single:null,valid:!1}}applyParsedInput(t){var c,p,m,f;if(!t.valid)return this.showInvalidStyle=!0,this.showValidStyle=!1,this.formControlController.setValidity(!1),!1;let e=y=>{if(!y)return!0;let b=$.parseLocalISO(y);return!(!this.inMinMax(b)||this.isDisabled(b))},r=!1;if(this.range){let y=(c=t.start)!=null?c:null,b=(p=t.end)!=null?p:null;if(!e(y)||b&&!e(b))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1;let E=y?$.parseLocalISO(y):null,L=b?$.parseLocalISO(b):null;if(E&&L){if($.compareDates(E,L)>0){let O=E;E=L,L=O}if(!this.allowSameDayRange&&$.isSameDay(E,L))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1;if(this.wouldRangeContainDisabled(E,L))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1}let M=E?$.toLocalISODate($.startOfDayLocal(E)):null,S=L?$.toLocalISODate($.startOfDayLocal(L)):null;if(this.rangeStart!==M||this.rangeEnd!==S){this.rangeStart=M,this.rangeEnd=S,this.previewEnd=null,r=!0;let O=(m=E!=null?E:L)!=null?m:this.today;this.viewMonth=new Date(O.getFullYear(),O.getMonth(),1),this.focusedDate=$.startOfDayLocal(O),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}})}return this.showInvalidStyle=!1,this.range?this.showValidStyle=!!(this.rangeStart&&this.rangeEnd&&this.styleOnValid):this.showValidStyle=!!(this.value&&this.styleOnValid),this.formControlController.setValidity(!0),this.updateComplete.then(()=>{this.formControlController.updateValidity()}),!0}let o=(f=t.single)!=null?f:null;if(!e(o))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1;let n=o?$.parseLocalISO(o):null,d=n?$.toLocalISODate($.startOfDayLocal(n)):null;return this.value!==d&&(this.value=d,r=!0,n&&(this.viewMonth=new Date(n.getFullYear(),n.getMonth(),1),this.focusedDate=$.startOfDayLocal(n)),this.emit("sd-select",{detail:{value:this.value,date:n!=null?n:null}})),this.showInvalidStyle=!1,this.showValidStyle=!!this.value,this.inputValue=this.formatInputValue(),r}buildDmyFromDigits(t){let e=t.slice(0,8),r=e.slice(0,2),o=e.slice(2,4),n=e.slice(4,8),d=r;return o.length&&(d+="."+o),n.length&&(d+="."+n),d}digitIndexToDmyCaretPos(t){return t<=2?t:t<=4?3+(t-2):6+(t-4)}countDigitsBeforeCaret(t,e){return t.slice(0,e).replace(/\D/g,"").length}handleOutsideClick(t){var r,o;((o=(r=t.composedPath)==null?void 0:r.call(t))!=null?o:[]).includes(this)||(this.hide(),this.hasFocus=!1,this.emit("sd-datepicker-close"))}show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}this.open=!0}hide(){if(!this.open||this.disabled){this.open=!1;return}this.open=!1}handleMouseDown(t){if(this.visuallyDisabled||this.disabled){t.preventDefault(),t.stopPropagation();return}t.preventDefault(),this.open||this.show()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleFocus(){this.hasFocus=!0,!this.open&&!this.disabled&&!this.visuallyDisabled&&this.show(),this.emit("sd-focus")}setMonth(t){let e=new Date(this.viewMonth.getFullYear(),this.viewMonth.getMonth()+t,1);if(e.getMonth()===this.viewMonth.getMonth()&&e.getFullYear()===this.viewMonth.getFullYear())return;this.viewMonth=e;let r=this.formatMonthYear(this.viewMonth);this.setNavStatus(r),this.emit("sd-month-change",{detail:{month:this.viewMonth}})}setYear(t){let e=new Date(this.viewMonth.getFullYear()+t,this.viewMonth.getMonth(),1);if(e.getFullYear()===this.viewMonth.getFullYear()&&e.getMonth()===this.viewMonth.getMonth())return;this.viewMonth=e;let r=this.formatMonthYear(this.viewMonth);this.setNavStatus(r),this.emit("sd-month-year",{detail:{month:this.viewMonth}})}focusInitialGridDay(){let t=null;if(!this.range&&this.value){let r=$.parseLocalISO(this.value);r&&(t=$.startOfDayLocal(r))}if(this.range){let r=this.rangeStart?$.parseLocalISO(this.rangeStart):null,o=this.rangeEnd?$.parseLocalISO(this.rangeEnd):null;o?t=$.startOfDayLocal(o):r&&(t=$.startOfDayLocal(r))}if(!(r=>r?r.getFullYear()===this.viewMonth.getFullYear()&&r.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(r):!1)(t)){let{weeks:r}=this.getMonthMatrix(this.viewMonth),o=r.flat().find(n=>n.getMonth()===this.viewMonth.getMonth()&&$.isSameDay(n,this.today)&&!this.isDisabled(n));if(o)t=$.startOfDayLocal(o);else{let n=r.flat().find(d=>d.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(d));t=n?$.startOfDayLocal(n):null}}t&&(this.focusedDate=t),this.requestUpdate(),requestAnimationFrame(()=>{let r=this.shadowRoot,o=(r==null?void 0:r.querySelector("button.day.selected"))||(r==null?void 0:r.querySelector("button.day.focused"))||(r==null?void 0:r.querySelector('button.day[tabindex="0"]'))||(r==null?void 0:r.querySelector("button.day"));o==null||o.focus({preventScroll:!0})})}selectSingleDate(t){if(this.isDisabled(t))return;let e=$.startOfDayLocal(t),r=$.toLocalISODate(e);if(this.value===r)return;this.value=r;let o=`${this.formatSelectionLabel(e)}, ${this.localize.term("selected")}`;this.announceSelect(o),this.emit("sd-select",{detail:{value:this.value,date:e}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var d;let n=this.input;n&&(n.value=(d=this.inputValue)!=null?d:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let c=n.value.length;n.setSelectionRange(c,c)})}))})}selectRangeDate(t){let e=$.startOfDayLocal(t),r=this.rangeStart?$.parseLocalISO(this.rangeStart):null,o=this.rangeEnd?$.parseLocalISO(this.rangeEnd):null;if(!r&&!o){if(this.isDisabled(e))return;this.rangeStart=$.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let n=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${n}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var c;let d=this.input;d&&(d.value=(c=this.inputValue)!=null?c:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let p=d.value.length;d.setSelectionRange(p,p)})}))});return}if(r&&!o){if(this.isDisabled(e))return;if($.isSameDay(r,e)){if(!this.allowSameDayRange){this.rangeStart=$.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let y=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${y}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var E;let b=this.input;b&&(b.value=(E=this.inputValue)!=null?E:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let L=b.value.length;b.setSelectionRange(L,L)})}))});return}this.rangeStart=$.toLocalISODate(e),this.rangeEnd=$.toLocalISODate(e),this.previewEnd=null;let f=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${f}`,40),this.announceSelect(`${this.termEndSelected()}: ${f}`,140),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var b;let y=this.input;y&&(y.value=(b=this.inputValue)!=null?b:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let E=y.value.length;y.setSelectionRange(E,E)})}))});return}let n=$.parseLocalISO(this.rangeStart);if(this.wouldRangeContainDisabled(n,e))return;let[d,c]=$.compareDates(n,e)<=0?[n,e]:[e,n];this.rangeStart=$.toLocalISODate(d),this.rangeEnd=$.toLocalISODate(c),this.previewEnd=null;let p=this.formatSelectionLabel(d),m=this.formatSelectionLabel(c);this.announceSelect(`${this.termStartSelected()}: ${p}`,40),this.announceSelect(`${this.termEndSelected()}: ${m}`,140),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var y;let f=this.input;f&&(f.value=(y=this.inputValue)!=null?y:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let b=f.value.length;f.setSelectionRange(b,b)})}))});return}if(r&&o){if(this.isDisabled(e))return;this.rangeStart=$.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let n=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${n}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var c;let d=this.input;d&&(d.value=(c=this.inputValue)!=null?c:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let p=d.value.length;d.setSelectionRange(p,p)})}))})}}selectDate(t){this.range?this.selectRangeDate(t):this.selectSingleDate(t)}getMonthMatrix(t){var m;let e=(m=this.firstDayOfWeek)!=null?m:1,r=new Date(t.getFullYear(),t.getMonth(),1),o=new Date(r),n=(r.getDay()-e+7)%7;o.setDate(r.getDate()-n);let d=[],c=o;for(let f=0;f<6;f++){let y=[];for(let b=0;b<7;b++)y.push(new Date(c)),c.setDate(c.getDate()+1);d.push(y)}let p=f=>f.every(y=>y.getMonth()!==t.getMonth());for(;d.length>0&&p(d[d.length-1]);)d.pop();return{weeks:d}}formatMonthYear(t){try{return new Intl.DateTimeFormat(this.locale,{month:"long",year:"numeric"}).format(t)}catch(e){return`${t.toLocaleString(void 0,{month:"long"})} ${t.getFullYear()}`}}weekdayLabels(){var o;let t=(o=this.firstDayOfWeek)!=null?o:1,e=new Date(2021,7,1),r=[];for(let n=0;n<7;n++){let d=new Date(e);d.setDate(e.getDate()+(t+n)%7);try{r.push(new Intl.DateTimeFormat(this.locale,{weekday:"short"}).format(d))}catch(c){r.push(d.toLocaleDateString(void 0,{weekday:"short"}))}}return r}getTabTargetDayForCurrentView(t){let e=t.flat().find(o=>o.getMonth()===this.viewMonth.getMonth()&&$.isSameDay(o,this.today)&&!this.isDisabled(o));if(e)return $.startOfDayLocal(e);let r=t.flat().find(o=>o.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(o));return r?$.startOfDayLocal(r):null}onDayMouseEnter(t){if(!this.range)return;let e=this.rangeStart?$.parseLocalISO(this.rangeStart):null,r=this.rangeEnd?$.parseLocalISO(this.rangeEnd):null;if(e&&!r){let o=$.startOfDayLocal(t);this.previewEnd=this.isDisabled(o)?null:o,this.requestUpdate()}}onGridMouseLeave(){this.previewEnd!==null&&(this.previewEnd=null,this.requestUpdate())}renderCalendar(){let{weeks:t}=this.getMonthMatrix(this.viewMonth),e=this.formatMonthYear(this.viewMonth),r=this.weekdayLabels(),o=this.value?this.parseISO(this.value):null,n=this.rangeStart?this.parseISO(this.rangeStart):null,d=this.rangeEnd?this.parseISO(this.rangeEnd):null,c=this.previewEnd,p=f=>!this.range||!n||d||!c?!1:$.isBetweenInclusive(f,n,c),m=this.getTabTargetDayForCurrentView(t);return u`<div part="datepicker" class="w-[284px] z-50 absolute top-full bg-white border-2 border-t-0 border-primary py-3 px-4 ${this.open?"block rounded-bl-default rounded-br-default":"hidden"} ${this.alignment==="left"?"left-0":"right-0"}"><div class="flex flex-row items-center w-full justify-between mb-3" part="header"><div class="flex items-center"><button type="button" tabindex="0" class="nav prev w-6 h-6 hover:cursor-pointer sd-interactive" part="prev-year-button" @click="${()=>this.setYear(-1)}" @keydown="${f=>this.handleHeaderKeyDown(f,"year",-1,!1)}" aria-label="${this.localize.term("previousYear")}"><sd-icon library="_internal" name="chevrons-sm-left" class="h-6 w-6"></sd-icon></button> <button type="button" tabindex="0" class="nav prev w-6 h-6 hover:cursor-pointer sd-interactive" part="prev-month-button" @click="${()=>this.setMonth(-1)}" @keydown="${f=>this.handleHeaderKeyDown(f,"month",-1,!1)}" aria-label="${this.localize.term("previousMonth")}"><sd-icon library="_internal" name="chevron-sm-left" class="h-6 w-6"></sd-icon></button></div><div tabindex="-1" class="month-label flex justify-center sd-headline sd-headline--size-base !text-primary" part="month-label" aria-live="polite">${e}</div><div class="flex items-center"><button type="button" tabindex="0" class="nav next w-6 h-6 hover:cursor-pointer sd-interactive" part="next-month-button" @click="${()=>this.setMonth(1)}" @keydown="${f=>this.handleHeaderKeyDown(f,"month",1,!1)}" aria-label="${this.localize.term("nextMonth")}"><sd-icon library="_internal" name="chevron-sm-right" class="h-6 w-6"></sd-icon></button> <button type="button" tabindex="0" class="nav next w-6 h-6 hover:cursor-pointer sd-interactive" part="next-year-button" @click="${()=>this.setYear(1)}" @keydown="${f=>this.handleHeaderKeyDown(f,"year",1,!0)}" aria-label="${this.localize.term("nextYear")}"><sd-icon library="_internal" name="chevrons-sm-right" class="h-6 w-6"></sd-icon></button></div></div><sd-divider></sd-divider><div class="sr-only" aria-live="polite" aria-atomic="true">${this.statusNavText}</div><div class="sr-only" aria-live="assertive" aria-atomic="true">${this.statusSelectText}</div><div class="sr-only" id="keyboard-hint">${this.localize.term("datePickerInfo")}</div><div class="grid mt-2" role="grid" aria-describedby="keyboard-hint" aria-label="${e}" part="grid" @mouseleave="${this.onGridMouseLeave}" @focusin="${()=>{this.tabbingIntoGrid=!1}}"><div class="grid-row grid-head grid grid-cols-7 gap-y-[1px]" role="row">${r.map((f,y)=>u`<div role="columnheader" aria-colindex="${y+1}" part="weekday" class="cell head flex items-center justify-center font-bold text-black text-sm leading-none h-8" aria-label="${f}" title="${f}" id="${"col-"+(y+1)}">${f}</div>`)}</div>${t.map((f,y)=>u`<div class="grid-row grid grid-cols-7 ${y===0?"mt-2":""}" role="row" aria-rowindex="${y+2}">${f.map((b,E)=>{let L=b.getMonth()===this.viewMonth.getMonth(),M=this.isDisabled(b),S=$.isSameDay(b,this.focusedDate),O=$.isSameDay(b,this.today),I=!this.range&&o?$.isSameDay(b,o):!1,F=this.range&&n?$.isSameDay(b,n):!1,D=this.range&&d?$.isSameDay(b,d):!1,Y=this.range&&n&&d?$.isBetweenInclusive(b,n,d):!1,X=p(b)&&!M,Et=-1,xt=m&&$.isSameDay(b,m);(this.tabbingIntoGrid&&xt||!this.tabbingIntoGrid&&S)&&(Et=0);let st=this.isWeekend(b),It=b.toLocaleDateString(this.locale,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),tt=F?this.localize.term("startDateSelected"):D?this.localize.term("endDateSelected"):void 0;return u`<button type="button" part="day" class="${h("cell day flex items-center justify-center focus-visible:outline focus:outline-2 focus:outline-primary -outline-offset-2 rounded-md w-[36px]",this.size==="sm"?"text-sm h-6":"text-base h-8",F||D?"hover:bg-primary-500":"hover:bg-primary-100 hover:text-primary-500",L?this.isInDisabledDates(b)?"out-month text-neutral-500":this.disabledWeekends&&st?"weekend-day text-neutral-500":"in-month text-primary":this.disabledWeekends&&st?"out-month weekend-day text-neutral-500":st?"out-month weekend-day text-neutral-700":"out-month text-neutral-700",I?"selected border-primary bg-primary text-white hover:bg-primary-500 hover:text-white":"",F?"bg-primary text-white rounded-l-md rounded-r-none":"",D?"bg-primary text-white range-end rounded-r-md rounded-l-none":"",Y&&!F&&!D?"in-range selected bg-primary-100 text-primary-500 rounded-none hover:bg-primary-500 hover:text-white":"",!Y&&X&&!F&&!D?"in-preview-range bg-primary-100 text-primary-500 rounded-none":"",O&&!I&&!F&&!D&&S?"today border-[1px] border-primary font-bold":"",M?"disabled cursor-not-allowed hover:bg-transparent":"",S&&!O?"focused outline outline-2 outline-primary":"")}" role="gridcell" aria-colindex="${E+1}" aria-labelledby="${"col-"+(E+1)}" .tabIndex="${Et}" ?disabled="${M||this.disabled}" aria-disabled="${M||this.visuallyDisabled||this.disabled?"true":"false"}" aria-selected="${I||Y||F||D?"true":"false"}" aria-current="${O?"date":j}" aria-label="${It}" aria-roledescription="${tt!=null?tt:j}" @focus="${()=>this.focusedDate=$.startOfDayLocal(b)}" @mouseenter="${()=>this.onDayMouseEnter(b)}" @keydown="${this.onKeyDown}" @click="${()=>{this.focusedDate=$.startOfDayLocal(b),this.selectDate(b)}}">${b.getDate()}</button>`})}</div>`)}</div></div>`}render(){let t={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},e=this.label?!0:!!t.label,r=this.helpText?!0:!!t.helpText,o=!!t.tooltip,n=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",d={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],c={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size],p=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",m={disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[p],f=this.size==="sm"?"text-sm":"text-base";return u`<div part="form-control" class="${h("min-w-[284px]",this.open&&"z-50",(this.disabled||this.visuallyDisabled)&&"cursor-not-allowed")}">${e||o?u`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${h(e?"inline-block":"hidden",f)}" for="input" aria-hidden="${e?"false":"true"}"><slot name="label">${this.label}</slot></label> ${t.tooltip?u`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${h("relative w-full",this.disabled&&"pointer-events-none",this.visuallyDisabled&&"cursor-not-allowed")}"><div part="border" class="${h("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",m,this.open&&this.alignment==="left"?"rounded-bl-none":"",this.open&&this.alignment==="right"?"rounded-br-none":"")}"></div><sd-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${h("inline-flex relative w-full")}" sync="width" auto-size="vertical" auto-size-padding="10" exportparts="popup:popup__content,"><div part="base" class="${h("px-4 flex flex-row items-center rounded-default transition-colors ease-in-out duration-medium hover:duration-fast w-full",!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",p==="disabled"||p==="visuallyDisabled"?"text-neutral-500":"text-black")}" slot="anchor"><input id="input" type="text" role="combobox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="dialog" aria-controls="calendar-grid" aria-describedby="${r?"help-text":void 0}" aria-invalid="${this.showInvalidStyle?"true":"false"}" aria-label="${this.range?"Select date range":"Select a date"}" class="${h("min-w-0 flex-grow focus:outline-none bg-transparent hover:cursor-pointer",this.visuallyDisabled||this.disabled?"placeholder:text-neutral-500 cursor-not-allowed":"placeholder:text-neutral-700",{sm:"h-8",md:"h-10",lg:"h-12"}[this.size],f)}" autocomplete="off" spellcheck="false" placeholder="${this.placeholder||this.localize.term(this.range?"dateRangePlaceholder":"datePlaceholder")}" ?disabled="${this.disabled}" ?readonly="${this.readonly||this.visuallyDisabled}" @input="${this.handleInput}" @click="${this.handleMouseDown}" @keydown="${this.handleInputKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleInputBlur}" @invalid="${this.handleInvalid}"> ${this.showInvalidStyle?u`<sd-icon part="invalid-icon" class="${h("text-error",d,c)}" library="_internal" name="risk"></sd-icon>`:""} ${this.showValidStyle&&this.styleOnValid?u`<sd-icon class="${h("text-success flex-shrink-0",d,c)}" library="_internal" name="confirm-circle" part="valid-icon"></sd-icon>`:""}<sd-icon class="${h(n,d,c,"hover:cursor-pointer")}" library="_internal" name="calendar" @click="${this.show}"></sd-icon>${this.renderCalendar()}</div></sd-popup></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${h("text-sm text-neutral-700 mt-1",r?"block":"hidden")}" aria-hidden="${!r}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};_.styles=[...g.styles,x`:host{display:inline-block;outline:2px solid transparent;outline-offset:2px;position:relative;width:100%}:host([required]) #label:after{content:" *"}:host([visually-disabled]) input{caret-color:transparent}`],a([l({type:String,reflect:!0})],_.prototype,"locale",2),a([l({type:String})],_.prototype,"value",2),a([l({type:Boolean,reflect:!0})],_.prototype,"range",2),a([l({type:String})],_.prototype,"rangeStart",2),a([l({type:String})],_.prototype,"rangeEnd",2),a([l({type:Boolean})],_.prototype,"allowSameDayRange",2),a([l({type:String})],_.prototype,"min",2),a([l({type:String})],_.prototype,"max",2),a([l({type:Number})],_.prototype,"firstDayOfWeek",2),a([l({type:Boolean,reflect:!0,attribute:"disabled-weekends"})],_.prototype,"disabledWeekends",2),a([l({attribute:"disabled-dates"})],_.prototype,"disabledDates",2),a([l({attribute:!1})],_.prototype,"isDateDisabled",2),a([l({type:String,reflect:!0})],_.prototype,"size",2),a([l({type:String})],_.prototype,"alignment",2),a([l({type:String,reflect:!0})],_.prototype,"label",2),a([l({type:String,attribute:"help-text",reflect:!0})],_.prototype,"helpText",2),a([l({type:Boolean,reflect:!0})],_.prototype,"disabled",2),a([l({type:Boolean,attribute:"visually-disabled"})],_.prototype,"visuallyDisabled",2),a([l({type:Boolean,reflect:!0,attribute:"style-on-valid"})],_.prototype,"styleOnValid",2),a([l({type:Boolean,reflect:!0})],_.prototype,"readonly",2),a([l({type:String,reflect:!0})],_.prototype,"placement",2),a([l({type:String,reflect:!0})],_.prototype,"placeholder",2),a([l({reflect:!0})],_.prototype,"name",2),a([l({type:String,reflect:!0})],_.prototype,"form",2),a([T()],_.prototype,"open",2),a([T()],_.prototype,"viewMonth",2),a([T()],_.prototype,"focusedDate",2),a([T()],_.prototype,"today",2),a([T()],_.prototype,"disabledDatesSet",2),a([T()],_.prototype,"previewEnd",2),a([T()],_.prototype,"statusNavText",2),a([T()],_.prototype,"statusSelectText",2),a([T()],_.prototype,"hasFocus",2),a([T()],_.prototype,"showValidStyle",2),a([T()],_.prototype,"showInvalidStyle",2),a([T()],_.prototype,"currentPlacement",2),a([T()],_.prototype,"inputValue",2),a([v("#invalid-message")],_.prototype,"invalidMessage",2),a([v("#input")],_.prototype,"input",2),a([k("locale")],_.prototype,"handleLocaleChange",1),a([k("disabledDates")],_.prototype,"handleDisabledDatesChange",1),a([k("value")],_.prototype,"handleValueChange",1),a([k("rangeStart"),k("rangeEnd")],_.prototype,"handleRangeChange",1),a([k(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],_.prototype,"handleDisabledChange",1),_=a([w("sd-datepicker")],_);var Ht=class extends g{constructor(){super(...arguments);this.hasSlotController=new P(this,"footer");this.localize=new A(this);this.open=!1;this.headline="";this.noCloseButton=!1}connectedCallback(){super.connectedCallback(),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.modal=new Ze(this)}firstUpdated(){this.dialog.hidden=!this.open,this.open&&(this.addOpenListeners(),this.modal.activate(),We(this))}disconnectedCallback(){super.disconnectedCallback(),Xe(this)}get prefersReducedMotion(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}requestClose(t){if(this.emit("sd-request-close",{cancelable:!0,detail:{source:t}}).defaultPrevented){let r=q(this,"dialog.denyClose",{dir:this.localize.dir()});K(this.panel,r.keyframes,r.options);return}this.hide()}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}handleDocumentKeyDown(t){this.open&&t.key==="Escape"&&(t.stopPropagation(),this.requestClose("keyboard"))}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.addOpenListeners(),this.originalTrigger=je(),this.modal.activate(),We(this);let t=this.querySelector("[autofocus]");t&&t.removeAttribute("autofocus"),await Promise.all([W(this.dialog),W(this.overlay)]),this.dialog.hidden=!1,requestAnimationFrame(()=>{this.emit("sd-initial-focus",{cancelable:!0}).defaultPrevented||(t?t.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),t&&t.setAttribute("autofocus","")});let e=this.prefersReducedMotion?q(this,"dialog.showReducedMotion",{dir:this.localize.dir()}):q(this,"dialog.show",{dir:this.localize.dir()}),r=q(this,"dialog.overlay.show",{dir:this.localize.dir()});await Promise.all([K(this.panel,e.keyframes,e.options),K(this.overlay,r.keyframes,r.options)]),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),this.modal.deactivate(),await Promise.all([W(this.dialog),W(this.overlay)]);let t=this.prefersReducedMotion?q(this,"dialog.hideReducedMotion",{dir:this.localize.dir()}):q(this,"dialog.hide",{dir:this.localize.dir()}),e=q(this,"dialog.overlay.hide",{dir:this.localize.dir()});await Promise.all([K(this.overlay,e.keyframes,e.options).then(()=>{this.overlay.hidden=!0}),K(this.panel,t.keyframes,t.options).then(()=>{this.panel.hidden=!0})]),this.dialog.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1,Xe(this);let r=this.originalTrigger;typeof(r==null?void 0:r.focus)=="function"&&r.isConnected&&setTimeout(()=>{try{r.focus({preventScroll:!0})}catch(o){r.focus()}this.originalTrigger=null}),this.emit("sd-after-hide")}}async show(){if(!this.open)return this.open=!0,J(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,J(this,"sd-after-hide")}render(){return u`<div part="base" class="${h("flex items-center justify-center fixed inset-0 z-dialog",this.hasSlotController.test("footer")&&"dialog--has-footer")}"><div part="overlay" class="fixed inset-0 bg-primary-800 opacity-90" @click="${()=>this.requestClose("overlay")}" tabindex="-1"></div><div part="panel" class="${h("flex flex-col z-20 bg-white py-4 sm:py-8 relative gap-6 focus-visible:focus-outline-inverted overflow-y-auto",this.open&&"flex opacity-100")}" role="dialog" aria-modal="true" aria-hidden="${this.open?"false":"true"}" aria-label="${C(this.headline?this.headline:void 0)}" aria-labelledby="${C(this.headline?void 0:"title")}" tabindex="0"><header part="header" class="flex flex-grow-0 flex-shrink-0 basis-auto px-6 sm:px-10"><h2 part="title" class="flex-auto m-0" id="title">${this.headline.length>0?u`<span class="sd-headline sd-headline--size-3xl leading-tight">${this.headline}</span>`:u`<slot name="headline"></slot>`}</h2>${this.noCloseButton?"":u`<sd-button part="close-button" variant="tertiary" exportparts="base:close-button__base" class="${h("absolute top-2 right-2")}" name="x-lg" @click="${()=>this.requestClose("close-button")}" type="button"><sd-icon label="${this.localize.term("close")}" name="close" library="_internal" color="currentColor"></sd-icon></sd-button>`}</header><main part="body" class="flex flex-auto overflow-auto w-full px-6 sm:px-10"><slot></slot></main><footer part="footer" class="flex flex-grow-0 flex-shrink-0 basis-auto ml-auto gap-4 px-6 sm:px-10"><slot name="footer"></slot></footer></div></div>`}};Ht.styles=[...g.styles,x`:host{--width:662px}[part=panel]{max-height:80vh;width:var(--width)}[part=body]{-webkit-overflow-scrolling:touch}@media (max-width:414px){:host{--width:335px}[part=body]{min-height:50px}[part=footer]{width:100%}}`],a([v('[part="base"]')],Ht.prototype,"dialog",2),a([v('[part="panel"]')],Ht.prototype,"panel",2),a([v('[part="overlay"]')],Ht.prototype,"overlay",2),a([l({type:Boolean,reflect:!0})],Ht.prototype,"open",2),a([l({type:String,reflect:!0})],Ht.prototype,"headline",2),a([l({attribute:"no-close-button",type:Boolean,reflect:!0})],Ht.prototype,"noCloseButton",2),a([k("open",{waitUntilFirstUpdate:!0})],Ht.prototype,"handleOpenChange",1),Ht=a([w("sd-dialog")],Ht);B("dialog.show",{keyframes:[{opacity:0,transform:"translate(-50%, 100%)"},{opacity:1,transform:"translate(0, 0)"}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});B("dialog.showReducedMotion",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out",reducedMotion:"allow"}});B("dialog.hide",{keyframes:[{opacity:1,transform:"translate(0, 0)"},{opacity:0,transform:"translate(50%, -100%)"}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});B("dialog.hideReducedMotion",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out",reducedMotion:"allow"}});B("dialog.denyClose",{keyframes:[{scale:1},{scale:1.02},{scale:1}],options:{duration:250}});B("dialog.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out",reducedMotion:"allow"}});B("dialog.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out",reducedMotion:"allow"}});var me=class extends g{constructor(){super(...arguments);this.orientation="horizontal";this.inverted=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}render(){return u`<hr part="main" aria-orientation="${this.orientation}" class="${h(this.inverted?"border-primary-400":"border-neutral-400",this.orientation==="horizontal"?"border-t w-full":" border-l h-full")}">`}};me.styles=[...g.styles,x`:host{margin:var(--sd-spacing-0,0)}:host(sd-divider[orientation=horizontal]){display:block}:host(sd-divider[orientation=vertical]){display:inline-block}`],a([l({type:String,reflect:!0})],me.prototype,"orientation",2),a([l({type:Boolean,reflect:!0})],me.prototype,"inverted",2),me=a([w("sd-divider")],me);function Ra(s,i){let t=s;for(;t;){if(t.matches(i))return t;if(t.parentElement)t=t.parentElement;else if(t.parentNode instanceof ShadowRoot)t=t.parentNode.host;else break}return null}var dt=class extends g{constructor(){super(...arguments);this.localize=new A(this);this.open=!1;this.rounded=!1;this.placement="bottom-start";this.disabled=!1;this.stayOpenOnSelect=!1;this.distance=0;this.skidding=0;this.noAutoSize=!1;this.noFlip=!1;this.hoist=!1}connectedCallback(){super.connectedCallback(),this.handleMenuItemActivate=this.handleMenuItemActivate.bind(this),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this)}firstUpdated(){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide()}getAccessibleTrigger(){let e=this.trigger.assignedElements({flatten:!0}).find(o=>ar(o).start),r=null;if(e)switch(e.tagName.toLowerCase()){case"sd-button":case"sd-icon-button":r=e.button;break;case"sd-navigation-item":r=e.button;break;default:r=e}return r}updateAccessibleTrigger(){let t=this.getAccessibleTrigger();t&&(t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false"))}focusOnTrigger(){let t=this.getAccessibleTrigger();typeof(t==null?void 0:t.focus)=="function"&&t.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find(t=>t.tagName.toLowerCase()==="sd-menu")}handleKeyDown(t){this.open&&t.key==="Escape"&&(t.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(t){var e;if(t.key==="Tab"){if(this.open&&((e=document.activeElement)==null?void 0:e.tagName.toLowerCase())==="sd-menu-item"){t.preventDefault(),this.hide(),this.focusOnTrigger();return}setTimeout(()=>{let r=je();(!r||!this.containingElement||Ra(r,this.containingElement.tagName.toLowerCase())!==this.containingElement)&&this.hide()})}}handleDocumentMouseDown(t){let e=t.composedPath();this.containingElement&&!e.includes(this.containingElement)&&this.hide()}handleMenuItemActivate(t){let e=t.target;ee(e,this.panel)}handlePanelSelect(t){let e=t.target;!this.stayOpenOnSelect&&e.tagName.toLowerCase()==="sd-menu"&&(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():this.show()}handleTriggerKeyDown(t){if(t.key==="Escape"&&this.open){t.stopPropagation(),this.focusOnTrigger(),this.hide();return}if([" ","Enter"].includes(t.key)){t.preventDefault(),this.handleTriggerClick();return}let e=this.getMenu();if(e){let r=e.defaultSlot.assignedElements({flatten:!0}),o=r.find(d=>!d.disabled)||r[0],n=r[r.length-1];["ArrowDown","ArrowUp","Home","End"].includes(t.key)&&(t.preventDefault(),this.open||this.show(),r.length>0&&requestAnimationFrame(()=>{(t.key==="ArrowDown"||t.key==="Home")&&(e.setCurrentItem(o),o.focus()),(t.key==="ArrowUp"||t.key==="End")&&(e.setCurrentItem(n),n.focus())}))}}handleTriggerKeyUp(t){t.key===" "&&t.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}async show(){if(!this.open)return this.open=!0,J(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,J(this,"sd-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("sd-activate",this.handleMenuItemActivate),this.panel.addEventListener("sd-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("sd-activate",this.handleMenuItemActivate),this.panel.removeEventListener("sd-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}async handleOpenChange(){if(this.disabled){this.open=!1;return}if(this.updateAccessibleTrigger(),this.open){this.emit("sd-show"),this.addOpenListeners(),await W(this),this.panel.hidden=!1,this.popup.active=!0;let{keyframes:t,options:e}=q(this,"dropdown.show",{dir:this.localize.dir()});await K(this.popup.popup,t,e),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await W(this);let{keyframes:t,options:e}=q(this,"dropdown.hide",{dir:this.localize.dir()});await K(this.popup.popup,t,e),this.panel.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}render(){return u`<sd-popup part="base" id="dropdown" exportparts="
137
+ "><div part="combobox" class="${h("relative w-full px-4 flex flex-row items-center rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200",this.open&&"shadow transition-shadow duration-medium ease-in-out",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}">${t.left?u`<slot part="left" name="left" class="${h("inline-flex",y,m,b)}"></slot>`:""} ${this.multiple&&this.useTags&&this.tags.length>0?u`<div part="tags" class="${h("flex items-center gap-1",y)}">${this.tags}</div>`:null} <input id="display-input" name="${this.name}" form="${this.form}" part="display-input" class="${h("appearance-none outline-none bg-transparent flex-auto min-w-0",p,this.selectedTextLabel&&!this.multiple?"placeholder-black":"placeholder-neutral-700")}" type="text" placeholder="${this.selectedTextLabel&&!this.multiple?this.selectedTextLabel:this.placeholder||this.localize.term("comboboxDefaultPlaceholder")}" .disabled="${this.disabled}" .value="${this.displayInputValue}" autocomplete="off" spellcheck="false" autocapitalize="off" aria-controls="listbox" aria-expanded="${this.open}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled||this.visuallyDisabled}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-autocomplete="list" aria-owns="listbox" @input="${this.handleInput}" @change="${this.handleChange}"><div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(E=>E==null?void 0:E.getTextLabel()).join(", ")}</div><input class="${h("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",p)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${d?u`<button part="clear-button" class="${h("flex justify-center",f,this.value.length>0?"visible":"invisible")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.preventLoosingFocus}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-icon class="${h("text-neutral-700",b)}" name="closing-round" library="_internal"></sd-icon></slot></button>`:""} ${this.showInvalidStyle?u`<sd-icon part="invalid-icon" class="${h(f,b,"text-error")}" library="_internal" name="risk"></sd-icon>`:""} ${this.styleOnValid&&this.showValidStyle?u`<sd-icon part="valid-icon" class="${h("flex-shrink-0 text-success",f,b)}" library="_internal" name="confirm-circle"></sd-icon>`:""}<slot name="right" part="right" class="${h("inline-flex ml-2 leading-[0]",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",b)}">${this.type!=="search"?u`<sd-icon class="${h("transition-transform duration-medium ease-in-out",this.open?"rotate-180":"rotate-0")}" name="chevron-down" part="chevron" library="_internal" color="currentColor" label="${this.localize.term("open")}"></sd-icon>`:""}</slot>${this.type==="search"?u`<button class="${h("flex items-center sd-interactive",f)}" type="button"><sd-icon class="${h(m,b)}" library="_internal" name="magnifying-glass" label="${this.localize.term("search")}"></sd-icon></button>`:u`<button class="sd-interactive combobox-button absolute top-2" @keydown="${this.handleComboboxMouseDown}" type="button"><span class="sr-only">${this.localize.term("open")}</span></button>`}</div><div id="listbox" role="${C(this.multiple?void 0:"listbox")}" aria-expanded="${this.open}" aria-multiselectable="${this.multiple}" aria-labelledby="label" part="listbox" class="${h("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow transition-shadow duration-medium ease-in-out",this.currentPlacement==="bottom"?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mousedown="${this.preventLoosingFocus}" @mouseup="${this.handleOptionClick}"><div part="filtered-listbox">${this.filteredOptions.length===0?u`<span id="noResults" class="px-4 flex items-center w-full transition-all text-left text-base relative text-black py-3" aria-hidden="true" @click="${this.handleNoResultsClick}">${this.localize.term("noResults")}</span>`:this.options}</div><slot id="defaultOptionsSlot" class="hidden" @slotchange="${this.handleDefaultSlotChange}"></slot></div></sd-popup></div><div part="form-control-help-text" id="help-text" class="text-sm text-neutral-700 mt-1" aria-hidden="${!n}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};z.styles=[...g.styles,x`:host{display:block;position:relative;width:100%}:host([required]) #label:after{content:" *"}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([visually-disabled]) input{caret-color:transparent}:host([size=sm]) .combobox-button{height:var(--sd-spacing-4,1rem);right:var(--sd-spacing-4,1rem);width:var(--sd-spacing-4,1rem)}:host([size=md]) .combobox-button{height:var(--sd-spacing-6,1.5rem);right:.85rem;width:var(--sd-spacing-6,1.5rem)}:host([size=lg]) .combobox-button{height:var(--sd-spacing-8,2rem);right:var(--sd-spacing-3,.75rem);width:var(--sd-spacing-8,2rem)}[part=listbox]{max-height:var(--auto-size-available-height,auto)}sd-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-tag::part(content){display:inline-block;max-width:var(--tag-max-width,15ch);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249)/var(--tw-bg-opacity,1))}[part=filtered-listbox] sd-optgroup:first-of-type{--display-divider:none}mark{background-color:transparent;color:inherit;font-weight:700}`],a([v("sd-popup")],z.prototype,"popup",2),a([v('[part="combobox"]')],z.prototype,"combobox",2),a([v('[part="display-input"]')],z.prototype,"displayInput",2),a([v(".value-input")],z.prototype,"valueInput",2),a([v('[part="listbox"]')],z.prototype,"listbox",2),a([v('[part="tags"]')],z.prototype,"tagWrapper",2),a([v('[part="filtered-listbox"]')],z.prototype,"filteredWrapper",2),a([v("slot:not([name])")],z.prototype,"defaultSlot",2),a([v("#invalid-message")],z.prototype,"invalidMessage",2),a([T()],z.prototype,"hasFocus",2),a([T()],z.prototype,"displayInputValue",2),a([T()],z.prototype,"selectedTextLabel",2),a([T()],z.prototype,"selectedOptions",2),a([T()],z.prototype,"filteredOptions",2),a([T()],z.prototype,"allOptions",2),a([T()],z.prototype,"lastOption",2),a([T()],z.prototype,"showValidStyle",2),a([T()],z.prototype,"showInvalidStyle",2),a([T()],z.prototype,"deletedTagLabel",2),a([l({reflect:!0})],z.prototype,"name",2),a([l({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],z.prototype,"value",2),a([Bt()],z.prototype,"defaultValue",2),a([l({type:String,reflect:!0})],z.prototype,"size",2),a([l({type:String,reflect:!0})],z.prototype,"placeholder",2),a([l({type:String,attribute:"max-options-tag-label",reflect:!0})],z.prototype,"maxOptionsTagLabel",2),a([l({type:Boolean,reflect:!0})],z.prototype,"disabled",2),a([l({type:Boolean,reflect:!0,attribute:"visually-disabled"})],z.prototype,"visuallyDisabled",2),a([l({type:Boolean,reflect:!0})],z.prototype,"clearable",2),a([l({type:Boolean,reflect:!0})],z.prototype,"open",2),a([l({type:Boolean,reflect:!0})],z.prototype,"hoist",2),a([l({type:String,reflect:!0})],z.prototype,"label",2),a([l({type:String,reflect:!0})],z.prototype,"placement",2),a([l({type:String,attribute:"help-text",reflect:!0})],z.prototype,"helpText",2),a([l({type:String,reflect:!0})],z.prototype,"form",2),a([l({type:Boolean,reflect:!0})],z.prototype,"required",2),a([l({type:String,reflect:!0})],z.prototype,"type",2),a([T()],z.prototype,"currentPlacement",2),a([l()],z.prototype,"getOption",2),a([l({type:Boolean,reflect:!0})],z.prototype,"multiple",2),a([l({type:Boolean,reflect:!0})],z.prototype,"useTags",2),a([l({type:Number,reflect:!0,attribute:"max-options-visible"})],z.prototype,"maxOptionsVisible",2),a([l({type:Boolean,reflect:!0,attribute:"style-on-valid"})],z.prototype,"styleOnValid",2),a([l()],z.prototype,"filter",2),a([l()],z.prototype,"getTag",2),a([k("filter",{waitUntilFirstUpdate:!0})],z.prototype,"handleFilterChange",1),a([k("useTags",{waitUntilFirstUpdate:!0})],z.prototype,"handleUseTagsChange",1),a([k("size",{waitUntilFirstUpdate:!0})],z.prototype,"applySizeToOptions",1),a([k(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],z.prototype,"handleDisabledChange",1),a([k("value",{waitUntilFirstUpdate:!0})],z.prototype,"handleValueChange",1),a([k("displayInputValue",{waitUntilFirstUpdate:!0})],z.prototype,"handleDisplayInputValueChange",1),a([k("open",{waitUntilFirstUpdate:!0})],z.prototype,"handleOpenChange",1),z=a([w("sd-combobox")],z);B("combobox.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});B("combobox.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});var me=class extends g{constructor(){super(...arguments);this.orientation="horizontal";this.inverted=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}render(){return u`<hr part="main" aria-orientation="${this.orientation}" class="${h(this.inverted?"border-primary-400":"border-neutral-400",this.orientation==="horizontal"?"border-t w-full":" border-l h-full")}">`}};me.styles=[...g.styles,x`:host{margin:var(--sd-spacing-0,0)}:host(sd-divider[orientation=horizontal]){display:block}:host(sd-divider[orientation=vertical]){display:inline-block}`],a([l({type:String,reflect:!0})],me.prototype,"orientation",2),a([l({type:Boolean,reflect:!0})],me.prototype,"inverted",2),me=a([w("sd-divider")],me);var $={startOfDayLocal:s=>new Date(s.getFullYear(),s.getMonth(),s.getDate()),isSameDay:(s,i)=>!s||!i?!1:s.getFullYear()===i.getFullYear()&&s.getMonth()===i.getMonth()&&s.getDate()===i.getDate(),clampDateToMonth:(s,i)=>{let t=new Date(i.getFullYear(),i.getMonth(),1),e=new Date(i.getFullYear(),i.getMonth()+1,0);return s<t?t:s>e?e:s},toLocalISODate:s=>{let i=s.getFullYear(),t=(s.getMonth()+1).toString().padStart(2,"0"),e=s.getDate().toString().padStart(2,"0");return`${i}.${t}.${e}`},parseLocalISO:s=>{if(!s)return null;let i=/^(\d{4})\.(\d{2})\.(\d{2})$/.exec(s);if(!i)return null;let t=Number(i[1]),e=Number(i[2])-1,r=Number(i[3]),o=new Date(t,e,r);return Number.isNaN(o.getTime())?null:o},compareDates:(s,i)=>{let t=$.startOfDayLocal(s).getTime(),e=$.startOfDayLocal(i).getTime();return t-e},isBetweenInclusive:(s,i,t)=>{let e=$.compareDates(i,t)<=0?i:t,r=$.compareDates(i,t)<=0?t:i;return $.compareDates(s,e)>=0&&$.compareDates(s,r)<=0}};var _=class extends g{constructor(){super();this.localize=new A(this);this.hasSlotController=new P(this,"label","help-text","tooltip");this.formControlController=new pt(this,{assumeInteractionOn:["sd-blur","sd-input"]});this.locale="en-US";this.value=null;this.range=!1;this.rangeStart=null;this.rangeEnd=null;this.allowSameDayRange=!1;this.min=void 0;this.max=void 0;this.firstDayOfWeek=null;this.disabledWeekends=!1;this.disabledDates=[];this.isDateDisabled=null;this.size="lg";this.alignment="left";this.label="";this.helpText="";this.disabled=!1;this.visuallyDisabled=!1;this.styleOnValid=!1;this.readonly=!1;this.placement="bottom";this.placeholder="";this.name="";this.form="";this.open=!1;this.today=$.startOfDayLocal(new Date);this.disabledDatesSet=new Set;this.previewEnd=null;this.statusNavText="";this.statusSelectText="";this.hasFocus=!1;this.showValidStyle=!1;this.showInvalidStyle=!1;this.currentPlacement=this.placement;this.inputValue="";this.tabbingIntoGrid=!1;this.statusBumpCounter=0;this.onFocusOut=t=>{let e=t.relatedTarget;e&&this.contains(e)||(this.open&&(this.hide(),this.emit("sd-datepicker-close")),this.hasFocus=!1)};this.onFocusIn=t=>{if(this.disabled||this.visuallyDisabled)return;t.composedPath().some(o=>{var n,d;return o instanceof HTMLElement&&(((n=o.classList)==null?void 0:n.contains("nav"))||((d=o.classList)==null?void 0:d.contains("month-label")))})&&(this.tabbingIntoGrid=!0)};this.handleInput=t=>{var d,c,p,m,f;if(this.disabled||this.visuallyDisabled){(d=t.preventDefault)==null||d.call(t),(c=t.stopPropagation)==null||c.call(t);return}let e=t.target,r=e.value,o=(p=e.selectionStart)!=null?p:r.length,n=(m=t.inputType)==null?void 0:m.startsWith("delete");if(this.range){let y=r.replace(/\D/g,""),b=y.slice(0,8),E=y.slice(8,16),L=this.buildDmyFromDigits(b),M=this.buildDmyFromDigits(E),S;b.length===0?S="":b.length<8?S=L:E.length>0?S=`${L} - ${M}`:S=n?L:`${L} -`;let O=this.countDigitsBeforeCaret(r,o),I;if(O<=8){let D=this.digitIndexToDmyCaretPos(Math.min(O,8));I=Math.min(D,L.length)}else{let D=b.length<8?L.length:L.length+3,Y=Math.min(O-8,8),X=this.digitIndexToDmyCaretPos(Y);I=D+Math.min(X,M.length)}this.inputValue=S;let F=!1;if(/^\d{2}\.\d{2}\.\d{4}$/.test(L)){let D=this.dmyToIso(L),Y=D?$.parseLocalISO(D):null;!!Y&&!this.isDisabled(Y)&&this.inMinMax(Y)&&this.rangeStart!==D&&(this.rangeStart=D,this.previewEnd=null,this.viewMonth=new Date(Y.getFullYear(),Y.getMonth(),1),this.focusedDate=$.startOfDayLocal(Y),F=!0)}else this.rangeStart&&(this.rangeStart=null,F=!0),this.rangeEnd&&(this.rangeEnd=null,F=!0);if(/^\d{2}\.\d{2}\.\d{4}$/.test(M)&&this.rangeStart){let D=$.parseLocalISO(this.rangeStart),Y=this.dmyToIso(M),X=Y?$.parseLocalISO(Y):null;if(!!X&&!this.isDisabled(X)&&this.inMinMax(X)){let[xt,st]=$.compareDates(D,X)<=0?[D,X]:[X,D],It=$.isSameDay(xt,st);if((this.allowSameDayRange||!It)&&!this.wouldRangeContainDisabled(xt,st)){let $t=$.toLocalISODate($.startOfDayLocal(xt)),ut=$.toLocalISODate($.startOfDayLocal(st));(this.rangeStart!==$t||this.rangeEnd!==ut)&&(this.rangeStart=$t,this.rangeEnd=ut,this.viewMonth=new Date(st.getFullYear(),st.getMonth(),1),this.focusedDate=$.startOfDayLocal(st),F=!0)}}}else this.rangeEnd&&(this.rangeEnd=null,F=!0);this.showInvalidStyle=!1,this.showValidStyle=!!(this.rangeStart&&this.rangeEnd),F&&(this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})),Promise.resolve().then(()=>{requestAnimationFrame(()=>{var Y;let D=(Y=this.input)!=null?Y:e;D&&(D.value=this.inputValue,D.setSelectionRange(I,I))})})}else{let y=e,b=y.value,E=(f=y.selectionStart)!=null?f:b.length,L=b.replace(/\D/g,"").slice(0,8),M=L.slice(0,2),S=L.slice(2,4),O=L.slice(4,8),I="";M.length>0&&(I+=M,M.length===2&&(I+=".")),S.length>0&&M.length===2&&(I+=S,S.length===2&&(I+=".")),O.length>0&&M.length===2&&S.length===2&&(I+=O),I=I.replace(/\.\.+/g,".");let F=this.inputValue||"";this.inputValue=I;let D=E,Y=tt=>{let $t=[];for(let ut=0;ut<tt.length;ut++)tt[ut]==="."&&$t.push(ut);return $t},X=Y(F),Et=Y(I),xt=X.filter(tt=>tt<E).length,It=Et.filter(tt=>tt<E).length-xt;if(It>0?D+=It:!X.includes(E)&&Et.includes(E)&&(D+=1),D=Math.min(Math.max(0,D),I.length),requestAnimationFrame(()=>{var $t;let tt=($t=this.input)!=null?$t:y;tt&&(tt.value=this.inputValue,tt.setSelectionRange(D,D))}),/^\d{2}\.\d{2}\.\d{4}$/.test(I)){let tt=this.parseInputText(I);this.applyParsedInput(tt)}else this.showInvalidStyle=!1,this.showValidStyle=!1;return}if(!this.open&&this.hasFocus&&!this.disabled&&!this.visuallyDisabled&&this.show(),this.range){let y=this.rangeStart?$.parseLocalISO(this.rangeStart):null,b=this.rangeEnd?$.parseLocalISO(this.rangeEnd):null;y&&!b?this.setNavStatus(`${this.termStartSelected()}: ${this.formatSelectionLabel(y)}`):y&&b&&this.setNavStatus(`${this.termStartSelected()}: ${this.formatSelectionLabel(y)}; ${this.termEndSelected()}: ${this.formatSelectionLabel(b)}`)}else if(this.value){let y=$.parseLocalISO(this.value);this.setNavStatus(`${this.formatSelectionLabel(y)}`)}};this.handleInputBlur=()=>{if(this.disabled||this.visuallyDisabled){this.handleBlur();return}let t=this.parseInputText(this.inputValue);t.valid?this.applyParsedInput(t):(this.inputValue=this.formatInputValue(),this.showInvalidStyle=!!this.inputValue&&!this.value&&!this.rangeStart),this.handleBlur()};this.handleCurrentPlacement=t=>{this.currentPlacement=t.detail.placement};this.handleHeaderKeyDown=(t,e,r,o)=>{if(t.key==="Tab"&&!t.shiftKey){o&&(t.preventDefault(),t.stopPropagation(),this.tabbingIntoGrid=!0,this.focusInitialGridDay());return}(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopPropagation(),e==="month"?this.setMonth(r):this.setYear(r))};this.onKeyDown=t=>{if(this.disabled||this.visuallyDisabled){t.preventDefault(),t.stopPropagation();return}let e=t.key,r=!0,o=new Date(this.focusedDate);switch(e){case"ArrowLeft":o.setDate(o.getDate()-1);break;case"ArrowRight":o.setDate(o.getDate()+1);break;case"ArrowUp":o.setDate(o.getDate()-7);break;case"ArrowDown":o.setDate(o.getDate()+7);break;case"Escape":{this.previewEnd?(this.previewEnd=null,this.setNavStatus(this.localize.term("selectionCleared"))):this.range&&this.rangeStart&&!this.rangeEnd&&(this.rangeStart=null,this.setNavStatus(this.localize.term("selectionCleared")),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}})),this.open&&(this.hide(),this.emit("sd-datepicker-close"));break}case"Enter":case" ":this.selectDate(this.focusedDate);break;default:r=!1}if(r){if(t.preventDefault(),o.getMonth()!==this.viewMonth.getMonth()||o.getFullYear()!==this.viewMonth.getFullYear()){this.viewMonth=new Date(o.getFullYear(),o.getMonth(),1);let p=this.formatMonthYear(this.viewMonth);this.setNavStatus(p)}let d=$.startOfDayLocal(o);(!this.focusedDate||d.getTime()!==this.focusedDate.getTime())&&(this.focusedDate=d);let c=d.toLocaleDateString(this.locale,{weekday:"long",day:"numeric",month:"long",year:"numeric"});this.setNavStatus(c),this.requestUpdate(),requestAnimationFrame(()=>{let p=this.shadowRoot,m=p==null?void 0:p.querySelector("button.day.focused");m==null||m.focus({preventScroll:!0})})}};this.handleInputKeyDown=t=>{if((this.disabled||this.visuallyDisabled)&&t.key!=="Tab"){t.preventDefault(),t.stopPropagation();return}if(!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||t.key==="End"||t.key==="PageUp"||t.key==="PageDown")){if(t.key==="Escape"&&this.open){t.preventDefault(),this.hide(),this.emit("sd-datepicker-close");return}t.key==="Enter"&&!this.open&&!this.disabled&&!this.visuallyDisabled&&(t.preventDefault(),this.show())}};this.handleOutsideClick=this.handleOutsideClick.bind(this)}connectedCallback(){super.connectedCallback(),this.syncDisabledDatesSet(),document.addEventListener("click",this.handleOutsideClick),this.addEventListener("focusout",this.onFocusOut),this.updateComplete.then(()=>{this.formControlController.updateValidity()});let t=this.value?$.parseLocalISO(this.value):null,e=this.rangeStart?$.parseLocalISO(this.rangeStart):null,r=this.range&&e?e:t!=null?t:$.startOfDayLocal(new Date);this.viewMonth=new Date(r.getFullYear(),r.getMonth(),1),this.focusedDate=$.clampDateToMonth(r,this.viewMonth),(this.firstDayOfWeek===null||this.firstDayOfWeek===void 0)&&(this.firstDayOfWeek=1),this.inputValue=this.formatInputValue(),this.setAttribute("role","group"),this.setAttribute("aria-label",this.range?this.localize.term("datePickerRange"):this.localize.term("datePicker")),this.addEventListener("focusin",this.onFocusIn)}firstUpdated(){this.formControlController.updateValidity()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut),document.removeEventListener("click",this.handleOutsideClick)}handleLocaleChange(){this.firstDayOfWeek===null&&(this.firstDayOfWeek=1),this.requestUpdate()}handleDisabledDatesChange(){this.syncDisabledDatesSet(),this.requestUpdate()}handleValueChange(){let t=this.value?$.parseLocalISO(this.value):null;t&&(this.viewMonth=new Date(t.getFullYear(),t.getMonth(),1),this.focusedDate=$.startOfDayLocal(t)),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var r;let e=this.input;if(e){e.value=(r=this.inputValue)!=null?r:"";let o=e.value.length;e.setSelectionRange(o,o)}this.formControlController.updateValidity()}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})}handleRangeChange(){let t=this.rangeStart?$.parseLocalISO(this.rangeStart):null,e=this.rangeEnd?$.parseLocalISO(this.rangeEnd):null,r=t!=null?t:e;r&&(this.viewMonth=new Date(r.getFullYear(),r.getMonth(),1),this.focusedDate=$.startOfDayLocal(r)),this.previewEnd!==null&&(this.previewEnd=null),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var n;let o=this.input;if(o){o.value=(n=this.inputValue)!=null?n:"";let d=o.value.length;o.setSelectionRange(d,d)}this.formControlController.updateValidity()}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})}handleDisabledChange(){this.formControlController.setValidity(this.disabled),(this.disabled||this.visuallyDisabled)&&(this.open=!1)}get validity(){let t={valid:!0};return this.input instanceof HTMLInputElement?this.input.validity:t}get validationMessage(){return(this.input instanceof HTMLInputElement?this.input.validationMessage:"")||""}checkValidity(){return this.input instanceof HTMLInputElement?this.input.checkValidity():!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input instanceof HTMLInputElement?this.input.reportValidity():!0}setCustomValidity(t){var e;(e=this.input)==null||e.setCustomValidity(t),this.formControlController.updateValidity()}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}parseISO(t){return $.parseLocalISO(t)}inMinMax(t){let e=this.parseISO(this.min!==null?String(this.min):null),r=this.parseISO(this.max!==null?String(this.max):null);return!(e&&t<e||r&&t>r)}isInDisabledDates(t){if(!this.disabledDatesSet||this.disabledDatesSet.size===0)return!1;let e=$.toLocalISODate($.startOfDayLocal(t));return this.disabledDatesSet.has(e)}isWeekend(t){let e=t.getDay();return e===0||e===6}isDisabled(t){var e;return!!(!this.inMinMax(t)||this.disabledWeekends&&this.isWeekend(t)||this.isInDisabledDates(t)||(e=this.isDateDisabled)!=null&&e.call(this,t))}setNavStatus(t){this.statusNavText=t}announceSelect(t,e=40){setTimeout(()=>{this.statusBumpCounter++;let r="\u200B".repeat(this.statusBumpCounter%3);this.statusSelectText=t+r},e)}formatSelectionLabel(t){if(this.locale==="de-DE")return t.toLocaleDateString("de-DE",{day:"numeric",month:"long",year:"numeric"});let e=t.getDate(),r=this.ordinal(e),o=t.toLocaleDateString("en-US",{month:"long"}),n=t.getFullYear();return`${r} of ${o} ${n}`}ordinal(t){let e=["th","st","nd","rd"],r=t%100,o=e[(r-20)%10]||e[r]||e[0];return t+o}syncDisabledDatesSet(){let t=[];if(Array.isArray(this.disabledDates))t=this.disabledDates;else if(typeof this.disabledDates=="string"){let e=this.disabledDates.trim();if(e.startsWith("["))try{let r=JSON.parse(e);Array.isArray(r)&&(t=r)}catch(r){t=[]}else e.length>0&&(t=e.split(",").map(r=>r.trim()).filter(Boolean))}this.disabledDatesSet=new Set(t)}wouldRangeContainDisabled(t,e){let r=$.compareDates(t,e)<=0?$.startOfDayLocal(t):$.startOfDayLocal(e),o=$.compareDates(t,e)<=0?$.startOfDayLocal(e):$.startOfDayLocal(t),n=new Date(r);for(;$.compareDates(n,o)<=0;){if(this.isDisabled(n))return!0;n.setDate(n.getDate()+1)}return!1}termStartSelected(){var t,e;return(e=(t=this.localize)==null?void 0:t.term)==null?void 0:e.call(t,"startDateSelected")}termEndSelected(){var t,e;return(e=(t=this.localize)==null?void 0:t.term)==null?void 0:e.call(t,"endDateSelected")}isoToDmy(t){if(!t)return"";let e=$.parseLocalISO(t);if(!e)return"";let r=String(e.getDate()).padStart(2,"0"),o=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getFullYear());return`${r}.${o}.${n}`}dmyToIso(t){if(!t)return null;let e=t.match(/^(\d{2})\.(\d{2})\.(\d{4})$/);if(!e)return null;let r=Number(e[1]),o=Number(e[2]),n=Number(e[3]),d=new Date(n,o-1,r);if(d.getFullYear()!==n||d.getMonth()!==o-1||d.getDate()!==r)return null;let c=$.startOfDayLocal(d);return $.toLocalISODate(c)}formatInputValue(){let t=(this.locale||"").toLowerCase(),e=(this.getAttribute("lang")||"").toLowerCase(),o=t.startsWith("de")||e.startsWith("de")?"\u2013":"-";if(!this.range)return this.isoToDmy(this.value);let n=this.isoToDmy(this.rangeStart),d=this.isoToDmy(this.rangeEnd);return n&&d?`${n} ${o} ${d}`:n&&!d?`${n} ${o}`:""}parseInputText(t){var o,n;let e=t.trim();if(this.range){let d=e.split(/\s*-\s*/);if(d.length===1){let c=d[0];if(!c)return{start:null,end:null,valid:!0};let p=this.dmyToIso(c);return p?{start:p,end:null,valid:!0}:{start:null,end:null,valid:!1}}else if(d.length>=2){let c=(o=d[0])!=null?o:"",p=(n=d[1])!=null?n:"",m=c?this.dmyToIso(c):null,f=p?this.dmyToIso(p):null;return c&&!m?{start:null,end:null,valid:!1}:p&&!f?{start:null,end:null,valid:!1}:{start:m,end:f,valid:!0}}return{start:null,end:null,valid:!1}}if(!e)return{single:null,valid:!0};let r=this.dmyToIso(e);return r?{single:r,valid:!0}:{single:null,valid:!1}}applyParsedInput(t){var c,p,m,f;if(!t.valid)return this.showInvalidStyle=!0,this.showValidStyle=!1,this.formControlController.setValidity(!1),!1;let e=y=>{if(!y)return!0;let b=$.parseLocalISO(y);return!(!this.inMinMax(b)||this.isDisabled(b))},r=!1;if(this.range){let y=(c=t.start)!=null?c:null,b=(p=t.end)!=null?p:null;if(!e(y)||b&&!e(b))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1;let E=y?$.parseLocalISO(y):null,L=b?$.parseLocalISO(b):null;if(E&&L){if($.compareDates(E,L)>0){let O=E;E=L,L=O}if(!this.allowSameDayRange&&$.isSameDay(E,L))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1;if(this.wouldRangeContainDisabled(E,L))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1}let M=E?$.toLocalISODate($.startOfDayLocal(E)):null,S=L?$.toLocalISODate($.startOfDayLocal(L)):null;if(this.rangeStart!==M||this.rangeEnd!==S){this.rangeStart=M,this.rangeEnd=S,this.previewEnd=null,r=!0;let O=(m=E!=null?E:L)!=null?m:this.today;this.viewMonth=new Date(O.getFullYear(),O.getMonth(),1),this.focusedDate=$.startOfDayLocal(O),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}})}return this.showInvalidStyle=!1,this.range?this.showValidStyle=!!(this.rangeStart&&this.rangeEnd&&this.styleOnValid):this.showValidStyle=!!(this.value&&this.styleOnValid),this.formControlController.setValidity(!0),this.updateComplete.then(()=>{this.formControlController.updateValidity()}),!0}let o=(f=t.single)!=null?f:null;if(!e(o))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1;let n=o?$.parseLocalISO(o):null,d=n?$.toLocalISODate($.startOfDayLocal(n)):null;return this.value!==d&&(this.value=d,r=!0,n&&(this.viewMonth=new Date(n.getFullYear(),n.getMonth(),1),this.focusedDate=$.startOfDayLocal(n)),this.emit("sd-select",{detail:{value:this.value,date:n!=null?n:null}})),this.showInvalidStyle=!1,this.showValidStyle=!!this.value,this.inputValue=this.formatInputValue(),r}buildDmyFromDigits(t){let e=t.slice(0,8),r=e.slice(0,2),o=e.slice(2,4),n=e.slice(4,8),d=r;return o.length&&(d+="."+o),n.length&&(d+="."+n),d}digitIndexToDmyCaretPos(t){return t<=2?t:t<=4?3+(t-2):6+(t-4)}countDigitsBeforeCaret(t,e){return t.slice(0,e).replace(/\D/g,"").length}handleOutsideClick(t){var r,o;((o=(r=t.composedPath)==null?void 0:r.call(t))!=null?o:[]).includes(this)||(this.hide(),this.hasFocus=!1,this.emit("sd-datepicker-close"))}show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}this.open=!0}hide(){if(!this.open||this.disabled){this.open=!1;return}this.open=!1}handleMouseDown(t){if(this.visuallyDisabled||this.disabled){t.preventDefault(),t.stopPropagation();return}t.preventDefault(),this.open||this.show()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleFocus(){this.hasFocus=!0,!this.open&&!this.disabled&&!this.visuallyDisabled&&this.show(),this.emit("sd-focus")}setMonth(t){let e=new Date(this.viewMonth.getFullYear(),this.viewMonth.getMonth()+t,1);if(e.getMonth()===this.viewMonth.getMonth()&&e.getFullYear()===this.viewMonth.getFullYear())return;this.viewMonth=e;let r=this.formatMonthYear(this.viewMonth);this.setNavStatus(r),this.emit("sd-month-change",{detail:{month:this.viewMonth}})}setYear(t){let e=new Date(this.viewMonth.getFullYear()+t,this.viewMonth.getMonth(),1);if(e.getFullYear()===this.viewMonth.getFullYear()&&e.getMonth()===this.viewMonth.getMonth())return;this.viewMonth=e;let r=this.formatMonthYear(this.viewMonth);this.setNavStatus(r),this.emit("sd-month-year",{detail:{month:this.viewMonth}})}focusInitialGridDay(){let t=null;if(!this.range&&this.value){let r=$.parseLocalISO(this.value);r&&(t=$.startOfDayLocal(r))}if(this.range){let r=this.rangeStart?$.parseLocalISO(this.rangeStart):null,o=this.rangeEnd?$.parseLocalISO(this.rangeEnd):null;o?t=$.startOfDayLocal(o):r&&(t=$.startOfDayLocal(r))}if(!(r=>r?r.getFullYear()===this.viewMonth.getFullYear()&&r.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(r):!1)(t)){let{weeks:r}=this.getMonthMatrix(this.viewMonth),o=r.flat().find(n=>n.getMonth()===this.viewMonth.getMonth()&&$.isSameDay(n,this.today)&&!this.isDisabled(n));if(o)t=$.startOfDayLocal(o);else{let n=r.flat().find(d=>d.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(d));t=n?$.startOfDayLocal(n):null}}t&&(this.focusedDate=t),this.requestUpdate(),requestAnimationFrame(()=>{let r=this.shadowRoot,o=(r==null?void 0:r.querySelector("button.day.selected"))||(r==null?void 0:r.querySelector("button.day.focused"))||(r==null?void 0:r.querySelector('button.day[tabindex="0"]'))||(r==null?void 0:r.querySelector("button.day"));o==null||o.focus({preventScroll:!0})})}selectSingleDate(t){if(this.isDisabled(t))return;let e=$.startOfDayLocal(t),r=$.toLocalISODate(e);if(this.value===r)return;this.value=r;let o=`${this.formatSelectionLabel(e)}, ${this.localize.term("selected")}`;this.announceSelect(o),this.emit("sd-select",{detail:{value:this.value,date:e}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var d;let n=this.input;n&&(n.value=(d=this.inputValue)!=null?d:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let c=n.value.length;n.setSelectionRange(c,c)})}))})}selectRangeDate(t){let e=$.startOfDayLocal(t),r=this.rangeStart?$.parseLocalISO(this.rangeStart):null,o=this.rangeEnd?$.parseLocalISO(this.rangeEnd):null;if(!r&&!o){if(this.isDisabled(e))return;this.rangeStart=$.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let n=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${n}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var c;let d=this.input;d&&(d.value=(c=this.inputValue)!=null?c:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let p=d.value.length;d.setSelectionRange(p,p)})}))});return}if(r&&!o){if(this.isDisabled(e))return;if($.isSameDay(r,e)){if(!this.allowSameDayRange){this.rangeStart=$.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let y=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${y}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var E;let b=this.input;b&&(b.value=(E=this.inputValue)!=null?E:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let L=b.value.length;b.setSelectionRange(L,L)})}))});return}this.rangeStart=$.toLocalISODate(e),this.rangeEnd=$.toLocalISODate(e),this.previewEnd=null;let f=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${f}`,40),this.announceSelect(`${this.termEndSelected()}: ${f}`,140),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var b;let y=this.input;y&&(y.value=(b=this.inputValue)!=null?b:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let E=y.value.length;y.setSelectionRange(E,E)})}))});return}let n=$.parseLocalISO(this.rangeStart);if(this.wouldRangeContainDisabled(n,e))return;let[d,c]=$.compareDates(n,e)<=0?[n,e]:[e,n];this.rangeStart=$.toLocalISODate(d),this.rangeEnd=$.toLocalISODate(c),this.previewEnd=null;let p=this.formatSelectionLabel(d),m=this.formatSelectionLabel(c);this.announceSelect(`${this.termStartSelected()}: ${p}`,40),this.announceSelect(`${this.termEndSelected()}: ${m}`,140),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var y;let f=this.input;f&&(f.value=(y=this.inputValue)!=null?y:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let b=f.value.length;f.setSelectionRange(b,b)})}))});return}if(r&&o){if(this.isDisabled(e))return;this.rangeStart=$.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let n=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${n}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var c;let d=this.input;d&&(d.value=(c=this.inputValue)!=null?c:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let p=d.value.length;d.setSelectionRange(p,p)})}))})}}selectDate(t){this.range?this.selectRangeDate(t):this.selectSingleDate(t)}getMonthMatrix(t){var m;let e=(m=this.firstDayOfWeek)!=null?m:1,r=new Date(t.getFullYear(),t.getMonth(),1),o=new Date(r),n=(r.getDay()-e+7)%7;o.setDate(r.getDate()-n);let d=[],c=o;for(let f=0;f<6;f++){let y=[];for(let b=0;b<7;b++)y.push(new Date(c)),c.setDate(c.getDate()+1);d.push(y)}let p=f=>f.every(y=>y.getMonth()!==t.getMonth());for(;d.length>0&&p(d[d.length-1]);)d.pop();return{weeks:d}}formatMonthYear(t){try{return new Intl.DateTimeFormat(this.locale,{month:"long",year:"numeric"}).format(t)}catch(e){return`${t.toLocaleString(void 0,{month:"long"})} ${t.getFullYear()}`}}weekdayLabels(){var o;let t=(o=this.firstDayOfWeek)!=null?o:1,e=new Date(2021,7,1),r=[];for(let n=0;n<7;n++){let d=new Date(e);d.setDate(e.getDate()+(t+n)%7);try{r.push(new Intl.DateTimeFormat(this.locale,{weekday:"short"}).format(d))}catch(c){r.push(d.toLocaleDateString(void 0,{weekday:"short"}))}}return r}getTabTargetDayForCurrentView(t){let e=t.flat().find(o=>o.getMonth()===this.viewMonth.getMonth()&&$.isSameDay(o,this.today)&&!this.isDisabled(o));if(e)return $.startOfDayLocal(e);let r=t.flat().find(o=>o.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(o));return r?$.startOfDayLocal(r):null}onDayMouseEnter(t){if(!this.range)return;let e=this.rangeStart?$.parseLocalISO(this.rangeStart):null,r=this.rangeEnd?$.parseLocalISO(this.rangeEnd):null;if(e&&!r){let o=$.startOfDayLocal(t);this.previewEnd=this.isDisabled(o)?null:o,this.requestUpdate()}}onGridMouseLeave(){this.previewEnd!==null&&(this.previewEnd=null,this.requestUpdate())}renderCalendar(){let{weeks:t}=this.getMonthMatrix(this.viewMonth),e=this.formatMonthYear(this.viewMonth),r=this.weekdayLabels(),o=this.value?this.parseISO(this.value):null,n=this.rangeStart?this.parseISO(this.rangeStart):null,d=this.rangeEnd?this.parseISO(this.rangeEnd):null,c=this.previewEnd,p=f=>!this.range||!n||d||!c?!1:$.isBetweenInclusive(f,n,c),m=this.getTabTargetDayForCurrentView(t);return u`<div part="datepicker" class="w-[284px] z-50 absolute top-full bg-white border-2 border-t-0 border-primary py-3 px-4 ${this.open?"block rounded-bl-default rounded-br-default":"hidden"} ${this.alignment==="left"?"left-0":"right-0"}"><div class="flex flex-row items-center w-full justify-between mb-3" part="header"><div class="flex items-center"><button type="button" tabindex="0" class="nav prev w-6 h-6 hover:cursor-pointer sd-interactive" part="prev-year-button" @click="${()=>this.setYear(-1)}" @keydown="${f=>this.handleHeaderKeyDown(f,"year",-1,!1)}" aria-label="${this.localize.term("previousYear")}"><sd-icon library="_internal" name="chevrons-sm-left" class="h-6 w-6"></sd-icon></button> <button type="button" tabindex="0" class="nav prev w-6 h-6 hover:cursor-pointer sd-interactive" part="prev-month-button" @click="${()=>this.setMonth(-1)}" @keydown="${f=>this.handleHeaderKeyDown(f,"month",-1,!1)}" aria-label="${this.localize.term("previousMonth")}"><sd-icon library="_internal" name="chevron-sm-left" class="h-6 w-6"></sd-icon></button></div><div tabindex="-1" class="month-label flex justify-center sd-headline sd-headline--size-base !text-primary" part="month-label" aria-live="polite">${e}</div><div class="flex items-center"><button type="button" tabindex="0" class="nav next w-6 h-6 hover:cursor-pointer sd-interactive" part="next-month-button" @click="${()=>this.setMonth(1)}" @keydown="${f=>this.handleHeaderKeyDown(f,"month",1,!1)}" aria-label="${this.localize.term("nextMonth")}"><sd-icon library="_internal" name="chevron-sm-right" class="h-6 w-6"></sd-icon></button> <button type="button" tabindex="0" class="nav next w-6 h-6 hover:cursor-pointer sd-interactive" part="next-year-button" @click="${()=>this.setYear(1)}" @keydown="${f=>this.handleHeaderKeyDown(f,"year",1,!0)}" aria-label="${this.localize.term("nextYear")}"><sd-icon library="_internal" name="chevrons-sm-right" class="h-6 w-6"></sd-icon></button></div></div><sd-divider></sd-divider><div class="sr-only" aria-live="polite" aria-atomic="true">${this.statusNavText}</div><div class="sr-only" aria-live="assertive" aria-atomic="true">${this.statusSelectText}</div><div class="sr-only" id="keyboard-hint">${this.localize.term("datePickerInfo")}</div><div class="grid mt-2" role="grid" aria-describedby="keyboard-hint" aria-label="${e}" part="grid" @mouseleave="${this.onGridMouseLeave}" @focusin="${()=>{this.tabbingIntoGrid=!1}}"><div class="grid-row grid-head grid grid-cols-7 gap-y-[1px]" role="row">${r.map((f,y)=>u`<div role="columnheader" aria-colindex="${y+1}" part="weekday" class="cell head flex items-center justify-center font-bold text-black text-sm leading-none h-8" aria-label="${f}" title="${f}" id="${"col-"+(y+1)}">${f}</div>`)}</div>${t.map((f,y)=>u`<div class="grid-row grid grid-cols-7 ${y===0?"mt-2":""}" role="row" aria-rowindex="${y+2}">${f.map((b,E)=>{let L=b.getMonth()===this.viewMonth.getMonth(),M=this.isDisabled(b),S=$.isSameDay(b,this.focusedDate),O=$.isSameDay(b,this.today),I=!this.range&&o?$.isSameDay(b,o):!1,F=this.range&&n?$.isSameDay(b,n):!1,D=this.range&&d?$.isSameDay(b,d):!1,Y=this.range&&n&&d?$.isBetweenInclusive(b,n,d):!1,X=p(b)&&!M,Et=-1,xt=m&&$.isSameDay(b,m);(this.tabbingIntoGrid&&xt||!this.tabbingIntoGrid&&S)&&(Et=0);let st=this.isWeekend(b),It=b.toLocaleDateString(this.locale,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),tt=F?this.localize.term("startDateSelected"):D?this.localize.term("endDateSelected"):void 0;return u`<button type="button" part="day" class="${h("cell day flex items-center justify-center focus-visible:outline focus:outline-2 focus:outline-primary -outline-offset-2 rounded-md w-[36px]",this.size==="sm"?"text-sm h-6":"text-base h-8",F||D?"hover:bg-primary-500":"hover:bg-primary-100 hover:text-primary-500",L?this.isInDisabledDates(b)?"out-month text-neutral-500":this.disabledWeekends&&st?"weekend-day text-neutral-500":"in-month text-primary":this.disabledWeekends&&st?"out-month weekend-day text-neutral-500":st?"out-month weekend-day text-neutral-700":"out-month text-neutral-700",I?"selected border-primary bg-primary text-white hover:bg-primary-500 hover:text-white":"",F?"bg-primary text-white rounded-l-md rounded-r-none":"",D?"bg-primary text-white range-end rounded-r-md rounded-l-none":"",Y&&!F&&!D?"in-range selected bg-primary-100 text-primary-500 rounded-none hover:bg-primary-500 hover:text-white":"",!Y&&X&&!F&&!D?"in-preview-range bg-primary-100 text-primary-500 rounded-none":"",O&&!I&&!F&&!D&&S?"today border-[1px] border-primary font-bold":"",M?"disabled cursor-not-allowed hover:bg-transparent":"",S&&!O?"focused outline outline-2 outline-primary":"")}" role="gridcell" aria-colindex="${E+1}" aria-labelledby="${"col-"+(E+1)}" .tabIndex="${Et}" ?disabled="${M||this.disabled}" aria-disabled="${M||this.visuallyDisabled||this.disabled?"true":"false"}" aria-selected="${I||Y||F||D?"true":"false"}" aria-current="${O?"date":j}" aria-label="${It}" aria-roledescription="${tt!=null?tt:j}" @focus="${()=>this.focusedDate=$.startOfDayLocal(b)}" @mouseenter="${()=>this.onDayMouseEnter(b)}" @keydown="${this.onKeyDown}" @click="${()=>{this.focusedDate=$.startOfDayLocal(b),this.selectDate(b)}}">${b.getDate()}</button>`})}</div>`)}</div></div>`}render(){let t={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},e=this.label?!0:!!t.label,r=this.helpText?!0:!!t.helpText,o=!!t.tooltip,n=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",d={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],c={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size],p=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",m={disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[p],f=this.size==="sm"?"text-sm":"text-base";return u`<div part="form-control" class="${h("min-w-[284px]",this.open&&"z-50",(this.disabled||this.visuallyDisabled)&&"cursor-not-allowed")}">${e||o?u`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${h(e?"inline-block":"hidden",f)}" for="input" aria-hidden="${e?"false":"true"}"><slot name="label">${this.label}</slot></label> ${t.tooltip?u`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${h("relative w-full",this.disabled&&"pointer-events-none",this.visuallyDisabled&&"cursor-not-allowed")}"><div part="border" class="${h("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",m,this.open&&this.alignment==="left"?"rounded-bl-none":"",this.open&&this.alignment==="right"?"rounded-br-none":"")}"></div><sd-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${h("inline-flex relative w-full")}" sync="width" auto-size="vertical" auto-size-padding="10" exportparts="popup:popup__content,"><div part="base" class="${h("px-4 flex flex-row items-center rounded-default transition-colors ease-in-out duration-medium hover:duration-fast w-full",!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",p==="disabled"||p==="visuallyDisabled"?"text-neutral-500":"text-black")}" slot="anchor"><input id="input" type="text" role="combobox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="dialog" aria-controls="calendar-grid" aria-describedby="${r?"help-text":void 0}" aria-invalid="${this.showInvalidStyle?"true":"false"}" aria-label="${this.range?"Select date range":"Select a date"}" class="${h("min-w-0 flex-grow focus:outline-none bg-transparent hover:cursor-pointer",this.visuallyDisabled||this.disabled?"placeholder:text-neutral-500 cursor-not-allowed":"placeholder:text-neutral-700",{sm:"h-8",md:"h-10",lg:"h-12"}[this.size],f)}" autocomplete="off" spellcheck="false" placeholder="${this.placeholder||this.localize.term(this.range?"dateRangePlaceholder":"datePlaceholder")}" ?disabled="${this.disabled}" ?readonly="${this.readonly||this.visuallyDisabled}" @input="${this.handleInput}" @click="${this.handleMouseDown}" @keydown="${this.handleInputKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleInputBlur}" @invalid="${this.handleInvalid}"> ${this.showInvalidStyle?u`<sd-icon part="invalid-icon" class="${h("text-error",d,c)}" library="_internal" name="risk"></sd-icon>`:""} ${this.showValidStyle&&this.styleOnValid?u`<sd-icon class="${h("text-success flex-shrink-0",d,c)}" library="_internal" name="confirm-circle" part="valid-icon"></sd-icon>`:""}<sd-icon class="${h(n,d,c,"hover:cursor-pointer")}" library="_internal" name="calendar" @click="${this.show}"></sd-icon>${this.renderCalendar()}</div></sd-popup></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${h("text-sm text-neutral-700 mt-1",r?"block":"hidden")}" aria-hidden="${!r}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};_.styles=[...g.styles,x`:host{display:inline-block;outline:2px solid transparent;outline-offset:2px;position:relative;width:100%}:host([required]) #label:after{content:" *"}:host([visually-disabled]) input{caret-color:transparent}`],a([l({type:String,reflect:!0})],_.prototype,"locale",2),a([l({type:String})],_.prototype,"value",2),a([l({type:Boolean,reflect:!0})],_.prototype,"range",2),a([l({type:String})],_.prototype,"rangeStart",2),a([l({type:String})],_.prototype,"rangeEnd",2),a([l({type:Boolean})],_.prototype,"allowSameDayRange",2),a([l({type:String})],_.prototype,"min",2),a([l({type:String})],_.prototype,"max",2),a([l({type:Number})],_.prototype,"firstDayOfWeek",2),a([l({type:Boolean,reflect:!0,attribute:"disabled-weekends"})],_.prototype,"disabledWeekends",2),a([l({attribute:"disabled-dates"})],_.prototype,"disabledDates",2),a([l({attribute:!1})],_.prototype,"isDateDisabled",2),a([l({type:String,reflect:!0})],_.prototype,"size",2),a([l({type:String})],_.prototype,"alignment",2),a([l({type:String,reflect:!0})],_.prototype,"label",2),a([l({type:String,attribute:"help-text",reflect:!0})],_.prototype,"helpText",2),a([l({type:Boolean,reflect:!0})],_.prototype,"disabled",2),a([l({type:Boolean,attribute:"visually-disabled"})],_.prototype,"visuallyDisabled",2),a([l({type:Boolean,reflect:!0,attribute:"style-on-valid"})],_.prototype,"styleOnValid",2),a([l({type:Boolean,reflect:!0})],_.prototype,"readonly",2),a([l({type:String,reflect:!0})],_.prototype,"placement",2),a([l({type:String,reflect:!0})],_.prototype,"placeholder",2),a([l({reflect:!0})],_.prototype,"name",2),a([l({type:String,reflect:!0})],_.prototype,"form",2),a([T()],_.prototype,"open",2),a([T()],_.prototype,"viewMonth",2),a([T()],_.prototype,"focusedDate",2),a([T()],_.prototype,"today",2),a([T()],_.prototype,"disabledDatesSet",2),a([T()],_.prototype,"previewEnd",2),a([T()],_.prototype,"statusNavText",2),a([T()],_.prototype,"statusSelectText",2),a([T()],_.prototype,"hasFocus",2),a([T()],_.prototype,"showValidStyle",2),a([T()],_.prototype,"showInvalidStyle",2),a([T()],_.prototype,"currentPlacement",2),a([T()],_.prototype,"inputValue",2),a([v("#invalid-message")],_.prototype,"invalidMessage",2),a([v("#input")],_.prototype,"input",2),a([k("locale")],_.prototype,"handleLocaleChange",1),a([k("disabledDates")],_.prototype,"handleDisabledDatesChange",1),a([k("value")],_.prototype,"handleValueChange",1),a([k("rangeStart"),k("rangeEnd")],_.prototype,"handleRangeChange",1),a([k(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],_.prototype,"handleDisabledChange",1),_=a([w("sd-datepicker")],_);var Ht=class extends g{constructor(){super(...arguments);this.hasSlotController=new P(this,"footer");this.localize=new A(this);this.open=!1;this.headline="";this.noCloseButton=!1}connectedCallback(){super.connectedCallback(),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.modal=new Ze(this)}firstUpdated(){this.dialog.hidden=!this.open,this.open&&(this.addOpenListeners(),this.modal.activate(),We(this))}disconnectedCallback(){super.disconnectedCallback(),Xe(this)}get prefersReducedMotion(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}requestClose(t){if(this.emit("sd-request-close",{cancelable:!0,detail:{source:t}}).defaultPrevented){let r=q(this,"dialog.denyClose",{dir:this.localize.dir()});K(this.panel,r.keyframes,r.options);return}this.hide()}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}handleDocumentKeyDown(t){this.open&&t.key==="Escape"&&(t.stopPropagation(),this.requestClose("keyboard"))}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.addOpenListeners(),this.originalTrigger=je(),this.modal.activate(),We(this);let t=this.querySelector("[autofocus]");t&&t.removeAttribute("autofocus"),await Promise.all([W(this.dialog),W(this.overlay)]),this.dialog.hidden=!1,requestAnimationFrame(()=>{this.emit("sd-initial-focus",{cancelable:!0}).defaultPrevented||(t?t.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),t&&t.setAttribute("autofocus","")});let e=this.prefersReducedMotion?q(this,"dialog.showReducedMotion",{dir:this.localize.dir()}):q(this,"dialog.show",{dir:this.localize.dir()}),r=q(this,"dialog.overlay.show",{dir:this.localize.dir()});await Promise.all([K(this.panel,e.keyframes,e.options),K(this.overlay,r.keyframes,r.options)]),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),this.modal.deactivate(),await Promise.all([W(this.dialog),W(this.overlay)]);let t=this.prefersReducedMotion?q(this,"dialog.hideReducedMotion",{dir:this.localize.dir()}):q(this,"dialog.hide",{dir:this.localize.dir()}),e=q(this,"dialog.overlay.hide",{dir:this.localize.dir()});await Promise.all([K(this.overlay,e.keyframes,e.options).then(()=>{this.overlay.hidden=!0}),K(this.panel,t.keyframes,t.options).then(()=>{this.panel.hidden=!0})]),this.dialog.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1,Xe(this);let r=this.originalTrigger;typeof(r==null?void 0:r.focus)=="function"&&r.isConnected&&setTimeout(()=>{try{r.focus({preventScroll:!0})}catch(o){r.focus()}this.originalTrigger=null}),this.emit("sd-after-hide")}}async show(){if(!this.open)return this.open=!0,J(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,J(this,"sd-after-hide")}render(){return u`<div part="base" class="${h("flex items-center justify-center fixed inset-0 z-dialog",this.hasSlotController.test("footer")&&"dialog--has-footer")}"><div part="overlay" class="fixed inset-0 bg-primary-800 opacity-90" @click="${()=>this.requestClose("overlay")}" tabindex="-1"></div><div part="panel" class="${h("flex flex-col z-20 bg-white py-4 sm:py-8 relative gap-6 focus-visible:focus-outline-inverted overflow-y-auto",this.open&&"flex opacity-100")}" role="dialog" aria-modal="true" aria-hidden="${this.open?"false":"true"}" aria-label="${C(this.headline?this.headline:void 0)}" aria-labelledby="${C(this.headline?void 0:"title")}" tabindex="0"><header part="header" class="flex flex-grow-0 flex-shrink-0 basis-auto px-6 sm:px-10"><h2 part="title" class="flex-auto m-0" id="title">${this.headline.length>0?u`<span class="sd-headline sd-headline--size-3xl leading-tight">${this.headline}</span>`:u`<slot name="headline"></slot>`}</h2>${this.noCloseButton?"":u`<sd-button part="close-button" variant="tertiary" exportparts="base:close-button__base" class="${h("absolute top-2 right-2")}" name="x-lg" @click="${()=>this.requestClose("close-button")}" type="button"><sd-icon label="${this.localize.term("close")}" name="close" library="_internal" color="currentColor"></sd-icon></sd-button>`}</header><main part="body" class="flex flex-auto overflow-auto w-full px-6 sm:px-10"><slot></slot></main><footer part="footer" class="flex flex-grow-0 flex-shrink-0 basis-auto ml-auto gap-4 px-6 sm:px-10"><slot name="footer"></slot></footer></div></div>`}};Ht.styles=[...g.styles,x`:host{--width:662px}[part=panel]{max-height:80vh;width:var(--width)}[part=body]{-webkit-overflow-scrolling:touch}@media (max-width:414px){:host{--width:335px}[part=body]{min-height:50px}[part=footer]{width:100%}}`],a([v('[part="base"]')],Ht.prototype,"dialog",2),a([v('[part="panel"]')],Ht.prototype,"panel",2),a([v('[part="overlay"]')],Ht.prototype,"overlay",2),a([l({type:Boolean,reflect:!0})],Ht.prototype,"open",2),a([l({type:String,reflect:!0})],Ht.prototype,"headline",2),a([l({attribute:"no-close-button",type:Boolean,reflect:!0})],Ht.prototype,"noCloseButton",2),a([k("open",{waitUntilFirstUpdate:!0})],Ht.prototype,"handleOpenChange",1),Ht=a([w("sd-dialog")],Ht);B("dialog.show",{keyframes:[{opacity:0,transform:"translate(-50%, 100%)"},{opacity:1,transform:"translate(0, 0)"}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});B("dialog.showReducedMotion",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out",reducedMotion:"allow"}});B("dialog.hide",{keyframes:[{opacity:1,transform:"translate(0, 0)"},{opacity:0,transform:"translate(50%, -100%)"}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});B("dialog.hideReducedMotion",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out",reducedMotion:"allow"}});B("dialog.denyClose",{keyframes:[{scale:1},{scale:1.02},{scale:1}],options:{duration:250}});B("dialog.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out",reducedMotion:"allow"}});B("dialog.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out",reducedMotion:"allow"}});function Ra(s,i){let t=s;for(;t;){if(t.matches(i))return t;if(t.parentElement)t=t.parentElement;else if(t.parentNode instanceof ShadowRoot)t=t.parentNode.host;else break}return null}var dt=class extends g{constructor(){super(...arguments);this.localize=new A(this);this.open=!1;this.rounded=!1;this.placement="bottom-start";this.disabled=!1;this.stayOpenOnSelect=!1;this.distance=0;this.skidding=0;this.noAutoSize=!1;this.noFlip=!1;this.hoist=!1}connectedCallback(){super.connectedCallback(),this.handleMenuItemActivate=this.handleMenuItemActivate.bind(this),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this)}firstUpdated(){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide()}getAccessibleTrigger(){let e=this.trigger.assignedElements({flatten:!0}).find(o=>ar(o).start),r=null;if(e)switch(e.tagName.toLowerCase()){case"sd-button":case"sd-icon-button":r=e.button;break;case"sd-navigation-item":r=e.button;break;default:r=e}return r}updateAccessibleTrigger(){let t=this.getAccessibleTrigger();t&&(t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false"))}focusOnTrigger(){let t=this.getAccessibleTrigger();typeof(t==null?void 0:t.focus)=="function"&&t.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find(t=>t.tagName.toLowerCase()==="sd-menu")}handleKeyDown(t){this.open&&t.key==="Escape"&&(t.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(t){var e;if(t.key==="Tab"){if(this.open&&((e=document.activeElement)==null?void 0:e.tagName.toLowerCase())==="sd-menu-item"){t.preventDefault(),this.hide(),this.focusOnTrigger();return}setTimeout(()=>{let r=je();(!r||!this.containingElement||Ra(r,this.containingElement.tagName.toLowerCase())!==this.containingElement)&&this.hide()})}}handleDocumentMouseDown(t){let e=t.composedPath();this.containingElement&&!e.includes(this.containingElement)&&this.hide()}handleMenuItemActivate(t){let e=t.target;ee(e,this.panel)}handlePanelSelect(t){let e=t.target;!this.stayOpenOnSelect&&e.tagName.toLowerCase()==="sd-menu"&&(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():this.show()}handleTriggerKeyDown(t){if(t.key==="Escape"&&this.open){t.stopPropagation(),this.focusOnTrigger(),this.hide();return}if([" ","Enter"].includes(t.key)){t.preventDefault(),this.handleTriggerClick();return}let e=this.getMenu();if(e){let r=e.defaultSlot.assignedElements({flatten:!0}),o=r.find(d=>!d.disabled)||r[0],n=r[r.length-1];["ArrowDown","ArrowUp","Home","End"].includes(t.key)&&(t.preventDefault(),this.open||this.show(),r.length>0&&requestAnimationFrame(()=>{(t.key==="ArrowDown"||t.key==="Home")&&(e.setCurrentItem(o),o.focus()),(t.key==="ArrowUp"||t.key==="End")&&(e.setCurrentItem(n),n.focus())}))}}handleTriggerKeyUp(t){t.key===" "&&t.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}async show(){if(!this.open)return this.open=!0,J(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,J(this,"sd-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("sd-activate",this.handleMenuItemActivate),this.panel.addEventListener("sd-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("sd-activate",this.handleMenuItemActivate),this.panel.removeEventListener("sd-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}async handleOpenChange(){if(this.disabled){this.open=!1;return}if(this.updateAccessibleTrigger(),this.open){this.emit("sd-show"),this.addOpenListeners(),await W(this),this.panel.hidden=!1,this.popup.active=!0;let{keyframes:t,options:e}=q(this,"dropdown.show",{dir:this.localize.dir()});await K(this.popup.popup,t,e),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await W(this);let{keyframes:t,options:e}=q(this,"dropdown.hide",{dir:this.localize.dir()});await K(this.popup.popup,t,e),this.panel.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}render(){return u`<sd-popup part="base" id="dropdown" exportparts="
138
138
  popup:base__popup,
139
139
  " placement="${this.placement}" distance="${this.rounded&&this.distance<1?1:this.distance}" skidding="${this.skidding}" strategy="${this.hoist?"fixed":"absolute"}" ?flip="${!this.noFlip}" shift auto-size="vertical" auto-size-padding="10"><slot name="trigger" slot="anchor" part="trigger" class="block" @click="${this.handleTriggerClick}" @keydown="${this.handleTriggerKeyDown}" @keyup="${this.handleTriggerKeyUp}" @slotchange="${this.handleTriggerSlotChange}"></slot><slot part="panel" class="${h("shadow bg-white block",this.open?"pointer-events-auto":"pointer-events-none",this.rounded&&"rounded-md")}" aria-hidden="${this.open?"false":"true"}" aria-labelledby="dropdown"></slot></sd-popup>`}};dt.styles=[...g.styles,x`:host{display:inline-block}#dropdown::part(popup){z-index:var(--sd-z-index-dropdown,900)}#dropdown[data-current-placement^=top]::part(popup){transform-origin:bottom}#dropdown[data-current-placement^=bottom]::part(popup){transform-origin:top}#dropdown[data-current-placement^=left]::part(popup){transform-origin:right}#dropdown[data-current-placement^=right]::part(popup){transform-origin:left}:host(:not([no-auto-size])) ::slotted(:not([slot=trigger])){max-height:var(--auto-size-available-height)!important;max-width:var(--auto-size-available-width)!important;overflow:auto}`],a([v("#dropdown")],dt.prototype,"popup",2),a([v("[part=trigger]")],dt.prototype,"trigger",2),a([v("[part=panel]")],dt.prototype,"panel",2),a([l({type:Boolean,reflect:!0})],dt.prototype,"open",2),a([l({type:Boolean,reflect:!0})],dt.prototype,"rounded",2),a([l({type:String,reflect:!0})],dt.prototype,"placement",2),a([l({type:Boolean,reflect:!0})],dt.prototype,"disabled",2),a([l({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],dt.prototype,"stayOpenOnSelect",2),a([l({type:Object})],dt.prototype,"containingElement",2),a([l({type:Number,reflect:!0})],dt.prototype,"distance",2),a([l({type:Number,reflect:!0})],dt.prototype,"skidding",2),a([l({type:Boolean,reflect:!0,attribute:"no-auto-size"})],dt.prototype,"noAutoSize",2),a([l({type:Boolean,reflect:!0,attribute:"no-flip"})],dt.prototype,"noFlip",2),a([l({type:Boolean,reflect:!0})],dt.prototype,"hoist",2),a([k("open",{waitUntilFirstUpdate:!0})],dt.prototype,"handleOpenChange",1),dt=a([w("sd-dropdown")],dt);B("dropdown.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});B("dropdown.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});var Nt=class extends g{constructor(){super(...arguments);this.open=!1;this.inverted=!1;this.localize=new A(this)}updateMaxHeight(){var e;let t=(e=this.contentPreview)==null?void 0:e.scrollHeight.toString();this.style.setProperty("--max-height-pixel",`${t}px`),this.style.setProperty("--max-height",t)}onToggleClick(){this.updateMaxHeight(),this.open=!this.open}async onOpenChange(){if(this.body.classList.add("transitioning"),this.open){this.emit("sd-show"),await W(this.body);let{keyframes:t,options:e}=q(this,"expandable.show",{dir:this.localize.dir()});await K(this.body,ye(t,this.body.scrollHeight),e),this.body.style.height="auto",this.updateComplete.then(()=>{this.emit("sd-after-show")})}else{this.emit("sd-hide"),await W(this.body);let{keyframes:t,options:e}=q(this,"expandable.hide",{dir:this.localize.dir()});await K(this.body,ye(t,this.body.scrollHeight),e),this.body.style.height="auto",this.updateComplete.then(()=>{this.emit("sd-after-hide")})}this.details.setAttribute("open",this.open.toString()),this.body.classList.remove("transitioning")}async show(){if(!this.open)return this.onToggleClick(),J(this,"sd-after-show")}async hide(){if(this.open)return this.onToggleClick(),J(this,"sd-after-hide")}render(){return u`<div part="base" class="flex flex-col-reverse gap-4"><button part="toggle" class="${h("sd-interactive sd-interactive--reset",this.inverted&&"sd-interactive--inverted",this.inverted?"!focus-visible:focus-outline-inverted":"!focus-visible:focus-outline")}" @click="${this.onToggleClick}" aria-expanded="${this.open}"><div class="${h("h-full justify-center w-full text-base flex items-center toggle")}"><span part="toggle-icon" class="${h("flex items-center mr-2 transition-transform duration-medium ease-in-out",this.open&&"rotate-180")}"><slot name="expand-icon" class="${h(this.open&&"hidden")}"><sd-icon library="_internal" name="chevron-down" class="text-xl"></sd-icon></slot><slot name="collapse-icon" class="${h(!this.open&&"hidden")}"><sd-icon library="_internal" name="chevron-down" class="text-xl"></sd-icon></slot></span><slot name="toggle-closed" class="${h(this.open&&"hidden")}">${this.localize.term("showMore")}</slot><slot name="toggle-open" class="${h(!this.open&&"hidden")}">${this.localize.term("showLess")}</slot></div></button><details part="details" ?inert="${C(!this.open)}"><summary part="summary" aria-hidden="true" class="cursor-pointer overflow-hidden list-none"><slot name="clone"></slot></summary><div part="content" class="content content-preview overflow-hidden relative"><slot></slot></div></details></div>`}firstUpdated(){this.cloneContentToLightDOM(),this.details.setAttribute("open",this.open.toString())}cloneContentToLightDOM(){let t=document.createElement("div");t.setAttribute("slot","clone"),Array.from(this.childNodes).forEach(r=>{let o=r.cloneNode(!0);t.appendChild(o)}),this.appendChild(t)}};Nt.styles=[...g.styles,x`:host{--component-expandable-max-block-size:90px;--gradient-height:24px;--gradient:var(--gradient-color-start,hsla(0,0%,100%,0)) 0%,var(--gradient-color-end,#fff) 80%,var(--gradient-color-end,#fff) 100%;display:inline-block;position:relative;width:100%}.toggle::-moz-focus-inner{border-style:none;padding:var(--sd-spacing-0,0)}details>summary::-webkit-details-marker,details[open] summary{display:none}summary{max-block-size:var(--component-expandable-max-block-size)}:host([open]) summary{max-block-size:var(--max-height-pixel,1000vh)}.content{max-block-size:var(--component-expandable-max-block-size)}:host([open]) .content,:host:has(.transitioning) .content{max-block-size:var(--max-height-pixel,1000vh)}.content:after{background:linear-gradient(180deg,var(--gradient));bottom:var(--sd-spacing-0,0);content:" ";display:block;height:var(--gradient-height);left:var(--sd-spacing-0,0);opacity:var(--sd-opacity-0,0);position:absolute;transition-duration:.15s;transition-duration:var(--sd-duration-medium,.3s);transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);width:100%}:host([inverted]){--color-primary-rgb:0,53,142;--gradient-color-start:rgba(var(--color-primary-rgb),0);--gradient-color-end:rgba(var(--color-primary-rgb),1)}:host([inverted]) .content:after{background:var(--gradient-vertical-transparent-primary,linear-gradient(180deg,var(--gradient)))}:host(:not([open])) .content:after{opacity:var(--sd-opacity-100,1)}`],a([v(".content-preview")],Nt.prototype,"contentPreview",2),a([v("details")],Nt.prototype,"details",2),a([v('[part="content"]')],Nt.prototype,"body",2),a([l({type:Boolean,reflect:!0})],Nt.prototype,"open",2),a([l({type:Boolean,reflect:!0})],Nt.prototype,"inverted",2),a([k("open",{waitUntilFirstUpdate:!0})],Nt.prototype,"onOpenChange",1),Nt=a([w("sd-expandable")],Nt);B("expandable.show",{keyframes:[{height:"var(--component-expandable-max-block-size, 90px)"},{height:"auto"}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});B("expandable.hide",{keyframes:[{height:"auto"},{height:"var(--component-expandable-max-block-size, 90px)"}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});var Vt=class extends g{constructor(){super(...arguments);this.flipDirection="horizontal";this.placement="top";this.frontVariant="primary";this.backVariant="primary";this.activeSide="front"}connectedCallback(){super.connectedCallback()}flipFront(){this.activeSide="back",this.front.classList.add("clicked--front"),this.back.classList.add("clicked--back"),this.emit("sd-flip-front"),setTimeout(()=>{this.back.focus()})}flipBack(){this.activeSide="front",this.front.classList.remove("clicked--front"),this.back.classList.remove("clicked--back"),this.emit("sd-flip-back"),setTimeout(()=>{this.front.focus()})}handleFrontKeydown(t){t.code==="Enter"&&this.front===t.target&&this.flipFront()}handleBackKeydown(t){t.code==="Enter"&&this.back===t.target&&this.flipBack()}render(){return u`<div part="base" class="${h("flip-card relative h-full w-full")}"><div part="front" tabindex="0" aria-hidden="${this.activeSide==="back"}" inert="${C(this.activeSide==="back"||void 0)}" class="${h("flip-card__side flip-card__side--front overflow-hidden transition-transform duration-1000 ease-in-out","flex focus-visible:focus-outline","absolute top-0 left-0 w-full h-full justify-end text-left",this.frontVariant==="primary"&&"bg-primary",this.frontVariant==="primary-100"&&"bg-primary-100",this.placement==="top"?"flex-col":"flex-col-reverse",this.flipDirection==="vertical"&&"vertical")}"><div part="media-front" class="${h("absolute h-full w-full -z-20",(this.frontVariant==="primary"||this.frontVariant==="primary-100")&&"hidden")}"><slot name="media-front"></slot></div><div part="front-slot-container" class="${h("flex",{primary:"text-white","primary-100":"text-black","gradient-light":"text-black","gradient-dark":"text-white"}[this.frontVariant],{primary:"","primary-100":"","gradient-light":this.placement==="top"?"bg-gradient-to-b from-white/75 to-white/60":"bg-gradient-to-t from-white/75 to-white/60","gradient-dark":this.placement==="bottom"?"bg-gradient-to-t from-primary-800/75 to-primary-800/60":"bg-gradient-to-b from-primary-800/75 to-primary-800/60"}[this.frontVariant])}"><slot name="front"></slot></div><div part="front-secondary-gradient" class="${h("flip-card__gradient",{primary:"mb-auto","primary-100":"mb-auto","gradient-light":this.placement==="top"?"bg-gradient-to-b from-white/60 to-white/0 mb-auto":"bg-gradient-to-t from-white/60 to-white/0 mt-auto","gradient-dark":this.placement==="bottom"?"bg-gradient-to-t from-primary-800/60 to-primary-800/0 mt-auto":"bg-gradient-to-b from-primary-800/60 to-primary-800/0 mb-auto"}[this.frontVariant])}"></div><sd-button part="front-button" size="md" variant="${{primary:"tertiary","primary-100":"tertiary","gradient-light":"primary","gradient-dark":"primary"}[this.frontVariant]}" ?inverted="${{primary:!0,"primary-100":!1,"gradient-light":!0,"gradient-dark":!0}[this.frontVariant]}" class="${h("absolute right-0 p-2 flex-shrink-0",this.placement==="top"?"bottom-0":"top-0")}" @click="${this.flipFront}" @keydown="${this.handleFrontKeydown}"><sd-icon library="_internal" name="reload" label="Flip to Back"></sd-icon></sd-button></div><div part="back" tabindex="0" aria-hidden="${this.activeSide==="front"}" inert="${C(this.activeSide==="front"||void 0)}" class="${h("flip-card__side flip-card__side--back overflow-hidden transition-transform duration-1000 ease-in-out","flex focus-visible:focus-outline","absolute top-0 left-0 w-full h-full justify-end text-left",this.backVariant==="primary"&&"bg-primary",this.backVariant==="primary-100"&&"bg-primary-100",this.placement==="top"?"flex-col":"flex-col-reverse",this.flipDirection==="vertical"&&"vertical")}"><div part="media-back" class="${h("absolute h-full w-full -z-20",(this.backVariant==="primary"||this.backVariant==="primary-100")&&"hidden")}"><slot name="media-back"></slot></div><div part="back-slot-container" class="${h("flex",{primary:"text-white","primary-100":"text-black","gradient-light":"text-black","gradient-dark":"text-white"}[this.backVariant],{primary:"","primary-100":"","gradient-light":this.placement==="top"?"bg-gradient-to-b from-white/75 to-white/60":"bg-gradient-to-t from-white/75 to-white/60","gradient-dark":this.placement==="bottom"?"bg-gradient-to-t from-primary-800/75 to-primary-800/60":"bg-gradient-to-b from-primary-800/75 to-primary-800/60"}[this.backVariant])}"><slot name="back"></slot></div><div part="back-secondary-gradient" class="${h("flip-card__gradient",{primary:"mb-auto","primary-100":"mb-auto","gradient-light":this.placement==="top"?"bg-gradient-to-b from-white/60 to-white/0 mb-auto":"bg-gradient-to-t from-white/60 to-white/0 mt-auto","gradient-dark":this.placement==="bottom"?"bg-gradient-to-t from-primary-800/60 to-primary-800/0 mt-auto":"bg-gradient-to-b from-primary-800/60 to-primary-800/0 mb-auto"}[this.backVariant])}"></div><sd-button size="md" part="back-button" variant="${{primary:"tertiary","primary-100":"tertiary","gradient-light":"primary","gradient-dark":"primary"}[this.backVariant]}" ?inverted="${{primary:!0,"primary-100":!1,"gradient-light":!0,"gradient-dark":!0}[this.backVariant]}" class="${h("absolute right-0 p-2 flex-shrink-0",this.placement==="top"?"bottom-0":"top-0")}" @click="${this.flipBack}" @keydown="${this.handleBackKeydown}"><sd-icon library="_internal" name="reload" label="Flip to Front"></sd-icon></sd-button></div></div>`}};Vt.styles=[...g.styles,x`:host{aspect-ratio:3/4;display:block;--name:"";--height:480px;height:var(--height)}.flip-card{perspective:100rem}.flip-card__side{backface-visibility:hidden}.flip-card__side--back{transform:rotateY(180deg)}.clicked--front{transform:rotateY(-180deg)}.clicked--back{transform:rotateY(0)}.flip-card__side--back.vertical{transform:rotateX(180deg)}.clicked--front.vertical{transform:rotateX(-180deg)}.clicked--back.vertical{transform:rotateX(0)}.flip-card__gradient{flex:.4 1 0}`],a([v('[part="front"]')],Vt.prototype,"front",2),a([v('[part="back"]')],Vt.prototype,"back",2),a([l({reflect:!0,attribute:"flip-direction"})],Vt.prototype,"flipDirection",2),a([l({reflect:!0})],Vt.prototype,"placement",2),a([l({type:String,reflect:!0,attribute:"front-variant"})],Vt.prototype,"frontVariant",2),a([l({type:String,reflect:!0,attribute:"back-variant"})],Vt.prototype,"backVariant",2),a([T()],Vt.prototype,"activeSide",2),Vt=a([w("sd-flipcard")],Vt);var oe=class extends g{constructor(){super(...arguments);this.fixed=!1}connectedCallback(){super.connectedCallback(),this.updateCalculatedHeight=this.updateCalculatedHeight.bind(this),this.addResizeObserver=this.addResizeObserver.bind(this),window.addEventListener("resize",this.updateCalculatedHeight)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.updateCalculatedHeight)}firstUpdated(){this.updateCalculatedHeight(),this.addResizeObserver()}updated(t){super.updated(t),t.has("fixed")&&this.updateCalculatedHeight()}addResizeObserver(){this.resizeObserver=new ResizeObserver(this.updateCalculatedHeight),this.header&&this.resizeObserver.observe(this.header)}updateCalculatedHeight(){let t=parseFloat(getComputedStyle(document.documentElement).fontSize),e=window.innerHeight/t;this.header&&this.fixed&&e>=32?document.documentElement.style.setProperty("--sd-header-calculated-height",`${this.header.clientHeight}px`):document.documentElement.style.removeProperty("--sd-header-calculated-height")}render(){return u`<header class="w-full bg-white relative" role="banner"><div part="main" class="relative mx-auto my-0 box-border"><slot></slot></div></header>`}};oe.styles=[...g.styles,x`:host{display:block;position:relative;z-index:var(--sd-z-index-header,600)}@media (min-height:32rem){:host([fixed]){padding-bottom:var(--sd-header-calculated-height)!important}:host([fixed]) header{left:var(--sd-spacing-0,0);position:fixed;top:var(--sd-spacing-0,0);width:100%}:host([fixed]) header:after{height:var(--sd-spacing-2,.5rem);left:var(--sd-spacing-0,0);position:absolute;right:var(--sd-spacing-0,0);top:100%;--tw-content:"";background:var(--gradient-vertical-black-40-transparent,linear-gradient(0deg,#18181800 50%,#18181866 100%));content:var(--tw-content)}}[part=main]{max-width:var(--sd-header-inner-max-width);padding:var(--sd-header-padding,12px 16px);width:var(--sd-header-inner-width)}`],a([l({reflect:!0,type:Boolean})],oe.prototype,"fixed",2),a([v("header")],oe.prototype,"header",2),a([di(100)],oe.prototype,"updateCalculatedHeight",1),oe=a([w("sd-header")],oe);var Zt=class extends g{constructor(){super(...arguments);this.mode="cors";this.allowScripts=!1}executeScript(t){let e=document.createElement("script");[...t.attributes].forEach(r=>e.setAttribute(r.name,r.value)),e.textContent=t.textContent,t.parentNode.replaceChild(e,t)}async handleSrcChange(){try{let t=this.src,e=await Ji(t,this.mode);if(t!==this.src)return;if(!e.ok){this.emit("sd-error",{detail:{status:e.status}});return}this.innerHTML=e.html,this.allowScripts&&[...this.querySelectorAll("script")].forEach(r=>this.executeScript(r)),this.emit("sd-load")}catch(t){this.emit("sd-error",{detail:{status:-1}})}}render(){return u`<slot></slot>`}};Zt.styles=[...g.styles,x`:host{display:block}`],a([l({reflect:!0})],Zt.prototype,"src",2),a([l({type:String,reflect:!0})],Zt.prototype,"mode",2),a([l({attribute:"allow-scripts",type:Boolean,reflect:!0})],Zt.prototype,"allowScripts",2),a([k("src")],Zt.prototype,"handleSrcChange",1),Zt=a([w("sd-include")],Zt);var Pi=(s,i)=>{var e;let t=s._$AN;if(t===void 0)return!1;for(let r of t)(e=r._$AO)==null||e.call(r,i,!1),Pi(r,i);return!0},wr=s=>{let i,t;do{if((i=s._$AM)===void 0)break;t=i._$AN,t.delete(s),s=i}while((t==null?void 0:t.size)===0)},Ua=s=>{for(let i;i=s._$AM;s=i){let t=i._$AN;if(t===void 0)i._$AN=t=new Set;else if(t.has(s))break;t.add(s),Xl(i)}};function jl(s){this._$AN!==void 0?(wr(this),this._$AM=s,Ua(this)):this._$AM=s}function Wl(s,i=!1,t=0){let e=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(i)if(Array.isArray(e))for(let o=t;o<e.length;o++)Pi(e[o],!1),wr(e[o]);else e!=null&&(Pi(e,!1),wr(e));else Pi(this,s)}var Xl=s=>{var i,t;s.type==Kt.CHILD&&((i=s._$AP)!=null||(s._$AP=Wl),(t=s._$AQ)!=null||(s._$AQ=jl))},ui=class extends Ie{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,e){super._$AT(i,t,e),Ua(this),this.isConnected=i._$AU}_$AO(i,t=!0){var e,r;i!==this.isConnected&&(this.isConnected=i,i?(e=this.reconnected)==null||e.call(this):(r=this.disconnected)==null||r.call(this)),t&&(Pi(this,i),wr(this))}setValue(i){if(lr(this._$Ct))this._$Ct._$AI(i,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=i,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};var ts=class extends ui{constructor(t){super(t);this.handlePointerDown=t=>{t.button!==0||this.host.disabled||this.spinOnLongPressCallback(t)};this.handlePointerUp=t=>{t==null||t.preventDefault(),t==null||t.stopPropagation(),this.timeout&&this.callbacks.start(),this.stopSpinningAndCleanUp(),this.callbacks.end(),document.removeEventListener("pointerup",this.handlePointerUp)};if(t.type!==Kt.ELEMENT||!(t.element instanceof HTMLButtonElement))throw new Error("The `longPress` directive must be used on an HTMLButtonElement.")}render(t){return j}update(t,[e]){return this.callbacks===void 0&&this.host===void 0&&(this.host=t.element,this.callbacks=N({},e),this.host.addEventListener("pointerdown",this.handlePointerDown)),Dt}disconnected(){this.stopSpinningAndCleanUp(),this.host.removeEventListener("pointerdown",this.handlePointerDown),document.removeEventListener("pointerup",this.handlePointerUp)}spinOnLongPressCallback(t){var e;t.preventDefault(),t.stopPropagation(),this.timeout=setTimeout(()=>{this.timeout=void 0,this.interval=setInterval(()=>{this.callbacks.start()},50)},500),document.addEventListener("pointerup",this.handlePointerUp),(e=this.observer)==null||e.disconnect(),this.observer=new MutationObserver(r=>{r.forEach(o=>{o.attributeName==="disabled"&&this.stopSpinningAndCleanUp()})}),this.observer.observe(this.host,{attributes:!0})}stopSpinningAndCleanUp(){var t;clearInterval(this.interval),clearTimeout(this.timeout),(t=this.observer)==null||t.disconnect()}},es=te(ts);var Na,Zl=(Na=navigator.userAgentData)==null?void 0:Na.brands.some(s=>s.brand.includes("Chromium")),Ql=Zl?!1:navigator.userAgent.includes("Firefox"),H=class extends g{constructor(){super(...arguments);this.formControlController=new pt(this);this.hasSlotController=new P(this,"help-text","label","left","right","message","placeholder");this.localize=new A(this);this.hasFocus=!1;this.showValidStyle=!1;this.showInvalidStyle=!1;this.type="text";this.size="lg";this.value="";this.defaultValue="";this.placeholder="";this.label="";this.helpText="";this.clearable=!1;this.disabled=!1;this.visuallyDisabled=!1;this.readonly=!1;this.passwordToggle=!1;this.passwordVisible=!1;this.spinButtons=!1;this.form="";this.name="";this.title="";this.required=!1;this.styleOnValid=!1;this.spellcheck=!0}get valueAsDate(){var t,e;return(e=(t=this.input)==null?void 0:t.valueAsDate)!=null?e:null}set valueAsDate(t){let e=document.createElement("input");e.type="date",e.valueAsDate=t,this.value=e.value}get valueAsNumber(){var t,e;return(e=(t=this.input)==null?void 0:t.valueAsNumber)!=null?e:parseFloat(this.value)}set valueAsNumber(t){let e=document.createElement("input");e.type="number",e.valueAsNumber=t,this.value=e.value}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.input.value,this.emit("sd-change")}handleClearClick(t){this.value="",this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change"),this.input.focus(),t.stopPropagation()}handleSearchClick(t){this.emit("sd-search"),t.stopPropagation()}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){if(this.visuallyDisabled){this.input.value=this.value;return}this.value=this.input.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleKeyDown(t){let e=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;t.key==="Enter"&&!e&&setTimeout(()=>{!t.defaultPrevented&&!t.isComposing&&this.formControlController.submit()})}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}isDecrementDisabled(){if(this.disabled||this.readonly)return!0;if(this.min===void 0||this.min===null)return!1;let t=typeof this.min=="string"?parseFloat(this.min):this.min;return this.valueAsNumber<=t}isIncrementDisabled(){if(this.disabled||this.readonly)return!0;if(this.max===void 0||this.max===null)return!1;let t=typeof this.max=="string"?parseFloat(this.max):this.max;return this.valueAsNumber>=t}handleStep(){this.handleInput(),this.input.focus()}handleStepUp(){this.stepUp(),this.handleStep()}handleStepDown(){this.stepDown(),this.handleStep()}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=String(this.step),this.formControlController.updateValidity()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity()}focus(t){this.input.focus(t)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(t,e,r="none"){this.input.setSelectionRange(t,e,r)}setRangeText(t,e,r,o){this.input.setRangeText(t,e,r,o),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){var t;return(t=this.input)==null?void 0:t.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(t){this.input.setCustomValidity(t),this.formControlController.updateValidity()}render(){let t={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),description:this.hasSlotController.test("description"),left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right"),tooltip:this.hasSlotController.test("tooltip")},e=this.label?!0:!!t.label,r=this.helpText?!0:!!t.helpText,o=this.clearable&&!this.readonly&&(typeof this.value=="number"||this.value.length>0),n=!!t.tooltip,d=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",c=this.size==="sm"?"text-sm":"text-base",p={disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[d],m=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",f={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],y={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return u`<div part="form-control" class="${h((this.disabled||this.visuallyDisabled)&&"cursor-not-allowed")}">${e||n?u`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${h(e?"inline-block":"hidden",c)}" for="input" aria-hidden="${e?"false":"true"}"><slot name="label">${this.label}</slot></label> ${t.tooltip?u`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${h("relative w-full",this.disabled&&"pointer-events-none",this.visuallyDisabled&&"cursor-not-allowed")}"><div part="border" class="${h("absolute w-full h-full pointer-events-none border rounded-default transition-[border] ease-in-out duration-medium hover:duration-fast",p)}"></div><div part="base" class="${h("px-4 flex flex-row items-center rounded-default transition-colors ease-in-out duration-medium hover:duration-fast",this.size==="lg"?"py-2":"py-1",!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",d==="disabled"||d==="visuallyDisabled"?"text-neutral-500":"text-black")}">${t.left?u`<slot name="left" part="left" class="${h("inline-flex",this.size==="sm"?"mr-1":"mr-2",m,y)}"></slot>`:""} <input part="input" id="input" class="${h("min-w-0 flex-grow focus:outline-none bg-transparent",this.visuallyDisabled||this.disabled?"placeholder-neutral-500 cursor-not-allowed":"placeholder-neutral-700",this.size==="sm"?"h-6":"h-8",c)}" type="${this.type==="password"&&this.passwordVisible?"text":this.type}" title="${this.title}" name="${C(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${C(this.placeholder)}" minlength="${C(this.minlength)}" maxlength="${C(this.maxlength)}" min="${C(this.min)}" max="${C(this.max)}" step="${C(this.step)}" .value="${xe(this.value)}" autocapitalize="${C(this.type==="password"?"off":this.autocapitalize)}" autocomplete="${C(this.autocomplete)}" autocorrect="${C(this.type==="password"?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${C(this.pattern)}" enterkeyhint="${C(this.enterkeyhint)}" inputmode="${C(this.inputmode)}" aria-describedby="help-text invalid-message" aria-disabled="${this.visuallyDisabled||this.disabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${o?u`<button part="clear-button" class="${h("flex justify-center",f)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-icon class="${h("text-neutral-700",y)}" library="_internal" name="closing-round"></sd-icon></slot></button>`:""} ${this.passwordToggle&&this.type==="password"?u`<button aria-label="${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}" part="password-toggle-button" class="${h("flex items-center sd-interactive",f)}" type="button" @click="${this.handlePasswordToggle}">${this.passwordVisible?u`<slot name="show-password-icon"><sd-icon class="${h(m,y)}" library="_internal" name="eye"></sd-icon></slot>`:u`<slot name="hide-password-icon"><sd-icon class="${h(m,y)}" library="_internal" name="eye-crossed-out"></sd-icon></slot>`}</button>`:""} ${(this.type==="date"||this.type==="datetime-local")&&!Ql?u`<sd-icon class="${h(m,f,y)}" library="_internal" name="calendar"></sd-icon>`:""} ${this.type==="time"?u`<sd-icon class="${h(m,f,y)}" library="_internal" name="clock"></sd-icon>`:""} ${this.type==="search"?u`<button class="${h("flex items-center sd-interactive",f)}" type="button" @click="${this.handleSearchClick}"><sd-icon class="${h(m,y)}" library="_internal" name="magnifying-glass" label="${this.localize.term("search")}"></sd-icon></button>`:""} ${this.showInvalidStyle?u`<sd-icon part="invalid-icon" class="${h("text-error",f,y)}" library="_internal" name="risk"></sd-icon>`:""} ${this.showValidStyle&&this.styleOnValid?u`<sd-icon class="${h("text-success flex-shrink-0",f,y)}" library="_internal" name="confirm-circle" part="valid-icon"></sd-icon>`:""} ${t.right?u`<slot name="right" part="right" class="${h("inline-flex",m,f,y)}"></slot>`:""} ${this.type==="number"&&this.spinButtons?u`<div part="stepper" class="flex items-center"><button part="decrement-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isDecrementDisabled()}" aria-hidden="true" ${es({start:()=>this.handleStepDown(),end:()=>this.handleChange()})} tabindex="-1"><slot name="decrement-number-stepper"><sd-icon name="system/minus-circle" label="Decrease value" class="${h(m,f,y)}"></sd-icon></slot></button> <button part="increment-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isIncrementDisabled()}" aria-hidden="true" ${es({start:()=>this.handleStepUp(),end:()=>this.handleChange()})} tabindex="-1"><slot name="increment-number-stepper"><sd-icon name="system/plus-circle" label="Decrease value" class="${h(m,f,y)}"></sd-icon></slot></button></div>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${h("text-sm text-neutral-700 mt-1",r?"block":"hidden")}" aria-hidden="${!r}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};H.styles=[...g.styles,x`:host{box-sizing:border-box;display:inline-block;position:relative;text-align:left;width:100%}:host([vertical]){display:block}:host([required]) #label:after{content:" *"}:host([visually-disabled]) input{caret-color:transparent}details summary::-webkit-details-marker{display:none}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}input[type=time]::-webkit-calendar-picker-indicator{background:0 0}details summary::-webkit-details-marker,input[type=date]::-webkit-calendar-picker-indicator,input[type=datetime-local]::-webkit-calendar-picker-indicator,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}.stepper-button[disabled] sd-icon{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}`],a([v("#input")],H.prototype,"input",2),a([v("#invalid-message")],H.prototype,"invalidMessage",2),a([T()],H.prototype,"hasFocus",2),a([T()],H.prototype,"showValidStyle",2),a([T()],H.prototype,"showInvalidStyle",2),a([l({type:String,reflect:!0})],H.prototype,"type",2),a([l({type:String,reflect:!0})],H.prototype,"size",2),a([l({type:String,reflect:!0})],H.prototype,"inputmode",2),a([l()],H.prototype,"value",2),a([Bt()],H.prototype,"defaultValue",2),a([l({type:String,reflect:!0})],H.prototype,"placeholder",2),a([l({type:String,reflect:!0})],H.prototype,"label",2),a([l({type:String,attribute:"help-text",reflect:!0})],H.prototype,"helpText",2),a([l({type:Boolean,reflect:!0})],H.prototype,"clearable",2),a([l({type:Boolean,reflect:!0})],H.prototype,"disabled",2),a([l({type:Boolean,reflect:!0,attribute:"visually-disabled"})],H.prototype,"visuallyDisabled",2),a([l({type:Boolean,reflect:!0})],H.prototype,"readonly",2),a([l({attribute:"password-toggle",type:Boolean,reflect:!0})],H.prototype,"passwordToggle",2),a([l({attribute:"password-visible",type:Boolean,reflect:!0})],H.prototype,"passwordVisible",2),a([l({attribute:"spin-buttons",type:Boolean,reflect:!0})],H.prototype,"spinButtons",2),a([l({type:Number,reflect:!0})],H.prototype,"minlength",2),a([l({type:Number,reflect:!0})],H.prototype,"maxlength",2),a([l({reflect:!0})],H.prototype,"min",2),a([l({reflect:!0})],H.prototype,"max",2),a([l({type:String,reflect:!0})],H.prototype,"form",2),a([l({type:String,reflect:!0})],H.prototype,"name",2),a([l({type:String,reflect:!0})],H.prototype,"title",2),a([l({type:Boolean,reflect:!0})],H.prototype,"required",2),a([l()],H.prototype,"pattern",2),a([l({reflect:!0})],H.prototype,"step",2),a([l({type:String,reflect:!0})],H.prototype,"autocapitalize",2),a([l({type:String,reflect:!0})],H.prototype,"autocorrect",2),a([l({reflect:!0})],H.prototype,"autocomplete",2),a([l({type:Boolean,reflect:!0})],H.prototype,"autofocus",2),a([l({type:String,reflect:!0})],H.prototype,"enterkeyhint",2),a([l({type:Boolean,reflect:!0,attribute:"style-on-valid"})],H.prototype,"styleOnValid",2),a([l({type:Boolean,converter:{fromAttribute:t=>!(!t||t==="false"),toAttribute:t=>t?"true":"false"}})],H.prototype,"spellcheck",2),a([k("disabled",{waitUntilFirstUpdate:!0})],H.prototype,"handleDisabledChange",1),a([k("step",{waitUntilFirstUpdate:!0})],H.prototype,"handleStepChange",1),a([k("value",{waitUntilFirstUpdate:!0})],H.prototype,"handleValueChange",1),H=a([w("sd-input")],H);var Ot=class extends g{constructor(){super(...arguments);this.hasSlotController=new P(this,"[default]","icon-left","icon-right");this.standalone=!1;this.size="inherit";this.inverted=!1;this.href="";this.visuallyDisabled=!1}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleClick(t){this.visuallyDisabled&&(t.preventDefault(),t.stopPropagation())}focus(t){this.button.focus(t)}blur(){this.button.blur()}render(){let t={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right")};return u`<a part="base" class="${h("inline",this.href&&!this.visuallyDisabled?"cursor-pointer":"",this.visuallyDisabled?"cursor-not-allowed focus-visible:focus-outline":"",{sm:"text-sm",lg:"text-base",inherit:""}[this.size],{disabled:this.inverted?"text-neutral-600":"text-neutral-500",enabled:this.inverted?"text-white hover:text-primary-200 active:text-primary-400 focus-visible:focus-outline-inverted":" text-primary hover:text-primary-500 active:text-primary-800 focus-visible:focus-outline",visuallyDisabled:this.inverted?"text-neutral-600":"text-neutral-500"}[this.href&&!this.visuallyDisabled?"enabled":this.visuallyDisabled?"visuallyDisabled":"disabled"],this.standalone&&"flex items-start")}" href="${C(this.href||void 0)}" target="${C(this.target||void 0)}" download="${C(this.download)}" rel="${C(this.target?"noreferrer noopener":void 0)}" aria-disabled="${!this.href||this.visuallyDisabled?"true":"false"}" tabindex="${this.href?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @click="${this.handleClick}"><slot name="icon-left" part="icon-left" class="${h("inline",t["icon-left"]&&(this.standalone?{sm:"mr-1",lg:"mr-2",inherit:"mr-[0.5em]"}[this.size]:"mr-[0.25em]"))}"></slot><span part="label" class="inline underline underline-offset-2"><slot></slot></span><slot name="icon-right" part="icon-right" class="${h("inline",t["icon-right"]&&(this.standalone?{sm:"ml-1",lg:"ml-2",inherit:"ml-[0.5em]"}[this.size]:"ml-[0.25em]"))}"></slot></a>`}};Ot.styles=[...g.styles,x`::slotted(sd-icon){font-size:1.25em;margin-bottom:-.25em}:host([size=sm][standalone]) ::slotted(sd-icon){font-size:var(--sd-font-size-base,1rem)}:host([size=lg][standalone]) ::slotted(sd-icon){font-size:var(--sd-font-size-xl,1.5rem)}`],a([v("a")],Ot.prototype,"button",2),a([l({type:Boolean,reflect:!0})],Ot.prototype,"standalone",2),a([l({type:String,reflect:!0})],Ot.prototype,"size",2),a([l({type:Boolean,reflect:!0})],Ot.prototype,"inverted",2),a([l({type:String,reflect:!0})],Ot.prototype,"href",2),a([l({type:Boolean,attribute:"visually-disabled",reflect:!0})],Ot.prototype,"visuallyDisabled",2),a([l({type:String,reflect:!0})],Ot.prototype,"target",2),a([l({reflect:!0})],Ot.prototype,"download",2),Ot=a([w("sd-link")],Ot);var Ft=class extends g{constructor(){super(...arguments);this.variant="main";this.state="default";this.animated=!1;this.notInteractive=!1;this.href="";this.label="";this.marker={cluster:`
140
140
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
@@ -1 +1 @@
1
- import"./chunks/chunk.HAL7R4WT.js";import{a as ee}from"./chunks/chunk.EIGW4PKE.js";import{a as oe}from"./chunks/chunk.6QNQMWSQ.js";import{a as ae}from"./chunks/chunk.SQ7OLI7Q.js";import{a as fe}from"./chunks/chunk.CEVVDV52.js";import{a as U}from"./chunks/chunk.MMM4IMJD.js";import{a as W}from"./chunks/chunk.YVU7BES7.js";import{a as X}from"./chunks/chunk.75UMJKQC.js";import{a as Y}from"./chunks/chunk.23JJBCLW.js";import{a as Z}from"./chunks/chunk.PCAKJGIV.js";import{a as _}from"./chunks/chunk.TFKNNQ5S.js";import{a as $}from"./chunks/chunk.ZKBX734R.js";import{a as j}from"./chunks/chunk.N4RSYGAV.js";import{a as V}from"./chunks/chunk.4HEDUSC5.js";import"./chunks/chunk.IVHEBGOY.js";import{a as q}from"./chunks/chunk.6XOV6LQS.js";import{a as y}from"./chunks/chunk.LLJ2OCGM.js";import{a as z}from"./chunks/chunk.CARQ25VA.js";import{a as J}from"./chunks/chunk.5GPPZUNF.js";import{a as K}from"./chunks/chunk.7SJXKLVN.js";import{a as N}from"./chunks/chunk.2YMJV2KL.js";import{a as O}from"./chunks/chunk.ZZAPDP7V.js";import{a as P}from"./chunks/chunk.72JQHJ3G.js";import{a as E}from"./chunks/chunk.OPMX2Q3A.js";import{a as H}from"./chunks/chunk.FYOUHXBZ.js";import{a as Q}from"./chunks/chunk.OCIA2UJP.js";import{a as F}from"./chunks/chunk.XAIFQKHV.js";import{a as R}from"./chunks/chunk.TDRPE2QQ.js";import{a as h}from"./chunks/chunk.OIOXSZHI.js";import{a as A}from"./chunks/chunk.RCMXIAQV.js";import{a as w}from"./chunks/chunk.TTG6Y6QJ.js";import{a as v}from"./chunks/chunk.4THKQ4PC.js";import"./chunks/chunk.HJ4O4XQA.js";import"./chunks/chunk.Y3GIPFVP.js";import{a as L}from"./chunks/chunk.H7I6O5HE.js";import{a as M}from"./chunks/chunk.7FMD6ZWC.js";import{a as k}from"./chunks/chunk.NZFGKV2I.js";import"./chunks/chunk.635MGLIZ.js";import{a as g}from"./chunks/chunk.W2JKI6K3.js";import{a as I}from"./chunks/chunk.OQSPWMNR.js";import{a as B}from"./chunks/chunk.4USO2EJG.js";import{a as C}from"./chunks/chunk.BV42CEWL.js";import{a as D}from"./chunks/chunk.ROIKKEJQ.js";import{a as G}from"./chunks/chunk.EIRHQEOO.js";import{a as i}from"./chunks/chunk.KVJJEMOI.js";import"./chunks/chunk.LIO6LMTQ.js";import"./chunks/chunk.4SX3FTTZ.js";import{a as n}from"./chunks/chunk.RIOXBQBC.js";import{a as T}from"./chunks/chunk.2RPN4LHN.js";import"./chunks/chunk.US3OB3XU.js";import{a as b}from"./chunks/chunk.QJFZKBPG.js";import{a as c}from"./chunks/chunk.QJAN6R4E.js";import"./chunks/chunk.EJI65G6N.js";import"./chunks/chunk.X2GM34WQ.js";import"./chunks/chunk.W7A3TU2Z.js";import{a as u}from"./chunks/chunk.MGCXOSRH.js";import{a as l}from"./chunks/chunk.Z4V7WPTW.js";import{a as m}from"./chunks/chunk.ZENM3WVO.js";import{a as x}from"./chunks/chunk.HXUQZXCZ.js";import"./chunks/chunk.CTOV3B4T.js";import{a as s}from"./chunks/chunk.NTP4LLF3.js";import"./chunks/chunk.BJBQEPZV.js";import"./chunks/chunk.C577EOP7.js";import"./chunks/chunk.MHWW3RZB.js";import{a as S}from"./chunks/chunk.2D3B6W4C.js";import"./chunks/chunk.CBQWVOOS.js";import{a}from"./chunks/chunk.7NHEEBDB.js";import{a as o}from"./chunks/chunk.QJVPLDR4.js";import{a as r}from"./chunks/chunk.ADTHFKFC.js";import"./chunks/chunk.XR2KNB36.js";import{a as p}from"./chunks/chunk.AKJ7U3Y3.js";import{a as f}from"./chunks/chunk.H3W4J4F4.js";import"./chunks/chunk.I2H6CZK5.js";import"./chunks/chunk.2AQOPKKH.js";import"./chunks/chunk.G7HKVXLR.js";import"./chunks/chunk.3L472FD4.js";import{a as d}from"./chunks/chunk.3PTWVC7K.js";import{a as t}from"./chunks/chunk.PIAYQI7K.js";import"./chunks/chunk.NRBNWX7R.js";import"./chunks/chunk.CGQ2BPPZ.js";import"./chunks/chunk.CHU57RUD.js";import"./chunks/chunk.SKUMYG4O.js";import"./chunks/chunk.PVM2WKMA.js";import"./chunks/chunk.KLRPP4NQ.js";import{a as e}from"./chunks/chunk.YMTUR575.js";import"./chunks/chunk.BOIDC3L5.js";import"./chunks/chunk.D6LAH53B.js";import{d as re,e as te}from"./chunks/chunk.LXHLWQH7.js";import"./chunks/chunk.K7HF3VBZ.js";import"./chunks/chunk.MHPHKNZ5.js";import"./chunks/chunk.PYHYYOBE.js";import"./chunks/chunk.TWZDCIM2.js";import"./chunks/chunk.MWDEA25W.js";import"./chunks/chunk.YEDQWNIV.js";import{a as de}from"./chunks/chunk.L6MCOH7T.js";import"./chunks/chunk.CIAY7P3F.js";import"./chunks/chunk.2PZOUYOE.js";import"./chunks/chunk.HJGLYEWV.js";import"./chunks/chunk.E2DRD2OX.js";import"./chunks/chunk.M6XINJ52.js";import"./chunks/chunk.RZUTJ36B.js";import"./chunks/chunk.6OTM3PE5.js";import"./chunks/chunk.WNP2V63C.js";import"./chunks/chunk.TJOCV4DC.js";export{de as LocalizeController,o as SdAccordion,a as SdAccordionGroup,r as SdAnimation,p as SdAudio,u as SdBadge,l as SdBrandshape,m as SdBreadcrumb,x as SdBreadcrumbItem,d as SdButton,s as SdCarousel,S as SdCarouselItem,i as SdCheckbox,n as SdCheckboxGroup,T as SdCombobox,k as SdDatepicker,g as SdDialog,I as SdDivider,f as SdDrawer,B as SdDropdown,C as SdExpandable,D as SdFlipcard,G as SdHeader,e as SdIcon,M as SdInclude,R as SdInput,h as SdLink,t as SdLoader,A as SdMapMarker,w as SdMenu,v as SdMenuItem,L as SdNavigationItem,N as SdNotification,O as SdOptgroup,P as SdOption,c as SdPopup,E as SdQuickfact,F as SdRadio,H as SdRadioButton,Q as SdRadioGroup,V as SdRange,j as SdRangeTick,q as SdScrollable,y as SdSelect,z as SdSkeleton,J as SdSpinner,K as SdStep,U as SdStepGroup,W as SdSwitch,X as SdTab,Y as SdTabGroup,Z as SdTabPanel,b as SdTag,_ as SdTeaser,$ as SdTeaserMedia,ee as SdTextarea,oe as SdTooltip,ae as SdVideo,re as registerIconLibrary,fe as setupAutocomplete,te as unregisterIconLibrary};
1
+ import"./chunks/chunk.HAL7R4WT.js";import{a as ee}from"./chunks/chunk.EIGW4PKE.js";import{a as oe}from"./chunks/chunk.6QNQMWSQ.js";import{a as ae}from"./chunks/chunk.SQ7OLI7Q.js";import{a as fe}from"./chunks/chunk.CEVVDV52.js";import{a as U}from"./chunks/chunk.MMM4IMJD.js";import{a as W}from"./chunks/chunk.YVU7BES7.js";import{a as X}from"./chunks/chunk.75UMJKQC.js";import{a as Y}from"./chunks/chunk.23JJBCLW.js";import{a as Z}from"./chunks/chunk.PCAKJGIV.js";import{a as _}from"./chunks/chunk.TFKNNQ5S.js";import{a as $}from"./chunks/chunk.ZKBX734R.js";import{a as V}from"./chunks/chunk.4HEDUSC5.js";import"./chunks/chunk.IVHEBGOY.js";import{a as j}from"./chunks/chunk.N4RSYGAV.js";import{a as q}from"./chunks/chunk.6XOV6LQS.js";import{a as y}from"./chunks/chunk.LLJ2OCGM.js";import{a as z}from"./chunks/chunk.CARQ25VA.js";import{a as J}from"./chunks/chunk.5GPPZUNF.js";import{a as K}from"./chunks/chunk.7SJXKLVN.js";import{a as N}from"./chunks/chunk.2YMJV2KL.js";import{a as O}from"./chunks/chunk.ZZAPDP7V.js";import{a as P}from"./chunks/chunk.72JQHJ3G.js";import{a as E}from"./chunks/chunk.OPMX2Q3A.js";import{a as H}from"./chunks/chunk.FYOUHXBZ.js";import{a as Q}from"./chunks/chunk.OCIA2UJP.js";import{a as F}from"./chunks/chunk.XAIFQKHV.js";import{a as R}from"./chunks/chunk.TDRPE2QQ.js";import{a as h}from"./chunks/chunk.OIOXSZHI.js";import{a as A}from"./chunks/chunk.RCMXIAQV.js";import{a as w}from"./chunks/chunk.TTG6Y6QJ.js";import{a as v}from"./chunks/chunk.4THKQ4PC.js";import"./chunks/chunk.HJ4O4XQA.js";import"./chunks/chunk.Y3GIPFVP.js";import{a as L}from"./chunks/chunk.H7I6O5HE.js";import{a as M}from"./chunks/chunk.7FMD6ZWC.js";import{a as g}from"./chunks/chunk.37O5FAM6.js";import"./chunks/chunk.635MGLIZ.js";import{a as I}from"./chunks/chunk.W2JKI6K3.js";import{a as k}from"./chunks/chunk.OQSPWMNR.js";import{a as B}from"./chunks/chunk.4USO2EJG.js";import{a as C}from"./chunks/chunk.BV42CEWL.js";import{a as D}from"./chunks/chunk.ROIKKEJQ.js";import{a as G}from"./chunks/chunk.EIRHQEOO.js";import{a as i}from"./chunks/chunk.KVJJEMOI.js";import"./chunks/chunk.LIO6LMTQ.js";import"./chunks/chunk.4SX3FTTZ.js";import{a as n}from"./chunks/chunk.RIOXBQBC.js";import{a as T}from"./chunks/chunk.2RPN4LHN.js";import"./chunks/chunk.US3OB3XU.js";import{a as b}from"./chunks/chunk.QJFZKBPG.js";import{a as c}from"./chunks/chunk.QJAN6R4E.js";import"./chunks/chunk.EJI65G6N.js";import"./chunks/chunk.X2GM34WQ.js";import"./chunks/chunk.W7A3TU2Z.js";import{a as u}from"./chunks/chunk.MGCXOSRH.js";import{a as m}from"./chunks/chunk.ZENM3WVO.js";import{a as l}from"./chunks/chunk.Z4V7WPTW.js";import{a as x}from"./chunks/chunk.HXUQZXCZ.js";import"./chunks/chunk.CTOV3B4T.js";import{a as s}from"./chunks/chunk.NTP4LLF3.js";import"./chunks/chunk.BJBQEPZV.js";import"./chunks/chunk.C577EOP7.js";import"./chunks/chunk.MHWW3RZB.js";import{a as S}from"./chunks/chunk.2D3B6W4C.js";import"./chunks/chunk.CBQWVOOS.js";import{a}from"./chunks/chunk.7NHEEBDB.js";import{a as o}from"./chunks/chunk.QJVPLDR4.js";import{a as r}from"./chunks/chunk.ADTHFKFC.js";import"./chunks/chunk.XR2KNB36.js";import{a as p}from"./chunks/chunk.AKJ7U3Y3.js";import{a as f}from"./chunks/chunk.H3W4J4F4.js";import"./chunks/chunk.I2H6CZK5.js";import"./chunks/chunk.2AQOPKKH.js";import"./chunks/chunk.G7HKVXLR.js";import"./chunks/chunk.3L472FD4.js";import{a as d}from"./chunks/chunk.3PTWVC7K.js";import{a as t}from"./chunks/chunk.PIAYQI7K.js";import"./chunks/chunk.NRBNWX7R.js";import"./chunks/chunk.CGQ2BPPZ.js";import"./chunks/chunk.CHU57RUD.js";import"./chunks/chunk.SKUMYG4O.js";import"./chunks/chunk.PVM2WKMA.js";import"./chunks/chunk.KLRPP4NQ.js";import{a as e}from"./chunks/chunk.YMTUR575.js";import"./chunks/chunk.BOIDC3L5.js";import"./chunks/chunk.D6LAH53B.js";import{d as re,e as te}from"./chunks/chunk.LXHLWQH7.js";import"./chunks/chunk.K7HF3VBZ.js";import"./chunks/chunk.MHPHKNZ5.js";import"./chunks/chunk.PYHYYOBE.js";import"./chunks/chunk.TWZDCIM2.js";import"./chunks/chunk.MWDEA25W.js";import"./chunks/chunk.YEDQWNIV.js";import{a as de}from"./chunks/chunk.L6MCOH7T.js";import"./chunks/chunk.CIAY7P3F.js";import"./chunks/chunk.2PZOUYOE.js";import"./chunks/chunk.HJGLYEWV.js";import"./chunks/chunk.E2DRD2OX.js";import"./chunks/chunk.M6XINJ52.js";import"./chunks/chunk.RZUTJ36B.js";import"./chunks/chunk.6OTM3PE5.js";import"./chunks/chunk.WNP2V63C.js";import"./chunks/chunk.TJOCV4DC.js";export{de as LocalizeController,o as SdAccordion,a as SdAccordionGroup,r as SdAnimation,p as SdAudio,u as SdBadge,l as SdBrandshape,m as SdBreadcrumb,x as SdBreadcrumbItem,d as SdButton,s as SdCarousel,S as SdCarouselItem,i as SdCheckbox,n as SdCheckboxGroup,T as SdCombobox,g as SdDatepicker,I as SdDialog,k as SdDivider,f as SdDrawer,B as SdDropdown,C as SdExpandable,D as SdFlipcard,G as SdHeader,e as SdIcon,M as SdInclude,R as SdInput,h as SdLink,t as SdLoader,A as SdMapMarker,w as SdMenu,v as SdMenuItem,L as SdNavigationItem,N as SdNotification,O as SdOptgroup,P as SdOption,c as SdPopup,E as SdQuickfact,F as SdRadio,H as SdRadioButton,Q as SdRadioGroup,V as SdRange,j as SdRangeTick,q as SdScrollable,y as SdSelect,z as SdSkeleton,J as SdSpinner,K as SdStep,U as SdStepGroup,W as SdSwitch,X as SdTab,Y as SdTabGroup,Z as SdTabPanel,b as SdTag,_ as SdTeaser,$ as SdTeaserMedia,ee as SdTextarea,oe as SdTooltip,ae as SdVideo,re as registerIconLibrary,fe as setupAutocomplete,te as unregisterIconLibrary};
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@solid-design-system/components",
4
- "version": "5.17.0",
4
+ "version": "5.17.1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1 +1 @@
1
- import{a as T}from"./chunk.MHWW3RZB.js";import{c as b}from"./chunk.3L472FD4.js";import{a as f}from"./chunk.CHU57RUD.js";import{a as c}from"./chunk.YEDQWNIV.js";import{a as w}from"./chunk.L6MCOH7T.js";import{a as g,b as y,c as v,d as h,h as u}from"./chunk.M6XINJ52.js";import{b as m,e as d}from"./chunk.RZUTJ36B.js";import{a as p,e as l}from"./chunk.TJOCV4DC.js";var a=class extends u{constructor(){super(...arguments);this.localize=new w(this);this.tabs=[];this.panels=[];this.hasScrollControls=!1;this.variant="default";this.canScroll={left:!1,right:!1};this.activation="auto"}connectedCallback(){let t=Promise.all([customElements.whenDefined("sd-5-17-0-tab"),customElements.whenDefined("sd-5-17-0-tab-panel")]);super.connectedCallback(),this.resizeObserver=new ResizeObserver(()=>{this.updateScrollControls(),this.repositionIndicator()}),this.mutationObserver=new MutationObserver(s=>{s.some(e=>!["aria-labelledby","aria-controls"].includes(e.attributeName))&&setTimeout(()=>this.setAriaLabels()),s.some(e=>e.attributeName==="disabled")&&this.syncTabsAndPanels()}),this.updateComplete.then(()=>{this.syncTabsAndPanels(),this.mutationObserver.observe(this,{attributes:!0,childList:!0,subtree:!0}),this.resizeObserver.observe(this.nav),this.nav.addEventListener("scroll",()=>this.handleScroll()),t.then(()=>{new IntersectionObserver((e,o)=>{var i;e[0].intersectionRatio>0&&(this.setAriaLabels(),this.setActiveTab((i=this.activeTab)!=null?i:this.tabs[0],{emitEvents:!1}),o.unobserve(e[0].target))}).observe(this.tabGroup)})})}updated(t){!t.get("canScroll")&&this.canScroll&&this.handleScroll()}disconnectedCallback(){var t;this.mutationObserver.disconnect(),this.nav&&((t=this.resizeObserver)==null||t.unobserve(this.nav))}getAllTabs(t={includeDisabled:!0}){let s=this.shadowRoot.querySelector('slot[name="nav"]');return Array.from(s.assignedElements()).map(e=>e.tagName.toLocaleLowerCase()==="sd-5-17-0-tab"?e:e.querySelector("sd-5-17-0-tab")).filter(e=>e&&t.includeDisabled?e.tagName.toLowerCase()==="sd-5-17-0-tab":e.tagName.toLowerCase()==="sd-5-17-0-tab"&&!e.disabled)}getAllPanels(){return[...this.body.assignedElements()].filter(t=>t.tagName.toLowerCase()==="sd-5-17-0-tab-panel")}getActiveTab(){return this.tabs.find(t=>t.matches(":focus"))}handleClick(t){let e=t.target.closest("sd-5-17-0-tab");(e==null?void 0:e.closest("sd-5-17-0-tab-group"))===this&&e!==null&&this.setActiveTab(e,{scrollBehavior:"smooth"})}handleKeyDown(t){let e=t.target.closest("sd-5-17-0-tab");if((e==null?void 0:e.closest("sd-5-17-0-tab-group"))===this){if(["Enter"," "].includes(t.key)&&e!==null&&(this.setActiveTab(e,{scrollBehavior:"smooth"}),t.preventDefault()),["Tab"].includes(t.key)){let i=this.tabs.indexOf(this.getActiveTab()),n=this.tabs[i+1];e!==null&&n&&b(n,this.nav,"horizontal")}if(["Shift","Tab"].includes(t.key)){let i=this.tabs.indexOf(this.getActiveTab()),n=this.tabs[i-1];e!==null&&n&&b(n,this.nav,"horizontal")}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key)){let i=this.tabs.find(r=>r.matches(":focus")),n=this.localize.dir()==="rtl";if((i==null?void 0:i.tagName.toLowerCase())==="sd-5-17-0-tab"){let r=this.tabs.indexOf(i);t.key==="Home"?r=0:t.key==="End"?r=this.tabs.length-1:t.key===(n?"ArrowRight":"ArrowLeft")||t.key==="ArrowUp"?r--:(t.key===(n?"ArrowLeft":"ArrowRight")||t.key==="ArrowDown")&&r++,r<0&&(r=this.tabs.length-1),r>this.tabs.length-1&&(r=0),this.tabs[r].focus({preventScroll:!0}),this.activation==="auto"&&this.setActiveTab(this.tabs[r],{scrollBehavior:"smooth"}),b(this.tabs[r],this.nav,"horizontal"),t.preventDefault()}}}}handleScroll(){this.canScroll={left:this.nav.scrollLeft>0,right:this.nav.scrollLeft+this.nav.clientWidth<this.nav.scrollWidth-1}}handleScrollToStart(){this.nav.scroll({left:this.localize.dir()==="rtl"?this.nav.scrollLeft+this.nav.clientWidth:this.nav.scrollLeft-this.nav.clientWidth,behavior:"smooth"})}handleScrollToEnd(){this.nav.scroll({left:this.localize.dir()==="rtl"?this.nav.scrollLeft-this.nav.clientWidth:this.nav.scrollLeft+this.nav.clientWidth,behavior:"smooth"})}setActiveTab(t,s){if(s=p({emitEvents:!0,scrollBehavior:"auto"},s),t!==this.activeTab&&!t.disabled&&!t.visuallyDisabled){let e=this.activeTab;this.activeTab=t,this.tabs.map(o=>o.active=o===this.activeTab),this.panels.map(o=>{var i;return o.active=o.name===((i=this.activeTab)==null?void 0:i.panel)}),this.repositionIndicator(),b(this.activeTab,this.nav,"horizontal",s.scrollBehavior),s.emitEvents&&(e&&this.emit("sd-tab-hide",{detail:{name:e.panel}}),this.emit("sd-tab-show",{detail:{name:this.activeTab.panel}}))}}setAriaLabels(){this.tabs.forEach(t=>{let s=this.panels.find(e=>e.name===t.panel);s&&t.setAttribute("aria-controls",s.getAttribute("id"))})}syncTabsAndPanels(){this.tabs=this.getAllTabs({includeDisabled:!1}),this.panels=this.getAllPanels(),this.repositionIndicator(),this.panels.forEach(t=>{t.tabIndex=0}),this.updateComplete.then(()=>this.updateScrollControls()),this.tabs.length!==0&&this.tabs[0].variant==="container"&&(this.variant="container")}updateScrollControls(){this.hasScrollControls=this.nav.scrollWidth>this.nav.clientWidth}async repositionIndicator(){await this.updateComplete;let t=this.activeTab,s=this.indicator,e=this.tabsContainer;if(!t||!s||!e||t.variant==="container")return;let o=t.getBoundingClientRect(),i=e.getBoundingClientRect(),n=getComputedStyle(e).justifyContent==="center",r=i.left+i.width/2,A=o.left+o.width/2,x=t.offsetWidth,C=n?A-r:o.left-i.left;s.style.width=`${x}px`,s.style.transform=`translateX(${C}px)`}show(t){let s=this.tabs.find(e=>e.panel===t);s&&this.setActiveTab(s,{scrollBehavior:"smooth"})}render(){var s;let t=this.localize.dir()==="rtl";return d`<div part="base" class="${c("flex flex-col rounded-none")}" @click="${this.handleClick}" @keydown="${this.handleKeyDown}"><div part="nav" class="${c(this.hasScrollControls&&"relative py-0 px-12")}">${this.hasScrollControls?d`<button part="scroll-button--start" exportparts="base:scroll-button__base" tabindex="-1" aria-hidden="true" disabled="${f(!this.canScroll.left||void 0)}" class="${c("sd-interactive flex items-center justify-center absolute top-0 bottom-0 left-0 !outline-offset-0 border-b border-neutral-400 z-10",this.localize.dir()==="rtl"&&"left-auto right-0")}" @click="${this.handleScrollToStart}"><sd-5-17-0-icon library="_internal" name="${t?"chevron-up":"chevron-down"}" label="previous" class="${c("h-6 w-12 rotate-90 grid place-items-center")}"></sd-5-17-0-icon></button>`:""}<div part="scroll-container" class="flex overflow-x-auto focus-visible:focus-outline !outline-offset-0"><div part="tabs" class="${c("flex flex-auto relative flex-row")}" role="tablist">${((s=this.activeTab)==null?void 0:s.variant)!=="container"?d`<div part="active-tab-indicator" id="indicator" class="absolute h-1 bg-accent bottom-0 transition-[transform,width] duration-medium ease-in-out z-30"></div>`:""}<div part="separation" class="border-neutral-400 absolute w-full h-0.25 bottom-0 border-b z-10"></div><slot name="nav" @slotchange="${this.syncTabsAndPanels}"></slot></div></div>${this.hasScrollControls?d`<button part="scroll-button--end" exportparts="base:scroll-button__base" tabindex="-1" aria-hidden="true" disabled="${f(!this.canScroll.right||void 0)}" class="${c("sd-interactive flex items-center justify-center absolute top-0 bottom-0 right-0 !outline-offset-0 border-b border-neutral-400 z-10",this.localize.dir()==="rtl"&&"right-auto left-0")}" @click="${this.handleScrollToEnd}"><sd-5-17-0-icon library="_internal" name="${t?"chevron-down":"chevron-up"}" label="next" class="${c("h-6 w-12 rotate-90 grid place-items-center")}"></sd-5-17-0-icon></button>`:""}</div><slot part="body" class="${c("block auto py-8 px-6",this.variant==="container"&&"border border-neutral-400 border-t-0")}" @slotchange="${this.syncTabsAndPanels}"></slot></div>`}};a.styles=[...u.styles,m`:host{box-sizing:border-box;display:block}[part=scroll-container]{scrollbar-width:none}[part=scroll-container]::-webkit-scrollbar{height:var(--sd-spacing-0,0);width:var(--sd-spacing-0,0)}::slotted(sd-5-17-0-tab-panel){--padding:1rem 0}::slotted(sd-5-17-0-tab-panel:focus-visible){outline-color:rgb(var(--sd-color-primary,0 53 142)/1);outline-offset:2px;outline-style:solid;outline-width:2px}`],l([h("[part=base]")],a.prototype,"tabGroup",2),l([h("[part=body]")],a.prototype,"body",2),l([h("[part=scroll-container]")],a.prototype,"nav",2),l([h("[part=active-tab-indicator]")],a.prototype,"indicator",2),l([h('[part="tabs"]')],a.prototype,"tabsContainer",2),l([v()],a.prototype,"hasScrollControls",2),l([v()],a.prototype,"variant",2),l([v()],a.prototype,"canScroll",2),l([y({type:String,reflect:!0})],a.prototype,"activation",2),l([T(20)],a.prototype,"handleScroll",1),a=l([g("sd-5-17-0-tab-group")],a);export{a};
1
+ import{a as T}from"./chunk.MHWW3RZB.js";import{c as b}from"./chunk.3L472FD4.js";import{a as f}from"./chunk.CHU57RUD.js";import{a as c}from"./chunk.YEDQWNIV.js";import{a as w}from"./chunk.L6MCOH7T.js";import{a as g,b as y,c as v,d as h,h as u}from"./chunk.M6XINJ52.js";import{b as m,e as d}from"./chunk.RZUTJ36B.js";import{a as p,e as l}from"./chunk.TJOCV4DC.js";var a=class extends u{constructor(){super(...arguments);this.localize=new w(this);this.tabs=[];this.panels=[];this.hasScrollControls=!1;this.variant="default";this.canScroll={left:!1,right:!1};this.activation="auto"}connectedCallback(){let t=Promise.all([customElements.whenDefined("sd-5-17-1-tab"),customElements.whenDefined("sd-5-17-1-tab-panel")]);super.connectedCallback(),this.resizeObserver=new ResizeObserver(()=>{this.updateScrollControls(),this.repositionIndicator()}),this.mutationObserver=new MutationObserver(s=>{s.some(e=>!["aria-labelledby","aria-controls"].includes(e.attributeName))&&setTimeout(()=>this.setAriaLabels()),s.some(e=>e.attributeName==="disabled")&&this.syncTabsAndPanels()}),this.updateComplete.then(()=>{this.syncTabsAndPanels(),this.mutationObserver.observe(this,{attributes:!0,childList:!0,subtree:!0}),this.resizeObserver.observe(this.nav),this.nav.addEventListener("scroll",()=>this.handleScroll()),t.then(()=>{new IntersectionObserver((e,o)=>{var i;e[0].intersectionRatio>0&&(this.setAriaLabels(),this.setActiveTab((i=this.activeTab)!=null?i:this.tabs[0],{emitEvents:!1}),o.unobserve(e[0].target))}).observe(this.tabGroup)})})}updated(t){!t.get("canScroll")&&this.canScroll&&this.handleScroll()}disconnectedCallback(){var t;this.mutationObserver.disconnect(),this.nav&&((t=this.resizeObserver)==null||t.unobserve(this.nav))}getAllTabs(t={includeDisabled:!0}){let s=this.shadowRoot.querySelector('slot[name="nav"]');return Array.from(s.assignedElements()).map(e=>e.tagName.toLocaleLowerCase()==="sd-5-17-1-tab"?e:e.querySelector("sd-5-17-1-tab")).filter(e=>e&&t.includeDisabled?e.tagName.toLowerCase()==="sd-5-17-1-tab":e.tagName.toLowerCase()==="sd-5-17-1-tab"&&!e.disabled)}getAllPanels(){return[...this.body.assignedElements()].filter(t=>t.tagName.toLowerCase()==="sd-5-17-1-tab-panel")}getActiveTab(){return this.tabs.find(t=>t.matches(":focus"))}handleClick(t){let e=t.target.closest("sd-5-17-1-tab");(e==null?void 0:e.closest("sd-5-17-1-tab-group"))===this&&e!==null&&this.setActiveTab(e,{scrollBehavior:"smooth"})}handleKeyDown(t){let e=t.target.closest("sd-5-17-1-tab");if((e==null?void 0:e.closest("sd-5-17-1-tab-group"))===this){if(["Enter"," "].includes(t.key)&&e!==null&&(this.setActiveTab(e,{scrollBehavior:"smooth"}),t.preventDefault()),["Tab"].includes(t.key)){let i=this.tabs.indexOf(this.getActiveTab()),n=this.tabs[i+1];e!==null&&n&&b(n,this.nav,"horizontal")}if(["Shift","Tab"].includes(t.key)){let i=this.tabs.indexOf(this.getActiveTab()),n=this.tabs[i-1];e!==null&&n&&b(n,this.nav,"horizontal")}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key)){let i=this.tabs.find(r=>r.matches(":focus")),n=this.localize.dir()==="rtl";if((i==null?void 0:i.tagName.toLowerCase())==="sd-5-17-1-tab"){let r=this.tabs.indexOf(i);t.key==="Home"?r=0:t.key==="End"?r=this.tabs.length-1:t.key===(n?"ArrowRight":"ArrowLeft")||t.key==="ArrowUp"?r--:(t.key===(n?"ArrowLeft":"ArrowRight")||t.key==="ArrowDown")&&r++,r<0&&(r=this.tabs.length-1),r>this.tabs.length-1&&(r=0),this.tabs[r].focus({preventScroll:!0}),this.activation==="auto"&&this.setActiveTab(this.tabs[r],{scrollBehavior:"smooth"}),b(this.tabs[r],this.nav,"horizontal"),t.preventDefault()}}}}handleScroll(){this.canScroll={left:this.nav.scrollLeft>0,right:this.nav.scrollLeft+this.nav.clientWidth<this.nav.scrollWidth-1}}handleScrollToStart(){this.nav.scroll({left:this.localize.dir()==="rtl"?this.nav.scrollLeft+this.nav.clientWidth:this.nav.scrollLeft-this.nav.clientWidth,behavior:"smooth"})}handleScrollToEnd(){this.nav.scroll({left:this.localize.dir()==="rtl"?this.nav.scrollLeft-this.nav.clientWidth:this.nav.scrollLeft+this.nav.clientWidth,behavior:"smooth"})}setActiveTab(t,s){if(s=p({emitEvents:!0,scrollBehavior:"auto"},s),t!==this.activeTab&&!t.disabled&&!t.visuallyDisabled){let e=this.activeTab;this.activeTab=t,this.tabs.map(o=>o.active=o===this.activeTab),this.panels.map(o=>{var i;return o.active=o.name===((i=this.activeTab)==null?void 0:i.panel)}),this.repositionIndicator(),b(this.activeTab,this.nav,"horizontal",s.scrollBehavior),s.emitEvents&&(e&&this.emit("sd-tab-hide",{detail:{name:e.panel}}),this.emit("sd-tab-show",{detail:{name:this.activeTab.panel}}))}}setAriaLabels(){this.tabs.forEach(t=>{let s=this.panels.find(e=>e.name===t.panel);s&&t.setAttribute("aria-controls",s.getAttribute("id"))})}syncTabsAndPanels(){this.tabs=this.getAllTabs({includeDisabled:!1}),this.panels=this.getAllPanels(),this.repositionIndicator(),this.panels.forEach(t=>{t.tabIndex=0}),this.updateComplete.then(()=>this.updateScrollControls()),this.tabs.length!==0&&this.tabs[0].variant==="container"&&(this.variant="container")}updateScrollControls(){this.hasScrollControls=this.nav.scrollWidth>this.nav.clientWidth}async repositionIndicator(){await this.updateComplete;let t=this.activeTab,s=this.indicator,e=this.tabsContainer;if(!t||!s||!e||t.variant==="container")return;let o=t.getBoundingClientRect(),i=e.getBoundingClientRect(),n=getComputedStyle(e).justifyContent==="center",r=i.left+i.width/2,A=o.left+o.width/2,x=t.offsetWidth,C=n?A-r:o.left-i.left;s.style.width=`${x}px`,s.style.transform=`translateX(${C}px)`}show(t){let s=this.tabs.find(e=>e.panel===t);s&&this.setActiveTab(s,{scrollBehavior:"smooth"})}render(){var s;let t=this.localize.dir()==="rtl";return d`<div part="base" class="${c("flex flex-col rounded-none")}" @click="${this.handleClick}" @keydown="${this.handleKeyDown}"><div part="nav" class="${c(this.hasScrollControls&&"relative py-0 px-12")}">${this.hasScrollControls?d`<button part="scroll-button--start" exportparts="base:scroll-button__base" tabindex="-1" aria-hidden="true" disabled="${f(!this.canScroll.left||void 0)}" class="${c("sd-interactive flex items-center justify-center absolute top-0 bottom-0 left-0 !outline-offset-0 border-b border-neutral-400 z-10",this.localize.dir()==="rtl"&&"left-auto right-0")}" @click="${this.handleScrollToStart}"><sd-5-17-1-icon library="_internal" name="${t?"chevron-up":"chevron-down"}" label="previous" class="${c("h-6 w-12 rotate-90 grid place-items-center")}"></sd-5-17-1-icon></button>`:""}<div part="scroll-container" class="flex overflow-x-auto focus-visible:focus-outline !outline-offset-0"><div part="tabs" class="${c("flex flex-auto relative flex-row")}" role="tablist">${((s=this.activeTab)==null?void 0:s.variant)!=="container"?d`<div part="active-tab-indicator" id="indicator" class="absolute h-1 bg-accent bottom-0 transition-[transform,width] duration-medium ease-in-out z-30"></div>`:""}<div part="separation" class="border-neutral-400 absolute w-full h-0.25 bottom-0 border-b z-10"></div><slot name="nav" @slotchange="${this.syncTabsAndPanels}"></slot></div></div>${this.hasScrollControls?d`<button part="scroll-button--end" exportparts="base:scroll-button__base" tabindex="-1" aria-hidden="true" disabled="${f(!this.canScroll.right||void 0)}" class="${c("sd-interactive flex items-center justify-center absolute top-0 bottom-0 right-0 !outline-offset-0 border-b border-neutral-400 z-10",this.localize.dir()==="rtl"&&"right-auto left-0")}" @click="${this.handleScrollToEnd}"><sd-5-17-1-icon library="_internal" name="${t?"chevron-down":"chevron-up"}" label="next" class="${c("h-6 w-12 rotate-90 grid place-items-center")}"></sd-5-17-1-icon></button>`:""}</div><slot part="body" class="${c("block auto py-8 px-6",this.variant==="container"&&"border border-neutral-400 border-t-0")}" @slotchange="${this.syncTabsAndPanels}"></slot></div>`}};a.styles=[...u.styles,m`:host{box-sizing:border-box;display:block}[part=scroll-container]{scrollbar-width:none}[part=scroll-container]::-webkit-scrollbar{height:var(--sd-spacing-0,0);width:var(--sd-spacing-0,0)}::slotted(sd-5-17-1-tab-panel){--padding:1rem 0}::slotted(sd-5-17-1-tab-panel:focus-visible){outline-color:rgb(var(--sd-color-primary,0 53 142)/1);outline-offset:2px;outline-style:solid;outline-width:2px}`],l([h("[part=base]")],a.prototype,"tabGroup",2),l([h("[part=body]")],a.prototype,"body",2),l([h("[part=scroll-container]")],a.prototype,"nav",2),l([h("[part=active-tab-indicator]")],a.prototype,"indicator",2),l([h('[part="tabs"]')],a.prototype,"tabsContainer",2),l([v()],a.prototype,"hasScrollControls",2),l([v()],a.prototype,"variant",2),l([v()],a.prototype,"canScroll",2),l([y({type:String,reflect:!0})],a.prototype,"activation",2),l([T(20)],a.prototype,"handleScroll",1),a=l([g("sd-5-17-1-tab-group")],a);export{a};
@@ -1 +1 @@
1
- import{a as r,h as e}from"./chunk.M6XINJ52.js";import{b as l,e as o}from"./chunk.RZUTJ36B.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends e{static isCarouselItem(s){return s instanceof Element&&s.getAttribute("aria-roledescription")==="slide"}connectedCallback(){super.connectedCallback(),this.setAttribute("role","group")}render(){return o`<slot></slot>`}};t.styles=[...e.styles,l`:host{align-items:center;aspect-ratio:var(--aspect-ratio);display:flex;flex-direction:column;height:100%;justify-content:center;scroll-snap-align:start;scroll-snap-stop:always;width:100%}::slotted(img){height:100%;-o-object-fit:cover;object-fit:cover;width:100%}`],t=i([r("sd-5-17-0-carousel-item")],t);export{t as a};
1
+ import{a as r,h as e}from"./chunk.M6XINJ52.js";import{b as l,e as o}from"./chunk.RZUTJ36B.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends e{static isCarouselItem(s){return s instanceof Element&&s.getAttribute("aria-roledescription")==="slide"}connectedCallback(){super.connectedCallback(),this.setAttribute("role","group")}render(){return o`<slot></slot>`}};t.styles=[...e.styles,l`:host{align-items:center;aspect-ratio:var(--aspect-ratio);display:flex;flex-direction:column;height:100%;justify-content:center;scroll-snap-align:start;scroll-snap-stop:always;width:100%}::slotted(img){height:100%;-o-object-fit:cover;object-fit:cover;width:100%}`],t=i([r("sd-5-17-1-carousel-item")],t);export{t as a};