@haiilo/catalyst 10.2.0 → 10.4.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 (282) hide show
  1. package/dist/catalyst/assets/fonts/Lato-Black.ttf +0 -0
  2. package/dist/catalyst/assets/fonts/Lato-Black.woff +0 -0
  3. package/dist/catalyst/assets/fonts/Lato-Black.woff2 +0 -0
  4. package/dist/catalyst/assets/fonts/Lato-BlackItalic.ttf +0 -0
  5. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff +0 -0
  6. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  7. package/dist/catalyst/assets/fonts/Lato-Bold.ttf +0 -0
  8. package/dist/catalyst/assets/fonts/Lato-Bold.woff +0 -0
  9. package/dist/catalyst/assets/fonts/Lato-Bold.woff2 +0 -0
  10. package/dist/catalyst/assets/fonts/Lato-BoldItalic.ttf +0 -0
  11. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff +0 -0
  12. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  13. package/dist/catalyst/assets/fonts/Lato-Hairline.ttf +0 -0
  14. package/dist/catalyst/assets/fonts/Lato-Hairline.woff +0 -0
  15. package/dist/catalyst/assets/fonts/Lato-Hairline.woff2 +0 -0
  16. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.ttf +0 -0
  17. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff +0 -0
  18. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  19. package/dist/catalyst/assets/fonts/Lato-Heavy.ttf +0 -0
  20. package/dist/catalyst/assets/fonts/Lato-Heavy.woff +0 -0
  21. package/dist/catalyst/assets/fonts/Lato-Heavy.woff2 +0 -0
  22. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.ttf +0 -0
  23. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff +0 -0
  24. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  25. package/dist/catalyst/assets/fonts/Lato-Italic.ttf +0 -0
  26. package/dist/catalyst/assets/fonts/Lato-Italic.woff +0 -0
  27. package/dist/catalyst/assets/fonts/Lato-Italic.woff2 +0 -0
  28. package/dist/catalyst/assets/fonts/Lato-Light.ttf +0 -0
  29. package/dist/catalyst/assets/fonts/Lato-Light.woff +0 -0
  30. package/dist/catalyst/assets/fonts/Lato-Light.woff2 +0 -0
  31. package/dist/catalyst/assets/fonts/Lato-LightItalic.ttf +0 -0
  32. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff +0 -0
  33. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff2 +0 -0
  34. package/dist/catalyst/assets/fonts/Lato-Medium.ttf +0 -0
  35. package/dist/catalyst/assets/fonts/Lato-Medium.woff +0 -0
  36. package/dist/catalyst/assets/fonts/Lato-Medium.woff2 +0 -0
  37. package/dist/catalyst/assets/fonts/Lato-MediumItalic.ttf +0 -0
  38. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff +0 -0
  39. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  40. package/dist/catalyst/assets/fonts/Lato-Regular.ttf +0 -0
  41. package/dist/catalyst/assets/fonts/Lato-Regular.woff +0 -0
  42. package/dist/catalyst/assets/fonts/Lato-Regular.woff2 +0 -0
  43. package/dist/catalyst/assets/fonts/Lato-Semibold.ttf +0 -0
  44. package/dist/catalyst/assets/fonts/Lato-Semibold.woff +0 -0
  45. package/dist/catalyst/assets/fonts/Lato-Semibold.woff2 +0 -0
  46. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.ttf +0 -0
  47. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  48. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  49. package/dist/catalyst/assets/fonts/Lato-Thin.ttf +0 -0
  50. package/dist/catalyst/assets/fonts/Lato-Thin.woff +0 -0
  51. package/dist/catalyst/assets/fonts/Lato-Thin.woff2 +0 -0
  52. package/dist/catalyst/assets/fonts/Lato-ThinItalic.ttf +0 -0
  53. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff +0 -0
  54. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  55. package/dist/catalyst/catalyst.css +10 -1
  56. package/dist/catalyst/catalyst.esm.js +1 -1
  57. package/dist/catalyst/catalyst.esm.js.map +1 -1
  58. package/dist/catalyst/index.esm.js +1 -1
  59. package/dist/catalyst/p-81800b65.js +2 -0
  60. package/dist/catalyst/p-81800b65.js.map +1 -0
  61. package/dist/catalyst/p-8a1d505d.entry.js +10 -0
  62. package/dist/catalyst/p-8a1d505d.entry.js.map +1 -0
  63. package/dist/catalyst/scss/core/_form.scss +12 -3
  64. package/dist/cjs/{cat-alert_26.cjs.entry.js → cat-alert_28.cjs.entry.js} +2293 -128
  65. package/dist/cjs/cat-alert_28.cjs.entry.js.map +1 -0
  66. package/dist/cjs/catalyst.cjs.js +1 -1
  67. package/dist/cjs/index.cjs.js +1 -1
  68. package/dist/cjs/loader.cjs.js +1 -1
  69. package/dist/cjs/{of-a6e7c491.js → of-45281229.js} +34 -19
  70. package/dist/cjs/of-45281229.js.map +1 -0
  71. package/dist/collection/assets/fonts/Lato-Black.ttf +0 -0
  72. package/dist/collection/assets/fonts/Lato-Black.woff +0 -0
  73. package/dist/collection/assets/fonts/Lato-Black.woff2 +0 -0
  74. package/dist/collection/assets/fonts/Lato-BlackItalic.ttf +0 -0
  75. package/dist/collection/assets/fonts/Lato-BlackItalic.woff +0 -0
  76. package/dist/collection/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  77. package/dist/collection/assets/fonts/Lato-Bold.ttf +0 -0
  78. package/dist/collection/assets/fonts/Lato-Bold.woff +0 -0
  79. package/dist/collection/assets/fonts/Lato-Bold.woff2 +0 -0
  80. package/dist/collection/assets/fonts/Lato-BoldItalic.ttf +0 -0
  81. package/dist/collection/assets/fonts/Lato-BoldItalic.woff +0 -0
  82. package/dist/collection/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  83. package/dist/collection/assets/fonts/Lato-Hairline.ttf +0 -0
  84. package/dist/collection/assets/fonts/Lato-Hairline.woff +0 -0
  85. package/dist/collection/assets/fonts/Lato-Hairline.woff2 +0 -0
  86. package/dist/collection/assets/fonts/Lato-HairlineItalic.ttf +0 -0
  87. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff +0 -0
  88. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  89. package/dist/collection/assets/fonts/Lato-Heavy.ttf +0 -0
  90. package/dist/collection/assets/fonts/Lato-Heavy.woff +0 -0
  91. package/dist/collection/assets/fonts/Lato-Heavy.woff2 +0 -0
  92. package/dist/collection/assets/fonts/Lato-HeavyItalic.ttf +0 -0
  93. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff +0 -0
  94. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  95. package/dist/collection/assets/fonts/Lato-Italic.ttf +0 -0
  96. package/dist/collection/assets/fonts/Lato-Italic.woff +0 -0
  97. package/dist/collection/assets/fonts/Lato-Italic.woff2 +0 -0
  98. package/dist/collection/assets/fonts/Lato-Light.ttf +0 -0
  99. package/dist/collection/assets/fonts/Lato-Light.woff +0 -0
  100. package/dist/collection/assets/fonts/Lato-Light.woff2 +0 -0
  101. package/dist/collection/assets/fonts/Lato-LightItalic.ttf +0 -0
  102. package/dist/collection/assets/fonts/Lato-LightItalic.woff +0 -0
  103. package/dist/collection/assets/fonts/Lato-LightItalic.woff2 +0 -0
  104. package/dist/collection/assets/fonts/Lato-Medium.ttf +0 -0
  105. package/dist/collection/assets/fonts/Lato-Medium.woff +0 -0
  106. package/dist/collection/assets/fonts/Lato-Medium.woff2 +0 -0
  107. package/dist/collection/assets/fonts/Lato-MediumItalic.ttf +0 -0
  108. package/dist/collection/assets/fonts/Lato-MediumItalic.woff +0 -0
  109. package/dist/collection/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  110. package/dist/collection/assets/fonts/Lato-Regular.ttf +0 -0
  111. package/dist/collection/assets/fonts/Lato-Regular.woff +0 -0
  112. package/dist/collection/assets/fonts/Lato-Regular.woff2 +0 -0
  113. package/dist/collection/assets/fonts/Lato-Semibold.ttf +0 -0
  114. package/dist/collection/assets/fonts/Lato-Semibold.woff +0 -0
  115. package/dist/collection/assets/fonts/Lato-Semibold.woff2 +0 -0
  116. package/dist/collection/assets/fonts/Lato-SemiboldItalic.ttf +0 -0
  117. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  118. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  119. package/dist/collection/assets/fonts/Lato-Thin.ttf +0 -0
  120. package/dist/collection/assets/fonts/Lato-Thin.woff +0 -0
  121. package/dist/collection/assets/fonts/Lato-Thin.woff2 +0 -0
  122. package/dist/collection/assets/fonts/Lato-ThinItalic.ttf +0 -0
  123. package/dist/collection/assets/fonts/Lato-ThinItalic.woff +0 -0
  124. package/dist/collection/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  125. package/dist/collection/collection-manifest.json +3 -1
  126. package/dist/collection/components/cat-alert/cat-alert.spec.js +2 -9
  127. package/dist/collection/components/cat-alert/cat-alert.spec.js.map +1 -1
  128. package/dist/collection/components/cat-avatar/cat-avatar.spec.js +3 -7
  129. package/dist/collection/components/cat-avatar/cat-avatar.spec.js.map +1 -1
  130. package/dist/collection/components/cat-badge/cat-badge.spec.js +2 -6
  131. package/dist/collection/components/cat-badge/cat-badge.spec.js.map +1 -1
  132. package/dist/collection/components/cat-button/cat-button.css +29 -0
  133. package/dist/collection/components/cat-button/cat-button.spec.js +1 -1
  134. package/dist/collection/components/cat-button/cat-button.spec.js.map +1 -1
  135. package/dist/collection/components/cat-button-group/cat-button-group.spec.js +2 -6
  136. package/dist/collection/components/cat-button-group/cat-button-group.spec.js.map +1 -1
  137. package/dist/collection/components/cat-card/cat-card.spec.js +2 -6
  138. package/dist/collection/components/cat-card/cat-card.spec.js.map +1 -1
  139. package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js +2 -17
  140. package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js.map +1 -1
  141. package/dist/collection/components/cat-date/cat-date-locale.js +54 -0
  142. package/dist/collection/components/cat-date/cat-date-locale.js.map +1 -0
  143. package/dist/collection/components/cat-date/cat-date-math.js +28 -0
  144. package/dist/collection/components/cat-date/cat-date-math.js.map +1 -0
  145. package/dist/collection/components/cat-date/cat-date.css +122 -0
  146. package/dist/collection/components/cat-date/cat-date.e2e.js +11 -0
  147. package/dist/collection/components/cat-date/cat-date.e2e.js.map +1 -0
  148. package/dist/collection/components/cat-date/cat-date.js +923 -0
  149. package/dist/collection/components/cat-date/cat-date.js.map +1 -0
  150. package/dist/collection/components/cat-date/cat-date.spec.js +16 -0
  151. package/dist/collection/components/cat-date/cat-date.spec.js.map +1 -0
  152. package/dist/collection/components/cat-datepicker/cat-datepicker.js +3 -3
  153. package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js +3 -8
  154. package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js.map +1 -1
  155. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +2 -2
  156. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js +2 -8
  157. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js.map +1 -1
  158. package/dist/collection/components/cat-dropdown/cat-dropdown.js +100 -30
  159. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
  160. package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js +2 -8
  161. package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js.map +1 -1
  162. package/dist/collection/components/cat-form-group/cat-form-group.js +1 -1
  163. package/dist/collection/components/cat-form-group/cat-form-group.spec.js +2 -6
  164. package/dist/collection/components/cat-form-group/cat-form-group.spec.js.map +1 -1
  165. package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js +1 -1
  166. package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js.map +1 -1
  167. package/dist/collection/components/cat-icon/cat-icon-registry.js +27 -15
  168. package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
  169. package/dist/collection/components/cat-icon/cat-icon.js +1 -1
  170. package/dist/collection/components/cat-icon/cat-icon.spec.js +1 -1
  171. package/dist/collection/components/cat-icon/cat-icon.spec.js.map +1 -1
  172. package/dist/collection/components/cat-input/cat-input.css +15 -0
  173. package/dist/collection/components/cat-input/cat-input.js +44 -6
  174. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  175. package/dist/collection/components/cat-input/cat-input.spec.js +2 -23
  176. package/dist/collection/components/cat-input/cat-input.spec.js.map +1 -1
  177. package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
  178. package/dist/collection/components/cat-pagination/cat-pagination.spec.js +2 -18
  179. package/dist/collection/components/cat-pagination/cat-pagination.spec.js.map +1 -1
  180. package/dist/collection/components/cat-radio/cat-radio.js +1 -1
  181. package/dist/collection/components/cat-radio/cat-radio.spec.js +3 -13
  182. package/dist/collection/components/cat-radio/cat-radio.spec.js.map +1 -1
  183. package/dist/collection/components/cat-radio-group/cat-radio-group.js +1 -1
  184. package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js +2 -8
  185. package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js.map +1 -1
  186. package/dist/collection/components/cat-scrollable/cat-scrollable.js +3 -3
  187. package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js +2 -13
  188. package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js.map +1 -1
  189. package/dist/collection/components/cat-select/cat-select.js +4 -4
  190. package/dist/collection/components/cat-select/cat-select.spec.js +2 -28
  191. package/dist/collection/components/cat-select/cat-select.spec.js.map +1 -1
  192. package/dist/collection/components/cat-select-demo/cat-select-demo.js +1 -1
  193. package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
  194. package/dist/collection/components/cat-skeleton/cat-skeleton.js +1 -1
  195. package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js +2 -6
  196. package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js.map +1 -1
  197. package/dist/collection/components/cat-spinner/cat-spinner.js +2 -2
  198. package/dist/collection/components/cat-spinner/cat-spinner.spec.js +1 -1
  199. package/dist/collection/components/cat-spinner/cat-spinner.spec.js.map +1 -1
  200. package/dist/collection/components/cat-tab/cat-tab.js +1 -1
  201. package/dist/collection/components/cat-tab/cat-tab.spec.js +2 -5
  202. package/dist/collection/components/cat-tab/cat-tab.spec.js.map +1 -1
  203. package/dist/collection/components/cat-tabs/cat-tabs.js +1 -1
  204. package/dist/collection/components/cat-tabs/cat-tabs.spec.js +2 -5
  205. package/dist/collection/components/cat-tabs/cat-tabs.spec.js.map +1 -1
  206. package/dist/collection/components/cat-textarea/cat-textarea.js +3 -3
  207. package/dist/collection/components/cat-textarea/cat-textarea.spec.js +2 -21
  208. package/dist/collection/components/cat-textarea/cat-textarea.spec.js.map +1 -1
  209. package/dist/collection/components/cat-time/cat-time-locale.js +15 -0
  210. package/dist/collection/components/cat-time/cat-time-locale.js.map +1 -0
  211. package/dist/collection/components/cat-time/cat-time-math.js +28 -0
  212. package/dist/collection/components/cat-time/cat-time-math.js.map +1 -0
  213. package/dist/collection/components/cat-time/cat-time.css +41 -0
  214. package/dist/collection/components/cat-time/cat-time.e2e.js +11 -0
  215. package/dist/collection/components/cat-time/cat-time.e2e.js.map +1 -0
  216. package/dist/collection/components/cat-time/cat-time.js +801 -0
  217. package/dist/collection/components/cat-time/cat-time.js.map +1 -0
  218. package/dist/collection/components/cat-time/cat-time.spec.js +16 -0
  219. package/dist/collection/components/cat-time/cat-time.spec.js.map +1 -0
  220. package/dist/collection/components/cat-toggle/cat-toggle.js +1 -1
  221. package/dist/collection/components/cat-toggle/cat-toggle.spec.js +2 -10
  222. package/dist/collection/components/cat-toggle/cat-toggle.spec.js.map +1 -1
  223. package/dist/collection/components/cat-tooltip/cat-tooltip.js +2 -2
  224. package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js +1 -9
  225. package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js.map +1 -1
  226. package/dist/collection/scss/core/_form.scss +12 -3
  227. package/dist/components/cat-button2.js +1 -1
  228. package/dist/components/cat-button2.js.map +1 -1
  229. package/dist/components/cat-date.d.ts +11 -0
  230. package/dist/components/cat-date.js +469 -0
  231. package/dist/components/cat-date.js.map +1 -0
  232. package/dist/components/cat-datepicker-inline.js +2 -2
  233. package/dist/components/cat-datepicker.js +2 -2
  234. package/dist/components/cat-dropdown2.js +35 -30
  235. package/dist/components/cat-dropdown2.js.map +1 -1
  236. package/dist/components/cat-form-group.js +1 -1
  237. package/dist/components/cat-icon-registry.js +33 -18
  238. package/dist/components/cat-icon-registry.js.map +1 -1
  239. package/dist/components/cat-icon2.js +1 -1
  240. package/dist/components/cat-input2.js +1572 -6
  241. package/dist/components/cat-input2.js.map +1 -1
  242. package/dist/components/cat-pagination.js +2 -2
  243. package/dist/components/cat-radio-group.js +1 -1
  244. package/dist/components/cat-radio.js +1 -1
  245. package/dist/components/cat-scrollable2.js +3 -3
  246. package/dist/components/cat-select-demo.js +1 -1
  247. package/dist/components/cat-select-demo.js.map +1 -1
  248. package/dist/components/cat-skeleton2.js +1 -1
  249. package/dist/components/cat-spinner2.js +2 -2
  250. package/dist/components/cat-tab.js +1 -1
  251. package/dist/components/cat-tabs.js +1 -1
  252. package/dist/components/cat-textarea.js +3 -3
  253. package/dist/components/cat-time.d.ts +11 -0
  254. package/dist/components/cat-time.js +303 -0
  255. package/dist/components/cat-time.js.map +1 -0
  256. package/dist/components/cat-toggle.js +1 -1
  257. package/dist/components/cat-tooltip.js +2 -2
  258. package/dist/esm/{cat-alert_26.entry.js → cat-alert_28.entry.js} +2293 -130
  259. package/dist/esm/cat-alert_28.entry.js.map +1 -0
  260. package/dist/esm/catalyst.js +1 -1
  261. package/dist/esm/index.js +2 -2
  262. package/dist/esm/loader.js +1 -1
  263. package/dist/esm/{of-d37c1933.js → of-19888f3b.js} +34 -19
  264. package/dist/esm/of-19888f3b.js.map +1 -0
  265. package/dist/types/components/cat-date/cat-date-locale.d.ts +24 -0
  266. package/dist/types/components/cat-date/cat-date-math.d.ts +7 -0
  267. package/dist/types/components/cat-date/cat-date.d.ts +180 -0
  268. package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +9 -3
  269. package/dist/types/components/cat-input/cat-input.d.ts +9 -2
  270. package/dist/types/components/cat-time/cat-time-locale.d.ts +6 -0
  271. package/dist/types/components/cat-time/cat-time-math.d.ts +3 -0
  272. package/dist/types/components/cat-time/cat-time.d.ts +168 -0
  273. package/dist/types/components.d.ts +551 -8
  274. package/package.json +7 -5
  275. package/dist/catalyst/p-37905c93.entry.js +0 -10
  276. package/dist/catalyst/p-37905c93.entry.js.map +0 -1
  277. package/dist/catalyst/p-8fc7b0f0.js +0 -2
  278. package/dist/catalyst/p-8fc7b0f0.js.map +0 -1
  279. package/dist/cjs/cat-alert_26.cjs.entry.js.map +0 -1
  280. package/dist/cjs/of-a6e7c491.js.map +0 -1
  281. package/dist/esm/cat-alert_26.entry.js.map +0 -1
  282. package/dist/esm/of-d37c1933.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-ecb4a974.js';
2
- import { e as createErrorClass, O as Observable, f as errorContext, E as EMPTY_SUBSCRIPTION, S as Subscription, g as arrRemove, h as operate, i as createOperatorSubscriber, j as innerFrom, k as executeSchedule, l as isFunction, m as identity, n as from, p as popScheduler, q as isArrayLike, r as isScheduler, s as popNumber, t as noop, u as log, a as catI18nRegistry, c as commonjsGlobal, d as catIconRegistry, o as of } from './of-d37c1933.js';
2
+ import { e as createErrorClass, O as Observable, f as errorContext, E as EMPTY_SUBSCRIPTION, S as Subscription, g as arrRemove, h as operate, i as createOperatorSubscriber, j as innerFrom, k as executeSchedule, l as isFunction, m as identity, n as from, p as popScheduler, q as isArrayLike, r as isScheduler, s as popNumber, t as noop, u as log, a as catI18nRegistry, c as commonjsGlobal$1, d as catIconRegistry, o as of } from './of-19888f3b.js';
3
3
 
4
4
  const ObjectUnsubscribedError = createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {
5
5
  _super(this);
@@ -1040,7 +1040,7 @@ function createEmptyStyleRule(query) {
1040
1040
  }
1041
1041
  }
1042
1042
 
1043
- const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 125ms linear, border-color 125ms linear, background-color 125ms linear, box-shadow 125ms linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-content{display:flex;flex-direction:column;min-width:0}.cat-button-content-inner{word-wrap:break-word;word-break:break-word}.cat-button-ellipsed .cat-button-content-inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-group-button-first{border-top-right-radius:0;border-bottom-right-radius:0}.cat-group-button-middle{border-radius:0}.cat-group-button-last{border-top-left-radius:0;border-bottom-left-radius:0}.cat-group-button:hover{z-index:1}.cat-group-button:focus-visible{z-index:2}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:var(--cat-font-weight-button, 600);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-filled.cat-button-disabled{--bg:242, 244, 247;--fill:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined.cat-button-disabled{--base:var(--cat-font-color-muted, 81, 92, 108);--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:var(--cat-link-button-decoration, none)}.cat-button-text.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-link{background-color:transparent;color:rgb(var(--text))}.cat-button-link.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-link:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-link.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-primary{--bg:var(--cat-primary-bg, 0, 129, 148);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 0, 129, 148);--base:var(--cat-primary-text, 0, 129, 148)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 1, 115, 132);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 1, 115, 132)}.cat-button-primary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 2, 99, 113);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 2, 99, 113)}.cat-button-secondary{--bg:var(--cat-secondary-bg, 105, 118, 135);--fill:var(--cat-secondary-fill, 255, 255, 255);--text:var(--cat-secondary-text, 0, 0, 0);--base:var(--cat-secondary-bg, 105, 118, 135)}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-hover, 105, 118, 135);--fill:var(--cat-secondary-fill-hover, 255, 255, 255);--text:var(--cat-secondary-text-hover, 0, 0, 0)}.cat-button-secondary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-active, 105, 118, 135);--fill:var(--cat-secondary-fill-active, 255, 255, 255);--text:var(--cat-secondary-text-active, 0, 0, 0)}.cat-button-info{--bg:var(--cat-info-bg, 0, 115, 230);--fill:var(--cat-info-fill, 255, 255, 255);--text:var(--cat-info-text, 0, 115, 230);--base:var(--cat-info-text, 0, 115, 230)}.cat-button-info:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-hover, 0, 107, 227);--fill:var(--cat-info-fill-hover, 255, 255, 255);--text:var(--cat-info-text-hover, 0, 107, 227)}.cat-button-info.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-info:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-active, 0, 96, 223);--fill:var(--cat-info-fill-active, 255, 255, 255);--text:var(--cat-info-text-active, 0, 96, 223)}.cat-button-success{--bg:var(--cat-success-bg, 0, 132, 88);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 132, 88);--base:var(--cat-success-text, 0, 132, 88)}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-hover, 0, 117, 78);--fill:var(--cat-success-fill-hover, 255, 255, 255);--text:var(--cat-success-text-hover, 0, 117, 78)}.cat-button-success.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-active, 0, 105, 70);--fill:var(--cat-success-fill-active, 255, 255, 255);--text:var(--cat-success-text-active, 0, 105, 70)}.cat-button-warning{--bg:var(--cat-warning-bg, 255, 206, 128);--fill:var(--cat-warning-fill, 0, 0, 0);--text:var(--cat-warning-text, 159, 97, 0);--base:var(--cat-warning-text, 159, 97, 0)}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-hover, 255, 214, 148);--fill:var(--cat-warning-fill-hover, 0, 0, 0);--text:var(--cat-warning-text-hover, 159, 97, 0)}.cat-button-warning.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-active, 255, 222, 168);--fill:var(--cat-warning-fill-active, 0, 0, 0);--text:var(--cat-warning-text-active, 159, 97, 0)}.cat-button-danger{--bg:var(--cat-danger-bg, 217, 52, 13);--fill:var(--cat-danger-fill, 255, 255, 255);--text:var(--cat-danger-text, 217, 52, 13);--base:var(--cat-danger-text, 217, 52, 13)}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-hover, 194, 46, 11);--fill:var(--cat-danger-fill-hover, 255, 255, 255);--text:var(--cat-danger-text-hover, 194, 46, 11)}.cat-button-danger.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-active, 174, 42, 10);--fill:var(--cat-danger-fill-active, 255, 255, 255);--text:var(--cat-danger-text-active, 174, 42, 10)}:host(.cat-button-pull:not([size])){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h:not([size])){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v:not([size])){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t:not([size])){margin-top:-0.625rem}:host(.cat-button-pull-l:not([size])){margin-left:-0.75rem}:host(.cat-button-pull-b:not([size])){margin-bottom:-0.625rem}:host(.cat-button-pull-r:not([size])){margin-right:-0.75rem}.cat-button-xs{min-width:1.5rem;padding:0.1875rem 0.25rem;font-size:0.875rem;line-height:1.125rem;gap:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;height:1.5rem;padding:0}:host(.cat-button-pull[size=xs]){margin:-0.1875rem -0.25rem}:host(.cat-button-pull-h[size=xs]){margin-left:-0.25rem;margin-right:-0.25rem}:host(.cat-button-pull-v[size=xs]){margin-top:-0.1875rem;margin-bottom:-0.1875rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.1875rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.1875rem}:host(.cat-button-pull-r[size=xs]){margin-right:-0.25rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;height:2rem;padding:0}:host(.cat-button-pull[size=s]){margin:-0.375rem -0.5rem}:host(.cat-button-pull-h[size=s]){margin-left:-0.5rem;margin-right:-0.5rem}:host(.cat-button-pull-v[size=s]){margin-top:-0.375rem;margin-bottom:-0.375rem}:host(.cat-button-pull-t[size=s]){margin-top:-0.375rem}:host(.cat-button-pull-l[size=s]){margin-left:-0.5rem}:host(.cat-button-pull-b[size=s]){margin-bottom:-0.375rem}:host(.cat-button-pull-r[size=s]){margin-right:-0.5rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;height:2.5rem;padding:0}:host(.cat-button-pull[size=m]){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h[size=m]){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v[size=m]){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t[size=m]){margin-top:-0.625rem}:host(.cat-button-pull-l[size=m]){margin-left:-0.75rem}:host(.cat-button-pull-b[size=m]){margin-bottom:-0.625rem}:host(.cat-button-pull-r[size=m]){margin-right:-0.75rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;height:3rem;padding:0}:host(.cat-button-pull[size=l]){margin:-0.875rem -1rem}:host(.cat-button-pull-h[size=l]){margin-left:-1rem;margin-right:-1rem}:host(.cat-button-pull-v[size=l]){margin-top:-0.875rem;margin-bottom:-0.875rem}:host(.cat-button-pull-t[size=l]){margin-top:-0.875rem}:host(.cat-button-pull-l[size=l]){margin-left:-1rem}:host(.cat-button-pull-b[size=l]){margin-bottom:-0.875rem}:host(.cat-button-pull-r[size=l]){margin-right:-1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem;gap:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;height:3.5rem;padding:0}:host(.cat-button-pull[size=xl]){margin:-1rem -1.25rem}:host(.cat-button-pull-h[size=xl]){margin-left:-1.25rem;margin-right:-1.25rem}:host(.cat-button-pull-v[size=xl]){margin-top:-1rem;margin-bottom:-1rem}:host(.cat-button-pull-t[size=xl]){margin-top:-1rem}:host(.cat-button-pull-l[size=xl]){margin-left:-1.25rem}:host(.cat-button-pull-b[size=xl]){margin-bottom:-1rem}:host(.cat-button-pull-r[size=xl]){margin-right:-1.25rem}:host(.cat-tab)::part(button){padding:1.125rem 0.75rem;--cat-secondary-bg:transparent;--cat-primary-text:transparent;--cat-danger-text:transparent}:host(.cat-tab)::part(content)::before{content:attr(data-text);content:attr(data-text)/\"\";height:0;visibility:hidden;overflow:hidden;user-select:none;pointer-events:none;font-weight:700}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}:host(.cat-nav-item){width:100%}:host(.cat-nav-item) .cat-button{box-shadow:none;justify-content:left;gap:0.5rem}:host(.cat-nav-item) .cat-button:focus-visible{outline-offset:-2px}";
1043
+ const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 125ms linear, border-color 125ms linear, background-color 125ms linear, box-shadow 125ms linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-content{display:flex;flex-direction:column;min-width:0}.cat-button-content-inner{word-wrap:break-word;word-break:break-word}.cat-button-ellipsed .cat-button-content-inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-group-button-first{border-top-right-radius:0;border-bottom-right-radius:0}.cat-group-button-middle{border-radius:0}.cat-group-button-last{border-top-left-radius:0;border-bottom-left-radius:0}.cat-group-button:hover{z-index:1}.cat-group-button:focus-visible{z-index:2}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:var(--cat-font-weight-button, 600);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-filled.cat-button-disabled{--bg:242, 244, 247;--fill:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined.cat-button-disabled{--base:var(--cat-font-color-muted, 81, 92, 108);--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:var(--cat-link-button-decoration, none)}.cat-button-text.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-link{background-color:transparent;color:rgb(var(--text))}.cat-button-link.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-link:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-link.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-primary{--bg:var(--cat-primary-bg, 0, 129, 148);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 0, 129, 148);--base:var(--cat-primary-text, 0, 129, 148)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 1, 115, 132);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 1, 115, 132)}.cat-button-primary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 2, 99, 113);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 2, 99, 113)}.cat-button-secondary{--bg:var(--cat-secondary-bg, 105, 118, 135);--fill:var(--cat-secondary-fill, 255, 255, 255);--text:var(--cat-secondary-text, 0, 0, 0);--base:var(--cat-secondary-bg, 105, 118, 135)}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-hover, 105, 118, 135);--fill:var(--cat-secondary-fill-hover, 255, 255, 255);--text:var(--cat-secondary-text-hover, 0, 0, 0)}.cat-button-secondary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-active, 105, 118, 135);--fill:var(--cat-secondary-fill-active, 255, 255, 255);--text:var(--cat-secondary-text-active, 0, 0, 0)}.cat-button-info{--bg:var(--cat-info-bg, 0, 115, 230);--fill:var(--cat-info-fill, 255, 255, 255);--text:var(--cat-info-text, 0, 115, 230);--base:var(--cat-info-text, 0, 115, 230)}.cat-button-info:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-hover, 0, 107, 227);--fill:var(--cat-info-fill-hover, 255, 255, 255);--text:var(--cat-info-text-hover, 0, 107, 227)}.cat-button-info.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-info:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-active, 0, 96, 223);--fill:var(--cat-info-fill-active, 255, 255, 255);--text:var(--cat-info-text-active, 0, 96, 223)}.cat-button-success{--bg:var(--cat-success-bg, 0, 132, 88);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 132, 88);--base:var(--cat-success-text, 0, 132, 88)}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-hover, 0, 117, 78);--fill:var(--cat-success-fill-hover, 255, 255, 255);--text:var(--cat-success-text-hover, 0, 117, 78)}.cat-button-success.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-active, 0, 105, 70);--fill:var(--cat-success-fill-active, 255, 255, 255);--text:var(--cat-success-text-active, 0, 105, 70)}.cat-button-warning{--bg:var(--cat-warning-bg, 255, 206, 128);--fill:var(--cat-warning-fill, 0, 0, 0);--text:var(--cat-warning-text, 159, 97, 0);--base:var(--cat-warning-text, 159, 97, 0)}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-hover, 255, 214, 148);--fill:var(--cat-warning-fill-hover, 0, 0, 0);--text:var(--cat-warning-text-hover, 159, 97, 0)}.cat-button-warning.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-active, 255, 222, 168);--fill:var(--cat-warning-fill-active, 0, 0, 0);--text:var(--cat-warning-text-active, 159, 97, 0)}.cat-button-danger{--bg:var(--cat-danger-bg, 217, 52, 13);--fill:var(--cat-danger-fill, 255, 255, 255);--text:var(--cat-danger-text, 217, 52, 13);--base:var(--cat-danger-text, 217, 52, 13)}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-hover, 194, 46, 11);--fill:var(--cat-danger-fill-hover, 255, 255, 255);--text:var(--cat-danger-text-hover, 194, 46, 11)}.cat-button-danger.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-active, 174, 42, 10);--fill:var(--cat-danger-fill-active, 255, 255, 255);--text:var(--cat-danger-text-active, 174, 42, 10)}:host(.cat-button-pull:not([size])){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h:not([size])){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v:not([size])){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t:not([size])){margin-top:-0.625rem}:host(.cat-button-pull-l:not([size])){margin-left:-0.75rem}:host(.cat-button-pull-b:not([size])){margin-bottom:-0.625rem}:host(.cat-button-pull-r:not([size])){margin-right:-0.75rem}.cat-button-xs{min-width:1.5rem;padding:0.1875rem 0.25rem;font-size:0.875rem;line-height:1.125rem;gap:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;height:1.5rem;padding:0}:host(.cat-button-pull[size=xs]){margin:-0.1875rem -0.25rem}:host(.cat-button-pull-h[size=xs]){margin-left:-0.25rem;margin-right:-0.25rem}:host(.cat-button-pull-v[size=xs]){margin-top:-0.1875rem;margin-bottom:-0.1875rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.1875rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.1875rem}:host(.cat-button-pull-r[size=xs]){margin-right:-0.25rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;height:2rem;padding:0}:host(.cat-button-pull[size=s]){margin:-0.375rem -0.5rem}:host(.cat-button-pull-h[size=s]){margin-left:-0.5rem;margin-right:-0.5rem}:host(.cat-button-pull-v[size=s]){margin-top:-0.375rem;margin-bottom:-0.375rem}:host(.cat-button-pull-t[size=s]){margin-top:-0.375rem}:host(.cat-button-pull-l[size=s]){margin-left:-0.5rem}:host(.cat-button-pull-b[size=s]){margin-bottom:-0.375rem}:host(.cat-button-pull-r[size=s]){margin-right:-0.5rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;height:2.5rem;padding:0}:host(.cat-button-pull[size=m]){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h[size=m]){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v[size=m]){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t[size=m]){margin-top:-0.625rem}:host(.cat-button-pull-l[size=m]){margin-left:-0.75rem}:host(.cat-button-pull-b[size=m]){margin-bottom:-0.625rem}:host(.cat-button-pull-r[size=m]){margin-right:-0.75rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;height:3rem;padding:0}:host(.cat-button-pull[size=l]){margin:-0.875rem -1rem}:host(.cat-button-pull-h[size=l]){margin-left:-1rem;margin-right:-1rem}:host(.cat-button-pull-v[size=l]){margin-top:-0.875rem;margin-bottom:-0.875rem}:host(.cat-button-pull-t[size=l]){margin-top:-0.875rem}:host(.cat-button-pull-l[size=l]){margin-left:-1rem}:host(.cat-button-pull-b[size=l]){margin-bottom:-0.875rem}:host(.cat-button-pull-r[size=l]){margin-right:-1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem;gap:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;height:3.5rem;padding:0}:host(.cat-button-pull[size=xl]){margin:-1rem -1.25rem}:host(.cat-button-pull-h[size=xl]){margin-left:-1.25rem;margin-right:-1.25rem}:host(.cat-button-pull-v[size=xl]){margin-top:-1rem;margin-bottom:-1rem}:host(.cat-button-pull-t[size=xl]){margin-top:-1rem}:host(.cat-button-pull-l[size=xl]){margin-left:-1.25rem}:host(.cat-button-pull-b[size=xl]){margin-bottom:-1rem}:host(.cat-button-pull-r[size=xl]){margin-right:-1.25rem}:host(.cat-tab)::part(button){padding:1.125rem 0.75rem;--cat-secondary-bg:transparent;--cat-primary-text:transparent;--cat-danger-text:transparent}:host(.cat-tab)::part(content)::before{content:attr(data-text);content:attr(data-text)/\"\";height:0;visibility:hidden;overflow:hidden;user-select:none;pointer-events:none;font-weight:700}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}:host(.cat-nav-item){width:100%}:host(.cat-nav-item) .cat-button{box-shadow:none;justify-content:left;gap:0.5rem}:host(.cat-nav-item) .cat-button:focus-visible{outline-offset:-2px}:host(.cat-time-format) .cat-button{border-radius:0}:host(.cat-date-toggle) .cat-button,:host(.cat-time-toggle) .cat-button{margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0}:host(.cat-date-item) .cat-button:hover,:host(.cat-date-toggle) .cat-button:hover,:host(.cat-time-format) .cat-button:hover,:host(.cat-time-toggle) .cat-button:hover{z-index:1}:host(.cat-date-item) .cat-button:focus-visible,:host(.cat-date-toggle) .cat-button:focus-visible,:host(.cat-time-format) .cat-button:focus-visible,:host(.cat-time-toggle) .cat-button:focus-visible{z-index:2}:host(.cat-date-item) .cat-button{padding-left:0;padding-right:0}";
1044
1044
  const CatButtonStyle0 = catButtonCss;
1045
1045
 
1046
1046
  const CatButton = class {
@@ -1344,6 +1344,388 @@ const CatCheckbox = class {
1344
1344
  };
1345
1345
  CatCheckbox.style = CatCheckboxStyle0;
1346
1346
 
1347
+ function getDays(language, weekday = 'long') {
1348
+ const date = new Date();
1349
+ const firstDayOfWeek = (date.getUTCDate() - date.getUTCDay() + 7) % 7;
1350
+ const format = new Intl.DateTimeFormat(language, { weekday }).format;
1351
+ return [...Array(7).keys()].map(day => format(new Date(date.getTime()).setUTCDate(firstDayOfWeek + day)));
1352
+ }
1353
+ function getMonths(language, month = 'long') {
1354
+ const date = new Date(0);
1355
+ const format = new Intl.DateTimeFormat(language, { month }).format;
1356
+ return [...Array(12).keys()].map(month => format(new Date(date.getTime()).setUTCMonth(month)));
1357
+ }
1358
+ function getWeekInfo(language) {
1359
+ const locale = new Intl.Locale(language);
1360
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1361
+ const weekInfo = locale.getWeekInfo?.() ?? locale.weekInfo;
1362
+ return {
1363
+ firstDay: weekInfo?.firstDay ?? 1,
1364
+ minDays: weekInfo?.minDays ?? 4,
1365
+ weekend: weekInfo?.weekend ?? [6, 7]
1366
+ };
1367
+ }
1368
+ function getFormat$1(language) {
1369
+ const format = new Intl.DateTimeFormat(language, { year: 'numeric', month: '2-digit', day: '2-digit' })
1370
+ .format(new Date(3456, 10, 22))
1371
+ .replace('3456', 'YYYY')
1372
+ .replace('56', 'YY')
1373
+ .replace('11', 'MM')
1374
+ .replace('22', 'DD');
1375
+ return /^(YYYY|YY|MM|DD)\W(YYYY|YY|MM|DD)\W(YYYY|YY|MM|DD)$/.test(format) ? format : 'DD-MM-YYYY';
1376
+ }
1377
+ function getLocale$2(language) {
1378
+ return {
1379
+ prevYear: catI18nRegistry.t('datepicker.prevYear'),
1380
+ nextYear: catI18nRegistry.t('datepicker.nextYear'),
1381
+ prevMonth: catI18nRegistry.t('datepicker.prevMonth'),
1382
+ nextMonth: catI18nRegistry.t('datepicker.nextMonth'),
1383
+ arrowKeys: catI18nRegistry.t('datepicker.arrowKeys'),
1384
+ today: catI18nRegistry.t('datepicker.today'),
1385
+ change: catI18nRegistry.t('datepicker.change'),
1386
+ choose: catI18nRegistry.t('datepicker.choose'),
1387
+ formatStr: getFormat$1(language),
1388
+ weekInfo: getWeekInfo(language),
1389
+ days: {
1390
+ short: getDays(language, 'short'),
1391
+ long: getDays(language, 'long')
1392
+ },
1393
+ months: {
1394
+ short: getMonths(language, 'short'),
1395
+ long: getMonths(language, 'long')
1396
+ }
1397
+ };
1398
+ }
1399
+
1400
+ function isLeapYear(year) {
1401
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
1402
+ }
1403
+ function addDays(date, n) {
1404
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() + n);
1405
+ }
1406
+ function addMonth(date, n) {
1407
+ const [year, month, day] = [date.getFullYear(), date.getMonth(), date.getDate()];
1408
+ const maxDays = [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1409
+ const newDate = new Date(date);
1410
+ newDate.setDate(1);
1411
+ newDate.setMonth(newDate.getMonth() + n);
1412
+ newDate.setDate(Math.min(day, maxDays[(month + (n % 12) + 12) % 12]));
1413
+ return newDate;
1414
+ }
1415
+ function isSameYear(date1, date2) {
1416
+ return !!date1 && !!date2 && date1.getFullYear() === date2.getFullYear();
1417
+ }
1418
+ function isSameMonth(date1, date2) {
1419
+ return !!date1 && !!date2 && date1.getMonth() === date2.getMonth() && isSameYear(date1, date2);
1420
+ }
1421
+ function isSameDay(date1, date2) {
1422
+ return !!date1 && !!date2 && date1.getDate() === date2.getDate() && isSameMonth(date1, date2);
1423
+ }
1424
+ function clampDate(min, date, max) {
1425
+ return new Date(Math.min(Math.max(date.getTime(), min?.getTime() ?? -Infinity), max?.getTime() ?? Infinity));
1426
+ }
1427
+
1428
+ const catDateCss = ":host{display:block}:host([hidden]){display:none}.label-aria{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.picker{padding:1rem;display:inline-flex;flex-direction:column}.picker-head{display:flex;gap:0.5rem;align-items:center}.picker-head h3{flex:1;text-align:center;margin:0}.picker-grid{display:grid;grid-template-rows:2rem repeat(6, 1fr);grid-template-columns:2rem repeat(7, 1fr);grid-template-areas:\". h h h h h h h\" \"w d d d d d d d\" \"w d d d d d d d\" \"w d d d d d d d\" \"w d d d d d d d\" \"w d d d d d d d\" \"w d d d d d d d\";margin:1rem 0 0.5rem}.picker-grid-head{grid-area:h;display:grid;grid-template-columns:repeat(7, 1fr);place-items:end center;padding-bottom:0.5rem}.picker-grid-weeks{grid-area:w;display:grid;grid-template-rows:repeat(6, 1fr);place-items:center right;padding-right:0.5rem}.picker-grid-days{grid-area:d;display:grid;grid-template-rows:repeat(6, 1fr);grid-template-columns:repeat(7, 1fr)}.picker-grid-head>*,.picker-grid-weeks>*{font-size:0.75rem;line-height:1rem;font-weight:600;color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important;text-decoration:none}.date-other{opacity:0.5}.date-disabled{opacity:0.25}.picker-foot{display:flex;gap:1rem;align-items:center}.cursor-help{flex:1;margin:0;font-size:0.875rem;line-height:1.125rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important;text-align:center}.cursor-help.cursor-right{text-align:right}.cursor-aria{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}";
1429
+ const CatDateStyle0 = catDateCss;
1430
+
1431
+ const CatDate = class {
1432
+ constructor(hostRef) {
1433
+ registerInstance(this, hostRef);
1434
+ this.catChange = createEvent(this, "catChange", 7);
1435
+ this.catFocus = createEvent(this, "catFocus", 7);
1436
+ this.catBlur = createEvent(this, "catBlur", 7);
1437
+ this.language = catI18nRegistry.getLocale();
1438
+ this.locale = getLocale$2(this.language);
1439
+ this.isOpen = false;
1440
+ // additonally store the focus date to ensure correct focus after potential re-render
1441
+ this.focusDate = null;
1442
+ this.hasSlottedLabel = false;
1443
+ this.hasSlottedHint = false;
1444
+ this.viewDate = this.now;
1445
+ this.selectionDate = null;
1446
+ this.requiredMarker = 'optional';
1447
+ this.horizontal = false;
1448
+ this.autoComplete = undefined;
1449
+ this.clearable = false;
1450
+ this.disabled = false;
1451
+ this.hint = undefined;
1452
+ this.icon = undefined;
1453
+ this.iconRight = false;
1454
+ this.identifier = undefined;
1455
+ this.label = '';
1456
+ this.labelHidden = false;
1457
+ this.max = undefined;
1458
+ this.min = undefined;
1459
+ this.name = undefined;
1460
+ this.placeholder = undefined;
1461
+ this.textPrefix = undefined;
1462
+ this.textSuffix = undefined;
1463
+ this.readonly = false;
1464
+ this.required = false;
1465
+ this.value = undefined;
1466
+ this.errors = undefined;
1467
+ this.errorUpdate = 0;
1468
+ this.nativeAttributes = undefined;
1469
+ this.placement = 'bottom-end';
1470
+ }
1471
+ get maxDate() {
1472
+ const [y, m, d] = this.max?.split('-').map(Number) || [];
1473
+ return this.max ? new Date(y, m - 1, d) : null;
1474
+ }
1475
+ get minDate() {
1476
+ const [y, m, d] = this.min?.split('-').map(Number) || [];
1477
+ return this.min ? new Date(y, m - 1, d) : null;
1478
+ }
1479
+ get now() {
1480
+ const date = new Date();
1481
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate());
1482
+ }
1483
+ get focusedDate() {
1484
+ const [all, year, month, day] = this.hostElement.shadowRoot
1485
+ ?.querySelector(`[data-date]:focus`)
1486
+ ?.dataset.date?.match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
1487
+ return all ? new Date(Number(year), Number(month) - 1, Number(day)) : null;
1488
+ }
1489
+ componentWillLoad() {
1490
+ const [match, year, month, day] = this.value?.match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
1491
+ if (match) {
1492
+ this.select(new Date(Number(year), Number(month) - 1, Number(day)));
1493
+ }
1494
+ }
1495
+ componentWillRender() {
1496
+ this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
1497
+ this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
1498
+ }
1499
+ componentDidLoad() {
1500
+ const format = this.locale.formatStr.replace('YYYY', 'Y').replace('YY', 'y').replace('MM', 'm').replace('DD', 'd');
1501
+ const [, p1, d1, p2, p3] = /(\w+)([^\w]+)(\w+)[^\w]+(\w+)/.exec(format) || [];
1502
+ this.input?.mask({
1503
+ date: true,
1504
+ dateMin: this.min,
1505
+ dateMax: this.max,
1506
+ delimiter: d1,
1507
+ datePattern: [p1, p2, p3]
1508
+ });
1509
+ }
1510
+ componentDidRender() {
1511
+ if (this.focusDate) {
1512
+ this.hostElement.shadowRoot
1513
+ ?.querySelector(`[data-date="${this.toLocalISO(this.focusDate)}"]`)
1514
+ ?.doFocus();
1515
+ this.focusDate = null;
1516
+ }
1517
+ }
1518
+ onOpen() {
1519
+ this.isOpen = true;
1520
+ this.setAriaLive('');
1521
+ const viewDate = this.selectionDate
1522
+ ? new Date(this.selectionDate.getFullYear(), this.selectionDate.getMonth(), 1)
1523
+ : this.now;
1524
+ this.viewDate = clampDate(this.minDate, viewDate, this.maxDate);
1525
+ }
1526
+ onClose() {
1527
+ this.isOpen = false;
1528
+ }
1529
+ onKeyDown(e) {
1530
+ if (!this.isOpen || !['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(e.key)) {
1531
+ return;
1532
+ }
1533
+ const focused = this.focusedDate;
1534
+ if (!focused) {
1535
+ e.preventDefault();
1536
+ this.focus(this.selectionDate || this.now);
1537
+ }
1538
+ else if (e.key === 'ArrowLeft') {
1539
+ e.preventDefault();
1540
+ this.focus(e.shiftKey ? addMonth(focused, -1) : addDays(focused, -1));
1541
+ }
1542
+ else if (e.key === 'ArrowRight') {
1543
+ e.preventDefault();
1544
+ this.focus(e.shiftKey ? addMonth(focused, 1) : addDays(focused, 1));
1545
+ }
1546
+ else if (e.key === 'ArrowUp') {
1547
+ e.preventDefault();
1548
+ this.focus(addDays(focused, -7));
1549
+ }
1550
+ else if (e.key === 'ArrowDown') {
1551
+ e.preventDefault();
1552
+ this.focus(addDays(focused, 7));
1553
+ }
1554
+ }
1555
+ /**
1556
+ * Select a date in the picker.
1557
+ *
1558
+ * @param date The date to select.
1559
+ */
1560
+ async select(date) {
1561
+ const oldValue = this.value;
1562
+ const newDate = clampDate(this.minDate, new Date(date.getFullYear(), date.getMonth(), date.getDate()), this.maxDate);
1563
+ this.focus(newDate);
1564
+ this.selectionDate = newDate;
1565
+ this.value = newDate.toISOString();
1566
+ if (oldValue !== this.value) {
1567
+ this.catChange.emit(this.value);
1568
+ }
1569
+ }
1570
+ /**
1571
+ * Programmatically move focus to the input. Use this method instead of
1572
+ * `input.focus()`.
1573
+ *
1574
+ * @param options An optional object providing options to control aspects of
1575
+ * the focusing process.
1576
+ */
1577
+ async doFocus(options) {
1578
+ this.input?.doFocus(options);
1579
+ }
1580
+ /**
1581
+ * Programmatically remove focus from the input. Use this method instead of
1582
+ * `input.blur()`.
1583
+ */
1584
+ async doBlur() {
1585
+ this.input?.doBlur();
1586
+ }
1587
+ /**
1588
+ * Clear the input.
1589
+ */
1590
+ async clear() {
1591
+ this.input?.clear();
1592
+ }
1593
+ render() {
1594
+ const dateGrid = this.dateGrid(this.viewDate.getFullYear(), this.viewDate.getMonth());
1595
+ return (h(Host, { key: 'ebb5f193ca43bc3306449c91d2e391cb25b3287c' }, h("cat-input", { key: '27292844d077a8d79022074a191c47e72736d2c5', class: "cat-date-input", ref: el => (this.input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, value: this.getInputValue(), onCatFocus: e => this.catFocus.emit(e.detail), onCatBlur: e => this.onInputBlur(e.detail) }, h("span", { key: 'e9c9ad5b5374fcf944396a7ae45ae61775336be4', slot: "label" }, this.label, h("span", { key: '5a05917857fdc967bb122e0403f64b8b71ecf08a', class: "label-aria" }, " (", this.locale.formatStr, ")")), h("cat-dropdown", { key: 'ac1b7f5e1efae2648fa82acb31059ab41d0adb55', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true }, h("cat-button", { key: 'bfaabd6f8120333b497b262894489628beb1d886', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.selectionDate
1596
+ ? `${this.locale.change}, ${this.getA11yLabelDay(this.selectionDate)}`
1597
+ : this.locale.choose }), h("div", { key: '9cfb02ca034584dcdd23fadb5f41ca598552a605', class: "picker", slot: "content" }, h("div", { key: '4d09c5f3ca84346bbcc68f4c83f3413159b8b608', class: "picker-head" }, h("cat-button", { key: '9e8d1695f1a882f2388a2b57ccd8cc51e8b52483', icon: "$cat:datepicker-year-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevYear, disabled: isSameYear(this.viewDate, this.minDate), onClick: () => this.navigate('prev', 'year'), "data-dropdown-no-close": true }), h("cat-button", { key: '5af1b092c2f0d13e5c12d49699e85ea5dded7580', icon: "$cat:datepicker-month-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevMonth, disabled: isSameMonth(this.viewDate, this.minDate), onClick: () => this.navigate('prev', 'month'), "data-dropdown-no-close": true }), h("h3", { key: 'cd730386e0fc19a4b12ee2910e6de7f079133584' }, this.getHeadline()), h("cat-button", { key: 'f0c76ac04573977e255956d2e377dd197080a5b8', icon: "$cat:datepicker-month-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextMonth, disabled: isSameMonth(this.viewDate, this.maxDate), onClick: () => this.navigate('next', 'month'), "data-dropdown-no-close": true }), h("cat-button", { key: 'd58917e0665df029acc6dac35e7ab05eab60f9d4', icon: "$cat:datepicker-year-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextYear, disabled: isSameYear(this.viewDate, this.maxDate), onClick: () => this.navigate('next', 'year'), "data-dropdown-no-close": true })), h("div", { key: '5307170ba72c90fceef4276aa5feb74dc569c74d', class: "picker-grid", onFocusin: () => this.setAriaLive(this.locale.arrowKeys) }, h("div", { key: 'acd6b0e720722ed3e3d013463645fe294a75b68d', class: "picker-grid-head" }, Array.from(Array(7), (_, i) => (h("abbr", { title: this.locale.days.long[i] }, this.locale.days.short[i])))), h("div", { key: 'a8b349d48f3595b7a29a037fb48b130dfb9af438', class: "picker-grid-weeks" }, dateGrid
1598
+ .filter((_, i) => i % 7 === 0)
1599
+ .map(day => (h("div", null, this.getWeekNumber(day))))), h("div", { key: '1e7750157710763ad977d866bb2e511b6ec44d03', class: "picker-grid-days" }, dateGrid.map(day => (h("cat-button", { class: {
1600
+ 'cat-date-item': true,
1601
+ 'date-other': !isSameMonth(this.viewDate, day),
1602
+ 'date-today': isSameDay(this.now, day),
1603
+ 'date-selected': isSameDay(this.selectionDate, day),
1604
+ 'date-focusable': this.canFocus(day),
1605
+ 'date-disabled': !this.canClick(day)
1606
+ }, nativeAttributes: !this.canFocus(day) ? { tabindex: '-1' } : {}, variant: isSameDay(this.selectionDate, day) ? 'filled' : isSameDay(this.now, day) ? 'outlined' : 'text', a11yLabel: this.getA11yLabelDay(day), active: isSameDay(this.selectionDate, day), color: isSameDay(this.selectionDate, day) || isSameDay(this.now, day) ? 'primary' : 'secondary', disabled: !this.canClick(day), onClick: () => this.select(day), "data-date": this.toLocalISO(day) }, day.getDate()))))), h("div", { key: 'd8874097357312b5ddd4bda5e4018d3e642aaf99', class: "picker-foot" }, this.canClick(this.now) && (h("cat-button", { size: "s", "data-dropdown-no-close": true, onClick: () => this.select(this.now) }, this.locale.today)), h("p", { key: '42d936d44ef0cb07375415ae42a95565cd7f342b', class: {
1607
+ 'cursor-help': true,
1608
+ 'cursor-right': this.canClick(this.now)
1609
+ } }, this.locale.arrowKeys), h("p", { key: '6df5566486d5082b3c2cb79fde22cedd7608c8bf', class: "cursor-aria", "aria-live": "polite" })))))));
1610
+ }
1611
+ parse(value) {
1612
+ const [, p1, d1, p2, p3] = /(\w+)([^\w]+)(\w+)[^\w]+(\w+)/.exec(this.locale.formatStr) || [];
1613
+ const formatParts = [p1, p2, p3];
1614
+ const parts = value.split(d1).map(s => Number(s || 'x'));
1615
+ let year = parts[formatParts.indexOf('YYYY') || formatParts.indexOf('YY')] || this.now.getFullYear();
1616
+ const month = parts[formatParts.indexOf('MM')];
1617
+ const day = parts[formatParts.indexOf('DD')];
1618
+ if (!Number.isInteger(month) || !Number.isInteger(day)) {
1619
+ return null;
1620
+ }
1621
+ else if (year < 100) {
1622
+ year += year < 50 ? 2000 : 1900;
1623
+ }
1624
+ return new Date(year, month - 1, day);
1625
+ }
1626
+ focus(date) {
1627
+ this.focusDate = clampDate(this.minDate, date, this.maxDate);
1628
+ this.viewDate = new Date(this.focusDate.getFullYear(), this.focusDate.getMonth());
1629
+ this.hostElement.shadowRoot
1630
+ ?.querySelector(`[data-date="${this.toLocalISO(this.focusDate)}"]`)
1631
+ ?.doFocus();
1632
+ }
1633
+ navigate(direction, period) {
1634
+ this.viewDate = new Date(direction === 'prev'
1635
+ ? period === 'year'
1636
+ ? this.viewDate.setFullYear(this.viewDate.getFullYear() - 1)
1637
+ : this.viewDate.setMonth(this.viewDate.getMonth() - 1)
1638
+ : period === 'year'
1639
+ ? this.viewDate.setFullYear(this.viewDate.getFullYear() + 1)
1640
+ : this.viewDate.setMonth(this.viewDate.getMonth() + 1));
1641
+ // announce the new month and year
1642
+ this.setAriaLive(this.getHeadline());
1643
+ }
1644
+ setAriaLive(text) {
1645
+ const node = this.hostElement.shadowRoot?.querySelector('.cursor-aria');
1646
+ if (node) {
1647
+ node.innerHTML = text;
1648
+ }
1649
+ }
1650
+ onInputBlur(e) {
1651
+ if (!this.input) {
1652
+ return;
1653
+ }
1654
+ const oldValue = this.value;
1655
+ const value = this.parse(this.input.value ?? '');
1656
+ this.selectionDate = value ? clampDate(this.minDate, value, this.maxDate) : value;
1657
+ this.value = this.selectionDate?.toISOString();
1658
+ if (oldValue !== this.value) {
1659
+ this.catChange.emit(this.value);
1660
+ }
1661
+ this.input.value = this.getInputValue();
1662
+ this.catBlur.emit(e);
1663
+ }
1664
+ dateGrid(year, month) {
1665
+ const firstDayOfWeek = new Date(year, month, 1).getDay();
1666
+ const daysInMonth = new Date(year, month + 1, 0).getDate();
1667
+ const days = [...Array(daysInMonth).keys()];
1668
+ const daysBefore = [...Array(firstDayOfWeek).keys()].map(day => new Date(year, month, day - firstDayOfWeek).getDate());
1669
+ const daysAfter = [...Array(42 - days.length - daysBefore.length).keys()];
1670
+ return [
1671
+ ...daysBefore.map(day => new Date(year, month - 1, day + 1)),
1672
+ ...days.map(day => new Date(year, month, day + 1)),
1673
+ ...daysAfter.map(day => new Date(year, month + 1, day + 1))
1674
+ ];
1675
+ }
1676
+ getHeadline() {
1677
+ return `${this.locale.months.long[this.viewDate.getMonth()]} ${this.viewDate.getFullYear()}`;
1678
+ }
1679
+ getInputValue() {
1680
+ const format = new Intl.DateTimeFormat(this.language, { year: 'numeric', month: '2-digit', day: '2-digit' });
1681
+ return this.selectionDate ? format.format(this.selectionDate) : '';
1682
+ }
1683
+ getA11yLabelDay(date) {
1684
+ const format = new Intl.DateTimeFormat(this.language, {
1685
+ year: 'numeric',
1686
+ month: 'long',
1687
+ day: 'numeric',
1688
+ weekday: 'long'
1689
+ });
1690
+ return format.format(date);
1691
+ }
1692
+ getWeekNumber(date, iso8601 = true) {
1693
+ const currentDate = new Date(date.getTime());
1694
+ const dayNum = iso8601 ? currentDate.getDay() || 7 : currentDate.getDay();
1695
+ currentDate.setDate(currentDate.getDate() + 4 - dayNum);
1696
+ const yearStart = new Date(currentDate.getFullYear(), 0, 1);
1697
+ return Math.ceil(((+currentDate - +yearStart) / 86400000 + 1) / 7);
1698
+ }
1699
+ canFocus(date) {
1700
+ const now = this.now;
1701
+ const focused = this.focusedDate;
1702
+ if (focused && isSameMonth(focused, this.viewDate)) {
1703
+ return isSameMonth(focused, date) && isSameDay(focused, date);
1704
+ }
1705
+ else if (this.selectionDate && isSameMonth(this.selectionDate, this.viewDate)) {
1706
+ return isSameMonth(this.selectionDate, date) && isSameDay(this.selectionDate, date);
1707
+ }
1708
+ else if (isSameMonth(this.viewDate, now) && (!this.minDate || this.minDate <= now)) {
1709
+ return isSameMonth(this.viewDate, date) && isSameDay(now, date);
1710
+ }
1711
+ const minDay = isSameMonth(date, this.minDate) ? this.minDate?.getDate() ?? 1 : 1;
1712
+ return isSameMonth(this.viewDate, date) && date.getDate() === minDay;
1713
+ }
1714
+ canClick(date) {
1715
+ const min = this.minDate;
1716
+ const max = this.maxDate;
1717
+ return (!min || min <= date) && (!max || max >= date);
1718
+ }
1719
+ toLocalISO(date) {
1720
+ const year = date.getFullYear();
1721
+ const month = (date.getMonth() + 1).toString().padStart(2, '0');
1722
+ const day = date.getDate().toString().padStart(2, '0');
1723
+ return `${year}-${month}-${day}`;
1724
+ }
1725
+ get hostElement() { return getElement(this); }
1726
+ };
1727
+ CatDate.style = CatDateStyle0;
1728
+
1347
1729
  var HOOKS = [
1348
1730
  "onChange",
1349
1731
  "onClose",
@@ -3911,7 +4293,7 @@ var weekSelect = {exports: {}};
3911
4293
  (function (module, exports) {
3912
4294
  (function (global, factory) {
3913
4295
  module.exports = factory() ;
3914
- }(commonjsGlobal, (function () {
4296
+ }(commonjsGlobal$1, (function () {
3915
4297
  function getEventTarget(event) {
3916
4298
  try {
3917
4299
  if (typeof event.composedPath === "function") {
@@ -4105,7 +4487,7 @@ function getFormat(language, mode) {
4105
4487
  .replace(/AM|PM/i, 'K');
4106
4488
  }
4107
4489
 
4108
- function getHour12(language) {
4490
+ function getHour12$1(language) {
4109
4491
  const dateStr = new Intl.DateTimeFormat(language, { hour: '2-digit', minute: '2-digit' })
4110
4492
  .format(new Date())
4111
4493
  .toLowerCase();
@@ -4128,7 +4510,7 @@ function monthsForLocale(language, month = 'long') {
4128
4510
  const format = new Intl.DateTimeFormat(language, { month }).format;
4129
4511
  return [...Array(12).keys()].map(month => format(new Date(date.getTime()).setUTCMonth(month)));
4130
4512
  }
4131
- function getLocale(language) {
4513
+ function getLocale$1(language) {
4132
4514
  return {
4133
4515
  firstDayOfWeek: getFirstDayOfWeek(language),
4134
4516
  rangeSeparator: ' - ',
@@ -4139,7 +4521,7 @@ function getLocale(language) {
4139
4521
  minuteAriaLabel: catI18nRegistry.t('datepicker.minute'),
4140
4522
  toggleTitle: catI18nRegistry.t('datepicker.toggle'),
4141
4523
  scrollTitle: catI18nRegistry.t('datepicker.scroll'),
4142
- time_24hr: !getHour12(language),
4524
+ time_24hr: !getHour12$1(language),
4143
4525
  weekdays: {
4144
4526
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4145
4527
  shorthand: daysForLocale(language, 'short'),
@@ -5702,7 +6084,7 @@ const CatDatepickerFlat = class {
5702
6084
  }
5703
6085
  render() {
5704
6086
  return [
5705
- h("cat-input", { key: 'd3848f35807c0d52c576af50c46fb609afb043d2', ref: el => (this._input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, label: this.label, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, value: this.value, errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, onCatChange: e => {
6087
+ h("cat-input", { key: '30fb619a94e93a583bf7df28945917562c6b184f', ref: el => (this._input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, label: this.label, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, value: this.value, errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, onCatChange: e => {
5706
6088
  e.stopPropagation();
5707
6089
  this.value = e.detail || undefined;
5708
6090
  }, onCatFocus: e => {
@@ -5712,7 +6094,7 @@ const CatDatepickerFlat = class {
5712
6094
  e.stopPropagation();
5713
6095
  this.catBlur.emit(e.detail);
5714
6096
  } }, this.hasSlottedLabel && (h("span", { slot: "label" }, h("slot", { name: "label" }))), this.hasSlottedHint && (h("span", { slot: "hint" }, h("slot", { name: "hint" })))),
5715
- h("div", { key: 'f773fd3007b93efbaf270376e6029f45e94e42b3', ref: el => (this._calendarWrapper = el), class: "datepicker-wrapper" })
6097
+ h("div", { key: 'f28f001436363260ec7c9dff26a8f82475c98ac5', ref: el => (this._calendarWrapper = el), class: "datepicker-wrapper" })
5716
6098
  ];
5717
6099
  }
5718
6100
  initDatepicker(input) {
@@ -5723,7 +6105,7 @@ const CatDatepickerFlat = class {
5723
6105
  const withinDropdown = !!findClosest('cat-dropdown', input);
5724
6106
  const nativePickerAttributes = withinDropdown ? { 'data-dropdown-no-close': '' } : {};
5725
6107
  return flatpickr(input, getConfig({
5726
- locale: getLocale(catI18nRegistry.getLocale()),
6108
+ locale: getLocale$1(catI18nRegistry.getLocale()),
5727
6109
  format: getFormat(catI18nRegistry.getLocale(), this.mode),
5728
6110
  mode: this.mode,
5729
6111
  min: this.min,
@@ -5815,18 +6197,18 @@ const CatDatepickerInline = class {
5815
6197
  this.pickr = this.initDatepicker(this.input);
5816
6198
  }
5817
6199
  render() {
5818
- return (h(Host, { key: '76c2554d2968d81f9610a48498a2cc688d65f596' }, h("div", { key: '029811c7aaec4382d62be054965864556112a017', tabIndex: this.disabled || this.readonly ? -1 : undefined, class: {
6200
+ return (h(Host, { key: 'bb9ebb60420d1268751f6136e38d1aed5bc74602' }, h("div", { key: 'b84cc674ab3b677ceb646dee84b1b83d5d969746', tabIndex: this.disabled || this.readonly ? -1 : undefined, class: {
5819
6201
  'datepicker-wrapper': true,
5820
6202
  'datepicker-disabled': this.disabled,
5821
6203
  'datepicker-readonly': this.readonly
5822
- } }, h("input", { key: '2f4ccdf0392adcb7d231639d078b12eba82cd477', ref: el => (this.input = el), value: this.value, disabled: this.disabled, readonly: this.readonly }))));
6204
+ } }, h("input", { key: '6f7706220aa7465a907391e78f97a5e1ad91fdf0', ref: el => (this.input = el), value: this.value, disabled: this.disabled, readonly: this.readonly }))));
5823
6205
  }
5824
6206
  initDatepicker(input) {
5825
6207
  if (!input) {
5826
6208
  return;
5827
6209
  }
5828
6210
  return flatpickr(input, getConfig({
5829
- locale: getLocale(catI18nRegistry.getLocale()),
6211
+ locale: getLocale$1(catI18nRegistry.getLocale()),
5830
6212
  format: getFormat(catI18nRegistry.getLocale(), this.mode),
5831
6213
  mode: this.mode,
5832
6214
  min: this.min,
@@ -7375,6 +7757,8 @@ const CatDropdown = class {
7375
7757
  this.isOpen = false;
7376
7758
  this.placement = 'bottom-start';
7377
7759
  this.noAutoClose = false;
7760
+ this.arrowNavigation = 'vertical';
7761
+ this.noResize = false;
7378
7762
  this.overflow = false;
7379
7763
  }
7380
7764
  clickHandler(event) {
@@ -7417,7 +7801,6 @@ const CatDropdown = class {
7417
7801
  this.isOpen = true;
7418
7802
  this.content.classList.add('show');
7419
7803
  this.trigger?.setAttribute('aria-expanded', 'true');
7420
- this.catOpen.emit();
7421
7804
  this.trap = this.trap
7422
7805
  ? this.trap.updateContainerElements(this.content)
7423
7806
  : createFocusTrap(this.content, {
@@ -7430,7 +7813,25 @@ const CatDropdown = class {
7430
7813
  !event.composedPath().includes(this.content) &&
7431
7814
  // check if click was not on an element marked with data-dropdown-no-close
7432
7815
  !event.composedPath().find(el => this.hasAttribute(el, 'data-dropdown-no-close')),
7433
- onPostDeactivate: () => this.close()
7816
+ onPostDeactivate: () => this.close(),
7817
+ onPostActivate: () => this.catOpen.emit(),
7818
+ setReturnFocus: elem => this.trigger || elem,
7819
+ isKeyForward: event => {
7820
+ if ((this.arrowNavigation === 'horizontal' && event.key === 'ArrowRight') ||
7821
+ (this.arrowNavigation === 'vertical' && event.key === 'ArrowDown')) {
7822
+ event.preventDefault();
7823
+ return true;
7824
+ }
7825
+ return event.key === 'Tab';
7826
+ },
7827
+ isKeyBackward: event => {
7828
+ if ((this.arrowNavigation === 'horizontal' && event.key === 'ArrowLeft') ||
7829
+ (this.arrowNavigation === 'vertical' && event.key === 'ArrowUp')) {
7830
+ event.preventDefault();
7831
+ return true;
7832
+ }
7833
+ return event.key === 'Tab' && event.shiftKey;
7834
+ }
7434
7835
  });
7435
7836
  this.trap.activate();
7436
7837
  });
@@ -7454,27 +7855,8 @@ const CatDropdown = class {
7454
7855
  this.catClose.emit();
7455
7856
  }, timeTransitionS);
7456
7857
  }
7457
- componentDidLoad() {
7458
- this.keyListener = event => {
7459
- if (this.isOpen && ['ArrowDown', 'ArrowUp'].includes(event.key)) {
7460
- const targetElements = tabbable(this.content, { includeContainer: false, getShadowRoot: true });
7461
- const activeElement = firstTabbable(document.activeElement);
7462
- const activeIdx = activeElement ? targetElements.indexOf(activeElement) : -1;
7463
- const activeOff = event.key === 'ArrowDown' ? 1 : -1;
7464
- const targetIdx = activeIdx < 0 ? 0 : (activeIdx + activeOff + targetElements.length) % targetElements.length;
7465
- targetElements[targetIdx].focus();
7466
- event.preventDefault();
7467
- }
7468
- };
7469
- document.addEventListener('keydown', this.keyListener);
7470
- }
7471
- disconnectedCallback() {
7472
- if (this.keyListener) {
7473
- document.removeEventListener('keydown', this.keyListener);
7474
- }
7475
- }
7476
7858
  render() {
7477
- return (h(Host, { key: '1302105901512a7bc803b09b677403c29a7e4d0f' }, h("slot", { key: 'b99d3b3428881473ef9cc1e8060b6664287108d7', name: "trigger", ref: el => (this.triggerSlot = el) }), h("div", { key: 'e221df97109e862d3f8af2ba83f4554ff19fff5b', id: this.contentId, class: { content: true, 'overflow-auto': !this.overflow }, ref: el => (this.content = el) }, h("slot", { key: 'bac2c0b2b1550f53e30ab34bf818f12b48706902', name: "content" }))));
7859
+ return (h(Host, { key: 'b9a95b9b2c0e084fe0036989f174ee1681ecfe96' }, h("slot", { key: '73d2e8b7dd4c67f95c6b9faa34142de00eb25c4e', name: "trigger", ref: el => (this.triggerSlot = el) }), h("div", { key: '6555cf3ab1b4f0cfcea0e9ba85221f3de5cede82', id: this.contentId, class: { content: true, 'overflow-auto': !this.overflow }, ref: el => (this.content = el) }, h("slot", { key: '70dab119fa43e67e1d17b558519028c0f9da60d4', name: "content" }))));
7478
7860
  }
7479
7861
  get contentId() {
7480
7862
  return `cat-dropdown-${this.id}`;
@@ -7506,12 +7888,9 @@ const CatDropdown = class {
7506
7888
  }
7507
7889
  update() {
7508
7890
  if (this.trigger) {
7509
- computePosition(this.trigger, this.content, {
7510
- strategy: 'fixed',
7511
- placement: this.placement,
7512
- middleware: [
7513
- offset(CatDropdown.OFFSET),
7514
- flip(),
7891
+ const resize = this.noResize
7892
+ ? []
7893
+ : [
7515
7894
  size({
7516
7895
  padding: CatDropdown.OFFSET,
7517
7896
  apply({ availableWidth, availableHeight, elements }) {
@@ -7521,7 +7900,11 @@ const CatDropdown = class {
7521
7900
  });
7522
7901
  }
7523
7902
  })
7524
- ]
7903
+ ];
7904
+ computePosition(this.trigger, this.content, {
7905
+ strategy: 'fixed',
7906
+ placement: this.placement,
7907
+ middleware: [offset(CatDropdown.OFFSET), flip(), ...resize]
7525
7908
  }).then(({ x, y, placement }) => {
7526
7909
  this.content.dataset.placement = placement;
7527
7910
  Object.assign(this.content.style, {
@@ -7559,7 +7942,7 @@ const CatFormGroup = class {
7559
7942
  });
7560
7943
  }
7561
7944
  render() {
7562
- return (h(Host, { key: '548a16590d7b83ed3e85de1ef3c9a78698c4e9b9', style: { '--label-size': this.labelSize } }, h("slot", { key: 'ff24db84c7429388eb78e57d7438e0c3c6e93e76', onSlotchange: this.onSlotChange.bind(this) })));
7945
+ return (h(Host, { key: 'd9805ae9997123327fa6259d9e849dff68576b31', style: { '--label-size': this.labelSize } }, h("slot", { key: 'e7e254cf202b8ee8a219ec077e659fde18db3530', onSlotchange: this.onSlotChange.bind(this) })));
7563
7946
  }
7564
7947
  onSlotChange() {
7565
7948
  this.formElements = Array.from(this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker'));
@@ -7591,7 +7974,7 @@ const CatIcon = class {
7591
7974
  this.a11yLabel = undefined;
7592
7975
  }
7593
7976
  render() {
7594
- return (h("span", { key: 'f7ef8a40c1fe37966b886ef9cd1a726a536dd08b', innerHTML: this.iconSrc || (this.icon ? catIconRegistry.getIcon(this.icon) : ''), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
7977
+ return (h("span", { key: 'ace2ec39a623d9c8168269a5b4c46c4efef2fbc7', innerHTML: this.iconSrc || (this.icon ? catIconRegistry.getIcon(this.icon) : ''), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
7595
7978
  icon: true,
7596
7979
  [`icon-${this.size}`]: this.size !== 'inline'
7597
7980
  } }));
@@ -7599,70 +7982,1627 @@ const CatIcon = class {
7599
7982
  };
7600
7983
  CatIcon.style = CatIconStyle0;
7601
7984
 
7602
- /* eslint-disable @typescript-eslint/no-explicit-any */
7603
- function coerceBoolean(value) {
7604
- return value != null && `${value}` !== 'false';
7605
- }
7606
- function coerceNumber(value, fallbackValue = 0) {
7607
- return isNumberValue(value) ? Number(value) : fallbackValue;
7608
- }
7609
- function isNumberValue(value) {
7610
- return !isNaN(parseFloat(value)) && !isNaN(Number(value));
7611
- }
7985
+ var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
7986
+
7987
+ var NumeralFormatter = function (numeralDecimalMark,
7988
+ numeralIntegerScale,
7989
+ numeralDecimalScale,
7990
+ numeralThousandsGroupStyle,
7991
+ numeralPositiveOnly,
7992
+ stripLeadingZeroes,
7993
+ prefix,
7994
+ signBeforePrefix,
7995
+ tailPrefix,
7996
+ delimiter) {
7997
+ var owner = this;
7998
+
7999
+ owner.numeralDecimalMark = numeralDecimalMark || '.';
8000
+ owner.numeralIntegerScale = numeralIntegerScale > 0 ? numeralIntegerScale : 0;
8001
+ owner.numeralDecimalScale = numeralDecimalScale >= 0 ? numeralDecimalScale : 2;
8002
+ owner.numeralThousandsGroupStyle = numeralThousandsGroupStyle || NumeralFormatter.groupStyle.thousand;
8003
+ owner.numeralPositiveOnly = !!numeralPositiveOnly;
8004
+ owner.stripLeadingZeroes = stripLeadingZeroes !== false;
8005
+ owner.prefix = (prefix || prefix === '') ? prefix : '';
8006
+ owner.signBeforePrefix = !!signBeforePrefix;
8007
+ owner.tailPrefix = !!tailPrefix;
8008
+ owner.delimiter = (delimiter || delimiter === '') ? delimiter : ',';
8009
+ owner.delimiterRE = delimiter ? new RegExp('\\' + delimiter, 'g') : '';
8010
+ };
7612
8011
 
7613
- const catInputCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}.cat-bg-primary{background-color:rgb(var(--cat-primary-bg, 0, 129, 148)) !important;color:rgb(var(--cat-primary-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-primary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-primary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-primary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-primary-hover{transition:background-color 125ms, color 125ms}.cat-bg-primary-hover:hover{background-color:rgb(var(--cat-primary-bg-hover, 1, 115, 132)) !important;color:rgb(var(--cat-primary-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-primary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-primary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-primary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-primary,.cat-link-primary{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-link-primary,.cat-text-primary-hover{transition:color 125ms}.cat-link-primary:hover,.cat-text-primary-hover:hover{color:rgb(var(--cat-primary-text-hover, 1, 115, 132)) !important}.cat-link-primary:active,.cat-text-primary-hover:active{color:rgb(var(--cat-primary-text-active, 2, 99, 113)) !important}.cat-bg-primaryInverted{background-color:#93b4f2 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-bg-primaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-primaryInverted-hover:hover{background-color:#93b4f2 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-text-primaryInverted,.cat-link-primaryInverted{color:#93b4f2 !important}.cat-link-primaryInverted,.cat-text-primaryInverted-hover{transition:color 125ms}.cat-link-primaryInverted:hover,.cat-text-primaryInverted-hover:hover{color:#93b4f2 !important}.cat-link-primaryInverted:active,.cat-text-primaryInverted-hover:active{color:#93b4f2 !important}.cat-bg-secondary{background-color:rgb(var(--cat-secondary-bg, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-secondary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-secondary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-secondary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-secondary-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondary-hover:hover{background-color:rgb(var(--cat-secondary-bg-hover, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-secondary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-secondary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-secondary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-secondary,.cat-link-secondary{color:rgb(var(--cat-secondary-text, 0, 0, 0)) !important}.cat-link-secondary,.cat-text-secondary-hover{transition:color 125ms}.cat-link-secondary:hover,.cat-text-secondary-hover:hover{color:rgb(var(--cat-secondary-text-hover, 0, 0, 0)) !important}.cat-link-secondary:active,.cat-text-secondary-hover:active{color:rgb(var(--cat-secondary-text-active, 0, 0, 0)) !important}.cat-bg-secondaryInverted{background-color:#697687 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-bg-secondaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondaryInverted-hover:hover{background-color:#697687 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-text-secondaryInverted,.cat-link-secondaryInverted{color:white !important}.cat-link-secondaryInverted,.cat-text-secondaryInverted-hover{transition:color 125ms}.cat-link-secondaryInverted:hover,.cat-text-secondaryInverted-hover:hover{color:white !important}.cat-link-secondaryInverted:active,.cat-text-secondaryInverted-hover:active{color:white !important}.cat-bg-info{background-color:rgb(var(--cat-info-bg, 0, 115, 230)) !important;color:rgb(var(--cat-info-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-info-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-info-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-info-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-info-hover{transition:background-color 125ms, color 125ms}.cat-bg-info-hover:hover{background-color:rgb(var(--cat-info-bg-hover, 0, 107, 227)) !important;color:rgb(var(--cat-info-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-info-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-info-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-info-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-info,.cat-link-info{color:rgb(var(--cat-info-text, 0, 115, 230)) !important}.cat-link-info,.cat-text-info-hover{transition:color 125ms}.cat-link-info:hover,.cat-text-info-hover:hover{color:rgb(var(--cat-info-text-hover, 0, 107, 227)) !important}.cat-link-info:active,.cat-text-info-hover:active{color:rgb(var(--cat-info-text-active, 0, 96, 223)) !important}.cat-bg-success{background-color:rgb(var(--cat-success-bg, 0, 132, 88)) !important;color:rgb(var(--cat-success-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-success-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-success-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-success-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-success-hover{transition:background-color 125ms, color 125ms}.cat-bg-success-hover:hover{background-color:rgb(var(--cat-success-bg-hover, 0, 117, 78)) !important;color:rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-success-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-success-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-success-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-success,.cat-link-success{color:rgb(var(--cat-success-text, 0, 132, 88)) !important}.cat-link-success,.cat-text-success-hover{transition:color 125ms}.cat-link-success:hover,.cat-text-success-hover:hover{color:rgb(var(--cat-success-text-hover, 0, 117, 78)) !important}.cat-link-success:active,.cat-text-success-hover:active{color:rgb(var(--cat-success-text-active, 0, 105, 70)) !important}.cat-bg-warning{background-color:rgb(var(--cat-warning-bg, 255, 206, 128)) !important;color:rgb(var(--cat-warning-fill, 0, 0, 0)) !important;--cat-primary-text:var(--cat-warning-fill, 0, 0, 0);--cat-primary-text-hover:var(--cat-warning-fill-hover, 0, 0, 0);--cat-primary-text-active:var(--cat-warning-fill-active, 0, 0, 0);--cat-link-decoration:underline}.cat-bg-warning-hover{transition:background-color 125ms, color 125ms}.cat-bg-warning-hover:hover{background-color:rgb(var(--cat-warning-bg-hover, 255, 214, 148)) !important;color:rgb(var(--cat-warning-fill-hover, 0, 0, 0)) !important;--cat-primary-text:var(--cat-warning-fill, 0, 0, 0);--cat-primary-text-hover:var(--cat-warning-fill-hover, 0, 0, 0);--cat-primary-text-active:var(--cat-warning-fill-active, 0, 0, 0);--cat-link-decoration:underline}.cat-text-warning,.cat-link-warning{color:rgb(var(--cat-warning-text, 159, 97, 0)) !important}.cat-link-warning,.cat-text-warning-hover{transition:color 125ms}.cat-link-warning:hover,.cat-text-warning-hover:hover{color:rgb(var(--cat-warning-text-hover, 159, 97, 0)) !important}.cat-link-warning:active,.cat-text-warning-hover:active{color:rgb(var(--cat-warning-text-active, 159, 97, 0)) !important}.cat-bg-danger{background-color:rgb(var(--cat-danger-bg, 217, 52, 13)) !important;color:rgb(var(--cat-danger-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-danger-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-danger-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-danger-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-danger-hover{transition:background-color 125ms, color 125ms}.cat-bg-danger-hover:hover{background-color:rgb(var(--cat-danger-bg-hover, 194, 46, 11)) !important;color:rgb(var(--cat-danger-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-danger-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-danger-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-danger-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-danger,.cat-link-danger{color:rgb(var(--cat-danger-text, 217, 52, 13)) !important}.cat-link-danger,.cat-text-danger-hover{transition:color 125ms}.cat-link-danger:hover,.cat-text-danger-hover:hover{color:rgb(var(--cat-danger-text-hover, 194, 46, 11)) !important}.cat-link-danger:active,.cat-text-danger-hover:active{color:rgb(var(--cat-danger-text-active, 174, 42, 10)) !important}.cat-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-text-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-text-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-bg-muted{background-color:#f2f4f7 !important}.cat-text-reset{color:inherit !important}.cat-link-reset{color:inherit !important;text-decoration:inherit !important}.label{overflow:hidden;word-wrap:break-word;word-break:break-word}.input-field:not(.input-horizontal) .label-container.hidden,.textarea-field:not(.textarea-horizontal) .label-container.hidden,.select-field:not(.select-horizontal) .label-container.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.label-container{flex-basis:var(--label-size, 33.33%)}.label-container .label-wrapper{display:flex;gap:0.25rem}.label-metadata{display:flex;flex-shrink:0;flex-grow:1;justify-content:space-between;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.label-optional,.label-character-count{display:inline-flex;align-items:center;max-height:1.25rem;font-size:0.75rem;line-height:1rem}.label-character-count{margin-left:auto}.input-horizontal .label-container.hidden label,.textarea-horizontal .label-container.hidden label,.select-horizontal .label-container.hidden label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-horizontal .label-wrapper,.textarea-horizontal .label-wrapper,.select-horizontal .label-wrapper{flex-direction:column}.input-horizontal label,.textarea-horizontal label,.select-horizontal label{min-height:2.5rem;display:inline-flex;align-items:center}.input-horizontal .label-metadata,.textarea-horizontal .label-metadata,.select-horizontal .label-metadata{justify-content:flex-start}.input-horizontal .label-metadata .label-character-count,.textarea-horizontal .label-metadata .label-character-count,.select-horizontal .label-metadata .label-character-count{margin-left:0}:host{display:flex;font-size:0.9375rem;line-height:1.25rem}:host([hidden]){display:none}.input-field,.input-container{display:flex;flex-direction:column;gap:0.5rem;flex:1 1 auto}.input-field.input-horizontal{flex-direction:row;gap:1rem}.input-wrapper{display:flex;align-items:stretch;gap:0.75rem;padding:0 0.75rem;height:2.5rem;overflow:hidden;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:inset 0 0 0 1px rgb(var(--border-color));transition:box-shadow 125ms linear;--border-color:var(--cat-border-color-dark, 215, 219, 224);}.input-wrapper.input-round{border-radius:10rem}.input-wrapper.input-readonly{pointer-events:none}.input-wrapper.input-disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.input-wrapper:not(.input-disabled):hover{box-shadow:inset 0 0 0 1px rgb(var(--border-color)), 0 0 0 1px rgb(var(--border-color))}.input-wrapper:focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-1px}.input-wrapper.input-invalid{--border-color:var(--cat-danger-bg, 217, 52, 13), 0.2}.input-wrapper:has(input:-webkit-autofill),.input-wrapper:has(input:-webkit-autofill):hover,.input-wrapper:has(input:-webkit-autofill):focus{background-color:#e8f0fe}.text-prefix,.text-suffix{display:inline-flex;align-items:center;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.text-prefix{border-right:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));padding-right:0.75rem}.text-suffix{border-left:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));padding-left:0.75rem}.icon-prefix,.icon-suffix{align-self:center}.input-inner-wrapper{display:flex;align-items:center;position:relative;flex:1 1 auto}input{font:inherit;margin:0;padding:0;width:100%;min-width:0;border:none;outline:none;background:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.input-disabled input{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}input.has-clearable,input.has-toggle-password{padding-right:1.5rem}input.has-clearable.has-toggle-password{padding-right:3.5rem}input::placeholder{color:rgb(var(--cat-font-color-muted, 81, 92, 108))}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus{-webkit-box-shadow:0 0 0 9999px #e8f0fe inset}.clearable{position:absolute;top:calc(50% - 1rem);right:-0.5rem}.toggle-password{position:absolute;top:calc(50% - 1rem);right:-0.5rem}.has-clearable~.toggle-password{right:1.5rem}";
7614
- const CatInputStyle0 = catInputCss;
8012
+ NumeralFormatter.groupStyle = {
8013
+ thousand: 'thousand',
8014
+ lakh: 'lakh',
8015
+ wan: 'wan',
8016
+ none: 'none'
8017
+ };
7615
8018
 
7616
- let nextUniqueId$6 = 0;
7617
- const CatInput = class {
7618
- constructor(hostRef) {
7619
- registerInstance(this, hostRef);
7620
- this.catChange = createEvent(this, "catChange", 7);
7621
- this.catFocus = createEvent(this, "catFocus", 7);
7622
- this.catBlur = createEvent(this, "catBlur", 7);
7623
- this._id = `cat-input-${nextUniqueId$6++}`;
7624
- this.hasSlottedLabel = false;
7625
- this.hasSlottedHint = false;
7626
- this.isPasswordShown = false;
7627
- this.errorMap = undefined;
7628
- this.requiredMarker = 'optional';
7629
- this.horizontal = false;
7630
- this.autoComplete = undefined;
7631
- this.clearable = false;
7632
- this.togglePassword = false;
7633
- this.disabled = false;
7634
- this.hint = undefined;
7635
- this.icon = undefined;
7636
- this.iconRight = false;
7637
- this.identifier = undefined;
7638
- this.label = '';
7639
- this.labelHidden = false;
7640
- this.max = undefined;
7641
- this.maxLength = undefined;
7642
- this.min = undefined;
7643
- this.minLength = undefined;
7644
- this.name = undefined;
7645
- this.placeholder = undefined;
7646
- this.textPrefix = undefined;
7647
- this.textSuffix = undefined;
7648
- this.readonly = false;
7649
- this.required = false;
7650
- this.round = false;
7651
- this.type = 'text';
7652
- this.value = undefined;
7653
- this.errors = undefined;
7654
- this.errorUpdate = 0;
7655
- this.nativeAttributes = undefined;
7656
- }
7657
- get id() {
7658
- return this.identifier || this._id;
7659
- }
7660
- componentWillRender() {
7661
- this.onErrorsChanged(this.errors);
7662
- this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
7663
- this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
7664
- if (!this.label && !this.hasSlottedLabel) {
7665
- log.warn('[A11y] Missing ARIA label on input', this);
8019
+ NumeralFormatter.prototype = {
8020
+ getRawValue: function (value) {
8021
+ return value.replace(this.delimiterRE, '').replace(this.numeralDecimalMark, '.');
8022
+ },
8023
+
8024
+ format: function (value) {
8025
+ var owner = this, parts, partSign, partSignAndPrefix, partInteger, partDecimal = '';
8026
+
8027
+ // strip alphabet letters
8028
+ value = value.replace(/[A-Za-z]/g, '')
8029
+ // replace the first decimal mark with reserved placeholder
8030
+ .replace(owner.numeralDecimalMark, 'M')
8031
+
8032
+ // strip non numeric letters except minus and "M"
8033
+ // this is to ensure prefix has been stripped
8034
+ .replace(/[^\dM-]/g, '')
8035
+
8036
+ // replace the leading minus with reserved placeholder
8037
+ .replace(/^\-/, 'N')
8038
+
8039
+ // strip the other minus sign (if present)
8040
+ .replace(/\-/g, '')
8041
+
8042
+ // replace the minus sign (if present)
8043
+ .replace('N', owner.numeralPositiveOnly ? '' : '-')
8044
+
8045
+ // replace decimal mark
8046
+ .replace('M', owner.numeralDecimalMark);
8047
+
8048
+ // strip any leading zeros
8049
+ if (owner.stripLeadingZeroes) {
8050
+ value = value.replace(/^(-)?0+(?=\d)/, '$1');
8051
+ }
8052
+
8053
+ partSign = value.slice(0, 1) === '-' ? '-' : '';
8054
+ if (typeof owner.prefix != 'undefined') {
8055
+ if (owner.signBeforePrefix) {
8056
+ partSignAndPrefix = partSign + owner.prefix;
8057
+ } else {
8058
+ partSignAndPrefix = owner.prefix + partSign;
8059
+ }
8060
+ } else {
8061
+ partSignAndPrefix = partSign;
8062
+ }
8063
+
8064
+ partInteger = value;
8065
+
8066
+ if (value.indexOf(owner.numeralDecimalMark) >= 0) {
8067
+ parts = value.split(owner.numeralDecimalMark);
8068
+ partInteger = parts[0];
8069
+ partDecimal = owner.numeralDecimalMark + parts[1].slice(0, owner.numeralDecimalScale);
8070
+ }
8071
+
8072
+ if(partSign === '-') {
8073
+ partInteger = partInteger.slice(1);
8074
+ }
8075
+
8076
+ if (owner.numeralIntegerScale > 0) {
8077
+ partInteger = partInteger.slice(0, owner.numeralIntegerScale);
8078
+ }
8079
+
8080
+ switch (owner.numeralThousandsGroupStyle) {
8081
+ case NumeralFormatter.groupStyle.lakh:
8082
+ partInteger = partInteger.replace(/(\d)(?=(\d\d)+\d$)/g, '$1' + owner.delimiter);
8083
+
8084
+ break;
8085
+
8086
+ case NumeralFormatter.groupStyle.wan:
8087
+ partInteger = partInteger.replace(/(\d)(?=(\d{4})+$)/g, '$1' + owner.delimiter);
8088
+
8089
+ break;
8090
+
8091
+ case NumeralFormatter.groupStyle.thousand:
8092
+ partInteger = partInteger.replace(/(\d)(?=(\d{3})+$)/g, '$1' + owner.delimiter);
8093
+
8094
+ break;
8095
+ }
8096
+
8097
+ if (owner.tailPrefix) {
8098
+ return partSign + partInteger.toString() + (owner.numeralDecimalScale > 0 ? partDecimal.toString() : '') + owner.prefix;
8099
+ }
8100
+
8101
+ return partSignAndPrefix + partInteger.toString() + (owner.numeralDecimalScale > 0 ? partDecimal.toString() : '');
8102
+ }
8103
+ };
8104
+
8105
+ var NumeralFormatter_1 = NumeralFormatter;
8106
+
8107
+ var DateFormatter = function (datePattern, dateMin, dateMax) {
8108
+ var owner = this;
8109
+
8110
+ owner.date = [];
8111
+ owner.blocks = [];
8112
+ owner.datePattern = datePattern;
8113
+ owner.dateMin = dateMin
8114
+ .split('-')
8115
+ .reverse()
8116
+ .map(function(x) {
8117
+ return parseInt(x, 10);
8118
+ });
8119
+ if (owner.dateMin.length === 2) owner.dateMin.unshift(0);
8120
+
8121
+ owner.dateMax = dateMax
8122
+ .split('-')
8123
+ .reverse()
8124
+ .map(function(x) {
8125
+ return parseInt(x, 10);
8126
+ });
8127
+ if (owner.dateMax.length === 2) owner.dateMax.unshift(0);
8128
+
8129
+ owner.initBlocks();
8130
+ };
8131
+
8132
+ DateFormatter.prototype = {
8133
+ initBlocks: function () {
8134
+ var owner = this;
8135
+ owner.datePattern.forEach(function (value) {
8136
+ if (value === 'Y') {
8137
+ owner.blocks.push(4);
8138
+ } else {
8139
+ owner.blocks.push(2);
8140
+ }
8141
+ });
8142
+ },
8143
+
8144
+ getISOFormatDate: function () {
8145
+ var owner = this,
8146
+ date = owner.date;
8147
+
8148
+ return date[2] ? (
8149
+ date[2] + '-' + owner.addLeadingZero(date[1]) + '-' + owner.addLeadingZero(date[0])
8150
+ ) : '';
8151
+ },
8152
+
8153
+ getBlocks: function () {
8154
+ return this.blocks;
8155
+ },
8156
+
8157
+ getValidatedDate: function (value) {
8158
+ var owner = this, result = '';
8159
+
8160
+ value = value.replace(/[^\d]/g, '');
8161
+
8162
+ owner.blocks.forEach(function (length, index) {
8163
+ if (value.length > 0) {
8164
+ var sub = value.slice(0, length),
8165
+ sub0 = sub.slice(0, 1),
8166
+ rest = value.slice(length);
8167
+
8168
+ switch (owner.datePattern[index]) {
8169
+ case 'd':
8170
+ if (sub === '00') {
8171
+ sub = '01';
8172
+ } else if (parseInt(sub0, 10) > 3) {
8173
+ sub = '0' + sub0;
8174
+ } else if (parseInt(sub, 10) > 31) {
8175
+ sub = '31';
8176
+ }
8177
+
8178
+ break;
8179
+
8180
+ case 'm':
8181
+ if (sub === '00') {
8182
+ sub = '01';
8183
+ } else if (parseInt(sub0, 10) > 1) {
8184
+ sub = '0' + sub0;
8185
+ } else if (parseInt(sub, 10) > 12) {
8186
+ sub = '12';
8187
+ }
8188
+
8189
+ break;
8190
+ }
8191
+
8192
+ result += sub;
8193
+
8194
+ // update remaining string
8195
+ value = rest;
8196
+ }
8197
+ });
8198
+
8199
+ return this.getFixedDateString(result);
8200
+ },
8201
+
8202
+ getFixedDateString: function (value) {
8203
+ var owner = this, datePattern = owner.datePattern, date = [],
8204
+ dayIndex = 0, monthIndex = 0, yearIndex = 0,
8205
+ dayStartIndex = 0, monthStartIndex = 0, yearStartIndex = 0,
8206
+ day, month, year, fullYearDone = false;
8207
+
8208
+ // mm-dd || dd-mm
8209
+ if (value.length === 4 && datePattern[0].toLowerCase() !== 'y' && datePattern[1].toLowerCase() !== 'y') {
8210
+ dayStartIndex = datePattern[0] === 'd' ? 0 : 2;
8211
+ monthStartIndex = 2 - dayStartIndex;
8212
+ day = parseInt(value.slice(dayStartIndex, dayStartIndex + 2), 10);
8213
+ month = parseInt(value.slice(monthStartIndex, monthStartIndex + 2), 10);
8214
+
8215
+ date = this.getFixedDate(day, month, 0);
8216
+ }
8217
+
8218
+ // yyyy-mm-dd || yyyy-dd-mm || mm-dd-yyyy || dd-mm-yyyy || dd-yyyy-mm || mm-yyyy-dd
8219
+ if (value.length === 8) {
8220
+ datePattern.forEach(function (type, index) {
8221
+ switch (type) {
8222
+ case 'd':
8223
+ dayIndex = index;
8224
+ break;
8225
+ case 'm':
8226
+ monthIndex = index;
8227
+ break;
8228
+ default:
8229
+ yearIndex = index;
8230
+ break;
8231
+ }
8232
+ });
8233
+
8234
+ yearStartIndex = yearIndex * 2;
8235
+ dayStartIndex = (dayIndex <= yearIndex) ? dayIndex * 2 : (dayIndex * 2 + 2);
8236
+ monthStartIndex = (monthIndex <= yearIndex) ? monthIndex * 2 : (monthIndex * 2 + 2);
8237
+
8238
+ day = parseInt(value.slice(dayStartIndex, dayStartIndex + 2), 10);
8239
+ month = parseInt(value.slice(monthStartIndex, monthStartIndex + 2), 10);
8240
+ year = parseInt(value.slice(yearStartIndex, yearStartIndex + 4), 10);
8241
+
8242
+ fullYearDone = value.slice(yearStartIndex, yearStartIndex + 4).length === 4;
8243
+
8244
+ date = this.getFixedDate(day, month, year);
8245
+ }
8246
+
8247
+ // mm-yy || yy-mm
8248
+ if (value.length === 4 && (datePattern[0] === 'y' || datePattern[1] === 'y')) {
8249
+ monthStartIndex = datePattern[0] === 'm' ? 0 : 2;
8250
+ yearStartIndex = 2 - monthStartIndex;
8251
+ month = parseInt(value.slice(monthStartIndex, monthStartIndex + 2), 10);
8252
+ year = parseInt(value.slice(yearStartIndex, yearStartIndex + 2), 10);
8253
+
8254
+ fullYearDone = value.slice(yearStartIndex, yearStartIndex + 2).length === 2;
8255
+
8256
+ date = [0, month, year];
8257
+ }
8258
+
8259
+ // mm-yyyy || yyyy-mm
8260
+ if (value.length === 6 && (datePattern[0] === 'Y' || datePattern[1] === 'Y')) {
8261
+ monthStartIndex = datePattern[0] === 'm' ? 0 : 4;
8262
+ yearStartIndex = 2 - 0.5 * monthStartIndex;
8263
+ month = parseInt(value.slice(monthStartIndex, monthStartIndex + 2), 10);
8264
+ year = parseInt(value.slice(yearStartIndex, yearStartIndex + 4), 10);
8265
+
8266
+ fullYearDone = value.slice(yearStartIndex, yearStartIndex + 4).length === 4;
8267
+
8268
+ date = [0, month, year];
8269
+ }
8270
+
8271
+ date = owner.getRangeFixedDate(date);
8272
+ owner.date = date;
8273
+
8274
+ var result = date.length === 0 ? value : datePattern.reduce(function (previous, current) {
8275
+ switch (current) {
8276
+ case 'd':
8277
+ return previous + (date[0] === 0 ? '' : owner.addLeadingZero(date[0]));
8278
+ case 'm':
8279
+ return previous + (date[1] === 0 ? '' : owner.addLeadingZero(date[1]));
8280
+ case 'y':
8281
+ return previous + (fullYearDone ? owner.addLeadingZeroForYear(date[2], false) : '');
8282
+ case 'Y':
8283
+ return previous + (fullYearDone ? owner.addLeadingZeroForYear(date[2], true) : '');
8284
+ }
8285
+ }, '');
8286
+
8287
+ return result;
8288
+ },
8289
+
8290
+ getRangeFixedDate: function (date) {
8291
+ var owner = this,
8292
+ datePattern = owner.datePattern,
8293
+ dateMin = owner.dateMin || [],
8294
+ dateMax = owner.dateMax || [];
8295
+
8296
+ if (!date.length || (dateMin.length < 3 && dateMax.length < 3)) return date;
8297
+
8298
+ if (
8299
+ datePattern.find(function(x) {
8300
+ return x.toLowerCase() === 'y';
8301
+ }) &&
8302
+ date[2] === 0
8303
+ ) return date;
8304
+
8305
+ if (dateMax.length && (dateMax[2] < date[2] || (
8306
+ dateMax[2] === date[2] && (dateMax[1] < date[1] || (
8307
+ dateMax[1] === date[1] && dateMax[0] < date[0]
8308
+ ))
8309
+ ))) return dateMax;
8310
+
8311
+ if (dateMin.length && (dateMin[2] > date[2] || (
8312
+ dateMin[2] === date[2] && (dateMin[1] > date[1] || (
8313
+ dateMin[1] === date[1] && dateMin[0] > date[0]
8314
+ ))
8315
+ ))) return dateMin;
8316
+
8317
+ return date;
8318
+ },
8319
+
8320
+ getFixedDate: function (day, month, year) {
8321
+ day = Math.min(day, 31);
8322
+ month = Math.min(month, 12);
8323
+ year = parseInt((year || 0), 10);
8324
+
8325
+ if ((month < 7 && month % 2 === 0) || (month > 8 && month % 2 === 1)) {
8326
+ day = Math.min(day, month === 2 ? (this.isLeapYear(year) ? 29 : 28) : 30);
8327
+ }
8328
+
8329
+ return [day, month, year];
8330
+ },
8331
+
8332
+ isLeapYear: function (year) {
8333
+ return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0);
8334
+ },
8335
+
8336
+ addLeadingZero: function (number) {
8337
+ return (number < 10 ? '0' : '') + number;
8338
+ },
8339
+
8340
+ addLeadingZeroForYear: function (number, fullYearMode) {
8341
+ if (fullYearMode) {
8342
+ return (number < 10 ? '000' : (number < 100 ? '00' : (number < 1000 ? '0' : ''))) + number;
8343
+ }
8344
+
8345
+ return (number < 10 ? '0' : '') + number;
8346
+ }
8347
+ };
8348
+
8349
+ var DateFormatter_1 = DateFormatter;
8350
+
8351
+ var TimeFormatter = function (timePattern, timeFormat) {
8352
+ var owner = this;
8353
+
8354
+ owner.time = [];
8355
+ owner.blocks = [];
8356
+ owner.timePattern = timePattern;
8357
+ owner.timeFormat = timeFormat;
8358
+ owner.initBlocks();
8359
+ };
8360
+
8361
+ TimeFormatter.prototype = {
8362
+ initBlocks: function () {
8363
+ var owner = this;
8364
+ owner.timePattern.forEach(function () {
8365
+ owner.blocks.push(2);
8366
+ });
8367
+ },
8368
+
8369
+ getISOFormatTime: function () {
8370
+ var owner = this,
8371
+ time = owner.time;
8372
+
8373
+ return time[2] ? (
8374
+ owner.addLeadingZero(time[0]) + ':' + owner.addLeadingZero(time[1]) + ':' + owner.addLeadingZero(time[2])
8375
+ ) : '';
8376
+ },
8377
+
8378
+ getBlocks: function () {
8379
+ return this.blocks;
8380
+ },
8381
+
8382
+ getTimeFormatOptions: function () {
8383
+ var owner = this;
8384
+ if (String(owner.timeFormat) === '12') {
8385
+ return {
8386
+ maxHourFirstDigit: 1,
8387
+ maxHours: 12,
8388
+ maxMinutesFirstDigit: 5,
8389
+ maxMinutes: 60
8390
+ };
8391
+ }
8392
+
8393
+ return {
8394
+ maxHourFirstDigit: 2,
8395
+ maxHours: 23,
8396
+ maxMinutesFirstDigit: 5,
8397
+ maxMinutes: 60
8398
+ };
8399
+ },
8400
+
8401
+ getValidatedTime: function (value) {
8402
+ var owner = this, result = '';
8403
+
8404
+ value = value.replace(/[^\d]/g, '');
8405
+
8406
+ var timeFormatOptions = owner.getTimeFormatOptions();
8407
+
8408
+ owner.blocks.forEach(function (length, index) {
8409
+ if (value.length > 0) {
8410
+ var sub = value.slice(0, length),
8411
+ sub0 = sub.slice(0, 1),
8412
+ rest = value.slice(length);
8413
+
8414
+ switch (owner.timePattern[index]) {
8415
+
8416
+ case 'h':
8417
+ if (parseInt(sub0, 10) > timeFormatOptions.maxHourFirstDigit) {
8418
+ sub = '0' + sub0;
8419
+ } else if (parseInt(sub, 10) > timeFormatOptions.maxHours) {
8420
+ sub = timeFormatOptions.maxHours + '';
8421
+ }
8422
+
8423
+ break;
8424
+
8425
+ case 'm':
8426
+ case 's':
8427
+ if (parseInt(sub0, 10) > timeFormatOptions.maxMinutesFirstDigit) {
8428
+ sub = '0' + sub0;
8429
+ } else if (parseInt(sub, 10) > timeFormatOptions.maxMinutes) {
8430
+ sub = timeFormatOptions.maxMinutes + '';
8431
+ }
8432
+ break;
8433
+ }
8434
+
8435
+ result += sub;
8436
+
8437
+ // update remaining string
8438
+ value = rest;
8439
+ }
8440
+ });
8441
+
8442
+ return this.getFixedTimeString(result);
8443
+ },
8444
+
8445
+ getFixedTimeString: function (value) {
8446
+ var owner = this, timePattern = owner.timePattern, time = [],
8447
+ secondIndex = 0, minuteIndex = 0, hourIndex = 0,
8448
+ secondStartIndex = 0, minuteStartIndex = 0, hourStartIndex = 0,
8449
+ second, minute, hour;
8450
+
8451
+ if (value.length === 6) {
8452
+ timePattern.forEach(function (type, index) {
8453
+ switch (type) {
8454
+ case 's':
8455
+ secondIndex = index * 2;
8456
+ break;
8457
+ case 'm':
8458
+ minuteIndex = index * 2;
8459
+ break;
8460
+ case 'h':
8461
+ hourIndex = index * 2;
8462
+ break;
8463
+ }
8464
+ });
8465
+
8466
+ hourStartIndex = hourIndex;
8467
+ minuteStartIndex = minuteIndex;
8468
+ secondStartIndex = secondIndex;
8469
+
8470
+ second = parseInt(value.slice(secondStartIndex, secondStartIndex + 2), 10);
8471
+ minute = parseInt(value.slice(minuteStartIndex, minuteStartIndex + 2), 10);
8472
+ hour = parseInt(value.slice(hourStartIndex, hourStartIndex + 2), 10);
8473
+
8474
+ time = this.getFixedTime(hour, minute, second);
8475
+ }
8476
+
8477
+ if (value.length === 4 && owner.timePattern.indexOf('s') < 0) {
8478
+ timePattern.forEach(function (type, index) {
8479
+ switch (type) {
8480
+ case 'm':
8481
+ minuteIndex = index * 2;
8482
+ break;
8483
+ case 'h':
8484
+ hourIndex = index * 2;
8485
+ break;
8486
+ }
8487
+ });
8488
+
8489
+ hourStartIndex = hourIndex;
8490
+ minuteStartIndex = minuteIndex;
8491
+
8492
+ second = 0;
8493
+ minute = parseInt(value.slice(minuteStartIndex, minuteStartIndex + 2), 10);
8494
+ hour = parseInt(value.slice(hourStartIndex, hourStartIndex + 2), 10);
8495
+
8496
+ time = this.getFixedTime(hour, minute, second);
8497
+ }
8498
+
8499
+ owner.time = time;
8500
+
8501
+ return time.length === 0 ? value : timePattern.reduce(function (previous, current) {
8502
+ switch (current) {
8503
+ case 's':
8504
+ return previous + owner.addLeadingZero(time[2]);
8505
+ case 'm':
8506
+ return previous + owner.addLeadingZero(time[1]);
8507
+ case 'h':
8508
+ return previous + owner.addLeadingZero(time[0]);
8509
+ }
8510
+ }, '');
8511
+ },
8512
+
8513
+ getFixedTime: function (hour, minute, second) {
8514
+ second = Math.min(parseInt(second || 0, 10), 60);
8515
+ minute = Math.min(minute, 60);
8516
+ hour = Math.min(hour, 60);
8517
+
8518
+ return [hour, minute, second];
8519
+ },
8520
+
8521
+ addLeadingZero: function (number) {
8522
+ return (number < 10 ? '0' : '') + number;
8523
+ }
8524
+ };
8525
+
8526
+ var TimeFormatter_1 = TimeFormatter;
8527
+
8528
+ var PhoneFormatter = function (formatter, delimiter) {
8529
+ var owner = this;
8530
+
8531
+ owner.delimiter = (delimiter || delimiter === '') ? delimiter : ' ';
8532
+ owner.delimiterRE = delimiter ? new RegExp('\\' + delimiter, 'g') : '';
8533
+
8534
+ owner.formatter = formatter;
8535
+ };
8536
+
8537
+ PhoneFormatter.prototype = {
8538
+ setFormatter: function (formatter) {
8539
+ this.formatter = formatter;
8540
+ },
8541
+
8542
+ format: function (phoneNumber) {
8543
+ var owner = this;
8544
+
8545
+ owner.formatter.clear();
8546
+
8547
+ // only keep number and +
8548
+ phoneNumber = phoneNumber.replace(/[^\d+]/g, '');
8549
+
8550
+ // strip non-leading +
8551
+ phoneNumber = phoneNumber.replace(/^\+/, 'B').replace(/\+/g, '').replace('B', '+');
8552
+
8553
+ // strip delimiter
8554
+ phoneNumber = phoneNumber.replace(owner.delimiterRE, '');
8555
+
8556
+ var result = '', current, validated = false;
8557
+
8558
+ for (var i = 0, iMax = phoneNumber.length; i < iMax; i++) {
8559
+ current = owner.formatter.inputDigit(phoneNumber.charAt(i));
8560
+
8561
+ // has ()- or space inside
8562
+ if (/[\s()-]/g.test(current)) {
8563
+ result = current;
8564
+
8565
+ validated = true;
8566
+ } else {
8567
+ if (!validated) {
8568
+ result = current;
8569
+ }
8570
+ // else: over length input
8571
+ // it turns to invalid number again
8572
+ }
8573
+ }
8574
+
8575
+ // strip ()
8576
+ // e.g. US: 7161234567 returns (716) 123-4567
8577
+ result = result.replace(/[()]/g, '');
8578
+ // replace library delimiter with user customized delimiter
8579
+ result = result.replace(/[\s-]/g, owner.delimiter);
8580
+
8581
+ return result;
8582
+ }
8583
+ };
8584
+
8585
+ var PhoneFormatter_1 = PhoneFormatter;
8586
+
8587
+ var CreditCardDetector = {
8588
+ blocks: {
8589
+ uatp: [4, 5, 6],
8590
+ amex: [4, 6, 5],
8591
+ diners: [4, 6, 4],
8592
+ discover: [4, 4, 4, 4],
8593
+ mastercard: [4, 4, 4, 4],
8594
+ dankort: [4, 4, 4, 4],
8595
+ instapayment: [4, 4, 4, 4],
8596
+ jcb15: [4, 6, 5],
8597
+ jcb: [4, 4, 4, 4],
8598
+ maestro: [4, 4, 4, 4],
8599
+ visa: [4, 4, 4, 4],
8600
+ mir: [4, 4, 4, 4],
8601
+ unionPay: [4, 4, 4, 4],
8602
+ general: [4, 4, 4, 4]
8603
+ },
8604
+
8605
+ re: {
8606
+ // starts with 1; 15 digits, not starts with 1800 (jcb card)
8607
+ uatp: /^(?!1800)1\d{0,14}/,
8608
+
8609
+ // starts with 34/37; 15 digits
8610
+ amex: /^3[47]\d{0,13}/,
8611
+
8612
+ // starts with 6011/65/644-649; 16 digits
8613
+ discover: /^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,
8614
+
8615
+ // starts with 300-305/309 or 36/38/39; 14 digits
8616
+ diners: /^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,
8617
+
8618
+ // starts with 51-55/2221–2720; 16 digits
8619
+ mastercard: /^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,
8620
+
8621
+ // starts with 5019/4175/4571; 16 digits
8622
+ dankort: /^(5019|4175|4571)\d{0,12}/,
8623
+
8624
+ // starts with 637-639; 16 digits
8625
+ instapayment: /^63[7-9]\d{0,13}/,
8626
+
8627
+ // starts with 2131/1800; 15 digits
8628
+ jcb15: /^(?:2131|1800)\d{0,11}/,
8629
+
8630
+ // starts with 2131/1800/35; 16 digits
8631
+ jcb: /^(?:35\d{0,2})\d{0,12}/,
8632
+
8633
+ // starts with 50/56-58/6304/67; 16 digits
8634
+ maestro: /^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,
8635
+
8636
+ // starts with 22; 16 digits
8637
+ mir: /^220[0-4]\d{0,12}/,
8638
+
8639
+ // starts with 4; 16 digits
8640
+ visa: /^4\d{0,15}/,
8641
+
8642
+ // starts with 62/81; 16 digits
8643
+ unionPay: /^(62|81)\d{0,14}/
8644
+ },
8645
+
8646
+ getStrictBlocks: function (block) {
8647
+ var total = block.reduce(function (prev, current) {
8648
+ return prev + current;
8649
+ }, 0);
8650
+
8651
+ return block.concat(19 - total);
8652
+ },
8653
+
8654
+ getInfo: function (value, strictMode) {
8655
+ var blocks = CreditCardDetector.blocks,
8656
+ re = CreditCardDetector.re;
8657
+
8658
+ // Some credit card can have up to 19 digits number.
8659
+ // Set strictMode to true will remove the 16 max-length restrain,
8660
+ // however, I never found any website validate card number like
8661
+ // this, hence probably you don't want to enable this option.
8662
+ strictMode = !!strictMode;
8663
+
8664
+ for (var key in re) {
8665
+ if (re[key].test(value)) {
8666
+ var matchedBlocks = blocks[key];
8667
+ return {
8668
+ type: key,
8669
+ blocks: strictMode ? this.getStrictBlocks(matchedBlocks) : matchedBlocks
8670
+ };
8671
+ }
8672
+ }
8673
+
8674
+ return {
8675
+ type: 'unknown',
8676
+ blocks: strictMode ? this.getStrictBlocks(blocks.general) : blocks.general
8677
+ };
8678
+ }
8679
+ };
8680
+
8681
+ var CreditCardDetector_1 = CreditCardDetector;
8682
+
8683
+ var Util = {
8684
+ noop: function () {
8685
+ },
8686
+
8687
+ strip: function (value, re) {
8688
+ return value.replace(re, '');
8689
+ },
8690
+
8691
+ getPostDelimiter: function (value, delimiter, delimiters) {
8692
+ // single delimiter
8693
+ if (delimiters.length === 0) {
8694
+ return value.slice(-delimiter.length) === delimiter ? delimiter : '';
8695
+ }
8696
+
8697
+ // multiple delimiters
8698
+ var matchedDelimiter = '';
8699
+ delimiters.forEach(function (current) {
8700
+ if (value.slice(-current.length) === current) {
8701
+ matchedDelimiter = current;
8702
+ }
8703
+ });
8704
+
8705
+ return matchedDelimiter;
8706
+ },
8707
+
8708
+ getDelimiterREByDelimiter: function (delimiter) {
8709
+ return new RegExp(delimiter.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1'), 'g');
8710
+ },
8711
+
8712
+ getNextCursorPosition: function (prevPos, oldValue, newValue, delimiter, delimiters) {
8713
+ // If cursor was at the end of value, just place it back.
8714
+ // Because new value could contain additional chars.
8715
+ if (oldValue.length === prevPos) {
8716
+ return newValue.length;
8717
+ }
8718
+
8719
+ return prevPos + this.getPositionOffset(prevPos, oldValue, newValue, delimiter ,delimiters);
8720
+ },
8721
+
8722
+ getPositionOffset: function (prevPos, oldValue, newValue, delimiter, delimiters) {
8723
+ var oldRawValue, newRawValue, lengthOffset;
8724
+
8725
+ oldRawValue = this.stripDelimiters(oldValue.slice(0, prevPos), delimiter, delimiters);
8726
+ newRawValue = this.stripDelimiters(newValue.slice(0, prevPos), delimiter, delimiters);
8727
+ lengthOffset = oldRawValue.length - newRawValue.length;
8728
+
8729
+ return (lengthOffset !== 0) ? (lengthOffset / Math.abs(lengthOffset)) : 0;
8730
+ },
8731
+
8732
+ stripDelimiters: function (value, delimiter, delimiters) {
8733
+ var owner = this;
8734
+
8735
+ // single delimiter
8736
+ if (delimiters.length === 0) {
8737
+ var delimiterRE = delimiter ? owner.getDelimiterREByDelimiter(delimiter) : '';
8738
+
8739
+ return value.replace(delimiterRE, '');
8740
+ }
8741
+
8742
+ // multiple delimiters
8743
+ delimiters.forEach(function (current) {
8744
+ current.split('').forEach(function (letter) {
8745
+ value = value.replace(owner.getDelimiterREByDelimiter(letter), '');
8746
+ });
8747
+ });
8748
+
8749
+ return value;
8750
+ },
8751
+
8752
+ headStr: function (str, length) {
8753
+ return str.slice(0, length);
8754
+ },
8755
+
8756
+ getMaxLength: function (blocks) {
8757
+ return blocks.reduce(function (previous, current) {
8758
+ return previous + current;
8759
+ }, 0);
8760
+ },
8761
+
8762
+ // strip prefix
8763
+ // Before type | After type | Return value
8764
+ // PEFIX-... | PEFIX-... | ''
8765
+ // PREFIX-123 | PEFIX-123 | 123
8766
+ // PREFIX-123 | PREFIX-23 | 23
8767
+ // PREFIX-123 | PREFIX-1234 | 1234
8768
+ getPrefixStrippedValue: function (value, prefix, prefixLength, prevResult, delimiter, delimiters, noImmediatePrefix, tailPrefix, signBeforePrefix) {
8769
+ // No prefix
8770
+ if (prefixLength === 0) {
8771
+ return value;
8772
+ }
8773
+
8774
+ // Value is prefix
8775
+ if (value === prefix && value !== '') {
8776
+ return '';
8777
+ }
8778
+
8779
+ if (signBeforePrefix && (value.slice(0, 1) == '-')) {
8780
+ var prev = (prevResult.slice(0, 1) == '-') ? prevResult.slice(1) : prevResult;
8781
+ return '-' + this.getPrefixStrippedValue(value.slice(1), prefix, prefixLength, prev, delimiter, delimiters, noImmediatePrefix, tailPrefix, signBeforePrefix);
8782
+ }
8783
+
8784
+ // Pre result prefix string does not match pre-defined prefix
8785
+ if (prevResult.slice(0, prefixLength) !== prefix && !tailPrefix) {
8786
+ // Check if the first time user entered something
8787
+ if (noImmediatePrefix && !prevResult && value) return value;
8788
+ return '';
8789
+ } else if (prevResult.slice(-prefixLength) !== prefix && tailPrefix) {
8790
+ // Check if the first time user entered something
8791
+ if (noImmediatePrefix && !prevResult && value) return value;
8792
+ return '';
8793
+ }
8794
+
8795
+ var prevValue = this.stripDelimiters(prevResult, delimiter, delimiters);
8796
+
8797
+ // New value has issue, someone typed in between prefix letters
8798
+ // Revert to pre value
8799
+ if (value.slice(0, prefixLength) !== prefix && !tailPrefix) {
8800
+ return prevValue.slice(prefixLength);
8801
+ } else if (value.slice(-prefixLength) !== prefix && tailPrefix) {
8802
+ return prevValue.slice(0, -prefixLength - 1);
8803
+ }
8804
+
8805
+ // No issue, strip prefix for new value
8806
+ return tailPrefix ? value.slice(0, -prefixLength) : value.slice(prefixLength);
8807
+ },
8808
+
8809
+ getFirstDiffIndex: function (prev, current) {
8810
+ var index = 0;
8811
+
8812
+ while (prev.charAt(index) === current.charAt(index)) {
8813
+ if (prev.charAt(index++) === '') {
8814
+ return -1;
8815
+ }
8816
+ }
8817
+
8818
+ return index;
8819
+ },
8820
+
8821
+ getFormattedValue: function (value, blocks, blocksLength, delimiter, delimiters, delimiterLazyShow) {
8822
+ var result = '',
8823
+ multipleDelimiters = delimiters.length > 0,
8824
+ currentDelimiter = '';
8825
+
8826
+ // no options, normal input
8827
+ if (blocksLength === 0) {
8828
+ return value;
8829
+ }
8830
+
8831
+ blocks.forEach(function (length, index) {
8832
+ if (value.length > 0) {
8833
+ var sub = value.slice(0, length),
8834
+ rest = value.slice(length);
8835
+
8836
+ if (multipleDelimiters) {
8837
+ currentDelimiter = delimiters[delimiterLazyShow ? (index - 1) : index] || currentDelimiter;
8838
+ } else {
8839
+ currentDelimiter = delimiter;
8840
+ }
8841
+
8842
+ if (delimiterLazyShow) {
8843
+ if (index > 0) {
8844
+ result += currentDelimiter;
8845
+ }
8846
+
8847
+ result += sub;
8848
+ } else {
8849
+ result += sub;
8850
+
8851
+ if (sub.length === length && index < blocksLength - 1) {
8852
+ result += currentDelimiter;
8853
+ }
8854
+ }
8855
+
8856
+ // update remaining string
8857
+ value = rest;
8858
+ }
8859
+ });
8860
+
8861
+ return result;
8862
+ },
8863
+
8864
+ // move cursor to the end
8865
+ // the first time user focuses on an input with prefix
8866
+ fixPrefixCursor: function (el, prefix, delimiter, delimiters) {
8867
+ if (!el) {
8868
+ return;
8869
+ }
8870
+
8871
+ var val = el.value,
8872
+ appendix = delimiter || (delimiters[0] || ' ');
8873
+
8874
+ if (!el.setSelectionRange || !prefix || (prefix.length + appendix.length) <= val.length) {
8875
+ return;
8876
+ }
8877
+
8878
+ var len = val.length * 2;
8879
+
8880
+ // set timeout to avoid blink
8881
+ setTimeout(function () {
8882
+ el.setSelectionRange(len, len);
8883
+ }, 1);
8884
+ },
8885
+
8886
+ // Check if input field is fully selected
8887
+ checkFullSelection: function(value) {
8888
+ try {
8889
+ var selection = window.getSelection() || document.getSelection() || {};
8890
+ return selection.toString().length === value.length;
8891
+ } catch (ex) {
8892
+ // Ignore
8893
+ }
8894
+
8895
+ return false;
8896
+ },
8897
+
8898
+ setSelection: function (element, position, doc) {
8899
+ if (element !== this.getActiveElement(doc)) {
8900
+ return;
8901
+ }
8902
+
8903
+ // cursor is already in the end
8904
+ if (element && element.value.length <= position) {
8905
+ return;
8906
+ }
8907
+
8908
+ if (element.createTextRange) {
8909
+ var range = element.createTextRange();
8910
+
8911
+ range.move('character', position);
8912
+ range.select();
8913
+ } else {
8914
+ try {
8915
+ element.setSelectionRange(position, position);
8916
+ } catch (e) {
8917
+ // eslint-disable-next-line
8918
+ console.warn('The input element type does not support selection');
8919
+ }
8920
+ }
8921
+ },
8922
+
8923
+ getActiveElement: function(parent) {
8924
+ var activeElement = parent.activeElement;
8925
+ if (activeElement && activeElement.shadowRoot) {
8926
+ return this.getActiveElement(activeElement.shadowRoot);
8927
+ }
8928
+ return activeElement;
8929
+ },
8930
+
8931
+ isAndroid: function () {
8932
+ return navigator && /android/i.test(navigator.userAgent);
8933
+ },
8934
+
8935
+ // On Android chrome, the keyup and keydown events
8936
+ // always return key code 229 as a composition that
8937
+ // buffers the user’s keystrokes
8938
+ // see https://github.com/nosir/cleave.js/issues/147
8939
+ isAndroidBackspaceKeydown: function (lastInputValue, currentInputValue) {
8940
+ if (!this.isAndroid() || !lastInputValue || !currentInputValue) {
8941
+ return false;
8942
+ }
8943
+
8944
+ return currentInputValue === lastInputValue.slice(0, -1);
8945
+ }
8946
+ };
8947
+
8948
+ var Util_1 = Util;
8949
+
8950
+ /**
8951
+ * Props Assignment
8952
+ *
8953
+ * Separate this, so react module can share the usage
8954
+ */
8955
+ var DefaultProperties = {
8956
+ // Maybe change to object-assign
8957
+ // for now just keep it as simple
8958
+ assign: function (target, opts) {
8959
+ target = target || {};
8960
+ opts = opts || {};
8961
+
8962
+ // credit card
8963
+ target.creditCard = !!opts.creditCard;
8964
+ target.creditCardStrictMode = !!opts.creditCardStrictMode;
8965
+ target.creditCardType = '';
8966
+ target.onCreditCardTypeChanged = opts.onCreditCardTypeChanged || (function () {});
8967
+
8968
+ // phone
8969
+ target.phone = !!opts.phone;
8970
+ target.phoneRegionCode = opts.phoneRegionCode || 'AU';
8971
+ target.phoneFormatter = {};
8972
+
8973
+ // time
8974
+ target.time = !!opts.time;
8975
+ target.timePattern = opts.timePattern || ['h', 'm', 's'];
8976
+ target.timeFormat = opts.timeFormat || '24';
8977
+ target.timeFormatter = {};
8978
+
8979
+ // date
8980
+ target.date = !!opts.date;
8981
+ target.datePattern = opts.datePattern || ['d', 'm', 'Y'];
8982
+ target.dateMin = opts.dateMin || '';
8983
+ target.dateMax = opts.dateMax || '';
8984
+ target.dateFormatter = {};
8985
+
8986
+ // numeral
8987
+ target.numeral = !!opts.numeral;
8988
+ target.numeralIntegerScale = opts.numeralIntegerScale > 0 ? opts.numeralIntegerScale : 0;
8989
+ target.numeralDecimalScale = opts.numeralDecimalScale >= 0 ? opts.numeralDecimalScale : 2;
8990
+ target.numeralDecimalMark = opts.numeralDecimalMark || '.';
8991
+ target.numeralThousandsGroupStyle = opts.numeralThousandsGroupStyle || 'thousand';
8992
+ target.numeralPositiveOnly = !!opts.numeralPositiveOnly;
8993
+ target.stripLeadingZeroes = opts.stripLeadingZeroes !== false;
8994
+ target.signBeforePrefix = !!opts.signBeforePrefix;
8995
+ target.tailPrefix = !!opts.tailPrefix;
8996
+
8997
+ // others
8998
+ target.swapHiddenInput = !!opts.swapHiddenInput;
8999
+
9000
+ target.numericOnly = target.creditCard || target.date || !!opts.numericOnly;
9001
+
9002
+ target.uppercase = !!opts.uppercase;
9003
+ target.lowercase = !!opts.lowercase;
9004
+
9005
+ target.prefix = (target.creditCard || target.date) ? '' : (opts.prefix || '');
9006
+ target.noImmediatePrefix = !!opts.noImmediatePrefix;
9007
+ target.prefixLength = target.prefix.length;
9008
+ target.rawValueTrimPrefix = !!opts.rawValueTrimPrefix;
9009
+ target.copyDelimiter = !!opts.copyDelimiter;
9010
+
9011
+ target.initValue = (opts.initValue !== undefined && opts.initValue !== null) ? opts.initValue.toString() : '';
9012
+
9013
+ target.delimiter =
9014
+ (opts.delimiter || opts.delimiter === '') ? opts.delimiter :
9015
+ (opts.date ? '/' :
9016
+ (opts.time ? ':' :
9017
+ (opts.numeral ? ',' :
9018
+ (opts.phone ? ' ' :
9019
+ ' '))));
9020
+ target.delimiterLength = target.delimiter.length;
9021
+ target.delimiterLazyShow = !!opts.delimiterLazyShow;
9022
+ target.delimiters = opts.delimiters || [];
9023
+
9024
+ target.blocks = opts.blocks || [];
9025
+ target.blocksLength = target.blocks.length;
9026
+
9027
+ target.root = (typeof commonjsGlobal === 'object' && commonjsGlobal) ? commonjsGlobal : window;
9028
+ target.document = opts.document || target.root.document;
9029
+
9030
+ target.maxLength = 0;
9031
+
9032
+ target.backspace = false;
9033
+ target.result = '';
9034
+
9035
+ target.onValueChanged = opts.onValueChanged || (function () {});
9036
+
9037
+ return target;
9038
+ }
9039
+ };
9040
+
9041
+ var DefaultProperties_1 = DefaultProperties;
9042
+
9043
+ /**
9044
+ * Construct a new Cleave instance by passing the configuration object
9045
+ *
9046
+ * @param {String | HTMLElement} element
9047
+ * @param {Object} opts
9048
+ */
9049
+ var Cleave = function (element, opts) {
9050
+ var owner = this;
9051
+ var hasMultipleElements = false;
9052
+
9053
+ if (typeof element === 'string') {
9054
+ owner.element = document.querySelector(element);
9055
+ hasMultipleElements = document.querySelectorAll(element).length > 1;
9056
+ } else {
9057
+ if (typeof element.length !== 'undefined' && element.length > 0) {
9058
+ owner.element = element[0];
9059
+ hasMultipleElements = element.length > 1;
9060
+ } else {
9061
+ owner.element = element;
9062
+ }
9063
+ }
9064
+
9065
+ if (!owner.element) {
9066
+ throw new Error('[cleave.js] Please check the element');
9067
+ }
9068
+
9069
+ if (hasMultipleElements) {
9070
+ try {
9071
+ // eslint-disable-next-line
9072
+ console.warn('[cleave.js] Multiple input fields matched, cleave.js will only take the first one.');
9073
+ } catch (e) {
9074
+ // Old IE
9075
+ }
9076
+ }
9077
+
9078
+ opts.initValue = owner.element.value;
9079
+
9080
+ owner.properties = Cleave.DefaultProperties.assign({}, opts);
9081
+
9082
+ owner.init();
9083
+ };
9084
+
9085
+ Cleave.prototype = {
9086
+ init: function () {
9087
+ var owner = this, pps = owner.properties;
9088
+
9089
+ // no need to use this lib
9090
+ if (!pps.numeral && !pps.phone && !pps.creditCard && !pps.time && !pps.date && (pps.blocksLength === 0 && !pps.prefix)) {
9091
+ owner.onInput(pps.initValue);
9092
+
9093
+ return;
9094
+ }
9095
+
9096
+ pps.maxLength = Cleave.Util.getMaxLength(pps.blocks);
9097
+
9098
+ owner.isAndroid = Cleave.Util.isAndroid();
9099
+ owner.lastInputValue = '';
9100
+ owner.isBackward = '';
9101
+
9102
+ owner.onChangeListener = owner.onChange.bind(owner);
9103
+ owner.onKeyDownListener = owner.onKeyDown.bind(owner);
9104
+ owner.onFocusListener = owner.onFocus.bind(owner);
9105
+ owner.onCutListener = owner.onCut.bind(owner);
9106
+ owner.onCopyListener = owner.onCopy.bind(owner);
9107
+
9108
+ owner.initSwapHiddenInput();
9109
+
9110
+ owner.element.addEventListener('input', owner.onChangeListener);
9111
+ owner.element.addEventListener('keydown', owner.onKeyDownListener);
9112
+ owner.element.addEventListener('focus', owner.onFocusListener);
9113
+ owner.element.addEventListener('cut', owner.onCutListener);
9114
+ owner.element.addEventListener('copy', owner.onCopyListener);
9115
+
9116
+
9117
+ owner.initPhoneFormatter();
9118
+ owner.initDateFormatter();
9119
+ owner.initTimeFormatter();
9120
+ owner.initNumeralFormatter();
9121
+
9122
+ // avoid touch input field if value is null
9123
+ // otherwise Firefox will add red box-shadow for <input required />
9124
+ if (pps.initValue || (pps.prefix && !pps.noImmediatePrefix)) {
9125
+ owner.onInput(pps.initValue);
9126
+ }
9127
+ },
9128
+
9129
+ initSwapHiddenInput: function () {
9130
+ var owner = this, pps = owner.properties;
9131
+ if (!pps.swapHiddenInput) return;
9132
+
9133
+ var inputFormatter = owner.element.cloneNode(true);
9134
+ owner.element.parentNode.insertBefore(inputFormatter, owner.element);
9135
+
9136
+ owner.elementSwapHidden = owner.element;
9137
+ owner.elementSwapHidden.type = 'hidden';
9138
+
9139
+ owner.element = inputFormatter;
9140
+ owner.element.id = '';
9141
+ },
9142
+
9143
+ initNumeralFormatter: function () {
9144
+ var owner = this, pps = owner.properties;
9145
+
9146
+ if (!pps.numeral) {
9147
+ return;
9148
+ }
9149
+
9150
+ pps.numeralFormatter = new Cleave.NumeralFormatter(
9151
+ pps.numeralDecimalMark,
9152
+ pps.numeralIntegerScale,
9153
+ pps.numeralDecimalScale,
9154
+ pps.numeralThousandsGroupStyle,
9155
+ pps.numeralPositiveOnly,
9156
+ pps.stripLeadingZeroes,
9157
+ pps.prefix,
9158
+ pps.signBeforePrefix,
9159
+ pps.tailPrefix,
9160
+ pps.delimiter
9161
+ );
9162
+ },
9163
+
9164
+ initTimeFormatter: function() {
9165
+ var owner = this, pps = owner.properties;
9166
+
9167
+ if (!pps.time) {
9168
+ return;
9169
+ }
9170
+
9171
+ pps.timeFormatter = new Cleave.TimeFormatter(pps.timePattern, pps.timeFormat);
9172
+ pps.blocks = pps.timeFormatter.getBlocks();
9173
+ pps.blocksLength = pps.blocks.length;
9174
+ pps.maxLength = Cleave.Util.getMaxLength(pps.blocks);
9175
+ },
9176
+
9177
+ initDateFormatter: function () {
9178
+ var owner = this, pps = owner.properties;
9179
+
9180
+ if (!pps.date) {
9181
+ return;
9182
+ }
9183
+
9184
+ pps.dateFormatter = new Cleave.DateFormatter(pps.datePattern, pps.dateMin, pps.dateMax);
9185
+ pps.blocks = pps.dateFormatter.getBlocks();
9186
+ pps.blocksLength = pps.blocks.length;
9187
+ pps.maxLength = Cleave.Util.getMaxLength(pps.blocks);
9188
+ },
9189
+
9190
+ initPhoneFormatter: function () {
9191
+ var owner = this, pps = owner.properties;
9192
+
9193
+ if (!pps.phone) {
9194
+ return;
9195
+ }
9196
+
9197
+ // Cleave.AsYouTypeFormatter should be provided by
9198
+ // external google closure lib
9199
+ try {
9200
+ pps.phoneFormatter = new Cleave.PhoneFormatter(
9201
+ new pps.root.Cleave.AsYouTypeFormatter(pps.phoneRegionCode),
9202
+ pps.delimiter
9203
+ );
9204
+ } catch (ex) {
9205
+ throw new Error('[cleave.js] Please include phone-type-formatter.{country}.js lib');
9206
+ }
9207
+ },
9208
+
9209
+ onKeyDown: function (event) {
9210
+ var owner = this,
9211
+ charCode = event.which || event.keyCode;
9212
+
9213
+ owner.lastInputValue = owner.element.value;
9214
+ owner.isBackward = charCode === 8;
9215
+ },
9216
+
9217
+ onChange: function (event) {
9218
+ var owner = this, pps = owner.properties,
9219
+ Util = Cleave.Util;
9220
+
9221
+ owner.isBackward = owner.isBackward || event.inputType === 'deleteContentBackward';
9222
+
9223
+ var postDelimiter = Util.getPostDelimiter(owner.lastInputValue, pps.delimiter, pps.delimiters);
9224
+
9225
+ if (owner.isBackward && postDelimiter) {
9226
+ pps.postDelimiterBackspace = postDelimiter;
9227
+ } else {
9228
+ pps.postDelimiterBackspace = false;
9229
+ }
9230
+
9231
+ this.onInput(this.element.value);
9232
+ },
9233
+
9234
+ onFocus: function () {
9235
+ var owner = this,
9236
+ pps = owner.properties;
9237
+ owner.lastInputValue = owner.element.value;
9238
+
9239
+ if (pps.prefix && pps.noImmediatePrefix && !owner.element.value) {
9240
+ this.onInput(pps.prefix);
9241
+ }
9242
+
9243
+ Cleave.Util.fixPrefixCursor(owner.element, pps.prefix, pps.delimiter, pps.delimiters);
9244
+ },
9245
+
9246
+ onCut: function (e) {
9247
+ if (!Cleave.Util.checkFullSelection(this.element.value)) return;
9248
+ this.copyClipboardData(e);
9249
+ this.onInput('');
9250
+ },
9251
+
9252
+ onCopy: function (e) {
9253
+ if (!Cleave.Util.checkFullSelection(this.element.value)) return;
9254
+ this.copyClipboardData(e);
9255
+ },
9256
+
9257
+ copyClipboardData: function (e) {
9258
+ var owner = this,
9259
+ pps = owner.properties,
9260
+ Util = Cleave.Util,
9261
+ inputValue = owner.element.value,
9262
+ textToCopy = '';
9263
+
9264
+ if (!pps.copyDelimiter) {
9265
+ textToCopy = Util.stripDelimiters(inputValue, pps.delimiter, pps.delimiters);
9266
+ } else {
9267
+ textToCopy = inputValue;
9268
+ }
9269
+
9270
+ try {
9271
+ if (e.clipboardData) {
9272
+ e.clipboardData.setData('Text', textToCopy);
9273
+ } else {
9274
+ window.clipboardData.setData('Text', textToCopy);
9275
+ }
9276
+
9277
+ e.preventDefault();
9278
+ } catch (ex) {
9279
+ // empty
9280
+ }
9281
+ },
9282
+
9283
+ onInput: function (value) {
9284
+ var owner = this, pps = owner.properties,
9285
+ Util = Cleave.Util;
9286
+
9287
+ // case 1: delete one more character "4"
9288
+ // 1234*| -> hit backspace -> 123|
9289
+ // case 2: last character is not delimiter which is:
9290
+ // 12|34* -> hit backspace -> 1|34*
9291
+ // note: no need to apply this for numeral mode
9292
+ var postDelimiterAfter = Util.getPostDelimiter(value, pps.delimiter, pps.delimiters);
9293
+ if (!pps.numeral && pps.postDelimiterBackspace && !postDelimiterAfter) {
9294
+ value = Util.headStr(value, value.length - pps.postDelimiterBackspace.length);
9295
+ }
9296
+
9297
+ // phone formatter
9298
+ if (pps.phone) {
9299
+ if (pps.prefix && (!pps.noImmediatePrefix || value.length)) {
9300
+ pps.result = pps.prefix + pps.phoneFormatter.format(value).slice(pps.prefix.length);
9301
+ } else {
9302
+ pps.result = pps.phoneFormatter.format(value);
9303
+ }
9304
+ owner.updateValueState();
9305
+
9306
+ return;
9307
+ }
9308
+
9309
+ // numeral formatter
9310
+ if (pps.numeral) {
9311
+ // Do not show prefix when noImmediatePrefix is specified
9312
+ // This mostly because we need to show user the native input placeholder
9313
+ if (pps.prefix && pps.noImmediatePrefix && value.length === 0) {
9314
+ pps.result = '';
9315
+ } else {
9316
+ pps.result = pps.numeralFormatter.format(value);
9317
+ }
9318
+ owner.updateValueState();
9319
+
9320
+ return;
9321
+ }
9322
+
9323
+ // date
9324
+ if (pps.date) {
9325
+ value = pps.dateFormatter.getValidatedDate(value);
9326
+ }
9327
+
9328
+ // time
9329
+ if (pps.time) {
9330
+ value = pps.timeFormatter.getValidatedTime(value);
9331
+ }
9332
+
9333
+ // strip delimiters
9334
+ value = Util.stripDelimiters(value, pps.delimiter, pps.delimiters);
9335
+
9336
+ // strip prefix
9337
+ value = Util.getPrefixStrippedValue(value, pps.prefix, pps.prefixLength, pps.result, pps.delimiter, pps.delimiters, pps.noImmediatePrefix, pps.tailPrefix, pps.signBeforePrefix);
9338
+
9339
+ // strip non-numeric characters
9340
+ value = pps.numericOnly ? Util.strip(value, /[^\d]/g) : value;
9341
+
9342
+ // convert case
9343
+ value = pps.uppercase ? value.toUpperCase() : value;
9344
+ value = pps.lowercase ? value.toLowerCase() : value;
9345
+
9346
+ // prevent from showing prefix when no immediate option enabled with empty input value
9347
+ if (pps.prefix) {
9348
+ if (pps.tailPrefix) {
9349
+ value = value + pps.prefix;
9350
+ } else {
9351
+ value = pps.prefix + value;
9352
+ }
9353
+
9354
+
9355
+ // no blocks specified, no need to do formatting
9356
+ if (pps.blocksLength === 0) {
9357
+ pps.result = value;
9358
+ owner.updateValueState();
9359
+
9360
+ return;
9361
+ }
9362
+ }
9363
+
9364
+ // update credit card props
9365
+ if (pps.creditCard) {
9366
+ owner.updateCreditCardPropsByValue(value);
9367
+ }
9368
+
9369
+ // strip over length characters
9370
+ value = Util.headStr(value, pps.maxLength);
9371
+
9372
+ // apply blocks
9373
+ pps.result = Util.getFormattedValue(
9374
+ value,
9375
+ pps.blocks, pps.blocksLength,
9376
+ pps.delimiter, pps.delimiters, pps.delimiterLazyShow
9377
+ );
9378
+
9379
+ owner.updateValueState();
9380
+ },
9381
+
9382
+ updateCreditCardPropsByValue: function (value) {
9383
+ var owner = this, pps = owner.properties,
9384
+ Util = Cleave.Util,
9385
+ creditCardInfo;
9386
+
9387
+ // At least one of the first 4 characters has changed
9388
+ if (Util.headStr(pps.result, 4) === Util.headStr(value, 4)) {
9389
+ return;
9390
+ }
9391
+
9392
+ creditCardInfo = Cleave.CreditCardDetector.getInfo(value, pps.creditCardStrictMode);
9393
+
9394
+ pps.blocks = creditCardInfo.blocks;
9395
+ pps.blocksLength = pps.blocks.length;
9396
+ pps.maxLength = Util.getMaxLength(pps.blocks);
9397
+
9398
+ // credit card type changed
9399
+ if (pps.creditCardType !== creditCardInfo.type) {
9400
+ pps.creditCardType = creditCardInfo.type;
9401
+
9402
+ pps.onCreditCardTypeChanged.call(owner, pps.creditCardType);
9403
+ }
9404
+ },
9405
+
9406
+ updateValueState: function () {
9407
+ var owner = this,
9408
+ Util = Cleave.Util,
9409
+ pps = owner.properties;
9410
+
9411
+ if (!owner.element) {
9412
+ return;
9413
+ }
9414
+
9415
+ var endPos = owner.element.selectionEnd;
9416
+ var oldValue = owner.element.value;
9417
+ var newValue = pps.result;
9418
+
9419
+ endPos = Util.getNextCursorPosition(endPos, oldValue, newValue, pps.delimiter, pps.delimiters);
9420
+
9421
+ // fix Android browser type="text" input field
9422
+ // cursor not jumping issue
9423
+ if (owner.isAndroid) {
9424
+ window.setTimeout(function () {
9425
+ owner.element.value = newValue;
9426
+ Util.setSelection(owner.element, endPos, pps.document, false);
9427
+ owner.callOnValueChanged();
9428
+ }, 1);
9429
+
9430
+ return;
9431
+ }
9432
+
9433
+ owner.element.value = newValue;
9434
+ if (pps.swapHiddenInput) owner.elementSwapHidden.value = owner.getRawValue();
9435
+
9436
+ Util.setSelection(owner.element, endPos, pps.document, false);
9437
+ owner.callOnValueChanged();
9438
+ },
9439
+
9440
+ callOnValueChanged: function () {
9441
+ var owner = this,
9442
+ pps = owner.properties;
9443
+
9444
+ pps.onValueChanged.call(owner, {
9445
+ target: {
9446
+ name: owner.element.name,
9447
+ value: pps.result,
9448
+ rawValue: owner.getRawValue()
9449
+ }
9450
+ });
9451
+ },
9452
+
9453
+ setPhoneRegionCode: function (phoneRegionCode) {
9454
+ var owner = this, pps = owner.properties;
9455
+
9456
+ pps.phoneRegionCode = phoneRegionCode;
9457
+ owner.initPhoneFormatter();
9458
+ owner.onChange();
9459
+ },
9460
+
9461
+ setRawValue: function (value) {
9462
+ var owner = this, pps = owner.properties;
9463
+
9464
+ value = value !== undefined && value !== null ? value.toString() : '';
9465
+
9466
+ if (pps.numeral) {
9467
+ value = value.replace('.', pps.numeralDecimalMark);
9468
+ }
9469
+
9470
+ pps.postDelimiterBackspace = false;
9471
+
9472
+ owner.element.value = value;
9473
+ owner.onInput(value);
9474
+ },
9475
+
9476
+ getRawValue: function () {
9477
+ var owner = this,
9478
+ pps = owner.properties,
9479
+ Util = Cleave.Util,
9480
+ rawValue = owner.element.value;
9481
+
9482
+ if (pps.rawValueTrimPrefix) {
9483
+ rawValue = Util.getPrefixStrippedValue(rawValue, pps.prefix, pps.prefixLength, pps.result, pps.delimiter, pps.delimiters, pps.noImmediatePrefix, pps.tailPrefix, pps.signBeforePrefix);
9484
+ }
9485
+
9486
+ if (pps.numeral) {
9487
+ rawValue = pps.numeralFormatter.getRawValue(rawValue);
9488
+ } else {
9489
+ rawValue = Util.stripDelimiters(rawValue, pps.delimiter, pps.delimiters);
9490
+ }
9491
+
9492
+ return rawValue;
9493
+ },
9494
+
9495
+ getISOFormatDate: function () {
9496
+ var owner = this,
9497
+ pps = owner.properties;
9498
+
9499
+ return pps.date ? pps.dateFormatter.getISOFormatDate() : '';
9500
+ },
9501
+
9502
+ getISOFormatTime: function () {
9503
+ var owner = this,
9504
+ pps = owner.properties;
9505
+
9506
+ return pps.time ? pps.timeFormatter.getISOFormatTime() : '';
9507
+ },
9508
+
9509
+ getFormattedValue: function () {
9510
+ return this.element.value;
9511
+ },
9512
+
9513
+ destroy: function () {
9514
+ var owner = this;
9515
+
9516
+ owner.element.removeEventListener('input', owner.onChangeListener);
9517
+ owner.element.removeEventListener('keydown', owner.onKeyDownListener);
9518
+ owner.element.removeEventListener('focus', owner.onFocusListener);
9519
+ owner.element.removeEventListener('cut', owner.onCutListener);
9520
+ owner.element.removeEventListener('copy', owner.onCopyListener);
9521
+ },
9522
+
9523
+ toString: function () {
9524
+ return '[Cleave Object]';
9525
+ }
9526
+ };
9527
+
9528
+ Cleave.NumeralFormatter = NumeralFormatter_1;
9529
+ Cleave.DateFormatter = DateFormatter_1;
9530
+ Cleave.TimeFormatter = TimeFormatter_1;
9531
+ Cleave.PhoneFormatter = PhoneFormatter_1;
9532
+ Cleave.CreditCardDetector = CreditCardDetector_1;
9533
+ Cleave.Util = Util_1;
9534
+ Cleave.DefaultProperties = DefaultProperties_1;
9535
+
9536
+ // for angular directive
9537
+ ((typeof commonjsGlobal === 'object' && commonjsGlobal) ? commonjsGlobal : window)['Cleave'] = Cleave;
9538
+
9539
+ // CommonJS
9540
+ var Cleave_1 = Cleave;
9541
+
9542
+ /* eslint-disable @typescript-eslint/no-explicit-any */
9543
+ function coerceBoolean(value) {
9544
+ return value != null && `${value}` !== 'false';
9545
+ }
9546
+ function coerceNumber(value, fallbackValue = 0) {
9547
+ return isNumberValue(value) ? Number(value) : fallbackValue;
9548
+ }
9549
+ function isNumberValue(value) {
9550
+ return !isNaN(parseFloat(value)) && !isNaN(Number(value));
9551
+ }
9552
+
9553
+ const catInputCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}.cat-bg-primary{background-color:rgb(var(--cat-primary-bg, 0, 129, 148)) !important;color:rgb(var(--cat-primary-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-primary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-primary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-primary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-primary-hover{transition:background-color 125ms, color 125ms}.cat-bg-primary-hover:hover{background-color:rgb(var(--cat-primary-bg-hover, 1, 115, 132)) !important;color:rgb(var(--cat-primary-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-primary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-primary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-primary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-primary,.cat-link-primary{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-link-primary,.cat-text-primary-hover{transition:color 125ms}.cat-link-primary:hover,.cat-text-primary-hover:hover{color:rgb(var(--cat-primary-text-hover, 1, 115, 132)) !important}.cat-link-primary:active,.cat-text-primary-hover:active{color:rgb(var(--cat-primary-text-active, 2, 99, 113)) !important}.cat-bg-primaryInverted{background-color:#93b4f2 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-bg-primaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-primaryInverted-hover:hover{background-color:#93b4f2 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-text-primaryInverted,.cat-link-primaryInverted{color:#93b4f2 !important}.cat-link-primaryInverted,.cat-text-primaryInverted-hover{transition:color 125ms}.cat-link-primaryInverted:hover,.cat-text-primaryInverted-hover:hover{color:#93b4f2 !important}.cat-link-primaryInverted:active,.cat-text-primaryInverted-hover:active{color:#93b4f2 !important}.cat-bg-secondary{background-color:rgb(var(--cat-secondary-bg, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-secondary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-secondary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-secondary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-secondary-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondary-hover:hover{background-color:rgb(var(--cat-secondary-bg-hover, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-secondary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-secondary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-secondary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-secondary,.cat-link-secondary{color:rgb(var(--cat-secondary-text, 0, 0, 0)) !important}.cat-link-secondary,.cat-text-secondary-hover{transition:color 125ms}.cat-link-secondary:hover,.cat-text-secondary-hover:hover{color:rgb(var(--cat-secondary-text-hover, 0, 0, 0)) !important}.cat-link-secondary:active,.cat-text-secondary-hover:active{color:rgb(var(--cat-secondary-text-active, 0, 0, 0)) !important}.cat-bg-secondaryInverted{background-color:#697687 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-bg-secondaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondaryInverted-hover:hover{background-color:#697687 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-text-secondaryInverted,.cat-link-secondaryInverted{color:white !important}.cat-link-secondaryInverted,.cat-text-secondaryInverted-hover{transition:color 125ms}.cat-link-secondaryInverted:hover,.cat-text-secondaryInverted-hover:hover{color:white !important}.cat-link-secondaryInverted:active,.cat-text-secondaryInverted-hover:active{color:white !important}.cat-bg-info{background-color:rgb(var(--cat-info-bg, 0, 115, 230)) !important;color:rgb(var(--cat-info-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-info-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-info-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-info-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-info-hover{transition:background-color 125ms, color 125ms}.cat-bg-info-hover:hover{background-color:rgb(var(--cat-info-bg-hover, 0, 107, 227)) !important;color:rgb(var(--cat-info-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-info-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-info-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-info-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-info,.cat-link-info{color:rgb(var(--cat-info-text, 0, 115, 230)) !important}.cat-link-info,.cat-text-info-hover{transition:color 125ms}.cat-link-info:hover,.cat-text-info-hover:hover{color:rgb(var(--cat-info-text-hover, 0, 107, 227)) !important}.cat-link-info:active,.cat-text-info-hover:active{color:rgb(var(--cat-info-text-active, 0, 96, 223)) !important}.cat-bg-success{background-color:rgb(var(--cat-success-bg, 0, 132, 88)) !important;color:rgb(var(--cat-success-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-success-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-success-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-success-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-success-hover{transition:background-color 125ms, color 125ms}.cat-bg-success-hover:hover{background-color:rgb(var(--cat-success-bg-hover, 0, 117, 78)) !important;color:rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-success-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-success-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-success-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-success,.cat-link-success{color:rgb(var(--cat-success-text, 0, 132, 88)) !important}.cat-link-success,.cat-text-success-hover{transition:color 125ms}.cat-link-success:hover,.cat-text-success-hover:hover{color:rgb(var(--cat-success-text-hover, 0, 117, 78)) !important}.cat-link-success:active,.cat-text-success-hover:active{color:rgb(var(--cat-success-text-active, 0, 105, 70)) !important}.cat-bg-warning{background-color:rgb(var(--cat-warning-bg, 255, 206, 128)) !important;color:rgb(var(--cat-warning-fill, 0, 0, 0)) !important;--cat-primary-text:var(--cat-warning-fill, 0, 0, 0);--cat-primary-text-hover:var(--cat-warning-fill-hover, 0, 0, 0);--cat-primary-text-active:var(--cat-warning-fill-active, 0, 0, 0);--cat-link-decoration:underline}.cat-bg-warning-hover{transition:background-color 125ms, color 125ms}.cat-bg-warning-hover:hover{background-color:rgb(var(--cat-warning-bg-hover, 255, 214, 148)) !important;color:rgb(var(--cat-warning-fill-hover, 0, 0, 0)) !important;--cat-primary-text:var(--cat-warning-fill, 0, 0, 0);--cat-primary-text-hover:var(--cat-warning-fill-hover, 0, 0, 0);--cat-primary-text-active:var(--cat-warning-fill-active, 0, 0, 0);--cat-link-decoration:underline}.cat-text-warning,.cat-link-warning{color:rgb(var(--cat-warning-text, 159, 97, 0)) !important}.cat-link-warning,.cat-text-warning-hover{transition:color 125ms}.cat-link-warning:hover,.cat-text-warning-hover:hover{color:rgb(var(--cat-warning-text-hover, 159, 97, 0)) !important}.cat-link-warning:active,.cat-text-warning-hover:active{color:rgb(var(--cat-warning-text-active, 159, 97, 0)) !important}.cat-bg-danger{background-color:rgb(var(--cat-danger-bg, 217, 52, 13)) !important;color:rgb(var(--cat-danger-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-danger-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-danger-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-danger-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-danger-hover{transition:background-color 125ms, color 125ms}.cat-bg-danger-hover:hover{background-color:rgb(var(--cat-danger-bg-hover, 194, 46, 11)) !important;color:rgb(var(--cat-danger-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-danger-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-danger-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-danger-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-danger,.cat-link-danger{color:rgb(var(--cat-danger-text, 217, 52, 13)) !important}.cat-link-danger,.cat-text-danger-hover{transition:color 125ms}.cat-link-danger:hover,.cat-text-danger-hover:hover{color:rgb(var(--cat-danger-text-hover, 194, 46, 11)) !important}.cat-link-danger:active,.cat-text-danger-hover:active{color:rgb(var(--cat-danger-text-active, 174, 42, 10)) !important}.cat-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-text-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-text-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-bg-muted{background-color:#f2f4f7 !important}.cat-text-reset{color:inherit !important}.cat-link-reset{color:inherit !important;text-decoration:inherit !important}.label{overflow:hidden;word-wrap:break-word;word-break:break-word}.input-field:not(.input-horizontal) .label-container.hidden,.textarea-field:not(.textarea-horizontal) .label-container.hidden,.select-field:not(.select-horizontal) .label-container.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.label-container{flex-basis:var(--label-size, 33.33%)}.label-container .label-wrapper{display:flex;gap:0.25rem}.label-metadata{display:flex;flex-shrink:0;flex-grow:1;justify-content:space-between;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.label-optional,.label-character-count{display:inline-flex;align-items:center;max-height:1.25rem;font-size:0.75rem;line-height:1rem}.label-character-count{margin-left:auto}.input-horizontal .label-container.hidden label,.textarea-horizontal .label-container.hidden label,.select-horizontal .label-container.hidden label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-horizontal .label-wrapper,.textarea-horizontal .label-wrapper,.select-horizontal .label-wrapper{flex-direction:column}.input-horizontal label,.textarea-horizontal label,.select-horizontal label{min-height:2.5rem;display:inline-flex;align-items:center}.input-horizontal .label-metadata,.textarea-horizontal .label-metadata,.select-horizontal .label-metadata{justify-content:flex-start}.input-horizontal .label-metadata .label-character-count,.textarea-horizontal .label-metadata .label-character-count,.select-horizontal .label-metadata .label-character-count{margin-left:0}:host{display:flex;font-size:0.9375rem;line-height:1.25rem}:host([hidden]){display:none}.input-field,.input-container{display:flex;flex-direction:column;gap:0.5rem;flex:1 1 auto}.input-field.input-horizontal{flex-direction:row;gap:1rem}.input-wrapper{flex:1 1 auto;display:flex;align-items:stretch;gap:0.75rem;padding:0 0.75rem;height:2.5rem;overflow:hidden;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:inset 0 0 0 1px rgb(var(--border-color));transition:box-shadow 125ms linear;--border-color:var(--cat-border-color-dark, 215, 219, 224);}.input-wrapper.input-round{border-radius:10rem}.input-wrapper.input-readonly{pointer-events:none}.input-wrapper.input-disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.input-wrapper:not(.input-disabled):hover{box-shadow:inset 0 0 0 1px rgb(var(--border-color)), 0 0 0 1px rgb(var(--border-color))}.input-wrapper:focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-1px}.input-wrapper:focus-within:has(.clearable:focus){outline:none}.input-wrapper.input-invalid{--border-color:var(--cat-danger-bg, 217, 52, 13), 0.2}.input-wrapper:has(input:-webkit-autofill),.input-wrapper:has(input:-webkit-autofill):hover,.input-wrapper:has(input:-webkit-autofill):focus{background-color:#e8f0fe}.text-prefix,.text-suffix{display:inline-flex;align-items:center;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.text-prefix{border-right:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));padding-right:0.75rem}.text-suffix{border-left:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));padding-left:0.75rem}.icon-prefix,.icon-suffix{align-self:center}.input-outer-wrapper{display:flex}.input-inner-wrapper{display:flex;align-items:center;position:relative;flex:1 1 auto}input{font:inherit;margin:0;padding:0;width:100%;min-width:0;border:none;outline:none;background:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.input-disabled input{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}input.has-clearable,input.has-toggle-password{padding-right:1.5rem}input.has-clearable.has-toggle-password{padding-right:3.5rem}input::placeholder{color:rgb(var(--cat-font-color-muted, 81, 92, 108))}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus{-webkit-box-shadow:0 0 0 9999px #e8f0fe inset}.clearable{position:absolute;top:calc(50% - 1rem);right:-0.5rem}.toggle-password{position:absolute;top:calc(50% - 1rem);right:-0.5rem}.has-clearable~.toggle-password{right:1.5rem}:host(.cat-date-input) .input-wrapper,:host(.cat-time-input) .input-wrapper{z-index:1;border-top-right-radius:0;border-bottom-right-radius:0}";
9554
+ const CatInputStyle0 = catInputCss;
9555
+
9556
+ let nextUniqueId$6 = 0;
9557
+ const CatInput = class {
9558
+ constructor(hostRef) {
9559
+ registerInstance(this, hostRef);
9560
+ this.catChange = createEvent(this, "catChange", 7);
9561
+ this.catFocus = createEvent(this, "catFocus", 7);
9562
+ this.catBlur = createEvent(this, "catBlur", 7);
9563
+ this._id = `cat-input-${nextUniqueId$6++}`;
9564
+ this.hasSlottedLabel = false;
9565
+ this.hasSlottedHint = false;
9566
+ this.isPasswordShown = false;
9567
+ this.errorMap = undefined;
9568
+ this.requiredMarker = 'optional';
9569
+ this.horizontal = false;
9570
+ this.autoComplete = undefined;
9571
+ this.clearable = false;
9572
+ this.togglePassword = false;
9573
+ this.disabled = false;
9574
+ this.hint = undefined;
9575
+ this.icon = undefined;
9576
+ this.iconRight = false;
9577
+ this.identifier = undefined;
9578
+ this.label = '';
9579
+ this.labelHidden = false;
9580
+ this.max = undefined;
9581
+ this.maxLength = undefined;
9582
+ this.min = undefined;
9583
+ this.minLength = undefined;
9584
+ this.name = undefined;
9585
+ this.placeholder = undefined;
9586
+ this.textPrefix = undefined;
9587
+ this.textSuffix = undefined;
9588
+ this.readonly = false;
9589
+ this.required = false;
9590
+ this.round = false;
9591
+ this.type = 'text';
9592
+ this.value = undefined;
9593
+ this.errors = undefined;
9594
+ this.errorUpdate = 0;
9595
+ this.nativeAttributes = undefined;
9596
+ }
9597
+ get id() {
9598
+ return this.identifier || this._id;
9599
+ }
9600
+ componentWillRender() {
9601
+ this.onErrorsChanged(this.errors);
9602
+ this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
9603
+ this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
9604
+ if (!this.label && !this.hasSlottedLabel) {
9605
+ log.warn('[A11y] Missing ARIA label on input', this);
7666
9606
  }
7667
9607
  }
7668
9608
  /**
@@ -7693,6 +9633,14 @@ const CatInput = class {
7693
9633
  this.value = '';
7694
9634
  this.catChange.emit(this.value);
7695
9635
  }
9636
+ /**
9637
+ * Adds a Cleave.js mask to the input.
9638
+ *
9639
+ * @param options The Cleave.js options.
9640
+ */
9641
+ async mask(options) {
9642
+ new Cleave_1(this.input, options);
9643
+ }
7696
9644
  onErrorsChanged(value) {
7697
9645
  if (!coerceBoolean(this.errorUpdate)) {
7698
9646
  this.errorMap = undefined;
@@ -7707,19 +9655,19 @@ const CatInput = class {
7707
9655
  }
7708
9656
  }
7709
9657
  render() {
7710
- return (h("div", { key: 'fe89677c5a5768818b2ac9b1536cb50c2cde2edd', class: {
9658
+ return (h("div", { key: 'aab57f9704562874b2dee392630c473fc31a33cb', class: {
7711
9659
  'input-field': true,
7712
9660
  'input-horizontal': this.horizontal
7713
- } }, h("div", { key: '92aaf9f42e27da513f87648888551f221bb45d52', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id, part: "label" }, h("span", { class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, h("div", { class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), this.maxLength && (h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.toString().length ?? 0, "/", this.maxLength))))))), h("div", { key: '24008f6704d6108ae439ba96507bf45db7b38978', class: "input-container" }, h("div", { key: 'fd329b7aff321121d771b325ff59a51668d5ad70', class: {
9661
+ } }, h("div", { key: 'f599b443389362d9eb3ee72d496d225ca2a8bf8d', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id, part: "label" }, h("span", { class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, h("div", { class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), this.maxLength && (h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.toString().length ?? 0, "/", this.maxLength))))))), h("div", { key: 'ddce0aaa854e32ae4b8a8686a3886089beac6300', class: "input-container" }, h("div", { key: '25eb9aa776ba2cee97fb2bf79bc52d5c44c54b55', class: "input-outer-wrapper" }, h("div", { key: '7cd420c3525b8e15a7c0f2d8405cdd70f2e5291c', class: {
7714
9662
  'input-wrapper': true,
7715
9663
  'input-round': this.round,
7716
9664
  'input-readonly': this.readonly,
7717
9665
  'input-disabled': this.disabled,
7718
9666
  'input-invalid': this.invalid
7719
- }, onClick: () => this.input.focus() }, this.textPrefix && (h("span", { class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && (h("cat-icon", { icon: this.icon, class: "icon-prefix", size: "l", onClick: () => this.doFocus() })), h("div", { key: '0a6fcef52829bd6429ca419a544a64fe68779afa', class: "input-inner-wrapper" }, h("input", { key: '43a4affa77f7f8f75b52da2cc553f20096519000', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, class: {
9667
+ }, onClick: () => this.input.focus() }, this.textPrefix && (h("span", { class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && (h("cat-icon", { icon: this.icon, class: "icon-prefix", size: "l", onClick: () => this.doFocus() })), h("div", { key: '7f0c24c572ddfb4a1f76457955b28c111c1b444a', class: "input-inner-wrapper" }, h("input", { key: 'fcef418a1eb7c5d54f47e239f8db0cf52f23d3f7', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, class: {
7720
9668
  'has-clearable': this.clearable && !this.disabled && !this.readonly && !!this.value,
7721
9669
  'has-toggle-password': this.togglePassword && !this.disabled && !this.readonly && !!this.value
7722
- }, autocomplete: this.autoComplete, disabled: this.disabled, max: this.max, maxlength: this.maxLength, min: this.min, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, type: this.isPasswordShown ? 'text' : this.type, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.clearable && !this.disabled && !this.readonly && this.value && (h("cat-button", { class: "clearable", icon: "$cat:input-close", "icon-only": "true", size: "s", variant: "text", "a11y-label": catI18nRegistry.t('input.clear'), onClick: this.clear.bind(this), "data-dropdown-no-close": true })), this.togglePassword && !this.disabled && !this.readonly && this.value && (h("cat-button", { class: "toggle-password", icon: this.isPasswordShown ? '$cat:input-password-hide' : '$cat:input-password-show', "icon-only": "true", size: "s", variant: "text", "a11y-label": catI18nRegistry.t(this.isPasswordShown ? 'input.hidePassword' : 'input.showPassword'), onClick: this.doTogglePassword.bind(this) }))), !this.invalid && this.icon && this.iconRight && (h("cat-icon", { icon: this.icon, class: "icon-suffix", size: "l", onClick: () => this.doFocus() })), this.invalid && h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" }), this.textSuffix && (h("span", { class: "text-suffix", part: "suffix" }, this.textSuffix))), this.hasHint && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))));
9670
+ }, autocomplete: this.autoComplete, disabled: this.disabled, max: this.max, maxlength: this.maxLength, min: this.min, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, type: this.isPasswordShown ? 'text' : this.type, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.clearable && !this.disabled && !this.readonly && this.value && (h("cat-button", { class: "clearable", icon: "$cat:input-close", "icon-only": "true", size: "s", variant: "text", "a11y-label": catI18nRegistry.t('input.clear'), onClick: this.clear.bind(this), "data-dropdown-no-close": true })), this.togglePassword && !this.disabled && !this.readonly && this.value && (h("cat-button", { class: "toggle-password", icon: this.isPasswordShown ? '$cat:input-password-hide' : '$cat:input-password-show', "icon-only": "true", size: "s", variant: "text", "a11y-label": catI18nRegistry.t(this.isPasswordShown ? 'input.hidePassword' : 'input.showPassword'), onClick: this.doTogglePassword.bind(this) }))), !this.invalid && this.icon && this.iconRight && (h("cat-icon", { icon: this.icon, class: "icon-suffix", size: "l", onClick: () => this.doFocus() })), this.invalid && (h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" })), this.textSuffix && (h("span", { class: "text-suffix", part: "suffix" }, this.textSuffix))), h("slot", { key: '3c3ff6368c631ae0634a7d0b875cb0d6a69edcba', name: "addon" })), this.hasHint && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))));
7723
9671
  }
7724
9672
  get hasHint() {
7725
9673
  return !!this.hint || !!this.hasSlottedHint || this.invalid;
@@ -7797,9 +9745,9 @@ const CatPagination = class {
7797
9745
  this.iconNext = '$cat:pagination-right';
7798
9746
  }
7799
9747
  render() {
7800
- return (h("nav", { key: 'b6166d7adf97431fcd6cd0b451f1c3287b3fca52', role: "navigation" }, h("ol", { key: '1810a4226ab05830a0b7e9d8d010d0e13dd6bd7f', class: {
9748
+ return (h("nav", { key: '113d4e757e003c8351efe53f8baeaffe28428c8f', role: "navigation" }, h("ol", { key: '15d86b0fd427abdd7f1af9ababb324806a746d05', class: {
7801
9749
  [`cat-pagination-${this.size}`]: Boolean(this.size)
7802
- } }, h("li", { key: '3b76a3f4a56ddbb998ba0da43cd99d759629567c' }, h("cat-button", { key: '7a07b951565187f86a2048bae6d9139eda2ecf57', variant: this.variant, size: this.size, round: this.round, disabled: this.isFirst, a11yLabel: catI18nRegistry.t('pagination.prev'), icon: this.iconPrev, iconOnly: true, onClick: () => this.setPage(this.page - 1) })), this.content, h("li", { key: '14e62c6284d2d52cb0d14f86bc960ff7bba8fb9d' }, h("cat-button", { key: '922396cb778f9a1f439557c5b15627415a733347', variant: this.variant, size: this.size, round: this.round, disabled: this.isLast, a11yLabel: catI18nRegistry.t('pagination.next'), icon: this.iconNext, iconOnly: true, onClick: () => this.setPage(this.page + 1) })))));
9750
+ } }, h("li", { key: 'b6e6dad6d903b65850cd33c15327386a61fde3d4' }, h("cat-button", { key: 'd32aa4a3af4aaae84b5d2de695deadf0852f4ae0', variant: this.variant, size: this.size, round: this.round, disabled: this.isFirst, a11yLabel: catI18nRegistry.t('pagination.prev'), icon: this.iconPrev, iconOnly: true, onClick: () => this.setPage(this.page - 1) })), this.content, h("li", { key: '19567f748e4f3976576ea1c894c2524865d6201a' }, h("cat-button", { key: '6170034891849aef2e248a1f531d86806aa4f4c1', variant: this.variant, size: this.size, round: this.round, disabled: this.isLast, a11yLabel: catI18nRegistry.t('pagination.next'), icon: this.iconNext, iconOnly: true, onClick: () => this.setPage(this.page + 1) })))));
7803
9751
  }
7804
9752
  get isFirst() {
7805
9753
  return this.page === 0;
@@ -7904,7 +9852,7 @@ const CatRadio = class {
7904
9852
  this.input.blur();
7905
9853
  }
7906
9854
  render() {
7907
- return (h(Host, { key: 'c44f5c1369b86ff3cc51d724a93ad0b2f3ec305d' }, h("label", { key: '921bc4790f98c244d60f60dad26eafb6f2dfe2a4', htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, h("span", { key: 'dea160109a4e097630b4dcccf22b4f201e79261d', class: "radio" }, h("input", { key: 'f03523fe726e79745b296983ff39803bf797b164', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.identifier || this.id, type: "radio", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), h("span", { key: '71259c52a7f46c1b49e4ccfa2e78e539ddf8c98f', class: "circle" })), h("span", { key: '93f2193a483bf6b8ad6e01d323393403714a1d95', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), this.hasHint && (h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { class: "circle-placeholder" }), h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
9855
+ return (h(Host, { key: '9e3d983eeda3b42a67db73775cafcb9a5d98953a' }, h("label", { key: 'e2c5919edf0540000622a239b4acaa7704b2b3a8', htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, h("span", { key: '1f8d95c1728e910305c6ef827b6779b4642102d8', class: "radio" }, h("input", { key: 'd0217cd454023eb440ef4c2481899f30c15c340f', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.identifier || this.id, type: "radio", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), h("span", { key: '83a85842c187adf508cba7497d9e2a545163967b', class: "circle" })), h("span", { key: 'de6ed4d4a62b894406ec53380ac4949a265fe74b', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), this.hasHint && (h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { class: "circle-placeholder" }), h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
7908
9856
  }
7909
9857
  get hasHint() {
7910
9858
  return !!this.hint || !!this.hasSlottedHint;
@@ -7995,7 +9943,7 @@ const CatRadioGroup = class {
7995
9943
  }
7996
9944
  }
7997
9945
  render() {
7998
- return (h("div", { key: '75b4eaacbbe46c9117d1668b088aaa2dd19dbc07', role: "radiogroup", "aria-label": this.a11yLabel }, h("slot", { key: '1d74e89695ff302ac5f166814a7912ba2826432d' })));
9946
+ return (h("div", { key: '05f0e3dddf696ecc2de0ea7491011e9ce6cf7ce4', role: "radiogroup", "aria-label": this.a11yLabel }, h("slot", { key: 'f67dc6e9f7e8410104626a1c5e54587d4cae51b0' })));
7999
9947
  }
8000
9948
  init() {
8001
9949
  this.catRadioGroup = Array.from(this.hostElement.querySelectorAll(`cat-radio`));
@@ -8084,13 +10032,13 @@ const CatScrollable = class {
8084
10032
  }
8085
10033
  render() {
8086
10034
  return [
8087
- h("div", { key: '349eb12cb7425f63471426378203dd4cfffbc39a', class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, !this.noShadowY && h("div", { class: "shadow-top" }), !this.noShadowX && h("div", { class: "shadow-left" }), !this.noShadowX && h("div", { class: "shadow-right" }), !this.noShadowY && h("div", { class: "shadow-bottom" })),
8088
- h("div", { key: '2e4bfaf86ca554f75941f62350a3e08eee36cb4a', ref: el => (this.scrollElement = el), class: {
10035
+ h("div", { key: 'a665d0c5a252ffb60c451b47b19e58d720aa7cc5', class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, !this.noShadowY && h("div", { class: "shadow-top" }), !this.noShadowX && h("div", { class: "shadow-left" }), !this.noShadowX && h("div", { class: "shadow-right" }), !this.noShadowY && h("div", { class: "shadow-bottom" })),
10036
+ h("div", { key: 'b5148d1b4d36da8f58dfd1a9f5ee4f8281e7bf48', ref: el => (this.scrollElement = el), class: {
8089
10037
  'scrollable-content': true,
8090
10038
  'scroll-x': !this.noOverflowX,
8091
10039
  'scroll-y': !this.noOverflowY,
8092
10040
  'no-overscroll': this.noOverscroll
8093
- } }, h("slot", { key: 'f0ed2418f5a797285f445a0d34135b4290448220' }))
10041
+ } }, h("slot", { key: '58770dc6389091b4fcd010b0ef867098bbdbd324' }))
8094
10042
  ];
8095
10043
  }
8096
10044
  attachEmitter(from, emitter) {
@@ -9034,7 +10982,7 @@ const CatSelectTest = class {
9034
10982
  setTimeout(() => this.multipleSelect && (this.multipleSelect.value = []), 5000);
9035
10983
  }
9036
10984
  render() {
9037
- return (h(Host, { key: '855f08143eb0eac251258488f5c3e38ce913ffe5', style: { display: 'flex', flexDirection: 'column' } }, h("cat-select", { key: 'b8cea61a78ec33ec5f2a07975e077878998e7d91', label: "Multiple Select", hint: "This is a hint!", ref: el => (this.multipleSelect = el), value: ['1'], placeholder: "Hello World", onCatChange: () => console.log('Multiple change', this.multipleSelect?.value), onCatBlur: e => console.log('Multiple blur', e), multiple: true, noItems: "No results", clearable: true, errorUpdate: false }, h("span", { key: 'af5f8a887adcfef7167f0ae73e1d12062762f698', slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), h("cat-select", { key: '42244b9525e5f9055114eaa5cd8b00204a1a0572', label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: '371052ebd2cc689d91263e42f1e9caedd5ad09c2', label: "Multiple with initials", ref: el => (this.multipleSelectAvatarInitials = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: 'e192a41b714c06726601d65c590df33ef06636ed', label: "Multiple with tagging support", hint: "This is a hint!", ref: el => (this.multipleSelectTagging = el), value: { ids: ['1'], tags: ['Test', 'Albania', 'Algeria'] }, placeholder: "Select country", onCatChange: () => console.log('Multiple tagging change', this.multipleSelectTagging?.value), multiple: true, tags: true, clearable: true, errorUpdate: false }), h("cat-select", { key: '612235ad95acfb4a6b3f472928bac192636f10fd', label: "Single Select", hint: "This is a hint!", ref: el => (this.singleSelect = el), placeholder: "Search for a country or capital", onCatBlur: e => console.log('Single blur', e), clearable: true, errorUpdate: false }), h("cat-select", { key: '19738b2c9f165c6e613ebad4c8c546f5659598df', label: "Single with img", ref: el => (this.singleSelectAvatar = el), value: '1', placeholder: "Search for a country or capital", clearable: true, errorUpdate: false }), h("cat-select", { key: '654a7ca6e2a3656082417a8815339eb65d30151a', label: "Single with initials", ref: el => (this.singleSelectAvatarInitials = el), placeholder: "Hello World", clearable: true, errorUpdate: false }), h("cat-dropdown", { key: '55d9456a63202045b0626eeb2cf4af6d3345c581', overflow: true }, h("cat-button", { key: 'ce0438f8e79de3a545fe604db8a97c3d279d1d1a', slot: "trigger", style: { width: '50%' } }, "Open select"), h("div", { key: 'da8a050195eeffdead1e45d6b77c05644c1ca379', slot: "content", style: { width: '400px' } }, h("cat-select", { key: 'f9f5c6bc85c0140366a19ec5f695dd92b5d80456', label: "Single with tagging support", ref: el => (this.singleSelectTagging = el), value: { id: '', tag: 'Albania' }, placeholder: "Search for a country or capital", onCatChange: () => console.log('Single change', this.singleSelectTagging?.value), tagHint: "new country", tags: true, clearable: true, errorUpdate: false, style: { width: '90%' } })))));
10985
+ return (h(Host, { key: '917d1993ffdeb3df253cb69c4f91670bae865ffe', style: { display: 'flex', flexDirection: 'column' }, class: "cat-form" }, h("cat-select", { key: '0783adb9958ab099ee05514ab1eff2c2e9c19a3d', label: "Multiple Select", hint: "This is a hint!", ref: el => (this.multipleSelect = el), value: ['1'], placeholder: "Hello World", onCatChange: () => console.log('Multiple change', this.multipleSelect?.value), onCatBlur: e => console.log('Multiple blur', e), multiple: true, noItems: "No results", clearable: true, errorUpdate: false }, h("span", { key: 'a022a3f75759761d9f8cc75855c15c8bd577ec6d', slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), h("cat-select", { key: '6e5ff0f3f69a6b8eb812a73243de623afe6958aa', label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: 'f1f365f238c40179536fed2fdecf9562e9a2313b', label: "Multiple with initials", ref: el => (this.multipleSelectAvatarInitials = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: '3444b60c5c4e65e96288f0773e0a1fa1aa2e6418', label: "Multiple with tagging support", hint: "This is a hint!", ref: el => (this.multipleSelectTagging = el), value: { ids: ['1'], tags: ['Test', 'Albania', 'Algeria'] }, placeholder: "Select country", onCatChange: () => console.log('Multiple tagging change', this.multipleSelectTagging?.value), multiple: true, tags: true, clearable: true, errorUpdate: false }), h("cat-select", { key: '9de06f744b6b072184fd8b5d25f1ecd1e6377152', label: "Single Select", hint: "This is a hint!", ref: el => (this.singleSelect = el), placeholder: "Search for a country or capital", onCatBlur: e => console.log('Single blur', e), clearable: true, errorUpdate: false }), h("cat-select", { key: '64e4286713877e81dbd587a2b46a4836d3e6a003', label: "Single with img", ref: el => (this.singleSelectAvatar = el), value: '1', placeholder: "Search for a country or capital", clearable: true, errorUpdate: false }), h("cat-select", { key: 'd3a3435025715aa6b2cfb82ca7093ebfc6537038', label: "Single with initials", ref: el => (this.singleSelectAvatarInitials = el), placeholder: "Hello World", clearable: true, errorUpdate: false }), h("cat-dropdown", { key: '24a8e325652f4fac91a7548d1c7db43930ae3dba', overflow: true }, h("cat-button", { key: 'fe655431da67831a02855510e864d65895efc20e', slot: "trigger", style: { width: '50%' } }, "Open select"), h("div", { key: '01fc39c99c6f2bc2eabda4c8a26ab6aa46ea49d3', slot: "content", style: { width: '400px' } }, h("cat-select", { key: '7bd02aadc9a84797f4868e9a236e9af7245a2bd7', label: "Single with tagging support", ref: el => (this.singleSelectTagging = el), value: { id: '', tag: 'Albania' }, placeholder: "Search for a country or capital", onCatChange: () => console.log('Single change', this.singleSelectTagging?.value), tagHint: "new country", tags: true, clearable: true, errorUpdate: false, style: { width: '90%' } })))));
9038
10986
  }
9039
10987
  get countryConnector() {
9040
10988
  return {
@@ -10290,7 +12238,7 @@ const CatSkeleton = class {
10290
12238
  this.lines = undefined;
10291
12239
  }
10292
12240
  render() {
10293
- return (h(Host, { key: '87c950d3e3d3ee5b8518adf2cf8b64ee1efee533' }, Array.from(Array(this.count)).map(() => (h("div", { style: this.style, class: {
12241
+ return (h(Host, { key: 'a19807a77a26996cffe07ac155ad7765618b5845' }, Array.from(Array(this.count)).map(() => (h("div", { style: this.style, class: {
10294
12242
  skeleton: true,
10295
12243
  [`skeleton-${this.effect}`]: Boolean(this.effect),
10296
12244
  [`skeleton-${this.variant}`]: Boolean(this.variant),
@@ -10330,9 +12278,9 @@ const CatSpinner = class {
10330
12278
  this.a11yLabel = undefined;
10331
12279
  }
10332
12280
  render() {
10333
- return (h("span", { key: '0d0291bbe429aab9c2e29eddc4f30e49fff688be', "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', class: {
12281
+ return (h("span", { key: '9959df68cbff0d66f606eddd9ad4d28e6387016c', "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', class: {
10334
12282
  [`spinner-${this.size}`]: this.size !== 'inline'
10335
- } }, h("svg", { key: 'cf2afc31127f79c98db843a3486b8ded495f1d0f', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" }, h("circle", { key: '93a4fbe77e50120eaeb171fb347f9262ca228262', cx: "24", cy: "24", r: "21.5" }))));
12283
+ } }, h("svg", { key: '5f1f119ac83d334ef537e58a18631b064504de42', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" }, h("circle", { key: 'c86f44033ed4cd7b13e08332dd0219001a1aa05d', cx: "24", cy: "24", r: "21.5" }))));
10336
12284
  }
10337
12285
  };
10338
12286
  CatSpinner.style = CatSpinnerStyle0;
@@ -10364,7 +12312,7 @@ const CatTab = class {
10364
12312
  this.catClick.emit(event);
10365
12313
  }
10366
12314
  render() {
10367
- return h(Host, { key: '90cadd626e7b128e0b45ca482b56659714a782f5' });
12315
+ return h(Host, { key: 'd82385eb808736eea3c76a3df8381b9d4e0d742e' });
10368
12316
  }
10369
12317
  get hostElement() { return getElement(this); }
10370
12318
  };
@@ -10428,7 +12376,7 @@ const CatTabs = class {
10428
12376
  this.activate(this.tabs[index]);
10429
12377
  }
10430
12378
  render() {
10431
- return (h(Host, { key: '94f164ecb863a882bbe537eafab2585d9db86668' }, this.tabs.map((tab) => {
12379
+ return (h(Host, { key: '94b84f077e41ac18206865152cabfc9f3a51ccc0' }, this.tabs.map((tab) => {
10432
12380
  return (h("cat-button", { buttonId: tab.id, role: "tab", part: "tab", class: {
10433
12381
  'cat-tab': true,
10434
12382
  'cat-tab-active': tab.id === this.activeTab,
@@ -10548,15 +12496,15 @@ const CatTextarea = class {
10548
12496
  }
10549
12497
  }
10550
12498
  render() {
10551
- return (h(Host, { key: 'a63d3665fbcd9525f524e38c6dd0691288ba3f0f' }, h("div", { key: '46fc76eb9a81499b948cf0a0749d2e1e5a756a08', class: {
12499
+ return (h(Host, { key: 'cb67b2133a56d47e02cc099e0a52670d8b2ba808' }, h("div", { key: 'bd7af8f7626ea32983a2cd2595556722b9384384', class: {
10552
12500
  'textarea-field': true,
10553
12501
  'textarea-horizontal': this.horizontal
10554
- } }, h("div", { key: '986dba66ccf0da2f0f20d624e4924b30cd19615d', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id, part: "label" }, h("span", { class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, h("div", { class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), this.maxLength && (h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.length ?? 0, "/", this.maxLength))))))), h("div", { key: '531df74c444c7927fd423125c055477e088a9f32', class: "textarea-container" }, h("div", { key: '56e11b8a7115423964349121f372b59249b7da2f', class: {
12502
+ } }, h("div", { key: '58eaf7f6f077148933667818c80ba7c61f3f599c', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id, part: "label" }, h("span", { class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, h("div", { class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), this.maxLength && (h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.length ?? 0, "/", this.maxLength))))))), h("div", { key: '697555f611a053df4df7dfe12cbd7e6fdcb4f0a1', class: "textarea-container" }, h("div", { key: '85c1b4a93bf03b3b6046f310bbb841d312638d3b', class: {
10555
12503
  'textarea-wrapper': true,
10556
12504
  'textarea-readonly': this.readonly,
10557
12505
  'textarea-disabled': this.disabled,
10558
12506
  'textarea-invalid': this.invalid
10559
- } }, h("textarea", { key: '11230cb5c9508d5a44172902d0f72e6305b11a65', ...this.nativeAttributes, part: "textarea", ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, maxlength: this.maxLength, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.invalid && (h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l", onClick: () => this.textarea.focus() }))), this.hasHint && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap }))))));
12507
+ } }, h("textarea", { key: '2646d5e59ea09e361c87ad1635d641c9ce2d1fb6', ...this.nativeAttributes, part: "textarea", ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, maxlength: this.maxLength, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.invalid && (h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l", onClick: () => this.textarea.focus() }))), this.hasHint && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap }))))));
10560
12508
  }
10561
12509
  get hasHint() {
10562
12510
  return !!this.hint || !!this.hasSlottedHint || this.invalid;
@@ -10603,6 +12551,221 @@ const CatTextarea = class {
10603
12551
  };
10604
12552
  CatTextarea.style = CatTextareaStyle0;
10605
12553
 
12554
+ function getHour12(language) {
12555
+ const dateStr = new Intl.DateTimeFormat(language, { hour: '2-digit', minute: '2-digit' })
12556
+ .format(new Date())
12557
+ .toLowerCase();
12558
+ return dateStr.includes('am') || dateStr.includes('pm');
12559
+ }
12560
+ function getLocale(language) {
12561
+ return {
12562
+ change: catI18nRegistry.t('timepicker.change'),
12563
+ choose: catI18nRegistry.t('timepicker.choose'),
12564
+ timeFormat: getHour12(language) ? '12' : '24'
12565
+ };
12566
+ }
12567
+
12568
+ function clampTime(min, date, max) {
12569
+ const [, hhMin, mmMin] = min?.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
12570
+ const [, hhMax, mmMax] = max?.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
12571
+ let minTime = -Infinity;
12572
+ let maxTime = Infinity;
12573
+ if (hhMin !== undefined && mmMin !== undefined) {
12574
+ minTime = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hhMin, mmMin).getTime();
12575
+ }
12576
+ if (hhMax !== undefined && mmMax !== undefined) {
12577
+ maxTime = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hhMax, mmMax).getTime();
12578
+ }
12579
+ return new Date(Math.min(Math.max(date.getTime(), minTime), maxTime));
12580
+ }
12581
+ function isBefore(date, time) {
12582
+ const [, hh, mm] = time?.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
12583
+ if (hh === undefined || mm === undefined) {
12584
+ return false;
12585
+ }
12586
+ return date.getHours() < hh || (date.getHours() === hh && date.getMinutes() < mm);
12587
+ }
12588
+ function isAfter(date, time) {
12589
+ const [, hh, mm] = time?.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
12590
+ if (hh === undefined || mm === undefined) {
12591
+ return false;
12592
+ }
12593
+ return date.getHours() > hh || (date.getHours() === hh && date.getMinutes() > mm);
12594
+ }
12595
+
12596
+ const catTimeCss = ":host{display:block}:host([hidden]){display:none}.label-aria{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.cat-time-addon{margin-left:-1px}nav{max-height:16rem}nav ul{list-style:none;margin:0;padding:0}.time-disabled{opacity:0.25}";
12597
+ const CatTimeStyle0 = catTimeCss;
12598
+
12599
+ const CatTime = class {
12600
+ constructor(hostRef) {
12601
+ registerInstance(this, hostRef);
12602
+ this.catChange = createEvent(this, "catChange", 7);
12603
+ this.catFocus = createEvent(this, "catFocus", 7);
12604
+ this.catBlur = createEvent(this, "catBlur", 7);
12605
+ this.language = catI18nRegistry.getLocale();
12606
+ this.locale = getLocale(this.language);
12607
+ this.hasSlottedLabel = false;
12608
+ this.hasSlottedHint = false;
12609
+ this.selectionTime = null;
12610
+ this.isAm = true;
12611
+ this.requiredMarker = 'optional';
12612
+ this.horizontal = false;
12613
+ this.autoComplete = undefined;
12614
+ this.clearable = false;
12615
+ this.disabled = false;
12616
+ this.hint = undefined;
12617
+ this.icon = undefined;
12618
+ this.iconRight = false;
12619
+ this.identifier = undefined;
12620
+ this.label = '';
12621
+ this.labelHidden = false;
12622
+ this.max = undefined;
12623
+ this.min = undefined;
12624
+ this.name = undefined;
12625
+ this.placeholder = undefined;
12626
+ this.textPrefix = undefined;
12627
+ this.textSuffix = undefined;
12628
+ this.readonly = false;
12629
+ this.required = false;
12630
+ this.value = undefined;
12631
+ this.errors = undefined;
12632
+ this.errorUpdate = 0;
12633
+ this.nativeAttributes = undefined;
12634
+ this.placement = 'bottom-end';
12635
+ this.step = 30;
12636
+ }
12637
+ componentWillLoad() {
12638
+ this.syncValue(this.value ?? '');
12639
+ }
12640
+ componentWillRender() {
12641
+ this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
12642
+ this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
12643
+ }
12644
+ componentDidLoad() {
12645
+ this.input?.mask({
12646
+ time: true,
12647
+ timeFormat: this.locale.timeFormat,
12648
+ timePattern: ['h', 'm']
12649
+ });
12650
+ }
12651
+ onOpen() {
12652
+ const query = (selector) => this.hostElement.shadowRoot?.querySelector(selector);
12653
+ const time = clampTime(this.min ?? null, this.selectionTime ?? new Date(2000, 5, 1, 8), this.max ?? null);
12654
+ const elem1 = query(`[data-time="${this.formatIso(time)}"]`);
12655
+ time.setMinutes(Math.floor(time.getMinutes() / this.step) * this.step);
12656
+ const elem2 = query(`[data-time="${this.formatIso(time)}"]`);
12657
+ setTimeout(() => {
12658
+ (elem2 ?? elem1)?.doFocus();
12659
+ (elem2 ?? elem1)?.scrollIntoView(this.selectionTime ? { block: 'center' } : undefined);
12660
+ }); // not entirely sure why this is necessary
12661
+ }
12662
+ /**
12663
+ * Select a time in the picker.
12664
+ *
12665
+ * @param date The time to select.
12666
+ */
12667
+ async select(date) {
12668
+ const oldValue = this.value;
12669
+ if (!date) {
12670
+ this.selectionTime = null;
12671
+ this.value = undefined;
12672
+ }
12673
+ else {
12674
+ const time = clampTime(this.min ?? null, date, this.max ?? null);
12675
+ this.isAm = this.format(time).toLowerCase().includes('am');
12676
+ this.selectionTime = time;
12677
+ this.value = this.formatIso(time);
12678
+ }
12679
+ // we need to set the input explicitly to sync the input even without a
12680
+ // rerender (if the value is not changed)
12681
+ if (this.input) {
12682
+ this.input.value = this.format(this.selectionTime, false);
12683
+ }
12684
+ if (oldValue !== this.value) {
12685
+ this.catChange.emit(this.value);
12686
+ }
12687
+ }
12688
+ /**
12689
+ * Programmatically move focus to the input. Use this method instead of
12690
+ * `input.focus()`.
12691
+ *
12692
+ * @param options An optional object providing options to control aspects of
12693
+ * the focusing process.
12694
+ */
12695
+ async doFocus(options) {
12696
+ this.input?.doFocus(options);
12697
+ }
12698
+ /**
12699
+ * Programmatically remove focus from the input. Use this method instead of
12700
+ * `input.blur()`.
12701
+ */
12702
+ async doBlur() {
12703
+ this.input?.doBlur();
12704
+ }
12705
+ /**
12706
+ * Clear the input.
12707
+ */
12708
+ async clear() {
12709
+ this.input?.clear();
12710
+ }
12711
+ render() {
12712
+ return (h(Host, { key: '417fe04aff5d229b3f99595cd464ed1b35a64655' }, h("cat-input", { key: 'a240ad76627fcc5013d8e51e0728e0296dbb0e42', class: "cat-time-input", ref: el => (this.input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, label: this.label, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, value: this.format(this.selectionTime, false), errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, onCatFocus: e => this.catFocus.emit(e.detail), onCatBlur: e => this.onInputBlur(e.detail) }, h("span", { key: 'cf2026f70a32a5df5331b82d1d64cb4695a0b42e', slot: "label" }, this.hasSlottedLabel && h("slot", { name: "label" }), !this.hasSlottedLabel && this.label, h("span", { key: '46b4a5363823a48d5569f77bcbadbaf0ef93e7b1', class: "label-aria" }, " (HH:mm)")), h("div", { key: 'cfad61c399b5b4a487b211976e61c3e33fb37a98', slot: "addon", class: "cat-time-addon" }, this.locale.timeFormat === '12' && (h("cat-button", { class: "cat-time-format", disabled: this.disabled || this.readonly, onCatClick: () => this.toggleAm() }, this.isAm ? 'AM' : 'PM')), h("cat-dropdown", { key: '2a158234c4cc55920105b326cdf31fbe02fedfb7', slot: "addon", placement: this.placement }, h("cat-button", { key: '1aa21b054ef608a4f1e9cc32312a762fa64d8b2d', slot: "trigger", class: "cat-time-toggle", disabled: this.disabled || this.readonly, icon: "$cat:timepicker-clock", iconOnly: true, a11yLabel: this.selectionTime ? `${this.locale.change}, ${this.format(this.selectionTime)}` : this.locale.choose }), h("nav", { key: 'dd604da9f2244c970ca62ca68385cc86d0b98bef', slot: "content", class: "cat-nav" }, h("ul", { key: '3c5e331defd7f192c27aab7085f5337a2eaf0fe7' }, this.timeArray().map(time => {
12713
+ const isoTime = this.formatIso(time);
12714
+ const disabled = isBefore(time, this.min ?? null) || isAfter(time, this.max ?? null);
12715
+ return (h("li", null, h("cat-button", { class: {
12716
+ 'cat-nav-item': true,
12717
+ 'time-disabled': disabled
12718
+ }, disabled: disabled, active: isoTime === this.value, color: isoTime === this.value ? 'primary' : 'secondary', variant: isoTime === this.value ? 'filled' : 'outlined', onCatClick: () => this.select(time), "data-time": isoTime }, this.format(time))));
12719
+ }))))), this.hasSlottedHint && (h("span", { slot: "hint" }, h("slot", { name: "hint" }))))));
12720
+ }
12721
+ timeArray() {
12722
+ const result = [];
12723
+ const start = new Date(2000, 5, 1, 0, 0, 0);
12724
+ let time = new Date(start.getTime());
12725
+ while (time.getDate() === start.getDate()) {
12726
+ result.push(time);
12727
+ time = new Date(time.getTime() + this.step * 60000);
12728
+ }
12729
+ return result;
12730
+ }
12731
+ syncValue(value) {
12732
+ const [, hh, mm] = value.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
12733
+ if (hh === undefined || mm === undefined) {
12734
+ this.select(null);
12735
+ return;
12736
+ }
12737
+ this.select(this.locale.timeFormat === '24'
12738
+ ? new Date(2000, 5, 1, hh, mm, 0)
12739
+ : new Date(2000, 5, 1, (hh % 12) + (this.isAm ? 0 : 12), mm, 0));
12740
+ }
12741
+ toggleAm() {
12742
+ if (this.selectionTime) {
12743
+ this.select(new Date(this.selectionTime.getTime() + (this.isAm ? 12 : -12) * 3600000));
12744
+ }
12745
+ else {
12746
+ this.isAm = !this.isAm;
12747
+ }
12748
+ }
12749
+ onInputBlur(e) {
12750
+ this.syncValue(this.input?.value ?? '');
12751
+ this.catBlur.emit(e);
12752
+ }
12753
+ format(date, includeAmPm = true) {
12754
+ const str = date
12755
+ ? new Intl.DateTimeFormat(this.language, {
12756
+ hour: '2-digit',
12757
+ minute: '2-digit'
12758
+ }).format(date)
12759
+ : '';
12760
+ return includeAmPm ? str : str.replace(/\s?(am|pm)/i, '');
12761
+ }
12762
+ formatIso(date) {
12763
+ return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
12764
+ }
12765
+ get hostElement() { return getElement(this); }
12766
+ };
12767
+ CatTime.style = CatTimeStyle0;
12768
+
10606
12769
  const catToggleCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}:host{display:flex;flex-direction:column;gap:0.5rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.label-left{flex-direction:row-reverse}input{position:absolute;margin:0;width:2rem;height:1.25rem;opacity:0;cursor:inherit}.toggle-placeholder{width:calc(2rem + 1px);flex-shrink:0}.toggle{flex:0 0 auto;display:flex;align-items:center;justify-content:center;position:relative;width:2rem;height:1.25rem;border-radius:10rem;background-color:rgb(var(--cat-border-color-dark, 215, 219, 224));transition:background-color 125ms ease;pointer-events:none}:checked+.toggle{background-color:rgb(var(--cat-primary-bg, 0, 129, 148))}:focus-visible+.toggle{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.toggle::after{content:\"\";position:absolute;width:1rem;height:1rem;background:#fff;border-radius:10rem;transform:translateX(calc(2px - 0.5rem));transition:transform 125ms linear;box-shadow:0 1px 2px rgba(27, 31, 38, 0.06), 0 1px 3px rgba(27, 31, 38, 0.1)}:checked+.toggle::after{transform:translateX(calc(-2px + 0.5rem));background:rgb(var(--cat-primary-fill, 255, 255, 255))}.is-disabled .toggle{background-color:rgb(var(--cat-border-color-dark, 215, 219, 224))}:host(.cat-error) .toggle{background-color:rgba(var(--cat-danger-bg, 217, 52, 13), 0.2)}:host(.cat-error) :checked+.toggle{background-color:rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) :checked+.toggle::after{background:rgb(var(--cat-danger-fill, 255, 255, 255))}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}";
10607
12770
  const CatToggleStyle0 = catToggleCss;
10608
12771
 
@@ -10661,7 +12824,7 @@ const CatToggle = class {
10661
12824
  this.input.blur();
10662
12825
  }
10663
12826
  render() {
10664
- return (h(Host, { key: '4b3382d701601d99d73293b42204c75a626fb931' }, h("label", { key: '43cb12fa74fa2208c4bd194a89a564ec574bb47e', htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, h("input", { key: 'd515d70a2a6e0301d9749e765093f85e3fdfd9ae', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, class: "form-check-input", role: "switch", onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), h("span", { key: 'fc31a34c19aa738c80b46c07a2bf84ac512f5c56', class: "toggle" }), h("span", { key: '31445ceb7673fb76b71c8f038b57ec4b7aeb4ded', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), this.hasHint && (h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { class: "toggle-placeholder" }), h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
12827
+ return (h(Host, { key: '1cc91400d302cd19fa92216ec3fdf45ae869b761' }, h("label", { key: '981ac74c7a9aa3324cab60067849e2ffff9d4158', htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, h("input", { key: 'f4c1a4398f73d2c3da8fd26b360d4a4d94dae3c3', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, class: "form-check-input", role: "switch", onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), h("span", { key: '4a8c4e21fcb48dc3f2260d5abfcf2351fa0eeb13', class: "toggle" }), h("span", { key: 'b911ffc5f29252efba3989e494eca1c5ec0fbd54', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), this.hasHint && (h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { class: "toggle-placeholder" }), h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
10665
12828
  }
10666
12829
  get hasHint() {
10667
12830
  return !!this.hint || !!this.hasSlottedHint;
@@ -10748,12 +12911,12 @@ const CatTooltip = class {
10748
12911
  }
10749
12912
  }
10750
12913
  render() {
10751
- return (h(Host, { key: '96ef4df283a341b1db46cf696b8b564ceac066da' }, h("slot", { key: 'ee530f90636a06425eb285cc594ba310deb9dca6' }), h("div", { key: '8d689cb8641c1f1eb59f0fe956ae63513bebf8ae', ref: el => (this.tooltip = el), id: this.id, role: "tooltip", "aria-hidden": !this.open, "aria-live": this.open ? 'polite' : 'off', class: {
12914
+ return (h(Host, { key: 'f1bfba8c8ce1a2d43959b18b00627af819536428' }, h("slot", { key: '0366fe88ce8bd0382beed9c298dbd945cad70bec' }), h("div", { key: 'dd9f7cd786780cd64e3fa2670f516eda71d15351', ref: el => (this.tooltip = el), id: this.id, role: "tooltip", "aria-hidden": !this.open, "aria-live": this.open ? 'polite' : 'off', class: {
10752
12915
  tooltip: true,
10753
12916
  'tooltip-hidden': this.inactive,
10754
12917
  'tooltip-round': this.round,
10755
12918
  [`tooltip-${this.size}`]: Boolean(this.size)
10756
- } }, h("slot", { key: 'e0dcfcc366684f8b5fdcf5f4804646e8e41ce8b1', name: "content" }, h("p", { key: '1fc7d41fedbf7808d9917245920f7c94822dc36a' }, this.content)))));
12919
+ } }, h("slot", { key: '2a6f92d2cfc845849730792f08e65ffb70c03e5f', name: "content" }, h("p", { key: '23b8d57bcb92506d5c88a59261716158b0daa0ba' }, this.content)))));
10757
12920
  }
10758
12921
  async update() {
10759
12922
  if (this.trigger && this.tooltip) {
@@ -10833,6 +12996,6 @@ CatTooltip.OFFSET = 4;
10833
12996
  CatTooltip.SHIFT_PADDING = 4;
10834
12997
  CatTooltip.style = CatTooltipStyle0;
10835
12998
 
10836
- export { CatAlert as cat_alert, CatAvatar as cat_avatar, CatBadge as cat_badge, CatButton as cat_button, CatButtonGroup as cat_button_group, CatCard as cat_card, CatCheckbox as cat_checkbox, CatDatepickerFlat as cat_datepicker, CatDatepickerInline as cat_datepicker_inline, CatDropdown as cat_dropdown, CatFormGroup as cat_form_group, CatIcon as cat_icon, CatInput as cat_input, CatPagination as cat_pagination, CatRadio as cat_radio, CatRadioGroup as cat_radio_group, CatScrollable as cat_scrollable, CatSelect as cat_select, CatSelectTest as cat_select_demo, CatSkeleton as cat_skeleton, CatSpinner as cat_spinner, CatTab as cat_tab, CatTabs as cat_tabs, CatTextarea as cat_textarea, CatToggle as cat_toggle, CatTooltip as cat_tooltip };
12999
+ export { CatAlert as cat_alert, CatAvatar as cat_avatar, CatBadge as cat_badge, CatButton as cat_button, CatButtonGroup as cat_button_group, CatCard as cat_card, CatCheckbox as cat_checkbox, CatDate as cat_date, CatDatepickerFlat as cat_datepicker, CatDatepickerInline as cat_datepicker_inline, CatDropdown as cat_dropdown, CatFormGroup as cat_form_group, CatIcon as cat_icon, CatInput as cat_input, CatPagination as cat_pagination, CatRadio as cat_radio, CatRadioGroup as cat_radio_group, CatScrollable as cat_scrollable, CatSelect as cat_select, CatSelectTest as cat_select_demo, CatSkeleton as cat_skeleton, CatSpinner as cat_spinner, CatTab as cat_tab, CatTabs as cat_tabs, CatTextarea as cat_textarea, CatTime as cat_time, CatToggle as cat_toggle, CatTooltip as cat_tooltip };
10837
13000
 
10838
- //# sourceMappingURL=cat-alert_26.entry.js.map
13001
+ //# sourceMappingURL=cat-alert_28.entry.js.map