stone-kit 0.0.880 → 0.0.882

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