@tylertech/forge 3.0.0-next.10 → 3.0.0-next.11

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 (425) hide show
  1. package/custom-elements.json +174 -11
  2. package/dist/esm/accordion/index.js +1 -1
  3. package/dist/esm/app-bar/help-button/index.js +1 -1
  4. package/dist/esm/app-bar/index.js +1 -1
  5. package/dist/esm/app-bar/menu-button/index.js +1 -1
  6. package/dist/esm/app-bar/notification-button/index.js +1 -1
  7. package/dist/esm/app-bar/profile-button/index.js +1 -1
  8. package/dist/esm/app-bar/search/index.js +1 -1
  9. package/dist/esm/autocomplete/index.js +1 -1
  10. package/dist/esm/avatar/index.js +1 -1
  11. package/dist/esm/backdrop/index.js +1 -1
  12. package/dist/esm/badge/index.js +1 -1
  13. package/dist/esm/banner/index.js +1 -1
  14. package/dist/esm/bottom-sheet/index.js +1 -1
  15. package/dist/esm/busy-indicator/index.js +1 -1
  16. package/dist/esm/button/index.js +1 -1
  17. package/dist/esm/button-toggle/button-toggle/index.js +1 -1
  18. package/dist/esm/button-toggle/button-toggle-group/index.js +1 -1
  19. package/dist/esm/button-toggle/index.js +1 -1
  20. package/dist/esm/calendar/calendar-dropdown/index.js +1 -1
  21. package/dist/esm/calendar/calendar-menu/index.js +1 -1
  22. package/dist/esm/calendar/index.js +1 -1
  23. package/dist/esm/card/index.js +1 -1
  24. package/dist/esm/checkbox/index.js +1 -1
  25. package/dist/esm/chip-field/index.js +1 -1
  26. package/dist/esm/chips/chip/index.js +1 -1
  27. package/dist/esm/chips/chip-set/index.js +1 -1
  28. package/dist/esm/chips/index.js +1 -1
  29. package/dist/esm/chunks/{chunk.ECRL6O3V.js → chunk.2AJ7FFI6.js} +2 -2
  30. package/dist/esm/chunks/{chunk.4WB3FGEL.js → chunk.2EWV2XBP.js} +2 -2
  31. package/dist/esm/chunks/{chunk.WH6C36MO.js → chunk.2QHD3DCR.js} +2 -2
  32. package/dist/esm/chunks/chunk.3HB22HCX.js +7 -0
  33. package/dist/esm/chunks/chunk.4C6KHYUO.js +7 -0
  34. package/dist/esm/chunks/{chunk.WBYXVMYI.js → chunk.4YFVG4KP.js} +2 -2
  35. package/dist/esm/chunks/{chunk.XATLSSAW.js → chunk.4ZKX3SO5.js} +2 -2
  36. package/dist/esm/chunks/{chunk.SZIM4KFZ.js → chunk.54OOOQ4R.js} +2 -2
  37. package/dist/esm/chunks/chunk.5565ZSTH.js +7 -0
  38. package/dist/esm/chunks/chunk.5565ZSTH.js.map +7 -0
  39. package/dist/esm/chunks/{chunk.ZDAXNM2P.js → chunk.5MZ5SGMO.js} +2 -2
  40. package/dist/esm/chunks/{chunk.YQXX5KSW.js → chunk.624UKZFU.js} +2 -2
  41. package/dist/esm/chunks/{chunk.BIFQ4VOJ.js → chunk.6GC5AJPE.js} +2 -2
  42. package/dist/esm/chunks/{chunk.OTD2SFQJ.js → chunk.6OUJSOJY.js} +2 -2
  43. package/dist/esm/chunks/{chunk.57IVD67K.js → chunk.6OW6Q3EW.js} +2 -2
  44. package/dist/esm/chunks/chunk.7CGKFRBK.js +7 -0
  45. package/dist/esm/chunks/chunk.7CGKFRBK.js.map +7 -0
  46. package/dist/esm/chunks/chunk.7DB3XVPI.js +7 -0
  47. package/dist/esm/chunks/chunk.7DB3XVPI.js.map +7 -0
  48. package/dist/esm/chunks/{chunk.46VQ2S2Z.js → chunk.7TMLILLW.js} +2 -2
  49. package/dist/esm/chunks/{chunk.46VQ2S2Z.js.map → chunk.7TMLILLW.js.map} +1 -1
  50. package/dist/esm/chunks/{chunk.IDD54B5P.js → chunk.A62DE5PD.js} +2 -2
  51. package/dist/esm/chunks/chunk.AEKOP3XT.js +7 -0
  52. package/dist/esm/chunks/chunk.AEKOP3XT.js.map +7 -0
  53. package/dist/esm/chunks/{chunk.4WVHON6T.js → chunk.ALIYGJXA.js} +2 -2
  54. package/dist/esm/chunks/{chunk.JTIPXKV6.js → chunk.B4T3R53C.js} +2 -2
  55. package/dist/esm/chunks/chunk.BH2TUG2V.js +7 -0
  56. package/dist/esm/chunks/chunk.BH2TUG2V.js.map +7 -0
  57. package/dist/esm/chunks/{chunk.5V5ABSHI.js → chunk.BKL2BAYW.js} +2 -2
  58. package/dist/esm/chunks/chunk.BY25RT52.js +7 -0
  59. package/dist/esm/chunks/{chunk.SN5LPTHH.js.map → chunk.BY25RT52.js.map} +3 -3
  60. package/dist/esm/chunks/{chunk.SEP3L4QL.js → chunk.CDGZYUQS.js} +2 -2
  61. package/dist/esm/chunks/{chunk.Z4J4D5FD.js → chunk.CKW7KKDW.js} +2 -2
  62. package/dist/esm/chunks/{chunk.QL45FKVJ.js → chunk.COVTBIQQ.js} +2 -2
  63. package/dist/esm/chunks/{chunk.WO7KEM5K.js → chunk.CWTV3TB3.js} +2 -2
  64. package/dist/esm/chunks/{chunk.7WVTJIVR.js → chunk.CXY6K7EI.js} +2 -2
  65. package/dist/esm/chunks/{chunk.VNOJO2PF.js → chunk.D5TAI6Q7.js} +2 -2
  66. package/dist/esm/chunks/chunk.DBNJHUYY.js +7 -0
  67. package/dist/esm/chunks/chunk.DBNJHUYY.js.map +7 -0
  68. package/dist/esm/chunks/{chunk.QZK3WEH6.js → chunk.DG4ZM3AW.js} +2 -2
  69. package/dist/esm/chunks/{chunk.DTZFWZPB.js → chunk.DXN7ZOH3.js} +2 -2
  70. package/dist/esm/chunks/{chunk.7ZQMJLHE.js → chunk.EK24Y56W.js} +2 -2
  71. package/dist/esm/chunks/chunk.F4VXEE76.js +7 -0
  72. package/dist/esm/chunks/chunk.F4VXEE76.js.map +7 -0
  73. package/dist/esm/chunks/{chunk.44UCSD46.js → chunk.F5SY2D4B.js} +2 -2
  74. package/dist/esm/chunks/{chunk.44UCSD46.js.map → chunk.F5SY2D4B.js.map} +2 -2
  75. package/dist/esm/chunks/{chunk.2O6IZ7XZ.js → chunk.F74YURLV.js} +2 -2
  76. package/dist/esm/chunks/chunk.FCATJM34.js +7 -0
  77. package/dist/esm/chunks/chunk.FCATJM34.js.map +7 -0
  78. package/dist/esm/chunks/chunk.FG2GNAM2.js +7 -0
  79. package/dist/esm/chunks/chunk.FG2GNAM2.js.map +7 -0
  80. package/dist/esm/chunks/{chunk.U4GYQOPY.js → chunk.FWFOOQMA.js} +2 -2
  81. package/dist/esm/chunks/{chunk.D2Y2CRRY.js → chunk.GNG64TXK.js} +2 -2
  82. package/dist/esm/chunks/{chunk.SAXRW6GB.js → chunk.HHCO64F3.js} +2 -2
  83. package/dist/esm/chunks/{chunk.SAXRW6GB.js.map → chunk.HHCO64F3.js.map} +2 -2
  84. package/dist/esm/chunks/{chunk.OAHA3QOH.js → chunk.IX25DYIM.js} +2 -2
  85. package/dist/esm/chunks/chunk.JIKSKUDW.js +7 -0
  86. package/dist/esm/chunks/chunk.JIKSKUDW.js.map +7 -0
  87. package/dist/esm/chunks/{chunk.RGPNNISQ.js → chunk.JLLHDJSO.js} +2 -2
  88. package/dist/esm/chunks/{chunk.ZAJB7G4V.js → chunk.JUJGROHA.js} +2 -2
  89. package/dist/esm/chunks/{chunk.PHBOQRF6.js → chunk.K3KAM2PL.js} +2 -2
  90. package/dist/esm/chunks/{chunk.CFDK4RCW.js → chunk.K7FPXAFS.js} +2 -2
  91. package/dist/esm/chunks/{chunk.CFDK4RCW.js.map → chunk.K7FPXAFS.js.map} +3 -3
  92. package/dist/esm/chunks/chunk.KJP2VA6Q.js +7 -0
  93. package/dist/esm/chunks/chunk.KJP2VA6Q.js.map +7 -0
  94. package/dist/esm/chunks/{chunk.G4IN6Y46.js → chunk.KVCDAZ6B.js} +2 -2
  95. package/dist/esm/chunks/{chunk.2QSDH3PC.js → chunk.LFODKHUO.js} +2 -2
  96. package/dist/esm/chunks/{chunk.N7PQ2MUQ.js → chunk.LK4AAUOP.js} +2 -2
  97. package/dist/esm/chunks/{chunk.5CMQ7DNL.js → chunk.LTT67HTW.js} +2 -2
  98. package/dist/esm/chunks/{chunk.NF4J3Q5X.js → chunk.LXPFG7MW.js} +2 -2
  99. package/dist/esm/chunks/{chunk.5M6Y2RU6.js → chunk.M56LSSPW.js} +2 -2
  100. package/dist/esm/chunks/chunk.MACPUZC2.js +7 -0
  101. package/dist/esm/chunks/chunk.MACPUZC2.js.map +7 -0
  102. package/dist/esm/chunks/{chunk.XOM2FYQ2.js → chunk.MGLL67VO.js} +2 -2
  103. package/dist/esm/chunks/{chunk.6MPXRRMB.js → chunk.MHBBMC6O.js} +2 -2
  104. package/dist/esm/chunks/{chunk.TL6WVBGT.js → chunk.MTKSU2BV.js} +2 -2
  105. package/dist/esm/chunks/{chunk.NK7H3MMM.js → chunk.MVTBJPO2.js} +2 -2
  106. package/dist/esm/chunks/{chunk.KSCUIS5C.js → chunk.MXEKIEJA.js} +2 -2
  107. package/dist/esm/chunks/{chunk.BBKRPL6R.js → chunk.N43BCJHN.js} +2 -2
  108. package/dist/esm/chunks/{chunk.2ZTERGYF.js → chunk.NR3MLTXF.js} +2 -2
  109. package/dist/esm/chunks/{chunk.PHTOULRR.js → chunk.OWCYRSI3.js} +2 -2
  110. package/dist/esm/chunks/chunk.P2CW5MQO.js +12 -0
  111. package/dist/esm/chunks/{chunk.7TGGJGTG.js → chunk.P2ZCNO63.js} +2 -2
  112. package/dist/esm/chunks/{chunk.RFLASSCI.js → chunk.PADPL4L3.js} +2 -2
  113. package/dist/esm/chunks/chunk.PEBT47AU.js +7 -0
  114. package/dist/esm/chunks/{chunk.BNFJRFLW.js.map → chunk.PEBT47AU.js.map} +2 -2
  115. package/dist/esm/chunks/{chunk.H5D54EHO.js → chunk.PH3HUFJJ.js} +2 -2
  116. package/dist/esm/chunks/chunk.Q7JUJNYD.js +7 -0
  117. package/dist/esm/chunks/{chunk.E6KWYFZG.js → chunk.Q7Z3SJ5F.js} +2 -2
  118. package/dist/esm/chunks/{chunk.SQVBT7HU.js → chunk.QCRRHGBA.js} +2 -2
  119. package/dist/esm/chunks/{chunk.7DHFTAWI.js → chunk.QOJESHEV.js} +2 -2
  120. package/dist/esm/chunks/{chunk.X3YNJSDT.js → chunk.S3JMOOWC.js} +2 -2
  121. package/dist/esm/chunks/{chunk.MJSLXZBM.js → chunk.SBYX7VZ4.js} +2 -2
  122. package/dist/esm/chunks/{chunk.XRESQBNE.js → chunk.SFCGOCQK.js} +2 -2
  123. package/dist/esm/chunks/chunk.SJJS4LYN.js +7 -0
  124. package/dist/esm/chunks/chunk.SJJS4LYN.js.map +7 -0
  125. package/dist/esm/chunks/{chunk.UCM6CGFM.js → chunk.SMGXXR6K.js} +2 -2
  126. package/dist/esm/chunks/{chunk.6VDF54LZ.js → chunk.SU4FU7GK.js} +2 -2
  127. package/dist/esm/chunks/{chunk.5IQGVS6U.js → chunk.TK5I4RHF.js} +2 -2
  128. package/dist/esm/chunks/{chunk.MGWY7YIL.js → chunk.TYLOAD7R.js} +2 -2
  129. package/dist/esm/chunks/{chunk.UKFJHDO7.js → chunk.UJ2WQOLO.js} +2 -2
  130. package/dist/esm/chunks/{chunk.2TQONIPK.js → chunk.ULY4H76N.js} +2 -2
  131. package/dist/esm/chunks/{chunk.J3UFSHDY.js → chunk.VSQOTSAO.js} +2 -2
  132. package/dist/esm/chunks/chunk.VVXSELXX.js +7 -0
  133. package/dist/esm/chunks/{chunk.CRWP7H46.js.map → chunk.VVXSELXX.js.map} +2 -2
  134. package/dist/esm/chunks/{chunk.QI3GKORL.js → chunk.VZWNNK7A.js} +2 -2
  135. package/dist/esm/chunks/{chunk.T5X6UNH7.js → chunk.W4247Q2P.js} +2 -2
  136. package/dist/esm/chunks/chunk.WPG7NNQX.js +7 -0
  137. package/dist/esm/chunks/chunk.WPG7NNQX.js.map +7 -0
  138. package/dist/esm/chunks/{chunk.IWA3CYIB.js → chunk.X3C3J5MH.js} +2 -2
  139. package/dist/esm/chunks/{chunk.WYP2M5FR.js → chunk.XGOAYMK2.js} +2 -2
  140. package/dist/esm/chunks/chunk.XI3MJSIS.js +7 -0
  141. package/dist/esm/chunks/chunk.XI3MJSIS.js.map +7 -0
  142. package/dist/esm/chunks/{chunk.MF36FG2X.js → chunk.XKI46BH2.js} +2 -2
  143. package/dist/esm/chunks/{chunk.Y5UJ23LB.js → chunk.YLG6ZC5K.js} +2 -2
  144. package/dist/esm/chunks/chunk.YRMR7IOS.js +7 -0
  145. package/dist/esm/chunks/{chunk.LYYWQGS6.js.map → chunk.YRMR7IOS.js.map} +2 -2
  146. package/dist/esm/chunks/{chunk.TT2VTZJ6.js → chunk.YWNCJ7XP.js} +2 -2
  147. package/dist/esm/chunks/{chunk.TT2VTZJ6.js.map → chunk.YWNCJ7XP.js.map} +2 -2
  148. package/dist/esm/chunks/{chunk.EDEYCLDU.js → chunk.YX7WLO5Y.js} +2 -2
  149. package/dist/esm/chunks/{chunk.AHHNJSZK.js → chunk.Z6FCL3G3.js} +2 -2
  150. package/dist/esm/chunks/chunk.ZDD2NLGP.js +7 -0
  151. package/dist/esm/chunks/{chunk.P5QIB6OY.js → chunk.ZJC2DSNM.js} +2 -2
  152. package/dist/esm/chunks/{chunk.L3M6DPQB.js → chunk.ZKGSQQGU.js} +3 -3
  153. package/dist/esm/chunks/chunk.ZKGSQQGU.js.map +7 -0
  154. package/dist/esm/chunks/{chunk.E7Z3IRWV.js → chunk.ZVBZ3LGP.js} +2 -2
  155. package/dist/esm/circular-progress/index.js +1 -1
  156. package/dist/esm/color-picker/index.js +1 -1
  157. package/dist/esm/core/base/index.js +1 -1
  158. package/dist/esm/core/delegates/index.js +1 -1
  159. package/dist/esm/core/index.js +1 -1
  160. package/dist/esm/date-picker/index.js +1 -1
  161. package/dist/esm/date-range-picker/index.js +1 -1
  162. package/dist/esm/dialog/index.js +1 -1
  163. package/dist/esm/divider/index.js +1 -1
  164. package/dist/esm/drawer/base/index.js +1 -1
  165. package/dist/esm/drawer/drawer/index.js +1 -1
  166. package/dist/esm/drawer/index.js +1 -1
  167. package/dist/esm/drawer/mini-drawer/index.js +1 -1
  168. package/dist/esm/drawer/modal-drawer/index.js +1 -1
  169. package/dist/esm/expansion-panel/index.js +1 -1
  170. package/dist/esm/file-picker/index.js +1 -1
  171. package/dist/esm/floating-action-button/index.js +1 -1
  172. package/dist/esm/floating-label/index.js +1 -1
  173. package/dist/esm/focus-indicator/index.js +1 -1
  174. package/dist/esm/icon/index.js +1 -1
  175. package/dist/esm/icon-button/index.js +1 -1
  176. package/dist/esm/index.js +1 -1
  177. package/dist/esm/inline-message/index.js +1 -1
  178. package/dist/esm/keyboard-shortcut/index.js +1 -1
  179. package/dist/esm/label-value/index.js +1 -1
  180. package/dist/esm/linear-progress/index.js +1 -1
  181. package/dist/esm/list/index.js +1 -1
  182. package/dist/esm/list/list/index.js +1 -1
  183. package/dist/esm/list/list-item/index.js +1 -1
  184. package/dist/esm/list-dropdown/index.js +1 -1
  185. package/dist/esm/menu/index.js +1 -1
  186. package/dist/esm/open-icon/index.js +1 -1
  187. package/dist/esm/page-state/index.js +1 -1
  188. package/dist/esm/paginator/index.js +1 -1
  189. package/dist/esm/popup/index.js +1 -1
  190. package/dist/esm/product-icon/index.js +1 -1
  191. package/dist/esm/profile-card/index.js +1 -1
  192. package/dist/esm/quantity-field/index.js +1 -1
  193. package/dist/esm/radio/index.js +1 -1
  194. package/dist/esm/ripple/index.js +1 -1
  195. package/dist/esm/scaffold/index.js +1 -1
  196. package/dist/esm/select/core/index.js +1 -1
  197. package/dist/esm/select/index.js +1 -1
  198. package/dist/esm/select/option/index.js +1 -1
  199. package/dist/esm/select/option-group/index.js +1 -1
  200. package/dist/esm/select/select/index.js +1 -1
  201. package/dist/esm/select/select-dropdown/index.js +1 -1
  202. package/dist/esm/skeleton/index.js +1 -1
  203. package/dist/esm/slider/index.js +1 -1
  204. package/dist/esm/split-view/index.js +1 -1
  205. package/dist/esm/split-view/split-view/index.js +1 -1
  206. package/dist/esm/split-view/split-view-panel/index.js +1 -1
  207. package/dist/esm/stack/index.js +1 -1
  208. package/dist/esm/state-layer/index.js +1 -1
  209. package/dist/esm/stepper/index.js +1 -1
  210. package/dist/esm/stepper/step/index.js +1 -1
  211. package/dist/esm/stepper/stepper/index.js +1 -1
  212. package/dist/esm/switch/index.js +1 -1
  213. package/dist/esm/table/index.js +1 -1
  214. package/dist/esm/tabs/index.js +1 -1
  215. package/dist/esm/tabs/tab/index.js +1 -1
  216. package/dist/esm/tabs/tab-bar/index.js +1 -1
  217. package/dist/esm/text-field/index.js +1 -1
  218. package/dist/esm/time-picker/index.js +1 -1
  219. package/dist/esm/toast/index.js +1 -1
  220. package/dist/esm/toolbar/index.js +1 -1
  221. package/dist/esm/tooltip/index.js +1 -1
  222. package/dist/esm/view-switcher/index.js +1 -1
  223. package/dist/esm/view-switcher/view/index.js +1 -1
  224. package/dist/forge.css +1 -1
  225. package/dist/table/forge-table.css +1 -1
  226. package/dist/typography/forge-typography-legacy.css +6 -0
  227. package/dist/typography/forge-typography.css +1 -1
  228. package/esm/app-bar/profile-button/app-bar-profile-button-adapter.js +1 -1
  229. package/esm/autocomplete/autocomplete-adapter.js +1 -1
  230. package/esm/busy-indicator/busy-indicator-adapter.js +1 -1
  231. package/esm/calendar/calendar-dropdown/calendar-dropdown.d.ts +3 -0
  232. package/esm/calendar/calendar-dropdown/calendar-dropdown.js +9 -0
  233. package/esm/chip-field/chip-field-foundation.js +1 -1
  234. package/esm/chips/chip/chip-adapter.js +2 -2
  235. package/esm/chips/chip/chip.js +1 -1
  236. package/esm/color-picker/color-picker-foundation.d.ts +0 -1
  237. package/esm/color-picker/color-picker-foundation.js +2 -5
  238. package/esm/date-picker/base/base-date-picker-adapter.d.ts +2 -0
  239. package/esm/date-picker/base/base-date-picker-adapter.js +6 -0
  240. package/esm/date-picker/base/base-date-picker-constants.d.ts +1 -0
  241. package/esm/date-picker/base/base-date-picker-constants.js +2 -1
  242. package/esm/date-picker/base/base-date-picker-foundation.d.ts +4 -0
  243. package/esm/date-picker/base/base-date-picker-foundation.js +13 -1
  244. package/esm/date-picker/base/base-date-picker.d.ts +3 -0
  245. package/esm/date-picker/base/base-date-picker.js +6 -0
  246. package/esm/date-picker/date-picker-adapter.js +1 -1
  247. package/esm/date-range-picker/date-range-picker-adapter.js +1 -1
  248. package/esm/dialog/dialog-adapter.js +1 -1
  249. package/esm/field/field-adapter.js +1 -1
  250. package/esm/field/field-foundation.js +5 -0
  251. package/esm/focus-indicator/focus-indicator.js +1 -1
  252. package/esm/linear-progress/linear-progress.js +1 -1
  253. package/esm/list/list/list-adapter.js +2 -2
  254. package/esm/list/list-item/list-item.js +1 -1
  255. package/esm/popup/popup-adapter.js +2 -2
  256. package/esm/radio/radio-adapter.js +2 -1
  257. package/esm/slider/slider.d.ts +2 -1
  258. package/esm/slider/slider.js +3 -2
  259. package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
  260. package/esm/stepper/core/stepper-utils.js +2 -1
  261. package/esm/stepper/stepper/stepper-adapter.js +1 -1
  262. package/esm/stepper/stepper/stepper-foundation.js +1 -0
  263. package/esm/tabs/tab/tab.js +1 -1
  264. package/esm/text-field/text-field-adapter.js +2 -1
  265. package/esm/time-picker/time-picker-adapter.js +2 -1
  266. package/package.json +2 -2
  267. package/styles/chips/chip/_mixins.scss +1 -0
  268. package/styles/circular-progress/{_animations.scss → _animation.scss} +6 -0
  269. package/styles/circular-progress/_configuration.scss +0 -7
  270. package/styles/circular-progress/_core.scss +8 -8
  271. package/styles/circular-progress/circular-progress.scss +2 -2
  272. package/styles/circular-progress/index.scss +1 -1
  273. package/styles/core/styles/{tokens/_utils.scss → _utils.scss} +21 -1
  274. package/styles/core/styles/animation/index.scss +16 -0
  275. package/styles/core/styles/border/index.scss +38 -0
  276. package/styles/core/styles/elevation/index.scss +10 -10
  277. package/styles/core/styles/shape/index.scss +31 -0
  278. package/styles/core/styles/spacing/index.scss +30 -0
  279. package/styles/core/styles/theme/index.scss +15 -11
  280. package/styles/core/styles/tokens/animation/_tokens.scss +38 -0
  281. package/styles/core/styles/tokens/border/_tokens.scss +17 -0
  282. package/styles/core/styles/tokens/circular-progress/_tokens.scss +1 -1
  283. package/styles/core/styles/tokens/focus-indicator/_tokens.scss +11 -7
  284. package/styles/core/styles/tokens/linear-progress/_tokens.scss +5 -3
  285. package/styles/core/styles/tokens/shape/_tokens.scss +42 -0
  286. package/styles/core/styles/tokens/slider/_tokens.scss +7 -5
  287. package/styles/core/styles/tokens/spacing/_tokens.scss +23 -0
  288. package/styles/core/styles/tokens/state-layer/_tokens.scss +1 -1
  289. package/styles/core/styles/tokens/tabs/tab/_tokens.scss +1 -1
  290. package/styles/core/styles/tokens/tabs/tab-bar/_tokens.scss +1 -1
  291. package/styles/core/styles/tokens/typography/_tokens.scss +198 -35
  292. package/styles/core/styles/typography/index.scss +119 -0
  293. package/styles/focus-indicator/_core.scss +1 -1
  294. package/styles/linear-progress/_core.scss +1 -1
  295. package/styles/list/list-item/_mixins.scss +11 -1
  296. package/styles/list/list-item/_variables.scss +9 -0
  297. package/styles/slider/_configuration.scss +2 -1
  298. package/styles/slider/_core.scss +7 -6
  299. package/styles/state-layer/_core.scss +1 -1
  300. package/styles/table/_mixins.scss +2 -2
  301. package/styles/tabs/tab/_core.scss +6 -5
  302. package/styles/tabs/tab/tab.scss +14 -0
  303. package/styles/tabs/tab-bar/_core.scss +1 -1
  304. package/styles/{core/styles/tokens/theme/_shape.scss → typography/forge-typography-legacy.scss} +2 -7
  305. package/styles/typography/forge-typography.scss +11 -3
  306. package/styles/utils/_mixins-core.scss +1 -1
  307. package/dist/esm/chunks/chunk.2VP57RZO.js +0 -7
  308. package/dist/esm/chunks/chunk.2VP57RZO.js.map +0 -7
  309. package/dist/esm/chunks/chunk.33EJTOVA.js +0 -7
  310. package/dist/esm/chunks/chunk.33EJTOVA.js.map +0 -7
  311. package/dist/esm/chunks/chunk.3JDFBEF7.js +0 -7
  312. package/dist/esm/chunks/chunk.74DEHKGT.js +0 -12
  313. package/dist/esm/chunks/chunk.7G72CBOJ.js +0 -7
  314. package/dist/esm/chunks/chunk.7G72CBOJ.js.map +0 -7
  315. package/dist/esm/chunks/chunk.BNFJRFLW.js +0 -7
  316. package/dist/esm/chunks/chunk.CRWP7H46.js +0 -7
  317. package/dist/esm/chunks/chunk.DXZ5LVFJ.js +0 -7
  318. package/dist/esm/chunks/chunk.DXZ5LVFJ.js.map +0 -7
  319. package/dist/esm/chunks/chunk.EYZ25QUP.js +0 -7
  320. package/dist/esm/chunks/chunk.EYZ25QUP.js.map +0 -7
  321. package/dist/esm/chunks/chunk.F776DWXU.js +0 -7
  322. package/dist/esm/chunks/chunk.F776DWXU.js.map +0 -7
  323. package/dist/esm/chunks/chunk.FIBGOPNP.js +0 -7
  324. package/dist/esm/chunks/chunk.FIBGOPNP.js.map +0 -7
  325. package/dist/esm/chunks/chunk.FUPNTFG7.js +0 -7
  326. package/dist/esm/chunks/chunk.FUPNTFG7.js.map +0 -7
  327. package/dist/esm/chunks/chunk.GT3XBPZY.js +0 -7
  328. package/dist/esm/chunks/chunk.GT3XBPZY.js.map +0 -7
  329. package/dist/esm/chunks/chunk.HXJCTE47.js +0 -7
  330. package/dist/esm/chunks/chunk.JL4XB4RI.js +0 -7
  331. package/dist/esm/chunks/chunk.JL4XB4RI.js.map +0 -7
  332. package/dist/esm/chunks/chunk.L3M6DPQB.js.map +0 -7
  333. package/dist/esm/chunks/chunk.LHBF47UY.js +0 -7
  334. package/dist/esm/chunks/chunk.LHBF47UY.js.map +0 -7
  335. package/dist/esm/chunks/chunk.LM57DOG3.js +0 -7
  336. package/dist/esm/chunks/chunk.LYYWQGS6.js +0 -7
  337. package/dist/esm/chunks/chunk.M2M47T4L.js +0 -7
  338. package/dist/esm/chunks/chunk.M2M47T4L.js.map +0 -7
  339. package/dist/esm/chunks/chunk.QLJBPFP5.js +0 -7
  340. package/dist/esm/chunks/chunk.QLJBPFP5.js.map +0 -7
  341. package/dist/esm/chunks/chunk.SN5LPTHH.js +0 -7
  342. package/dist/esm/chunks/chunk.YDY2IGBF.js +0 -7
  343. package/dist/esm/chunks/chunk.YDY2IGBF.js.map +0 -7
  344. package/dist/esm/chunks/chunk.YWCLKUK7.js +0 -7
  345. package/dist/esm/chunks/chunk.YWCLKUK7.js.map +0 -7
  346. package/dist/esm/chunks/chunk.ZMRDW25U.js +0 -7
  347. package/dist/typography/forge-form.css +0 -6
  348. package/styles/typography/forge-form.scss +0 -67
  349. /package/dist/esm/chunks/{chunk.ECRL6O3V.js.map → chunk.2AJ7FFI6.js.map} +0 -0
  350. /package/dist/esm/chunks/{chunk.4WB3FGEL.js.map → chunk.2EWV2XBP.js.map} +0 -0
  351. /package/dist/esm/chunks/{chunk.WH6C36MO.js.map → chunk.2QHD3DCR.js.map} +0 -0
  352. /package/dist/esm/chunks/{chunk.ZMRDW25U.js.map → chunk.3HB22HCX.js.map} +0 -0
  353. /package/dist/esm/chunks/{chunk.3JDFBEF7.js.map → chunk.4C6KHYUO.js.map} +0 -0
  354. /package/dist/esm/chunks/{chunk.WBYXVMYI.js.map → chunk.4YFVG4KP.js.map} +0 -0
  355. /package/dist/esm/chunks/{chunk.XATLSSAW.js.map → chunk.4ZKX3SO5.js.map} +0 -0
  356. /package/dist/esm/chunks/{chunk.SZIM4KFZ.js.map → chunk.54OOOQ4R.js.map} +0 -0
  357. /package/dist/esm/chunks/{chunk.ZDAXNM2P.js.map → chunk.5MZ5SGMO.js.map} +0 -0
  358. /package/dist/esm/chunks/{chunk.YQXX5KSW.js.map → chunk.624UKZFU.js.map} +0 -0
  359. /package/dist/esm/chunks/{chunk.BIFQ4VOJ.js.map → chunk.6GC5AJPE.js.map} +0 -0
  360. /package/dist/esm/chunks/{chunk.OTD2SFQJ.js.map → chunk.6OUJSOJY.js.map} +0 -0
  361. /package/dist/esm/chunks/{chunk.57IVD67K.js.map → chunk.6OW6Q3EW.js.map} +0 -0
  362. /package/dist/esm/chunks/{chunk.IDD54B5P.js.map → chunk.A62DE5PD.js.map} +0 -0
  363. /package/dist/esm/chunks/{chunk.4WVHON6T.js.map → chunk.ALIYGJXA.js.map} +0 -0
  364. /package/dist/esm/chunks/{chunk.JTIPXKV6.js.map → chunk.B4T3R53C.js.map} +0 -0
  365. /package/dist/esm/chunks/{chunk.5V5ABSHI.js.map → chunk.BKL2BAYW.js.map} +0 -0
  366. /package/dist/esm/chunks/{chunk.SEP3L4QL.js.map → chunk.CDGZYUQS.js.map} +0 -0
  367. /package/dist/esm/chunks/{chunk.Z4J4D5FD.js.map → chunk.CKW7KKDW.js.map} +0 -0
  368. /package/dist/esm/chunks/{chunk.QL45FKVJ.js.map → chunk.COVTBIQQ.js.map} +0 -0
  369. /package/dist/esm/chunks/{chunk.WO7KEM5K.js.map → chunk.CWTV3TB3.js.map} +0 -0
  370. /package/dist/esm/chunks/{chunk.7WVTJIVR.js.map → chunk.CXY6K7EI.js.map} +0 -0
  371. /package/dist/esm/chunks/{chunk.VNOJO2PF.js.map → chunk.D5TAI6Q7.js.map} +0 -0
  372. /package/dist/esm/chunks/{chunk.QZK3WEH6.js.map → chunk.DG4ZM3AW.js.map} +0 -0
  373. /package/dist/esm/chunks/{chunk.DTZFWZPB.js.map → chunk.DXN7ZOH3.js.map} +0 -0
  374. /package/dist/esm/chunks/{chunk.7ZQMJLHE.js.map → chunk.EK24Y56W.js.map} +0 -0
  375. /package/dist/esm/chunks/{chunk.2O6IZ7XZ.js.map → chunk.F74YURLV.js.map} +0 -0
  376. /package/dist/esm/chunks/{chunk.U4GYQOPY.js.map → chunk.FWFOOQMA.js.map} +0 -0
  377. /package/dist/esm/chunks/{chunk.D2Y2CRRY.js.map → chunk.GNG64TXK.js.map} +0 -0
  378. /package/dist/esm/chunks/{chunk.OAHA3QOH.js.map → chunk.IX25DYIM.js.map} +0 -0
  379. /package/dist/esm/chunks/{chunk.RGPNNISQ.js.map → chunk.JLLHDJSO.js.map} +0 -0
  380. /package/dist/esm/chunks/{chunk.ZAJB7G4V.js.map → chunk.JUJGROHA.js.map} +0 -0
  381. /package/dist/esm/chunks/{chunk.PHBOQRF6.js.map → chunk.K3KAM2PL.js.map} +0 -0
  382. /package/dist/esm/chunks/{chunk.G4IN6Y46.js.map → chunk.KVCDAZ6B.js.map} +0 -0
  383. /package/dist/esm/chunks/{chunk.2QSDH3PC.js.map → chunk.LFODKHUO.js.map} +0 -0
  384. /package/dist/esm/chunks/{chunk.N7PQ2MUQ.js.map → chunk.LK4AAUOP.js.map} +0 -0
  385. /package/dist/esm/chunks/{chunk.5CMQ7DNL.js.map → chunk.LTT67HTW.js.map} +0 -0
  386. /package/dist/esm/chunks/{chunk.NF4J3Q5X.js.map → chunk.LXPFG7MW.js.map} +0 -0
  387. /package/dist/esm/chunks/{chunk.5M6Y2RU6.js.map → chunk.M56LSSPW.js.map} +0 -0
  388. /package/dist/esm/chunks/{chunk.XOM2FYQ2.js.map → chunk.MGLL67VO.js.map} +0 -0
  389. /package/dist/esm/chunks/{chunk.6MPXRRMB.js.map → chunk.MHBBMC6O.js.map} +0 -0
  390. /package/dist/esm/chunks/{chunk.TL6WVBGT.js.map → chunk.MTKSU2BV.js.map} +0 -0
  391. /package/dist/esm/chunks/{chunk.NK7H3MMM.js.map → chunk.MVTBJPO2.js.map} +0 -0
  392. /package/dist/esm/chunks/{chunk.KSCUIS5C.js.map → chunk.MXEKIEJA.js.map} +0 -0
  393. /package/dist/esm/chunks/{chunk.BBKRPL6R.js.map → chunk.N43BCJHN.js.map} +0 -0
  394. /package/dist/esm/chunks/{chunk.2ZTERGYF.js.map → chunk.NR3MLTXF.js.map} +0 -0
  395. /package/dist/esm/chunks/{chunk.PHTOULRR.js.map → chunk.OWCYRSI3.js.map} +0 -0
  396. /package/dist/esm/chunks/{chunk.74DEHKGT.js.map → chunk.P2CW5MQO.js.map} +0 -0
  397. /package/dist/esm/chunks/{chunk.7TGGJGTG.js.map → chunk.P2ZCNO63.js.map} +0 -0
  398. /package/dist/esm/chunks/{chunk.RFLASSCI.js.map → chunk.PADPL4L3.js.map} +0 -0
  399. /package/dist/esm/chunks/{chunk.H5D54EHO.js.map → chunk.PH3HUFJJ.js.map} +0 -0
  400. /package/dist/esm/chunks/{chunk.LM57DOG3.js.map → chunk.Q7JUJNYD.js.map} +0 -0
  401. /package/dist/esm/chunks/{chunk.E6KWYFZG.js.map → chunk.Q7Z3SJ5F.js.map} +0 -0
  402. /package/dist/esm/chunks/{chunk.SQVBT7HU.js.map → chunk.QCRRHGBA.js.map} +0 -0
  403. /package/dist/esm/chunks/{chunk.7DHFTAWI.js.map → chunk.QOJESHEV.js.map} +0 -0
  404. /package/dist/esm/chunks/{chunk.X3YNJSDT.js.map → chunk.S3JMOOWC.js.map} +0 -0
  405. /package/dist/esm/chunks/{chunk.MJSLXZBM.js.map → chunk.SBYX7VZ4.js.map} +0 -0
  406. /package/dist/esm/chunks/{chunk.XRESQBNE.js.map → chunk.SFCGOCQK.js.map} +0 -0
  407. /package/dist/esm/chunks/{chunk.UCM6CGFM.js.map → chunk.SMGXXR6K.js.map} +0 -0
  408. /package/dist/esm/chunks/{chunk.6VDF54LZ.js.map → chunk.SU4FU7GK.js.map} +0 -0
  409. /package/dist/esm/chunks/{chunk.5IQGVS6U.js.map → chunk.TK5I4RHF.js.map} +0 -0
  410. /package/dist/esm/chunks/{chunk.MGWY7YIL.js.map → chunk.TYLOAD7R.js.map} +0 -0
  411. /package/dist/esm/chunks/{chunk.UKFJHDO7.js.map → chunk.UJ2WQOLO.js.map} +0 -0
  412. /package/dist/esm/chunks/{chunk.2TQONIPK.js.map → chunk.ULY4H76N.js.map} +0 -0
  413. /package/dist/esm/chunks/{chunk.J3UFSHDY.js.map → chunk.VSQOTSAO.js.map} +0 -0
  414. /package/dist/esm/chunks/{chunk.QI3GKORL.js.map → chunk.VZWNNK7A.js.map} +0 -0
  415. /package/dist/esm/chunks/{chunk.T5X6UNH7.js.map → chunk.W4247Q2P.js.map} +0 -0
  416. /package/dist/esm/chunks/{chunk.IWA3CYIB.js.map → chunk.X3C3J5MH.js.map} +0 -0
  417. /package/dist/esm/chunks/{chunk.WYP2M5FR.js.map → chunk.XGOAYMK2.js.map} +0 -0
  418. /package/dist/esm/chunks/{chunk.MF36FG2X.js.map → chunk.XKI46BH2.js.map} +0 -0
  419. /package/dist/esm/chunks/{chunk.Y5UJ23LB.js.map → chunk.YLG6ZC5K.js.map} +0 -0
  420. /package/dist/esm/chunks/{chunk.EDEYCLDU.js.map → chunk.YX7WLO5Y.js.map} +0 -0
  421. /package/dist/esm/chunks/{chunk.AHHNJSZK.js.map → chunk.Z6FCL3G3.js.map} +0 -0
  422. /package/dist/esm/chunks/{chunk.HXJCTE47.js.map → chunk.ZDD2NLGP.js.map} +0 -0
  423. /package/dist/esm/chunks/{chunk.P5QIB6OY.js.map → chunk.ZJC2DSNM.js.map} +0 -0
  424. /package/dist/esm/chunks/{chunk.E7Z3IRWV.js.map → chunk.ZVBZ3LGP.js.map} +0 -0
  425. /package/styles/core/styles/tokens/{theme/_elevation.scss → elevation/_tokens.scss} +0 -0
@@ -3,5 +3,5 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{a as k}from"./chunk.T5X6UNH7.js";import{d as K}from"./chunk.QI3GKORL.js";import{e as V,h as B,j as H}from"./chunk.SQVBT7HU.js";import{c as x}from"./chunk.GT3XBPZY.js";import{a as m,b as N}from"./chunk.SAXRW6GB.js";import{b as A}from"./chunk.L3M6DPQB.js";import{e as F}from"./chunk.7G72CBOJ.js";import{d as P}from"./chunk.FYWPZFLJ.js";import{d as w}from"./chunk.H5D54EHO.js";import{a as p}from"./chunk.NVUMRW44.js";import{a as S}from"./chunk.5V5ABSHI.js";import{a as T,b as D,d as y}from"./chunk.DTZFWZPB.js";import{a as L,e as C}from"./chunk.NK7H3MMM.js";import{m as M}from"./chunk.CFDK4RCW.js";import{a as g,b as O,i as I,k as _}from"./chunk.J2M2MXP2.js";import{a as c,b,d as a}from"./chunk.M3QDAYD2.js";var l=`${D}menu`,U={POPUP:"forge-menu__popup",MENU:"mdc-menu"},G={TOGGLE:`.${l}__toggle,[${l}-toggle],button,[type=button],[role=button],a,[tabindex]:not([tabindex^="-"])`,MENU_LIST:"forge-list"},R={OPEN:"open",PLACEMENT:"placement",SELECTED_INDEX:"selected-index",SELECTED_VALUE:"selected-value",DENSE:"dense",ICON_CLASS:"icon-class",PERSIST_SELECTION:"persist-selection",MODE:"mode",SYNC_POPUP_WIDTH:"sync-popup-width",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold"},$={SELECT:`${l}-select`,OPEN:`${l}-open`,CLOSE:`${l}-close`,ACTIVE_CHANGE:`${l}-active-change`},z={CHILD_MOUSE_LEAVE_TIMEOUT:300,POPUP_MOUSE_LEAVE_TIMEOUT:500},i={elementName:l,classes:U,selectors:G,attributes:R,events:$,numbers:z};var u=class extends S{constructor(e){super(e);this._childMenus=new Map}getDropdownElement(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.dropdownElement)!=null?t:null}hasTargetElement(){return!!this._targetElement}initializeTarget(){this._targetElement=this._component.querySelector(i.selectors.TOGGLE),this._targetElement||(this._targetElement=this._component.firstElementChild)}initializeAccessibility(e){this._targetElement&&(this._targetElement.setAttribute("aria-atomic","true"),this._targetElement.setAttribute("aria-live","assertive"),this._targetElement.setAttribute("aria-haspopup","true"),this._targetElement.setAttribute("aria-expanded","false"),this._targetElement.hasAttribute("aria-label")||this._targetElement.setAttribute("aria-label",this._targetElement.textContent||""))}addTargetListener(e,t,n=!1){this._targetElement&&this._targetElement.addEventListener(e,t,n)}removeTargetListener(e,t){this._targetElement&&this._targetElement.removeEventListener(e,t)}attachMenu(e){this._listDropdown||!this._targetElement||(this._listDropdown=new B(this._targetElement,e),this._listDropdown.open(),this._targetElement.setAttribute("aria-expanded","true"),this._targetElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`))}setOptions(e){this._listDropdown&&this._listDropdown.setOptions(e)}detachMenu(){this._targetElement&&(this._targetElement.removeAttribute("aria-activedescendant"),this._targetElement.removeAttribute("aria-expanded"),this._targetElement.removeAttribute("aria-controls")),this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0)}setActiveOption(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}setCascadeTargetInactive(){let e=this._targetElement;e!=null&&e.active&&(e.active=!1)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:-1}focusTarget(){this._targetElement&&this._targetElement.focus()}isTargetFocused(){return document.activeElement===this._targetElement}updateActiveDescendant(e){this._targetElement&&(e?this._targetElement.setAttribute("aria-activedescendant",e):this._targetElement.removeAttribute("aria-activedescendant"))}addDropdownListener(e,t){!this._listDropdown||!this._listDropdown.dropdownElement||this._listDropdown.dropdownElement.addEventListener(e,t)}isOwnElement(e){return!this._targetElement||!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._targetElement.contains(e)||!!this._listDropdown.dropdownElement.contains(e)}propagateKey(e){var t;(t=this._listDropdown)==null||t.handleKey(e)}proxyKeyboardEventToChild(e,t){if(!this.getDropdownElement())return;let n=this._getOpenChildMenu(t);n&&n.propagateKeyEvent(e)}toggleChildMenu(e,t){let r=this._getListItems()[e].parentElement;r&&r.tagName.toLowerCase()===i.elementName&&(t===void 0?r.open=!r.open:r.open=t,r.activateFirstOption())}createChildMenu(e,t,n,o,r){let d=document.createElement("forge-menu");return d.style.display="block",d.addEventListener(i.events.OPEN,()=>{this._childMenus.set(e,d),n(e)}),d.addEventListener(i.events.CLOSE,()=>{this._childMenus.delete(e),o(e)}),d.addEventListener(i.events.SELECT,f=>{f.stopPropagation(),r(b(c({},f.detail),{parentValue:t}))}),d}closeOtherChildMenus(e){let t=[];this._childMenus.forEach((n,o)=>{o!==e&&(n.open=!1,t.push(o))}),t.forEach(n=>this._childMenus.delete(n))}setSelectedValues(e){var t;(t=this._listDropdown)==null||t.setSelectedValues(e)}_getOpenChildMenu(e){if(!this.getDropdownElement())return null;let t=this._getOwnList(e);return t?t.querySelector(`${i.elementName}[${i.attributes.OPEN}]`):null}_getOwnList(e){let t=this.getDropdownElement();return t?t.querySelector(`${m.elementName}[id="list-dropdown-list-${e}"]`):null}_getListItems(){let e=this.getDropdownElement();if(!e)return[];let t=e.querySelector(m.elementName);return t?Array.from(t.querySelectorAll(N.elementName)):[]}};var h=class extends H{constructor(e){super({popupTimeout:i.numbers.POPUP_MOUSE_LEAVE_TIMEOUT,targetTimeout:i.numbers.CHILD_MOUSE_LEAVE_TIMEOUT});this._adapter=e;this._placement="bottom-start";this._fallbackPlacements=[];this._dense=!1;this._iconClass=y;this._persistSelection=!1;this._mode="click";this._identifier=g(),this._clickListener=t=>this._onTargetClick(t),this._blurListener=t=>this._onTargetBlur(t),this._selectListener=t=>this._handleSelectEvent(t),this._keydownListener=t=>this.onKeydown(t),this._activeChangeListener=t=>this._onActiveOptionChanged(t)}initialize(){this._adapter.initializeTarget(),this._adapter.initializeAccessibility(this._identifier),this._initializeInteractionListeners()}disconnect(){this._open&&this._closeDropdown(),this._destroyInteractionListeners()}activateFirstOption(){this._adapter.activateFirstOption()}_applyMode(){this._adapter.hasTargetElement()&&(this._mode!=="cascade"?this._adapter.addTargetListener("click",this._clickListener):this._attachCascadingListeners())}_initializeInteractionListeners(){this._adapter.hasTargetElement()&&(this._applyMode(),this._adapter.addTargetListener("keydown",this._keydownListener,!0),this._adapter.addTargetListener("focusout",this._blurListener))}_destroyInteractionListeners(){this._adapter.hasTargetElement()&&(this._adapter.removeTargetListener("keydown",this._clickListener),this._adapter.removeTargetListener("focusout",this._blurListener),this._adapter.removeTargetListener("click",this._clickListener),this._detachCascadingListeners())}_attachCascadingListeners(){this._adapter.addTargetListener("mouseenter",this._targetMouseEnterListener),this._adapter.addTargetListener("mouseleave",this._targetMouseLeaveListener),this._adapter.addDocumentListener("mousemove",this._documentMouseMoveListener)}_detachCascadingListeners(){this._adapter.removeTargetListener("mouseenter",this._targetMouseEnterListener),this._adapter.removeTargetListener("mouseleave",this._targetMouseLeaveListener),this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener)}get _nonDividerOptions(){return this._flatOptions.filter(e=>!e.divider)}get _flatOptions(){return V(this._options,1)?this._options.reduce((e,t)=>e.concat(t.options),[]):this._options}_onTargetClick(e){if(this._open){this._closeDropdown();return}this.open=!this._open,this._open&&this._adapter.focusTarget()}_onTargetBlur(e){this._open&&this._closeDropdown()}_onActiveOptionChanged(e){let t={id:e},n=this._adapter.emitHostEvent(i.events.ACTIVE_CHANGE,t,!0,!0);this._mode!=="cascade"&&n&&this._adapter.updateActiveDescendant(e)}onKeydown(e){if(this._childOpen){this._adapter.proxyKeyboardEventToChild(e,this._identifier);return}switch(e.code){case"Tab":this._open&&this._selectActiveOption();break;case"Escape":this._open&&(e.preventDefault(),e.stopPropagation(),this._closeDropdown());break;case"Space":e.preventDefault(),this._open?this._closeDropdown():this._openDropdown({fromKeyboard:!0});break;case"Home":case"End":this._open&&(e.preventDefault(),this._adapter.propagateKey(e.code));break;case"Enter":if(e.preventDefault(),!this._open){e.preventDefault(),this._openDropdown({fromKeyboard:!0});return}e.stopImmediatePropagation(),this._adapter.propagateKey(e.code);let t=this._adapter.getActiveOptionIndex(),n=this._nonDividerOptions[t];n&&n.options&&n.options.length&&this._adapter.toggleChildMenu(t);break;case"ArrowUp":case"ArrowDown":if(this._open&&e.stopImmediatePropagation(),e.preventDefault(),!this._open&&e.code==="ArrowDown"){this._openDropdown({fromKeyboard:!0}),this._adapter.activateFirstOption();return}this._adapter.propagateKey(e.code);break;case"ArrowLeft":this._open&&e.stopImmediatePropagation(),this._mode==="cascade"&&this._open&&this._closeDropdown();break;case"ArrowRight":if(this._open&&e.stopImmediatePropagation(),!this._open)return;let o=this._adapter.getActiveOptionIndex(),r=this._nonDividerOptions[o];if(r&&r.options){this._adapter.toggleChildMenu(o,e.code==="ArrowRight");return}break}}async _openMenu({fromKeyboard:e}={}){this._open=!0;let t=[];if(typeof this._optionsFactory=="function")this._loadOptionsAsync(),this._options=[];else{if(!this._options||!this._options.length)return;t=this._options}this._persistSelection||t.forEach(r=>r.selected=!1),this._mapIconToLeadingIcon();let n=this._persistSelection?this._getSelectedValues():[],o={id:this._identifier,type:"menu",options:this._options,selectedValues:n,iconClass:this._iconClass,dense:this._dense,multiple:!1,popupStatic:!0,allowBusy:!0,asyncStyle:"spinner",optionBuilder:this._optionBuilder,optionLimit:this._optionLimit,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,popupPlacement:this._placement,popupFallbackPlacements:this._fallbackPlacements,activeStartIndex:e?0:void 0,popupClasses:[i.classes.POPUP,i.classes.MENU,...this._popupClasses],syncWidth:this._syncPopupWidth,activeChangeCallback:this._activeChangeListener,selectCallback:this._selectListener,popupOffset:this._popupOffset,cascadingElementFactory:r=>this._createCascadingElement(r)};this._adapter.setHostAttribute(i.attributes.OPEN,""),this._adapter.attachMenu(o),this._mode==="cascade"&&(this._adapter.addDropdownListener("mouseenter",this._childPopupMouseEnterListener),this._adapter.addDropdownListener("mouseleave",this._childPopupMouseLeaveListener)),this._adapter.addDropdownListener(i.events.ACTIVE_CHANGE,r=>{this._onActiveOptionChanged(r.detail.id)}),this._adapter.emitHostEvent(i.events.OPEN)}_closeMenu(){this._open=!1,this._childOpen=!1,this._adapter.detachMenu(),this._activeMouseLeaveTimeout!==void 0&&window.clearTimeout(this._activeMouseLeaveTimeout),this._adapter.removeHostAttribute(i.attributes.OPEN),this._adapter.emitHostEvent(i.events.CLOSE)}_loadOptionsAsync(){return this._optionsFactory?Promise.resolve(this._optionsFactory()).then(e=>{if(this._persistSelection||e.forEach(t=>t.selected=!1),this._open)if(e&&I(e)&&e.length){this._options=e,this._adapter.setOptions(e);let t=this._getSelectedValues();t.length&&this._adapter.setSelectedValues(t)}else this._open&&this._closeDropdown()}).catch(e=>{console.error("An unexpected error ocurred while opening the menu:",e),this._open&&this._closeDropdown()}):(this._open&&this._closeMenu(),Promise.resolve())}_handleSelectEvent(e){let t=this._nonDividerOptions.findIndex(n=>n.value===e);t<0||this._selectOptionByIndex(t)}_selectActiveOption(){let e=this._adapter.getActiveOptionIndex();e>=0&&this._nonDividerOptions[e]&&this._selectOptionByIndex(e)}_selectOptionByIndex(e){let{options:t,value:n}=this._nonDividerOptions[e];if(t){this._adapter.setActiveOption(e);return}this._closeDropdown();let o={index:e,value:n};!this._adapter.emitHostEvent(i.events.SELECT,o,!0,!0)||(this._selectedValue=this._persistSelection?n:void 0)}_getSelectedValues(){let e=this._flatOptions.filter(t=>t.selected).map(t=>t.value);return this._selectedValue!==void 0&&e.push(this._selectedValue),e}_onCascadingOptionSelected(e){this._persistSelection&&(this._selectedValue=e.value),this._adapter.emitHostEvent(i.events.SELECT,e),this._closeDropdown()}_onCascadingChildOpen(e){super._clearMouseLeaveTimeout(),this._adapter.closeOtherChildMenus(e),this._childOpen=!0,this._adapter.setActiveOption(e)}_onCascadingChildClose(e){this._childOpen=!1}_closeDropdown(){this._closeMenu()}_openDropdown({fromKeyboard:e}={}){this._openMenu({fromKeyboard:e})}_setCascadeTargetInactive(){this._adapter.setCascadeTargetInactive()}_isOwnElement(e){return this._adapter.isOwnElement(e)}_createCascadingElement({index:e,options:t,parentValue:n}){let o=this._adapter.createChildMenu(e,n,this._onCascadingChildOpen.bind(this),this._onCascadingChildClose.bind(this),this._onCascadingOptionSelected.bind(this));return o.mode="cascade",o.popupOffset={x:0,y:-8},o.dense=this._dense,o.placement="right-start",o.fallbackPlacements=["left-start","right-start"],o.persistSelection=this._persistSelection,this._persistSelection&&(o.selectedValue=this._selectedValue),o.options=t,o.optionBuilder=this._optionBuilder,o.iconClass=this._iconClass,o}_mapIconToLeadingIcon(){this._flatOptions.filter(e=>e.icon).forEach(e=>e.leadingIcon=e.icon)}get open(){return this._open}set open(e){e=!!e,this._open!==e&&(this._open=e,e?this._openDropdown():this._closeDropdown())}set options(e){if(typeof e=="function")this.optionsFactory=e;else if(this.optionsFactory=void 0,this._options=e.map(t=>c({},t)),this._open&&(this._mapIconToLeadingIcon(),this._adapter.setOptions(this._options),this._persistSelection)){let t=this._getSelectedValues();t.length&&this._adapter.setSelectedValues(t)}}get options(){return this._options?this._flatOptions.map(e=>c({},e)):[]}set optionsFactory(e){this._optionsFactory=e}set selectedIndex(e){let t=this._nonDividerOptions[e];t&&t.value!==this._selectedValue&&(this.selectedValue=t.value)}get selectedIndex(){return this._selectedValue!==void 0?this._nonDividerOptions.findIndex(e=>e.value===this._selectedValue):-1}set selectedValue(e){this._selectedValue!==e&&(this._selectedValue=e,this._adapter.setSelectedValues(this._selectedValue))}get selectedValue(){return this._selectedValue}get placement(){return this._placement}set placement(e){this._placement!==e&&(this._placement=e||"bottom-start",this._adapter.setHostAttribute(i.attributes.PLACEMENT,this._placement))}get fallbackPlacements(){return this._fallbackPlacements}set fallbackPlacements(e){this._fallbackPlacements=Array.isArray(e)?e:[]}get dense(){return this._dense}set dense(e){this._dense=e}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass=e}get persistSelection(){return this._persistSelection}set persistSelection(e){this._persistSelection!==e&&(this._persistSelection=e,this._adapter.toggleHostAttribute(i.attributes.PERSIST_SELECTION,this._persistSelection),this._persistSelection||(this._flatOptions.forEach(t=>t.selected=!1),this._selectedValue=void 0))}get mode(){return this._mode}set mode(e){this._mode!==e&&(this._mode=e,this._destroyInteractionListeners(),this._applyMode(),this._adapter.setHostAttribute(i.attributes.MODE,this._mode))}get popupOffset(){return this._popupOffset}set popupOffset(e){this._popupOffset=e}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get popupElement(){return this._adapter.getDropdownElement()}};var q="<template><slot></slot></template>",W=":host{display:inline-block}:host([hidden]){display:none}",s=class extends k{constructor(){super();w.define(P),this._foundation=new h(new u(this)),C(this,q,W)}static get observedAttributes(){return[i.attributes.OPEN,i.attributes.PLACEMENT,i.attributes.SELECTED_INDEX,i.attributes.SELECTED_VALUE,i.attributes.DENSE,i.attributes.ICON_CLASS,i.attributes.PERSIST_SELECTION,i.attributes.MODE,i.attributes.SYNC_POPUP_WIDTH,i.attributes.POPUP_CLASSES,i.attributes.OPTION_LIMIT,i.attributes.OBSERVE_SCROLL,i.attributes.OBSERVE_SCROLL_THRESHOLD]}connectedCallback(){this.querySelector(i.selectors.TOGGLE)?this._foundation.initialize():M(this,i.selectors.TOGGLE).then(()=>this._foundation.initialize())}attributeChangedCallback(e,t,n){switch(super.attributeChangedCallback(e,t,n),e){case i.attributes.OPEN:this._foundation.open=O(n);break;case i.attributes.PLACEMENT:this._foundation.placement=n;break;case i.attributes.SELECTED_INDEX:this._foundation.selectedIndex=Number(n);break;case i.attributes.SELECTED_VALUE:this._foundation.selectedValue=n;break;case i.attributes.DENSE:this._foundation.dense=_(n);break;case i.attributes.ICON_CLASS:this._foundation.iconClass=n;break;case i.attributes.PERSIST_SELECTION:this.persistSelection=_(n);break;case i.attributes.MODE:this.mode=n;break}}disconnectedCallback(){this._foundation.disconnect()}propagateKeyEvent(e){this._foundation.onKeydown(e)}activateFirstOption(){this._foundation.activateFirstOption()}};a([p()],s.prototype,"open",2),a([p()],s.prototype,"options",2),a([p()],s.prototype,"selectedIndex",2),a([p()],s.prototype,"selectedValue",2),a([p()],s.prototype,"placement",2),a([p()],s.prototype,"fallbackPlacements",2),a([p()],s.prototype,"dense",2),a([p()],s.prototype,"iconClass",2),a([p()],s.prototype,"persistSelection",2),a([p()],s.prototype,"mode",2),a([p()],s.prototype,"popupOffset",2),a([p()],s.prototype,"optionBuilder",2),a([p({set:!1})],s.prototype,"popupElement",2),s=a([T({name:i.elementName,dependencies:[F,x,K,A]})],s);function Qe(){L(s)}export{i as a,u as b,h as c,s as d,Qe as e};
7
- //# sourceMappingURL=chunk.ZAJB7G4V.js.map
6
+ import{a as k}from"./chunk.W4247Q2P.js";import{d as K}from"./chunk.VZWNNK7A.js";import{e as V,h as B,j as H}from"./chunk.QCRRHGBA.js";import{c as x}from"./chunk.F4VXEE76.js";import{a as m,b as N}from"./chunk.HHCO64F3.js";import{b as A}from"./chunk.ZKGSQQGU.js";import{e as F}from"./chunk.7CGKFRBK.js";import{d as P}from"./chunk.FYWPZFLJ.js";import{d as w}from"./chunk.PH3HUFJJ.js";import{a as p}from"./chunk.NVUMRW44.js";import{a as S}from"./chunk.BKL2BAYW.js";import{a as T,b as D,d as y}from"./chunk.DXN7ZOH3.js";import{a as L,e as C}from"./chunk.MVTBJPO2.js";import{m as M}from"./chunk.K7FPXAFS.js";import{a as g,b as O,i as I,k as _}from"./chunk.J2M2MXP2.js";import{a as c,b,d as a}from"./chunk.M3QDAYD2.js";var l=`${D}menu`,U={POPUP:"forge-menu__popup",MENU:"mdc-menu"},G={TOGGLE:`.${l}__toggle,[${l}-toggle],button,[type=button],[role=button],a,[tabindex]:not([tabindex^="-"])`,MENU_LIST:"forge-list"},R={OPEN:"open",PLACEMENT:"placement",SELECTED_INDEX:"selected-index",SELECTED_VALUE:"selected-value",DENSE:"dense",ICON_CLASS:"icon-class",PERSIST_SELECTION:"persist-selection",MODE:"mode",SYNC_POPUP_WIDTH:"sync-popup-width",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold"},$={SELECT:`${l}-select`,OPEN:`${l}-open`,CLOSE:`${l}-close`,ACTIVE_CHANGE:`${l}-active-change`},z={CHILD_MOUSE_LEAVE_TIMEOUT:300,POPUP_MOUSE_LEAVE_TIMEOUT:500},i={elementName:l,classes:U,selectors:G,attributes:R,events:$,numbers:z};var u=class extends S{constructor(e){super(e);this._childMenus=new Map}getDropdownElement(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.dropdownElement)!=null?t:null}hasTargetElement(){return!!this._targetElement}initializeTarget(){this._targetElement=this._component.querySelector(i.selectors.TOGGLE),this._targetElement||(this._targetElement=this._component.firstElementChild)}initializeAccessibility(e){this._targetElement&&(this._targetElement.setAttribute("aria-atomic","true"),this._targetElement.setAttribute("aria-live","assertive"),this._targetElement.setAttribute("aria-haspopup","true"),this._targetElement.setAttribute("aria-expanded","false"),this._targetElement.hasAttribute("aria-label")||this._targetElement.setAttribute("aria-label",this._targetElement.textContent||""))}addTargetListener(e,t,n=!1){this._targetElement&&this._targetElement.addEventListener(e,t,n)}removeTargetListener(e,t){this._targetElement&&this._targetElement.removeEventListener(e,t)}attachMenu(e){this._listDropdown||!this._targetElement||(this._listDropdown=new B(this._targetElement,e),this._listDropdown.open(),this._targetElement.setAttribute("aria-expanded","true"),this._targetElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`))}setOptions(e){this._listDropdown&&this._listDropdown.setOptions(e)}detachMenu(){this._targetElement&&(this._targetElement.removeAttribute("aria-activedescendant"),this._targetElement.removeAttribute("aria-expanded"),this._targetElement.removeAttribute("aria-controls")),this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0)}setActiveOption(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}setCascadeTargetInactive(){let e=this._targetElement;e!=null&&e.active&&(e.active=!1)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:-1}focusTarget(){this._targetElement&&this._targetElement.focus()}isTargetFocused(){return document.activeElement===this._targetElement}updateActiveDescendant(e){this._targetElement&&(e?this._targetElement.setAttribute("aria-activedescendant",e):this._targetElement.removeAttribute("aria-activedescendant"))}addDropdownListener(e,t){!this._listDropdown||!this._listDropdown.dropdownElement||this._listDropdown.dropdownElement.addEventListener(e,t)}isOwnElement(e){return!this._targetElement||!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._targetElement.contains(e)||!!this._listDropdown.dropdownElement.contains(e)}propagateKey(e){var t;(t=this._listDropdown)==null||t.handleKey(e)}proxyKeyboardEventToChild(e,t){if(!this.getDropdownElement())return;let n=this._getOpenChildMenu(t);n&&n.propagateKeyEvent(e)}toggleChildMenu(e,t){let r=this._getListItems()[e].parentElement;r&&r.tagName.toLowerCase()===i.elementName&&(t===void 0?r.open=!r.open:r.open=t,r.activateFirstOption())}createChildMenu(e,t,n,o,r){let d=document.createElement("forge-menu");return d.style.display="block",d.addEventListener(i.events.OPEN,()=>{this._childMenus.set(e,d),n(e)}),d.addEventListener(i.events.CLOSE,()=>{this._childMenus.delete(e),o(e)}),d.addEventListener(i.events.SELECT,f=>{f.stopPropagation(),r(b(c({},f.detail),{parentValue:t}))}),d}closeOtherChildMenus(e){let t=[];this._childMenus.forEach((n,o)=>{o!==e&&(n.open=!1,t.push(o))}),t.forEach(n=>this._childMenus.delete(n))}setSelectedValues(e){var t;(t=this._listDropdown)==null||t.setSelectedValues(e)}_getOpenChildMenu(e){if(!this.getDropdownElement())return null;let t=this._getOwnList(e);return t?t.querySelector(`${i.elementName}[${i.attributes.OPEN}]`):null}_getOwnList(e){let t=this.getDropdownElement();return t?t.querySelector(`${m.elementName}[id="list-dropdown-list-${e}"]`):null}_getListItems(){let e=this.getDropdownElement();if(!e)return[];let t=e.querySelector(m.elementName);return t?Array.from(t.querySelectorAll(N.elementName)):[]}};var h=class extends H{constructor(e){super({popupTimeout:i.numbers.POPUP_MOUSE_LEAVE_TIMEOUT,targetTimeout:i.numbers.CHILD_MOUSE_LEAVE_TIMEOUT});this._adapter=e;this._placement="bottom-start";this._fallbackPlacements=[];this._dense=!1;this._iconClass=y;this._persistSelection=!1;this._mode="click";this._identifier=g(),this._clickListener=t=>this._onTargetClick(t),this._blurListener=t=>this._onTargetBlur(t),this._selectListener=t=>this._handleSelectEvent(t),this._keydownListener=t=>this.onKeydown(t),this._activeChangeListener=t=>this._onActiveOptionChanged(t)}initialize(){this._adapter.initializeTarget(),this._adapter.initializeAccessibility(this._identifier),this._initializeInteractionListeners()}disconnect(){this._open&&this._closeDropdown(),this._destroyInteractionListeners()}activateFirstOption(){this._adapter.activateFirstOption()}_applyMode(){this._adapter.hasTargetElement()&&(this._mode!=="cascade"?this._adapter.addTargetListener("click",this._clickListener):this._attachCascadingListeners())}_initializeInteractionListeners(){this._adapter.hasTargetElement()&&(this._applyMode(),this._adapter.addTargetListener("keydown",this._keydownListener,!0),this._adapter.addTargetListener("focusout",this._blurListener))}_destroyInteractionListeners(){this._adapter.hasTargetElement()&&(this._adapter.removeTargetListener("keydown",this._clickListener),this._adapter.removeTargetListener("focusout",this._blurListener),this._adapter.removeTargetListener("click",this._clickListener),this._detachCascadingListeners())}_attachCascadingListeners(){this._adapter.addTargetListener("mouseenter",this._targetMouseEnterListener),this._adapter.addTargetListener("mouseleave",this._targetMouseLeaveListener),this._adapter.addDocumentListener("mousemove",this._documentMouseMoveListener)}_detachCascadingListeners(){this._adapter.removeTargetListener("mouseenter",this._targetMouseEnterListener),this._adapter.removeTargetListener("mouseleave",this._targetMouseLeaveListener),this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener)}get _nonDividerOptions(){return this._flatOptions.filter(e=>!e.divider)}get _flatOptions(){return V(this._options,1)?this._options.reduce((e,t)=>e.concat(t.options),[]):this._options}_onTargetClick(e){if(this._open){this._closeDropdown();return}this.open=!this._open,this._open&&this._adapter.focusTarget()}_onTargetBlur(e){this._open&&this._closeDropdown()}_onActiveOptionChanged(e){let t={id:e},n=this._adapter.emitHostEvent(i.events.ACTIVE_CHANGE,t,!0,!0);this._mode!=="cascade"&&n&&this._adapter.updateActiveDescendant(e)}onKeydown(e){if(this._childOpen){this._adapter.proxyKeyboardEventToChild(e,this._identifier);return}switch(e.code){case"Tab":this._open&&this._selectActiveOption();break;case"Escape":this._open&&(e.preventDefault(),e.stopPropagation(),this._closeDropdown());break;case"Space":e.preventDefault(),this._open?this._closeDropdown():this._openDropdown({fromKeyboard:!0});break;case"Home":case"End":this._open&&(e.preventDefault(),this._adapter.propagateKey(e.code));break;case"Enter":if(e.preventDefault(),!this._open){e.preventDefault(),this._openDropdown({fromKeyboard:!0});return}e.stopImmediatePropagation(),this._adapter.propagateKey(e.code);let t=this._adapter.getActiveOptionIndex(),n=this._nonDividerOptions[t];n&&n.options&&n.options.length&&this._adapter.toggleChildMenu(t);break;case"ArrowUp":case"ArrowDown":if(this._open&&e.stopImmediatePropagation(),e.preventDefault(),!this._open&&e.code==="ArrowDown"){this._openDropdown({fromKeyboard:!0}),this._adapter.activateFirstOption();return}this._adapter.propagateKey(e.code);break;case"ArrowLeft":this._open&&e.stopImmediatePropagation(),this._mode==="cascade"&&this._open&&this._closeDropdown();break;case"ArrowRight":if(this._open&&e.stopImmediatePropagation(),!this._open)return;let o=this._adapter.getActiveOptionIndex(),r=this._nonDividerOptions[o];if(r&&r.options){this._adapter.toggleChildMenu(o,e.code==="ArrowRight");return}break}}async _openMenu({fromKeyboard:e}={}){this._open=!0;let t=[];if(typeof this._optionsFactory=="function")this._loadOptionsAsync(),this._options=[];else{if(!this._options||!this._options.length)return;t=this._options}this._persistSelection||t.forEach(r=>r.selected=!1),this._mapIconToLeadingIcon();let n=this._persistSelection?this._getSelectedValues():[],o={id:this._identifier,type:"menu",options:this._options,selectedValues:n,iconClass:this._iconClass,dense:this._dense,multiple:!1,popupStatic:!0,allowBusy:!0,asyncStyle:"spinner",optionBuilder:this._optionBuilder,optionLimit:this._optionLimit,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,popupPlacement:this._placement,popupFallbackPlacements:this._fallbackPlacements,activeStartIndex:e?0:void 0,popupClasses:[i.classes.POPUP,i.classes.MENU,...this._popupClasses],syncWidth:this._syncPopupWidth,activeChangeCallback:this._activeChangeListener,selectCallback:this._selectListener,popupOffset:this._popupOffset,cascadingElementFactory:r=>this._createCascadingElement(r)};this._adapter.setHostAttribute(i.attributes.OPEN,""),this._adapter.attachMenu(o),this._mode==="cascade"&&(this._adapter.addDropdownListener("mouseenter",this._childPopupMouseEnterListener),this._adapter.addDropdownListener("mouseleave",this._childPopupMouseLeaveListener)),this._adapter.addDropdownListener(i.events.ACTIVE_CHANGE,r=>{this._onActiveOptionChanged(r.detail.id)}),this._adapter.emitHostEvent(i.events.OPEN)}_closeMenu(){this._open=!1,this._childOpen=!1,this._adapter.detachMenu(),this._activeMouseLeaveTimeout!==void 0&&window.clearTimeout(this._activeMouseLeaveTimeout),this._adapter.removeHostAttribute(i.attributes.OPEN),this._adapter.emitHostEvent(i.events.CLOSE)}_loadOptionsAsync(){return this._optionsFactory?Promise.resolve(this._optionsFactory()).then(e=>{if(this._persistSelection||e.forEach(t=>t.selected=!1),this._open)if(e&&I(e)&&e.length){this._options=e,this._adapter.setOptions(e);let t=this._getSelectedValues();t.length&&this._adapter.setSelectedValues(t)}else this._open&&this._closeDropdown()}).catch(e=>{console.error("An unexpected error ocurred while opening the menu:",e),this._open&&this._closeDropdown()}):(this._open&&this._closeMenu(),Promise.resolve())}_handleSelectEvent(e){let t=this._nonDividerOptions.findIndex(n=>n.value===e);t<0||this._selectOptionByIndex(t)}_selectActiveOption(){let e=this._adapter.getActiveOptionIndex();e>=0&&this._nonDividerOptions[e]&&this._selectOptionByIndex(e)}_selectOptionByIndex(e){let{options:t,value:n}=this._nonDividerOptions[e];if(t){this._adapter.setActiveOption(e);return}this._closeDropdown();let o={index:e,value:n};!this._adapter.emitHostEvent(i.events.SELECT,o,!0,!0)||(this._selectedValue=this._persistSelection?n:void 0)}_getSelectedValues(){let e=this._flatOptions.filter(t=>t.selected).map(t=>t.value);return this._selectedValue!==void 0&&e.push(this._selectedValue),e}_onCascadingOptionSelected(e){this._persistSelection&&(this._selectedValue=e.value),this._adapter.emitHostEvent(i.events.SELECT,e),this._closeDropdown()}_onCascadingChildOpen(e){super._clearMouseLeaveTimeout(),this._adapter.closeOtherChildMenus(e),this._childOpen=!0,this._adapter.setActiveOption(e)}_onCascadingChildClose(e){this._childOpen=!1}_closeDropdown(){this._closeMenu()}_openDropdown({fromKeyboard:e}={}){this._openMenu({fromKeyboard:e})}_setCascadeTargetInactive(){this._adapter.setCascadeTargetInactive()}_isOwnElement(e){return this._adapter.isOwnElement(e)}_createCascadingElement({index:e,options:t,parentValue:n}){let o=this._adapter.createChildMenu(e,n,this._onCascadingChildOpen.bind(this),this._onCascadingChildClose.bind(this),this._onCascadingOptionSelected.bind(this));return o.mode="cascade",o.popupOffset={x:0,y:-8},o.dense=this._dense,o.placement="right-start",o.fallbackPlacements=["left-start","right-start"],o.persistSelection=this._persistSelection,this._persistSelection&&(o.selectedValue=this._selectedValue),o.options=t,o.optionBuilder=this._optionBuilder,o.iconClass=this._iconClass,o}_mapIconToLeadingIcon(){this._flatOptions.filter(e=>e.icon).forEach(e=>e.leadingIcon=e.icon)}get open(){return this._open}set open(e){e=!!e,this._open!==e&&(this._open=e,e?this._openDropdown():this._closeDropdown())}set options(e){if(typeof e=="function")this.optionsFactory=e;else if(this.optionsFactory=void 0,this._options=e.map(t=>c({},t)),this._open&&(this._mapIconToLeadingIcon(),this._adapter.setOptions(this._options),this._persistSelection)){let t=this._getSelectedValues();t.length&&this._adapter.setSelectedValues(t)}}get options(){return this._options?this._flatOptions.map(e=>c({},e)):[]}set optionsFactory(e){this._optionsFactory=e}set selectedIndex(e){let t=this._nonDividerOptions[e];t&&t.value!==this._selectedValue&&(this.selectedValue=t.value)}get selectedIndex(){return this._selectedValue!==void 0?this._nonDividerOptions.findIndex(e=>e.value===this._selectedValue):-1}set selectedValue(e){this._selectedValue!==e&&(this._selectedValue=e,this._adapter.setSelectedValues(this._selectedValue))}get selectedValue(){return this._selectedValue}get placement(){return this._placement}set placement(e){this._placement!==e&&(this._placement=e||"bottom-start",this._adapter.setHostAttribute(i.attributes.PLACEMENT,this._placement))}get fallbackPlacements(){return this._fallbackPlacements}set fallbackPlacements(e){this._fallbackPlacements=Array.isArray(e)?e:[]}get dense(){return this._dense}set dense(e){this._dense=e}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass=e}get persistSelection(){return this._persistSelection}set persistSelection(e){this._persistSelection!==e&&(this._persistSelection=e,this._adapter.toggleHostAttribute(i.attributes.PERSIST_SELECTION,this._persistSelection),this._persistSelection||(this._flatOptions.forEach(t=>t.selected=!1),this._selectedValue=void 0))}get mode(){return this._mode}set mode(e){this._mode!==e&&(this._mode=e,this._destroyInteractionListeners(),this._applyMode(),this._adapter.setHostAttribute(i.attributes.MODE,this._mode))}get popupOffset(){return this._popupOffset}set popupOffset(e){this._popupOffset=e}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get popupElement(){return this._adapter.getDropdownElement()}};var q="<template><slot></slot></template>",W=":host{display:inline-block}:host([hidden]){display:none}",s=class extends k{constructor(){super();w.define(P),this._foundation=new h(new u(this)),C(this,q,W)}static get observedAttributes(){return[i.attributes.OPEN,i.attributes.PLACEMENT,i.attributes.SELECTED_INDEX,i.attributes.SELECTED_VALUE,i.attributes.DENSE,i.attributes.ICON_CLASS,i.attributes.PERSIST_SELECTION,i.attributes.MODE,i.attributes.SYNC_POPUP_WIDTH,i.attributes.POPUP_CLASSES,i.attributes.OPTION_LIMIT,i.attributes.OBSERVE_SCROLL,i.attributes.OBSERVE_SCROLL_THRESHOLD]}connectedCallback(){this.querySelector(i.selectors.TOGGLE)?this._foundation.initialize():M(this,i.selectors.TOGGLE).then(()=>this._foundation.initialize())}attributeChangedCallback(e,t,n){switch(super.attributeChangedCallback(e,t,n),e){case i.attributes.OPEN:this._foundation.open=O(n);break;case i.attributes.PLACEMENT:this._foundation.placement=n;break;case i.attributes.SELECTED_INDEX:this._foundation.selectedIndex=Number(n);break;case i.attributes.SELECTED_VALUE:this._foundation.selectedValue=n;break;case i.attributes.DENSE:this._foundation.dense=_(n);break;case i.attributes.ICON_CLASS:this._foundation.iconClass=n;break;case i.attributes.PERSIST_SELECTION:this.persistSelection=_(n);break;case i.attributes.MODE:this.mode=n;break}}disconnectedCallback(){this._foundation.disconnect()}propagateKeyEvent(e){this._foundation.onKeydown(e)}activateFirstOption(){this._foundation.activateFirstOption()}};a([p()],s.prototype,"open",2),a([p()],s.prototype,"options",2),a([p()],s.prototype,"selectedIndex",2),a([p()],s.prototype,"selectedValue",2),a([p()],s.prototype,"placement",2),a([p()],s.prototype,"fallbackPlacements",2),a([p()],s.prototype,"dense",2),a([p()],s.prototype,"iconClass",2),a([p()],s.prototype,"persistSelection",2),a([p()],s.prototype,"mode",2),a([p()],s.prototype,"popupOffset",2),a([p()],s.prototype,"optionBuilder",2),a([p({set:!1})],s.prototype,"popupElement",2),s=a([T({name:i.elementName,dependencies:[F,x,K,A]})],s);function Qe(){L(s)}export{i as a,u as b,h as c,s as d,Qe as e};
7
+ //# sourceMappingURL=chunk.JUJGROHA.js.map
@@ -3,5 +3,5 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{a as E}from"./chunk.7XFU2W25.js";import{a as o}from"./chunk.NVUMRW44.js";import{a as v}from"./chunk.5V5ABSHI.js";import{f as m,k as h}from"./chunk.NK7H3MMM.js";import{f as l,g as _}from"./chunk.CFDK4RCW.js";import{b as p,k as c}from"./chunk.J2M2MXP2.js";import{d as s}from"./chunk.M3QDAYD2.js";var f={OPEN:"open",DIRECTION:"direction"},D={DRAWER:"forge-drawer",LEFT:"forge-drawer--left",RIGHT:"forge-drawer--right",CLOSING:"forge-drawer--closing",CLOSED:"forge-drawer--closed",NO_TRANSITION:"forge-drawer--no-transition"},w={DRAWER:`.${D.DRAWER}`},b={AFTER_OPEN:"forge-drawer-after-open",AFTER_CLOSE:"forge-drawer-after-close"},e={attributes:f,classes:D,selectors:w,events:b};var u=class extends v{constructor(t){super(t);this._component=t;this._drawerElement=m(this._component,e.selectors.DRAWER)}proxyScrollEvent(){this.tryUnproxyScrollEvent(),this._unproxyScrollEventCb=E(this._component.shadowRoot,this._component)}tryUnproxyScrollEvent(){this._unproxyScrollEventCb&&this._unproxyScrollEventCb()}setDirection(t){switch(t){case"left":this._drawerElement.classList.remove(e.classes.RIGHT),this._drawerElement.classList.add(e.classes.LEFT);break;case"right":this._drawerElement.classList.remove(e.classes.LEFT),this._drawerElement.classList.add(e.classes.RIGHT);break}}removeDrawerClass(t){_(t,this._drawerElement)}setDrawerClass(t){l(t,this._drawerElement)}listenTransitionComplete(t){this._activeTransitionListener&&this._drawerElement.removeEventListener("transitionend",this._activeTransitionListener),this._activeTransitionListener=a=>{a.propertyName==="transform"&&(this._activeTransitionListener&&(this._drawerElement.removeEventListener("transitionend",this._activeTransitionListener),this._activeTransitionListener=void 0),t())},this._drawerElement.addEventListener("transitionend",this._activeTransitionListener)}};var C=class{constructor(r){this._adapter=r;this._open=!0;this._direction="left";this._hasInitialized=!1;this._openAnimationListener=()=>this._onOpenComplete(),this._closeAnimationListener=()=>this._onCloseComplete()}connect(){this._open?this._setOpened():this._setClosed(),this._applyDirection(),this._adapter.proxyScrollEvent(),this._hasInitialized=!0}disconnect(){this._adapter.tryUnproxyScrollEvent(),this._hasInitialized=!1}_applyDirection(){this._adapter.setDirection(this._direction),this._adapter.setHostAttribute(e.attributes.DIRECTION,p(this._direction)?this._direction.toString():"")}_onOpenComplete(){this._open&&(this._setOpened(),this._adapter.emitHostEvent(e.events.AFTER_OPEN))}_onCloseComplete(){this._open||(this._setClosed(),this._adapter.emitHostEvent(e.events.AFTER_CLOSE))}_setOpened(){this._adapter.removeDrawerClass([e.classes.CLOSED,e.classes.CLOSING]),this._adapter.setHostAttribute(e.attributes.OPEN)}_setClosed(){this._adapter.removeDrawerClass([e.classes.CLOSING,e.classes.NO_TRANSITION]),this._adapter.setDrawerClass(e.classes.CLOSED),this._adapter.removeHostAttribute(e.attributes.OPEN)}_applyOpen(){this._open?(this._triggerDrawerOpen(),this._adapter.setHostAttribute(e.attributes.OPEN)):(this._triggerDrawerClose(),this._adapter.removeHostAttribute(e.attributes.OPEN))}_triggerDrawerOpen(){this._adapter.listenTransitionComplete(this._openAnimationListener),this._adapter.removeDrawerClass([e.classes.CLOSED,e.classes.CLOSING])}_triggerDrawerClose(){this._adapter.listenTransitionComplete(this._closeAnimationListener),this._adapter.setDrawerClass(e.classes.CLOSING)}get open(){return this._open}set open(r){this._open!==r&&(this._open=r,this._hasInitialized&&this._applyOpen())}get direction(){return this._direction}set direction(r){this._direction!==r&&(this._direction=r,this._hasInitialized&&this._applyDirection())}};var i=class extends h{constructor(){super()}static get observedAttributes(){return[e.attributes.OPEN,e.attributes.DIRECTION]}connectedCallback(){this._foundation.connect()}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,a,d){switch(t){case e.attributes.OPEN:this.open=c(d);break;case e.attributes.DIRECTION:this.direction=d;break}}};s([o()],i.prototype,"open",2),s([o()],i.prototype,"direction",2);export{e as a,u as b,C as c,i as d};
7
- //# sourceMappingURL=chunk.PHBOQRF6.js.map
6
+ import{a as E}from"./chunk.7XFU2W25.js";import{a as o}from"./chunk.NVUMRW44.js";import{a as v}from"./chunk.BKL2BAYW.js";import{f as m,k as h}from"./chunk.MVTBJPO2.js";import{f as l,g as _}from"./chunk.K7FPXAFS.js";import{b as p,k as c}from"./chunk.J2M2MXP2.js";import{d as s}from"./chunk.M3QDAYD2.js";var f={OPEN:"open",DIRECTION:"direction"},D={DRAWER:"forge-drawer",LEFT:"forge-drawer--left",RIGHT:"forge-drawer--right",CLOSING:"forge-drawer--closing",CLOSED:"forge-drawer--closed",NO_TRANSITION:"forge-drawer--no-transition"},w={DRAWER:`.${D.DRAWER}`},b={AFTER_OPEN:"forge-drawer-after-open",AFTER_CLOSE:"forge-drawer-after-close"},e={attributes:f,classes:D,selectors:w,events:b};var u=class extends v{constructor(t){super(t);this._component=t;this._drawerElement=m(this._component,e.selectors.DRAWER)}proxyScrollEvent(){this.tryUnproxyScrollEvent(),this._unproxyScrollEventCb=E(this._component.shadowRoot,this._component)}tryUnproxyScrollEvent(){this._unproxyScrollEventCb&&this._unproxyScrollEventCb()}setDirection(t){switch(t){case"left":this._drawerElement.classList.remove(e.classes.RIGHT),this._drawerElement.classList.add(e.classes.LEFT);break;case"right":this._drawerElement.classList.remove(e.classes.LEFT),this._drawerElement.classList.add(e.classes.RIGHT);break}}removeDrawerClass(t){_(t,this._drawerElement)}setDrawerClass(t){l(t,this._drawerElement)}listenTransitionComplete(t){this._activeTransitionListener&&this._drawerElement.removeEventListener("transitionend",this._activeTransitionListener),this._activeTransitionListener=a=>{a.propertyName==="transform"&&(this._activeTransitionListener&&(this._drawerElement.removeEventListener("transitionend",this._activeTransitionListener),this._activeTransitionListener=void 0),t())},this._drawerElement.addEventListener("transitionend",this._activeTransitionListener)}};var C=class{constructor(r){this._adapter=r;this._open=!0;this._direction="left";this._hasInitialized=!1;this._openAnimationListener=()=>this._onOpenComplete(),this._closeAnimationListener=()=>this._onCloseComplete()}connect(){this._open?this._setOpened():this._setClosed(),this._applyDirection(),this._adapter.proxyScrollEvent(),this._hasInitialized=!0}disconnect(){this._adapter.tryUnproxyScrollEvent(),this._hasInitialized=!1}_applyDirection(){this._adapter.setDirection(this._direction),this._adapter.setHostAttribute(e.attributes.DIRECTION,p(this._direction)?this._direction.toString():"")}_onOpenComplete(){this._open&&(this._setOpened(),this._adapter.emitHostEvent(e.events.AFTER_OPEN))}_onCloseComplete(){this._open||(this._setClosed(),this._adapter.emitHostEvent(e.events.AFTER_CLOSE))}_setOpened(){this._adapter.removeDrawerClass([e.classes.CLOSED,e.classes.CLOSING]),this._adapter.setHostAttribute(e.attributes.OPEN)}_setClosed(){this._adapter.removeDrawerClass([e.classes.CLOSING,e.classes.NO_TRANSITION]),this._adapter.setDrawerClass(e.classes.CLOSED),this._adapter.removeHostAttribute(e.attributes.OPEN)}_applyOpen(){this._open?(this._triggerDrawerOpen(),this._adapter.setHostAttribute(e.attributes.OPEN)):(this._triggerDrawerClose(),this._adapter.removeHostAttribute(e.attributes.OPEN))}_triggerDrawerOpen(){this._adapter.listenTransitionComplete(this._openAnimationListener),this._adapter.removeDrawerClass([e.classes.CLOSED,e.classes.CLOSING])}_triggerDrawerClose(){this._adapter.listenTransitionComplete(this._closeAnimationListener),this._adapter.setDrawerClass(e.classes.CLOSING)}get open(){return this._open}set open(r){this._open!==r&&(this._open=r,this._hasInitialized&&this._applyOpen())}get direction(){return this._direction}set direction(r){this._direction!==r&&(this._direction=r,this._hasInitialized&&this._applyDirection())}};var i=class extends h{constructor(){super()}static get observedAttributes(){return[e.attributes.OPEN,e.attributes.DIRECTION]}connectedCallback(){this._foundation.connect()}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,a,d){switch(t){case e.attributes.OPEN:this.open=c(d);break;case e.attributes.DIRECTION:this.direction=d;break}}};s([o()],i.prototype,"open",2),s([o()],i.prototype,"direction",2);export{e as a,u as b,C as c,i as d};
7
+ //# sourceMappingURL=chunk.K3KAM2PL.js.map
@@ -3,5 +3,5 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{i as a}from"./chunk.J2M2MXP2.js";function u(t){return t.ownerDocument||document}function p(t){return t&&t.nodeType===1}function L(t,e){if(!p(t))throw new Error("DOMUtils - elementParents: invalid element argument");let o=[];for(;t.parentElement&&(o.push(t.parentElement),!(t.parentElement===e||t.parentElement===u(t).body));)t.parentElement&&t.parentElement.parentNode&&t.parentElement.parentNode.nodeType===11?t=t.parentElement.parentNode.host:t=t.parentElement;return o}function g(t,e){if(!p(t))throw new Error("DOMUtils - offset: invalid element argument");let o=t.getBoundingClientRect(),n=u(t).defaultView,r=e||n.document.documentElement,i={width:o.width,height:o.width,top:0,left:0,bottom:0,right:0};if(!e||r===n.document.documentElement||r===n.document.body)i.top=n.scrollY+o.top,i.bottom=r.clientHeight-n.scrollY-o.bottom,i.left=n.scrollX+o.left,i.right=r.clientWidth-n.scrollX-o.right;else{if(!p(e))throw new Error("DOMUtils - offset: invalid parentElement argument");let s=e.getBoundingClientRect();i.top=o.top-s.top,i.bottom=s.bottom-o.bottom,i.left=o.left-s.left,i.right=s.right-o.right}return{width:Math.round(o.width),height:Math.round(o.height),top:Math.round(i.top),bottom:Math.round(i.bottom),left:Math.round(i.left),right:Math.round(i.right)}}function M(t,e,o){let n=i=>{let s=()=>{i.stopPropagation(),i.cancelable&&i.preventDefault();let l=i.type==="touchstart"?i.target:u(t).activeElement;t.contains(l)||e(l)};o?window.requestAnimationFrame(()=>s()):s()},r=u(t);return r.addEventListener("blur",n,!0),r.addEventListener("touchstart",n,!0),()=>{r.removeEventListener("blur",n,!0),r.removeEventListener("touchstart",n,!0)}}function N(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function P(t,e){return e.parentNode.replaceChild(t,e)}function b(t,e){a(t)?t.forEach(o=>e.classList.add(o)):e.classList.add(t)}function v(t,e){a(t)?t.forEach(o=>e.classList.remove(o)):e.classList.remove(t)}function x(){let t=document.createElement("fakeelement"),e={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(let o in e)if(t.style[o]!==void 0)return e[o]}async function W(t,e,o=!0){return t.classList.add(e),new Promise(n=>{let r=x(),i=()=>{o&&t.classList.remove(e),t.removeEventListener(r,i),n()};t.addEventListener(r,i)})}function E(t){t.removeNode?t.removeNode(!0):t.remove?t.remove():t.parentNode.removeChild(t)}function O(t){if(typeof t=="string"){if(t[t.length-1]==="%")return t;if(t.slice(-2)==="px")return t;if(Number(t)>=0)return`${t}px`}else if(typeof t=="number"&&t>=0)return`${t}px`}function R(t){let e=document.createElement("div");e.style.position="absolute",e.style.top="-99999px",e.style.left="-99999px",e.style.visibility="hidden",e.appendChild(t.cloneNode(!0)),document.body.appendChild(e);let o={width:e.scrollWidth,height:e.scrollHeight};return E(e),e=void 0,o}function H(t){return t.children.length?Promise.resolve():new Promise(e=>{let o=new MutationObserver(n=>{t.children.length&&(o.disconnect(),e())});o.observe(t,{childList:!0})})}function T(t,e){let o=f(t,e);return o.length?Promise.resolve(o[0]):new Promise(n=>{let r=new MutationObserver(i=>{if(i.reduce((l,c)=>l+c.addedNodes.length,0)>0){let l=f(t,e);l.length&&(r.disconnect(),n(l[0]))}});r.observe(t,{childList:!0,subtree:!0})})}function D(t,e){let o=t&&t.parentNode;for(;o;){if(e(o))return o;o=o.parentNode}return null}function U(t,e){let n=document.createElement("canvas").getContext("2d"),r=e?e.fontSize:16,i=e?e.fontFamily:"Roboto";return n.font=`${r}px ${i}`,n.measureText(t).width}function V(t,e){let o=[];for(let n=1;n<=t;n++)o.push(`${n}px ${n}px ${e}`);return o.join(", ")}function y(t,e){if(t.nodeType!==Node.ELEMENT_NODE)return!1;typeof e=="string"&&(e=e.replace(/\s+/,"").split(","));let o=Element.prototype.matches;return e.some(n=>o.call(t,n))}function f(t,e,o=!1){let n=[];if(!t)return n;if(typeof e=="string"&&(e=e.replace(/\s+/,"").split(",")),o&&y(t,e)&&n.indexOf(t)===-1&&n.push(t),t.tagName==="SLOT")t.assignedNodes().forEach(i=>n=n.concat(f(i,e,!0)));else{let r=t.shadowRoot?t.shadowRoot.firstElementChild:t.firstElementChild;for(;r;)n=n.concat(f(r,e,!0)),r=r.nextElementSibling}return n}function $(){let t=document.activeElement;return!t||t===document.body?t:m(t)}function m(t){return t.shadowRoot&&t.shadowRoot.activeElement&&(t=m(t.shadowRoot.activeElement)),t}function B(t,e,o){e?b(o,t):v(o,t)}function F(t,e,o,n=""){e?t.setAttribute(o,n):t.removeAttribute(o)}function I(t,e,o,n){let r=t.getAttribute(e);(n===void 0||n===!0)&&(!r||!r.includes(o))?A(t,e,o):n||C(t,e,o)}function A(t,e,o){let n=t.getAttribute(e);!n||!n.length?t.setAttribute(e,o):t.setAttribute(e,`${n} ${o}`)}function C(t,e,o){if(!t.hasAttribute(e))return;let n=t.getAttribute(e);if(n){let r=n==null?void 0:n.replace(o,"");r=r.replace(/\s+/g," ").trim(),r.length?t.setAttribute(e,r):t.removeAttribute(e)}}function X(t,e,o="auto",n="nearest"){if(!t)return;if(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth){let i=g(e,t),s=i.top<=e.clientHeight,l=i.bottom<=e.clientHeight;if(s||l){let d=h(n,s,e.offsetTop,e.clientHeight,t.offsetTop,t.offsetHeight);t.scrollTo({top:d,behavior:o});return}let c=i.left<=e.clientWidth,w=i.right<=e.clientWidth;if(c||w){let d=h(n,c,e.offsetLeft,e.clientWidth,t.offsetLeft,t.offsetWidth);t.scrollTo({left:d,behavior:o})}}}function h(t,e,o,n,r,i){return t==="nearest"?e?o-r-n:o-i+n*2:o-r-i/2+n/2}function k(t){let e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstElementChild}function Y(t,e,o){let n=new MutationObserver(r=>{for(let i of r)i.attributeName&&e(i.attributeName,t.getAttribute(i.attributeName))});return n.observe(t,{attributes:!0,attributeFilter:o}),n}export{p as a,L as b,M as c,N as d,P as e,b as f,v as g,W as h,E as i,O as j,R as k,H as l,T as m,D as n,U as o,V as p,y as q,f as r,$ as s,B as t,F as u,I as v,A as w,X as x,k as y,Y as z};
7
- //# sourceMappingURL=chunk.CFDK4RCW.js.map
6
+ import{i as a}from"./chunk.J2M2MXP2.js";function u(t){return t.ownerDocument||document}function p(t){return t&&t.nodeType===1}function L(t,e){if(!p(t))throw new Error("DOMUtils - elementParents: invalid element argument");let o=[];for(;t.parentElement&&(o.push(t.parentElement),!(t.parentElement===e||t.parentElement===u(t).body));)t.parentElement&&t.parentElement.parentNode&&t.parentElement.parentNode.nodeType===11?t=t.parentElement.parentNode.host:t=t.parentElement;return o}function g(t,e){if(!p(t))throw new Error("DOMUtils - offset: invalid element argument");let o=t.getBoundingClientRect(),n=u(t).defaultView,r=e||n.document.documentElement,i={width:o.width,height:o.width,top:0,left:0,bottom:0,right:0};if(!e||r===n.document.documentElement||r===n.document.body)i.top=n.scrollY+o.top,i.bottom=r.clientHeight-n.scrollY-o.bottom,i.left=n.scrollX+o.left,i.right=r.clientWidth-n.scrollX-o.right;else{if(!p(e))throw new Error("DOMUtils - offset: invalid parentElement argument");let s=e.getBoundingClientRect();i.top=o.top-s.top,i.bottom=s.bottom-o.bottom,i.left=o.left-s.left,i.right=s.right-o.right}return{width:Math.round(o.width),height:Math.round(o.height),top:Math.round(i.top),bottom:Math.round(i.bottom),left:Math.round(i.left),right:Math.round(i.right)}}function M(t,e,o){let n=i=>{let s=()=>{i.stopPropagation(),i.cancelable&&i.preventDefault();let l=i.type==="touchstart"?i.target:u(t).activeElement;t.contains(l)||e(l)};o?window.requestAnimationFrame(()=>s()):s()},r=u(t);return r.addEventListener("blur",n,!0),r.addEventListener("touchstart",n,!0),()=>{r.removeEventListener("blur",n,!0),r.removeEventListener("touchstart",n,!0)}}function N(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function P(t,e){return e.parentNode.replaceChild(t,e)}function b(t,e){a(t)?t.forEach(o=>e.classList.add(o)):e.classList.add(t)}function v(t,e){a(t)?t.forEach(o=>e.classList.remove(o)):e.classList.remove(t)}function x(){let t=document.createElement("fakeelement"),e={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(let o in e)if(t.style[o]!==void 0)return e[o]}async function W(t,e,o=!0){return t.classList.add(e),new Promise(n=>{let r=x(),i=()=>{o&&t.classList.remove(e),t.removeEventListener(r,i),n()};t.addEventListener(r,i)})}function E(t){t.removeNode?t.removeNode(!0):t.remove?t.remove():t.parentNode.removeChild(t)}function O(t){if(typeof t=="string"){if(t[t.length-1]==="%")return t;if(t.slice(-2)==="px")return t;if(Number(t)>=0)return`${t}px`}else if(typeof t=="number"&&t>=0)return`${t}px`}function R(t){let e=document.createElement("div");e.style.position="absolute",e.style.top="-99999px",e.style.left="-99999px",e.style.visibility="hidden",e.appendChild(t.cloneNode(!0)),document.body.appendChild(e);let o={width:e.scrollWidth,height:e.scrollHeight};return E(e),e=void 0,o}function H(t){return t.children.length?Promise.resolve():new Promise(e=>{let o=new MutationObserver(n=>{t.children.length&&(o.disconnect(),e())});o.observe(t,{childList:!0})})}function T(t,e){let o=f(t,e);return o.length?Promise.resolve(o[0]):new Promise(n=>{let r=new MutationObserver(i=>{if(i.reduce((l,c)=>l+c.addedNodes.length,0)>0){let l=f(t,e);l.length&&(r.disconnect(),n(l[0]))}});r.observe(t,{childList:!0,subtree:!0})})}function D(t,e){let o=t&&t.parentNode;for(;o;){if(e(o))return o;o=o.parentNode}return null}function U(t,e){let n=document.createElement("canvas").getContext("2d"),r=e?e.fontSize:16,i=e?e.fontFamily:"Roboto";return n.font=`${r}px ${i}`,n.measureText(t).width}function V(t,e){let o=[];for(let n=1;n<=t;n++)o.push(`${n}px ${n}px ${e}`);return o.join(", ")}function y(t,e){if(t.nodeType!==Node.ELEMENT_NODE)return!1;typeof e=="string"&&(e=e.replace(/\s+/,"").split(","));let o=Element.prototype.matches;return e.some(n=>o.call(t,n))}function f(t,e,o=!1){let n=[];if(!t)return n;if(typeof e=="string"&&(e=e.replace(/\s+/,"").split(",")),o&&y(t,e)&&n.indexOf(t)===-1&&n.push(t),t.tagName==="SLOT")t.assignedNodes().forEach(i=>n=n.concat(f(i,e,!0)));else{let r=t.shadowRoot?t.shadowRoot.firstElementChild:t.firstElementChild;for(;r;)n=n.concat(f(r,e,!0)),r=r.nextElementSibling}return n}function $(t=document){let e=t.activeElement;return!e||e===t.body?e:m(e)}function m(t){return t.shadowRoot&&t.shadowRoot.activeElement&&(t=m(t.shadowRoot.activeElement)),t}function B(t,e,o){e?b(o,t):v(o,t)}function F(t,e,o,n=""){e?t.setAttribute(o,n):t.removeAttribute(o)}function I(t,e,o,n){let r=t.getAttribute(e);(n===void 0||n===!0)&&(!r||!r.includes(o))?A(t,e,o):n||C(t,e,o)}function A(t,e,o){let n=t.getAttribute(e);!n||!n.length?t.setAttribute(e,o):t.setAttribute(e,`${n} ${o}`)}function C(t,e,o){if(!t.hasAttribute(e))return;let n=t.getAttribute(e);if(n){let r=n==null?void 0:n.replace(o,"");r=r.replace(/\s+/g," ").trim(),r.length?t.setAttribute(e,r):t.removeAttribute(e)}}function X(t,e,o="auto",n="nearest"){if(!t)return;if(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth){let i=g(e,t),s=i.top<=e.clientHeight,l=i.bottom<=e.clientHeight;if(s||l){let d=h(n,s,e.offsetTop,e.clientHeight,t.offsetTop,t.offsetHeight);t.scrollTo({top:d,behavior:o});return}let c=i.left<=e.clientWidth,w=i.right<=e.clientWidth;if(c||w){let d=h(n,c,e.offsetLeft,e.clientWidth,t.offsetLeft,t.offsetWidth);t.scrollTo({left:d,behavior:o})}}}function h(t,e,o,n,r,i){return t==="nearest"?e?o-r-n:o-i+n*2:o-r-i/2+n/2}function k(t){let e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstElementChild}function Y(t,e,o){let n=new MutationObserver(r=>{for(let i of r)i.attributeName&&e(i.attributeName,t.getAttribute(i.attributeName))});return n.observe(t,{attributes:!0,attributeFilter:o}),n}export{p as a,L as b,M as c,N as d,P as e,b as f,v as g,W as h,E as i,O as j,R as k,H as l,T as m,D as n,U as o,V as p,y as q,f as r,$ as s,B as t,F as u,I as v,A as w,X as x,k as y,Y as z};
7
+ //# sourceMappingURL=chunk.K7FPXAFS.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../node_modules/@tylertech/forge-core/esm/utils/dom-utils.js"],
4
- "sourcesContent": ["import { isArray } from './utils';\n/**\n * Holds regular expressions\n */\n/* tslint:disable-next-line:require-private-underscore */\nconst REGULAR_EXPRESSIONS = {\n placement: {\n auto: /\\s?auto?\\s?/i,\n primary: /^(top|bottom|left|right)$/,\n secondary: /^(top|bottom|left|right|center)$/,\n topBottom: /^(top|bottom)$/\n },\n overflow: /(auto|scroll)/\n};\n/**\n * Holds the browser scrollbar width.\n */\n/* tslint:disable-next-line:require-private-underscore */\nlet SCROLLBAR_WIDTH;\n/**\n * Gets the ownerDocument for an element, if null, than returns the document element.\n * @param {Element} element The element to get the ownerDocument for\n * @returns {Document}\n */\nfunction _ownerDocument(element) {\n return element.ownerDocument || document;\n}\n/**\n * Retrieves an element based on the provided root and selector.\n * @param {Element} root The root element to search within.\n * @param {string} selector The selector for the child element.\n * @param {boolean} [allowNull=false] Should the method allow the element to be not found? Default is false.\n * @returns {HTMLElement}\n */\nexport function getElement(root, selector, allowNull = false) {\n const element = root.querySelector(selector);\n if (!element && !allowNull) {\n throw new Error(`Element not found with selector: ${selector}`);\n }\n return element;\n}\n/**\n * Checks if an element is a valid element.\n * @param {Element} element The node to test\n * @returns {boolean}\n */\nexport function isElement(element) {\n return element && element.nodeType === 1;\n}\n/**\n * Checks if an element is statically positioned.\n * @param {Element} element The node to test.\n * @returns {boolean}\n */\nexport function isPositionStatic(element) {\n return (window.getComputedStyle(element).position || 'static') === 'static';\n}\n/**\n * Parses a style string to a numeric value (removes 'px').\n * @param {string} value The style string to parse.\n * @returns {number}\n */\nexport function parseStyle(value) {\n if (!value || !value.length) {\n return 0;\n }\n const parsedValue = parseFloat(value);\n return isFinite(parsedValue) ? parsedValue : 0;\n}\n/**\n * Gets the index of an element in the parent element children.\n * @param {Element} element The element to get the index on.\n * @returns {number}\n */\nexport function elementIndex(element) {\n if (!isElement(element)) {\n throw new Error('DOMUtils - elementIndex: invalid element argument');\n }\n if (!element.parentElement) {\n return -1;\n }\n return Array.from(element.parentElement.children).indexOf(element);\n}\n/**\n * Gets an array of parent elements up to the body element.\n * @param {Element} element The element to get the parents of.\n * @param {Element=} untilElement Optional element where traversal should stop.\n * @returns {Array}\n */\nexport function elementParents(element, untilElement) {\n if (!isElement(element)) {\n throw new Error('DOMUtils - elementParents: invalid element argument');\n }\n const parentElements = [];\n while (element.parentElement) {\n parentElements.push(element.parentElement);\n if (element.parentElement === untilElement || element.parentElement === _ownerDocument(element).body) {\n break;\n }\n // pierce shadow DOM\n if (element.parentElement && element.parentElement.parentNode && element.parentElement.parentNode.nodeType === 11) {\n element = element.parentElement.parentNode.host;\n }\n else {\n element = element.parentElement;\n }\n }\n return parentElements;\n}\n/**\n * Gets the non-statically positioned parent of an element.\n * @param element The element to get the offset parent of.\n * @returns {Element}\n */\nexport function offsetParent(element) {\n if (!isElement(element)) {\n throw new Error('DOMUtils - offsetParent: invalid element argument');\n }\n let offsetParentElem = element.offsetParent;\n while (offsetParentElem && isPositionStatic(offsetParentElem)) {\n offsetParentElem = offsetParentElem.offsetParent;\n }\n return offsetParentElem || _ownerDocument(element).documentElement;\n}\n/**\n * Gets the browser scrollbar width.\n * @returns {number}\n */\nexport function scrollbarWidth() {\n if (SCROLLBAR_WIDTH === undefined) {\n const elem = document.createElement('div');\n elem.style.position = 'absolute';\n elem.style.top = '-100px';\n elem.style.left = '-100px';\n elem.style.width = '50px';\n elem.style.height = '50px';\n elem.style.overflow = 'scroll';\n document.body.appendChild(elem);\n const width = elem.offsetWidth - elem.clientWidth;\n removeElement(elem);\n SCROLLBAR_WIDTH = isFinite(width) ? width : 0;\n }\n return SCROLLBAR_WIDTH;\n}\n/**\n * Checks if an element is scrollable.\n * @param {Element} element The element to test for scrollability\n * @returns {boolean}\n */\nexport function isScrollable(element) {\n const elemStyle = window.getComputedStyle(element);\n return REGULAR_EXPRESSIONS.overflow.test('' + elemStyle.overflow + elemStyle.overflowY + elemStyle.overflowX);\n}\n/**\n * Gets the scroll parent of an element.\n * @param {Element} element The element to get the scroll parent of.\n * @param {boolean} [includeSelf=false] Should the element be checked for scrollability.\n * @returns {Element}\n */\nexport function scrollParent(element, includeSelf = false) {\n if (!isElement(element)) {\n throw new Error('DOMUtils - scrollParent: invalid element argument');\n }\n const docElem = _ownerDocument(element).documentElement;\n const elemStyle = window.getComputedStyle(element);\n if (includeSelf && REGULAR_EXPRESSIONS.overflow.test('' + elemStyle.overflow + elemStyle.overflowY + elemStyle.overflowX)) {\n return element;\n }\n let excludeStatic = elemStyle.position === 'absolute';\n let scrollParentElem = element.parentElement || docElem;\n if (scrollParentElem === docElem || elemStyle.position === 'fixed') {\n return scrollParentElem;\n }\n while (scrollParentElem && scrollParentElem !== docElem) {\n const scrollParentStyle = window.getComputedStyle(scrollParentElem);\n if (excludeStatic && scrollParentStyle.position !== 'static') {\n excludeStatic = false;\n }\n if (!excludeStatic && REGULAR_EXPRESSIONS.overflow.test('' + scrollParentStyle.overflow + scrollParentStyle.overflowY + scrollParentStyle.overflowX)) {\n break;\n }\n scrollParentElem = scrollParentElem.scrollParent;\n }\n return scrollParentElem || docElem;\n}\n/**\n * Checks if the elements scroll parent scrollbars are visible.\n * @param {Element} element The element to check the scroll parent of.\n * @returns {IScrollbarVisibility}\n */\nexport function isScrollbarVisible(element) {\n if (!isElement(element)) {\n throw new Error('DOMUtils - isDocumentScrolled: invalid element argument');\n }\n const scrollParentElem = scrollParent(element);\n return {\n x: scrollParentElem.scrollWidth > scrollParentElem.clientWidth,\n y: scrollParentElem.scrollHeight > scrollParentElem.clientHeight\n };\n}\n/**\n * Gets the offset from the element to the parent element edges.\n * If no parentElement is supplied, the documentElement will be used.\n * @param {Element} element The element to compute the offset for.\n * @param {Element=} parentElement Optional parent element to measure from.\n * @returns {DOMRect}\n */\nexport function offset(element, parentElement) {\n if (!isElement(element)) {\n throw new Error('DOMUtils - offset: invalid element argument');\n }\n const elemBCR = element.getBoundingClientRect();\n const win = _ownerDocument(element).defaultView;\n const docElem = parentElement || win.document.documentElement;\n const offsetValues = { width: elemBCR.width, height: elemBCR.width, top: 0, left: 0, bottom: 0, right: 0 };\n if (!parentElement || docElem === win.document.documentElement || docElem === win.document.body) {\n offsetValues.top = win.scrollY + elemBCR.top;\n offsetValues.bottom = docElem.clientHeight - win.scrollY - elemBCR.bottom;\n offsetValues.left = win.scrollX + elemBCR.left;\n offsetValues.right = docElem.clientWidth - win.scrollX - elemBCR.right;\n }\n else {\n if (!isElement(parentElement)) {\n throw new Error('DOMUtils - offset: invalid parentElement argument');\n }\n const parentBCR = parentElement.getBoundingClientRect();\n offsetValues.top = elemBCR.top - parentBCR.top;\n offsetValues.bottom = parentBCR.bottom - elemBCR.bottom;\n offsetValues.left = elemBCR.left - parentBCR.left;\n offsetValues.right = parentBCR.right - elemBCR.right;\n }\n return {\n width: Math.round(elemBCR.width),\n height: Math.round(elemBCR.height),\n top: Math.round(offsetValues.top),\n bottom: Math.round(offsetValues.bottom),\n left: Math.round(offsetValues.left),\n right: Math.round(offsetValues.right)\n };\n}\n/**\n * Gets the offset from the element to the parent element viewable edges.\n * If no parentElement is supplied, the documentElement will be used.\n * @param {Element} element The element to measure\n * @param {Element=} parentElement The parent element to measure to.\n * @returns {DOMRect}\n */\nexport function viewportOffset(element, parentElement) {\n if (!isElement(element)) {\n throw new Error('DOMUtils - offset: invalid element argument');\n }\n const win = _ownerDocument(element).defaultView;\n parentElement = parentElement || win.document.documentElement;\n const parentElementOffset = offset(element, parentElement);\n const offsetValues = {\n top: parentElementOffset.top,\n bottom: 0,\n left: parentElementOffset.left,\n right: 0\n };\n if (parentElement === win.document.documentElement) {\n offsetValues.top -= win.scrollY;\n offsetValues.left -= win.scrollX;\n }\n else {\n const parentStyle = window.getComputedStyle(parentElement);\n offsetValues.top -= parseStyle('' + parentStyle.borderTopWidth);\n offsetValues.left -= parseStyle('' + parentStyle.borderLeftWidth);\n }\n offsetValues.bottom = parentElement.clientHeight - offsetValues.top - element.offsetHeight;\n offsetValues.right = parentElement.clientWidth - offsetValues.left - element.offsetWidth;\n return {\n width: parentElementOffset.width,\n height: parentElementOffset.height,\n top: Math.round(offsetValues.top),\n bottom: Math.round(offsetValues.bottom),\n left: Math.round(offsetValues.left),\n right: Math.round(offsetValues.right)\n };\n}\n/**\n * Checks if any part of an element is visible in the viewport.\n * @param {Element} element The element to check.\n * @returns {boolean}\n */\nexport function isElementInViewport(element) {\n if (!isElement(element)) {\n throw new Error('DOMUtils - isElementInViewport: invalid element argument');\n }\n const document = _ownerDocument(element);\n const scrollParentElem = scrollParent(element);\n const elemBCR = element.getBoundingClientRect();\n if (scrollParentElem !== document.documentElement && scrollParentElem !== document.body) {\n const scrollParentOffset = offset(element, scrollParentElem);\n if (scrollParentOffset.top + elemBCR.height < 0 ||\n scrollParentOffset.left + elemBCR.width < 0 ||\n scrollParentOffset.bottom + elemBCR.height - this.scrollbarWidth < 0 ||\n scrollParentOffset.right + elemBCR.width - this.scrollbarWidth < 0) {\n return false;\n }\n }\n if (elemBCR.top + elemBCR.height < 0 ||\n elemBCR.left + elemBCR.width < 0 ||\n elemBCR.bottom + elemBCR.height > document.documentElement.clientHeight ||\n elemBCR.right + elemBCR.width > document.documentElement.clientWidth) {\n return false;\n }\n return true;\n}\n/**\n * Adds an event listener to the document that will call the provided callback function\n * when an element and it's children no longer have focus. The blur and touchstart events are used\n * to evaluate the active element to determine if the callback should be called.\n *\n * @param {Element} element The element to add the event listener to.\n * @param {Function} callback The function to call when the element and children don't have focus.\n * @param {boolean} [delay=false] Should a RAF cycle occur before the callback is called.\n * @returns {Function} The function to call to remove the document events.\n */\nexport function notChildEventListener(element, callback, delay) {\n const evtHandler = (event) => {\n const handle = () => {\n event.stopPropagation();\n if (event.cancelable) {\n event.preventDefault();\n }\n const activeElement = (event.type === 'touchstart' ? event.target : _ownerDocument(element).activeElement);\n if (!element.contains(activeElement)) {\n callback(activeElement);\n }\n };\n if (delay) {\n window.requestAnimationFrame(() => handle());\n }\n else {\n handle();\n }\n };\n const docElem = _ownerDocument(element);\n docElem.addEventListener('blur', evtHandler, true);\n docElem.addEventListener('touchstart', evtHandler, true);\n return () => {\n docElem.removeEventListener('blur', evtHandler, true);\n docElem.removeEventListener('touchstart', evtHandler, true);\n };\n}\n/**\n * Removes all children from a DOM node.\n * @param node The DOM node to remove children from.\n */\nexport function removeAllChildren(node) {\n while (node.lastChild) {\n node.removeChild(node.lastChild);\n }\n}\n/**\n * Replaces one child node of the specified node with another.\n * @param newChild The new node to replace `oldChild`.\n * @param oldChild The existing node to be replaced.\n * @returns {Node} The replaced node. Same node as `oldChild`.\n */\nexport function replaceElement(newChild, oldChild) {\n return oldChild.parentNode.replaceChild(newChild, oldChild);\n}\n/**\n * Adds a class or array of classes to an element.\n *\n * @param {string | string[]} name The class(es) to add to the element\n * @param {Element} element The element to add class(es) to.\n */\nexport function addClass(name, element) {\n if (isArray(name)) {\n name.forEach(n => element.classList.add(n));\n }\n else {\n element.classList.add(name);\n }\n}\n/**\n * Removes a class or array of classes to an element.\n *\n * @param {string | string[]} name The class(es) to remove from the element\n * @param {Element} element The element to remove class(es) from.\n */\nexport function removeClass(name, element) {\n if (isArray(name)) {\n name.forEach(n => element.classList.remove(n));\n }\n else {\n element.classList.remove(name);\n }\n}\n/** Determines which type of animation event is supported. */\nexport function getAnimationEvent() {\n const el = document.createElement('fakeelement');\n // tslint:disable:object-literal-key-quotes\n const animations = {\n 'animation': 'animationend',\n 'OAnimation': 'oAnimationEnd',\n 'MozAnimation': 'animationend',\n 'WebkitAnimation': 'webkitAnimationEnd'\n };\n for (const t in animations) {\n if (el.style[t] !== undefined) {\n return animations[t];\n }\n }\n}\n/**\n * A helper method to trigger a keyframe animation via adding a class, and removing the class when the animation completes.\n * @param {HTMLElement} element The element to play the animation on.\n * @param {string} className The class to add that triggers the animation.\n */\nexport async function playKeyframeAnimation(element, className, remove = true) {\n element.classList.add(className);\n return new Promise(resolve => {\n const animationEvent = getAnimationEvent();\n const animationCompletedListener = () => {\n if (remove) {\n element.classList.remove(className);\n }\n element.removeEventListener(animationEvent, animationCompletedListener);\n resolve();\n };\n element.addEventListener(animationEvent, animationCompletedListener);\n });\n}\n/**\n * Removes an element from the DOM using the available remove method for that platform.\n * @param {HTMLElement} element The element to remove.\n */\nexport function removeElement(element) {\n if (element.removeNode) {\n element.removeNode(true);\n }\n else if (element.remove) {\n element.remove();\n }\n else {\n element.parentNode.removeChild(element);\n }\n}\n/**\n * Returns a width string that is safe for css based on the provided input.\n * @param {string | number} width\n * @returns {string | undefined} A width safe for using in CSS.\n */\nexport function safeCssWidth(width) {\n if (typeof width === 'string') {\n if (width[width.length - 1] === '%') {\n return width;\n }\n else if (width.slice(-2) === 'px') {\n return width;\n }\n else if (Number(width) >= 0) {\n return `${width}px`;\n }\n }\n else if (typeof width === 'number') {\n if (width >= 0) {\n return `${width}px`;\n }\n }\n return undefined;\n}\n/**\n * Calculates the size of an element that is not attached to the DOM.\n * @param {HTMLElement} element The element to calc the size of.\n * @returns {width, height} The size of the element.\n */\nexport function calcSizeUnattached(element) {\n let container = document.createElement('div');\n container.style.position = 'absolute';\n container.style.top = '-99999px';\n container.style.left = '-99999px';\n container.style.visibility = 'hidden';\n container.appendChild(element.cloneNode(true));\n document.body.appendChild(container);\n const size = {\n width: container.scrollWidth,\n height: container.scrollHeight\n };\n removeElement(container);\n container = undefined;\n return size;\n}\n/**\n * Resolves a promise when the provided element has children.\n * @param {Element} element An element that does or will contain children.\n */\nexport function ensureChildren(element) {\n if (element.children.length) {\n return Promise.resolve();\n }\n return new Promise(resolve => {\n const observer = new MutationObserver(changes => {\n if (element.children.length) {\n observer.disconnect();\n resolve();\n }\n });\n observer.observe(element, { childList: true });\n });\n}\n/**\n * Resolves a promise when the provided element has a child that matches a given selector.\n * @param {Element} element An element that does or will contain children.\n * @param {string} selector A CSS selector to use for finding an element.\n */\nexport function ensureChild(element, selector) {\n const initialElements = deepQuerySelectorAll(element, selector);\n if (initialElements.length) {\n return Promise.resolve(initialElements[0]);\n }\n return new Promise(resolve => {\n const observer = new MutationObserver(changes => {\n const hasAddedNodes = changes.reduce((prev, curr) => prev + curr.addedNodes.length, 0) > 0;\n if (hasAddedNodes) {\n const foundElements = deepQuerySelectorAll(element, selector);\n if (foundElements.length) {\n observer.disconnect();\n resolve(foundElements[0]);\n }\n }\n });\n observer.observe(element, { childList: true, subtree: true });\n });\n}\n/**\n * Resolves a promise when the provided host element has an `<input>` element child\n * @param {HTMLElement} host An element that does or will contain children.\n */\nexport function ensureInputElement(host) {\n return new Promise(resolve => {\n const element = host.querySelector('input');\n if (element) {\n resolve(element);\n }\n const observer = new MutationObserver(changes => {\n const hasAddedNodes = changes.reduce((prev, curr) => prev + curr.addedNodes.length, 0) > 0;\n if (hasAddedNodes) {\n const foundElement = host.querySelector('input');\n if (foundElement) {\n observer.disconnect();\n resolve(foundElement);\n }\n }\n });\n observer.observe(host, { childList: true, subtree: true });\n });\n}\n/**\n * Walks up the tree starting a specific node and stops when the provided matcher function returns true.\n * @param {Node} node The node to start searching from.\n * @returns {Node | null} The closest matching ancestor node, or null if not found.\n */\nexport function walkUpUntil(node, matcher) {\n let parent = node && node.parentNode;\n while (parent) {\n if (matcher(parent)) {\n return parent;\n }\n parent = parent.parentNode;\n }\n return null;\n}\n/**\n * Calculates the width of a string given the provided font information.\n */\nexport function calculateFontWidth(value, info) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n const fontSize = info ? info.fontSize : 16;\n const fontFamily = info ? info.fontFamily : 'Roboto';\n ctx.font = `${fontSize}px ${fontFamily}`;\n return ctx.measureText(value).width;\n}\n/**\n * Generates a CSS text-shadow style value based on the number of iterations and color provided.\n * @param {number} iterations The number of iterations for how long the shadow should be.\n * @param {string} color The color of the text shadow. Can be any CSS-safe color format. Ex. hex, rgb, rgba, hsl... etc.\n */\nexport function generateTextShadow(iterations, color) {\n const shadows = [];\n for (let i = 1; i <= iterations; i++) {\n shadows.push(`${i}px ${i}px ${color}`);\n }\n return shadows.join(', ');\n}\n/**\n * Checks if an element matches any of the provided selectors.\n * @param {Element} el The element to match.\n * @param {string[]} selectors The selectors to check the element against.\n */\nexport function matchesSelectors(el, selectors) {\n if (el.nodeType !== Node.ELEMENT_NODE) {\n return false;\n }\n if (typeof selectors === 'string') {\n selectors = selectors.replace(/\\s+/, '').split(',');\n }\n const matchesFn = Element.prototype.matches;\n return selectors.some(selector => matchesFn.call(el, selector));\n}\n/**\n * Walks the DOM tree starting at a root element and checks if any of its children\n * match the provided selectors. Similar to the native `querySelectorAll` except\n * that it will traverse the shadow DOM as well as slotted nodes.\n * @param {Element} rootElement The element to start querying from.\n * @param {string[]} selectors An array of CSS selectors.\n * @param {boolean} [checkRootElement] True if the provided root element is to be matched against the selectors.\n */\nexport function deepQuerySelectorAll(rootElement, selectors, checkRootElement = false) {\n let nodes = [];\n if (!rootElement) {\n return nodes;\n }\n if (typeof selectors === 'string') {\n selectors = selectors.replace(/\\s+/, '').split(',');\n }\n if (checkRootElement && matchesSelectors(rootElement, selectors) && nodes.indexOf(rootElement) === -1) {\n nodes.push(rootElement);\n }\n if (rootElement.tagName === 'SLOT') {\n const slotNodes = rootElement.assignedNodes();\n slotNodes.forEach(slottedNode => nodes = nodes.concat(deepQuerySelectorAll(slottedNode, selectors, true)));\n }\n else {\n let node = rootElement.shadowRoot ? rootElement.shadowRoot.firstElementChild : rootElement.firstElementChild;\n while (node) {\n nodes = nodes.concat(deepQuerySelectorAll(node, selectors, true));\n node = node.nextElementSibling;\n }\n }\n return nodes;\n}\n/**\n * Gets the currently focused element within the document by also traversing shadow roots.\n * @returns {Element}\n */\nexport function getActiveElement() {\n const activeElement = document.activeElement;\n if (!activeElement || activeElement === document.body) {\n return activeElement;\n }\n return getActiveShadowElement(activeElement);\n}\n/**\n * Gets the active element within the provided elements shadow root. If the element\n * does not have a shadow root, the provided element is returned.\n * @param {Element} element The active element.\n */\nexport function getActiveShadowElement(element) {\n if (element.shadowRoot && element.shadowRoot.activeElement) {\n element = getActiveShadowElement(element.shadowRoot.activeElement);\n }\n return element;\n}\n/** Toggles a CSS class (or classes) on an element based on a boolean. */\nexport function toggleClass(el, hasClass, className) {\n if (hasClass) {\n addClass(className, el);\n }\n else {\n removeClass(className, el);\n }\n}\n/** Toggles a value-less attribute on an element. */\nexport function toggleAttribute(el, hasAttribute, name, value = '') {\n if (hasAttribute) {\n el.setAttribute(name, value);\n }\n else {\n el.removeAttribute(name);\n }\n}\n/** Toggles part of an attribute on an element. */\nexport function toggleOnAttribute(el, attribute, value, force) {\n const oldValue = el.getAttribute(attribute);\n if ((force === undefined || force === true) && (!oldValue || !oldValue.includes(value))) {\n appendToAttribute(el, attribute, value);\n }\n else if (!force) {\n removeFromAttribute(el, attribute, value);\n }\n}\n/** Appends a value to an attribute on an element, first setting it if it doesn't exist. */\nexport function appendToAttribute(el, attribute, value) {\n const oldValue = el.getAttribute(attribute);\n if (!oldValue || !oldValue.length) {\n el.setAttribute(attribute, value);\n }\n else {\n el.setAttribute(attribute, `${oldValue} ${value}`);\n }\n}\n/** Removes a value from an attribute on an element, removing the attribute if empty. */\nexport function removeFromAttribute(el, attribute, value) {\n if (!el.hasAttribute(attribute)) {\n return;\n }\n const oldValue = el.getAttribute(attribute);\n if (oldValue) {\n let newValue = oldValue === null || oldValue === void 0 ? void 0 : oldValue.replace(value, '');\n newValue = newValue.replace(/\\s+/g, ' ').trim();\n if (newValue.length) {\n el.setAttribute(attribute, newValue);\n }\n else {\n el.removeAttribute(attribute);\n }\n }\n}\n/**\n * Attempts to scroll a target element into view within a scrollable parent element, unless already visible within the container.\n * @param scrollElement The scrollable parent element.\n * @param targetElement The element to scroll into view.\n * @param behavior The scroll behavior. Defaults to 'auto'.\n * @param block The block position to anchor the target element to within the scroll element.\n */\nexport function tryScrollIntoView(scrollElement, targetElement, behavior = 'auto', block = 'nearest') {\n if (!scrollElement) {\n return;\n }\n const canScroll = scrollElement.scrollHeight > scrollElement.clientHeight || scrollElement.scrollWidth > scrollElement.clientWidth;\n if (canScroll) {\n const offsetRect = offset(targetElement, scrollElement);\n const isClippedTop = offsetRect.top <= targetElement.clientHeight;\n const isClippedBottom = offsetRect.bottom <= targetElement.clientHeight;\n if (isClippedTop || isClippedBottom) {\n const top = calcBlockScroll(block, isClippedTop, targetElement.offsetTop, targetElement.clientHeight, scrollElement.offsetTop, scrollElement.offsetHeight);\n scrollElement.scrollTo({ top, behavior });\n return;\n }\n const isClippedLeft = offsetRect.left <= targetElement.clientWidth;\n const isClippedRight = offsetRect.right <= targetElement.clientWidth;\n if (isClippedLeft || isClippedRight) {\n const left = calcBlockScroll(block, isClippedLeft, targetElement.offsetLeft, targetElement.clientWidth, scrollElement.offsetLeft, scrollElement.offsetWidth);\n scrollElement.scrollTo({ left, behavior });\n }\n }\n}\n/** Calculates the block anchor position for a target element within a scrollable parent element. */\nexport function calcBlockScroll(block, isClippedStart, targetOffset, targetSize, scrollOffset, scrollSize) {\n if (block === 'nearest') {\n if (isClippedStart) {\n return (targetOffset - scrollOffset) - targetSize;\n }\n return (targetOffset - scrollSize) + targetSize * 2;\n }\n return targetOffset - scrollOffset - scrollSize / 2 + targetSize / 2;\n}\n/**\n * Creates an element from an HTML string.\n */\nexport function elementFromHTML(html) {\n const template = document.createElement('template');\n html = html.trim();\n template.innerHTML = html;\n return template.content.firstElementChild;\n}\n/**\n * Observes changes to the provided attributes on a target element and executes a provided callback when changed.\n * @param element The element to observe.\n * @param listener The callback to execute when an attribute changes on the element.\n * @param attributeFilter The attributes to observe.\n * @returns A `MutationObserver` instasnce.\n */\nexport function createElementAttributeObserver(element, listener, attributeFilter) {\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (mutation.attributeName) {\n listener(mutation.attributeName, element.getAttribute(mutation.attributeName));\n }\n }\n });\n observer.observe(element, { attributes: true, attributeFilter });\n return observer;\n}\n"],
5
- "mappings": "wCAwBA,SAASA,EAAeC,EAAS,CAC7B,OAAOA,EAAQ,eAAiB,QACpC,CAoBO,SAASC,EAAUC,EAAS,CAC/B,OAAOA,GAAWA,EAAQ,WAAa,CAC3C,CAyCO,SAASC,EAAeC,EAASC,EAAc,CAClD,GAAI,CAACC,EAAUF,CAAO,EAClB,MAAM,IAAI,MAAM,qDAAqD,EAEzE,IAAMG,EAAiB,CAAC,EACxB,KAAOH,EAAQ,gBACXG,EAAe,KAAKH,EAAQ,aAAa,EACrC,EAAAA,EAAQ,gBAAkBC,GAAgBD,EAAQ,gBAAkBI,EAAeJ,CAAO,EAAE,QAI5FA,EAAQ,eAAiBA,EAAQ,cAAc,YAAcA,EAAQ,cAAc,WAAW,WAAa,GAC3GA,EAAUA,EAAQ,cAAc,WAAW,KAG3CA,EAAUA,EAAQ,cAG1B,OAAOG,CACX,CAmGO,SAASE,EAAOC,EAASC,EAAe,CAC3C,GAAI,CAACC,EAAUF,CAAO,EAClB,MAAM,IAAI,MAAM,6CAA6C,EAEjE,IAAMG,EAAUH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xC,OAEJ,IAAMQ,EAAgBN,EAAW,MAAQH,EAAc,YACjDU,EAAiBP,EAAW,OAASH,EAAc,YACzD,GAAIS,GAAiBC,EAAgB,CACjC,IAAMC,EAAOH,EAAgBN,EAAOO,EAAeT,EAAc,WAAYA,EAAc,YAAaD,EAAc,WAAYA,EAAc,WAAW,EAC3JA,EAAc,SAAS,CAAE,KAAAY,EAAM,SAAAV,CAAS,CAAC,GAGrD,CAEO,SAASO,EAAgBN,EAAOU,EAAgBC,EAAcC,EAAYC,EAAcC,EAAY,CACvG,OAAId,IAAU,UACNU,EACQC,EAAeE,EAAgBD,EAEnCD,EAAeG,EAAcF,EAAa,EAE/CD,EAAeE,EAAeC,EAAa,EAAIF,EAAa,CACvE,CAIO,SAASG,EAAgBC,EAAM,CAClC,IAAMC,EAAW,SAAS,cAAc,UAAU,EAClD,OAAAD,EAAOA,EAAK,KAAK,EACjBC,EAAS,UAAYD,EACdC,EAAS,QAAQ,iBAC5B,CAQO,SAASC,EAA+BtC,EAASuC,EAAUC,EAAiB,CAC/E,IAAMC,EAAW,IAAI,iBAAiBC,GAAa,CAC/C,QAAWC,KAAYD,EACfC,EAAS,eACTJ,EAASI,EAAS,cAAe3C,EAAQ,aAAa2C,EAAS,aAAa,CAAC,CAGzF,CAAC,EACD,OAAAF,EAAS,QAAQzC,EAAS,CAAE,WAAY,GAAM,gBAAAwC,CAAgB,CAAC,EACxDC,CACX",
6
- "names": ["_ownerDocument", "element", "isElement", "element", "elementParents", "element", "untilElement", "isElement", "parentElements", "_ownerDocument", "offset", "element", "parentElement", "isElement", "elemBCR", "win", "_ownerDocument", "docElem", "offsetValues", "parentBCR", "notChildEventListener", "element", "callback", "delay", "evtHandler", "event", "handle", "activeElement", "_ownerDocument", "docElem", "removeAllChildren", "node", "replaceElement", "newChild", "oldChild", "addClass", "name", "isArray", "n", "removeClass", "getAnimationEvent", "el", "animations", "t", "playKeyframeAnimation", "className", "remove", "resolve", "animationEvent", "animationCompletedListener", "removeElement", "safeCssWidth", "width", "calcSizeUnattached", "container", "size", "ensureChildren", "observer", "changes", "ensureChild", "selector", "initialElements", "deepQuerySelectorAll", "prev", "curr", "foundElements", "walkUpUntil", "node", "matcher", "parent", "calculateFontWidth", "value", "info", "ctx", "fontSize", "fontFamily", "generateTextShadow", "iterations", "color", "shadows", "i", "matchesSelectors", "el", "selectors", "matchesFn", "selector", "deepQuerySelectorAll", "rootElement", "checkRootElement", "nodes", "slottedNode", "getActiveElement", "activeElement", "getActiveShadowElement", "element", "toggleClass", "hasClass", "className", "addClass", "removeClass", "toggleAttribute", "hasAttribute", "name", "toggleOnAttribute", "attribute", "force", "oldValue", "appendToAttribute", "removeFromAttribute", "newValue", "tryScrollIntoView", "scrollElement", "targetElement", "behavior", "block", "offsetRect", "offset", "isClippedTop", "isClippedBottom", "top", "calcBlockScroll", "isClippedLeft", "isClippedRight", "left", "isClippedStart", "targetOffset", "targetSize", "scrollOffset", "scrollSize", "elementFromHTML", "html", "template", "createElementAttributeObserver", "listener", "attributeFilter", "observer", "mutations", "mutation"]
4
+ "sourcesContent": ["import { isArray } from './utils';\n/**\n * Holds regular expressions\n */\n/* tslint:disable-next-line:require-private-underscore */\nconst REGULAR_EXPRESSIONS = {\n placement: {\n auto: /\\s?auto?\\s?/i,\n primary: /^(top|bottom|left|right)$/,\n secondary: /^(top|bottom|left|right|center)$/,\n topBottom: /^(top|bottom)$/\n },\n overflow: /(auto|scroll)/\n};\n/**\n * Holds the browser scrollbar width.\n */\n/* tslint:disable-next-line:require-private-underscore */\nlet SCROLLBAR_WIDTH;\n/**\n * Gets the ownerDocument for an element, if null, than returns the document element.\n * @param {Element} element The element to get the ownerDocument for\n * @returns {Document}\n */\nfunction _ownerDocument(element) {\n return element.ownerDocument || document;\n}\n/**\n * Retrieves an element based on the provided root and selector.\n * @param {Element} root The root element to search within.\n * @param {string} selector The selector for the child element.\n * @param {boolean} [allowNull=false] Should the method allow the element to be not found? Default is false.\n * @returns {HTMLElement}\n */\nexport function getElement(root, selector, allowNull = false) {\n const element = root.querySelector(selector);\n if (!element && !allowNull) {\n throw new Error(`Element not found with selector: ${selector}`);\n }\n return element;\n}\n/**\n * Checks if an element is a valid element.\n * @param {Element} element The node to test\n * @returns {boolean}\n */\nexport function isElement(element) {\n return element && element.nodeType === 1;\n}\n/**\n * Checks if an element is statically positioned.\n * @param {Element} element The node to test.\n * @returns {boolean}\n */\nexport function isPositionStatic(element) {\n return (window.getComputedStyle(element).position || 'static') === 'static';\n}\n/**\n * Parses a style string to a numeric value (removes 'px').\n * @param {string} value The style string to parse.\n * @returns {number}\n */\nexport function parseStyle(value) {\n if (!value || !value.length) {\n return 0;\n }\n const parsedValue = parseFloat(value);\n return isFinite(parsedValue) ? parsedValue : 0;\n}\n/**\n * Gets the index of an element in the parent element children.\n * @param {Element} element The element to get the index on.\n * @returns {number}\n */\nexport function elementIndex(element) {\n if (!isElement(element)) {\n throw new Error('DOMUtils - elementIndex: invalid element argument');\n }\n if (!element.parentElement) {\n return -1;\n }\n return Array.from(element.parentElement.children).indexOf(element);\n}\n/**\n * Gets an array of parent elements up to the body element.\n * @param {Element} element The element to get the parents of.\n * @param {Element=} untilElement Optional element where traversal should stop.\n * @returns {Array}\n */\nexport function elementParents(element, untilElement) {\n if (!isElement(element)) {\n throw new Error('DOMUtils - elementParents: invalid element argument');\n }\n const parentElements = [];\n while (element.parentElement) {\n parentElements.push(element.parentElement);\n if (element.parentElement === untilElement || element.parentElement === _ownerDocument(element).body) {\n break;\n }\n // pierce shadow DOM\n if (element.parentElement && element.parentElement.parentNode && element.parentElement.parentNode.nodeType === 11) {\n element = element.parentElement.parentNode.host;\n }\n else {\n element = element.parentElement;\n }\n }\n return parentElements;\n}\n/**\n * Gets the non-statically positioned parent of an element.\n * @param element The element to get the offset parent of.\n * @returns {Element}\n */\nexport function offsetParent(element) {\n if (!isElement(element)) {\n throw new Error('DOMUtils - offsetParent: invalid element argument');\n }\n let offsetParentElem = element.offsetParent;\n while (offsetParentElem && isPositionStatic(offsetParentElem)) {\n offsetParentElem = offsetParentElem.offsetParent;\n }\n return offsetParentElem || _ownerDocument(element).documentElement;\n}\n/**\n * Gets the browser scrollbar width.\n * @returns {number}\n */\nexport function scrollbarWidth() {\n if (SCROLLBAR_WIDTH === undefined) {\n const elem = document.createElement('div');\n elem.style.position = 'absolute';\n elem.style.top = '-100px';\n elem.style.left = '-100px';\n elem.style.width = '50px';\n elem.style.height = '50px';\n elem.style.overflow = 'scroll';\n document.body.appendChild(elem);\n const width = elem.offsetWidth - elem.clientWidth;\n removeElement(elem);\n SCROLLBAR_WIDTH = isFinite(width) ? width : 0;\n }\n return SCROLLBAR_WIDTH;\n}\n/**\n * Checks if an element is scrollable.\n * @param {Element} element The element to test for scrollability\n * @returns {boolean}\n */\nexport function isScrollable(element) {\n const elemStyle = window.getComputedStyle(element);\n return REGULAR_EXPRESSIONS.overflow.test('' + elemStyle.overflow + elemStyle.overflowY + elemStyle.overflowX);\n}\n/**\n * Gets the scroll parent of an element.\n * @param {Element} element The element to get the scroll parent of.\n * @param {boolean} [includeSelf=false] Should the element be checked for scrollability.\n * @returns {Element}\n */\nexport function scrollParent(element, includeSelf = false) {\n if (!isElement(element)) {\n throw new Error('DOMUtils - scrollParent: invalid element argument');\n }\n const docElem = _ownerDocument(element).documentElement;\n const elemStyle = window.getComputedStyle(element);\n if (includeSelf && REGULAR_EXPRESSIONS.overflow.test('' + elemStyle.overflow + elemStyle.overflowY + elemStyle.overflowX)) {\n return element;\n }\n let excludeStatic = elemStyle.position === 'absolute';\n let scrollParentElem = element.parentElement || docElem;\n if (scrollParentElem === docElem || elemStyle.position === 'fixed') {\n return scrollParentElem;\n }\n while (scrollParentElem && scrollParentElem !== docElem) {\n const scrollParentStyle = window.getComputedStyle(scrollParentElem);\n if (excludeStatic && scrollParentStyle.position !== 'static') {\n excludeStatic = false;\n }\n if (!excludeStatic && REGULAR_EXPRESSIONS.overflow.test('' + scrollParentStyle.overflow + scrollParentStyle.overflowY + scrollParentStyle.overflowX)) {\n break;\n }\n scrollParentElem = scrollParentElem.scrollParent;\n }\n return scrollParentElem || docElem;\n}\n/**\n * Checks if the elements scroll parent scrollbars are visible.\n * @param {Element} element The element to check the scroll parent of.\n * @returns {IScrollbarVisibility}\n */\nexport function isScrollbarVisible(element) {\n if (!isElement(element)) {\n throw new Error('DOMUtils - isDocumentScrolled: invalid element argument');\n }\n const scrollParentElem = scrollParent(element);\n return {\n x: scrollParentElem.scrollWidth > scrollParentElem.clientWidth,\n y: scrollParentElem.scrollHeight > scrollParentElem.clientHeight\n };\n}\n/**\n * Gets the offset from the element to the parent element edges.\n * If no parentElement is supplied, the documentElement will be used.\n * @param {Element} element The element to compute the offset for.\n * @param {Element=} parentElement Optional parent element to measure from.\n * @returns {DOMRect}\n */\nexport function offset(element, parentElement) {\n if (!isElement(element)) {\n throw new Error('DOMUtils - offset: invalid element argument');\n }\n const elemBCR = element.getBoundingClientRect();\n const win = _ownerDocument(element).defaultView;\n const docElem = parentElement || win.document.documentElement;\n const offsetValues = { width: elemBCR.width, height: elemBCR.width, top: 0, left: 0, bottom: 0, right: 0 };\n if (!parentElement || docElem === win.document.documentElement || docElem === win.document.body) {\n offsetValues.top = win.scrollY + elemBCR.top;\n offsetValues.bottom = docElem.clientHeight - win.scrollY - elemBCR.bottom;\n offsetValues.left = win.scrollX + elemBCR.left;\n offsetValues.right = docElem.clientWidth - win.scrollX - elemBCR.right;\n }\n else {\n if (!isElement(parentElement)) {\n throw new Error('DOMUtils - offset: invalid parentElement argument');\n }\n const parentBCR = parentElement.getBoundingClientRect();\n offsetValues.top = elemBCR.top - parentBCR.top;\n offsetValues.bottom = parentBCR.bottom - elemBCR.bottom;\n offsetValues.left = elemBCR.left - parentBCR.left;\n offsetValues.right = parentBCR.right - elemBCR.right;\n }\n return {\n width: Math.round(elemBCR.width),\n height: Math.round(elemBCR.height),\n top: Math.round(offsetValues.top),\n bottom: Math.round(offsetValues.bottom),\n left: Math.round(offsetValues.left),\n right: Math.round(offsetValues.right)\n };\n}\n/**\n * Gets the offset from the element to the parent element viewable edges.\n * If no parentElement is supplied, the documentElement will be used.\n * @param {Element} element The element to measure\n * @param {Element=} parentElement The parent element to measure to.\n * @returns {DOMRect}\n */\nexport function viewportOffset(element, parentElement) {\n if (!isElement(element)) {\n throw new Error('DOMUtils - offset: invalid element argument');\n }\n const win = _ownerDocument(element).defaultView;\n parentElement = parentElement || win.document.documentElement;\n const parentElementOffset = offset(element, parentElement);\n const offsetValues = {\n top: parentElementOffset.top,\n bottom: 0,\n left: parentElementOffset.left,\n right: 0\n };\n if (parentElement === win.document.documentElement) {\n offsetValues.top -= win.scrollY;\n offsetValues.left -= win.scrollX;\n }\n else {\n const parentStyle = window.getComputedStyle(parentElement);\n offsetValues.top -= parseStyle('' + parentStyle.borderTopWidth);\n offsetValues.left -= parseStyle('' + parentStyle.borderLeftWidth);\n }\n offsetValues.bottom = parentElement.clientHeight - offsetValues.top - element.offsetHeight;\n offsetValues.right = parentElement.clientWidth - offsetValues.left - element.offsetWidth;\n return {\n width: parentElementOffset.width,\n height: parentElementOffset.height,\n top: Math.round(offsetValues.top),\n bottom: Math.round(offsetValues.bottom),\n left: Math.round(offsetValues.left),\n right: Math.round(offsetValues.right)\n };\n}\n/**\n * Checks if any part of an element is visible in the viewport.\n * @param {Element} element The element to check.\n * @returns {boolean}\n */\nexport function isElementInViewport(element) {\n if (!isElement(element)) {\n throw new Error('DOMUtils - isElementInViewport: invalid element argument');\n }\n const document = _ownerDocument(element);\n const scrollParentElem = scrollParent(element);\n const elemBCR = element.getBoundingClientRect();\n if (scrollParentElem !== document.documentElement && scrollParentElem !== document.body) {\n const scrollParentOffset = offset(element, scrollParentElem);\n if (scrollParentOffset.top + elemBCR.height < 0 ||\n scrollParentOffset.left + elemBCR.width < 0 ||\n scrollParentOffset.bottom + elemBCR.height - this.scrollbarWidth < 0 ||\n scrollParentOffset.right + elemBCR.width - this.scrollbarWidth < 0) {\n return false;\n }\n }\n if (elemBCR.top + elemBCR.height < 0 ||\n elemBCR.left + elemBCR.width < 0 ||\n elemBCR.bottom + elemBCR.height > document.documentElement.clientHeight ||\n elemBCR.right + elemBCR.width > document.documentElement.clientWidth) {\n return false;\n }\n return true;\n}\n/**\n * Adds an event listener to the document that will call the provided callback function\n * when an element and it's children no longer have focus. The blur and touchstart events are used\n * to evaluate the active element to determine if the callback should be called.\n *\n * @param {Element} element The element to add the event listener to.\n * @param {Function} callback The function to call when the element and children don't have focus.\n * @param {boolean} [delay=false] Should a RAF cycle occur before the callback is called.\n * @returns {Function} The function to call to remove the document events.\n */\nexport function notChildEventListener(element, callback, delay) {\n const evtHandler = (event) => {\n const handle = () => {\n event.stopPropagation();\n if (event.cancelable) {\n event.preventDefault();\n }\n const activeElement = (event.type === 'touchstart' ? event.target : _ownerDocument(element).activeElement);\n if (!element.contains(activeElement)) {\n callback(activeElement);\n }\n };\n if (delay) {\n window.requestAnimationFrame(() => handle());\n }\n else {\n handle();\n }\n };\n const docElem = _ownerDocument(element);\n docElem.addEventListener('blur', evtHandler, true);\n docElem.addEventListener('touchstart', evtHandler, true);\n return () => {\n docElem.removeEventListener('blur', evtHandler, true);\n docElem.removeEventListener('touchstart', evtHandler, true);\n };\n}\n/**\n * Removes all children from a DOM node.\n * @param node The DOM node to remove children from.\n */\nexport function removeAllChildren(node) {\n while (node.lastChild) {\n node.removeChild(node.lastChild);\n }\n}\n/**\n * Replaces one child node of the specified node with another.\n * @param newChild The new node to replace `oldChild`.\n * @param oldChild The existing node to be replaced.\n * @returns {Node} The replaced node. Same node as `oldChild`.\n */\nexport function replaceElement(newChild, oldChild) {\n return oldChild.parentNode.replaceChild(newChild, oldChild);\n}\n/**\n * Adds a class or array of classes to an element.\n *\n * @param {string | string[]} name The class(es) to add to the element\n * @param {Element} element The element to add class(es) to.\n */\nexport function addClass(name, element) {\n if (isArray(name)) {\n name.forEach(n => element.classList.add(n));\n }\n else {\n element.classList.add(name);\n }\n}\n/**\n * Removes a class or array of classes to an element.\n *\n * @param {string | string[]} name The class(es) to remove from the element\n * @param {Element} element The element to remove class(es) from.\n */\nexport function removeClass(name, element) {\n if (isArray(name)) {\n name.forEach(n => element.classList.remove(n));\n }\n else {\n element.classList.remove(name);\n }\n}\n/** Determines which type of animation event is supported. */\nexport function getAnimationEvent() {\n const el = document.createElement('fakeelement');\n // tslint:disable:object-literal-key-quotes\n const animations = {\n 'animation': 'animationend',\n 'OAnimation': 'oAnimationEnd',\n 'MozAnimation': 'animationend',\n 'WebkitAnimation': 'webkitAnimationEnd'\n };\n for (const t in animations) {\n if (el.style[t] !== undefined) {\n return animations[t];\n }\n }\n}\n/**\n * A helper method to trigger a keyframe animation via adding a class, and removing the class when the animation completes.\n * @param {HTMLElement} element The element to play the animation on.\n * @param {string} className The class to add that triggers the animation.\n */\nexport async function playKeyframeAnimation(element, className, remove = true) {\n element.classList.add(className);\n return new Promise(resolve => {\n const animationEvent = getAnimationEvent();\n const animationCompletedListener = () => {\n if (remove) {\n element.classList.remove(className);\n }\n element.removeEventListener(animationEvent, animationCompletedListener);\n resolve();\n };\n element.addEventListener(animationEvent, animationCompletedListener);\n });\n}\n/**\n * Removes an element from the DOM using the available remove method for that platform.\n * @param {HTMLElement} element The element to remove.\n */\nexport function removeElement(element) {\n if (element.removeNode) {\n element.removeNode(true);\n }\n else if (element.remove) {\n element.remove();\n }\n else {\n element.parentNode.removeChild(element);\n }\n}\n/**\n * Returns a width string that is safe for css based on the provided input.\n * @param {string | number} width\n * @returns {string | undefined} A width safe for using in CSS.\n */\nexport function safeCssWidth(width) {\n if (typeof width === 'string') {\n if (width[width.length - 1] === '%') {\n return width;\n }\n else if (width.slice(-2) === 'px') {\n return width;\n }\n else if (Number(width) >= 0) {\n return `${width}px`;\n }\n }\n else if (typeof width === 'number') {\n if (width >= 0) {\n return `${width}px`;\n }\n }\n return undefined;\n}\n/**\n * Calculates the size of an element that is not attached to the DOM.\n * @param {HTMLElement} element The element to calc the size of.\n * @returns {width, height} The size of the element.\n */\nexport function calcSizeUnattached(element) {\n let container = document.createElement('div');\n container.style.position = 'absolute';\n container.style.top = '-99999px';\n container.style.left = '-99999px';\n container.style.visibility = 'hidden';\n container.appendChild(element.cloneNode(true));\n document.body.appendChild(container);\n const size = {\n width: container.scrollWidth,\n height: container.scrollHeight\n };\n removeElement(container);\n container = undefined;\n return size;\n}\n/**\n * Resolves a promise when the provided element has children.\n * @param {Element} element An element that does or will contain children.\n */\nexport function ensureChildren(element) {\n if (element.children.length) {\n return Promise.resolve();\n }\n return new Promise(resolve => {\n const observer = new MutationObserver(changes => {\n if (element.children.length) {\n observer.disconnect();\n resolve();\n }\n });\n observer.observe(element, { childList: true });\n });\n}\n/**\n * Resolves a promise when the provided element has a child that matches a given selector.\n * @param {Element} element An element that does or will contain children.\n * @param {string} selector A CSS selector to use for finding an element.\n */\nexport function ensureChild(element, selector) {\n const initialElements = deepQuerySelectorAll(element, selector);\n if (initialElements.length) {\n return Promise.resolve(initialElements[0]);\n }\n return new Promise(resolve => {\n const observer = new MutationObserver(changes => {\n const hasAddedNodes = changes.reduce((prev, curr) => prev + curr.addedNodes.length, 0) > 0;\n if (hasAddedNodes) {\n const foundElements = deepQuerySelectorAll(element, selector);\n if (foundElements.length) {\n observer.disconnect();\n resolve(foundElements[0]);\n }\n }\n });\n observer.observe(element, { childList: true, subtree: true });\n });\n}\n/**\n * Resolves a promise when the provided host element has an `<input>` element child\n * @param {HTMLElement} host An element that does or will contain children.\n */\nexport function ensureInputElement(host) {\n return new Promise(resolve => {\n const element = host.querySelector('input');\n if (element) {\n resolve(element);\n }\n const observer = new MutationObserver(changes => {\n const hasAddedNodes = changes.reduce((prev, curr) => prev + curr.addedNodes.length, 0) > 0;\n if (hasAddedNodes) {\n const foundElement = host.querySelector('input');\n if (foundElement) {\n observer.disconnect();\n resolve(foundElement);\n }\n }\n });\n observer.observe(host, { childList: true, subtree: true });\n });\n}\n/**\n * Walks up the tree starting a specific node and stops when the provided matcher function returns true.\n * @param {Node} node The node to start searching from.\n * @returns {Node | null} The closest matching ancestor node, or null if not found.\n */\nexport function walkUpUntil(node, matcher) {\n let parent = node && node.parentNode;\n while (parent) {\n if (matcher(parent)) {\n return parent;\n }\n parent = parent.parentNode;\n }\n return null;\n}\n/**\n * Calculates the width of a string given the provided font information.\n */\nexport function calculateFontWidth(value, info) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n const fontSize = info ? info.fontSize : 16;\n const fontFamily = info ? info.fontFamily : 'Roboto';\n ctx.font = `${fontSize}px ${fontFamily}`;\n return ctx.measureText(value).width;\n}\n/**\n * Generates a CSS text-shadow style value based on the number of iterations and color provided.\n * @param {number} iterations The number of iterations for how long the shadow should be.\n * @param {string} color The color of the text shadow. Can be any CSS-safe color format. Ex. hex, rgb, rgba, hsl... etc.\n */\nexport function generateTextShadow(iterations, color) {\n const shadows = [];\n for (let i = 1; i <= iterations; i++) {\n shadows.push(`${i}px ${i}px ${color}`);\n }\n return shadows.join(', ');\n}\n/**\n * Checks if an element matches any of the provided selectors.\n * @param {Element} el The element to match.\n * @param {string[]} selectors The selectors to check the element against.\n */\nexport function matchesSelectors(el, selectors) {\n if (el.nodeType !== Node.ELEMENT_NODE) {\n return false;\n }\n if (typeof selectors === 'string') {\n selectors = selectors.replace(/\\s+/, '').split(',');\n }\n const matchesFn = Element.prototype.matches;\n return selectors.some(selector => matchesFn.call(el, selector));\n}\n/**\n * Walks the DOM tree starting at a root element and checks if any of its children\n * match the provided selectors. Similar to the native `querySelectorAll` except\n * that it will traverse the shadow DOM as well as slotted nodes.\n * @param {Element} rootElement The element to start querying from.\n * @param {string[]} selectors An array of CSS selectors.\n * @param {boolean} [checkRootElement] True if the provided root element is to be matched against the selectors.\n */\nexport function deepQuerySelectorAll(rootElement, selectors, checkRootElement = false) {\n let nodes = [];\n if (!rootElement) {\n return nodes;\n }\n if (typeof selectors === 'string') {\n selectors = selectors.replace(/\\s+/, '').split(',');\n }\n if (checkRootElement && matchesSelectors(rootElement, selectors) && nodes.indexOf(rootElement) === -1) {\n nodes.push(rootElement);\n }\n if (rootElement.tagName === 'SLOT') {\n const slotNodes = rootElement.assignedNodes();\n slotNodes.forEach(slottedNode => nodes = nodes.concat(deepQuerySelectorAll(slottedNode, selectors, true)));\n }\n else {\n let node = rootElement.shadowRoot ? rootElement.shadowRoot.firstElementChild : rootElement.firstElementChild;\n while (node) {\n nodes = nodes.concat(deepQuerySelectorAll(node, selectors, true));\n node = node.nextElementSibling;\n }\n }\n return nodes;\n}\n/**\n * Gets the currently focused element within the document by also traversing shadow roots.\n * @param {Document} doc The document to get the active element from. Defaults to the current document.\n * @returns {Element}\n */\nexport function getActiveElement(doc = document) {\n const activeElement = doc.activeElement;\n if (!activeElement || activeElement === doc.body) {\n return activeElement;\n }\n return getActiveShadowElement(activeElement);\n}\n/**\n * Gets the active element within the provided elements shadow root. If the element\n * does not have a shadow root, the provided element is returned.\n * @param {Element} element The active element.\n */\nexport function getActiveShadowElement(element) {\n if (element.shadowRoot && element.shadowRoot.activeElement) {\n element = getActiveShadowElement(element.shadowRoot.activeElement);\n }\n return element;\n}\n/** Toggles a CSS class (or classes) on an element based on a boolean. */\nexport function toggleClass(el, hasClass, className) {\n if (hasClass) {\n addClass(className, el);\n }\n else {\n removeClass(className, el);\n }\n}\n/** Toggles a value-less attribute on an element. */\nexport function toggleAttribute(el, hasAttribute, name, value = '') {\n if (hasAttribute) {\n el.setAttribute(name, value);\n }\n else {\n el.removeAttribute(name);\n }\n}\n/** Toggles part of an attribute on an element. */\nexport function toggleOnAttribute(el, attribute, value, force) {\n const oldValue = el.getAttribute(attribute);\n if ((force === undefined || force === true) && (!oldValue || !oldValue.includes(value))) {\n appendToAttribute(el, attribute, value);\n }\n else if (!force) {\n removeFromAttribute(el, attribute, value);\n }\n}\n/** Appends a value to an attribute on an element, first setting it if it doesn't exist. */\nexport function appendToAttribute(el, attribute, value) {\n const oldValue = el.getAttribute(attribute);\n if (!oldValue || !oldValue.length) {\n el.setAttribute(attribute, value);\n }\n else {\n el.setAttribute(attribute, `${oldValue} ${value}`);\n }\n}\n/** Removes a value from an attribute on an element, removing the attribute if empty. */\nexport function removeFromAttribute(el, attribute, value) {\n if (!el.hasAttribute(attribute)) {\n return;\n }\n const oldValue = el.getAttribute(attribute);\n if (oldValue) {\n let newValue = oldValue === null || oldValue === void 0 ? void 0 : oldValue.replace(value, '');\n newValue = newValue.replace(/\\s+/g, ' ').trim();\n if (newValue.length) {\n el.setAttribute(attribute, newValue);\n }\n else {\n el.removeAttribute(attribute);\n }\n }\n}\n/**\n * Attempts to scroll a target element into view within a scrollable parent element, unless already visible within the container.\n * @param scrollElement The scrollable parent element.\n * @param targetElement The element to scroll into view.\n * @param behavior The scroll behavior. Defaults to 'auto'.\n * @param block The block position to anchor the target element to within the scroll element.\n */\nexport function tryScrollIntoView(scrollElement, targetElement, behavior = 'auto', block = 'nearest') {\n if (!scrollElement) {\n return;\n }\n const canScroll = scrollElement.scrollHeight > scrollElement.clientHeight || scrollElement.scrollWidth > scrollElement.clientWidth;\n if (canScroll) {\n const offsetRect = offset(targetElement, scrollElement);\n const isClippedTop = offsetRect.top <= targetElement.clientHeight;\n const isClippedBottom = offsetRect.bottom <= targetElement.clientHeight;\n if (isClippedTop || isClippedBottom) {\n const top = calcBlockScroll(block, isClippedTop, targetElement.offsetTop, targetElement.clientHeight, scrollElement.offsetTop, scrollElement.offsetHeight);\n scrollElement.scrollTo({ top, behavior });\n return;\n }\n const isClippedLeft = offsetRect.left <= targetElement.clientWidth;\n const isClippedRight = offsetRect.right <= targetElement.clientWidth;\n if (isClippedLeft || isClippedRight) {\n const left = calcBlockScroll(block, isClippedLeft, targetElement.offsetLeft, targetElement.clientWidth, scrollElement.offsetLeft, scrollElement.offsetWidth);\n scrollElement.scrollTo({ left, behavior });\n }\n }\n}\n/** Calculates the block anchor position for a target element within a scrollable parent element. */\nexport function calcBlockScroll(block, isClippedStart, targetOffset, targetSize, scrollOffset, scrollSize) {\n if (block === 'nearest') {\n if (isClippedStart) {\n return (targetOffset - scrollOffset) - targetSize;\n }\n return (targetOffset - scrollSize) + targetSize * 2;\n }\n return targetOffset - scrollOffset - scrollSize / 2 + targetSize / 2;\n}\n/**\n * Creates an element from an HTML string.\n */\nexport function elementFromHTML(html) {\n const template = document.createElement('template');\n html = html.trim();\n template.innerHTML = html;\n return template.content.firstElementChild;\n}\n/**\n * Observes changes to the provided attributes on a target element and executes a provided callback when changed.\n * @param element The element to observe.\n * @param listener The callback to execute when an attribute changes on the element.\n * @param attributeFilter The attributes to observe.\n * @returns A `MutationObserver` instasnce.\n */\nexport function createElementAttributeObserver(element, listener, attributeFilter) {\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (mutation.attributeName) {\n listener(mutation.attributeName, element.getAttribute(mutation.attributeName));\n }\n }\n });\n observer.observe(element, { attributes: true, attributeFilter });\n return observer;\n}\n"],
5
+ "mappings": "wCAwBA,SAASA,EAAeC,EAAS,CAC7B,OAAOA,EAAQ,eAAiB,QACpC,CAoBO,SAASC,EAAUC,EAAS,CAC/B,OAAOA,GAAWA,EAAQ,WAAa,CAC3C,CAyCO,SAASC,EAAeC,EAASC,EAAc,CAClD,GAAI,CAACC,EAAUF,CAAO,EAClB,MAAM,IAAI,MAAM,qDAAqD,EAEzE,IAAMG,EAAiB,CAAC,EACxB,KAAOH,EAAQ,gBACXG,EAAe,KAAKH,EAAQ,aAAa,EACrC,EAAAA,EAAQ,gBAAkBC,GAAgBD,EAAQ,gBAAkBI,EAAeJ,CAAO,EAAE,QAI5FA,EAAQ,eAAiBA,EAAQ,cAAc,YAAcA,EAAQ,cAAc,WAAW,WAAa,GAC3GA,EAAUA,EAAQ,cAAc,WAAW,KAG3CA,EAAUA,EAAQ,cAG1B,OAAOG,CACX,CAmGO,SAASE,EAAOC,EAASC,EAAe,CAC3C,GAAI,CAACC,EAAUF,CAAO,EAClB,MAAM,IAAI,MAAM,6CAA6C,EAEjE,IAAMG,EAAUH,EAAQ,sBAAsB,EACxCI,EAAMC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AAMQ,EAAgBN,EAAW,MAAQH,EAAc,YACjDU,EAAiBP,EAAW,OAASH,EAAc,YACzD,GAAIS,GAAiBC,EAAgB,CACjC,IAAMC,EAAOH,EAAgBN,EAAOO,EAAeT,EAAc,WAAYA,EAAc,YAAaD,EAAc,WAAYA,EAAc,WAAW,EAC3JA,EAAc,SAAS,CAAE,KAAAY,EAAM,SAAAV,CAAS,CAAC,GAGrD,CAEO,SAASO,EAAgBN,EAAOU,EAAgBC,EAAcC,EAAYC,EAAcC,EAAY,CACvG,OAAId,IAAU,UACNU,EACQC,EAAeE,EAAgBD,EAEnCD,EAAeG,EAAcF,EAAa,EAE/CD,EAAeE,EAAeC,EAAa,EAAIF,EAAa,CACvE,CAIO,SAASG,EAAgBC,EAAM,CAClC,IAAMC,EAAW,SAAS,cAAc,UAAU,EAClD,OAAAD,EAAOA,EAAK,KAAK,EACjBC,EAAS,UAAYD,EACdC,EAAS,QAAQ,iBAC5B,CAQO,SAASC,EAA+BtC,EAASuC,EAAUC,EAAiB,CAC/E,IAAMC,EAAW,IAAI,iBAAiBC,GAAa,CAC/C,QAAWC,KAAYD,EACfC,EAAS,eACTJ,EAASI,EAAS,cAAe3C,EAAQ,aAAa2C,EAAS,aAAa,CAAC,CAGzF,CAAC,EACD,OAAAF,EAAS,QAAQzC,EAAS,CAAE,WAAY,GAAM,gBAAAwC,CAAgB,CAAC,EACxDC,CACX",
6
+ "names": ["_ownerDocument", "element", "isElement", "element", "elementParents", "element", "untilElement", "isElement", "parentElements", "_ownerDocument", "offset", "element", "parentElement", "isElement", "elemBCR", "win", "_ownerDocument", "docElem", "offsetValues", "parentBCR", "notChildEventListener", "element", "callback", "delay", "evtHandler", "event", "handle", "activeElement", "_ownerDocument", "docElem", "removeAllChildren", "node", "replaceElement", "newChild", "oldChild", "addClass", "name", "isArray", "n", "removeClass", "getAnimationEvent", "el", "animations", "t", "playKeyframeAnimation", "className", "remove", "resolve", "animationEvent", "animationCompletedListener", "removeElement", "safeCssWidth", "width", "calcSizeUnattached", "container", "size", "ensureChildren", "observer", "changes", "ensureChild", "selector", "initialElements", "deepQuerySelectorAll", "prev", "curr", "foundElements", "walkUpUntil", "node", "matcher", "parent", "calculateFontWidth", "value", "info", "ctx", "fontSize", "fontFamily", "generateTextShadow", "iterations", "color", "shadows", "i", "matchesSelectors", "el", "selectors", "matchesFn", "selector", "deepQuerySelectorAll", "rootElement", "checkRootElement", "nodes", "slottedNode", "getActiveElement", "doc", "activeElement", "getActiveShadowElement", "element", "toggleClass", "hasClass", "className", "addClass", "removeClass", "toggleAttribute", "hasAttribute", "name", "toggleOnAttribute", "attribute", "force", "oldValue", "appendToAttribute", "removeFromAttribute", "newValue", "tryScrollIntoView", "scrollElement", "targetElement", "behavior", "block", "offsetRect", "offset", "isClippedTop", "isClippedBottom", "top", "calcBlockScroll", "isClippedLeft", "isClippedRight", "left", "isClippedStart", "targetOffset", "targetSize", "scrollOffset", "scrollSize", "elementFromHTML", "html", "template", "createElementAttributeObserver", "listener", "attributeFilter", "observer", "mutations", "mutation"]
7
7
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ import{d as at}from"./chunk.YWNCJ7XP.js";import{a as rt}from"./chunk.LIKJD4SK.js";import{h as st}from"./chunk.QCRRHGBA.js";import{c as et}from"./chunk.F4VXEE76.js";import{e as tt}from"./chunk.HHCO64F3.js";import{e as it}from"./chunk.7CGKFRBK.js";import{a as f,b as nt}from"./chunk.OWCYRSI3.js";import{a as F}from"./chunk.MGLWXAZO.js";import{a as C,b as ot}from"./chunk.MXEKIEJA.js";import{j as K}from"./chunk.FYWPZFLJ.js";import{a as Q,d as Z,l as E}from"./chunk.PH3HUFJJ.js";import{g as J}from"./chunk.XIQFHO5R.js";import{j as b,k as X,n as G,o as q,p as Y,q as j}from"./chunk.DMCBAYQX.js";import{a as $}from"./chunk.KVCDAZ6B.js";import{a as u}from"./chunk.NVUMRW44.js";import{a as W}from"./chunk.BKL2BAYW.js";import{a as R,b as z}from"./chunk.DXN7ZOH3.js";import{a as N,e as H,f as V,h as U,k as B}from"./chunk.MVTBJPO2.js";import{m as A,s as P,u as x}from"./chunk.K7FPXAFS.js";import{a as D,k as m,l as y,o as L}from"./chunk.J2M2MXP2.js";import{a as w,d as p}from"./chunk.M3QDAYD2.js";var h=`${z}time-picker`,lt={TOGGLE:"forge-time-picker-toggle",VALUE:"value",OPEN:"open",ALLOW_SECONDS:"allow-seconds",MASKED:"masked",SHOW_MASK_FORMAT:"show-mask-format",USE_24_HOUR_TIME:"use-24-hour-time",ALLOW_INVALID_TIME:"allow-invalid-time",MIN:"min",MAX:"max",START_TIME:"start-time",STEP:"step",ALLOW_INPUT:"allow-input",SHOW_NOW:"show-now",SHOW_HOUR_OPTIONS:"show-hour-options",DISABLED:"disabled",POPUP_CLASSES:"popup-classes",ALLOW_DROPDOWN:"allow-dropdown"},ft={INPUT:"input, input[forge-time-picker-input]",TOGGLE:`[${lt.TOGGLE}]`},gt={OPEN:`${h}-open`,CLOSE:`${h}-close`,INPUT:`${h}-input`,CHANGE:`${h}-change`},vt={DEFAULT_MINUTE_STEP:60,MAX_DAY_MILLIS:864e5,MAX_DAY_MINUTES:1440},s={elementName:h,attributes:lt,selectors:ft,events:gt,numbers:vt};var g=class extends W{constructor(e){super(e)}initialize(){this._inputElement=this._component.querySelector(s.selectors.INPUT)}initializeMask(e){this.destroyMask(),this._inputMask=new J(this._inputElement,e)}destroy(){this._targetElement=void 0,this._toggleElement=void 0,this._inputElement=void 0}destroyMask(){var e;(e=this._inputMask)==null||e.destroy(),this._inputMask=void 0}initializeAccessibility(e){this._inputElement.setAttribute("autocomplete","off"),this._inputElement.setAttribute("autocorrect","off"),this._inputElement.setAttribute("autocapitalize","off"),this._inputElement.setAttribute("spellcheck","false"),this._inputElement.setAttribute("role","combobox"),this._inputElement.setAttribute("aria-live","assertive"),this._inputElement.setAttribute("aria-atomic","true"),this._inputElement.setAttribute("aria-haspopup","true"),this._inputElement.setAttribute("aria-expanded","false")}addInputListener(e,i,n){this._inputElement.addEventListener(e,i,{capture:n})}removeInputListener(e,i,n){this._inputElement&&this._inputElement.removeEventListener(e,i,{capture:n})}addToggleListener(e,i){this._toggleElement&&this._toggleElement.addEventListener(e,i)}removeToggleListener(e,i){this._toggleElement&&this._toggleElement.removeEventListener(e,i)}hasInputElement(){return!!this._inputElement}tryCreateToggle(){let e=this._component.querySelector(f.elementName),i=this._component.querySelector(s.selectors.TOGGLE);if(e){let n=e.querySelector(`${C.elementName}[slot=trailing]`);if(n||i){this._toggleElement=n||i;return}let a=document.createElement(C.elementName);a.slot="trailing",a.dense=!0,a.densityLevel=3,a.style.marginRight="4px";let r=document.createElement("button");r.type="button",r.tabIndex=-1,r.setAttribute("aria-label","Toggle time dropdown");let d=document.createElement(Q.elementName);d.name="clock_outline",r.appendChild(d),a.appendChild(r),e.appendChild(a),this._toggleElement=a}else i&&(this._toggleElement=i)}tryFocusInput(){this._inputElement.select()}tryBlurInput(){this._inputElement.blur()}selectInputText(){this._inputElement.select()}isInputDisabled(){return this._inputElement.disabled}isInputFocused(){return P(this._component.ownerDocument)===this._inputElement}setInputValue(e,i){this._inputElement.value!==e&&(this._inputElement.value=e,this._inputMask&&this._inputMask.update(),i&&(this._emitInputEvent("change"),this._emitInputEvent("input")))}getInputValue(){return this._inputMask?this._inputMask.maskedValue:this._inputElement.value}setDisabled(e){this._inputElement.disabled=e,this._inputElement.setAttribute("aria-disabled",e.toString()),this.setToggleDisabled(e)}attachDropdown(e){this._listDropdown=new st(this._inputElement,e),this._listDropdown.open(),this._inputElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`)}detachDropdown(){this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0),this._inputElement.removeAttribute("aria-controls")}propagateKey(e){var i;(i=this._listDropdown)==null||i.handleKey(e)}setActiveDescendant(e){x(this._inputElement,!!e,"aria-activedescendant",e)}getTargetElementWidth(e){return this._getTargetElement(e).getBoundingClientRect().width}_emitInputEvent(e){this._inputElement.dispatchEvent(new Event(e))}emitInputEvent(e,i){U(this._inputElement,e,i)}setInputReadonly(e){this._inputElement.readOnly=e}setToggleDisabled(e){if(this._toggleElement)if(this._toggleElement.setAttribute("aria-disabled",e.toString()),"disabled"in this._toggleElement)this._toggleElement.disabled=e;else{let i=this._toggleElement.querySelector("button");i&&(i.disabled=e)}}hasActiveOption(){var e,i;return((i=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?i:-1)>=0}activateOptionByIndex(e){var i;(i=this._listDropdown)==null||i.activateOption(e)}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}getActiveOption(){var e;return(e=this._listDropdown)==null?void 0:e.getActiveOption()}_getTargetElement(e){return this._targetElement?this._targetElement:(this._targetElement=e?this._component.querySelector(e)||this._getDefaultTargetElement():this._getDefaultTargetElement(),this._targetElement)}_getDefaultTargetElement(){let e=this._component.querySelector(f.elementName);if(e&&e.shadowRoot){let i=V(e,f.selectors.ROOT);if(i)return i}return this._component}};function v(o,t,e){if(!o||/^\s*$/.test(o))return null;let i=0,n=0,a=0;if(b.test(o)){let r=G(o);i=+r.hours||0,n=+r.minutes||0,a=+r.seconds||0}else if(X.test(o)){let r=q(o);i=+r.hours||0,n=+r.minutes||0,a=+r.seconds||0,i===12&&r.meridiem==="AM"&&(i=0),i<12&&r.meridiem==="PM"&&(i+=12)}else return null;return dt(i)+T(n)+(e?O(a):0)}function c(o,t,e){if(typeof o!="number"||o<0)return null;let i=Math.min(pt(o),23),n=Math.min(ut(o),59),r=o/(1e3*60)<720?"AM":"PM";t||(i=i<=12?i:i-12,i===0&&(i=12));let d=`${String(i).padStart(2,"0")}:${String(n).padStart(2,"0")}`;if(e){let _=Math.min(M(o),59);d+=`:${String(_).padStart(2,"0")}`}return t||(d+=` ${r}`),d}function pt(o){return Math.abs(Math.floor(o/(1e3*60*60)))}function ut(o){return Math.abs(Math.floor(I(o)%60))}function I(o){return o/(1e3*60)}function M(o){return Math.abs(Math.floor(It(o)%60))}function It(o){return o/1e3}function dt(o){return o*60*60*1e3}function T(o){return o*60*1e3}function O(o){return o*1e3}function ct(o){return o-O(M(o))}function S(o){let t=new Date,e=t.getHours(),i=t.getMinutes();return dt(e)+T(i)+(o?O(t.getSeconds()):0)}function Rt(o,t,e=!1){o||(o=new Date);let i=v(t,!0,e);if(!i)return o.setHours(0,0,0),o;let n=pt(i),a=828e5;n>a?n=a:n<0&&(n=0);let r=ut(i),d=e?M(i):0;return o.setHours(n,r,d),o}var k=class{constructor(t){this._adapter=t;this._value=null;this._masked=!0;this._use24HourTime=!1;this._showMaskFormat=!1;this._min=null;this._max=null;this._restrictedTimes=[];this._startTime=null;this._step=s.numbers.DEFAULT_MINUTE_STEP;this._allowInput=!0;this._open=!1;this._allowSeconds=!1;this._allowInvalidTime=!1;this._showNow=!1;this._showHourOptions=!0;this._customOptions=[];this._disabled=!1;this._popupClasses=[];this._allowDropdown=!0;this._isInitialized=!1;this._identifier=D(),this._inputListener=e=>this._onInput(e),this._inputKeydownListener=e=>this._onInputKeydown(e),this._toggleMousedownListener=e=>this._onToggleMousedown(e),this._inputFocusListener=e=>this._onInputFocus(e),this._inputBlurListener=e=>this._onInputBlur(e),this._inputMousedownListener=e=>this._onInputMousedown(e)}initialize(){if(this._adapter.initialize(),!this._adapter.hasInputElement())throw new Error("Unable to locate <input> element to attach to.");if(this._adapter.initializeAccessibility(this._identifier),!this._value){let t=this._adapter.getInputValue();this._setValue(this._convertTimeStringToMillis(t,this._use24HourTime,this._allowSeconds))}this._adapter.addInputListener("focus",this._inputFocusListener),this._adapter.addInputListener("blur",this._inputBlurListener),this._adapter.addInputListener("keydown",this._inputKeydownListener,!0),this._formatInputValue(!1),typeof this._value=="number"&&this._applyValue(this._value,!1),this._applyAllowInput(),this._applyAllowDropdown(),this._applyDisabled(),this._applyMask(),this._isInitialized=!0}disconnect(){this._isInitialized=!1,this._adapter.removeInputListener("input",this._inputListener),this._adapter.removeInputListener("focus",this._inputFocusListener),this._adapter.removeInputListener("blur",this._inputBlurListener),this._adapter.removeToggleListener("mousedown",this._toggleMousedownListener),this._adapter.removeInputListener("keydown",this._inputKeydownListener,!0),this._masked&&this._adapter.destroyMask(),this._closeDropdown(),this._adapter.destroy()}_onInput(t){this._handleInput(this._adapter.getInputValue())}_onInputKeydown(t){var e,i;if(t.shiftKey)switch(t.code){case"Backspace":case"Delete":t.preventDefault(),this._trySetValue(null)&&this._formatInputValue();return}switch(t.code){case"Tab":this._open&&this._selectActiveOption();break;case"Esc":case"Escape":this._open&&(t.preventDefault(),t.stopPropagation(),this._closeDropdown(!0));break;case"Down":case"ArrowDown":this._allowDropdown&&(t.preventDefault(),this._open?this._adapter.hasActiveOption()?this._adapter.propagateKey(t.code):this._trySetActiveOption():(this._openDropdown(),typeof((e=this._dropdownConfig)==null?void 0:e.visibleStartIndex)=="number"&&this._dropdownConfig.visibleStartIndex>=0?this._adapter.activateOptionByIndex((i=this._dropdownConfig)==null?void 0:i.visibleStartIndex):this._adapter.activateFirstOption()));break;case"ArrowUp":this._allowDropdown&&(t.preventDefault(),this._open&&(this._adapter.hasActiveOption()?this._adapter.propagateKey(t.code):this._trySetActiveOption()));break;case"Enter":case"NumpadEnter":case"Home":case"End":this._open&&((t.code==="Enter"||t.code==="NumpadEnter")&&t.stopPropagation(),t.preventDefault(),this._adapter.propagateKey(t.code));break;case"KeyN":t.preventDefault();let n=S(this._allowSeconds);if(this._value!==n){let a=c(n,!0,this._allowSeconds);this._emitChangeEvent(a)&&(this._applyValue(n),this._selectInputText())}break}}_trySetActiveOption(){var t,e;!this._adapter.hasActiveOption()&&typeof((t=this._dropdownConfig)==null?void 0:t.visibleStartIndex)=="number"&&this._dropdownConfig.visibleStartIndex>=0&&this._adapter.activateOptionByIndex((e=this._dropdownConfig)==null?void 0:e.visibleStartIndex)}_selectActiveOption(){let t=this._adapter.getActiveOption();t&&this._onSelect(t.value)}_onToggleMousedown(t){this._disabled||!this.allowDropdown||(t.stopPropagation(),!this._adapter.isInputDisabled()&&(t.preventDefault(),this._open?this._closeDropdown(!0):(F.isMobile?this._adapter.tryBlurInput():this._adapter.tryFocusInput(),this._openDropdown())))}_onInputFocus(t){this._allowInput&&this._adapter.selectInputText(),this.masked&&this._showMaskFormat&&this._applyMask()}_onInputBlur(t){this.masked&&this._showMaskFormat&&this._applyMask(),this._formatInputValue(),this._open&&!this._adapter.isInputFocused()&&this._closeDropdown(!0)}_onInputMousedown(t){!this._allowInput&&!this._open&&(this._openDropdown(),this._adapter.tryFocusInput(),window.requestAnimationFrame(()=>this._adapter.selectInputText()))}_applyDisabled(){this._adapter.setDisabled(this._disabled)}_applyMask(){if(this._masked&&this._allowInput){this._adapter.destroyMask();let t={showMaskFormat:this._showMaskFormat&&this._adapter.isInputFocused(),use24HourTime:this._use24HourTime,showSeconds:this._allowSeconds,prepareCallback:this._prepareMaskCallback,onChange:L(e=>this._handleInput(e),0,!0)};this._adapter.initializeMask(t)}else this._adapter.destroyMask(),this._formatInputValue()}_applyAllowInput(){this._adapter.setInputReadonly(!this._allowInput),this._allowInput?(this._adapter.removeInputListener("mousedown",this._inputMousedownListener),this._masked||this._adapter.addInputListener("input",this._inputListener)):(this._adapter.addInputListener("mousedown",this._inputMousedownListener),this._adapter.removeInputListener("input",this._inputListener))}_applyAllowDropdown(){this._adapter.setToggleDisabled(!this._allowDropdown),this._allowDropdown?(this._adapter.removeToggleListener("mousedown",this._toggleMousedownListener),this._adapter.tryCreateToggle(),this._adapter.addToggleListener("mousedown",this._toggleMousedownListener)):this._open&&this._closeDropdown(!0)}_applyAllowSeconds(){let t=this._value;if(this._allowSeconds){if(this._isInitialized&&t!==this._value){let e=c(this._value,!0,!0);this._emitChangeEvent(e)}}else{if(typeof this._value!="number")return;if(this._setValue(ct(this._value)),this._isInitialized&&t!==this._value){let e=c(this._value,!0,!1);this._emitChangeEvent(e)}}}_handleInput(t){let e=t;if(!this._allowInput)return;this._open&&this._closeDropdown(!0),t=j(t,this._use24HourTime,this._allowSeconds),typeof this._coercionCallback=="function"&&(t=this._coercionCallback.call(null,e,t,this._allowSeconds)),this._isValidTimeFormat(t)||(t="");let i;!this._masked&&typeof this._parseCallback=="function"?i=this._parseCallback.call(null,t):i=this._convertTimeStringToMillis(t,this._use24HourTime,this._allowSeconds),i=this._validateMillis(i),this._trySetValue(i)}_emitChangeEvent(t,e=!1){return this._adapter.emitHostEvent(s.events.CHANGE,t,!0,!e)}_trySetValue(t){if(t===this._value)return!1;let e=c(t,!0,this._allowSeconds);return this._adapter.emitInputEvent(s.events.INPUT,e),this._value!==t&&this._emitChangeEvent(e)?(this._setValue(t),!0):!1}_setValue(t){this._value=this._normalizeTimeValue(t)}_validateMillis(t){if(typeof t=="number"){let e=typeof this._min=="number"&&t<this._min,i=typeof this._max=="number"&&t>this._max;(e||i)&&(t=null)}return typeof t=="number"&&this._restrictedTimes.length&&this._restrictedTimes.includes(t)&&(t=null),t}_isValidTimeFormat(t){return!this._masked&&typeof this._validationCallback=="function"?this._validationCallback.call(this,t):Y(t)}_isValidInputValue(t){return b.test(t)}_onSelect(t){if(this._closeDropdown(!0),!t.isCustom&&t.metadata==="now"&&(t.time=S(this._allowSeconds)),t.isCustom)if(typeof t.customCallback=="function"){let n=t.customCallback.call(null,t.metadata);if(typeof n!="number")throw new Error("Custom options must provide a time of day value in milliseconds.");t.time=n}else throw new Error("You must implement a `toMilliseconds` callback that returns the time value to use for this custom option.");if(this._value===t.time)return;let e=c(t.time,!0,this._allowSeconds);this._emitChangeEvent(e)&&(this._applyValue(t.time),this._selectInputText())}_selectInputText(){window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{this._adapter.isInputFocused()&&this._adapter.selectInputText()})})}_applyValue(t,e=!0){this._setValue(t);let i=this._formatValue(this._value);this._adapter.getInputValue()!==i&&this._adapter.setInputValue(i,e)}_normalizeTimeValue(t){return t==null?null:t<0?0:t>s.numbers.MAX_DAY_MILLIS?s.numbers.MAX_DAY_MILLIS:t}_openDropdown(){let t=this._generateTimeOptions();if(!this.allowDropdown||!t.length)return;this._formatInputValue(),this._open=!0,this._adapter.setHostAttribute(s.attributes.OPEN);let e=t.filter(a=>!a.divider&&!a.disabled),i=[],n=0;if(t.length)if(this._value!=null){let a=this._findClosestOptionIndex(this._value,e);a>=0&&(e[a].value.time===this._value?i=[e[a].value]:n=a)}else if(typeof this._startTime=="number"){let a=this._findClosestOptionIndex(this._startTime,e);a>=0&&a<e.length&&(n=a)}else this._startTime==null&&(n=this._getOptionIndexClosestCurrent(e));this._dropdownConfig={id:`forge-time-picker-${this._identifier}`,selectedValues:i,syncWidth:!0,visibleStartIndex:n,popupClasses:this._popupClasses,popupStatic:!0,type:"standard",options:t,selectCallback:a=>this._onSelect(a),closeCallback:()=>this._closeDropdown(!0),activeChangeCallback:a=>this._adapter.setActiveDescendant(a),targetWidthCallback:()=>this._adapter.getTargetElementWidth(this._popupTarget)},this._adapter.attachDropdown(this._dropdownConfig),this._adapter.emitHostEvent(s.events.OPEN,void 0,!1)}_closeDropdown(t=!1){this._open=!1,this._dropdownConfig=void 0,this._adapter.removeHostAttribute(s.attributes.OPEN),this._adapter.detachDropdown(),t&&this._adapter.emitHostEvent(s.events.CLOSE,!0,!1)}_getOptionIndexClosestCurrent(t){let e=new Date,i=`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,n=v(i,!0,!1);return this._findClosestOptionIndex(n,t)}_findClosestOptionIndex(t,e){let i=e.reduce((n,a)=>Math.abs((a.value.time||0)-t)<Math.abs((n.value.time||0)-t)?a:n);return e.indexOf(i)}_formatInputValue(t=!0){let e=this._adapter.getInputValue();if(this._allowInvalidTime&&!this._masked&&e&&!this._value)return;let i=this._formatValue(this._value);e!==i&&(this._adapter.setInputValue(i,t),this._adapter.emitInputEvent(s.events.INPUT,i))}_generateTimeOptions(){let t=this._min!=null?Math.max(I(this._min),0):0,e=this._max!=null?Math.min(I(this._max),s.numbers.MAX_DAY_MINUTES):s.numbers.MAX_DAY_MINUTES,i=this._step,n=[],a=[];if(this._showHourOptions){for(let d=t;d<=e&&d!==s.numbers.MAX_DAY_MINUTES;d+=i){let _=T(d),_t=this._restrictedTimes.includes(_),ht=c(_,this._use24HourTime,!1)||"",bt={time:_};n.push({label:ht,value:bt,disabled:_t})}let r=n.findIndex(d=>d.value.time/1e3/60>=720);r>=0&&r<n.length-1&&n.splice(r,0,{label:"",value:null,divider:!0})}if(this._showNow){let r={time:null,metadata:"now"};a.push({label:"Now",value:r})}if(Array.isArray(this._customOptions)&&this._customOptions.length){let r=this._customOptions.map(d=>{let _={time:null,metadata:d.value,isCustom:!0,customCallback:d.toMilliseconds};return{label:d.label,value:_}});a=[...a,...r]}return a.length&&(n.length&&n.splice(0,0,{label:"",value:null,divider:!0}),a.forEach((r,d)=>n.splice(d,0,r))),n}_convertTimeStringToMillis(t,e,i){return(!t||!this._isValidTimeFormat(t))&&(t=""),v(t,e,i)}_formatValue(t){return!this._masked&&typeof this._formatCallback=="function"?this._formatCallback.call(null,t,this._use24HourTime,this._allowSeconds):c(this._value,this._use24HourTime,this._allowSeconds)||""}_warnInvalidFormat(t){console.warn(`The specified value "${t}" does not conform to the required format. The format is "HH:mm", "HH:mm:ss" where HH is 00-23, mm is 00-59, and ss is 00-59.`)}get open(){return this._open}set open(t){this._open!==t&&this._isInitialized&&(this._open=t,this._open?this._openDropdown():this._closeDropdown())}get masked(){return this._masked}set masked(t){this._masked!==t&&(this._masked=t,this._isInitialized&&(this._masked?(this._adapter.removeInputListener("input",this._inputListener),this._applyMask()):(this._adapter.destroyMask(),this._formatInputValue(),this._adapter.addInputListener("input",this._inputListener))))}get showMaskFormat(){return this._showMaskFormat}set showMaskFormat(t){this._showMaskFormat!==t&&(this._showMaskFormat=t)}get allowSeconds(){return this._allowSeconds}set allowSeconds(t){this._allowSeconds!==t&&(this._allowSeconds=!!t,this._applyAllowSeconds(),this._isInitialized&&(this._applyMask(),this._formatInputValue()),this._adapter.setHostAttribute(s.attributes.ALLOW_SECONDS,`${!!t}`))}get use24HourTime(){return this._use24HourTime}set use24HourTime(t){this._use24HourTime!==t&&(this._use24HourTime=!!t,this._isInitialized&&(this._applyMask(),this._formatInputValue()),this._adapter.setHostAttribute(s.attributes.USE_24_HOUR_TIME,`${!!t}`))}get allowInvalidTime(){return this._allowInvalidTime}set allowInvalidTime(t){this._allowInvalidTime!==t&&(this._allowInvalidTime=!!t,this._adapter.setHostAttribute(s.attributes.ALLOW_INVALID_TIME,`${!!t}`))}get value(){return c(this._value,!0,this._allowSeconds)}set value(t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}let e=this._validateMillis(this._convertTimeStringToMillis(t,!0,!0));this._setValue(e),this._isInitialized&&this._applyValue(this._value)}get min(){return c(this._min,!0,this._allowSeconds)}set min(t){if(this._min!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._min=this._convertTimeStringToMillis(t,!0,this._allowSeconds);let e=this._validateMillis(this._value);this._setValue(e),this._isInitialized&&this._applyValue(e)}}get max(){return c(this._max,!0,this._allowSeconds)}set max(t){if(this._max!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._max=this._convertTimeStringToMillis(t,!0,this._allowSeconds);let e=this._validateMillis(this._value);this._setValue(e),this._isInitialized&&this._applyValue(e)}}get restrictedTimes(){return this._restrictedTimes.map(t=>c(t,!0,this._allowSeconds)).filter(t=>typeof t=="string")}set restrictedTimes(t){Array.isArray(t)||(t=[]),this._restrictedTimes=t.filter(e=>typeof e=="string").map(e=>this._convertTimeStringToMillis(e,!0,!0)).filter(e=>typeof e=="number")}get startTime(){return c(this._startTime,!0,this._allowSeconds)}set startTime(t){if(this._startTime!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._startTime=this._convertTimeStringToMillis(t,!0,this._allowSeconds)}}get step(){return this._step}set step(t){this._step=t}get allowInput(){return this._allowInput}set allowInput(t){this._allowInput!==t&&(this._allowInput=t,this._isInitialized&&(this._applyAllowInput(),this._applyMask()))}get popupTarget(){return this._popupTarget}set popupTarget(t){this._popupTarget!==t&&(this._popupTarget=t)}get showNow(){return this._showNow}set showNow(t){this._showNow!==t&&(this._showNow=t)}get showHourOptions(){return this._showHourOptions}set showHourOptions(t){this._showHourOptions!==t&&(this._showHourOptions=t)}get customOptions(){return this._customOptions}set customOptions(t){this._customOptions=Array.isArray(t)?t:[]}set validationCallback(t){this._validationCallback=t,this._isInitialized&&this._applyMask()}set parseCallback(t){this._parseCallback=t}set formatCallback(t){this._formatCallback=t}set coercionCallback(t){this._coercionCallback=t}set prepareMaskCallback(t){this._prepareMaskCallback=t,this._isInitialized&&this._applyMask()}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=!!t,this._isInitialized&&this._applyDisabled(),this._adapter.toggleHostAttribute(s.attributes.DISABLED,this._disabled))}get popupClasses(){return Array.isArray(this._popupClasses)?[...this._popupClasses]:this._popupClasses}set popupClasses(t){Array.isArray(t)?this._popupClasses=[...t]:this._popupClasses=[t]}get allowDropdown(){return this._allowDropdown}set allowDropdown(t){this._allowDropdown!==t&&(this._allowDropdown=t,this._isInitialized&&this._applyAllowDropdown())}};var Tt="<template><slot></slot></template>",kt=":host{display:block}:host([hidden]){display:none}",l=class extends B{constructor(){super();Z.define([rt,K]),H(this,Tt,kt),this._foundation=new k(new g(this))}static get observedAttributes(){return[s.attributes.VALUE,s.attributes.OPEN,s.attributes.ALLOW_SECONDS,s.attributes.MASKED,s.attributes.SHOW_MASK_FORMAT,s.attributes.USE_24_HOUR_TIME,s.attributes.ALLOW_INVALID_TIME,s.attributes.MIN,s.attributes.MAX,s.attributes.START_TIME,s.attributes.STEP,s.attributes.ALLOW_INPUT,s.attributes.SHOW_NOW,s.attributes.SHOW_HOUR_OPTIONS,s.attributes.DISABLED,s.attributes.POPUP_CLASSES,s.attributes.ALLOW_DROPDOWN]}connectedCallback(){this.querySelector(s.selectors.INPUT)?this._foundation.initialize():A(this,s.selectors.INPUT).then(()=>this._foundation.initialize())}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(e,i,n){switch(e){case s.attributes.VALUE:this.value=n;break;case s.attributes.OPEN:this.open=m(n);break;case s.attributes.ALLOW_SECONDS:this.allowSeconds=m(n);break;case s.attributes.MASKED:this.masked=m(n);break;case s.attributes.SHOW_MASK_FORMAT:this.showMaskFormat=m(n);break;case s.attributes.USE_24_HOUR_TIME:this.use24HourTime=m(n);break;case s.attributes.ALLOW_INVALID_TIME:this.allowInvalidTime=m(n);break;case s.attributes.SHOW_NOW:this.showNow=m(n);break;case s.attributes.SHOW_HOUR_OPTIONS:this.showHourOptions=m(n);break;case s.attributes.MIN:this.min=n;break;case s.attributes.MAX:this.max=n;break;case s.attributes.START_TIME:this.startTime=n;break;case s.attributes.STEP:this.step=y(n);break;case s.attributes.ALLOW_INPUT:this.allowInput=m(n);break;case s.attributes.DISABLED:this.disabled=m(n);break;case s.attributes.POPUP_CLASSES:this.popupClasses=n;break;case s.attributes.ALLOW_DROPDOWN:this.allowDropdown=m(n);break}}};p([u()],l.prototype,"value",2),p([u()],l.prototype,"open",2),p([u()],l.prototype,"allowSeconds",2),p([u()],l.prototype,"masked",2),p([u()],l.prototype,"showMaskFormat",2),p([u()],l.prototype,"use24HourTime",2),p([u()],l.prototype,"allowInvalidTime",2),p([u()],l.prototype,"min",2),p([u()],l.prototype,"max",2),p([u()],l.prototype,"restrictedTimes",2),p([u()],l.prototype,"startTime",2),p([u()],l.prototype,"step",2),p([u()],l.prototype,"allowInput",2),p([u()],l.prototype,"showNow",2),p([u()],l.prototype,"showHourOptions",2),p([u()],l.prototype,"customOptions",2),p([u()],l.prototype,"validationCallback",2),p([u()],l.prototype,"parseCallback",2),p([u()],l.prototype,"formatCallback",2),p([u()],l.prototype,"coercionCallback",2),p([u()],l.prototype,"prepareMaskCallback",2),p([u()],l.prototype,"disabled",2),p([u()],l.prototype,"popupClasses",2),p([u()],l.prototype,"allowDropdown",2),p([u()],l.prototype,"popupTarget",2),l=p([R({name:s.elementName,dependencies:[et,tt,ot,E,it,E,at]})],l);var mt=class extends ${constructor(e){super(e)}_build(){let e=document.createElement(s.elementName);return this._attachTextField(e),e}get inputElement(){return this._textFieldDelegate.inputElement}get textFieldElement(){return this._textFieldDelegate.element}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._element.disabled}set disabled(e){this._element.disabled=e}get invalid(){return this._textFieldDelegate.invalid||!1}set invalid(e){this._textFieldDelegate.invalid=e}onChange(e){this._element.addEventListener(s.events.CHANGE,i=>{var n;return e((n=i.detail)!=null?n:"")})}onInput(e){this._element.addEventListener(s.events.INPUT,i=>{var n;return e((n=i.detail)!=null?n:"")})}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",i=>e(i))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",i=>e(i))}_attachTextField(e){var n,a,r,d;let i={props:w({},(a=(n=this._config.options)==null?void 0:n.textFieldDelegateConfig)==null?void 0:a.props),options:w({},(d=(r=this._config.options)==null?void 0:r.textFieldDelegateConfig)==null?void 0:d.options)};this._textFieldDelegate=new nt(i),e.appendChild(this._textFieldDelegate.element)}};function Ne(){N(l)}export{s as a,g as b,v as c,c as d,pt as e,ut as f,I as g,M as h,It as i,dt as j,T as k,O as l,ct as m,S as n,Rt as o,k as p,l as q,mt as r,Ne as s};
7
+ //# sourceMappingURL=chunk.KJP2VA6Q.js.map