stone-kit 0.0.1106 → 0.0.1107

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 (271) hide show
  1. package/README.md +30 -0
  2. package/dist/App.d.ts +2 -0
  3. package/dist/App.js +10 -0
  4. package/dist/Option-DmDx_xOt.js +99 -0
  5. package/dist/PinTrans-D6OZq76b.js +10 -0
  6. package/dist/Router.d.ts +2 -0
  7. package/dist/Router.js +103 -0
  8. package/dist/SmallFilter-C-VKnbkP.js +10 -0
  9. package/dist/chunk-4WY6JWTD-BeveLKf_.js +1582 -0
  10. package/dist/components/Button/ui/Button.d.ts +1 -2
  11. package/dist/components/Button/ui/Button.js +74 -67
  12. package/dist/components/Button/ui/Button.types.d.ts +7 -5
  13. package/dist/components/Button/ui/Button.types.js +5 -3
  14. package/dist/components/CheckBox/CheckBox.d.ts +2 -0
  15. package/dist/components/CheckBox/CheckBox.js +84 -0
  16. package/dist/components/CheckBox/CheckBox.types.d.ts +17 -0
  17. package/dist/components/CheckBox/CheckBox.types.js +1 -0
  18. package/dist/components/CheckBox/index.d.ts +2 -0
  19. package/dist/components/CheckBox/index.js +4 -0
  20. package/dist/components/CheckBoxNew/CheckBox.types.d.ts +16 -0
  21. package/dist/components/CheckBoxNew/CheckBox.types.js +6 -0
  22. package/dist/components/CheckBoxNew/CheckBoxNew.d.ts +11 -0
  23. package/dist/components/CheckBoxNew/CheckBoxNew.js +45 -0
  24. package/dist/components/CheckboxSelect/index.d.ts +1 -0
  25. package/dist/components/CheckboxSelect/index.js +4 -0
  26. package/dist/components/CheckboxSelect/ui/CheckboxSelect.d.ts +18 -0
  27. package/dist/components/CheckboxSelect/ui/CheckboxSelect.js +57 -0
  28. package/dist/components/CommercialLotCard/CommercialLotCard.d.ts +2 -0
  29. package/dist/components/CommercialLotCard/CommercialLotCard.js +81 -0
  30. package/dist/components/CommercialLotCard/components/PaymentLink/PaymentLink.d.ts +6 -0
  31. package/dist/components/CommercialLotCard/components/PaymentLink/PaymentLink.js +21 -0
  32. package/dist/components/CommercialLotCard/components/Price/Price.d.ts +9 -0
  33. package/dist/components/CommercialLotCard/components/Price/Price.js +39 -0
  34. package/dist/components/CommercialLotCard/components/Snippets/Snippets.d.ts +6 -0
  35. package/dist/components/CommercialLotCard/components/Snippets/Snippets.js +100 -0
  36. package/dist/components/CommercialLotCard/components/Tags/Tags.d.ts +7 -0
  37. package/dist/components/CommercialLotCard/components/Tags/Tags.js +37 -0
  38. package/dist/components/CommercialLotCard/types/CommercialLotCard.types.d.ts +10 -0
  39. package/dist/components/CommercialLotCard/types/CommercialLotCard.types.js +1 -0
  40. package/dist/components/CommercialLotCard/types/LotCard.d.ts +386 -0
  41. package/dist/components/CommercialLotCard/types/LotCard.js +1 -0
  42. package/dist/components/CommercialLotCard/utils/formatPrice.d.ts +1 -0
  43. package/dist/components/CommercialLotCard/utils/formatPrice.js +8 -0
  44. package/dist/components/CommercialLotCard/utils/getTagsFeatures.d.ts +4 -0
  45. package/dist/components/CommercialLotCard/utils/getTagsFeatures.js +13 -0
  46. package/dist/components/DestinationTab/ui/DestinationTab.d.ts +0 -1
  47. package/dist/components/DestinationTab/ui/DestinationTab.js +41 -41
  48. package/dist/components/DestinationTab/ui/DestinationTab.types.d.ts +0 -1
  49. package/dist/components/FavoriteIcon/FavoriteIcon.d.ts +7 -0
  50. package/dist/components/FavoriteIcon/FavoriteIcon.js +66 -0
  51. package/dist/components/FavoriteIcon/Heart.d.ts +3 -0
  52. package/dist/components/FavoriteIcon/Heart.js +24 -0
  53. package/dist/components/FavoriteIcon/HeartFilled.d.ts +5 -0
  54. package/dist/components/FavoriteIcon/HeartFilled.js +27 -0
  55. package/dist/components/FieldInput/ui/FieldInput.d.ts +1 -2
  56. package/dist/components/FieldInput/ui/FieldInput.js +28 -7
  57. package/dist/components/FieldInput/ui/FieldInput.types.d.ts +3 -1
  58. package/dist/components/FilterWithSave/hooks/useFilterWithSave.d.ts +43 -0
  59. package/dist/components/FilterWithSave/hooks/useFilterWithSave.js +56 -0
  60. package/dist/components/FilterWithSave/ui/FilterWithSave.d.ts +29 -0
  61. package/dist/components/FilterWithSave/ui/FilterWithSave.js +325 -0
  62. package/dist/components/Flex/ui/Flex.d.ts +0 -1
  63. package/dist/components/Flex/ui/Flex.js +1 -1
  64. package/dist/components/Flex/ui/Flex.types.d.ts +0 -1
  65. package/dist/components/FormModal/ui/ModalForm.d.ts +60 -0
  66. package/dist/components/FormModal/ui/ModalForm.js +1518 -0
  67. package/dist/components/FormModal/utils/reg.d.ts +4 -0
  68. package/dist/components/FormModal/utils/reg.js +6 -0
  69. package/dist/components/GroupedInput/ui/GroupedInputs.d.ts +0 -1
  70. package/dist/components/GroupedInput/ui/GroupedInputs.js +5 -5
  71. package/dist/components/GroupedInput/ui/GroupedInputs.types.d.ts +0 -1
  72. package/dist/components/Input/ui/Input.d.ts +28 -0
  73. package/dist/components/Input/ui/Input.js +3247 -49
  74. package/dist/components/Input/ui/Input.types.d.ts +0 -23
  75. package/dist/components/Input/ui/Input.types.js +1 -7
  76. package/dist/components/Logo/ui/Logo.d.ts +1 -2
  77. package/dist/components/Logo/ui/Logo.js +58 -33
  78. package/dist/components/Logo/ui/Logo.types.d.ts +13 -1
  79. package/dist/components/Logo/ui/Logo.types.js +14 -1
  80. package/dist/components/LotCard/hooks/useLotCard.d.ts +25 -0
  81. package/dist/components/LotCard/hooks/useLotCard.js +13 -0
  82. package/dist/components/LotCard/ui/LotCard.d.ts +1 -2
  83. package/dist/components/LotCard/ui/LotCard.js +203 -104
  84. package/dist/components/LotCard/ui/LotCard.types.d.ts +234 -75
  85. package/dist/components/LotCard/utils/checkBedroomsCount.js +2 -2
  86. package/dist/components/LotCard/utils/const.d.ts +8 -0
  87. package/dist/components/LotCard/utils/const.js +11 -0
  88. package/dist/components/LotCard/utils/formatPrice.d.ts +1 -1
  89. package/dist/components/LotCard/utils/formatPrice.js +5 -6
  90. package/dist/components/LotCard/utils/getTagsFeatures.d.ts +4 -0
  91. package/dist/components/LotCard/utils/getTagsFeatures.js +13 -0
  92. package/dist/components/LotCard/utils/monthlyPayment.d.ts +1 -0
  93. package/dist/components/LotCard/utils/monthlyPayment.js +4 -0
  94. package/dist/components/LotCardSkeleton/index.d.ts +1 -0
  95. package/dist/components/LotCardSkeleton/index.js +4 -0
  96. package/dist/components/LotCardSkeleton/ui/LotCardSkeleton.d.ts +5 -0
  97. package/dist/components/LotCardSkeleton/ui/LotCardSkeleton.js +83 -0
  98. package/dist/components/MetroLabel/ui/MetroLabel.d.ts +0 -1
  99. package/dist/components/MetroLabel/ui/MetroLabel.js +19 -19
  100. package/dist/components/MetroLabel/ui/MetroLabel.types.d.ts +0 -1
  101. package/dist/components/MetroTag/ui/MetroTag.d.ts +1 -2
  102. package/dist/components/MetroTag/ui/MetroTag.js +121 -25
  103. package/dist/components/MetroTag/ui/MetroTag.types.d.ts +21 -6
  104. package/dist/components/Modal/ui/Modal.d.ts +2 -17
  105. package/dist/components/Modal/ui/Modal.js +63 -19594
  106. package/dist/components/Modal/ui/Modal.types.d.ts +21 -0
  107. package/dist/components/ModalSuccess/ModalSuccess.d.ts +2 -0
  108. package/dist/components/ModalSuccess/ModalSuccess.js +60 -0
  109. package/dist/components/ModalSuccess/ModalSuccess.types.d.ts +8 -0
  110. package/dist/components/ModalSuccess/ModalSuccess.types.js +1 -0
  111. package/dist/components/ModalSuccess/index.d.ts +1 -0
  112. package/dist/components/ModalSuccess/index.js +4 -0
  113. package/dist/components/NewIcon/icons/PinTrans.d.ts +3 -0
  114. package/dist/components/NewIcon/icons/PinTrans.js +6 -0
  115. package/dist/components/NewIcon/icons/SmallFilter.d.ts +3 -0
  116. package/dist/components/NewIcon/icons/SmallFilter.js +6 -0
  117. package/dist/components/NewIcon/index.d.ts +1 -1
  118. package/dist/components/NewIcon/index.js +3 -2
  119. package/dist/components/NewIcon/ui/NewIcon.d.ts +2 -2
  120. package/dist/components/NewIcon/ui/NewIcon.js +204 -99
  121. package/dist/components/NewIcon/ui/NewIcon.types.d.ts +0 -1
  122. package/dist/components/NewIcon/ui/iconTypes.d.ts +3 -0
  123. package/dist/components/NewIcon/ui/iconTypes.js +60 -0
  124. package/dist/components/ProjectCardSkeleton/index.d.ts +1 -0
  125. package/dist/components/ProjectCardSkeleton/index.js +4 -0
  126. package/dist/components/ProjectCardSkeleton/ui/ProjectCardSkeleton.d.ts +1 -0
  127. package/dist/components/ProjectCardSkeleton/ui/ProjectCardSkeleton.js +32 -0
  128. package/dist/components/RoundButton/ui/RoundButton.d.ts +1 -2
  129. package/dist/components/RoundButton/ui/RoundButton.js +56 -45
  130. package/dist/components/RoundButton/ui/RoundButton.types.d.ts +10 -2
  131. package/dist/components/RoundButton/ui/RoundButton.types.js +13 -6
  132. package/dist/components/Select/model/selectMode.d.ts +16 -0
  133. package/dist/components/Select/model/selectMode.js +64 -0
  134. package/dist/components/Select/ui/Category.d.ts +13 -0
  135. package/dist/components/Select/ui/Category.js +79 -0
  136. package/dist/components/Select/ui/Option.d.ts +15 -0
  137. package/dist/components/Select/ui/Option.js +7 -0
  138. package/dist/components/Select/ui/Select.d.ts +1 -3
  139. package/dist/components/Select/ui/Select.js +196 -79
  140. package/dist/components/Select/ui/Select.types.d.ts +62 -8
  141. package/dist/components/SliderNavigation/index.d.ts +0 -1
  142. package/dist/components/SliderNavigation/ui/SliderNavigation.d.ts +1 -2
  143. package/dist/components/SliderNavigation/ui/SliderNavigation.js +45 -32
  144. package/dist/components/SliderNavigation/ui/SliderNavigation.types.d.ts +7 -0
  145. package/dist/components/SortSelect/hooks/useSortSelect.d.ts +5 -4
  146. package/dist/components/SortSelect/hooks/useSortSelect.js +2 -2
  147. package/dist/components/SortSelect/ui/SortSelect.d.ts +0 -1
  148. package/dist/components/SortSelect/ui/SortSelect.js +67 -56
  149. package/dist/components/SortSelect/ui/SortSelect.types.d.ts +9 -2
  150. package/dist/components/SummarySelect/index.d.ts +1 -0
  151. package/dist/components/SummarySelect/index.js +4 -0
  152. package/dist/components/SummarySelect/ui/SummarySelect.d.ts +15 -0
  153. package/dist/components/SummarySelect/ui/SummarySelect.js +172 -0
  154. package/dist/components/Switcher/ui/Switcher.d.ts +1 -2
  155. package/dist/components/Switcher/ui/Switcher.js +45 -30
  156. package/dist/components/Switcher/ui/Switcher.types.d.ts +3 -1
  157. package/dist/components/TabSelect/index.d.ts +1 -0
  158. package/dist/components/TabSelect/index.js +4 -0
  159. package/dist/components/TabSelect/ui/TabSelect.d.ts +32 -0
  160. package/dist/components/TabSelect/ui/TabSelect.js +64 -0
  161. package/dist/components/TabSelect/ui/TabSelect.types.d.ts +0 -0
  162. package/dist/components/TabSelect/ui/TabSelect.types.js +1 -0
  163. package/dist/components/TabSwitcher/ui/TabSwitcher.d.ts +4 -4
  164. package/dist/components/TabSwitcher/ui/TabSwitcher.js +114 -34
  165. package/dist/components/TabSwitcher/ui/TabSwitcher.types.d.ts +23 -4
  166. package/dist/components/Tag/ui/Tag.d.ts +1 -2
  167. package/dist/components/Tag/ui/Tag.js +96 -44
  168. package/dist/components/Tag/ui/Tag.types.d.ts +22 -2
  169. package/dist/components/Tag/ui/Tag.types.js +20 -3
  170. package/dist/components/Text/ui/Text.d.ts +1 -2
  171. package/dist/components/Text/ui/Text.js +20 -27
  172. package/dist/components/Text/ui/Text.types.d.ts +0 -1
  173. package/dist/components/TextArea/TextArea.d.ts +8 -0
  174. package/dist/components/TextArea/TextArea.js +25 -0
  175. package/dist/components/ZoomControls/index.d.ts +1 -0
  176. package/dist/components/ZoomControls/index.js +4 -0
  177. package/dist/components/ZoomControls/ui/ZoomControls.d.ts +2 -0
  178. package/dist/components/ZoomControls/ui/ZoomControls.js +33 -0
  179. package/dist/components/ZoomControls/ui/ZoomControls.types.d.ts +6 -0
  180. package/dist/components/ZoomControls/ui/ZoomControls.types.js +1 -0
  181. package/dist/components/mobileButton/ui/MobileButton.d.ts +0 -1
  182. package/dist/components/mobileButton/ui/MobileButton.js +38 -38
  183. package/dist/components/mobileButton/ui/MobileButton.types.d.ts +0 -1
  184. package/dist/index-BJwl9stn.js +33872 -0
  185. package/dist/index-YnD2EP-S.js +43 -0
  186. package/dist/layout/Layout.d.ts +5 -0
  187. package/dist/layout/Layout.js +11 -0
  188. package/dist/layout/components/Header/Header.d.ts +1 -0
  189. package/dist/layout/components/Header/Header.js +141 -0
  190. package/dist/layout/components/Menu.d.ts +1 -0
  191. package/dist/layout/components/Menu.js +109 -0
  192. package/dist/main.d.ts +14 -0
  193. package/dist/main.js +70 -42
  194. package/dist/pages/ButtonsPage/Buttons.d.ts +1 -0
  195. package/dist/pages/ButtonsPage/Buttons.js +106 -0
  196. package/dist/pages/CheckboxPage/CheckboxPage.d.ts +1 -0
  197. package/dist/pages/CheckboxPage/CheckboxPage.js +224 -0
  198. package/dist/pages/FormsPage/FormsPage.d.ts +2 -0
  199. package/dist/pages/FormsPage/FormsPage.js +58 -0
  200. package/dist/pages/HomePage/HomePage.d.ts +2 -0
  201. package/dist/pages/HomePage/HomePage.js +7 -0
  202. package/dist/pages/IconsPage/IconsPage.d.ts +1 -0
  203. package/dist/pages/IconsPage/IconsPage.js +19 -0
  204. package/dist/pages/InputPage/InputPage.d.ts +1 -0
  205. package/dist/pages/InputPage/InputPage.js +13 -0
  206. package/dist/pages/LogoPage/LogoPage.d.ts +1 -0
  207. package/dist/pages/LogoPage/LogoPage.js +16 -0
  208. package/dist/pages/LotsPage/LotsPage.d.ts +1 -0
  209. package/dist/pages/LotsPage/LotsPage.js +74 -0
  210. package/dist/pages/LotsPage/const.d.ts +4 -0
  211. package/dist/pages/LotsPage/const.js +678 -0
  212. package/dist/pages/ModalsPage/ModalPage.d.ts +2 -0
  213. package/dist/pages/ModalsPage/ModalPage.js +110 -0
  214. package/dist/pages/SelectPage/SelectPage.d.ts +1 -0
  215. package/dist/pages/SelectPage/SelectPage.js +211 -0
  216. package/dist/pages/SelectPage/const.d.ts +13 -0
  217. package/dist/pages/SelectPage/const.js +35 -0
  218. package/dist/pages/TabsPage/TabsPage.d.ts +2 -0
  219. package/dist/pages/TabsPage/TabsPage.js +168 -0
  220. package/dist/pages/TagsPage/TagsPage.d.ts +1 -0
  221. package/dist/pages/TagsPage/TagsPage.js +64 -0
  222. package/dist/shared/checkLargeOffice.d.ts +2 -0
  223. package/dist/shared/checkLargeOffice.js +4 -0
  224. package/dist/shared/deepEqual.d.ts +1 -0
  225. package/dist/shared/deepEqual.js +16 -0
  226. package/dist/shared/fmtNumber.d.ts +1 -0
  227. package/dist/shared/fmtNumber.js +4 -0
  228. package/dist/shared/mlnRound.d.ts +1 -0
  229. package/dist/shared/mlnRound.js +8 -0
  230. package/dist/shared/useClientWidth.d.ts +2 -0
  231. package/dist/shared/useClientWidth.js +6 -6
  232. package/dist/stone-kit.css +1 -0
  233. package/dist/stories/entities/CommercialLotCard/CommercialLotCard.stories.js +166 -0
  234. package/dist/stories/entities/index.js +4 -0
  235. package/dist/stories/shared/ui/Button/Button.stories.js +118 -0
  236. package/dist/stories/shared/ui/CheckBox/CheckBox.stories.js +71 -0
  237. package/dist/stories/shared/ui/CheckBox/CheckBoxNew.stories.js +45 -0
  238. package/dist/stories/shared/ui/CheckboxSelect/CheckboxSelect.stories.js +114 -0
  239. package/dist/stories/shared/ui/DestinationTab/DestinationTab.stories.js +89 -0
  240. package/dist/stories/shared/ui/FieldInput/FieldInput.stories.js +31 -0
  241. package/dist/stories/shared/ui/FilterWithSave/FilterWithSave.stories.js +44 -0
  242. package/dist/stories/shared/ui/Flex/Flex.stories.js +74 -0
  243. package/dist/stories/shared/ui/FormModal/FormModal.stories.js +65 -0
  244. package/dist/stories/shared/ui/GroupedInput/GroupedInput.stories.js +68 -0
  245. package/dist/stories/shared/ui/Input/Input.stories.js +82 -0
  246. package/dist/stories/shared/ui/Logo/Logo.stories.js +75 -0
  247. package/dist/stories/shared/ui/MetroLabel/MetroLabel.stories.js +91 -0
  248. package/dist/stories/shared/ui/MetroTag/MetroTag.stories.js +96 -0
  249. package/dist/stories/shared/ui/MobileButton/MobileButton.stories.js +77 -0
  250. package/dist/stories/shared/ui/Modal/Modal.stories.js +77 -0
  251. package/dist/stories/shared/ui/ModalSuccess/ModalSuccess.stories.js +34 -0
  252. package/dist/stories/shared/ui/NewIcon/NewIcon.stories.js +38 -0
  253. package/dist/stories/shared/ui/RoundButton/RoundButton.stories.js +83 -0
  254. package/dist/stories/shared/ui/Select/Select.stories.js +81 -0
  255. package/dist/stories/shared/ui/SliderNavigation/SliderNavigation.stories.js +82 -0
  256. package/dist/stories/shared/ui/SortSelect/SortSelect.stories.js +87 -0
  257. package/dist/stories/shared/ui/SummarySelect/SummarySelect.stories.js +85 -0
  258. package/dist/stories/shared/ui/Switcher/Switcher.stories.js +77 -0
  259. package/dist/stories/shared/ui/TabSelect/TabSelect.stories.js +76 -0
  260. package/dist/stories/shared/ui/TabSwitcher/TabSwitcher.stories.js +76 -0
  261. package/dist/stories/shared/ui/Tag/Tag.stories.js +51 -0
  262. package/dist/stories/shared/ui/Text/Text.stories.js +22 -0
  263. package/dist/stories/shared/ui/TextArea/TextArea.stories.js +37 -0
  264. package/dist/stories/shared/ui/ZoomControls/ZoomControls.stories.js +91 -0
  265. package/dist/stories/shared/ui/index.js +62 -0
  266. package/dist/useLotCard-D-gK4J_o.js +186 -0
  267. package/dist/useSortSelect-IeonkD5d.js +79 -0
  268. package/package.json +39 -30
  269. package/dist/index-DIxK0V-G.js +0 -44
  270. package/dist/style.css +0 -1
  271. package/dist/useSortSelect-A7A_pNcU.js +0 -76
@@ -1,57 +1,3255 @@
1
- import { jsxs as q, jsx as a } from "react/jsx-runtime";
2
- import { forwardRef as W } from "react";
3
- import { c as d } from "../../../index-DIxK0V-G.js";
4
- const h = "_inputWrapper_qoqna_10", m = "_inputWrapperPost_qoqna_34", f = "_inputWrapperPre_qoqna_35", P = "_light_qoqna_47", w = "_dark_qoqna_80", g = "_inputWrapperError_qoqna_116", r = {
5
- "auto-width": "_auto-width_qoqna_1",
6
- "full-width": "_full-width_qoqna_6",
7
- inputWrapper: h,
8
- inputWrapperPost: m,
9
- inputWrapperPre: f,
10
- light: P,
11
- dark: w,
12
- inputWrapperError: g
13
- }, $ = d.bind(r), x = W(
1
+ import { jsx as et, jsxs as Vt, Fragment as ne } from "react/jsx-runtime";
2
+ import J, { forwardRef as ae } from "react";
3
+ import { g as ue, c as oe } from "../../../index-YnD2EP-S.js";
4
+ const le = "_inputWrapper_1ln65_10", he = "_inputIMask_1ln65_37", pe = "_inputWrapperPost_1ln65_41", ce = "_inputWrapperPre_1ln65_42", de = "_light_1ln65_58", fe = "_gray_1ln65_96", _e = "_dark_1ln65_128", me = "_transparent_1ln65_169", ge = "_inputWrapperError_1ln65_227", ke = "_inputWrapperErrorWithoutBorder_1ln65_241", ve = "_inputWrapperErrorDark_1ln65_252", Ee = "_checkBox_1ln65_266", M = {
5
+ "auto-width": "_auto-width_1ln65_1",
6
+ "full-width": "_full-width_1ln65_6",
7
+ inputWrapper: le,
8
+ inputIMask: he,
9
+ inputWrapperPost: pe,
10
+ inputWrapperPre: ce,
11
+ light: de,
12
+ gray: fe,
13
+ dark: _e,
14
+ transparent: me,
15
+ inputWrapperError: ge,
16
+ inputWrapperErrorWithoutBorder: ke,
17
+ inputWrapperErrorDark: ve,
18
+ checkBox: Ee,
19
+ "tiny-size_s": "_tiny-size_s_1ln65_270",
20
+ "small-size_s": "_small-size_s_1ln65_278",
21
+ "medium-size_s": "_medium-size_s_1ln65_286",
22
+ "large-size_s": "_large-size_s_1ln65_294",
23
+ "tiny-size_m": "_tiny-size_m_1ln65_303",
24
+ "small-size_m": "_small-size_m_1ln65_310",
25
+ "medium-size_m": "_medium-size_m_1ln65_317",
26
+ "large-size_m": "_large-size_m_1ln65_324",
27
+ "tiny-size_l": "_tiny-size_l_1ln65_333",
28
+ "small-size_l": "_small-size_l_1ln65_340",
29
+ "medium-size_l": "_medium-size_l_1ln65_347",
30
+ "large-size_l": "_large-size_l_1ln65_354"
31
+ };
32
+ function G(a) {
33
+ return typeof a == "string" || a instanceof String;
34
+ }
35
+ function Pt(a) {
36
+ var t;
37
+ return typeof a == "object" && a != null && (a == null || (t = a.constructor) == null ? void 0 : t.name) === "Object";
38
+ }
39
+ function Gt(a, t) {
40
+ return Array.isArray(t) ? Gt(a, (e, s) => t.includes(s)) : Object.entries(a).reduce((e, s) => {
41
+ let [i, r] = s;
42
+ return t(r, i) && (e[i] = r), e;
43
+ }, {});
44
+ }
45
+ const _ = {
46
+ NONE: "NONE",
47
+ LEFT: "LEFT",
48
+ FORCE_LEFT: "FORCE_LEFT",
49
+ RIGHT: "RIGHT",
50
+ FORCE_RIGHT: "FORCE_RIGHT"
51
+ };
52
+ function ye(a) {
53
+ switch (a) {
54
+ case _.LEFT:
55
+ return _.FORCE_LEFT;
56
+ case _.RIGHT:
57
+ return _.FORCE_RIGHT;
58
+ default:
59
+ return a;
60
+ }
61
+ }
62
+ function bt(a) {
63
+ return a.replace(/([.*+?^=!:${}()|[\]/\\])/g, "\\$1");
64
+ }
65
+ function ht(a, t) {
66
+ if (t === a) return !0;
67
+ const e = Array.isArray(t), s = Array.isArray(a);
68
+ let i;
69
+ if (e && s) {
70
+ if (t.length != a.length) return !1;
71
+ for (i = 0; i < t.length; i++) if (!ht(t[i], a[i])) return !1;
72
+ return !0;
73
+ }
74
+ if (e != s) return !1;
75
+ if (t && a && typeof t == "object" && typeof a == "object") {
76
+ const r = t instanceof Date, n = a instanceof Date;
77
+ if (r && n) return t.getTime() == a.getTime();
78
+ if (r != n) return !1;
79
+ const u = t instanceof RegExp, o = a instanceof RegExp;
80
+ if (u && o) return t.toString() == a.toString();
81
+ if (u != o) return !1;
82
+ const h = Object.keys(t);
83
+ for (i = 0; i < h.length; i++) if (!Object.prototype.hasOwnProperty.call(a, h[i])) return !1;
84
+ for (i = 0; i < h.length; i++) if (!ht(a[h[i]], t[h[i]])) return !1;
85
+ return !0;
86
+ } else if (t && a && typeof t == "function" && typeof a == "function")
87
+ return t.toString() === a.toString();
88
+ return !1;
89
+ }
90
+ class Ce {
91
+ /** Current input value */
92
+ /** Current cursor position */
93
+ /** Old input value */
94
+ /** Old selection */
95
+ constructor(t) {
96
+ for (Object.assign(this, t); this.value.slice(0, this.startChangePos) !== this.oldValue.slice(0, this.startChangePos); )
97
+ --this.oldSelection.start;
98
+ if (this.insertedCount)
99
+ for (; this.value.slice(this.cursorPos) !== this.oldValue.slice(this.oldSelection.end); )
100
+ this.value.length - this.cursorPos < this.oldValue.length - this.oldSelection.end ? ++this.oldSelection.end : ++this.cursorPos;
101
+ }
102
+ /** Start changing position */
103
+ get startChangePos() {
104
+ return Math.min(this.cursorPos, this.oldSelection.start);
105
+ }
106
+ /** Inserted symbols count */
107
+ get insertedCount() {
108
+ return this.cursorPos - this.startChangePos;
109
+ }
110
+ /** Inserted symbols */
111
+ get inserted() {
112
+ return this.value.substr(this.startChangePos, this.insertedCount);
113
+ }
114
+ /** Removed symbols count */
115
+ get removedCount() {
116
+ return Math.max(this.oldSelection.end - this.startChangePos || // for Delete
117
+ this.oldValue.length - this.value.length, 0);
118
+ }
119
+ /** Removed symbols */
120
+ get removed() {
121
+ return this.oldValue.substr(this.startChangePos, this.removedCount);
122
+ }
123
+ /** Unchanged head symbols */
124
+ get head() {
125
+ return this.value.substring(0, this.startChangePos);
126
+ }
127
+ /** Unchanged tail symbols */
128
+ get tail() {
129
+ return this.value.substring(this.startChangePos + this.insertedCount);
130
+ }
131
+ /** Remove direction */
132
+ get removeDirection() {
133
+ return !this.removedCount || this.insertedCount ? _.NONE : (this.oldSelection.end === this.cursorPos || this.oldSelection.start === this.cursorPos) && // if not range removed (event with backspace)
134
+ this.oldSelection.end === this.oldSelection.start ? _.RIGHT : _.LEFT;
135
+ }
136
+ }
137
+ function k(a, t) {
138
+ return new k.InputMask(a, t);
139
+ }
140
+ function Zt(a) {
141
+ if (a == null) throw new Error("mask property should be defined");
142
+ return a instanceof RegExp ? k.MaskedRegExp : G(a) ? k.MaskedPattern : a === Date ? k.MaskedDate : a === Number ? k.MaskedNumber : Array.isArray(a) || a === Array ? k.MaskedDynamic : k.Masked && a.prototype instanceof k.Masked ? a : k.Masked && a instanceof k.Masked ? a.constructor : a instanceof Function ? k.MaskedFunction : (console.warn("Mask not found for mask", a), k.Masked);
143
+ }
144
+ function it(a) {
145
+ if (!a) throw new Error("Options in not defined");
146
+ if (k.Masked) {
147
+ if (a.prototype instanceof k.Masked) return {
148
+ mask: a
149
+ };
150
+ const {
151
+ mask: t = void 0,
152
+ ...e
153
+ } = a instanceof k.Masked ? {
154
+ mask: a
155
+ } : Pt(a) && a.mask instanceof k.Masked ? a : {};
156
+ if (t) {
157
+ const s = t.mask;
158
+ return {
159
+ ...Gt(t, (i, r) => !r.startsWith("_")),
160
+ mask: t.constructor,
161
+ _mask: s,
162
+ ...e
163
+ };
164
+ }
165
+ }
166
+ return Pt(a) ? {
167
+ ...a
168
+ } : {
169
+ mask: a
170
+ };
171
+ }
172
+ function K(a) {
173
+ if (k.Masked && a instanceof k.Masked) return a;
174
+ const t = it(a), e = Zt(t.mask);
175
+ if (!e) throw new Error("Masked class is not found for provided mask " + t.mask + ", appropriate module needs to be imported manually before creating mask.");
176
+ return t.mask === e && delete t.mask, t._mask && (t.mask = t._mask, delete t._mask), new e(t);
177
+ }
178
+ k.createMask = K;
179
+ class Mt {
180
+ /** */
181
+ /** */
182
+ /** */
183
+ /** Safely returns selection start */
184
+ get selectionStart() {
185
+ let t;
186
+ try {
187
+ t = this._unsafeSelectionStart;
188
+ } catch {
189
+ }
190
+ return t ?? this.value.length;
191
+ }
192
+ /** Safely returns selection end */
193
+ get selectionEnd() {
194
+ let t;
195
+ try {
196
+ t = this._unsafeSelectionEnd;
197
+ } catch {
198
+ }
199
+ return t ?? this.value.length;
200
+ }
201
+ /** Safely sets element selection */
202
+ select(t, e) {
203
+ if (!(t == null || e == null || t === this.selectionStart && e === this.selectionEnd))
204
+ try {
205
+ this._unsafeSelect(t, e);
206
+ } catch {
207
+ }
208
+ }
209
+ /** */
210
+ get isActive() {
211
+ return !1;
212
+ }
213
+ /** */
214
+ /** */
215
+ /** */
216
+ }
217
+ k.MaskElement = Mt;
218
+ const Lt = 90, Ae = 89;
219
+ class ct extends Mt {
220
+ /** HTMLElement to use mask on */
221
+ constructor(t) {
222
+ super(), this.input = t, this._onKeydown = this._onKeydown.bind(this), this._onInput = this._onInput.bind(this), this._onBeforeinput = this._onBeforeinput.bind(this), this._onCompositionEnd = this._onCompositionEnd.bind(this);
223
+ }
224
+ get rootElement() {
225
+ var t, e, s;
226
+ return (t = (e = (s = this.input).getRootNode) == null ? void 0 : e.call(s)) != null ? t : document;
227
+ }
228
+ /** Is element in focus */
229
+ get isActive() {
230
+ return this.input === this.rootElement.activeElement;
231
+ }
232
+ /** Binds HTMLElement events to mask internal events */
233
+ bindEvents(t) {
234
+ this.input.addEventListener("keydown", this._onKeydown), this.input.addEventListener("input", this._onInput), this.input.addEventListener("beforeinput", this._onBeforeinput), this.input.addEventListener("compositionend", this._onCompositionEnd), this.input.addEventListener("drop", t.drop), this.input.addEventListener("click", t.click), this.input.addEventListener("focus", t.focus), this.input.addEventListener("blur", t.commit), this._handlers = t;
235
+ }
236
+ _onKeydown(t) {
237
+ if (this._handlers.redo && (t.keyCode === Lt && t.shiftKey && (t.metaKey || t.ctrlKey) || t.keyCode === Ae && t.ctrlKey))
238
+ return t.preventDefault(), this._handlers.redo(t);
239
+ if (this._handlers.undo && t.keyCode === Lt && (t.metaKey || t.ctrlKey))
240
+ return t.preventDefault(), this._handlers.undo(t);
241
+ t.isComposing || this._handlers.selectionChange(t);
242
+ }
243
+ _onBeforeinput(t) {
244
+ if (t.inputType === "historyUndo" && this._handlers.undo)
245
+ return t.preventDefault(), this._handlers.undo(t);
246
+ if (t.inputType === "historyRedo" && this._handlers.redo)
247
+ return t.preventDefault(), this._handlers.redo(t);
248
+ }
249
+ _onCompositionEnd(t) {
250
+ this._handlers.input(t);
251
+ }
252
+ _onInput(t) {
253
+ t.isComposing || this._handlers.input(t);
254
+ }
255
+ /** Unbinds HTMLElement events to mask internal events */
256
+ unbindEvents() {
257
+ this.input.removeEventListener("keydown", this._onKeydown), this.input.removeEventListener("input", this._onInput), this.input.removeEventListener("beforeinput", this._onBeforeinput), this.input.removeEventListener("compositionend", this._onCompositionEnd), this.input.removeEventListener("drop", this._handlers.drop), this.input.removeEventListener("click", this._handlers.click), this.input.removeEventListener("focus", this._handlers.focus), this.input.removeEventListener("blur", this._handlers.commit), this._handlers = {};
258
+ }
259
+ }
260
+ k.HTMLMaskElement = ct;
261
+ class be extends ct {
262
+ /** InputElement to use mask on */
263
+ constructor(t) {
264
+ super(t), this.input = t;
265
+ }
266
+ /** Returns InputElement selection start */
267
+ get _unsafeSelectionStart() {
268
+ return this.input.selectionStart != null ? this.input.selectionStart : this.value.length;
269
+ }
270
+ /** Returns InputElement selection end */
271
+ get _unsafeSelectionEnd() {
272
+ return this.input.selectionEnd;
273
+ }
274
+ /** Sets InputElement selection */
275
+ _unsafeSelect(t, e) {
276
+ this.input.setSelectionRange(t, e);
277
+ }
278
+ get value() {
279
+ return this.input.value;
280
+ }
281
+ set value(t) {
282
+ this.input.value = t;
283
+ }
284
+ }
285
+ k.HTMLMaskElement = ct;
286
+ class Xt extends ct {
287
+ /** Returns HTMLElement selection start */
288
+ get _unsafeSelectionStart() {
289
+ const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset, i = e && e.focusOffset;
290
+ return i == null || s == null || s < i ? s : i;
291
+ }
292
+ /** Returns HTMLElement selection end */
293
+ get _unsafeSelectionEnd() {
294
+ const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset, i = e && e.focusOffset;
295
+ return i == null || s == null || s > i ? s : i;
296
+ }
297
+ /** Sets HTMLElement selection */
298
+ _unsafeSelect(t, e) {
299
+ if (!this.rootElement.createRange) return;
300
+ const s = this.rootElement.createRange();
301
+ s.setStart(this.input.firstChild || this.input, t), s.setEnd(this.input.lastChild || this.input, e);
302
+ const i = this.rootElement, r = i.getSelection && i.getSelection();
303
+ r && (r.removeAllRanges(), r.addRange(s));
304
+ }
305
+ /** HTMLElement value */
306
+ get value() {
307
+ return this.input.textContent || "";
308
+ }
309
+ set value(t) {
310
+ this.input.textContent = t;
311
+ }
312
+ }
313
+ k.HTMLContenteditableMaskElement = Xt;
314
+ class dt {
315
+ constructor() {
316
+ this.states = [], this.currentIndex = 0;
317
+ }
318
+ get currentState() {
319
+ return this.states[this.currentIndex];
320
+ }
321
+ get isEmpty() {
322
+ return this.states.length === 0;
323
+ }
324
+ push(t) {
325
+ this.currentIndex < this.states.length - 1 && (this.states.length = this.currentIndex + 1), this.states.push(t), this.states.length > dt.MAX_LENGTH && this.states.shift(), this.currentIndex = this.states.length - 1;
326
+ }
327
+ go(t) {
328
+ return this.currentIndex = Math.min(Math.max(this.currentIndex + t, 0), this.states.length - 1), this.currentState;
329
+ }
330
+ undo() {
331
+ return this.go(-1);
332
+ }
333
+ redo() {
334
+ return this.go(1);
335
+ }
336
+ clear() {
337
+ this.states.length = 0, this.currentIndex = 0;
338
+ }
339
+ }
340
+ dt.MAX_LENGTH = 100;
341
+ class xe {
342
+ /**
343
+ View element
344
+ */
345
+ /** Internal {@link Masked} model */
346
+ constructor(t, e) {
347
+ this.el = t instanceof Mt ? t : t.isContentEditable && t.tagName !== "INPUT" && t.tagName !== "TEXTAREA" ? new Xt(t) : new be(t), this.masked = K(e), this._listeners = {}, this._value = "", this._unmaskedValue = "", this._rawInputValue = "", this.history = new dt(), this._saveSelection = this._saveSelection.bind(this), this._onInput = this._onInput.bind(this), this._onChange = this._onChange.bind(this), this._onDrop = this._onDrop.bind(this), this._onFocus = this._onFocus.bind(this), this._onClick = this._onClick.bind(this), this._onUndo = this._onUndo.bind(this), this._onRedo = this._onRedo.bind(this), this.alignCursor = this.alignCursor.bind(this), this.alignCursorFriendly = this.alignCursorFriendly.bind(this), this._bindEvents(), this.updateValue(), this._onChange();
348
+ }
349
+ maskEquals(t) {
350
+ var e;
351
+ return t == null || ((e = this.masked) == null ? void 0 : e.maskEquals(t));
352
+ }
353
+ /** Masked */
354
+ get mask() {
355
+ return this.masked.mask;
356
+ }
357
+ set mask(t) {
358
+ if (this.maskEquals(t)) return;
359
+ if (!(t instanceof k.Masked) && this.masked.constructor === Zt(t)) {
360
+ this.masked.updateOptions({
361
+ mask: t
362
+ });
363
+ return;
364
+ }
365
+ const e = t instanceof k.Masked ? t : K({
366
+ mask: t
367
+ });
368
+ e.unmaskedValue = this.masked.unmaskedValue, this.masked = e;
369
+ }
370
+ /** Raw value */
371
+ get value() {
372
+ return this._value;
373
+ }
374
+ set value(t) {
375
+ this.value !== t && (this.masked.value = t, this.updateControl("auto"));
376
+ }
377
+ /** Unmasked value */
378
+ get unmaskedValue() {
379
+ return this._unmaskedValue;
380
+ }
381
+ set unmaskedValue(t) {
382
+ this.unmaskedValue !== t && (this.masked.unmaskedValue = t, this.updateControl("auto"));
383
+ }
384
+ /** Raw input value */
385
+ get rawInputValue() {
386
+ return this._rawInputValue;
387
+ }
388
+ set rawInputValue(t) {
389
+ this.rawInputValue !== t && (this.masked.rawInputValue = t, this.updateControl(), this.alignCursor());
390
+ }
391
+ /** Typed unmasked value */
392
+ get typedValue() {
393
+ return this.masked.typedValue;
394
+ }
395
+ set typedValue(t) {
396
+ this.masked.typedValueEquals(t) || (this.masked.typedValue = t, this.updateControl("auto"));
397
+ }
398
+ /** Display value */
399
+ get displayValue() {
400
+ return this.masked.displayValue;
401
+ }
402
+ /** Starts listening to element events */
403
+ _bindEvents() {
404
+ this.el.bindEvents({
405
+ selectionChange: this._saveSelection,
406
+ input: this._onInput,
407
+ drop: this._onDrop,
408
+ click: this._onClick,
409
+ focus: this._onFocus,
410
+ commit: this._onChange,
411
+ undo: this._onUndo,
412
+ redo: this._onRedo
413
+ });
414
+ }
415
+ /** Stops listening to element events */
416
+ _unbindEvents() {
417
+ this.el && this.el.unbindEvents();
418
+ }
419
+ /** Fires custom event */
420
+ _fireEvent(t, e) {
421
+ const s = this._listeners[t];
422
+ s && s.forEach((i) => i(e));
423
+ }
424
+ /** Current selection start */
425
+ get selectionStart() {
426
+ return this._cursorChanging ? this._changingCursorPos : this.el.selectionStart;
427
+ }
428
+ /** Current cursor position */
429
+ get cursorPos() {
430
+ return this._cursorChanging ? this._changingCursorPos : this.el.selectionEnd;
431
+ }
432
+ set cursorPos(t) {
433
+ !this.el || !this.el.isActive || (this.el.select(t, t), this._saveSelection());
434
+ }
435
+ /** Stores current selection */
436
+ _saveSelection() {
437
+ this.displayValue !== this.el.value && console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."), this._selection = {
438
+ start: this.selectionStart,
439
+ end: this.cursorPos
440
+ };
441
+ }
442
+ /** Syncronizes model value from view */
443
+ updateValue() {
444
+ this.masked.value = this.el.value, this._value = this.masked.value, this._unmaskedValue = this.masked.unmaskedValue, this._rawInputValue = this.masked.rawInputValue;
445
+ }
446
+ /** Syncronizes view from model value, fires change events */
447
+ updateControl(t) {
448
+ const e = this.masked.unmaskedValue, s = this.masked.value, i = this.masked.rawInputValue, r = this.displayValue, n = this.unmaskedValue !== e || this.value !== s || this._rawInputValue !== i;
449
+ this._unmaskedValue = e, this._value = s, this._rawInputValue = i, this.el.value !== r && (this.el.value = r), t === "auto" ? this.alignCursor() : t != null && (this.cursorPos = t), n && this._fireChangeEvents(), !this._historyChanging && (n || this.history.isEmpty) && this.history.push({
450
+ unmaskedValue: e,
451
+ selection: {
452
+ start: this.selectionStart,
453
+ end: this.cursorPos
454
+ }
455
+ });
456
+ }
457
+ /** Updates options with deep equal check, recreates {@link Masked} model if mask type changes */
458
+ updateOptions(t) {
459
+ const {
460
+ mask: e,
461
+ ...s
462
+ } = t, i = !this.maskEquals(e), r = this.masked.optionsIsChanged(s);
463
+ i && (this.mask = e), r && this.masked.updateOptions(s), (i || r) && this.updateControl();
464
+ }
465
+ /** Updates cursor */
466
+ updateCursor(t) {
467
+ t != null && (this.cursorPos = t, this._delayUpdateCursor(t));
468
+ }
469
+ /** Delays cursor update to support mobile browsers */
470
+ _delayUpdateCursor(t) {
471
+ this._abortUpdateCursor(), this._changingCursorPos = t, this._cursorChanging = setTimeout(() => {
472
+ this.el && (this.cursorPos = this._changingCursorPos, this._abortUpdateCursor());
473
+ }, 10);
474
+ }
475
+ /** Fires custom events */
476
+ _fireChangeEvents() {
477
+ this._fireEvent("accept", this._inputEvent), this.masked.isComplete && this._fireEvent("complete", this._inputEvent);
478
+ }
479
+ /** Aborts delayed cursor update */
480
+ _abortUpdateCursor() {
481
+ this._cursorChanging && (clearTimeout(this._cursorChanging), delete this._cursorChanging);
482
+ }
483
+ /** Aligns cursor to nearest available position */
484
+ alignCursor() {
485
+ this.cursorPos = this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos, _.LEFT));
486
+ }
487
+ /** Aligns cursor only if selection is empty */
488
+ alignCursorFriendly() {
489
+ this.selectionStart === this.cursorPos && this.alignCursor();
490
+ }
491
+ /** Adds listener on custom event */
492
+ on(t, e) {
493
+ return this._listeners[t] || (this._listeners[t] = []), this._listeners[t].push(e), this;
494
+ }
495
+ /** Removes custom event listener */
496
+ off(t, e) {
497
+ if (!this._listeners[t]) return this;
498
+ if (!e)
499
+ return delete this._listeners[t], this;
500
+ const s = this._listeners[t].indexOf(e);
501
+ return s >= 0 && this._listeners[t].splice(s, 1), this;
502
+ }
503
+ /** Handles view input event */
504
+ _onInput(t) {
505
+ this._inputEvent = t, this._abortUpdateCursor();
506
+ const e = new Ce({
507
+ // new state
508
+ value: this.el.value,
509
+ cursorPos: this.cursorPos,
510
+ // old state
511
+ oldValue: this.displayValue,
512
+ oldSelection: this._selection
513
+ }), s = this.masked.rawInputValue, i = this.masked.splice(e.startChangePos, e.removed.length, e.inserted, e.removeDirection, {
514
+ input: !0,
515
+ raw: !0
516
+ }).offset, r = s === this.masked.rawInputValue ? e.removeDirection : _.NONE;
517
+ let n = this.masked.nearestInputPos(e.startChangePos + i, r);
518
+ r !== _.NONE && (n = this.masked.nearestInputPos(n, _.NONE)), this.updateControl(n), delete this._inputEvent;
519
+ }
520
+ /** Handles view change event and commits model value */
521
+ _onChange() {
522
+ this.displayValue !== this.el.value && this.updateValue(), this.masked.doCommit(), this.updateControl(), this._saveSelection();
523
+ }
524
+ /** Handles view drop event, prevents by default */
525
+ _onDrop(t) {
526
+ t.preventDefault(), t.stopPropagation();
527
+ }
528
+ /** Restore last selection on focus */
529
+ _onFocus(t) {
530
+ this.alignCursorFriendly();
531
+ }
532
+ /** Restore last selection on focus */
533
+ _onClick(t) {
534
+ this.alignCursorFriendly();
535
+ }
536
+ _onUndo() {
537
+ this._applyHistoryState(this.history.undo());
538
+ }
539
+ _onRedo() {
540
+ this._applyHistoryState(this.history.redo());
541
+ }
542
+ _applyHistoryState(t) {
543
+ t && (this._historyChanging = !0, this.unmaskedValue = t.unmaskedValue, this.el.select(t.selection.start, t.selection.end), this._saveSelection(), this._historyChanging = !1);
544
+ }
545
+ /** Unbind view events and removes element reference */
546
+ destroy() {
547
+ this._unbindEvents(), this._listeners.length = 0, delete this.el;
548
+ }
549
+ }
550
+ k.InputMask = xe;
551
+ class E {
552
+ /** Inserted symbols */
553
+ /** Additional offset if any changes occurred before tail */
554
+ /** Raw inserted is used by dynamic mask */
555
+ /** Can skip chars */
556
+ static normalize(t) {
557
+ return Array.isArray(t) ? t : [t, new E()];
558
+ }
559
+ constructor(t) {
560
+ Object.assign(this, {
561
+ inserted: "",
562
+ rawInserted: "",
563
+ tailShift: 0,
564
+ skip: !1
565
+ }, t);
566
+ }
567
+ /** Aggregate changes */
568
+ aggregate(t) {
569
+ return this.inserted += t.inserted, this.rawInserted += t.rawInserted, this.tailShift += t.tailShift, this.skip = this.skip || t.skip, this;
570
+ }
571
+ /** Total offset considering all changes */
572
+ get offset() {
573
+ return this.tailShift + this.inserted.length;
574
+ }
575
+ get consumed() {
576
+ return !!this.rawInserted || this.skip;
577
+ }
578
+ equals(t) {
579
+ return this.inserted === t.inserted && this.tailShift === t.tailShift && this.rawInserted === t.rawInserted && this.skip === t.skip;
580
+ }
581
+ }
582
+ k.ChangeDetails = E;
583
+ class Y {
584
+ /** Tail value as string */
585
+ /** Tail start position */
586
+ /** Start position */
587
+ constructor(t, e, s) {
588
+ t === void 0 && (t = ""), e === void 0 && (e = 0), this.value = t, this.from = e, this.stop = s;
589
+ }
590
+ toString() {
591
+ return this.value;
592
+ }
593
+ extend(t) {
594
+ this.value += String(t);
595
+ }
596
+ appendTo(t) {
597
+ return t.append(this.toString(), {
598
+ tail: !0
599
+ }).aggregate(t._appendPlaceholder());
600
+ }
601
+ get state() {
602
+ return {
603
+ value: this.value,
604
+ from: this.from,
605
+ stop: this.stop
606
+ };
607
+ }
608
+ set state(t) {
609
+ Object.assign(this, t);
610
+ }
611
+ unshift(t) {
612
+ if (!this.value.length || t != null && this.from >= t) return "";
613
+ const e = this.value[0];
614
+ return this.value = this.value.slice(1), e;
615
+ }
616
+ shift() {
617
+ if (!this.value.length) return "";
618
+ const t = this.value[this.value.length - 1];
619
+ return this.value = this.value.slice(0, -1), t;
620
+ }
621
+ }
622
+ class L {
623
+ /** */
624
+ /** */
625
+ /** Transforms value before mask processing */
626
+ /** Transforms each char before mask processing */
627
+ /** Validates if value is acceptable */
628
+ /** Does additional processing at the end of editing */
629
+ /** Format typed value to string */
630
+ /** Parse string to get typed value */
631
+ /** Enable characters overwriting */
632
+ /** */
633
+ /** */
634
+ /** */
635
+ /** */
636
+ constructor(t) {
637
+ this._value = "", this._update({
638
+ ...L.DEFAULTS,
639
+ ...t
640
+ }), this._initialized = !0;
641
+ }
642
+ /** Sets and applies new options */
643
+ updateOptions(t) {
644
+ this.optionsIsChanged(t) && this.withValueRefresh(this._update.bind(this, t));
645
+ }
646
+ /** Sets new options */
647
+ _update(t) {
648
+ Object.assign(this, t);
649
+ }
650
+ /** Mask state */
651
+ get state() {
652
+ return {
653
+ _value: this.value,
654
+ _rawInputValue: this.rawInputValue
655
+ };
656
+ }
657
+ set state(t) {
658
+ this._value = t._value;
659
+ }
660
+ /** Resets value */
661
+ reset() {
662
+ this._value = "";
663
+ }
664
+ get value() {
665
+ return this._value;
666
+ }
667
+ set value(t) {
668
+ this.resolve(t, {
669
+ input: !0
670
+ });
671
+ }
672
+ /** Resolve new value */
673
+ resolve(t, e) {
674
+ e === void 0 && (e = {
675
+ input: !0
676
+ }), this.reset(), this.append(t, e, ""), this.doCommit();
677
+ }
678
+ get unmaskedValue() {
679
+ return this.value;
680
+ }
681
+ set unmaskedValue(t) {
682
+ this.resolve(t, {});
683
+ }
684
+ get typedValue() {
685
+ return this.parse ? this.parse(this.value, this) : this.unmaskedValue;
686
+ }
687
+ set typedValue(t) {
688
+ this.format ? this.value = this.format(t, this) : this.unmaskedValue = String(t);
689
+ }
690
+ /** Value that includes raw user input */
691
+ get rawInputValue() {
692
+ return this.extractInput(0, this.displayValue.length, {
693
+ raw: !0
694
+ });
695
+ }
696
+ set rawInputValue(t) {
697
+ this.resolve(t, {
698
+ raw: !0
699
+ });
700
+ }
701
+ get displayValue() {
702
+ return this.value;
703
+ }
704
+ get isComplete() {
705
+ return !0;
706
+ }
707
+ get isFilled() {
708
+ return this.isComplete;
709
+ }
710
+ /** Finds nearest input position in direction */
711
+ nearestInputPos(t, e) {
712
+ return t;
713
+ }
714
+ totalInputPositions(t, e) {
715
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), Math.min(this.displayValue.length, e - t);
716
+ }
717
+ /** Extracts value in range considering flags */
718
+ extractInput(t, e, s) {
719
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), this.displayValue.slice(t, e);
720
+ }
721
+ /** Extracts tail in range */
722
+ extractTail(t, e) {
723
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), new Y(this.extractInput(t, e), t);
724
+ }
725
+ /** Appends tail */
726
+ appendTail(t) {
727
+ return G(t) && (t = new Y(String(t))), t.appendTo(this);
728
+ }
729
+ /** Appends char */
730
+ _appendCharRaw(t, e) {
731
+ return t ? (this._value += t, new E({
732
+ inserted: t,
733
+ rawInserted: t
734
+ })) : new E();
735
+ }
736
+ /** Appends char */
737
+ _appendChar(t, e, s) {
738
+ e === void 0 && (e = {});
739
+ const i = this.state;
740
+ let r;
741
+ if ([t, r] = this.doPrepareChar(t, e), t && (r = r.aggregate(this._appendCharRaw(t, e)), !r.rawInserted && this.autofix === "pad")) {
742
+ const n = this.state;
743
+ this.state = i;
744
+ let u = this.pad(e);
745
+ const o = this._appendCharRaw(t, e);
746
+ u = u.aggregate(o), o.rawInserted || u.equals(r) ? r = u : this.state = n;
747
+ }
748
+ if (r.inserted) {
749
+ let n, u = this.doValidate(e) !== !1;
750
+ if (u && s != null) {
751
+ const o = this.state;
752
+ if (this.overwrite === !0) {
753
+ n = s.state;
754
+ for (let m = 0; m < r.rawInserted.length; ++m)
755
+ s.unshift(this.displayValue.length - r.tailShift);
756
+ }
757
+ let h = this.appendTail(s);
758
+ if (u = h.rawInserted.length === s.toString().length, !(u && h.inserted) && this.overwrite === "shift") {
759
+ this.state = o, n = s.state;
760
+ for (let m = 0; m < r.rawInserted.length; ++m)
761
+ s.shift();
762
+ h = this.appendTail(s), u = h.rawInserted.length === s.toString().length;
763
+ }
764
+ u && h.inserted && (this.state = o);
765
+ }
766
+ u || (r = new E(), this.state = i, s && n && (s.state = n));
767
+ }
768
+ return r;
769
+ }
770
+ /** Appends optional placeholder at the end */
771
+ _appendPlaceholder() {
772
+ return new E();
773
+ }
774
+ /** Appends optional eager placeholder at the end */
775
+ _appendEager() {
776
+ return new E();
777
+ }
778
+ /** Appends symbols considering flags */
779
+ append(t, e, s) {
780
+ if (!G(t)) throw new Error("value should be string");
781
+ const i = G(s) ? new Y(String(s)) : s;
782
+ e != null && e.tail && (e._beforeTailState = this.state);
783
+ let r;
784
+ [t, r] = this.doPrepare(t, e);
785
+ for (let n = 0; n < t.length; ++n) {
786
+ const u = this._appendChar(t[n], e, i);
787
+ if (!u.rawInserted && !this.doSkipInvalid(t[n], e, i)) break;
788
+ r.aggregate(u);
789
+ }
790
+ return (this.eager === !0 || this.eager === "append") && e != null && e.input && t && r.aggregate(this._appendEager()), i != null && (r.tailShift += this.appendTail(i).tailShift), r;
791
+ }
792
+ remove(t, e) {
793
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), this._value = this.displayValue.slice(0, t) + this.displayValue.slice(e), new E();
794
+ }
795
+ /** Calls function and reapplies current value */
796
+ withValueRefresh(t) {
797
+ if (this._refreshing || !this._initialized) return t();
798
+ this._refreshing = !0;
799
+ const e = this.rawInputValue, s = this.value, i = t();
800
+ return this.rawInputValue = e, this.value && this.value !== s && s.indexOf(this.value) === 0 && (this.append(s.slice(this.displayValue.length), {}, ""), this.doCommit()), delete this._refreshing, i;
801
+ }
802
+ runIsolated(t) {
803
+ if (this._isolated || !this._initialized) return t(this);
804
+ this._isolated = !0;
805
+ const e = this.state, s = t(this);
806
+ return this.state = e, delete this._isolated, s;
807
+ }
808
+ doSkipInvalid(t, e, s) {
809
+ return !!this.skipInvalid;
810
+ }
811
+ /** Prepares string before mask processing */
812
+ doPrepare(t, e) {
813
+ return e === void 0 && (e = {}), E.normalize(this.prepare ? this.prepare(t, this, e) : t);
814
+ }
815
+ /** Prepares each char before mask processing */
816
+ doPrepareChar(t, e) {
817
+ return e === void 0 && (e = {}), E.normalize(this.prepareChar ? this.prepareChar(t, this, e) : t);
818
+ }
819
+ /** Validates if value is acceptable */
820
+ doValidate(t) {
821
+ return (!this.validate || this.validate(this.value, this, t)) && (!this.parent || this.parent.doValidate(t));
822
+ }
823
+ /** Does additional processing at the end of editing */
824
+ doCommit() {
825
+ this.commit && this.commit(this.value, this);
826
+ }
827
+ splice(t, e, s, i, r) {
828
+ s === void 0 && (s = ""), i === void 0 && (i = _.NONE), r === void 0 && (r = {
829
+ input: !0
830
+ });
831
+ const n = t + e, u = this.extractTail(n), o = this.eager === !0 || this.eager === "remove";
832
+ let h;
833
+ o && (i = ye(i), h = this.extractInput(0, n, {
834
+ raw: !0
835
+ }));
836
+ let m = t;
837
+ const g = new E();
838
+ if (i !== _.NONE && (m = this.nearestInputPos(t, e > 1 && t !== 0 && !o ? _.NONE : i), g.tailShift = m - t), g.aggregate(this.remove(m)), o && i !== _.NONE && h === this.rawInputValue)
839
+ if (i === _.FORCE_LEFT) {
840
+ let y;
841
+ for (; h === this.rawInputValue && (y = this.displayValue.length); )
842
+ g.aggregate(new E({
843
+ tailShift: -1
844
+ })).aggregate(this.remove(y - 1));
845
+ } else i === _.FORCE_RIGHT && u.unshift();
846
+ return g.aggregate(this.append(s, r, u));
847
+ }
848
+ maskEquals(t) {
849
+ return this.mask === t;
850
+ }
851
+ optionsIsChanged(t) {
852
+ return !ht(this, t);
853
+ }
854
+ typedValueEquals(t) {
855
+ const e = this.typedValue;
856
+ return t === e || L.EMPTY_VALUES.includes(t) && L.EMPTY_VALUES.includes(e) || (this.format ? this.format(t, this) === this.format(this.typedValue, this) : !1);
857
+ }
858
+ pad(t) {
859
+ return new E();
860
+ }
861
+ }
862
+ L.DEFAULTS = {
863
+ skipInvalid: !0
864
+ };
865
+ L.EMPTY_VALUES = [void 0, null, ""];
866
+ k.Masked = L;
867
+ class Q {
868
+ /** */
869
+ constructor(t, e) {
870
+ t === void 0 && (t = []), e === void 0 && (e = 0), this.chunks = t, this.from = e;
871
+ }
872
+ toString() {
873
+ return this.chunks.map(String).join("");
874
+ }
875
+ extend(t) {
876
+ if (!String(t)) return;
877
+ t = G(t) ? new Y(String(t)) : t;
878
+ const e = this.chunks[this.chunks.length - 1], s = e && // if stops are same or tail has no stop
879
+ (e.stop === t.stop || t.stop == null) && // if tail chunk goes just after last chunk
880
+ t.from === e.from + e.toString().length;
881
+ if (t instanceof Y)
882
+ s ? e.extend(t.toString()) : this.chunks.push(t);
883
+ else if (t instanceof Q) {
884
+ if (t.stop == null) {
885
+ let i;
886
+ for (; t.chunks.length && t.chunks[0].stop == null; )
887
+ i = t.chunks.shift(), i.from += t.from, this.extend(i);
888
+ }
889
+ t.toString() && (t.stop = t.blockIndex, this.chunks.push(t));
890
+ }
891
+ }
892
+ appendTo(t) {
893
+ if (!(t instanceof k.MaskedPattern))
894
+ return new Y(this.toString()).appendTo(t);
895
+ const e = new E();
896
+ for (let s = 0; s < this.chunks.length; ++s) {
897
+ const i = this.chunks[s], r = t._mapPosToBlock(t.displayValue.length), n = i.stop;
898
+ let u;
899
+ if (n != null && // if block not found or stop is behind lastBlock
900
+ (!r || r.index <= n) && ((i instanceof Q || // for continuous block also check if stop is exist
901
+ t._stops.indexOf(n) >= 0) && e.aggregate(t._appendPlaceholder(n)), u = i instanceof Q && t._blocks[n]), u) {
902
+ const o = u.appendTail(i);
903
+ e.aggregate(o);
904
+ const h = i.toString().slice(o.rawInserted.length);
905
+ h && e.aggregate(t.append(h, {
906
+ tail: !0
907
+ }));
908
+ } else
909
+ e.aggregate(t.append(i.toString(), {
910
+ tail: !0
911
+ }));
912
+ }
913
+ return e;
914
+ }
915
+ get state() {
916
+ return {
917
+ chunks: this.chunks.map((t) => t.state),
918
+ from: this.from,
919
+ stop: this.stop,
920
+ blockIndex: this.blockIndex
921
+ };
922
+ }
923
+ set state(t) {
924
+ const {
925
+ chunks: e,
926
+ ...s
927
+ } = t;
928
+ Object.assign(this, s), this.chunks = e.map((i) => {
929
+ const r = "chunks" in i ? new Q() : new Y();
930
+ return r.state = i, r;
931
+ });
932
+ }
933
+ unshift(t) {
934
+ if (!this.chunks.length || t != null && this.from >= t) return "";
935
+ const e = t != null ? t - this.from : t;
936
+ let s = 0;
937
+ for (; s < this.chunks.length; ) {
938
+ const i = this.chunks[s], r = i.unshift(e);
939
+ if (i.toString()) {
940
+ if (!r) break;
941
+ ++s;
942
+ } else
943
+ this.chunks.splice(s, 1);
944
+ if (r) return r;
945
+ }
946
+ return "";
947
+ }
948
+ shift() {
949
+ if (!this.chunks.length) return "";
950
+ let t = this.chunks.length - 1;
951
+ for (; 0 <= t; ) {
952
+ const e = this.chunks[t], s = e.shift();
953
+ if (e.toString()) {
954
+ if (!s) break;
955
+ --t;
956
+ } else
957
+ this.chunks.splice(t, 1);
958
+ if (s) return s;
959
+ }
960
+ return "";
961
+ }
962
+ }
963
+ class Fe {
964
+ constructor(t, e) {
965
+ this.masked = t, this._log = [];
966
+ const {
967
+ offset: s,
968
+ index: i
969
+ } = t._mapPosToBlock(e) || (e < 0 ? (
970
+ // first
971
+ {
972
+ index: 0,
973
+ offset: 0
974
+ }
975
+ ) : (
976
+ // last
977
+ {
978
+ index: this.masked._blocks.length,
979
+ offset: 0
980
+ }
981
+ ));
982
+ this.offset = s, this.index = i, this.ok = !1;
983
+ }
984
+ get block() {
985
+ return this.masked._blocks[this.index];
986
+ }
987
+ get pos() {
988
+ return this.masked._blockStartPos(this.index) + this.offset;
989
+ }
990
+ get state() {
991
+ return {
992
+ index: this.index,
993
+ offset: this.offset,
994
+ ok: this.ok
995
+ };
996
+ }
997
+ set state(t) {
998
+ Object.assign(this, t);
999
+ }
1000
+ pushState() {
1001
+ this._log.push(this.state);
1002
+ }
1003
+ popState() {
1004
+ const t = this._log.pop();
1005
+ return t && (this.state = t), t;
1006
+ }
1007
+ bindBlock() {
1008
+ this.block || (this.index < 0 && (this.index = 0, this.offset = 0), this.index >= this.masked._blocks.length && (this.index = this.masked._blocks.length - 1, this.offset = this.block.displayValue.length));
1009
+ }
1010
+ _pushLeft(t) {
1011
+ for (this.pushState(), this.bindBlock(); 0 <= this.index; --this.index, this.offset = ((e = this.block) == null ? void 0 : e.displayValue.length) || 0) {
1012
+ var e;
1013
+ if (t()) return this.ok = !0;
1014
+ }
1015
+ return this.ok = !1;
1016
+ }
1017
+ _pushRight(t) {
1018
+ for (this.pushState(), this.bindBlock(); this.index < this.masked._blocks.length; ++this.index, this.offset = 0)
1019
+ if (t()) return this.ok = !0;
1020
+ return this.ok = !1;
1021
+ }
1022
+ pushLeftBeforeFilled() {
1023
+ return this._pushLeft(() => {
1024
+ if (!(this.block.isFixed || !this.block.value) && (this.offset = this.block.nearestInputPos(this.offset, _.FORCE_LEFT), this.offset !== 0))
1025
+ return !0;
1026
+ });
1027
+ }
1028
+ pushLeftBeforeInput() {
1029
+ return this._pushLeft(() => {
1030
+ if (!this.block.isFixed)
1031
+ return this.offset = this.block.nearestInputPos(this.offset, _.LEFT), !0;
1032
+ });
1033
+ }
1034
+ pushLeftBeforeRequired() {
1035
+ return this._pushLeft(() => {
1036
+ if (!(this.block.isFixed || this.block.isOptional && !this.block.value))
1037
+ return this.offset = this.block.nearestInputPos(this.offset, _.LEFT), !0;
1038
+ });
1039
+ }
1040
+ pushRightBeforeFilled() {
1041
+ return this._pushRight(() => {
1042
+ if (!(this.block.isFixed || !this.block.value) && (this.offset = this.block.nearestInputPos(this.offset, _.FORCE_RIGHT), this.offset !== this.block.value.length))
1043
+ return !0;
1044
+ });
1045
+ }
1046
+ pushRightBeforeInput() {
1047
+ return this._pushRight(() => {
1048
+ if (!this.block.isFixed)
1049
+ return this.offset = this.block.nearestInputPos(this.offset, _.NONE), !0;
1050
+ });
1051
+ }
1052
+ pushRightBeforeRequired() {
1053
+ return this._pushRight(() => {
1054
+ if (!(this.block.isFixed || this.block.isOptional && !this.block.value))
1055
+ return this.offset = this.block.nearestInputPos(this.offset, _.NONE), !0;
1056
+ });
1057
+ }
1058
+ }
1059
+ class Jt {
1060
+ /** */
1061
+ /** */
1062
+ /** */
1063
+ /** */
1064
+ /** */
1065
+ /** */
1066
+ constructor(t) {
1067
+ Object.assign(this, t), this._value = "", this.isFixed = !0;
1068
+ }
1069
+ get value() {
1070
+ return this._value;
1071
+ }
1072
+ get unmaskedValue() {
1073
+ return this.isUnmasking ? this.value : "";
1074
+ }
1075
+ get rawInputValue() {
1076
+ return this._isRawInput ? this.value : "";
1077
+ }
1078
+ get displayValue() {
1079
+ return this.value;
1080
+ }
1081
+ reset() {
1082
+ this._isRawInput = !1, this._value = "";
1083
+ }
1084
+ remove(t, e) {
1085
+ return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), this._value = this._value.slice(0, t) + this._value.slice(e), this._value || (this._isRawInput = !1), new E();
1086
+ }
1087
+ nearestInputPos(t, e) {
1088
+ e === void 0 && (e = _.NONE);
1089
+ const s = 0, i = this._value.length;
1090
+ switch (e) {
1091
+ case _.LEFT:
1092
+ case _.FORCE_LEFT:
1093
+ return s;
1094
+ case _.NONE:
1095
+ case _.RIGHT:
1096
+ case _.FORCE_RIGHT:
1097
+ default:
1098
+ return i;
1099
+ }
1100
+ }
1101
+ totalInputPositions(t, e) {
1102
+ return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), this._isRawInput ? e - t : 0;
1103
+ }
1104
+ extractInput(t, e, s) {
1105
+ return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), s === void 0 && (s = {}), s.raw && this._isRawInput && this._value.slice(t, e) || "";
1106
+ }
1107
+ get isComplete() {
1108
+ return !0;
1109
+ }
1110
+ get isFilled() {
1111
+ return !!this._value;
1112
+ }
1113
+ _appendChar(t, e) {
1114
+ if (e === void 0 && (e = {}), this.isFilled) return new E();
1115
+ const s = this.eager === !0 || this.eager === "append", r = this.char === t && (this.isUnmasking || e.input || e.raw) && (!e.raw || !s) && !e.tail, n = new E({
1116
+ inserted: this.char,
1117
+ rawInserted: r ? this.char : ""
1118
+ });
1119
+ return this._value = this.char, this._isRawInput = r && (e.raw || e.input), n;
1120
+ }
1121
+ _appendEager() {
1122
+ return this._appendChar(this.char, {
1123
+ tail: !0
1124
+ });
1125
+ }
1126
+ _appendPlaceholder() {
1127
+ const t = new E();
1128
+ return this.isFilled || (this._value = t.inserted = this.char), t;
1129
+ }
1130
+ extractTail() {
1131
+ return new Y("");
1132
+ }
1133
+ appendTail(t) {
1134
+ return G(t) && (t = new Y(String(t))), t.appendTo(this);
1135
+ }
1136
+ append(t, e, s) {
1137
+ const i = this._appendChar(t[0], e);
1138
+ return s != null && (i.tailShift += this.appendTail(s).tailShift), i;
1139
+ }
1140
+ doCommit() {
1141
+ }
1142
+ get state() {
1143
+ return {
1144
+ _value: this._value,
1145
+ _rawInputValue: this.rawInputValue
1146
+ };
1147
+ }
1148
+ set state(t) {
1149
+ this._value = t._value, this._isRawInput = !!t._rawInputValue;
1150
+ }
1151
+ pad(t) {
1152
+ return this._appendPlaceholder();
1153
+ }
1154
+ }
1155
+ class pt {
1156
+ /** */
1157
+ /** */
1158
+ /** */
1159
+ /** */
1160
+ /** */
1161
+ /** */
1162
+ /** */
1163
+ /** */
1164
+ constructor(t) {
1165
+ const {
1166
+ parent: e,
1167
+ isOptional: s,
1168
+ placeholderChar: i,
1169
+ displayChar: r,
1170
+ lazy: n,
1171
+ eager: u,
1172
+ ...o
1173
+ } = t;
1174
+ this.masked = K(o), Object.assign(this, {
1175
+ parent: e,
1176
+ isOptional: s,
1177
+ placeholderChar: i,
1178
+ displayChar: r,
1179
+ lazy: n,
1180
+ eager: u
1181
+ });
1182
+ }
1183
+ reset() {
1184
+ this.isFilled = !1, this.masked.reset();
1185
+ }
1186
+ remove(t, e) {
1187
+ return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), t === 0 && e >= 1 ? (this.isFilled = !1, this.masked.remove(t, e)) : new E();
1188
+ }
1189
+ get value() {
1190
+ return this.masked.value || (this.isFilled && !this.isOptional ? this.placeholderChar : "");
1191
+ }
1192
+ get unmaskedValue() {
1193
+ return this.masked.unmaskedValue;
1194
+ }
1195
+ get rawInputValue() {
1196
+ return this.masked.rawInputValue;
1197
+ }
1198
+ get displayValue() {
1199
+ return this.masked.value && this.displayChar || this.value;
1200
+ }
1201
+ get isComplete() {
1202
+ return !!this.masked.value || this.isOptional;
1203
+ }
1204
+ _appendChar(t, e) {
1205
+ if (e === void 0 && (e = {}), this.isFilled) return new E();
1206
+ const s = this.masked.state;
1207
+ let i = this.masked._appendChar(t, this.currentMaskFlags(e));
1208
+ return i.inserted && this.doValidate(e) === !1 && (i = new E(), this.masked.state = s), !i.inserted && !this.isOptional && !this.lazy && !e.input && (i.inserted = this.placeholderChar), i.skip = !i.inserted && !this.isOptional, this.isFilled = !!i.inserted, i;
1209
+ }
1210
+ append(t, e, s) {
1211
+ return this.masked.append(t, this.currentMaskFlags(e), s);
1212
+ }
1213
+ _appendPlaceholder() {
1214
+ return this.isFilled || this.isOptional ? new E() : (this.isFilled = !0, new E({
1215
+ inserted: this.placeholderChar
1216
+ }));
1217
+ }
1218
+ _appendEager() {
1219
+ return new E();
1220
+ }
1221
+ extractTail(t, e) {
1222
+ return this.masked.extractTail(t, e);
1223
+ }
1224
+ appendTail(t) {
1225
+ return this.masked.appendTail(t);
1226
+ }
1227
+ extractInput(t, e, s) {
1228
+ return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), this.masked.extractInput(t, e, s);
1229
+ }
1230
+ nearestInputPos(t, e) {
1231
+ e === void 0 && (e = _.NONE);
1232
+ const s = 0, i = this.value.length, r = Math.min(Math.max(t, s), i);
1233
+ switch (e) {
1234
+ case _.LEFT:
1235
+ case _.FORCE_LEFT:
1236
+ return this.isComplete ? r : s;
1237
+ case _.RIGHT:
1238
+ case _.FORCE_RIGHT:
1239
+ return this.isComplete ? r : i;
1240
+ case _.NONE:
1241
+ default:
1242
+ return r;
1243
+ }
1244
+ }
1245
+ totalInputPositions(t, e) {
1246
+ return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), this.value.slice(t, e).length;
1247
+ }
1248
+ doValidate(t) {
1249
+ return this.masked.doValidate(this.currentMaskFlags(t)) && (!this.parent || this.parent.doValidate(this.currentMaskFlags(t)));
1250
+ }
1251
+ doCommit() {
1252
+ this.masked.doCommit();
1253
+ }
1254
+ get state() {
1255
+ return {
1256
+ _value: this.value,
1257
+ _rawInputValue: this.rawInputValue,
1258
+ masked: this.masked.state,
1259
+ isFilled: this.isFilled
1260
+ };
1261
+ }
1262
+ set state(t) {
1263
+ this.masked.state = t.masked, this.isFilled = t.isFilled;
1264
+ }
1265
+ currentMaskFlags(t) {
1266
+ var e;
1267
+ return {
1268
+ ...t,
1269
+ _beforeTailState: (t == null || (e = t._beforeTailState) == null ? void 0 : e.masked) || t?._beforeTailState
1270
+ };
1271
+ }
1272
+ pad(t) {
1273
+ return new E();
1274
+ }
1275
+ }
1276
+ pt.DEFAULT_DEFINITIONS = {
1277
+ 0: /\d/,
1278
+ a: /[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
1279
+ // http://stackoverflow.com/a/22075070
1280
+ "*": /./
1281
+ };
1282
+ class Se extends L {
1283
+ /** */
1284
+ /** Enable characters overwriting */
1285
+ /** */
1286
+ /** */
1287
+ /** */
1288
+ updateOptions(t) {
1289
+ super.updateOptions(t);
1290
+ }
1291
+ _update(t) {
1292
+ const e = t.mask;
1293
+ e && (t.validate = (s) => s.search(e) >= 0), super._update(t);
1294
+ }
1295
+ }
1296
+ k.MaskedRegExp = Se;
1297
+ class N extends L {
1298
+ /** */
1299
+ /** */
1300
+ /** Single char for empty input */
1301
+ /** Single char for filled input */
1302
+ /** Show placeholder only when needed */
1303
+ /** Enable characters overwriting */
1304
+ /** */
1305
+ /** */
1306
+ /** */
1307
+ constructor(t) {
1308
+ super({
1309
+ ...N.DEFAULTS,
1310
+ ...t,
1311
+ definitions: Object.assign({}, pt.DEFAULT_DEFINITIONS, t?.definitions)
1312
+ });
1313
+ }
1314
+ updateOptions(t) {
1315
+ super.updateOptions(t);
1316
+ }
1317
+ _update(t) {
1318
+ t.definitions = Object.assign({}, this.definitions, t.definitions), super._update(t), this._rebuildMask();
1319
+ }
1320
+ _rebuildMask() {
1321
+ const t = this.definitions;
1322
+ this._blocks = [], this.exposeBlock = void 0, this._stops = [], this._maskedBlocks = {};
1323
+ const e = this.mask;
1324
+ if (!e || !t) return;
1325
+ let s = !1, i = !1;
1326
+ for (let r = 0; r < e.length; ++r) {
1327
+ if (this.blocks) {
1328
+ const h = e.slice(r), m = Object.keys(this.blocks).filter((y) => h.indexOf(y) === 0);
1329
+ m.sort((y, O) => O.length - y.length);
1330
+ const g = m[0];
1331
+ if (g) {
1332
+ const {
1333
+ expose: y,
1334
+ repeat: O,
1335
+ ...j
1336
+ } = it(this.blocks[g]), B = {
1337
+ lazy: this.lazy,
1338
+ eager: this.eager,
1339
+ placeholderChar: this.placeholderChar,
1340
+ displayChar: this.displayChar,
1341
+ overwrite: this.overwrite,
1342
+ autofix: this.autofix,
1343
+ ...j,
1344
+ repeat: O,
1345
+ parent: this
1346
+ }, D = O != null ? new k.RepeatBlock(
1347
+ B
1348
+ /* TODO */
1349
+ ) : K(B);
1350
+ D && (this._blocks.push(D), y && (this.exposeBlock = D), this._maskedBlocks[g] || (this._maskedBlocks[g] = []), this._maskedBlocks[g].push(this._blocks.length - 1)), r += g.length - 1;
1351
+ continue;
1352
+ }
1353
+ }
1354
+ let n = e[r], u = n in t;
1355
+ if (n === N.STOP_CHAR) {
1356
+ this._stops.push(this._blocks.length);
1357
+ continue;
1358
+ }
1359
+ if (n === "{" || n === "}") {
1360
+ s = !s;
1361
+ continue;
1362
+ }
1363
+ if (n === "[" || n === "]") {
1364
+ i = !i;
1365
+ continue;
1366
+ }
1367
+ if (n === N.ESCAPE_CHAR) {
1368
+ if (++r, n = e[r], !n) break;
1369
+ u = !1;
1370
+ }
1371
+ const o = u ? new pt({
1372
+ isOptional: i,
1373
+ lazy: this.lazy,
1374
+ eager: this.eager,
1375
+ placeholderChar: this.placeholderChar,
1376
+ displayChar: this.displayChar,
1377
+ ...it(t[n]),
1378
+ parent: this
1379
+ }) : new Jt({
1380
+ char: n,
1381
+ eager: this.eager,
1382
+ isUnmasking: s
1383
+ });
1384
+ this._blocks.push(o);
1385
+ }
1386
+ }
1387
+ get state() {
1388
+ return {
1389
+ ...super.state,
1390
+ _blocks: this._blocks.map((t) => t.state)
1391
+ };
1392
+ }
1393
+ set state(t) {
1394
+ if (!t) {
1395
+ this.reset();
1396
+ return;
1397
+ }
1398
+ const {
1399
+ _blocks: e,
1400
+ ...s
1401
+ } = t;
1402
+ this._blocks.forEach((i, r) => i.state = e[r]), super.state = s;
1403
+ }
1404
+ reset() {
1405
+ super.reset(), this._blocks.forEach((t) => t.reset());
1406
+ }
1407
+ get isComplete() {
1408
+ return this.exposeBlock ? this.exposeBlock.isComplete : this._blocks.every((t) => t.isComplete);
1409
+ }
1410
+ get isFilled() {
1411
+ return this._blocks.every((t) => t.isFilled);
1412
+ }
1413
+ get isFixed() {
1414
+ return this._blocks.every((t) => t.isFixed);
1415
+ }
1416
+ get isOptional() {
1417
+ return this._blocks.every((t) => t.isOptional);
1418
+ }
1419
+ doCommit() {
1420
+ this._blocks.forEach((t) => t.doCommit()), super.doCommit();
1421
+ }
1422
+ get unmaskedValue() {
1423
+ return this.exposeBlock ? this.exposeBlock.unmaskedValue : this._blocks.reduce((t, e) => t += e.unmaskedValue, "");
1424
+ }
1425
+ set unmaskedValue(t) {
1426
+ if (this.exposeBlock) {
1427
+ const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1428
+ this.exposeBlock.unmaskedValue = t, this.appendTail(e), this.doCommit();
1429
+ } else super.unmaskedValue = t;
1430
+ }
1431
+ get value() {
1432
+ return this.exposeBlock ? this.exposeBlock.value : (
1433
+ // TODO return _value when not in change?
1434
+ this._blocks.reduce((t, e) => t += e.value, "")
1435
+ );
1436
+ }
1437
+ set value(t) {
1438
+ if (this.exposeBlock) {
1439
+ const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1440
+ this.exposeBlock.value = t, this.appendTail(e), this.doCommit();
1441
+ } else super.value = t;
1442
+ }
1443
+ get typedValue() {
1444
+ return this.exposeBlock ? this.exposeBlock.typedValue : super.typedValue;
1445
+ }
1446
+ set typedValue(t) {
1447
+ if (this.exposeBlock) {
1448
+ const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1449
+ this.exposeBlock.typedValue = t, this.appendTail(e), this.doCommit();
1450
+ } else super.typedValue = t;
1451
+ }
1452
+ get displayValue() {
1453
+ return this._blocks.reduce((t, e) => t += e.displayValue, "");
1454
+ }
1455
+ appendTail(t) {
1456
+ return super.appendTail(t).aggregate(this._appendPlaceholder());
1457
+ }
1458
+ _appendEager() {
1459
+ var t;
1460
+ const e = new E();
1461
+ let s = (t = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : t.index;
1462
+ if (s == null) return e;
1463
+ this._blocks[s].isFilled && ++s;
1464
+ for (let i = s; i < this._blocks.length; ++i) {
1465
+ const r = this._blocks[i]._appendEager();
1466
+ if (!r.inserted) break;
1467
+ e.aggregate(r);
1468
+ }
1469
+ return e;
1470
+ }
1471
+ _appendCharRaw(t, e) {
1472
+ e === void 0 && (e = {});
1473
+ const s = this._mapPosToBlock(this.displayValue.length), i = new E();
1474
+ if (!s) return i;
1475
+ for (let n = s.index, u; u = this._blocks[n]; ++n) {
1476
+ var r;
1477
+ const o = u._appendChar(t, {
1478
+ ...e,
1479
+ _beforeTailState: (r = e._beforeTailState) == null || (r = r._blocks) == null ? void 0 : r[n]
1480
+ });
1481
+ if (i.aggregate(o), o.consumed) break;
1482
+ }
1483
+ return i;
1484
+ }
1485
+ extractTail(t, e) {
1486
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1487
+ const s = new Q();
1488
+ return t === e || this._forEachBlocksInRange(t, e, (i, r, n, u) => {
1489
+ const o = i.extractTail(n, u);
1490
+ o.stop = this._findStopBefore(r), o.from = this._blockStartPos(r), o instanceof Q && (o.blockIndex = r), s.extend(o);
1491
+ }), s;
1492
+ }
1493
+ extractInput(t, e, s) {
1494
+ if (t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), s === void 0 && (s = {}), t === e) return "";
1495
+ let i = "";
1496
+ return this._forEachBlocksInRange(t, e, (r, n, u, o) => {
1497
+ i += r.extractInput(u, o, s);
1498
+ }), i;
1499
+ }
1500
+ _findStopBefore(t) {
1501
+ let e;
1502
+ for (let s = 0; s < this._stops.length; ++s) {
1503
+ const i = this._stops[s];
1504
+ if (i <= t) e = i;
1505
+ else break;
1506
+ }
1507
+ return e;
1508
+ }
1509
+ /** Appends placeholder depending on laziness */
1510
+ _appendPlaceholder(t) {
1511
+ const e = new E();
1512
+ if (this.lazy && t == null) return e;
1513
+ const s = this._mapPosToBlock(this.displayValue.length);
1514
+ if (!s) return e;
1515
+ const i = s.index, r = t ?? this._blocks.length;
1516
+ return this._blocks.slice(i, r).forEach((n) => {
1517
+ if (!n.lazy || t != null) {
1518
+ var u;
1519
+ e.aggregate(n._appendPlaceholder((u = n._blocks) == null ? void 0 : u.length));
1520
+ }
1521
+ }), e;
1522
+ }
1523
+ /** Finds block in pos */
1524
+ _mapPosToBlock(t) {
1525
+ let e = "";
1526
+ for (let s = 0; s < this._blocks.length; ++s) {
1527
+ const i = this._blocks[s], r = e.length;
1528
+ if (e += i.displayValue, t <= e.length)
1529
+ return {
1530
+ index: s,
1531
+ offset: t - r
1532
+ };
1533
+ }
1534
+ }
1535
+ _blockStartPos(t) {
1536
+ return this._blocks.slice(0, t).reduce((e, s) => e += s.displayValue.length, 0);
1537
+ }
1538
+ _forEachBlocksInRange(t, e, s) {
1539
+ e === void 0 && (e = this.displayValue.length);
1540
+ const i = this._mapPosToBlock(t);
1541
+ if (i) {
1542
+ const r = this._mapPosToBlock(e), n = r && i.index === r.index, u = i.offset, o = r && n ? r.offset : this._blocks[i.index].displayValue.length;
1543
+ if (s(this._blocks[i.index], i.index, u, o), r && !n) {
1544
+ for (let h = i.index + 1; h < r.index; ++h)
1545
+ s(this._blocks[h], h, 0, this._blocks[h].displayValue.length);
1546
+ s(this._blocks[r.index], r.index, 0, r.offset);
1547
+ }
1548
+ }
1549
+ }
1550
+ remove(t, e) {
1551
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1552
+ const s = super.remove(t, e);
1553
+ return this._forEachBlocksInRange(t, e, (i, r, n, u) => {
1554
+ s.aggregate(i.remove(n, u));
1555
+ }), s;
1556
+ }
1557
+ nearestInputPos(t, e) {
1558
+ if (e === void 0 && (e = _.NONE), !this._blocks.length) return 0;
1559
+ const s = new Fe(this, t);
1560
+ if (e === _.NONE)
1561
+ return s.pushRightBeforeInput() || (s.popState(), s.pushLeftBeforeInput()) ? s.pos : this.displayValue.length;
1562
+ if (e === _.LEFT || e === _.FORCE_LEFT) {
1563
+ if (e === _.LEFT) {
1564
+ if (s.pushRightBeforeFilled(), s.ok && s.pos === t) return t;
1565
+ s.popState();
1566
+ }
1567
+ if (s.pushLeftBeforeInput(), s.pushLeftBeforeRequired(), s.pushLeftBeforeFilled(), e === _.LEFT) {
1568
+ if (s.pushRightBeforeInput(), s.pushRightBeforeRequired(), s.ok && s.pos <= t || (s.popState(), s.ok && s.pos <= t)) return s.pos;
1569
+ s.popState();
1570
+ }
1571
+ return s.ok ? s.pos : e === _.FORCE_LEFT ? 0 : (s.popState(), s.ok || (s.popState(), s.ok) ? s.pos : 0);
1572
+ }
1573
+ return e === _.RIGHT || e === _.FORCE_RIGHT ? (s.pushRightBeforeInput(), s.pushRightBeforeRequired(), s.pushRightBeforeFilled() ? s.pos : e === _.FORCE_RIGHT ? this.displayValue.length : (s.popState(), s.ok || (s.popState(), s.ok) ? s.pos : this.nearestInputPos(t, _.LEFT))) : t;
1574
+ }
1575
+ totalInputPositions(t, e) {
1576
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1577
+ let s = 0;
1578
+ return this._forEachBlocksInRange(t, e, (i, r, n, u) => {
1579
+ s += i.totalInputPositions(n, u);
1580
+ }), s;
1581
+ }
1582
+ /** Get block by name */
1583
+ maskedBlock(t) {
1584
+ return this.maskedBlocks(t)[0];
1585
+ }
1586
+ /** Get all blocks by name */
1587
+ maskedBlocks(t) {
1588
+ const e = this._maskedBlocks[t];
1589
+ return e ? e.map((s) => this._blocks[s]) : [];
1590
+ }
1591
+ pad(t) {
1592
+ const e = new E();
1593
+ return this._forEachBlocksInRange(0, this.displayValue.length, (s) => e.aggregate(s.pad(t))), e;
1594
+ }
1595
+ }
1596
+ N.DEFAULTS = {
1597
+ ...L.DEFAULTS,
1598
+ lazy: !0,
1599
+ placeholderChar: "_"
1600
+ };
1601
+ N.STOP_CHAR = "`";
1602
+ N.ESCAPE_CHAR = "\\";
1603
+ N.InputDefinition = pt;
1604
+ N.FixedDefinition = Jt;
1605
+ k.MaskedPattern = N;
1606
+ class lt extends N {
1607
+ /**
1608
+ Optionally sets max length of pattern.
1609
+ Used when pattern length is longer then `to` param length. Pads zeros at start in this case.
1610
+ */
1611
+ /** Min bound */
1612
+ /** Max bound */
1613
+ get _matchFrom() {
1614
+ return this.maxLength - String(this.from).length;
1615
+ }
1616
+ constructor(t) {
1617
+ super(t);
1618
+ }
1619
+ updateOptions(t) {
1620
+ super.updateOptions(t);
1621
+ }
1622
+ _update(t) {
1623
+ const {
1624
+ to: e = this.to || 0,
1625
+ from: s = this.from || 0,
1626
+ maxLength: i = this.maxLength || 0,
1627
+ autofix: r = this.autofix,
1628
+ ...n
1629
+ } = t;
1630
+ this.to = e, this.from = s, this.maxLength = Math.max(String(e).length, i), this.autofix = r;
1631
+ const u = String(this.from).padStart(this.maxLength, "0"), o = String(this.to).padStart(this.maxLength, "0");
1632
+ let h = 0;
1633
+ for (; h < o.length && o[h] === u[h]; ) ++h;
1634
+ n.mask = o.slice(0, h).replace(/0/g, "\\0") + "0".repeat(this.maxLength - h), super._update(n);
1635
+ }
1636
+ get isComplete() {
1637
+ return super.isComplete && !!this.value;
1638
+ }
1639
+ boundaries(t) {
1640
+ let e = "", s = "";
1641
+ const [, i, r] = t.match(/^(\D*)(\d*)(\D*)/) || [];
1642
+ return r && (e = "0".repeat(i.length) + r, s = "9".repeat(i.length) + r), e = e.padEnd(this.maxLength, "0"), s = s.padEnd(this.maxLength, "9"), [e, s];
1643
+ }
1644
+ doPrepareChar(t, e) {
1645
+ e === void 0 && (e = {});
1646
+ let s;
1647
+ return [t, s] = super.doPrepareChar(t.replace(/\D/g, ""), e), t || (s.skip = !this.isComplete), [t, s];
1648
+ }
1649
+ _appendCharRaw(t, e) {
1650
+ if (e === void 0 && (e = {}), !this.autofix || this.value.length + 1 > this.maxLength) return super._appendCharRaw(t, e);
1651
+ const s = String(this.from).padStart(this.maxLength, "0"), i = String(this.to).padStart(this.maxLength, "0"), [r, n] = this.boundaries(this.value + t);
1652
+ return Number(n) < this.from ? super._appendCharRaw(s[this.value.length], e) : Number(r) > this.to ? !e.tail && this.autofix === "pad" && this.value.length + 1 < this.maxLength ? super._appendCharRaw(s[this.value.length], e).aggregate(this._appendCharRaw(t, e)) : super._appendCharRaw(i[this.value.length], e) : super._appendCharRaw(t, e);
1653
+ }
1654
+ doValidate(t) {
1655
+ const e = this.value;
1656
+ if (e.search(/[^0]/) === -1 && e.length <= this._matchFrom) return !0;
1657
+ const [i, r] = this.boundaries(e);
1658
+ return this.from <= Number(r) && Number(i) <= this.to && super.doValidate(t);
1659
+ }
1660
+ pad(t) {
1661
+ const e = new E();
1662
+ if (this.value.length === this.maxLength) return e;
1663
+ const s = this.value, i = this.maxLength - this.value.length;
1664
+ if (i) {
1665
+ this.reset();
1666
+ for (let r = 0; r < i; ++r)
1667
+ e.aggregate(super._appendCharRaw("0", t));
1668
+ s.split("").forEach((r) => this._appendCharRaw(r));
1669
+ }
1670
+ return e;
1671
+ }
1672
+ }
1673
+ k.MaskedRange = lt;
1674
+ const Te = "d{.}`m{.}`Y";
1675
+ class H extends N {
1676
+ static extractPatternOptions(t) {
1677
+ const {
1678
+ mask: e,
1679
+ pattern: s,
1680
+ ...i
1681
+ } = t;
1682
+ return {
1683
+ ...i,
1684
+ mask: G(e) ? e : s
1685
+ };
1686
+ }
1687
+ /** Pattern mask for date according to {@link MaskedDate#format} */
1688
+ /** Start date */
1689
+ /** End date */
1690
+ /** Format typed value to string */
1691
+ /** Parse string to get typed value */
1692
+ constructor(t) {
1693
+ super(H.extractPatternOptions({
1694
+ ...H.DEFAULTS,
1695
+ ...t
1696
+ }));
1697
+ }
1698
+ updateOptions(t) {
1699
+ super.updateOptions(t);
1700
+ }
1701
+ _update(t) {
1702
+ const {
1703
+ mask: e,
1704
+ pattern: s,
1705
+ blocks: i,
1706
+ ...r
1707
+ } = {
1708
+ ...H.DEFAULTS,
1709
+ ...t
1710
+ }, n = Object.assign({}, H.GET_DEFAULT_BLOCKS());
1711
+ t.min && (n.Y.from = t.min.getFullYear()), t.max && (n.Y.to = t.max.getFullYear()), t.min && t.max && n.Y.from === n.Y.to && (n.m.from = t.min.getMonth() + 1, n.m.to = t.max.getMonth() + 1, n.m.from === n.m.to && (n.d.from = t.min.getDate(), n.d.to = t.max.getDate())), Object.assign(n, this.blocks, i), super._update({
1712
+ ...r,
1713
+ mask: G(e) ? e : s,
1714
+ blocks: n
1715
+ });
1716
+ }
1717
+ doValidate(t) {
1718
+ const e = this.date;
1719
+ return super.doValidate(t) && (!this.isComplete || this.isDateExist(this.value) && e != null && (this.min == null || this.min <= e) && (this.max == null || e <= this.max));
1720
+ }
1721
+ /** Checks if date is exists */
1722
+ isDateExist(t) {
1723
+ return this.format(this.parse(t, this), this).indexOf(t) >= 0;
1724
+ }
1725
+ /** Parsed Date */
1726
+ get date() {
1727
+ return this.typedValue;
1728
+ }
1729
+ set date(t) {
1730
+ this.typedValue = t;
1731
+ }
1732
+ get typedValue() {
1733
+ return this.isComplete ? super.typedValue : null;
1734
+ }
1735
+ set typedValue(t) {
1736
+ super.typedValue = t;
1737
+ }
1738
+ maskEquals(t) {
1739
+ return t === Date || super.maskEquals(t);
1740
+ }
1741
+ optionsIsChanged(t) {
1742
+ return super.optionsIsChanged(H.extractPatternOptions(t));
1743
+ }
1744
+ }
1745
+ H.GET_DEFAULT_BLOCKS = () => ({
1746
+ d: {
1747
+ mask: lt,
1748
+ from: 1,
1749
+ to: 31,
1750
+ maxLength: 2
1751
+ },
1752
+ m: {
1753
+ mask: lt,
1754
+ from: 1,
1755
+ to: 12,
1756
+ maxLength: 2
1757
+ },
1758
+ Y: {
1759
+ mask: lt,
1760
+ from: 1900,
1761
+ to: 9999
1762
+ }
1763
+ });
1764
+ H.DEFAULTS = {
1765
+ ...N.DEFAULTS,
1766
+ mask: Date,
1767
+ pattern: Te,
1768
+ format: (a, t) => {
1769
+ if (!a) return "";
1770
+ const e = String(a.getDate()).padStart(2, "0"), s = String(a.getMonth() + 1).padStart(2, "0"), i = a.getFullYear();
1771
+ return [e, s, i].join(".");
1772
+ },
1773
+ parse: (a, t) => {
1774
+ const [e, s, i] = a.split(".").map(Number);
1775
+ return new Date(i, s - 1, e);
1776
+ }
1777
+ };
1778
+ k.MaskedDate = H;
1779
+ class ft extends L {
1780
+ constructor(t) {
1781
+ super({
1782
+ ...ft.DEFAULTS,
1783
+ ...t
1784
+ }), this.currentMask = void 0;
1785
+ }
1786
+ updateOptions(t) {
1787
+ super.updateOptions(t);
1788
+ }
1789
+ _update(t) {
1790
+ super._update(t), "mask" in t && (this.exposeMask = void 0, this.compiledMasks = Array.isArray(t.mask) ? t.mask.map((e) => {
1791
+ const {
1792
+ expose: s,
1793
+ ...i
1794
+ } = it(e), r = K({
1795
+ overwrite: this._overwrite,
1796
+ eager: this._eager,
1797
+ skipInvalid: this._skipInvalid,
1798
+ ...i
1799
+ });
1800
+ return s && (this.exposeMask = r), r;
1801
+ }) : []);
1802
+ }
1803
+ _appendCharRaw(t, e) {
1804
+ e === void 0 && (e = {});
1805
+ const s = this._applyDispatch(t, e);
1806
+ return this.currentMask && s.aggregate(this.currentMask._appendChar(t, this.currentMaskFlags(e))), s;
1807
+ }
1808
+ _applyDispatch(t, e, s) {
1809
+ t === void 0 && (t = ""), e === void 0 && (e = {}), s === void 0 && (s = "");
1810
+ const i = e.tail && e._beforeTailState != null ? e._beforeTailState._value : this.value, r = this.rawInputValue, n = e.tail && e._beforeTailState != null ? e._beforeTailState._rawInputValue : r, u = r.slice(n.length), o = this.currentMask, h = new E(), m = o?.state;
1811
+ return this.currentMask = this.doDispatch(t, {
1812
+ ...e
1813
+ }, s), this.currentMask && (this.currentMask !== o ? (this.currentMask.reset(), n && (this.currentMask.append(n, {
1814
+ raw: !0
1815
+ }), h.tailShift = this.currentMask.value.length - i.length), u && (h.tailShift += this.currentMask.append(u, {
1816
+ raw: !0,
1817
+ tail: !0
1818
+ }).tailShift)) : m && (this.currentMask.state = m)), h;
1819
+ }
1820
+ _appendPlaceholder() {
1821
+ const t = this._applyDispatch();
1822
+ return this.currentMask && t.aggregate(this.currentMask._appendPlaceholder()), t;
1823
+ }
1824
+ _appendEager() {
1825
+ const t = this._applyDispatch();
1826
+ return this.currentMask && t.aggregate(this.currentMask._appendEager()), t;
1827
+ }
1828
+ appendTail(t) {
1829
+ const e = new E();
1830
+ return t && e.aggregate(this._applyDispatch("", {}, t)), e.aggregate(this.currentMask ? this.currentMask.appendTail(t) : super.appendTail(t));
1831
+ }
1832
+ currentMaskFlags(t) {
1833
+ var e, s;
1834
+ return {
1835
+ ...t,
1836
+ _beforeTailState: ((e = t._beforeTailState) == null ? void 0 : e.currentMaskRef) === this.currentMask && ((s = t._beforeTailState) == null ? void 0 : s.currentMask) || t._beforeTailState
1837
+ };
1838
+ }
1839
+ doDispatch(t, e, s) {
1840
+ return e === void 0 && (e = {}), s === void 0 && (s = ""), this.dispatch(t, this, e, s);
1841
+ }
1842
+ doValidate(t) {
1843
+ return super.doValidate(t) && (!this.currentMask || this.currentMask.doValidate(this.currentMaskFlags(t)));
1844
+ }
1845
+ doPrepare(t, e) {
1846
+ e === void 0 && (e = {});
1847
+ let [s, i] = super.doPrepare(t, e);
1848
+ if (this.currentMask) {
1849
+ let r;
1850
+ [s, r] = super.doPrepare(s, this.currentMaskFlags(e)), i = i.aggregate(r);
1851
+ }
1852
+ return [s, i];
1853
+ }
1854
+ doPrepareChar(t, e) {
1855
+ e === void 0 && (e = {});
1856
+ let [s, i] = super.doPrepareChar(t, e);
1857
+ if (this.currentMask) {
1858
+ let r;
1859
+ [s, r] = super.doPrepareChar(s, this.currentMaskFlags(e)), i = i.aggregate(r);
1860
+ }
1861
+ return [s, i];
1862
+ }
1863
+ reset() {
1864
+ var t;
1865
+ (t = this.currentMask) == null || t.reset(), this.compiledMasks.forEach((e) => e.reset());
1866
+ }
1867
+ get value() {
1868
+ return this.exposeMask ? this.exposeMask.value : this.currentMask ? this.currentMask.value : "";
1869
+ }
1870
+ set value(t) {
1871
+ this.exposeMask ? (this.exposeMask.value = t, this.currentMask = this.exposeMask, this._applyDispatch()) : super.value = t;
1872
+ }
1873
+ get unmaskedValue() {
1874
+ return this.exposeMask ? this.exposeMask.unmaskedValue : this.currentMask ? this.currentMask.unmaskedValue : "";
1875
+ }
1876
+ set unmaskedValue(t) {
1877
+ this.exposeMask ? (this.exposeMask.unmaskedValue = t, this.currentMask = this.exposeMask, this._applyDispatch()) : super.unmaskedValue = t;
1878
+ }
1879
+ get typedValue() {
1880
+ return this.exposeMask ? this.exposeMask.typedValue : this.currentMask ? this.currentMask.typedValue : "";
1881
+ }
1882
+ set typedValue(t) {
1883
+ if (this.exposeMask) {
1884
+ this.exposeMask.typedValue = t, this.currentMask = this.exposeMask, this._applyDispatch();
1885
+ return;
1886
+ }
1887
+ let e = String(t);
1888
+ this.currentMask && (this.currentMask.typedValue = t, e = this.currentMask.unmaskedValue), this.unmaskedValue = e;
1889
+ }
1890
+ get displayValue() {
1891
+ return this.currentMask ? this.currentMask.displayValue : "";
1892
+ }
1893
+ get isComplete() {
1894
+ var t;
1895
+ return !!((t = this.currentMask) != null && t.isComplete);
1896
+ }
1897
+ get isFilled() {
1898
+ var t;
1899
+ return !!((t = this.currentMask) != null && t.isFilled);
1900
+ }
1901
+ remove(t, e) {
1902
+ const s = new E();
1903
+ return this.currentMask && s.aggregate(this.currentMask.remove(t, e)).aggregate(this._applyDispatch()), s;
1904
+ }
1905
+ get state() {
1906
+ var t;
1907
+ return {
1908
+ ...super.state,
1909
+ _rawInputValue: this.rawInputValue,
1910
+ compiledMasks: this.compiledMasks.map((e) => e.state),
1911
+ currentMaskRef: this.currentMask,
1912
+ currentMask: (t = this.currentMask) == null ? void 0 : t.state
1913
+ };
1914
+ }
1915
+ set state(t) {
1916
+ const {
1917
+ compiledMasks: e,
1918
+ currentMaskRef: s,
1919
+ currentMask: i,
1920
+ ...r
1921
+ } = t;
1922
+ e && this.compiledMasks.forEach((n, u) => n.state = e[u]), s != null && (this.currentMask = s, this.currentMask.state = i), super.state = r;
1923
+ }
1924
+ extractInput(t, e, s) {
1925
+ return this.currentMask ? this.currentMask.extractInput(t, e, s) : "";
1926
+ }
1927
+ extractTail(t, e) {
1928
+ return this.currentMask ? this.currentMask.extractTail(t, e) : super.extractTail(t, e);
1929
+ }
1930
+ doCommit() {
1931
+ this.currentMask && this.currentMask.doCommit(), super.doCommit();
1932
+ }
1933
+ nearestInputPos(t, e) {
1934
+ return this.currentMask ? this.currentMask.nearestInputPos(t, e) : super.nearestInputPos(t, e);
1935
+ }
1936
+ get overwrite() {
1937
+ return this.currentMask ? this.currentMask.overwrite : this._overwrite;
1938
+ }
1939
+ set overwrite(t) {
1940
+ this._overwrite = t;
1941
+ }
1942
+ get eager() {
1943
+ return this.currentMask ? this.currentMask.eager : this._eager;
1944
+ }
1945
+ set eager(t) {
1946
+ this._eager = t;
1947
+ }
1948
+ get skipInvalid() {
1949
+ return this.currentMask ? this.currentMask.skipInvalid : this._skipInvalid;
1950
+ }
1951
+ set skipInvalid(t) {
1952
+ this._skipInvalid = t;
1953
+ }
1954
+ get autofix() {
1955
+ return this.currentMask ? this.currentMask.autofix : this._autofix;
1956
+ }
1957
+ set autofix(t) {
1958
+ this._autofix = t;
1959
+ }
1960
+ maskEquals(t) {
1961
+ return Array.isArray(t) ? this.compiledMasks.every((e, s) => {
1962
+ if (!t[s]) return;
1963
+ const {
1964
+ mask: i,
1965
+ ...r
1966
+ } = t[s];
1967
+ return ht(e, r) && e.maskEquals(i);
1968
+ }) : super.maskEquals(t);
1969
+ }
1970
+ typedValueEquals(t) {
1971
+ var e;
1972
+ return !!((e = this.currentMask) != null && e.typedValueEquals(t));
1973
+ }
1974
+ }
1975
+ ft.DEFAULTS = {
1976
+ ...L.DEFAULTS,
1977
+ dispatch: (a, t, e, s) => {
1978
+ if (!t.compiledMasks.length) return;
1979
+ const i = t.rawInputValue, r = t.compiledMasks.map((n, u) => {
1980
+ const o = t.currentMask === n, h = o ? n.displayValue.length : n.nearestInputPos(n.displayValue.length, _.FORCE_LEFT);
1981
+ return n.rawInputValue !== i ? (n.reset(), n.append(i, {
1982
+ raw: !0
1983
+ })) : o || n.remove(h), n.append(a, t.currentMaskFlags(e)), n.appendTail(s), {
1984
+ index: u,
1985
+ weight: n.rawInputValue.length,
1986
+ totalInputPositions: n.totalInputPositions(0, Math.max(h, n.nearestInputPos(n.displayValue.length, _.FORCE_LEFT)))
1987
+ };
1988
+ });
1989
+ return r.sort((n, u) => u.weight - n.weight || u.totalInputPositions - n.totalInputPositions), t.compiledMasks[r[0].index];
1990
+ }
1991
+ };
1992
+ k.MaskedDynamic = ft;
1993
+ class _t extends N {
1994
+ constructor(t) {
1995
+ super({
1996
+ ..._t.DEFAULTS,
1997
+ ...t
1998
+ });
1999
+ }
2000
+ updateOptions(t) {
2001
+ super.updateOptions(t);
2002
+ }
2003
+ _update(t) {
2004
+ const {
2005
+ enum: e,
2006
+ ...s
2007
+ } = t;
2008
+ if (e) {
2009
+ const i = e.map((u) => u.length), r = Math.min(...i), n = Math.max(...i) - r;
2010
+ s.mask = "*".repeat(r), n && (s.mask += "[" + "*".repeat(n) + "]"), this.enum = e;
2011
+ }
2012
+ super._update(s);
2013
+ }
2014
+ _appendCharRaw(t, e) {
2015
+ e === void 0 && (e = {});
2016
+ const s = Math.min(this.nearestInputPos(0, _.FORCE_RIGHT), this.value.length), i = this.enum.filter((r) => this.matchValue(r, this.unmaskedValue + t, s));
2017
+ if (i.length) {
2018
+ i.length === 1 && this._forEachBlocksInRange(0, this.value.length, (n, u) => {
2019
+ const o = i[0][u];
2020
+ u >= this.value.length || o === n.value || (n.reset(), n._appendChar(o, e));
2021
+ });
2022
+ const r = super._appendCharRaw(i[0][this.value.length], e);
2023
+ return i.length === 1 && i[0].slice(this.unmaskedValue.length).split("").forEach((n) => r.aggregate(super._appendCharRaw(n))), r;
2024
+ }
2025
+ return new E({
2026
+ skip: !this.isComplete
2027
+ });
2028
+ }
2029
+ extractTail(t, e) {
2030
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), new Y("", t);
2031
+ }
2032
+ remove(t, e) {
2033
+ if (t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), t === e) return new E();
2034
+ const s = Math.min(super.nearestInputPos(0, _.FORCE_RIGHT), this.value.length);
2035
+ let i;
2036
+ for (i = t; i >= 0 && !(this.enum.filter((u) => this.matchValue(u, this.value.slice(s, i), s)).length > 1); --i)
2037
+ ;
2038
+ const r = super.remove(i, e);
2039
+ return r.tailShift += i - t, r;
2040
+ }
2041
+ get isComplete() {
2042
+ return this.enum.indexOf(this.value) >= 0;
2043
+ }
2044
+ }
2045
+ _t.DEFAULTS = {
2046
+ ...N.DEFAULTS,
2047
+ matchValue: (a, t, e) => a.indexOf(t, e) === e
2048
+ };
2049
+ k.MaskedEnum = _t;
2050
+ class Ie extends L {
2051
+ /** */
2052
+ /** Enable characters overwriting */
2053
+ /** */
2054
+ /** */
2055
+ /** */
2056
+ updateOptions(t) {
2057
+ super.updateOptions(t);
2058
+ }
2059
+ _update(t) {
2060
+ super._update({
2061
+ ...t,
2062
+ validate: t.mask
2063
+ });
2064
+ }
2065
+ }
2066
+ k.MaskedFunction = Ie;
2067
+ var Qt;
2068
+ class z extends L {
2069
+ /** Single char */
2070
+ /** Single char */
2071
+ /** Array of single chars */
2072
+ /** */
2073
+ /** */
2074
+ /** Digits after point */
2075
+ /** Flag to remove leading and trailing zeros in the end of editing */
2076
+ /** Flag to pad trailing zeros after point in the end of editing */
2077
+ /** Enable characters overwriting */
2078
+ /** */
2079
+ /** */
2080
+ /** */
2081
+ /** Format typed value to string */
2082
+ /** Parse string to get typed value */
2083
+ constructor(t) {
2084
+ super({
2085
+ ...z.DEFAULTS,
2086
+ ...t
2087
+ });
2088
+ }
2089
+ updateOptions(t) {
2090
+ super.updateOptions(t);
2091
+ }
2092
+ _update(t) {
2093
+ super._update(t), this._updateRegExps();
2094
+ }
2095
+ _updateRegExps() {
2096
+ const t = "^" + (this.allowNegative ? "[+|\\-]?" : ""), e = "\\d*", s = (this.scale ? "(" + bt(this.radix) + "\\d{0," + this.scale + "})?" : "") + "$";
2097
+ this._numberRegExp = new RegExp(t + e + s), this._mapToRadixRegExp = new RegExp("[" + this.mapToRadix.map(bt).join("") + "]", "g"), this._thousandsSeparatorRegExp = new RegExp(bt(this.thousandsSeparator), "g");
2098
+ }
2099
+ _removeThousandsSeparators(t) {
2100
+ return t.replace(this._thousandsSeparatorRegExp, "");
2101
+ }
2102
+ _insertThousandsSeparators(t) {
2103
+ const e = t.split(this.radix);
2104
+ return e[0] = e[0].replace(/\B(?=(\d{3})+(?!\d))/g, this.thousandsSeparator), e.join(this.radix);
2105
+ }
2106
+ doPrepareChar(t, e) {
2107
+ e === void 0 && (e = {});
2108
+ const [s, i] = super.doPrepareChar(this._removeThousandsSeparators(this.scale && this.mapToRadix.length && /*
2109
+ radix should be mapped when
2110
+ 1) input is done from keyboard = flags.input && flags.raw
2111
+ 2) unmasked value is set = !flags.input && !flags.raw
2112
+ and should not be mapped when
2113
+ 1) value is set = flags.input && !flags.raw
2114
+ 2) raw value is set = !flags.input && flags.raw
2115
+ */
2116
+ (e.input && e.raw || !e.input && !e.raw) ? t.replace(this._mapToRadixRegExp, this.radix) : t), e);
2117
+ return t && !s && (i.skip = !0), s && !this.allowPositive && !this.value && s !== "-" && i.aggregate(this._appendChar("-")), [s, i];
2118
+ }
2119
+ _separatorsCount(t, e) {
2120
+ e === void 0 && (e = !1);
2121
+ let s = 0;
2122
+ for (let i = 0; i < t; ++i)
2123
+ this._value.indexOf(this.thousandsSeparator, i) === i && (++s, e && (t += this.thousandsSeparator.length));
2124
+ return s;
2125
+ }
2126
+ _separatorsCountFromSlice(t) {
2127
+ return t === void 0 && (t = this._value), this._separatorsCount(this._removeThousandsSeparators(t).length, !0);
2128
+ }
2129
+ extractInput(t, e, s) {
2130
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), [t, e] = this._adjustRangeWithSeparators(t, e), this._removeThousandsSeparators(super.extractInput(t, e, s));
2131
+ }
2132
+ _appendCharRaw(t, e) {
2133
+ e === void 0 && (e = {});
2134
+ const s = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value, i = this._separatorsCountFromSlice(s);
2135
+ this._value = this._removeThousandsSeparators(this.value);
2136
+ const r = this._value;
2137
+ this._value += t;
2138
+ const n = this.number;
2139
+ let u = !isNaN(n), o = !1;
2140
+ if (u) {
2141
+ let y;
2142
+ this.min != null && this.min < 0 && this.number < this.min && (y = this.min), this.max != null && this.max > 0 && this.number > this.max && (y = this.max), y != null && (this.autofix ? (this._value = this.format(y, this).replace(z.UNMASKED_RADIX, this.radix), o || (o = r === this._value && !e.tail)) : u = !1), u && (u = !!this._value.match(this._numberRegExp));
2143
+ }
2144
+ let h;
2145
+ u ? h = new E({
2146
+ inserted: this._value.slice(r.length),
2147
+ rawInserted: o ? "" : t,
2148
+ skip: o
2149
+ }) : (this._value = r, h = new E()), this._value = this._insertThousandsSeparators(this._value);
2150
+ const m = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value, g = this._separatorsCountFromSlice(m);
2151
+ return h.tailShift += (g - i) * this.thousandsSeparator.length, h;
2152
+ }
2153
+ _findSeparatorAround(t) {
2154
+ if (this.thousandsSeparator) {
2155
+ const e = t - this.thousandsSeparator.length + 1, s = this.value.indexOf(this.thousandsSeparator, e);
2156
+ if (s <= t) return s;
2157
+ }
2158
+ return -1;
2159
+ }
2160
+ _adjustRangeWithSeparators(t, e) {
2161
+ const s = this._findSeparatorAround(t);
2162
+ s >= 0 && (t = s);
2163
+ const i = this._findSeparatorAround(e);
2164
+ return i >= 0 && (e = i + this.thousandsSeparator.length), [t, e];
2165
+ }
2166
+ remove(t, e) {
2167
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), [t, e] = this._adjustRangeWithSeparators(t, e);
2168
+ const s = this.value.slice(0, t), i = this.value.slice(e), r = this._separatorsCount(s.length);
2169
+ this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(s + i));
2170
+ const n = this._separatorsCountFromSlice(s);
2171
+ return new E({
2172
+ tailShift: (n - r) * this.thousandsSeparator.length
2173
+ });
2174
+ }
2175
+ nearestInputPos(t, e) {
2176
+ if (!this.thousandsSeparator) return t;
2177
+ switch (e) {
2178
+ case _.NONE:
2179
+ case _.LEFT:
2180
+ case _.FORCE_LEFT: {
2181
+ const s = this._findSeparatorAround(t - 1);
2182
+ if (s >= 0) {
2183
+ const i = s + this.thousandsSeparator.length;
2184
+ if (t < i || this.value.length <= i || e === _.FORCE_LEFT)
2185
+ return s;
2186
+ }
2187
+ break;
2188
+ }
2189
+ case _.RIGHT:
2190
+ case _.FORCE_RIGHT: {
2191
+ const s = this._findSeparatorAround(t);
2192
+ if (s >= 0)
2193
+ return s + this.thousandsSeparator.length;
2194
+ }
2195
+ }
2196
+ return t;
2197
+ }
2198
+ doCommit() {
2199
+ if (this.value) {
2200
+ const t = this.number;
2201
+ let e = t;
2202
+ this.min != null && (e = Math.max(e, this.min)), this.max != null && (e = Math.min(e, this.max)), e !== t && (this.unmaskedValue = this.format(e, this));
2203
+ let s = this.value;
2204
+ this.normalizeZeros && (s = this._normalizeZeros(s)), this.padFractionalZeros && this.scale > 0 && (s = this._padFractionalZeros(s)), this._value = s;
2205
+ }
2206
+ super.doCommit();
2207
+ }
2208
+ _normalizeZeros(t) {
2209
+ const e = this._removeThousandsSeparators(t).split(this.radix);
2210
+ return e[0] = e[0].replace(/^(\D*)(0*)(\d*)/, (s, i, r, n) => i + n), t.length && !/\d$/.test(e[0]) && (e[0] = e[0] + "0"), e.length > 1 && (e[1] = e[1].replace(/0*$/, ""), e[1].length || (e.length = 1)), this._insertThousandsSeparators(e.join(this.radix));
2211
+ }
2212
+ _padFractionalZeros(t) {
2213
+ if (!t) return t;
2214
+ const e = t.split(this.radix);
2215
+ return e.length < 2 && e.push(""), e[1] = e[1].padEnd(this.scale, "0"), e.join(this.radix);
2216
+ }
2217
+ doSkipInvalid(t, e, s) {
2218
+ e === void 0 && (e = {});
2219
+ const i = this.scale === 0 && t !== this.thousandsSeparator && (t === this.radix || t === z.UNMASKED_RADIX || this.mapToRadix.includes(t));
2220
+ return super.doSkipInvalid(t, e, s) && !i;
2221
+ }
2222
+ get unmaskedValue() {
2223
+ return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix, z.UNMASKED_RADIX);
2224
+ }
2225
+ set unmaskedValue(t) {
2226
+ super.unmaskedValue = t;
2227
+ }
2228
+ get typedValue() {
2229
+ return this.parse(this.unmaskedValue, this);
2230
+ }
2231
+ set typedValue(t) {
2232
+ this.rawInputValue = this.format(t, this).replace(z.UNMASKED_RADIX, this.radix);
2233
+ }
2234
+ /** Parsed Number */
2235
+ get number() {
2236
+ return this.typedValue;
2237
+ }
2238
+ set number(t) {
2239
+ this.typedValue = t;
2240
+ }
2241
+ get allowNegative() {
2242
+ return this.min != null && this.min < 0 || this.max != null && this.max < 0;
2243
+ }
2244
+ get allowPositive() {
2245
+ return this.min != null && this.min > 0 || this.max != null && this.max > 0;
2246
+ }
2247
+ typedValueEquals(t) {
2248
+ return (super.typedValueEquals(t) || z.EMPTY_VALUES.includes(t) && z.EMPTY_VALUES.includes(this.typedValue)) && !(t === 0 && this.value === "");
2249
+ }
2250
+ }
2251
+ Qt = z;
2252
+ z.UNMASKED_RADIX = ".";
2253
+ z.EMPTY_VALUES = [...L.EMPTY_VALUES, 0];
2254
+ z.DEFAULTS = {
2255
+ ...L.DEFAULTS,
2256
+ mask: Number,
2257
+ radix: ",",
2258
+ thousandsSeparator: "",
2259
+ mapToRadix: [Qt.UNMASKED_RADIX],
2260
+ min: Number.MIN_SAFE_INTEGER,
2261
+ max: Number.MAX_SAFE_INTEGER,
2262
+ scale: 2,
2263
+ normalizeZeros: !0,
2264
+ padFractionalZeros: !1,
2265
+ parse: Number,
2266
+ format: (a) => a.toLocaleString("en-US", {
2267
+ useGrouping: !1,
2268
+ maximumFractionDigits: 20
2269
+ })
2270
+ };
2271
+ k.MaskedNumber = z;
2272
+ const Bt = {
2273
+ MASKED: "value",
2274
+ UNMASKED: "unmaskedValue",
2275
+ TYPED: "typedValue"
2276
+ };
2277
+ function te(a, t, e) {
2278
+ t === void 0 && (t = Bt.MASKED), e === void 0 && (e = Bt.MASKED);
2279
+ const s = K(a);
2280
+ return (i) => s.runIsolated((r) => (r[t] = i, r[e]));
2281
+ }
2282
+ function Re(a, t, e, s) {
2283
+ return te(t, e, s)(a);
2284
+ }
2285
+ k.PIPE_TYPE = Bt;
2286
+ k.createPipe = te;
2287
+ k.pipe = Re;
2288
+ class we extends N {
2289
+ get repeatFrom() {
2290
+ var t;
2291
+ return (t = Array.isArray(this.repeat) ? this.repeat[0] : this.repeat === 1 / 0 ? 0 : this.repeat) != null ? t : 0;
2292
+ }
2293
+ get repeatTo() {
2294
+ var t;
2295
+ return (t = Array.isArray(this.repeat) ? this.repeat[1] : this.repeat) != null ? t : 1 / 0;
2296
+ }
2297
+ constructor(t) {
2298
+ super(t);
2299
+ }
2300
+ updateOptions(t) {
2301
+ super.updateOptions(t);
2302
+ }
2303
+ _update(t) {
2304
+ var e, s, i;
2305
+ const {
2306
+ repeat: r,
2307
+ ...n
2308
+ } = it(t);
2309
+ this._blockOpts = Object.assign({}, this._blockOpts, n);
2310
+ const u = K(this._blockOpts);
2311
+ this.repeat = (e = (s = r ?? u.repeat) != null ? s : this.repeat) != null ? e : 1 / 0, super._update({
2312
+ mask: "m".repeat(Math.max(this.repeatTo === 1 / 0 && ((i = this._blocks) == null ? void 0 : i.length) || 0, this.repeatFrom)),
2313
+ blocks: {
2314
+ m: u
2315
+ },
2316
+ eager: u.eager,
2317
+ overwrite: u.overwrite,
2318
+ skipInvalid: u.skipInvalid,
2319
+ lazy: u.lazy,
2320
+ placeholderChar: u.placeholderChar,
2321
+ displayChar: u.displayChar
2322
+ });
2323
+ }
2324
+ _allocateBlock(t) {
2325
+ if (t < this._blocks.length) return this._blocks[t];
2326
+ if (this.repeatTo === 1 / 0 || this._blocks.length < this.repeatTo)
2327
+ return this._blocks.push(K(this._blockOpts)), this.mask += "m", this._blocks[this._blocks.length - 1];
2328
+ }
2329
+ _appendCharRaw(t, e) {
2330
+ e === void 0 && (e = {});
2331
+ const s = new E();
2332
+ for (
2333
+ let o = (i = (r = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : r.index) != null ? i : Math.max(this._blocks.length - 1, 0), h, m;
2334
+ // try to get a block or
2335
+ // try to allocate a new block if not allocated already
2336
+ h = (n = this._blocks[o]) != null ? n : m = !m && this._allocateBlock(o);
2337
+ ++o
2338
+ ) {
2339
+ var i, r, n, u;
2340
+ const g = h._appendChar(t, {
2341
+ ...e,
2342
+ _beforeTailState: (u = e._beforeTailState) == null || (u = u._blocks) == null ? void 0 : u[o]
2343
+ });
2344
+ if (g.skip && m) {
2345
+ this._blocks.pop(), this.mask = this.mask.slice(1);
2346
+ break;
2347
+ }
2348
+ if (s.aggregate(g), g.consumed) break;
2349
+ }
2350
+ return s;
2351
+ }
2352
+ _trimEmptyTail(t, e) {
2353
+ var s, i;
2354
+ t === void 0 && (t = 0);
2355
+ const r = Math.max(((s = this._mapPosToBlock(t)) == null ? void 0 : s.index) || 0, this.repeatFrom, 0);
2356
+ let n;
2357
+ e != null && (n = (i = this._mapPosToBlock(e)) == null ? void 0 : i.index), n == null && (n = this._blocks.length - 1);
2358
+ let u = 0;
2359
+ for (let o = n; r <= o && !this._blocks[o].unmaskedValue; --o, ++u)
2360
+ ;
2361
+ u && (this._blocks.splice(n - u + 1, u), this.mask = this.mask.slice(u));
2362
+ }
2363
+ reset() {
2364
+ super.reset(), this._trimEmptyTail();
2365
+ }
2366
+ remove(t, e) {
2367
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
2368
+ const s = super.remove(t, e);
2369
+ return this._trimEmptyTail(t, e), s;
2370
+ }
2371
+ totalInputPositions(t, e) {
2372
+ return t === void 0 && (t = 0), e == null && this.repeatTo === 1 / 0 ? 1 / 0 : super.totalInputPositions(t, e);
2373
+ }
2374
+ get state() {
2375
+ return super.state;
2376
+ }
2377
+ set state(t) {
2378
+ this._blocks.length = t._blocks.length, this.mask = this.mask.slice(0, this._blocks.length), super.state = t;
2379
+ }
2380
+ }
2381
+ k.RepeatBlock = we;
2382
+ try {
2383
+ globalThis.IMask = k;
2384
+ } catch {
2385
+ }
2386
+ var ut = { exports: {} }, ot = { exports: {} }, I = {};
2387
+ var Nt;
2388
+ function Be() {
2389
+ if (Nt) return I;
2390
+ Nt = 1;
2391
+ var a = typeof Symbol == "function" && Symbol.for, t = a ? Symbol.for("react.element") : 60103, e = a ? Symbol.for("react.portal") : 60106, s = a ? Symbol.for("react.fragment") : 60107, i = a ? Symbol.for("react.strict_mode") : 60108, r = a ? Symbol.for("react.profiler") : 60114, n = a ? Symbol.for("react.provider") : 60109, u = a ? Symbol.for("react.context") : 60110, o = a ? Symbol.for("react.async_mode") : 60111, h = a ? Symbol.for("react.concurrent_mode") : 60111, m = a ? Symbol.for("react.forward_ref") : 60112, g = a ? Symbol.for("react.suspense") : 60113, y = a ? Symbol.for("react.suspense_list") : 60120, O = a ? Symbol.for("react.memo") : 60115, j = a ? Symbol.for("react.lazy") : 60116, B = a ? Symbol.for("react.block") : 60121, D = a ? Symbol.for("react.fundamental") : 60117, $ = a ? Symbol.for("react.responder") : 60118, st = a ? Symbol.for("react.scope") : 60119;
2392
+ function P(c) {
2393
+ if (typeof c == "object" && c !== null) {
2394
+ var Z = c.$$typeof;
2395
+ switch (Z) {
2396
+ case t:
2397
+ switch (c = c.type, c) {
2398
+ case o:
2399
+ case h:
2400
+ case s:
2401
+ case r:
2402
+ case i:
2403
+ case g:
2404
+ return c;
2405
+ default:
2406
+ switch (c = c && c.$$typeof, c) {
2407
+ case u:
2408
+ case m:
2409
+ case j:
2410
+ case O:
2411
+ case n:
2412
+ return c;
2413
+ default:
2414
+ return Z;
2415
+ }
2416
+ }
2417
+ case e:
2418
+ return Z;
2419
+ }
2420
+ }
2421
+ }
2422
+ function V(c) {
2423
+ return P(c) === h;
2424
+ }
2425
+ return I.AsyncMode = o, I.ConcurrentMode = h, I.ContextConsumer = u, I.ContextProvider = n, I.Element = t, I.ForwardRef = m, I.Fragment = s, I.Lazy = j, I.Memo = O, I.Portal = e, I.Profiler = r, I.StrictMode = i, I.Suspense = g, I.isAsyncMode = function(c) {
2426
+ return V(c) || P(c) === o;
2427
+ }, I.isConcurrentMode = V, I.isContextConsumer = function(c) {
2428
+ return P(c) === u;
2429
+ }, I.isContextProvider = function(c) {
2430
+ return P(c) === n;
2431
+ }, I.isElement = function(c) {
2432
+ return typeof c == "object" && c !== null && c.$$typeof === t;
2433
+ }, I.isForwardRef = function(c) {
2434
+ return P(c) === m;
2435
+ }, I.isFragment = function(c) {
2436
+ return P(c) === s;
2437
+ }, I.isLazy = function(c) {
2438
+ return P(c) === j;
2439
+ }, I.isMemo = function(c) {
2440
+ return P(c) === O;
2441
+ }, I.isPortal = function(c) {
2442
+ return P(c) === e;
2443
+ }, I.isProfiler = function(c) {
2444
+ return P(c) === r;
2445
+ }, I.isStrictMode = function(c) {
2446
+ return P(c) === i;
2447
+ }, I.isSuspense = function(c) {
2448
+ return P(c) === g;
2449
+ }, I.isValidElementType = function(c) {
2450
+ return typeof c == "string" || typeof c == "function" || c === s || c === h || c === r || c === i || c === g || c === y || typeof c == "object" && c !== null && (c.$$typeof === j || c.$$typeof === O || c.$$typeof === n || c.$$typeof === u || c.$$typeof === m || c.$$typeof === D || c.$$typeof === $ || c.$$typeof === st || c.$$typeof === B);
2451
+ }, I.typeOf = P, I;
2452
+ }
2453
+ var R = {};
2454
+ var jt;
2455
+ function Me() {
2456
+ return jt || (jt = 1, process.env.NODE_ENV !== "production" && (function() {
2457
+ var a = typeof Symbol == "function" && Symbol.for, t = a ? Symbol.for("react.element") : 60103, e = a ? Symbol.for("react.portal") : 60106, s = a ? Symbol.for("react.fragment") : 60107, i = a ? Symbol.for("react.strict_mode") : 60108, r = a ? Symbol.for("react.profiler") : 60114, n = a ? Symbol.for("react.provider") : 60109, u = a ? Symbol.for("react.context") : 60110, o = a ? Symbol.for("react.async_mode") : 60111, h = a ? Symbol.for("react.concurrent_mode") : 60111, m = a ? Symbol.for("react.forward_ref") : 60112, g = a ? Symbol.for("react.suspense") : 60113, y = a ? Symbol.for("react.suspense_list") : 60120, O = a ? Symbol.for("react.memo") : 60115, j = a ? Symbol.for("react.lazy") : 60116, B = a ? Symbol.for("react.block") : 60121, D = a ? Symbol.for("react.fundamental") : 60117, $ = a ? Symbol.for("react.responder") : 60118, st = a ? Symbol.for("react.scope") : 60119;
2458
+ function P(p) {
2459
+ return typeof p == "string" || typeof p == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
2460
+ p === s || p === h || p === r || p === i || p === g || p === y || typeof p == "object" && p !== null && (p.$$typeof === j || p.$$typeof === O || p.$$typeof === n || p.$$typeof === u || p.$$typeof === m || p.$$typeof === D || p.$$typeof === $ || p.$$typeof === st || p.$$typeof === B);
2461
+ }
2462
+ function V(p) {
2463
+ if (typeof p == "object" && p !== null) {
2464
+ var q = p.$$typeof;
2465
+ switch (q) {
2466
+ case t:
2467
+ var at = p.type;
2468
+ switch (at) {
2469
+ case o:
2470
+ case h:
2471
+ case s:
2472
+ case r:
2473
+ case i:
2474
+ case g:
2475
+ return at;
2476
+ default:
2477
+ var Dt = at && at.$$typeof;
2478
+ switch (Dt) {
2479
+ case u:
2480
+ case m:
2481
+ case j:
2482
+ case O:
2483
+ case n:
2484
+ return Dt;
2485
+ default:
2486
+ return q;
2487
+ }
2488
+ }
2489
+ case e:
2490
+ return q;
2491
+ }
2492
+ }
2493
+ }
2494
+ var c = o, Z = h, mt = u, gt = n, kt = t, vt = m, rt = s, Et = j, yt = O, tt = e, Ct = r, W = i, X = g, nt = !1;
2495
+ function At(p) {
2496
+ return nt || (nt = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), l(p) || V(p) === o;
2497
+ }
2498
+ function l(p) {
2499
+ return V(p) === h;
2500
+ }
2501
+ function d(p) {
2502
+ return V(p) === u;
2503
+ }
2504
+ function x(p) {
2505
+ return V(p) === n;
2506
+ }
2507
+ function A(p) {
2508
+ return typeof p == "object" && p !== null && p.$$typeof === t;
2509
+ }
2510
+ function v(p) {
2511
+ return V(p) === m;
2512
+ }
2513
+ function F(p) {
2514
+ return V(p) === s;
2515
+ }
2516
+ function C(p) {
2517
+ return V(p) === j;
2518
+ }
2519
+ function b(p) {
2520
+ return V(p) === O;
2521
+ }
2522
+ function S(p) {
2523
+ return V(p) === e;
2524
+ }
2525
+ function w(p) {
2526
+ return V(p) === r;
2527
+ }
2528
+ function T(p) {
2529
+ return V(p) === i;
2530
+ }
2531
+ function U(p) {
2532
+ return V(p) === g;
2533
+ }
2534
+ R.AsyncMode = c, R.ConcurrentMode = Z, R.ContextConsumer = mt, R.ContextProvider = gt, R.Element = kt, R.ForwardRef = vt, R.Fragment = rt, R.Lazy = Et, R.Memo = yt, R.Portal = tt, R.Profiler = Ct, R.StrictMode = W, R.Suspense = X, R.isAsyncMode = At, R.isConcurrentMode = l, R.isContextConsumer = d, R.isContextProvider = x, R.isElement = A, R.isForwardRef = v, R.isFragment = F, R.isLazy = C, R.isMemo = b, R.isPortal = S, R.isProfiler = w, R.isStrictMode = T, R.isSuspense = U, R.isValidElementType = P, R.typeOf = V;
2535
+ })()), R;
2536
+ }
2537
+ var Ut;
2538
+ function ee() {
2539
+ return Ut || (Ut = 1, process.env.NODE_ENV === "production" ? ot.exports = Be() : ot.exports = Me()), ot.exports;
2540
+ }
2541
+ var xt, zt;
2542
+ function Oe() {
2543
+ if (zt) return xt;
2544
+ zt = 1;
2545
+ var a = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, e = Object.prototype.propertyIsEnumerable;
2546
+ function s(r) {
2547
+ if (r == null)
2548
+ throw new TypeError("Object.assign cannot be called with null or undefined");
2549
+ return Object(r);
2550
+ }
2551
+ function i() {
2552
+ try {
2553
+ if (!Object.assign)
2554
+ return !1;
2555
+ var r = new String("abc");
2556
+ if (r[5] = "de", Object.getOwnPropertyNames(r)[0] === "5")
2557
+ return !1;
2558
+ for (var n = {}, u = 0; u < 10; u++)
2559
+ n["_" + String.fromCharCode(u)] = u;
2560
+ var o = Object.getOwnPropertyNames(n).map(function(m) {
2561
+ return n[m];
2562
+ });
2563
+ if (o.join("") !== "0123456789")
2564
+ return !1;
2565
+ var h = {};
2566
+ return "abcdefghijklmnopqrst".split("").forEach(function(m) {
2567
+ h[m] = m;
2568
+ }), Object.keys(Object.assign({}, h)).join("") === "abcdefghijklmnopqrst";
2569
+ } catch {
2570
+ return !1;
2571
+ }
2572
+ }
2573
+ return xt = i() ? Object.assign : function(r, n) {
2574
+ for (var u, o = s(r), h, m = 1; m < arguments.length; m++) {
2575
+ u = Object(arguments[m]);
2576
+ for (var g in u)
2577
+ t.call(u, g) && (o[g] = u[g]);
2578
+ if (a) {
2579
+ h = a(u);
2580
+ for (var y = 0; y < h.length; y++)
2581
+ e.call(u, h[y]) && (o[h[y]] = u[h[y]]);
2582
+ }
2583
+ }
2584
+ return o;
2585
+ }, xt;
2586
+ }
2587
+ var Ft, $t;
2588
+ function Ot() {
2589
+ if ($t) return Ft;
2590
+ $t = 1;
2591
+ var a = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
2592
+ return Ft = a, Ft;
2593
+ }
2594
+ var St, Wt;
2595
+ function se() {
2596
+ return Wt || (Wt = 1, St = Function.call.bind(Object.prototype.hasOwnProperty)), St;
2597
+ }
2598
+ var Tt, qt;
2599
+ function De() {
2600
+ if (qt) return Tt;
2601
+ qt = 1;
2602
+ var a = function() {
2603
+ };
2604
+ if (process.env.NODE_ENV !== "production") {
2605
+ var t = /* @__PURE__ */ Ot(), e = {}, s = /* @__PURE__ */ se();
2606
+ a = function(r) {
2607
+ var n = "Warning: " + r;
2608
+ typeof console < "u" && console.error(n);
2609
+ try {
2610
+ throw new Error(n);
2611
+ } catch {
2612
+ }
2613
+ };
2614
+ }
2615
+ function i(r, n, u, o, h) {
2616
+ if (process.env.NODE_ENV !== "production") {
2617
+ for (var m in r)
2618
+ if (s(r, m)) {
2619
+ var g;
2620
+ try {
2621
+ if (typeof r[m] != "function") {
2622
+ var y = Error(
2623
+ (o || "React class") + ": " + u + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
2624
+ );
2625
+ throw y.name = "Invariant Violation", y;
2626
+ }
2627
+ g = r[m](n, m, o, u, null, t);
2628
+ } catch (j) {
2629
+ g = j;
2630
+ }
2631
+ if (g && !(g instanceof Error) && a(
2632
+ (o || "React class") + ": type specification of " + u + " `" + m + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof g + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
2633
+ ), g instanceof Error && !(g.message in e)) {
2634
+ e[g.message] = !0;
2635
+ var O = h ? h() : "";
2636
+ a(
2637
+ "Failed " + u + " type: " + g.message + (O ?? "")
2638
+ );
2639
+ }
2640
+ }
2641
+ }
2642
+ }
2643
+ return i.resetWarningCache = function() {
2644
+ process.env.NODE_ENV !== "production" && (e = {});
2645
+ }, Tt = i, Tt;
2646
+ }
2647
+ var It, Yt;
2648
+ function Ve() {
2649
+ if (Yt) return It;
2650
+ Yt = 1;
2651
+ var a = ee(), t = Oe(), e = /* @__PURE__ */ Ot(), s = /* @__PURE__ */ se(), i = /* @__PURE__ */ De(), r = function() {
2652
+ };
2653
+ process.env.NODE_ENV !== "production" && (r = function(u) {
2654
+ var o = "Warning: " + u;
2655
+ typeof console < "u" && console.error(o);
2656
+ try {
2657
+ throw new Error(o);
2658
+ } catch {
2659
+ }
2660
+ });
2661
+ function n() {
2662
+ return null;
2663
+ }
2664
+ return It = function(u, o) {
2665
+ var h = typeof Symbol == "function" && Symbol.iterator, m = "@@iterator";
2666
+ function g(l) {
2667
+ var d = l && (h && l[h] || l[m]);
2668
+ if (typeof d == "function")
2669
+ return d;
2670
+ }
2671
+ var y = "<<anonymous>>", O = {
2672
+ array: $("array"),
2673
+ bigint: $("bigint"),
2674
+ bool: $("boolean"),
2675
+ func: $("function"),
2676
+ number: $("number"),
2677
+ object: $("object"),
2678
+ string: $("string"),
2679
+ symbol: $("symbol"),
2680
+ any: st(),
2681
+ arrayOf: P,
2682
+ element: V(),
2683
+ elementType: c(),
2684
+ instanceOf: Z,
2685
+ node: vt(),
2686
+ objectOf: gt,
2687
+ oneOf: mt,
2688
+ oneOfType: kt,
2689
+ shape: Et,
2690
+ exact: yt
2691
+ };
2692
+ function j(l, d) {
2693
+ return l === d ? l !== 0 || 1 / l === 1 / d : l !== l && d !== d;
2694
+ }
2695
+ function B(l, d) {
2696
+ this.message = l, this.data = d && typeof d == "object" ? d : {}, this.stack = "";
2697
+ }
2698
+ B.prototype = Error.prototype;
2699
+ function D(l) {
2700
+ if (process.env.NODE_ENV !== "production")
2701
+ var d = {}, x = 0;
2702
+ function A(F, C, b, S, w, T, U) {
2703
+ if (S = S || y, T = T || b, U !== e) {
2704
+ if (o) {
2705
+ var p = new Error(
2706
+ "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
2707
+ );
2708
+ throw p.name = "Invariant Violation", p;
2709
+ } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
2710
+ var q = S + ":" + b;
2711
+ !d[q] && // Avoid spamming the console because they are often not actionable except for lib authors
2712
+ x < 3 && (r(
2713
+ "You are manually calling a React.PropTypes validation function for the `" + T + "` prop on `" + S + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
2714
+ ), d[q] = !0, x++);
2715
+ }
2716
+ }
2717
+ return C[b] == null ? F ? C[b] === null ? new B("The " + w + " `" + T + "` is marked as required " + ("in `" + S + "`, but its value is `null`.")) : new B("The " + w + " `" + T + "` is marked as required in " + ("`" + S + "`, but its value is `undefined`.")) : null : l(C, b, S, w, T);
2718
+ }
2719
+ var v = A.bind(null, !1);
2720
+ return v.isRequired = A.bind(null, !0), v;
2721
+ }
2722
+ function $(l) {
2723
+ function d(x, A, v, F, C, b) {
2724
+ var S = x[A], w = W(S);
2725
+ if (w !== l) {
2726
+ var T = X(S);
2727
+ return new B(
2728
+ "Invalid " + F + " `" + C + "` of type " + ("`" + T + "` supplied to `" + v + "`, expected ") + ("`" + l + "`."),
2729
+ { expectedType: l }
2730
+ );
2731
+ }
2732
+ return null;
2733
+ }
2734
+ return D(d);
2735
+ }
2736
+ function st() {
2737
+ return D(n);
2738
+ }
2739
+ function P(l) {
2740
+ function d(x, A, v, F, C) {
2741
+ if (typeof l != "function")
2742
+ return new B("Property `" + C + "` of component `" + v + "` has invalid PropType notation inside arrayOf.");
2743
+ var b = x[A];
2744
+ if (!Array.isArray(b)) {
2745
+ var S = W(b);
2746
+ return new B("Invalid " + F + " `" + C + "` of type " + ("`" + S + "` supplied to `" + v + "`, expected an array."));
2747
+ }
2748
+ for (var w = 0; w < b.length; w++) {
2749
+ var T = l(b, w, v, F, C + "[" + w + "]", e);
2750
+ if (T instanceof Error)
2751
+ return T;
2752
+ }
2753
+ return null;
2754
+ }
2755
+ return D(d);
2756
+ }
2757
+ function V() {
2758
+ function l(d, x, A, v, F) {
2759
+ var C = d[x];
2760
+ if (!u(C)) {
2761
+ var b = W(C);
2762
+ return new B("Invalid " + v + " `" + F + "` of type " + ("`" + b + "` supplied to `" + A + "`, expected a single ReactElement."));
2763
+ }
2764
+ return null;
2765
+ }
2766
+ return D(l);
2767
+ }
2768
+ function c() {
2769
+ function l(d, x, A, v, F) {
2770
+ var C = d[x];
2771
+ if (!a.isValidElementType(C)) {
2772
+ var b = W(C);
2773
+ return new B("Invalid " + v + " `" + F + "` of type " + ("`" + b + "` supplied to `" + A + "`, expected a single ReactElement type."));
2774
+ }
2775
+ return null;
2776
+ }
2777
+ return D(l);
2778
+ }
2779
+ function Z(l) {
2780
+ function d(x, A, v, F, C) {
2781
+ if (!(x[A] instanceof l)) {
2782
+ var b = l.name || y, S = At(x[A]);
2783
+ return new B("Invalid " + F + " `" + C + "` of type " + ("`" + S + "` supplied to `" + v + "`, expected ") + ("instance of `" + b + "`."));
2784
+ }
2785
+ return null;
2786
+ }
2787
+ return D(d);
2788
+ }
2789
+ function mt(l) {
2790
+ if (!Array.isArray(l))
2791
+ return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? r(
2792
+ "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
2793
+ ) : r("Invalid argument supplied to oneOf, expected an array.")), n;
2794
+ function d(x, A, v, F, C) {
2795
+ for (var b = x[A], S = 0; S < l.length; S++)
2796
+ if (j(b, l[S]))
2797
+ return null;
2798
+ var w = JSON.stringify(l, function(U, p) {
2799
+ var q = X(p);
2800
+ return q === "symbol" ? String(p) : p;
2801
+ });
2802
+ return new B("Invalid " + F + " `" + C + "` of value `" + String(b) + "` " + ("supplied to `" + v + "`, expected one of " + w + "."));
2803
+ }
2804
+ return D(d);
2805
+ }
2806
+ function gt(l) {
2807
+ function d(x, A, v, F, C) {
2808
+ if (typeof l != "function")
2809
+ return new B("Property `" + C + "` of component `" + v + "` has invalid PropType notation inside objectOf.");
2810
+ var b = x[A], S = W(b);
2811
+ if (S !== "object")
2812
+ return new B("Invalid " + F + " `" + C + "` of type " + ("`" + S + "` supplied to `" + v + "`, expected an object."));
2813
+ for (var w in b)
2814
+ if (s(b, w)) {
2815
+ var T = l(b, w, v, F, C + "." + w, e);
2816
+ if (T instanceof Error)
2817
+ return T;
2818
+ }
2819
+ return null;
2820
+ }
2821
+ return D(d);
2822
+ }
2823
+ function kt(l) {
2824
+ if (!Array.isArray(l))
2825
+ return process.env.NODE_ENV !== "production" && r("Invalid argument supplied to oneOfType, expected an instance of array."), n;
2826
+ for (var d = 0; d < l.length; d++) {
2827
+ var x = l[d];
2828
+ if (typeof x != "function")
2829
+ return r(
2830
+ "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + nt(x) + " at index " + d + "."
2831
+ ), n;
2832
+ }
2833
+ function A(v, F, C, b, S) {
2834
+ for (var w = [], T = 0; T < l.length; T++) {
2835
+ var U = l[T], p = U(v, F, C, b, S, e);
2836
+ if (p == null)
2837
+ return null;
2838
+ p.data && s(p.data, "expectedType") && w.push(p.data.expectedType);
2839
+ }
2840
+ var q = w.length > 0 ? ", expected one of type [" + w.join(", ") + "]" : "";
2841
+ return new B("Invalid " + b + " `" + S + "` supplied to " + ("`" + C + "`" + q + "."));
2842
+ }
2843
+ return D(A);
2844
+ }
2845
+ function vt() {
2846
+ function l(d, x, A, v, F) {
2847
+ return tt(d[x]) ? null : new B("Invalid " + v + " `" + F + "` supplied to " + ("`" + A + "`, expected a ReactNode."));
2848
+ }
2849
+ return D(l);
2850
+ }
2851
+ function rt(l, d, x, A, v) {
2852
+ return new B(
2853
+ (l || "React class") + ": " + d + " type `" + x + "." + A + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + v + "`."
2854
+ );
2855
+ }
2856
+ function Et(l) {
2857
+ function d(x, A, v, F, C) {
2858
+ var b = x[A], S = W(b);
2859
+ if (S !== "object")
2860
+ return new B("Invalid " + F + " `" + C + "` of type `" + S + "` " + ("supplied to `" + v + "`, expected `object`."));
2861
+ for (var w in l) {
2862
+ var T = l[w];
2863
+ if (typeof T != "function")
2864
+ return rt(v, F, C, w, X(T));
2865
+ var U = T(b, w, v, F, C + "." + w, e);
2866
+ if (U)
2867
+ return U;
2868
+ }
2869
+ return null;
2870
+ }
2871
+ return D(d);
2872
+ }
2873
+ function yt(l) {
2874
+ function d(x, A, v, F, C) {
2875
+ var b = x[A], S = W(b);
2876
+ if (S !== "object")
2877
+ return new B("Invalid " + F + " `" + C + "` of type `" + S + "` " + ("supplied to `" + v + "`, expected `object`."));
2878
+ var w = t({}, x[A], l);
2879
+ for (var T in w) {
2880
+ var U = l[T];
2881
+ if (s(l, T) && typeof U != "function")
2882
+ return rt(v, F, C, T, X(U));
2883
+ if (!U)
2884
+ return new B(
2885
+ "Invalid " + F + " `" + C + "` key `" + T + "` supplied to `" + v + "`.\nBad object: " + JSON.stringify(x[A], null, " ") + `
2886
+ Valid keys: ` + JSON.stringify(Object.keys(l), null, " ")
2887
+ );
2888
+ var p = U(b, T, v, F, C + "." + T, e);
2889
+ if (p)
2890
+ return p;
2891
+ }
2892
+ return null;
2893
+ }
2894
+ return D(d);
2895
+ }
2896
+ function tt(l) {
2897
+ switch (typeof l) {
2898
+ case "number":
2899
+ case "string":
2900
+ case "undefined":
2901
+ return !0;
2902
+ case "boolean":
2903
+ return !l;
2904
+ case "object":
2905
+ if (Array.isArray(l))
2906
+ return l.every(tt);
2907
+ if (l === null || u(l))
2908
+ return !0;
2909
+ var d = g(l);
2910
+ if (d) {
2911
+ var x = d.call(l), A;
2912
+ if (d !== l.entries) {
2913
+ for (; !(A = x.next()).done; )
2914
+ if (!tt(A.value))
2915
+ return !1;
2916
+ } else
2917
+ for (; !(A = x.next()).done; ) {
2918
+ var v = A.value;
2919
+ if (v && !tt(v[1]))
2920
+ return !1;
2921
+ }
2922
+ } else
2923
+ return !1;
2924
+ return !0;
2925
+ default:
2926
+ return !1;
2927
+ }
2928
+ }
2929
+ function Ct(l, d) {
2930
+ return l === "symbol" ? !0 : d ? d["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && d instanceof Symbol : !1;
2931
+ }
2932
+ function W(l) {
2933
+ var d = typeof l;
2934
+ return Array.isArray(l) ? "array" : l instanceof RegExp ? "object" : Ct(d, l) ? "symbol" : d;
2935
+ }
2936
+ function X(l) {
2937
+ if (typeof l > "u" || l === null)
2938
+ return "" + l;
2939
+ var d = W(l);
2940
+ if (d === "object") {
2941
+ if (l instanceof Date)
2942
+ return "date";
2943
+ if (l instanceof RegExp)
2944
+ return "regexp";
2945
+ }
2946
+ return d;
2947
+ }
2948
+ function nt(l) {
2949
+ var d = X(l);
2950
+ switch (d) {
2951
+ case "array":
2952
+ case "object":
2953
+ return "an " + d;
2954
+ case "boolean":
2955
+ case "date":
2956
+ case "regexp":
2957
+ return "a " + d;
2958
+ default:
2959
+ return d;
2960
+ }
2961
+ }
2962
+ function At(l) {
2963
+ return !l.constructor || !l.constructor.name ? y : l.constructor.name;
2964
+ }
2965
+ return O.checkPropTypes = i, O.resetWarningCache = i.resetWarningCache, O.PropTypes = O, O;
2966
+ }, It;
2967
+ }
2968
+ var Rt, Ht;
2969
+ function Pe() {
2970
+ if (Ht) return Rt;
2971
+ Ht = 1;
2972
+ var a = /* @__PURE__ */ Ot();
2973
+ function t() {
2974
+ }
2975
+ function e() {
2976
+ }
2977
+ return e.resetWarningCache = t, Rt = function() {
2978
+ function s(n, u, o, h, m, g) {
2979
+ if (g !== a) {
2980
+ var y = new Error(
2981
+ "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
2982
+ );
2983
+ throw y.name = "Invariant Violation", y;
2984
+ }
2985
+ }
2986
+ s.isRequired = s;
2987
+ function i() {
2988
+ return s;
2989
+ }
2990
+ var r = {
2991
+ array: s,
2992
+ bigint: s,
2993
+ bool: s,
2994
+ func: s,
2995
+ number: s,
2996
+ object: s,
2997
+ string: s,
2998
+ symbol: s,
2999
+ any: s,
3000
+ arrayOf: i,
3001
+ element: s,
3002
+ elementType: s,
3003
+ instanceOf: i,
3004
+ node: s,
3005
+ objectOf: i,
3006
+ oneOf: i,
3007
+ oneOfType: i,
3008
+ shape: i,
3009
+ exact: i,
3010
+ checkPropTypes: e,
3011
+ resetWarningCache: t
3012
+ };
3013
+ return r.PropTypes = r, r;
3014
+ }, Rt;
3015
+ }
3016
+ var Kt;
3017
+ function Le() {
3018
+ if (Kt) return ut.exports;
3019
+ if (Kt = 1, process.env.NODE_ENV !== "production") {
3020
+ var a = ee(), t = !0;
3021
+ ut.exports = /* @__PURE__ */ Ve()(a.isElement, t);
3022
+ } else
3023
+ ut.exports = /* @__PURE__ */ Pe()();
3024
+ return ut.exports;
3025
+ }
3026
+ var Ne = /* @__PURE__ */ Le();
3027
+ const f = /* @__PURE__ */ ue(Ne), ie = {
3028
+ // common
3029
+ mask: f.oneOfType([f.array, f.func, f.string, f.instanceOf(RegExp), f.oneOf([Date, Number, k.Masked]), f.instanceOf(k.Masked)]),
3030
+ value: f.any,
3031
+ unmask: f.oneOfType([f.bool, f.oneOf(["typed"])]),
3032
+ prepare: f.func,
3033
+ prepareChar: f.func,
3034
+ validate: f.func,
3035
+ commit: f.func,
3036
+ overwrite: f.oneOfType([f.bool, f.oneOf(["shift"])]),
3037
+ eager: f.oneOfType([f.bool, f.oneOf(["append", "remove"])]),
3038
+ skipInvalid: f.bool,
3039
+ // events
3040
+ onAccept: f.func,
3041
+ onComplete: f.func,
3042
+ // pattern
3043
+ placeholderChar: f.string,
3044
+ displayChar: f.string,
3045
+ lazy: f.bool,
3046
+ definitions: f.object,
3047
+ blocks: f.object,
3048
+ // enum
3049
+ enum: f.arrayOf(f.string),
3050
+ // range
3051
+ maxLength: f.number,
3052
+ from: f.number,
3053
+ to: f.number,
3054
+ // date
3055
+ pattern: f.string,
3056
+ format: f.func,
3057
+ parse: f.func,
3058
+ autofix: f.oneOfType([f.bool, f.oneOf(["pad"])]),
3059
+ // number
3060
+ radix: f.string,
3061
+ thousandsSeparator: f.string,
3062
+ mapToRadix: f.arrayOf(f.string),
3063
+ scale: f.number,
3064
+ normalizeZeros: f.bool,
3065
+ padFractionalZeros: f.bool,
3066
+ min: f.oneOfType([f.number, f.instanceOf(Date)]),
3067
+ max: f.oneOfType([f.number, f.instanceOf(Date)]),
3068
+ // dynamic
3069
+ dispatch: f.func,
3070
+ // ref
3071
+ inputRef: f.oneOfType([f.func, f.shape({
3072
+ current: f.object
3073
+ })])
3074
+ }, re = Object.keys(ie).filter((a) => a !== "value"), je = ["value", "unmask", "onAccept", "onComplete", "inputRef"], Ue = re.filter((a) => je.indexOf(a) < 0);
3075
+ function ze(a) {
3076
+ var t;
3077
+ const e = (t = class extends J.Component {
3078
+ constructor(r) {
3079
+ super(r), this._inputRef = this._inputRef.bind(this);
3080
+ }
3081
+ componentDidMount() {
3082
+ this.props.mask && this.initMask();
3083
+ }
3084
+ componentDidUpdate() {
3085
+ const r = this.props, n = this._extractMaskOptionsFromProps(r);
3086
+ if (n.mask)
3087
+ this.maskRef ? (this.maskRef.updateOptions(n), "value" in r && r.value !== void 0 && (this.maskValue = r.value)) : this.initMask(n);
3088
+ else if (this.destroyMask(), "value" in r && r.value !== void 0) {
3089
+ var u;
3090
+ (u = this.element) != null && u.isContentEditable && this.element.tagName !== "INPUT" && this.element.tagName !== "TEXTAREA" ? this.element.textContent = r.value : this.element.value = r.value;
3091
+ }
3092
+ }
3093
+ componentWillUnmount() {
3094
+ this.destroyMask();
3095
+ }
3096
+ _inputRef(r) {
3097
+ this.element = r, this.props.inputRef && (Object.prototype.hasOwnProperty.call(this.props.inputRef, "current") ? this.props.inputRef.current = r : this.props.inputRef(r));
3098
+ }
3099
+ initMask(r) {
3100
+ r === void 0 && (r = this._extractMaskOptionsFromProps(this.props)), this.maskRef = k(this.element, r).on("accept", this._onAccept.bind(this)).on("complete", this._onComplete.bind(this)), "value" in this.props && this.props.value !== void 0 && (this.maskValue = this.props.value);
3101
+ }
3102
+ destroyMask() {
3103
+ this.maskRef && (this.maskRef.destroy(), delete this.maskRef);
3104
+ }
3105
+ _extractMaskOptionsFromProps(r) {
3106
+ const {
3107
+ ...n
3108
+ } = r;
3109
+ return Object.keys(n).filter((u) => Ue.indexOf(u) < 0).forEach((u) => {
3110
+ delete n[u];
3111
+ }), n;
3112
+ }
3113
+ _extractNonMaskProps(r) {
3114
+ const {
3115
+ ...n
3116
+ } = r;
3117
+ return re.forEach((u) => {
3118
+ u !== "maxLength" && delete n[u];
3119
+ }), "defaultValue" in n || (n.defaultValue = r.mask ? "" : n.value), delete n.value, n;
3120
+ }
3121
+ get maskValue() {
3122
+ return this.maskRef ? this.props.unmask === "typed" ? this.maskRef.typedValue : this.props.unmask ? this.maskRef.unmaskedValue : this.maskRef.value : "";
3123
+ }
3124
+ set maskValue(r) {
3125
+ this.maskRef && (r = r == null && this.props.unmask !== "typed" ? "" : r, this.props.unmask === "typed" ? this.maskRef.typedValue = r : this.props.unmask ? this.maskRef.unmaskedValue = r : this.maskRef.value = r);
3126
+ }
3127
+ _onAccept(r) {
3128
+ this.props.onAccept && this.maskRef && this.props.onAccept(this.maskValue, this.maskRef, r);
3129
+ }
3130
+ _onComplete(r) {
3131
+ this.props.onComplete && this.maskRef && this.props.onComplete(this.maskValue, this.maskRef, r);
3132
+ }
3133
+ render() {
3134
+ return J.createElement(a, {
3135
+ ...this._extractNonMaskProps(this.props),
3136
+ inputRef: this._inputRef
3137
+ });
3138
+ }
3139
+ }, t.displayName = void 0, t.propTypes = void 0, t), s = a.displayName || a.name || "Component";
3140
+ return e.displayName = "IMask(" + s + ")", e.propTypes = ie, J.forwardRef((i, r) => J.createElement(e, {
3141
+ ...i,
3142
+ ref: r
3143
+ }));
3144
+ }
3145
+ const $e = ze((a) => {
3146
+ let {
3147
+ inputRef: t,
3148
+ ...e
3149
+ } = a;
3150
+ return J.createElement("input", {
3151
+ ...e,
3152
+ ref: t
3153
+ });
3154
+ }), We = (a, t) => J.createElement($e, {
3155
+ ...a,
3156
+ ref: t
3157
+ }), qe = J.forwardRef(We), wt = oe.bind(M), Xe = {
3158
+ light: "light",
3159
+ dark: "dark",
3160
+ gray: "gray",
3161
+ transparent: "transparent"
3162
+ }, Ye = ae(
14
3163
  ({
15
- size_s: n = "large",
16
- size_m: i,
17
- size_l: o,
18
- pre: p = !1,
19
- post: t = !1,
20
- variant: e = "light",
21
- width: s = "auto",
22
- error: _,
23
- additionalClass: u = "",
24
- ...l
25
- }, c) => /* @__PURE__ */ q(
3164
+ size_s: a = "large",
3165
+ size_m: t,
3166
+ size_l: e,
3167
+ pre: s = !1,
3168
+ post: i = !1,
3169
+ variant: r = "light",
3170
+ width: n = "auto",
3171
+ error: u,
3172
+ type: o,
3173
+ isPhoneIMask: h = !1,
3174
+ additionalClass: m = "",
3175
+ ...g
3176
+ }, y) => h ? /* @__PURE__ */ et(
26
3177
  "div",
27
3178
  {
28
- className: $(
29
- r.inputWrapper,
30
- r[`${n}-size`],
31
- r[`${i}-size_m`],
32
- r[`${o}-size_l`],
33
- r[`${e}`],
34
- { [r.inputWrapperPre]: p },
35
- { [r.inputWrapperPost]: t },
36
- r[`${s}-width`],
37
- { [r.inputWrapperError]: _ },
38
- u
3179
+ className: wt(
3180
+ M.inputWrapper,
3181
+ M[`${a}-size_s`],
3182
+ M[`${t}-size_m`],
3183
+ M[`${e}-size_l`],
3184
+ M[`${r}`],
3185
+ { [M.inputWrapperPre]: s },
3186
+ { [M.inputWrapperPost]: i },
3187
+ M[`${n}-width`],
3188
+ { [M.inputWrapperError]: u && r === "light" },
3189
+ { [M.inputWrapperErrorWithoutBorder]: u && r === "gray" },
3190
+ { [M.inputWrapperErrorDark]: u && r === "dark" },
3191
+ m
39
3192
  ),
40
- children: [
41
- p && /* @__PURE__ */ a("span", { children: p }),
42
- /* @__PURE__ */ a(
43
- "input",
44
- {
45
- ref: c,
46
- ...l
47
- }
48
- ),
49
- t && /* @__PURE__ */ a("span", { children: t })
50
- ]
3193
+ children: /* @__PURE__ */ et(
3194
+ qe,
3195
+ {
3196
+ inputRef: y,
3197
+ className: M.inputIMask,
3198
+ mask: "+7 (000) 000-00-00",
3199
+ definitions: { 0: /[0-9]/ },
3200
+ placeholder: "+7 (---) --- -- --",
3201
+ ...g,
3202
+ max: void 0,
3203
+ min: void 0,
3204
+ value: String(g.value)
3205
+ }
3206
+ )
51
3207
  }
52
- )
3208
+ ) : /* @__PURE__ */ Vt(ne, { children: [
3209
+ o !== "checkbox" && /* @__PURE__ */ Vt(
3210
+ "div",
3211
+ {
3212
+ className: wt(
3213
+ M.inputWrapper,
3214
+ M[`${a}-size_s`],
3215
+ M[`${t}-size_m`],
3216
+ M[`${e}-size_l`],
3217
+ M[`${r}`],
3218
+ { [M.inputWrapperPre]: s },
3219
+ { [M.inputWrapperPost]: i },
3220
+ M[`${n}-width`],
3221
+ { [M.inputWrapperError]: u && r === "light" },
3222
+ { [M.inputWrapperErrorWithoutBorder]: u && r === "gray" },
3223
+ { [M.inputWrapperErrorDark]: u && r === "dark" },
3224
+ m
3225
+ ),
3226
+ children: [
3227
+ s && /* @__PURE__ */ et("div", { children: s }),
3228
+ /* @__PURE__ */ et(
3229
+ "input",
3230
+ {
3231
+ ref: y,
3232
+ type: o,
3233
+ ...g
3234
+ }
3235
+ ),
3236
+ i && /* @__PURE__ */ et("div", { children: i })
3237
+ ]
3238
+ }
3239
+ ),
3240
+ o === "checkbox" && /* @__PURE__ */ et(
3241
+ "input",
3242
+ {
3243
+ className: wt(M.checkBox),
3244
+ ref: y,
3245
+ type: o,
3246
+ ...g
3247
+ }
3248
+ )
3249
+ ] })
53
3250
  );
54
- x.displayName = "Input";
3251
+ Ye.displayName = "Input";
55
3252
  export {
56
- x as Input
3253
+ Xe as INPUT_VARIANTS,
3254
+ Ye as Input
57
3255
  };