@rpcbase/ui 0.202.0 → 0.203.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 (641) hide show
  1. package/dist/index.js +25 -73
  2. package/dist/index10.js +18 -28
  3. package/dist/index10.js.map +1 -1
  4. package/dist/index100.js +8 -8
  5. package/dist/index100.js.map +1 -1
  6. package/dist/index101.js +8 -7
  7. package/dist/index101.js.map +1 -1
  8. package/dist/index102.js +14 -7
  9. package/dist/index102.js.map +1 -1
  10. package/dist/index103.js +9 -9
  11. package/dist/index103.js.map +1 -1
  12. package/dist/index104.js +14 -148
  13. package/dist/index104.js.map +1 -1
  14. package/dist/index105.js +21 -43
  15. package/dist/index105.js.map +1 -1
  16. package/dist/index106.js +27 -7
  17. package/dist/index106.js.map +1 -1
  18. package/dist/index107.js +8 -10
  19. package/dist/index107.js.map +1 -1
  20. package/dist/index108.js +8 -16
  21. package/dist/index108.js.map +1 -1
  22. package/dist/index109.js +9 -16
  23. package/dist/index109.js.map +1 -1
  24. package/dist/index11.js +1674 -41
  25. package/dist/index11.js.map +1 -1
  26. package/dist/index110.js +9 -10
  27. package/dist/index110.js.map +1 -1
  28. package/dist/index111.js +8 -34
  29. package/dist/index111.js.map +1 -1
  30. package/dist/index112.js +8 -13
  31. package/dist/index112.js.map +1 -1
  32. package/dist/index113.js +11 -13
  33. package/dist/index113.js.map +1 -1
  34. package/dist/index114.js +10 -11
  35. package/dist/index114.js.map +1 -1
  36. package/dist/index115.js +37 -16
  37. package/dist/index115.js.map +1 -1
  38. package/dist/index116.js +10 -104
  39. package/dist/index116.js.map +1 -1
  40. package/dist/index117.js +9 -23
  41. package/dist/index117.js.map +1 -1
  42. package/dist/index118.js +10 -56
  43. package/dist/index118.js.map +1 -1
  44. package/dist/index119.js +12 -75
  45. package/dist/index119.js.map +1 -1
  46. package/dist/index12.js +10 -470
  47. package/dist/index12.js.map +1 -1
  48. package/dist/index120.js +8 -12
  49. package/dist/index120.js.map +1 -1
  50. package/dist/index121.js +9 -23
  51. package/dist/index121.js.map +1 -1
  52. package/dist/index122.js +8 -19
  53. package/dist/index122.js.map +1 -1
  54. package/dist/index123.js +8 -26
  55. package/dist/index123.js.map +1 -1
  56. package/dist/index124.js +9 -9
  57. package/dist/index124.js.map +1 -1
  58. package/dist/index125.js +8 -8
  59. package/dist/index125.js.map +1 -1
  60. package/dist/index126.js +9 -27
  61. package/dist/index126.js.map +1 -1
  62. package/dist/index127.js +11 -38
  63. package/dist/index127.js.map +1 -1
  64. package/dist/index128.js +60 -19
  65. package/dist/index128.js.map +1 -1
  66. package/dist/index129.js +9 -9
  67. package/dist/index129.js.map +1 -1
  68. package/dist/index13.js +22 -140
  69. package/dist/index13.js.map +1 -1
  70. package/dist/index130.js +23 -8
  71. package/dist/index130.js.map +1 -1
  72. package/dist/index131.js +22 -7
  73. package/dist/index131.js.map +1 -1
  74. package/dist/index132.js +37 -7
  75. package/dist/index132.js.map +1 -1
  76. package/dist/index133.js +8 -7
  77. package/dist/index133.js.map +1 -1
  78. package/dist/index134.js +11 -6
  79. package/dist/index134.js.map +1 -1
  80. package/dist/index135.js +17 -9
  81. package/dist/index135.js.map +1 -1
  82. package/dist/index136.js +14 -27
  83. package/dist/index136.js.map +1 -1
  84. package/dist/index137.js +9 -10
  85. package/dist/index137.js.map +1 -1
  86. package/dist/index138.js +8 -9
  87. package/dist/index138.js.map +1 -1
  88. package/dist/index139.js +8 -8
  89. package/dist/index139.js.map +1 -1
  90. package/dist/index14.js +194 -78
  91. package/dist/index14.js.map +1 -1
  92. package/dist/index140.js +8 -6
  93. package/dist/index140.js.map +1 -1
  94. package/dist/index141.js +8 -6
  95. package/dist/index141.js.map +1 -1
  96. package/dist/index142.js +7 -7
  97. package/dist/index142.js.map +1 -1
  98. package/dist/index143.js +9 -6
  99. package/dist/index143.js.map +1 -1
  100. package/dist/index144.js +24 -8
  101. package/dist/index144.js.map +1 -1
  102. package/dist/index145.js +11 -6
  103. package/dist/index145.js.map +1 -1
  104. package/dist/index146.js +10 -6
  105. package/dist/index146.js.map +1 -1
  106. package/dist/index147.js +9 -6
  107. package/dist/index147.js.map +1 -1
  108. package/dist/index148.js +9 -8
  109. package/dist/index148.js.map +1 -1
  110. package/dist/index149.js +7 -10
  111. package/dist/index149.js.map +1 -1
  112. package/dist/index15.js +33 -874
  113. package/dist/index15.js.map +1 -1
  114. package/dist/index150.js +7 -8
  115. package/dist/index150.js.map +1 -1
  116. package/dist/index151.js +9 -50
  117. package/dist/index151.js.map +1 -1
  118. package/dist/index152.js +8 -50
  119. package/dist/index152.js.map +1 -1
  120. package/dist/index153.js +9 -209
  121. package/dist/index153.js.map +1 -1
  122. package/dist/index154.js +8 -25
  123. package/dist/index154.js.map +1 -1
  124. package/dist/index155.js +7 -27
  125. package/dist/index155.js.map +1 -1
  126. package/dist/index156.js +8 -403
  127. package/dist/index156.js.map +1 -1
  128. package/dist/index157.js +32 -609
  129. package/dist/index157.js.map +1 -1
  130. package/dist/index158.js +35 -19
  131. package/dist/index158.js.map +1 -1
  132. package/dist/index159.js +18 -8
  133. package/dist/index159.js.map +1 -1
  134. package/dist/index16.js +57 -23
  135. package/dist/index16.js.map +1 -1
  136. package/dist/index160.js +14 -8
  137. package/dist/index160.js.map +1 -1
  138. package/dist/index161.js +12 -61
  139. package/dist/index161.js.map +1 -1
  140. package/dist/index162.js +19 -69
  141. package/dist/index162.js.map +1 -1
  142. package/dist/index163.js +89 -9
  143. package/dist/index163.js.map +1 -1
  144. package/dist/index164.js +50 -7
  145. package/dist/index164.js.map +1 -1
  146. package/dist/index165.js +20 -10
  147. package/dist/index165.js.map +1 -1
  148. package/dist/index166.js +11 -20
  149. package/dist/index166.js.map +1 -1
  150. package/dist/index167.js +13 -8
  151. package/dist/index167.js.map +1 -1
  152. package/dist/index168.js +8 -8
  153. package/dist/index168.js.map +1 -1
  154. package/dist/index169.js +25 -16
  155. package/dist/index169.js.map +1 -1
  156. package/dist/index17.js +9 -20
  157. package/dist/index17.js.map +1 -1
  158. package/dist/index170.js +10 -13
  159. package/dist/index170.js.map +1 -1
  160. package/dist/index171.js +9 -17
  161. package/dist/index171.js.map +1 -1
  162. package/dist/index172.js +9 -17
  163. package/dist/index172.js.map +1 -1
  164. package/dist/index173.js +7 -8
  165. package/dist/index173.js.map +1 -1
  166. package/dist/index174.js +9 -9
  167. package/dist/index174.js.map +1 -1
  168. package/dist/index175.js +70 -10
  169. package/dist/index175.js.map +1 -1
  170. package/dist/index176.js +20 -9
  171. package/dist/index176.js.map +1 -1
  172. package/dist/index177.js +15 -12
  173. package/dist/index177.js.map +1 -1
  174. package/dist/index178.js +12 -8
  175. package/dist/index178.js.map +1 -1
  176. package/dist/index179.js +23 -8
  177. package/dist/index179.js.map +1 -1
  178. package/dist/index18.js +27 -460
  179. package/dist/index18.js.map +1 -1
  180. package/dist/index180.js +20 -12
  181. package/dist/index180.js.map +1 -1
  182. package/dist/index181.js +58 -8
  183. package/dist/index181.js.map +1 -1
  184. package/dist/index182.js +13 -8
  185. package/dist/index182.js.map +1 -1
  186. package/dist/index183.js +9 -7
  187. package/dist/index183.js.map +1 -1
  188. package/dist/index184.js +29 -14
  189. package/dist/index184.js.map +1 -1
  190. package/dist/index185.js +29 -13
  191. package/dist/index185.js.map +1 -1
  192. package/dist/index186.js +16 -13
  193. package/dist/index186.js.map +1 -1
  194. package/dist/index187.js +16 -14
  195. package/dist/index187.js.map +1 -1
  196. package/dist/index188.js +9 -14
  197. package/dist/index188.js.map +1 -1
  198. package/dist/index189.js +26 -13
  199. package/dist/index189.js.map +1 -1
  200. package/dist/index19.js +65 -666
  201. package/dist/index19.js.map +1 -1
  202. package/dist/index190.js +388 -10
  203. package/dist/index190.js.map +1 -1
  204. package/dist/index191.js +499 -10
  205. package/dist/index191.js.map +1 -1
  206. package/dist/index192.js +134 -9
  207. package/dist/index192.js.map +1 -1
  208. package/dist/index193.js +55 -9
  209. package/dist/index193.js.map +1 -1
  210. package/dist/index194.js +80 -10
  211. package/dist/index194.js.map +1 -1
  212. package/dist/index195.js +902 -9
  213. package/dist/index195.js.map +1 -1
  214. package/dist/index196.js +22 -58
  215. package/dist/index196.js.map +1 -1
  216. package/dist/index197.js +452 -12
  217. package/dist/index197.js.map +1 -1
  218. package/dist/index198.js +7 -22
  219. package/dist/index198.js.map +1 -1
  220. package/dist/index199.js +60 -32
  221. package/dist/index199.js.map +1 -1
  222. package/dist/index2.js +10 -8
  223. package/dist/index20.js +43 -469
  224. package/dist/index20.js.map +1 -1
  225. package/dist/index200.js +63 -15
  226. package/dist/index200.js.map +1 -1
  227. package/dist/index201.js +11 -28
  228. package/dist/index201.js.map +1 -1
  229. package/dist/index202.js +19 -8
  230. package/dist/index202.js.map +1 -1
  231. package/dist/index203.js +148 -20
  232. package/dist/index203.js.map +1 -1
  233. package/dist/index204.js +7 -11
  234. package/dist/index204.js.map +1 -1
  235. package/dist/index205.js +13 -13
  236. package/dist/index205.js.map +1 -1
  237. package/dist/index206.js +107 -13
  238. package/dist/index206.js.map +1 -1
  239. package/dist/index207.js +359 -23
  240. package/dist/index207.js.map +1 -1
  241. package/dist/index208.js +99 -14
  242. package/dist/index208.js.map +1 -1
  243. package/dist/index209.js +329 -12
  244. package/dist/index209.js.map +1 -1
  245. package/dist/index21.js +12 -266
  246. package/dist/index21.js.map +1 -1
  247. package/dist/index210.js +213 -12
  248. package/dist/index210.js.map +1 -1
  249. package/dist/index211.js +22 -8
  250. package/dist/index211.js.map +1 -1
  251. package/dist/index212.js +30 -8
  252. package/dist/index212.js.map +1 -1
  253. package/dist/index213.js +189 -18
  254. package/dist/index213.js.map +1 -1
  255. package/dist/index214.js +21 -13
  256. package/dist/index214.js.map +1 -1
  257. package/dist/index215.js +46 -21
  258. package/dist/index215.js.map +1 -1
  259. package/dist/index216.js +12 -18
  260. package/dist/index216.js.map +1 -1
  261. package/dist/index217.js +28 -16
  262. package/dist/index217.js.map +1 -1
  263. package/dist/index218.js +47 -8
  264. package/dist/index218.js.map +1 -1
  265. package/dist/index219.js +19 -70
  266. package/dist/index219.js.map +1 -1
  267. package/dist/index22.js +16 -8
  268. package/dist/index22.js.map +1 -1
  269. package/dist/index220.js +6 -5
  270. package/dist/index220.js.map +1 -1
  271. package/dist/index221.js +8 -367
  272. package/dist/index221.js.map +1 -1
  273. package/dist/index222.js +24 -265
  274. package/dist/index222.js.map +1 -1
  275. package/dist/index223.js +27 -63
  276. package/dist/index223.js.map +1 -1
  277. package/dist/index224.js +68 -47
  278. package/dist/index224.js.map +1 -1
  279. package/dist/index225.js +17 -172
  280. package/dist/index225.js.map +1 -1
  281. package/dist/index226.js +7 -113
  282. package/dist/index226.js.map +1 -1
  283. package/dist/index227.js +53 -27
  284. package/dist/index227.js.map +1 -1
  285. package/dist/index228.js +8 -10
  286. package/dist/index228.js.map +1 -1
  287. package/dist/index229.js +28 -6
  288. package/dist/index229.js.map +1 -1
  289. package/dist/index23.js +109 -30
  290. package/dist/index23.js.map +1 -1
  291. package/dist/index230.js +16 -8
  292. package/dist/index230.js.map +1 -1
  293. package/dist/index231.js +12 -7
  294. package/dist/index231.js.map +1 -1
  295. package/dist/index232.js +3 -470
  296. package/dist/index233.js +28 -188
  297. package/dist/index233.js.map +1 -1
  298. package/dist/index234.js +68 -107
  299. package/dist/index234.js.map +1 -1
  300. package/dist/index235.js +3 -266
  301. package/dist/index236.js +14 -12
  302. package/dist/index236.js.map +1 -1
  303. package/dist/index237.js +53 -45
  304. package/dist/index237.js.map +1 -1
  305. package/dist/index238.js +117 -7
  306. package/dist/index238.js.map +1 -1
  307. package/dist/index239.js +9 -28
  308. package/dist/index239.js.map +1 -1
  309. package/dist/index24.js +3 -269
  310. package/dist/index24.js.map +1 -1
  311. package/dist/index240.js +15 -31
  312. package/dist/index240.js.map +1 -1
  313. package/dist/index241.js +689 -7
  314. package/dist/index241.js.map +1 -1
  315. package/dist/index242.js +256 -71
  316. package/dist/index242.js.map +1 -1
  317. package/dist/index243.js +704 -184
  318. package/dist/index243.js.map +1 -1
  319. package/dist/index244.js +7433 -49
  320. package/dist/index244.js.map +1 -1
  321. package/dist/index245.js +9 -7
  322. package/dist/index245.js.map +1 -1
  323. package/dist/index246.js +16 -22
  324. package/dist/index246.js.map +1 -1
  325. package/dist/index247.js +8 -15
  326. package/dist/index247.js.map +1 -1
  327. package/dist/index248.js +462 -16
  328. package/dist/index248.js.map +1 -1
  329. package/dist/index249.js +41 -158
  330. package/dist/index249.js.map +1 -1
  331. package/dist/index25.js +11 -179
  332. package/dist/index25.js.map +1 -1
  333. package/dist/index250.js +21 -32
  334. package/dist/index250.js.map +1 -1
  335. package/dist/index251.js +30 -12
  336. package/dist/index251.js.map +1 -1
  337. package/dist/index252.js +8 -52
  338. package/dist/index252.js.map +1 -1
  339. package/dist/index253.js +62 -15
  340. package/dist/index253.js.map +1 -1
  341. package/dist/index254.js +10 -47
  342. package/dist/index254.js.map +1 -1
  343. package/dist/index255.js +14 -97
  344. package/dist/index255.js.map +1 -1
  345. package/dist/index256.js +6 -90
  346. package/dist/index256.js.map +1 -1
  347. package/dist/index257.js +20 -109
  348. package/dist/index257.js.map +1 -1
  349. package/dist/index258.js +28 -55
  350. package/dist/index258.js.map +1 -1
  351. package/dist/index259.js +47 -15
  352. package/dist/index259.js.map +1 -1
  353. package/dist/index26.js +22 -16
  354. package/dist/index26.js.map +1 -1
  355. package/dist/index260.js +16 -40
  356. package/dist/index260.js.map +1 -1
  357. package/dist/index261.js +28 -11
  358. package/dist/index261.js.map +1 -1
  359. package/dist/index262.js +20 -119
  360. package/dist/index262.js.map +1 -1
  361. package/dist/index263.js +38 -20
  362. package/dist/index263.js.map +1 -1
  363. package/dist/index264.js +8 -18
  364. package/dist/index264.js.map +1 -1
  365. package/dist/index265.js +12 -6
  366. package/dist/index265.js.map +1 -1
  367. package/dist/index266.js +11 -39
  368. package/dist/index266.js.map +1 -1
  369. package/dist/index267.js +12 -23
  370. package/dist/index267.js.map +1 -1
  371. package/dist/index268.js +13 -12
  372. package/dist/index268.js.map +1 -1
  373. package/dist/index269.js +10 -11
  374. package/dist/index269.js.map +1 -1
  375. package/dist/index27.js +61 -2924
  376. package/dist/index27.js.map +1 -1
  377. package/dist/index270.js +76 -22
  378. package/dist/index270.js.map +1 -1
  379. package/dist/index271.js +174 -31
  380. package/dist/index271.js.map +1 -1
  381. package/dist/index272.js +118 -20
  382. package/dist/index272.js.map +1 -1
  383. package/dist/index273.js +18 -8
  384. package/dist/index273.js.map +1 -1
  385. package/dist/index274.js +83 -5
  386. package/dist/index274.js.map +1 -1
  387. package/dist/index275.js +49 -26
  388. package/dist/index275.js.map +1 -1
  389. package/dist/index276.js +15 -114
  390. package/dist/index276.js.map +1 -1
  391. package/dist/index277.js +19 -18
  392. package/dist/index277.js.map +1 -1
  393. package/dist/index278.js +98 -523
  394. package/dist/index278.js.map +1 -1
  395. package/dist/index279.js +60 -131
  396. package/dist/index279.js.map +1 -1
  397. package/dist/index28.js +58 -5
  398. package/dist/index28.js.map +1 -1
  399. package/dist/index280.js +109 -134
  400. package/dist/index280.js.map +1 -1
  401. package/dist/index281.js +75 -9
  402. package/dist/index281.js.map +1 -1
  403. package/dist/index282.js +117 -9
  404. package/dist/index282.js.map +1 -1
  405. package/dist/index283.js +59 -7
  406. package/dist/index283.js.map +1 -1
  407. package/dist/index284.js +46 -18
  408. package/dist/index284.js.map +1 -1
  409. package/dist/index285.js +146 -12
  410. package/dist/index285.js.map +1 -1
  411. package/dist/index286.js +143 -9
  412. package/dist/index286.js.map +1 -1
  413. package/dist/index287.js +258 -8
  414. package/dist/index287.js.map +1 -1
  415. package/dist/index288.js +241 -546
  416. package/dist/index288.js.map +1 -1
  417. package/dist/index289.js +302 -50
  418. package/dist/index289.js.map +1 -1
  419. package/dist/index29.js +1 -40
  420. package/dist/index290.js +9 -21
  421. package/dist/index290.js.map +1 -1
  422. package/dist/index291.js +9 -9
  423. package/dist/index291.js.map +1 -1
  424. package/dist/index292.js +10 -11
  425. package/dist/index292.js.map +1 -1
  426. package/dist/index293.js +9 -10
  427. package/dist/index293.js.map +1 -1
  428. package/dist/index294.js +9 -11
  429. package/dist/index294.js.map +1 -1
  430. package/dist/index295.js +24 -15
  431. package/dist/index295.js.map +1 -1
  432. package/dist/index296.js +13 -12
  433. package/dist/index296.js.map +1 -1
  434. package/dist/index297.js +130 -17
  435. package/dist/index297.js.map +1 -1
  436. package/dist/index298.js +167 -23
  437. package/dist/index298.js.map +1 -1
  438. package/dist/index299.js +69 -65
  439. package/dist/index299.js.map +1 -1
  440. package/dist/index3.js +6 -5
  441. package/dist/index3.js.map +1 -1
  442. package/dist/index30.js +6 -6
  443. package/dist/index300.js +113 -72
  444. package/dist/index300.js.map +1 -1
  445. package/dist/index301.js +495 -12
  446. package/dist/index301.js.map +1 -1
  447. package/dist/index302.js +65 -16
  448. package/dist/index302.js.map +1 -1
  449. package/dist/index303.js +7 -69
  450. package/dist/index303.js.map +1 -1
  451. package/dist/index304.js +30 -7
  452. package/dist/index304.js.map +1 -1
  453. package/dist/index305.js +68 -58
  454. package/dist/index305.js.map +1 -1
  455. package/dist/index306.js +155 -70
  456. package/dist/index306.js.map +1 -1
  457. package/dist/index307.js +563 -32
  458. package/dist/index307.js.map +1 -1
  459. package/dist/index308.js +213 -11
  460. package/dist/index308.js.map +1 -1
  461. package/dist/index309.js +335 -156
  462. package/dist/index309.js.map +1 -1
  463. package/dist/index31.js +8 -128
  464. package/dist/index31.js.map +1 -1
  465. package/dist/index310.js +271 -110
  466. package/dist/index310.js.map +1 -1
  467. package/dist/index32.js +8 -234
  468. package/dist/index32.js.map +1 -1
  469. package/dist/index33.js +8 -26
  470. package/dist/index33.js.map +1 -1
  471. package/dist/index34.js +11 -54
  472. package/dist/index34.js.map +1 -1
  473. package/dist/index35.js +13 -24
  474. package/dist/index35.js.map +1 -1
  475. package/dist/index36.js +9 -133
  476. package/dist/index36.js.map +1 -1
  477. package/dist/index37.js +11 -225
  478. package/dist/index37.js.map +1 -1
  479. package/dist/index38.js +12 -94
  480. package/dist/index38.js.map +1 -1
  481. package/dist/index39.js +15 -121
  482. package/dist/index39.js.map +1 -1
  483. package/dist/index4.js +24 -28
  484. package/dist/index4.js.map +1 -1
  485. package/dist/index40.js +9 -8
  486. package/dist/index40.js.map +1 -1
  487. package/dist/index41.js +10 -847
  488. package/dist/index41.js.map +1 -1
  489. package/dist/index42.js +10 -60
  490. package/dist/index42.js.map +1 -1
  491. package/dist/index43.js +12 -10
  492. package/dist/index43.js.map +1 -1
  493. package/dist/index44.js +12 -5
  494. package/dist/index44.js.map +1 -1
  495. package/dist/index45.js +8 -14
  496. package/dist/index45.js.map +1 -1
  497. package/dist/index46.js +8 -21
  498. package/dist/index46.js.map +1 -1
  499. package/dist/index47.js +14 -10
  500. package/dist/index47.js.map +1 -1
  501. package/dist/index48.js +15 -5
  502. package/dist/index48.js.map +1 -1
  503. package/dist/index49.js +10 -26
  504. package/dist/index49.js.map +1 -1
  505. package/dist/index5.js +34 -48
  506. package/dist/index5.js.map +1 -1
  507. package/dist/index50.js +7 -236
  508. package/dist/index50.js.map +1 -1
  509. package/dist/index51.js +9 -9
  510. package/dist/index51.js.map +1 -1
  511. package/dist/index52.js +9 -36
  512. package/dist/index52.js.map +1 -1
  513. package/dist/index53.js +9 -29
  514. package/dist/index53.js.map +1 -1
  515. package/dist/index54.js +12 -10
  516. package/dist/index54.js.map +1 -1
  517. package/dist/index55.js +16 -14
  518. package/dist/index55.js.map +1 -1
  519. package/dist/index56.js +10 -5
  520. package/dist/index56.js.map +1 -1
  521. package/dist/index57.js +10 -5
  522. package/dist/index57.js.map +1 -1
  523. package/dist/index58.js +10 -5
  524. package/dist/index58.js.map +1 -1
  525. package/dist/index59.js +17 -5
  526. package/dist/index59.js.map +1 -1
  527. package/dist/index6.js +42 -227
  528. package/dist/index6.js.map +1 -1
  529. package/dist/index60.js +11 -208
  530. package/dist/index60.js.map +1 -1
  531. package/dist/index61.js +11 -6
  532. package/dist/index61.js.map +1 -1
  533. package/dist/index62.js +70 -50
  534. package/dist/index62.js.map +1 -1
  535. package/dist/index63.js +10 -53
  536. package/dist/index63.js.map +1 -1
  537. package/dist/index64.js +33 -10
  538. package/dist/index64.js.map +1 -1
  539. package/dist/index65.js +13 -18
  540. package/dist/index65.js.map +1 -1
  541. package/dist/index66.js +19 -137
  542. package/dist/index66.js.map +1 -1
  543. package/dist/index67.js +203 -13
  544. package/dist/index67.js.map +1 -1
  545. package/dist/index68.js +22 -218
  546. package/dist/index68.js.map +1 -1
  547. package/dist/index69.js +20 -16
  548. package/dist/index69.js.map +1 -1
  549. package/dist/index7.js +225 -37
  550. package/dist/index7.js.map +1 -1
  551. package/dist/index70.js +125 -49
  552. package/dist/index70.js.map +1 -1
  553. package/dist/index71.js +21 -52
  554. package/dist/index71.js.map +1 -1
  555. package/dist/index72.js +12 -7
  556. package/dist/index72.js.map +1 -1
  557. package/dist/index73.js +12 -8
  558. package/dist/index73.js.map +1 -1
  559. package/dist/index74.js +17 -31
  560. package/dist/index74.js.map +1 -1
  561. package/dist/index75.js +13 -53
  562. package/dist/index75.js.map +1 -1
  563. package/dist/index76.js +13 -12
  564. package/dist/index76.js.map +1 -1
  565. package/dist/index77.js +8 -55
  566. package/dist/index77.js.map +1 -1
  567. package/dist/index78.js +44 -7
  568. package/dist/index78.js.map +1 -1
  569. package/dist/index79.js +383 -7
  570. package/dist/index79.js.map +1 -1
  571. package/dist/index8.js +36 -32
  572. package/dist/index8.js.map +1 -1
  573. package/dist/index80.js +41 -18
  574. package/dist/index80.js.map +1 -1
  575. package/dist/index81.js +25 -9
  576. package/dist/index81.js.map +1 -1
  577. package/dist/index82.js +60 -10
  578. package/dist/index82.js.map +1 -1
  579. package/dist/index83.js +10 -19
  580. package/dist/index83.js.map +1 -1
  581. package/dist/index84.js +8 -7
  582. package/dist/index84.js.map +1 -1
  583. package/dist/index85.js +8 -7
  584. package/dist/index85.js.map +1 -1
  585. package/dist/index86.js +8 -8
  586. package/dist/index86.js.map +1 -1
  587. package/dist/index87.js +8 -8
  588. package/dist/index87.js.map +1 -1
  589. package/dist/index88.js +9 -7
  590. package/dist/index88.js.map +1 -1
  591. package/dist/index89.js +9 -7
  592. package/dist/index89.js.map +1 -1
  593. package/dist/index9.js +33 -181
  594. package/dist/index9.js.map +1 -1
  595. package/dist/index90.js +13 -9
  596. package/dist/index90.js.map +1 -1
  597. package/dist/index91.js +10 -27
  598. package/dist/index91.js.map +1 -1
  599. package/dist/index92.js +9 -9
  600. package/dist/index92.js.map +1 -1
  601. package/dist/index93.js +8 -7
  602. package/dist/index93.js.map +1 -1
  603. package/dist/index94.js +10 -9
  604. package/dist/index94.js.map +1 -1
  605. package/dist/index95.js +50 -8
  606. package/dist/index95.js.map +1 -1
  607. package/dist/index96.js +108 -7
  608. package/dist/index96.js.map +1 -1
  609. package/dist/index97.js +13 -8
  610. package/dist/index97.js.map +1 -1
  611. package/dist/index98.js +9 -7
  612. package/dist/index98.js.map +1 -1
  613. package/dist/index99.js +9 -11
  614. package/dist/index99.js.map +1 -1
  615. package/package.json +6 -6
  616. package/dist/index.js.map +0 -1
  617. package/dist/index2.js.map +0 -1
  618. package/dist/index232.js.map +0 -1
  619. package/dist/index235.js.map +0 -1
  620. package/dist/index29.js.map +0 -1
  621. package/dist/index30.js.map +0 -1
  622. package/dist/index311.js +0 -7
  623. package/dist/index311.js.map +0 -1
  624. package/dist/index312.js +0 -26
  625. package/dist/index312.js.map +0 -1
  626. package/dist/index313.js +0 -19
  627. package/dist/index313.js.map +0 -1
  628. package/dist/index314.js +0 -32
  629. package/dist/index314.js.map +0 -1
  630. package/dist/index315.js +0 -16
  631. package/dist/index315.js.map +0 -1
  632. package/dist/index316.js +0 -10
  633. package/dist/index316.js.map +0 -1
  634. package/dist/index317.js +0 -26
  635. package/dist/index317.js.map +0 -1
  636. package/dist/index318.js +0 -16
  637. package/dist/index318.js.map +0 -1
  638. package/dist/index319.js +0 -31
  639. package/dist/index319.js.map +0 -1
  640. package/dist/index320.js +0 -8
  641. package/dist/index320.js.map +0 -1
package/dist/index298.js CHANGED
@@ -1,24 +1,168 @@
1
- import { VALID_DIGITS as n } from "./index228.js";
2
- var v = "+", I = "[\\-\\.\\(\\)]?", R = "([" + n + "]|" + I + ")", i = "^\\" + v + R + "*[" + n + "]" + R + "*$", N = new RegExp(i, "g"), r = n, C = "[" + r + "]+((\\-)*[" + r + "])*", L = "a-zA-Z", f = "[" + L + "]+((\\-)*[" + r + "])*", E = "^(" + C + "\\.)*" + f + "\\.?$", O = new RegExp(E, "g"), l = "tel:", a = ";phone-context=", u = ";isub=";
3
- function D(_) {
4
- var t = _.indexOf(a);
5
- if (t < 0)
6
- return null;
7
- var e = t + a.length;
8
- if (e >= _.length)
9
- return "";
10
- var A = _.indexOf(";", e);
11
- return A >= 0 ? _.substring(e, A) : _.substring(e);
12
- }
13
- function S(_) {
14
- return _ === null ? !0 : _.length === 0 ? !1 : N.test(_) || O.test(_);
15
- }
16
- export {
17
- v as PLUS_SIGN,
18
- u as RFC3966_ISDN_SUBADDRESS_,
19
- a as RFC3966_PHONE_CONTEXT_,
20
- l as RFC3966_PREFIX_,
21
- D as default,
22
- S as isPhoneContextValid
1
+ import { validatePhoneNumberLength as e } from "./index291.js";
2
+ import { AsYouType as t } from "./index292.js";
3
+ import { getCountryCallingCode as n } from "./index294.js";
4
+ import { COMMON_IDD_PREFIXES as r, COUNTRY_DIAL_CODES as i, MAX_DIAL_CODE_LENGTH as a } from "./index297.js";
5
+ //#region src/components/PhoneNumberInput/normalization.ts
6
+ function o(e) {
7
+ return e.replace(/\D/g, "");
8
+ }
9
+ function s(e) {
10
+ return e ? e.length > a ? !1 : i.some((t) => t.startsWith(e)) : !0;
11
+ }
12
+ var c = /[\u061C\u200B-\u200F\u202A-\u202E\u2066-\u2069\uFEFF]/g;
13
+ function l(e) {
14
+ return e.replace(c, "");
15
+ }
16
+ function u(e, t, n = {}) {
17
+ let { force: r = !1 } = n, i = `+${t}`;
18
+ if (!e.startsWith(i) || !r) return e;
19
+ let a = e.slice(i.length).trimStart();
20
+ if (a.startsWith("0")) return e;
21
+ if (!a) return `${i} 0`;
22
+ let [o, ...s] = a.split(" ");
23
+ return `${i} ${`0${o ?? ""}`}${s.length > 0 ? ` ${s.join(" ")}` : ""}`.replace(/\s\s+/g, " ").trimEnd();
24
+ }
25
+ var d = {
26
+ GG: "GB",
27
+ JE: "GB",
28
+ IM: "GB"
23
29
  };
24
- //# sourceMappingURL=index298.js.map
30
+ function f(e) {
31
+ if (e) return d[e] ?? e;
32
+ }
33
+ function p(e, t, n) {
34
+ if (!e || !n || (e.nationalNumber ?? "").length < 4) return;
35
+ let r = e.countryCallingCode;
36
+ if (!r) return;
37
+ let i = e.getMetadata, a = (typeof i == "function" ? i() : null)?.country_calling_codes?.[r];
38
+ if (!a || a.length === 0) return;
39
+ let o = [];
40
+ for (let e of a) {
41
+ let t = f(e);
42
+ t && !o.includes(t) && o.push(t);
43
+ }
44
+ if (o.length !== 0) return t && o.includes(t) ? t : o.includes("US") ? "US" : o[0];
45
+ }
46
+ function m(e, t, n, r) {
47
+ return e ? r ? !n || !e.startsWith(n) || !e.slice(n.length).startsWith("0") ? !1 : e.slice(n.length + 1) === (t.startsWith(n) ? t.slice(n.length) : t) : e.startsWith("0") : !1;
48
+ }
49
+ function h(e) {
50
+ for (let t of r) if (e.startsWith(t)) return e.slice(t.length);
51
+ return e;
52
+ }
53
+ function g(e, t, r = {}) {
54
+ let { allowJustPlus: i = !1, removeNationalPrefix: s = !0, previousValue: c } = r, u = l(e).trim();
55
+ if (!u) return "";
56
+ if (u === "+") return i ? "+" : "";
57
+ if (u.startsWith("+")) {
58
+ let e = o(u);
59
+ if (!e) return i ? "+" : "";
60
+ let r = h(e);
61
+ if (r !== e) return r ? `+${r}` : i ? "+" : "";
62
+ if (s && t) {
63
+ let r = n(t);
64
+ if (e.startsWith(r) && e.slice(r.length).startsWith("0")) {
65
+ let t = e.slice(r.length + 1);
66
+ return t ? `+${r}${t}` : `+${r}`;
67
+ }
68
+ }
69
+ return `+${e}`;
70
+ }
71
+ let d = o(u);
72
+ if (!d) return "";
73
+ let f = h(d);
74
+ if (f !== d) return f ? `+${f}` : i ? "+" : "";
75
+ let p = typeof c == "string" ? c : "", m = p && p.startsWith("+") ? o(p) : "";
76
+ if (m && m.length > d.length && m.endsWith(d) && m.length - d.length <= a) return `+${d}`;
77
+ if (d === "0") return "0";
78
+ if (s && t && d.length > 1 && d.startsWith("0") && !d.startsWith("00")) {
79
+ let e = n(t), r = d.slice(1);
80
+ return r ? `+${e}${r}` : `+${e}`;
81
+ }
82
+ return t ? d.length <= 4 ? `+${d}` : `+${n(t)}${d}` : d;
83
+ }
84
+ function _(e, n) {
85
+ if (e === "+") return {
86
+ international: "+",
87
+ national: "",
88
+ formatted: "+",
89
+ phoneNumber: null,
90
+ detectedCountry: void 0,
91
+ inferredCountry: void 0,
92
+ hasExplicitInternationalPrefix: !0
93
+ };
94
+ let r = /^\s*\+/.test(e), i = n ? new t(n) : new t(), a = i.input(e), s = i.getNumber(), c = o(e), l = f(s?.country ?? i.country ?? void 0), u = l ?? !s ? void 0 : f(p(s, n, c)), d = s?.formatInternational() ?? a;
95
+ return {
96
+ international: d,
97
+ national: s?.formatNational() ?? o(d),
98
+ formatted: a,
99
+ phoneNumber: s,
100
+ detectedCountry: l,
101
+ inferredCountry: u,
102
+ hasExplicitInternationalPrefix: r
103
+ };
104
+ }
105
+ function v(e, t) {
106
+ return e.startsWith(t) ? e.slice(t.length) : e;
107
+ }
108
+ function y(t, n) {
109
+ if (!n || !t) return null;
110
+ try {
111
+ return e(t, n) === "TOO_LONG" ? "TOO_LONG" : null;
112
+ } catch {
113
+ return null;
114
+ }
115
+ }
116
+ function b(e, t, r, i = {}) {
117
+ let { hasRemovedNationalPrefix: a = !1, detectedCountry: c, hasExplicitInternationalPrefix: l = !1 } = i;
118
+ if (!e) return {
119
+ shouldSuggest: !1,
120
+ query: ""
121
+ };
122
+ if (e === "+") return {
123
+ shouldSuggest: !0,
124
+ query: ""
125
+ };
126
+ let u = o(e);
127
+ if (!u) return {
128
+ shouldSuggest: !0,
129
+ query: ""
130
+ };
131
+ if (a) return {
132
+ shouldSuggest: !1,
133
+ query: ""
134
+ };
135
+ if (l && !c) return s(u) ? {
136
+ shouldSuggest: !0,
137
+ query: u
138
+ } : {
139
+ shouldSuggest: !1,
140
+ query: ""
141
+ };
142
+ let d = r?.countryCallingCode ?? null;
143
+ if (!d) {
144
+ if (t) {
145
+ let e = n(t);
146
+ u.startsWith(e) && (d = e);
147
+ } else if (!l) return {
148
+ shouldSuggest: !1,
149
+ query: ""
150
+ };
151
+ }
152
+ return !d || v(u, d).length === 0 ? {
153
+ shouldSuggest: !0,
154
+ query: u
155
+ } : {
156
+ shouldSuggest: !1,
157
+ query: ""
158
+ };
159
+ }
160
+ function x(e, t) {
161
+ if (e.shouldSuggest) return !1;
162
+ let { hasExplicitInternationalPrefix: n = !1, detectedCountry: r } = t;
163
+ return n ? !!r : !0;
164
+ }
165
+ //#endregion
166
+ export { m as detectNationalPrefixForDisplay, _ as formatWithAsYouType, y as getLengthIssue, b as getSuggestionState, u as injectNationalPrefixDisplay, g as normalizeInputValue, o as sanitizeDigits, x as shouldDisplayExplicitCountrySelection, v as stripPrefix };
167
+
168
+ //# sourceMappingURL=index298.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index298.js","sources":["../../../node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js"],"sourcesContent":["// When phone numbers are written in `RFC3966` format — `\"tel:+12133734253\"` —\n// they can have their \"calling code\" part written separately in a `phone-context` parameter.\n// Example: `\"tel:12133734253;phone-context=+1\"`.\n// This function parses the full phone number from the local number and the `phone-context`\n// when the `phone-context` contains a `+` sign.\n\nimport { VALID_DIGITS\n// PLUS_CHARS\n} from '../constants.js';\nexport var PLUS_SIGN = '+';\nvar RFC3966_VISUAL_SEPARATOR_ = '[\\\\-\\\\.\\\\(\\\\)]?';\nvar RFC3966_PHONE_DIGIT_ = '(' + '[' + VALID_DIGITS + ']' + '|' + RFC3966_VISUAL_SEPARATOR_ + ')';\nvar RFC3966_GLOBAL_NUMBER_DIGITS_ = '^' + '\\\\' + PLUS_SIGN + RFC3966_PHONE_DIGIT_ + '*' + '[' + VALID_DIGITS + ']' + RFC3966_PHONE_DIGIT_ + '*' + '$';\n\n/**\r\n * Regular expression of valid global-number-digits for the phone-context\r\n * parameter, following the syntax defined in RFC3966.\r\n */\nvar RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_ = new RegExp(RFC3966_GLOBAL_NUMBER_DIGITS_, 'g');\n\n// In this port of Google's library, we don't accept alpha characters in phone numbers.\n// const ALPHANUM_ = VALID_ALPHA_ + VALID_DIGITS\nvar ALPHANUM_ = VALID_DIGITS;\nvar RFC3966_DOMAINLABEL_ = '[' + ALPHANUM_ + ']+((\\\\-)*[' + ALPHANUM_ + '])*';\nvar VALID_ALPHA_ = 'a-zA-Z';\nvar RFC3966_TOPLABEL_ = '[' + VALID_ALPHA_ + ']+((\\\\-)*[' + ALPHANUM_ + '])*';\nvar RFC3966_DOMAINNAME_ = '^(' + RFC3966_DOMAINLABEL_ + '\\\\.)*' + RFC3966_TOPLABEL_ + '\\\\.?$';\n\n/**\r\n * Regular expression of valid domainname for the phone-context parameter,\r\n * following the syntax defined in RFC3966.\r\n */\nvar RFC3966_DOMAINNAME_PATTERN_ = new RegExp(RFC3966_DOMAINNAME_, 'g');\nexport var RFC3966_PREFIX_ = 'tel:';\nexport var RFC3966_PHONE_CONTEXT_ = ';phone-context=';\nexport var RFC3966_ISDN_SUBADDRESS_ = ';isub=';\n\n/**\r\n * Extracts the value of the phone-context parameter of `numberToExtractFrom`,\r\n * following the syntax defined in RFC3966.\r\n *\r\n * @param {string} numberToExtractFrom\r\n * @return {string|null} the extracted string (possibly empty), or `null` if no phone-context parameter is found.\r\n */\nexport default function extractPhoneContext(numberToExtractFrom) {\n var indexOfPhoneContext = numberToExtractFrom.indexOf(RFC3966_PHONE_CONTEXT_);\n // If no phone-context parameter is present\n if (indexOfPhoneContext < 0) {\n return null;\n }\n var phoneContextStart = indexOfPhoneContext + RFC3966_PHONE_CONTEXT_.length;\n // If phone-context parameter is empty\n if (phoneContextStart >= numberToExtractFrom.length) {\n return '';\n }\n var phoneContextEnd = numberToExtractFrom.indexOf(';', phoneContextStart);\n // If phone-context is not the last parameter\n if (phoneContextEnd >= 0) {\n return numberToExtractFrom.substring(phoneContextStart, phoneContextEnd);\n } else {\n return numberToExtractFrom.substring(phoneContextStart);\n }\n}\n\n/**\r\n * Returns whether the value of phoneContext follows the syntax defined in RFC3966.\r\n *\r\n * @param {string|null} phoneContext\r\n * @return {boolean}\r\n */\nexport function isPhoneContextValid(phoneContext) {\n if (phoneContext === null) {\n return true;\n }\n if (phoneContext.length === 0) {\n return false;\n }\n\n // Does phone-context value match pattern of global-number-digits or domainname.\n return RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_.test(phoneContext) || RFC3966_DOMAINNAME_PATTERN_.test(phoneContext);\n}\n//# sourceMappingURL=extractPhoneContext.js.map"],"names":["PLUS_SIGN","RFC3966_VISUAL_SEPARATOR_","RFC3966_PHONE_DIGIT_","VALID_DIGITS","RFC3966_GLOBAL_NUMBER_DIGITS_","RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_","ALPHANUM_","RFC3966_DOMAINLABEL_","VALID_ALPHA_","RFC3966_TOPLABEL_","RFC3966_DOMAINNAME_","RFC3966_DOMAINNAME_PATTERN_","RFC3966_PREFIX_","RFC3966_PHONE_CONTEXT_","RFC3966_ISDN_SUBADDRESS_","extractPhoneContext","numberToExtractFrom","indexOfPhoneContext","phoneContextStart","phoneContextEnd","isPhoneContextValid","phoneContext"],"mappings":";AASU,IAACA,IAAY,KACnBC,IAA4B,mBAC5BC,IAAuB,OAAYC,IAAe,OAAYF,IAA4B,KAC1FG,IAAgC,QAAaJ,IAAYE,IAAuB,OAAYC,IAAe,MAAMD,IAAuB,MAMxIG,IAAwC,IAAI,OAAOD,GAA+B,GAAG,GAIrFE,IAAYH,GACZI,IAAuB,MAAMD,IAAY,eAAeA,IAAY,OACpEE,IAAe,UACfC,IAAoB,MAAMD,IAAe,eAAeF,IAAY,OACpEI,IAAsB,OAAOH,IAAuB,UAAUE,IAAoB,SAMlFE,IAA8B,IAAI,OAAOD,GAAqB,GAAG,GAC1DE,IAAkB,QAClBC,IAAyB,mBACzBC,IAA2B;AASvB,SAASC,EAAoBC,GAAqB;AAC/D,MAAIC,IAAsBD,EAAoB,QAAQH,CAAsB;AAE5E,MAAII,IAAsB;AACxB,WAAO;AAET,MAAIC,IAAoBD,IAAsBJ,EAAuB;AAErE,MAAIK,KAAqBF,EAAoB;AAC3C,WAAO;AAET,MAAIG,IAAkBH,EAAoB,QAAQ,KAAKE,CAAiB;AAExE,SAAIC,KAAmB,IACdH,EAAoB,UAAUE,GAAmBC,CAAe,IAEhEH,EAAoB,UAAUE,CAAiB;AAE1D;AAQO,SAASE,EAAoBC,GAAc;AAChD,SAAIA,MAAiB,OACZ,KAELA,EAAa,WAAW,IACnB,KAIFhB,EAAsC,KAAKgB,CAAY,KAAKV,EAA4B,KAAKU,CAAY;AAClH;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index298.js","names":["CountryCode","AsYouType","getCountryCallingCode","validatePhoneNumberLength","COMMON_IDD_PREFIXES","COUNTRY_DIAL_CODES","DEFAULT_COUNTRY","MAX_DIAL_CODE_LENGTH","LengthIssue","sanitizeDigits","value","replace","isDialCodeProgress","digits","length","some","dial","startsWith","INVISIBLE_FORMATTING_CHARACTERS","stripInvisibleFormatting","injectNationalPrefixDisplay","international","dialCode","options","force","prefix","remainder","slice","trimStart","alreadyHasTrunk","firstGroup","restGroups","split","rebuiltFirstGroup","rebuiltRemainder","join","trimEnd","DETECTED_COUNTRY_OVERRIDES","Partial","Record","GG","JE","IM","canonicalizeDetectedCountry","candidate","undefined","AsYouTypeNumber","ReturnType","inferCountryFromDialCode","phoneNumber","baseCountry","normalizedDigits","nationalDigits","nationalNumber","countryCallingCode","metadataGetter","getMetadata","metadata","country_calling_codes","candidates","canonicalCandidates","canonical","includes","push","detectNationalPrefixForDisplay","rawDigits","internationalDigits","hasExplicitInternationalPrefix","rawAfterTrunk","internationalAfterDial","stripIddPrefix","normalizeInputValue","rawValue","country","allowJustPlus","removeNationalPrefix","previousValue","cleaned","trimmed","trim","digitsWithoutIdd","withoutPrefix","digitsOnly","previousNormalized","previousDigits","endsWith","removedPrefixLength","formatWithAsYouType","national","formatted","detectedCountry","inferredCountry","test","formatter","input","getNumber","formatInternational","formatNational","stripPrefix","getLengthIssue","result","SuggestionState","shouldSuggest","query","getSuggestionState","normalized","hasRemovedNationalPrefix","baseDial","shouldDisplayExplicitCountrySelection","suggestion","Boolean"],"sources":["../src/components/PhoneNumberInput/normalization.ts"],"sourcesContent":["import type { CountryCode } from \"libphonenumber-js\"\nimport { AsYouType, getCountryCallingCode, validatePhoneNumberLength } from \"libphonenumber-js\"\n\nimport {\n COMMON_IDD_PREFIXES,\n COUNTRY_DIAL_CODES,\n DEFAULT_COUNTRY,\n MAX_DIAL_CODE_LENGTH,\n} from \"./country-options\"\n\n\nexport type LengthIssue = \"TOO_LONG\"\n\nexport function sanitizeDigits(value: string) {\n return value.replace(/\\D/g, \"\")\n}\n\nfunction isDialCodeProgress(digits: string) {\n if (!digits) {\n return true\n }\n\n if (digits.length > MAX_DIAL_CODE_LENGTH) {\n return false\n }\n\n return COUNTRY_DIAL_CODES.some((dial) => dial.startsWith(digits))\n}\n\nconst INVISIBLE_FORMATTING_CHARACTERS =\n /[\\u061C\\u200B-\\u200F\\u202A-\\u202E\\u2066-\\u2069\\uFEFF]/g\n\nfunction stripInvisibleFormatting(value: string) {\n return value.replace(INVISIBLE_FORMATTING_CHARACTERS, \"\")\n}\n\nexport function injectNationalPrefixDisplay(\n international: string,\n dialCode: string,\n options: { force?: boolean } = {}\n) {\n // Preserve a user-typed national trunk (e.g. the French \"0\") purely for display\n // so validation can continue to use the canonical E.164 representation internally.\n const { force = false } = options\n const prefix = `+${dialCode}`\n\n if (!international.startsWith(prefix)) {\n return international\n }\n\n if (!force) {\n return international\n }\n\n const remainder = international.slice(prefix.length).trimStart()\n const alreadyHasTrunk = remainder.startsWith(\"0\")\n\n if (alreadyHasTrunk) {\n return international\n }\n\n if (!remainder) {\n return `${prefix} 0`\n }\n\n const [firstGroup, ...restGroups] = remainder.split(\" \")\n const rebuiltFirstGroup = `0${firstGroup ?? \"\"}`\n const rebuiltRemainder = restGroups.length > 0 ? ` ${restGroups.join(\" \")}` : \"\"\n\n return `${prefix} ${rebuiltFirstGroup}${rebuiltRemainder}`.replace(/\\s\\s+/g, \" \").trimEnd()\n}\n\nconst DETECTED_COUNTRY_OVERRIDES: Partial<Record<CountryCode, CountryCode>> = {\n GG: \"GB\",\n JE: \"GB\",\n IM: \"GB\",\n}\n\nfunction canonicalizeDetectedCountry(candidate: CountryCode | undefined): CountryCode | undefined {\n if (!candidate) {\n return undefined\n }\n return DETECTED_COUNTRY_OVERRIDES[candidate] ?? candidate\n}\n\ntype AsYouTypeNumber = ReturnType<AsYouType[\"getNumber\"]>\n\nfunction inferCountryFromDialCode(\n phoneNumber: AsYouTypeNumber,\n baseCountry: CountryCode | undefined,\n normalizedDigits: string\n): CountryCode | undefined {\n if (!phoneNumber) {\n return undefined\n }\n\n if (!normalizedDigits) {\n return undefined\n }\n\n const nationalDigits = phoneNumber.nationalNumber ?? \"\"\n if (nationalDigits.length < 4) {\n return undefined\n }\n\n const dial = phoneNumber.countryCallingCode\n if (!dial) {\n return undefined\n }\n\n const metadataGetter = (phoneNumber as unknown as { getMetadata?: () => unknown }).getMetadata\n const metadata =\n typeof metadataGetter === \"function\"\n ? (metadataGetter() as {\n country_calling_codes?: Record<string, string[]>\n } | null)\n : null\n\n const candidates = metadata?.country_calling_codes?.[dial]\n if (!candidates || candidates.length === 0) {\n return undefined\n }\n\n const canonicalCandidates: CountryCode[] = []\n for (const candidate of candidates) {\n const canonical = canonicalizeDetectedCountry(candidate as CountryCode)\n if (canonical && !canonicalCandidates.includes(canonical)) {\n canonicalCandidates.push(canonical)\n }\n }\n\n if (canonicalCandidates.length === 0) {\n return undefined\n }\n\n if (baseCountry && canonicalCandidates.includes(baseCountry)) {\n return baseCountry\n }\n\n if (canonicalCandidates.includes(DEFAULT_COUNTRY)) {\n return DEFAULT_COUNTRY\n }\n\n return canonicalCandidates[0]\n}\n\nexport function detectNationalPrefixForDisplay(\n rawDigits: string,\n internationalDigits: string,\n dialCode: string,\n hasExplicitInternationalPrefix: boolean\n) {\n if (!rawDigits) {\n return false\n }\n\n if (!hasExplicitInternationalPrefix) {\n return rawDigits.startsWith(\"0\")\n }\n\n if (!dialCode) {\n return false\n }\n\n if (!rawDigits.startsWith(dialCode)) {\n return false\n }\n\n if (!rawDigits.slice(dialCode.length).startsWith(\"0\")) {\n return false\n }\n\n const rawAfterTrunk = rawDigits.slice(dialCode.length + 1)\n const internationalAfterDial = internationalDigits.startsWith(dialCode)\n ? internationalDigits.slice(dialCode.length)\n : internationalDigits\n\n return rawAfterTrunk === internationalAfterDial\n}\n\nfunction stripIddPrefix(digits: string) {\n for (const prefix of COMMON_IDD_PREFIXES) {\n if (digits.startsWith(prefix)) {\n return digits.slice(prefix.length)\n }\n }\n return digits\n}\n\nexport function normalizeInputValue(\n rawValue: string,\n country: CountryCode | undefined,\n options: {\n allowJustPlus?: boolean\n removeNationalPrefix?: boolean\n previousValue?: string\n } = {}\n) {\n const { allowJustPlus = false, removeNationalPrefix = true, previousValue } = options\n const cleaned = stripInvisibleFormatting(rawValue)\n const trimmed = cleaned.trim()\n\n if (!trimmed) {\n return \"\"\n }\n\n if (trimmed === \"+\") {\n return allowJustPlus ? \"+\" : \"\"\n }\n\n if (trimmed.startsWith(\"+\")) {\n const digits = sanitizeDigits(trimmed)\n if (!digits) {\n return allowJustPlus ? \"+\" : \"\"\n }\n const digitsWithoutIdd = stripIddPrefix(digits)\n if (digitsWithoutIdd !== digits) {\n return digitsWithoutIdd ? `+${digitsWithoutIdd}` : allowJustPlus ? \"+\" : \"\"\n }\n if (removeNationalPrefix && country) {\n const dial = getCountryCallingCode(country)\n if (digits.startsWith(dial) && digits.slice(dial.length).startsWith(\"0\")) {\n const withoutPrefix = digits.slice(dial.length + 1)\n return withoutPrefix ? `+${dial}${withoutPrefix}` : `+${dial}`\n }\n }\n return `+${digits}`\n }\n\n const digitsOnly = sanitizeDigits(trimmed)\n if (!digitsOnly) {\n return \"\"\n }\n\n const digitsWithoutIdd = stripIddPrefix(digitsOnly)\n if (digitsWithoutIdd !== digitsOnly) {\n return digitsWithoutIdd ? `+${digitsWithoutIdd}` : allowJustPlus ? \"+\" : \"\"\n }\n\n const previousNormalized = typeof previousValue === \"string\" ? previousValue : \"\"\n const previousDigits =\n previousNormalized && previousNormalized.startsWith(\"+\")\n ? sanitizeDigits(previousNormalized)\n : \"\"\n\n if (previousDigits && previousDigits.length > digitsOnly.length) {\n if (previousDigits.endsWith(digitsOnly)) {\n const removedPrefixLength = previousDigits.length - digitsOnly.length\n if (removedPrefixLength <= MAX_DIAL_CODE_LENGTH) {\n return `+${digitsOnly}`\n }\n }\n }\n\n if (digitsOnly === \"0\") {\n return \"0\"\n }\n\n if (\n removeNationalPrefix &&\n country &&\n digitsOnly.length > 1 &&\n digitsOnly.startsWith(\"0\") &&\n !digitsOnly.startsWith(\"00\")\n ) {\n const dial = getCountryCallingCode(country)\n const withoutPrefix = digitsOnly.slice(1)\n return withoutPrefix ? `+${dial}${withoutPrefix}` : `+${dial}`\n }\n\n if (!country) {\n return digitsOnly\n }\n\n if (digitsOnly.length <= 4) {\n return `+${digitsOnly}`\n }\n\n const dial = getCountryCallingCode(country)\n return `+${dial}${digitsOnly}`\n}\n\nexport function formatWithAsYouType(value: string, baseCountry?: CountryCode) {\n if (value === \"+\") {\n return {\n international: \"+\",\n national: \"\",\n formatted: \"+\",\n phoneNumber: null,\n detectedCountry: undefined,\n inferredCountry: undefined,\n hasExplicitInternationalPrefix: true,\n }\n }\n\n const hasExplicitInternationalPrefix = /^\\s*\\+/.test(value)\n const formatter = baseCountry ? new AsYouType(baseCountry) : new AsYouType()\n const formatted = formatter.input(value)\n const phoneNumber = formatter.getNumber()\n const digits = sanitizeDigits(value)\n const detectedCountry = canonicalizeDetectedCountry(\n (phoneNumber?.country ?? formatter.country ?? undefined) as CountryCode | undefined\n )\n const inferredCountry =\n detectedCountry ?? !phoneNumber\n ? undefined\n : canonicalizeDetectedCountry(\n inferCountryFromDialCode(phoneNumber, baseCountry, digits)\n )\n\n const international = phoneNumber?.formatInternational() ?? formatted\n const national = phoneNumber?.formatNational() ?? sanitizeDigits(international)\n\n return {\n international,\n national,\n formatted,\n phoneNumber,\n detectedCountry,\n inferredCountry,\n hasExplicitInternationalPrefix,\n }\n}\n\nexport function stripPrefix(value: string, prefix: string) {\n return value.startsWith(prefix) ? value.slice(prefix.length) : value\n}\n\nexport function getLengthIssue(value: string, country: CountryCode | undefined): LengthIssue | null {\n if (!country || !value) {\n return null\n }\n\n try {\n const result = validatePhoneNumberLength(value, country)\n return result === \"TOO_LONG\" ? \"TOO_LONG\" : null\n } catch {\n return null\n }\n}\n\ntype SuggestionState = {\n shouldSuggest: boolean\n query: string\n}\n\nexport function getSuggestionState(\n normalized: string,\n baseCountry: CountryCode | undefined,\n phoneNumber: ReturnType<AsYouType[\"getNumber\"]>,\n options: {\n hasRemovedNationalPrefix?: boolean\n detectedCountry?: CountryCode\n hasExplicitInternationalPrefix?: boolean\n } = {}\n): SuggestionState {\n const {\n hasRemovedNationalPrefix = false,\n detectedCountry,\n hasExplicitInternationalPrefix = false,\n } = options\n\n if (!normalized) {\n return { shouldSuggest: false, query: \"\" }\n }\n\n if (normalized === \"+\") {\n return { shouldSuggest: true, query: \"\" }\n }\n\n const digits = sanitizeDigits(normalized)\n if (!digits) {\n return { shouldSuggest: true, query: \"\" }\n }\n\n if (hasRemovedNationalPrefix) {\n return { shouldSuggest: false, query: \"\" }\n }\n\n if (hasExplicitInternationalPrefix && !detectedCountry) {\n if (!isDialCodeProgress(digits)) {\n return { shouldSuggest: false, query: \"\" }\n }\n return { shouldSuggest: true, query: digits }\n }\n\n let dial = phoneNumber?.countryCallingCode ?? null\n if (!dial) {\n if (baseCountry) {\n const baseDial = getCountryCallingCode(baseCountry)\n if (digits.startsWith(baseDial)) {\n dial = baseDial\n }\n } else if (!hasExplicitInternationalPrefix) {\n return { shouldSuggest: false, query: \"\" }\n }\n }\n\n if (!dial) {\n return { shouldSuggest: true, query: digits }\n }\n\n const nationalDigits = stripPrefix(digits, dial)\n if (nationalDigits.length === 0) {\n return { shouldSuggest: true, query: digits }\n }\n\n return { shouldSuggest: false, query: \"\" }\n}\n\nexport function shouldDisplayExplicitCountrySelection(\n suggestion: SuggestionState,\n options: { detectedCountry?: CountryCode; hasExplicitInternationalPrefix?: boolean }\n) {\n if (suggestion.shouldSuggest) {\n return false\n }\n\n const { hasExplicitInternationalPrefix = false, detectedCountry } = options\n\n if (!hasExplicitInternationalPrefix) {\n return true\n }\n\n return Boolean(detectedCountry)\n}\n"],"mappings":";;;;;AAaA,SAAgBS,EAAeC,GAAe;AAC5C,QAAOA,EAAMC,QAAQ,OAAO,GAAG;;AAGjC,SAASC,EAAmBC,GAAgB;AAS1C,QARKA,IAIDA,EAAOC,SAASP,IACX,KAGFF,EAAmBU,MAAMC,MAASA,EAAKC,WAAWJ,EAAO,CAAC,GAPxD;;AAUX,IAAMK,IACJ;AAEF,SAASC,EAAyBT,GAAe;AAC/C,QAAOA,EAAMC,QAAQO,GAAiC,GAAG;;AAG3D,SAAgBE,EACdC,GACAC,GACAC,IAA+B,EAAE,EACjC;CAGA,IAAM,EAAEC,WAAQ,OAAUD,GACpBE,IAAS,IAAIH;AAMnB,KAJI,CAACD,EAAcJ,WAAWQ,EAAO,IAIjC,CAACD,EACH,QAAOH;CAGT,IAAMK,IAAYL,EAAcM,MAAMF,EAAOX,OAAO,CAACc,WAAW;AAGhE,KAFwBF,EAAUT,WAAW,IAAI,CAG/C,QAAOI;AAGT,KAAI,CAACK,EACH,QAAO,G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AAe;EAAOC,OAAO;EAAI;;AAG5C,SAAgBK,EACdC,GACAtF,GACA;AACA,KAAIsF,EAAWP,cACb,QAAO;CAGT,IAAM,EAAEnC,oCAAiC,IAAOuB,uBAAoBnE;AAMpE,QAJK4C,IAIE2C,EAAQpB,IAHN"}
package/dist/index299.js CHANGED
@@ -1,68 +1,72 @@
1
- import { __assign as d } from "./index239.js";
2
- function l(r) {
3
- return r;
1
+ //#region src/components/PhoneNumberInput/selection.ts
2
+ function e(e) {
3
+ if (!e) return !1;
4
+ let t = e.charCodeAt(0);
5
+ return t >= 48 && t <= 57;
4
6
  }
5
- function h(r, t) {
6
- t === void 0 && (t = l);
7
- var e = [], o = !1, c = {
8
- read: function() {
9
- if (o)
10
- throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
11
- return e.length ? e[e.length - 1] : r;
12
- },
13
- useMedium: function(u) {
14
- var n = t(u, o);
15
- return e.push(n), function() {
16
- e = e.filter(function(i) {
17
- return i !== n;
18
- });
19
- };
20
- },
21
- assignSyncMedium: function(u) {
22
- for (o = !0; e.length; ) {
23
- var n = e;
24
- e = [], n.forEach(u);
25
- }
26
- e = {
27
- push: function(i) {
28
- return u(i);
29
- },
30
- filter: function() {
31
- return e;
32
- }
33
- };
34
- },
35
- assignMedium: function(u) {
36
- o = !0;
37
- var n = [];
38
- if (e.length) {
39
- var i = e;
40
- e = [], i.forEach(u), n = e;
41
- }
42
- var s = function() {
43
- var f = n;
44
- n = [], f.forEach(u);
45
- }, a = function() {
46
- return Promise.resolve().then(s);
47
- };
48
- a(), e = {
49
- push: function(f) {
50
- n.push(f), a();
51
- },
52
- filter: function(f) {
53
- return n = n.filter(f), e;
54
- }
55
- };
56
- }
57
- };
58
- return c;
7
+ function t(t, n) {
8
+ let r = 0, i = Math.min(n, t.length);
9
+ for (let n = 0; n < i; n += 1) e(t[n] ?? "") && (r += 1);
10
+ return r;
59
11
  }
60
- function v(r) {
61
- r === void 0 && (r = {});
62
- var t = h(null);
63
- return t.options = d({ async: !0, ssr: !1 }, r), t;
12
+ function n(t, n) {
13
+ if (n <= 0) return t.startsWith("+") ? Math.min(1, t.length) : 0;
14
+ let r = 0;
15
+ for (let i = 0; i < t.length; i += 1) if (e(t[i] ?? "") && (r += 1, r === n)) return i + 1;
16
+ return t.length;
64
17
  }
65
- export {
66
- v as createSidecarMedium
67
- };
68
- //# sourceMappingURL=index299.js.map
18
+ function r(t) {
19
+ return !t || e(t) ? !1 : t !== "+";
20
+ }
21
+ function i(e, t) {
22
+ let n = t;
23
+ for (; n > 0 && r(e[n - 1] ?? "");) --n;
24
+ return n;
25
+ }
26
+ function a(e, t) {
27
+ let n = t;
28
+ for (; n < e.length && r(e[n] ?? "");) n += 1;
29
+ return n;
30
+ }
31
+ function o(e) {
32
+ let { value: n } = e, r = e.selectionStart ?? n.length, i = e.selectionEnd ?? r, a = r <= 1 && n.startsWith("+"), o = i <= 1 && n.startsWith("+");
33
+ return {
34
+ selectionStart: r,
35
+ selectionEnd: i,
36
+ startDigits: t(n, r),
37
+ endDigits: t(n, i),
38
+ preserveStartIndex: a,
39
+ preserveEndIndex: o,
40
+ wasAtStart: r === 0,
41
+ wasAtEnd: i === n.length
42
+ };
43
+ }
44
+ function s(e, t) {
45
+ if (e.selectionStart === e.selectionEnd) {
46
+ if (e.wasAtEnd) {
47
+ let e = t.length;
48
+ return {
49
+ start: e,
50
+ end: e
51
+ };
52
+ }
53
+ if (e.wasAtStart) return {
54
+ start: 0,
55
+ end: 0
56
+ };
57
+ }
58
+ let r = e.preserveStartIndex ? Math.min(e.selectionStart, t.length) : n(t, e.startDigits), i = e.preserveEndIndex ? Math.min(e.selectionEnd, t.length) : n(t, e.endDigits), a = r, o = i;
59
+ e.wasAtStart && (a = 0), e.wasAtEnd && (o = t.length), e.selectionStart === e.selectionEnd && (a = o);
60
+ let s = Math.min(Math.max(a, 0), t.length), c = Math.min(Math.max(o, 0), t.length);
61
+ return s > c ? {
62
+ start: c,
63
+ end: c
64
+ } : {
65
+ start: s,
66
+ end: c
67
+ };
68
+ }
69
+ //#endregion
70
+ export { o as captureSelectionSnapshot, s as resolveSelection, i as skipFormattingCharactersLeft, a as skipFormattingCharactersRight };
71
+
72
+ //# sourceMappingURL=index299.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index299.js","sources":["../../../node_modules/use-sidecar/dist/es2015/medium.js"],"sourcesContent":["import { __assign } from \"tslib\";\nfunction ItoI(a) {\n return a;\n}\nfunction innerCreateMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n var buffer = [];\n var assigned = false;\n var medium = {\n read: function () {\n if (assigned) {\n throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');\n }\n if (buffer.length) {\n return buffer[buffer.length - 1];\n }\n return defaults;\n },\n useMedium: function (data) {\n var item = middleware(data, assigned);\n buffer.push(item);\n return function () {\n buffer = buffer.filter(function (x) { return x !== item; });\n };\n },\n assignSyncMedium: function (cb) {\n assigned = true;\n while (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n }\n buffer = {\n push: function (x) { return cb(x); },\n filter: function () { return buffer; },\n };\n },\n assignMedium: function (cb) {\n assigned = true;\n var pendingQueue = [];\n if (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n pendingQueue = buffer;\n }\n var executeQueue = function () {\n var cbs = pendingQueue;\n pendingQueue = [];\n cbs.forEach(cb);\n };\n var cycle = function () { return Promise.resolve().then(executeQueue); };\n cycle();\n buffer = {\n push: function (x) {\n pendingQueue.push(x);\n cycle();\n },\n filter: function (filter) {\n pendingQueue = pendingQueue.filter(filter);\n return buffer;\n },\n };\n },\n };\n return medium;\n}\nexport function createMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n return innerCreateMedium(defaults, middleware);\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function createSidecarMedium(options) {\n if (options === void 0) { options = {}; }\n var medium = innerCreateMedium(null);\n medium.options = __assign({ async: true, ssr: false }, options);\n return medium;\n}\n"],"names":["ItoI","a","innerCreateMedium","defaults","middleware","buffer","assigned","medium","data","item","x","cb","cbs","pendingQueue","executeQueue","cycle","filter","createSidecarMedium","options","__assign"],"mappings":";AACA,SAASA,EAAKC,GAAG;AACb,SAAOA;AACX;AACA,SAASC,EAAkBC,GAAUC,GAAY;AAC7C,EAAIA,MAAe,WAAUA,IAAaJ;AAC1C,MAAIK,IAAS,CAAA,GACTC,IAAW,IACXC,IAAS;AAAA,IACT,MAAM,WAAY;AACd,UAAID;AACA,cAAM,IAAI,MAAM,kGAAkG;AAEtH,aAAID,EAAO,SACAA,EAAOA,EAAO,SAAS,CAAC,IAE5BF;AAAA,IACX;AAAA,IACA,WAAW,SAAUK,GAAM;AACvB,UAAIC,IAAOL,EAAWI,GAAMF,CAAQ;AACpC,aAAAD,EAAO,KAAKI,CAAI,GACT,WAAY;AACf,QAAAJ,IAASA,EAAO,OAAO,SAAUK,GAAG;AAAE,iBAAOA,MAAMD;AAAA,QAAM,CAAC;AAAA,MAC9D;AAAA,IACJ;AAAA,IACA,kBAAkB,SAAUE,GAAI;AAE5B,WADAL,IAAW,IACJD,EAAO,UAAQ;AAClB,YAAIO,IAAMP;AACV,QAAAA,IAAS,CAAA,GACTO,EAAI,QAAQD,CAAE;AAAA,MAClB;AACA,MAAAN,IAAS;AAAA,QACL,MAAM,SAAUK,GAAG;AAAE,iBAAOC,EAAGD,CAAC;AAAA,QAAG;AAAA,QACnC,QAAQ,WAAY;AAAE,iBAAOL;AAAA,QAAQ;AAAA,MACrD;AAAA,IACQ;AAAA,IACA,cAAc,SAAUM,GAAI;AACxB,MAAAL,IAAW;AACX,UAAIO,IAAe,CAAA;AACnB,UAAIR,EAAO,QAAQ;AACf,YAAIO,IAAMP;AACV,QAAAA,IAAS,CAAA,GACTO,EAAI,QAAQD,CAAE,GACdE,IAAeR;AAAA,MACnB;AACA,UAAIS,IAAe,WAAY;AAC3B,YAAIF,IAAMC;AACV,QAAAA,IAAe,CAAA,GACfD,EAAI,QAAQD,CAAE;AAAA,MAClB,GACII,IAAQ,WAAY;AAAE,eAAO,QAAQ,QAAO,EAAG,KAAKD,CAAY;AAAA,MAAG;AACvE,MAAAC,EAAK,GACLV,IAAS;AAAA,QACL,MAAM,SAAUK,GAAG;AACf,UAAAG,EAAa,KAAKH,CAAC,GACnBK,EAAK;AAAA,QACT;AAAA,QACA,QAAQ,SAAUC,GAAQ;AACtB,iBAAAH,IAAeA,EAAa,OAAOG,CAAM,GAClCX;AAAA,QACX;AAAA,MAChB;AAAA,IACQ;AAAA,EACR;AACI,SAAOE;AACX;AAMO,SAASU,EAAoBC,GAAS;AACzC,EAAIA,MAAY,WAAUA,IAAU,CAAA;AACpC,MAAIX,IAASL,EAAkB,IAAI;AACnC,SAAAK,EAAO,UAAUY,EAAS,EAAE,OAAO,IAAM,KAAK,GAAK,GAAID,CAAO,GACvDX;AACX;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index299.js","names":["isDigitCharacter","char","code","charCodeAt","countDigitsBefore","value","index","count","limit","Math","min","length","position","findIndexForDigitCount","digitCount","startsWith","seen","isFormattingCharacter","skipFormattingCharactersLeft","next","skipFormattingCharactersRight","SelectionSnapshot","selectionStart","selectionEnd","startDigits","endDigits","preserveStartIndex","preserveEndIndex","wasAtStart","wasAtEnd","captureSelectionSnapshot","input","HTMLInputElement","resolveSelection","snapshot","end","start","resolvedStart","resolvedEnd","clampedStart","max","clampedEnd"],"sources":["../src/components/PhoneNumberInput/selection.ts"],"sourcesContent":["function isDigitCharacter(char: string) {\n if (!char) {\n return false\n }\n const code = char.charCodeAt(0)\n return code >= 48 && code <= 57\n}\n\nfunction countDigitsBefore(value: string, index: number) {\n let count = 0\n const limit = Math.min(index, value.length)\n for (let position = 0; position < limit; position += 1) {\n if (isDigitCharacter(value[position] ?? \"\")) {\n count += 1\n }\n }\n return count\n}\n\nfunction findIndexForDigitCount(value: string, digitCount: number) {\n if (digitCount <= 0) {\n return value.startsWith(\"+\") ? Math.min(1, value.length) : 0\n }\n\n let seen = 0\n for (let index = 0; index < value.length; index += 1) {\n if (isDigitCharacter(value[index] ?? \"\")) {\n seen += 1\n if (seen === digitCount) {\n return index + 1\n }\n }\n }\n\n return value.length\n}\n\nfunction isFormattingCharacter(char: string) {\n if (!char) {\n return false\n }\n if (isDigitCharacter(char)) {\n return false\n }\n return char !== \"+\"\n}\n\nexport function skipFormattingCharactersLeft(value: string, index: number) {\n let position = index\n while (position > 0) {\n const next = value[position - 1] ?? \"\"\n if (!isFormattingCharacter(next)) {\n break\n }\n position -= 1\n }\n return position\n}\n\nexport function skipFormattingCharactersRight(value: string, index: number) {\n let position = index\n while (position < value.length) {\n const next = value[position] ?? \"\"\n if (!isFormattingCharacter(next)) {\n break\n }\n position += 1\n }\n return position\n}\n\ntype SelectionSnapshot = {\n selectionStart: number\n selectionEnd: number\n startDigits: number\n endDigits: number\n preserveStartIndex: boolean\n preserveEndIndex: boolean\n wasAtStart: boolean\n wasAtEnd: boolean\n}\n\nexport function captureSelectionSnapshot(input: HTMLInputElement): SelectionSnapshot {\n const { value } = input\n const selectionStart = input.selectionStart ?? value.length\n const selectionEnd = input.selectionEnd ?? selectionStart\n const preserveStartIndex = selectionStart <= 1 && value.startsWith(\"+\")\n const preserveEndIndex = selectionEnd <= 1 && value.startsWith(\"+\")\n\n return {\n selectionStart,\n selectionEnd,\n startDigits: countDigitsBefore(value, selectionStart),\n endDigits: countDigitsBefore(value, selectionEnd),\n preserveStartIndex,\n preserveEndIndex,\n wasAtStart: selectionStart === 0,\n wasAtEnd: selectionEnd === value.length,\n }\n}\n\nexport function resolveSelection(snapshot: SelectionSnapshot, value: string) {\n if (snapshot.selectionStart === snapshot.selectionEnd) {\n if (snapshot.wasAtEnd) {\n const end = value.length\n return { start: end, end }\n }\n if (snapshot.wasAtStart) {\n return { start: 0, end: 0 }\n }\n }\n\n const start = snapshot.preserveStartIndex\n ? Math.min(snapshot.selectionStart, value.length)\n : findIndexForDigitCount(value, snapshot.startDigits)\n const end = snapshot.preserveEndIndex\n ? Math.min(snapshot.selectionEnd, value.length)\n : findIndexForDigitCount(value, snapshot.endDigits)\n\n let resolvedStart = start\n let resolvedEnd = end\n\n if (snapshot.wasAtStart) {\n resolvedStart = 0\n }\n\n if (snapshot.wasAtEnd) {\n resolvedEnd = value.length\n }\n\n if (snapshot.selectionStart === snapshot.selectionEnd) {\n resolvedStart = resolvedEnd\n }\n\n const clampedStart = Math.min(Math.max(resolvedStart, 0), value.length)\n const clampedEnd = Math.min(Math.max(resolvedEnd, 0), value.length)\n\n if (clampedStart > clampedEnd) {\n return { start: clampedEnd, end: clampedEnd }\n }\n\n return { start: clampedStart, end: clampedEnd }\n}\n\n"],"mappings":";AAAA,SAASA,EAAiBC,GAAc;AACtC,KAAI,CAACA,EACH,QAAO;CAET,IAAMC,IAAOD,EAAKE,WAAW,EAAE;AAC/B,QAAOD,KAAQ,MAAMA,KAAQ;;AAG/B,SAASE,EAAkBC,GAAeC,GAAe;CACvD,IAAIC,IAAQ,GACNC,IAAQC,KAAKC,IAAIJ,GAAOD,EAAMM,OAAO;AAC3C,MAAK,IAAIC,IAAW,GAAGA,IAAWJ,GAAOI,KAAY,EACnD,CAAIZ,EAAiBK,EAAMO,MAAa,GAAG,KACzCL,KAAS;AAGb,QAAOA;;AAGT,SAASM,EAAuBR,GAAeS,GAAoB;AACjE,KAAIA,KAAc,EAChB,QAAOT,EAAMU,WAAW,IAAI,GAAGN,KAAKC,IAAI,GAAGL,EAAMM,OAAO,GAAG;CAG7D,IAAIK,IAAO;AACX,MAAK,IAAIV,IAAQ,GAAGA,IAAQD,EAAMM,QAAQL,KAAS,EACjD,KAAIN,EAAiBK,EAAMC,MAAU,GAAG,KACtCU,KAAQ,GACJA,MAASF,GACX,QAAOR,IAAQ;AAKrB,QAAOD,EAAMM;;AAGf,SAASM,EAAsBhB,GAAc;AAO3C,QANI,CAACA,KAGDD,EAAiBC,EAAK,GACjB,K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,EAASN,eACXS,IAAgB,IAGdH,EAASL,aACXS,IAAcjC,EAAMM,SAGlBuB,EAASZ,mBAAmBY,EAASX,iBACvCc,IAAgBC;CAGlB,IAAMC,IAAe9B,KAAKC,IAAID,KAAK+B,IAAIH,GAAe,EAAE,EAAEhC,EAAMM,OAAO,EACjE8B,IAAahC,KAAKC,IAAID,KAAK+B,IAAIF,GAAa,EAAE,EAAEjC,EAAMM,OAAO;AAMnE,QAJI4B,IAAeE,IACV;EAAEL,OAAOK;EAAYN,KAAKM;EAAY,GAGxC;EAAEL,OAAOG;EAAcJ,KAAKM;EAAY"}
package/dist/index3.js CHANGED
@@ -1,5 +1,6 @@
1
- const e = () => typeof navigator > "u" ? !1 : /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
2
- export {
3
- e as isMobileDevice
4
- };
5
- //# sourceMappingURL=index3.js.map
1
+ //#region src/helpers/isMobileDevice.ts
2
+ var e = () => typeof navigator > "u" ? !1 : /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
3
+ //#endregion
4
+ export { e as isMobileDevice };
5
+
6
+ //# sourceMappingURL=index3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index3.js","sources":["../src/helpers/isMobileDevice.ts"],"sourcesContent":["export const isMobileDevice = () => {\n if (typeof navigator === \"undefined\") return false\n return /Android|iPhone|iPad|iPod/i.test(navigator.userAgent)\n}\n"],"names":["isMobileDevice","navigator","test","userAgent"],"mappings":"AAAO,MAAMA,IAAiBA,MACxB,OAAOC,YAAc,MAAoB,KACtC,4BAA4BC,KAAKD,UAAUE,SAAS;"}
1
+ {"version":3,"file":"index3.js","names":["isMobileDevice","navigator","test","userAgent"],"sources":["../src/helpers/isMobileDevice.ts"],"sourcesContent":["export const isMobileDevice = () => {\n if (typeof navigator === \"undefined\") return false\n return /Android|iPhone|iPad|iPod/i.test(navigator.userAgent)\n}\n"],"mappings":";AAAA,IAAaA,UACP,OAAOC,YAAc,MAAoB,KACtC,4BAA4BC,KAAKD,UAAUE,UAAU"}
package/dist/index30.js CHANGED
@@ -1,6 +1,6 @@
1
- import { __require as r } from "./index47.js";
2
- var i = r();
3
- export {
4
- i as j
5
- };
6
- //# sourceMappingURL=index30.js.map
1
+ import "./index24.js";
2
+ import "./index25.js";
3
+ import "./index26.js";
4
+ import "./index27.js";
5
+ import "./index28.js";
6
+ import "./index29.js";