@watermarkinsights/ripple 3.12.0 → 3.13.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (311) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/{chartFunctions-44ae2eee.js → chartFunctions-b5f0319b.js} +420 -420
  3. package/dist/cjs/{functions-1a67b971.js → functions-3c5e979d.js} +1900 -479
  4. package/dist/cjs/{global-122fc638.js → global-23355ac3.js} +60 -60
  5. package/dist/cjs/{http-service-494d81de.js → http-service-9e8c4dd5.js} +49 -49
  6. package/dist/cjs/{index-acad7ab3.js → index-df6a3611.js} +4 -1
  7. package/dist/cjs/{interfaces-a3338581.js → interfaces-30a74c1f.js} +29 -29
  8. package/dist/cjs/loader.cjs.js +4 -4
  9. package/dist/cjs/priv-chart-popover.cjs.entry.js +87 -87
  10. package/dist/cjs/priv-datepicker.cjs.entry.js +658 -658
  11. package/dist/cjs/priv-navigator-button.cjs.entry.js +19 -19
  12. package/dist/cjs/priv-navigator-item.cjs.entry.js +24 -24
  13. package/dist/cjs/ripple.cjs.js +4 -4
  14. package/dist/cjs/wm-action-menu_2.cjs.entry.js +336 -336
  15. package/dist/cjs/wm-button.cjs.entry.js +239 -231
  16. package/dist/cjs/wm-chart-slice.cjs.entry.js +14 -14
  17. package/dist/cjs/wm-chart.cjs.entry.js +111 -111
  18. package/dist/cjs/wm-datepicker.cjs.entry.js +266 -266
  19. package/dist/cjs/wm-input.cjs.entry.js +135 -135
  20. package/dist/cjs/wm-modal-footer.cjs.entry.js +34 -34
  21. package/dist/cjs/wm-modal-header.cjs.entry.js +37 -37
  22. package/dist/cjs/wm-modal.cjs.entry.js +164 -164
  23. package/dist/cjs/wm-navigation_3.cjs.entry.js +228 -228
  24. package/dist/cjs/wm-navigator.cjs.entry.js +269 -269
  25. package/dist/cjs/wm-network-uploader.cjs.entry.js +453 -453
  26. package/dist/cjs/wm-option_2.cjs.entry.js +485 -485
  27. package/dist/cjs/wm-pagination.cjs.entry.js +168 -168
  28. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +130 -130
  29. package/dist/cjs/wm-search.cjs.entry.js +233 -233
  30. package/dist/cjs/wm-snackbar.cjs.entry.js +171 -171
  31. package/dist/cjs/wm-tab-item_3.cjs.entry.js +297 -297
  32. package/dist/cjs/wm-tag-input.cjs.entry.js +580 -580
  33. package/dist/cjs/wm-timepicker.cjs.entry.js +384 -384
  34. package/dist/cjs/wm-toggletip.cjs.entry.js +125 -125
  35. package/dist/cjs/wm-uploader.cjs.entry.js +635 -635
  36. package/dist/cjs/wm-wrapper.cjs.entry.js +13 -13
  37. package/dist/collection/collection-manifest.json +1 -1
  38. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +258 -258
  39. package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +115 -115
  40. package/dist/collection/components/charts/wm-chart/wm-chart.js +328 -328
  41. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +195 -195
  42. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +88 -88
  43. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +111 -111
  44. package/dist/collection/components/wm-action-menu/wm-action-menu.js +448 -448
  45. package/dist/collection/components/wm-button/wm-button.css +1 -0
  46. package/dist/collection/components/wm-button/wm-button.js +500 -494
  47. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +1024 -1024
  48. package/dist/collection/components/wm-datepicker/wm-datepicker.js +471 -471
  49. package/dist/collection/components/wm-input/wm-input.js +423 -423
  50. package/dist/collection/components/wm-menuitem/wm-menuitem.js +444 -444
  51. package/dist/collection/components/wm-modal/wm-modal-footer.js +136 -136
  52. package/dist/collection/components/wm-modal/wm-modal-header.js +87 -87
  53. package/dist/collection/components/wm-modal/wm-modal.js +461 -461
  54. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +162 -162
  55. package/dist/collection/components/wm-navigation/wm-navigation-item.js +121 -121
  56. package/dist/collection/components/wm-navigation/wm-navigation.js +218 -218
  57. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +97 -97
  58. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +114 -114
  59. package/dist/collection/components/wm-navigator/wm-navigator.js +468 -468
  60. package/dist/collection/components/wm-option/wm-option.js +414 -414
  61. package/dist/collection/components/wm-pagination/wm-pagination.js +368 -368
  62. package/dist/collection/components/wm-search/wm-search.js +480 -480
  63. package/dist/collection/components/wm-select/wm-select.js +718 -718
  64. package/dist/collection/components/wm-snackbar/wm-snackbar.js +297 -297
  65. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +216 -216
  66. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +330 -330
  67. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +104 -104
  68. package/dist/collection/components/wm-tag-input/wm-tag-input.js +810 -810
  69. package/dist/collection/components/wm-timepicker/wm-timepicker.js +583 -583
  70. package/dist/collection/components/wm-toggletip/wm-toggletip.js +241 -241
  71. package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +785 -785
  72. package/dist/collection/components/wm-uploader/wm-uploader.css +1 -2
  73. package/dist/collection/components/wm-uploader/wm-uploader.js +1079 -1079
  74. package/dist/collection/components/wm-wrapper/wm-wrapper.js +27 -27
  75. package/dist/collection/dev/scripts.js +20 -20
  76. package/dist/collection/global/__mocks__/functions.js +6 -6
  77. package/dist/collection/global/chartFunctions.js +421 -421
  78. package/dist/collection/global/functions.js +445 -468
  79. package/dist/collection/global/global.js +67 -67
  80. package/dist/collection/global/interfaces.js +49 -49
  81. package/dist/collection/global/services/__mocks__/http-service.js +130 -130
  82. package/dist/collection/global/services/http-service.js +50 -50
  83. package/dist/collection/lang/lang.js +5 -5
  84. package/dist/collection/lang/missing.js +43 -43
  85. package/dist/collection/lang/piglatin.js +93 -93
  86. package/dist/esm/{chartFunctions-8fa800a6.js → chartFunctions-89470707.js} +420 -420
  87. package/dist/esm/{functions-61c7bb1f.js → functions-78aea827.js} +1900 -479
  88. package/dist/esm/{global-5902ef31.js → global-2c09bb9a.js} +60 -60
  89. package/dist/esm/{http-service-3dc3b3e7.js → http-service-5d037e16.js} +49 -49
  90. package/dist/esm/{index-7603f98e.js → index-17c79cc6.js} +4 -1
  91. package/dist/esm/{interfaces-2b97fab2.js → interfaces-61c6305b.js} +29 -29
  92. package/dist/esm/loader.js +4 -4
  93. package/dist/esm/polyfills/core-js.js +0 -0
  94. package/dist/esm/polyfills/css-shim.js +1 -1
  95. package/dist/esm/polyfills/dom.js +0 -0
  96. package/dist/esm/polyfills/es5-html-element.js +0 -0
  97. package/dist/esm/polyfills/index.js +0 -0
  98. package/dist/esm/polyfills/system.js +0 -0
  99. package/dist/esm/priv-chart-popover.entry.js +87 -87
  100. package/dist/esm/priv-datepicker.entry.js +658 -658
  101. package/dist/esm/priv-navigator-button.entry.js +19 -19
  102. package/dist/esm/priv-navigator-item.entry.js +24 -24
  103. package/dist/esm/ripple.js +4 -4
  104. package/dist/esm/wm-action-menu_2.entry.js +336 -336
  105. package/dist/esm/wm-button.entry.js +239 -231
  106. package/dist/esm/wm-chart-slice.entry.js +14 -14
  107. package/dist/esm/wm-chart.entry.js +111 -111
  108. package/dist/esm/wm-datepicker.entry.js +266 -266
  109. package/dist/esm/wm-input.entry.js +135 -135
  110. package/dist/esm/wm-modal-footer.entry.js +34 -34
  111. package/dist/esm/wm-modal-header.entry.js +37 -37
  112. package/dist/esm/wm-modal.entry.js +164 -164
  113. package/dist/esm/wm-navigation_3.entry.js +228 -228
  114. package/dist/esm/wm-navigator.entry.js +269 -269
  115. package/dist/esm/wm-network-uploader.entry.js +453 -453
  116. package/dist/esm/wm-option_2.entry.js +485 -485
  117. package/dist/esm/wm-pagination.entry.js +168 -168
  118. package/dist/esm/wm-progress-indicator_3.entry.js +130 -130
  119. package/dist/esm/wm-search.entry.js +233 -233
  120. package/dist/esm/wm-snackbar.entry.js +171 -171
  121. package/dist/esm/wm-tab-item_3.entry.js +297 -297
  122. package/dist/esm/wm-tag-input.entry.js +580 -580
  123. package/dist/esm/wm-timepicker.entry.js +384 -384
  124. package/dist/esm/wm-toggletip.entry.js +125 -125
  125. package/dist/esm/wm-uploader.entry.js +635 -635
  126. package/dist/esm/wm-wrapper.entry.js +13 -13
  127. package/dist/esm-es5/{chartFunctions-8fa800a6.js → chartFunctions-89470707.js} +1 -1
  128. package/dist/esm-es5/functions-78aea827.js +1 -0
  129. package/dist/esm-es5/global-2c09bb9a.js +1 -0
  130. package/dist/esm-es5/{http-service-3dc3b3e7.js → http-service-5d037e16.js} +0 -0
  131. package/dist/esm-es5/{index-7603f98e.js → index-17c79cc6.js} +1 -1
  132. package/dist/esm-es5/{interfaces-2b97fab2.js → interfaces-61c6305b.js} +0 -0
  133. package/dist/esm-es5/loader.js +1 -1
  134. package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
  135. package/dist/esm-es5/priv-datepicker.entry.js +1 -1
  136. package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
  137. package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
  138. package/dist/esm-es5/ripple.js +1 -1
  139. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
  140. package/dist/esm-es5/wm-button.entry.js +1 -1
  141. package/dist/esm-es5/wm-chart-slice.entry.js +1 -1
  142. package/dist/esm-es5/wm-chart.entry.js +1 -1
  143. package/dist/esm-es5/wm-datepicker.entry.js +1 -1
  144. package/dist/esm-es5/wm-input.entry.js +1 -1
  145. package/dist/esm-es5/wm-modal-footer.entry.js +1 -1
  146. package/dist/esm-es5/wm-modal-header.entry.js +1 -1
  147. package/dist/esm-es5/wm-modal.entry.js +1 -1
  148. package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
  149. package/dist/esm-es5/wm-navigator.entry.js +1 -1
  150. package/dist/esm-es5/wm-network-uploader.entry.js +1 -1
  151. package/dist/esm-es5/wm-option_2.entry.js +1 -1
  152. package/dist/esm-es5/wm-pagination.entry.js +1 -1
  153. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
  154. package/dist/esm-es5/wm-search.entry.js +1 -1
  155. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  156. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
  157. package/dist/esm-es5/wm-tag-input.entry.js +1 -1
  158. package/dist/esm-es5/wm-timepicker.entry.js +1 -1
  159. package/dist/esm-es5/wm-toggletip.entry.js +1 -1
  160. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  161. package/dist/esm-es5/wm-wrapper.entry.js +1 -1
  162. package/dist/ripple/{p-9f12284b.system.entry.js → p-00c9f26c.system.entry.js} +1 -1
  163. package/dist/ripple/{p-d81a4e7c.system.entry.js → p-01fb2a55.system.entry.js} +1 -1
  164. package/dist/ripple/{p-212aac05.system.entry.js → p-07870c6b.system.entry.js} +1 -1
  165. package/dist/ripple/{p-f5df5903.system.js → p-08b7ec08.system.js} +0 -0
  166. package/dist/ripple/p-08e5f351.entry.js +1 -0
  167. package/dist/ripple/p-09043ef5.js +1 -0
  168. package/dist/ripple/p-0bd1815c.system.entry.js +1 -0
  169. package/dist/ripple/{p-fdc4a599.system.entry.js → p-1a64cbce.system.entry.js} +1 -1
  170. package/dist/ripple/p-1ca113d7.entry.js +1 -0
  171. package/dist/ripple/p-22283507.system.js +1 -0
  172. package/dist/ripple/p-262c75ff.entry.js +1 -0
  173. package/dist/ripple/{p-90ed3268.system.entry.js → p-27253ed2.system.entry.js} +1 -1
  174. package/dist/ripple/p-2ceec421.entry.js +1 -0
  175. package/dist/ripple/p-2e5cb321.entry.js +1 -0
  176. package/dist/ripple/{p-eee347b4.system.entry.js → p-31364104.system.entry.js} +1 -1
  177. package/dist/ripple/{p-9d02957d.system.js → p-313b6073.system.js} +0 -0
  178. package/dist/ripple/p-3e451dd0.entry.js +1 -0
  179. package/dist/ripple/{p-eacd33cc.system.entry.js → p-4439bdd1.system.entry.js} +1 -1
  180. package/dist/ripple/{p-ac2485a6.system.entry.js → p-474e6695.system.entry.js} +1 -1
  181. package/dist/ripple/p-539e9bfa.entry.js +1 -0
  182. package/dist/ripple/p-55c27bcc.entry.js +1 -0
  183. package/dist/ripple/p-57c94258.entry.js +1 -0
  184. package/dist/ripple/{p-1242752c.system.entry.js → p-58fc7a8d.system.entry.js} +1 -1
  185. package/dist/ripple/{p-1df2adee.system.entry.js → p-59678b70.system.entry.js} +1 -1
  186. package/dist/ripple/{p-5471864e.system.entry.js → p-5aa7b31c.system.entry.js} +1 -1
  187. package/dist/ripple/p-5bec3eeb.entry.js +1 -0
  188. package/dist/ripple/{p-e180001c.system.entry.js → p-65363da5.system.entry.js} +1 -1
  189. package/dist/ripple/p-6855af44.entry.js +1 -0
  190. package/dist/ripple/{p-28bf6a2e.system.js → p-68c7d04d.system.js} +1 -1
  191. package/dist/ripple/p-6a87da11.js +1 -0
  192. package/dist/ripple/{p-a0c3ef16.system.js → p-726b9452.system.js} +1 -1
  193. package/dist/ripple/p-82370ff7.entry.js +1 -0
  194. package/dist/ripple/p-82e24061.entry.js +1 -0
  195. package/dist/ripple/{p-398b2486.system.entry.js → p-84960032.system.entry.js} +1 -1
  196. package/dist/ripple/{p-43f1298b.js → p-888bec42.js} +0 -0
  197. package/dist/ripple/{p-487f7419.system.entry.js → p-8ad4f5ec.system.entry.js} +1 -1
  198. package/dist/ripple/p-93f6326d.system.js +1 -0
  199. package/dist/ripple/p-962f51ff.entry.js +1 -0
  200. package/dist/ripple/p-97c5c2ed.entry.js +1 -0
  201. package/dist/ripple/p-9fc092f2.entry.js +1 -0
  202. package/dist/ripple/p-a4b21d7b.entry.js +1 -0
  203. package/dist/ripple/{p-c873b490.system.entry.js → p-a5ae5ebb.system.entry.js} +1 -1
  204. package/dist/ripple/{p-75ef731b.system.entry.js → p-a65c09e8.system.entry.js} +1 -1
  205. package/dist/ripple/{p-ca2fbd1b.system.js → p-a695c1b5.system.js} +1 -1
  206. package/dist/ripple/{p-fd8070fb.js → p-a6d6eae7.js} +0 -0
  207. package/dist/ripple/{p-8aa9f811.js → p-a9ae4fa8.js} +1 -1
  208. package/dist/ripple/{p-73d66b0a.system.entry.js → p-abb0514c.system.entry.js} +1 -1
  209. package/dist/ripple/p-ad13a695.entry.js +1 -0
  210. package/dist/ripple/p-b0536ddb.entry.js +1 -0
  211. package/dist/ripple/p-b9f445c0.entry.js +1 -0
  212. package/dist/ripple/p-ba91d8ad.system.entry.js +1 -0
  213. package/dist/ripple/{p-42aa51fe.system.entry.js → p-babcd2c8.system.entry.js} +1 -1
  214. package/dist/ripple/{p-3f1d8211.system.entry.js → p-bcfd74b3.system.entry.js} +1 -1
  215. package/dist/ripple/p-c2abdcba.js +1 -0
  216. package/dist/ripple/{p-d3ed8b65.system.entry.js → p-c5ac8d9d.system.entry.js} +1 -1
  217. package/dist/ripple/p-cfe5b40f.entry.js +1 -0
  218. package/dist/ripple/p-d2d91a99.entry.js +1 -0
  219. package/dist/ripple/{p-44035b02.system.entry.js → p-d41727ae.system.entry.js} +1 -1
  220. package/dist/ripple/{p-ae6cfbca.system.entry.js → p-db44eb6f.system.entry.js} +1 -1
  221. package/dist/ripple/p-e18870d9.entry.js +1 -0
  222. package/dist/ripple/{p-3e6498ea.system.entry.js → p-e46174bc.system.entry.js} +1 -1
  223. package/dist/ripple/p-e6dee50b.entry.js +1 -0
  224. package/dist/ripple/p-ebd67c13.entry.js +1 -0
  225. package/dist/ripple/{p-68155230.system.entry.js → p-f048e76f.system.entry.js} +1 -1
  226. package/dist/ripple/{p-3b3e847c.system.entry.js → p-f17076c4.system.entry.js} +1 -1
  227. package/dist/ripple/p-f2c0d110.entry.js +1 -0
  228. package/dist/ripple/p-f74ccdea.entry.js +1 -0
  229. package/dist/ripple/ripple.esm.js +1 -1
  230. package/dist/ripple/ripple.js +1 -1
  231. package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +27 -27
  232. package/dist/types/components/charts/wm-chart/wm-chart-slice.d.ts +11 -11
  233. package/dist/types/components/charts/wm-chart/wm-chart.d.ts +36 -36
  234. package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +27 -27
  235. package/dist/types/components/charts/wm-progress-monitor/wm-progress-monitor.d.ts +17 -17
  236. package/dist/types/components/charts/wm-progress-monitor/wm-progress-slice.d.ts +10 -10
  237. package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +47 -47
  238. package/dist/types/components/wm-button/wm-button.d.ts +43 -43
  239. package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +80 -80
  240. package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +41 -41
  241. package/dist/types/components/wm-input/wm-input.d.ts +46 -46
  242. package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +34 -34
  243. package/dist/types/components/wm-modal/wm-modal-footer.d.ts +14 -14
  244. package/dist/types/components/wm-modal/wm-modal-header.d.ts +11 -11
  245. package/dist/types/components/wm-modal/wm-modal.d.ts +41 -41
  246. package/dist/types/components/wm-navigation/wm-navigation-hamburger.d.ts +21 -21
  247. package/dist/types/components/wm-navigation/wm-navigation-item.d.ts +13 -13
  248. package/dist/types/components/wm-navigation/wm-navigation.d.ts +28 -28
  249. package/dist/types/components/wm-navigator/priv-navigator-button/priv-navigator-button.d.ts +10 -10
  250. package/dist/types/components/wm-navigator/priv-navigator-item/priv-navigator-item.d.ts +13 -13
  251. package/dist/types/components/wm-navigator/wm-navigator.d.ts +61 -61
  252. package/dist/types/components/wm-option/wm-option.d.ts +32 -32
  253. package/dist/types/components/wm-pagination/wm-pagination.d.ts +32 -32
  254. package/dist/types/components/wm-search/wm-search.d.ts +86 -86
  255. package/dist/types/components/wm-select/wm-select.d.ts +66 -66
  256. package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +35 -35
  257. package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +38 -38
  258. package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +53 -53
  259. package/dist/types/components/wm-tabs/wm-tab-panel/wm-tab-panel.d.ts +20 -20
  260. package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +92 -92
  261. package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +61 -61
  262. package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +27 -27
  263. package/dist/types/components/wm-uploader/wm-network-uploader/wm-network-uploader.d.ts +85 -85
  264. package/dist/types/components/wm-uploader/wm-uploader.d.ts +119 -119
  265. package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +7 -7
  266. package/dist/types/components.d.ts +29 -29
  267. package/dist/types/global/__mocks__/functions.d.ts +6 -6
  268. package/dist/types/global/chartFunctions.d.ts +29 -29
  269. package/dist/types/global/functions.d.ts +42 -42
  270. package/dist/types/global/global.d.ts +1 -1
  271. package/dist/types/global/interfaces.d.ts +44 -44
  272. package/dist/types/global/services/__mocks__/http-service.d.ts +6 -6
  273. package/dist/types/global/services/http-service.d.ts +4 -4
  274. package/dist/types/lang/lang.d.ts +5 -5
  275. package/package.json +47 -47
  276. package/dist/esm-es5/functions-61c7bb1f.js +0 -15
  277. package/dist/esm-es5/global-5902ef31.js +0 -1
  278. package/dist/ripple/p-00fa3d4b.entry.js +0 -1
  279. package/dist/ripple/p-0f33461d.entry.js +0 -1
  280. package/dist/ripple/p-15b1c11b.js +0 -16
  281. package/dist/ripple/p-1b058a44.entry.js +0 -1
  282. package/dist/ripple/p-2077203e.system.js +0 -1
  283. package/dist/ripple/p-30745db6.entry.js +0 -1
  284. package/dist/ripple/p-358bde27.entry.js +0 -1
  285. package/dist/ripple/p-35cfcf9f.entry.js +0 -1
  286. package/dist/ripple/p-379b125b.entry.js +0 -1
  287. package/dist/ripple/p-49bf0b81.js +0 -1
  288. package/dist/ripple/p-4d59fe86.entry.js +0 -1
  289. package/dist/ripple/p-520b0f54.entry.js +0 -1
  290. package/dist/ripple/p-584fef7f.system.entry.js +0 -1
  291. package/dist/ripple/p-5e041c35.entry.js +0 -1
  292. package/dist/ripple/p-72eb5064.system.entry.js +0 -1
  293. package/dist/ripple/p-76ca7498.system.js +0 -15
  294. package/dist/ripple/p-7fae0cc2.entry.js +0 -1
  295. package/dist/ripple/p-8caae464.entry.js +0 -1
  296. package/dist/ripple/p-8d347cd5.entry.js +0 -1
  297. package/dist/ripple/p-92226595.entry.js +0 -1
  298. package/dist/ripple/p-9fe64cec.entry.js +0 -1
  299. package/dist/ripple/p-a82d37d8.entry.js +0 -1
  300. package/dist/ripple/p-a9e0ce88.entry.js +0 -1
  301. package/dist/ripple/p-b3c71506.js +0 -1
  302. package/dist/ripple/p-ba168596.entry.js +0 -1
  303. package/dist/ripple/p-cd4fda75.entry.js +0 -1
  304. package/dist/ripple/p-d3603def.entry.js +0 -1
  305. package/dist/ripple/p-e49b9a96.entry.js +0 -1
  306. package/dist/ripple/p-e748e22b.entry.js +0 -1
  307. package/dist/ripple/p-e75e75e0.entry.js +0 -1
  308. package/dist/ripple/p-ed657559.entry.js +0 -1
  309. package/dist/ripple/p-f0656464.entry.js +0 -1
  310. package/dist/ripple/p-f12a510f.entry.js +0 -1
  311. package/dist/ripple/p-f36b74bf.entry.js +0 -1
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,r,t,a){function n(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,p){function o(e){try{s(a.next(e))}catch(e){p(e)}}function c(e){try{s(a["throw"](e))}catch(e){p(e)}}function s(e){e.done?t(e.value):n(e.value).then(o,c)}s((a=a.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},a,n,p,o;return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(e){return function(r){return s([e,r])}}function s(o){if(a)throw new TypeError("Generator is already executing.");while(t)try{if(a=1,n&&(p=o[0]&2?n["return"]:o[0]?n["throw"]||((p=n["return"])&&p.call(n),0):n.next)&&!(p=p.call(n,o[1])).done)return p;if(n=0,p)o=[o[0]&2,p.value];switch(o[0]){case 0:case 1:p=o;break;case 4:t.label++;return{value:o[1],done:false};case 5:t.label++;n=o[1];o=[0];continue;case 7:o=t.ops.pop();t.trys.pop();continue;default:if(!(p=t.trys,p=p.length>0&&p[p.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!p||o[1]>p[0]&&o[1]<p[3])){t.label=o[1];break}if(o[0]===6&&t.label<p[1]){t.label=p[1];p=o;break}if(p&&t.label<p[2]){t.label=p[2];t.ops.push(o);break}if(p[2])t.ops.pop();t.trys.pop();continue}o=r.call(e,t)}catch(e){o=[6,e];n=0}finally{a=p=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,f as forceUpdate,h,H as Host,g as getElement}from"./index-7603f98e.js";import{g as generateId,i as intl,d as debounce}from"./functions-61c7bb1f.js";import{g as getData,t as types,h as handleChartKeydown,r as renderLegend,a as renderBar,b as renderDoughnut,c as renderCompletionMessage,e as exitChart,d as amountToPercent}from"./chartFunctions-8fa800a6.js";var wmChartCss=":host .component-wrapper,wm-chart .component-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;font-size:0.875rem;position:relative;}:host .component-wrapper .label,wm-chart .component-wrapper .label{display:block;margin:0;padding-bottom:0.25rem;font-weight:500;position:relative}:host .component-wrapper .label .subinfo,wm-chart .component-wrapper .label .subinfo{display:block;font-weight:normal;font-style:italic;bottom:0.25rem;width:100%;color:#6b6b6b}:host .component-wrapper .legend-wrapper,wm-chart .component-wrapper .legend-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}:host .component-wrapper .legend-wrapper .legend,wm-chart .component-wrapper .legend-wrapper .legend{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;-webkit-box-sizing:border-box;box-sizing:border-box}:host .component-wrapper .legend-wrapper .legend.--top,wm-chart .component-wrapper .legend-wrapper .legend.--top{margin-top:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-item,wm-chart .component-wrapper .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-color,wm-chart .component-wrapper .legend-wrapper .legend.--top .legend-color{top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom,wm-chart .component-wrapper .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-item,wm-chart .component-wrapper .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-color,wm-chart .component-wrapper .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}:host .component-wrapper .legend-wrapper .legend .legend-item,wm-chart .component-wrapper .legend-wrapper .legend .legend-item{position:relative}:host .component-wrapper .legend-wrapper .legend .legend-item:not(:last-of-type),wm-chart .component-wrapper .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}:host .component-wrapper .legend-wrapper .legend .legend-text,wm-chart .component-wrapper .legend-wrapper .legend .legend-text{padding-left:1rem;line-height:1}:host .component-wrapper .legend-wrapper .legend .legend-color,wm-chart .component-wrapper .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem}:host .component-wrapper .legend-wrapper .cluster-warning,wm-chart .component-wrapper .legend-wrapper .cluster-warning{font-size:0.75rem;font-style:italic;max-width:100%}:host .component-wrapper .doughnut-svg,wm-chart .component-wrapper .doughnut-svg,:host .component-wrapper .inner-bar-wrapper,wm-chart .component-wrapper .inner-bar-wrapper{overflow:visible}:host .component-wrapper .bar-wrapper,wm-chart .component-wrapper .bar-wrapper{-ms-flex-positive:1;flex-grow:1;width:100%}:host .component-wrapper .bar-wrapper .inner-bar-wrapper,wm-chart .component-wrapper .bar-wrapper .inner-bar-wrapper{width:100%}:host .component-wrapper .bar-wrapper .inner-bar-wrapper .values,wm-chart .component-wrapper .bar-wrapper .inner-bar-wrapper .values{display:-ms-flexbox;display:flex}:host .component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper,wm-chart .component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper{display:-ms-flexbox;display:flex}:host .component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper .bar-segment,wm-chart .component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper .bar-segment{height:30px;cursor:pointer}:host .component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper .bar-segment:not(.zero):not(:last-of-type),wm-chart .component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper .bar-segment:not(.zero):not(:last-of-type){margin-right:2px}:host .component-wrapper .doughnut-wrapper,wm-chart .component-wrapper .doughnut-wrapper{-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;border-radius:4px}:host .component-wrapper .doughnut-wrapper .doughnut-segment,wm-chart .component-wrapper .doughnut-wrapper .doughnut-segment{cursor:pointer}:host .component-wrapper .value,wm-chart .component-wrapper .value{display:inline-block;text-align:center}:host .component-wrapper .value:not(:last-of-type),wm-chart .component-wrapper .value:not(:last-of-type){margin-right:2px}:host .component-wrapper path:active,wm-chart .component-wrapper path:active,:host .component-wrapper path:hover,wm-chart .component-wrapper path:hover,:host .component-wrapper path:focus,wm-chart .component-wrapper path:focus,:host .component-wrapper .bar-segment:active,wm-chart .component-wrapper .bar-segment:active,:host .component-wrapper .bar-segment:hover,wm-chart .component-wrapper .bar-segment:hover,:host .component-wrapper .bar-segment:focus,wm-chart .component-wrapper .bar-segment:focus{outline:none}:host .component-wrapper .bar-segment:active.bar-segment,wm-chart .component-wrapper .bar-segment:active.bar-segment,:host .component-wrapper .bar-segment:hover.bar-segment,wm-chart .component-wrapper .bar-segment:hover.bar-segment,:host .component-wrapper .bar-segment:focus.bar-segment,wm-chart .component-wrapper .bar-segment:focus.bar-segment{-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper path:active.doughnut-segment,wm-chart .component-wrapper path:active.doughnut-segment,:host .component-wrapper path:hover.doughnut-segment,wm-chart .component-wrapper path:hover.doughnut-segment,:host .component-wrapper path:focus.doughnut-segment,wm-chart .component-wrapper path:focus.doughnut-segment,:host .component-wrapper .bar-segment:active.doughnut-segment,wm-chart .component-wrapper .bar-segment:active.doughnut-segment,:host .component-wrapper .bar-segment:hover.doughnut-segment,wm-chart .component-wrapper .bar-segment:hover.doughnut-segment,:host .component-wrapper .bar-segment:focus.doughnut-segment,wm-chart .component-wrapper .bar-segment:focus.doughnut-segment{-webkit-filter:url(#wmHoverDropShadow);filter:url(#wmHoverDropShadow)}:host .component-wrapper path::-moz-focus-inner,wm-chart .component-wrapper path::-moz-focus-inner,:host .component-wrapper .bar-segment::-moz-focus-inner,wm-chart .component-wrapper .bar-segment::-moz-focus-inner{border:0;outline:none}:host .component-wrapper.doughnut,wm-chart .component-wrapper.doughnut{width:300px}:host .component-wrapper.doughnut1 label,wm-chart .component-wrapper.doughnut1 label,:host .component-wrapper.doughnut1 .label-text,wm-chart .component-wrapper.doughnut1 .label-text,:host .component-wrapper.doughnut2 label,wm-chart .component-wrapper.doughnut2 label,:host .component-wrapper.doughnut2 .label-text,wm-chart .component-wrapper.doughnut2 .label-text,:host .component-wrapper.doughnut3 label,wm-chart .component-wrapper.doughnut3 label,:host .component-wrapper.doughnut3 .label-text,wm-chart .component-wrapper.doughnut3 .label-text{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .component-wrapper.doughnut0,wm-chart .component-wrapper.doughnut0,:host .component-wrapper.doughnut,wm-chart .component-wrapper.doughnut{-ms-flex-align:center;align-items:center}:host .component-wrapper.doughnut0 label,wm-chart .component-wrapper.doughnut0 label,:host .component-wrapper.doughnut label,wm-chart .component-wrapper.doughnut label{text-align:center;width:100%;padding-bottom:1.5rem}:host .component-wrapper.doughnut0 label .subinfo,wm-chart .component-wrapper.doughnut0 label .subinfo,:host .component-wrapper.doughnut label .subinfo,wm-chart .component-wrapper.doughnut label .subinfo{position:absolute}:host .component-wrapper.doughnut0 .legend,wm-chart .component-wrapper.doughnut0 .legend,:host .component-wrapper.doughnut .legend,wm-chart .component-wrapper.doughnut .legend{display:-ms-flexbox;display:flex}:host .component-wrapper.doughnut0 .completion-message,wm-chart .component-wrapper.doughnut0 .completion-message,:host .component-wrapper.doughnut .completion-message,wm-chart .component-wrapper.doughnut .completion-message{padding-top:0.625rem}:host .component-wrapper.bar1,wm-chart .component-wrapper.bar1,:host .component-wrapper.bar,wm-chart .component-wrapper.bar{padding:1.25rem;-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar1 label,wm-chart .component-wrapper.bar1 label,:host .component-wrapper.bar label,wm-chart .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .component-wrapper.bar1 label .subinfo,wm-chart .component-wrapper.bar1 label .subinfo,:host .component-wrapper.bar label .subinfo,wm-chart .component-wrapper.bar label .subinfo{position:initial}:host .component-wrapper.bar1 .legend,wm-chart .component-wrapper.bar1 .legend,:host .component-wrapper.bar .legend,wm-chart .component-wrapper.bar .legend{display:none}:host .component-wrapper.bar1 .chart-wrapper,wm-chart .component-wrapper.bar1 .chart-wrapper,:host .component-wrapper.bar .chart-wrapper,wm-chart .component-wrapper.bar .chart-wrapper{display:-ms-flexbox;display:flex}:host .component-wrapper.bar1 .chart-wrapper .single-perc,wm-chart .component-wrapper.bar1 .chart-wrapper .single-perc,:host .component-wrapper.bar .chart-wrapper .single-perc,wm-chart .component-wrapper.bar .chart-wrapper .single-perc{width:4rem;-ms-flex:none;flex:none;display:-ms-flexbox;display:flex;height:30px;-ms-flex-align:center;align-items:center}:host .component-wrapper.bar1 .chart-wrapper .inner-bar-wrapper,wm-chart .component-wrapper.bar1 .chart-wrapper .inner-bar-wrapper,:host .component-wrapper.bar .chart-wrapper .inner-bar-wrapper,wm-chart .component-wrapper.bar .chart-wrapper .inner-bar-wrapper{-ms-flex:1;flex:1}:host .component-wrapper.bar1 .chart-wrapper .completion-message,wm-chart .component-wrapper.bar1 .chart-wrapper .completion-message,:host .component-wrapper.bar .chart-wrapper .completion-message,wm-chart .component-wrapper.bar .chart-wrapper .completion-message{width:100%;text-align:right;margin-top:0.25rem}@media screen and (min-width: 768px){:host .component-wrapper.bar1,wm-chart .component-wrapper.bar1,:host .component-wrapper.bar,wm-chart .component-wrapper.bar{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.bar1 label,wm-chart .component-wrapper.bar1 label,:host .component-wrapper.bar label,wm-chart .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;min-height:30px;width:12rem;text-align:left;padding-right:1.25rem;padding-bottom:0;-ms-flex:none;flex:none}:host .component-wrapper.bar1 .bar-wrapper,wm-chart .component-wrapper.bar1 .bar-wrapper,:host .component-wrapper.bar .bar-wrapper,wm-chart .component-wrapper.bar .bar-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host .component-wrapper.bar1 .bar-wrapper .single-perc,wm-chart .component-wrapper.bar1 .bar-wrapper .single-perc,:host .component-wrapper.bar .bar-wrapper .single-perc,wm-chart .component-wrapper.bar .bar-wrapper .single-perc{text-align:center;padding-left:0.5rem;-ms-flex-pack:center;justify-content:center}}:host .component-wrapper.bar2,wm-chart .component-wrapper.bar2,:host .component-wrapper.bar3,wm-chart .component-wrapper.bar3,:host .component-wrapper.bar4,wm-chart .component-wrapper.bar4,:host .component-wrapper.bar5,wm-chart .component-wrapper.bar5{-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar2 .inner-bar-wrapper,wm-chart .component-wrapper.bar2 .inner-bar-wrapper,:host .component-wrapper.bar4 .inner-bar-wrapper,wm-chart .component-wrapper.bar4 .inner-bar-wrapper,:host .component-wrapper.bar5 .inner-bar-wrapper,wm-chart .component-wrapper.bar5 .inner-bar-wrapper{height:30px;margin-bottom:0}:host .component-wrapper.bar2 .inner-bar-wrapper.show-values,wm-chart .component-wrapper.bar2 .inner-bar-wrapper.show-values,:host .component-wrapper.bar4 .inner-bar-wrapper.show-values,wm-chart .component-wrapper.bar4 .inner-bar-wrapper.show-values,:host .component-wrapper.bar5 .inner-bar-wrapper.show-values,wm-chart .component-wrapper.bar5 .inner-bar-wrapper.show-values{height:60px;margin-top:0}:host .component-wrapper.bar3 .legend,wm-chart .component-wrapper.bar3 .legend{padding-bottom:1.25rem}:host .component-wrapper.bar3 .chart-wrapper,wm-chart .component-wrapper.bar3 .chart-wrapper{position:relative;height:100px}:host .component-wrapper.bar3 .chart-wrapper .inner-bar-wrapper,wm-chart .component-wrapper.bar3 .chart-wrapper .inner-bar-wrapper{position:absolute;top:35px;left:0;right:0;bottom:0;height:30px}:host .component-wrapper.bar3 .chart-wrapper .inner-bar-wrapper text,wm-chart .component-wrapper.bar3 .chart-wrapper .inner-bar-wrapper text{fill:#4a4a4a}:host .component-wrapper.bar3 .chart-wrapper .axis,wm-chart .component-wrapper.bar3 .chart-wrapper .axis{position:absolute;top:0;left:0;height:90px;width:100%;overflow:visible;-webkit-transform:translateY(90px);transform:translateY(90px)}:host .component-wrapper.bar3 .chart-wrapper .axis line,wm-chart .component-wrapper.bar3 .chart-wrapper .axis line{stroke:#eeedf4;stroke-width:1px}:host .component-wrapper.bar3 .chart-wrapper .axis text,wm-chart .component-wrapper.bar3 .chart-wrapper .axis text{-webkit-transform:translate(4px, 24px);transform:translate(4px, 24px);text-anchor:middle}:host .component-wrapper.left-label,wm-chart .component-wrapper.left-label{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.left-label .label,wm-chart .component-wrapper.left-label .label{width:12rem;padding-right:1.25rem;-ms-flex:none;flex:none;-ms-flex-item-align:end;align-self:flex-end;min-height:30px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host(:focus){outline:none}:host(:focus) .component-wrapper.user-is-tabbing .bar-segments-wrapper,:host(:focus) .component-wrapper.user-is-tabbing .doughnut-wrapper{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e;-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e;box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e}:host(:focus) .component-wrapper.user-is-tabbing .bar-segments-wrapper::-moz-focus-inner,:host(:focus) .component-wrapper.user-is-tabbing .doughnut-wrapper::-moz-focus-inner{border:0}";var Chart=function(){function e(e){var r=this;registerInstance(this,e);this.chartType="doughnut1";this.showLegend=true;this.notStartedColor=false;this.labelPosition="top";this.isTabbing=false;this.userIsNavigating=false;this.uid=generateId();this.slicesData=[];this.chartLabelMessage=intl.formatMessage({id:"chart.interactiveChart",defaultMessage:"Interactive chart. Use arrow keys to browse elements, press Tab to exit."});this.debouncedResize=debounce((function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,getData.call(this,this.currentChartType)];case 1:e.sent();forceUpdate(this.el);return[2]}}))}))}),10);this.debouncedSliceUpdate=debounce((function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,getData.call(this,this.currentChartType)];case 1:e.sent();forceUpdate(this.el);return[2]}}))}))}),100)}Object.defineProperty(e.prototype,"tempValueFormat",{get:function(){return this.valueFormat||this.showValues||"none"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"hybridType",{get:function(){return window.innerWidth>1340?"doughnut0":"bar1"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"popoverEl",{get:function(){return this.el.shadowRoot.querySelector("priv-chart-popover")},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"sliceEls",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll(".segment"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"currentChartType",{get:function(){return this.chartType==="hybrid"?this.hybridType:this.chartType},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"chartData",{get:function(){return types[this.currentChartType]},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"ariaLabelText",{get:function(){var e="".concat(this.label,", ").concat(this.chartLabelMessage);if(this.subinfo){e+=" ".concat(this.subinfo)}return e},enumerable:false,configurable:true});e.prototype.toggleTabbingOn=function(){this.isTabbing=true};e.prototype.toggleTabbingOff=function(){this.isTabbing=false};e.prototype.handleKeydown=function(e){handleChartKeydown.call(this,e)};e.prototype.handleResize=function(){if(this.chartType==="hybrid"){this.debouncedResize()}};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!this.label){throw new Error("For accessibility purposes, you must provide a label for the chart. See https://components.watermarkinsights.com/chart for more information.")}if(this.showValues){console.warn("wm-chart: show-values has been deprecated as of v3.1.0. Please use value-format instead.")}return[4,getData.call(this,this.currentChartType)];case 1:e.sent();return[2]}}))}))};e.prototype.handleSliceUpdate=function(){this.debouncedSliceUpdate()};e.prototype.renderBarText=function(e,r){var t;if(this.tempValueFormat==="percentage"){t=e.perc+"%"}else if(this.tempValueFormat==="amount"){t=e.amount}else{return}return h("span",{class:"value",style:{width:"calc(".concat(amountToPercent(e.amount,this.total,false),"%\n ").concat(r!==this.slicesData.length-1?" - 2px":"")}},t)};e.prototype.drawAxis=function(){if(this.currentChartType==="bar3"){return h("svg",{class:"axis"},h("line",{x1:"0",x2:"100%",y1:"0",y2:"0"}),h("line",{x1:"0",x2:"0",y1:"0",y2:"-85px"}),h("line",{class:"tick",x1:"0.5",x2:"0.5",y1:"0",y2:"6"}),h("text",{x:"0.5",y:"-6"},"0%"),h("line",{class:"tick",x1:"100%",x2:"100%",y1:"0",y2:"6"}),h("text",{x:"100%",y:"-6"},"100%"))}};e.prototype.render=function(){var e=this;return h(Host,{role:"application","aria-label":this.ariaLabelText,tabindex:"0",onBlur:function(){return exitChart.call(e)}},h("div",{class:"component-wrapper ".concat(this.currentChartType," ").concat(this.isTabbing&&!this.userIsNavigating?"user-is-tabbing":""," ").concat(this.labelPosition==="left"&&this.chartType==="bar4"?"left-label":"")},h("label",{class:"label",id:"label-".concat(this.uid),htmlFor:"graphic-".concat(this.uid)},h("span",{class:"label-text"},this.label),this.subinfo?h("span",{class:"subinfo"},this.subinfo):""),this.chartData.isBar?renderLegend.call(this):"",this.total>0&&this.chartData.isBar?renderBar.call(this,this.currentChartType):renderDoughnut.call(this,this.currentChartType),!this.chartData.isBar?renderLegend.call(this):"",h("priv-chart-popover",{class:this.isTabbing?"user-is-tabbing":""}),this.currentChartType==="doughnut0"?renderCompletionMessage.call(this):""))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();Chart.style=wmChartCss;export{Chart as wm_chart};
1
+ var __awaiter=this&&this.__awaiter||function(e,r,t,a){function n(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,p){function o(e){try{s(a.next(e))}catch(e){p(e)}}function c(e){try{s(a["throw"](e))}catch(e){p(e)}}function s(e){e.done?t(e.value):n(e.value).then(o,c)}s((a=a.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},a,n,p,o;return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(e){return function(r){return s([e,r])}}function s(o){if(a)throw new TypeError("Generator is already executing.");while(t)try{if(a=1,n&&(p=o[0]&2?n["return"]:o[0]?n["throw"]||((p=n["return"])&&p.call(n),0):n.next)&&!(p=p.call(n,o[1])).done)return p;if(n=0,p)o=[o[0]&2,p.value];switch(o[0]){case 0:case 1:p=o;break;case 4:t.label++;return{value:o[1],done:false};case 5:t.label++;n=o[1];o=[0];continue;case 7:o=t.ops.pop();t.trys.pop();continue;default:if(!(p=t.trys,p=p.length>0&&p[p.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!p||o[1]>p[0]&&o[1]<p[3])){t.label=o[1];break}if(o[0]===6&&t.label<p[1]){t.label=p[1];p=o;break}if(p&&t.label<p[2]){t.label=p[2];t.ops.push(o);break}if(p[2])t.ops.pop();t.trys.pop();continue}o=r.call(e,t)}catch(e){o=[6,e];n=0}finally{a=p=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,f as forceUpdate,h,H as Host,g as getElement}from"./index-17c79cc6.js";import{g as generateId,i as intl,d as debounce}from"./functions-78aea827.js";import{g as getData,t as types,h as handleChartKeydown,r as renderLegend,a as renderBar,b as renderDoughnut,c as renderCompletionMessage,e as exitChart,d as amountToPercent}from"./chartFunctions-89470707.js";var wmChartCss=":host .component-wrapper,wm-chart .component-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;font-size:0.875rem;position:relative;}:host .component-wrapper .label,wm-chart .component-wrapper .label{display:block;margin:0;padding-bottom:0.25rem;font-weight:500;position:relative}:host .component-wrapper .label .subinfo,wm-chart .component-wrapper .label .subinfo{display:block;font-weight:normal;font-style:italic;bottom:0.25rem;width:100%;color:#6b6b6b}:host .component-wrapper .legend-wrapper,wm-chart .component-wrapper .legend-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}:host .component-wrapper .legend-wrapper .legend,wm-chart .component-wrapper .legend-wrapper .legend{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;-webkit-box-sizing:border-box;box-sizing:border-box}:host .component-wrapper .legend-wrapper .legend.--top,wm-chart .component-wrapper .legend-wrapper .legend.--top{margin-top:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-item,wm-chart .component-wrapper .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-color,wm-chart .component-wrapper .legend-wrapper .legend.--top .legend-color{top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom,wm-chart .component-wrapper .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-item,wm-chart .component-wrapper .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-color,wm-chart .component-wrapper .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}:host .component-wrapper .legend-wrapper .legend .legend-item,wm-chart .component-wrapper .legend-wrapper .legend .legend-item{position:relative}:host .component-wrapper .legend-wrapper .legend .legend-item:not(:last-of-type),wm-chart .component-wrapper .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}:host .component-wrapper .legend-wrapper .legend .legend-text,wm-chart .component-wrapper .legend-wrapper .legend .legend-text{padding-left:1rem;line-height:1}:host .component-wrapper .legend-wrapper .legend .legend-color,wm-chart .component-wrapper .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem}:host .component-wrapper .legend-wrapper .cluster-warning,wm-chart .component-wrapper .legend-wrapper .cluster-warning{font-size:0.75rem;font-style:italic;max-width:100%}:host .component-wrapper .doughnut-svg,wm-chart .component-wrapper .doughnut-svg,:host .component-wrapper .inner-bar-wrapper,wm-chart .component-wrapper .inner-bar-wrapper{overflow:visible}:host .component-wrapper .bar-wrapper,wm-chart .component-wrapper .bar-wrapper{-ms-flex-positive:1;flex-grow:1;width:100%}:host .component-wrapper .bar-wrapper .inner-bar-wrapper,wm-chart .component-wrapper .bar-wrapper .inner-bar-wrapper{width:100%}:host .component-wrapper .bar-wrapper .inner-bar-wrapper .values,wm-chart .component-wrapper .bar-wrapper .inner-bar-wrapper .values{display:-ms-flexbox;display:flex}:host .component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper,wm-chart .component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper{display:-ms-flexbox;display:flex}:host .component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper .bar-segment,wm-chart .component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper .bar-segment{height:30px;cursor:pointer}:host .component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper .bar-segment:not(.zero):not(:last-of-type),wm-chart .component-wrapper .bar-wrapper .inner-bar-wrapper .bar-segments-wrapper .bar-segment:not(.zero):not(:last-of-type){margin-right:2px}:host .component-wrapper .doughnut-wrapper,wm-chart .component-wrapper .doughnut-wrapper{-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;border-radius:4px}:host .component-wrapper .doughnut-wrapper .doughnut-segment,wm-chart .component-wrapper .doughnut-wrapper .doughnut-segment{cursor:pointer}:host .component-wrapper .value,wm-chart .component-wrapper .value{display:inline-block;text-align:center}:host .component-wrapper .value:not(:last-of-type),wm-chart .component-wrapper .value:not(:last-of-type){margin-right:2px}:host .component-wrapper path:active,wm-chart .component-wrapper path:active,:host .component-wrapper path:hover,wm-chart .component-wrapper path:hover,:host .component-wrapper path:focus,wm-chart .component-wrapper path:focus,:host .component-wrapper .bar-segment:active,wm-chart .component-wrapper .bar-segment:active,:host .component-wrapper .bar-segment:hover,wm-chart .component-wrapper .bar-segment:hover,:host .component-wrapper .bar-segment:focus,wm-chart .component-wrapper .bar-segment:focus{outline:none}:host .component-wrapper .bar-segment:active.bar-segment,wm-chart .component-wrapper .bar-segment:active.bar-segment,:host .component-wrapper .bar-segment:hover.bar-segment,wm-chart .component-wrapper .bar-segment:hover.bar-segment,:host .component-wrapper .bar-segment:focus.bar-segment,wm-chart .component-wrapper .bar-segment:focus.bar-segment{-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper path:active.doughnut-segment,wm-chart .component-wrapper path:active.doughnut-segment,:host .component-wrapper path:hover.doughnut-segment,wm-chart .component-wrapper path:hover.doughnut-segment,:host .component-wrapper path:focus.doughnut-segment,wm-chart .component-wrapper path:focus.doughnut-segment,:host .component-wrapper .bar-segment:active.doughnut-segment,wm-chart .component-wrapper .bar-segment:active.doughnut-segment,:host .component-wrapper .bar-segment:hover.doughnut-segment,wm-chart .component-wrapper .bar-segment:hover.doughnut-segment,:host .component-wrapper .bar-segment:focus.doughnut-segment,wm-chart .component-wrapper .bar-segment:focus.doughnut-segment{-webkit-filter:url(#wmHoverDropShadow);filter:url(#wmHoverDropShadow)}:host .component-wrapper path::-moz-focus-inner,wm-chart .component-wrapper path::-moz-focus-inner,:host .component-wrapper .bar-segment::-moz-focus-inner,wm-chart .component-wrapper .bar-segment::-moz-focus-inner{border:0;outline:none}:host .component-wrapper.doughnut,wm-chart .component-wrapper.doughnut{width:300px}:host .component-wrapper.doughnut1 label,wm-chart .component-wrapper.doughnut1 label,:host .component-wrapper.doughnut1 .label-text,wm-chart .component-wrapper.doughnut1 .label-text,:host .component-wrapper.doughnut2 label,wm-chart .component-wrapper.doughnut2 label,:host .component-wrapper.doughnut2 .label-text,wm-chart .component-wrapper.doughnut2 .label-text,:host .component-wrapper.doughnut3 label,wm-chart .component-wrapper.doughnut3 label,:host .component-wrapper.doughnut3 .label-text,wm-chart .component-wrapper.doughnut3 .label-text{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .component-wrapper.doughnut0,wm-chart .component-wrapper.doughnut0,:host .component-wrapper.doughnut,wm-chart .component-wrapper.doughnut{-ms-flex-align:center;align-items:center}:host .component-wrapper.doughnut0 label,wm-chart .component-wrapper.doughnut0 label,:host .component-wrapper.doughnut label,wm-chart .component-wrapper.doughnut label{text-align:center;width:100%;padding-bottom:1.5rem}:host .component-wrapper.doughnut0 label .subinfo,wm-chart .component-wrapper.doughnut0 label .subinfo,:host .component-wrapper.doughnut label .subinfo,wm-chart .component-wrapper.doughnut label .subinfo{position:absolute}:host .component-wrapper.doughnut0 .legend,wm-chart .component-wrapper.doughnut0 .legend,:host .component-wrapper.doughnut .legend,wm-chart .component-wrapper.doughnut .legend{display:-ms-flexbox;display:flex}:host .component-wrapper.doughnut0 .completion-message,wm-chart .component-wrapper.doughnut0 .completion-message,:host .component-wrapper.doughnut .completion-message,wm-chart .component-wrapper.doughnut .completion-message{padding-top:0.625rem}:host .component-wrapper.bar1,wm-chart .component-wrapper.bar1,:host .component-wrapper.bar,wm-chart .component-wrapper.bar{padding:1.25rem;-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar1 label,wm-chart .component-wrapper.bar1 label,:host .component-wrapper.bar label,wm-chart .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .component-wrapper.bar1 label .subinfo,wm-chart .component-wrapper.bar1 label .subinfo,:host .component-wrapper.bar label .subinfo,wm-chart .component-wrapper.bar label .subinfo{position:initial}:host .component-wrapper.bar1 .legend,wm-chart .component-wrapper.bar1 .legend,:host .component-wrapper.bar .legend,wm-chart .component-wrapper.bar .legend{display:none}:host .component-wrapper.bar1 .chart-wrapper,wm-chart .component-wrapper.bar1 .chart-wrapper,:host .component-wrapper.bar .chart-wrapper,wm-chart .component-wrapper.bar .chart-wrapper{display:-ms-flexbox;display:flex}:host .component-wrapper.bar1 .chart-wrapper .single-perc,wm-chart .component-wrapper.bar1 .chart-wrapper .single-perc,:host .component-wrapper.bar .chart-wrapper .single-perc,wm-chart .component-wrapper.bar .chart-wrapper .single-perc{width:4rem;-ms-flex:none;flex:none;display:-ms-flexbox;display:flex;height:30px;-ms-flex-align:center;align-items:center}:host .component-wrapper.bar1 .chart-wrapper .inner-bar-wrapper,wm-chart .component-wrapper.bar1 .chart-wrapper .inner-bar-wrapper,:host .component-wrapper.bar .chart-wrapper .inner-bar-wrapper,wm-chart .component-wrapper.bar .chart-wrapper .inner-bar-wrapper{-ms-flex:1;flex:1}:host .component-wrapper.bar1 .chart-wrapper .completion-message,wm-chart .component-wrapper.bar1 .chart-wrapper .completion-message,:host .component-wrapper.bar .chart-wrapper .completion-message,wm-chart .component-wrapper.bar .chart-wrapper .completion-message{width:100%;text-align:right;margin-top:0.25rem}@media screen and (min-width: 768px){:host .component-wrapper.bar1,wm-chart .component-wrapper.bar1,:host .component-wrapper.bar,wm-chart .component-wrapper.bar{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.bar1 label,wm-chart .component-wrapper.bar1 label,:host .component-wrapper.bar label,wm-chart .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;min-height:30px;width:12rem;text-align:left;padding-right:1.25rem;padding-bottom:0;-ms-flex:none;flex:none}:host .component-wrapper.bar1 .bar-wrapper,wm-chart .component-wrapper.bar1 .bar-wrapper,:host .component-wrapper.bar .bar-wrapper,wm-chart .component-wrapper.bar .bar-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host .component-wrapper.bar1 .bar-wrapper .single-perc,wm-chart .component-wrapper.bar1 .bar-wrapper .single-perc,:host .component-wrapper.bar .bar-wrapper .single-perc,wm-chart .component-wrapper.bar .bar-wrapper .single-perc{text-align:center;padding-left:0.5rem;-ms-flex-pack:center;justify-content:center}}:host .component-wrapper.bar2,wm-chart .component-wrapper.bar2,:host .component-wrapper.bar3,wm-chart .component-wrapper.bar3,:host .component-wrapper.bar4,wm-chart .component-wrapper.bar4,:host .component-wrapper.bar5,wm-chart .component-wrapper.bar5{-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar2 .inner-bar-wrapper,wm-chart .component-wrapper.bar2 .inner-bar-wrapper,:host .component-wrapper.bar4 .inner-bar-wrapper,wm-chart .component-wrapper.bar4 .inner-bar-wrapper,:host .component-wrapper.bar5 .inner-bar-wrapper,wm-chart .component-wrapper.bar5 .inner-bar-wrapper{height:30px;margin-bottom:0}:host .component-wrapper.bar2 .inner-bar-wrapper.show-values,wm-chart .component-wrapper.bar2 .inner-bar-wrapper.show-values,:host .component-wrapper.bar4 .inner-bar-wrapper.show-values,wm-chart .component-wrapper.bar4 .inner-bar-wrapper.show-values,:host .component-wrapper.bar5 .inner-bar-wrapper.show-values,wm-chart .component-wrapper.bar5 .inner-bar-wrapper.show-values{height:60px;margin-top:0}:host .component-wrapper.bar3 .legend,wm-chart .component-wrapper.bar3 .legend{padding-bottom:1.25rem}:host .component-wrapper.bar3 .chart-wrapper,wm-chart .component-wrapper.bar3 .chart-wrapper{position:relative;height:100px}:host .component-wrapper.bar3 .chart-wrapper .inner-bar-wrapper,wm-chart .component-wrapper.bar3 .chart-wrapper .inner-bar-wrapper{position:absolute;top:35px;left:0;right:0;bottom:0;height:30px}:host .component-wrapper.bar3 .chart-wrapper .inner-bar-wrapper text,wm-chart .component-wrapper.bar3 .chart-wrapper .inner-bar-wrapper text{fill:#4a4a4a}:host .component-wrapper.bar3 .chart-wrapper .axis,wm-chart .component-wrapper.bar3 .chart-wrapper .axis{position:absolute;top:0;left:0;height:90px;width:100%;overflow:visible;-webkit-transform:translateY(90px);transform:translateY(90px)}:host .component-wrapper.bar3 .chart-wrapper .axis line,wm-chart .component-wrapper.bar3 .chart-wrapper .axis line{stroke:#eeedf4;stroke-width:1px}:host .component-wrapper.bar3 .chart-wrapper .axis text,wm-chart .component-wrapper.bar3 .chart-wrapper .axis text{-webkit-transform:translate(4px, 24px);transform:translate(4px, 24px);text-anchor:middle}:host .component-wrapper.left-label,wm-chart .component-wrapper.left-label{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.left-label .label,wm-chart .component-wrapper.left-label .label{width:12rem;padding-right:1.25rem;-ms-flex:none;flex:none;-ms-flex-item-align:end;align-self:flex-end;min-height:30px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host(:focus){outline:none}:host(:focus) .component-wrapper.user-is-tabbing .bar-segments-wrapper,:host(:focus) .component-wrapper.user-is-tabbing .doughnut-wrapper{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e;-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e;box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e}:host(:focus) .component-wrapper.user-is-tabbing .bar-segments-wrapper::-moz-focus-inner,:host(:focus) .component-wrapper.user-is-tabbing .doughnut-wrapper::-moz-focus-inner{border:0}";var Chart=function(){function e(e){var r=this;registerInstance(this,e);this.chartType="doughnut1";this.showLegend=true;this.notStartedColor=false;this.labelPosition="top";this.isTabbing=false;this.userIsNavigating=false;this.uid=generateId();this.slicesData=[];this.chartLabelMessage=intl.formatMessage({id:"chart.interactiveChart",defaultMessage:"Interactive chart. Use arrow keys to browse elements, press Tab to exit."});this.debouncedResize=debounce((function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,getData.call(this,this.currentChartType)];case 1:e.sent();forceUpdate(this.el);return[2]}}))}))}),10);this.debouncedSliceUpdate=debounce((function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,getData.call(this,this.currentChartType)];case 1:e.sent();forceUpdate(this.el);return[2]}}))}))}),100)}Object.defineProperty(e.prototype,"tempValueFormat",{get:function(){return this.valueFormat||this.showValues||"none"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"hybridType",{get:function(){return window.innerWidth>1340?"doughnut0":"bar1"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"popoverEl",{get:function(){return this.el.shadowRoot.querySelector("priv-chart-popover")},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"sliceEls",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll(".segment"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"currentChartType",{get:function(){return this.chartType==="hybrid"?this.hybridType:this.chartType},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"chartData",{get:function(){return types[this.currentChartType]},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"ariaLabelText",{get:function(){var e="".concat(this.label,", ").concat(this.chartLabelMessage);if(this.subinfo){e+=" ".concat(this.subinfo)}return e},enumerable:false,configurable:true});e.prototype.toggleTabbingOn=function(){this.isTabbing=true};e.prototype.toggleTabbingOff=function(){this.isTabbing=false};e.prototype.handleKeydown=function(e){handleChartKeydown.call(this,e)};e.prototype.handleResize=function(){if(this.chartType==="hybrid"){this.debouncedResize()}};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!this.label){throw new Error("For accessibility purposes, you must provide a label for the chart. See https://components.watermarkinsights.com/chart for more information.")}if(this.showValues){console.warn("wm-chart: show-values has been deprecated as of v3.1.0. Please use value-format instead.")}return[4,getData.call(this,this.currentChartType)];case 1:e.sent();return[2]}}))}))};e.prototype.handleSliceUpdate=function(){this.debouncedSliceUpdate()};e.prototype.renderBarText=function(e,r){var t;if(this.tempValueFormat==="percentage"){t=e.perc+"%"}else if(this.tempValueFormat==="amount"){t=e.amount}else{return}return h("span",{class:"value",style:{width:"calc(".concat(amountToPercent(e.amount,this.total,false),"%\n ").concat(r!==this.slicesData.length-1?" - 2px":"")}},t)};e.prototype.drawAxis=function(){if(this.currentChartType==="bar3"){return h("svg",{class:"axis"},h("line",{x1:"0",x2:"100%",y1:"0",y2:"0"}),h("line",{x1:"0",x2:"0",y1:"0",y2:"-85px"}),h("line",{class:"tick",x1:"0.5",x2:"0.5",y1:"0",y2:"6"}),h("text",{x:"0.5",y:"-6"},"0%"),h("line",{class:"tick",x1:"100%",x2:"100%",y1:"0",y2:"6"}),h("text",{x:"100%",y:"-6"},"100%"))}};e.prototype.render=function(){var e=this;return h(Host,{role:"application","aria-label":this.ariaLabelText,tabindex:"0",onBlur:function(){return exitChart.call(e)}},h("div",{class:"component-wrapper ".concat(this.currentChartType," ").concat(this.isTabbing&&!this.userIsNavigating?"user-is-tabbing":""," ").concat(this.labelPosition==="left"&&this.chartType==="bar4"?"left-label":"")},h("label",{class:"label",id:"label-".concat(this.uid),htmlFor:"graphic-".concat(this.uid)},h("span",{class:"label-text"},this.label),this.subinfo?h("span",{class:"subinfo"},this.subinfo):""),this.chartData.isBar?renderLegend.call(this):"",this.total>0&&this.chartData.isBar?renderBar.call(this,this.currentChartType):renderDoughnut.call(this,this.currentChartType),!this.chartData.isBar?renderLegend.call(this):"",h("priv-chart-popover",{class:this.isTabbing?"user-is-tabbing":""}),this.currentChartType==="doughnut0"?renderCompletionMessage.call(this):""))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();Chart.style=wmChartCss;export{Chart as wm_chart};
@@ -1 +1 @@
1
- import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-7603f98e.js";import{i as intl,e as isRelatedTarget,h as checkForFocusableElInShadow,g as generateId}from"./functions-61c7bb1f.js";var wmDatepickerCss=':host,wm-datepicker{font-family:inherit}:host *,wm-datepicker *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wrapper,wm-datepicker .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label,wm-datepicker .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required,wm-datepicker .wrapper .label .required{color:#c0392b}:host .wrapper.label-left,wm-datepicker .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper,wm-datepicker .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label,wm-datepicker .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label,wm-datepicker .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label,wm-datepicker .wrapper.invalid .label{color:#c0392b}:host .wrapper.invalid .label:after,wm-datepicker .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after,[dir=RTL] wm-datepicker .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label,wm-datepicker .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper,wm-datepicker .wrapper{position:relative}:host .wrapper .required,wm-datepicker .wrapper .required{color:#c4431c}:host .wrapper .inner-wrapper,wm-datepicker .wrapper .inner-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:2.5rem;border:1px solid;border-color:rgba(35, 35, 35, 0.6);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;max-width:236px;-ms-flex-pack:justify;justify-content:space-between;position:relative}:host .wrapper .inner-wrapper .date-input,wm-datepicker .wrapper .inner-wrapper .date-input{-moz-border-top-left-radius:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-bottom-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;border:none;font-size:0.875rem;padding:0.625rem 0.9375rem 0.5rem;min-width:0;height:100%;-ms-flex:1;flex:1;margin:0}:host .wrapper .inner-wrapper .date-input:disabled,wm-datepicker .wrapper .inner-wrapper .date-input:disabled{background-color:#f0f0f0;color:#737373}:host .wrapper .inner-wrapper .date-input:focus,wm-datepicker .wrapper .inner-wrapper .date-input:focus{outline:none}:host .wrapper.invalid .inner-wrapper,wm-datepicker .wrapper.invalid .inner-wrapper{-webkit-box-shadow:0 0 0 1px #c0392b;-moz-box-shadow:0 0 0 1px #c0392b;box-shadow:0 0 0 1px #c0392b;border-color:#c0392b}:host .wrapper.invalid .error,wm-datepicker .wrapper.invalid .error{margin-top:4px;margin-bottom:4px;display:block;top:100%;left:0;font-style:italic;font-size:0.875rem;color:#c0392b}:host .wrapper.focus .inner-wrapper,wm-datepicker .wrapper.focus .inner-wrapper{-webkit-box-shadow:0 0 0 1px #20cbd4;-moz-box-shadow:0 0 0 1px #20cbd4;box-shadow:0 0 0 1px #20cbd4;outline:none;border-color:#20cbd4}:host .user-is-tabbing .toggle:focus:not(:active),wm-datepicker .user-is-tabbing .toggle:focus:not(:active){border:none;z-index:11}';var DatePicker=function(){function e(e){registerInstance(this,e);this.wmDatepickerNewValidValue=createEvent(this,"wmDatepickerNewValidValue",7);this.value="";this.disabled=false;this.dateFormat="US";this.errorMessage="";this.labelPosition="top";this.label="";this.requiredField=false;this.displayError="";this.lastCommittedValue=this.value;this.parsableEntry=/^(\d{1}|\d{2}|\d{4})[\-\.\/]\d{1,2}[\-\.\/](\d{1}|\d{2}|\d{4})$/;this.isoEntry=/^\d\d\d\d[-]\d\d[-]\d\d$/;this.eightDigitsEntry=/^\d{8}$/;this.dateFormats={US:intl.formatMessage({id:"date.formatUS",defaultMessage:"mm/dd/yyyy"}),INT:intl.formatMessage({id:"date.formatINT",defaultMessage:"dd/mm/yyyy"}),ISO:intl.formatMessage({id:"date.formatISO",defaultMessage:"yyyy/mm/dd"})}}e.prototype.handleTabbingOn=function(){this.dpWrapper&&this.dpWrapper.classList.add("user-is-tabbing")};e.prototype.handleTabbingOff=function(){this.dpWrapper&&this.dpWrapper.classList.remove("user-is-tabbing")};e.prototype.handleError=function(){if(this.errorMessage){this.generateError()}else{this.clearError();this.processInput()}};e.prototype.handleInput=function(e){this.value=e.target.value};e.prototype.handleBlur=function(e){var t=this.preventValidation&&isRelatedTarget(e,this.preventValidation);if(!t){this.processInput()}this.dpWrapper.classList.remove("focus")};e.prototype.focusHandler=function(){this.dpWrapper.classList.add("focus")};e.prototype.handlePopupBlurred=function(e){if(e.detail.relatedTarget!==this.el){var t=new CustomEvent("blur");t.relatedTarget=e.detail.relatedTarget;this.el.dispatchEvent(t)}};e.prototype.getActiveElement=function(){return checkForFocusableElInShadow(document.activeElement)};e.prototype.handleCellTriggered=function(e){var t=e.detail;var r=t.getAttribute("data-year")+"-"+t.getAttribute("data-month")+"-"+t.textContent;this.inputEl.value=this.reformatDate(this.dateFormat,r);this.processInput();var a=new CustomEvent("input");this.el.dispatchEvent(a)};e.prototype.processInput=function(e){var t=!e&&this.requiredField;var r=this.inputEl.value;if(this.eightDigitsEntry.test(this.inputEl.value)){this.inputEl.value=this.addSlashes(this.inputEl.value)}if(this.parsableEntry.test(this.inputEl.value)){r=this.reformatDate("ISO",this.inputEl.value);this.inputEl.value=this.reformatDate(this.dateFormat,r);if(this.isValidDate(r)){if(this.errorMessage){this.generateError()}else{this.clearError()}}else if(this.inputEl.value.length){this.generateError()}}else if(this.inputEl.value.length||t||this.errorMessage){this.generateError()}else if(!this.inputEl.value.length&&!t){this.clearError()}if(r!==this.lastCommittedValue){this.value=r;var a=new CustomEvent("change");this.el.dispatchEvent(a);this.lastCommittedValue=this.value}if(this.isValidDate(r)&&r!==this.lastValidValue){this.wmDatepickerNewValidValue.emit();this.lastValidValue=r}};e.prototype.reformatDate=function(e,t){if(!t){return""}else if(!this.parsableEntry.test(t)){return t}else{var r=t.replace(/[\-\.]/gi,"/").split("/");switch(e){case"US":case this.dateFormats["US"]:return r[1].padStart(2,"0")+"/"+r[2].padStart(2,"0")+"/"+r[0].padStart(4,"20");case"INT":case this.dateFormats["INT"]:return r[2].padStart(2,"0")+"/"+r[1].padStart(2,"0")+"/"+r[0].padStart(4,"20");case"ISO":case this.dateFormats["ISO"]:if(this.dateFormat==="US"||this.dateFormat===this.dateFormats["US"]){return r[2].padStart(4,"20")+"-"+r[0].padStart(2,"0")+"-"+r[1].padStart(2,"0")}else if(this.dateFormat==="INT"||this.dateFormat===this.dateFormats["INT"]){return r[2].padStart(4,"20")+"-"+r[1].padStart(2,"0")+"-"+r[0].padStart(2,"0")}else if(this.dateFormat==="ISO"||this.dateFormat===this.dateFormats["ISO"]){return r[0].padStart(4,"20")+"-"+r[1].padStart(2,"0")+"-"+r[2].padStart(2,"0")}default:return r.join("/")}}};e.prototype.isValidDate=function(e){if(!e||!this.isoEntry.test(e)){return false}else{var t=e.split("-");var r=parseInt(t[2],10);var a=parseInt(t[1],10);var i=parseInt(t[0],10);if(i<1e3||i>3e3||a==0||a>12)return false;var s=[31,28,31,30,31,30,31,31,30,31,30,31];if(i%400==0||i%100!=0&&i%4==0)s[1]=29;return r>0&&r<=s[a-1]}};e.prototype.generateError=function(){var e=intl.formatMessage({id:"date.requiredDateError",defaultMessage:"A date is required."});var t=intl.formatMessage({id:"date.invalidDate",defaultMessage:"Please enter a valid date in the format {dateFormat, select, us {mm/dd/yyyy} int {dd/mm/yyyy} other {yyyy/mm/dd}}."},{dateFormat:this.dateFormat.toLowerCase()});if(this.errorMessage){this.displayError=this.errorMessage}else if(this.inputEl.value.length){this.displayError=t}else if(!this.inputEl.value.length&&this.requiredField){this.displayError=e}};e.prototype.clearError=function(){this.displayError=""};e.prototype.addSlashes=function(e){if(this.dateFormat==="ISO"||this.dateFormat===this.dateFormats["ISO"]){return e.substring(0,4)+"/"+e.substring(4,6)+"/"+e.substring(6)}else{return e.substring(0,2)+"/"+e.substring(2,4)+"/"+e.substring(4)}};e.prototype.componentWillLoad=function(){this.el.focus=function(){if(!this.disabled){this.shadowRoot.querySelector("input").focus()}};if(this.label===""){console.error("You must include a label prop for the datepicker input (for accessibility reasons), even if the label position is none.")}if(this.errorMessage){this.generateError()}this.uid=this.el.id?this.el.id:generateId();if(this.value&&this.isValidDate(this.value)){this.lastValidValue=this.value}};e.prototype.componentDidLoad=function(){this.inputEl.value=this.reformatDate(this.dateFormat,this.value);this.processInput(true)};e.prototype.render=function(){var e=this;var t=intl.formatMessage({id:"date.format",defaultMessage:"{dateFormat, select, us {mm/dd/yyyy} int {dd/mm/yyyy} other {yyyy/mm/dd}}"},{dateFormat:this.dateFormat.toLowerCase()});return h(Host,{id:this.uid,"aria-busy":"false",class:"".concat(this.displayError?"invalid":""),invalid:this.displayError?"true":null},h("div",{ref:function(t){return e.dpWrapper=t},class:"wrapper label-".concat(this.labelPosition," ").concat(this.displayError?"invalid":"")},h("div",{class:"label-wrapper"},this.labelPosition!=="none"&&h("label",{id:"datepickerLabel-".concat(this.uid),htmlFor:"date-input-".concat(this.uid),class:"label",title:"".concat(this.label," (").concat(t,")")},this.label,this.requiredField&&h("span",{"aria-hidden":"true",class:"required"},"*"))),h("div",null,h("div",{class:"inner-wrapper"},h("input",{disabled:this.disabled,type:"text",id:"date-input-".concat(this.uid),class:"date-input",name:"date",placeholder:t,onFocus:this.focusHandler.bind(this),onInput:function(t){return e.handleInput(t)},onBlur:function(t){return e.handleBlur(t)},ref:function(t){return e.inputEl=t},"aria-describedby":"error-".concat(this.uid),"aria-controls":"popup-".concat(this.uid),"aria-label":this.label,required:this.requiredField}),h("priv-datepicker",{disabled:this.disabled,date:this.lastValidValue?new Date(this.lastValidValue):new Date,parentId:this.uid})),h("div",{id:"error-".concat(this.uid),class:"error","aria-live":"assertive","aria-atomic":"true"},this.displayError))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{errorMessage:["handleError"]}},enumerable:false,configurable:true});return e}();DatePicker.style=wmDatepickerCss;export{DatePicker as wm_datepicker};
1
+ import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-17c79cc6.js";import{i as intl,e as isRelatedTarget,h as checkForFocusableElInShadow,g as generateId}from"./functions-78aea827.js";var wmDatepickerCss=':host,wm-datepicker{font-family:inherit}:host *,wm-datepicker *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wrapper,wm-datepicker .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label,wm-datepicker .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required,wm-datepicker .wrapper .label .required{color:#c0392b}:host .wrapper.label-left,wm-datepicker .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper,wm-datepicker .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label,wm-datepicker .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label,wm-datepicker .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label,wm-datepicker .wrapper.invalid .label{color:#c0392b}:host .wrapper.invalid .label:after,wm-datepicker .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after,[dir=RTL] wm-datepicker .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label,wm-datepicker .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper,wm-datepicker .wrapper{position:relative}:host .wrapper .required,wm-datepicker .wrapper .required{color:#c4431c}:host .wrapper .inner-wrapper,wm-datepicker .wrapper .inner-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:2.5rem;border:1px solid;border-color:rgba(35, 35, 35, 0.6);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;max-width:236px;-ms-flex-pack:justify;justify-content:space-between;position:relative}:host .wrapper .inner-wrapper .date-input,wm-datepicker .wrapper .inner-wrapper .date-input{-moz-border-top-left-radius:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-bottom-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;border:none;font-size:0.875rem;padding:0.625rem 0.9375rem 0.5rem;min-width:0;height:100%;-ms-flex:1;flex:1;margin:0}:host .wrapper .inner-wrapper .date-input:disabled,wm-datepicker .wrapper .inner-wrapper .date-input:disabled{background-color:#f0f0f0;color:#737373}:host .wrapper .inner-wrapper .date-input:focus,wm-datepicker .wrapper .inner-wrapper .date-input:focus{outline:none}:host .wrapper.invalid .inner-wrapper,wm-datepicker .wrapper.invalid .inner-wrapper{-webkit-box-shadow:0 0 0 1px #c0392b;-moz-box-shadow:0 0 0 1px #c0392b;box-shadow:0 0 0 1px #c0392b;border-color:#c0392b}:host .wrapper.invalid .error,wm-datepicker .wrapper.invalid .error{margin-top:4px;margin-bottom:4px;display:block;top:100%;left:0;font-style:italic;font-size:0.875rem;color:#c0392b}:host .wrapper.focus .inner-wrapper,wm-datepicker .wrapper.focus .inner-wrapper{-webkit-box-shadow:0 0 0 1px #20cbd4;-moz-box-shadow:0 0 0 1px #20cbd4;box-shadow:0 0 0 1px #20cbd4;outline:none;border-color:#20cbd4}:host .user-is-tabbing .toggle:focus:not(:active),wm-datepicker .user-is-tabbing .toggle:focus:not(:active){border:none;z-index:11}';var DatePicker=function(){function e(e){registerInstance(this,e);this.wmDatepickerNewValidValue=createEvent(this,"wmDatepickerNewValidValue",7);this.value="";this.disabled=false;this.dateFormat="US";this.errorMessage="";this.labelPosition="top";this.label="";this.requiredField=false;this.displayError="";this.lastCommittedValue=this.value;this.parsableEntry=/^(\d{1}|\d{2}|\d{4})[\-\.\/]\d{1,2}[\-\.\/](\d{1}|\d{2}|\d{4})$/;this.isoEntry=/^\d\d\d\d[-]\d\d[-]\d\d$/;this.eightDigitsEntry=/^\d{8}$/;this.dateFormats={US:intl.formatMessage({id:"date.formatUS",defaultMessage:"mm/dd/yyyy"}),INT:intl.formatMessage({id:"date.formatINT",defaultMessage:"dd/mm/yyyy"}),ISO:intl.formatMessage({id:"date.formatISO",defaultMessage:"yyyy/mm/dd"})}}e.prototype.handleTabbingOn=function(){this.dpWrapper&&this.dpWrapper.classList.add("user-is-tabbing")};e.prototype.handleTabbingOff=function(){this.dpWrapper&&this.dpWrapper.classList.remove("user-is-tabbing")};e.prototype.handleError=function(){if(this.errorMessage){this.generateError()}else{this.clearError();this.processInput()}};e.prototype.handleInput=function(e){this.value=e.target.value};e.prototype.handleBlur=function(e){var t=this.preventValidation&&isRelatedTarget(e,this.preventValidation);if(!t){this.processInput()}this.dpWrapper.classList.remove("focus")};e.prototype.focusHandler=function(){this.dpWrapper.classList.add("focus")};e.prototype.handlePopupBlurred=function(e){if(e.detail.relatedTarget!==this.el){var t=new CustomEvent("blur");t.relatedTarget=e.detail.relatedTarget;this.el.dispatchEvent(t)}};e.prototype.getActiveElement=function(){return checkForFocusableElInShadow(document.activeElement)};e.prototype.handleCellTriggered=function(e){var t=e.detail;var r=t.getAttribute("data-year")+"-"+t.getAttribute("data-month")+"-"+t.textContent;this.inputEl.value=this.reformatDate(this.dateFormat,r);this.processInput();var a=new CustomEvent("input");this.el.dispatchEvent(a)};e.prototype.processInput=function(e){var t=!e&&this.requiredField;var r=this.inputEl.value;if(this.eightDigitsEntry.test(this.inputEl.value)){this.inputEl.value=this.addSlashes(this.inputEl.value)}if(this.parsableEntry.test(this.inputEl.value)){r=this.reformatDate("ISO",this.inputEl.value);this.inputEl.value=this.reformatDate(this.dateFormat,r);if(this.isValidDate(r)){if(this.errorMessage){this.generateError()}else{this.clearError()}}else if(this.inputEl.value.length){this.generateError()}}else if(this.inputEl.value.length||t||this.errorMessage){this.generateError()}else if(!this.inputEl.value.length&&!t){this.clearError()}if(r!==this.lastCommittedValue){this.value=r;var a=new CustomEvent("change");this.el.dispatchEvent(a);this.lastCommittedValue=this.value}if(this.isValidDate(r)&&r!==this.lastValidValue){this.wmDatepickerNewValidValue.emit();this.lastValidValue=r}};e.prototype.reformatDate=function(e,t){if(!t){return""}else if(!this.parsableEntry.test(t)){return t}else{var r=t.replace(/[\-\.]/gi,"/").split("/");switch(e){case"US":case this.dateFormats["US"]:return r[1].padStart(2,"0")+"/"+r[2].padStart(2,"0")+"/"+r[0].padStart(4,"20");case"INT":case this.dateFormats["INT"]:return r[2].padStart(2,"0")+"/"+r[1].padStart(2,"0")+"/"+r[0].padStart(4,"20");case"ISO":case this.dateFormats["ISO"]:if(this.dateFormat==="US"||this.dateFormat===this.dateFormats["US"]){return r[2].padStart(4,"20")+"-"+r[0].padStart(2,"0")+"-"+r[1].padStart(2,"0")}else if(this.dateFormat==="INT"||this.dateFormat===this.dateFormats["INT"]){return r[2].padStart(4,"20")+"-"+r[1].padStart(2,"0")+"-"+r[0].padStart(2,"0")}else if(this.dateFormat==="ISO"||this.dateFormat===this.dateFormats["ISO"]){return r[0].padStart(4,"20")+"-"+r[1].padStart(2,"0")+"-"+r[2].padStart(2,"0")}default:return r.join("/")}}};e.prototype.isValidDate=function(e){if(!e||!this.isoEntry.test(e)){return false}else{var t=e.split("-");var r=parseInt(t[2],10);var a=parseInt(t[1],10);var i=parseInt(t[0],10);if(i<1e3||i>3e3||a==0||a>12)return false;var s=[31,28,31,30,31,30,31,31,30,31,30,31];if(i%400==0||i%100!=0&&i%4==0)s[1]=29;return r>0&&r<=s[a-1]}};e.prototype.generateError=function(){var e=intl.formatMessage({id:"date.requiredDateError",defaultMessage:"A date is required."});var t=intl.formatMessage({id:"date.invalidDate",defaultMessage:"Please enter a valid date in the format {dateFormat, select, us {mm/dd/yyyy} int {dd/mm/yyyy} other {yyyy/mm/dd}}."},{dateFormat:this.dateFormat.toLowerCase()});if(this.errorMessage){this.displayError=this.errorMessage}else if(this.inputEl.value.length){this.displayError=t}else if(!this.inputEl.value.length&&this.requiredField){this.displayError=e}};e.prototype.clearError=function(){this.displayError=""};e.prototype.addSlashes=function(e){if(this.dateFormat==="ISO"||this.dateFormat===this.dateFormats["ISO"]){return e.substring(0,4)+"/"+e.substring(4,6)+"/"+e.substring(6)}else{return e.substring(0,2)+"/"+e.substring(2,4)+"/"+e.substring(4)}};e.prototype.componentWillLoad=function(){this.el.focus=function(){if(!this.disabled){this.shadowRoot.querySelector("input").focus()}};if(this.label===""){console.error("You must include a label prop for the datepicker input (for accessibility reasons), even if the label position is none.")}if(this.errorMessage){this.generateError()}this.uid=this.el.id?this.el.id:generateId();if(this.value&&this.isValidDate(this.value)){this.lastValidValue=this.value}};e.prototype.componentDidLoad=function(){this.inputEl.value=this.reformatDate(this.dateFormat,this.value);this.processInput(true)};e.prototype.render=function(){var e=this;var t=intl.formatMessage({id:"date.format",defaultMessage:"{dateFormat, select, us {mm/dd/yyyy} int {dd/mm/yyyy} other {yyyy/mm/dd}}"},{dateFormat:this.dateFormat.toLowerCase()});return h(Host,{id:this.uid,"aria-busy":"false",class:"".concat(this.displayError?"invalid":""),invalid:this.displayError?"true":null},h("div",{ref:function(t){return e.dpWrapper=t},class:"wrapper label-".concat(this.labelPosition," ").concat(this.displayError?"invalid":"")},h("div",{class:"label-wrapper"},this.labelPosition!=="none"&&h("label",{id:"datepickerLabel-".concat(this.uid),htmlFor:"date-input-".concat(this.uid),class:"label",title:"".concat(this.label," (").concat(t,")")},this.label,this.requiredField&&h("span",{"aria-hidden":"true",class:"required"},"*"))),h("div",null,h("div",{class:"inner-wrapper"},h("input",{disabled:this.disabled,type:"text",id:"date-input-".concat(this.uid),class:"date-input",name:"date",placeholder:t,onFocus:this.focusHandler.bind(this),onInput:function(t){return e.handleInput(t)},onBlur:function(t){return e.handleBlur(t)},ref:function(t){return e.inputEl=t},"aria-describedby":"error-".concat(this.uid),"aria-controls":"popup-".concat(this.uid),"aria-label":this.label,required:this.requiredField}),h("priv-datepicker",{disabled:this.disabled,date:this.lastValidValue?new Date(this.lastValidValue):new Date,parentId:this.uid})),h("div",{id:"error-".concat(this.uid),class:"error","aria-live":"assertive","aria-atomic":"true"},this.displayError))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{errorMessage:["handleError"]}},enumerable:false,configurable:true});return e}();DatePicker.style=wmDatepickerCss;export{DatePicker as wm_datepicker};
@@ -1 +1 @@
1
- import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-7603f98e.js";import{i as intl,g as generateId,e as isRelatedTarget}from"./functions-61c7bb1f.js";var wmInputCss=':host,wm-input{font-family:inherit;width:100%}:host *,wm-input *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wrapper,wm-input .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label,wm-input .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required,wm-input .wrapper .label .required{color:#c0392b}:host .wrapper.label-left,wm-input .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper,wm-input .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label,wm-input .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label,wm-input .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label,wm-input .wrapper.invalid .label{color:#c0392b}:host .wrapper.invalid .label:after,wm-input .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after,[dir=RTL] wm-input .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label,wm-input .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper .inner-wrapper,wm-input .wrapper .inner-wrapper{width:100%}:host .wrapper .inputfield-wrapper,wm-input .wrapper .inputfield-wrapper{height:2.5rem;border:1px solid #4a4a4a;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;display:-ms-flexbox;display:flex}:host .wrapper .character-count,wm-input .wrapper .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:5rem;background-color:rgba(74, 74, 74, 0.05);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .wrapper input,wm-input .wrapper input{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;border:none;font-family:inherit;font-size:0.875rem;height:100%;-ms-flex:1;flex:1;padding:0.75rem 1rem;width:100%}:host .wrapper input:disabled,wm-input .wrapper input:disabled{background-color:#f0f0f0;color:#737373}:host .wrapper input:focus,wm-input .wrapper input:focus{outline:none}:host .wrapper .info,wm-input .wrapper .info{font-style:italic;line-height:100%;margin:4px 0}:host .wrapper.invalid .inputfield-wrapper,wm-input .wrapper.invalid .inputfield-wrapper{-webkit-box-shadow:0 0 0 1px #c0392b;-moz-box-shadow:0 0 0 1px #c0392b;box-shadow:0 0 0 1px #c0392b;border-color:#c0392b}:host .wrapper.invalid .error-message,wm-input .wrapper.invalid .error-message{color:#c0392b;margin:4px 0;display:block;font-style:italic;line-height:100%}:host .wrapper:focus .inputfield-wrapper,:host .wrapper.focus .inputfield-wrapper,wm-input .wrapper:focus .inputfield-wrapper,wm-input .wrapper.focus .inputfield-wrapper{-webkit-box-shadow:0 0 0 1px #20cbd4;-moz-box-shadow:0 0 0 1px #20cbd4;box-shadow:0 0 0 1px #20cbd4;outline:none;border-color:#20cbd4}:host .sr-only,wm-input .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var Input=function(){function e(e){registerInstance(this,e);this.wmInputValueChanged=createEvent(this,"wmInputValueChanged",7);this.labelPosition="top";this.value="";this.disabled=false;this.placeholder="";this.requiredField=false;this.type="text";this.step=1;this.announcement="";this.displayedErrorMessage="";this.uid="";this.previousBlurredValue="";this.requiredErrorMessage=intl.formatMessage({id:"global.requiredError",defaultMessage:"This field is required."});this.numberErrorMessage=intl.formatMessage({id:"input.numberError",defaultMessage:"Please enter a valid number."})}Object.defineProperty(e.prototype,"charCount",{get:function(){return this.value.length},enumerable:false,configurable:true});e.prototype.componentWillLoad=function(){this.uid=this.el.id?this.el.id:generateId();this.el.focus=function(){if(!this.disabled){this.shadowRoot.querySelector("input").focus()}};if(!this.label){console.error("wm-input requires the label property")}};e.prototype.componentDidLoad=function(){if(this.value){this.inputEl.value=this.value;this.previousBlurredValue=this.inputEl.value}};e.prototype.handleErrorMessage=function(e){this.displayedErrorMessage=e};e.prototype.handleKeyDown=function(e){var t=e.ctrlKey||e.metaKey||e.altKey;var r=/^.$/.test(e.key)&&!t;var i=r&&this.characterLimit&&this.inputEl.value.length>=this.characterLimit;if(i){this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit))}};e.prototype.handleBlur=function(e){if(this.value!==this.previousBlurredValue){this.wmInputValueChanged.emit({value:this.value})}this.previousBlurredValue=this.value;var t=this.preventValidation&&isRelatedTarget(e,this.preventValidation);if(!t){this.displayedErrorMessage=this.validate()}this.inputWrapperEl.classList.remove("focus")};e.prototype.handleInput=function(e){this.value=e.target.value;if(this.characterLimit&&this.charCount>=this.characterLimit-5){this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit))}};e.prototype.handleFocus=function(){this.inputWrapperEl.classList.add("focus")};e.prototype.validate=function(){var e=[this.validateNumber.bind(this),this.validateRequired.bind(this)];if(this.errorMessage){return this.errorMessage}else{return e.reduce((function(e,t){return e?e:t()}),"")}};e.prototype.validateRequired=function(){return this.requiredField&&this.value===""?this.requiredErrorMessage:""};e.prototype.validateNumber=function(){return this.type==="number"&&this.inputEl.validity.badInput?this.numberErrorMessage:""};e.prototype.announce=function(e){if(this.liveRegionEl.textContent===e){e+=" "}this.announcement=e};e.prototype.generateCharacterLimitWarning=function(e,t){var r=intl.formatMessage({id:"global.charactersEntered",defaultMessage:"{x, number} of {y, number} characters entered.",description:"for screen readers"},{x:e,y:t});var i=intl.formatMessage({id:"global.characterLimitReached",defaultMessage:"No additional characters will be entered.",description:"for screen readers"});return"".concat(r).concat(e>=t?" "+i:"")};e.prototype.generateCharacterLimitLabel=function(e){return intl.formatMessage({id:"global.characterLimit",defaultMessage:"{limit, number} characters allowed.",description:"for screen readers"},{limit:e})};e.prototype.renderErrorMessage=function(){return this.errorMessage||this.displayedErrorMessage};e.prototype.render=function(){var e=this;return h(Host,{id:this.uid},h("div",{class:"wrapper label-".concat(this.labelPosition," ").concat(this.errorMessage||this.displayedErrorMessage?"invalid":""),ref:function(t){return e.inputWrapperEl=t}},h("div",{class:"label-wrapper"},this.labelPosition!=="none"&&h("label",{htmlFor:"inputfield-".concat(this.uid),class:"label"},this.label,this.requiredField&&h("span",{class:"required","aria-hidden":"true"},"*"))),h("div",{class:"inner-wrapper"},h("div",{class:"inputfield-wrapper"},h("input",{ref:function(t){return e.inputEl=t},id:"inputfield-".concat(this.uid),disabled:this.disabled,"aria-label":"".concat(this.label).concat(this.characterLimit?" "+this.generateCharacterLimitLabel(this.characterLimit):""),"aria-describedby":"info-".concat(this.uid," error-").concat(this.uid),onInput:function(t){return e.handleInput(t)},onKeyDown:function(t){return e.handleKeyDown(t)},onBlur:function(t){return e.handleBlur(t)},onFocus:this.handleFocus.bind(this),placeholder:this.placeholder,autocomplete:"off",required:this.requiredField,maxLength:this.characterLimit||undefined,type:this.type,step:this.step,max:this.max,min:this.min}),this.characterLimit&&typeof this.characterLimit==="number"?h("div",{class:"character-count"},this.charCount,"/",this.characterLimit):""),this.info&&h("div",{id:"info-".concat(this.uid),class:"info"},this.info),h("div",{id:"error-".concat(this.uid),"aria-live":"assertive",class:"error-message","aria-atomic":"true"},this.renderErrorMessage()),h("div",{class:"sr-only","aria-live":"polite","aria-atomic":"true",ref:function(t){return e.liveRegionEl=t}},this.announcement))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{errorMessage:["handleErrorMessage"]}},enumerable:false,configurable:true});return e}();Input.style=wmInputCss;export{Input as wm_input};
1
+ import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-17c79cc6.js";import{i as intl,g as generateId,e as isRelatedTarget}from"./functions-78aea827.js";var wmInputCss=':host,wm-input{font-family:inherit;width:100%}:host *,wm-input *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wrapper,wm-input .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label,wm-input .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required,wm-input .wrapper .label .required{color:#c0392b}:host .wrapper.label-left,wm-input .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper,wm-input .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label,wm-input .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label,wm-input .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label,wm-input .wrapper.invalid .label{color:#c0392b}:host .wrapper.invalid .label:after,wm-input .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after,[dir=RTL] wm-input .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label,wm-input .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper .inner-wrapper,wm-input .wrapper .inner-wrapper{width:100%}:host .wrapper .inputfield-wrapper,wm-input .wrapper .inputfield-wrapper{height:2.5rem;border:1px solid #4a4a4a;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;display:-ms-flexbox;display:flex}:host .wrapper .character-count,wm-input .wrapper .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:5rem;background-color:rgba(74, 74, 74, 0.05);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .wrapper input,wm-input .wrapper input{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;border:none;font-family:inherit;font-size:0.875rem;height:100%;-ms-flex:1;flex:1;padding:0.75rem 1rem;width:100%}:host .wrapper input:disabled,wm-input .wrapper input:disabled{background-color:#f0f0f0;color:#737373}:host .wrapper input:focus,wm-input .wrapper input:focus{outline:none}:host .wrapper .info,wm-input .wrapper .info{font-style:italic;line-height:100%;margin:4px 0}:host .wrapper.invalid .inputfield-wrapper,wm-input .wrapper.invalid .inputfield-wrapper{-webkit-box-shadow:0 0 0 1px #c0392b;-moz-box-shadow:0 0 0 1px #c0392b;box-shadow:0 0 0 1px #c0392b;border-color:#c0392b}:host .wrapper.invalid .error-message,wm-input .wrapper.invalid .error-message{color:#c0392b;margin:4px 0;display:block;font-style:italic;line-height:100%}:host .wrapper:focus .inputfield-wrapper,:host .wrapper.focus .inputfield-wrapper,wm-input .wrapper:focus .inputfield-wrapper,wm-input .wrapper.focus .inputfield-wrapper{-webkit-box-shadow:0 0 0 1px #20cbd4;-moz-box-shadow:0 0 0 1px #20cbd4;box-shadow:0 0 0 1px #20cbd4;outline:none;border-color:#20cbd4}:host .sr-only,wm-input .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var Input=function(){function e(e){registerInstance(this,e);this.wmInputValueChanged=createEvent(this,"wmInputValueChanged",7);this.labelPosition="top";this.value="";this.disabled=false;this.placeholder="";this.requiredField=false;this.type="text";this.step=1;this.announcement="";this.displayedErrorMessage="";this.uid="";this.previousBlurredValue="";this.requiredErrorMessage=intl.formatMessage({id:"global.requiredError",defaultMessage:"This field is required."});this.numberErrorMessage=intl.formatMessage({id:"input.numberError",defaultMessage:"Please enter a valid number."})}Object.defineProperty(e.prototype,"charCount",{get:function(){return this.value.length},enumerable:false,configurable:true});e.prototype.componentWillLoad=function(){this.uid=this.el.id?this.el.id:generateId();this.el.focus=function(){if(!this.disabled){this.shadowRoot.querySelector("input").focus()}};if(!this.label){console.error("wm-input requires the label property")}};e.prototype.componentDidLoad=function(){if(this.value){this.inputEl.value=this.value;this.previousBlurredValue=this.inputEl.value}};e.prototype.handleErrorMessage=function(e){this.displayedErrorMessage=e};e.prototype.handleKeyDown=function(e){var t=e.ctrlKey||e.metaKey||e.altKey;var r=/^.$/.test(e.key)&&!t;var i=r&&this.characterLimit&&this.inputEl.value.length>=this.characterLimit;if(i){this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit))}};e.prototype.handleBlur=function(e){if(this.value!==this.previousBlurredValue){this.wmInputValueChanged.emit({value:this.value})}this.previousBlurredValue=this.value;var t=this.preventValidation&&isRelatedTarget(e,this.preventValidation);if(!t){this.displayedErrorMessage=this.validate()}this.inputWrapperEl.classList.remove("focus")};e.prototype.handleInput=function(e){this.value=e.target.value;if(this.characterLimit&&this.charCount>=this.characterLimit-5){this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit))}};e.prototype.handleFocus=function(){this.inputWrapperEl.classList.add("focus")};e.prototype.validate=function(){var e=[this.validateNumber.bind(this),this.validateRequired.bind(this)];if(this.errorMessage){return this.errorMessage}else{return e.reduce((function(e,t){return e?e:t()}),"")}};e.prototype.validateRequired=function(){return this.requiredField&&this.value===""?this.requiredErrorMessage:""};e.prototype.validateNumber=function(){return this.type==="number"&&this.inputEl.validity.badInput?this.numberErrorMessage:""};e.prototype.announce=function(e){if(this.liveRegionEl.textContent===e){e+=" "}this.announcement=e};e.prototype.generateCharacterLimitWarning=function(e,t){var r=intl.formatMessage({id:"global.charactersEntered",defaultMessage:"{x, number} of {y, number} characters entered.",description:"for screen readers"},{x:e,y:t});var i=intl.formatMessage({id:"global.characterLimitReached",defaultMessage:"No additional characters will be entered.",description:"for screen readers"});return"".concat(r).concat(e>=t?" "+i:"")};e.prototype.generateCharacterLimitLabel=function(e){return intl.formatMessage({id:"global.characterLimit",defaultMessage:"{limit, number} characters allowed.",description:"for screen readers"},{limit:e})};e.prototype.renderErrorMessage=function(){return this.errorMessage||this.displayedErrorMessage};e.prototype.render=function(){var e=this;return h(Host,{id:this.uid},h("div",{class:"wrapper label-".concat(this.labelPosition," ").concat(this.errorMessage||this.displayedErrorMessage?"invalid":""),ref:function(t){return e.inputWrapperEl=t}},h("div",{class:"label-wrapper"},this.labelPosition!=="none"&&h("label",{htmlFor:"inputfield-".concat(this.uid),class:"label"},this.label,this.requiredField&&h("span",{class:"required","aria-hidden":"true"},"*"))),h("div",{class:"inner-wrapper"},h("div",{class:"inputfield-wrapper"},h("input",{ref:function(t){return e.inputEl=t},id:"inputfield-".concat(this.uid),disabled:this.disabled,"aria-label":"".concat(this.label).concat(this.characterLimit?" "+this.generateCharacterLimitLabel(this.characterLimit):""),"aria-describedby":"info-".concat(this.uid," error-").concat(this.uid),onInput:function(t){return e.handleInput(t)},onKeyDown:function(t){return e.handleKeyDown(t)},onBlur:function(t){return e.handleBlur(t)},onFocus:this.handleFocus.bind(this),placeholder:this.placeholder,autocomplete:"off",required:this.requiredField,maxLength:this.characterLimit||undefined,type:this.type,step:this.step,max:this.max,min:this.min}),this.characterLimit&&typeof this.characterLimit==="number"?h("div",{class:"character-count"},this.charCount,"/",this.characterLimit):""),this.info&&h("div",{id:"info-".concat(this.uid),class:"info"},this.info),h("div",{id:"error-".concat(this.uid),"aria-live":"assertive",class:"error-message","aria-atomic":"true"},this.renderErrorMessage()),h("div",{class:"sr-only","aria-live":"polite","aria-atomic":"true",ref:function(t){return e.liveRegionEl=t}},this.announcement))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{errorMessage:["handleErrorMessage"]}},enumerable:false,configurable:true});return e}();Input.style=wmInputCss;export{Input as wm_input};
@@ -1 +1 @@
1
- import{r as registerInstance,h,g as getElement}from"./index-7603f98e.js";var wmModalFooterCss="wm-modal-footer{-webkit-border-radius:0px 0px 5px 5px;-moz-border-radius:0px 0px 5px 5px;-ms-border-radius:0px 0px 5px 5px;border-radius:0px 0px 5px 5px;margin-top:-1px}wm-modal-footer .wm-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}@media only screen and (max-width: 650px){wm-modal-footer .wm-wrapper.footer-text{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}wm-modal-footer .wm-wrapper wm-button+wm-button{margin-left:1rem}wm-modal-footer .wm-wrapper .wm-info{font-size:0.875rem;font-style:italic}@media only screen and (max-width: 650px){wm-modal-footer .wm-wrapper .wm-info{padding-bottom:0.625rem}}wm-modal-footer .wm-wrapper .wm-info:focus{outline:none}";var ModalFooter=function(){function e(e){registerInstance(this,e);this.secondaryText="";this.primaryText="";this.infoText="";this.primaryActionDisabled=false;this.deleteStyle=false}e.prototype.componentWillLoad=function(){var e=this;this.uid=this.el.parentElement.uid;this.el.parentElement.addEventListener("focusLastElement",(function(){e.lastElement.focus()}))};e.prototype.emitParentPrimaryEvent=function(){var e=this.el.parentElement;e.emitPrimaryEvent()};e.prototype.emitParentSecondaryEvent=function(){var e=this.el.parentElement;e.emitSecondaryEvent()};e.prototype.render=function(){var e=this;return h("div",{class:"wm-wrapper ".concat(this.infoText?" footer-text":"")},h("div",{class:"wm-info"},this.infoText),h("div",{class:"wm-button-collection"},this.secondaryText&&h("wm-button",{onClick:function(){return e.emitParentSecondaryEvent()},id:"wm-secondary-".concat(this.uid),ref:function(t){return e.primaryActionDisabled?e.lastElement=t:null}},this.secondaryText),h("wm-button",{"button-type":this.deleteStyle?"secondary":"primary","permanently-delete":this.deleteStyle,onClick:function(){return e.emitParentPrimaryEvent()},disabled:this.primaryActionDisabled,id:"wm-primary-".concat(this.uid),ref:function(t){return!e.primaryActionDisabled?e.lastElement=t:null}},this.primaryText)))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();ModalFooter.style=wmModalFooterCss;export{ModalFooter as wm_modal_footer};
1
+ import{r as registerInstance,h,g as getElement}from"./index-17c79cc6.js";var wmModalFooterCss="wm-modal-footer{-webkit-border-radius:0px 0px 5px 5px;-moz-border-radius:0px 0px 5px 5px;-ms-border-radius:0px 0px 5px 5px;border-radius:0px 0px 5px 5px;margin-top:-1px}wm-modal-footer .wm-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}@media only screen and (max-width: 650px){wm-modal-footer .wm-wrapper.footer-text{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}wm-modal-footer .wm-wrapper wm-button+wm-button{margin-left:1rem}wm-modal-footer .wm-wrapper .wm-info{font-size:0.875rem;font-style:italic}@media only screen and (max-width: 650px){wm-modal-footer .wm-wrapper .wm-info{padding-bottom:0.625rem}}wm-modal-footer .wm-wrapper .wm-info:focus{outline:none}";var ModalFooter=function(){function e(e){registerInstance(this,e);this.secondaryText="";this.primaryText="";this.infoText="";this.primaryActionDisabled=false;this.deleteStyle=false}e.prototype.componentWillLoad=function(){var e=this;this.uid=this.el.parentElement.uid;this.el.parentElement.addEventListener("focusLastElement",(function(){e.lastElement.focus()}))};e.prototype.emitParentPrimaryEvent=function(){var e=this.el.parentElement;e.emitPrimaryEvent()};e.prototype.emitParentSecondaryEvent=function(){var e=this.el.parentElement;e.emitSecondaryEvent()};e.prototype.render=function(){var e=this;return h("div",{class:"wm-wrapper ".concat(this.infoText?" footer-text":"")},h("div",{class:"wm-info","aria-live":"polite"},this.infoText),h("div",{class:"wm-button-collection"},this.secondaryText&&h("wm-button",{onClick:function(){return e.emitParentSecondaryEvent()},id:"wm-secondary-".concat(this.uid),ref:function(t){return e.primaryActionDisabled?e.lastElement=t:null}},this.secondaryText),h("wm-button",{"button-type":this.deleteStyle?"secondary":"primary","permanently-delete":this.deleteStyle,onClick:function(){return e.emitParentPrimaryEvent()},disabled:this.primaryActionDisabled,id:"wm-primary-".concat(this.uid),ref:function(t){return!e.primaryActionDisabled?e.lastElement=t:null}},this.primaryText)))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();ModalFooter.style=wmModalFooterCss;export{ModalFooter as wm_modal_footer};
@@ -1 +1 @@
1
- import{r as registerInstance,h,H as Host,g as getElement}from"./index-7603f98e.js";import{i as intl}from"./functions-61c7bb1f.js";var wmModalHeaderCss="wm-modal-header{-webkit-border-radius:5px 5px 0 0px;-moz-border-radius:5px 5px 0 0px;-ms-border-radius:5px 5px 0 0px;border-radius:5px 5px 0 0px;margin-bottom:-1px}wm-modal-header .wm-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}wm-modal-header .wm-wrapper .title{margin:0;font-weight:600;font-size:1.125rem;color:#4a4a4a;line-height:normal}wm-modal-header .wm-wrapper .title .subtitle{display:block;font-size:0.875rem;font-weight:normal}wm-modal-header .wm-wrapper .title:focus{outline:none}";var ModalHeader=function(){function e(e){registerInstance(this,e);this.heading="";this.subheading="";this.closeTooltipMessage=intl.formatMessage({id:"global.closeVerb",defaultMessage:"Close",description:"For a button, to close a user interface element"})}e.prototype.componentWillLoad=function(){var e=this;this.uid=this.el.parentElement.uid;this.el.parentElement.addEventListener("focusFirstElement",(function(){e.closeButtonEl.focus()}))};e.prototype.emitParentCloseEvent=function(){var e=this.el.parentElement;e.emitCloseEvent()};e.prototype.render=function(){var e=this;return h(Host,null,h("div",{class:"wm-wrapper"},h("div",null,h("h2",{class:"title",id:"wm-modal-heading-text-".concat(this.uid)},this.heading,h("span",{class:"subtitle"},this.subheading))),h("wm-button",{"button-type":"navigational",icon:"f156",tooltip:this.closeTooltipMessage,"tooltip-position":"left",id:"wm-modal-close-".concat(this.uid),ref:function(t){return e.closeButtonEl=t},onClick:function(){return e.emitParentCloseEvent()}})))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();ModalHeader.style=wmModalHeaderCss;export{ModalHeader as wm_modal_header};
1
+ import{r as registerInstance,h,H as Host,g as getElement}from"./index-17c79cc6.js";import{i as intl}from"./functions-78aea827.js";var wmModalHeaderCss="wm-modal-header{-webkit-border-radius:5px 5px 0 0px;-moz-border-radius:5px 5px 0 0px;-ms-border-radius:5px 5px 0 0px;border-radius:5px 5px 0 0px;margin-bottom:-1px}wm-modal-header .wm-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}wm-modal-header .wm-wrapper .title{margin:0;font-weight:600;font-size:1.125rem;color:#4a4a4a;line-height:normal}wm-modal-header .wm-wrapper .title .subtitle{display:block;font-size:0.875rem;font-weight:normal}wm-modal-header .wm-wrapper .title:focus{outline:none}";var ModalHeader=function(){function e(e){registerInstance(this,e);this.heading="";this.subheading="";this.closeTooltipMessage=intl.formatMessage({id:"global.closeVerb",defaultMessage:"Close",description:"For a button, to close a user interface element"})}e.prototype.componentWillLoad=function(){var e=this;this.uid=this.el.parentElement.uid;this.el.parentElement.addEventListener("focusFirstElement",(function(){e.closeButtonEl.focus()}))};e.prototype.emitParentCloseEvent=function(){var e=this.el.parentElement;e.emitCloseEvent()};e.prototype.render=function(){var e=this;return h(Host,null,h("div",{class:"wm-wrapper"},h("div",null,h("h2",{class:"title",id:"wm-modal-heading-text-".concat(this.uid)},this.heading,h("span",{class:"subtitle"},this.subheading))),h("wm-button",{"button-type":"navigational",icon:"f156",tooltip:this.closeTooltipMessage,"tooltip-position":"left",id:"wm-modal-close-".concat(this.uid),ref:function(t){return e.closeButtonEl=t},onClick:function(){return e.emitParentCloseEvent()}})))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();ModalHeader.style=wmModalHeaderCss;export{ModalHeader as wm_modal_header};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,o,n){function i(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n["throw"](e))}catch(e){r(e)}}function l(e){e.done?o(e.value):i(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(o)try{if(n=1,i&&(r=a[0]&2?i["return"]:a[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;if(i=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;i=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(a[0]===6&&o.label<r[1]){o.label=r[1];r=a;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(a);break}if(r[2])o.ops.pop();o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e];i=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-7603f98e.js";import{g as generateId,j as getFirstFocusableDescendant,c as checkForActiveElInShadow}from"./functions-61c7bb1f.js";var wmModalCss="wm-modal{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;position:fixed;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);z-index:2001;width:80vw;max-width:750px;max-height:80vh;-webkit-box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);-moz-box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14)}wm-modal *{-webkit-box-sizing:border-box;box-sizing:border-box}wm-modal>*{width:80vw;max-width:750px;background:#fff}wm-modal>*:focus{outline:none}wm-modal wm-modal-header,wm-modal wm-modal-footer{padding:1.25rem 1.875rem}wm-modal wm-modal-header{z-index:2003}wm-modal wm-modal-footer{z-index:2003}wm-modal>:not(wm-modal-header):not(wm-modal-footer){max-height:calc(80vh - 166px);z-index:2002}wm-modal.wm-modal wm-modal-header{border-bottom:1px solid #f4f3f6}wm-modal.wm-modal wm-modal-footer{border-top:1px solid #f4f3f6}@media only screen and (max-width: 768px){wm-modal.wm-modal{height:100%;max-height:none;max-width:none;width:100vw}wm-modal.wm-modal>*{max-width:none;width:100vw}wm-modal.wm-modal>*:not(wm-modal-header):not(wm-modal-footer){max-height:none;height:calc(100vh - 166px)}}wm-modal.wm-dialog>:not(wm-modal-header):not(wm-modal-footer){padding:0 1.875rem 1.25rem 1.875rem;font-size:0.875rem;border:none}wm-modal .overlay{width:100vw;height:100vh;max-width:none;max-height:none;position:fixed !important;top:-1;bottom:1;left:-1;right:1;-webkit-transform:translate(0%, 0%);transform:translate(0%, 0%);background-color:rgba(25, 25, 25, 0.4);-ms-transition:opacity 0.5s ease-out;-webkit-transition:opacity 0.5s ease-out;-moz-transition:opacity 0.5s ease-out;transition:opacity 0.5s ease-out;z-index:2000}wm-modal.hide{visibility:hidden}wm-modal .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important;top:0;left:0}";var Modal=function(){function e(e){var t=this;registerInstance(this,e);this.focusLastElement=createEvent(this,"focusLastElement",3);this.focusFirstElement=createEvent(this,"focusFirstElement",3);this.wmModalCloseTriggered=createEvent(this,"wmModalCloseTriggered",3);this.wmCloseTriggered=createEvent(this,"wmCloseTriggered",7);this.wmModalPrimaryTriggered=createEvent(this,"wmModalPrimaryTriggered",7);this.wmPrimaryTriggered=createEvent(this,"wmPrimaryTriggered",7);this.wmModalSecondaryTriggered=createEvent(this,"wmModalSecondaryTriggered",7);this.wmSecondaryTriggered=createEvent(this,"wmSecondaryTriggered",7);this.open=false;this.isOpen=false;this.elementToFocus="";this.modalType=null;this.isTypeDialog=null;this.bodyFocusListener=function(){return t.redirectFocusFromBody()}}Object.defineProperty(e.prototype,"tempOpen",{get:function(){return this.open||this.isOpen},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"tempModalType",{get:function(){return this.modalType?this.modalType:this.isTypeDialog?"dialog":"modal"},enumerable:false,configurable:true});e.prototype.toggleModal=function(){this.tempOpen?this.showModal():this.hideModal()};e.prototype.handleClick=function(e){this.tempOpen&&e.target===this.overlayEl&&this.focusOnOpen.focus()};e.prototype.closeModalOnEscape=function(e){if(e.key==="Escape"){e.stopPropagation();this.wmModalCloseTriggered.emit();this.wmCloseTriggered.emit();this.open=false}};e.prototype.showModal=function(){var e=this;this.setElToFocusOnClose();document.body.style.overflow="hidden";document.body.tabIndex=0;document.body.removeEventListener("focus",this.bodyFocusListener,true);document.body.addEventListener("focus",this.bodyFocusListener,true);window.requestAnimationFrame((function(){e.setElToFocusOnOpen();window.requestAnimationFrame((function(){return e.focusOnOpen.focus()}))}))};e.prototype.hideModal=function(){var e=this;document.body.style.overflow="visible";document.body.tabIndex=-1;document.body.removeEventListener("focus",this.bodyFocusListener,true);window.requestAnimationFrame((function(){return e.focusOnClose.focus()}))};e.prototype.componentWillLoad=function(){if(this.isOpen){console.warn("wm-modal: is-open has been deprecated as of v3.1.0. Please use open instead.")}if(this.isTypeDialog){console.warn("wm-modal: is-type-dialog has been deprecated as of v3.1.0. Please use modal-type instead.")}if(this.elementToFocus==="primary"||this.elementToFocus==="secondary"){if(!this.el.id){console.error("You are telling the modal to focus an element in the footer when it opens. That's fine! But when you do that, you also need to give the wm-modal-wrapper an ID and set the ID of the modal body to 'content-[id of wm-modal-wrapper]. This is for accessibility purposes.")}}this.uid=this.el.id?this.el.id:generateId()};e.prototype.componentDidLoad=function(){if(this.tempOpen){this.showModal()}};e.prototype.emitCloseEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.wmModalCloseTriggered.emit();this.wmCloseTriggered.emit();return[2]}))}))};e.prototype.emitPrimaryEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.wmModalPrimaryTriggered.emit();this.wmPrimaryTriggered.emit();return[2]}))}))};e.prototype.emitSecondaryEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.wmModalSecondaryTriggered.emit();this.wmSecondaryTriggered.emit();return[2]}))}))};e.prototype.setElToFocusOnOpen=function(){var e=getFirstFocusableDescendant(this.el.querySelector("#wm-modal-close-".concat(this.uid)));if(this.elementToFocus){if(this.elementToFocus==="primary"||this.elementToFocus==="secondary"){this.setAriaDescribedbyOnModal();this.elementToFocus="wm-".concat(this.elementToFocus,"-").concat(this.uid)}var t=this.el.querySelector("#".concat(this.elementToFocus));if(t){var o=getFirstFocusableDescendant(t);if(o){this.focusOnOpen=o}else{console.warn("Ripple Component Library: The modal component couldn't find an element matching the value you passed for 'elementToFocus'. It will fall back to the default and focus the close button when the modal opens.");this.focusOnOpen=e}}else{console.warn("Ripple Component Library: The modal component couldn't find an element matching the value you passed for 'elementToFocus'. It will fall back to the default and focus the close button when the modal opens.");this.focusOnOpen=e}}else{this.focusOnOpen=e}};e.prototype.setAriaDescribedbyOnModal=function(){var e=document.getElementById("content-".concat(this.uid));if(!e){console.warn("Ripple Component Library: The element containing the body of the modal must include an id in the format 'content-[id of modal]' for accessibility purposes.")}else{this.el.setAttribute("aria-describedby","wm-modal-heading-text-".concat(this.uid," content-").concat(this.uid))}};e.prototype.setElToFocusOnClose=function(){var e=document.activeElement;if(e.tagName==="WM-MENUITEM"){this.focusOnClose=e.parentElement}else{this.focusOnClose=checkForActiveElInShadow(e)}};e.prototype.redirectFocusFromBody=function(){if(document.activeElement.tagName==="BODY"){this.setElToFocusOnOpen();this.focusOnOpen.focus()}};e.prototype.render=function(){var e=this;return h(Host,{class:"".concat(this.tempOpen?"":"hide ").concat("wm-"+this.tempModalType),role:"dialog","aria-describedby":"wm-modal-heading-text-".concat(this.uid),"aria-modal":"true",tabindex:this.tempOpen?0:null,onFocus:function(){e.focusLastElement.emit()}},h("div",{class:"overlay",ref:function(t){return e.overlayEl=t}}),h("div",{class:"sr-only",tabIndex:0,onFocus:function(){e.focusFirstElement.emit()}}))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{open:["toggleModal"],isOpen:["toggleModal"]}},enumerable:false,configurable:true});return e}();Modal.style=wmModalCss;export{Modal as wm_modal};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,o,n){function i(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n["throw"](e))}catch(e){r(e)}}function l(e){e.done?o(e.value):i(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(o)try{if(n=1,i&&(r=a[0]&2?i["return"]:a[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;if(i=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;i=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(a[0]===6&&o.label<r[1]){o.label=r[1];r=a;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(a);break}if(r[2])o.ops.pop();o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e];i=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-17c79cc6.js";import{g as generateId,j as getFirstFocusableDescendant,c as checkForActiveElInShadow}from"./functions-78aea827.js";var wmModalCss="wm-modal{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;position:fixed;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);z-index:2001;width:80vw;max-width:750px;max-height:80vh;-webkit-box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);-moz-box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14)}wm-modal *{-webkit-box-sizing:border-box;box-sizing:border-box}wm-modal>*{width:80vw;max-width:750px;background:#fff}wm-modal>*:focus{outline:none}wm-modal wm-modal-header,wm-modal wm-modal-footer{padding:1.25rem 1.875rem}wm-modal wm-modal-header{z-index:2003}wm-modal wm-modal-footer{z-index:2003}wm-modal>:not(wm-modal-header):not(wm-modal-footer){max-height:calc(80vh - 166px);z-index:2002}wm-modal.wm-modal wm-modal-header{border-bottom:1px solid #f4f3f6}wm-modal.wm-modal wm-modal-footer{border-top:1px solid #f4f3f6}@media only screen and (max-width: 768px){wm-modal.wm-modal{height:100%;max-height:none;max-width:none;width:100vw}wm-modal.wm-modal>*{max-width:none;width:100vw}wm-modal.wm-modal>*:not(wm-modal-header):not(wm-modal-footer){max-height:none;height:calc(100vh - 166px)}}wm-modal.wm-dialog>:not(wm-modal-header):not(wm-modal-footer){padding:0 1.875rem 1.25rem 1.875rem;font-size:0.875rem;border:none}wm-modal .overlay{width:100vw;height:100vh;max-width:none;max-height:none;position:fixed !important;top:-1;bottom:1;left:-1;right:1;-webkit-transform:translate(0%, 0%);transform:translate(0%, 0%);background-color:rgba(25, 25, 25, 0.4);-ms-transition:opacity 0.5s ease-out;-webkit-transition:opacity 0.5s ease-out;-moz-transition:opacity 0.5s ease-out;transition:opacity 0.5s ease-out;z-index:2000}wm-modal.hide{visibility:hidden}wm-modal .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important;top:0;left:0}";var Modal=function(){function e(e){var t=this;registerInstance(this,e);this.focusLastElement=createEvent(this,"focusLastElement",3);this.focusFirstElement=createEvent(this,"focusFirstElement",3);this.wmModalCloseTriggered=createEvent(this,"wmModalCloseTriggered",3);this.wmCloseTriggered=createEvent(this,"wmCloseTriggered",7);this.wmModalPrimaryTriggered=createEvent(this,"wmModalPrimaryTriggered",7);this.wmPrimaryTriggered=createEvent(this,"wmPrimaryTriggered",7);this.wmModalSecondaryTriggered=createEvent(this,"wmModalSecondaryTriggered",7);this.wmSecondaryTriggered=createEvent(this,"wmSecondaryTriggered",7);this.open=false;this.isOpen=false;this.elementToFocus="";this.modalType=null;this.isTypeDialog=null;this.bodyFocusListener=function(){return t.redirectFocusFromBody()}}Object.defineProperty(e.prototype,"tempOpen",{get:function(){return this.open||this.isOpen},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"tempModalType",{get:function(){return this.modalType?this.modalType:this.isTypeDialog?"dialog":"modal"},enumerable:false,configurable:true});e.prototype.toggleModal=function(){this.tempOpen?this.showModal():this.hideModal()};e.prototype.handleClick=function(e){this.tempOpen&&e.target===this.overlayEl&&this.focusOnOpen.focus()};e.prototype.closeModalOnEscape=function(e){if(e.key==="Escape"){e.stopPropagation();this.wmModalCloseTriggered.emit();this.wmCloseTriggered.emit();this.open=false}};e.prototype.showModal=function(){var e=this;this.setElToFocusOnClose();document.body.style.overflow="hidden";document.body.tabIndex=0;document.body.removeEventListener("focus",this.bodyFocusListener,true);document.body.addEventListener("focus",this.bodyFocusListener,true);window.requestAnimationFrame((function(){e.setElToFocusOnOpen();window.requestAnimationFrame((function(){return e.focusOnOpen.focus()}))}))};e.prototype.hideModal=function(){var e=this;document.body.style.overflow="visible";document.body.tabIndex=-1;document.body.removeEventListener("focus",this.bodyFocusListener,true);window.requestAnimationFrame((function(){return e.focusOnClose.focus()}))};e.prototype.componentWillLoad=function(){if(this.isOpen){console.warn("wm-modal: is-open has been deprecated as of v3.1.0. Please use open instead.")}if(this.isTypeDialog){console.warn("wm-modal: is-type-dialog has been deprecated as of v3.1.0. Please use modal-type instead.")}if(this.elementToFocus==="primary"||this.elementToFocus==="secondary"){if(!this.el.id){console.error("You are telling the modal to focus an element in the footer when it opens. That's fine! But when you do that, you also need to give the wm-modal-wrapper an ID and set the ID of the modal body to 'content-[id of wm-modal-wrapper]. This is for accessibility purposes.")}}this.uid=this.el.id?this.el.id:generateId()};e.prototype.componentDidLoad=function(){if(this.tempOpen){this.showModal()}};e.prototype.emitCloseEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.wmModalCloseTriggered.emit();this.wmCloseTriggered.emit();return[2]}))}))};e.prototype.emitPrimaryEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.wmModalPrimaryTriggered.emit();this.wmPrimaryTriggered.emit();return[2]}))}))};e.prototype.emitSecondaryEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.wmModalSecondaryTriggered.emit();this.wmSecondaryTriggered.emit();return[2]}))}))};e.prototype.setElToFocusOnOpen=function(){var e=getFirstFocusableDescendant(this.el.querySelector("#wm-modal-close-".concat(this.uid)));if(this.elementToFocus){if(this.elementToFocus==="primary"||this.elementToFocus==="secondary"){this.setAriaDescribedbyOnModal();this.elementToFocus="wm-".concat(this.elementToFocus,"-").concat(this.uid)}var t=this.el.querySelector("#".concat(this.elementToFocus));if(t){var o=getFirstFocusableDescendant(t);if(o){this.focusOnOpen=o}else{console.warn("Ripple Component Library: The modal component couldn't find an element matching the value you passed for 'elementToFocus'. It will fall back to the default and focus the close button when the modal opens.");this.focusOnOpen=e}}else{console.warn("Ripple Component Library: The modal component couldn't find an element matching the value you passed for 'elementToFocus'. It will fall back to the default and focus the close button when the modal opens.");this.focusOnOpen=e}}else{this.focusOnOpen=e}};e.prototype.setAriaDescribedbyOnModal=function(){var e=document.getElementById("content-".concat(this.uid));if(!e){console.warn("Ripple Component Library: The element containing the body of the modal must include an id in the format 'content-[id of modal]' for accessibility purposes.")}else{this.el.setAttribute("aria-describedby","wm-modal-heading-text-".concat(this.uid," content-").concat(this.uid))}};e.prototype.setElToFocusOnClose=function(){var e=document.activeElement;if(e.tagName==="WM-MENUITEM"){this.focusOnClose=e.parentElement}else{this.focusOnClose=checkForActiveElInShadow(e)}};e.prototype.redirectFocusFromBody=function(){if(document.activeElement.tagName==="BODY"){this.setElToFocusOnOpen();this.focusOnOpen.focus()}};e.prototype.render=function(){var e=this;return h(Host,{class:"".concat(this.tempOpen?"":"hide ").concat("wm-"+this.tempModalType),role:"dialog","aria-describedby":"wm-modal-heading-text-".concat(this.uid),"aria-modal":"true",tabindex:this.tempOpen?0:null,onFocus:function(){e.focusLastElement.emit()}},h("div",{class:"overlay",ref:function(t){return e.overlayEl=t}}),h("div",{class:"sr-only",tabIndex:0,onFocus:function(){e.focusFirstElement.emit()}}))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{open:["toggleModal"],isOpen:["toggleModal"]}},enumerable:false,configurable:true});return e}();Modal.style=wmModalCss;export{Modal as wm_modal};
@@ -1 +1 @@
1
- import{r as registerInstance,c as createEvent,h,H as Host,g as getElement,f as forceUpdate}from"./index-7603f98e.js";import{i as intl,r as throttle}from"./functions-61c7bb1f.js";var wmNavigationCss=":host{z-index:10}:host([aria-expanded=true]){z-index:5000}.tray{-webkit-box-shadow:0 0 14px 0 rgba(0, 0, 0, 0.14);-moz-box-shadow:0 0 14px 0 rgba(0, 0, 0, 0.14);box-shadow:0 0 14px 0 rgba(0, 0, 0, 0.14);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:7.5625rem;background-color:#fff;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;font-size:0.875rem;height:100%}.navlist{margin:0;padding:0}.toggle-wrapper{display:none}@media screen and (max-width: 1023px){.tray{-ms-transition:transform 0.33s ease;-webkit-transition:transform 0.33s ease;-moz-transition:transform 0.33s ease;-webkit-transition:-webkit-transform 0.33s ease;transition:-webkit-transform 0.33s ease;transition:transform 0.33s ease;transition:transform 0.33s ease, -webkit-transform 0.33s ease;position:fixed;top:0;bottom:0;left:0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}.tray ul{visibility:hidden}.tray .toggle-wrapper{display:inline-block;min-height:5rem;width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([aria-expanded=true]) .tray{-webkit-transform:translateX(0);transform:translateX(0)}:host([aria-expanded=true]) .tray ul{visibility:visible}.overlay{width:100vw;height:100vh;max-width:none;max-height:none;position:fixed !important;top:0;bottom:0;left:0;right:0;-webkit-transform:translate(0%, 0%);transform:translate(0%, 0%);background-color:rgba(25, 25, 25, 0.4);-ms-transition:opacity 0.5s ease-out;-webkit-transition:opacity 0.5s ease-out;-moz-transition:opacity 0.5s ease-out;transition:opacity 0.5s ease-out}}";var Navigation=function(){function t(t){var e=this;registerInstance(this,t);this.wmNavigationStateChanged=createEvent(this,"wmNavigationStateChanged",7);this.open=false;this.isTabbing=false;this.mainNavigationMessage=intl.formatMessage({id:"navigation.mainNavigation",defaultMessage:"Main",description:"Label describing the site navigation, for screen reader users"});this.openTooltipMessage=intl.formatMessage({id:"global.openVerb",defaultMessage:"Open",description:"For a button, to open a user interface element"});this.closeTooltipMessage=intl.formatMessage({id:"global.closeVerb",defaultMessage:"Close",description:"For a button, to close a user interface element"});this.throttledRerender=throttle((function(){return forceUpdate(e.el)}),50)}Object.defineProperty(t.prototype,"isCollapsible",{get:function(){return window.innerWidth<1024},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"ariaExpanded",{get:function(){return this.isCollapsible?this.open.toString():undefined},enumerable:false,configurable:true});t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.closeOnEscape=function(t){if(t.key==="Escape"){this.open=false}};t.prototype.handleWindowResize=function(){this.throttledRerender()};t.prototype.handleHamburgerClicked=function(){this.open=!this.open};t.prototype.handleClickOnItem=function(){this.open=false};t.prototype.handleStateChange=function(){if(this.isCollapsible){this.wmNavigationStateChanged.emit();this.open?this.expand():this.collapse()}};t.prototype.componentWillLoad=function(){var t=this;if(document.body.classList.contains("wmcl-user-is-tabbing")){this.toggleTabbingOn()}this.el.focus=function(){var e=t.open?t.el.shadowRoot.querySelector(".toggle"):document.querySelector("wm-navigation-hamburger");var i=t.el.querySelector("wm-navigation-item");t.isCollapsible?e.focus():i.focus()};if(this.isCollapsible&&this.open){this.wmNavigationStateChanged.emit();this.expand()}};t.prototype.redirectFocusFromBody=function(t){if(document.activeElement.tagName==="BODY"&&!t.relatedTarget){this.el.focus()}};t.prototype.expand=function(){var t=this;document.body.tabIndex=0;document.body.addEventListener("focus",this.redirectFocusFromBody.bind(this),true);setTimeout((function(){return t.toggleEl.focus()}),250)};t.prototype.collapse=function(){document.body.tabIndex=-1;document.body.removeEventListener("focus",this.redirectFocusFromBody.bind(this));var t=document.querySelector("wm-navigation-hamburger");if(t)t.focus()};t.prototype.focusLastItem=function(){var t=this.el.querySelectorAll("wm-navigation-item");var e=Array.from(t).pop();e.focus()};t.prototype.renderOverlay=function(){var t=this;return h("div",{class:"overlay",onClick:function(){t.open=false}})};t.prototype.render=function(){var t=this;return h(Host,{role:"navigation","aria-expanded":this.ariaExpanded,"aria-label":this.mainNavigationMessage},this.open?this.renderOverlay():"",this.isCollapsible&&h("div",{class:"trapfocus",tabindex:this.open?0:undefined,onFocus:function(){return t.focusLastItem()}}),h("div",{class:"tray"},h("div",{class:"toggle-wrapper"},h("wm-button",{ref:function(e){return t.toggleEl=e},class:"toggle ".concat(this.isTabbing?"user-is-tabbing":""),"button-type":"navigational",icon:this.open?"f156":"f35c","icon-size":"2rem",tooltip:this.open?this.closeTooltipMessage:this.openTooltipMessage,"tooltip-position":"left",tabIndex:this.open?undefined:-1,onClick:function(){t.open=!t.open}})),h("ul",{class:"navlist"},h("slot",null))),this.isCollapsible&&h("div",{class:"trapfocus",tabindex:this.open?0:undefined,onFocus:function(){return t.toggleEl.focus()}}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{open:["handleStateChange"]}},enumerable:false,configurable:true});return t}();Navigation.style=wmNavigationCss;var wmNavigationHamburgerCss='button{display:none;width:100%;height:100%;border:none;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1);background-color:transparent;outline:none;padding:0}button.user-is-tabbing:focus{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e;-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e;box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e}button.user-is-tabbing:focus::-moz-focus-inner{border:0}button:hover{background-color:#d7d6d9}.icon:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f35c";font-size:1.5rem;color:#575195}@media screen and (max-width: 1023px){:host{width:3.75rem;height:3.75rem}button{display:initial}}';var NavigationHamburger=function(){function t(t){registerInstance(this,t);this.wmNavigationHamburgerClicked=createEvent(this,"wmNavigationHamburgerClicked",7);this.tooltipVisible=false;this.isTabbing=false;this.open=false;this.showNavMessage=intl.formatMessage({id:"navigation.showNavigation",defaultMessage:"Show navigation",description:"For user interface element opening a navigation menu"})}Object.defineProperty(t.prototype,"tooltipEl",{get:function(){return document.getElementById("wm-tooltip")},enumerable:false,configurable:true});t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.handleNavigationStateChanged=function(t){this.open=t.target.open};t.prototype.componentWillLoad=function(){this.el.focus=function(){var t=this;this.shadowRoot.querySelector("button").focus();requestAnimationFrame((function(){t.tooltipVisible=false}))};if(document.body.classList.contains("wmcl-user-is-tabbing")){this.toggleTabbingOn()}if(!this.navId){console.error("wm-navigation-hamburger: nav-id is a required prop")}};t.prototype.showTooltip=function(){var t=this;this.tooltipEl.textContent=this.showNavMessage;this.tooltipEl.style.top="1.125rem";this.tooltipEl.style.left="2.75rem";this.tooltipEl.style.transitionDelay="500ms";this.tooltipEl.style.opacity="1";setTimeout((function(){t.tooltipVisible=true}),500)};t.prototype.hideTooltip=function(){this.tooltipEl.style.transitionDelay="0s";this.tooltipEl.style.opacity="0";this.tooltipVisible=false};t.prototype.showTooltipForKeyboardUsers=function(){if(this.isTabbing){this.showTooltip()}};t.prototype.handleClick=function(){this.hideTooltip();this.wmNavigationHamburgerClicked.emit()};t.prototype.render=function(){var t=this;return h(Host,{class:"hamburger ".concat(this.open?"nav-open":"nav-closed")},h("button",{class:this.isTabbing?"user-is-tabbing":undefined,"aria-expanded":this.open,"aria-controls":this.navId,"aria-label":this.showNavMessage,onMouseEnter:function(){return t.showTooltip()},onMouseLeave:function(){return t.hideTooltip()},onFocus:function(){return t.showTooltipForKeyboardUsers()},onBlur:function(){return t.hideTooltip()},onClick:function(){return t.handleClick()}},h("span",{class:"icon"})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();NavigationHamburger.style=wmNavigationHamburgerCss;var wmNavigationItemCss='.link{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;color:inherit;text-decoration:none;min-height:4.5rem;text-align:center;padding:1.25rem 0.5rem;font-weight:500;outline:none;position:relative}.link:hover{background-color:#f2f2f2}.link .icon{font-size:1.375rem;color:#6b6b6b}.link .text{font-size:0.875rem}.link.user-is-tabbing:focus{-webkit-box-shadow:inset 0 2px 2px 0 rgba(244, 243, 246, 0.2), inset 0 2px 2px 0 rgba(0, 0, 0, 0.1), inset 0 0 4px 3px #61279e;box-shadow:inset 0 2px 2px 0 rgba(244, 243, 246, 0.2), inset 0 2px 2px 0 rgba(0, 0, 0, 0.1), inset 0 0 4px 3px #61279e}.link.active{background-color:#e9e7ec}.link.active:before{content:"";background-color:#575195;position:absolute;height:100%;width:5px;left:0}.link.active .text{color:#575195}.link.active .icon{color:#575195}';var NavigationItem=function(){function t(t){registerInstance(this,t);this.wmNavigationItemClicked=createEvent(this,"wmNavigationItemClicked",7);this.isTabbing=false}t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.componentWillLoad=function(){this.el.focus=function(){this.shadowRoot.querySelector(".link").focus()};if(document.body.classList.contains("wmcl-user-is-tabbing")){this.toggleTabbingOn()}};t.prototype.render=function(){var t=this;return h(Host,{role:"listitem"},h("a",{class:"link ".concat(this.active?"active":""," ").concat(this.isTabbing?"user-is-tabbing":""),href:this.href,onClick:function(){return t.wmNavigationItemClicked.emit()}},h("div",{class:"icon","aria-hidden":"true"},h("slot",null)),h("div",{class:"text"},this.text)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();NavigationItem.style=wmNavigationItemCss;export{Navigation as wm_navigation,NavigationHamburger as wm_navigation_hamburger,NavigationItem as wm_navigation_item};
1
+ import{r as registerInstance,c as createEvent,h,H as Host,g as getElement,f as forceUpdate}from"./index-17c79cc6.js";import{i as intl,r as throttle}from"./functions-78aea827.js";var wmNavigationCss=":host{z-index:10}:host([aria-expanded=true]){z-index:5000}.tray{-webkit-box-shadow:0 0 14px 0 rgba(0, 0, 0, 0.14);-moz-box-shadow:0 0 14px 0 rgba(0, 0, 0, 0.14);box-shadow:0 0 14px 0 rgba(0, 0, 0, 0.14);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:7.5625rem;background-color:#fff;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;font-size:0.875rem;height:100%}.navlist{margin:0;padding:0}.toggle-wrapper{display:none}@media screen and (max-width: 1023px){.tray{-ms-transition:transform 0.33s ease;-webkit-transition:transform 0.33s ease;-moz-transition:transform 0.33s ease;-webkit-transition:-webkit-transform 0.33s ease;transition:-webkit-transform 0.33s ease;transition:transform 0.33s ease;transition:transform 0.33s ease, -webkit-transform 0.33s ease;position:fixed;top:0;bottom:0;left:0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}.tray ul{visibility:hidden}.tray .toggle-wrapper{display:inline-block;min-height:5rem;width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([aria-expanded=true]) .tray{-webkit-transform:translateX(0);transform:translateX(0)}:host([aria-expanded=true]) .tray ul{visibility:visible}.overlay{width:100vw;height:100vh;max-width:none;max-height:none;position:fixed !important;top:0;bottom:0;left:0;right:0;-webkit-transform:translate(0%, 0%);transform:translate(0%, 0%);background-color:rgba(25, 25, 25, 0.4);-ms-transition:opacity 0.5s ease-out;-webkit-transition:opacity 0.5s ease-out;-moz-transition:opacity 0.5s ease-out;transition:opacity 0.5s ease-out}}";var Navigation=function(){function t(t){var e=this;registerInstance(this,t);this.wmNavigationStateChanged=createEvent(this,"wmNavigationStateChanged",7);this.open=false;this.isTabbing=false;this.mainNavigationMessage=intl.formatMessage({id:"navigation.mainNavigation",defaultMessage:"Main",description:"Label describing the site navigation, for screen reader users"});this.openTooltipMessage=intl.formatMessage({id:"global.openVerb",defaultMessage:"Open",description:"For a button, to open a user interface element"});this.closeTooltipMessage=intl.formatMessage({id:"global.closeVerb",defaultMessage:"Close",description:"For a button, to close a user interface element"});this.throttledRerender=throttle((function(){return forceUpdate(e.el)}),50)}Object.defineProperty(t.prototype,"isCollapsible",{get:function(){return window.innerWidth<1024},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"ariaExpanded",{get:function(){return this.isCollapsible?this.open.toString():undefined},enumerable:false,configurable:true});t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.closeOnEscape=function(t){if(t.key==="Escape"){this.open=false}};t.prototype.handleWindowResize=function(){this.throttledRerender()};t.prototype.handleHamburgerClicked=function(){this.open=!this.open};t.prototype.handleClickOnItem=function(){this.open=false};t.prototype.handleStateChange=function(){if(this.isCollapsible){this.wmNavigationStateChanged.emit();this.open?this.expand():this.collapse()}};t.prototype.componentWillLoad=function(){var t=this;if(document.body.classList.contains("wmcl-user-is-tabbing")){this.toggleTabbingOn()}this.el.focus=function(){var e=t.open?t.el.shadowRoot.querySelector(".toggle"):document.querySelector("wm-navigation-hamburger");var i=t.el.querySelector("wm-navigation-item");t.isCollapsible?e.focus():i.focus()};if(this.isCollapsible&&this.open){this.wmNavigationStateChanged.emit();this.expand()}};t.prototype.redirectFocusFromBody=function(t){if(document.activeElement.tagName==="BODY"&&!t.relatedTarget){this.el.focus()}};t.prototype.expand=function(){var t=this;document.body.tabIndex=0;document.body.addEventListener("focus",this.redirectFocusFromBody.bind(this),true);setTimeout((function(){return t.toggleEl.focus()}),250)};t.prototype.collapse=function(){document.body.tabIndex=-1;document.body.removeEventListener("focus",this.redirectFocusFromBody.bind(this));var t=document.querySelector("wm-navigation-hamburger");if(t)t.focus()};t.prototype.focusLastItem=function(){var t=this.el.querySelectorAll("wm-navigation-item");var e=Array.from(t).pop();e.focus()};t.prototype.renderOverlay=function(){var t=this;return h("div",{class:"overlay",onClick:function(){t.open=false}})};t.prototype.render=function(){var t=this;return h(Host,{role:"navigation","aria-expanded":this.ariaExpanded,"aria-label":this.mainNavigationMessage},this.open?this.renderOverlay():"",this.isCollapsible&&h("div",{class:"trapfocus",tabindex:this.open?0:undefined,onFocus:function(){return t.focusLastItem()}}),h("div",{class:"tray"},h("div",{class:"toggle-wrapper"},h("wm-button",{ref:function(e){return t.toggleEl=e},class:"toggle ".concat(this.isTabbing?"user-is-tabbing":""),"button-type":"navigational",icon:this.open?"f156":"f35c","icon-size":"2rem",tooltip:this.open?this.closeTooltipMessage:this.openTooltipMessage,"tooltip-position":"left",tabIndex:this.open?undefined:-1,onClick:function(){t.open=!t.open}})),h("ul",{class:"navlist"},h("slot",null))),this.isCollapsible&&h("div",{class:"trapfocus",tabindex:this.open?0:undefined,onFocus:function(){return t.toggleEl.focus()}}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{open:["handleStateChange"]}},enumerable:false,configurable:true});return t}();Navigation.style=wmNavigationCss;var wmNavigationHamburgerCss='button{display:none;width:100%;height:100%;border:none;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1);background-color:transparent;outline:none;padding:0}button.user-is-tabbing:focus{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e;-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e;box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e}button.user-is-tabbing:focus::-moz-focus-inner{border:0}button:hover{background-color:#d7d6d9}.icon:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f35c";font-size:1.5rem;color:#575195}@media screen and (max-width: 1023px){:host{width:3.75rem;height:3.75rem}button{display:initial}}';var NavigationHamburger=function(){function t(t){registerInstance(this,t);this.wmNavigationHamburgerClicked=createEvent(this,"wmNavigationHamburgerClicked",7);this.tooltipVisible=false;this.isTabbing=false;this.open=false;this.showNavMessage=intl.formatMessage({id:"navigation.showNavigation",defaultMessage:"Show navigation",description:"For user interface element opening a navigation menu"})}Object.defineProperty(t.prototype,"tooltipEl",{get:function(){return document.getElementById("wm-tooltip")},enumerable:false,configurable:true});t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.handleNavigationStateChanged=function(t){this.open=t.target.open};t.prototype.componentWillLoad=function(){this.el.focus=function(){var t=this;this.shadowRoot.querySelector("button").focus();requestAnimationFrame((function(){t.tooltipVisible=false}))};if(document.body.classList.contains("wmcl-user-is-tabbing")){this.toggleTabbingOn()}if(!this.navId){console.error("wm-navigation-hamburger: nav-id is a required prop")}};t.prototype.showTooltip=function(){var t=this;this.tooltipEl.textContent=this.showNavMessage;this.tooltipEl.style.top="1.125rem";this.tooltipEl.style.left="2.75rem";this.tooltipEl.style.transitionDelay="500ms";this.tooltipEl.style.opacity="1";setTimeout((function(){t.tooltipVisible=true}),500)};t.prototype.hideTooltip=function(){this.tooltipEl.style.transitionDelay="0s";this.tooltipEl.style.opacity="0";this.tooltipVisible=false};t.prototype.showTooltipForKeyboardUsers=function(){if(this.isTabbing){this.showTooltip()}};t.prototype.handleClick=function(){this.hideTooltip();this.wmNavigationHamburgerClicked.emit()};t.prototype.render=function(){var t=this;return h(Host,{class:"hamburger ".concat(this.open?"nav-open":"nav-closed")},h("button",{class:this.isTabbing?"user-is-tabbing":undefined,"aria-expanded":this.open,"aria-controls":this.navId,"aria-label":this.showNavMessage,onMouseEnter:function(){return t.showTooltip()},onMouseLeave:function(){return t.hideTooltip()},onFocus:function(){return t.showTooltipForKeyboardUsers()},onBlur:function(){return t.hideTooltip()},onClick:function(){return t.handleClick()}},h("span",{class:"icon"})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();NavigationHamburger.style=wmNavigationHamburgerCss;var wmNavigationItemCss='.link{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;color:inherit;text-decoration:none;min-height:4.5rem;text-align:center;padding:1.25rem 0.5rem;font-weight:500;outline:none;position:relative}.link:hover{background-color:#f2f2f2}.link .icon{font-size:1.375rem;color:#6b6b6b}.link .text{font-size:0.875rem}.link.user-is-tabbing:focus{-webkit-box-shadow:inset 0 2px 2px 0 rgba(244, 243, 246, 0.2), inset 0 2px 2px 0 rgba(0, 0, 0, 0.1), inset 0 0 4px 3px #61279e;box-shadow:inset 0 2px 2px 0 rgba(244, 243, 246, 0.2), inset 0 2px 2px 0 rgba(0, 0, 0, 0.1), inset 0 0 4px 3px #61279e}.link.active{background-color:#e9e7ec}.link.active:before{content:"";background-color:#575195;position:absolute;height:100%;width:5px;left:0}.link.active .text{color:#575195}.link.active .icon{color:#575195}';var NavigationItem=function(){function t(t){registerInstance(this,t);this.wmNavigationItemClicked=createEvent(this,"wmNavigationItemClicked",7);this.isTabbing=false}t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.componentWillLoad=function(){this.el.focus=function(){this.shadowRoot.querySelector(".link").focus()};if(document.body.classList.contains("wmcl-user-is-tabbing")){this.toggleTabbingOn()}};t.prototype.render=function(){var t=this;return h(Host,{role:"listitem"},h("a",{class:"link ".concat(this.active?"active":""," ").concat(this.isTabbing?"user-is-tabbing":""),href:this.href,onClick:function(){return t.wmNavigationItemClicked.emit()}},h("div",{class:"icon","aria-hidden":"true"},h("slot",null)),h("div",{class:"text"},this.text)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();NavigationItem.style=wmNavigationItemCss;export{Navigation as wm_navigation,NavigationHamburger as wm_navigation_hamburger,NavigationItem as wm_navigation_item};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,r,o){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function a(t){try{u(o.next(t))}catch(t){i(t)}}function s(t){try{u(o["throw"](t))}catch(t){i(t)}}function u(t){t.done?r(t.value):n(t.value).then(a,s)}u((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,n,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return u([t,e])}}function u(a){if(o)throw new TypeError("Generator is already executing.");while(r)try{if(o=1,n&&(i=a[0]&2?n["return"]:a[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;if(n=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;n=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(a[0]===6&&r.label<i[1]){r.label=i[1];i=a;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(a);break}if(i[2])r.ops.pop();r.trys.pop();continue}a=e.call(t,r)}catch(t){a=[6,t];n=0}finally{o=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-7603f98e.js";import{a as getWmMode}from"./interfaces-2b97fab2.js";import{s as snakeCaseToCamelCase,k as getNewIndexToFocus,i as intl}from"./functions-61c7bb1f.js";import{g as getRequest}from"./http-service-3dc3b3e7.js";var wmNavigatorCss=":host,wm-navigator{height:100%;min-width:0;position:relative;display:inline-block}:host .wrapper,wm-navigator .wrapper{overflow:auto;font-size:1.125rem;min-width:13.125rem;width:auto;max-height:80vh;text-align:left;position:absolute;z-index:50;top:100%;right:20px;left:auto;background:#fff;letter-spacing:normal;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .wrapper .user,wm-navigator .wrapper .user{background:#f4f4f4;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper .user p,wm-navigator .wrapper .user p{margin:0}:host .wrapper .user p:first-child,wm-navigator .wrapper .user p:first-child{font-weight:700;text-transform:capitalize}:host .wrapper h2,wm-navigator .wrapper h2{background:#2e1b46;color:#fff;font-weight:700;margin:0;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper [role=listbox],wm-navigator .wrapper [role=listbox]{list-style:none;margin:0;padding-left:0}:host .wrapper.hide,wm-navigator .wrapper.hide{-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0)}:host .wrapper.right,wm-navigator .wrapper.right{right:auto;left:20px}:host img,wm-navigator img{-webkit-transform:scale(0.8);transform:scale(0.8);-webkit-transform-origin:left center;transform-origin:left center;display:block}:host .logout,wm-navigator .logout{text-align:center;text-transform:capitalize}priv-navigator-item:focus{outline:none}";var Navigator=function(){function t(t){registerInstance(this,t);this.wmNavigatorLogout=createEvent(this,"wmNavigatorLogout",7);this.authType=1;this.loadFromUserinfo=false;this.retrievedInfo=!this.loadFromUserinfo;this.parsedProducts=[];this.isOpen=false;this.openRight=false;this.isTabbing=false;this.itemIndexToFocus=0}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.userName){console.error("wm-navigator: user-name is a required property.")}return[4,this.parseData()];case 1:t.sent();this.setFocusIndex();return[2]}}))}))};t.prototype.parseData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){switch(e.label){case 0:if(!!!this.loadFromUserinfo)return[3,2];return[4,getRequest("/platform/navigator/userinfo").then((function(e){t.email=e.email;t.currentProductId=e.current_product_id;t.parsedProducts=t.productKeysToCamelCase(e.products);t.logoutUrl=t.logoutUrl?t.logoutUrl:e.logout_url;t.connectionName=t.connectionName?t.connectionName:e.connection_name;if(!!t.email&&!!t.currentProductId){t.retrievedInfo=true}})).catch((function(t){console.error(t)}))];case 1:e.sent();return[3,3];case 2:this.currentProductId=getWmMode(this.el);if(!!this.products){if(typeof this.products==="string"){this.parsedProducts=JSON.parse(this.products)}else{this.parsedProducts=this.products}this.parsedProducts=this.productKeysToCamelCase(this.parsedProducts)}e.label=3;case 3:this.parsedProducts.sort((function(t,e){return t.name<e.name?-1:1}));return[2]}}))}))};t.prototype.productKeysToCamelCase=function(t){t=t.map((function(t){var e=Object.keys(t);var r={};e.forEach((function(e){r[snakeCaseToCamelCase(e)]=t[e]}));return r}));return t};t.prototype.setFocusIndex=function(){if(this.parsedProducts.length>1){var t=this.getProduct(this.currentProductId);if(t){this.itemIndexToFocus=this.parsedProducts.indexOf(t)}}};t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.handleKeys=function(t){switch(t.key){case"Escape":t.preventDefault();this.closeMenu();break;case"ArrowDown":case"ArrowUp":t.preventDefault();if(!this.isOpen){this.itemIndexToFocus=getNewIndexToFocus(this.itemIndexToFocus,t.key,this.navigatorItems.length);this.openMenu()}break}};t.prototype.handleKeydown=function(t){var e=t.detail.key;var r=t.detail.navItem;switch(e){case"Tab":this.closeMenu();break;case"Enter":case" ":r.click();break;case"ArrowDown":case"ArrowUp":var o=this.itemIndexToFocus;this.itemIndexToFocus=getNewIndexToFocus(this.itemIndexToFocus,e,this.navigatorItems.length);this.focusItem();this.unfocusItem(o);break}};t.prototype.handleClick=function(t){var e=t.target===this.el||this.el.contains(t.target);if(!e&&this.isOpen){this.closeMenu()}};t.prototype.handleButtonClick=function(){this.isOpen?this.closeMenu():this.openMenu()};t.prototype.openMenu=function(){if(this.wrapperEl){var t=this.wrapperEl.clientWidth;var e=this.el.getBoundingClientRect().left;var r=document.documentElement.clientWidth-this.el.getBoundingClientRect().right;this.openRight=t>e&&r>e}this.isOpen=true;this.focusItem()};t.prototype.closeMenu=function(){this.isOpen=false;this.buttonFocusHandler();this.unfocusItem(this.itemIndexToFocus);this.setFocusIndex()};t.prototype.focusItem=function(){var t=this.navigatorItems[this.itemIndexToFocus];t.tabIndex=0;t.focused=true;window.requestAnimationFrame((function(){return t.focus()}))};t.prototype.unfocusItem=function(t){var e=this.navigatorItems[t];e.tabIndex=-1;e.focused=false};t.prototype.buttonFocusHandler=function(){var t=this.el.shadowRoot.querySelector("priv-navigator-button");var e=t.shadowRoot.querySelector("button");window.requestAnimationFrame((function(){return e.focus()}))};t.prototype.renderUserInfo=function(){return h("div",{class:"user",id:"wm-nav-user","aria-label":intl.formatMessage({id:"navigator.userinfoLabel",defaultMessage:"for {name}, email {email}"},{name:this.userName,email:this.email})},h("p",null,this.userName),h("p",null,this.email))};t.prototype.setAltText=function(){if(this.parsedProducts.length>1){return intl.formatMessage({id:"navigator.userinfoAndProductNavigator",defaultMessage:"User information and product navigator"})}else{return intl.formatMessage({id:"navigator.userinfo",defaultMessage:"User information"})}};t.prototype.renderHeading=function(){return h("h2",null,intl.formatMessage({id:"navigator.watermarkApps",defaultMessage:"Watermark Apps",description:"Applications made by Watermark Insights"}))};t.prototype.renderList=function(){return h("ul",{role:"listbox","aria-label":"".concat(intl.formatMessage({id:"navigator.WatermarkAppNavigation",defaultMessage:"Watermark App Navigation",description:"list of applications by Watermark Insights"})),"aria-describedby":"wm-nav-user"},this.parsedProducts.length>1&&this.renderProductOptions(),this.renderLogoutOption())};t.prototype.renderProductOptions=function(){var t=this;return this.parsedProducts.map((function(e){var r,o,n,i;r=e.name;o=e.iconUrl;i=t.setProductOnClick(e.id);if(!!r&&!!o){n=t.currentProductId===e.id;return h("priv-navigator-item",{selected:n,id:e.id,onClick:i,role:"option","aria-label":r},h("img",{src:o,alt:r}))}}))};t.prototype.setProductOnClick=function(t){var e=this.getProduct(t);if(this.currentProductId===t){return function(){}}else if(e){if(!!this.loadFromUserinfo||this.authType===2){return function(){return window.location.href=e.linkUrl}}else if(this.authType===3){var r=this.connectionName?"/?connection_name=".concat(this.connectionName):"";return function(){return window.location.href=e.samlLinkUrl+r}}}};t.prototype.renderLogoutOption=function(){return h("priv-navigator-item",{class:"logout",selected:!(this.parsedProducts.length>1),id:"nav-logout",onClick:this.setLogoutOnclick(),role:"option"},h("span",{class:"logout"},intl.formatMessage({id:"navigator.logout",defaultMessage:"Log Out"})))};t.prototype.setLogoutOnclick=function(){var t=this;return function(){t.wmNavigatorLogout.emit();if(t.logoutUrl){window.location.href=t.logoutUrl}}};Object.defineProperty(t.prototype,"navigatorItems",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll("priv-navigator-item"))},enumerable:false,configurable:true});t.prototype.getProduct=function(t){return this.parsedProducts.find((function(e){return e.id===t}))};t.prototype.render=function(){var t=this;return this.retrievedInfo?h(Host,{class:this.isTabbing?"user-is-tabbing":""},h("priv-navigator-button",{expanded:this.isOpen,altText:this.setAltText(),isTabbing:this.isTabbing}),h("div",{class:"wrapper ".concat(this.isOpen?"":"hide"," ").concat(this.openRight?"right":""),ref:function(e){return t.wrapperEl=e}},this.renderUserInfo(),this.parsedProducts.length>1&&this.renderHeading(),this.renderList())):""};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{products:["parseData"]}},enumerable:false,configurable:true});return t}();Navigator.style=wmNavigatorCss;export{Navigator as wm_navigator};
1
+ var __awaiter=this&&this.__awaiter||function(t,e,r,o){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function a(t){try{u(o.next(t))}catch(t){i(t)}}function s(t){try{u(o["throw"](t))}catch(t){i(t)}}function u(t){t.done?r(t.value):n(t.value).then(a,s)}u((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,n,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return u([t,e])}}function u(a){if(o)throw new TypeError("Generator is already executing.");while(r)try{if(o=1,n&&(i=a[0]&2?n["return"]:a[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;if(n=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;n=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(a[0]===6&&r.label<i[1]){r.label=i[1];i=a;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(a);break}if(i[2])r.ops.pop();r.trys.pop();continue}a=e.call(t,r)}catch(t){a=[6,t];n=0}finally{o=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-17c79cc6.js";import{a as getWmMode}from"./interfaces-61c6305b.js";import{s as snakeCaseToCamelCase,k as getNewIndexToFocus,i as intl}from"./functions-78aea827.js";import{g as getRequest}from"./http-service-5d037e16.js";var wmNavigatorCss=":host,wm-navigator{height:100%;min-width:0;position:relative;display:inline-block}:host .wrapper,wm-navigator .wrapper{overflow:auto;font-size:1.125rem;min-width:13.125rem;width:auto;max-height:80vh;text-align:left;position:absolute;z-index:50;top:100%;right:20px;left:auto;background:#fff;letter-spacing:normal;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .wrapper .user,wm-navigator .wrapper .user{background:#f4f4f4;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper .user p,wm-navigator .wrapper .user p{margin:0}:host .wrapper .user p:first-child,wm-navigator .wrapper .user p:first-child{font-weight:700;text-transform:capitalize}:host .wrapper h2,wm-navigator .wrapper h2{background:#2e1b46;color:#fff;font-weight:700;margin:0;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper [role=listbox],wm-navigator .wrapper [role=listbox]{list-style:none;margin:0;padding-left:0}:host .wrapper.hide,wm-navigator .wrapper.hide{-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0)}:host .wrapper.right,wm-navigator .wrapper.right{right:auto;left:20px}:host img,wm-navigator img{-webkit-transform:scale(0.8);transform:scale(0.8);-webkit-transform-origin:left center;transform-origin:left center;display:block}:host .logout,wm-navigator .logout{text-align:center;text-transform:capitalize}priv-navigator-item:focus{outline:none}";var Navigator=function(){function t(t){registerInstance(this,t);this.wmNavigatorLogout=createEvent(this,"wmNavigatorLogout",7);this.authType=1;this.loadFromUserinfo=false;this.retrievedInfo=!this.loadFromUserinfo;this.parsedProducts=[];this.isOpen=false;this.openRight=false;this.isTabbing=false;this.itemIndexToFocus=0}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.userName){console.error("wm-navigator: user-name is a required property.")}return[4,this.parseData()];case 1:t.sent();this.setFocusIndex();return[2]}}))}))};t.prototype.parseData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){switch(e.label){case 0:if(!!!this.loadFromUserinfo)return[3,2];return[4,getRequest("/platform/navigator/userinfo").then((function(e){t.email=e.email;t.currentProductId=e.current_product_id;t.parsedProducts=t.productKeysToCamelCase(e.products);t.logoutUrl=t.logoutUrl?t.logoutUrl:e.logout_url;t.connectionName=t.connectionName?t.connectionName:e.connection_name;if(!!t.email&&!!t.currentProductId){t.retrievedInfo=true}})).catch((function(t){console.error(t)}))];case 1:e.sent();return[3,3];case 2:this.currentProductId=getWmMode(this.el);if(!!this.products){if(typeof this.products==="string"){this.parsedProducts=JSON.parse(this.products)}else{this.parsedProducts=this.products}this.parsedProducts=this.productKeysToCamelCase(this.parsedProducts)}e.label=3;case 3:this.parsedProducts.sort((function(t,e){return t.name<e.name?-1:1}));return[2]}}))}))};t.prototype.productKeysToCamelCase=function(t){t=t.map((function(t){var e=Object.keys(t);var r={};e.forEach((function(e){r[snakeCaseToCamelCase(e)]=t[e]}));return r}));return t};t.prototype.setFocusIndex=function(){if(this.parsedProducts.length>1){var t=this.getProduct(this.currentProductId);if(t){this.itemIndexToFocus=this.parsedProducts.indexOf(t)}}};t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.handleKeys=function(t){switch(t.key){case"Escape":t.preventDefault();this.closeMenu();break;case"ArrowDown":case"ArrowUp":t.preventDefault();if(!this.isOpen){this.itemIndexToFocus=getNewIndexToFocus(this.itemIndexToFocus,t.key,this.navigatorItems.length);this.openMenu()}break}};t.prototype.handleKeydown=function(t){var e=t.detail.key;var r=t.detail.navItem;switch(e){case"Tab":this.closeMenu();break;case"Enter":case" ":r.click();break;case"ArrowDown":case"ArrowUp":var o=this.itemIndexToFocus;this.itemIndexToFocus=getNewIndexToFocus(this.itemIndexToFocus,e,this.navigatorItems.length);this.focusItem();this.unfocusItem(o);break}};t.prototype.handleClick=function(t){var e=t.target===this.el||this.el.contains(t.target);if(!e&&this.isOpen){this.closeMenu()}};t.prototype.handleButtonClick=function(){this.isOpen?this.closeMenu():this.openMenu()};t.prototype.openMenu=function(){if(this.wrapperEl){var t=this.wrapperEl.clientWidth;var e=this.el.getBoundingClientRect().left;var r=document.documentElement.clientWidth-this.el.getBoundingClientRect().right;this.openRight=t>e&&r>e}this.isOpen=true;this.focusItem()};t.prototype.closeMenu=function(){this.isOpen=false;this.buttonFocusHandler();this.unfocusItem(this.itemIndexToFocus);this.setFocusIndex()};t.prototype.focusItem=function(){var t=this.navigatorItems[this.itemIndexToFocus];t.tabIndex=0;t.focused=true;window.requestAnimationFrame((function(){return t.focus()}))};t.prototype.unfocusItem=function(t){var e=this.navigatorItems[t];e.tabIndex=-1;e.focused=false};t.prototype.buttonFocusHandler=function(){var t=this.el.shadowRoot.querySelector("priv-navigator-button");var e=t.shadowRoot.querySelector("button");window.requestAnimationFrame((function(){return e.focus()}))};t.prototype.renderUserInfo=function(){return h("div",{class:"user",id:"wm-nav-user","aria-label":intl.formatMessage({id:"navigator.userinfoLabel",defaultMessage:"for {name}, email {email}"},{name:this.userName,email:this.email})},h("p",null,this.userName),h("p",null,this.email))};t.prototype.setAltText=function(){if(this.parsedProducts.length>1){return intl.formatMessage({id:"navigator.userinfoAndProductNavigator",defaultMessage:"User information and product navigator"})}else{return intl.formatMessage({id:"navigator.userinfo",defaultMessage:"User information"})}};t.prototype.renderHeading=function(){return h("h2",null,intl.formatMessage({id:"navigator.watermarkApps",defaultMessage:"Watermark Apps",description:"Applications made by Watermark Insights"}))};t.prototype.renderList=function(){return h("ul",{role:"listbox","aria-label":"".concat(intl.formatMessage({id:"navigator.WatermarkAppNavigation",defaultMessage:"Watermark App Navigation",description:"list of applications by Watermark Insights"})),"aria-describedby":"wm-nav-user"},this.parsedProducts.length>1&&this.renderProductOptions(),this.renderLogoutOption())};t.prototype.renderProductOptions=function(){var t=this;return this.parsedProducts.map((function(e){var r,o,n,i;r=e.name;o=e.iconUrl;i=t.setProductOnClick(e.id);if(!!r&&!!o){n=t.currentProductId===e.id;return h("priv-navigator-item",{selected:n,id:e.id,onClick:i,role:"option","aria-label":r},h("img",{src:o,alt:r}))}}))};t.prototype.setProductOnClick=function(t){var e=this.getProduct(t);if(this.currentProductId===t){return function(){}}else if(e){if(!!this.loadFromUserinfo||this.authType===2){return function(){return window.location.href=e.linkUrl}}else if(this.authType===3){var r=this.connectionName?"/?connection_name=".concat(this.connectionName):"";return function(){return window.location.href=e.samlLinkUrl+r}}}};t.prototype.renderLogoutOption=function(){return h("priv-navigator-item",{class:"logout",selected:!(this.parsedProducts.length>1),id:"nav-logout",onClick:this.setLogoutOnclick(),role:"option"},h("span",{class:"logout"},intl.formatMessage({id:"navigator.logout",defaultMessage:"Log Out"})))};t.prototype.setLogoutOnclick=function(){var t=this;return function(){t.wmNavigatorLogout.emit();if(t.logoutUrl){window.location.href=t.logoutUrl}}};Object.defineProperty(t.prototype,"navigatorItems",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll("priv-navigator-item"))},enumerable:false,configurable:true});t.prototype.getProduct=function(t){return this.parsedProducts.find((function(e){return e.id===t}))};t.prototype.render=function(){var t=this;return this.retrievedInfo?h(Host,{class:this.isTabbing?"user-is-tabbing":""},h("priv-navigator-button",{expanded:this.isOpen,altText:this.setAltText(),isTabbing:this.isTabbing}),h("div",{class:"wrapper ".concat(this.isOpen?"":"hide"," ").concat(this.openRight?"right":""),ref:function(e){return t.wrapperEl=e}},this.renderUserInfo(),this.parsedProducts.length>1&&this.renderHeading(),this.renderList())):""};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{products:["parseData"]}},enumerable:false,configurable:true});return t}();Navigator.style=wmNavigatorCss;export{Navigator as wm_navigator};