@solid-design-system/components 5.15.5 → 5.15.6

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 (261) hide show
  1. package/cdn/chunks/chunk.6NSE3DZZ.js +11 -0
  2. package/cdn/components/carousel/carousel.js +1 -1
  3. package/cdn/custom-elements.json +1 -1
  4. package/cdn/solid-components.bundle.js +1 -1
  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.2HR2JHBL.js +1 -1
  9. package/cdn-versioned/chunks/chunk.35XMPPY5.js +1 -1
  10. package/cdn-versioned/chunks/chunk.3OGPT34F.js +1 -1
  11. package/cdn-versioned/chunks/chunk.4OSXAE67.js +1 -1
  12. package/cdn-versioned/chunks/chunk.4VGPLUHG.js +1 -1
  13. package/cdn-versioned/chunks/chunk.5FGVDYO4.js +1 -1
  14. package/cdn-versioned/chunks/chunk.5UU57WGX.js +1 -1
  15. package/cdn-versioned/chunks/chunk.5YR2BW6Z.js +1 -1
  16. package/cdn-versioned/chunks/chunk.6DD53IIK.js +1 -1
  17. package/cdn-versioned/chunks/chunk.6DEKOOVF.js +1 -1
  18. package/cdn-versioned/chunks/chunk.6DJJYTKZ.js +2 -2
  19. package/cdn-versioned/chunks/chunk.6LY4CQS5.js +1 -1
  20. package/cdn-versioned/chunks/chunk.6NSE3DZZ.js +11 -0
  21. package/cdn-versioned/chunks/chunk.77KBPY6M.js +1 -1
  22. package/cdn-versioned/chunks/chunk.7GJAULJA.js +1 -1
  23. package/cdn-versioned/chunks/chunk.7JV32P5Q.js +1 -1
  24. package/cdn-versioned/chunks/chunk.7ZT7XD7H.js +1 -1
  25. package/cdn-versioned/chunks/chunk.AVWCANBI.js +1 -1
  26. package/cdn-versioned/chunks/chunk.BGKGDPBP.js +1 -1
  27. package/cdn-versioned/chunks/chunk.C2K5FJG6.js +1 -1
  28. package/cdn-versioned/chunks/chunk.CE5ZCTLG.js +1 -1
  29. package/cdn-versioned/chunks/chunk.CEVVDV52.js +1 -1
  30. package/cdn-versioned/chunks/chunk.CNOQLSAS.js +4 -4
  31. package/cdn-versioned/chunks/chunk.DKTLAKVD.js +1 -1
  32. package/cdn-versioned/chunks/chunk.EBQAL4SG.js +1 -1
  33. package/cdn-versioned/chunks/chunk.EC63I62M.js +1 -1
  34. package/cdn-versioned/chunks/chunk.ENG4CGOQ.js +1 -1
  35. package/cdn-versioned/chunks/chunk.EWX245UT.js +1 -1
  36. package/cdn-versioned/chunks/chunk.GB43ZI2M.js +1 -1
  37. package/cdn-versioned/chunks/chunk.GC5HUEMT.js +4 -4
  38. package/cdn-versioned/chunks/chunk.GJAPEOYB.js +1 -1
  39. package/cdn-versioned/chunks/chunk.GVD7DPUX.js +1 -1
  40. package/cdn-versioned/chunks/chunk.HVSHE3SX.js +1 -1
  41. package/cdn-versioned/chunks/chunk.IHKACSKZ.js +1 -1
  42. package/cdn-versioned/chunks/chunk.IQ4XSBN6.js +1 -1
  43. package/cdn-versioned/chunks/chunk.JGGJ7DHB.js +1 -1
  44. package/cdn-versioned/chunks/chunk.KD3QQ6GF.js +1 -1
  45. package/cdn-versioned/chunks/chunk.LFTOGDCS.js +1 -1
  46. package/cdn-versioned/chunks/chunk.LUHUBO4Y.js +1 -1
  47. package/cdn-versioned/chunks/chunk.LZDITSGD.js +1 -1
  48. package/cdn-versioned/chunks/chunk.M4XF4HY6.js +2 -2
  49. package/cdn-versioned/chunks/chunk.N4VPOI2K.js +1 -1
  50. package/cdn-versioned/chunks/chunk.O6KTLPCX.js +1 -1
  51. package/cdn-versioned/chunks/chunk.OLYZZSH7.js +1 -1
  52. package/cdn-versioned/chunks/chunk.OZ4RSXMQ.js +1 -1
  53. package/cdn-versioned/chunks/chunk.Q3NMER3S.js +1 -1
  54. package/cdn-versioned/chunks/chunk.QVM2KJMY.js +1 -1
  55. package/cdn-versioned/chunks/chunk.RBVN4ZNT.js +1 -1
  56. package/cdn-versioned/chunks/chunk.RCDKFEMZ.js +1 -1
  57. package/cdn-versioned/chunks/chunk.RPGHXS3H.js +1 -1
  58. package/cdn-versioned/chunks/chunk.RW5KPI4Z.js +1 -1
  59. package/cdn-versioned/chunks/chunk.RYTJY7J3.js +1 -1
  60. package/cdn-versioned/chunks/chunk.SBW3IQVN.js +1 -1
  61. package/cdn-versioned/chunks/chunk.SOCURUDK.js +1 -1
  62. package/cdn-versioned/chunks/chunk.UQR7JBGF.js +1 -1
  63. package/cdn-versioned/chunks/chunk.VPFGICJP.js +1 -1
  64. package/cdn-versioned/chunks/chunk.W7A3TU2Z.js +1 -1
  65. package/cdn-versioned/chunks/chunk.WG74SLXL.js +1 -1
  66. package/cdn-versioned/chunks/chunk.WZDZQ6LB.js +1 -1
  67. package/cdn-versioned/chunks/chunk.X3PHFNB7.js +1 -1
  68. package/cdn-versioned/chunks/chunk.ZRK4JWRJ.js +1 -1
  69. package/cdn-versioned/components/accordion/accordion.d.ts +1 -1
  70. package/cdn-versioned/components/accordion-group/accordion-group.d.ts +1 -1
  71. package/cdn-versioned/components/animation/animation.d.ts +1 -1
  72. package/cdn-versioned/components/audio/audio.d.ts +1 -1
  73. package/cdn-versioned/components/badge/badge.d.ts +1 -1
  74. package/cdn-versioned/components/brandshape/brandshape.d.ts +1 -1
  75. package/cdn-versioned/components/breadcrumb/breadcrumb.d.ts +1 -1
  76. package/cdn-versioned/components/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  77. package/cdn-versioned/components/button/button.d.ts +1 -1
  78. package/cdn-versioned/components/button-group/button-group.d.ts +1 -1
  79. package/cdn-versioned/components/carousel/carousel.d.ts +1 -1
  80. package/cdn-versioned/components/carousel/carousel.js +1 -1
  81. package/cdn-versioned/components/carousel-item/carousel-item.d.ts +1 -1
  82. package/cdn-versioned/components/checkbox/checkbox.d.ts +1 -1
  83. package/cdn-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
  84. package/cdn-versioned/components/combobox/combobox.d.ts +1 -1
  85. package/cdn-versioned/components/dialog/dialog.d.ts +1 -1
  86. package/cdn-versioned/components/divider/divider.d.ts +1 -1
  87. package/cdn-versioned/components/drawer/drawer.d.ts +1 -1
  88. package/cdn-versioned/components/dropdown/dropdown.d.ts +1 -1
  89. package/cdn-versioned/components/expandable/expandable.d.ts +1 -1
  90. package/cdn-versioned/components/flipcard/flipcard.d.ts +1 -1
  91. package/cdn-versioned/components/header/header.d.ts +1 -1
  92. package/cdn-versioned/components/icon/icon.d.ts +1 -1
  93. package/cdn-versioned/components/include/include.d.ts +1 -1
  94. package/cdn-versioned/components/input/input.d.ts +1 -1
  95. package/cdn-versioned/components/link/link.d.ts +1 -1
  96. package/cdn-versioned/components/loader/loader.d.ts +1 -1
  97. package/cdn-versioned/components/map-marker/map-marker.d.ts +1 -1
  98. package/cdn-versioned/components/menu/menu.d.ts +1 -1
  99. package/cdn-versioned/components/menu-item/menu-item.d.ts +1 -1
  100. package/cdn-versioned/components/navigation-item/navigation-item.d.ts +1 -1
  101. package/cdn-versioned/components/notification/notification.d.ts +1 -1
  102. package/cdn-versioned/components/optgroup/optgroup.d.ts +1 -1
  103. package/cdn-versioned/components/option/option.d.ts +1 -1
  104. package/cdn-versioned/components/popup/popup.d.ts +1 -1
  105. package/cdn-versioned/components/quickfact/quickfact.d.ts +1 -1
  106. package/cdn-versioned/components/radio/radio.d.ts +1 -1
  107. package/cdn-versioned/components/radio-button/radio-button.d.ts +1 -1
  108. package/cdn-versioned/components/radio-group/radio-group.d.ts +1 -1
  109. package/cdn-versioned/components/range/range.d.ts +1 -1
  110. package/cdn-versioned/components/range-tick/range-tick.d.ts +1 -1
  111. package/cdn-versioned/components/scrollable/scrollable.d.ts +1 -1
  112. package/cdn-versioned/components/select/select.d.ts +1 -1
  113. package/cdn-versioned/components/spinner/spinner.d.ts +1 -1
  114. package/cdn-versioned/components/step/step.d.ts +1 -1
  115. package/cdn-versioned/components/step-group/step-group.d.ts +1 -1
  116. package/cdn-versioned/components/switch/switch.d.ts +1 -1
  117. package/cdn-versioned/components/tab/tab.d.ts +1 -1
  118. package/cdn-versioned/components/tab-group/tab-group.d.ts +1 -1
  119. package/cdn-versioned/components/tab-panel/tab-panel.d.ts +1 -1
  120. package/cdn-versioned/components/tag/tag.d.ts +1 -1
  121. package/cdn-versioned/components/textarea/textarea.d.ts +1 -1
  122. package/cdn-versioned/components/tooltip/tooltip.d.ts +1 -1
  123. package/cdn-versioned/components/video/video.d.ts +1 -1
  124. package/cdn-versioned/custom-elements.json +238 -238
  125. package/cdn-versioned/internal/form.js +3 -3
  126. package/cdn-versioned/solid-components.bundle.js +14 -14
  127. package/cdn-versioned/solid-components.css +2 -2
  128. package/cdn-versioned/solid-components.iife.js +14 -14
  129. package/cdn-versioned/solid-components.js +1 -1
  130. package/cdn-versioned/vscode.html-custom-data.json +91 -91
  131. package/cdn-versioned/web-types.json +154 -154
  132. package/dist/chunks/{chunk.2AQLDT5K.js → chunk.Y62XG7YE.js} +17 -1
  133. package/dist/components/carousel/carousel.js +1 -1
  134. package/dist/custom-elements.json +1 -1
  135. package/dist/solid-components.js +4 -4
  136. package/dist/web-types.json +1 -1
  137. package/dist-versioned/chunks/chunk.257BQ5G3.js +2 -2
  138. package/dist-versioned/chunks/chunk.2TPMKDGR.js +1 -1
  139. package/dist-versioned/chunks/chunk.2Z23SMCT.js +2 -2
  140. package/dist-versioned/chunks/chunk.34JZVZG6.js +2 -2
  141. package/dist-versioned/chunks/chunk.45EBRFJS.js +1 -1
  142. package/dist-versioned/chunks/chunk.4CMRVAWO.js +6 -6
  143. package/dist-versioned/chunks/chunk.6DKXZWRN.js +4 -4
  144. package/dist-versioned/chunks/chunk.6S62Y3SN.js +2 -2
  145. package/dist-versioned/chunks/chunk.A6F5UBS5.js +1 -1
  146. package/dist-versioned/chunks/chunk.AO5E3XWU.js +2 -2
  147. package/dist-versioned/chunks/chunk.C7HV6GLS.js +1 -1
  148. package/dist-versioned/chunks/chunk.CWOPJ6AE.js +2 -2
  149. package/dist-versioned/chunks/chunk.CYAZC6LN.js +3 -3
  150. package/dist-versioned/chunks/chunk.CZ5NVXDL.js +2 -2
  151. package/dist-versioned/chunks/chunk.DC7DGLHJ.js +1 -1
  152. package/dist-versioned/chunks/chunk.DT3ZL7JI.js +12 -12
  153. package/dist-versioned/chunks/chunk.ELPOH7TW.js +11 -11
  154. package/dist-versioned/chunks/chunk.F2UZ5T7G.js +5 -5
  155. package/dist-versioned/chunks/chunk.GCRESMVG.js +3 -3
  156. package/dist-versioned/chunks/chunk.HBX6PDXK.js +4 -4
  157. package/dist-versioned/chunks/chunk.IJ2YK4AW.js +4 -4
  158. package/dist-versioned/chunks/chunk.IJIJ7YVU.js +1 -1
  159. package/dist-versioned/chunks/chunk.ILB62SSN.js +3 -3
  160. package/dist-versioned/chunks/chunk.IYSGB2DQ.js +5 -5
  161. package/dist-versioned/chunks/chunk.J3K6PVKE.js +2 -2
  162. package/dist-versioned/chunks/chunk.JSVTNGBN.js +2 -2
  163. package/dist-versioned/chunks/chunk.KEJFWGZI.js +4 -4
  164. package/dist-versioned/chunks/chunk.KENPSAUU.js +1 -1
  165. package/dist-versioned/chunks/chunk.KZLAI4DK.js +1 -1
  166. package/dist-versioned/chunks/chunk.LNGJFVKN.js +2 -2
  167. package/dist-versioned/chunks/chunk.M55G2PHP.js +2 -2
  168. package/dist-versioned/chunks/chunk.MDZHXHUH.js +3 -3
  169. package/dist-versioned/chunks/chunk.MML77VKL.js +2 -2
  170. package/dist-versioned/chunks/chunk.NR3OWI4Y.js +1 -1
  171. package/dist-versioned/chunks/chunk.NSCG7U5D.js +14 -14
  172. package/dist-versioned/chunks/chunk.NZFEW5QU.js +1 -1
  173. package/dist-versioned/chunks/chunk.PAGQREWS.js +4 -4
  174. package/dist-versioned/chunks/chunk.PUT4BQ4M.js +5 -5
  175. package/dist-versioned/chunks/chunk.PVFVGCKE.js +1 -1
  176. package/dist-versioned/chunks/chunk.QENOXTAG.js +26 -26
  177. package/dist-versioned/chunks/chunk.QGSAYCDJ.js +5 -5
  178. package/dist-versioned/chunks/chunk.QIWHR4XZ.js +1 -1
  179. package/dist-versioned/chunks/chunk.QW32IQ37.js +6 -6
  180. package/dist-versioned/chunks/chunk.RVZPI7LZ.js +8 -8
  181. package/dist-versioned/chunks/chunk.THYGJ3F3.js +2 -2
  182. package/dist-versioned/chunks/chunk.TUOYTASX.js +3 -3
  183. package/dist-versioned/chunks/chunk.U44CWPXO.js +3 -3
  184. package/dist-versioned/chunks/chunk.U6LFASA7.js +1 -1
  185. package/dist-versioned/chunks/chunk.UIQBHPD3.js +2 -2
  186. package/dist-versioned/chunks/chunk.WDWZFQ4X.js +2 -2
  187. package/dist-versioned/chunks/chunk.XCQC3F3H.js +3 -3
  188. package/dist-versioned/chunks/chunk.XIRK4KQ5.js +3 -3
  189. package/dist-versioned/chunks/chunk.XK3MBLKI.js +24 -24
  190. package/dist-versioned/chunks/chunk.XVNT7HIE.js +1 -1
  191. package/dist-versioned/chunks/chunk.XX3EFOOF.js +3 -3
  192. package/dist-versioned/chunks/chunk.XZDQNDB2.js +12 -12
  193. package/dist-versioned/chunks/{chunk.2AQLDT5K.js → chunk.Y62XG7YE.js} +23 -7
  194. package/dist-versioned/chunks/chunk.Y7TQJEA7.js +2 -2
  195. package/dist-versioned/chunks/chunk.YFRXAKBQ.js +1 -1
  196. package/dist-versioned/chunks/chunk.YXP3Q4D5.js +2 -2
  197. package/dist-versioned/chunks/chunk.ZNPGMZAM.js +1 -1
  198. package/dist-versioned/components/accordion/accordion.d.ts +1 -1
  199. package/dist-versioned/components/accordion-group/accordion-group.d.ts +1 -1
  200. package/dist-versioned/components/animation/animation.d.ts +1 -1
  201. package/dist-versioned/components/audio/audio.d.ts +1 -1
  202. package/dist-versioned/components/badge/badge.d.ts +1 -1
  203. package/dist-versioned/components/brandshape/brandshape.d.ts +1 -1
  204. package/dist-versioned/components/breadcrumb/breadcrumb.d.ts +1 -1
  205. package/dist-versioned/components/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  206. package/dist-versioned/components/button/button.d.ts +1 -1
  207. package/dist-versioned/components/button-group/button-group.d.ts +1 -1
  208. package/dist-versioned/components/carousel/carousel.d.ts +1 -1
  209. package/dist-versioned/components/carousel/carousel.js +1 -1
  210. package/dist-versioned/components/carousel-item/carousel-item.d.ts +1 -1
  211. package/dist-versioned/components/checkbox/checkbox.d.ts +1 -1
  212. package/dist-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
  213. package/dist-versioned/components/combobox/combobox.d.ts +1 -1
  214. package/dist-versioned/components/dialog/dialog.d.ts +1 -1
  215. package/dist-versioned/components/divider/divider.d.ts +1 -1
  216. package/dist-versioned/components/drawer/drawer.d.ts +1 -1
  217. package/dist-versioned/components/dropdown/dropdown.d.ts +1 -1
  218. package/dist-versioned/components/expandable/expandable.d.ts +1 -1
  219. package/dist-versioned/components/flipcard/flipcard.d.ts +1 -1
  220. package/dist-versioned/components/header/header.d.ts +1 -1
  221. package/dist-versioned/components/icon/icon.d.ts +1 -1
  222. package/dist-versioned/components/include/include.d.ts +1 -1
  223. package/dist-versioned/components/input/input.d.ts +1 -1
  224. package/dist-versioned/components/link/link.d.ts +1 -1
  225. package/dist-versioned/components/loader/loader.d.ts +1 -1
  226. package/dist-versioned/components/map-marker/map-marker.d.ts +1 -1
  227. package/dist-versioned/components/menu/menu.d.ts +1 -1
  228. package/dist-versioned/components/menu-item/menu-item.d.ts +1 -1
  229. package/dist-versioned/components/navigation-item/navigation-item.d.ts +1 -1
  230. package/dist-versioned/components/notification/notification.d.ts +1 -1
  231. package/dist-versioned/components/optgroup/optgroup.d.ts +1 -1
  232. package/dist-versioned/components/option/option.d.ts +1 -1
  233. package/dist-versioned/components/popup/popup.d.ts +1 -1
  234. package/dist-versioned/components/quickfact/quickfact.d.ts +1 -1
  235. package/dist-versioned/components/radio/radio.d.ts +1 -1
  236. package/dist-versioned/components/radio-button/radio-button.d.ts +1 -1
  237. package/dist-versioned/components/radio-group/radio-group.d.ts +1 -1
  238. package/dist-versioned/components/range/range.d.ts +1 -1
  239. package/dist-versioned/components/range-tick/range-tick.d.ts +1 -1
  240. package/dist-versioned/components/scrollable/scrollable.d.ts +1 -1
  241. package/dist-versioned/components/select/select.d.ts +1 -1
  242. package/dist-versioned/components/spinner/spinner.d.ts +1 -1
  243. package/dist-versioned/components/step/step.d.ts +1 -1
  244. package/dist-versioned/components/step-group/step-group.d.ts +1 -1
  245. package/dist-versioned/components/switch/switch.d.ts +1 -1
  246. package/dist-versioned/components/tab/tab.d.ts +1 -1
  247. package/dist-versioned/components/tab-group/tab-group.d.ts +1 -1
  248. package/dist-versioned/components/tab-panel/tab-panel.d.ts +1 -1
  249. package/dist-versioned/components/tag/tag.d.ts +1 -1
  250. package/dist-versioned/components/textarea/textarea.d.ts +1 -1
  251. package/dist-versioned/components/tooltip/tooltip.d.ts +1 -1
  252. package/dist-versioned/components/video/video.d.ts +1 -1
  253. package/dist-versioned/custom-elements.json +238 -238
  254. package/dist-versioned/internal/form.js +3 -3
  255. package/dist-versioned/solid-components.css +2 -2
  256. package/dist-versioned/solid-components.js +4 -4
  257. package/dist-versioned/vscode.html-custom-data.json +91 -91
  258. package/dist-versioned/web-types.json +154 -154
  259. package/package.json +1 -1
  260. package/cdn/chunks/chunk.G43QKY2C.js +0 -11
  261. package/cdn-versioned/chunks/chunk.G43QKY2C.js +0 -11
@@ -1 +1 @@
1
- import{e as p}from"./chunk.ZR5P6TQI.js";import{a as l,b as m}from"./chunk.TJOCV4DC.js";var a=new WeakMap,n=new WeakMap,c=new WeakMap,d=new WeakMap,v=class{constructor(t,e){this.handleFormData=t=>{let e=this.options.disabled(this.host),o=this.options.name(this.host),i=this.options.value(this.host),s=this.host.tagName.toLowerCase()==="sd-5-15-5-button";!e&&!s&&typeof o=="string"&&o.length>0&&typeof i!="undefined"&&(Array.isArray(i)?i.forEach(r=>{t.formData.append(o,r.toString())}):t.formData.append(o,i.toString()))};this.handleFormSubmit=t=>{var i,s;let e=this.options.disabled(this.host),o=this.options.reportValidity;if(this.form&&!this.form.noValidate&&((i=a.get(this.form))==null||i.forEach(r=>{this.setUserInteracted(r,!0)})),this.form&&!this.form.noValidate&&!e&&!o(this.host)){t.preventDefault(),t.stopImmediatePropagation();let r=(s=this.form)==null?void 0:s.querySelectorAll("[data-invalid]");Array.from(r).filter(h=>h.tagName.toLowerCase()==="sd-5-15-5-radio-group").forEach(h=>{var f,u;(u=(f=h.shadowRoot)==null?void 0:f.querySelector("input"))==null||u.dispatchEvent(new Event("invalid"))}),r!=null&&r.length&&r[0].focus()}};this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),d.set(this.host,[])};this.handleInteraction=t=>{let e=d.get(this.host);e.includes(t.type)||e.push(t.type),e.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)};this.fakeUserInteraction=()=>{this.setUserInteracted(this.host,!0)};(this.host=t).addController(this),this.options=l({form:o=>{if(o.hasAttribute("form")&&o.getAttribute("form")!==""){let i=o.getRootNode(),s=o.getAttribute("form");if(s)return i.getElementById(s)}return o.closest("form")},name:o=>o.name,value:o=>o.value,defaultValue:o=>o.defaultValue,disabled:o=>{var i;return(i=o.disabled)!=null?i:!1},reportValidity:o=>typeof o.reportValidity=="function"?o.reportValidity():!0,setValue:(o,i)=>o.value=i,assumeInteractionOn:["sd-5-15-5-input"]},e)}hostConnected(){let t=this.options.form(this.host);t&&this.attachForm(t),d.set(this.host,[]),this.options.assumeInteractionOn.forEach(e=>{this.host.addEventListener(e,this.handleInteraction)})}hostDisconnected(){this.detachForm(),d.delete(this.host),this.options.assumeInteractionOn.forEach(t=>{this.host.removeEventListener(t,this.handleInteraction)})}hostUpdated(){var e;let t=this.options.form(this.host);t||this.detachForm(),t&&this.form!==t&&(this.detachForm(),this.attachForm(t)),this.host.hasUpdated&&(this.setValidity((e=this.host)==null?void 0:e.validity.valid),this.updateValidityStyle())}attachForm(t){t?(this.form=t,a.has(this.form)?a.get(this.form).add(this.host):a.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),n.has(this.form)||(n.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity())):this.form=void 0}detachForm(){var t;this.form&&((t=a.get(this.form))==null||t.delete(this.host),this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),n.has(this.form)&&(this.form.reportValidity=n.get(this.form),n.delete(this.form))),this.form=void 0}reportFormValidity(){if(this.form&&!this.form.noValidate){let t=this.form.querySelectorAll("*");for(let e of t)if(typeof e.reportValidity=="function"&&!e.reportValidity())return!1}return!0}setUserInteracted(t,e){c.set(t,e),t.requestUpdate()}doAction(t,e){if(this.form){let o=document.createElement("button");o.type=t,o.style.position="absolute",o.style.width="0",o.style.height="0",o.style.clipPath="inset(50%)",o.style.overflow="hidden",o.style.whiteSpace="nowrap",e&&(o.name=e.name,o.value=e.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach(i=>{e.hasAttribute(i)&&o.setAttribute(i,e.getAttribute(i))})),this.form.append(o),o.click(),o.remove()}}updateValidityStyle(){this.host.hasAttribute("data-user-valid")&&this.host.checkValidity()?(this.host.showValidStyle!==void 0&&(this.host.showValidStyle=!0),this.host.showInvalidStyle=!1):this.host.hasAttribute("data-user-invalid")&&!this.host.checkValidity()?(this.host.showValidStyle!==void 0&&(this.host.showValidStyle=!1),this.host.showInvalidStyle=!0):(this.host.showValidStyle!==void 0&&(this.host.showValidStyle=!1),this.host.showInvalidStyle=!1)}getForm(){var t;return(t=this.form)!=null?t:null}renderInvalidMessage(){return p`<div id="invalid-message" class="text-error text-sm mt-1 text-left" part="invalid-message" aria-live="polite" ?hidden="${!this.host.showInvalidStyle}"></div>`}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}setValidity(t){var s;let e=this.host,o=!!c.get(e),i=!!e.required;(s=this.form)!=null&&s.noValidate?(e.removeAttribute("data-required"),e.removeAttribute("data-optional"),e.removeAttribute("data-invalid"),e.removeAttribute("data-valid"),e.removeAttribute("data-user-invalid"),e.removeAttribute("data-user-valid"),e.removeAttribute("aria-invalid")):(e.toggleAttribute("data-required",i),e.toggleAttribute("data-optional",!i),e.toggleAttribute("data-invalid",!t),e.toggleAttribute("data-valid",t),e.toggleAttribute("data-user-invalid",!t&&o),e.toggleAttribute("data-user-valid",t&&o),e.setAttribute("aria-invalid",(!t).toString()))}updateValidity(){let t=this.host;this.setValidity(t==null?void 0:t.validity.valid)}emitInvalidEvent(t){t==null||t.preventDefault();let e=new CustomEvent("sd-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});t||e.preventDefault()}},y=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1}),F=Object.freeze(m(l({},y),{valid:!1,valueMissing:!0})),V=Object.freeze(m(l({},y),{valid:!1,customError:!0}));export{a,v as b,y as c,F as d,V as e};
1
+ import{e as p}from"./chunk.ZR5P6TQI.js";import{a as l,b as m}from"./chunk.TJOCV4DC.js";var a=new WeakMap,n=new WeakMap,c=new WeakMap,d=new WeakMap,v=class{constructor(t,e){this.handleFormData=t=>{let e=this.options.disabled(this.host),o=this.options.name(this.host),i=this.options.value(this.host),s=this.host.tagName.toLowerCase()==="sd-5-15-6-button";!e&&!s&&typeof o=="string"&&o.length>0&&typeof i!="undefined"&&(Array.isArray(i)?i.forEach(r=>{t.formData.append(o,r.toString())}):t.formData.append(o,i.toString()))};this.handleFormSubmit=t=>{var i,s;let e=this.options.disabled(this.host),o=this.options.reportValidity;if(this.form&&!this.form.noValidate&&((i=a.get(this.form))==null||i.forEach(r=>{this.setUserInteracted(r,!0)})),this.form&&!this.form.noValidate&&!e&&!o(this.host)){t.preventDefault(),t.stopImmediatePropagation();let r=(s=this.form)==null?void 0:s.querySelectorAll("[data-invalid]");Array.from(r).filter(h=>h.tagName.toLowerCase()==="sd-5-15-6-radio-group").forEach(h=>{var f,u;(u=(f=h.shadowRoot)==null?void 0:f.querySelector("input"))==null||u.dispatchEvent(new Event("invalid"))}),r!=null&&r.length&&r[0].focus()}};this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),d.set(this.host,[])};this.handleInteraction=t=>{let e=d.get(this.host);e.includes(t.type)||e.push(t.type),e.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)};this.fakeUserInteraction=()=>{this.setUserInteracted(this.host,!0)};(this.host=t).addController(this),this.options=l({form:o=>{if(o.hasAttribute("form")&&o.getAttribute("form")!==""){let i=o.getRootNode(),s=o.getAttribute("form");if(s)return i.getElementById(s)}return o.closest("form")},name:o=>o.name,value:o=>o.value,defaultValue:o=>o.defaultValue,disabled:o=>{var i;return(i=o.disabled)!=null?i:!1},reportValidity:o=>typeof o.reportValidity=="function"?o.reportValidity():!0,setValue:(o,i)=>o.value=i,assumeInteractionOn:["sd-5-15-6-input"]},e)}hostConnected(){let t=this.options.form(this.host);t&&this.attachForm(t),d.set(this.host,[]),this.options.assumeInteractionOn.forEach(e=>{this.host.addEventListener(e,this.handleInteraction)})}hostDisconnected(){this.detachForm(),d.delete(this.host),this.options.assumeInteractionOn.forEach(t=>{this.host.removeEventListener(t,this.handleInteraction)})}hostUpdated(){var e;let t=this.options.form(this.host);t||this.detachForm(),t&&this.form!==t&&(this.detachForm(),this.attachForm(t)),this.host.hasUpdated&&(this.setValidity((e=this.host)==null?void 0:e.validity.valid),this.updateValidityStyle())}attachForm(t){t?(this.form=t,a.has(this.form)?a.get(this.form).add(this.host):a.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),n.has(this.form)||(n.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity())):this.form=void 0}detachForm(){var t;this.form&&((t=a.get(this.form))==null||t.delete(this.host),this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),n.has(this.form)&&(this.form.reportValidity=n.get(this.form),n.delete(this.form))),this.form=void 0}reportFormValidity(){if(this.form&&!this.form.noValidate){let t=this.form.querySelectorAll("*");for(let e of t)if(typeof e.reportValidity=="function"&&!e.reportValidity())return!1}return!0}setUserInteracted(t,e){c.set(t,e),t.requestUpdate()}doAction(t,e){if(this.form){let o=document.createElement("button");o.type=t,o.style.position="absolute",o.style.width="0",o.style.height="0",o.style.clipPath="inset(50%)",o.style.overflow="hidden",o.style.whiteSpace="nowrap",e&&(o.name=e.name,o.value=e.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach(i=>{e.hasAttribute(i)&&o.setAttribute(i,e.getAttribute(i))})),this.form.append(o),o.click(),o.remove()}}updateValidityStyle(){this.host.hasAttribute("data-user-valid")&&this.host.checkValidity()?(this.host.showValidStyle!==void 0&&(this.host.showValidStyle=!0),this.host.showInvalidStyle=!1):this.host.hasAttribute("data-user-invalid")&&!this.host.checkValidity()?(this.host.showValidStyle!==void 0&&(this.host.showValidStyle=!1),this.host.showInvalidStyle=!0):(this.host.showValidStyle!==void 0&&(this.host.showValidStyle=!1),this.host.showInvalidStyle=!1)}getForm(){var t;return(t=this.form)!=null?t:null}renderInvalidMessage(){return p`<div id="invalid-message" class="text-error text-sm mt-1 text-left" part="invalid-message" aria-live="polite" ?hidden="${!this.host.showInvalidStyle}"></div>`}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}setValidity(t){var s;let e=this.host,o=!!c.get(e),i=!!e.required;(s=this.form)!=null&&s.noValidate?(e.removeAttribute("data-required"),e.removeAttribute("data-optional"),e.removeAttribute("data-invalid"),e.removeAttribute("data-valid"),e.removeAttribute("data-user-invalid"),e.removeAttribute("data-user-valid"),e.removeAttribute("aria-invalid")):(e.toggleAttribute("data-required",i),e.toggleAttribute("data-optional",!i),e.toggleAttribute("data-invalid",!t),e.toggleAttribute("data-valid",t),e.toggleAttribute("data-user-invalid",!t&&o),e.toggleAttribute("data-user-valid",t&&o),e.setAttribute("aria-invalid",(!t).toString()))}updateValidity(){let t=this.host;this.setValidity(t==null?void 0:t.validity.valid)}emitInvalidEvent(t){t==null||t.preventDefault();let e=new CustomEvent("sd-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});t||e.preventDefault()}},y=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1}),F=Object.freeze(m(l({},y),{valid:!1,valueMissing:!0})),V=Object.freeze(m(l({},y),{valid:!1,customError:!0}));export{a,v as b,y as c,F as d,V as e};
@@ -1 +1 @@
1
- import{a as g,b as v}from"./chunk.I2H6CZK5.js";import{a as d,c as h}from"./chunk.SKUMYG4O.js";import{a as y}from"./chunk.KLRPP4NQ.js";import{a as r}from"./chunk.26V4EXHB.js";import{a as H}from"./chunk.Y7NVH75J.js";import{a as f}from"./chunk.E2DRD2OX.js";import{a as T,b as a,d as u,h as w}from"./chunk.HVSHE3SX.js";import{b as k,e as p}from"./chunk.ZR5P6TQI.js";import{b as n,e as l,f as b}from"./chunk.6OTM3PE5.js";import{e}from"./chunk.TJOCV4DC.js";var m={"top-right":null,"bottom-center":null},$=()=>{Object.entries(m).forEach(([s])=>{let c=document.querySelector(`#sd-toast-stack--${s}`);if(c){c.setAttribute("role","region"),m[s]=c;return}m[s]=Object.assign(document.createElement("div"),{role:"region",id:`sd-toast-stack--${s}`,className:`sd-toast-stack sd-toast-stack--${s}`})})};$();var t=class extends w{constructor(){super(...arguments);this.localize=new H(this);this.variant="info";this.open=!1;this.closable=!1;this.duration=1/0;this.durationIndicator=!1;this.toastStack="top-right";this.remainingDuration=this.duration;this.startTime=Date.now()}get stack(){return m[this.toastStack]}connectedCallback(){super.connectedCallback(),this.stack.parentElement||(document.body.append(this.stack),this.stack.ariaLabel=this.localize.term("notifications"))}disconnectedCallback(){super.disconnectedCallback()}firstUpdated(){this.wrapper.hidden=!this.open}startAutoHide(){clearTimeout(this.autoHideTimeout),this.startTime=Date.now(),this.remainingDuration=this.duration,this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>this.hide(),this.duration))}onHover(){clearTimeout(this.autoHideTimeout),this.duration<1/0&&(this.remainingDuration-=Date.now()-this.startTime)}onHoverEnd(){this.startTime=Date.now(),clearTimeout(this.autoHideTimeout),this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>{this.hide()},this.remainingDuration))}handleCloseClick(){this.hide()}handleKeyDown(i){this.closable&&i.key==="Escape"&&this.hide()}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.duration<1/0&&this.startAutoHide(),await Promise.all([l(this.base),l(this.wrapper)]),this.wrapper.hidden=!1;let i=h(this,"notification.show",{dir:this.localize.dir()}),o=h(this,`notification.wrapper.show${g(v(this.toastStack))}`,{dir:this.localize.dir()});await Promise.all([n(this.base,b(i.keyframes,this.base.scrollHeight),i.options),n(this.wrapper,o.keyframes,o.options)]),this.emit("sd-after-show")}else{this.emit("sd-hide"),clearTimeout(this.autoHideTimeout),await Promise.all([l(this.base),l(this.wrapper)]);let i=h(this,"notification.hide",{dir:this.localize.dir()}),o=h(this,`notification.wrapper.hide${g(v(this.toastStack))}`,{dir:this.localize.dir()});await Promise.all([n(this.base,b(i.keyframes,this.base.scrollHeight),i.options),n(this.wrapper,o.keyframes,o.options)]),this.wrapper.hidden=!0,this.emit("sd-after-hide")}}handleDurationChange(){this.startAutoHide()}async show(){if(!this.open)return this.open=!0,y(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,y(this,"sd-after-hide")}async toast(){return new Promise(i=>{this.stack.parentElement===null&&document.body.append(this.stack),this.stack.appendChild(this),requestAnimationFrame(()=>{this.clientWidth,this.show()}),this.addEventListener("sd-after-hide",()=>{this.stack.removeChild(this),i()},{once:!0})})}render(){return p`<div part="base" class="${r("w-full flex items-stretch m-2 focus-visible:focus-outline")}" id="notification" tabindex="0" role="alert" aria-labelledby="message" aria-hidden="${this.open?"false":"true"}" @mouseenter="${this.onHover}" @mouseleave="${this.onHoverEnd}" @keydown="${this.handleKeyDown}"><div part="wrapper" class="${r("w-full h-fit overflow-hidden flex items-stretch relative")}"><slot name="icon" part="icon" class="${r("min-w-min flex items-center px-3 justify-center",{info:"bg-info",success:"bg-success",warning:"bg-warning",error:"bg-error"}[this.variant])}"><sd-5-15-5-icon name="${{info:"info-circle",success:"confirm-circle",warning:"exclamation-circle",error:"warning"}[this.variant]||""}" library="_internal" class="h-6 w-6 text-white"></sd-5-15-5-icon></slot><div part="content" class="${r("h-full w-full p-1 gap-2 flex items-center justify-stretch bg-white","border-solid border-[1px] border-l-0 border-neutral-400")}"><slot id="message" part="message" class="block w-full pl-3 py-2"></slot>${this.closable?p`<sd-5-15-5-button size="md" variant="tertiary" part="close-button" class="ml-auto flex flex-[0_0_auto] items-stretch" @click="${this.handleCloseClick}"><sd-5-15-5-icon label="${this.localize.term("close")}" name="close" library="_internal" color="currentColor"></sd-5-15-5-icon></sd-5-15-5-button>`:""}</div>${this.durationIndicator?p`<div part="duration-indicator__elapsed" id="duration-indicator__elapsed" style="${`animation-duration: ${this.duration}ms`}" class="${r("absolute w-0 h-[2px] bottom-0 bg-primary z-10 animate-grow")}"></div><div part="duration-indicator__total" class="w-full h-[2px] bottom-0 absolute border border-neutral-400"></div>`:""}</div></div>`}};t.styles=[...w.styles,k`:host{display:contents}#notification:hover #duration-indicator__elapsed{animation-play-state:paused!important}`],e([u('[part~="base"]')],t.prototype,"base",2),e([u('[part~="wrapper"]')],t.prototype,"wrapper",2),e([u('[part~="close-button"]')],t.prototype,"close",2),e([a({type:String,reflect:!0})],t.prototype,"variant",2),e([a({type:Boolean,reflect:!0})],t.prototype,"open",2),e([a({type:Boolean,reflect:!0})],t.prototype,"closable",2),e([a({type:Number,reflect:!0})],t.prototype,"duration",2),e([a({type:Boolean,reflect:!0,attribute:"duration-indicator"})],t.prototype,"durationIndicator",2),e([a({type:String,reflect:!0,attribute:"toast-stack"})],t.prototype,"toastStack",2),e([f("open",{waitUntilFirstUpdate:!0})],t.prototype,"handleOpenChange",1),e([f("duration")],t.prototype,"handleDurationChange",1),t=e([T("sd-5-15-5-notification")],t);d("notification.show",{keyframes:[{opacity:0,height:0},{opacity:1,height:"auto"}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});d("notification.hide",{keyframes:[{opacity:1,height:"auto"},{opacity:0,height:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});d("notification.wrapper.showTopRight",{keyframes:[{bottom:"32px"},{bottom:"0"}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});d("notification.wrapper.hideTopRight",{keyframes:[{bottom:"0"},{bottom:"32px"}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{t as a};
1
+ import{a as g,b as v}from"./chunk.I2H6CZK5.js";import{a as d,c as h}from"./chunk.SKUMYG4O.js";import{a as y}from"./chunk.KLRPP4NQ.js";import{a as r}from"./chunk.26V4EXHB.js";import{a as H}from"./chunk.Y7NVH75J.js";import{a as f}from"./chunk.E2DRD2OX.js";import{a as T,b as a,d as u,h as w}from"./chunk.HVSHE3SX.js";import{b as k,e as p}from"./chunk.ZR5P6TQI.js";import{b as n,e as l,f as b}from"./chunk.6OTM3PE5.js";import{e}from"./chunk.TJOCV4DC.js";var m={"top-right":null,"bottom-center":null},$=()=>{Object.entries(m).forEach(([s])=>{let c=document.querySelector(`#sd-toast-stack--${s}`);if(c){c.setAttribute("role","region"),m[s]=c;return}m[s]=Object.assign(document.createElement("div"),{role:"region",id:`sd-toast-stack--${s}`,className:`sd-toast-stack sd-toast-stack--${s}`})})};$();var t=class extends w{constructor(){super(...arguments);this.localize=new H(this);this.variant="info";this.open=!1;this.closable=!1;this.duration=1/0;this.durationIndicator=!1;this.toastStack="top-right";this.remainingDuration=this.duration;this.startTime=Date.now()}get stack(){return m[this.toastStack]}connectedCallback(){super.connectedCallback(),this.stack.parentElement||(document.body.append(this.stack),this.stack.ariaLabel=this.localize.term("notifications"))}disconnectedCallback(){super.disconnectedCallback()}firstUpdated(){this.wrapper.hidden=!this.open}startAutoHide(){clearTimeout(this.autoHideTimeout),this.startTime=Date.now(),this.remainingDuration=this.duration,this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>this.hide(),this.duration))}onHover(){clearTimeout(this.autoHideTimeout),this.duration<1/0&&(this.remainingDuration-=Date.now()-this.startTime)}onHoverEnd(){this.startTime=Date.now(),clearTimeout(this.autoHideTimeout),this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>{this.hide()},this.remainingDuration))}handleCloseClick(){this.hide()}handleKeyDown(i){this.closable&&i.key==="Escape"&&this.hide()}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.duration<1/0&&this.startAutoHide(),await Promise.all([l(this.base),l(this.wrapper)]),this.wrapper.hidden=!1;let i=h(this,"notification.show",{dir:this.localize.dir()}),o=h(this,`notification.wrapper.show${g(v(this.toastStack))}`,{dir:this.localize.dir()});await Promise.all([n(this.base,b(i.keyframes,this.base.scrollHeight),i.options),n(this.wrapper,o.keyframes,o.options)]),this.emit("sd-after-show")}else{this.emit("sd-hide"),clearTimeout(this.autoHideTimeout),await Promise.all([l(this.base),l(this.wrapper)]);let i=h(this,"notification.hide",{dir:this.localize.dir()}),o=h(this,`notification.wrapper.hide${g(v(this.toastStack))}`,{dir:this.localize.dir()});await Promise.all([n(this.base,b(i.keyframes,this.base.scrollHeight),i.options),n(this.wrapper,o.keyframes,o.options)]),this.wrapper.hidden=!0,this.emit("sd-after-hide")}}handleDurationChange(){this.startAutoHide()}async show(){if(!this.open)return this.open=!0,y(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,y(this,"sd-after-hide")}async toast(){return new Promise(i=>{this.stack.parentElement===null&&document.body.append(this.stack),this.stack.appendChild(this),requestAnimationFrame(()=>{this.clientWidth,this.show()}),this.addEventListener("sd-after-hide",()=>{this.stack.removeChild(this),i()},{once:!0})})}render(){return p`<div part="base" class="${r("w-full flex items-stretch m-2 focus-visible:focus-outline")}" id="notification" tabindex="0" role="alert" aria-labelledby="message" aria-hidden="${this.open?"false":"true"}" @mouseenter="${this.onHover}" @mouseleave="${this.onHoverEnd}" @keydown="${this.handleKeyDown}"><div part="wrapper" class="${r("w-full h-fit overflow-hidden flex items-stretch relative")}"><slot name="icon" part="icon" class="${r("min-w-min flex items-center px-3 justify-center",{info:"bg-info",success:"bg-success",warning:"bg-warning",error:"bg-error"}[this.variant])}"><sd-5-15-6-icon name="${{info:"info-circle",success:"confirm-circle",warning:"exclamation-circle",error:"warning"}[this.variant]||""}" library="_internal" class="h-6 w-6 text-white"></sd-5-15-6-icon></slot><div part="content" class="${r("h-full w-full p-1 gap-2 flex items-center justify-stretch bg-white","border-solid border-[1px] border-l-0 border-neutral-400")}"><slot id="message" part="message" class="block w-full pl-3 py-2"></slot>${this.closable?p`<sd-5-15-6-button size="md" variant="tertiary" part="close-button" class="ml-auto flex flex-[0_0_auto] items-stretch" @click="${this.handleCloseClick}"><sd-5-15-6-icon label="${this.localize.term("close")}" name="close" library="_internal" color="currentColor"></sd-5-15-6-icon></sd-5-15-6-button>`:""}</div>${this.durationIndicator?p`<div part="duration-indicator__elapsed" id="duration-indicator__elapsed" style="${`animation-duration: ${this.duration}ms`}" class="${r("absolute w-0 h-[2px] bottom-0 bg-primary z-10 animate-grow")}"></div><div part="duration-indicator__total" class="w-full h-[2px] bottom-0 absolute border border-neutral-400"></div>`:""}</div></div>`}};t.styles=[...w.styles,k`:host{display:contents}#notification:hover #duration-indicator__elapsed{animation-play-state:paused!important}`],e([u('[part~="base"]')],t.prototype,"base",2),e([u('[part~="wrapper"]')],t.prototype,"wrapper",2),e([u('[part~="close-button"]')],t.prototype,"close",2),e([a({type:String,reflect:!0})],t.prototype,"variant",2),e([a({type:Boolean,reflect:!0})],t.prototype,"open",2),e([a({type:Boolean,reflect:!0})],t.prototype,"closable",2),e([a({type:Number,reflect:!0})],t.prototype,"duration",2),e([a({type:Boolean,reflect:!0,attribute:"duration-indicator"})],t.prototype,"durationIndicator",2),e([a({type:String,reflect:!0,attribute:"toast-stack"})],t.prototype,"toastStack",2),e([f("open",{waitUntilFirstUpdate:!0})],t.prototype,"handleOpenChange",1),e([f("duration")],t.prototype,"handleDurationChange",1),t=e([T("sd-5-15-6-notification")],t);d("notification.show",{keyframes:[{opacity:0,height:0},{opacity:1,height:"auto"}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});d("notification.hide",{keyframes:[{opacity:1,height:"auto"},{opacity:0,height:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});d("notification.wrapper.showTopRight",{keyframes:[{bottom:"32px"},{bottom:"0"}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});d("notification.wrapper.hideTopRight",{keyframes:[{bottom:"0"},{bottom:"32px"}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{t as a};
@@ -1 +1 @@
1
- import{a as A}from"./chunk.63JDND76.js";import{a as z}from"./chunk.WM6VARGR.js";import{a as L}from"./chunk.RTXVVB2O.js";import{b as F}from"./chunk.7JV32P5Q.js";import{a as M}from"./chunk.CGQ2BPPZ.js";import{a as n}from"./chunk.GLVMB2MH.js";import{a as P,b as V}from"./chunk.D6LAH53B.js";import{a}from"./chunk.26V4EXHB.js";import{a as T}from"./chunk.Y7NVH75J.js";import{a as m}from"./chunk.E2DRD2OX.js";import{a as E,b as s,c as p,d as v,h as y}from"./chunk.HVSHE3SX.js";import{b as C,e as r,h as k,i as D}from"./chunk.ZR5P6TQI.js";import{a as $,e as i}from"./chunk.TJOCV4DC.js";var g=class extends A{constructor(e){super(e);this.handlePointerDown=e=>{e.button!==0||this.host.disabled||this.spinOnLongPressCallback(e)};this.handlePointerUp=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation(),this.timeout&&this.callbacks.start(),this.stopSpinningAndCleanUp(),this.callbacks.end(),document.removeEventListener("pointerup",this.handlePointerUp)};if(e.type!==P.ELEMENT||!(e.element instanceof HTMLButtonElement))throw new Error("The `longPress` directive must be used on an HTMLButtonElement.")}render(e){return D}update(e,[l]){return this.callbacks===void 0&&this.host===void 0&&(this.host=e.element,this.callbacks=$({},l),this.host.addEventListener("pointerdown",this.handlePointerDown)),k}disconnected(){this.stopSpinningAndCleanUp(),this.host.removeEventListener("pointerdown",this.handlePointerDown),document.removeEventListener("pointerup",this.handlePointerUp)}spinOnLongPressCallback(e){var l;e.preventDefault(),e.stopPropagation(),this.timeout=setTimeout(()=>{this.timeout=void 0,this.interval=setInterval(()=>{this.callbacks.start()},50)},500),document.addEventListener("pointerup",this.handlePointerUp),(l=this.observer)==null||l.disconnect(),this.observer=new MutationObserver(u=>{u.forEach(c=>{c.attributeName==="disabled"&&this.stopSpinningAndCleanUp()})}),this.observer.observe(this.host,{attributes:!0})}stopSpinningAndCleanUp(){var e;clearInterval(this.interval),clearTimeout(this.timeout),(e=this.observer)==null||e.disconnect()}},w=V(g);var B,S=(B=navigator.userAgentData)==null?void 0:B.brands.some(b=>b.brand.includes("Chromium")),O=S?!1:navigator.userAgent.includes("Firefox"),t=class extends y{constructor(){super(...arguments);this.formControlController=new F(this);this.hasSlotController=new M(this,"help-text","label","left","right","message","placeholder");this.localize=new T(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 e,l;return(l=(e=this.input)==null?void 0:e.valueAsDate)!=null?l:null}set valueAsDate(e){let l=document.createElement("input");l.type="date",l.valueAsDate=e,this.value=l.value}get valueAsNumber(){var e,l;return(l=(e=this.input)==null?void 0:e.valueAsNumber)!=null?l:parseFloat(this.value)}set valueAsNumber(e){let l=document.createElement("input");l.type="number",l.valueAsNumber=e,this.value=l.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(e){this.value="",this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change"),this.input.focus(),e.stopPropagation()}handleSearchClick(e){this.emit("sd-search"),e.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(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleKeyDown(e){let l=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;e.key==="Enter"&&!l&&setTimeout(()=>{!e.defaultPrevented&&!e.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 e=typeof this.min=="string"?parseFloat(this.min):this.min;return this.valueAsNumber<=e}isIncrementDisabled(){if(this.disabled||this.readonly)return!0;if(this.max===void 0||this.max===null)return!1;let e=typeof this.max=="string"?parseFloat(this.max):this.max;return this.valueAsNumber>=e}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(e){this.input.focus(e)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(e,l,u="none"){this.input.setSelectionRange(e,l,u)}setRangeText(e,l,u,c){this.input.setRangeText(e,l,u,c),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 e;return(e=this.input)==null?void 0:e.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){let e={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")},l=this.label?!0:!!e.label,u=this.helpText?!0:!!e.helpText,c=this.clearable&&!this.readonly&&(typeof this.value=="number"||this.value.length>0),U=!!e.tooltip,f=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",x=this.size==="sm"?"text-sm":"text-base",H={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"}[f],d=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",h={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],o={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return r`<div part="form-control" class="${a((this.disabled||this.visuallyDisabled)&&"cursor-not-allowed")}">${l||U?r`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${a(l?"inline-block":"hidden",x)}" for="input" aria-hidden="${l?"false":"true"}"><slot name="label">${this.label}</slot></label> ${e.tooltip?r`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${a("relative w-full",this.disabled&&"pointer-events-none",this.visuallyDisabled&&"cursor-not-allowed")}"><div part="border" class="${a("absolute w-full h-full pointer-events-none border rounded-default transition-[border] ease-in-out duration-medium hover:duration-fast",H)}"></div><div part="base" class="${a("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",f==="disabled"||f==="visuallyDisabled"?"text-neutral-500":"text-black")}">${e.left?r`<slot name="left" part="left" class="${a("inline-flex",this.size==="sm"?"mr-1":"mr-2",d,o)}"></slot>`:""} <input part="input" id="input" class="${a("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",x)}" type="${this.type==="password"&&this.passwordVisible?"text":this.type}" title="${this.title}" name="${n(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${n(this.placeholder)}" minlength="${n(this.minlength)}" maxlength="${n(this.maxlength)}" min="${n(this.min)}" max="${n(this.max)}" step="${n(this.step)}" .value="${z(this.value)}" autocapitalize="${n(this.type==="password"?"off":this.autocapitalize)}" autocomplete="${n(this.autocomplete)}" autocorrect="${n(this.type==="password"?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${n(this.pattern)}" enterkeyhint="${n(this.enterkeyhint)}" inputmode="${n(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}"> ${c?r`<button part="clear-button" class="${a("flex justify-center",h)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-15-5-icon class="${a("text-neutral-700",o)}" library="_internal" name="closing-round"></sd-5-15-5-icon></slot></button>`:""} ${this.passwordToggle&&this.type==="password"?r`<button aria-label="${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}" part="password-toggle-button" class="${a("flex items-center sd-interactive",h)}" type="button" @click="${this.handlePasswordToggle}">${this.passwordVisible?r`<slot name="show-password-icon"><sd-5-15-5-icon class="${a(d,o)}" library="_internal" name="eye"></sd-5-15-5-icon></slot>`:r`<slot name="hide-password-icon"><sd-5-15-5-icon class="${a(d,o)}" library="_internal" name="eye-crossed-out"></sd-5-15-5-icon></slot>`}</button>`:""} ${(this.type==="date"||this.type==="datetime-local")&&!O?r`<sd-5-15-5-icon class="${a(d,h,o)}" library="_internal" name="calendar"></sd-5-15-5-icon>`:""} ${this.type==="time"?r`<sd-5-15-5-icon class="${a(d,h,o)}" library="_internal" name="clock"></sd-5-15-5-icon>`:""} ${this.type==="search"?r`<button class="${a("flex items-center sd-interactive",h)}" type="button" @click="${this.handleSearchClick}"><sd-5-15-5-icon class="${a(d,o)}" library="_internal" name="magnifying-glass" label="${this.localize.term("search")}"></sd-5-15-5-icon></button>`:""} ${this.showInvalidStyle?r`<sd-5-15-5-icon part="invalid-icon" class="${a("text-error",h,o)}" library="_internal" name="risk"></sd-5-15-5-icon>`:""} ${this.showValidStyle&&this.styleOnValid?r`<sd-5-15-5-icon class="${a("text-success flex-shrink-0",h,o)}" library="_internal" name="status-check" part="valid-icon"></sd-5-15-5-icon>`:""} ${e.right?r`<slot name="right" part="right" class="${a("inline-flex",d,h,o)}"></slot>`:""} ${this.type==="number"&&this.spinButtons?r`<div part="stepper" class="flex items-center"><button part="decrement-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isDecrementDisabled()}" aria-hidden="true" ${w({start:()=>this.handleStepDown(),end:()=>this.handleChange()})} tabindex="-1"><slot name="decrement-number-stepper"><sd-5-15-5-icon name="system/minus-circle" label="Decrease value" class="${a(d,h,o)}"></sd-5-15-5-icon></slot></button> <button part="increment-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isIncrementDisabled()}" aria-hidden="true" ${w({start:()=>this.handleStepUp(),end:()=>this.handleChange()})} tabindex="-1"><slot name="increment-number-stepper"><sd-5-15-5-icon name="system/plus-circle" label="Decrease value" class="${a(d,h,o)}"></sd-5-15-5-icon></slot></button></div>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700 mt-1",u?"block":"hidden")}" aria-hidden="${!u}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};t.styles=[...y.styles,C`: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-5-15-5-icon{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}`],i([v("#input")],t.prototype,"input",2),i([v("#invalid-message")],t.prototype,"invalidMessage",2),i([p()],t.prototype,"hasFocus",2),i([p()],t.prototype,"showValidStyle",2),i([p()],t.prototype,"showInvalidStyle",2),i([s({type:String,reflect:!0})],t.prototype,"type",2),i([s({type:String,reflect:!0})],t.prototype,"size",2),i([s({type:String,reflect:!0})],t.prototype,"inputmode",2),i([s()],t.prototype,"value",2),i([L()],t.prototype,"defaultValue",2),i([s({type:String,reflect:!0})],t.prototype,"placeholder",2),i([s({type:String,reflect:!0})],t.prototype,"label",2),i([s({type:String,attribute:"help-text",reflect:!0})],t.prototype,"helpText",2),i([s({type:Boolean,reflect:!0})],t.prototype,"clearable",2),i([s({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([s({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),i([s({type:Boolean,reflect:!0})],t.prototype,"readonly",2),i([s({attribute:"password-toggle",type:Boolean,reflect:!0})],t.prototype,"passwordToggle",2),i([s({attribute:"password-visible",type:Boolean,reflect:!0})],t.prototype,"passwordVisible",2),i([s({attribute:"spin-buttons",type:Boolean,reflect:!0})],t.prototype,"spinButtons",2),i([s({type:Number,reflect:!0})],t.prototype,"minlength",2),i([s({type:Number,reflect:!0})],t.prototype,"maxlength",2),i([s({reflect:!0})],t.prototype,"min",2),i([s({reflect:!0})],t.prototype,"max",2),i([s({type:String,reflect:!0})],t.prototype,"form",2),i([s({type:String,reflect:!0})],t.prototype,"name",2),i([s({type:String,reflect:!0})],t.prototype,"title",2),i([s({type:Boolean,reflect:!0})],t.prototype,"required",2),i([s()],t.prototype,"pattern",2),i([s({reflect:!0})],t.prototype,"step",2),i([s({type:String,reflect:!0})],t.prototype,"autocapitalize",2),i([s({type:String,reflect:!0})],t.prototype,"autocorrect",2),i([s({reflect:!0})],t.prototype,"autocomplete",2),i([s({type:Boolean,reflect:!0})],t.prototype,"autofocus",2),i([s({type:String,reflect:!0})],t.prototype,"enterkeyhint",2),i([s({type:Boolean,reflect:!0,attribute:"style-on-valid"})],t.prototype,"styleOnValid",2),i([s({type:Boolean,converter:{fromAttribute:e=>!(!e||e==="false"),toAttribute:e=>e?"true":"false"}})],t.prototype,"spellcheck",2),i([m("disabled",{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),i([m("step",{waitUntilFirstUpdate:!0})],t.prototype,"handleStepChange",1),i([m("value",{waitUntilFirstUpdate:!0})],t.prototype,"handleValueChange",1),t=i([E("sd-5-15-5-input")],t);export{t as a};
1
+ import{a as A}from"./chunk.63JDND76.js";import{a as z}from"./chunk.WM6VARGR.js";import{a as L}from"./chunk.RTXVVB2O.js";import{b as F}from"./chunk.7JV32P5Q.js";import{a as M}from"./chunk.CGQ2BPPZ.js";import{a as n}from"./chunk.GLVMB2MH.js";import{a as P,b as V}from"./chunk.D6LAH53B.js";import{a}from"./chunk.26V4EXHB.js";import{a as T}from"./chunk.Y7NVH75J.js";import{a as m}from"./chunk.E2DRD2OX.js";import{a as E,b as s,c as p,d as v,h as y}from"./chunk.HVSHE3SX.js";import{b as C,e as r,h as k,i as D}from"./chunk.ZR5P6TQI.js";import{a as $,e as i}from"./chunk.TJOCV4DC.js";var g=class extends A{constructor(e){super(e);this.handlePointerDown=e=>{e.button!==0||this.host.disabled||this.spinOnLongPressCallback(e)};this.handlePointerUp=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation(),this.timeout&&this.callbacks.start(),this.stopSpinningAndCleanUp(),this.callbacks.end(),document.removeEventListener("pointerup",this.handlePointerUp)};if(e.type!==P.ELEMENT||!(e.element instanceof HTMLButtonElement))throw new Error("The `longPress` directive must be used on an HTMLButtonElement.")}render(e){return D}update(e,[l]){return this.callbacks===void 0&&this.host===void 0&&(this.host=e.element,this.callbacks=$({},l),this.host.addEventListener("pointerdown",this.handlePointerDown)),k}disconnected(){this.stopSpinningAndCleanUp(),this.host.removeEventListener("pointerdown",this.handlePointerDown),document.removeEventListener("pointerup",this.handlePointerUp)}spinOnLongPressCallback(e){var l;e.preventDefault(),e.stopPropagation(),this.timeout=setTimeout(()=>{this.timeout=void 0,this.interval=setInterval(()=>{this.callbacks.start()},50)},500),document.addEventListener("pointerup",this.handlePointerUp),(l=this.observer)==null||l.disconnect(),this.observer=new MutationObserver(u=>{u.forEach(c=>{c.attributeName==="disabled"&&this.stopSpinningAndCleanUp()})}),this.observer.observe(this.host,{attributes:!0})}stopSpinningAndCleanUp(){var e;clearInterval(this.interval),clearTimeout(this.timeout),(e=this.observer)==null||e.disconnect()}},w=V(g);var B,S=(B=navigator.userAgentData)==null?void 0:B.brands.some(b=>b.brand.includes("Chromium")),O=S?!1:navigator.userAgent.includes("Firefox"),t=class extends y{constructor(){super(...arguments);this.formControlController=new F(this);this.hasSlotController=new M(this,"help-text","label","left","right","message","placeholder");this.localize=new T(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 e,l;return(l=(e=this.input)==null?void 0:e.valueAsDate)!=null?l:null}set valueAsDate(e){let l=document.createElement("input");l.type="date",l.valueAsDate=e,this.value=l.value}get valueAsNumber(){var e,l;return(l=(e=this.input)==null?void 0:e.valueAsNumber)!=null?l:parseFloat(this.value)}set valueAsNumber(e){let l=document.createElement("input");l.type="number",l.valueAsNumber=e,this.value=l.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(e){this.value="",this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change"),this.input.focus(),e.stopPropagation()}handleSearchClick(e){this.emit("sd-search"),e.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(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleKeyDown(e){let l=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;e.key==="Enter"&&!l&&setTimeout(()=>{!e.defaultPrevented&&!e.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 e=typeof this.min=="string"?parseFloat(this.min):this.min;return this.valueAsNumber<=e}isIncrementDisabled(){if(this.disabled||this.readonly)return!0;if(this.max===void 0||this.max===null)return!1;let e=typeof this.max=="string"?parseFloat(this.max):this.max;return this.valueAsNumber>=e}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(e){this.input.focus(e)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(e,l,u="none"){this.input.setSelectionRange(e,l,u)}setRangeText(e,l,u,c){this.input.setRangeText(e,l,u,c),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 e;return(e=this.input)==null?void 0:e.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){let e={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")},l=this.label?!0:!!e.label,u=this.helpText?!0:!!e.helpText,c=this.clearable&&!this.readonly&&(typeof this.value=="number"||this.value.length>0),U=!!e.tooltip,f=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",x=this.size==="sm"?"text-sm":"text-base",H={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"}[f],d=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",h={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],o={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return r`<div part="form-control" class="${a((this.disabled||this.visuallyDisabled)&&"cursor-not-allowed")}">${l||U?r`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${a(l?"inline-block":"hidden",x)}" for="input" aria-hidden="${l?"false":"true"}"><slot name="label">${this.label}</slot></label> ${e.tooltip?r`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${a("relative w-full",this.disabled&&"pointer-events-none",this.visuallyDisabled&&"cursor-not-allowed")}"><div part="border" class="${a("absolute w-full h-full pointer-events-none border rounded-default transition-[border] ease-in-out duration-medium hover:duration-fast",H)}"></div><div part="base" class="${a("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",f==="disabled"||f==="visuallyDisabled"?"text-neutral-500":"text-black")}">${e.left?r`<slot name="left" part="left" class="${a("inline-flex",this.size==="sm"?"mr-1":"mr-2",d,o)}"></slot>`:""} <input part="input" id="input" class="${a("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",x)}" type="${this.type==="password"&&this.passwordVisible?"text":this.type}" title="${this.title}" name="${n(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${n(this.placeholder)}" minlength="${n(this.minlength)}" maxlength="${n(this.maxlength)}" min="${n(this.min)}" max="${n(this.max)}" step="${n(this.step)}" .value="${z(this.value)}" autocapitalize="${n(this.type==="password"?"off":this.autocapitalize)}" autocomplete="${n(this.autocomplete)}" autocorrect="${n(this.type==="password"?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${n(this.pattern)}" enterkeyhint="${n(this.enterkeyhint)}" inputmode="${n(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}"> ${c?r`<button part="clear-button" class="${a("flex justify-center",h)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-15-6-icon class="${a("text-neutral-700",o)}" library="_internal" name="closing-round"></sd-5-15-6-icon></slot></button>`:""} ${this.passwordToggle&&this.type==="password"?r`<button aria-label="${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}" part="password-toggle-button" class="${a("flex items-center sd-interactive",h)}" type="button" @click="${this.handlePasswordToggle}">${this.passwordVisible?r`<slot name="show-password-icon"><sd-5-15-6-icon class="${a(d,o)}" library="_internal" name="eye"></sd-5-15-6-icon></slot>`:r`<slot name="hide-password-icon"><sd-5-15-6-icon class="${a(d,o)}" library="_internal" name="eye-crossed-out"></sd-5-15-6-icon></slot>`}</button>`:""} ${(this.type==="date"||this.type==="datetime-local")&&!O?r`<sd-5-15-6-icon class="${a(d,h,o)}" library="_internal" name="calendar"></sd-5-15-6-icon>`:""} ${this.type==="time"?r`<sd-5-15-6-icon class="${a(d,h,o)}" library="_internal" name="clock"></sd-5-15-6-icon>`:""} ${this.type==="search"?r`<button class="${a("flex items-center sd-interactive",h)}" type="button" @click="${this.handleSearchClick}"><sd-5-15-6-icon class="${a(d,o)}" library="_internal" name="magnifying-glass" label="${this.localize.term("search")}"></sd-5-15-6-icon></button>`:""} ${this.showInvalidStyle?r`<sd-5-15-6-icon part="invalid-icon" class="${a("text-error",h,o)}" library="_internal" name="risk"></sd-5-15-6-icon>`:""} ${this.showValidStyle&&this.styleOnValid?r`<sd-5-15-6-icon class="${a("text-success flex-shrink-0",h,o)}" library="_internal" name="status-check" part="valid-icon"></sd-5-15-6-icon>`:""} ${e.right?r`<slot name="right" part="right" class="${a("inline-flex",d,h,o)}"></slot>`:""} ${this.type==="number"&&this.spinButtons?r`<div part="stepper" class="flex items-center"><button part="decrement-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isDecrementDisabled()}" aria-hidden="true" ${w({start:()=>this.handleStepDown(),end:()=>this.handleChange()})} tabindex="-1"><slot name="decrement-number-stepper"><sd-5-15-6-icon name="system/minus-circle" label="Decrease value" class="${a(d,h,o)}"></sd-5-15-6-icon></slot></button> <button part="increment-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isIncrementDisabled()}" aria-hidden="true" ${w({start:()=>this.handleStepUp(),end:()=>this.handleChange()})} tabindex="-1"><slot name="increment-number-stepper"><sd-5-15-6-icon name="system/plus-circle" label="Decrease value" class="${a(d,h,o)}"></sd-5-15-6-icon></slot></button></div>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700 mt-1",u?"block":"hidden")}" aria-hidden="${!u}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};t.styles=[...y.styles,C`: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-5-15-6-icon{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}`],i([v("#input")],t.prototype,"input",2),i([v("#invalid-message")],t.prototype,"invalidMessage",2),i([p()],t.prototype,"hasFocus",2),i([p()],t.prototype,"showValidStyle",2),i([p()],t.prototype,"showInvalidStyle",2),i([s({type:String,reflect:!0})],t.prototype,"type",2),i([s({type:String,reflect:!0})],t.prototype,"size",2),i([s({type:String,reflect:!0})],t.prototype,"inputmode",2),i([s()],t.prototype,"value",2),i([L()],t.prototype,"defaultValue",2),i([s({type:String,reflect:!0})],t.prototype,"placeholder",2),i([s({type:String,reflect:!0})],t.prototype,"label",2),i([s({type:String,attribute:"help-text",reflect:!0})],t.prototype,"helpText",2),i([s({type:Boolean,reflect:!0})],t.prototype,"clearable",2),i([s({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([s({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),i([s({type:Boolean,reflect:!0})],t.prototype,"readonly",2),i([s({attribute:"password-toggle",type:Boolean,reflect:!0})],t.prototype,"passwordToggle",2),i([s({attribute:"password-visible",type:Boolean,reflect:!0})],t.prototype,"passwordVisible",2),i([s({attribute:"spin-buttons",type:Boolean,reflect:!0})],t.prototype,"spinButtons",2),i([s({type:Number,reflect:!0})],t.prototype,"minlength",2),i([s({type:Number,reflect:!0})],t.prototype,"maxlength",2),i([s({reflect:!0})],t.prototype,"min",2),i([s({reflect:!0})],t.prototype,"max",2),i([s({type:String,reflect:!0})],t.prototype,"form",2),i([s({type:String,reflect:!0})],t.prototype,"name",2),i([s({type:String,reflect:!0})],t.prototype,"title",2),i([s({type:Boolean,reflect:!0})],t.prototype,"required",2),i([s()],t.prototype,"pattern",2),i([s({reflect:!0})],t.prototype,"step",2),i([s({type:String,reflect:!0})],t.prototype,"autocapitalize",2),i([s({type:String,reflect:!0})],t.prototype,"autocorrect",2),i([s({reflect:!0})],t.prototype,"autocomplete",2),i([s({type:Boolean,reflect:!0})],t.prototype,"autofocus",2),i([s({type:String,reflect:!0})],t.prototype,"enterkeyhint",2),i([s({type:Boolean,reflect:!0,attribute:"style-on-valid"})],t.prototype,"styleOnValid",2),i([s({type:Boolean,converter:{fromAttribute:e=>!(!e||e==="false"),toAttribute:e=>e?"true":"false"}})],t.prototype,"spellcheck",2),i([m("disabled",{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),i([m("step",{waitUntilFirstUpdate:!0})],t.prototype,"handleStepChange",1),i([m("value",{waitUntilFirstUpdate:!0})],t.prototype,"handleValueChange",1),t=i([E("sd-5-15-6-input")],t);export{t as a};
@@ -1 +1 @@
1
- import{a as y}from"./chunk.CGQ2BPPZ.js";import{a as o}from"./chunk.GLVMB2MH.js";import{a as u,b as s}from"./chunk.JMGRPC2F.js";import{a as l}from"./chunk.26V4EXHB.js";import{a as b}from"./chunk.Y7NVH75J.js";import{a as m,b as i,d as p,h as f}from"./chunk.HVSHE3SX.js";import{b as v}from"./chunk.ZR5P6TQI.js";import{e as r}from"./chunk.TJOCV4DC.js";var t=class extends f{constructor(){super(...arguments);this.hasSlotController=new y(this,"[default]","description","children");this.localize=new b(this);this.vertical=!1;this.size="md";this.current=!1;this.disabled=!1;this.chevron=!1;this.relaxed=!1;this.divider=!1;this.indented=!1;this.open=!1;this.separated=!1}get isButton(){return!this.href&&!this.hasSlotController.test("children")}get isLink(){return!!this.href}get isAccordion(){return!this.separated&&!this.href&&this.hasSlotController.test("children")}get isIconOnly(){if(!this.defaultSlot)return!1;let e=this.defaultSlot.assignedNodes({flatten:!0});return e.length>0&&e.every(a=>{var d;return a.nodeType===Node.TEXT_NODE?!((d=a.textContent)!=null&&d.trim()):a.nodeType===Node.ELEMENT_NODE?a.tagName.toLowerCase()==="sd-5-15-5-icon":!1})}handleClickButton(e){this.disabled&&(e.preventDefault(),e.stopPropagation())}handleClickSummary(e){e.preventDefault(),e.stopPropagation(),this.disabled||(this.open?this.hideDetails():this.showDetails())}hideDetails(){this.open=!1,this.emit("sd-hide",{cancelable:!0})}showDetails(){this.open=!0,this.emit("sd-show",{cancelable:!0})}get calculatePaddingX(){return this.relaxed&&this.indented?"pl-8 pr-4":this.relaxed?"px-4":this.indented?"pl-4":""}get tag(){return this.separated&&!this.isLink?u`div`:this.isAccordion&&!this.isLink?u`summary`:this.isLink?u`a`:u`button`}focus(){var e;this.disabled||(e=this.button)==null||e.focus()}blur(){var e;(e=this.button)==null||e.blur()}render(){let e=this.tag,a=this.isLink,d=this.isButton,n=this.isAccordion,w=this.isIconOnly,c={label:this.hasSlotController.test("[default]"),main:this.hasSlotController.test("main"),description:this.hasSlotController.test("description"),children:this.hasSlotController.test("children")},x=this.vertical?"py-3":"py-2",h=s`<${e} part="base" class="${l("flex items-center cursor-pointer relative focus-visible:focus-outline group hover:bg-neutral-200 transition-colors duration-fast ease-in-out min-h-[48px]",{md:"text-base",lg:"text-lg",sm:"text-[14px]"}[this.size],this.disabled?"text-neutral-500 pointer-events-none":"text-primary",this.current&&"font-bold",!n&&"w-full",this.divider&&this.vertical&&"mt-0.25",!this.vertical&&"inline-flex items-center",!this.separated&&"hover:bg-neutral-200 group transition-colors duration-fast ease-in-out min-h-[48px]",w?"justify-center aspect-square p-3":"px-4")}" aria-current="${o(this.current?"page":void 0)}" aria-disabled="${this.disabled}" aria-labelledby="content" aria-describedby="description" ?disabled="${o(d?this.disabled:void 0)}" href="${o(a?this.href:void 0)}" target="${o(a?this.target:void 0)}" download="${o(a?this.download:void 0)}" rel="${o(a&&this.target?"noreferrer noopener":void 0)}" tabindex="${this.disabled?"-1":"0"}" @click="${this.separated?void 0:n?this.handleClickSummary:d?this.handleClickButton:void 0}"><div part="current-indicator" class="${l("absolute bg-accent left-0 pointer-events-none",this.vertical?"w-1 h-[calc(100%-16px)] top-2 group-hover:h-full group-hover:top-0":"h-1 w-[calc(100%-16px)] bottom-0 left-2 group-hover:w-full group-hover:left-0",this.disabled&&"bg-neutral-500")}"></div><div class="inline-flex flex-col justify-center gap-1 w-full h-full"><span part="content-area" class="${l("relative inline-flex justify-between items-center",n?"grow":"w-full",c.description&&"pt-3",!c.description&&!this.separated&&x,this.calculatePaddingX)}">${this.divider&&this.vertical?s`<sd-5-15-5-divider part="divider" class="${l("w-full transition-all absolute -top-0.25 left-0",this.calculatePaddingX)}"></sd-5-15-5-divider>`:""} <span id="content" part="content-container" class="inline-flex items-center flex-auto"><slot part="content" class="inline-flex text-start"></slot></span>${this.chevron||c.children&&this.vertical&&!this.separated?s`<sd-5-15-5-icon name="chevron-down" part="chevron" library="_internal" color="currentColor" class="${l("h-6 w-6 ml-2 transition-all",n?this.open?"rotate-180":"rotate-0":"rotate-[270deg]")}"></sd-5-15-5-icon>`:""} </span>${c.description&&this.vertical?s`<slot id="description" name="description" part="description" class="${l("inline-block text-sm text-left font-normal text-black pb-3",n||this.separated?"grow":"w-full",this.calculatePaddingX)}"></slot>`:""}</div></${e}>`;return this.separated?s`<div part="details" id="navigation-item-details" class="relative flex flex-col"><div class="flex items-start">${h} ${c.children&&this.vertical?s`<button type="button" title="${this.open?this.localize.term("collapseNavigationItem"):this.localize.term("expandNavigationItem")}" class="sd-interactive sd-interactive--reset -mt-1" @click="${this.handleClickSummary}"><sd-5-15-5-icon name="chevron-down" part="chevron" library="_internal" color="currentColor" class="${l("m-4 h-6 w-6 transition-all",n||this.separated?this.open?"rotate-180":"rotate-0":"rotate-[270deg]")}"></sd-5-15-5-icon></button>`:""}</div>${this.open?s`<slot name="children"></slot>`:""}</div>`:n?s`<details aria-expanded="${this.open}" part="details" id="navigation-item-details" ?open="${this.open}" class="relative">${h}<slot name="children"></slot></details>`:s`${h}`}};t.styles=[...f.styles,v`:host{box-sizing:border-box;display:inline-block;position:relative}:host([vertical]){display:block}details summary::-webkit-details-marker{display:none}[part=current-indicator]{--tw-scale-x:0;--tw-scale-y:0;opacity:var(--sd-opacity-0,0);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-duration:var(--sd-duration-fast,.15s);transition:width var(--sd-duration-fast) ease-in-out,height var(--sd-duration-fast) ease-in-out,left var(--sd-duration-fast) ease-in-out,top var(--sd-duration-fast) ease-in-out,opacity var(--sd-duration-fast) ease-in-out,transform var(--sd-duration-fast) ease-in-out var(--sd-duration-fast)}:host([current]) [part=current-indicator]{--tw-scale-x:1;--tw-scale-y:1;opacity:var(--sd-opacity-100,1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition:width var(--sd-duration-fast) ease-in-out,height var(--sd-duration-fast) ease-in-out,left var(--sd-duration-fast) ease-in-out,top var(--sd-duration-fast) ease-in-out,transform var(--sd-duration-fast) ease-in-out}`],r([p('[part="base"]')],t.prototype,"button",2),r([p("slot:not([name])")],t.prototype,"defaultSlot",2),r([i({type:Boolean,reflect:!0})],t.prototype,"vertical",2),r([i({type:String,reflect:!0})],t.prototype,"size",2),r([i({reflect:!0})],t.prototype,"href",2),r([i({type:String,reflect:!0})],t.prototype,"target",2),r([i({reflect:!0})],t.prototype,"download",2),r([i({type:Boolean,reflect:!0})],t.prototype,"current",2),r([i({type:Boolean,reflect:!0})],t.prototype,"disabled",2),r([i({type:Boolean,reflect:!0})],t.prototype,"chevron",2),r([i({type:Boolean,reflect:!0})],t.prototype,"relaxed",2),r([i({type:Boolean,reflect:!0})],t.prototype,"divider",2),r([i({type:Boolean,reflect:!0})],t.prototype,"indented",2),r([i({type:Boolean,reflect:!0})],t.prototype,"open",2),r([i({type:Boolean,reflect:!0})],t.prototype,"separated",2),t=r([m("sd-5-15-5-navigation-item")],t);export{t as a};
1
+ import{a as y}from"./chunk.CGQ2BPPZ.js";import{a as o}from"./chunk.GLVMB2MH.js";import{a as u,b as s}from"./chunk.JMGRPC2F.js";import{a as l}from"./chunk.26V4EXHB.js";import{a as b}from"./chunk.Y7NVH75J.js";import{a as m,b as i,d as p,h as f}from"./chunk.HVSHE3SX.js";import{b as v}from"./chunk.ZR5P6TQI.js";import{e as r}from"./chunk.TJOCV4DC.js";var t=class extends f{constructor(){super(...arguments);this.hasSlotController=new y(this,"[default]","description","children");this.localize=new b(this);this.vertical=!1;this.size="md";this.current=!1;this.disabled=!1;this.chevron=!1;this.relaxed=!1;this.divider=!1;this.indented=!1;this.open=!1;this.separated=!1}get isButton(){return!this.href&&!this.hasSlotController.test("children")}get isLink(){return!!this.href}get isAccordion(){return!this.separated&&!this.href&&this.hasSlotController.test("children")}get isIconOnly(){if(!this.defaultSlot)return!1;let e=this.defaultSlot.assignedNodes({flatten:!0});return e.length>0&&e.every(a=>{var d;return a.nodeType===Node.TEXT_NODE?!((d=a.textContent)!=null&&d.trim()):a.nodeType===Node.ELEMENT_NODE?a.tagName.toLowerCase()==="sd-5-15-6-icon":!1})}handleClickButton(e){this.disabled&&(e.preventDefault(),e.stopPropagation())}handleClickSummary(e){e.preventDefault(),e.stopPropagation(),this.disabled||(this.open?this.hideDetails():this.showDetails())}hideDetails(){this.open=!1,this.emit("sd-hide",{cancelable:!0})}showDetails(){this.open=!0,this.emit("sd-show",{cancelable:!0})}get calculatePaddingX(){return this.relaxed&&this.indented?"pl-8 pr-4":this.relaxed?"px-4":this.indented?"pl-4":""}get tag(){return this.separated&&!this.isLink?u`div`:this.isAccordion&&!this.isLink?u`summary`:this.isLink?u`a`:u`button`}focus(){var e;this.disabled||(e=this.button)==null||e.focus()}blur(){var e;(e=this.button)==null||e.blur()}render(){let e=this.tag,a=this.isLink,d=this.isButton,n=this.isAccordion,w=this.isIconOnly,c={label:this.hasSlotController.test("[default]"),main:this.hasSlotController.test("main"),description:this.hasSlotController.test("description"),children:this.hasSlotController.test("children")},x=this.vertical?"py-3":"py-2",h=s`<${e} part="base" class="${l("flex items-center cursor-pointer relative focus-visible:focus-outline group hover:bg-neutral-200 transition-colors duration-fast ease-in-out min-h-[48px]",{md:"text-base",lg:"text-lg",sm:"text-[14px]"}[this.size],this.disabled?"text-neutral-500 pointer-events-none":"text-primary",this.current&&"font-bold",!n&&"w-full",this.divider&&this.vertical&&"mt-0.25",!this.vertical&&"inline-flex items-center",!this.separated&&"hover:bg-neutral-200 group transition-colors duration-fast ease-in-out min-h-[48px]",w?"justify-center aspect-square p-3":"px-4")}" aria-current="${o(this.current?"page":void 0)}" aria-disabled="${this.disabled}" aria-labelledby="content" aria-describedby="description" ?disabled="${o(d?this.disabled:void 0)}" href="${o(a?this.href:void 0)}" target="${o(a?this.target:void 0)}" download="${o(a?this.download:void 0)}" rel="${o(a&&this.target?"noreferrer noopener":void 0)}" tabindex="${this.disabled?"-1":"0"}" @click="${this.separated?void 0:n?this.handleClickSummary:d?this.handleClickButton:void 0}"><div part="current-indicator" class="${l("absolute bg-accent left-0 pointer-events-none",this.vertical?"w-1 h-[calc(100%-16px)] top-2 group-hover:h-full group-hover:top-0":"h-1 w-[calc(100%-16px)] bottom-0 left-2 group-hover:w-full group-hover:left-0",this.disabled&&"bg-neutral-500")}"></div><div class="inline-flex flex-col justify-center gap-1 w-full h-full"><span part="content-area" class="${l("relative inline-flex justify-between items-center",n?"grow":"w-full",c.description&&"pt-3",!c.description&&!this.separated&&x,this.calculatePaddingX)}">${this.divider&&this.vertical?s`<sd-5-15-6-divider part="divider" class="${l("w-full transition-all absolute -top-0.25 left-0",this.calculatePaddingX)}"></sd-5-15-6-divider>`:""} <span id="content" part="content-container" class="inline-flex items-center flex-auto"><slot part="content" class="inline-flex text-start"></slot></span>${this.chevron||c.children&&this.vertical&&!this.separated?s`<sd-5-15-6-icon name="chevron-down" part="chevron" library="_internal" color="currentColor" class="${l("h-6 w-6 ml-2 transition-all",n?this.open?"rotate-180":"rotate-0":"rotate-[270deg]")}"></sd-5-15-6-icon>`:""} </span>${c.description&&this.vertical?s`<slot id="description" name="description" part="description" class="${l("inline-block text-sm text-left font-normal text-black pb-3",n||this.separated?"grow":"w-full",this.calculatePaddingX)}"></slot>`:""}</div></${e}>`;return this.separated?s`<div part="details" id="navigation-item-details" class="relative flex flex-col"><div class="flex items-start">${h} ${c.children&&this.vertical?s`<button type="button" title="${this.open?this.localize.term("collapseNavigationItem"):this.localize.term("expandNavigationItem")}" class="sd-interactive sd-interactive--reset -mt-1" @click="${this.handleClickSummary}"><sd-5-15-6-icon name="chevron-down" part="chevron" library="_internal" color="currentColor" class="${l("m-4 h-6 w-6 transition-all",n||this.separated?this.open?"rotate-180":"rotate-0":"rotate-[270deg]")}"></sd-5-15-6-icon></button>`:""}</div>${this.open?s`<slot name="children"></slot>`:""}</div>`:n?s`<details aria-expanded="${this.open}" part="details" id="navigation-item-details" ?open="${this.open}" class="relative">${h}<slot name="children"></slot></details>`:s`${h}`}};t.styles=[...f.styles,v`:host{box-sizing:border-box;display:inline-block;position:relative}:host([vertical]){display:block}details summary::-webkit-details-marker{display:none}[part=current-indicator]{--tw-scale-x:0;--tw-scale-y:0;opacity:var(--sd-opacity-0,0);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-duration:var(--sd-duration-fast,.15s);transition:width var(--sd-duration-fast) ease-in-out,height var(--sd-duration-fast) ease-in-out,left var(--sd-duration-fast) ease-in-out,top var(--sd-duration-fast) ease-in-out,opacity var(--sd-duration-fast) ease-in-out,transform var(--sd-duration-fast) ease-in-out var(--sd-duration-fast)}:host([current]) [part=current-indicator]{--tw-scale-x:1;--tw-scale-y:1;opacity:var(--sd-opacity-100,1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition:width var(--sd-duration-fast) ease-in-out,height var(--sd-duration-fast) ease-in-out,left var(--sd-duration-fast) ease-in-out,top var(--sd-duration-fast) ease-in-out,transform var(--sd-duration-fast) ease-in-out}`],r([p('[part="base"]')],t.prototype,"button",2),r([p("slot:not([name])")],t.prototype,"defaultSlot",2),r([i({type:Boolean,reflect:!0})],t.prototype,"vertical",2),r([i({type:String,reflect:!0})],t.prototype,"size",2),r([i({reflect:!0})],t.prototype,"href",2),r([i({type:String,reflect:!0})],t.prototype,"target",2),r([i({reflect:!0})],t.prototype,"download",2),r([i({type:Boolean,reflect:!0})],t.prototype,"current",2),r([i({type:Boolean,reflect:!0})],t.prototype,"disabled",2),r([i({type:Boolean,reflect:!0})],t.prototype,"chevron",2),r([i({type:Boolean,reflect:!0})],t.prototype,"relaxed",2),r([i({type:Boolean,reflect:!0})],t.prototype,"divider",2),r([i({type:Boolean,reflect:!0})],t.prototype,"indented",2),r([i({type:Boolean,reflect:!0})],t.prototype,"open",2),r([i({type:Boolean,reflect:!0})],t.prototype,"separated",2),t=r([m("sd-5-15-6-navigation-item")],t);export{t as a};
@@ -1 +1 @@
1
- import{a}from"./chunk.26V4EXHB.js";import{a as p,b as o,c as d,d as v,h as n}from"./chunk.HVSHE3SX.js";import{b as l,e as t}from"./chunk.ZR5P6TQI.js";import{e as i}from"./chunk.TJOCV4DC.js";var r=class extends n{constructor(){super(...arguments);this.variant="primary";this.shapes=["top","middle","bottom"];this.componentBreakpoint=0}getSvg(e,s){return{0:this.smallSvg(s),414:this.mediumSvg(s),640:this.largeSvg(s)}[e]}largeSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M610.777 1.393.001 120.146 0 123h700.001V74.79c0-4.797-.462-9.585-1.381-14.294-7.909-40.537-47.237-66.998-87.843-59.103Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 123"><path d="M89.224 121.607 700 2.854 700.001 0h-700L0 48.21c0 4.797.463 9.584 1.381 14.294 7.909 40.537 47.237 66.998 87.843 59.103Z"/></svg>`}mediumSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 119"><path d="M597.75 1.6 0 118.046V121h700V85.872c0-5.509-.53-11.006-1.583-16.413-9.063-46.543-54.133-76.924-100.667-67.86Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M102.25 119.4 700 2.954V0H0v35.128c0 5.509.53 11.006 1.583 16.413 9.063 46.543 54.134 76.924 100.667 67.859Z"/></svg>`}smallSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 113"><path d="M566.951 2.08 0 112.466v2.934h700v-3.672c0-7.166-.689-14.314-2.059-21.348-11.789-60.557-70.436-100.09-130.99-88.3Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 116"><path d="M133.049 113.32 700 2.934V0H0v3.672c0 7.165.69 14.314 2.059 21.348 11.79 60.557 70.436 100.09 130.99 88.3Z"/></svg>`}setBreakpoint(){switch(!0){case this.containerElem.clientWidth<=414:this.componentBreakpoint=0;break;case this.containerElem.clientWidth<640:this.componentBreakpoint=414;break;default:this.componentBreakpoint=640}}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver(()=>this.setBreakpoint()),this.updateComplete.then(()=>{this.setBreakpoint(),this.resizeObserver.observe(this.containerElem)})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.containerElem)}renderTopBrandshape(){return t`<div class="relative" part="shape-top">${this.getSvg(this.componentBreakpoint,"top")} ${this.renderWhitespaceFix("top")}</div>`}renderMiddleBrandshape(){return t`<div class="${a({0:"px-6 py-4",414:"px-10 py-8",640:"px-10 py-8"}[this.componentBreakpoint],"w-full block relative")}"><div part="shape-middle" class="${a({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white","border-white":"bg-transparent","border-primary":"bg-transparent",image:"bg-transparent"}[this.variant],"w-full block absolute h-full top-0 left-0 z-0")}"></div><div class="${a("z-10 relative",this.variant==="image"&&"invisible opacity-0")}" part="content"><slot>${this.variant==="image"?"":t`<div class="h-8"></div>`}</slot></div></div>`}renderBottomBrandshape(){return t`<div class="relative" part="shape-bottom">${this.getSvg(this.componentBreakpoint,"bottom")}${this.renderWhitespaceFix("bottom")}</div>`}renderWhitespaceFix(e){return t`<div class="${a({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white","border-white":"bg-transparent","border-primary":"bg-transparent",image:"bg-transparent"}[this.variant],{top:"bottom-0",bottom:"top-0"}[e],"block absolute left-0 w-full h-[1px]")}"></div>`}renderStylizedVariant(){return t`<div part="stylized-container" class="w-full overflow-hidden"><slot class="${a(this.variant!=="image"&&"hidden")}" name="image"></slot></div>`}renderShapes(){return t`${this.shapes.includes("top")?this.renderTopBrandshape():""} ${this.shapes.includes("middle")?this.renderMiddleBrandshape():""} ${this.shapes.includes("bottom")?this.renderBottomBrandshape():""}`}render(){let e=this.variant.startsWith("border-")||this.variant==="image";return t`<div class="${a({"neutral-100":"fill-neutral-100",primary:"fill-primary",white:"fill-white","border-white":"fill-transparent","border-primary":"fill-transparent",image:"fill-transparent"}[this.variant],"relative")}" part="base">${e?this.renderStylizedVariant():""} ${this.renderShapes()}</div>`}};r.styles=[...n.styles,l`:host{container-type:inline-size;display:block;--angle:11deg;--radius:60px;--tan:tan(var(--angle));--adjacent:100cqw;--opposite:calc(var(--tan)*var(--adjacent));--curve:calc((var(--opposite) - (var(--radius)/3))*0.5)}@supports not (transform:skewY(11deg)){:host{--tan:0.1943803091}}@media (min-width:415px){:host{--radius:72px}}@media (min-width:640px){:host{--radius:84px}}:host([variant=image]) [part=stylized-container],:host([variant^=border-]) [part=stylized-container]:before{border-radius:0 var(--radius);height:calc(100% - var(--curve)*2);left:var(--sd-spacing-0,0);margin-top:calc(var(--curve));position:absolute;top:var(--sd-spacing-0,0);transform:skewY(calc(var(--angle)*-1))}slot[name=image]::slotted(img),slot[name=image]::slotted(video){height:calc(100% + var(--curve)*2)!important;-o-object-fit:cover;object-fit:cover;position:absolute!important;transform:translateY(calc(var(--curve)*-1)) skewY(var(--angle));width:100%}@supports not (height:100cqw){:host([variant=image]) [part=stylized-container],:host([variant^=border-]) [part=stylized-container]:before{height:100%;margin-top:0;transform:unset}slot[name=image]::slotted(img),slot[name=image]::slotted(video){height:100%!important;transform:unset}}:host([variant=border-primary]){--internal-border-color:rgb(var(--sd-color-primary,0 53 142))}:host([variant=border-white]){--internal-border-color:var(--sd-color-white,#fff)}:host([variant^=border-]) [part=stylized-container]:before{border-color:var(--internal-border-color,#000);border-style:solid;border-width:2px;content:"";right:var(--sd-spacing-0,0)}`],i([v("[part=base]")],r.prototype,"containerElem",2),i([o({type:String,reflect:!0})],r.prototype,"variant",2),i([o({type:Array})],r.prototype,"shapes",2),i([d()],r.prototype,"componentBreakpoint",2),r=i([p("sd-5-15-5-brandshape")],r);export{r as a};
1
+ import{a}from"./chunk.26V4EXHB.js";import{a as p,b as o,c as d,d as v,h as n}from"./chunk.HVSHE3SX.js";import{b as l,e as t}from"./chunk.ZR5P6TQI.js";import{e as i}from"./chunk.TJOCV4DC.js";var r=class extends n{constructor(){super(...arguments);this.variant="primary";this.shapes=["top","middle","bottom"];this.componentBreakpoint=0}getSvg(e,s){return{0:this.smallSvg(s),414:this.mediumSvg(s),640:this.largeSvg(s)}[e]}largeSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M610.777 1.393.001 120.146 0 123h700.001V74.79c0-4.797-.462-9.585-1.381-14.294-7.909-40.537-47.237-66.998-87.843-59.103Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 123"><path d="M89.224 121.607 700 2.854 700.001 0h-700L0 48.21c0 4.797.463 9.584 1.381 14.294 7.909 40.537 47.237 66.998 87.843 59.103Z"/></svg>`}mediumSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 119"><path d="M597.75 1.6 0 118.046V121h700V85.872c0-5.509-.53-11.006-1.583-16.413-9.063-46.543-54.133-76.924-100.667-67.86Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M102.25 119.4 700 2.954V0H0v35.128c0 5.509.53 11.006 1.583 16.413 9.063 46.543 54.134 76.924 100.667 67.859Z"/></svg>`}smallSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 113"><path d="M566.951 2.08 0 112.466v2.934h700v-3.672c0-7.166-.689-14.314-2.059-21.348-11.789-60.557-70.436-100.09-130.99-88.3Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 116"><path d="M133.049 113.32 700 2.934V0H0v3.672c0 7.165.69 14.314 2.059 21.348 11.79 60.557 70.436 100.09 130.99 88.3Z"/></svg>`}setBreakpoint(){switch(!0){case this.containerElem.clientWidth<=414:this.componentBreakpoint=0;break;case this.containerElem.clientWidth<640:this.componentBreakpoint=414;break;default:this.componentBreakpoint=640}}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver(()=>this.setBreakpoint()),this.updateComplete.then(()=>{this.setBreakpoint(),this.resizeObserver.observe(this.containerElem)})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.containerElem)}renderTopBrandshape(){return t`<div class="relative" part="shape-top">${this.getSvg(this.componentBreakpoint,"top")} ${this.renderWhitespaceFix("top")}</div>`}renderMiddleBrandshape(){return t`<div class="${a({0:"px-6 py-4",414:"px-10 py-8",640:"px-10 py-8"}[this.componentBreakpoint],"w-full block relative")}"><div part="shape-middle" class="${a({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white","border-white":"bg-transparent","border-primary":"bg-transparent",image:"bg-transparent"}[this.variant],"w-full block absolute h-full top-0 left-0 z-0")}"></div><div class="${a("z-10 relative",this.variant==="image"&&"invisible opacity-0")}" part="content"><slot>${this.variant==="image"?"":t`<div class="h-8"></div>`}</slot></div></div>`}renderBottomBrandshape(){return t`<div class="relative" part="shape-bottom">${this.getSvg(this.componentBreakpoint,"bottom")}${this.renderWhitespaceFix("bottom")}</div>`}renderWhitespaceFix(e){return t`<div class="${a({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white","border-white":"bg-transparent","border-primary":"bg-transparent",image:"bg-transparent"}[this.variant],{top:"bottom-0",bottom:"top-0"}[e],"block absolute left-0 w-full h-[1px]")}"></div>`}renderStylizedVariant(){return t`<div part="stylized-container" class="w-full overflow-hidden"><slot class="${a(this.variant!=="image"&&"hidden")}" name="image"></slot></div>`}renderShapes(){return t`${this.shapes.includes("top")?this.renderTopBrandshape():""} ${this.shapes.includes("middle")?this.renderMiddleBrandshape():""} ${this.shapes.includes("bottom")?this.renderBottomBrandshape():""}`}render(){let e=this.variant.startsWith("border-")||this.variant==="image";return t`<div class="${a({"neutral-100":"fill-neutral-100",primary:"fill-primary",white:"fill-white","border-white":"fill-transparent","border-primary":"fill-transparent",image:"fill-transparent"}[this.variant],"relative")}" part="base">${e?this.renderStylizedVariant():""} ${this.renderShapes()}</div>`}};r.styles=[...n.styles,l`:host{container-type:inline-size;display:block;--angle:11deg;--radius:60px;--tan:tan(var(--angle));--adjacent:100cqw;--opposite:calc(var(--tan)*var(--adjacent));--curve:calc((var(--opposite) - (var(--radius)/3))*0.5)}@supports not (transform:skewY(11deg)){:host{--tan:0.1943803091}}@media (min-width:415px){:host{--radius:72px}}@media (min-width:640px){:host{--radius:84px}}:host([variant=image]) [part=stylized-container],:host([variant^=border-]) [part=stylized-container]:before{border-radius:0 var(--radius);height:calc(100% - var(--curve)*2);left:var(--sd-spacing-0,0);margin-top:calc(var(--curve));position:absolute;top:var(--sd-spacing-0,0);transform:skewY(calc(var(--angle)*-1))}slot[name=image]::slotted(img),slot[name=image]::slotted(video){height:calc(100% + var(--curve)*2)!important;-o-object-fit:cover;object-fit:cover;position:absolute!important;transform:translateY(calc(var(--curve)*-1)) skewY(var(--angle));width:100%}@supports not (height:100cqw){:host([variant=image]) [part=stylized-container],:host([variant^=border-]) [part=stylized-container]:before{height:100%;margin-top:0;transform:unset}slot[name=image]::slotted(img),slot[name=image]::slotted(video){height:100%!important;transform:unset}}:host([variant=border-primary]){--internal-border-color:rgb(var(--sd-color-primary,0 53 142))}:host([variant=border-white]){--internal-border-color:var(--sd-color-white,#fff)}:host([variant^=border-]) [part=stylized-container]:before{border-color:var(--internal-border-color,#000);border-style:solid;border-width:2px;content:"";right:var(--sd-spacing-0,0)}`],i([v("[part=base]")],r.prototype,"containerElem",2),i([o({type:String,reflect:!0})],r.prototype,"variant",2),i([o({type:Array})],r.prototype,"shapes",2),i([d()],r.prototype,"componentBreakpoint",2),r=i([p("sd-5-15-6-brandshape")],r);export{r as a};
@@ -1 +1 @@
1
- import{a as Dt}from"./chunk.26V4EXHB.js";import{a as kt,b as E,d as Et,h as Rt}from"./chunk.HVSHE3SX.js";import{b as Mt,e as Ot}from"./chunk.ZR5P6TQI.js";import{a as C,b as V,c as dt,e as b}from"./chunk.TJOCV4DC.js";var _=Math.min,T=Math.max,ct=Math.round,ft=Math.floor,F=t=>({x:t,y:t}),de={left:"right",right:"left",bottom:"top",top:"bottom"},me={start:"end",end:"start"};function pt(t,e,n){return T(t,_(e,n))}function Z(t,e){return typeof t=="function"?t(e):t}function q(t){return t.split("-")[0]}function tt(t){return t.split("-")[1]}function Ct(t){return t==="x"?"y":"x"}function gt(t){return t==="y"?"height":"width"}var pe=new Set(["top","bottom"]);function j(t){return pe.has(q(t))?"y":"x"}function wt(t){return Ct(j(t))}function $t(t,e,n){n===void 0&&(n=!1);let i=tt(t),o=wt(t),s=gt(o),r=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=lt(r)),[r,lt(r)]}function Nt(t){let e=lt(t);return[mt(t),e,mt(e)]}function mt(t){return t.replace(/start|end/g,e=>me[e])}var Bt=["left","right"],Ft=["right","left"],ge=["top","bottom"],we=["bottom","top"];function ye(t,e,n){switch(t){case"top":case"bottom":return n?e?Ft:Bt:e?Bt:Ft;case"left":case"right":return e?ge:we;default:return[]}}function Ht(t,e,n,i){let o=tt(t),s=ye(q(t),n==="start",i);return o&&(s=s.map(r=>r+"-"+o),e&&(s=s.concat(s.map(mt)))),s}function lt(t){return t.replace(/left|right|bottom|top/g,e=>de[e])}function xe(t){return C({top:0,right:0,bottom:0,left:0},t)}function Tt(t){return typeof t!="number"?xe(t):{top:t,right:t,bottom:t,left:t}}function et(t){let{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function Wt(t,e,n){let{reference:i,floating:o}=t,s=j(e),r=wt(e),a=gt(r),c=q(e),l=s==="y",f=i.x+i.width/2-o.width/2,h=i.y+i.height/2-o.height/2,m=i[a]/2-o[a]/2,u;switch(c){case"top":u={x:f,y:i.y-o.height};break;case"bottom":u={x:f,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:h};break;case"left":u={x:i.x-o.width,y:h};break;default:u={x:i.x,y:i.y}}switch(tt(e)){case"start":u[r]-=m*(n&&l?-1:1);break;case"end":u[r]+=m*(n&&l?-1:1);break}return u}var Vt=async(t,e,n)=>{let{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:r}=n,a=s.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e)),l=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:h}=Wt(l,i,c),m=i,u={},d=0;for(let p=0;p<a.length;p++){let{name:w,fn:g}=a[p],{x:y,y:v,data:A,reset:O}=await g({x:f,y:h,initialPlacement:i,placement:m,strategy:o,middlewareData:u,rects:l,platform:r,elements:{reference:t,floating:e}});f=y!=null?y:f,h=v!=null?v:h,u=V(C({},u),{[w]:C(C({},u[w]),A)}),O&&d<=50&&(d++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(l=O.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:o}):O.rects),{x:f,y:h}=Wt(l,m,c)),p=-1)}return{x:f,y:h,placement:m,strategy:o,middlewareData:u}};async function yt(t,e){var n;e===void 0&&(e={});let{x:i,y:o,platform:s,rects:r,elements:a,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:u=0}=Z(e,t),d=Tt(u),w=a[m?h==="floating"?"reference":"floating":h],g=et(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:f,strategy:c})),y=h==="floating"?{x:i,y:o,width:r.floating.width,height:r.floating.height}:r.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),A=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},O=et(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:c}):y);return{top:(g.top-O.top+d.top)/A.y,bottom:(O.bottom-g.bottom+d.bottom)/A.y,left:(g.left-O.left+d.left)/A.x,right:(O.right-g.right+d.right)/A.x}}var _t=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:i,placement:o,rects:s,platform:r,elements:a,middlewareData:c}=e,{element:l,padding:f=0}=Z(t,e)||{};if(l==null)return{};let h=Tt(f),m={x:n,y:i},u=wt(o),d=gt(u),p=await r.getDimensions(l),w=u==="y",g=w?"top":"left",y=w?"bottom":"right",v=w?"clientHeight":"clientWidth",A=s.reference[d]+s.reference[u]-m[u]-s.floating[d],O=m[u]-s.reference[u],k=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l)),R=k?k[v]:0;(!R||!await(r.isElement==null?void 0:r.isElement(k)))&&(R=a.floating[v]||s.floating[d]);let I=A/2-O/2,H=R/2-p[d]/2-1,L=_(h[g],H),U=_(h[y],H),W=L,K=R-p[d]-U,S=R/2-p[d]/2+I,D=pt(W,S,K),J=!c.arrow&&tt(o)!=null&&S!==D&&s.reference[d]/2-(S<W?L:U)-p[d]/2<0,Y=J?S<W?S-W:S-K:0;return{[u]:m[u]+Y,data:C({[u]:D,centerOffset:S-D-Y},J&&{alignmentOffset:Y}),reset:J}}});var jt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;let{placement:o,middlewareData:s,rects:r,initialPlacement:a,platform:c,elements:l}=e,S=Z(t,e),{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:p=!0}=S,w=dt(S,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=s.arrow)!=null&&n.alignmentOffset)return{};let g=q(o),y=j(a),v=q(a)===a,A=await(c.isRTL==null?void 0:c.isRTL(l.floating)),O=m||(v||!p?[lt(a)]:Nt(a)),k=d!=="none";!m&&k&&O.push(...Ht(a,p,d,A));let R=[a,...O],I=await yt(e,w),H=[],L=((i=s.flip)==null?void 0:i.overflows)||[];if(f&&H.push(I[g]),h){let D=$t(o,r,A);H.push(I[D[0]],I[D[1]])}if(L=[...L,{placement:o,overflows:H}],!H.every(D=>D<=0)){var U,W;let D=(((U=s.flip)==null?void 0:U.index)||0)+1,J=R[D];if(J&&(!(h==="alignment"?y!==j(J):!1)||L.every(B=>j(B.placement)===y?B.overflows[0]>0:!0)))return{data:{index:D,overflows:L},reset:{placement:J}};let Y=(W=L.filter(Q=>Q.overflows[0]<=0).sort((Q,B)=>Q.overflows[1]-B.overflows[1])[0])==null?void 0:W.placement;if(!Y)switch(u){case"bestFit":{var K;let Q=(K=L.filter(B=>{if(k){let G=j(B.placement);return G===y||G==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(G=>G>0).reduce((G,he)=>G+he,0)]).sort((B,G)=>B[1]-G[1])[0])==null?void 0:K[0];Q&&(Y=Q);break}case"initialPlacement":Y=a;break}if(o!==Y)return{reset:{placement:Y}}}return{}}}};var ve=new Set(["left","top"]);async function be(t,e){let{placement:n,platform:i,elements:o}=t,s=await(i.isRTL==null?void 0:i.isRTL(o.floating)),r=q(n),a=tt(n),c=j(n)==="y",l=ve.has(r)?-1:1,f=s&&c?-1:1,h=Z(e,t),{mainAxis:m,crossAxis:u,alignmentAxis:d}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof d=="number"&&(u=a==="end"?d*-1:d),c?{x:u*f,y:m*l}:{x:m*l,y:u*f}}var It=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:o,y:s,placement:r,middlewareData:a}=e,c=await be(e,t);return r===((n=a.offset)==null?void 0:n.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:V(C({},c),{placement:r})}}}},Yt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:o}=e,w=Z(t,e),{mainAxis:s=!0,crossAxis:r=!1,limiter:a={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}}}=w,c=dt(w,["mainAxis","crossAxis","limiter"]),l={x:n,y:i},f=await yt(e,c),h=j(q(o)),m=Ct(h),u=l[m],d=l[h];if(s){let g=m==="y"?"top":"left",y=m==="y"?"bottom":"right",v=u+f[g],A=u-f[y];u=pt(v,u,A)}if(r){let g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=d+f[g],A=d-f[y];d=pt(v,d,A)}let p=a.fn(V(C({},e),{[m]:u,[h]:d}));return V(C({},p),{data:{x:p.x-n,y:p.y-i,enabled:{[m]:s,[h]:r}}})}}};var qt=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;let{placement:o,rects:s,platform:r,elements:a}=e,L=Z(t,e),{apply:c=()=>{}}=L,l=dt(L,["apply"]),f=await yt(e,l),h=q(o),m=tt(o),u=j(o)==="y",{width:d,height:p}=s.floating,w,g;h==="top"||h==="bottom"?(w=h,g=m===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(g=h,w=m==="end"?"top":"bottom");let y=p-f.top-f.bottom,v=d-f.left-f.right,A=_(p-f[w],y),O=_(d-f[g],v),k=!e.middlewareData.shift,R=A,I=O;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(I=v),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(R=y),k&&!m){let U=T(f.left,0),W=T(f.right,0),K=T(f.top,0),S=T(f.bottom,0);u?I=d-2*(U!==0||W!==0?U+W:T(f.left,f.right)):R=p-2*(K!==0||S!==0?K+S:T(f.top,f.bottom))}await c(V(C({},e),{availableWidth:I,availableHeight:R}));let H=await r.getDimensions(a.floating);return d!==H.width||p!==H.height?{reset:{rects:!0}}:{}}}};function xt(){return typeof window!="undefined"}function nt(t){return Ut(t)?(t.nodeName||"").toLowerCase():"#document"}function P(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $(t){var e;return(e=(Ut(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ut(t){return xt()?t instanceof Node||t instanceof P(t).Node:!1}function z(t){return xt()?t instanceof Element||t instanceof P(t).Element:!1}function N(t){return xt()?t instanceof HTMLElement||t instanceof P(t).HTMLElement:!1}function Xt(t){return!xt()||typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof P(t).ShadowRoot}var Ae=new Set(["inline","contents"]);function st(t){let{overflow:e,overflowX:n,overflowY:i,display:o}=M(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!Ae.has(o)}var Oe=new Set(["table","td","th"]);function Kt(t){return Oe.has(nt(t))}var Ee=[":popover-open",":modal"];function ut(t){return Ee.some(e=>{try{return t.matches(e)}catch(n){return!1}})}var Re=["transform","translate","scale","rotate","perspective"],Ce=["transform","translate","scale","rotate","perspective","filter"],Te=["paint","layout","strict","content"];function vt(t){let e=bt(),n=z(t)?M(t):t;return Re.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Ce.some(i=>(n.willChange||"").includes(i))||Te.some(i=>(n.contain||"").includes(i))}function Gt(t){let e=X(t);for(;N(e)&&!it(e);){if(vt(e))return e;if(ut(e))return null;e=X(e)}return null}function bt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var Pe=new Set(["html","body","#document"]);function it(t){return Pe.has(nt(t))}function M(t){return P(t).getComputedStyle(t)}function ht(t){return z(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function X(t){if(nt(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Xt(t)&&t.host||$(t);return Xt(e)?e.host:e}function Jt(t){let e=X(t);return it(e)?t.ownerDocument?t.ownerDocument.body:t.body:N(e)&&st(e)?e:Jt(e)}function rt(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let o=Jt(t),s=o===((i=t.ownerDocument)==null?void 0:i.body),r=P(o);if(s){let a=At(r);return e.concat(r,r.visualViewport||[],st(o)?o:[],a&&n?rt(a):[])}return e.concat(o,rt(o,[],n))}function At(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function te(t){let e=M(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,o=N(t),s=o?t.offsetWidth:n,r=o?t.offsetHeight:i,a=ct(n)!==s||ct(i)!==r;return a&&(n=s,i=r),{width:n,height:i,$:a}}function St(t){return z(t)?t:t.contextElement}function at(t){let e=St(t);if(!N(e))return F(1);let n=e.getBoundingClientRect(),{width:i,height:o,$:s}=te(e),r=(s?ct(n.width):n.width)/i,a=(s?ct(n.height):n.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}var Se=F(0);function ee(t){let e=P(t);return!bt()||!e.visualViewport?Se:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Le(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==P(t)?!1:e}function ot(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let o=t.getBoundingClientRect(),s=St(t),r=F(1);e&&(i?z(i)&&(r=at(i)):r=at(t));let a=Le(s,n,i)?ee(s):F(0),c=(o.left+a.x)/r.x,l=(o.top+a.y)/r.y,f=o.width/r.x,h=o.height/r.y;if(s){let m=P(s),u=i&&z(i)?P(i):i,d=m,p=At(d);for(;p&&i&&u!==d;){let w=at(p),g=p.getBoundingClientRect(),y=M(p),v=g.left+(p.clientLeft+parseFloat(y.paddingLeft))*w.x,A=g.top+(p.clientTop+parseFloat(y.paddingTop))*w.y;c*=w.x,l*=w.y,f*=w.x,h*=w.y,c+=v,l+=A,d=P(p),p=At(d)}}return et({width:f,height:h,x:c,y:l})}function Lt(t,e){let n=ht(t).scrollLeft;return e?e.left+n:ot($(t)).left+n}function ne(t,e,n){n===void 0&&(n=!1);let i=t.getBoundingClientRect(),o=i.left+e.scrollLeft-(n?0:Lt(t,i)),s=i.top+e.scrollTop;return{x:o,y:s}}function ze(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t,s=o==="fixed",r=$(i),a=e?ut(e.floating):!1;if(i===r||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=F(1),f=F(0),h=N(i);if((h||!h&&!s)&&((nt(i)!=="body"||st(r))&&(c=ht(i)),N(i))){let u=ot(i);l=at(i),f.x=u.x+i.clientLeft,f.y=u.y+i.clientTop}let m=r&&!h&&!s?ne(r,c,!0):F(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+f.x+m.x,y:n.y*l.y-c.scrollTop*l.y+f.y+m.y}}function Me(t){return Array.from(t.getClientRects())}function ke(t){let e=$(t),n=ht(t),i=t.ownerDocument.body,o=T(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=T(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),r=-n.scrollLeft+Lt(t),a=-n.scrollTop;return M(i).direction==="rtl"&&(r+=T(e.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:a}}function De(t,e){let n=P(t),i=$(t),o=n.visualViewport,s=i.clientWidth,r=i.clientHeight,a=0,c=0;if(o){s=o.width,r=o.height;let l=bt();(!l||l&&e==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:s,height:r,x:a,y:c}}var Be=new Set(["absolute","fixed"]);function Fe(t,e){let n=ot(t,!0,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft,s=N(t)?at(t):F(1),r=t.clientWidth*s.x,a=t.clientHeight*s.y,c=o*s.x,l=i*s.y;return{width:r,height:a,x:c,y:l}}function Qt(t,e,n){let i;if(e==="viewport")i=De(t,n);else if(e==="document")i=ke($(t));else if(z(e))i=Fe(e,n);else{let o=ee(t);i={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return et(i)}function ie(t,e){let n=X(t);return n===e||!z(n)||it(n)?!1:M(n).position==="fixed"||ie(n,e)}function $e(t,e){let n=e.get(t);if(n)return n;let i=rt(t,[],!1).filter(a=>z(a)&&nt(a)!=="body"),o=null,s=M(t).position==="fixed",r=s?X(t):t;for(;z(r)&&!it(r);){let a=M(r),c=vt(r);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&Be.has(o.position)||st(r)&&!c&&ie(t,r))?i=i.filter(f=>f!==r):o=a,r=X(r)}return e.set(t,i),i}function Ne(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t,r=[...n==="clippingAncestors"?ut(e)?[]:$e(e,this._c):[].concat(n),i],a=r[0],c=r.reduce((l,f)=>{let h=Qt(e,f,o);return l.top=T(h.top,l.top),l.right=_(h.right,l.right),l.bottom=_(h.bottom,l.bottom),l.left=T(h.left,l.left),l},Qt(e,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function He(t){let{width:e,height:n}=te(t);return{width:e,height:n}}function We(t,e,n){let i=N(e),o=$(e),s=n==="fixed",r=ot(t,!0,s,e),a={scrollLeft:0,scrollTop:0},c=F(0);function l(){c.x=Lt(o)}if(i||!i&&!s)if((nt(e)!=="body"||st(o))&&(a=ht(e)),i){let u=ot(e,!0,s,e);c.x=u.x+e.clientLeft,c.y=u.y+e.clientTop}else o&&l();s&&!i&&o&&l();let f=o&&!i&&!s?ne(o,a):F(0),h=r.left+a.scrollLeft-c.x-f.x,m=r.top+a.scrollTop-c.y-f.y;return{x:h,y:m,width:r.width,height:r.height}}function Pt(t){return M(t).position==="static"}function Zt(t,e){if(!N(t)||M(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return $(t)===n&&(n=n.ownerDocument.body),n}function oe(t,e){let n=P(t);if(ut(t))return n;if(!N(t)){let o=X(t);for(;o&&!it(o);){if(z(o)&&!Pt(o))return o;o=X(o)}return n}let i=Zt(t,e);for(;i&&Kt(i)&&Pt(i);)i=Zt(i,e);return i&&it(i)&&Pt(i)&&!vt(i)?n:i||Gt(t)||n}var Ve=async function(t){let e=this.getOffsetParent||oe,n=this.getDimensions,i=await n(t.floating);return{reference:We(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function _e(t){return M(t).direction==="rtl"}var je={convertOffsetParentRelativeRectToViewportRelativeRect:ze,getDocumentElement:$,getClippingRect:Ne,getOffsetParent:oe,getElementRects:Ve,getClientRects:Me,getDimensions:He,getScale:at,isElement:z,isRTL:_e};function re(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ie(t,e){let n=null,i,o=$(t);function s(){var a;clearTimeout(i),(a=n)==null||a.disconnect(),n=null}function r(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();let l=t.getBoundingClientRect(),{left:f,top:h,width:m,height:u}=l;if(a||e(),!m||!u)return;let d=ft(h),p=ft(o.clientWidth-(f+m)),w=ft(o.clientHeight-(h+u)),g=ft(f),v={rootMargin:-d+"px "+-p+"px "+-w+"px "+-g+"px",threshold:T(0,_(1,c))||1},A=!0;function O(k){let R=k[0].intersectionRatio;if(R!==c){if(!A)return r();R?r(!1,R):i=setTimeout(()=>{r(!1,1e-7)},1e3)}R===1&&!re(l,t.getBoundingClientRect())&&r(),A=!1}try{n=new IntersectionObserver(O,V(C({},v),{root:o.ownerDocument}))}catch(k){n=new IntersectionObserver(O,v)}n.observe(t)}return r(!0),s}function se(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,l=St(t),f=o||s?[...l?rt(l):[],...rt(e)]:[];f.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});let h=l&&a?Ie(l,n):null,m=-1,u=null;r&&(u=new ResizeObserver(g=>{let[y]=g;y&&y.target===l&&u&&(u.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var v;(v=u)==null||v.observe(e)})),n()}),l&&!c&&u.observe(l),u.observe(e));let d,p=c?ot(t):null;c&&w();function w(){let g=ot(t);p&&!re(p,g)&&n(),p=g,d=requestAnimationFrame(w)}return n(),()=>{var g;f.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),h==null||h(),(g=u)==null||g.disconnect(),u=null,c&&cancelAnimationFrame(d)}}var ae=It;var le=Yt,ce=jt,zt=qt;var fe=_t;var ue=(t,e,n)=>{let i=new Map,o=C({platform:je},n),s=V(C({},o.platform),{_c:i});return Vt(t,e,V(C({},o),{platform:s}))};var x=class extends Rt{constructor(){super(...arguments);this.active=!1;this.placement="top";this.strategy="absolute";this.distance=0;this.skidding=0;this.arrow=!1;this.arrowPlacement="anchor";this.arrowPadding=10;this.flip=!1;this.flipFallbackPlacements="";this.flipFallbackStrategy="best-fit";this.flipPadding=0;this.shift=!1;this.shiftPadding=0;this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start(),this.setupMutationObserver()}disconnectedCallback(){this.stop(),this.mutationObserver&&this.mutationObserver.disconnect()}async updated(n){super.updated(n),n.has("active")&&(this.active?this.start():this.stop()),n.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}setupMutationObserver(){this.mutationObserver=new MutationObserver(i=>this.handleCurrentPlacementChange(i));let n={attributes:!0};this.mutationObserver.observe(this,n)}handleCurrentPlacementChange(n){return n.forEach(i=>{if(i.attributeName==="data-current-placement"){let o=this.getAttribute("data-current-placement");this.emit("sd-current-placement",{detail:o})}})}async handleAnchorChange(){if(await this.stop(),this.anchor&&typeof this.anchor=="string"){let n=this.getRootNode();this.anchorEl=n.getElementById(this.anchor)}else this.anchor instanceof HTMLElement?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');if(this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),!this.anchorEl)throw new Error("Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.");this.start()}start(){this.anchorEl&&(this.cleanup=se(this.anchorEl,this.popup,()=>{this.reposition()}))}async stop(){return new Promise(n=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame(()=>n())):n()})}reposition(){if(!this.active||!this.anchorEl)return;let n=[ae({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?n.push(zt({apply:({rects:i})=>{let o=this.sync==="width"||this.sync==="both",s=this.sync==="height"||this.sync==="both";this.popup.style.width=o?`${i.reference.width}px`:"",this.popup.style.height=s?`${i.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&n.push(ce({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:this.flipFallbackStrategy==="best-fit"?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&n.push(le({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?n.push(zt({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:i,availableHeight:o})=>{this.autoSize==="vertical"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-height",`${o}px`):this.style.removeProperty("--auto-size-available-height"),this.autoSize==="horizontal"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-width",`${i}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&n.push(fe({element:this.arrowEl,padding:this.arrowPadding})),ue(this.anchorEl,this.popup,{placement:this.placement,middleware:n,strategy:this.strategy}).then(({x:i,y:o,middlewareData:s,placement:r})=>{let a=getComputedStyle(this).direction==="rtl",c={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]];if(this.setAttribute("data-current-placement",r),Object.assign(this.popup.style,{left:`${i}px`,top:`${o}px`}),this.arrow){let l=s.arrow.x,f=s.arrow.y,h="",m="",u="",d="";if(this.arrowPlacement==="start"){let p=typeof l=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";h=typeof f=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",m=a?p:"",d=a?"":p}else if(this.arrowPlacement==="end"){let p=typeof l=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";m=a?"":p,d=a?p:"",u=typeof f=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else this.arrowPlacement==="center"?(d=typeof l=="number"?"calc(50% - var(--arrow-size-diagonal))":"",h=typeof f=="number"?"calc(50% - var(--arrow-size-diagonal))":""):(d=typeof l=="number"?`${l}px`:"",h=typeof f=="number"?`${f}px`:"");Object.assign(this.arrowEl.style,{top:h,right:m,bottom:u,left:d,[c]:"calc(var(--arrow-size-diagonal) * -1)"})}}),this.emit("sd-reposition")}render(){return Ot`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><div part="popup" class="${Dt("isolate",this.strategy!=="fixed"?"absolute":"fixed",!this.active&&"hidden")}"><slot></slot>${this.arrow?Ot`<div part="arrow" class="absolute rotate-45 -z-10" role="presentation"></div>`:""}</div>`}};x.styles=[...Rt.styles,Mt`:host{--arrow-color:var(--sd-color-neutral-1000);--arrow-size:6px;--arrow-size-diagonal:calc(var(--arrow-size)*0.7071);--arrow-padding-offset:calc(var(--arrow-size-diagonal) - var(--arrow-size));display:contents}[part=popup]{max-height:var(--auto-size-available-height,none);max-width:var(--auto-size-available-width,none)}[part=arrow]{background:var(--arrow-color);height:calc(var(--arrow-size-diagonal)*2);width:calc(var(--arrow-size-diagonal)*2)}`],b([Et('[part="popup"]')],x.prototype,"popup",2),b([Et('[part="arrow"]')],x.prototype,"arrowEl",2),b([E({reflect:!0})],x.prototype,"anchor",2),b([E({type:Boolean,reflect:!0})],x.prototype,"active",2),b([E({type:String,reflect:!0})],x.prototype,"placement",2),b([E({type:String,reflect:!0})],x.prototype,"strategy",2),b([E({type:Number,reflect:!0})],x.prototype,"distance",2),b([E({type:Number,reflect:!0})],x.prototype,"skidding",2),b([E({type:Boolean,reflect:!0})],x.prototype,"arrow",2),b([E({type:String,attribute:"arrow-placement",reflect:!0})],x.prototype,"arrowPlacement",2),b([E({attribute:"arrow-padding",type:Number,reflect:!0})],x.prototype,"arrowPadding",2),b([E({type:Boolean,reflect:!0})],x.prototype,"flip",2),b([E({attribute:"flip-fallback-placements",converter:{fromAttribute:n=>n.split(" ").map(i=>i.trim()).filter(i=>i!==""),toAttribute:n=>n.join(" ")}})],x.prototype,"flipFallbackPlacements",2),b([E({type:String,attribute:"flip-fallback-strategy"})],x.prototype,"flipFallbackStrategy",2),b([E({type:Object})],x.prototype,"flipBoundary",2),b([E({attribute:"flip-padding",type:Number})],x.prototype,"flipPadding",2),b([E({type:Boolean})],x.prototype,"shift",2),b([E({type:Object})],x.prototype,"shiftBoundary",2),b([E({attribute:"shift-padding",type:Number})],x.prototype,"shiftPadding",2),b([E({type:String,attribute:"auto-size"})],x.prototype,"autoSize",2),b([E()],x.prototype,"sync",2),b([E({type:Object})],x.prototype,"autoSizeBoundary",2),b([E({attribute:"auto-size-padding",type:Number})],x.prototype,"autoSizePadding",2),x=b([kt("sd-5-15-5-popup")],x);export{x as a};
1
+ import{a as Dt}from"./chunk.26V4EXHB.js";import{a as kt,b as E,d as Et,h as Rt}from"./chunk.HVSHE3SX.js";import{b as Mt,e as Ot}from"./chunk.ZR5P6TQI.js";import{a as C,b as V,c as dt,e as b}from"./chunk.TJOCV4DC.js";var _=Math.min,T=Math.max,ct=Math.round,ft=Math.floor,F=t=>({x:t,y:t}),de={left:"right",right:"left",bottom:"top",top:"bottom"},me={start:"end",end:"start"};function pt(t,e,n){return T(t,_(e,n))}function Z(t,e){return typeof t=="function"?t(e):t}function q(t){return t.split("-")[0]}function tt(t){return t.split("-")[1]}function Ct(t){return t==="x"?"y":"x"}function gt(t){return t==="y"?"height":"width"}var pe=new Set(["top","bottom"]);function j(t){return pe.has(q(t))?"y":"x"}function wt(t){return Ct(j(t))}function $t(t,e,n){n===void 0&&(n=!1);let i=tt(t),o=wt(t),s=gt(o),r=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=lt(r)),[r,lt(r)]}function Nt(t){let e=lt(t);return[mt(t),e,mt(e)]}function mt(t){return t.replace(/start|end/g,e=>me[e])}var Bt=["left","right"],Ft=["right","left"],ge=["top","bottom"],we=["bottom","top"];function ye(t,e,n){switch(t){case"top":case"bottom":return n?e?Ft:Bt:e?Bt:Ft;case"left":case"right":return e?ge:we;default:return[]}}function Ht(t,e,n,i){let o=tt(t),s=ye(q(t),n==="start",i);return o&&(s=s.map(r=>r+"-"+o),e&&(s=s.concat(s.map(mt)))),s}function lt(t){return t.replace(/left|right|bottom|top/g,e=>de[e])}function xe(t){return C({top:0,right:0,bottom:0,left:0},t)}function Tt(t){return typeof t!="number"?xe(t):{top:t,right:t,bottom:t,left:t}}function et(t){let{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function Wt(t,e,n){let{reference:i,floating:o}=t,s=j(e),r=wt(e),a=gt(r),c=q(e),l=s==="y",f=i.x+i.width/2-o.width/2,h=i.y+i.height/2-o.height/2,m=i[a]/2-o[a]/2,u;switch(c){case"top":u={x:f,y:i.y-o.height};break;case"bottom":u={x:f,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:h};break;case"left":u={x:i.x-o.width,y:h};break;default:u={x:i.x,y:i.y}}switch(tt(e)){case"start":u[r]-=m*(n&&l?-1:1);break;case"end":u[r]+=m*(n&&l?-1:1);break}return u}var Vt=async(t,e,n)=>{let{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:r}=n,a=s.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e)),l=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:h}=Wt(l,i,c),m=i,u={},d=0;for(let p=0;p<a.length;p++){let{name:w,fn:g}=a[p],{x:y,y:v,data:A,reset:O}=await g({x:f,y:h,initialPlacement:i,placement:m,strategy:o,middlewareData:u,rects:l,platform:r,elements:{reference:t,floating:e}});f=y!=null?y:f,h=v!=null?v:h,u=V(C({},u),{[w]:C(C({},u[w]),A)}),O&&d<=50&&(d++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(l=O.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:o}):O.rects),{x:f,y:h}=Wt(l,m,c)),p=-1)}return{x:f,y:h,placement:m,strategy:o,middlewareData:u}};async function yt(t,e){var n;e===void 0&&(e={});let{x:i,y:o,platform:s,rects:r,elements:a,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:u=0}=Z(e,t),d=Tt(u),w=a[m?h==="floating"?"reference":"floating":h],g=et(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:f,strategy:c})),y=h==="floating"?{x:i,y:o,width:r.floating.width,height:r.floating.height}:r.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),A=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},O=et(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:c}):y);return{top:(g.top-O.top+d.top)/A.y,bottom:(O.bottom-g.bottom+d.bottom)/A.y,left:(g.left-O.left+d.left)/A.x,right:(O.right-g.right+d.right)/A.x}}var _t=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:i,placement:o,rects:s,platform:r,elements:a,middlewareData:c}=e,{element:l,padding:f=0}=Z(t,e)||{};if(l==null)return{};let h=Tt(f),m={x:n,y:i},u=wt(o),d=gt(u),p=await r.getDimensions(l),w=u==="y",g=w?"top":"left",y=w?"bottom":"right",v=w?"clientHeight":"clientWidth",A=s.reference[d]+s.reference[u]-m[u]-s.floating[d],O=m[u]-s.reference[u],k=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l)),R=k?k[v]:0;(!R||!await(r.isElement==null?void 0:r.isElement(k)))&&(R=a.floating[v]||s.floating[d]);let I=A/2-O/2,H=R/2-p[d]/2-1,L=_(h[g],H),U=_(h[y],H),W=L,K=R-p[d]-U,S=R/2-p[d]/2+I,D=pt(W,S,K),J=!c.arrow&&tt(o)!=null&&S!==D&&s.reference[d]/2-(S<W?L:U)-p[d]/2<0,Y=J?S<W?S-W:S-K:0;return{[u]:m[u]+Y,data:C({[u]:D,centerOffset:S-D-Y},J&&{alignmentOffset:Y}),reset:J}}});var jt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;let{placement:o,middlewareData:s,rects:r,initialPlacement:a,platform:c,elements:l}=e,S=Z(t,e),{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:p=!0}=S,w=dt(S,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=s.arrow)!=null&&n.alignmentOffset)return{};let g=q(o),y=j(a),v=q(a)===a,A=await(c.isRTL==null?void 0:c.isRTL(l.floating)),O=m||(v||!p?[lt(a)]:Nt(a)),k=d!=="none";!m&&k&&O.push(...Ht(a,p,d,A));let R=[a,...O],I=await yt(e,w),H=[],L=((i=s.flip)==null?void 0:i.overflows)||[];if(f&&H.push(I[g]),h){let D=$t(o,r,A);H.push(I[D[0]],I[D[1]])}if(L=[...L,{placement:o,overflows:H}],!H.every(D=>D<=0)){var U,W;let D=(((U=s.flip)==null?void 0:U.index)||0)+1,J=R[D];if(J&&(!(h==="alignment"?y!==j(J):!1)||L.every(B=>j(B.placement)===y?B.overflows[0]>0:!0)))return{data:{index:D,overflows:L},reset:{placement:J}};let Y=(W=L.filter(Q=>Q.overflows[0]<=0).sort((Q,B)=>Q.overflows[1]-B.overflows[1])[0])==null?void 0:W.placement;if(!Y)switch(u){case"bestFit":{var K;let Q=(K=L.filter(B=>{if(k){let G=j(B.placement);return G===y||G==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(G=>G>0).reduce((G,he)=>G+he,0)]).sort((B,G)=>B[1]-G[1])[0])==null?void 0:K[0];Q&&(Y=Q);break}case"initialPlacement":Y=a;break}if(o!==Y)return{reset:{placement:Y}}}return{}}}};var ve=new Set(["left","top"]);async function be(t,e){let{placement:n,platform:i,elements:o}=t,s=await(i.isRTL==null?void 0:i.isRTL(o.floating)),r=q(n),a=tt(n),c=j(n)==="y",l=ve.has(r)?-1:1,f=s&&c?-1:1,h=Z(e,t),{mainAxis:m,crossAxis:u,alignmentAxis:d}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof d=="number"&&(u=a==="end"?d*-1:d),c?{x:u*f,y:m*l}:{x:m*l,y:u*f}}var It=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:o,y:s,placement:r,middlewareData:a}=e,c=await be(e,t);return r===((n=a.offset)==null?void 0:n.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:V(C({},c),{placement:r})}}}},Yt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:o}=e,w=Z(t,e),{mainAxis:s=!0,crossAxis:r=!1,limiter:a={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}}}=w,c=dt(w,["mainAxis","crossAxis","limiter"]),l={x:n,y:i},f=await yt(e,c),h=j(q(o)),m=Ct(h),u=l[m],d=l[h];if(s){let g=m==="y"?"top":"left",y=m==="y"?"bottom":"right",v=u+f[g],A=u-f[y];u=pt(v,u,A)}if(r){let g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=d+f[g],A=d-f[y];d=pt(v,d,A)}let p=a.fn(V(C({},e),{[m]:u,[h]:d}));return V(C({},p),{data:{x:p.x-n,y:p.y-i,enabled:{[m]:s,[h]:r}}})}}};var qt=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;let{placement:o,rects:s,platform:r,elements:a}=e,L=Z(t,e),{apply:c=()=>{}}=L,l=dt(L,["apply"]),f=await yt(e,l),h=q(o),m=tt(o),u=j(o)==="y",{width:d,height:p}=s.floating,w,g;h==="top"||h==="bottom"?(w=h,g=m===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(g=h,w=m==="end"?"top":"bottom");let y=p-f.top-f.bottom,v=d-f.left-f.right,A=_(p-f[w],y),O=_(d-f[g],v),k=!e.middlewareData.shift,R=A,I=O;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(I=v),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(R=y),k&&!m){let U=T(f.left,0),W=T(f.right,0),K=T(f.top,0),S=T(f.bottom,0);u?I=d-2*(U!==0||W!==0?U+W:T(f.left,f.right)):R=p-2*(K!==0||S!==0?K+S:T(f.top,f.bottom))}await c(V(C({},e),{availableWidth:I,availableHeight:R}));let H=await r.getDimensions(a.floating);return d!==H.width||p!==H.height?{reset:{rects:!0}}:{}}}};function xt(){return typeof window!="undefined"}function nt(t){return Ut(t)?(t.nodeName||"").toLowerCase():"#document"}function P(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $(t){var e;return(e=(Ut(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ut(t){return xt()?t instanceof Node||t instanceof P(t).Node:!1}function z(t){return xt()?t instanceof Element||t instanceof P(t).Element:!1}function N(t){return xt()?t instanceof HTMLElement||t instanceof P(t).HTMLElement:!1}function Xt(t){return!xt()||typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof P(t).ShadowRoot}var Ae=new Set(["inline","contents"]);function st(t){let{overflow:e,overflowX:n,overflowY:i,display:o}=M(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!Ae.has(o)}var Oe=new Set(["table","td","th"]);function Kt(t){return Oe.has(nt(t))}var Ee=[":popover-open",":modal"];function ut(t){return Ee.some(e=>{try{return t.matches(e)}catch(n){return!1}})}var Re=["transform","translate","scale","rotate","perspective"],Ce=["transform","translate","scale","rotate","perspective","filter"],Te=["paint","layout","strict","content"];function vt(t){let e=bt(),n=z(t)?M(t):t;return Re.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Ce.some(i=>(n.willChange||"").includes(i))||Te.some(i=>(n.contain||"").includes(i))}function Gt(t){let e=X(t);for(;N(e)&&!it(e);){if(vt(e))return e;if(ut(e))return null;e=X(e)}return null}function bt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var Pe=new Set(["html","body","#document"]);function it(t){return Pe.has(nt(t))}function M(t){return P(t).getComputedStyle(t)}function ht(t){return z(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function X(t){if(nt(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Xt(t)&&t.host||$(t);return Xt(e)?e.host:e}function Jt(t){let e=X(t);return it(e)?t.ownerDocument?t.ownerDocument.body:t.body:N(e)&&st(e)?e:Jt(e)}function rt(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let o=Jt(t),s=o===((i=t.ownerDocument)==null?void 0:i.body),r=P(o);if(s){let a=At(r);return e.concat(r,r.visualViewport||[],st(o)?o:[],a&&n?rt(a):[])}return e.concat(o,rt(o,[],n))}function At(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function te(t){let e=M(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,o=N(t),s=o?t.offsetWidth:n,r=o?t.offsetHeight:i,a=ct(n)!==s||ct(i)!==r;return a&&(n=s,i=r),{width:n,height:i,$:a}}function St(t){return z(t)?t:t.contextElement}function at(t){let e=St(t);if(!N(e))return F(1);let n=e.getBoundingClientRect(),{width:i,height:o,$:s}=te(e),r=(s?ct(n.width):n.width)/i,a=(s?ct(n.height):n.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}var Se=F(0);function ee(t){let e=P(t);return!bt()||!e.visualViewport?Se:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Le(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==P(t)?!1:e}function ot(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let o=t.getBoundingClientRect(),s=St(t),r=F(1);e&&(i?z(i)&&(r=at(i)):r=at(t));let a=Le(s,n,i)?ee(s):F(0),c=(o.left+a.x)/r.x,l=(o.top+a.y)/r.y,f=o.width/r.x,h=o.height/r.y;if(s){let m=P(s),u=i&&z(i)?P(i):i,d=m,p=At(d);for(;p&&i&&u!==d;){let w=at(p),g=p.getBoundingClientRect(),y=M(p),v=g.left+(p.clientLeft+parseFloat(y.paddingLeft))*w.x,A=g.top+(p.clientTop+parseFloat(y.paddingTop))*w.y;c*=w.x,l*=w.y,f*=w.x,h*=w.y,c+=v,l+=A,d=P(p),p=At(d)}}return et({width:f,height:h,x:c,y:l})}function Lt(t,e){let n=ht(t).scrollLeft;return e?e.left+n:ot($(t)).left+n}function ne(t,e,n){n===void 0&&(n=!1);let i=t.getBoundingClientRect(),o=i.left+e.scrollLeft-(n?0:Lt(t,i)),s=i.top+e.scrollTop;return{x:o,y:s}}function ze(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t,s=o==="fixed",r=$(i),a=e?ut(e.floating):!1;if(i===r||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=F(1),f=F(0),h=N(i);if((h||!h&&!s)&&((nt(i)!=="body"||st(r))&&(c=ht(i)),N(i))){let u=ot(i);l=at(i),f.x=u.x+i.clientLeft,f.y=u.y+i.clientTop}let m=r&&!h&&!s?ne(r,c,!0):F(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+f.x+m.x,y:n.y*l.y-c.scrollTop*l.y+f.y+m.y}}function Me(t){return Array.from(t.getClientRects())}function ke(t){let e=$(t),n=ht(t),i=t.ownerDocument.body,o=T(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=T(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),r=-n.scrollLeft+Lt(t),a=-n.scrollTop;return M(i).direction==="rtl"&&(r+=T(e.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:a}}function De(t,e){let n=P(t),i=$(t),o=n.visualViewport,s=i.clientWidth,r=i.clientHeight,a=0,c=0;if(o){s=o.width,r=o.height;let l=bt();(!l||l&&e==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:s,height:r,x:a,y:c}}var Be=new Set(["absolute","fixed"]);function Fe(t,e){let n=ot(t,!0,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft,s=N(t)?at(t):F(1),r=t.clientWidth*s.x,a=t.clientHeight*s.y,c=o*s.x,l=i*s.y;return{width:r,height:a,x:c,y:l}}function Qt(t,e,n){let i;if(e==="viewport")i=De(t,n);else if(e==="document")i=ke($(t));else if(z(e))i=Fe(e,n);else{let o=ee(t);i={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return et(i)}function ie(t,e){let n=X(t);return n===e||!z(n)||it(n)?!1:M(n).position==="fixed"||ie(n,e)}function $e(t,e){let n=e.get(t);if(n)return n;let i=rt(t,[],!1).filter(a=>z(a)&&nt(a)!=="body"),o=null,s=M(t).position==="fixed",r=s?X(t):t;for(;z(r)&&!it(r);){let a=M(r),c=vt(r);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&Be.has(o.position)||st(r)&&!c&&ie(t,r))?i=i.filter(f=>f!==r):o=a,r=X(r)}return e.set(t,i),i}function Ne(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t,r=[...n==="clippingAncestors"?ut(e)?[]:$e(e,this._c):[].concat(n),i],a=r[0],c=r.reduce((l,f)=>{let h=Qt(e,f,o);return l.top=T(h.top,l.top),l.right=_(h.right,l.right),l.bottom=_(h.bottom,l.bottom),l.left=T(h.left,l.left),l},Qt(e,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function He(t){let{width:e,height:n}=te(t);return{width:e,height:n}}function We(t,e,n){let i=N(e),o=$(e),s=n==="fixed",r=ot(t,!0,s,e),a={scrollLeft:0,scrollTop:0},c=F(0);function l(){c.x=Lt(o)}if(i||!i&&!s)if((nt(e)!=="body"||st(o))&&(a=ht(e)),i){let u=ot(e,!0,s,e);c.x=u.x+e.clientLeft,c.y=u.y+e.clientTop}else o&&l();s&&!i&&o&&l();let f=o&&!i&&!s?ne(o,a):F(0),h=r.left+a.scrollLeft-c.x-f.x,m=r.top+a.scrollTop-c.y-f.y;return{x:h,y:m,width:r.width,height:r.height}}function Pt(t){return M(t).position==="static"}function Zt(t,e){if(!N(t)||M(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return $(t)===n&&(n=n.ownerDocument.body),n}function oe(t,e){let n=P(t);if(ut(t))return n;if(!N(t)){let o=X(t);for(;o&&!it(o);){if(z(o)&&!Pt(o))return o;o=X(o)}return n}let i=Zt(t,e);for(;i&&Kt(i)&&Pt(i);)i=Zt(i,e);return i&&it(i)&&Pt(i)&&!vt(i)?n:i||Gt(t)||n}var Ve=async function(t){let e=this.getOffsetParent||oe,n=this.getDimensions,i=await n(t.floating);return{reference:We(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function _e(t){return M(t).direction==="rtl"}var je={convertOffsetParentRelativeRectToViewportRelativeRect:ze,getDocumentElement:$,getClippingRect:Ne,getOffsetParent:oe,getElementRects:Ve,getClientRects:Me,getDimensions:He,getScale:at,isElement:z,isRTL:_e};function re(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ie(t,e){let n=null,i,o=$(t);function s(){var a;clearTimeout(i),(a=n)==null||a.disconnect(),n=null}function r(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();let l=t.getBoundingClientRect(),{left:f,top:h,width:m,height:u}=l;if(a||e(),!m||!u)return;let d=ft(h),p=ft(o.clientWidth-(f+m)),w=ft(o.clientHeight-(h+u)),g=ft(f),v={rootMargin:-d+"px "+-p+"px "+-w+"px "+-g+"px",threshold:T(0,_(1,c))||1},A=!0;function O(k){let R=k[0].intersectionRatio;if(R!==c){if(!A)return r();R?r(!1,R):i=setTimeout(()=>{r(!1,1e-7)},1e3)}R===1&&!re(l,t.getBoundingClientRect())&&r(),A=!1}try{n=new IntersectionObserver(O,V(C({},v),{root:o.ownerDocument}))}catch(k){n=new IntersectionObserver(O,v)}n.observe(t)}return r(!0),s}function se(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,l=St(t),f=o||s?[...l?rt(l):[],...rt(e)]:[];f.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});let h=l&&a?Ie(l,n):null,m=-1,u=null;r&&(u=new ResizeObserver(g=>{let[y]=g;y&&y.target===l&&u&&(u.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var v;(v=u)==null||v.observe(e)})),n()}),l&&!c&&u.observe(l),u.observe(e));let d,p=c?ot(t):null;c&&w();function w(){let g=ot(t);p&&!re(p,g)&&n(),p=g,d=requestAnimationFrame(w)}return n(),()=>{var g;f.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),h==null||h(),(g=u)==null||g.disconnect(),u=null,c&&cancelAnimationFrame(d)}}var ae=It;var le=Yt,ce=jt,zt=qt;var fe=_t;var ue=(t,e,n)=>{let i=new Map,o=C({platform:je},n),s=V(C({},o.platform),{_c:i});return Vt(t,e,V(C({},o),{platform:s}))};var x=class extends Rt{constructor(){super(...arguments);this.active=!1;this.placement="top";this.strategy="absolute";this.distance=0;this.skidding=0;this.arrow=!1;this.arrowPlacement="anchor";this.arrowPadding=10;this.flip=!1;this.flipFallbackPlacements="";this.flipFallbackStrategy="best-fit";this.flipPadding=0;this.shift=!1;this.shiftPadding=0;this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start(),this.setupMutationObserver()}disconnectedCallback(){this.stop(),this.mutationObserver&&this.mutationObserver.disconnect()}async updated(n){super.updated(n),n.has("active")&&(this.active?this.start():this.stop()),n.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}setupMutationObserver(){this.mutationObserver=new MutationObserver(i=>this.handleCurrentPlacementChange(i));let n={attributes:!0};this.mutationObserver.observe(this,n)}handleCurrentPlacementChange(n){return n.forEach(i=>{if(i.attributeName==="data-current-placement"){let o=this.getAttribute("data-current-placement");this.emit("sd-current-placement",{detail:o})}})}async handleAnchorChange(){if(await this.stop(),this.anchor&&typeof this.anchor=="string"){let n=this.getRootNode();this.anchorEl=n.getElementById(this.anchor)}else this.anchor instanceof HTMLElement?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');if(this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),!this.anchorEl)throw new Error("Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.");this.start()}start(){this.anchorEl&&(this.cleanup=se(this.anchorEl,this.popup,()=>{this.reposition()}))}async stop(){return new Promise(n=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame(()=>n())):n()})}reposition(){if(!this.active||!this.anchorEl)return;let n=[ae({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?n.push(zt({apply:({rects:i})=>{let o=this.sync==="width"||this.sync==="both",s=this.sync==="height"||this.sync==="both";this.popup.style.width=o?`${i.reference.width}px`:"",this.popup.style.height=s?`${i.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&n.push(ce({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:this.flipFallbackStrategy==="best-fit"?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&n.push(le({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?n.push(zt({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:i,availableHeight:o})=>{this.autoSize==="vertical"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-height",`${o}px`):this.style.removeProperty("--auto-size-available-height"),this.autoSize==="horizontal"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-width",`${i}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&n.push(fe({element:this.arrowEl,padding:this.arrowPadding})),ue(this.anchorEl,this.popup,{placement:this.placement,middleware:n,strategy:this.strategy}).then(({x:i,y:o,middlewareData:s,placement:r})=>{let a=getComputedStyle(this).direction==="rtl",c={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]];if(this.setAttribute("data-current-placement",r),Object.assign(this.popup.style,{left:`${i}px`,top:`${o}px`}),this.arrow){let l=s.arrow.x,f=s.arrow.y,h="",m="",u="",d="";if(this.arrowPlacement==="start"){let p=typeof l=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";h=typeof f=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",m=a?p:"",d=a?"":p}else if(this.arrowPlacement==="end"){let p=typeof l=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";m=a?"":p,d=a?p:"",u=typeof f=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else this.arrowPlacement==="center"?(d=typeof l=="number"?"calc(50% - var(--arrow-size-diagonal))":"",h=typeof f=="number"?"calc(50% - var(--arrow-size-diagonal))":""):(d=typeof l=="number"?`${l}px`:"",h=typeof f=="number"?`${f}px`:"");Object.assign(this.arrowEl.style,{top:h,right:m,bottom:u,left:d,[c]:"calc(var(--arrow-size-diagonal) * -1)"})}}),this.emit("sd-reposition")}render(){return Ot`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><div part="popup" class="${Dt("isolate",this.strategy!=="fixed"?"absolute":"fixed",!this.active&&"hidden")}"><slot></slot>${this.arrow?Ot`<div part="arrow" class="absolute rotate-45 -z-10" role="presentation"></div>`:""}</div>`}};x.styles=[...Rt.styles,Mt`:host{--arrow-color:var(--sd-color-neutral-1000);--arrow-size:6px;--arrow-size-diagonal:calc(var(--arrow-size)*0.7071);--arrow-padding-offset:calc(var(--arrow-size-diagonal) - var(--arrow-size));display:contents}[part=popup]{max-height:var(--auto-size-available-height,none);max-width:var(--auto-size-available-width,none)}[part=arrow]{background:var(--arrow-color);height:calc(var(--arrow-size-diagonal)*2);width:calc(var(--arrow-size-diagonal)*2)}`],b([Et('[part="popup"]')],x.prototype,"popup",2),b([Et('[part="arrow"]')],x.prototype,"arrowEl",2),b([E({reflect:!0})],x.prototype,"anchor",2),b([E({type:Boolean,reflect:!0})],x.prototype,"active",2),b([E({type:String,reflect:!0})],x.prototype,"placement",2),b([E({type:String,reflect:!0})],x.prototype,"strategy",2),b([E({type:Number,reflect:!0})],x.prototype,"distance",2),b([E({type:Number,reflect:!0})],x.prototype,"skidding",2),b([E({type:Boolean,reflect:!0})],x.prototype,"arrow",2),b([E({type:String,attribute:"arrow-placement",reflect:!0})],x.prototype,"arrowPlacement",2),b([E({attribute:"arrow-padding",type:Number,reflect:!0})],x.prototype,"arrowPadding",2),b([E({type:Boolean,reflect:!0})],x.prototype,"flip",2),b([E({attribute:"flip-fallback-placements",converter:{fromAttribute:n=>n.split(" ").map(i=>i.trim()).filter(i=>i!==""),toAttribute:n=>n.join(" ")}})],x.prototype,"flipFallbackPlacements",2),b([E({type:String,attribute:"flip-fallback-strategy"})],x.prototype,"flipFallbackStrategy",2),b([E({type:Object})],x.prototype,"flipBoundary",2),b([E({attribute:"flip-padding",type:Number})],x.prototype,"flipPadding",2),b([E({type:Boolean})],x.prototype,"shift",2),b([E({type:Object})],x.prototype,"shiftBoundary",2),b([E({attribute:"shift-padding",type:Number})],x.prototype,"shiftPadding",2),b([E({type:String,attribute:"auto-size"})],x.prototype,"autoSize",2),b([E()],x.prototype,"sync",2),b([E({type:Object})],x.prototype,"autoSizeBoundary",2),b([E({attribute:"auto-size-padding",type:Number})],x.prototype,"autoSizePadding",2),x=b([kt("sd-5-15-6-popup")],x);export{x as a};
@@ -1 +1 @@
1
- function w(n,{setValueOnSelection:p,scrollSelectionIntoView:c}={setValueOnSelection:!0,scrollSelectionIntoView:!0}){let r=n?typeof n=="string"?document.querySelector(n):n:document.querySelector("#autoComplete"),i=r.shadowRoot.querySelector("input"),l=o=>o[0];return i.addEventListener("init",()=>{var a,s;let o=(a=r.shadowRoot)==null?void 0:a.querySelector("ul");o==null||o.setAttribute("part","listbox");let t=document.createElement("sd-5-15-5-popup");t.appendChild(o),(s=r.shadowRoot)==null||s.appendChild(t),t==null||t.setAttribute("exportparts","popup__content"),t&&(t.active=!1,t.autoSize="vertical",t.autoSizePadding=16,t.placement="bottom-start",t.anchor=r,t.sync="width");let d=l`sd-5-15-5-popup::part(popup){border-bottom-left-radius:var(--sd-border-radius-default,.25rem);border-bottom-right-radius:var(--sd-border-radius-default,.25rem);border-width:0 2px 2px;overflow-y:scroll;z-index:var(--sd-z-index-dropdown,900);--tw-border-opacity:1;border-color:rgb(var(--sd-color-primary,0 53 142)/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(var(--sd-color-white,255 255 255)/var(--tw-bg-opacity,1));padding:var(--sd-spacing-3,.75rem) var(--sd-spacing-2,.5rem);--tw-shadow:var(--sd-shadow,0px 1px 3px 0px rgba(81,81,81,.75));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-5-15-5-popup li{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}sd-5-15-5-popup li:hover:not([disabled]){--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-100,246 246 246)/var(--tw-bg-opacity,1))}sd-5-15-5-popup li{list-style-type:""}sd-5-15-5-popup li mark{background-color:transparent;font-weight:700}sd-5-15-5-popup li:not(:has(sd-5-15-5-option)){cursor:pointer;font-size:var(--sd-font-size-base,1rem);padding:var(--sd-spacing-3,.75rem) var(--sd-spacing-4,1rem);--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24)/var(--tw-text-opacity,1))}sd-5-15-5-popup li:not(:has(sd-5-15-5-option)):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233)/var(--tw-bg-opacity,1))}sd-5-15-5-popup li[aria-selected=true]{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233)/var(--tw-bg-opacity,1))}`,e=new CSSStyleSheet;e.replaceSync(d),r.shadowRoot.adoptedStyleSheets=[...r.shadowRoot.adoptedStyleSheets,e]}),p&&i.addEventListener("selection",o=>{var t;r.value=(t=o==null?void 0:o.detail)==null?void 0:t.selection.value}),i.addEventListener("open",()=>{var o,t,d,e,a,s;(t=(o=r.shadowRoot)==null?void 0:o.querySelector("sd-5-15-5-popup"))==null||t.setAttribute("active","true"),(e=(d=r.shadowRoot)==null?void 0:d.querySelector('[part="border"]'))==null||e.classList.add("rounded-b-none"),(s=(a=r.shadowRoot)==null?void 0:a.querySelector('[part="form-control"]'))==null||s.classList.add("z-50")}),i.addEventListener("close",()=>{var o,t,d,e,a,s;(t=(o=r.shadowRoot)==null?void 0:o.querySelector("sd-5-15-5-popup"))==null||t.removeAttribute("active"),(e=(d=r.shadowRoot)==null?void 0:d.querySelector('[part="border"]'))==null||e.classList.remove("rounded-b-none"),(s=(a=r.shadowRoot)==null?void 0:a.querySelector('[part="form-control"]'))==null||s.classList.remove("z-50")}),c&&i.addEventListener("navigate",()=>{let o=r.shadowRoot.querySelector('[aria-selected="true"]');o==null||o.scrollIntoView({block:"nearest"})}),{config:{selector:()=>i,resultsList:{tag:"ul"},wrapper:!1}}}export{w as a};
1
+ function w(n,{setValueOnSelection:p,scrollSelectionIntoView:c}={setValueOnSelection:!0,scrollSelectionIntoView:!0}){let r=n?typeof n=="string"?document.querySelector(n):n:document.querySelector("#autoComplete"),i=r.shadowRoot.querySelector("input"),l=o=>o[0];return i.addEventListener("init",()=>{var a,s;let o=(a=r.shadowRoot)==null?void 0:a.querySelector("ul");o==null||o.setAttribute("part","listbox");let t=document.createElement("sd-5-15-6-popup");t.appendChild(o),(s=r.shadowRoot)==null||s.appendChild(t),t==null||t.setAttribute("exportparts","popup__content"),t&&(t.active=!1,t.autoSize="vertical",t.autoSizePadding=16,t.placement="bottom-start",t.anchor=r,t.sync="width");let d=l`sd-5-15-6-popup::part(popup){border-bottom-left-radius:var(--sd-border-radius-default,.25rem);border-bottom-right-radius:var(--sd-border-radius-default,.25rem);border-width:0 2px 2px;overflow-y:scroll;z-index:var(--sd-z-index-dropdown,900);--tw-border-opacity:1;border-color:rgb(var(--sd-color-primary,0 53 142)/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(var(--sd-color-white,255 255 255)/var(--tw-bg-opacity,1));padding:var(--sd-spacing-3,.75rem) var(--sd-spacing-2,.5rem);--tw-shadow:var(--sd-shadow,0px 1px 3px 0px rgba(81,81,81,.75));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-5-15-6-popup li{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}sd-5-15-6-popup li:hover:not([disabled]){--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-100,246 246 246)/var(--tw-bg-opacity,1))}sd-5-15-6-popup li{list-style-type:""}sd-5-15-6-popup li mark{background-color:transparent;font-weight:700}sd-5-15-6-popup li:not(:has(sd-5-15-6-option)){cursor:pointer;font-size:var(--sd-font-size-base,1rem);padding:var(--sd-spacing-3,.75rem) var(--sd-spacing-4,1rem);--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24)/var(--tw-text-opacity,1))}sd-5-15-6-popup li:not(:has(sd-5-15-6-option)):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233)/var(--tw-bg-opacity,1))}sd-5-15-6-popup li[aria-selected=true]{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233)/var(--tw-bg-opacity,1))}`,e=new CSSStyleSheet;e.replaceSync(d),r.shadowRoot.adoptedStyleSheets=[...r.shadowRoot.adoptedStyleSheets,e]}),p&&i.addEventListener("selection",o=>{var t;r.value=(t=o==null?void 0:o.detail)==null?void 0:t.selection.value}),i.addEventListener("open",()=>{var o,t,d,e,a,s;(t=(o=r.shadowRoot)==null?void 0:o.querySelector("sd-5-15-6-popup"))==null||t.setAttribute("active","true"),(e=(d=r.shadowRoot)==null?void 0:d.querySelector('[part="border"]'))==null||e.classList.add("rounded-b-none"),(s=(a=r.shadowRoot)==null?void 0:a.querySelector('[part="form-control"]'))==null||s.classList.add("z-50")}),i.addEventListener("close",()=>{var o,t,d,e,a,s;(t=(o=r.shadowRoot)==null?void 0:o.querySelector("sd-5-15-6-popup"))==null||t.removeAttribute("active"),(e=(d=r.shadowRoot)==null?void 0:d.querySelector('[part="border"]'))==null||e.classList.remove("rounded-b-none"),(s=(a=r.shadowRoot)==null?void 0:a.querySelector('[part="form-control"]'))==null||s.classList.remove("z-50")}),c&&i.addEventListener("navigate",()=>{let o=r.shadowRoot.querySelector('[aria-selected="true"]');o==null||o.scrollIntoView({block:"nearest"})}),{config:{selector:()=>i,resultsList:{tag:"ul"},wrapper:!1}}}export{w as a};
@@ -1,11 +1,11 @@
1
- import{a as M}from"./chunk.RTXVVB2O.js";import{c as I}from"./chunk.3L472FD4.js";import{b as z}from"./chunk.7JV32P5Q.js";import{a as L}from"./chunk.CGQ2BPPZ.js";import{a as w,c as O}from"./chunk.SKUMYG4O.js";import{a as C}from"./chunk.KLRPP4NQ.js";import{a as k}from"./chunk.FODPSMJF.js";import{a as d}from"./chunk.26V4EXHB.js";import{a as D}from"./chunk.Y7NVH75J.js";import{a as b}from"./chunk.E2DRD2OX.js";import{a as $,b as a,c as u,d as c,g as E,h as x}from"./chunk.HVSHE3SX.js";import{b as T,e as p}from"./chunk.ZR5P6TQI.js";import{b as v,e as y}from"./chunk.6OTM3PE5.js";import{e as s}from"./chunk.TJOCV4DC.js";var i=class extends x{constructor(){super(...arguments);this.formControlController=new z(this,{assumeInteractionOn:["sd-blur","sd-5-15-5-input"]});this.hasSlotController=new L(this,"help-text","label");this.localize=new D(this);this.typeToSelectString="";this.deletedTagLabel="";this.hasFocus=!1;this.selectedOptions=[];this.showValidStyle=!1;this.showInvalidStyle=!1;this.defaultValue="";this.open=!1;this.size="lg";this.placement="bottom";this.label="";this.placeholder="";this.maxOptionsTagLabel="";this.disabled=!1;this.visuallyDisabled=!1;this.helpText="";this.currentPlacement=this.placement;this.clearable=!1;this.multiple=!1;this.useTags=!1;this.maxOptionsVisible=3;this.form="";this.name="";this.value="";this.required=!1;this.styleOnValid=!1;this.hoist=!1;this.getTag=t=>p`<sd-5-15-5-tag class="relative z-10" ?disabled="${this.disabled}" part="tag" exportparts="
1
+ import{a as M}from"./chunk.RTXVVB2O.js";import{c as I}from"./chunk.3L472FD4.js";import{b as z}from"./chunk.7JV32P5Q.js";import{a as L}from"./chunk.CGQ2BPPZ.js";import{a as w,c as O}from"./chunk.SKUMYG4O.js";import{a as C}from"./chunk.KLRPP4NQ.js";import{a as k}from"./chunk.FODPSMJF.js";import{a as d}from"./chunk.26V4EXHB.js";import{a as D}from"./chunk.Y7NVH75J.js";import{a as b}from"./chunk.E2DRD2OX.js";import{a as $,b as a,c as u,d as c,g as E,h as x}from"./chunk.HVSHE3SX.js";import{b as T,e as p}from"./chunk.ZR5P6TQI.js";import{b as v,e as y}from"./chunk.6OTM3PE5.js";import{e as s}from"./chunk.TJOCV4DC.js";var i=class extends x{constructor(){super(...arguments);this.formControlController=new z(this,{assumeInteractionOn:["sd-blur","sd-5-15-6-input"]});this.hasSlotController=new L(this,"help-text","label");this.localize=new D(this);this.typeToSelectString="";this.deletedTagLabel="";this.hasFocus=!1;this.selectedOptions=[];this.showValidStyle=!1;this.showInvalidStyle=!1;this.defaultValue="";this.open=!1;this.size="lg";this.placement="bottom";this.label="";this.placeholder="";this.maxOptionsTagLabel="";this.disabled=!1;this.visuallyDisabled=!1;this.helpText="";this.currentPlacement=this.placement;this.clearable=!1;this.multiple=!1;this.useTags=!1;this.maxOptionsVisible=3;this.form="";this.name="";this.value="";this.required=!1;this.styleOnValid=!1;this.hoist=!1;this.getTag=t=>p`<sd-5-15-6-tag class="relative z-10" ?disabled="${this.disabled}" part="tag" exportparts="
2
2
  base:tag__base,
3
3
  content:tag__content,
4
4
  removable-indicator:tag__removable-indicator,
5
- " size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-5-15-5-tag>`;this.handleDocumentFocusIn=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()};this.handleDocumentKeyDown=t=>{let e=t.target,o=e.closest(".select__clear")!==null,l=e.closest("sd-5-15-5-icon-button")!==null;if(!(o||l)){if(t.key==="Escape"&&this.open&&(t.preventDefault(),t.stopPropagation(),this.hide(),this.combobox.focus({preventScroll:!0})),t.key==="Enter"||t.key===" "&&this.typeToSelectString===""){if(t.preventDefault(),t.stopImmediatePropagation(),!this.open){this.show(),this.setCurrentOption(this.currentOption||this.getFirstOption(),t);return}this.currentOption&&!this.currentOption.disabled&&(this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.combobox.focus({preventScroll:!0})));return}if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){let h=this.getAllOptions(),n=h.indexOf(this.currentOption),r=Math.max(0,n);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;t.key==="ArrowDown"?(r=n+1,r>h.length-1&&(r=0)):t.key==="ArrowUp"?(r=n-1,r<0&&(r=h.length-1)):t.key==="Home"?r=0:t.key==="End"&&(r=h.length-1),this.setCurrentOption(h[r],t)}if(t.key.length===1||t.key==="Backspace"){let h=this.getAllOptions();if(t.metaKey||t.ctrlKey||t.altKey)return;if(!this.open){if(t.key==="Backspace")return;this.show()}t.stopPropagation(),t.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout(()=>this.typeToSelectString="",1e3),t.key==="Backspace"?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=t.key.toLowerCase();for(let n of h)if(n.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(n);break}}}};this.handleDocumentMouseDown=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()}}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),this.open=!1}firstUpdated(){this.applySizeToOptions()}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){var o,l,h;if((t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple){t.preventDefault(),t.stopPropagation();let n=(o=t.currentTarget)==null?void 0:o.parentElement,r=(l=n==null?void 0:n.previousElementSibling)==null?void 0:l.querySelector("sd-5-15-5-tag"),m=(h=n==null?void 0:n.nextElementSibling)==null?void 0:h.querySelector("sd-5-15-5-tag");this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>{m?m.focus():r?r.focus():this.focus({preventScroll:!0})})}}handleTagMaxOptionsKeyDown(t){(t.key==="Backspace"||t.key==="Enter")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>{var o;let e=(o=this.shadowRoot)==null?void 0:o.querySelectorAll("sd-5-15-5-tag");e&&e.length>0?e==null||e[(e==null?void 0:e.length)-1].focus():this.focus({preventScroll:!0})}))}handleLabelClick(){this.combobox.focus()}handleComboboxMouseDown(t){let o=t.composedPath().some(l=>l instanceof HTMLSlotElement&&l.name==="removable-indicator");this.disabled||o||this.visuallyDisabled||(t.preventDefault(),this.combobox.focus({preventScroll:!0}),this.open=!this.open,this.setCurrentOption(this.currentOption||this.getFirstOption(),t))}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearSelect()}clearSelect(){this.setSelectedOptions([]),this.combobox.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")})}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let o=t.target.closest("sd-5-15-5-option"),l=this.value;o&&!o.disabled&&(this.multiple?this.toggleOptionSelection(o):this.setSelectedOptions(o),this.updateComplete.then(()=>this.combobox.focus({preventScroll:!0})),this.value!==l&&this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.combobox.focus({preventScroll:!0})))}handleDefaultSlotChange(){let t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],o=[];customElements.get("sd-5-15-5-option")?(t.forEach(l=>{this.multiple&&(l.checkbox=!0),o.push(l.value)}),this.setSelectedOptions(t.filter(l=>e.includes(l.value)))):customElements.whenDefined("sd-5-15-5-option").then(()=>this.handleDefaultSlotChange())}handleTagRemove(t,e){t.stopPropagation(),e||this.clearSelect(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.deletedTagLabel=this.localize.term("removed",e.textContent),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}))}getAllOptions(){return[...this.querySelectorAll("sd-5-15-5-option")]}getFirstOption(){return this.querySelector("sd-5-15-5-option")}setCurrentOption(t,e){this.getAllOptions().forEach(l=>{l.current=!1,l.tabIndex=-1,((e==null?void 0:e.type)==="keydown"||(e==null?void 0:e.type)==="mousedown")&&(l.isKeyboardFocus=!1)}),t&&(this.currentOption=t,t.current=!0,t.tabIndex=0,t.focus()),t&&(e==null?void 0:e.type)==="keydown"&&(t.isKeyboardFocus=!0)}setSelectedOptions(t){let e=this.getAllOptions(),o=Array.isArray(t)?t:[t];e.forEach(l=>l.selected=!1),o.length&&o.forEach(l=>l.selected=!0),Array.isArray(t)?this.selectionChanged():this.selectionChanged(t)}toggleOptionSelection(t,e){e===!0||e===!1?t.selected=e:t.selected=!t.selected,Array.isArray(t)?this.selectionChanged():this.selectionChanged(t)}get displayLabel(){var t,e;return this.multiple?this.useTags||this.value.length===0?"":this.localize.term("numOptionsSelected",this.selectedOptions.length):(e=(t=this.selectedOptions[0])==null?void 0:t.getTextLabel())!=null?e:""}selectionChanged(t){var e,o;t&&this.multiple?this.selectedOptions.find(l=>l.value===t.value)?this.selectedOptions=this.selectedOptions.filter(l=>l.value!==t.value):this.selectedOptions=[...this.selectedOptions,t]:this.selectedOptions=this.getAllOptions().filter(l=>l.selected),this.multiple?this.value=this.selectedOptions.map(l=>l.value):this.value=(o=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?o:"",this.updateComplete.then(()=>{this.formControlController.updateValidity()})}get tags(){return this.selectedOptions.length<=this.maxOptionsVisible?this.selectedOptions.map((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){let o=this.getTag(t,e);return p`<div @sd-remove="${l=>this.handleTagRemove(l,t)}">${typeof o=="string"?k(o):o}</div>`}return[p``]}):[p`<sd-5-15-5-tag class="z-10" ?disabled="${this.disabled}" part="tag" exportparts="
5
+ " size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-5-15-6-tag>`;this.handleDocumentFocusIn=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()};this.handleDocumentKeyDown=t=>{let e=t.target,o=e.closest(".select__clear")!==null,l=e.closest("sd-5-15-6-icon-button")!==null;if(!(o||l)){if(t.key==="Escape"&&this.open&&(t.preventDefault(),t.stopPropagation(),this.hide(),this.combobox.focus({preventScroll:!0})),t.key==="Enter"||t.key===" "&&this.typeToSelectString===""){if(t.preventDefault(),t.stopImmediatePropagation(),!this.open){this.show(),this.setCurrentOption(this.currentOption||this.getFirstOption(),t);return}this.currentOption&&!this.currentOption.disabled&&(this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.combobox.focus({preventScroll:!0})));return}if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){let h=this.getAllOptions(),n=h.indexOf(this.currentOption),r=Math.max(0,n);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;t.key==="ArrowDown"?(r=n+1,r>h.length-1&&(r=0)):t.key==="ArrowUp"?(r=n-1,r<0&&(r=h.length-1)):t.key==="Home"?r=0:t.key==="End"&&(r=h.length-1),this.setCurrentOption(h[r],t)}if(t.key.length===1||t.key==="Backspace"){let h=this.getAllOptions();if(t.metaKey||t.ctrlKey||t.altKey)return;if(!this.open){if(t.key==="Backspace")return;this.show()}t.stopPropagation(),t.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout(()=>this.typeToSelectString="",1e3),t.key==="Backspace"?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=t.key.toLowerCase();for(let n of h)if(n.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(n);break}}}};this.handleDocumentMouseDown=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()}}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),this.open=!1}firstUpdated(){this.applySizeToOptions()}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){var o,l,h;if((t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple){t.preventDefault(),t.stopPropagation();let n=(o=t.currentTarget)==null?void 0:o.parentElement,r=(l=n==null?void 0:n.previousElementSibling)==null?void 0:l.querySelector("sd-5-15-6-tag"),m=(h=n==null?void 0:n.nextElementSibling)==null?void 0:h.querySelector("sd-5-15-6-tag");this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>{m?m.focus():r?r.focus():this.focus({preventScroll:!0})})}}handleTagMaxOptionsKeyDown(t){(t.key==="Backspace"||t.key==="Enter")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>{var o;let e=(o=this.shadowRoot)==null?void 0:o.querySelectorAll("sd-5-15-6-tag");e&&e.length>0?e==null||e[(e==null?void 0:e.length)-1].focus():this.focus({preventScroll:!0})}))}handleLabelClick(){this.combobox.focus()}handleComboboxMouseDown(t){let o=t.composedPath().some(l=>l instanceof HTMLSlotElement&&l.name==="removable-indicator");this.disabled||o||this.visuallyDisabled||(t.preventDefault(),this.combobox.focus({preventScroll:!0}),this.open=!this.open,this.setCurrentOption(this.currentOption||this.getFirstOption(),t))}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearSelect()}clearSelect(){this.setSelectedOptions([]),this.combobox.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")})}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let o=t.target.closest("sd-5-15-6-option"),l=this.value;o&&!o.disabled&&(this.multiple?this.toggleOptionSelection(o):this.setSelectedOptions(o),this.updateComplete.then(()=>this.combobox.focus({preventScroll:!0})),this.value!==l&&this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.combobox.focus({preventScroll:!0})))}handleDefaultSlotChange(){let t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],o=[];customElements.get("sd-5-15-6-option")?(t.forEach(l=>{this.multiple&&(l.checkbox=!0),o.push(l.value)}),this.setSelectedOptions(t.filter(l=>e.includes(l.value)))):customElements.whenDefined("sd-5-15-6-option").then(()=>this.handleDefaultSlotChange())}handleTagRemove(t,e){t.stopPropagation(),e||this.clearSelect(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.deletedTagLabel=this.localize.term("removed",e.textContent),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}))}getAllOptions(){return[...this.querySelectorAll("sd-5-15-6-option")]}getFirstOption(){return this.querySelector("sd-5-15-6-option")}setCurrentOption(t,e){this.getAllOptions().forEach(l=>{l.current=!1,l.tabIndex=-1,((e==null?void 0:e.type)==="keydown"||(e==null?void 0:e.type)==="mousedown")&&(l.isKeyboardFocus=!1)}),t&&(this.currentOption=t,t.current=!0,t.tabIndex=0,t.focus()),t&&(e==null?void 0:e.type)==="keydown"&&(t.isKeyboardFocus=!0)}setSelectedOptions(t){let e=this.getAllOptions(),o=Array.isArray(t)?t:[t];e.forEach(l=>l.selected=!1),o.length&&o.forEach(l=>l.selected=!0),Array.isArray(t)?this.selectionChanged():this.selectionChanged(t)}toggleOptionSelection(t,e){e===!0||e===!1?t.selected=e:t.selected=!t.selected,Array.isArray(t)?this.selectionChanged():this.selectionChanged(t)}get displayLabel(){var t,e;return this.multiple?this.useTags||this.value.length===0?"":this.localize.term("numOptionsSelected",this.selectedOptions.length):(e=(t=this.selectedOptions[0])==null?void 0:t.getTextLabel())!=null?e:""}selectionChanged(t){var e,o;t&&this.multiple?this.selectedOptions.find(l=>l.value===t.value)?this.selectedOptions=this.selectedOptions.filter(l=>l.value!==t.value):this.selectedOptions=[...this.selectedOptions,t]:this.selectedOptions=this.getAllOptions().filter(l=>l.selected),this.multiple?this.value=this.selectedOptions.map(l=>l.value):this.value=(o=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?o:"",this.updateComplete.then(()=>{this.formControlController.updateValidity()})}get tags(){return this.selectedOptions.length<=this.maxOptionsVisible?this.selectedOptions.map((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){let o=this.getTag(t,e);return p`<div @sd-remove="${l=>this.handleTagRemove(l,t)}">${typeof o=="string"?k(o):o}</div>`}return[p``]}):[p`<sd-5-15-6-tag class="z-10" ?disabled="${this.disabled}" part="tag" exportparts="
6
6
  base:tag__base,
7
7
  content:tag__content,
8
8
  removable-indicator:tag__removable-indicator,
9
- " 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-5-15-5-tag>`]}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)}handleUseTagsChange(){let t=this.getAllOptions();customElements.get("sd-5-15-5-option")&&t.forEach(e=>{e.checkbox=this.multiple})}handleDisabledChange(){(this.disabled||this.visuallyDisabled)&&(this.open=!1,this.handleOpenChange())}async handleOpenChange(){if(this.open&&(!this.disabled||!this.visuallyDisabled)){this.multiple||this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sd-show"),this.addOpenListeners(),await y(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame(()=>{this.setCurrentOption(this.currentOption)});let{keyframes:t,options:e}=O(this,"select.show",{dir:this.localize.dir()});await v(this.popup.popup,t,e),this.currentOption&&I(this.currentOption,this.listbox,"vertical","auto"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await y(this);let{keyframes:t,options:e}=O(this,"select.hide",{dir:this.localize.dir()});await v(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}applySizeToOptions(){this._optionsInDefaultSlot.forEach(t=>{t.size=this.size})}handleValueChange(){if(this.selectedOptions.length===(Array.isArray(this.value)?this.value.length:1))return;let t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(t.filter(o=>e.includes(o.value)))}async show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}return this.open=!0,C(this,"sd-after-show")}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.open=!1,C(this,"sd-after-hide")}checkValidity(){var t;return(t=this.valueInput)==null?void 0:t.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.combobox.focus(t)}blur(){this.combobox.blur()}render(){let t={default:this.hasSlotController.test("[default]"),label:this.hasSlotController.test("label"),clearIcon:this.hasSlotController.test("clear-icon"),expandIcon:this.hasSlotController.test("expand-icon"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},e=this.label?!0:!!t.label,o=this.helpText?!0:!!t.helpText,l=this.clearable&&!this.disabled,h=!!t.tooltip,n=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",r=this.disabled||this.visuallyDisabled?"cursor-not-allowed":"cursor-pointer",m={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],f={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return p`<div part="form-control" class="${d("relative text-left",r,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}"><span class="sr-only" aria-live="polite">${this.deletedTagLabel}</span> ${e||h?p`<div class="flex items-center gap-1 mb-2"><label id="label" part="form-control-label" class="${e&&"inline-block"}" aria-hidden="${e?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label> ${t.tooltip?p`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${d("relative w-full bg-white",n==="disabled"?"text-neutral-500":"text-black")}"><div part="border" class="${d("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"}[n],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-5-15-5-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${d("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
9
+ " 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-5-15-6-tag>`]}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)}handleUseTagsChange(){let t=this.getAllOptions();customElements.get("sd-5-15-6-option")&&t.forEach(e=>{e.checkbox=this.multiple})}handleDisabledChange(){(this.disabled||this.visuallyDisabled)&&(this.open=!1,this.handleOpenChange())}async handleOpenChange(){if(this.open&&(!this.disabled||!this.visuallyDisabled)){this.multiple||this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sd-show"),this.addOpenListeners(),await y(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame(()=>{this.setCurrentOption(this.currentOption)});let{keyframes:t,options:e}=O(this,"select.show",{dir:this.localize.dir()});await v(this.popup.popup,t,e),this.currentOption&&I(this.currentOption,this.listbox,"vertical","auto"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await y(this);let{keyframes:t,options:e}=O(this,"select.hide",{dir:this.localize.dir()});await v(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}applySizeToOptions(){this._optionsInDefaultSlot.forEach(t=>{t.size=this.size})}handleValueChange(){if(this.selectedOptions.length===(Array.isArray(this.value)?this.value.length:1))return;let t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(t.filter(o=>e.includes(o.value)))}async show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}return this.open=!0,C(this,"sd-after-show")}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.open=!1,C(this,"sd-after-hide")}checkValidity(){var t;return(t=this.valueInput)==null?void 0:t.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.combobox.focus(t)}blur(){this.combobox.blur()}render(){let t={default:this.hasSlotController.test("[default]"),label:this.hasSlotController.test("label"),clearIcon:this.hasSlotController.test("clear-icon"),expandIcon:this.hasSlotController.test("expand-icon"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},e=this.label?!0:!!t.label,o=this.helpText?!0:!!t.helpText,l=this.clearable&&!this.disabled,h=!!t.tooltip,n=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",r=this.disabled||this.visuallyDisabled?"cursor-not-allowed":"cursor-pointer",m={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],f={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return p`<div part="form-control" class="${d("relative text-left",r,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}"><span class="sr-only" aria-live="polite">${this.deletedTagLabel}</span> ${e||h?p`<div class="flex items-center gap-1 mb-2"><label id="label" part="form-control-label" class="${e&&"inline-block"}" aria-hidden="${e?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label> ${t.tooltip?p`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${d("relative w-full bg-white",n==="disabled"?"text-neutral-500":"text-black")}"><div part="border" class="${d("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"}[n],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-5-15-6-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${d("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
10
10
  popup:popup__content,
11
- "><div class="${d("relative w-full h-full grid grid-cols-1 rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200")}" slot="anchor"><div class="${d("input-container flex items-center w-full h-full px-4",{sm:"py-1",md:"py-1",lg:"py-2"}[this.size])}"><input name="${this.name}" form="${this.form}" part="display-input" class="${d("top-0 left-0 appearance-none outline-none flex-grow bg-transparent w-full placeholder-neutral-700",r,this.multiple&&this.useTags&&this.value.length>0?"hidden":"")}" type="text" .disabled="${this.disabled}" placeholder="${this.placeholder||this.localize.term("selectDefaultPlaceholder")}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled||this.visuallyDisabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" aria-describedby="help-text invalid-message" role="combobox" tabindex="-1"> ${this.multiple&&this.useTags?p`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>`:""}<div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(g=>g==null?void 0:g.getTextLabel()).join(", ")}</div><input class="${d("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",r)}" 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}"> ${l?p`<button part="clear-button" class="${d("select__clear flex justify-center",m,this.value.length>0?"visible":"invisible")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-15-5-icon class="${d("text-neutral-700 z-10",f)}" library="_internal" name="closing-round"></sd-5-15-5-icon></slot></button>`:""} ${this.showInvalidStyle?p`<sd-5-15-5-icon part="invalid-icon" class="${d(m,f,"text-error")}" library="_internal" name="risk"></sd-5-15-5-icon>`:""} ${this.styleOnValid&&this.showValidStyle?p`<sd-5-15-5-icon part="valid-icon" class="${d("flex-shrink-0 text-success",m,f)}" library="_internal" name="status-check"></sd-5-15-5-icon>`:""}<slot name="expand-icon" part="expand-icon" class="${d("inline-flex ml-2 items-center transition-transform duration-medium ease-in-out",this.open?"rotate-180":"rotate-0",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",f)}"><sd-5-15-5-icon name="chevron-down" part="chevron" library="_internal" color="currentColor"></sd-5-15-5-icon></slot></div><button part="combobox" class="${d("relative w-full px-4 flex flex-row items-center rounded-default focus-visible:outline-none",r,this.open&&"shadow transition-shadow duration-medium ease-in-out",{sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]"}[this.size])}" type="button" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-labelledby="label"></button></div><div id="listbox" role="listbox" aria-expanded="${this.open?"true":"false"}" aria-multiselectable="${this.multiple?"true":"false"}" aria-labelledby="label" part="listbox" class="${d("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" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-5-15-5-popup></div><div class="text-sm text-neutral-700 mt-1" part="form-control-help-text" id="help-text" aria-hidden="${o?"false":"true"}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};i.styles=[...x.styles,T`: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))}[part=listbox]{max-height:var(--auto-size-available-height,auto)}.input-container,[part=combobox]{grid-column:1/1;grid-row:1/1}sd-5-15-5-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-5-15-5-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-5-15-5-tag::part(content){display:inline-block;max-width:var(--tag-max-width,15ch);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-5-15-5-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-5-15-5-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))}`],s([E({selector:"sd-5-15-5-option"})],i.prototype,"_optionsInDefaultSlot",2),s([c("sd-5-15-5-popup")],i.prototype,"popup",2),s([c('[part="combobox"]')],i.prototype,"combobox",2),s([c('[part="display-input"]')],i.prototype,"displayInput",2),s([c(".value-input")],i.prototype,"valueInput",2),s([c('[part="listbox"]')],i.prototype,"listbox",2),s([c("#invalid-message")],i.prototype,"invalidMessage",2),s([u()],i.prototype,"deletedTagLabel",2),s([u()],i.prototype,"hasFocus",2),s([u()],i.prototype,"currentOption",2),s([u()],i.prototype,"selectedOptions",2),s([u()],i.prototype,"showValidStyle",2),s([u()],i.prototype,"showInvalidStyle",2),s([M()],i.prototype,"defaultValue",2),s([a({type:Boolean,reflect:!0})],i.prototype,"open",2),s([a({type:String,reflect:!0})],i.prototype,"size",2),s([a({type:String,reflect:!0})],i.prototype,"placement",2),s([a({type:String,reflect:!0})],i.prototype,"label",2),s([a({type:String,reflect:!0})],i.prototype,"placeholder",2),s([a({type:String,attribute:"max-options-tag-label",reflect:!0})],i.prototype,"maxOptionsTagLabel",2),s([a({type:Boolean,reflect:!0})],i.prototype,"disabled",2),s([a({type:Boolean,reflect:!0,attribute:"visually-disabled"})],i.prototype,"visuallyDisabled",2),s([a({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),s([u()],i.prototype,"currentPlacement",2),s([a({type:Boolean,reflect:!0})],i.prototype,"clearable",2),s([a({type:Boolean,reflect:!0})],i.prototype,"multiple",2),s([a({type:Boolean,reflect:!0})],i.prototype,"useTags",2),s([a({attribute:"max-options-visible",type:Number,reflect:!0})],i.prototype,"maxOptionsVisible",2),s([a({reflect:!0})],i.prototype,"form",2),s([a({reflect:!0})],i.prototype,"name",2),s([a({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],i.prototype,"value",2),s([a({type:Boolean,reflect:!0})],i.prototype,"required",2),s([a({type:Boolean,reflect:!0,attribute:"style-on-valid"})],i.prototype,"styleOnValid",2),s([a({type:Boolean,reflect:!0})],i.prototype,"hoist",2),s([a()],i.prototype,"getTag",2),s([b("useTags",{waitUntilFirstUpdate:!0})],i.prototype,"handleUseTagsChange",1),s([b(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],i.prototype,"handleDisabledChange",1),s([b("open",{waitUntilFirstUpdate:!0})],i.prototype,"handleOpenChange",1),s([b("size",{waitUntilFirstUpdate:!0})],i.prototype,"applySizeToOptions",1),s([b("value",{waitUntilFirstUpdate:!0})],i.prototype,"handleValueChange",1),i=s([$("sd-5-15-5-select")],i);w("select.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});w("select.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{i as a};
11
+ "><div class="${d("relative w-full h-full grid grid-cols-1 rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200")}" slot="anchor"><div class="${d("input-container flex items-center w-full h-full px-4",{sm:"py-1",md:"py-1",lg:"py-2"}[this.size])}"><input name="${this.name}" form="${this.form}" part="display-input" class="${d("top-0 left-0 appearance-none outline-none flex-grow bg-transparent w-full placeholder-neutral-700",r,this.multiple&&this.useTags&&this.value.length>0?"hidden":"")}" type="text" .disabled="${this.disabled}" placeholder="${this.placeholder||this.localize.term("selectDefaultPlaceholder")}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled||this.visuallyDisabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" aria-describedby="help-text invalid-message" role="combobox" tabindex="-1"> ${this.multiple&&this.useTags?p`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>`:""}<div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(g=>g==null?void 0:g.getTextLabel()).join(", ")}</div><input class="${d("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",r)}" 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}"> ${l?p`<button part="clear-button" class="${d("select__clear flex justify-center",m,this.value.length>0?"visible":"invisible")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-15-6-icon class="${d("text-neutral-700 z-10",f)}" library="_internal" name="closing-round"></sd-5-15-6-icon></slot></button>`:""} ${this.showInvalidStyle?p`<sd-5-15-6-icon part="invalid-icon" class="${d(m,f,"text-error")}" library="_internal" name="risk"></sd-5-15-6-icon>`:""} ${this.styleOnValid&&this.showValidStyle?p`<sd-5-15-6-icon part="valid-icon" class="${d("flex-shrink-0 text-success",m,f)}" library="_internal" name="status-check"></sd-5-15-6-icon>`:""}<slot name="expand-icon" part="expand-icon" class="${d("inline-flex ml-2 items-center transition-transform duration-medium ease-in-out",this.open?"rotate-180":"rotate-0",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",f)}"><sd-5-15-6-icon name="chevron-down" part="chevron" library="_internal" color="currentColor"></sd-5-15-6-icon></slot></div><button part="combobox" class="${d("relative w-full px-4 flex flex-row items-center rounded-default focus-visible:outline-none",r,this.open&&"shadow transition-shadow duration-medium ease-in-out",{sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]"}[this.size])}" type="button" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-labelledby="label"></button></div><div id="listbox" role="listbox" aria-expanded="${this.open?"true":"false"}" aria-multiselectable="${this.multiple?"true":"false"}" aria-labelledby="label" part="listbox" class="${d("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" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-5-15-6-popup></div><div class="text-sm text-neutral-700 mt-1" part="form-control-help-text" id="help-text" aria-hidden="${o?"false":"true"}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};i.styles=[...x.styles,T`: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))}[part=listbox]{max-height:var(--auto-size-available-height,auto)}.input-container,[part=combobox]{grid-column:1/1;grid-row:1/1}sd-5-15-6-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-5-15-6-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-5-15-6-tag::part(content){display:inline-block;max-width:var(--tag-max-width,15ch);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-5-15-6-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-5-15-6-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))}`],s([E({selector:"sd-5-15-6-option"})],i.prototype,"_optionsInDefaultSlot",2),s([c("sd-5-15-6-popup")],i.prototype,"popup",2),s([c('[part="combobox"]')],i.prototype,"combobox",2),s([c('[part="display-input"]')],i.prototype,"displayInput",2),s([c(".value-input")],i.prototype,"valueInput",2),s([c('[part="listbox"]')],i.prototype,"listbox",2),s([c("#invalid-message")],i.prototype,"invalidMessage",2),s([u()],i.prototype,"deletedTagLabel",2),s([u()],i.prototype,"hasFocus",2),s([u()],i.prototype,"currentOption",2),s([u()],i.prototype,"selectedOptions",2),s([u()],i.prototype,"showValidStyle",2),s([u()],i.prototype,"showInvalidStyle",2),s([M()],i.prototype,"defaultValue",2),s([a({type:Boolean,reflect:!0})],i.prototype,"open",2),s([a({type:String,reflect:!0})],i.prototype,"size",2),s([a({type:String,reflect:!0})],i.prototype,"placement",2),s([a({type:String,reflect:!0})],i.prototype,"label",2),s([a({type:String,reflect:!0})],i.prototype,"placeholder",2),s([a({type:String,attribute:"max-options-tag-label",reflect:!0})],i.prototype,"maxOptionsTagLabel",2),s([a({type:Boolean,reflect:!0})],i.prototype,"disabled",2),s([a({type:Boolean,reflect:!0,attribute:"visually-disabled"})],i.prototype,"visuallyDisabled",2),s([a({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),s([u()],i.prototype,"currentPlacement",2),s([a({type:Boolean,reflect:!0})],i.prototype,"clearable",2),s([a({type:Boolean,reflect:!0})],i.prototype,"multiple",2),s([a({type:Boolean,reflect:!0})],i.prototype,"useTags",2),s([a({attribute:"max-options-visible",type:Number,reflect:!0})],i.prototype,"maxOptionsVisible",2),s([a({reflect:!0})],i.prototype,"form",2),s([a({reflect:!0})],i.prototype,"name",2),s([a({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],i.prototype,"value",2),s([a({type:Boolean,reflect:!0})],i.prototype,"required",2),s([a({type:Boolean,reflect:!0,attribute:"style-on-valid"})],i.prototype,"styleOnValid",2),s([a({type:Boolean,reflect:!0})],i.prototype,"hoist",2),s([a()],i.prototype,"getTag",2),s([b("useTags",{waitUntilFirstUpdate:!0})],i.prototype,"handleUseTagsChange",1),s([b(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],i.prototype,"handleDisabledChange",1),s([b("open",{waitUntilFirstUpdate:!0})],i.prototype,"handleOpenChange",1),s([b("size",{waitUntilFirstUpdate:!0})],i.prototype,"applySizeToOptions",1),s([b("value",{waitUntilFirstUpdate:!0})],i.prototype,"handleValueChange",1),i=s([$("sd-5-15-6-select")],i);w("select.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});w("select.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{i as a};
@@ -1 +1 @@
1
- import{a as m}from"./chunk.26V4EXHB.js";import{a as l}from"./chunk.E2DRD2OX.js";import{a as h,b as r,d as f,h as n}from"./chunk.HVSHE3SX.js";import{b as o,e as c}from"./chunk.ZR5P6TQI.js";import{e as s}from"./chunk.TJOCV4DC.js";var e=class extends n{constructor(){super(...arguments);this.steps=[];this.size="lg";this.orientation="horizontal";this.activeStep=0;this.notInteractive=!1;this.label=""}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.steps=this.getAllSteps(),this.steps[this.steps.length-1].noTail=!0;let t;this.steps.forEach((i,a)=>{i.index=a+1,i.size=this.size,i.orientation=this.orientation,this.notInteractive?(i.current=!1,i.disabled=!1,i.notInteractive=!0):i.current&&(t=a)}),this.setActiveStep(t||this.activeStep)})}updateSize(){this.steps.forEach(t=>{t.size=this.size})}updateOrientation(){this.steps.forEach(t=>{t.orientation=this.orientation})}getAllSteps(){return[...this.body.assignedElements()].filter(t=>t.tagName.toLowerCase()==="sd-5-15-5-step")}setActiveStep(t){t>=0&&t<this.steps.length&&!this.notInteractive&&(this.activeStep=t,this.steps.forEach((i,a)=>{a===t?i.current=!0:a>t?i.waiting=!0:i.current=!1}))}handleInteractivityChange(){this.notInteractive&&this.steps.forEach(t=>{t.current=!1,t.disabled=!1,t.notInteractive=!0})}render(){return c`<div role="${this.notInteractive?"group":"navigation"}" class="h-full" aria-label="${this.label}"><div role="list" part="base" class="${m("flex",this.orientation==="vertical"&&"flex-col h-full")}"><slot part="body"></slot></div></div>`}};e.styles=[...n.styles,o`:host{width:-moz-max-content;width:max-content}`],s([f("[part=body]")],e.prototype,"body",2),s([r({type:String,reflect:!0})],e.prototype,"size",2),s([r({type:String,reflect:!0})],e.prototype,"orientation",2),s([r({type:Number,reflect:!0,attribute:"active-step"})],e.prototype,"activeStep",2),s([r({type:Boolean,reflect:!0,attribute:"not-interactive"})],e.prototype,"notInteractive",2),s([r({type:String,reflect:!0})],e.prototype,"label",2),s([l("size",{waitUntilFirstUpdate:!0})],e.prototype,"updateSize",1),s([l("orientation",{waitUntilFirstUpdate:!0})],e.prototype,"updateOrientation",1),s([l("notInteractive")],e.prototype,"handleInteractivityChange",1),e=s([h("sd-5-15-5-step-group")],e);export{e as a};
1
+ import{a as m}from"./chunk.26V4EXHB.js";import{a as l}from"./chunk.E2DRD2OX.js";import{a as h,b as r,d as f,h as n}from"./chunk.HVSHE3SX.js";import{b as o,e as c}from"./chunk.ZR5P6TQI.js";import{e as s}from"./chunk.TJOCV4DC.js";var e=class extends n{constructor(){super(...arguments);this.steps=[];this.size="lg";this.orientation="horizontal";this.activeStep=0;this.notInteractive=!1;this.label=""}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.steps=this.getAllSteps(),this.steps[this.steps.length-1].noTail=!0;let t;this.steps.forEach((i,a)=>{i.index=a+1,i.size=this.size,i.orientation=this.orientation,this.notInteractive?(i.current=!1,i.disabled=!1,i.notInteractive=!0):i.current&&(t=a)}),this.setActiveStep(t||this.activeStep)})}updateSize(){this.steps.forEach(t=>{t.size=this.size})}updateOrientation(){this.steps.forEach(t=>{t.orientation=this.orientation})}getAllSteps(){return[...this.body.assignedElements()].filter(t=>t.tagName.toLowerCase()==="sd-5-15-6-step")}setActiveStep(t){t>=0&&t<this.steps.length&&!this.notInteractive&&(this.activeStep=t,this.steps.forEach((i,a)=>{a===t?i.current=!0:a>t?i.waiting=!0:i.current=!1}))}handleInteractivityChange(){this.notInteractive&&this.steps.forEach(t=>{t.current=!1,t.disabled=!1,t.notInteractive=!0})}render(){return c`<div role="${this.notInteractive?"group":"navigation"}" class="h-full" aria-label="${this.label}"><div role="list" part="base" class="${m("flex",this.orientation==="vertical"&&"flex-col h-full")}"><slot part="body"></slot></div></div>`}};e.styles=[...n.styles,o`:host{width:-moz-max-content;width:max-content}`],s([f("[part=body]")],e.prototype,"body",2),s([r({type:String,reflect:!0})],e.prototype,"size",2),s([r({type:String,reflect:!0})],e.prototype,"orientation",2),s([r({type:Number,reflect:!0,attribute:"active-step"})],e.prototype,"activeStep",2),s([r({type:Boolean,reflect:!0,attribute:"not-interactive"})],e.prototype,"notInteractive",2),s([r({type:String,reflect:!0})],e.prototype,"label",2),s([l("size",{waitUntilFirstUpdate:!0})],e.prototype,"updateSize",1),s([l("orientation",{waitUntilFirstUpdate:!0})],e.prototype,"updateOrientation",1),s([l("notInteractive")],e.prototype,"handleInteractivityChange",1),e=s([h("sd-5-15-6-step-group")],e);export{e as a};