@rzl-zone/utils-js 3.12.0 → 3.12.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/{LICENSE.md → LICENSE} +3 -3
  2. package/README.md +62 -89
  3. package/dist/.references/index.d.cts +25 -0
  4. package/dist/.references/index.d.ts +25 -0
  5. package/dist/assertIsArray-BChqwPiP.cjs +26 -0
  6. package/dist/assertIsArray-BChqwPiP.cjs.map +1 -0
  7. package/dist/assertIsArray-BfAbIUfa.js +20 -0
  8. package/dist/assertIsArray-BfAbIUfa.js.map +1 -0
  9. package/dist/assertIsBoolean-BlBct0Fc.js +1073 -0
  10. package/dist/assertIsBoolean-BlBct0Fc.js.map +1 -0
  11. package/dist/assertIsBoolean-DozdtbNi.cjs +1283 -0
  12. package/dist/assertIsBoolean-DozdtbNi.cjs.map +1 -0
  13. package/dist/assertIsString-Bvk7bUL7.cjs +26 -0
  14. package/dist/assertIsString-Bvk7bUL7.cjs.map +1 -0
  15. package/dist/assertIsString-DqV9NwbI.js +20 -0
  16. package/dist/assertIsString-DqV9NwbI.js.map +1 -0
  17. package/dist/assertions/index.cjs +37 -40
  18. package/dist/assertions/index.cjs.map +1 -0
  19. package/dist/assertions/index.d.cts +12 -0
  20. package/dist/assertions/index.d.ts +10 -824
  21. package/dist/assertions/index.js +30 -13
  22. package/dist/assertions/index.js.map +1 -0
  23. package/dist/conversions/index.cjs +34 -103
  24. package/dist/conversions/index.d.cts +12 -0
  25. package/dist/conversions/index.d.ts +10 -1791
  26. package/dist/conversions/index.js +14 -24
  27. package/dist/conversions-CBs8-REq.cjs +448 -0
  28. package/dist/conversions-CBs8-REq.cjs.map +1 -0
  29. package/dist/conversions-EMJa3g-D.js +382 -0
  30. package/dist/conversions-EMJa3g-D.js.map +1 -0
  31. package/dist/events/index.cjs +55 -31
  32. package/dist/events/index.cjs.map +1 -0
  33. package/dist/events/index.d.cts +174 -0
  34. package/dist/events/index.d.ts +31 -35
  35. package/dist/events/index.js +50 -12
  36. package/dist/events/index.js.map +1 -0
  37. package/dist/formatEnvPort-DpIXzPAZ.js +159 -0
  38. package/dist/formatEnvPort-DpIXzPAZ.js.map +1 -0
  39. package/dist/formatEnvPort-hHNvOim-.cjs +171 -0
  40. package/dist/formatEnvPort-hHNvOim-.cjs.map +1 -0
  41. package/dist/formatters/index.cjs +21 -61
  42. package/dist/formatters/index.d.cts +12 -0
  43. package/dist/formatters/index.d.ts +10 -2152
  44. package/dist/formatters/index.js +10 -18
  45. package/dist/formatters-QcZO_Cpx.js +367 -0
  46. package/dist/formatters-QcZO_Cpx.js.map +1 -0
  47. package/dist/formatters-lAYgA11L.cjs +427 -0
  48. package/dist/formatters-lAYgA11L.cjs.map +1 -0
  49. package/dist/generators/index.cjs +161 -41
  50. package/dist/generators/index.cjs.map +1 -0
  51. package/dist/generators/index.d.cts +12 -0
  52. package/dist/generators/index.d.ts +10 -338
  53. package/dist/generators/index.js +154 -14
  54. package/dist/generators/index.js.map +1 -0
  55. package/dist/index-26W7ItWx.d.ts +760 -0
  56. package/dist/index-BPPQjAfs.d.cts +2359 -0
  57. package/dist/index-BXjlgBLz.d.cts +2139 -0
  58. package/dist/index-B_Wwo91H.d.ts +2359 -0
  59. package/dist/index-CpufydcI.d.cts +704 -0
  60. package/dist/index-Czc4O526.d.ts +333 -0
  61. package/dist/index-DPs1_p5G.d.cts +760 -0
  62. package/dist/index-DRpOyBSC.d.ts +1703 -0
  63. package/dist/index-DWWvtHUn.d.cts +822 -0
  64. package/dist/index-DnM0LD0n.d.cts +333 -0
  65. package/dist/index-GUZ9fK6T.d.ts +2139 -0
  66. package/dist/index-I4fAzwXV.d.ts +704 -0
  67. package/dist/index-JDrOl_19.d.ts +822 -0
  68. package/dist/index-b66P49Qe.d.cts +1703 -0
  69. package/dist/isBigInt-B1cijjqm.cjs +20 -0
  70. package/dist/isBigInt-B1cijjqm.cjs.map +1 -0
  71. package/dist/isBigInt-C0bN0Rhu.js +14 -0
  72. package/dist/isBigInt-C0bN0Rhu.js.map +1 -0
  73. package/dist/isEmptyObject-DI42NEo0.cjs +37 -0
  74. package/dist/isEmptyObject-DI42NEo0.cjs.map +1 -0
  75. package/dist/isEmptyObject-DeLVIJpl.js +25 -0
  76. package/dist/isEmptyObject-DeLVIJpl.js.map +1 -0
  77. package/dist/isEmptyString-BTUWYTbw.js +15 -0
  78. package/dist/isEmptyString-BTUWYTbw.js.map +1 -0
  79. package/dist/isEmptyString-CCK3bP74.cjs +21 -0
  80. package/dist/isEmptyString-CCK3bP74.cjs.map +1 -0
  81. package/dist/isEmptyValue-DMSMFTU8.cjs +30 -0
  82. package/dist/isEmptyValue-DMSMFTU8.cjs.map +1 -0
  83. package/dist/isEmptyValue-fjnfQnt5.js +24 -0
  84. package/dist/isEmptyValue-fjnfQnt5.js.map +1 -0
  85. package/dist/isEqual-B1fRgEuU.cjs +111 -0
  86. package/dist/isEqual-B1fRgEuU.cjs.map +1 -0
  87. package/dist/isEqual-DhyP8fB_.js +87 -0
  88. package/dist/isEqual-DhyP8fB_.js.map +1 -0
  89. package/dist/isFinite-BYMOo0os.js +15 -0
  90. package/dist/isFinite-BYMOo0os.js.map +1 -0
  91. package/dist/isFinite-sFkps2TY.cjs +21 -0
  92. package/dist/isFinite-sFkps2TY.cjs.map +1 -0
  93. package/dist/isInteger-DS9V7l_f.js +14 -0
  94. package/dist/isInteger-DS9V7l_f.js.map +1 -0
  95. package/dist/isInteger-FTCthMre.cjs +20 -0
  96. package/dist/isInteger-FTCthMre.cjs.map +1 -0
  97. package/dist/isPlainObject-DcFGh3_5.d.ts +530 -0
  98. package/dist/isPlainObject-doTI11Ib.d.cts +530 -0
  99. package/dist/isServer-D1TXfOs3.js +14 -0
  100. package/dist/isServer-D1TXfOs3.js.map +1 -0
  101. package/dist/isServer-q-QLFCqE.cjs +20 -0
  102. package/dist/isServer-q-QLFCqE.cjs.map +1 -0
  103. package/dist/isTypedArray-47R0wdrc.js +31 -0
  104. package/dist/isTypedArray-47R0wdrc.js.map +1 -0
  105. package/dist/isTypedArray-DiCoqffZ.cjs +43 -0
  106. package/dist/isTypedArray-DiCoqffZ.cjs.map +1 -0
  107. package/dist/isURL-CQiowFq2.js +14 -0
  108. package/dist/isURL-CQiowFq2.js.map +1 -0
  109. package/dist/isURL-WZypXsax.cjs +20 -0
  110. package/dist/isURL-WZypXsax.cjs.map +1 -0
  111. package/dist/isValidDomain-BSXshgkC.cjs +1788 -0
  112. package/dist/isValidDomain-BSXshgkC.cjs.map +1 -0
  113. package/dist/isValidDomain-DwA2EN79.js +1782 -0
  114. package/dist/isValidDomain-DwA2EN79.js.map +1 -0
  115. package/dist/next/index.cjs +119 -214
  116. package/dist/next/index.cjs.map +1 -0
  117. package/dist/next/index.d.cts +226 -0
  118. package/dist/next/index.d.ts +26 -31
  119. package/dist/next/index.js +117 -212
  120. package/dist/next/index.js.map +1 -0
  121. package/dist/next/server/index.cjs +25 -40
  122. package/dist/next/server/index.cjs.map +1 -0
  123. package/dist/next/server/index.d.cts +39 -0
  124. package/dist/next/server/index.d.ts +9 -10
  125. package/dist/next/server/index.js +23 -38
  126. package/dist/next/server/index.js.map +1 -0
  127. package/dist/noop-B2mTBhW-.cjs +18 -0
  128. package/dist/noop-B2mTBhW-.cjs.map +1 -0
  129. package/dist/noop-BzktGBVz.js +12 -0
  130. package/dist/noop-BzktGBVz.js.map +1 -0
  131. package/dist/normalizeSpaces-DQHR3Tlr.cjs +29 -0
  132. package/dist/normalizeSpaces-DQHR3Tlr.cjs.map +1 -0
  133. package/dist/normalizeSpaces-WS_iERJk.js +23 -0
  134. package/dist/normalizeSpaces-WS_iERJk.js.map +1 -0
  135. package/dist/normalizeString-2WLth_Gj.js +15 -0
  136. package/dist/normalizeString-2WLth_Gj.js.map +1 -0
  137. package/dist/normalizeString-D8euBcRD.cjs +21 -0
  138. package/dist/normalizeString-D8euBcRD.cjs.map +1 -0
  139. package/dist/operations/index.cjs +65 -32
  140. package/dist/operations/index.cjs.map +1 -0
  141. package/dist/operations/index.d.cts +139 -0
  142. package/dist/operations/index.d.ts +10 -15
  143. package/dist/operations/index.js +61 -17
  144. package/dist/operations/index.js.map +1 -0
  145. package/dist/parsers/index.cjs +12 -19
  146. package/dist/parsers/index.d.cts +239 -0
  147. package/dist/parsers/index.d.ts +71 -72
  148. package/dist/parsers/index.js +10 -12
  149. package/dist/parsers-DXtpsDyj.cjs +649 -0
  150. package/dist/parsers-DXtpsDyj.cjs.map +1 -0
  151. package/dist/parsers-Dpuq-V4u.js +643 -0
  152. package/dist/parsers-Dpuq-V4u.js.map +1 -0
  153. package/dist/parsing-B43x1sxn.js +50 -0
  154. package/dist/parsing-B43x1sxn.js.map +1 -0
  155. package/dist/parsing-lRoxn1Nz.cjs +56 -0
  156. package/dist/parsing-lRoxn1Nz.cjs.map +1 -0
  157. package/dist/predicates/index.cjs +91 -296
  158. package/dist/predicates/index.d.cts +13 -0
  159. package/dist/predicates/index.d.ts +12 -2482
  160. package/dist/predicates/index.js +23 -25
  161. package/dist/predicates-DiaYA7Ps.cjs +413 -0
  162. package/dist/predicates-DiaYA7Ps.cjs.map +1 -0
  163. package/dist/predicates-gNepszvo.js +257 -0
  164. package/dist/predicates-gNepszvo.js.map +1 -0
  165. package/dist/promises/index.cjs +76 -24
  166. package/dist/promises/index.cjs.map +1 -0
  167. package/dist/promises/index.d.cts +123 -0
  168. package/dist/promises/index.d.ts +28 -31
  169. package/dist/promises/index.js +73 -13
  170. package/dist/promises/index.js.map +1 -0
  171. package/dist/punyCode-CTWXVVFo.cjs +185 -0
  172. package/dist/punyCode-CTWXVVFo.cjs.map +1 -0
  173. package/dist/punyCode-hmiFzLWT.js +179 -0
  174. package/dist/punyCode-hmiFzLWT.js.map +1 -0
  175. package/dist/removeSpaces-BE8lfh-4.js +19 -0
  176. package/dist/removeSpaces-BE8lfh-4.js.map +1 -0
  177. package/dist/removeSpaces-DRRxNWlb.cjs +25 -0
  178. package/dist/removeSpaces-DRRxNWlb.cjs.map +1 -0
  179. package/dist/safeJsonParse-BBnQElk8.cjs +208 -0
  180. package/dist/safeJsonParse-BBnQElk8.cjs.map +1 -0
  181. package/dist/safeJsonParse-CXruaP0p.js +184 -0
  182. package/dist/safeJsonParse-CXruaP0p.js.map +1 -0
  183. package/dist/safeStableStringify-BNh3D0K0.js +88 -0
  184. package/dist/safeStableStringify-BNh3D0K0.js.map +1 -0
  185. package/dist/safeStableStringify-Cc62pfRp.cjs +106 -0
  186. package/dist/safeStableStringify-Cc62pfRp.cjs.map +1 -0
  187. package/dist/strings/index.cjs +76 -81
  188. package/dist/strings/index.cjs.map +1 -0
  189. package/dist/strings/index.d.cts +12 -0
  190. package/dist/strings/index.d.ts +10 -775
  191. package/dist/strings/index.js +59 -14
  192. package/dist/strings/index.js.map +1 -0
  193. package/dist/tailwind/index.cjs +19 -47
  194. package/dist/tailwind/index.d.cts +12 -0
  195. package/dist/tailwind/index.d.ts +11 -712
  196. package/dist/tailwind/index.js +10 -12
  197. package/dist/tailwind-DJ4cmLUw.cjs +247 -0
  198. package/dist/tailwind-DJ4cmLUw.cjs.map +1 -0
  199. package/dist/tailwind-IJvOdkZp.js +199 -0
  200. package/dist/tailwind-IJvOdkZp.js.map +1 -0
  201. package/dist/toStringArrayUnRecursive-CFs0jTEg.js +39 -0
  202. package/dist/toStringArrayUnRecursive-CFs0jTEg.js.map +1 -0
  203. package/dist/toStringArrayUnRecursive-xUaU8Ot9.cjs +51 -0
  204. package/dist/toStringArrayUnRecursive-xUaU8Ot9.cjs.map +1 -0
  205. package/dist/urls/index.cjs +129 -57
  206. package/dist/urls/index.cjs.map +1 -0
  207. package/dist/urls/index.d.cts +740 -0
  208. package/dist/urls/index.d.ts +218 -224
  209. package/dist/urls/index.js +121 -26
  210. package/dist/urls/index.js.map +1 -0
  211. package/package.json +203 -194
  212. package/dist/chunk-2AFQ33D3.cjs +0 -64
  213. package/dist/chunk-2CYDJVGM.js +0 -246
  214. package/dist/chunk-2MW4JDQ2.cjs +0 -598
  215. package/dist/chunk-2VTDXC3N.cjs +0 -1825
  216. package/dist/chunk-44XX2P34.js +0 -209
  217. package/dist/chunk-4YLBKLGS.cjs +0 -18
  218. package/dist/chunk-566CXQW7.cjs +0 -560
  219. package/dist/chunk-57EPKYID.cjs +0 -397
  220. package/dist/chunk-5MGEC3YG.js +0 -63
  221. package/dist/chunk-6EF52423.cjs +0 -249
  222. package/dist/chunk-6SCOKU3S.js +0 -109
  223. package/dist/chunk-6VUXD3CF.js +0 -119
  224. package/dist/chunk-7B76BSNK.cjs +0 -118
  225. package/dist/chunk-7Y6I2DSU.cjs +0 -101
  226. package/dist/chunk-A7S7E2EE.cjs +0 -308
  227. package/dist/chunk-AJZ6PMMZ.js +0 -16
  228. package/dist/chunk-AXGBL2IO.cjs +0 -251
  229. package/dist/chunk-B4TC6FBV.cjs +0 -678
  230. package/dist/chunk-BAV5T2E3.cjs +0 -15
  231. package/dist/chunk-BKIJBNIE.js +0 -21
  232. package/dist/chunk-BNIMTFK5.js +0 -59
  233. package/dist/chunk-BXW7YXB7.js +0 -1823
  234. package/dist/chunk-CFYZC4S6.js +0 -53
  235. package/dist/chunk-CSG4SCL3.js +0 -1587
  236. package/dist/chunk-CWQW7AKK.js +0 -676
  237. package/dist/chunk-DVMHRLKP.cjs +0 -16
  238. package/dist/chunk-EN7LVZBZ.js +0 -548
  239. package/dist/chunk-EV4Y7HCY.cjs +0 -26
  240. package/dist/chunk-F66VDYIZ.cjs +0 -18
  241. package/dist/chunk-FLJX37EL.cjs +0 -30
  242. package/dist/chunk-GKC3UDMC.cjs +0 -1623
  243. package/dist/chunk-H65I3GRZ.cjs +0 -106
  244. package/dist/chunk-HHYWB7VZ.js +0 -24
  245. package/dist/chunk-HNGGISFL.cjs +0 -65
  246. package/dist/chunk-HNSQAVSZ.cjs +0 -35
  247. package/dist/chunk-HSP6IWZK.js +0 -17
  248. package/dist/chunk-IDZS7J6T.js +0 -242
  249. package/dist/chunk-JS6R55VL.js +0 -302
  250. package/dist/chunk-JZVT5FK7.js +0 -232
  251. package/dist/chunk-KHO2SBNA.cjs +0 -16
  252. package/dist/chunk-KIDJCMNJ.js +0 -33
  253. package/dist/chunk-KOLEURVT.cjs +0 -38
  254. package/dist/chunk-L4V53MQK.cjs +0 -269
  255. package/dist/chunk-L5RDAVVH.js +0 -14
  256. package/dist/chunk-NODTV4F3.js +0 -16
  257. package/dist/chunk-NYK5K3V2.cjs +0 -211
  258. package/dist/chunk-ODUO3RTL.cjs +0 -113
  259. package/dist/chunk-ONZFBJVW.js +0 -14
  260. package/dist/chunk-PFXCTE37.js +0 -28
  261. package/dist/chunk-PPST7QAQ.js +0 -587
  262. package/dist/chunk-Q5IMYDFL.cjs +0 -33
  263. package/dist/chunk-QFFBIOJ4.js +0 -31
  264. package/dist/chunk-QNKGP5DY.js +0 -14
  265. package/dist/chunk-RRQHMOPE.cjs +0 -19
  266. package/dist/chunk-RU5OSRBU.js +0 -95
  267. package/dist/chunk-SDMPEJ4F.js +0 -35
  268. package/dist/chunk-SYNL5IKP.js +0 -115
  269. package/dist/chunk-TCDOWZQE.js +0 -16
  270. package/dist/chunk-TQPGXGKB.cjs +0 -123
  271. package/dist/chunk-TULOI4GL.js +0 -370
  272. package/dist/chunk-UBHCP4N5.cjs +0 -36
  273. package/dist/chunk-UCHF3M34.cjs +0 -56
  274. package/dist/chunk-UDA26MCU.cjs +0 -16
  275. package/dist/chunk-V3C4FYZL.cjs +0 -18
  276. package/dist/chunk-VAAHZFBF.js +0 -32
  277. package/dist/chunk-VJDDGRIK.cjs +0 -16
  278. package/dist/chunk-WVSPXFTY.js +0 -14
  279. package/dist/chunk-WYP76WXB.js +0 -101
  280. package/dist/chunk-YDE4ZBB7.cjs +0 -237
  281. package/dist/chunk-YKQEOO7C.cjs +0 -23
  282. package/dist/chunk-YSZC56SZ.js +0 -264
  283. package/dist/chunk-YWHHVDT4.js +0 -13
  284. package/dist/index.d.ts +0 -24
  285. package/dist/isPlainObject-DTJVV2Kf.d.ts +0 -536
  286. package/dist/rzl-utils.global.js +0 -10
@@ -1,19 +1,11 @@
1
1
  /*!
2
- * ====================================================
3
- * Rzl Utils-JS.
4
- * ----------------------------------------------------
5
- * Version: 3.12.0.
6
- * Author: Rizalvin Dwiky.
7
- * Repository: https://github.com/rzl-zone/utils-js.
8
- * ====================================================
9
- */
10
- export { censorEmail, chunkString, formatCurrency, formatDateFns, formatDateIntl, formatDateTime, formatNumber, formatPhoneNumber, getGMTOffset, truncateString } from '../chunk-PPST7QAQ.js';
11
- import '../chunk-PFXCTE37.js';
12
- import '../chunk-5MGEC3YG.js';
13
- import '../chunk-NODTV4F3.js';
14
- import '../chunk-WVSPXFTY.js';
15
- import '../chunk-TCDOWZQE.js';
16
- import '../chunk-BKIJBNIE.js';
17
- import '../chunk-6VUXD3CF.js';
18
- import '../chunk-QNKGP5DY.js';
19
- import '../chunk-CSG4SCL3.js';
2
+ * ========================================================================
3
+ * @rzl-zone/utils-js
4
+ * ------------------------------------------------------------------------
5
+ * Version: `3.12.1-beta.0`
6
+ * Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
7
+ * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
8
+ * ========================================================================
9
+ */
10
+ import { a as truncateString, c as formatPhoneNumber, i as formatDateFns, l as formatNumber, n as formatDateTime, o as chunkString, r as formatDateIntl, s as censorEmail, t as getGMTOffset, u as formatCurrency } from "../formatters-QcZO_Cpx.js";
11
+ export { censorEmail, chunkString, formatCurrency, formatDateFns, formatDateIntl, formatDateTime, formatNumber, formatPhoneNumber, getGMTOffset, truncateString };
@@ -0,0 +1,367 @@
1
+ /*!
2
+ * ========================================================================
3
+ * @rzl-zone/utils-js
4
+ * ------------------------------------------------------------------------
5
+ * Version: `3.12.1-beta.0`
6
+ * Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
7
+ * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
8
+ * ========================================================================
9
+ */
10
+ import { A as isPlainObject, D as isNaN, F as isBoolean, N as isNil, P as isFunction, S as isUndefined, T as assertIsPlainObject, b as hasOwnProp, k as isString, r as getPreciseType, t as assertIsBoolean, w as isNumber, y as isNonEmptyString } from "./assertIsBoolean-BlBct0Fc.js";
11
+ import { t as assertIsString } from "./assertIsString-DqV9NwbI.js";
12
+ import { t as isFinite } from "./isFinite-BYMOo0os.js";
13
+ import { n as isDate, t as safeStableStringify } from "./safeStableStringify-BNh3D0K0.js";
14
+ import { t as isEmptyString } from "./isEmptyString-BTUWYTbw.js";
15
+ import { t as parseCurrencyString } from "./parsing-B43x1sxn.js";
16
+ import { t as isInteger } from "./isInteger-DS9V7l_f.js";
17
+ import { t as normalizeSpaces } from "./normalizeSpaces-WS_iERJk.js";
18
+ import { AsYouType, isSupportedCountry } from "libphonenumber-js/max";
19
+ import { enUS, id } from "date-fns/locale";
20
+ import { format, parse } from "date-fns";
21
+ const formatIndianNumber = ({ numStr, separator }) => {
22
+ const lastThree = numStr?.slice(-3);
23
+ const rest = numStr?.slice(0, -3);
24
+ if (!rest) return lastThree;
25
+ return rest.replace(/\B(?=(\d{2})+(?!\d))/g, separator) + separator + lastThree;
26
+ };
27
+ const formatCurrency = (value, options = {}) => {
28
+ if (!isString(value) && !isFinite(value)) throw new TypeError(`First parameter (\`value\`) must be of type \`string\` or \`primitive-number\`, but received: \`${getPreciseType(value)}\`, with value: \`${safeStableStringify(value, { keepUndefined: true })}\`.`);
29
+ assertIsPlainObject(options, { message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
30
+ const decimal = hasOwnProp(options, "decimal") ? options.decimal : false;
31
+ const totalDecimal = hasOwnProp(options, "totalDecimal") ? options.totalDecimal : 2;
32
+ const endDecimal = hasOwnProp(options, "endDecimal") ? options.endDecimal : true;
33
+ const indianFormat = hasOwnProp(options, "indianFormat") ? options.indianFormat : false;
34
+ const suffixCurrency = hasOwnProp(options, "suffixCurrency") ? options.suffixCurrency : "";
35
+ const suffixDecimal = hasOwnProp(options, "suffixDecimal") ? options.suffixDecimal : "";
36
+ const roundedDecimal = hasOwnProp(options, "roundedDecimal") ? options.roundedDecimal : "round";
37
+ const negativeFormat = hasOwnProp(options, "negativeFormat") ? options.negativeFormat : "dash";
38
+ let separatorDecimals = hasOwnProp(options, "separatorDecimals") ? options.separatorDecimals : ",";
39
+ let separator = hasOwnProp(options, "separator") ? options.separator : ".";
40
+ if (!isString(separator) || !isString(separatorDecimals) || !isString(suffixCurrency) || !isString(suffixDecimal)) throw new TypeError(`Parameter \`separator\`, \`separatorDecimals\`, \`suffixCurrency\` and \`suffixDecimal\` property of the \`options\` (second parameter) must be of type \`string\`, but received: ['separator': \`${getPreciseType(separator)}\`, 'separatorDecimals': \`${getPreciseType(separatorDecimals)}\`, 'suffixCurrency': \`${getPreciseType(suffixCurrency)}\`, 'suffixDecimal': \`${getPreciseType(suffixDecimal)}\`].`);
41
+ if (!isBoolean(decimal) || !isBoolean(endDecimal) || !isBoolean(indianFormat)) throw new TypeError(`Parameter \`decimal\`, \`endDecimal\` and \`indianFormat\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['decimal': \`${getPreciseType(decimal)}\`, 'endDecimal': \`${getPreciseType(endDecimal)}\`, 'indianFormat': \`${getPreciseType(indianFormat)}\`].`);
42
+ if (!isInteger(totalDecimal)) throw new TypeError(`Parameter \`totalDecimal\` property of the \`options\` (second parameter) must be of type \`integer-number\`, but received: \`${getPreciseType(totalDecimal)}\`, with value: \`${safeStableStringify(length, { keepUndefined: true })}\`.`);
43
+ if (!(roundedDecimal === false || roundedDecimal === "round" || roundedDecimal === "ceil" || roundedDecimal === "floor")) throw new TypeError(`Parameter \`roundedDecimal\` property of the \`options\` (second parameter) must be of type \`false\` or \`string\` must be one of "round" | "ceil" | "floor", but received: \`${getPreciseType(roundedDecimal)}\`, with value: \`${safeStableStringify(roundedDecimal, { keepUndefined: true })}\`.`);
44
+ if (!(negativeFormat === "abs" || negativeFormat === "brackets" || negativeFormat === "dash" || isPlainObject(negativeFormat))) throw new TypeError(`Parameter \`negativeFormat\` property of the \`options\` (second parameter) must be of type \`string\` must be one of "abs" | "brackets" | "dash" or \`plain-object\` type, but received: \`${getPreciseType(negativeFormat)}\`, with value: \`${safeStableStringify(negativeFormat, { keepUndefined: true })}\`.`);
45
+ const rawNum = isString(value) ? parseCurrencyString(value) : value;
46
+ if (isNaN(rawNum)) throw new TypeError("First parameter (`value`) could not be parsed into a valid `number`.");
47
+ let integerPart;
48
+ let decimalPartRaw;
49
+ let num = Math.abs(rawNum);
50
+ const factor = Math.pow(10, totalDecimal);
51
+ if (roundedDecimal) {
52
+ const scaled = num * factor;
53
+ switch (roundedDecimal) {
54
+ case "round":
55
+ num = Math.round(scaled) / factor;
56
+ break;
57
+ case "ceil":
58
+ num = Math.ceil(scaled) / factor;
59
+ break;
60
+ case "floor":
61
+ num = Math.floor(scaled) / factor;
62
+ break;
63
+ }
64
+ }
65
+ if (roundedDecimal) {
66
+ [integerPart, decimalPartRaw] = num.toFixed(totalDecimal).split(".");
67
+ decimalPartRaw = decimalPartRaw ?? "".padEnd(totalDecimal, "0");
68
+ } else {
69
+ const split = String(num).split(".");
70
+ integerPart = split[0];
71
+ decimalPartRaw = (split[1] || "").slice(0, totalDecimal).padEnd(totalDecimal, "0");
72
+ }
73
+ let formattedInteger;
74
+ if (indianFormat) {
75
+ separator = ",";
76
+ separatorDecimals = ".";
77
+ formattedInteger = (suffixCurrency.trim().length ? suffixCurrency : "") + formatIndianNumber({
78
+ numStr: integerPart,
79
+ separator
80
+ });
81
+ } else formattedInteger = (suffixCurrency.trim().length ? suffixCurrency : "") + integerPart?.replace(/\B(?=(\d{3})+(?!\d))/g, separator);
82
+ if (decimal && !isUndefined(decimalPartRaw) && totalDecimal > 0) {
83
+ let formattedDecimal = separatorDecimals + decimalPartRaw;
84
+ if (endDecimal) formattedDecimal += suffixDecimal;
85
+ formattedInteger += formattedDecimal;
86
+ }
87
+ if (rawNum < 0) {
88
+ if (negativeFormat === "dash") formattedInteger = "-" + formattedInteger;
89
+ else if (negativeFormat === "brackets") formattedInteger = "(" + formattedInteger + ")";
90
+ else if (negativeFormat === "abs") {} else if (isPlainObject(negativeFormat)) if (hasOwnProp(negativeFormat, "custom")) {
91
+ const formatCustomNegative = negativeFormat.custom;
92
+ if (!isFunction(formatCustomNegative)) throw new TypeError(`Parameter \`negativeFormat.custom\` property of the \`options\` (second parameter) must be of type function: \`(formatted: string) => string\`, but received: \`${getPreciseType(formatCustomNegative)}\`.`);
93
+ const result = formatCustomNegative(formattedInteger);
94
+ assertIsString(result, { message: ({ currentType, validType }) => `Parameter \`negativeFormat.custom\` property of the \`options\` (second parameter) expected return a \`${validType}\` type value, but received: \`${currentType}\`.` });
95
+ formattedInteger = result;
96
+ } else {
97
+ const formatStyleNegative = negativeFormat.style || "dash";
98
+ const formatSpaceNegative = !isUndefined(negativeFormat.space) ? negativeFormat.space : false;
99
+ assertIsBoolean(formatSpaceNegative, { message: ({ currentType, validType }) => `Parameter \`negativeFormat.space\` property of the \`options\` (second parameter) must be of type \`${validType} or undefined\`, but received: \`${currentType}\`.` });
100
+ if (!(formatStyleNegative === "abs" || formatStyleNegative === "brackets" || formatStyleNegative === "dash")) throw new TypeError(`Parameter \`negativeFormat.style\` property of the \`options\` (second parameter) must be of type \`string\` must be of type "abs" | "brackets" | "dash", but received: \`${getPreciseType(formatStyleNegative)}\`, with value: \`${safeStableStringify(formatStyleNegative, { keepUndefined: true })}\`.`);
101
+ switch (formatStyleNegative) {
102
+ case "dash":
103
+ formattedInteger = "-" + (formatSpaceNegative ? " " : "") + formattedInteger;
104
+ break;
105
+ case "brackets":
106
+ formattedInteger = formatSpaceNegative ? `( ${formattedInteger} )` : `(${formattedInteger})`;
107
+ break;
108
+ case "abs": break;
109
+ }
110
+ }
111
+ }
112
+ return formattedInteger;
113
+ };
114
+ const formatNumber = (value, separator = ",") => {
115
+ if (!isString(value) && !isFinite(value)) throw new TypeError(`First parameter (\`value\`) must be of type \`string\` or \`primitive number\`, but received: \`${getPreciseType(value)}\`.`);
116
+ if (!isString(separator)) throw new TypeError(`Second parameter (\`separator\`) must be of type \`string\` or empty as \`undefined\`, but received: \`${getPreciseType(separator)}\`.`);
117
+ separator = isString(separator) ? separator : ",";
118
+ const decimalSeparator = separator === "." ? "," : separator === "," ? "." : ".";
119
+ const stringValue = value.toString().trim();
120
+ const lastDot = stringValue.lastIndexOf(".");
121
+ const lastComma = stringValue.lastIndexOf(",");
122
+ let actualDecimal = "";
123
+ if (lastDot > lastComma) actualDecimal = ".";
124
+ else if (lastComma > lastDot) actualDecimal = ",";
125
+ let integerPart = stringValue;
126
+ let decimalPart = "";
127
+ if (actualDecimal) {
128
+ const parts = stringValue.split(actualDecimal);
129
+ integerPart = parts.slice(0, -1).join(actualDecimal);
130
+ decimalPart = parts.slice(-1)[0];
131
+ }
132
+ integerPart = integerPart.replace(/[^\d]/g, "");
133
+ const formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, separator);
134
+ return decimalPart ? `${formattedInteger}${decimalSeparator}${decimalPart}` : formattedInteger;
135
+ };
136
+ const parsingAsYouType = (value, defaultCountry) => {
137
+ let parsed;
138
+ try {
139
+ parsed = new AsYouType(defaultCountry);
140
+ parsed.input(value);
141
+ return parsed;
142
+ } catch {
143
+ parsed?.reset();
144
+ return;
145
+ }
146
+ };
147
+ const isValidParseAsYouType = (parsedAsYouType) => {
148
+ return !!parsedAsYouType?.isValid() && !!parsedAsYouType.getNumber();
149
+ };
150
+ function formatPhoneNumber(value, options = {}) {
151
+ if (isNil(value)) return "";
152
+ if (!isString(value) && !isNumber(value)) throw new TypeError(`First parameter (\`value\`) must be of type \`string\`, \`number\`, \`null\` or \`undefined\`, but received: \`${getPreciseType(value)}\`.`);
153
+ assertIsPlainObject(options, { message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
154
+ const takeNumberOnly = hasOwnProp(options, "takeNumberOnly") ? options.takeNumberOnly : false;
155
+ const checkValidOnly = hasOwnProp(options, "checkValidOnly") ? options.checkValidOnly : false;
156
+ const defaultCountry = hasOwnProp(options, "defaultCountry") ? options.defaultCountry : void 0;
157
+ const separator = hasOwnProp(options, "separator") ? options.separator : " ";
158
+ const prependPlusCountryCode = hasOwnProp(options, "prependPlusCountryCode") ? options.prependPlusCountryCode : true;
159
+ const outputFormat = hasOwnProp(options, "outputFormat") ? options.outputFormat : "INTERNATIONAL";
160
+ const openingNumberCountry = hasOwnProp(options, "openingNumberCountry") ? options.openingNumberCountry : "";
161
+ const closingNumberCountry = hasOwnProp(options, "closingNumberCountry") ? options.closingNumberCountry : "";
162
+ if (!isBoolean(takeNumberOnly) || !isBoolean(checkValidOnly) || !isBoolean(prependPlusCountryCode)) throw new TypeError(`Parameter \`takeNumberOnly\`, \`checkValidOnly\` and \`prependPlusCountryCode\` property of the \`options\` (second parameter) must be of type \`boolean\` or unset as \`undefined\` value, but received: ['takeNumberOnly': \`${getPreciseType(takeNumberOnly)}\`, 'checkValidOnly': \`${getPreciseType(checkValidOnly)}\`, 'prependPlusCountryCode': \`${getPreciseType(prependPlusCountryCode)}\`].`);
163
+ if (!isUndefined(defaultCountry) && !isSupportedCountry(defaultCountry)) throw new TypeError(`Parameter \`defaultCountry\` property of the \`options\` (second parameter) must be of type \`string\` as \`CountryCode\` (ISO-3166-1 alpha-2) or unset as \`undefined\` value, but received: \`${getPreciseType(defaultCountry)}\`, with value: \`${safeStableStringify(defaultCountry, { keepUndefined: true })}\`.\n\nSee: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements, for all ISO 3166-1 alpha-2 code.`);
164
+ if (![
165
+ "INTERNATIONAL",
166
+ "NATIONAL",
167
+ "RFC3966",
168
+ "E.164"
169
+ ].includes(outputFormat)) throw new TypeError(`Parameter \`outputFormat\` property of the \`options\` (second parameter) must be of type \`string\` as \`OutputFormat\` ("NATIONAL" | "INTERNATIONAL" | "E.164" | "RFC3966") or unset as \`undefined\` (default value to: \`INTERNATIONAL\`) value, but received: \`${getPreciseType(outputFormat)}\`, with value: ${safeStableStringify(outputFormat, { keepUndefined: true })}.`);
170
+ if (!isString(separator) || !isString(openingNumberCountry) || !isString(closingNumberCountry)) throw new TypeError(`Parameter \`separator\`, \`plusNumberCountry\`, \`openingNumberCountry\` and \`closingNumberCountry\` property of the \`options\` (second parameter) must be of type \`string\` or unset as \`undefined\` value, but received: ['separator': \`${getPreciseType(separator)}\`,'openingNumberCountry': \`${getPreciseType(openingNumberCountry)}\`, 'closingNumberCountry': \`${getPreciseType(closingNumberCountry)}\`].`);
171
+ if (!isString(value)) value = String(value);
172
+ const parsedPhoneNumber = parsingAsYouType(value, defaultCountry);
173
+ const validPhoneNumber = isValidParseAsYouType(parsedPhoneNumber);
174
+ if (checkValidOnly) return validPhoneNumber;
175
+ if (!validPhoneNumber) return "";
176
+ if (takeNumberOnly) return parsedPhoneNumber.getNumber().formatNational().replace(/\D/g, "");
177
+ const intlNumb = parsedPhoneNumber.getNumber().format(outputFormat);
178
+ if (outputFormat === "INTERNATIONAL") {
179
+ const [cc, ...rest] = intlNumb.split(" ");
180
+ const countryCode = prependPlusCountryCode ? cc : cc.replace(/^\++/, "");
181
+ const restWithSeparator = rest.join(separator);
182
+ if (isNonEmptyString(openingNumberCountry) && isNonEmptyString(closingNumberCountry)) return `${openingNumberCountry}${countryCode}${closingNumberCountry} ${restWithSeparator}`;
183
+ return `${countryCode} ${restWithSeparator}`;
184
+ }
185
+ if (outputFormat === "NATIONAL") return `${intlNumb.split(" ").join(separator)}`;
186
+ return intlNumb;
187
+ }
188
+ const hashSeedGenerate = (mode, email) => {
189
+ const generateSeed = () => {
190
+ let hash = 0;
191
+ for (let i = 0; i < email.length; i++) {
192
+ hash = (hash << 5) - hash + email.charCodeAt(i);
193
+ hash |= 0;
194
+ }
195
+ return Math.abs(hash);
196
+ };
197
+ return mode === "fixed" ? generateSeed() : void 0;
198
+ };
199
+ const _censor = (str, minCensor, maxPercentage, hashSeed) => {
200
+ if (str.length <= minCensor) return "*".repeat(str.length);
201
+ const strArr = str.split("");
202
+ const totalCensor = Math.max(minCensor, Math.ceil(str.length * maxPercentage));
203
+ const indexes = /* @__PURE__ */ new Set();
204
+ let i = 0;
205
+ while (indexes.size < totalCensor) {
206
+ const idx = !isUndefined(hashSeed) ? (hashSeed + str.length + i * 31) % str.length : Math.floor(Math.random() * str.length);
207
+ indexes.add(idx);
208
+ i++;
209
+ }
210
+ for (const index of indexes) strArr[index] = "*";
211
+ return strArr.join("");
212
+ };
213
+ const censorEmail = (email, options = {}) => {
214
+ if (!isNonEmptyString(email)) return "";
215
+ assertIsPlainObject(options, { message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
216
+ const mode = hasOwnProp(options, "mode") ? options.mode : "fixed";
217
+ if (mode !== "random" && mode !== "fixed") throw new TypeError(`Parameter \`mode\` property of the \`options\` (second parameter) must be one of "fixed" or "random", but received: \`${getPreciseType(mode)}\`, with value: \`${safeStableStringify(mode, { keepUndefined: true })}\`.`);
218
+ if (!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(email)) return "";
219
+ const [local, domain] = email.split("@");
220
+ const domainParts = domain.split(".");
221
+ if (domainParts.length < 2) return "";
222
+ const [domainName, ...tldParts] = domainParts;
223
+ const tld = tldParts.join(".");
224
+ const hashSeed = hashSeedGenerate(mode, email);
225
+ const localMinCensor = local.length < 4 ? 1 : 2;
226
+ const domainMinCensor = domainName.length < 4 ? 1 : 2;
227
+ return `${_censor(local, localMinCensor, .6, hashSeed)}@${_censor(domainName, domainMinCensor, .5, hashSeed)}.${tld.length <= 2 ? tld : _censor(tld, 1, .4, hashSeed)}`;
228
+ };
229
+ function chunkString(subject, limiter, options = {}) {
230
+ if (isNil(subject) || limiter <= 0) return subject;
231
+ assertIsString(subject, { message: ({ currentType, validType }) => `First parameter (\`subject\`) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
232
+ if (!isInteger(limiter)) throw new TypeError(`Second parameter (\`limiter\`) must be of type \`integer-number\`, but received: \`${getPreciseType(limiter)}\`, with value: \`${safeStableStringify(limiter, { keepUndefined: true })}\`.`);
233
+ assertIsPlainObject(options, { message: ({ currentType, validType }) => `Third parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
234
+ const separator = hasOwnProp(options, "separator") ? options.separator : " ";
235
+ const reCountAfterSpace = hasOwnProp(options, "reCountAfterSpace") ? options.reCountAfterSpace : false;
236
+ assertIsString(separator, { message: ({ currentType, validType }) => `Parameter \`separator\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
237
+ assertIsBoolean(reCountAfterSpace, { message: ({ currentType, validType }) => `Parameter \`reCountAfterSpace\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
238
+ subject = normalizeSpaces(subject);
239
+ if (!reCountAfterSpace) {
240
+ let result = "";
241
+ let currentCount = 0;
242
+ for (let i = 0; i < subject.length; i++) {
243
+ const char = subject[i];
244
+ if (currentCount === limiter) {
245
+ result += separator;
246
+ currentCount = 0;
247
+ }
248
+ result += char;
249
+ currentCount++;
250
+ }
251
+ return result;
252
+ }
253
+ const words = subject.split(" ");
254
+ const finalSegments = [];
255
+ let currentGroup = [];
256
+ let wordsInCurrentGroupCount = 0;
257
+ for (let i = 0; i < words.length; i++) {
258
+ const word = words[i];
259
+ let processedWord = "";
260
+ let charCountInWord = 0;
261
+ for (let j = 0; j < word.length; j++) {
262
+ processedWord += word[j];
263
+ charCountInWord++;
264
+ if (charCountInWord === limiter && j < word.length - 1) {
265
+ processedWord += separator;
266
+ charCountInWord = 0;
267
+ }
268
+ }
269
+ currentGroup.push(processedWord);
270
+ wordsInCurrentGroupCount++;
271
+ if (wordsInCurrentGroupCount === limiter || i === words.length - 1) {
272
+ finalSegments.push(currentGroup.join(separator));
273
+ currentGroup = [];
274
+ wordsInCurrentGroupCount = 0;
275
+ }
276
+ }
277
+ return finalSegments.join(" ");
278
+ }
279
+ const truncateString = (text, options = {}) => {
280
+ if (!isNonEmptyString(text)) return "";
281
+ assertIsPlainObject(options, { message: ({ currentType, validType }) => `Seconds parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
282
+ const trim = hasOwnProp(options, "trim") ? options.trim : true;
283
+ const length = hasOwnProp(options, "length") ? options.length : 10;
284
+ let ending = hasOwnProp(options, "ending") ? options.ending : "...";
285
+ if (!isInteger(length)) throw new TypeError(`Parameter \`length\` property of the \`options\` (second parameter) must be of type \`integer-number\`, but received: \`${getPreciseType(length)}\`, with value: \`${safeStableStringify(length, { keepUndefined: true })}\`.`);
286
+ if (length < 1) return "";
287
+ assertIsString(ending, { message: ({ currentType, validType }) => `Parameter \`ending\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
288
+ assertIsBoolean(trim, { message: ({ currentType, validType }) => `Parameter \`trim\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
289
+ if (isEmptyString(ending)) ending = "...";
290
+ else ending = ending.trim();
291
+ const original = trim ? text.trim() : text;
292
+ if (original.length <= length) return original;
293
+ const sliced = original.slice(0, length);
294
+ return (trim ? sliced : sliced.trimEnd()) + ending;
295
+ };
296
+ const formatDateFns = (date, options = {}) => {
297
+ if (isNil(date) || !(isDate(date) || isNonEmptyString(date))) return null;
298
+ if (!isPlainObject(options)) options = {};
299
+ const { inputFormat, locale = "en", inputLocale = "en", ...restOptions } = options;
300
+ const format$1 = hasOwnProp(options, "format") && isNonEmptyString(options.format) ? options.format : "dd MMM yyyy - HH:mm:ss";
301
+ let parsedDate;
302
+ try {
303
+ if (isNonEmptyString(date) && inputFormat && inputLocale) {
304
+ const valueOfInputLocale = isNonEmptyString(inputLocale) ? inputLocale === "id" ? id : enUS : inputLocale;
305
+ parsedDate = parse(date, inputFormat, /* @__PURE__ */ new Date(), { locale: valueOfInputLocale });
306
+ } else parsedDate = new Date(date);
307
+ if (isNaN(parsedDate.getTime())) return null;
308
+ const valueOfLocale = isNonEmptyString(locale) ? locale === "id" ? id : enUS : locale;
309
+ return format(parsedDate, format$1, {
310
+ ...restOptions,
311
+ locale: valueOfLocale
312
+ });
313
+ } catch {
314
+ return null;
315
+ }
316
+ };
317
+ const formatDateIntl = (date, options) => {
318
+ if (isNil(date) || !(isDate(date) || isNonEmptyString(date))) return null;
319
+ const parsedDate = new Date(date);
320
+ if (isNaN(parsedDate.getTime())) return null;
321
+ if (!isPlainObject(options)) options = {};
322
+ const { locale = "en-US", ...restProps } = options;
323
+ try {
324
+ return new Intl.DateTimeFormat(isNonEmptyString(locale) ? locale.trim() : "en-US", restProps).format(parsedDate);
325
+ } catch {
326
+ return null;
327
+ }
328
+ };
329
+ const formatDateTime = (date, format) => {
330
+ if (isNil(format)) format = "YYYY-MM-DD hh:mm:ss";
331
+ if (!isString(format)) return null;
332
+ if (isNil(date) || !(isDate(date) || isNonEmptyString(date))) return null;
333
+ try {
334
+ const parsedDate = new Date(date);
335
+ if (isNaN(parsedDate.getTime())) return null;
336
+ const pad2 = (n) => n.toString().padStart(2, "0");
337
+ const map = {
338
+ YYYY: parsedDate.getFullYear().toString(),
339
+ MM: pad2(parsedDate.getMonth() + 1),
340
+ DD: pad2(parsedDate.getDate()),
341
+ hh: pad2(parsedDate.getHours()),
342
+ mm: pad2(parsedDate.getMinutes()),
343
+ ss: pad2(parsedDate.getSeconds())
344
+ };
345
+ const result = Object.entries(map).reduce((prev, [key, value]) => prev.split(key).join(value), format);
346
+ return !result.includes("NaN") ? result : null;
347
+ } catch {
348
+ return null;
349
+ }
350
+ };
351
+ const getGMTOffset = (date) => {
352
+ try {
353
+ if (isNil(date) || isString(date) && isEmptyString(date)) date = /* @__PURE__ */ new Date();
354
+ else if (!(isDate(date) || isNonEmptyString(date))) return "0";
355
+ const parsedDate = new Date(date);
356
+ if (isNaN(parsedDate.getTime())) return "0";
357
+ const padZero = (num) => num.toString().padStart(2, "0");
358
+ let offset = parsedDate.getTimezoneOffset();
359
+ const sign = offset < 0 ? "+" : "-";
360
+ offset = Math.abs(offset);
361
+ return `${sign}${padZero(Math.floor(offset / 60))}${padZero(offset % 60)}`;
362
+ } catch {
363
+ return "0";
364
+ }
365
+ };
366
+ export { truncateString as a, formatPhoneNumber as c, formatDateFns as i, formatNumber as l, formatDateTime as n, chunkString as o, formatDateIntl as r, censorEmail as s, getGMTOffset as t, formatCurrency as u };
367
+ //# sourceMappingURL=formatters-QcZO_Cpx.js.map