@tylertech/forge 3.0.0-next.6 → 3.0.0-next.8

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 (254) hide show
  1. package/custom-elements.json +2084 -1482
  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/banner/index.js +1 -1
  11. package/dist/esm/bottom-sheet/index.js +1 -1
  12. package/dist/esm/busy-indicator/index.js +1 -1
  13. package/dist/esm/button/index.js +1 -1
  14. package/dist/esm/button-toggle/button-toggle/index.js +1 -1
  15. package/dist/esm/button-toggle/button-toggle-group/index.js +1 -1
  16. package/dist/esm/button-toggle/index.js +1 -1
  17. package/dist/esm/calendar/calendar-dropdown/index.js +1 -1
  18. package/dist/esm/calendar/calendar-menu/index.js +1 -1
  19. package/dist/esm/calendar/index.js +1 -1
  20. package/dist/esm/card/index.js +1 -1
  21. package/dist/esm/checkbox/index.js +1 -1
  22. package/dist/esm/chip-field/index.js +1 -1
  23. package/dist/esm/chips/chip/index.js +1 -1
  24. package/dist/esm/chips/chip-set/index.js +1 -1
  25. package/dist/esm/chips/index.js +1 -1
  26. package/dist/esm/chunks/{chunk.Q6IP5GJ6.js → chunk.246JM2YT.js} +2 -2
  27. package/dist/esm/chunks/{chunk.DHTAH23Y.js → chunk.24L5GDD2.js} +2 -2
  28. package/dist/esm/chunks/{chunk.ZWTZJJ6H.js → chunk.2IQGDFQS.js} +2 -2
  29. package/dist/esm/chunks/{chunk.DAGXGSX7.js → chunk.2LRDPTHK.js} +2 -2
  30. package/dist/esm/chunks/{chunk.Q47M2LB5.js → chunk.2QFIMTVP.js} +2 -2
  31. package/dist/esm/chunks/{chunk.IVB6XTHQ.js → chunk.2TQONIPK.js} +2 -2
  32. package/dist/esm/chunks/{chunk.DXHKS7XO.js → chunk.2XFVFZ3P.js} +2 -2
  33. package/dist/esm/chunks/{chunk.3ICROIFD.js → chunk.2YAU7AXH.js} +2 -2
  34. package/dist/esm/chunks/{chunk.5B2CGITX.js → chunk.2YX7ASSX.js} +2 -2
  35. package/dist/esm/chunks/{chunk.QLNGQCJX.js → chunk.2ZTERGYF.js} +2 -2
  36. package/dist/esm/chunks/{chunk.BIJJCDHE.js → chunk.3AF7CJP2.js} +2 -2
  37. package/dist/esm/chunks/{chunk.BIJJCDHE.js.map → chunk.3AF7CJP2.js.map} +1 -1
  38. package/dist/esm/chunks/{chunk.Y2ANYRZH.js → chunk.4EB5NVCK.js} +2 -2
  39. package/dist/esm/chunks/{chunk.SACZLJPQ.js → chunk.4LVS2EYJ.js} +2 -2
  40. package/dist/esm/chunks/chunk.57XQ4F6F.js +12 -0
  41. package/dist/esm/chunks/chunk.57XQ4F6F.js.map +7 -0
  42. package/dist/esm/chunks/{chunk.E3VXLUEY.js → chunk.5IVB5L5Z.js} +2 -2
  43. package/dist/esm/chunks/{chunk.GZZ6GFKT.js → chunk.5MK5YWCK.js} +2 -2
  44. package/dist/esm/chunks/{chunk.QO37K76P.js → chunk.6SBTLXLH.js} +2 -2
  45. package/dist/esm/chunks/{chunk.BTZF6QGA.js → chunk.7JQHQKXN.js} +2 -2
  46. package/dist/esm/chunks/{chunk.TWV4OTF7.js → chunk.A5MBSCSQ.js} +2 -2
  47. package/dist/esm/chunks/{chunk.4EF7UJDK.js → chunk.A5R7KUIP.js} +2 -2
  48. package/dist/esm/chunks/{chunk.NQH4ZCXJ.js → chunk.AGMPIMJV.js} +2 -2
  49. package/dist/esm/chunks/{chunk.PMY4KVCF.js → chunk.BKCEVPKW.js} +2 -2
  50. package/dist/esm/chunks/{chunk.I5MLIFN5.js → chunk.BSTIDYQJ.js} +2 -2
  51. package/dist/esm/chunks/chunk.C2LTB7EX.js +7 -0
  52. package/dist/esm/chunks/chunk.C2LTB7EX.js.map +7 -0
  53. package/dist/esm/chunks/chunk.CN27IHDN.js +7 -0
  54. package/dist/esm/chunks/chunk.CN27IHDN.js.map +7 -0
  55. package/dist/esm/chunks/{chunk.MZNL36GJ.js → chunk.CNQESSA3.js} +2 -2
  56. package/dist/esm/chunks/{chunk.6FISJTFJ.js → chunk.E6KWYFZG.js} +2 -2
  57. package/dist/esm/chunks/{chunk.H3SBIXK5.js → chunk.ECRL6O3V.js} +2 -2
  58. package/dist/esm/chunks/{chunk.SBDWCXK3.js → chunk.ER52NFXX.js} +2 -2
  59. package/dist/esm/chunks/{chunk.GSQF3ACL.js → chunk.EUE3OVC7.js} +2 -2
  60. package/dist/esm/chunks/{chunk.DGNS4JNN.js → chunk.FAANPQES.js} +2 -2
  61. package/dist/esm/chunks/{chunk.MZLPUI6R.js → chunk.FYWPZFLJ.js} +2 -2
  62. package/dist/esm/chunks/{chunk.MZLPUI6R.js.map → chunk.FYWPZFLJ.js.map} +2 -2
  63. package/dist/esm/chunks/{chunk.LMSXJOPL.js → chunk.GF2GUVYS.js} +2 -2
  64. package/dist/esm/chunks/{chunk.QKRB6AIQ.js → chunk.GHSAKRYH.js} +2 -2
  65. package/dist/esm/chunks/{chunk.JHTGKXXX.js → chunk.GJW4WS4I.js} +2 -2
  66. package/dist/esm/chunks/{chunk.IW37LUQJ.js → chunk.GUYPITGA.js} +2 -2
  67. package/dist/esm/chunks/{chunk.G75X57KY.js → chunk.HKJEGD6C.js} +2 -2
  68. package/dist/esm/chunks/{chunk.3ARIVYGG.js → chunk.IGK3VYZG.js} +2 -2
  69. package/dist/esm/chunks/chunk.IIXLFXHZ.js +7 -0
  70. package/dist/esm/chunks/chunk.IIXLFXHZ.js.map +7 -0
  71. package/dist/esm/chunks/chunk.JQIOVCKI.js +7 -0
  72. package/dist/esm/chunks/chunk.JQIOVCKI.js.map +7 -0
  73. package/dist/esm/chunks/{chunk.7MDHI4PT.js → chunk.JVW6JGV3.js} +2 -2
  74. package/dist/esm/chunks/chunk.LJYTJ3RV.js +7 -0
  75. package/dist/esm/chunks/chunk.LJYTJ3RV.js.map +7 -0
  76. package/dist/esm/chunks/{chunk.LQ4RD7WW.js → chunk.MXNLCQRB.js} +2 -2
  77. package/dist/esm/chunks/{chunk.DCCJTW7C.js → chunk.NDGFQILG.js} +2 -2
  78. package/dist/esm/chunks/{chunk.PG4HEEX2.js → chunk.OTVT3XM2.js} +2 -2
  79. package/dist/esm/chunks/{chunk.VSO5QDBV.js → chunk.P5QIB6OY.js} +2 -2
  80. package/dist/esm/chunks/{chunk.XUV63FEH.js → chunk.PPPTT3SM.js} +2 -2
  81. package/dist/esm/chunks/{chunk.GZRMHYID.js → chunk.QA3NU7EN.js} +2 -2
  82. package/dist/esm/chunks/{chunk.MVYTV6WX.js → chunk.QYKO543K.js} +2 -2
  83. package/dist/esm/chunks/{chunk.XI4RWFCG.js → chunk.RHYRMQS7.js} +2 -2
  84. package/dist/esm/chunks/{chunk.Q4SCW4FN.js → chunk.RUSHOL23.js} +2 -2
  85. package/dist/esm/chunks/{chunk.AD4CP4UK.js → chunk.SIJGKRYS.js} +2 -2
  86. package/dist/esm/chunks/{chunk.RTMDWDS4.js → chunk.SYZB7B4F.js} +2 -2
  87. package/dist/esm/chunks/{chunk.GYPPM2D2.js → chunk.SZIM4KFZ.js} +2 -2
  88. package/dist/esm/chunks/{chunk.UXQZFI55.js → chunk.THPU5KBV.js} +2 -2
  89. package/dist/esm/chunks/{chunk.K6VWRQWY.js → chunk.TXFYS6EU.js} +2 -2
  90. package/dist/esm/chunks/{chunk.ZLFH7VOM.js → chunk.V4RBOYNH.js} +2 -2
  91. package/dist/esm/chunks/chunk.WH6C36MO.js +7 -0
  92. package/dist/esm/chunks/chunk.WH6C36MO.js.map +7 -0
  93. package/dist/esm/chunks/{chunk.JRV5FYMW.js → chunk.YUAU5IWT.js} +2 -2
  94. package/dist/esm/chunks/{chunk.YSFUL5AD.js → chunk.YZLASVCK.js} +2 -2
  95. package/dist/esm/chunks/{chunk.R7MQKCHR.js → chunk.Z5TWWM7I.js} +2 -2
  96. package/dist/esm/color-picker/index.js +1 -1
  97. package/dist/esm/core/index.js +1 -1
  98. package/dist/esm/date-picker/index.js +1 -1
  99. package/dist/esm/date-range-picker/index.js +1 -1
  100. package/dist/esm/expansion-panel/index.js +1 -1
  101. package/dist/esm/file-picker/index.js +1 -1
  102. package/dist/esm/floating-action-button/index.js +1 -1
  103. package/dist/esm/focus-indicator/index.js +7 -0
  104. package/dist/esm/focus-indicator/index.js.map +7 -0
  105. package/dist/esm/icon/index.js +1 -1
  106. package/dist/esm/icon-button/index.js +1 -1
  107. package/dist/esm/index.js +1 -1
  108. package/dist/esm/list/index.js +1 -1
  109. package/dist/esm/list/list/index.js +1 -1
  110. package/dist/esm/list/list-item/index.js +1 -1
  111. package/dist/esm/list-dropdown/index.js +1 -1
  112. package/dist/esm/menu/index.js +1 -1
  113. package/dist/esm/open-icon/index.js +1 -1
  114. package/dist/esm/paginator/index.js +1 -1
  115. package/dist/esm/profile-card/index.js +1 -1
  116. package/dist/esm/quantity-field/index.js +1 -1
  117. package/dist/esm/radio/index.js +1 -1
  118. package/dist/esm/ripple/index.js +1 -1
  119. package/dist/esm/select/core/index.js +1 -1
  120. package/dist/esm/select/index.js +1 -1
  121. package/dist/esm/select/select/index.js +1 -1
  122. package/dist/esm/select/select-dropdown/index.js +1 -1
  123. package/dist/esm/slider/index.js +1 -1
  124. package/dist/esm/split-view/index.js +1 -1
  125. package/dist/esm/split-view/split-view/index.js +1 -1
  126. package/dist/esm/split-view/split-view-panel/index.js +1 -1
  127. package/dist/esm/stepper/index.js +1 -1
  128. package/dist/esm/stepper/step/index.js +1 -1
  129. package/dist/esm/stepper/stepper/index.js +1 -1
  130. package/dist/esm/switch/index.js +1 -1
  131. package/dist/esm/table/index.js +1 -1
  132. package/dist/esm/tabs/index.js +1 -1
  133. package/dist/esm/tabs/tab/index.js +1 -1
  134. package/dist/esm/tabs/tab-bar/index.js +1 -1
  135. package/dist/esm/time-picker/index.js +1 -1
  136. package/dist/esm/toast/index.js +1 -1
  137. package/esm/card/card-constants.d.ts +2 -2
  138. package/esm/card/card-constants.js +2 -2
  139. package/esm/card/card.d.ts +19 -8
  140. package/esm/card/card.js +30 -21
  141. package/esm/focus-indicator/focus-indicator-adapter.d.ts +37 -0
  142. package/esm/focus-indicator/focus-indicator-adapter.js +59 -0
  143. package/esm/focus-indicator/focus-indicator-constants.d.ts +15 -0
  144. package/esm/focus-indicator/focus-indicator-constants.js +19 -0
  145. package/esm/focus-indicator/focus-indicator-foundation.d.ts +43 -0
  146. package/esm/focus-indicator/focus-indicator-foundation.js +110 -0
  147. package/esm/focus-indicator/focus-indicator.d.ts +67 -0
  148. package/esm/focus-indicator/focus-indicator.js +112 -0
  149. package/esm/focus-indicator/index.d.ts +10 -0
  150. package/esm/focus-indicator/index.js +14 -0
  151. package/esm/index.d.ts +1 -0
  152. package/esm/index.js +3 -0
  153. package/esm/slider/slider-utils.js +3 -0
  154. package/esm/slider/slider.d.ts +0 -1
  155. package/esm/slider/slider.js +7 -4
  156. package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
  157. package/esm/tabs/tab/tab-adapter.d.ts +15 -39
  158. package/esm/tabs/tab/tab-adapter.js +65 -78
  159. package/esm/tabs/tab/tab-constants.d.ts +13 -13
  160. package/esm/tabs/tab/tab-constants.js +18 -10
  161. package/esm/tabs/tab/tab-foundation.d.ts +24 -23
  162. package/esm/tabs/tab/tab-foundation.js +68 -62
  163. package/esm/tabs/tab/tab-ripple.d.ts +17 -0
  164. package/esm/tabs/tab/tab-ripple.js +33 -0
  165. package/esm/tabs/tab/tab.d.ts +56 -19
  166. package/esm/tabs/tab/tab.js +82 -32
  167. package/esm/tabs/tab-bar/tab-bar-adapter.d.ts +49 -87
  168. package/esm/tabs/tab-bar/tab-bar-adapter.js +114 -188
  169. package/esm/tabs/tab-bar/tab-bar-constants.d.ts +15 -45
  170. package/esm/tabs/tab-bar/tab-bar-constants.js +22 -56
  171. package/esm/tabs/tab-bar/tab-bar-foundation.d.ts +56 -65
  172. package/esm/tabs/tab-bar/tab-bar-foundation.js +241 -302
  173. package/esm/tabs/tab-bar/tab-bar.d.ts +51 -36
  174. package/esm/tabs/tab-bar/tab-bar.js +84 -52
  175. package/package.json +1 -1
  176. package/styles/card/_mixins.scss +8 -7
  177. package/styles/core/style-layer/tabs/tab/_core.scss +419 -0
  178. package/styles/core/style-layer/tabs/tab/_variables.scss +20 -0
  179. package/styles/core/style-layer/tabs/tab/index.scss +13 -0
  180. package/styles/core/style-layer/tabs/tab-bar/_core.scss +110 -0
  181. package/styles/core/style-layer/tabs/tab-bar/_variables.scss +9 -0
  182. package/styles/core/style-layer/tabs/tab-bar/index.scss +13 -0
  183. package/styles/focus-indicator/_mixins.scss +147 -0
  184. package/styles/focus-indicator/_variables.scss +20 -0
  185. package/styles/focus-indicator/focus-indicator.scss +32 -0
  186. package/styles/slider/_mixins.scss +9 -0
  187. package/styles/tabs/tab/_mixins.scss +55 -126
  188. package/styles/tabs/tab/_variables.scss +26 -4
  189. package/styles/tabs/tab/tab.scss +50 -11
  190. package/styles/tabs/tab-bar/_mixins.scss +20 -60
  191. package/styles/tabs/tab-bar/_variables.scss +11 -0
  192. package/styles/tabs/tab-bar/tab-bar.scss +29 -2
  193. package/dist/esm/chunks/chunk.4B22UXEH.js +0 -7
  194. package/dist/esm/chunks/chunk.4B22UXEH.js.map +0 -7
  195. package/dist/esm/chunks/chunk.4QPMNWJ3.js +0 -129
  196. package/dist/esm/chunks/chunk.4QPMNWJ3.js.map +0 -7
  197. package/dist/esm/chunks/chunk.BWZKQ6WX.js +0 -7
  198. package/dist/esm/chunks/chunk.BWZKQ6WX.js.map +0 -7
  199. package/dist/esm/chunks/chunk.D3IAEEPM.js +0 -201
  200. package/dist/esm/chunks/chunk.D3IAEEPM.js.map +0 -7
  201. package/dist/esm/chunks/chunk.NV4U4DE6.js +0 -12
  202. package/dist/esm/chunks/chunk.NV4U4DE6.js.map +0 -7
  203. /package/dist/esm/chunks/{chunk.Q6IP5GJ6.js.map → chunk.246JM2YT.js.map} +0 -0
  204. /package/dist/esm/chunks/{chunk.DHTAH23Y.js.map → chunk.24L5GDD2.js.map} +0 -0
  205. /package/dist/esm/chunks/{chunk.ZWTZJJ6H.js.map → chunk.2IQGDFQS.js.map} +0 -0
  206. /package/dist/esm/chunks/{chunk.DAGXGSX7.js.map → chunk.2LRDPTHK.js.map} +0 -0
  207. /package/dist/esm/chunks/{chunk.Q47M2LB5.js.map → chunk.2QFIMTVP.js.map} +0 -0
  208. /package/dist/esm/chunks/{chunk.IVB6XTHQ.js.map → chunk.2TQONIPK.js.map} +0 -0
  209. /package/dist/esm/chunks/{chunk.DXHKS7XO.js.map → chunk.2XFVFZ3P.js.map} +0 -0
  210. /package/dist/esm/chunks/{chunk.3ICROIFD.js.map → chunk.2YAU7AXH.js.map} +0 -0
  211. /package/dist/esm/chunks/{chunk.5B2CGITX.js.map → chunk.2YX7ASSX.js.map} +0 -0
  212. /package/dist/esm/chunks/{chunk.QLNGQCJX.js.map → chunk.2ZTERGYF.js.map} +0 -0
  213. /package/dist/esm/chunks/{chunk.Y2ANYRZH.js.map → chunk.4EB5NVCK.js.map} +0 -0
  214. /package/dist/esm/chunks/{chunk.SACZLJPQ.js.map → chunk.4LVS2EYJ.js.map} +0 -0
  215. /package/dist/esm/chunks/{chunk.E3VXLUEY.js.map → chunk.5IVB5L5Z.js.map} +0 -0
  216. /package/dist/esm/chunks/{chunk.GZZ6GFKT.js.map → chunk.5MK5YWCK.js.map} +0 -0
  217. /package/dist/esm/chunks/{chunk.QO37K76P.js.map → chunk.6SBTLXLH.js.map} +0 -0
  218. /package/dist/esm/chunks/{chunk.BTZF6QGA.js.map → chunk.7JQHQKXN.js.map} +0 -0
  219. /package/dist/esm/chunks/{chunk.TWV4OTF7.js.map → chunk.A5MBSCSQ.js.map} +0 -0
  220. /package/dist/esm/chunks/{chunk.4EF7UJDK.js.map → chunk.A5R7KUIP.js.map} +0 -0
  221. /package/dist/esm/chunks/{chunk.NQH4ZCXJ.js.map → chunk.AGMPIMJV.js.map} +0 -0
  222. /package/dist/esm/chunks/{chunk.PMY4KVCF.js.map → chunk.BKCEVPKW.js.map} +0 -0
  223. /package/dist/esm/chunks/{chunk.I5MLIFN5.js.map → chunk.BSTIDYQJ.js.map} +0 -0
  224. /package/dist/esm/chunks/{chunk.MZNL36GJ.js.map → chunk.CNQESSA3.js.map} +0 -0
  225. /package/dist/esm/chunks/{chunk.6FISJTFJ.js.map → chunk.E6KWYFZG.js.map} +0 -0
  226. /package/dist/esm/chunks/{chunk.H3SBIXK5.js.map → chunk.ECRL6O3V.js.map} +0 -0
  227. /package/dist/esm/chunks/{chunk.SBDWCXK3.js.map → chunk.ER52NFXX.js.map} +0 -0
  228. /package/dist/esm/chunks/{chunk.GSQF3ACL.js.map → chunk.EUE3OVC7.js.map} +0 -0
  229. /package/dist/esm/chunks/{chunk.DGNS4JNN.js.map → chunk.FAANPQES.js.map} +0 -0
  230. /package/dist/esm/chunks/{chunk.LMSXJOPL.js.map → chunk.GF2GUVYS.js.map} +0 -0
  231. /package/dist/esm/chunks/{chunk.QKRB6AIQ.js.map → chunk.GHSAKRYH.js.map} +0 -0
  232. /package/dist/esm/chunks/{chunk.JHTGKXXX.js.map → chunk.GJW4WS4I.js.map} +0 -0
  233. /package/dist/esm/chunks/{chunk.IW37LUQJ.js.map → chunk.GUYPITGA.js.map} +0 -0
  234. /package/dist/esm/chunks/{chunk.G75X57KY.js.map → chunk.HKJEGD6C.js.map} +0 -0
  235. /package/dist/esm/chunks/{chunk.3ARIVYGG.js.map → chunk.IGK3VYZG.js.map} +0 -0
  236. /package/dist/esm/chunks/{chunk.7MDHI4PT.js.map → chunk.JVW6JGV3.js.map} +0 -0
  237. /package/dist/esm/chunks/{chunk.LQ4RD7WW.js.map → chunk.MXNLCQRB.js.map} +0 -0
  238. /package/dist/esm/chunks/{chunk.DCCJTW7C.js.map → chunk.NDGFQILG.js.map} +0 -0
  239. /package/dist/esm/chunks/{chunk.PG4HEEX2.js.map → chunk.OTVT3XM2.js.map} +0 -0
  240. /package/dist/esm/chunks/{chunk.VSO5QDBV.js.map → chunk.P5QIB6OY.js.map} +0 -0
  241. /package/dist/esm/chunks/{chunk.XUV63FEH.js.map → chunk.PPPTT3SM.js.map} +0 -0
  242. /package/dist/esm/chunks/{chunk.GZRMHYID.js.map → chunk.QA3NU7EN.js.map} +0 -0
  243. /package/dist/esm/chunks/{chunk.MVYTV6WX.js.map → chunk.QYKO543K.js.map} +0 -0
  244. /package/dist/esm/chunks/{chunk.XI4RWFCG.js.map → chunk.RHYRMQS7.js.map} +0 -0
  245. /package/dist/esm/chunks/{chunk.Q4SCW4FN.js.map → chunk.RUSHOL23.js.map} +0 -0
  246. /package/dist/esm/chunks/{chunk.AD4CP4UK.js.map → chunk.SIJGKRYS.js.map} +0 -0
  247. /package/dist/esm/chunks/{chunk.RTMDWDS4.js.map → chunk.SYZB7B4F.js.map} +0 -0
  248. /package/dist/esm/chunks/{chunk.GYPPM2D2.js.map → chunk.SZIM4KFZ.js.map} +0 -0
  249. /package/dist/esm/chunks/{chunk.UXQZFI55.js.map → chunk.THPU5KBV.js.map} +0 -0
  250. /package/dist/esm/chunks/{chunk.K6VWRQWY.js.map → chunk.TXFYS6EU.js.map} +0 -0
  251. /package/dist/esm/chunks/{chunk.ZLFH7VOM.js.map → chunk.V4RBOYNH.js.map} +0 -0
  252. /package/dist/esm/chunks/{chunk.JRV5FYMW.js.map → chunk.YUAU5IWT.js.map} +0 -0
  253. /package/dist/esm/chunks/{chunk.YSFUL5AD.js.map → chunk.YZLASVCK.js.map} +0 -0
  254. /package/dist/esm/chunks/{chunk.R7MQKCHR.js.map → chunk.Z5TWWM7I.js.map} +0 -0
@@ -3,5 +3,5 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{c as re,f as ce}from"./chunk.DXHKS7XO.js";import{a as M,d as ae}from"./chunk.H3SBIXK5.js";import{a as ne}from"./chunk.WO7KEM5K.js";import{a as $,b as x,c as v,d as K}from"./chunk.UV3WIHCM.js";import{a as H}from"./chunk.LEVFMI2Q.js";import{b as te}from"./chunk.MZLPUI6R.js";import{a as ie,d as se,l as oe}from"./chunk.H5D54EHO.js";import{a as X}from"./chunk.G4IN6Y46.js";import{a as le}from"./chunk.RFLASSCI.js";import{a as T}from"./chunk.NVUMRW44.js";import{a as Q}from"./chunk.5V5ABSHI.js";import{a as j,b as ee}from"./chunk.DTZFWZPB.js";import{a as q,k as J}from"./chunk.NK7H3MMM.js";import{d as R,e as F,f as p,g as D,i as W,j as U,t as Z}from"./chunk.CFDK4RCW.js";import{b as f,c as Y,d as I,h as y,j as g,k as L,l as G,o as V}from"./chunk.J2M2MXP2.js";import{a as h,d as _}from"./chunk.M3QDAYD2.js";var w=class{constructor(e){this._key=e,this._items=[]}getItems(){return[...this._items]}count(){return this._items.length}setKey(e){this._key=e}add(e){return e instanceof Array||(e=[e]),e.forEach(t=>{this.exists(t)||this._items.push(t)}),this}remove(e){e instanceof Array||(e=[e]);for(let t=e.length-1;t>=0;t--)this.exists(e[t])&&this._items.splice(this._items.indexOf(this._getItem(e[t])),1);return this}clear(){return this._items=[],this}exists(e){return this._getItem(e)!==null}_getItem(e){return this._key?x(this._items,v(this._key,e))||null:this._items.find(t=>t===e)||null}};var S=`${ee}table`,de={TABLE:"forge-table",TABLE_DENSE:"forge-table--dense",TABLE_ROOMY:"forge-table--roomy",TABLE_RESIZABLE:"forge-table--resizable",TABLE_RESIZING:"forge-table--resizing",TABLE_RESIZE_HANDLE:"forge-table__resize-handle",TABLE_NO_WRAP_CONTENT:"forge-table--no-wrap-content",TABLE_LAYOUT_FIXED:"forge-table--layout-fixed",TABLE_FILTER_VISIBLE:"forge-table--filter-visible",TABLE_FIXED:"forge-table--fixed",TABLE_HEAD:"forge-table-head",TABLE_HEAD_ROW:"forge-table-head__row",TABLE_HEAD_ROW_FILTER:"forge-table-head__row__filter",TABLE_HEAD_CELL:"forge-table-head__cell",TABLE_HEAD_CELL_CONTAINER:"forge-table-head__cell-container",TABLE_HEAD_CELL_SORTABLE:"forge-table-head__cell--sortable",TABLE_HEAD_CELL_SORT_ICON:"forge-table-head__cell-sort-icon",TABLE_HEAD_CELL_TEXT:"forge-table-head__cell-text",TABLE_HEAD_CELL_SORT_ICON_ACTIVE:"forge-table-head__cell-sort-icon--active",TABLE_HEAD_CELL_SORTED_ASCENDING:"forge-table-head__cell--sorted-ascending",TABLE_HEAD_CELL_SORTED_DESCENDING:"forge-table-head__cell--sorted-descending",TABLE_HEAD_CELL_SORT_ORDER:"forge-table-head__cell__sort-order",TABLE_HEAD_CELL_SORT_ORDER_HIDDEN:"forge-table-head__cell__sort-order--hidden",TABLE_BODY:"forge-table-body",TABLE_BODY_ROW:"forge-table-body__row",TABLE_BODY_ROW_SELECTED:"forge-table-body__row--selected",TABLE_BODY_ROW_CLICKABLE:"forge-table-body__row--clickable",TABLE_BODY_CELL:"forge-table-body__cell",TABLE_ROW:"forge-table-row",TABLE_ROW_EXPANDED:"forge-table-row--expanded",TABLE_ROW_EXPANDABLE_CONTENT:"forge-table-row__expandable-content",TABLE_ROW_EXPANDABLE_CONTENT_CELL:"forge-table-row__expandable-content-cell",TABLE_CELL:"forge-table-cell",TABLE_CELL_SELECT:"forge-table-cell__select",TABLE_CELL_SELECT_CHECKBOX:"forge-table-cell__select-checkbox",TABLE_CELL_SELECT_CHECKBOX_CONTAINER:"forge-table-cell__select-checkbox-container",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_RIGHT:"forge-table-cell__select-checkbox-container--align-right",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_LEFT:"forge-table-cell__select-checkbox-container--align-left",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_CENTER:"forge-table-cell__select-checkbox-container--align-center",TABLE_CELL_CONTAINER:"forge-table-cell__container",TABLE_CELL_CONTAINER_TEXT:"forge-table-cell__container-text",TABLE_CELL_CENTER:"forge-table-cell--center",TABLE_CELL_RIGHT:"forge-table-cell--right",TABLE_CELL_RESIZABLE:"forge-table-cell--resizing"},Ee={TABLE:".forge-table",CHECKBOX_INPUT:"forge-checkbox > input[type=checkbox]:not([forge-ignore])",SELECT_ALL_TEMPLATE_CHECKBOX_INPUT:"input[type=checkbox]:not([forge-ignore])",ROW_SELECTED:`.${de.TABLE_BODY_ROW_SELECTED}`},_e={SELECT:"select",MULTISELECT:"multiselect",SELECT_KEY:"select-key",DENSE:"dense",ROOMY:"roomy",FILTER:"filter",FIXED_HEADERS:"fixed-headers",LAYOUT_TYPE:"layout-type",WRAP_CONTENT:"wrap-content",RESIZABLE:"resizable",MIN_RESIZE_WIDTH:"min-resize-width",ALLOW_ROW_CLICK:"allow-row-click",MULTI_COLUMN_SORT:"multi-column-sort",SELECT_CHECKBOX_ALIGNMENT:"select-checkbox-alignment",TOOLTIP_SELECT:"tooltip-select",TOOLTIP_SELECT_ALL:"tooltip-select-all",CHECKBOX_TYPE:"forge-checkbox-type",CUSTOM_CELL_TEMPLATE:"data-cell-template",CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION:"data-cell-template-stop-propagation"},Te={ROW_CLICK:`${S}-row-click`,SELECT:`${S}-select`,SELECT_DOUBLE:`${S}-select-double`,SELECT_ALL:`${S}-select-all`,SORT:`${S}-sort`,FILTER:`${S}-filter`,INITIALIZED:`${S}-initialized`,COLUMN_RESIZE:`${S}-column-resize`},pe={SELECT_ALL:"select-all",SELECT_ROW:"select-row",DEFAULT_LAYOUT_TYPE:"auto"},Ce={SORT_DOWN:"arrow_downward"},he={DEFAULT_FILTER_DEBOUNCE_TIME:750,MIN_RESIZE_WIDTH:100,RESIZE_HOVER_DURATION:150},s={elementName:S,classes:de,selectors:Ee,attributes:_e,events:Te,strings:pe,icons:Ce,numbers:he};var B=(l=>(l.Left="left",l.Right="right",l.Center="center",l))(B||{}),O=(l=>(l.Ascending="ASC",l.Descending="DESC",l.Unset="UNSET",l))(O||{}),Le=(a=>(a.InputText="text",a.InputNumber="number",a.Select="select",a.SelectMultiple="select-multiple",a.Date="date",a.DateRange="date-range",a))(Le||{});function me(n){return n&&typeof n=="object"&&"content"in n}var b=class n{static createTable(e){n._resetTable(e.tableElement);let t=n._createTableHead(e),l=n._createTableBody(e);e.clickListener&&(n._attachRowClickListeners(l,e.clickListener,e.doubleClickListener),n._addRowClickAttributes(l)),e.fixedHeaders&&n.setFixedHeaders(e),e.resizable&&n.setResizable(e),e.dense&&n.setDenseState(e.tableElement,e.dense),e.wrapContent&&n.setWrapContentState(e.tableElement,e.wrapContent),e.selectListener&&n._addSelectColumn(t,l,e.selectListener,e.selectAllListener,e.selectAllTemplate,e.selectCheckboxAlignment,e.data,e.tooltipSelect,e.tooltipSelectAll),(e.resizable||e.columnConfigurations.some(i=>!!i.sortable))&&(n._attachHeadRowMouseDownListener(t,e.headRowMouseDownListener),n._isMac()&&n._attachHeadRowContextMenuListener(t,e.headRowContextMenuListener)),n.setLayoutType(e),n._setTableHead(e.tableElement,t),e.filter&&n.setFilterRow(e),n._setTableBody(e.tableElement,l)}static _setTableHead(e,t){e.tHead?F(t,e.tHead):e.appendChild(t)}static _setTableBody(e,t){e.tBodies.length?F(t,e.tBodies[0]):e.appendChild(t)}static recreateTableBody(e){let t=n._createTableBody(e);e.clickListener&&(n._attachRowClickListeners(t,e.clickListener,e.doubleClickListener),n._addRowClickAttributes(t)),e.selectListener&&(n._createBodySelectColumn(t,e.selectCheckboxAlignment,e.data,e.tooltipSelect,e.tooltipSelectAll),n._attachRowSelectListeners(t,e.selectListener)),n._setTableBody(e.tableElement,t)}static _resetTable(e){R(e)}static _createMultisortTooltip(){let e=document.createElement(ne.elementName);return e.textContent="Ctrl + click to sort multiple columns",e.position="bottom",e.delay=0,e}static _createTableHead(e){let t=document.createElement("thead"),l=t.insertRow();p([s.classes.TABLE_ROW,s.classes.TABLE_HEAD_ROW],l);let i=!1;for(let o=0;o<e.columnConfigurations.length;o++){let a=e.columnConfigurations[o],r=document.createElement("th");r.scope="col",p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],r);let c=document.createElement("div");if(c.classList.add(s.classes.TABLE_HEAD_CELL_CONTAINER),e.multiColumnSort){let d=n._createMultisortTooltip();c.appendChild(d)}if(a.align&&n._setCellAlignmentClass(c,a.align),f(a.width)){let d=U(a.width);d&&(r.style.width=d)}if(e.resizable&&a.resizable!==!1){let d=document.createElement("div");d.classList.add(s.classes.TABLE_RESIZE_HANDLE),r.appendChild(d)}f(a.headerCellStyle)&&g(a.headerCellStyle)&&(Object.assign(r.style,a.headerCellStyle),Object.assign(c.style,a.headerCellStyle));let m=document.createElement("span");if(m.classList.add(s.classes.TABLE_HEAD_CELL_TEXT),m.textContent=a.header&&typeof a.header=="string"?a.header.trim():"",a.sortable){r.classList.add(s.classes.TABLE_HEAD_CELL_SORTABLE);let d=document.createElement("span");p([s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN,s.classes.TABLE_HEAD_CELL_SORT_ORDER],d);let u=document.createElement(ie.elementName);u.name=s.icons.SORT_DOWN,p([s.classes.TABLE_HEAD_CELL_SORT_ICON],u),e.multiColumnSort?typeof a.initialSort=="object"&&a.initialSort.sortOrder&&(d.textContent=a.initialSort.sortOrder.toString(),e.columnConfigurations.filter(C=>typeof C.initialSort=="object").length>1&&D(s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN,d),r.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),u.classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(r,a.initialSort.direction)):e.sortedColumn===o&&!i&&!e.multiColumnSort&&(r.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),u.classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(r,e.sortDirection),i=!0),c.appendChild(u),c.appendChild(d)}typeof a.headerTemplate=="function"?Promise.resolve(a.headerTemplate(o,c,a)).then(d=>{if(d){let u=document.createElement("div");p(s.classes.TABLE_CELL_CONTAINER,u),typeof d=="string"?u.innerHTML=d:n._prepend(d,u),u.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""),n._prepend(u,c)}}):n._prepend(m,c),r.appendChild(c),l.appendChild(r)}return t}static setSortDirection(e,t,l){let i=n._getHeaderCellByIndex(e,t);n._setColumnSortDirection(i,l)}static _setColumnSortDirection(e,t){e.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)&&e.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING),e.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING)&&e.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),!t||t==="DESC"?e.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING):e.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)}static _createTableBody(e){let t=document.createElement("tbody");return n._getOrderedRowData(e.columnConfigurations,e.data).forEach((i,o)=>{let a=t.insertRow();p([s.classes.TABLE_ROW,s.classes.TABLE_BODY_ROW],a),n._populateRowCells(e,a,i,o),typeof e.rowCreatedCallback=="function"&&e.rowCreatedCallback(a,o,h({},e.data[o].data))}),t}static _populateRowCells(e,t,l,i){for(let o=0;o<l.length;o++){let a=e.columnConfigurations[o],r=t.insertCell();if(p([s.classes.TABLE_CELL,s.classes.TABLE_BODY_CELL],r),f(a.width)){let m=U(a.width);m&&(r.style.width=m)}let c=document.createElement("div");if(c.classList.add(s.classes.TABLE_CELL_CONTAINER),f(a.cellStyle)&&g(a.cellStyle)&&(Object.assign(r.style,a.cellStyle),Object.assign(c.style,a.cellStyle)),a.template&&typeof a.template=="function"){let m=e.data[i]?e.data[i].data:void 0;Promise.resolve(a.template(i,c,m,o)).then(d=>{let u=me(d)?d:{content:d,stopClickPropagation:a.stopCellTemplateClickPropagation};u.content&&(typeof u.content=="string"?c.innerHTML=u.content:c.appendChild(u.content),c.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""),u.stopClickPropagation&&c.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION,""))})}else if(a.property){let m=document.createElement("span");m.classList.add(s.classes.TABLE_CELL_CONTAINER_TEXT),c.appendChild(m),a.transform&&typeof a.transform=="function"?Promise.resolve(a.transform(l[o])).then(d=>m.textContent=d):l[o]==null?m.textContent="":m.textContent=l[o].toString()}if(a.align&&n._setCellAlignmentClass(c,a.align),r.appendChild(c),f(a.columnSpan)){if(a.columnSpan==="all"){r.colSpan=l.length-o;break}else if(typeof a.columnSpan=="number"&&a.columnSpan>0){let m=a.columnSpan;a.columnSpan>l.length-o&&(m=l.length),r.colSpan=m,o=o+(m-1)}}typeof e.cellCreatedCallback=="function"&&e.cellCreatedCallback(r,i,o)}}static _setCellAlignmentClass(e,t){switch(t){case"center":e.classList.add(s.classes.TABLE_CELL_CENTER);break;case"right":e.classList.add(s.classes.TABLE_CELL_RIGHT);break}}static _getNonExpandedRows(e){return Array.from(e).filter(t=>!t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}static _getExpandedRows(e){return Array.from(e).filter(t=>t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}static _createColumnDataMap(e,t){return e.map(l=>({config:l,data:t.map(i=>{if(l.property){let o=$(i.data,l.property);return f(o)?o:null}return null})}))}static _getOrderedRowData(e,t){let l=n._createColumnDataMap(e,t),i=[];for(let o of l)for(let a=0;a<o.data.length;a++)i[a]||(i[a]=[]),i[a].push(o.data[a]);return i}static _attachRowClickListeners(e,t,l){n._getNonExpandedRows(e.rows).forEach(o=>{o.addEventListener("click",t),l&&o.addEventListener("dblclick",l)})}static _addRowClickAttributes(e){n._getNonExpandedRows(e.rows).forEach(l=>{l.classList.add(s.classes.TABLE_BODY_ROW_CLICKABLE)})}static _removeRowClickAttributes(e){n._getNonExpandedRows(e.rows).forEach(l=>{l.classList.remove(s.classes.TABLE_BODY_ROW_CLICKABLE)})}static _attachRowSelectListeners(e,t){n._getNonExpandedRows(e.rows).forEach(i=>n._attachRowSelectListener(i,t))}static _attachRowSelectListener(e,t){let l=n._getCheckboxElement(e);l==null||l.addEventListener("click",t)}static _detachRowSelectListeners(e,t){Array.from(e.rows).forEach(l=>{let i=n._getCheckboxElement(l);i==null||i.removeEventListener("click",t)})}static _detachRowClickListeners(e,t,l){Array.from(e.rows).forEach(i=>{i.removeEventListener("click",t),i.removeEventListener("dblclick",l)})}static _attachSelectAllListener(e,t){let l=e.rows[e.rows.length-1],i=n._getCheckboxElement(l);if(!i)throw new Error("Checkbox element not found.");i.addEventListener("change",t)}static _tryAttachSelectAllTemplateListener(e,t){let l=e.rows[e.rows.length-1],i=n._tryGetSelectAllCheckboxElement(l);i&&i.addEventListener("change",t)}static _detachSelectAllListener(e,t){let l=e.rows[e.rows.length-1],i=n._tryGetSelectAllCheckboxElement(l);i&&i.removeEventListener("change",t)}static _attachHeadRowMouseDownListener(e,t){let l=e.rows[0];if(!l)throw new Error("Missing table header row. Unable to attach sort listener.");l.addEventListener("mousedown",t)}static _attachHeadRowContextMenuListener(e,t){let l=e.rows[0];if(!l)throw new Error("Missing table header row. Unable to attach sort listener.");l.addEventListener("contextmenu",t)}static _createSelectColumn(e,t,l,i,o,a,r,c,m){e&&n._createHeadSelectColumn(e,l,i,o,a,m),t&&n._createBodySelectColumn(t,a,r,c,m)}static _createHeadSelectColumn(e,t,l,i,o,a){var r;if(Array.from(e.rows).forEach(c=>{let m=document.createElement("th");p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],m),c.insertBefore(m,c.cells.item(0))}),t){let c=(r=e.rows.item(e.rows.length-1))==null?void 0:r.cells.item(0);c.classList.add(s.classes.TABLE_CELL_SELECT),typeof l=="function"?n._renderSelectAllTemplate(l,e).then(()=>{typeof i=="function"&&i()}):c==null||c.appendChild(n._createCheckboxElement(!0,o,null,null,null,a))}}static _createBodySelectColumn(e,t,l,i,o){if(n._getNonExpandedRows(e.rows).forEach((r,c)=>n._addRowSelectColumn(r,t,c,l[c],i,o)),e.rows.length){let r=e.rows.item(0);r&&n._updateExpandedRowColspan(e.rows,r.cells.length)}}static _addRowSelectColumn(e,t,l,i,o,a){let r=e.insertCell(0);p([s.classes.TABLE_CELL,s.classes.TABLE_BODY_CELL,s.classes.TABLE_CELL_SELECT],r),r.appendChild(n._createCheckboxElement(!1,t,l,i,o,a))}static _destroySelectColumn(e,t){let l=n._getNonExpandedRows(t.rows);if(Array.from(e.rows).forEach(i=>i.removeChild(i.cells.item(0))),Array.from(l).forEach(i=>i.removeChild(i.cells.item(0))),t.rows.length){let i=t.rows.item(0);i&&n._updateExpandedRowColspan(t.rows,i.cells.length)}}static _hasSelectColumn(e,t){return[...Array.from(e.rows),...Array.from(t.rows)].some(i=>i.cells.item(0).classList.contains(s.classes.TABLE_CELL_SELECT))}static _createCheckboxElement(e,t,l,i,o,a){let r=document.createElement("div");if(r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER),t)switch(t){case"center":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_CENTER);break;case"left":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_LEFT);break;case"right":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_RIGHT);break}let c=document.createElement(re.elementName),m=document.createElement("input");m.type="checkbox";let d=o||"";i&&typeof o=="function"&&(d=o.call(null,l,i.data));let u=document.createElement("forge-tooltip");return u.position="left",e?u.textContent=a||"":u.textContent=d,m.setAttribute("aria-label","Select row"),c.appendChild(m),r.appendChild(u),r.appendChild(c),r}static _getCheckboxElement(e){let t=e.querySelector(`.${s.classes.TABLE_CELL_SELECT}`);return t?t.querySelector(s.selectors.CHECKBOX_INPUT):null}static _tryGetSelectAllCheckboxElement(e){let t=e.querySelector(`.${s.classes.TABLE_CELL_SELECT}`);return t?t.querySelector(s.selectors.CHECKBOX_INPUT)||t.querySelector(s.selectors.SELECT_ALL_TEMPLATE_CHECKBOX_INPUT):null}static _setSelectedCheckboxState(e,t){e&&(e.checked=t)}static _setIndeterminateCheckboxState(e,t){e&&(e.indeterminate=t)}static _setRowSelectedState(e,t){t?e.classList.contains(s.classes.TABLE_BODY_ROW_SELECTED)||e.classList.add(s.classes.TABLE_BODY_ROW_SELECTED):e.classList.remove(s.classes.TABLE_BODY_ROW_SELECTED)}static _updateExpandedRowColspan(e,t){n._getExpandedRows(e).forEach(i=>{let o=i.cells.item(0);o&&(o.colSpan=t)})}static updateSelectedState(e,t){n._setRowSelectedState(e,t);let l=n._getCheckboxElement(e);l&&n._setSelectedCheckboxState(l,t)}static getRowByIndex(e,t){return n._getNonExpandedRows(e.tBodies[0].rows)[t]}static updateSelectAllState(e,t,l){if(!e.tHead)return;let i=e.tHead.rows[e.tHead.rows.length-1],o=n._tryGetSelectAllCheckboxElement(i);o&&(n._setSelectedCheckboxState(o,t),n._setIndeterminateCheckboxState(o,!!l))}static setSelectedRows(e,t,l,i,o=!1){if(!e.tBodies.length)return;o||n.clearSelectedRows(e);let a=e.tBodies[0].rows,r=0;i.length&&Array.from(a).forEach((c,m)=>{let d=l[m];if(x(i,v(t,d))){n._setRowSelectedState(c,!0);let C=n._getCheckboxElement(c);C&&n._setSelectedCheckboxState(C,!0),r++}}),n.updateSelectAllState(e,r>0&&a.length===r)}static clearSelectedRows(e){if(!e.tBodies.length)return;n._getNonExpandedRows(e.tBodies[0].rows).forEach(l=>{n._setRowSelectedState(l,!1);let i=n._getCheckboxElement(l);i&&n._setSelectedCheckboxState(i,!1)})}static setSortedColumn(e,t,l){let i=n._getHeaderCellByIndex(e,t);n._getSortIconElementFromHeaderCell(i).classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(i,l)}static setMultiSortColumnSortNumber(e,t,l,i){let r=n._getHeaderCellByIndex(e,l).querySelector(`.${s.classes.TABLE_HEAD_CELL_CONTAINER}`).querySelector(`.${s.classes.TABLE_HEAD_CELL_SORT_ORDER}`);r&&(Z(r,typeof i!="number"||!t,s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN),i&&(r.textContent=i.toString()))}static removeColumnSort(e,t){let l=n._getHeaderCellByIndex(e,t);l.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)&&l.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING),l.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING)&&l.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING);let i=n._getSortIconElementFromHeaderCell(l);i&&i.classList.contains(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE)&&i.classList.remove(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE)}static _getHeaderCellByIndex(e,t){if(!e.tHead)throw new Error("Table head element cannot be null.");return e.tHead.rows.item(0).cells.item(t)}static _getSortIconElementFromHeaderCell(e){return e.querySelector(`.${s.classes.TABLE_HEAD_CELL_SORT_ICON}`)}static setSelectColumnVisibility(e,t,l,i,o,a,r,c,m){let d=e.tHead,u=e.tBodies[0];!d||!u||(t?n._addSelectColumn(d,u,l,i,o,a,r,c,m):n._hasSelectColumn(d,u)&&(l&&n._detachRowSelectListeners(u,l),i&&n._detachSelectAllListener(d,i),n._destroySelectColumn(d,u)))}static _addSelectColumn(e,t,l,i,o,a,r,c,m){n._createSelectColumn(e,t,!!i,o,()=>{i&&n._tryAttachSelectAllTemplateListener(e,i)},a,r,c,m),l&&n._attachRowSelectListeners(t,l),i&&!o&&n._tryAttachSelectAllTemplateListener(e,i)}static setDenseState(e,t){e.classList.contains(s.classes.TABLE_DENSE)&&e.classList.remove(s.classes.TABLE_DENSE),t&&e.classList.add(s.classes.TABLE_DENSE)}static setRoomyState(e,t){e.classList.contains(s.classes.TABLE_ROOMY)&&e.classList.remove(s.classes.TABLE_ROOMY),t&&e.classList.add(s.classes.TABLE_ROOMY)}static setResizable(e){let t=e.tableElement.tHead;e.resizable?(e.tableElement.classList.add(s.classes.TABLE_RESIZABLE),n._addResizeHandles(t,e)):(e.tableElement.classList.remove(s.classes.TABLE_RESIZABLE),n._removeResizeHandles(t,e))}static _addResizeHandles(e,t){if(!e)return;let l=e.rows.item(0);if(l){let i=Array.from(l.cells);t.selectListener&&(i=i.slice(1));for(let o of i){let a=i.indexOf(o);if(t.columnConfigurations[a].resizable!==!1){let c=document.createElement("div");c.classList.add(s.classes.TABLE_RESIZE_HANDLE),o.appendChild(c)}}}}static _removeResizeHandles(e,t){if(!e)return;let l=e.rows.item(0);if(l){let i=Array.from(l.cells);t.selectListener&&(i=i.slice(1));for(let o of i){let a=document.querySelector(`.${s.classes.TABLE_RESIZE_HANDLE}`);a&&o.removeChild(a)}}}static setWrapContentState(e,t){t?e.classList.remove(s.classes.TABLE_NO_WRAP_CONTENT):e.classList.add(s.classes.TABLE_NO_WRAP_CONTENT)}static setSelectAllVisibility(e,t,l,i,o,a){let r=e.tHead;if(!r)return;!t&&l&&n._detachSelectAllListener(r,l);let m=r.rows[r.rows.length-1].cells.item(0);t?m.childElementCount||(m.classList.add(s.classes.TABLE_CELL_SELECT),i?n._renderSelectAllTemplate(i,r).then(()=>{l&&n._tryAttachSelectAllTemplateListener(r,l)}):m.appendChild(n._createCheckboxElement(!0,o||null,null,null,null,a)),l&&!i&&n._attachSelectAllListener(r,l)):(l&&n._detachSelectAllListener(r,l),R(m))}static setFilterRow(e){if(!e.tableElement.tHead)return;let t=n._getFilterRowElement(e.tableElement.tHead),l;if(e.filter?e.tableElement.classList.add(s.classes.TABLE_FILTER_VISIBLE):e.tableElement.classList.remove(s.classes.TABLE_FILTER_VISIBLE),e.filter&&!t){if(e.columnConfigurations.every(o=>!o.filter))return;e.selectListener&&e.selectAllListener&&(l=e.tableElement.tHead.rows[e.tableElement.tHead.rows.length-1].cells.item(0));let i=n._createFilterRowElement(e);i&&l&&Array.from(l.children).forEach(o=>{var a;(a=i.cells.item(0))==null||a.appendChild(o)})}else if(!e.filter&&t){if(e.selectListener&&e.selectAllListener){l=t.cells.item(0);let i=Array.from(e.tableElement.tHead.rows).indexOf(t)-1,o=e.tableElement.tHead.rows.item(i);o&&Array.from(l.children).forEach(a=>{var r;(r=o.cells.item(0))==null||r.appendChild(a)})}W(t)}}static _createFilterRowElement(e){if(!e.tableElement.tHead)throw new Error("Table head element cannot be null.");let t=e.tableElement.tHead.insertRow();if(p([s.classes.TABLE_ROW,s.classes.TABLE_HEAD_ROW_FILTER],t),e.selectListener){let l=document.createElement("th");p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],l),t.insertBefore(l,t.cells[0]),l.classList.add(s.classes.TABLE_CELL_SELECT)}return e.columnConfigurations.forEach((l,i)=>{let o=document.createElement("th");if(p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],o),l.filter&&f(l.filterDelegate)){let a=document.createElement("div");a.classList.add(s.classes.TABLE_HEAD_CELL_CONTAINER),l.align&&n._setCellAlignmentClass(a,l.align);let r=n._createFilterElement(l,i,e.filterListener);a.appendChild(r),o.appendChild(a)}t.appendChild(o)}),t}static _createFilterElement(e,t,l){let i;if(y(e.filterDelegate))i=e.filterDelegate();else if(e.filterDelegate instanceof X||e.filterDelegate instanceof le)i=e.filterDelegate;else throw new Error("Invalid filter delegate.");if(l&&i instanceof X&&y(i.onChange))if(!f(e.filterDebounceTime)||I(e.filterDebounceTime)){let o=f(e.filterDebounceTime)?e.filterDebounceTime:s.numbers.DEFAULT_FILTER_DEBOUNCE_TIME;i.onChange(V(a=>l(a,t),o))}else i.onChange(o=>l(o,t));return i.element}static _getFilterRowElement(e){if(e)return Array.from(e.rows).find(t=>t.classList.contains(s.classes.TABLE_HEAD_ROW_FILTER))}static async expandRow(e,t,l){let i=e.tableElement.tBodies[0],a=n._getNonExpandedRows(i.rows)[t];a.classList.add(s.classes.TABLE_ROW_EXPANDED);let r=Array.from(i.rows).indexOf(a),c=i.insertRow(r+1);p([s.classes.TABLE_ROW,s.classes.TABLE_BODY_ROW,s.classes.TABLE_ROW_EXPANDABLE_CONTENT],c);let m=c.insertCell();m.setAttribute("colspan",a.cells.length.toString()),m.classList.add(s.classes.TABLE_ROW_EXPANDABLE_CONTENT_CELL);let d=document.createElement("div"),u=document.createElement(M.elementName);u.appendChild(d),m.appendChild(u);let C=l;if(y(l)){let ue=e.data[t]?e.data[t].data:void 0,be=l(t,d,ue);try{let A=await Promise.resolve(be);C=me(A)?A.content:A}catch(A){console.error("Failed to load row template "+A.message),C=""}}C&&n._setRowTemplate(d,C),window.requestAnimationFrame(()=>u.open=!0)}static _setRowTemplate(e,t){Y(t)?e.innerHTML=t:e.appendChild(t)}static collapseRow(e,t){if(!e.tableElement||!e.tableElement.tBodies.length||!e.tableElement.tBodies[0].rows.length)return Promise.resolve();let l=e.tableElement.tBodies[0],o=n._getNonExpandedRows(l.rows)[t],a=Array.from(l.rows).indexOf(o);if(o&&o.classList.contains(s.classes.TABLE_ROW_EXPANDED)){let r=l.rows[a+1],c=r.querySelector(M.elementName);if(c&&c.open)return c.open=!1,new Promise(m=>{setTimeout(()=>{o.classList.remove(s.classes.TABLE_ROW_EXPANDED),W(r),m()},M.numbers.COLLAPSE_ANIMATION_DURATION)})}return Promise.resolve()}static isRowExpanded(e,t){let l=e.tableElement.tBodies[0],o=n._getNonExpandedRows(l.rows)[t];return o&&o.classList.contains(s.classes.TABLE_ROW_EXPANDED)}static setFixedHeaders(e){e.fixedHeaders?e.tableElement.classList.add(s.classes.TABLE_FIXED):e.tableElement.classList.remove(s.classes.TABLE_FIXED)}static setLayoutType(e){e.layoutType==="fixed"?e.tableElement.classList.add(s.classes.TABLE_LAYOUT_FIXED):e.tableElement.classList.remove(s.classes.TABLE_LAYOUT_FIXED)}static normalizeColumnWidths(e){let t=e.tableElement;if(t.tHead&&t.tHead.rows.length){let l=Array.from(t.tHead.rows[0].cells);for(let i of l){let o=getComputedStyle(i).width;i.style.width&&i.style.width!==o&&(i.style.width=o)}}}static setColumnResizeIndicatorVisibility(e,t,l){let i=e.tableElement;if(i.tHead&&i.tHead.rows.length){let o=Array.from(i.tHead.rows);for(let a of o){let r=a.cells[t];r&&(l?r.classList.add(s.classes.TABLE_CELL_RESIZABLE):r.classList.remove(s.classes.TABLE_CELL_RESIZABLE))}}if(i.tBodies.length){let o=Array.from(i.tBodies[0].rows);for(let a of o){let r=a.cells[t];r&&(l?r.classList.add(s.classes.TABLE_CELL_RESIZABLE):r.classList.remove(s.classes.TABLE_CELL_RESIZABLE))}}}static setRowClickListeners(e,t,l,i){let o=e.tBodies[0];o&&(t?n._attachRowClickListeners(o,l,i):n._detachRowClickListeners(o,l,i))}static setRowClickAttributes(e,t){let l=e.tBodies[0];l&&(t?n._addRowClickAttributes(l):n._removeRowClickAttributes(l))}static getOwnerDocument(e){return e.ownerDocument||document}static _prepend(e,t){let l=t.childNodes.item(0);l?t.insertBefore(e,l):t.appendChild(e)}static _isMac(){return!!(navigator&&navigator.platform&&navigator.platform.substr(0,3)==="Mac")}static _renderSelectAllTemplate(e,t){return Promise.resolve(e()).then(l=>{let i=t.rows.item(t.rows.length-1);if(!i)return;let o=i.cells.item(0);l&&o&&(typeof l=="string"?o.innerHTML=l:l instanceof HTMLElement&&o.appendChild(l),o.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""))})}};var N=class extends Q{constructor(t){super(t)}initialize(){this._tableElement||(this._tableElement=document.createElement("table"),this._tableElement.classList.add(s.classes.TABLE),this._component.children.length&&R(this._component),this._component.appendChild(this._tableElement))}getTableElement(){return this._tableElement||this.initialize(),this._tableElement}createTable(t){return b.createTable(t)}recreateTableBody(t){b.recreateTableBody(t)}setSelectedRows(t,l,i,o,a=!1){b.setSelectedRows(t,l,i,o,a)}clearSelectedRows(t){b.clearSelectedRows(t)}updateSelectedState(t,l){b.updateSelectedState(t,l)}updateSelectAllState(t,l,i){b.updateSelectAllState(t,l,i)}setSortedColumn(t,l,i){b.setSortedColumn(t,l,i)}removeColumnSort(t,l){b.removeColumnSort(t,l)}setSortDirection(t,l,i){b.setSortDirection(t,l,i)}setSelectColumnVisibility(t,l,i,o,a,r,c,m,d){b.setSelectColumnVisibility(t,l,i,o||null,a||null,r||null,c||[],m||null,d||null)}setDense(t,l){b.setDenseState(t,l)}setRoomy(t,l){b.setRoomyState(t,l)}setResizable(t){b.setResizable(t)}setSelectAllVisibility(t,l,i,o,a,r=null){b.setSelectAllVisibility(t,l,i,o,a||null,r||null)}setFilterRow(t){b.setFilterRow(t)}expandRow(t,l,i){return b.expandRow(t,l,i)}collapseRow(t,l){return b.collapseRow(t,l)}isRowExpanded(t,l){return b.isRowExpanded(t,l)}setFixedHeaders(t){b.setFixedHeaders(t)}setTableLayoutType(t){b.setLayoutType(t)}setWrapContentState(t){b.setWrapContentState(t.tableElement,t.wrapContent)}addDocumentListener(t,l){b.getOwnerDocument(this._component).addEventListener(t,l)}removeDocumentListener(t,l){b.getOwnerDocument(this._component).removeEventListener(t,l)}normalizeColumnWidths(t){b.normalizeColumnWidths(t)}setResizeColumnVisibility(t,l,i){b.setColumnResizeIndicatorVisibility(t,l,i)}addTableClass(t){p(t,this._tableElement)}removeTableClass(t){D(t,this._tableElement)}setRowClickListeners(t,l,i,o){b.setRowClickListeners(t,l,i,o)}setRowClickAttributes(t,l){b.setRowClickAttributes(t,l)}};var k=class{constructor(){this._sortedColumns=[]}get sortedColumns(){return[...this._sortedColumns.map(e=>h({},e))]}addSortColumn(e){this._sortedColumns.push(h({},e)),this._updateSortNumbers()}updateSortColumn(e){let t=this._sortedColumns.find(l=>l.columnIndex===e.columnIndex);if(t)switch(t.direction){case"ASC":this.removeSortColumn(e);break;case"DESC":t.direction="ASC";break;case"UNSET":t.direction="DESC";break}}setSortColumns(e){this._sortedColumns=[...e.map(t=>h({},t))]}removeSortColumn(e){typeof e=="number"?this._sortedColumns.splice(e,1):this._sortedColumns.splice(this._sortedColumns.indexOf(e),1),this._updateSortNumbers()}isSortColumn(e){return typeof e=="number"?this._sortedColumns.some(t=>t.columnIndex===e):this._sortedColumns.includes(e)}clearMultiSort(){this._sortedColumns=[]}getSortColumn(e){return this._sortedColumns.find(t=>t.columnIndex===e)}_updateSortNumbers(){this._sortedColumns.every(e=>typeof e.sortOrder=="number")&&this._sortedColumns.sort((e,t)=>e.sortOrder-t.sortOrder),this._sortedColumns.forEach((e,t)=>e.sortOrder=t+1)}};var P=class{constructor(e,t=!1){this.data=e;this.selected=t}};var z=class{constructor(e){this._adapter=e;this._tableRows=[];this._data=[];this._columnConfigurations=[];this._select=!1;this._multiselect=!0;this._dense=!1;this._roomy=!1;this._filter=!1;this._fixedHeaders=!1;this._layoutType=s.strings.DEFAULT_LAYOUT_TYPE;this._wrapContent=!0;this._resizable=!1;this._minResizeWidth=s.numbers.MIN_RESIZE_WIDTH;this._multiColumnSort=!1;this._selectCheckboxAlignment="center";this._isAllSelected=!1;this._sortedColumnIndex=-1;this._rendered=!1;this._allowRowClick=!1;this._multiSortManager=new k;this._rowClickListener=t=>this._onRowClick(t),this._rowDoubleClickListener=t=>this._onRowDoubleClick(t),this._selectRowListener=t=>this._onRowSelected(t),this._selectAllListener=t=>this._onSelectAll(t),this._headRowMouseDownListener=t=>this._onHeadRowMouseDown(t),this._headRowContextMenuListener=t=>this._onHeadRowContextMenu(t),this._documentMouseMoveListener=t=>this._onMouseMove(t),this._documentMouseUpListener=t=>this._onMouseUp(t),this._filterListener=(t,l)=>this._onFilter(t,l),this._selectionManager=new w(this._selectKey),this._hiddenColumnManager=new w}initialize(){this.connect(),this._adapter.setHostAttribute(s.attributes.SELECT,this._select.toString()),this._adapter.setHostAttribute(s.attributes.MULTISELECT,this._multiselect.toString()),this._adapter.setHostAttribute(s.attributes.DENSE,this._dense.toString()),this._adapter.setHostAttribute(s.attributes.ROOMY,this._roomy.toString()),this._adapter.setHostAttribute(s.attributes.FILTER,this._filter.toString()),this._adapter.emitHostEvent(s.events.INITIALIZED,void 0,!1)}connect(){this._adapter.initialize()}disconnect(){this._resizeDescriptor=void 0,this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.removeDocumentListener("mouseup",this._documentMouseUpListener)}set data(e){Array.isArray(e)&&e.length>0?g(e[0])?this._data=e.map(t=>h({},t)):this._data=[...e]:this._data=[],this._tableRows=this._data.map(t=>new P(t,this._selectionManager.exists(t))),this._renderBody()}get data(){return JSON.parse(JSON.stringify(this._data))}set columnConfigurations(e){this._columnConfigurations=e.map(t=>h({},t)),this._hiddenColumnManager.clear(),this._columnConfigurations.forEach(t=>{t.hidden&&this._hiddenColumnManager.add(t)}),this._refreshTableSort(),this.render()}get columnConfigurations(){return this._columnConfigurations.map(e=>h({},e))}get _visibleColumnConfigurations(){return this._columnConfigurations.filter(e=>!this._hiddenColumnManager.exists(e))}get _tableConfiguration(){return{tableElement:this._adapter.getTableElement(),columnConfigurations:this._visibleColumnConfigurations,data:this._tableRows,clickListener:this._allowRowClick?this._rowClickListener:null,doubleClickListener:this._allowRowClick?this._rowDoubleClickListener:null,selectListener:this._select?this._selectRowListener:null,selectAllListener:this._multiselect?this._selectAllListener:null,headRowMouseDownListener:this._headRowMouseDownListener,headRowContextMenuListener:this._headRowContextMenuListener,filterListener:this._filter?this._filterListener:null,sortDirection:this._sortDirection,sortedColumn:this._sortedColumnIndex,multiColumnSort:this._multiColumnSort,filter:this._filter,wrapContent:this._wrapContent,fixedHeaders:this._fixedHeaders,layoutType:this._layoutType,dense:this._dense,resizable:this._resizable,rowCreatedCallback:this._rowCreatedCallback,cellCreatedCallback:this._cellCreatedCallback,selectAllTemplate:this._selectAllTemplate,selectCheckboxAlignment:this._selectCheckboxAlignment,tooltipSelect:this._tooltipSelect,tooltipSelectAll:this._tooltipSelectAll}}set select(e){this._select!==e&&(this._select=e,this._adapter.setSelectColumnVisibility(this._adapter.getTableElement(),this._select,this._selectRowListener,this._multiselect?this._selectAllListener:void 0,this._multiselect?this._selectAllTemplate:null,this._selectCheckboxAlignment,this._tableRows,this._tooltipSelect,this._tooltipSelectAll),this._updateSelections(!0),this._select?this._adapter.setHostAttribute(s.attributes.SELECT,this._select.toString()):this._adapter.removeHostAttribute(s.attributes.SELECT))}get select(){return this._select}set multiselect(e){this._multiselect!==e&&(this._multiselect=e,this._select&&(this._adapter.setSelectAllVisibility(this._adapter.getTableElement(),this._multiselect,this._multiselect?this._selectAllListener:null,this._multiselect?this.selectAllTemplate:null,this._selectCheckboxAlignment,this._tooltipSelectAll),this._updateSelections(!0)),this._adapter.setHostAttribute(s.attributes.MULTISELECT,this._multiselect.toString()))}get multiselect(){return this._multiselect}get selectKey(){return Array.isArray(this._selectKey)?[...this._selectKey]:this._selectKey}set selectKey(e){this._originalSelectKey!==e&&(Array.isArray(e)?(this._originalSelectKey=[...e],this._selectKey=[...e]):(this._originalSelectKey=e,this._selectKey=[e]),this._selectionManager.setKey(this._selectKey),this._updateSelections(!1))}get dense(){return this._dense}set dense(e){this._dense!==e&&(this._dense=e,this._adapter.setDense(this._adapter.getTableElement(),this._dense),this._adapter.setHostAttribute(s.attributes.DENSE,this._dense.toString()))}get roomy(){return this._roomy}set roomy(e){e!==this._roomy&&(this._roomy=e,this._applyRoomy())}set filter(e){this._filter!==e&&(this._filter=e,this._adapter.setFilterRow(this._tableConfiguration),this._adapter.setHostAttribute(s.attributes.FILTER,this._filter.toString()))}get filter(){return this._filter}set fixedHeaders(e){this._fixedHeaders!==e&&(this._fixedHeaders=e,this._adapter.setFixedHeaders(this._tableConfiguration))}get fixedHeaders(){return this._fixedHeaders}get layoutType(){return this._layoutType}set layoutType(e){this._layoutType!==e&&(this._layoutType=e,this._adapter.setTableLayoutType(this._tableConfiguration))}get wrapContent(){return this._wrapContent}set wrapContent(e){this._wrapContent!==e&&(this._wrapContent=e,this._adapter.setWrapContentState(this._tableConfiguration))}get resizable(){return this._resizable}set resizable(e){this._resizable!==e&&(this._resizable=e,this._adapter.setResizable(this._tableConfiguration))}get minResizeWidth(){return this._minResizeWidth}set minResizeWidth(e){this._minResizeWidth!==e&&(this._minResizeWidth=e,I(this._minResizeWidth)?this._minResizeWidth<0&&(this._minResizeWidth=0):this._minResizeWidth=s.numbers.MIN_RESIZE_WIDTH)}get allowRowClick(){return this._allowRowClick}set allowRowClick(e){this._allowRowClick!==e&&(this._allowRowClick=e,this._rendered&&(this._adapter.setRowClickListeners(this._adapter.getTableElement(),this._allowRowClick,this._rowClickListener,this._rowDoubleClickListener),this._adapter.setRowClickAttributes(this._adapter.getTableElement(),this._allowRowClick)))}get multiColumnSort(){return this._multiColumnSort}set multiColumnSort(e){e!==this._multiColumnSort&&(this._multiColumnSort=e,this._refreshTableSort(),this.render())}get selectCheckboxAlignment(){return this._selectCheckboxAlignment}set selectCheckboxAlignment(e){e!==this._selectCheckboxAlignment&&(this._selectCheckboxAlignment=e,this._adapter.setHostAttribute(s.attributes.SELECT_CHECKBOX_ALIGNMENT,e),this.render())}get tooltipSelect(){return this._tooltipSelect}set tooltipSelect(e){e!==this._tooltipSelect&&(this._tooltipSelect=e,typeof e=="string"&&this._adapter.setHostAttribute(s.attributes.TOOLTIP_SELECT,e),this.render())}get tooltipSelectAll(){return this._tooltipSelectAll}set tooltipSelectAll(e){e!==this._tooltipSelectAll&&(this._tooltipSelectAll=e,this._adapter.setHostAttribute(s.attributes.TOOLTIP_SELECT_ALL,e),this.render())}get selectAllTemplate(){return this._selectAllTemplate}set selectAllTemplate(e){e!==this._selectAllTemplate&&(this._selectAllTemplate=e,this.render())}get rowCreated(){return this._rowCreatedCallback}set rowCreated(e){this._rowCreatedCallback=e}get cellCreated(){return this._cellCreatedCallback}set cellCreated(e){this._cellCreatedCallback=e}isRowSelected(e){let t=v(Array.isArray(this._selectKey)?this._selectKey:[this._selectKey],e);return this.selectKey?!!this._selectionManager.getItems().find(l=>K(l,t)):this._selectionManager.exists(e)}getSelectedRows(){return this._selectionManager.getItems()}selectRows(e,t){if(!this._selectKey)throw new Error("You must set a selectKey to select rows.");(!this._multiselect||t)&&this.clearSelections(),e&&e.length&&(this._selectionManager.add(e),this._updateSelections(!t))}deselectRows(e){e&&e.length&&(this._selectionManager.remove(e),this._updateSelections(!1))}clearSelections(){let e=this._adapter.getTableElement();this._selectionManager.clear(),this._tableRows.forEach(t=>t.selected=!1),this._isAllSelected=!1,this._adapter.clearSelectedRows(e),this._select&&this._multiselect&&this._adapter.updateSelectAllState(e,!1)}hideColumn(e){let t=this._columnConfigurations[e];this._sortedColumnIndex===e&&(this._sortedColumnIndex=-1),this._hiddenColumnManager.exists(t)||(this._hiddenColumnManager.add(t),this.render())}showColumn(e){let t=this._columnConfigurations[e];this._hiddenColumnManager.exists(t)&&(this._hiddenColumnManager.remove(t),this.render())}isColumnHidden(e){let t=this._columnConfigurations[e];return!!t&&this._hiddenColumnManager.exists(t)}render(){this._adapter.createTable(this._tableConfiguration),this._renderSelections(),this._rendered=!0}_renderBody(){this._rendered&&(this._adapter.recreateTableBody(this._tableConfiguration),this._renderSelections())}_renderSelections(){this.select&&(this._isAllSelected=this._getSelectAllState(),this._multiselect&&this._adapter.updateSelectAllState(this._adapter.getTableElement(),this._isAllSelected,this._isIndeterminate(this._isAllSelected)));let e=this._selectionManager.getItems();e.length&&this._adapter.setSelectedRows(this._adapter.getTableElement(),this._selectKey,this._data,e,!1)}expandRow(e,t){if(!this._rendered)throw new Error("Cannot expand a row before the table has rendered.");if(e<0||e>this._tableRows.length)throw new Error(`Invalid row index: ${e}.`);return this._adapter.expandRow(this._tableConfiguration,e,t)}collapseRow(e){return!this._rendered||e<0||e>this._tableRows.length?Promise.resolve():this._adapter.collapseRow(this._tableConfiguration,e)}isRowExpanded(e){return this._adapter.isRowExpanded(this._tableConfiguration,e)}selectRowsByIndex(e,t){let l=e.map(i=>this._data[i]).filter(i=>!!i);this.selectRows(l,!t)}deselectRowsByIndex(e){let t=e.map(l=>this._data[l]).filter(l=>!!l);this.deselectRows(t)}_getSelectAllState(){return this._tableRows.length>0&&this._tableRows.every(e=>e.selected)}_updateSelections(e){this._tableRows.forEach(l=>l.selected=this._selectionManager.exists(l.data));let t=this._getSelectAllState();this._adapter.setSelectedRows(this._adapter.getTableElement(),this._selectKey,this._data,this._selectionManager.getItems(),e),(t!==this._isAllSelected||this._isIndeterminate(t))&&(this._isAllSelected=t,this._multiselect&&this._adapter.updateSelectAllState(this._adapter.getTableElement(),this._isAllSelected,this._isIndeterminate(this._isAllSelected)))}_onRowClick(e){if(e.stopImmediatePropagation(),e.target.tagName==="INPUT"&&e.target.type==="checkbox")return;let i=H(e).filter(m=>m.nodeType===1).find(m=>m.hasAttribute(s.attributes.CUSTOM_CELL_TEMPLATE));if(i&&i.hasAttribute(s.attributes.CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION))return;let{index:a,data:r}=this._getSelectedRowFromEvent(e),c={index:a,data:r};this._adapter.emitHostEvent(s.events.ROW_CLICK,c,!0,!1)}_onRowDoubleClick(e){if(e.stopPropagation(),e.target.tagName==="INPUT"&&e.target.type==="checkbox")return;let t=this._getSelectedRowFromEvent(e),l={index:t.index,data:t.data};this._adapter.emitHostEvent(s.events.SELECT_DOUBLE,l,!0,!1)}_onRowSelected(e){let t=this._getSelectedRowFromEvent(e);this._multiselect||this._tableRows.filter(r=>r.selected).forEach(r=>{K(r.data,v(this._selectKey,t.data))||this.deselectRows([r.data])});let l=!this._selectionManager.exists(t.data);this._adapter.updateSelectedState(t.rowElement,l),l?this._selectionManager.add(t.data):this._selectionManager.remove(t.data),this._tableRows[t.index].selected=l;let i=[t.index],o=!1;if(this._multiselect){if(e.shiftKey&&this._previouslyClickedRow&&(i=this._shiftSelectRows(t),i.includes(this._previouslyClickedRow.index))){let r=i.indexOf(this._previouslyClickedRow.index);i.splice(r,1)}o=this._getSelectAllState(),this._adapter.updateSelectAllState(this._adapter.getTableElement(),o,this._isIndeterminate(o))}for(let a of i){let r=this._tableRows[a].data,m={selected:this._selectionManager.exists(r),index:a,data:r};this._adapter.emitHostEvent(s.events.SELECT,m,!0,!1)}if(this._isAllSelected!==o){this._isAllSelected=o;let a={status:this._isAllSelected,count:this._tableRows.filter(r=>r.selected).length,data:[...this._data],targetType:"row"};this._adapter.emitHostEvent(s.events.SELECT_ALL,a,!0,!1)}this._previouslyClickedRow=h({},t)}_getSelectedRowFromEvent(e){let l=H(e).find(r=>r.tagName==="TR"),i=l.parentElement,o=this._getNonExpandedRows(i).findIndex(r=>r===l),a=this._tableRows[o].data;return{rowElement:l,index:o,data:a}}_getNonExpandedRows(e){return Array.from(e.rows).filter(t=>!t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}_onSelectAll(e){e.stopPropagation(),this._isAllSelected=!this._isAllSelected;let t=this._adapter.getTableElement();this._adapter.updateSelectAllState(t,this._isAllSelected),this._tableRows.forEach((i,o)=>{i.selected=this._isAllSelected,this._isAllSelected?this._selectionManager.add(i.data):this._selectionManager.remove(i.data);let a=b.getRowByIndex(t,o);a&&this._adapter.updateSelectedState(a,this._isAllSelected)});let l={status:this._isAllSelected,count:this._tableRows.filter(i=>i.selected).length,data:[...this._data],targetType:"select-all"};this._adapter.emitHostEvent(s.events.SELECT_ALL,l,!0,!1)}_onHeadRowContextMenu(e){e.preventDefault()}_onHeadRowMouseDown(e){if(e.button!==0)return;let t=H(e),l=e.target,i=t.find(r=>r.tagName==="TR"),o=t.find(r=>r.tagName==="TH"),a=Array.from(i.cells).findIndex(r=>r===o);this._headCellMouseDownIndex=a,l!==o&&l.classList.contains(s.classes.TABLE_RESIZE_HANDLE)&&(this._resizeDescriptor={element:o,startWidth:o.offsetWidth,startX:e.pageX,width:o.offsetWidth,index:this._select?a-1:a},this._adapter.addDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.setResizeColumnVisibility(this._tableConfiguration,a,!0)),this._adapter.addDocumentListener("mouseup",this._documentMouseUpListener)}_onMouseMove(e){if(this._resizeDescriptor){let t=this._resizeDescriptor.startWidth+(e.pageX-this._resizeDescriptor.startX);t<this._minResizeWidth&&(t=this._minResizeWidth),this._resizeDescriptor.width=t,this._resizeDescriptor.element.style.width=`${t}px`,this._adapter.addTableClass(s.classes.TABLE_RESIZING)}}_onMouseUp(e){if(this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.removeDocumentListener("mouseup",this._documentMouseUpListener),this._adapter.removeTableClass(s.classes.TABLE_RESIZING),this._headCellMouseDownIndex!==void 0){if(this._resizeDescriptor){this._adapter.normalizeColumnWidths(this._tableConfiguration),this._adapter.setResizeColumnVisibility(this._tableConfiguration,this._headCellMouseDownIndex,!1);let t={index:this._resizeDescriptor.index,width:this._resizeDescriptor.width};this._adapter.emitHostEvent(s.events.COLUMN_RESIZE,t),this._resizeDescriptor=void 0}else this._tableConfiguration.tableElement.tHead.contains(e.target)&&(this._multiColumnSort?this._onMultiSort(this._headCellMouseDownIndex,e.ctrlKey):this._onSort(this._headCellMouseDownIndex));this._headCellMouseDownIndex=void 0}}_onSort(e){let t=this._select?e-1:e,l=t>=0?this._visibleColumnConfigurations[t]:null;if(!l||!l.sortable)return;let i="ASC",o=t===this._sortedColumnIndex,a=this._sortDirection==="ASC"||this._sortDirection===void 0,r=o&&this._sortDirection==="DESC";o&&a&&(i="DESC"),r&&!l.preventUnsort&&(i="UNSET");let c={direction:i,columnIndex:t};if(this._adapter.emitHostEvent(s.events.SORT,c,!0,!0)){if(o&&this._sortDirection==="DESC"&&!l.preventUnsort){this._adapter.removeColumnSort(this._adapter.getTableElement(),this._select?this._sortedColumnIndex+1:this._sortedColumnIndex),this._sortedColumnIndex=-1;return}this._sortDirection=i,t===this._sortedColumnIndex?this._adapter.setSortDirection(this._adapter.getTableElement(),e,this._sortDirection):(this._sortedColumnIndex>=0&&this._adapter.removeColumnSort(this._adapter.getTableElement(),this._select?this._sortedColumnIndex+1:this._sortedColumnIndex),this._sortedColumnIndex=t,this._adapter.setSortedColumn(this._adapter.getTableElement(),e,this._sortDirection))}}_onMultiSort(e,t){let l=this._select?e-1:e,i=l>=0?this._visibleColumnConfigurations[l]:null;if(!i||!i.sortable)return;let o=this._multiSortManager.sortedColumns,a=this._multiSortManager.getSortColumn(l);a?this._multiSortManager.updateSortColumn(a):t?this._multiSortManager.addSortColumn({direction:"DESC",columnIndex:l,propertyName:i.property}):(this._multiSortManager.clearMultiSort(),this._multiSortManager.addSortColumn({direction:"DESC",columnIndex:l,propertyName:i.property}));let r=this._multiSortManager.sortedColumns.map(d=>h({},d));if(!this._adapter.emitHostEvent(s.events.SORT,r,!0,!0)){this._multiSortManager.setSortColumns(o);return}let m=this._multiSortManager.sortedColumns.length>1;for(let d=0;d<this._visibleColumnConfigurations.length;d++){let u=this._select?d+1:d;if(!this._multiSortManager.isSortColumn(d))this._adapter.removeColumnSort(this._adapter.getTableElement(),u),b.setMultiSortColumnSortNumber(this._adapter.getTableElement(),m,u,null);else{let C=this._multiSortManager.getSortColumn(d);C&&(this._adapter.setSortedColumn(this._adapter.getTableElement(),u,C.direction),b.setMultiSortColumnSortNumber(this._adapter.getTableElement(),m,u,C.sortOrder||null))}}}_onFilter(e,t){let l={value:e,columnIndex:t};this._adapter.emitHostEvent(s.events.FILTER,l,!0,!1)}_shiftSelectRows(e){let t=[];if(this._previouslyClickedRow){let l=this._previouslyClickedRow.index,i=e.index,o=i>=l?l:i,a=i>=l?i:l;a+=a>o?1:0,o+=o>a?1:0;let r=d=>this.selectRows(d,!1),c=this._tableRows.find(d=>d.selected&&d.data===e.data),m=this._tableRows.find(d=>{var u;return d.data===((u=this._previouslyClickedRow)==null?void 0:u.data)&&!d.selected});(!c||m)&&(r=d=>this.deselectRows(d));for(let d=o;d<a;d++)t.push(d);r(this.data.filter((d,u)=>t.includes(u)))}return t}_isIndeterminate(e){return!e&&this.getSelectedRows().length>0&&this._data.length!==this.getSelectedRows().length}_applyRoomy(){this._adapter.setRoomy(this._adapter.getTableElement(),this._roomy),this._adapter.setHostAttribute(s.attributes.ROOMY,this._roomy.toString())}_refreshTableSort(){if(this._sortedColumnIndex=this._visibleColumnConfigurations.findIndex(e=>e.initialSort),this._sortDirection=this._sortedColumnIndex>=0?this._visibleColumnConfigurations[this._sortedColumnIndex].sortDirection:void 0,this._multiColumnSort){let e=[];this._visibleColumnConfigurations.forEach((t,l)=>{typeof t.initialSort=="object"&&e.push({columnIndex:l,direction:t.initialSort.direction,sortOrder:t.initialSort.sortOrder,propertyName:t.property})}),this._multiSortManager.setSortColumns(e)}}};var E=class extends J{constructor(){super();se.define(te),this._foundation=new z(new N(this))}static get observedAttributes(){return[s.attributes.SELECT,s.attributes.MULTISELECT,s.attributes.SELECT_KEY,s.attributes.DENSE,s.attributes.ROOMY,s.attributes.FILTER,s.attributes.FIXED_HEADERS,s.attributes.LAYOUT_TYPE,s.attributes.WRAP_CONTENT,s.attributes.RESIZABLE,s.attributes.MIN_RESIZE_WIDTH,s.attributes.ALLOW_ROW_CLICK,s.attributes.MULTI_COLUMN_SORT,s.attributes.SELECT_CHECKBOX_ALIGNMENT,s.attributes.TOOLTIP_SELECT,s.attributes.TOOLTIP_SELECT_ALL]}initializedCallback(){this._foundation.initialize()}connectedCallback(){this._foundation.connect()}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,l,i){switch(t){case s.attributes.SELECT:this.select=L(i);break;case s.attributes.MULTISELECT:this.multiselect=L(i);break;case s.attributes.SELECT_KEY:this.selectKey=i;break;case s.attributes.DENSE:this.dense=L(i);break;case s.attributes.ROOMY:this.roomy=L(i);break;case s.attributes.FILTER:this.filter=L(i);break;case s.attributes.FIXED_HEADERS:this.fixedHeaders=L(i);break;case s.attributes.LAYOUT_TYPE:this.layoutType=i;break;case s.attributes.WRAP_CONTENT:this.wrapContent=L(i);break;case s.attributes.RESIZABLE:this.resizable=L(i);break;case s.attributes.MIN_RESIZE_WIDTH:this.minResizeWidth=G(i);break;case s.attributes.ALLOW_ROW_CLICK:this.allowRowClick=L(i);break;case s.attributes.MULTI_COLUMN_SORT:this.multiColumnSort=L(i);break;case s.attributes.SELECT_CHECKBOX_ALIGNMENT:this.selectCheckboxAlignment=this.getAttribute(s.attributes.SELECT_CHECKBOX_ALIGNMENT)||"center";break;case s.attributes.TOOLTIP_SELECT:this.tooltipSelect=i;break;case s.attributes.TOOLTIP_SELECT_ALL:this.tooltipSelectAll=i;break}}hideColumn(t){this._foundation.hideColumn(t)}showColumn(t){this._foundation.showColumn(t)}isColumnHidden(t){return this._foundation.isColumnHidden(t)}getSelectedRows(){return this._foundation.getSelectedRows()}selectRow(t){this._foundation.selectRows([t],!1)}selectRows(t,l=!1){this._foundation.selectRows(t,!l)}deselectRow(t){this._foundation.deselectRows([t])}deselectRows(t){this._foundation.deselectRows(t)}clearSelections(){this._foundation.clearSelections()}render(){this._foundation.render()}expandRow(t,l){return this._foundation.expandRow(t,l)}collapseRow(t){return this._foundation.collapseRow(t)}isRowExpanded(t){return this._foundation.isRowExpanded(t)}selectRowsByIndex(t,l){typeof t=="number"?this._foundation.selectRowsByIndex([t],l):Array.isArray(t)&&this._foundation.selectRowsByIndex(t,l)}deselectRowsByIndex(t){typeof t=="number"?this._foundation.deselectRowsByIndex([t]):Array.isArray(t)&&this._foundation.deselectRowsByIndex(t)}isRowSelected(t){return this._foundation.isRowSelected(t)}};_([T()],E.prototype,"data",2),_([T()],E.prototype,"columnConfigurations",2),_([T()],E.prototype,"select",2),_([T()],E.prototype,"multiselect",2),_([T()],E.prototype,"selectKey",2),_([T()],E.prototype,"tooltipSelect",2),_([T()],E.prototype,"tooltipSelectAll",2),_([T()],E.prototype,"dense",2),_([T()],E.prototype,"roomy",2),_([T()],E.prototype,"filter",2),_([T()],E.prototype,"fixedHeaders",2),_([T()],E.prototype,"layoutType",2),_([T()],E.prototype,"wrapContent",2),_([T()],E.prototype,"resizable",2),_([T()],E.prototype,"minResizeWidth",2),_([T()],E.prototype,"allowRowClick",2),_([T()],E.prototype,"multiColumnSort",2),_([T()],E.prototype,"rowCreated",2),_([T()],E.prototype,"cellCreated",2),_([T()],E.prototype,"selectAllTemplate",2),_([T()],E.prototype,"selectCheckboxAlignment",2),E=_([j({name:s.elementName,dependencies:[ae,oe,ce]})],E);function pl(){q(E)}export{s as a,B as b,O as c,Le as d,N as e,P as f,z as g,E as h,pl as i};
7
- //# sourceMappingURL=chunk.MZNL36GJ.js.map
6
+ import{c as re,f as ce}from"./chunk.2XFVFZ3P.js";import{a as M,d as ae}from"./chunk.ECRL6O3V.js";import{a as ne}from"./chunk.WO7KEM5K.js";import{a as $,b as x,c as v,d as K}from"./chunk.UV3WIHCM.js";import{a as H}from"./chunk.LEVFMI2Q.js";import{b as te}from"./chunk.FYWPZFLJ.js";import{a as ie,d as se,l as oe}from"./chunk.H5D54EHO.js";import{a as X}from"./chunk.G4IN6Y46.js";import{a as le}from"./chunk.RFLASSCI.js";import{a as T}from"./chunk.NVUMRW44.js";import{a as Q}from"./chunk.5V5ABSHI.js";import{a as j,b as ee}from"./chunk.DTZFWZPB.js";import{a as q,k as J}from"./chunk.NK7H3MMM.js";import{d as R,e as F,f as p,g as D,i as W,j as U,t as Z}from"./chunk.CFDK4RCW.js";import{b as f,c as Y,d as I,h as y,j as g,k as L,l as G,o as V}from"./chunk.J2M2MXP2.js";import{a as h,d as _}from"./chunk.M3QDAYD2.js";var w=class{constructor(e){this._key=e,this._items=[]}getItems(){return[...this._items]}count(){return this._items.length}setKey(e){this._key=e}add(e){return e instanceof Array||(e=[e]),e.forEach(t=>{this.exists(t)||this._items.push(t)}),this}remove(e){e instanceof Array||(e=[e]);for(let t=e.length-1;t>=0;t--)this.exists(e[t])&&this._items.splice(this._items.indexOf(this._getItem(e[t])),1);return this}clear(){return this._items=[],this}exists(e){return this._getItem(e)!==null}_getItem(e){return this._key?x(this._items,v(this._key,e))||null:this._items.find(t=>t===e)||null}};var S=`${ee}table`,de={TABLE:"forge-table",TABLE_DENSE:"forge-table--dense",TABLE_ROOMY:"forge-table--roomy",TABLE_RESIZABLE:"forge-table--resizable",TABLE_RESIZING:"forge-table--resizing",TABLE_RESIZE_HANDLE:"forge-table__resize-handle",TABLE_NO_WRAP_CONTENT:"forge-table--no-wrap-content",TABLE_LAYOUT_FIXED:"forge-table--layout-fixed",TABLE_FILTER_VISIBLE:"forge-table--filter-visible",TABLE_FIXED:"forge-table--fixed",TABLE_HEAD:"forge-table-head",TABLE_HEAD_ROW:"forge-table-head__row",TABLE_HEAD_ROW_FILTER:"forge-table-head__row__filter",TABLE_HEAD_CELL:"forge-table-head__cell",TABLE_HEAD_CELL_CONTAINER:"forge-table-head__cell-container",TABLE_HEAD_CELL_SORTABLE:"forge-table-head__cell--sortable",TABLE_HEAD_CELL_SORT_ICON:"forge-table-head__cell-sort-icon",TABLE_HEAD_CELL_TEXT:"forge-table-head__cell-text",TABLE_HEAD_CELL_SORT_ICON_ACTIVE:"forge-table-head__cell-sort-icon--active",TABLE_HEAD_CELL_SORTED_ASCENDING:"forge-table-head__cell--sorted-ascending",TABLE_HEAD_CELL_SORTED_DESCENDING:"forge-table-head__cell--sorted-descending",TABLE_HEAD_CELL_SORT_ORDER:"forge-table-head__cell__sort-order",TABLE_HEAD_CELL_SORT_ORDER_HIDDEN:"forge-table-head__cell__sort-order--hidden",TABLE_BODY:"forge-table-body",TABLE_BODY_ROW:"forge-table-body__row",TABLE_BODY_ROW_SELECTED:"forge-table-body__row--selected",TABLE_BODY_ROW_CLICKABLE:"forge-table-body__row--clickable",TABLE_BODY_CELL:"forge-table-body__cell",TABLE_ROW:"forge-table-row",TABLE_ROW_EXPANDED:"forge-table-row--expanded",TABLE_ROW_EXPANDABLE_CONTENT:"forge-table-row__expandable-content",TABLE_ROW_EXPANDABLE_CONTENT_CELL:"forge-table-row__expandable-content-cell",TABLE_CELL:"forge-table-cell",TABLE_CELL_SELECT:"forge-table-cell__select",TABLE_CELL_SELECT_CHECKBOX:"forge-table-cell__select-checkbox",TABLE_CELL_SELECT_CHECKBOX_CONTAINER:"forge-table-cell__select-checkbox-container",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_RIGHT:"forge-table-cell__select-checkbox-container--align-right",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_LEFT:"forge-table-cell__select-checkbox-container--align-left",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_CENTER:"forge-table-cell__select-checkbox-container--align-center",TABLE_CELL_CONTAINER:"forge-table-cell__container",TABLE_CELL_CONTAINER_TEXT:"forge-table-cell__container-text",TABLE_CELL_CENTER:"forge-table-cell--center",TABLE_CELL_RIGHT:"forge-table-cell--right",TABLE_CELL_RESIZABLE:"forge-table-cell--resizing"},Ee={TABLE:".forge-table",CHECKBOX_INPUT:"forge-checkbox > input[type=checkbox]:not([forge-ignore])",SELECT_ALL_TEMPLATE_CHECKBOX_INPUT:"input[type=checkbox]:not([forge-ignore])",ROW_SELECTED:`.${de.TABLE_BODY_ROW_SELECTED}`},_e={SELECT:"select",MULTISELECT:"multiselect",SELECT_KEY:"select-key",DENSE:"dense",ROOMY:"roomy",FILTER:"filter",FIXED_HEADERS:"fixed-headers",LAYOUT_TYPE:"layout-type",WRAP_CONTENT:"wrap-content",RESIZABLE:"resizable",MIN_RESIZE_WIDTH:"min-resize-width",ALLOW_ROW_CLICK:"allow-row-click",MULTI_COLUMN_SORT:"multi-column-sort",SELECT_CHECKBOX_ALIGNMENT:"select-checkbox-alignment",TOOLTIP_SELECT:"tooltip-select",TOOLTIP_SELECT_ALL:"tooltip-select-all",CHECKBOX_TYPE:"forge-checkbox-type",CUSTOM_CELL_TEMPLATE:"data-cell-template",CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION:"data-cell-template-stop-propagation"},Te={ROW_CLICK:`${S}-row-click`,SELECT:`${S}-select`,SELECT_DOUBLE:`${S}-select-double`,SELECT_ALL:`${S}-select-all`,SORT:`${S}-sort`,FILTER:`${S}-filter`,INITIALIZED:`${S}-initialized`,COLUMN_RESIZE:`${S}-column-resize`},pe={SELECT_ALL:"select-all",SELECT_ROW:"select-row",DEFAULT_LAYOUT_TYPE:"auto"},Ce={SORT_DOWN:"arrow_downward"},he={DEFAULT_FILTER_DEBOUNCE_TIME:750,MIN_RESIZE_WIDTH:100,RESIZE_HOVER_DURATION:150},s={elementName:S,classes:de,selectors:Ee,attributes:_e,events:Te,strings:pe,icons:Ce,numbers:he};var B=(l=>(l.Left="left",l.Right="right",l.Center="center",l))(B||{}),O=(l=>(l.Ascending="ASC",l.Descending="DESC",l.Unset="UNSET",l))(O||{}),Le=(a=>(a.InputText="text",a.InputNumber="number",a.Select="select",a.SelectMultiple="select-multiple",a.Date="date",a.DateRange="date-range",a))(Le||{});function me(n){return n&&typeof n=="object"&&"content"in n}var b=class n{static createTable(e){n._resetTable(e.tableElement);let t=n._createTableHead(e),l=n._createTableBody(e);e.clickListener&&(n._attachRowClickListeners(l,e.clickListener,e.doubleClickListener),n._addRowClickAttributes(l)),e.fixedHeaders&&n.setFixedHeaders(e),e.resizable&&n.setResizable(e),e.dense&&n.setDenseState(e.tableElement,e.dense),e.wrapContent&&n.setWrapContentState(e.tableElement,e.wrapContent),e.selectListener&&n._addSelectColumn(t,l,e.selectListener,e.selectAllListener,e.selectAllTemplate,e.selectCheckboxAlignment,e.data,e.tooltipSelect,e.tooltipSelectAll),(e.resizable||e.columnConfigurations.some(i=>!!i.sortable))&&(n._attachHeadRowMouseDownListener(t,e.headRowMouseDownListener),n._isMac()&&n._attachHeadRowContextMenuListener(t,e.headRowContextMenuListener)),n.setLayoutType(e),n._setTableHead(e.tableElement,t),e.filter&&n.setFilterRow(e),n._setTableBody(e.tableElement,l)}static _setTableHead(e,t){e.tHead?F(t,e.tHead):e.appendChild(t)}static _setTableBody(e,t){e.tBodies.length?F(t,e.tBodies[0]):e.appendChild(t)}static recreateTableBody(e){let t=n._createTableBody(e);e.clickListener&&(n._attachRowClickListeners(t,e.clickListener,e.doubleClickListener),n._addRowClickAttributes(t)),e.selectListener&&(n._createBodySelectColumn(t,e.selectCheckboxAlignment,e.data,e.tooltipSelect,e.tooltipSelectAll),n._attachRowSelectListeners(t,e.selectListener)),n._setTableBody(e.tableElement,t)}static _resetTable(e){R(e)}static _createMultisortTooltip(){let e=document.createElement(ne.elementName);return e.textContent="Ctrl + click to sort multiple columns",e.position="bottom",e.delay=0,e}static _createTableHead(e){let t=document.createElement("thead"),l=t.insertRow();p([s.classes.TABLE_ROW,s.classes.TABLE_HEAD_ROW],l);let i=!1;for(let o=0;o<e.columnConfigurations.length;o++){let a=e.columnConfigurations[o],r=document.createElement("th");r.scope="col",p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],r);let c=document.createElement("div");if(c.classList.add(s.classes.TABLE_HEAD_CELL_CONTAINER),e.multiColumnSort){let d=n._createMultisortTooltip();c.appendChild(d)}if(a.align&&n._setCellAlignmentClass(c,a.align),f(a.width)){let d=U(a.width);d&&(r.style.width=d)}if(e.resizable&&a.resizable!==!1){let d=document.createElement("div");d.classList.add(s.classes.TABLE_RESIZE_HANDLE),r.appendChild(d)}f(a.headerCellStyle)&&g(a.headerCellStyle)&&(Object.assign(r.style,a.headerCellStyle),Object.assign(c.style,a.headerCellStyle));let m=document.createElement("span");if(m.classList.add(s.classes.TABLE_HEAD_CELL_TEXT),m.textContent=a.header&&typeof a.header=="string"?a.header.trim():"",a.sortable){r.classList.add(s.classes.TABLE_HEAD_CELL_SORTABLE);let d=document.createElement("span");p([s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN,s.classes.TABLE_HEAD_CELL_SORT_ORDER],d);let u=document.createElement(ie.elementName);u.name=s.icons.SORT_DOWN,p([s.classes.TABLE_HEAD_CELL_SORT_ICON],u),e.multiColumnSort?typeof a.initialSort=="object"&&a.initialSort.sortOrder&&(d.textContent=a.initialSort.sortOrder.toString(),e.columnConfigurations.filter(C=>typeof C.initialSort=="object").length>1&&D(s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN,d),r.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),u.classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(r,a.initialSort.direction)):e.sortedColumn===o&&!i&&!e.multiColumnSort&&(r.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),u.classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(r,e.sortDirection),i=!0),c.appendChild(u),c.appendChild(d)}typeof a.headerTemplate=="function"?Promise.resolve(a.headerTemplate(o,c,a)).then(d=>{if(d){let u=document.createElement("div");p(s.classes.TABLE_CELL_CONTAINER,u),typeof d=="string"?u.innerHTML=d:n._prepend(d,u),u.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""),n._prepend(u,c)}}):n._prepend(m,c),r.appendChild(c),l.appendChild(r)}return t}static setSortDirection(e,t,l){let i=n._getHeaderCellByIndex(e,t);n._setColumnSortDirection(i,l)}static _setColumnSortDirection(e,t){e.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)&&e.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING),e.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING)&&e.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),!t||t==="DESC"?e.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING):e.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)}static _createTableBody(e){let t=document.createElement("tbody");return n._getOrderedRowData(e.columnConfigurations,e.data).forEach((i,o)=>{let a=t.insertRow();p([s.classes.TABLE_ROW,s.classes.TABLE_BODY_ROW],a),n._populateRowCells(e,a,i,o),typeof e.rowCreatedCallback=="function"&&e.rowCreatedCallback(a,o,h({},e.data[o].data))}),t}static _populateRowCells(e,t,l,i){for(let o=0;o<l.length;o++){let a=e.columnConfigurations[o],r=t.insertCell();if(p([s.classes.TABLE_CELL,s.classes.TABLE_BODY_CELL],r),f(a.width)){let m=U(a.width);m&&(r.style.width=m)}let c=document.createElement("div");if(c.classList.add(s.classes.TABLE_CELL_CONTAINER),f(a.cellStyle)&&g(a.cellStyle)&&(Object.assign(r.style,a.cellStyle),Object.assign(c.style,a.cellStyle)),a.template&&typeof a.template=="function"){let m=e.data[i]?e.data[i].data:void 0;Promise.resolve(a.template(i,c,m,o)).then(d=>{let u=me(d)?d:{content:d,stopClickPropagation:a.stopCellTemplateClickPropagation};u.content&&(typeof u.content=="string"?c.innerHTML=u.content:c.appendChild(u.content),c.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""),u.stopClickPropagation&&c.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION,""))})}else if(a.property){let m=document.createElement("span");m.classList.add(s.classes.TABLE_CELL_CONTAINER_TEXT),c.appendChild(m),a.transform&&typeof a.transform=="function"?Promise.resolve(a.transform(l[o])).then(d=>m.textContent=d):l[o]==null?m.textContent="":m.textContent=l[o].toString()}if(a.align&&n._setCellAlignmentClass(c,a.align),r.appendChild(c),f(a.columnSpan)){if(a.columnSpan==="all"){r.colSpan=l.length-o;break}else if(typeof a.columnSpan=="number"&&a.columnSpan>0){let m=a.columnSpan;a.columnSpan>l.length-o&&(m=l.length),r.colSpan=m,o=o+(m-1)}}typeof e.cellCreatedCallback=="function"&&e.cellCreatedCallback(r,i,o)}}static _setCellAlignmentClass(e,t){switch(t){case"center":e.classList.add(s.classes.TABLE_CELL_CENTER);break;case"right":e.classList.add(s.classes.TABLE_CELL_RIGHT);break}}static _getNonExpandedRows(e){return Array.from(e).filter(t=>!t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}static _getExpandedRows(e){return Array.from(e).filter(t=>t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}static _createColumnDataMap(e,t){return e.map(l=>({config:l,data:t.map(i=>{if(l.property){let o=$(i.data,l.property);return f(o)?o:null}return null})}))}static _getOrderedRowData(e,t){let l=n._createColumnDataMap(e,t),i=[];for(let o of l)for(let a=0;a<o.data.length;a++)i[a]||(i[a]=[]),i[a].push(o.data[a]);return i}static _attachRowClickListeners(e,t,l){n._getNonExpandedRows(e.rows).forEach(o=>{o.addEventListener("click",t),l&&o.addEventListener("dblclick",l)})}static _addRowClickAttributes(e){n._getNonExpandedRows(e.rows).forEach(l=>{l.classList.add(s.classes.TABLE_BODY_ROW_CLICKABLE)})}static _removeRowClickAttributes(e){n._getNonExpandedRows(e.rows).forEach(l=>{l.classList.remove(s.classes.TABLE_BODY_ROW_CLICKABLE)})}static _attachRowSelectListeners(e,t){n._getNonExpandedRows(e.rows).forEach(i=>n._attachRowSelectListener(i,t))}static _attachRowSelectListener(e,t){let l=n._getCheckboxElement(e);l==null||l.addEventListener("click",t)}static _detachRowSelectListeners(e,t){Array.from(e.rows).forEach(l=>{let i=n._getCheckboxElement(l);i==null||i.removeEventListener("click",t)})}static _detachRowClickListeners(e,t,l){Array.from(e.rows).forEach(i=>{i.removeEventListener("click",t),i.removeEventListener("dblclick",l)})}static _attachSelectAllListener(e,t){let l=e.rows[e.rows.length-1],i=n._getCheckboxElement(l);if(!i)throw new Error("Checkbox element not found.");i.addEventListener("change",t)}static _tryAttachSelectAllTemplateListener(e,t){let l=e.rows[e.rows.length-1],i=n._tryGetSelectAllCheckboxElement(l);i&&i.addEventListener("change",t)}static _detachSelectAllListener(e,t){let l=e.rows[e.rows.length-1],i=n._tryGetSelectAllCheckboxElement(l);i&&i.removeEventListener("change",t)}static _attachHeadRowMouseDownListener(e,t){let l=e.rows[0];if(!l)throw new Error("Missing table header row. Unable to attach sort listener.");l.addEventListener("mousedown",t)}static _attachHeadRowContextMenuListener(e,t){let l=e.rows[0];if(!l)throw new Error("Missing table header row. Unable to attach sort listener.");l.addEventListener("contextmenu",t)}static _createSelectColumn(e,t,l,i,o,a,r,c,m){e&&n._createHeadSelectColumn(e,l,i,o,a,m),t&&n._createBodySelectColumn(t,a,r,c,m)}static _createHeadSelectColumn(e,t,l,i,o,a){var r;if(Array.from(e.rows).forEach(c=>{let m=document.createElement("th");p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],m),c.insertBefore(m,c.cells.item(0))}),t){let c=(r=e.rows.item(e.rows.length-1))==null?void 0:r.cells.item(0);c.classList.add(s.classes.TABLE_CELL_SELECT),typeof l=="function"?n._renderSelectAllTemplate(l,e).then(()=>{typeof i=="function"&&i()}):c==null||c.appendChild(n._createCheckboxElement(!0,o,null,null,null,a))}}static _createBodySelectColumn(e,t,l,i,o){if(n._getNonExpandedRows(e.rows).forEach((r,c)=>n._addRowSelectColumn(r,t,c,l[c],i,o)),e.rows.length){let r=e.rows.item(0);r&&n._updateExpandedRowColspan(e.rows,r.cells.length)}}static _addRowSelectColumn(e,t,l,i,o,a){let r=e.insertCell(0);p([s.classes.TABLE_CELL,s.classes.TABLE_BODY_CELL,s.classes.TABLE_CELL_SELECT],r),r.appendChild(n._createCheckboxElement(!1,t,l,i,o,a))}static _destroySelectColumn(e,t){let l=n._getNonExpandedRows(t.rows);if(Array.from(e.rows).forEach(i=>i.removeChild(i.cells.item(0))),Array.from(l).forEach(i=>i.removeChild(i.cells.item(0))),t.rows.length){let i=t.rows.item(0);i&&n._updateExpandedRowColspan(t.rows,i.cells.length)}}static _hasSelectColumn(e,t){return[...Array.from(e.rows),...Array.from(t.rows)].some(i=>i.cells.item(0).classList.contains(s.classes.TABLE_CELL_SELECT))}static _createCheckboxElement(e,t,l,i,o,a){let r=document.createElement("div");if(r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER),t)switch(t){case"center":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_CENTER);break;case"left":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_LEFT);break;case"right":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_RIGHT);break}let c=document.createElement(re.elementName),m=document.createElement("input");m.type="checkbox";let d=o||"";i&&typeof o=="function"&&(d=o.call(null,l,i.data));let u=document.createElement("forge-tooltip");return u.position="left",e?u.textContent=a||"":u.textContent=d,m.setAttribute("aria-label","Select row"),c.appendChild(m),r.appendChild(u),r.appendChild(c),r}static _getCheckboxElement(e){let t=e.querySelector(`.${s.classes.TABLE_CELL_SELECT}`);return t?t.querySelector(s.selectors.CHECKBOX_INPUT):null}static _tryGetSelectAllCheckboxElement(e){let t=e.querySelector(`.${s.classes.TABLE_CELL_SELECT}`);return t?t.querySelector(s.selectors.CHECKBOX_INPUT)||t.querySelector(s.selectors.SELECT_ALL_TEMPLATE_CHECKBOX_INPUT):null}static _setSelectedCheckboxState(e,t){e&&(e.checked=t)}static _setIndeterminateCheckboxState(e,t){e&&(e.indeterminate=t)}static _setRowSelectedState(e,t){t?e.classList.contains(s.classes.TABLE_BODY_ROW_SELECTED)||e.classList.add(s.classes.TABLE_BODY_ROW_SELECTED):e.classList.remove(s.classes.TABLE_BODY_ROW_SELECTED)}static _updateExpandedRowColspan(e,t){n._getExpandedRows(e).forEach(i=>{let o=i.cells.item(0);o&&(o.colSpan=t)})}static updateSelectedState(e,t){n._setRowSelectedState(e,t);let l=n._getCheckboxElement(e);l&&n._setSelectedCheckboxState(l,t)}static getRowByIndex(e,t){return n._getNonExpandedRows(e.tBodies[0].rows)[t]}static updateSelectAllState(e,t,l){if(!e.tHead)return;let i=e.tHead.rows[e.tHead.rows.length-1],o=n._tryGetSelectAllCheckboxElement(i);o&&(n._setSelectedCheckboxState(o,t),n._setIndeterminateCheckboxState(o,!!l))}static setSelectedRows(e,t,l,i,o=!1){if(!e.tBodies.length)return;o||n.clearSelectedRows(e);let a=e.tBodies[0].rows,r=0;i.length&&Array.from(a).forEach((c,m)=>{let d=l[m];if(x(i,v(t,d))){n._setRowSelectedState(c,!0);let C=n._getCheckboxElement(c);C&&n._setSelectedCheckboxState(C,!0),r++}}),n.updateSelectAllState(e,r>0&&a.length===r)}static clearSelectedRows(e){if(!e.tBodies.length)return;n._getNonExpandedRows(e.tBodies[0].rows).forEach(l=>{n._setRowSelectedState(l,!1);let i=n._getCheckboxElement(l);i&&n._setSelectedCheckboxState(i,!1)})}static setSortedColumn(e,t,l){let i=n._getHeaderCellByIndex(e,t);n._getSortIconElementFromHeaderCell(i).classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(i,l)}static setMultiSortColumnSortNumber(e,t,l,i){let r=n._getHeaderCellByIndex(e,l).querySelector(`.${s.classes.TABLE_HEAD_CELL_CONTAINER}`).querySelector(`.${s.classes.TABLE_HEAD_CELL_SORT_ORDER}`);r&&(Z(r,typeof i!="number"||!t,s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN),i&&(r.textContent=i.toString()))}static removeColumnSort(e,t){let l=n._getHeaderCellByIndex(e,t);l.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)&&l.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING),l.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING)&&l.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING);let i=n._getSortIconElementFromHeaderCell(l);i&&i.classList.contains(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE)&&i.classList.remove(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE)}static _getHeaderCellByIndex(e,t){if(!e.tHead)throw new Error("Table head element cannot be null.");return e.tHead.rows.item(0).cells.item(t)}static _getSortIconElementFromHeaderCell(e){return e.querySelector(`.${s.classes.TABLE_HEAD_CELL_SORT_ICON}`)}static setSelectColumnVisibility(e,t,l,i,o,a,r,c,m){let d=e.tHead,u=e.tBodies[0];!d||!u||(t?n._addSelectColumn(d,u,l,i,o,a,r,c,m):n._hasSelectColumn(d,u)&&(l&&n._detachRowSelectListeners(u,l),i&&n._detachSelectAllListener(d,i),n._destroySelectColumn(d,u)))}static _addSelectColumn(e,t,l,i,o,a,r,c,m){n._createSelectColumn(e,t,!!i,o,()=>{i&&n._tryAttachSelectAllTemplateListener(e,i)},a,r,c,m),l&&n._attachRowSelectListeners(t,l),i&&!o&&n._tryAttachSelectAllTemplateListener(e,i)}static setDenseState(e,t){e.classList.contains(s.classes.TABLE_DENSE)&&e.classList.remove(s.classes.TABLE_DENSE),t&&e.classList.add(s.classes.TABLE_DENSE)}static setRoomyState(e,t){e.classList.contains(s.classes.TABLE_ROOMY)&&e.classList.remove(s.classes.TABLE_ROOMY),t&&e.classList.add(s.classes.TABLE_ROOMY)}static setResizable(e){let t=e.tableElement.tHead;e.resizable?(e.tableElement.classList.add(s.classes.TABLE_RESIZABLE),n._addResizeHandles(t,e)):(e.tableElement.classList.remove(s.classes.TABLE_RESIZABLE),n._removeResizeHandles(t,e))}static _addResizeHandles(e,t){if(!e)return;let l=e.rows.item(0);if(l){let i=Array.from(l.cells);t.selectListener&&(i=i.slice(1));for(let o of i){let a=i.indexOf(o);if(t.columnConfigurations[a].resizable!==!1){let c=document.createElement("div");c.classList.add(s.classes.TABLE_RESIZE_HANDLE),o.appendChild(c)}}}}static _removeResizeHandles(e,t){if(!e)return;let l=e.rows.item(0);if(l){let i=Array.from(l.cells);t.selectListener&&(i=i.slice(1));for(let o of i){let a=document.querySelector(`.${s.classes.TABLE_RESIZE_HANDLE}`);a&&o.removeChild(a)}}}static setWrapContentState(e,t){t?e.classList.remove(s.classes.TABLE_NO_WRAP_CONTENT):e.classList.add(s.classes.TABLE_NO_WRAP_CONTENT)}static setSelectAllVisibility(e,t,l,i,o,a){let r=e.tHead;if(!r)return;!t&&l&&n._detachSelectAllListener(r,l);let m=r.rows[r.rows.length-1].cells.item(0);t?m.childElementCount||(m.classList.add(s.classes.TABLE_CELL_SELECT),i?n._renderSelectAllTemplate(i,r).then(()=>{l&&n._tryAttachSelectAllTemplateListener(r,l)}):m.appendChild(n._createCheckboxElement(!0,o||null,null,null,null,a)),l&&!i&&n._attachSelectAllListener(r,l)):(l&&n._detachSelectAllListener(r,l),R(m))}static setFilterRow(e){if(!e.tableElement.tHead)return;let t=n._getFilterRowElement(e.tableElement.tHead),l;if(e.filter?e.tableElement.classList.add(s.classes.TABLE_FILTER_VISIBLE):e.tableElement.classList.remove(s.classes.TABLE_FILTER_VISIBLE),e.filter&&!t){if(e.columnConfigurations.every(o=>!o.filter))return;e.selectListener&&e.selectAllListener&&(l=e.tableElement.tHead.rows[e.tableElement.tHead.rows.length-1].cells.item(0));let i=n._createFilterRowElement(e);i&&l&&Array.from(l.children).forEach(o=>{var a;(a=i.cells.item(0))==null||a.appendChild(o)})}else if(!e.filter&&t){if(e.selectListener&&e.selectAllListener){l=t.cells.item(0);let i=Array.from(e.tableElement.tHead.rows).indexOf(t)-1,o=e.tableElement.tHead.rows.item(i);o&&Array.from(l.children).forEach(a=>{var r;(r=o.cells.item(0))==null||r.appendChild(a)})}W(t)}}static _createFilterRowElement(e){if(!e.tableElement.tHead)throw new Error("Table head element cannot be null.");let t=e.tableElement.tHead.insertRow();if(p([s.classes.TABLE_ROW,s.classes.TABLE_HEAD_ROW_FILTER],t),e.selectListener){let l=document.createElement("th");p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],l),t.insertBefore(l,t.cells[0]),l.classList.add(s.classes.TABLE_CELL_SELECT)}return e.columnConfigurations.forEach((l,i)=>{let o=document.createElement("th");if(p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],o),l.filter&&f(l.filterDelegate)){let a=document.createElement("div");a.classList.add(s.classes.TABLE_HEAD_CELL_CONTAINER),l.align&&n._setCellAlignmentClass(a,l.align);let r=n._createFilterElement(l,i,e.filterListener);a.appendChild(r),o.appendChild(a)}t.appendChild(o)}),t}static _createFilterElement(e,t,l){let i;if(y(e.filterDelegate))i=e.filterDelegate();else if(e.filterDelegate instanceof X||e.filterDelegate instanceof le)i=e.filterDelegate;else throw new Error("Invalid filter delegate.");if(l&&i instanceof X&&y(i.onChange))if(!f(e.filterDebounceTime)||I(e.filterDebounceTime)){let o=f(e.filterDebounceTime)?e.filterDebounceTime:s.numbers.DEFAULT_FILTER_DEBOUNCE_TIME;i.onChange(V(a=>l(a,t),o))}else i.onChange(o=>l(o,t));return i.element}static _getFilterRowElement(e){if(e)return Array.from(e.rows).find(t=>t.classList.contains(s.classes.TABLE_HEAD_ROW_FILTER))}static async expandRow(e,t,l){let i=e.tableElement.tBodies[0],a=n._getNonExpandedRows(i.rows)[t];a.classList.add(s.classes.TABLE_ROW_EXPANDED);let r=Array.from(i.rows).indexOf(a),c=i.insertRow(r+1);p([s.classes.TABLE_ROW,s.classes.TABLE_BODY_ROW,s.classes.TABLE_ROW_EXPANDABLE_CONTENT],c);let m=c.insertCell();m.setAttribute("colspan",a.cells.length.toString()),m.classList.add(s.classes.TABLE_ROW_EXPANDABLE_CONTENT_CELL);let d=document.createElement("div"),u=document.createElement(M.elementName);u.appendChild(d),m.appendChild(u);let C=l;if(y(l)){let ue=e.data[t]?e.data[t].data:void 0,be=l(t,d,ue);try{let A=await Promise.resolve(be);C=me(A)?A.content:A}catch(A){console.error("Failed to load row template "+A.message),C=""}}C&&n._setRowTemplate(d,C),window.requestAnimationFrame(()=>u.open=!0)}static _setRowTemplate(e,t){Y(t)?e.innerHTML=t:e.appendChild(t)}static collapseRow(e,t){if(!e.tableElement||!e.tableElement.tBodies.length||!e.tableElement.tBodies[0].rows.length)return Promise.resolve();let l=e.tableElement.tBodies[0],o=n._getNonExpandedRows(l.rows)[t],a=Array.from(l.rows).indexOf(o);if(o&&o.classList.contains(s.classes.TABLE_ROW_EXPANDED)){let r=l.rows[a+1],c=r.querySelector(M.elementName);if(c&&c.open)return c.open=!1,new Promise(m=>{setTimeout(()=>{o.classList.remove(s.classes.TABLE_ROW_EXPANDED),W(r),m()},M.numbers.COLLAPSE_ANIMATION_DURATION)})}return Promise.resolve()}static isRowExpanded(e,t){let l=e.tableElement.tBodies[0],o=n._getNonExpandedRows(l.rows)[t];return o&&o.classList.contains(s.classes.TABLE_ROW_EXPANDED)}static setFixedHeaders(e){e.fixedHeaders?e.tableElement.classList.add(s.classes.TABLE_FIXED):e.tableElement.classList.remove(s.classes.TABLE_FIXED)}static setLayoutType(e){e.layoutType==="fixed"?e.tableElement.classList.add(s.classes.TABLE_LAYOUT_FIXED):e.tableElement.classList.remove(s.classes.TABLE_LAYOUT_FIXED)}static normalizeColumnWidths(e){let t=e.tableElement;if(t.tHead&&t.tHead.rows.length){let l=Array.from(t.tHead.rows[0].cells);for(let i of l){let o=getComputedStyle(i).width;i.style.width&&i.style.width!==o&&(i.style.width=o)}}}static setColumnResizeIndicatorVisibility(e,t,l){let i=e.tableElement;if(i.tHead&&i.tHead.rows.length){let o=Array.from(i.tHead.rows);for(let a of o){let r=a.cells[t];r&&(l?r.classList.add(s.classes.TABLE_CELL_RESIZABLE):r.classList.remove(s.classes.TABLE_CELL_RESIZABLE))}}if(i.tBodies.length){let o=Array.from(i.tBodies[0].rows);for(let a of o){let r=a.cells[t];r&&(l?r.classList.add(s.classes.TABLE_CELL_RESIZABLE):r.classList.remove(s.classes.TABLE_CELL_RESIZABLE))}}}static setRowClickListeners(e,t,l,i){let o=e.tBodies[0];o&&(t?n._attachRowClickListeners(o,l,i):n._detachRowClickListeners(o,l,i))}static setRowClickAttributes(e,t){let l=e.tBodies[0];l&&(t?n._addRowClickAttributes(l):n._removeRowClickAttributes(l))}static getOwnerDocument(e){return e.ownerDocument||document}static _prepend(e,t){let l=t.childNodes.item(0);l?t.insertBefore(e,l):t.appendChild(e)}static _isMac(){return!!(navigator&&navigator.platform&&navigator.platform.substr(0,3)==="Mac")}static _renderSelectAllTemplate(e,t){return Promise.resolve(e()).then(l=>{let i=t.rows.item(t.rows.length-1);if(!i)return;let o=i.cells.item(0);l&&o&&(typeof l=="string"?o.innerHTML=l:l instanceof HTMLElement&&o.appendChild(l),o.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""))})}};var N=class extends Q{constructor(t){super(t)}initialize(){this._tableElement||(this._tableElement=document.createElement("table"),this._tableElement.classList.add(s.classes.TABLE),this._component.children.length&&R(this._component),this._component.appendChild(this._tableElement))}getTableElement(){return this._tableElement||this.initialize(),this._tableElement}createTable(t){return b.createTable(t)}recreateTableBody(t){b.recreateTableBody(t)}setSelectedRows(t,l,i,o,a=!1){b.setSelectedRows(t,l,i,o,a)}clearSelectedRows(t){b.clearSelectedRows(t)}updateSelectedState(t,l){b.updateSelectedState(t,l)}updateSelectAllState(t,l,i){b.updateSelectAllState(t,l,i)}setSortedColumn(t,l,i){b.setSortedColumn(t,l,i)}removeColumnSort(t,l){b.removeColumnSort(t,l)}setSortDirection(t,l,i){b.setSortDirection(t,l,i)}setSelectColumnVisibility(t,l,i,o,a,r,c,m,d){b.setSelectColumnVisibility(t,l,i,o||null,a||null,r||null,c||[],m||null,d||null)}setDense(t,l){b.setDenseState(t,l)}setRoomy(t,l){b.setRoomyState(t,l)}setResizable(t){b.setResizable(t)}setSelectAllVisibility(t,l,i,o,a,r=null){b.setSelectAllVisibility(t,l,i,o,a||null,r||null)}setFilterRow(t){b.setFilterRow(t)}expandRow(t,l,i){return b.expandRow(t,l,i)}collapseRow(t,l){return b.collapseRow(t,l)}isRowExpanded(t,l){return b.isRowExpanded(t,l)}setFixedHeaders(t){b.setFixedHeaders(t)}setTableLayoutType(t){b.setLayoutType(t)}setWrapContentState(t){b.setWrapContentState(t.tableElement,t.wrapContent)}addDocumentListener(t,l){b.getOwnerDocument(this._component).addEventListener(t,l)}removeDocumentListener(t,l){b.getOwnerDocument(this._component).removeEventListener(t,l)}normalizeColumnWidths(t){b.normalizeColumnWidths(t)}setResizeColumnVisibility(t,l,i){b.setColumnResizeIndicatorVisibility(t,l,i)}addTableClass(t){p(t,this._tableElement)}removeTableClass(t){D(t,this._tableElement)}setRowClickListeners(t,l,i,o){b.setRowClickListeners(t,l,i,o)}setRowClickAttributes(t,l){b.setRowClickAttributes(t,l)}};var k=class{constructor(){this._sortedColumns=[]}get sortedColumns(){return[...this._sortedColumns.map(e=>h({},e))]}addSortColumn(e){this._sortedColumns.push(h({},e)),this._updateSortNumbers()}updateSortColumn(e){let t=this._sortedColumns.find(l=>l.columnIndex===e.columnIndex);if(t)switch(t.direction){case"ASC":this.removeSortColumn(e);break;case"DESC":t.direction="ASC";break;case"UNSET":t.direction="DESC";break}}setSortColumns(e){this._sortedColumns=[...e.map(t=>h({},t))]}removeSortColumn(e){typeof e=="number"?this._sortedColumns.splice(e,1):this._sortedColumns.splice(this._sortedColumns.indexOf(e),1),this._updateSortNumbers()}isSortColumn(e){return typeof e=="number"?this._sortedColumns.some(t=>t.columnIndex===e):this._sortedColumns.includes(e)}clearMultiSort(){this._sortedColumns=[]}getSortColumn(e){return this._sortedColumns.find(t=>t.columnIndex===e)}_updateSortNumbers(){this._sortedColumns.every(e=>typeof e.sortOrder=="number")&&this._sortedColumns.sort((e,t)=>e.sortOrder-t.sortOrder),this._sortedColumns.forEach((e,t)=>e.sortOrder=t+1)}};var P=class{constructor(e,t=!1){this.data=e;this.selected=t}};var z=class{constructor(e){this._adapter=e;this._tableRows=[];this._data=[];this._columnConfigurations=[];this._select=!1;this._multiselect=!0;this._dense=!1;this._roomy=!1;this._filter=!1;this._fixedHeaders=!1;this._layoutType=s.strings.DEFAULT_LAYOUT_TYPE;this._wrapContent=!0;this._resizable=!1;this._minResizeWidth=s.numbers.MIN_RESIZE_WIDTH;this._multiColumnSort=!1;this._selectCheckboxAlignment="center";this._isAllSelected=!1;this._sortedColumnIndex=-1;this._rendered=!1;this._allowRowClick=!1;this._multiSortManager=new k;this._rowClickListener=t=>this._onRowClick(t),this._rowDoubleClickListener=t=>this._onRowDoubleClick(t),this._selectRowListener=t=>this._onRowSelected(t),this._selectAllListener=t=>this._onSelectAll(t),this._headRowMouseDownListener=t=>this._onHeadRowMouseDown(t),this._headRowContextMenuListener=t=>this._onHeadRowContextMenu(t),this._documentMouseMoveListener=t=>this._onMouseMove(t),this._documentMouseUpListener=t=>this._onMouseUp(t),this._filterListener=(t,l)=>this._onFilter(t,l),this._selectionManager=new w(this._selectKey),this._hiddenColumnManager=new w}initialize(){this.connect(),this._adapter.setHostAttribute(s.attributes.SELECT,this._select.toString()),this._adapter.setHostAttribute(s.attributes.MULTISELECT,this._multiselect.toString()),this._adapter.setHostAttribute(s.attributes.DENSE,this._dense.toString()),this._adapter.setHostAttribute(s.attributes.ROOMY,this._roomy.toString()),this._adapter.setHostAttribute(s.attributes.FILTER,this._filter.toString()),this._adapter.emitHostEvent(s.events.INITIALIZED,void 0,!1)}connect(){this._adapter.initialize()}disconnect(){this._resizeDescriptor=void 0,this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.removeDocumentListener("mouseup",this._documentMouseUpListener)}set data(e){Array.isArray(e)&&e.length>0?g(e[0])?this._data=e.map(t=>h({},t)):this._data=[...e]:this._data=[],this._tableRows=this._data.map(t=>new P(t,this._selectionManager.exists(t))),this._renderBody()}get data(){return JSON.parse(JSON.stringify(this._data))}set columnConfigurations(e){this._columnConfigurations=e.map(t=>h({},t)),this._hiddenColumnManager.clear(),this._columnConfigurations.forEach(t=>{t.hidden&&this._hiddenColumnManager.add(t)}),this._refreshTableSort(),this.render()}get columnConfigurations(){return this._columnConfigurations.map(e=>h({},e))}get _visibleColumnConfigurations(){return this._columnConfigurations.filter(e=>!this._hiddenColumnManager.exists(e))}get _tableConfiguration(){return{tableElement:this._adapter.getTableElement(),columnConfigurations:this._visibleColumnConfigurations,data:this._tableRows,clickListener:this._allowRowClick?this._rowClickListener:null,doubleClickListener:this._allowRowClick?this._rowDoubleClickListener:null,selectListener:this._select?this._selectRowListener:null,selectAllListener:this._multiselect?this._selectAllListener:null,headRowMouseDownListener:this._headRowMouseDownListener,headRowContextMenuListener:this._headRowContextMenuListener,filterListener:this._filter?this._filterListener:null,sortDirection:this._sortDirection,sortedColumn:this._sortedColumnIndex,multiColumnSort:this._multiColumnSort,filter:this._filter,wrapContent:this._wrapContent,fixedHeaders:this._fixedHeaders,layoutType:this._layoutType,dense:this._dense,resizable:this._resizable,rowCreatedCallback:this._rowCreatedCallback,cellCreatedCallback:this._cellCreatedCallback,selectAllTemplate:this._selectAllTemplate,selectCheckboxAlignment:this._selectCheckboxAlignment,tooltipSelect:this._tooltipSelect,tooltipSelectAll:this._tooltipSelectAll}}set select(e){this._select!==e&&(this._select=e,this._adapter.setSelectColumnVisibility(this._adapter.getTableElement(),this._select,this._selectRowListener,this._multiselect?this._selectAllListener:void 0,this._multiselect?this._selectAllTemplate:null,this._selectCheckboxAlignment,this._tableRows,this._tooltipSelect,this._tooltipSelectAll),this._updateSelections(!0),this._select?this._adapter.setHostAttribute(s.attributes.SELECT,this._select.toString()):this._adapter.removeHostAttribute(s.attributes.SELECT))}get select(){return this._select}set multiselect(e){this._multiselect!==e&&(this._multiselect=e,this._select&&(this._adapter.setSelectAllVisibility(this._adapter.getTableElement(),this._multiselect,this._multiselect?this._selectAllListener:null,this._multiselect?this.selectAllTemplate:null,this._selectCheckboxAlignment,this._tooltipSelectAll),this._updateSelections(!0)),this._adapter.setHostAttribute(s.attributes.MULTISELECT,this._multiselect.toString()))}get multiselect(){return this._multiselect}get selectKey(){return Array.isArray(this._selectKey)?[...this._selectKey]:this._selectKey}set selectKey(e){this._originalSelectKey!==e&&(Array.isArray(e)?(this._originalSelectKey=[...e],this._selectKey=[...e]):(this._originalSelectKey=e,this._selectKey=[e]),this._selectionManager.setKey(this._selectKey),this._updateSelections(!1))}get dense(){return this._dense}set dense(e){this._dense!==e&&(this._dense=e,this._adapter.setDense(this._adapter.getTableElement(),this._dense),this._adapter.setHostAttribute(s.attributes.DENSE,this._dense.toString()))}get roomy(){return this._roomy}set roomy(e){e!==this._roomy&&(this._roomy=e,this._applyRoomy())}set filter(e){this._filter!==e&&(this._filter=e,this._adapter.setFilterRow(this._tableConfiguration),this._adapter.setHostAttribute(s.attributes.FILTER,this._filter.toString()))}get filter(){return this._filter}set fixedHeaders(e){this._fixedHeaders!==e&&(this._fixedHeaders=e,this._adapter.setFixedHeaders(this._tableConfiguration))}get fixedHeaders(){return this._fixedHeaders}get layoutType(){return this._layoutType}set layoutType(e){this._layoutType!==e&&(this._layoutType=e,this._adapter.setTableLayoutType(this._tableConfiguration))}get wrapContent(){return this._wrapContent}set wrapContent(e){this._wrapContent!==e&&(this._wrapContent=e,this._adapter.setWrapContentState(this._tableConfiguration))}get resizable(){return this._resizable}set resizable(e){this._resizable!==e&&(this._resizable=e,this._adapter.setResizable(this._tableConfiguration))}get minResizeWidth(){return this._minResizeWidth}set minResizeWidth(e){this._minResizeWidth!==e&&(this._minResizeWidth=e,I(this._minResizeWidth)?this._minResizeWidth<0&&(this._minResizeWidth=0):this._minResizeWidth=s.numbers.MIN_RESIZE_WIDTH)}get allowRowClick(){return this._allowRowClick}set allowRowClick(e){this._allowRowClick!==e&&(this._allowRowClick=e,this._rendered&&(this._adapter.setRowClickListeners(this._adapter.getTableElement(),this._allowRowClick,this._rowClickListener,this._rowDoubleClickListener),this._adapter.setRowClickAttributes(this._adapter.getTableElement(),this._allowRowClick)))}get multiColumnSort(){return this._multiColumnSort}set multiColumnSort(e){e!==this._multiColumnSort&&(this._multiColumnSort=e,this._refreshTableSort(),this.render())}get selectCheckboxAlignment(){return this._selectCheckboxAlignment}set selectCheckboxAlignment(e){e!==this._selectCheckboxAlignment&&(this._selectCheckboxAlignment=e,this._adapter.setHostAttribute(s.attributes.SELECT_CHECKBOX_ALIGNMENT,e),this.render())}get tooltipSelect(){return this._tooltipSelect}set tooltipSelect(e){e!==this._tooltipSelect&&(this._tooltipSelect=e,typeof e=="string"&&this._adapter.setHostAttribute(s.attributes.TOOLTIP_SELECT,e),this.render())}get tooltipSelectAll(){return this._tooltipSelectAll}set tooltipSelectAll(e){e!==this._tooltipSelectAll&&(this._tooltipSelectAll=e,this._adapter.setHostAttribute(s.attributes.TOOLTIP_SELECT_ALL,e),this.render())}get selectAllTemplate(){return this._selectAllTemplate}set selectAllTemplate(e){e!==this._selectAllTemplate&&(this._selectAllTemplate=e,this.render())}get rowCreated(){return this._rowCreatedCallback}set rowCreated(e){this._rowCreatedCallback=e}get cellCreated(){return this._cellCreatedCallback}set cellCreated(e){this._cellCreatedCallback=e}isRowSelected(e){let t=v(Array.isArray(this._selectKey)?this._selectKey:[this._selectKey],e);return this.selectKey?!!this._selectionManager.getItems().find(l=>K(l,t)):this._selectionManager.exists(e)}getSelectedRows(){return this._selectionManager.getItems()}selectRows(e,t){if(!this._selectKey)throw new Error("You must set a selectKey to select rows.");(!this._multiselect||t)&&this.clearSelections(),e&&e.length&&(this._selectionManager.add(e),this._updateSelections(!t))}deselectRows(e){e&&e.length&&(this._selectionManager.remove(e),this._updateSelections(!1))}clearSelections(){let e=this._adapter.getTableElement();this._selectionManager.clear(),this._tableRows.forEach(t=>t.selected=!1),this._isAllSelected=!1,this._adapter.clearSelectedRows(e),this._select&&this._multiselect&&this._adapter.updateSelectAllState(e,!1)}hideColumn(e){let t=this._columnConfigurations[e];this._sortedColumnIndex===e&&(this._sortedColumnIndex=-1),this._hiddenColumnManager.exists(t)||(this._hiddenColumnManager.add(t),this.render())}showColumn(e){let t=this._columnConfigurations[e];this._hiddenColumnManager.exists(t)&&(this._hiddenColumnManager.remove(t),this.render())}isColumnHidden(e){let t=this._columnConfigurations[e];return!!t&&this._hiddenColumnManager.exists(t)}render(){this._adapter.createTable(this._tableConfiguration),this._renderSelections(),this._rendered=!0}_renderBody(){this._rendered&&(this._adapter.recreateTableBody(this._tableConfiguration),this._renderSelections())}_renderSelections(){this.select&&(this._isAllSelected=this._getSelectAllState(),this._multiselect&&this._adapter.updateSelectAllState(this._adapter.getTableElement(),this._isAllSelected,this._isIndeterminate(this._isAllSelected)));let e=this._selectionManager.getItems();e.length&&this._adapter.setSelectedRows(this._adapter.getTableElement(),this._selectKey,this._data,e,!1)}expandRow(e,t){if(!this._rendered)throw new Error("Cannot expand a row before the table has rendered.");if(e<0||e>this._tableRows.length)throw new Error(`Invalid row index: ${e}.`);return this._adapter.expandRow(this._tableConfiguration,e,t)}collapseRow(e){return!this._rendered||e<0||e>this._tableRows.length?Promise.resolve():this._adapter.collapseRow(this._tableConfiguration,e)}isRowExpanded(e){return this._adapter.isRowExpanded(this._tableConfiguration,e)}selectRowsByIndex(e,t){let l=e.map(i=>this._data[i]).filter(i=>!!i);this.selectRows(l,!t)}deselectRowsByIndex(e){let t=e.map(l=>this._data[l]).filter(l=>!!l);this.deselectRows(t)}_getSelectAllState(){return this._tableRows.length>0&&this._tableRows.every(e=>e.selected)}_updateSelections(e){this._tableRows.forEach(l=>l.selected=this._selectionManager.exists(l.data));let t=this._getSelectAllState();this._adapter.setSelectedRows(this._adapter.getTableElement(),this._selectKey,this._data,this._selectionManager.getItems(),e),(t!==this._isAllSelected||this._isIndeterminate(t))&&(this._isAllSelected=t,this._multiselect&&this._adapter.updateSelectAllState(this._adapter.getTableElement(),this._isAllSelected,this._isIndeterminate(this._isAllSelected)))}_onRowClick(e){if(e.stopImmediatePropagation(),e.target.tagName==="INPUT"&&e.target.type==="checkbox")return;let i=H(e).filter(m=>m.nodeType===1).find(m=>m.hasAttribute(s.attributes.CUSTOM_CELL_TEMPLATE));if(i&&i.hasAttribute(s.attributes.CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION))return;let{index:a,data:r}=this._getSelectedRowFromEvent(e),c={index:a,data:r};this._adapter.emitHostEvent(s.events.ROW_CLICK,c,!0,!1)}_onRowDoubleClick(e){if(e.stopPropagation(),e.target.tagName==="INPUT"&&e.target.type==="checkbox")return;let t=this._getSelectedRowFromEvent(e),l={index:t.index,data:t.data};this._adapter.emitHostEvent(s.events.SELECT_DOUBLE,l,!0,!1)}_onRowSelected(e){let t=this._getSelectedRowFromEvent(e);this._multiselect||this._tableRows.filter(r=>r.selected).forEach(r=>{K(r.data,v(this._selectKey,t.data))||this.deselectRows([r.data])});let l=!this._selectionManager.exists(t.data);this._adapter.updateSelectedState(t.rowElement,l),l?this._selectionManager.add(t.data):this._selectionManager.remove(t.data),this._tableRows[t.index].selected=l;let i=[t.index],o=!1;if(this._multiselect){if(e.shiftKey&&this._previouslyClickedRow&&(i=this._shiftSelectRows(t),i.includes(this._previouslyClickedRow.index))){let r=i.indexOf(this._previouslyClickedRow.index);i.splice(r,1)}o=this._getSelectAllState(),this._adapter.updateSelectAllState(this._adapter.getTableElement(),o,this._isIndeterminate(o))}for(let a of i){let r=this._tableRows[a].data,m={selected:this._selectionManager.exists(r),index:a,data:r};this._adapter.emitHostEvent(s.events.SELECT,m,!0,!1)}if(this._isAllSelected!==o){this._isAllSelected=o;let a={status:this._isAllSelected,count:this._tableRows.filter(r=>r.selected).length,data:[...this._data],targetType:"row"};this._adapter.emitHostEvent(s.events.SELECT_ALL,a,!0,!1)}this._previouslyClickedRow=h({},t)}_getSelectedRowFromEvent(e){let l=H(e).find(r=>r.tagName==="TR"),i=l.parentElement,o=this._getNonExpandedRows(i).findIndex(r=>r===l),a=this._tableRows[o].data;return{rowElement:l,index:o,data:a}}_getNonExpandedRows(e){return Array.from(e.rows).filter(t=>!t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}_onSelectAll(e){e.stopPropagation(),this._isAllSelected=!this._isAllSelected;let t=this._adapter.getTableElement();this._adapter.updateSelectAllState(t,this._isAllSelected),this._tableRows.forEach((i,o)=>{i.selected=this._isAllSelected,this._isAllSelected?this._selectionManager.add(i.data):this._selectionManager.remove(i.data);let a=b.getRowByIndex(t,o);a&&this._adapter.updateSelectedState(a,this._isAllSelected)});let l={status:this._isAllSelected,count:this._tableRows.filter(i=>i.selected).length,data:[...this._data],targetType:"select-all"};this._adapter.emitHostEvent(s.events.SELECT_ALL,l,!0,!1)}_onHeadRowContextMenu(e){e.preventDefault()}_onHeadRowMouseDown(e){if(e.button!==0)return;let t=H(e),l=e.target,i=t.find(r=>r.tagName==="TR"),o=t.find(r=>r.tagName==="TH"),a=Array.from(i.cells).findIndex(r=>r===o);this._headCellMouseDownIndex=a,l!==o&&l.classList.contains(s.classes.TABLE_RESIZE_HANDLE)&&(this._resizeDescriptor={element:o,startWidth:o.offsetWidth,startX:e.pageX,width:o.offsetWidth,index:this._select?a-1:a},this._adapter.addDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.setResizeColumnVisibility(this._tableConfiguration,a,!0)),this._adapter.addDocumentListener("mouseup",this._documentMouseUpListener)}_onMouseMove(e){if(this._resizeDescriptor){let t=this._resizeDescriptor.startWidth+(e.pageX-this._resizeDescriptor.startX);t<this._minResizeWidth&&(t=this._minResizeWidth),this._resizeDescriptor.width=t,this._resizeDescriptor.element.style.width=`${t}px`,this._adapter.addTableClass(s.classes.TABLE_RESIZING)}}_onMouseUp(e){if(this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.removeDocumentListener("mouseup",this._documentMouseUpListener),this._adapter.removeTableClass(s.classes.TABLE_RESIZING),this._headCellMouseDownIndex!==void 0){if(this._resizeDescriptor){this._adapter.normalizeColumnWidths(this._tableConfiguration),this._adapter.setResizeColumnVisibility(this._tableConfiguration,this._headCellMouseDownIndex,!1);let t={index:this._resizeDescriptor.index,width:this._resizeDescriptor.width};this._adapter.emitHostEvent(s.events.COLUMN_RESIZE,t),this._resizeDescriptor=void 0}else this._tableConfiguration.tableElement.tHead.contains(e.target)&&(this._multiColumnSort?this._onMultiSort(this._headCellMouseDownIndex,e.ctrlKey):this._onSort(this._headCellMouseDownIndex));this._headCellMouseDownIndex=void 0}}_onSort(e){let t=this._select?e-1:e,l=t>=0?this._visibleColumnConfigurations[t]:null;if(!l||!l.sortable)return;let i="ASC",o=t===this._sortedColumnIndex,a=this._sortDirection==="ASC"||this._sortDirection===void 0,r=o&&this._sortDirection==="DESC";o&&a&&(i="DESC"),r&&!l.preventUnsort&&(i="UNSET");let c={direction:i,columnIndex:t};if(this._adapter.emitHostEvent(s.events.SORT,c,!0,!0)){if(o&&this._sortDirection==="DESC"&&!l.preventUnsort){this._adapter.removeColumnSort(this._adapter.getTableElement(),this._select?this._sortedColumnIndex+1:this._sortedColumnIndex),this._sortedColumnIndex=-1;return}this._sortDirection=i,t===this._sortedColumnIndex?this._adapter.setSortDirection(this._adapter.getTableElement(),e,this._sortDirection):(this._sortedColumnIndex>=0&&this._adapter.removeColumnSort(this._adapter.getTableElement(),this._select?this._sortedColumnIndex+1:this._sortedColumnIndex),this._sortedColumnIndex=t,this._adapter.setSortedColumn(this._adapter.getTableElement(),e,this._sortDirection))}}_onMultiSort(e,t){let l=this._select?e-1:e,i=l>=0?this._visibleColumnConfigurations[l]:null;if(!i||!i.sortable)return;let o=this._multiSortManager.sortedColumns,a=this._multiSortManager.getSortColumn(l);a?this._multiSortManager.updateSortColumn(a):t?this._multiSortManager.addSortColumn({direction:"DESC",columnIndex:l,propertyName:i.property}):(this._multiSortManager.clearMultiSort(),this._multiSortManager.addSortColumn({direction:"DESC",columnIndex:l,propertyName:i.property}));let r=this._multiSortManager.sortedColumns.map(d=>h({},d));if(!this._adapter.emitHostEvent(s.events.SORT,r,!0,!0)){this._multiSortManager.setSortColumns(o);return}let m=this._multiSortManager.sortedColumns.length>1;for(let d=0;d<this._visibleColumnConfigurations.length;d++){let u=this._select?d+1:d;if(!this._multiSortManager.isSortColumn(d))this._adapter.removeColumnSort(this._adapter.getTableElement(),u),b.setMultiSortColumnSortNumber(this._adapter.getTableElement(),m,u,null);else{let C=this._multiSortManager.getSortColumn(d);C&&(this._adapter.setSortedColumn(this._adapter.getTableElement(),u,C.direction),b.setMultiSortColumnSortNumber(this._adapter.getTableElement(),m,u,C.sortOrder||null))}}}_onFilter(e,t){let l={value:e,columnIndex:t};this._adapter.emitHostEvent(s.events.FILTER,l,!0,!1)}_shiftSelectRows(e){let t=[];if(this._previouslyClickedRow){let l=this._previouslyClickedRow.index,i=e.index,o=i>=l?l:i,a=i>=l?i:l;a+=a>o?1:0,o+=o>a?1:0;let r=d=>this.selectRows(d,!1),c=this._tableRows.find(d=>d.selected&&d.data===e.data),m=this._tableRows.find(d=>{var u;return d.data===((u=this._previouslyClickedRow)==null?void 0:u.data)&&!d.selected});(!c||m)&&(r=d=>this.deselectRows(d));for(let d=o;d<a;d++)t.push(d);r(this.data.filter((d,u)=>t.includes(u)))}return t}_isIndeterminate(e){return!e&&this.getSelectedRows().length>0&&this._data.length!==this.getSelectedRows().length}_applyRoomy(){this._adapter.setRoomy(this._adapter.getTableElement(),this._roomy),this._adapter.setHostAttribute(s.attributes.ROOMY,this._roomy.toString())}_refreshTableSort(){if(this._sortedColumnIndex=this._visibleColumnConfigurations.findIndex(e=>e.initialSort),this._sortDirection=this._sortedColumnIndex>=0?this._visibleColumnConfigurations[this._sortedColumnIndex].sortDirection:void 0,this._multiColumnSort){let e=[];this._visibleColumnConfigurations.forEach((t,l)=>{typeof t.initialSort=="object"&&e.push({columnIndex:l,direction:t.initialSort.direction,sortOrder:t.initialSort.sortOrder,propertyName:t.property})}),this._multiSortManager.setSortColumns(e)}}};var E=class extends J{constructor(){super();se.define(te),this._foundation=new z(new N(this))}static get observedAttributes(){return[s.attributes.SELECT,s.attributes.MULTISELECT,s.attributes.SELECT_KEY,s.attributes.DENSE,s.attributes.ROOMY,s.attributes.FILTER,s.attributes.FIXED_HEADERS,s.attributes.LAYOUT_TYPE,s.attributes.WRAP_CONTENT,s.attributes.RESIZABLE,s.attributes.MIN_RESIZE_WIDTH,s.attributes.ALLOW_ROW_CLICK,s.attributes.MULTI_COLUMN_SORT,s.attributes.SELECT_CHECKBOX_ALIGNMENT,s.attributes.TOOLTIP_SELECT,s.attributes.TOOLTIP_SELECT_ALL]}initializedCallback(){this._foundation.initialize()}connectedCallback(){this._foundation.connect()}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,l,i){switch(t){case s.attributes.SELECT:this.select=L(i);break;case s.attributes.MULTISELECT:this.multiselect=L(i);break;case s.attributes.SELECT_KEY:this.selectKey=i;break;case s.attributes.DENSE:this.dense=L(i);break;case s.attributes.ROOMY:this.roomy=L(i);break;case s.attributes.FILTER:this.filter=L(i);break;case s.attributes.FIXED_HEADERS:this.fixedHeaders=L(i);break;case s.attributes.LAYOUT_TYPE:this.layoutType=i;break;case s.attributes.WRAP_CONTENT:this.wrapContent=L(i);break;case s.attributes.RESIZABLE:this.resizable=L(i);break;case s.attributes.MIN_RESIZE_WIDTH:this.minResizeWidth=G(i);break;case s.attributes.ALLOW_ROW_CLICK:this.allowRowClick=L(i);break;case s.attributes.MULTI_COLUMN_SORT:this.multiColumnSort=L(i);break;case s.attributes.SELECT_CHECKBOX_ALIGNMENT:this.selectCheckboxAlignment=this.getAttribute(s.attributes.SELECT_CHECKBOX_ALIGNMENT)||"center";break;case s.attributes.TOOLTIP_SELECT:this.tooltipSelect=i;break;case s.attributes.TOOLTIP_SELECT_ALL:this.tooltipSelectAll=i;break}}hideColumn(t){this._foundation.hideColumn(t)}showColumn(t){this._foundation.showColumn(t)}isColumnHidden(t){return this._foundation.isColumnHidden(t)}getSelectedRows(){return this._foundation.getSelectedRows()}selectRow(t){this._foundation.selectRows([t],!1)}selectRows(t,l=!1){this._foundation.selectRows(t,!l)}deselectRow(t){this._foundation.deselectRows([t])}deselectRows(t){this._foundation.deselectRows(t)}clearSelections(){this._foundation.clearSelections()}render(){this._foundation.render()}expandRow(t,l){return this._foundation.expandRow(t,l)}collapseRow(t){return this._foundation.collapseRow(t)}isRowExpanded(t){return this._foundation.isRowExpanded(t)}selectRowsByIndex(t,l){typeof t=="number"?this._foundation.selectRowsByIndex([t],l):Array.isArray(t)&&this._foundation.selectRowsByIndex(t,l)}deselectRowsByIndex(t){typeof t=="number"?this._foundation.deselectRowsByIndex([t]):Array.isArray(t)&&this._foundation.deselectRowsByIndex(t)}isRowSelected(t){return this._foundation.isRowSelected(t)}};_([T()],E.prototype,"data",2),_([T()],E.prototype,"columnConfigurations",2),_([T()],E.prototype,"select",2),_([T()],E.prototype,"multiselect",2),_([T()],E.prototype,"selectKey",2),_([T()],E.prototype,"tooltipSelect",2),_([T()],E.prototype,"tooltipSelectAll",2),_([T()],E.prototype,"dense",2),_([T()],E.prototype,"roomy",2),_([T()],E.prototype,"filter",2),_([T()],E.prototype,"fixedHeaders",2),_([T()],E.prototype,"layoutType",2),_([T()],E.prototype,"wrapContent",2),_([T()],E.prototype,"resizable",2),_([T()],E.prototype,"minResizeWidth",2),_([T()],E.prototype,"allowRowClick",2),_([T()],E.prototype,"multiColumnSort",2),_([T()],E.prototype,"rowCreated",2),_([T()],E.prototype,"cellCreated",2),_([T()],E.prototype,"selectAllTemplate",2),_([T()],E.prototype,"selectCheckboxAlignment",2),E=_([j({name:s.elementName,dependencies:[ae,oe,ce]})],E);function pl(){q(E)}export{s as a,B as b,O as c,Le as d,N as e,P as f,z as g,E as h,pl as i};
7
+ //# sourceMappingURL=chunk.CNQESSA3.js.map
@@ -3,5 +3,5 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{q as g,r as u}from"./chunk.MZLPUI6R.js";import{a as h,d as C,l as T}from"./chunk.H5D54EHO.js";import{a as p}from"./chunk.NVUMRW44.js";import{a as _}from"./chunk.5V5ABSHI.js";import{a as f,b}from"./chunk.DTZFWZPB.js";import{a as O,e as d,f as s,k as N}from"./chunk.NK7H3MMM.js";import{t as I}from"./chunk.CFDK4RCW.js";import{k as l}from"./chunk.J2M2MXP2.js";import{d as i}from"./chunk.M3QDAYD2.js";var E=`${b}open-icon`,A={ICON:"forge-open-icon",ICON_OPEN:"forge-open-icon--open"},x={OPEN:"open",ORIENTATION:"orientation"},S={ORIENTATION_VERTICAL:"vertical",ORIENTATION_HORIZONTAL:"horizontal"},e={elementName:E,classes:A,attributes:x,strings:S};var r=class{constructor(o){this._adapter=o;this._open=!1;this._orientation=e.strings.ORIENTATION_VERTICAL}initialize(){this._adapter.setOrientation(this._orientation),this._adapter.setOpenState(this._open)}get open(){return this._open}set open(o){o=!!o,this._open!==o&&(this._open=o,this._adapter.setOpenState(this._open))}get orientation(){return this._orientation}set orientation(o){this._orientation=o,this._adapter.setOrientation(this._orientation)}};var a=class extends _{constructor(t){super(t);this._openIcon=s(t,`.${e.classes.ICON}`),this._iconElement=s(t,h.elementName)}setOrientation(t){t===e.strings.ORIENTATION_HORIZONTAL?this._iconElement.name="keyboard_arrow_right":this._iconElement.name="keyboard_arrow_down"}setOpenState(t){I(this._openIcon,t,e.classes.ICON_OPEN)}};var w='<template><span class="forge-open-icon" part="root"><forge-icon class="icon" part="icon"></forge-icon></span></template>',v=".forge-open-icon{color:#757575;color:var(--forge-theme-icon-color,#757575)}.forge-open-icon .icon{-webkit-transition:-webkit-transform .4s;transition:-webkit-transform .4s;transition:transform .4s;transition:transform .4s,-webkit-transform .4s}.forge-open-icon.forge-open-icon--open .icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host{line-height:.5}:host([hidden]){display:none}",n=class extends N{constructor(){super();C.define([u,g]),d(this,w,v),this._foundation=new r(new a(this))}static get observedAttributes(){return[e.attributes.OPEN,e.attributes.ORIENTATION]}initializedCallback(){this._foundation.initialize()}attributeChangedCallback(t,R,m){switch(t){case e.attributes.OPEN:this.open=l(m);break;case e.attributes.ORIENTATION:this.orientation=m;break}}};i([p()],n.prototype,"open",2),i([p()],n.prototype,"orientation",2),n=i([f({name:e.elementName,dependencies:[T]})],n);function ee(){O(n)}export{e as a,r as b,a as c,n as d,ee as e};
7
- //# sourceMappingURL=chunk.6FISJTFJ.js.map
6
+ import{q as g,r as u}from"./chunk.FYWPZFLJ.js";import{a as h,d as C,l as T}from"./chunk.H5D54EHO.js";import{a as p}from"./chunk.NVUMRW44.js";import{a as _}from"./chunk.5V5ABSHI.js";import{a as f,b}from"./chunk.DTZFWZPB.js";import{a as O,e as d,f as s,k as N}from"./chunk.NK7H3MMM.js";import{t as I}from"./chunk.CFDK4RCW.js";import{k as l}from"./chunk.J2M2MXP2.js";import{d as i}from"./chunk.M3QDAYD2.js";var E=`${b}open-icon`,A={ICON:"forge-open-icon",ICON_OPEN:"forge-open-icon--open"},x={OPEN:"open",ORIENTATION:"orientation"},S={ORIENTATION_VERTICAL:"vertical",ORIENTATION_HORIZONTAL:"horizontal"},e={elementName:E,classes:A,attributes:x,strings:S};var r=class{constructor(o){this._adapter=o;this._open=!1;this._orientation=e.strings.ORIENTATION_VERTICAL}initialize(){this._adapter.setOrientation(this._orientation),this._adapter.setOpenState(this._open)}get open(){return this._open}set open(o){o=!!o,this._open!==o&&(this._open=o,this._adapter.setOpenState(this._open))}get orientation(){return this._orientation}set orientation(o){this._orientation=o,this._adapter.setOrientation(this._orientation)}};var a=class extends _{constructor(t){super(t);this._openIcon=s(t,`.${e.classes.ICON}`),this._iconElement=s(t,h.elementName)}setOrientation(t){t===e.strings.ORIENTATION_HORIZONTAL?this._iconElement.name="keyboard_arrow_right":this._iconElement.name="keyboard_arrow_down"}setOpenState(t){I(this._openIcon,t,e.classes.ICON_OPEN)}};var w='<template><span class="forge-open-icon" part="root"><forge-icon class="icon" part="icon"></forge-icon></span></template>',v=".forge-open-icon{color:#757575;color:var(--forge-theme-icon-color,#757575)}.forge-open-icon .icon{-webkit-transition:-webkit-transform .4s;transition:-webkit-transform .4s;transition:transform .4s;transition:transform .4s,-webkit-transform .4s}.forge-open-icon.forge-open-icon--open .icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host{line-height:.5}:host([hidden]){display:none}",n=class extends N{constructor(){super();C.define([u,g]),d(this,w,v),this._foundation=new r(new a(this))}static get observedAttributes(){return[e.attributes.OPEN,e.attributes.ORIENTATION]}initializedCallback(){this._foundation.initialize()}attributeChangedCallback(t,R,m){switch(t){case e.attributes.OPEN:this.open=l(m);break;case e.attributes.ORIENTATION:this.orientation=m;break}}};i([p()],n.prototype,"open",2),i([p()],n.prototype,"orientation",2),n=i([f({name:e.elementName,dependencies:[T]})],n);function ee(){O(n)}export{e as a,r as b,a as c,n as d,ee as e};
7
+ //# sourceMappingURL=chunk.E6KWYFZG.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 L}from"./chunk.6FISJTFJ.js";import{a as N}from"./chunk.LEVFMI2Q.js";import{a as d}from"./chunk.NVUMRW44.js";import{a as T}from"./chunk.5V5ABSHI.js";import{a as I,b as y}from"./chunk.DTZFWZPB.js";import{a as O,e as f,f as h,k as A}from"./chunk.NK7H3MMM.js";import{k as v,o as u}from"./chunk.J2M2MXP2.js";import{d as a}from"./chunk.M3QDAYD2.js";var C=`${y}expansion-panel`,c={CONTAINER:"forge-expansion-panel",HEADER:"forge-expansion-panel__header",CONTENT:"forge-expansion-panel__content"},x={CONTAINER:`.${c.CONTAINER}`,HEADER:`.${c.HEADER}`,CONTENT:`.${c.CONTENT}`,HEADER_SLOT:`.${c.HEADER} > slot[name=header]`,OPEN_ICON:`[slot=header] ${L.elementName}`},k={TOGGLE:`${C}-toggle`},P={OPEN:"open",ORIENTATION:"orientation",USE_ANIMATIONS:"use-animations",IGNORE:"data-forge-ignore",IGNORE_ALT:"forge-ignore"},p={COLLAPSE_ANIMATION_DURATION:400,CLICK_DEBOUNCE_THRESHOLD:200},S={ORIENTATION_VERTICAL:"vertical",ORIENTATION_HORIZONTAL:"horizontal",EXPANSION_VERTICAL_TRANSITION:`height ${p.COLLAPSE_ANIMATION_DURATION}ms cubic-bezier(0.4, 0, 0.2, 1), opacity ${p.COLLAPSE_ANIMATION_DURATION}ms ease-in-out`,EXPANSION_HORIZONTAL_TRANSITION:`width ${p.COLLAPSE_ANIMATION_DURATION}ms cubic-bezier(0.4, 0, 0.2, 1), opacity ${p.COLLAPSE_ANIMATION_DURATION}ms ease-in-out`},i={elementName:C,classes:c,selectors:x,events:k,attributes:P,numbers:p,strings:S};var _=class extends T{constructor(t){super(t);this._headerElement=h(this._component,i.selectors.HEADER),this._contentElement=h(this._component,i.selectors.CONTENT),this._headerSlotElement=h(this._component,i.selectors.HEADER_SLOT)}initialize(t,n="vertical"){let r=this._headerElement.children[0].assignedNodes();if(this.setHeaderVisibility(!!r.length),n===i.strings.ORIENTATION_HORIZONTAL&&(this._contentElement.style.height="",this._contentElement.style.width="0px"),t){n==="vertical"?this._contentElement.style.height="":this._contentElement.style.width="",this._contentElement.style.removeProperty("opacity"),this._contentElement.style.removeProperty("visibility");let l=this._component.querySelector(i.selectors.OPEN_ICON);l&&(l.open=!0)}this._headerElement.setAttribute("aria-expanded",t?"true":"false")}setHeaderVisibility(t){t?this._headerElement.style.display="":this._headerElement.style.display="none"}setOpenState(t,n=i.strings.ORIENTATION_VERTICAL,r=!0){let l=this._contentElement.children[0].assignedNodes(),s=this._component.querySelector(i.selectors.OPEN_ICON);if(r&&l&&l.length&&l[0]){let E=({propertyName:g})=>{if(this._component.open!==t){this._contentElement.removeEventListener("transitionend",E);return}(g==="height"||g==="width")&&(this._contentElement.removeEventListener("transitionend",E),this._contentElement.style.removeProperty("transition"),t?(n===i.strings.ORIENTATION_HORIZONTAL?this._contentElement.style.width="":this._contentElement.style.height="",this._contentElement.style.removeProperty("opacity")):this._contentElement.style.visibility="hidden")};this._contentElement.addEventListener("transitionend",E),t?(n===i.strings.ORIENTATION_HORIZONTAL?this._contentElement.style.width="0px":this._contentElement.style.height="0px",this._contentElement.style.opacity="0",this._contentElement.style.removeProperty("visibility")):(n===i.strings.ORIENTATION_HORIZONTAL?this._contentElement.style.width=`${this._contentElement.scrollWidth}px`:this._contentElement.style.height=`${this._contentElement.scrollHeight}px`,this._contentElement.style.opacity="1"),n===i.strings.ORIENTATION_HORIZONTAL?this._contentElement.style.transition=i.strings.EXPANSION_HORIZONTAL_TRANSITION:this._contentElement.style.transition=i.strings.EXPANSION_VERTICAL_TRANSITION,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{t?(n===i.strings.ORIENTATION_HORIZONTAL?this._contentElement.style.width=`${this._contentElement.scrollWidth}px`:this._contentElement.style.height=`${this._contentElement.scrollHeight}px`,this._contentElement.style.opacity="1",this._headerElement.setAttribute("aria-expanded","true"),s&&(s.open=!0)):(n===i.strings.ORIENTATION_HORIZONTAL?this._contentElement.style.width="0px":this._contentElement.style.height="0px",this._contentElement.style.opacity="0",this._headerElement.setAttribute("aria-expanded","false"),s&&(s.open=!1))})})}else this._contentElement.style.removeProperty("transition"),t?(n===i.strings.ORIENTATION_HORIZONTAL?this._contentElement.style.width="":this._contentElement.style.height="",this._contentElement.style.removeProperty("visibility"),this._contentElement.style.removeProperty("opacity"),this._headerElement.setAttribute("aria-expanded","true"),s&&(s.open=!0)):(n===i.strings.ORIENTATION_HORIZONTAL?this._contentElement.style.width="0px":this._contentElement.style.height="0px",this._contentElement.style.opacity="0",this._contentElement.style.visibility="hidden",this._headerElement.setAttribute("aria-expanded","false"),s&&(s.open=!1))}registerClickListener(t){this._headerElement.addEventListener("click",t)}deregisterClickListener(t){this._headerElement.removeEventListener("click",t)}registerKeydownListener(t){this._headerElement.addEventListener("keydown",t)}deregisterKeydownListener(t){this._headerElement.removeEventListener("keydown",t)}registerHeaderSlotListener(t){this._headerSlotElement.addEventListener("slotchange",t)}deregisterHeaderSlotListener(t){this._headerSlotElement.removeEventListener("slotchange",t)}};var m=class{constructor(e){this._adapter=e;this._open=!1;this._useAnimations=!0;this._orientation=i.strings.ORIENTATION_VERTICAL;this._isInitialized=!1;this._clickListener=u(t=>this._onClick(t),i.numbers.CLICK_DEBOUNCE_THRESHOLD,!0),this._keydownListener=t=>this._onKeydown(t),this._headerSlotChangeListener=t=>this._onHeaderSlotChanged(t)}initialize(){this.connect(),this._adapter.initialize(this._open,this._orientation),this._isInitialized=!0}connect(){this._adapter.registerHeaderSlotListener(this._headerSlotChangeListener),this._adapter.registerClickListener(this._clickListener),this._adapter.registerKeydownListener(this._keydownListener)}disconnect(){this._adapter.deregisterHeaderSlotListener(this._headerSlotChangeListener),this._adapter.deregisterClickListener(this._clickListener),this._adapter.deregisterKeydownListener(this._keydownListener)}setOpenImmediate(e){e?this._openPanel(!1):this._closePanel(!1)}_applyOpen(e){if(!this._isInitialized){this._open=e;return}e?this._openCallback?Promise.resolve(this._openCallback()).then(()=>{this._open=e,this._openPanel(this._useAnimations)}).catch(()=>{}):(this._open=e,this._openPanel(this._useAnimations)):this._closeCallback?Promise.resolve(this._closeCallback()).then(()=>{this._open=e,this._closePanel(this._useAnimations)}).catch(()=>{}):(this._open=e,this._closePanel(this._useAnimations))}get open(){return this._open}set open(e){e=!!e,this._open!==e&&this._applyOpen(e)}get openCallback(){return this._openCallback}set openCallback(e){this._openCallback=e}get closeCallback(){return this._closeCallback}set closeCallback(e){this._closeCallback=e}get orientation(){return this._orientation}set orientation(e){this._orientation=e}get useAnimations(){return this._useAnimations}set useAnimations(e){this._useAnimations!==!!e&&(this._useAnimations=!!e,this._adapter.setHostAttribute(i.attributes.USE_ANIMATIONS,`${this._useAnimations}`))}_onClick(e){N(e).find(t=>t.nodeType===1&&(t.hasAttribute(i.attributes.IGNORE)||t.hasAttribute(i.attributes.IGNORE_ALT)))||(e.stopPropagation(),this._toggle(),this._emitEvent())}_onKeydown(e){(e.key===" "||e.key==="Enter")&&(e.stopPropagation(),e.preventDefault(),this._toggle(),this._emitEvent())}_emitEvent(){this._adapter.emitHostEvent(i.events.TOGGLE,this._open)}_toggle(){this.open=!this.open}_openPanel(e){this._adapter.setHostAttribute(i.attributes.OPEN,""),this._adapter.setOpenState(!0,this._orientation,e)}_closePanel(e){this._adapter.removeHostAttribute(i.attributes.OPEN),this._adapter.setOpenState(!1,this._orientation,e)}_onHeaderSlotChanged(e){this._adapter.setHeaderVisibility(!!e.target.assignedNodes().length)}};var R='<template><div class="forge-expansion-panel" part="root"><div class="forge-expansion-panel__header" part="header"><slot name="header"></slot></div><div class="forge-expansion-panel__content" style="height: 0; opacity: 0; visibility: hidden;" part="content"><slot></slot></div></div></template>',H=".forge-expansion-panel{display:block;display:var(--forge-expansion-panel-display,block);height:auto;height:var(--forge-expansion-panel-height,auto)}.forge-expansion-panel__header{outline:0}.forge-expansion-panel__header:hover{cursor:pointer}.forge-expansion-panel__header forge-open-icon{margin-left:auto}.forge-expansion-panel__content{overflow:hidden;overflow:var(--forge-expansion-panel-content-overflow,hidden);max-height:none;max-height:var(--forge-expansion-panel-content-max-height,none)}.forge-expansion-panel__content::-webkit-scrollbar{width:16px;width:var(--forge-scrollbar-width,16px);height:16px;height:var(--forge-scrollbar-height,16px)}.forge-expansion-panel__content::-webkit-scrollbar-corner{background-color:#f0f0f0;background-color:var(--forge-theme-scrollbar-track,#f0f0f0)}.forge-expansion-panel__content::-webkit-scrollbar-track{background-color:#f0f0f0;background-color:var(--forge-theme-scrollbar-track,#f0f0f0)}.forge-expansion-panel__content::-webkit-scrollbar-track:hover{background-color:#ececec;background-color:var(--forge-theme-scrollbar-track-hover,#ececec)}.forge-expansion-panel__content::-webkit-scrollbar-thumb{background-color:#bdbdbd;background-color:var(--forge-theme-scrollbar-thumb,#bdbdbd);height:32px;height:var(--forge-scrollbar-min-height,32px);width:32px;width:var(--forge-scrollbar-min-width,32px);border-radius:10px;border-radius:var(--forge-scrollbar-border-radius,10px);border-width:3px;border-width:var(--forge-scrollbar-border-width,3px);border-style:solid;border-color:transparent;background-clip:content-box}.forge-expansion-panel__content::-webkit-scrollbar-thumb:hover{background-color:#9e9e9e;background-color:var(--forge-theme-scrollbar-thumb-hover,#9e9e9e)}:host{display:block}:host([hidden]){display:none}",o=class extends A{constructor(){super();f(this,R,H),this._foundation=new m(new _(this))}static get observedAttributes(){return[i.attributes.OPEN,i.attributes.ORIENTATION,i.attributes.USE_ANIMATIONS]}initializedCallback(){this._foundation.initialize()}connectedCallback(){this._foundation.connect()}attributeChangedCallback(t,n,r){switch(t){case i.attributes.OPEN:this.open=v(r);break;case i.attributes.ORIENTATION:this.orientation=r;break;case i.attributes.USE_ANIMATIONS:this.useAnimations=v(r);break}}disconnectedCallback(){this._foundation.disconnect()}toggle(){this.open=!this.open}setOpenImmediate(t){this._foundation.setOpenImmediate(t)}};a([d()],o.prototype,"open",2),a([d()],o.prototype,"openCallback",2),a([d()],o.prototype,"closeCallback",2),a([d()],o.prototype,"orientation",2),a([d()],o.prototype,"useAnimations",2),o=a([I({name:i.elementName})],o);function ne(){O(o)}export{i as a,_ as b,m as c,o as d,ne as e};
7
- //# sourceMappingURL=chunk.H3SBIXK5.js.map
6
+ import{a as L}from"./chunk.E6KWYFZG.js";import{a as N}from"./chunk.LEVFMI2Q.js";import{a as d}from"./chunk.NVUMRW44.js";import{a as T}from"./chunk.5V5ABSHI.js";import{a as I,b as y}from"./chunk.DTZFWZPB.js";import{a as O,e as f,f as h,k as A}from"./chunk.NK7H3MMM.js";import{k as v,o as u}from"./chunk.J2M2MXP2.js";import{d as a}from"./chunk.M3QDAYD2.js";var C=`${y}expansion-panel`,c={CONTAINER:"forge-expansion-panel",HEADER:"forge-expansion-panel__header",CONTENT:"forge-expansion-panel__content"},x={CONTAINER:`.${c.CONTAINER}`,HEADER:`.${c.HEADER}`,CONTENT:`.${c.CONTENT}`,HEADER_SLOT:`.${c.HEADER} > slot[name=header]`,OPEN_ICON:`[slot=header] ${L.elementName}`},k={TOGGLE:`${C}-toggle`},P={OPEN:"open",ORIENTATION:"orientation",USE_ANIMATIONS:"use-animations",IGNORE:"data-forge-ignore",IGNORE_ALT:"forge-ignore"},p={COLLAPSE_ANIMATION_DURATION:400,CLICK_DEBOUNCE_THRESHOLD:200},S={ORIENTATION_VERTICAL:"vertical",ORIENTATION_HORIZONTAL:"horizontal",EXPANSION_VERTICAL_TRANSITION:`height ${p.COLLAPSE_ANIMATION_DURATION}ms cubic-bezier(0.4, 0, 0.2, 1), opacity ${p.COLLAPSE_ANIMATION_DURATION}ms ease-in-out`,EXPANSION_HORIZONTAL_TRANSITION:`width ${p.COLLAPSE_ANIMATION_DURATION}ms cubic-bezier(0.4, 0, 0.2, 1), opacity ${p.COLLAPSE_ANIMATION_DURATION}ms ease-in-out`},i={elementName:C,classes:c,selectors:x,events:k,attributes:P,numbers:p,strings:S};var _=class extends T{constructor(t){super(t);this._headerElement=h(this._component,i.selectors.HEADER),this._contentElement=h(this._component,i.selectors.CONTENT),this._headerSlotElement=h(this._component,i.selectors.HEADER_SLOT)}initialize(t,n="vertical"){let r=this._headerElement.children[0].assignedNodes();if(this.setHeaderVisibility(!!r.length),n===i.strings.ORIENTATION_HORIZONTAL&&(this._contentElement.style.height="",this._contentElement.style.width="0px"),t){n==="vertical"?this._contentElement.style.height="":this._contentElement.style.width="",this._contentElement.style.removeProperty("opacity"),this._contentElement.style.removeProperty("visibility");let l=this._component.querySelector(i.selectors.OPEN_ICON);l&&(l.open=!0)}this._headerElement.setAttribute("aria-expanded",t?"true":"false")}setHeaderVisibility(t){t?this._headerElement.style.display="":this._headerElement.style.display="none"}setOpenState(t,n=i.strings.ORIENTATION_VERTICAL,r=!0){let l=this._contentElement.children[0].assignedNodes(),s=this._component.querySelector(i.selectors.OPEN_ICON);if(r&&l&&l.length&&l[0]){let E=({propertyName:g})=>{if(this._component.open!==t){this._contentElement.removeEventListener("transitionend",E);return}(g==="height"||g==="width")&&(this._contentElement.removeEventListener("transitionend",E),this._contentElement.style.removeProperty("transition"),t?(n===i.strings.ORIENTATION_HORIZONTAL?this._contentElement.style.width="":this._contentElement.style.height="",this._contentElement.style.removeProperty("opacity")):this._contentElement.style.visibility="hidden")};this._contentElement.addEventListener("transitionend",E),t?(n===i.strings.ORIENTATION_HORIZONTAL?this._contentElement.style.width="0px":this._contentElement.style.height="0px",this._contentElement.style.opacity="0",this._contentElement.style.removeProperty("visibility")):(n===i.strings.ORIENTATION_HORIZONTAL?this._contentElement.style.width=`${this._contentElement.scrollWidth}px`:this._contentElement.style.height=`${this._contentElement.scrollHeight}px`,this._contentElement.style.opacity="1"),n===i.strings.ORIENTATION_HORIZONTAL?this._contentElement.style.transition=i.strings.EXPANSION_HORIZONTAL_TRANSITION:this._contentElement.style.transition=i.strings.EXPANSION_VERTICAL_TRANSITION,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{t?(n===i.strings.ORIENTATION_HORIZONTAL?this._contentElement.style.width=`${this._contentElement.scrollWidth}px`:this._contentElement.style.height=`${this._contentElement.scrollHeight}px`,this._contentElement.style.opacity="1",this._headerElement.setAttribute("aria-expanded","true"),s&&(s.open=!0)):(n===i.strings.ORIENTATION_HORIZONTAL?this._contentElement.style.width="0px":this._contentElement.style.height="0px",this._contentElement.style.opacity="0",this._headerElement.setAttribute("aria-expanded","false"),s&&(s.open=!1))})})}else this._contentElement.style.removeProperty("transition"),t?(n===i.strings.ORIENTATION_HORIZONTAL?this._contentElement.style.width="":this._contentElement.style.height="",this._contentElement.style.removeProperty("visibility"),this._contentElement.style.removeProperty("opacity"),this._headerElement.setAttribute("aria-expanded","true"),s&&(s.open=!0)):(n===i.strings.ORIENTATION_HORIZONTAL?this._contentElement.style.width="0px":this._contentElement.style.height="0px",this._contentElement.style.opacity="0",this._contentElement.style.visibility="hidden",this._headerElement.setAttribute("aria-expanded","false"),s&&(s.open=!1))}registerClickListener(t){this._headerElement.addEventListener("click",t)}deregisterClickListener(t){this._headerElement.removeEventListener("click",t)}registerKeydownListener(t){this._headerElement.addEventListener("keydown",t)}deregisterKeydownListener(t){this._headerElement.removeEventListener("keydown",t)}registerHeaderSlotListener(t){this._headerSlotElement.addEventListener("slotchange",t)}deregisterHeaderSlotListener(t){this._headerSlotElement.removeEventListener("slotchange",t)}};var m=class{constructor(e){this._adapter=e;this._open=!1;this._useAnimations=!0;this._orientation=i.strings.ORIENTATION_VERTICAL;this._isInitialized=!1;this._clickListener=u(t=>this._onClick(t),i.numbers.CLICK_DEBOUNCE_THRESHOLD,!0),this._keydownListener=t=>this._onKeydown(t),this._headerSlotChangeListener=t=>this._onHeaderSlotChanged(t)}initialize(){this.connect(),this._adapter.initialize(this._open,this._orientation),this._isInitialized=!0}connect(){this._adapter.registerHeaderSlotListener(this._headerSlotChangeListener),this._adapter.registerClickListener(this._clickListener),this._adapter.registerKeydownListener(this._keydownListener)}disconnect(){this._adapter.deregisterHeaderSlotListener(this._headerSlotChangeListener),this._adapter.deregisterClickListener(this._clickListener),this._adapter.deregisterKeydownListener(this._keydownListener)}setOpenImmediate(e){e?this._openPanel(!1):this._closePanel(!1)}_applyOpen(e){if(!this._isInitialized){this._open=e;return}e?this._openCallback?Promise.resolve(this._openCallback()).then(()=>{this._open=e,this._openPanel(this._useAnimations)}).catch(()=>{}):(this._open=e,this._openPanel(this._useAnimations)):this._closeCallback?Promise.resolve(this._closeCallback()).then(()=>{this._open=e,this._closePanel(this._useAnimations)}).catch(()=>{}):(this._open=e,this._closePanel(this._useAnimations))}get open(){return this._open}set open(e){e=!!e,this._open!==e&&this._applyOpen(e)}get openCallback(){return this._openCallback}set openCallback(e){this._openCallback=e}get closeCallback(){return this._closeCallback}set closeCallback(e){this._closeCallback=e}get orientation(){return this._orientation}set orientation(e){this._orientation=e}get useAnimations(){return this._useAnimations}set useAnimations(e){this._useAnimations!==!!e&&(this._useAnimations=!!e,this._adapter.setHostAttribute(i.attributes.USE_ANIMATIONS,`${this._useAnimations}`))}_onClick(e){N(e).find(t=>t.nodeType===1&&(t.hasAttribute(i.attributes.IGNORE)||t.hasAttribute(i.attributes.IGNORE_ALT)))||(e.stopPropagation(),this._toggle(),this._emitEvent())}_onKeydown(e){(e.key===" "||e.key==="Enter")&&(e.stopPropagation(),e.preventDefault(),this._toggle(),this._emitEvent())}_emitEvent(){this._adapter.emitHostEvent(i.events.TOGGLE,this._open)}_toggle(){this.open=!this.open}_openPanel(e){this._adapter.setHostAttribute(i.attributes.OPEN,""),this._adapter.setOpenState(!0,this._orientation,e)}_closePanel(e){this._adapter.removeHostAttribute(i.attributes.OPEN),this._adapter.setOpenState(!1,this._orientation,e)}_onHeaderSlotChanged(e){this._adapter.setHeaderVisibility(!!e.target.assignedNodes().length)}};var R='<template><div class="forge-expansion-panel" part="root"><div class="forge-expansion-panel__header" part="header"><slot name="header"></slot></div><div class="forge-expansion-panel__content" style="height: 0; opacity: 0; visibility: hidden;" part="content"><slot></slot></div></div></template>',H=".forge-expansion-panel{display:block;display:var(--forge-expansion-panel-display,block);height:auto;height:var(--forge-expansion-panel-height,auto)}.forge-expansion-panel__header{outline:0}.forge-expansion-panel__header:hover{cursor:pointer}.forge-expansion-panel__header forge-open-icon{margin-left:auto}.forge-expansion-panel__content{overflow:hidden;overflow:var(--forge-expansion-panel-content-overflow,hidden);max-height:none;max-height:var(--forge-expansion-panel-content-max-height,none)}.forge-expansion-panel__content::-webkit-scrollbar{width:16px;width:var(--forge-scrollbar-width,16px);height:16px;height:var(--forge-scrollbar-height,16px)}.forge-expansion-panel__content::-webkit-scrollbar-corner{background-color:#f0f0f0;background-color:var(--forge-theme-scrollbar-track,#f0f0f0)}.forge-expansion-panel__content::-webkit-scrollbar-track{background-color:#f0f0f0;background-color:var(--forge-theme-scrollbar-track,#f0f0f0)}.forge-expansion-panel__content::-webkit-scrollbar-track:hover{background-color:#ececec;background-color:var(--forge-theme-scrollbar-track-hover,#ececec)}.forge-expansion-panel__content::-webkit-scrollbar-thumb{background-color:#bdbdbd;background-color:var(--forge-theme-scrollbar-thumb,#bdbdbd);height:32px;height:var(--forge-scrollbar-min-height,32px);width:32px;width:var(--forge-scrollbar-min-width,32px);border-radius:10px;border-radius:var(--forge-scrollbar-border-radius,10px);border-width:3px;border-width:var(--forge-scrollbar-border-width,3px);border-style:solid;border-color:transparent;background-clip:content-box}.forge-expansion-panel__content::-webkit-scrollbar-thumb:hover{background-color:#9e9e9e;background-color:var(--forge-theme-scrollbar-thumb-hover,#9e9e9e)}:host{display:block}:host([hidden]){display:none}",o=class extends A{constructor(){super();f(this,R,H),this._foundation=new m(new _(this))}static get observedAttributes(){return[i.attributes.OPEN,i.attributes.ORIENTATION,i.attributes.USE_ANIMATIONS]}initializedCallback(){this._foundation.initialize()}connectedCallback(){this._foundation.connect()}attributeChangedCallback(t,n,r){switch(t){case i.attributes.OPEN:this.open=v(r);break;case i.attributes.ORIENTATION:this.orientation=r;break;case i.attributes.USE_ANIMATIONS:this.useAnimations=v(r);break}}disconnectedCallback(){this._foundation.disconnect()}toggle(){this.open=!this.open}setOpenImmediate(t){this._foundation.setOpenImmediate(t)}};a([d()],o.prototype,"open",2),a([d()],o.prototype,"openCallback",2),a([d()],o.prototype,"closeCallback",2),a([d()],o.prototype,"orientation",2),a([d()],o.prototype,"useAnimations",2),o=a([I({name:i.elementName})],o);function ne(){O(o)}export{i as a,_ as b,m as c,o as d,ne as e};
7
+ //# sourceMappingURL=chunk.ECRL6O3V.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 k}from"./chunk.QKRB6AIQ.js";import{d as K}from"./chunk.2CTK5R37.js";import{e as V,h as B,j as H}from"./chunk.RTMDWDS4.js";import{b as A}from"./chunk.ZIB7L7DZ.js";import{e as F}from"./chunk.7G72CBOJ.js";import{c as x}from"./chunk.Q47M2LB5.js";import{a as m,b as N}from"./chunk.E3VXLUEY.js";import{d as P}from"./chunk.MZLPUI6R.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.SBDWCXK3.js.map
6
+ import{a as k}from"./chunk.GHSAKRYH.js";import{d as K}from"./chunk.2CTK5R37.js";import{e as V,h as B,j as H}from"./chunk.SYZB7B4F.js";import{b as A}from"./chunk.ZIB7L7DZ.js";import{e as F}from"./chunk.7G72CBOJ.js";import{c as x}from"./chunk.2QFIMTVP.js";import{a as m,b as N}from"./chunk.5IVB5L5Z.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.ER52NFXX.js.map