@rpcbase/ui 0.287.0 → 0.289.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 (738) hide show
  1. package/dist/assets/sha256.worker-DNtOSCbM.js.map +1 -0
  2. package/dist/components/FilesUploadField/index.d.ts.map +1 -1
  3. package/dist/index.js +12 -12
  4. package/dist/index10.js.map +1 -1
  5. package/dist/index100.js.map +1 -1
  6. package/dist/index101.js.map +1 -1
  7. package/dist/index102.js.map +1 -1
  8. package/dist/index103.js.map +1 -1
  9. package/dist/index104.js.map +1 -1
  10. package/dist/index105.js.map +1 -1
  11. package/dist/index106.js.map +1 -1
  12. package/dist/index107.js.map +1 -1
  13. package/dist/index108.js.map +1 -1
  14. package/dist/index109.js.map +1 -1
  15. package/dist/index11.js +96 -17
  16. package/dist/index11.js.map +1 -1
  17. package/dist/index110.js.map +1 -1
  18. package/dist/index111.js.map +1 -1
  19. package/dist/index112.js.map +1 -1
  20. package/dist/index113.js.map +1 -1
  21. package/dist/index114.js.map +1 -1
  22. package/dist/index115.js.map +1 -1
  23. package/dist/index116.js.map +1 -1
  24. package/dist/index117.js.map +1 -1
  25. package/dist/index118.js.map +1 -1
  26. package/dist/index119.js.map +1 -1
  27. package/dist/index12.js.map +1 -1
  28. package/dist/index120.js.map +1 -1
  29. package/dist/index121.js.map +1 -1
  30. package/dist/index122.js.map +1 -1
  31. package/dist/index123.js +1 -1
  32. package/dist/index123.js.map +1 -1
  33. package/dist/index124.js.map +1 -1
  34. package/dist/index125.js.map +1 -1
  35. package/dist/index126.js.map +1 -1
  36. package/dist/index127.js.map +1 -1
  37. package/dist/index128.js.map +1 -1
  38. package/dist/index129.js.map +1 -1
  39. package/dist/index13.js.map +1 -1
  40. package/dist/index130.js.map +1 -1
  41. package/dist/index131.js.map +1 -1
  42. package/dist/index132.js.map +1 -1
  43. package/dist/index133.js.map +1 -1
  44. package/dist/index134.js.map +1 -1
  45. package/dist/index135.js.map +1 -1
  46. package/dist/index136.js.map +1 -1
  47. package/dist/index137.js.map +1 -1
  48. package/dist/index138.js.map +1 -1
  49. package/dist/index139.js.map +1 -1
  50. package/dist/index14.js.map +1 -1
  51. package/dist/index140.js.map +1 -1
  52. package/dist/index141.js.map +1 -1
  53. package/dist/index142.js.map +1 -1
  54. package/dist/index143.js.map +1 -1
  55. package/dist/index144.js.map +1 -1
  56. package/dist/index145.js.map +1 -1
  57. package/dist/index146.js.map +1 -1
  58. package/dist/index147.js.map +1 -1
  59. package/dist/index148.js.map +1 -1
  60. package/dist/index149.js.map +1 -1
  61. package/dist/index15.js.map +1 -1
  62. package/dist/index150.js.map +1 -1
  63. package/dist/index151.js.map +1 -1
  64. package/dist/index152.js.map +1 -1
  65. package/dist/index153.js.map +1 -1
  66. package/dist/index154.js +4 -4
  67. package/dist/index154.js.map +1 -1
  68. package/dist/index155.js.map +1 -1
  69. package/dist/index156.js.map +1 -1
  70. package/dist/index157.js.map +1 -1
  71. package/dist/index158.js.map +1 -1
  72. package/dist/index159.js.map +1 -1
  73. package/dist/index16.js.map +1 -1
  74. package/dist/index160.js.map +1 -1
  75. package/dist/index161.js.map +1 -1
  76. package/dist/index162.js.map +1 -1
  77. package/dist/index163.js.map +1 -1
  78. package/dist/index164.js.map +1 -1
  79. package/dist/index165.js.map +1 -1
  80. package/dist/index166.js.map +1 -1
  81. package/dist/index167.js.map +1 -1
  82. package/dist/index168.js.map +1 -1
  83. package/dist/index169.js.map +1 -1
  84. package/dist/index17.js.map +1 -1
  85. package/dist/index170.js +18 -12
  86. package/dist/index170.js.map +1 -1
  87. package/dist/index171.js.map +1 -1
  88. package/dist/index172.js.map +1 -1
  89. package/dist/index173.js.map +1 -1
  90. package/dist/index174.js.map +1 -1
  91. package/dist/index175.js.map +1 -1
  92. package/dist/index176.js.map +1 -1
  93. package/dist/index177.js.map +1 -1
  94. package/dist/index178.js.map +1 -1
  95. package/dist/index179.js.map +1 -1
  96. package/dist/index18.js.map +1 -1
  97. package/dist/index180.js.map +1 -1
  98. package/dist/index181.js +1 -1
  99. package/dist/index181.js.map +1 -1
  100. package/dist/index182.js +3 -3
  101. package/dist/index182.js.map +1 -1
  102. package/dist/index183.js.map +1 -1
  103. package/dist/index184.js.map +1 -1
  104. package/dist/index185.js.map +1 -1
  105. package/dist/index186.js.map +1 -1
  106. package/dist/index187.js.map +1 -1
  107. package/dist/index188.js.map +1 -1
  108. package/dist/index189.js.map +1 -1
  109. package/dist/index19.js.map +1 -1
  110. package/dist/index190.js +9 -7
  111. package/dist/index190.js.map +1 -1
  112. package/dist/index191.js +4 -4
  113. package/dist/index191.js.map +1 -1
  114. package/dist/index192.js +4 -15
  115. package/dist/index192.js.map +1 -1
  116. package/dist/index193.js +13 -3
  117. package/dist/index193.js.map +1 -1
  118. package/dist/index194.js +2 -2
  119. package/dist/index194.js.map +1 -1
  120. package/dist/index195.js +4 -85
  121. package/dist/index195.js.map +1 -1
  122. package/dist/index196.js +79 -54
  123. package/dist/index196.js.map +1 -1
  124. package/dist/index197.js +68 -7
  125. package/dist/index197.js.map +1 -1
  126. package/dist/index198.js +3 -23
  127. package/dist/index198.js.map +1 -1
  128. package/dist/index199.js +6 -28
  129. package/dist/index199.js.map +1 -1
  130. package/dist/index20.js.map +1 -1
  131. package/dist/index200.js +4 -97
  132. package/dist/index200.js.map +1 -1
  133. package/dist/index201.js +3 -4
  134. package/dist/index201.js.map +1 -1
  135. package/dist/index202.js +23 -24
  136. package/dist/index202.js.map +1 -1
  137. package/dist/index203.js +28 -10
  138. package/dist/index203.js.map +1 -1
  139. package/dist/index204.js +97 -4
  140. package/dist/index204.js.map +1 -1
  141. package/dist/index205.js +4 -12
  142. package/dist/index205.js.map +1 -1
  143. package/dist/index206.js +22 -19
  144. package/dist/index206.js.map +1 -1
  145. package/dist/index207.js +4 -6
  146. package/dist/index207.js.map +1 -1
  147. package/dist/index208.js +4 -15
  148. package/dist/index208.js.map +1 -1
  149. package/dist/index209.js +10 -102
  150. package/dist/index209.js.map +1 -1
  151. package/dist/index210.js +21 -3
  152. package/dist/index210.js.map +1 -1
  153. package/dist/index211.js +5 -23
  154. package/dist/index211.js.map +1 -1
  155. package/dist/index212.js +15 -28
  156. package/dist/index212.js.map +1 -1
  157. package/dist/index213.js +101 -17
  158. package/dist/index213.js.map +1 -1
  159. package/dist/index214.js +3 -7
  160. package/dist/index214.js.map +1 -1
  161. package/dist/index215.js +24 -15
  162. package/dist/index215.js.map +1 -1
  163. package/dist/index216.js +27 -7
  164. package/dist/index216.js.map +1 -1
  165. package/dist/index217.js +17 -24
  166. package/dist/index217.js.map +1 -1
  167. package/dist/index218.js +6 -22
  168. package/dist/index218.js.map +1 -1
  169. package/dist/index219.js +15 -6
  170. package/dist/index219.js.map +1 -1
  171. package/dist/index220.js +8 -5
  172. package/dist/index220.js.map +1 -1
  173. package/dist/index221.js +27 -4
  174. package/dist/index221.js.map +1 -1
  175. package/dist/index222.js +23 -4
  176. package/dist/index222.js.map +1 -1
  177. package/dist/index223.js +6 -24
  178. package/dist/index223.js.map +1 -1
  179. package/dist/index224.js +5 -3
  180. package/dist/index224.js.map +1 -1
  181. package/dist/index225.js +4 -24
  182. package/dist/index225.js.map +1 -1
  183. package/dist/index226.js +4 -23
  184. package/dist/index226.js.map +1 -1
  185. package/dist/index227.js +23 -6
  186. package/dist/index227.js.map +1 -1
  187. package/dist/index228.js +22 -8
  188. package/dist/index228.js.map +1 -1
  189. package/dist/index229.js +3 -19
  190. package/dist/index229.js.map +1 -1
  191. package/dist/index23.js.map +1 -1
  192. package/dist/index230.js +22 -50
  193. package/dist/index230.js.map +1 -1
  194. package/dist/index231.js +7 -20
  195. package/dist/index231.js.map +1 -1
  196. package/dist/index232.js +9 -27
  197. package/dist/index232.js.map +1 -1
  198. package/dist/index233.js +17 -97
  199. package/dist/index233.js.map +1 -1
  200. package/dist/index234.js +50 -33
  201. package/dist/index234.js.map +1 -1
  202. package/dist/index235.js +20 -119
  203. package/dist/index235.js.map +1 -1
  204. package/dist/index236.js +28 -13
  205. package/dist/index236.js.map +1 -1
  206. package/dist/index237.js +98 -4
  207. package/dist/index237.js.map +1 -1
  208. package/dist/index238.js +33 -15
  209. package/dist/index238.js.map +1 -1
  210. package/dist/index239.js +116 -62
  211. package/dist/index239.js.map +1 -1
  212. package/dist/index24.js.map +1 -1
  213. package/dist/index240.js +13 -10
  214. package/dist/index240.js.map +1 -1
  215. package/dist/index241.js +4 -109
  216. package/dist/index241.js.map +1 -1
  217. package/dist/index242.js +14 -14
  218. package/dist/index242.js.map +1 -1
  219. package/dist/index243.js +64 -12
  220. package/dist/index243.js.map +1 -1
  221. package/dist/index244.js +10 -5
  222. package/dist/index244.js.map +1 -1
  223. package/dist/index245.js +104 -318
  224. package/dist/index245.js.map +1 -1
  225. package/dist/index246.js +14 -66
  226. package/dist/index246.js.map +1 -1
  227. package/dist/index247.js +12 -232
  228. package/dist/index247.js.map +1 -1
  229. package/dist/index248.js +4 -270
  230. package/dist/index248.js.map +1 -1
  231. package/dist/index249.js +313 -309
  232. package/dist/index249.js.map +1 -1
  233. package/dist/index25.js.map +1 -1
  234. package/dist/index250.js +60 -171
  235. package/dist/index250.js.map +1 -1
  236. package/dist/index251.js +252 -8
  237. package/dist/index251.js.map +1 -1
  238. package/dist/index252.js +268 -41
  239. package/dist/index252.js.map +1 -1
  240. package/dist/index253.js +316 -47
  241. package/dist/index253.js.map +1 -1
  242. package/dist/index254.js +179 -9
  243. package/dist/index254.js.map +1 -1
  244. package/dist/index255.js +6 -50
  245. package/dist/index255.js.map +1 -1
  246. package/dist/index256.js +41 -51
  247. package/dist/index256.js.map +1 -1
  248. package/dist/index257.js +50 -7
  249. package/dist/index257.js.map +1 -1
  250. package/dist/index258.js +9 -10
  251. package/dist/index258.js.map +1 -1
  252. package/dist/index259.js +51 -61
  253. package/dist/index259.js.map +1 -1
  254. package/dist/index26.js.map +1 -1
  255. package/dist/index260.js +53 -42
  256. package/dist/index260.js.map +1 -1
  257. package/dist/index261.js +9 -97
  258. package/dist/index261.js.map +1 -1
  259. package/dist/index262.js +31 -47
  260. package/dist/index262.js.map +1 -1
  261. package/dist/index263.js +61 -36
  262. package/dist/index263.js.map +1 -1
  263. package/dist/index264.js +43 -47
  264. package/dist/index264.js.map +1 -1
  265. package/dist/index265.js +92 -46
  266. package/dist/index265.js.map +1 -1
  267. package/dist/index266.js +48 -20
  268. package/dist/index266.js.map +1 -1
  269. package/dist/index267.js +33 -176
  270. package/dist/index267.js.map +1 -1
  271. package/dist/index268.js +49 -48
  272. package/dist/index268.js.map +1 -1
  273. package/dist/index269.js +68 -15
  274. package/dist/index269.js.map +1 -1
  275. package/dist/index27.js.map +1 -1
  276. package/dist/index270.js +20 -65
  277. package/dist/index270.js.map +1 -1
  278. package/dist/index271.js +202 -9
  279. package/dist/index271.js.map +1 -1
  280. package/dist/index272.js +48 -40
  281. package/dist/index272.js.map +1 -1
  282. package/dist/index273.js +60 -91
  283. package/dist/index273.js.map +1 -1
  284. package/dist/index274.js +9 -278
  285. package/dist/index274.js.map +1 -1
  286. package/dist/index275.js +38 -55
  287. package/dist/index275.js.map +1 -1
  288. package/dist/index276.js +91 -10
  289. package/dist/index276.js.map +1 -1
  290. package/dist/index277.js +278 -12
  291. package/dist/index277.js.map +1 -1
  292. package/dist/index278.js +58 -11
  293. package/dist/index278.js.map +1 -1
  294. package/dist/index279.js +11 -64
  295. package/dist/index279.js.map +1 -1
  296. package/dist/index28.js +5 -5
  297. package/dist/index28.js.map +1 -1
  298. package/dist/index280.js +12 -6
  299. package/dist/index280.js.map +1 -1
  300. package/dist/index281.js +3 -25
  301. package/dist/index281.js.map +1 -1
  302. package/dist/index282.js +3 -25
  303. package/dist/index282.js.map +1 -1
  304. package/dist/index283.js +12 -126
  305. package/dist/index283.js.map +1 -1
  306. package/dist/index284.js +63 -51
  307. package/dist/index284.js.map +1 -1
  308. package/dist/index285.js +5 -60
  309. package/dist/index285.js.map +1 -1
  310. package/dist/index286.js +24 -48
  311. package/dist/index286.js.map +1 -1
  312. package/dist/index287.js +24 -6
  313. package/dist/index287.js.map +1 -1
  314. package/dist/index288.js +125 -14
  315. package/dist/index288.js.map +1 -1
  316. package/dist/index289.js +51 -16
  317. package/dist/index289.js.map +1 -1
  318. package/dist/index29.js +5 -7
  319. package/dist/index29.js.map +1 -1
  320. package/dist/index290.js +56 -11
  321. package/dist/index290.js.map +1 -1
  322. package/dist/index291.js +47 -24
  323. package/dist/index291.js.map +1 -1
  324. package/dist/index292.js +7 -51
  325. package/dist/index292.js.map +1 -1
  326. package/dist/index293.js +15 -6
  327. package/dist/index293.js.map +1 -1
  328. package/dist/index294.js +18 -148
  329. package/dist/index294.js.map +1 -1
  330. package/dist/index295.js +12 -59
  331. package/dist/index295.js.map +1 -1
  332. package/dist/index296.js +25 -120
  333. package/dist/index296.js.map +1 -1
  334. package/dist/index297.js +54 -15
  335. package/dist/index297.js.map +1 -1
  336. package/dist/index298.js +5 -866
  337. package/dist/index298.js.map +1 -1
  338. package/dist/index299.js +148 -28
  339. package/dist/index299.js.map +1 -1
  340. package/dist/index3.js.map +1 -1
  341. package/dist/index30.js +6 -8
  342. package/dist/index30.js.map +1 -1
  343. package/dist/index300.js +55 -512
  344. package/dist/index300.js.map +1 -1
  345. package/dist/index301.js +111 -794
  346. package/dist/index301.js.map +1 -1
  347. package/dist/index302.js +14 -7436
  348. package/dist/index302.js.map +1 -1
  349. package/dist/index303.js +862 -6
  350. package/dist/index303.js.map +1 -1
  351. package/dist/index304.js +28 -12
  352. package/dist/index304.js.map +1 -1
  353. package/dist/index305.js +515 -5
  354. package/dist/index305.js.map +1 -1
  355. package/dist/index306.js +803 -5
  356. package/dist/index306.js.map +1 -1
  357. package/dist/index307.js +7426 -468
  358. package/dist/index307.js.map +1 -1
  359. package/dist/index308.js +6 -37
  360. package/dist/index308.js.map +1 -1
  361. package/dist/index309.js +12 -19
  362. package/dist/index309.js.map +1 -1
  363. package/dist/index31.js +5 -11
  364. package/dist/index31.js.map +1 -1
  365. package/dist/index310.js +5 -30
  366. package/dist/index310.js.map +1 -1
  367. package/dist/index311.js +5 -4
  368. package/dist/index311.js.map +1 -1
  369. package/dist/index312.js +461 -51
  370. package/dist/index312.js.map +1 -1
  371. package/dist/index313.js +36 -10
  372. package/dist/index313.js.map +1 -1
  373. package/dist/index314.js +19 -5
  374. package/dist/index314.js.map +1 -1
  375. package/dist/index315.js +29 -8
  376. package/dist/index315.js.map +1 -1
  377. package/dist/index316.js +4 -12
  378. package/dist/index316.js.map +1 -1
  379. package/dist/index317.js +60 -3
  380. package/dist/index317.js.map +1 -1
  381. package/dist/index318.js +10 -15
  382. package/dist/index318.js.map +1 -1
  383. package/dist/index319.js +5 -25
  384. package/dist/index319.js.map +1 -1
  385. package/dist/index32.js +5 -5
  386. package/dist/index32.js.map +1 -1
  387. package/dist/index320.js +9 -41
  388. package/dist/index320.js.map +1 -1
  389. package/dist/index321.js +11 -4
  390. package/dist/index321.js.map +1 -1
  391. package/dist/index322.js +3 -26
  392. package/dist/index322.js.map +1 -1
  393. package/dist/index323.js +15 -18
  394. package/dist/index323.js.map +1 -1
  395. package/dist/index324.js +22 -31
  396. package/dist/index324.js.map +1 -1
  397. package/dist/index325.js +41 -5
  398. package/dist/index325.js.map +1 -1
  399. package/dist/index326.js +4 -8
  400. package/dist/index326.js.map +1 -1
  401. package/dist/index327.js +25 -8
  402. package/dist/index327.js.map +1 -1
  403. package/dist/index328.js +19 -9
  404. package/dist/index328.js.map +1 -1
  405. package/dist/index329.js +34 -10
  406. package/dist/index329.js.map +1 -1
  407. package/dist/index33.js +9 -6
  408. package/dist/index33.js.map +1 -1
  409. package/dist/index330.js +5 -7
  410. package/dist/index330.js.map +1 -1
  411. package/dist/index331.js +9 -75
  412. package/dist/index331.js.map +1 -1
  413. package/dist/index332.js +8 -162
  414. package/dist/index332.js.map +1 -1
  415. package/dist/index333.js +9 -114
  416. package/dist/index333.js.map +1 -1
  417. package/dist/index334.js +10 -14
  418. package/dist/index334.js.map +1 -1
  419. package/dist/index335.js +7 -80
  420. package/dist/index335.js.map +1 -1
  421. package/dist/index336.js +68 -39
  422. package/dist/index336.js.map +1 -1
  423. package/dist/index337.js +160 -11
  424. package/dist/index337.js.map +1 -1
  425. package/dist/index338.js +113 -15
  426. package/dist/index338.js.map +1 -1
  427. package/dist/index339.js +13 -100
  428. package/dist/index339.js.map +1 -1
  429. package/dist/index34.js +6 -6
  430. package/dist/index34.js.map +1 -1
  431. package/dist/index340.js +73 -49
  432. package/dist/index340.js.map +1 -1
  433. package/dist/index341.js +34 -96
  434. package/dist/index341.js.map +1 -1
  435. package/dist/index342.js +12 -70
  436. package/dist/index342.js.map +1 -1
  437. package/dist/index343.js +14 -111
  438. package/dist/index343.js.map +1 -1
  439. package/dist/index344.js +94 -48
  440. package/dist/index344.js.map +1 -1
  441. package/dist/index345.js +50 -37
  442. package/dist/index345.js.map +1 -1
  443. package/dist/index346.js +89 -125
  444. package/dist/index346.js.map +1 -1
  445. package/dist/index347.js +52 -123
  446. package/dist/index347.js.map +1 -1
  447. package/dist/index348.js +54 -197
  448. package/dist/index348.js.map +1 -1
  449. package/dist/index349.js +44 -229
  450. package/dist/index349.js.map +1 -1
  451. package/dist/index35.js +9 -9
  452. package/dist/index35.js.map +1 -1
  453. package/dist/index350.js +42 -308
  454. package/dist/index350.js.map +1 -1
  455. package/dist/index351.js +144 -5
  456. package/dist/index351.js.map +1 -1
  457. package/dist/index352.js +142 -6
  458. package/dist/index352.js.map +1 -1
  459. package/dist/index353.js +257 -7
  460. package/dist/index353.js.map +1 -1
  461. package/dist/index354.js +241 -6
  462. package/dist/index354.js.map +1 -1
  463. package/dist/index355.js +309 -6
  464. package/dist/index355.js.map +1 -1
  465. package/dist/index356.js +5 -21
  466. package/dist/index356.js.map +1 -1
  467. package/dist/index357.js +6 -10
  468. package/dist/index357.js.map +1 -1
  469. package/dist/index358.js +7 -128
  470. package/dist/index358.js.map +1 -1
  471. package/dist/index359.js +6 -42
  472. package/dist/index359.js.map +1 -1
  473. package/dist/index36.js +12 -7
  474. package/dist/index36.js.map +1 -1
  475. package/dist/index360.js +6 -68
  476. package/dist/index360.js.map +1 -1
  477. package/dist/index361.js +20 -116
  478. package/dist/index361.js.map +1 -1
  479. package/dist/index362.js +10 -490
  480. package/dist/index362.js.map +1 -1
  481. package/dist/index363.js +128 -7
  482. package/dist/index363.js.map +1 -1
  483. package/dist/index364.js +42 -13
  484. package/dist/index364.js.map +1 -1
  485. package/dist/index365.js +67 -3
  486. package/dist/index365.js.map +1 -1
  487. package/dist/index366.js +115 -45
  488. package/dist/index366.js.map +1 -1
  489. package/dist/index367.js +490 -11
  490. package/dist/index367.js.map +1 -1
  491. package/dist/index368.js +8 -26
  492. package/dist/index368.js.map +1 -1
  493. package/dist/index369.js +12 -41
  494. package/dist/index369.js.map +1 -1
  495. package/dist/index37.js +13 -5
  496. package/dist/index37.js.map +1 -1
  497. package/dist/index370.js +4 -36
  498. package/dist/index370.js.map +1 -1
  499. package/dist/index371.js +45 -15
  500. package/dist/index371.js.map +1 -1
  501. package/dist/index372.js +24 -41
  502. package/dist/index372.js.map +1 -1
  503. package/dist/index373.js +3 -12
  504. package/dist/index373.js.map +1 -1
  505. package/dist/index374.js +27 -11
  506. package/dist/index374.js.map +1 -1
  507. package/dist/index375.js +40 -50
  508. package/dist/index375.js.map +1 -1
  509. package/dist/index376.js +37 -40
  510. package/dist/index376.js.map +1 -1
  511. package/dist/index377.js +12 -10
  512. package/dist/index377.js.map +1 -1
  513. package/dist/index378.js +40 -4
  514. package/dist/index378.js.map +1 -1
  515. package/dist/index379.js +7 -4
  516. package/dist/index379.js.map +1 -1
  517. package/dist/index38.js +5 -5
  518. package/dist/index38.js.map +1 -1
  519. package/dist/index380.js +29 -8
  520. package/dist/index380.js.map +1 -1
  521. package/dist/index381.js +9 -303
  522. package/dist/index381.js.map +1 -1
  523. package/dist/index382.js +57 -4
  524. package/dist/index382.js.map +1 -1
  525. package/dist/index383.js +40 -22
  526. package/dist/index383.js.map +1 -1
  527. package/dist/index384.js +15 -105
  528. package/dist/index384.js.map +1 -1
  529. package/dist/index385.js +5 -22
  530. package/dist/index385.js.map +1 -1
  531. package/dist/index386.js +10 -22
  532. package/dist/index386.js.map +1 -1
  533. package/dist/index387.js +289 -16
  534. package/dist/index387.js.map +1 -1
  535. package/dist/index388.js +4 -12
  536. package/dist/index388.js.map +1 -1
  537. package/dist/index389.js +20 -112
  538. package/dist/index389.js.map +1 -1
  539. package/dist/index39.js +6 -10
  540. package/dist/index39.js.map +1 -1
  541. package/dist/index390.js +3 -9
  542. package/dist/index390.js.map +1 -1
  543. package/dist/index391.js +104 -27
  544. package/dist/index391.js.map +1 -1
  545. package/dist/index392.js +20 -9
  546. package/dist/index392.js.map +1 -1
  547. package/dist/index393.js +20 -6
  548. package/dist/index393.js.map +1 -1
  549. package/dist/index394.js +14 -253
  550. package/dist/index394.js.map +1 -1
  551. package/dist/index395.js +12 -10
  552. package/dist/index395.js.map +1 -1
  553. package/dist/index396.js +117 -11
  554. package/dist/index396.js.map +1 -1
  555. package/dist/index397.js +8 -6
  556. package/dist/index397.js.map +1 -1
  557. package/dist/index398.js +32 -22
  558. package/dist/index398.js.map +1 -1
  559. package/dist/index399.js +9 -23
  560. package/dist/index399.js.map +1 -1
  561. package/dist/index4.js.map +1 -1
  562. package/dist/index40.js +8 -11
  563. package/dist/index40.js.map +1 -1
  564. package/dist/index400.js +6 -105
  565. package/dist/index400.js.map +1 -1
  566. package/dist/index401.js +3 -15
  567. package/dist/index401.js.map +1 -1
  568. package/dist/index402.js +251 -10
  569. package/dist/index402.js.map +1 -1
  570. package/dist/index403.js +9 -7
  571. package/dist/index403.js.map +1 -1
  572. package/dist/index404.js +11 -239
  573. package/dist/index404.js.map +1 -1
  574. package/dist/index405.js +7 -28
  575. package/dist/index405.js.map +1 -1
  576. package/dist/index406.js +21 -37
  577. package/dist/index406.js.map +1 -1
  578. package/dist/index407.js +21 -10
  579. package/dist/index407.js.map +1 -1
  580. package/dist/index408.js +97 -117
  581. package/dist/index408.js.map +1 -1
  582. package/dist/index409.js +15 -40
  583. package/dist/index409.js.map +1 -1
  584. package/dist/index41.js +6 -7
  585. package/dist/index41.js.map +1 -1
  586. package/dist/index410.js +11 -25
  587. package/dist/index410.js.map +1 -1
  588. package/dist/index411.js +7 -9
  589. package/dist/index411.js.map +1 -1
  590. package/dist/index412.js +3 -24
  591. package/dist/index412.js.map +1 -1
  592. package/dist/index413.js +226 -15
  593. package/dist/index413.js.map +1 -1
  594. package/dist/index414.js +24 -11
  595. package/dist/index414.js.map +1 -1
  596. package/dist/index415.js +38 -4
  597. package/dist/index415.js.map +1 -1
  598. package/dist/index416.js +11 -324
  599. package/dist/index416.js.map +1 -1
  600. package/dist/index417.js +119 -62
  601. package/dist/index417.js.map +1 -1
  602. package/dist/index418.js +42 -4
  603. package/dist/index418.js.map +1 -1
  604. package/dist/index419.js +25 -28
  605. package/dist/index419.js.map +1 -1
  606. package/dist/index42.js +6 -4
  607. package/dist/index42.js.map +1 -1
  608. package/dist/index420.js +11 -470
  609. package/dist/index420.js.map +1 -1
  610. package/dist/index421.js +23 -268
  611. package/dist/index421.js.map +1 -1
  612. package/dist/index422.js +24 -0
  613. package/dist/index422.js.map +1 -0
  614. package/dist/index423.js +17 -0
  615. package/dist/index423.js.map +1 -0
  616. package/dist/index424.js +8 -0
  617. package/dist/index424.js.map +1 -0
  618. package/dist/index425.js +328 -0
  619. package/dist/index425.js.map +1 -0
  620. package/dist/index426.js +66 -0
  621. package/dist/index426.js.map +1 -0
  622. package/dist/index427.js +7 -0
  623. package/dist/index427.js.map +1 -0
  624. package/dist/index428.js +31 -0
  625. package/dist/index428.js.map +1 -0
  626. package/dist/index429.js +474 -0
  627. package/dist/index429.js.map +1 -0
  628. package/dist/index43.js +68 -7
  629. package/dist/index43.js.map +1 -1
  630. package/dist/index430.js +272 -0
  631. package/dist/index430.js.map +1 -0
  632. package/dist/index44.js +7 -6
  633. package/dist/index44.js.map +1 -1
  634. package/dist/index45.js +31 -7
  635. package/dist/index45.js.map +1 -1
  636. package/dist/index46.js +10 -10
  637. package/dist/index46.js.map +1 -1
  638. package/dist/index47.js +15 -13
  639. package/dist/index47.js.map +1 -1
  640. package/dist/index48.js +201 -7
  641. package/dist/index48.js.map +1 -1
  642. package/dist/index49.js +20 -6
  643. package/dist/index49.js.map +1 -1
  644. package/dist/index5.js.map +1 -1
  645. package/dist/index50.js +16 -6
  646. package/dist/index50.js.map +1 -1
  647. package/dist/index51.js +123 -14
  648. package/dist/index51.js.map +1 -1
  649. package/dist/index52.js +19 -8
  650. package/dist/index52.js.map +1 -1
  651. package/dist/index53.js +5 -7
  652. package/dist/index53.js.map +1 -1
  653. package/dist/index54.js +9 -68
  654. package/dist/index54.js.map +1 -1
  655. package/dist/index55.js +7 -7
  656. package/dist/index55.js.map +1 -1
  657. package/dist/index56.js +9 -31
  658. package/dist/index56.js.map +1 -1
  659. package/dist/index57.js +13 -10
  660. package/dist/index57.js.map +1 -1
  661. package/dist/index58.js +8 -15
  662. package/dist/index58.js.map +1 -1
  663. package/dist/index59.js +10 -201
  664. package/dist/index59.js.map +1 -1
  665. package/dist/index6.js.map +1 -1
  666. package/dist/index60.js +13 -20
  667. package/dist/index60.js.map +1 -1
  668. package/dist/index61.js +9 -16
  669. package/dist/index61.js.map +1 -1
  670. package/dist/index62.js +10 -123
  671. package/dist/index62.js.map +1 -1
  672. package/dist/index63.js +5 -19
  673. package/dist/index63.js.map +1 -1
  674. package/dist/index64.js +42 -9
  675. package/dist/index64.js.map +1 -1
  676. package/dist/index65.js +387 -9
  677. package/dist/index65.js.map +1 -1
  678. package/dist/index66.js +37 -14
  679. package/dist/index66.js.map +1 -1
  680. package/dist/index67.js +21 -9
  681. package/dist/index67.js.map +1 -1
  682. package/dist/index68.js +4 -9
  683. package/dist/index68.js.map +1 -1
  684. package/dist/index69.js +6 -4
  685. package/dist/index69.js.map +1 -1
  686. package/dist/index7.js +3 -3
  687. package/dist/index7.js.map +1 -1
  688. package/dist/index70.js +57 -41
  689. package/dist/index70.js.map +1 -1
  690. package/dist/index71.js +5 -387
  691. package/dist/index71.js.map +1 -1
  692. package/dist/index72.js +6 -37
  693. package/dist/index72.js.map +1 -1
  694. package/dist/index73.js +5 -21
  695. package/dist/index73.js.map +1 -1
  696. package/dist/index74.js +4 -56
  697. package/dist/index74.js.map +1 -1
  698. package/dist/index75.js +7 -7
  699. package/dist/index75.js.map +1 -1
  700. package/dist/index76.js +6 -5
  701. package/dist/index76.js.map +1 -1
  702. package/dist/index77.js +6 -5
  703. package/dist/index77.js.map +1 -1
  704. package/dist/index78.js +11 -5
  705. package/dist/index78.js.map +1 -1
  706. package/dist/index79.js +11 -5
  707. package/dist/index79.js.map +1 -1
  708. package/dist/index8.js.map +1 -1
  709. package/dist/index80.js +7 -6
  710. package/dist/index80.js.map +1 -1
  711. package/dist/index81.js +10 -6
  712. package/dist/index81.js.map +1 -1
  713. package/dist/index82.js +5 -8
  714. package/dist/index82.js.map +1 -1
  715. package/dist/index83.js +6 -7
  716. package/dist/index83.js.map +1 -1
  717. package/dist/index84.js.map +1 -1
  718. package/dist/index85.js.map +1 -1
  719. package/dist/index86.js.map +1 -1
  720. package/dist/index87.js +2 -2
  721. package/dist/index87.js.map +1 -1
  722. package/dist/index88.js +31 -31
  723. package/dist/index88.js.map +1 -1
  724. package/dist/index89.js +1 -1
  725. package/dist/index89.js.map +1 -1
  726. package/dist/index9.js.map +1 -1
  727. package/dist/index90.js.map +1 -1
  728. package/dist/index91.js.map +1 -1
  729. package/dist/index92.js.map +1 -1
  730. package/dist/index93.js.map +1 -1
  731. package/dist/index94.js.map +1 -1
  732. package/dist/index95.js.map +1 -1
  733. package/dist/index96.js.map +1 -1
  734. package/dist/index97.js.map +1 -1
  735. package/dist/index98.js.map +1 -1
  736. package/dist/index99.js.map +1 -1
  737. package/package.json +13 -13
  738. package/dist/assets/sha256.worker-BEf4_Y9w.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index362.js","names":[],"sources":["../src/components/PhoneNumberInput/index.tsx"],"sourcesContent":["import * as React from \"react\"\nimport type { CountryCode } from \"libphonenumber-js\"\nimport { getCountryCallingCode } from \"libphonenumber-js\"\nimport Select, {\n type Props as SelectProps,\n type SingleValue,\n type StylesConfig,\n} from \"react-select\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport type {\n CountryOption,\n PhoneNumberChangeDetails,\n PhoneNumberInputProps,\n PhoneNumberSelectedCountry,\n} from \"./types\"\nimport { resolveMessages } from \"./messages\"\nimport {\n COMMON_IDD_PREFIXES,\n DEFAULT_COUNTRY,\n buildFallbackSelectedCountry,\n getCachedCountryOptions,\n getLocaleCacheKey,\n getValidCountry,\n normalizeSearchValue,\n optionMatchIndex,\n parseLocaleCacheKey,\n toSelectedCountry,\n} from \"./country-options\"\nimport {\n formatWithAsYouType,\n getLengthIssue,\n sanitizeDigits,\n stripPrefix,\n type LengthIssue,\n} from \"./normalization\"\nimport {\n captureSelectionSnapshot,\n resolveSelection,\n skipFormattingCharactersLeft,\n skipFormattingCharactersRight,\n} from \"./selection\"\nimport {\n HiddenControl,\n NullComponent,\n SuggestionContext,\n SuggestionOption,\n formatCountryOption,\n suggestionSelectStyles,\n type SuggestionContextValue,\n} from \"./suggestions\"\n\n\nexport type {\n CountryOption,\n PhoneNumberChangeDetails,\n PhoneNumberInputMessages,\n PhoneNumberInputProps,\n PhoneNumberInputValidationCode,\n PhoneNumberSelectedCountry,\n} from \"./types\"\n\nconst INVISIBLE_FORMATTING_CHARACTERS =\n /[\\u061C\\u200B-\\u200F\\u202A-\\u202E\\u2066-\\u2069\\uFEFF]/g\n\ntype ParsedInput = Omit<PhoneNumberChangeDetails, \"selectedCountry\"> & {\n displayValue: string\n lengthIssue: LengthIssue | null\n}\n\nfunction stripInvisibleFormatting(value: string) {\n return value.replace(INVISIBLE_FORMATTING_CHARACTERS, \"\")\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\nfunction normalizeImplicitInternationalInput(digits: string) {\n const candidate = `+${digits}`\n const { phoneNumber, detectedCountry } = formatWithAsYouType(candidate)\n\n if (phoneNumber?.isValid() && detectedCountry) {\n return candidate\n }\n\n return null\n}\n\nfunction normalizeExplicitInternationalInput(value: string) {\n const cleaned = stripInvisibleFormatting(value).trim()\n if (!cleaned) {\n return null\n }\n\n if (cleaned.startsWith(\"+\")) {\n const digits = sanitizeDigits(cleaned)\n if (!digits) {\n return \"+\"\n }\n\n const digitsWithoutIdd = stripIddPrefix(digits)\n return digitsWithoutIdd ? `+${digitsWithoutIdd}` : \"+\"\n }\n\n const digits = sanitizeDigits(cleaned)\n if (!digits) {\n return null\n }\n\n const digitsWithoutIdd = stripIddPrefix(digits)\n if (digitsWithoutIdd !== digits) {\n return digitsWithoutIdd ? `+${digitsWithoutIdd}` : \"+\"\n }\n\n return null\n}\n\nfunction normalizeInternationalInput(value: string) {\n const explicitInternational = normalizeExplicitInternationalInput(value)\n if (explicitInternational != null) {\n return explicitInternational\n }\n\n const cleaned = stripInvisibleFormatting(value).trim()\n const digits = sanitizeDigits(cleaned)\n if (!digits) {\n return null\n }\n\n return normalizeImplicitInternationalInput(digits)\n}\n\nfunction getDialCode(country: CountryCode | null, parsedDialCode: string | undefined) {\n if (parsedDialCode) {\n return parsedDialCode\n }\n return country ? getCountryCallingCode(country) : null\n}\n\nfunction getInputValueForSelectedCountry(\n value: string,\n option: Pick<CountryOption, \"dialCode\" | \"value\">,\n options?: { allowImplicitInternational?: boolean }\n) {\n const cleaned = stripInvisibleFormatting(value).trim()\n const digits = sanitizeDigits(cleaned)\n\n if (!digits) {\n return `+${option.dialCode}`\n }\n\n const normalizedInternational =\n options?.allowImplicitInternational === false\n ? normalizeExplicitInternationalInput(cleaned)\n : normalizeInternationalInput(cleaned)\n if (normalizedInternational) {\n const normalizedDigits = sanitizeDigits(normalizedInternational)\n if (normalizedDigits.startsWith(option.dialCode)) {\n return normalizedInternational\n }\n\n const { phoneNumber } = formatWithAsYouType(normalizedInternational)\n const currentDialCode = phoneNumber?.countryCallingCode\n const nationalDigits =\n currentDialCode && normalizedDigits.startsWith(currentDialCode)\n ? normalizedDigits.slice(currentDialCode.length)\n : phoneNumber?.nationalNumber ?? normalizedDigits\n\n return `+${option.dialCode}${nationalDigits}`\n }\n\n const { phoneNumber } = formatWithAsYouType(cleaned, option.value)\n return `+${option.dialCode}${phoneNumber?.nationalNumber ?? digits}`\n}\n\nfunction preferSelectedCountry(\n parsed: ParsedInput,\n option: Pick<CountryOption, \"dialCode\" | \"value\">\n): ParsedInput {\n return {\n ...parsed,\n country: option.value,\n countryCallingCode: option.dialCode,\n lengthIssue: getLengthIssue(parsed.rawInput, option.value),\n }\n}\n\nfunction parsePhoneInput(rawValue: string | undefined, baseCountry?: CountryCode): ParsedInput {\n const cleaned = stripInvisibleFormatting(rawValue ?? \"\").trim()\n\n if (!cleaned) {\n const country = baseCountry ?? null\n const countryCallingCode = country ? getCountryCallingCode(country) : null\n\n return {\n displayValue: \"\",\n formattedInternational: \"\",\n formattedNational: \"\",\n e164: null,\n country,\n countryCallingCode,\n nationalNumber: \"\",\n rawInput: \"\",\n isValid: false,\n lengthIssue: null,\n }\n }\n\n const normalizedInternational = normalizeInternationalInput(cleaned)\n const shouldFormat = normalizedInternational != null || baseCountry != null\n\n if (!shouldFormat) {\n return {\n displayValue: cleaned,\n formattedInternational: cleaned,\n formattedNational: cleaned,\n e164: null,\n country: null,\n countryCallingCode: null,\n nationalNumber: sanitizeDigits(cleaned),\n rawInput: cleaned,\n isValid: false,\n lengthIssue: null,\n }\n }\n\n const normalized = normalizedInternational ?? cleaned\n const {\n international,\n national,\n formatted,\n phoneNumber,\n detectedCountry,\n } = formatWithAsYouType(normalized, baseCountry)\n const hasInternationalPrefix = normalizedInternational != null\n const country = hasInternationalPrefix\n ? detectedCountry ?? baseCountry ?? null\n : baseCountry ?? detectedCountry ?? null\n const countryCallingCode = getDialCode(country, phoneNumber?.countryCallingCode)\n const normalizedDigits = sanitizeDigits(normalized)\n const nationalNumber =\n phoneNumber?.nationalNumber ??\n (countryCallingCode && normalized.startsWith(\"+\")\n ? stripPrefix(normalizedDigits, countryCallingCode)\n : sanitizeDigits(cleaned))\n const displayValue = hasInternationalPrefix ? international : formatted\n\n return {\n displayValue,\n formattedInternational: phoneNumber?.formatInternational() ?? international,\n formattedNational: phoneNumber?.formatNational() ?? national,\n e164: phoneNumber?.number ?? null,\n country,\n countryCallingCode,\n nationalNumber,\n rawInput: normalized,\n isValid: phoneNumber?.isValid() ?? false,\n lengthIssue: country ? getLengthIssue(normalized, country) : null,\n }\n}\n\nexport const PhoneNumberInput = React.forwardRef<HTMLInputElement, PhoneNumberInputProps>(\n function PhoneNumberInput(props, forwardedRef) {\n const {\n value,\n defaultCountry,\n country: countryProp,\n locale,\n onChange,\n onCountryChange,\n className,\n inputClassName,\n disabled,\n readOnly,\n selectProps,\n autofillShimName,\n messages: messagesProp,\n renderValidationMessage,\n ...restProps\n } = props\n\n const {\n onFocus: onInputFocus,\n onBlur: onInputBlur,\n onKeyDown: onInputKeyDown,\n name: inputName,\n autoComplete: inputAutoComplete,\n ...restInputProps\n } = restProps\n\n const controlledCountry = typeof countryProp === \"string\" ? countryProp : null\n const localeCacheKey = getLocaleCacheKey(locale)\n const localeForBuild = React.useMemo(\n () => parseLocaleCacheKey(localeCacheKey),\n [localeCacheKey]\n )\n const resolvedMessages = React.useMemo(\n () => resolveMessages(localeForBuild, messagesProp),\n [localeForBuild, messagesProp]\n )\n const countryOptions = React.useMemo(\n () => getCachedCountryOptions(localeForBuild, localeCacheKey),\n [localeCacheKey, localeForBuild]\n )\n const resolveSelectedCountry = React.useCallback(\n (country: CountryCode): PhoneNumberSelectedCountry => {\n const match = countryOptions.find((candidate) => candidate.value === country)\n if (match) {\n return toSelectedCountry(match)\n }\n return buildFallbackSelectedCountry(country)\n },\n [countryOptions]\n )\n const menuPriorityCountry = React.useMemo(() => {\n const candidate = getValidCountry(defaultCountry ?? countryProp ?? DEFAULT_COUNTRY)\n if (countryOptions.some((option) => option.value === candidate)) {\n return candidate\n }\n return countryOptions[0]?.value ?? DEFAULT_COUNTRY\n }, [countryOptions, countryProp, defaultCountry])\n\n const initialStateRef = React.useRef<ParsedInput | null>(null)\n\n if (!initialStateRef.current) {\n const initialState = parsePhoneInput(value, controlledCountry ?? undefined)\n initialStateRef.current = initialState\n }\n\n const initialState = initialStateRef.current\n\n const [uncontrolledCountry, setUncontrolledCountry] = React.useState<CountryCode | null>(\n controlledCountry ? null : initialState.country\n )\n const [inputValueState, setInputValueState] = React.useState(initialState.displayValue)\n const [countryQuery, setCountryQuery] = React.useState(\"\")\n const [showSuggestions, setShowSuggestions] = React.useState(false)\n const [highlightedIndex, setHighlightedIndex] = React.useState<number>(-1)\n const [isFocused, setIsFocused] = React.useState(false)\n const [shouldRenderSelect, setShouldRenderSelect] = React.useState(false)\n const [lengthIssue, setLengthIssue] = React.useState<LengthIssue | null>(\n initialState.lengthIssue\n )\n\n const manualSelectionCountryRef = React.useRef<CountryCode | null>(null)\n const keyboardBufferRef = React.useRef(\"\")\n const bufferTimeoutRef = React.useRef<number | null>(null)\n const scrollBehaviorRef = React.useRef<ScrollBehavior>(\"smooth\")\n const pendingSelectionRef = React.useRef<{ start: number; end: number } | null>(null)\n const hasNotifiedCountryRef = React.useRef(false)\n const lastNotifiedCountryRef = React.useRef<CountryCode | null>(null)\n const inputRef = React.useRef<HTMLInputElement | null>(null)\n\n const activeCountry = controlledCountry ?? uncontrolledCountry\n const explicitFormattingCountry = controlledCountry ?? manualSelectionCountryRef.current ?? undefined\n\n React.useImperativeHandle(forwardedRef, () => inputRef.current as HTMLInputElement, [])\n\n React.useLayoutEffect(() => {\n setShouldRenderSelect(true)\n }, [])\n\n React.useLayoutEffect(() => {\n const selection = pendingSelectionRef.current\n if (!selection) {\n return\n }\n\n const input = inputRef.current\n pendingSelectionRef.current = null\n if (!input) {\n return\n }\n\n const { start, end } = selection\n input.setSelectionRange(start, end)\n }, [inputValueState])\n\n const selectOverrides = selectProps ?? {}\n const generatedSelectInstanceId = React.useId()\n const {\n styles: userSelectStyles,\n components: userSelectComponents,\n classNamePrefix: userClassNamePrefix,\n formatOptionLabel: userFormatOptionLabel,\n menuPortalTarget: userMenuPortalTarget,\n menuPosition: userMenuPosition,\n ...forwardedSelectProps\n } = selectOverrides\n const {\n instanceId: userSelectInstanceId,\n noOptionsMessage,\n ...restForwardedSelectProps\n } = forwardedSelectProps\n const selectInstanceId = userSelectInstanceId ?? generatedSelectInstanceId\n const [defaultMenuPortalTarget, setDefaultMenuPortalTarget] =\n React.useState<HTMLElement | null>(null)\n const hasUserMenuPortalTarget = \"menuPortalTarget\" in selectOverrides\n const menuPortalTarget = hasUserMenuPortalTarget\n ? userMenuPortalTarget\n : defaultMenuPortalTarget\n\n const mergedSelectStyles = React.useMemo<StylesConfig<CountryOption, false>>(\n () => {\n const userMenuPortal = userSelectStyles?.menuPortal\n\n return {\n ...suggestionSelectStyles,\n ...(userSelectStyles ?? {}),\n menuPortal: (provided, state) => {\n const baseWithZIndex = {\n ...provided,\n zIndex: 1300,\n }\n const base = userMenuPortal ? userMenuPortal(baseWithZIndex, state) : baseWithZIndex\n\n if (typeof document === \"undefined\" || !menuPortalTarget || menuPortalTarget === document.body) {\n return base\n }\n\n const portalRect = menuPortalTarget.getBoundingClientRect()\n return {\n ...base,\n left: typeof base.left === \"number\" ? base.left - portalRect.left : base.left,\n top: typeof base.top === \"number\" ? base.top - portalRect.top : base.top,\n }\n },\n }\n },\n [menuPortalTarget, userSelectStyles]\n )\n\n React.useLayoutEffect(() => {\n if (hasUserMenuPortalTarget || typeof document === \"undefined\") {\n return\n }\n\n const portalTarget =\n inputRef.current?.closest<HTMLElement>(\n \"[data-slot='dialog-content'], [data-slot='sheet-content'], [role='dialog']\"\n ) ?? document.body\n setDefaultMenuPortalTarget(portalTarget)\n }, [hasUserMenuPortalTarget])\n\n const mergedSelectComponents = React.useMemo(() => {\n const baseComponents = {\n Control: HiddenControl,\n IndicatorsContainer: NullComponent,\n DropdownIndicator: NullComponent,\n IndicatorSeparator: NullComponent,\n ValueContainer: NullComponent,\n }\n\n const overrides = userSelectComponents ?? {}\n\n if (!overrides.Option) {\n return {\n ...baseComponents,\n ...overrides,\n Option: SuggestionOption,\n }\n }\n\n return {\n ...baseComponents,\n ...overrides,\n }\n }, [userSelectComponents])\n\n React.useEffect(() => () => {\n if (bufferTimeoutRef.current != null && typeof window !== \"undefined\") {\n window.clearTimeout(bufferTimeoutRef.current)\n }\n }, [])\n\n React.useEffect(() => {\n if (value == null) {\n return\n }\n\n const parsed = parsePhoneInput(value, explicitFormattingCountry)\n keyboardBufferRef.current = \"\"\n\n setInputValueState(parsed.displayValue)\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(parsed.lengthIssue)\n\n if (!controlledCountry && parsed.country !== uncontrolledCountry) {\n setUncontrolledCountry(parsed.country)\n }\n }, [controlledCountry, explicitFormattingCountry, uncontrolledCountry, value])\n\n React.useEffect(() => {\n const country = activeCountry ?? null\n if (!hasNotifiedCountryRef.current && country == null) {\n return\n }\n\n if (hasNotifiedCountryRef.current && lastNotifiedCountryRef.current === country) {\n return\n }\n\n hasNotifiedCountryRef.current = true\n lastNotifiedCountryRef.current = country\n onCountryChange?.(country, country ? resolveSelectedCountry(country) : null)\n }, [activeCountry, onCountryChange, resolveSelectedCountry])\n\n const emitChange = React.useCallback(\n (details: Omit<PhoneNumberChangeDetails, \"selectedCountry\">) => {\n onChange?.({\n ...details,\n selectedCountry: details.country ? resolveSelectedCountry(details.country) : null,\n })\n },\n [onChange, resolveSelectedCountry]\n )\n\n const scheduleBufferReset = React.useCallback(() => {\n if (typeof window === \"undefined\") {\n return\n }\n\n if (bufferTimeoutRef.current != null) {\n window.clearTimeout(bufferTimeoutRef.current)\n }\n\n bufferTimeoutRef.current = window.setTimeout(() => {\n keyboardBufferRef.current = \"\"\n bufferTimeoutRef.current = null\n }, 800)\n }, [])\n\n const applyParsedInput = React.useCallback(\n (parsed: ParsedInput, snapshot: ReturnType<typeof captureSelectionSnapshot> | null) => {\n setInputValueState(parsed.displayValue)\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(parsed.lengthIssue)\n\n if (!controlledCountry && parsed.country !== uncontrolledCountry) {\n setUncontrolledCountry(parsed.country)\n }\n\n if (snapshot) {\n pendingSelectionRef.current = resolveSelection(snapshot, parsed.displayValue)\n }\n\n emitChange({\n formattedInternational: parsed.formattedInternational,\n formattedNational: parsed.formattedNational,\n e164: parsed.e164,\n country: parsed.country,\n countryCallingCode: parsed.countryCallingCode,\n nationalNumber: parsed.nationalNumber,\n rawInput: parsed.rawInput,\n isValid: parsed.isValid,\n })\n },\n [controlledCountry, emitChange, uncontrolledCountry]\n )\n\n const handleInputChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const target = event.target\n const snapshot = captureSelectionSnapshot(target)\n const raw = target.value\n keyboardBufferRef.current = \"\"\n\n const normalizedExplicitInternational = normalizeExplicitInternationalInput(raw)\n const manualCountry = manualSelectionCountryRef.current\n if (normalizedExplicitInternational != null && manualCountry) {\n const manualDialCode = getCountryCallingCode(manualCountry)\n if (!sanitizeDigits(normalizedExplicitInternational).startsWith(manualDialCode)) {\n manualSelectionCountryRef.current = null\n }\n } else if (normalizedExplicitInternational != null) {\n manualSelectionCountryRef.current = null\n }\n\n const activeManualCountry = manualSelectionCountryRef.current\n const rawDigits = sanitizeDigits(raw)\n if (\n !controlledCountry &&\n activeManualCountry &&\n normalizedExplicitInternational == null &&\n rawDigits\n ) {\n const manualOption = {\n value: activeManualCountry,\n dialCode: getCountryCallingCode(activeManualCountry),\n }\n const parsed = preferSelectedCountry(\n parsePhoneInput(\n getInputValueForSelectedCountry(\n raw,\n {\n value: manualOption.value,\n dialCode: manualOption.dialCode,\n },\n { allowImplicitInternational: false }\n ),\n activeManualCountry\n ),\n manualOption\n )\n applyParsedInput(parsed, snapshot)\n return\n }\n\n const baseCountry = controlledCountry ?? activeManualCountry ?? undefined\n const parsed = parsePhoneInput(raw, baseCountry)\n applyParsedInput(parsed, snapshot)\n },\n [applyParsedInput, controlledCountry]\n )\n\n const handleCountrySelect = React.useCallback(\n (option: SingleValue<CountryOption>) => {\n if (!option) {\n return\n }\n\n manualSelectionCountryRef.current = option.value\n const nextInputValue = getInputValueForSelectedCountry(inputValueState, option)\n const parsed = preferSelectedCountry(\n parsePhoneInput(nextInputValue, option.value),\n option\n )\n\n setInputValueState(parsed.displayValue)\n pendingSelectionRef.current = {\n start: parsed.displayValue.length,\n end: parsed.displayValue.length,\n }\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(parsed.lengthIssue)\n\n if (!controlledCountry) {\n setUncontrolledCountry(option.value)\n }\n\n emitChange({\n formattedInternational: parsed.formattedInternational,\n formattedNational: parsed.formattedNational,\n e164: parsed.e164,\n country: parsed.country,\n countryCallingCode: parsed.countryCallingCode,\n nationalNumber: parsed.nationalNumber,\n rawInput: parsed.rawInput,\n isValid: parsed.isValid,\n })\n\n requestAnimationFrame(() => {\n inputRef.current?.focus()\n })\n },\n [controlledCountry, emitChange, inputValueState]\n )\n\n const filteredOptions = React.useMemo(() => {\n if (!showSuggestions) {\n return [] as CountryOption[]\n }\n\n const results: CountryOption[] = []\n\n const pushUnique = (option: CountryOption | undefined) => {\n if (option && !results.some((existing) => existing.value === option.value)) {\n results.push(option)\n }\n }\n\n const priorityOption = countryOptions.find((option) => option.value === menuPriorityCountry)\n const currentOption = activeCountry\n ? countryOptions.find((option) => option.value === activeCountry)\n : undefined\n const query = countryQuery.trim()\n const digitQuery = sanitizeDigits(query)\n const normalizedQuery = normalizeSearchValue(query)\n\n if (!digitQuery && !normalizedQuery) {\n pushUnique(currentOption)\n pushUnique(priorityOption)\n countryOptions.forEach(pushUnique)\n return results\n }\n\n if (digitQuery) {\n const dialMatches = countryOptions\n .filter((option) => option.dialCode.startsWith(digitQuery))\n .sort((a, b) => {\n const aExact = a.dialCode === digitQuery\n const bExact = b.dialCode === digitQuery\n if (aExact && !bExact) {\n return -1\n }\n if (!aExact && bExact) {\n return 1\n }\n return a.dialCode.length - b.dialCode.length\n })\n dialMatches.forEach(pushUnique)\n }\n\n if (normalizedQuery) {\n const nameMatches = countryOptions\n .filter((option) =>\n option.normalizedSearchableTokens.some((token) => token.includes(normalizedQuery))\n )\n .sort((a, b) => {\n const aIndex = optionMatchIndex(a.normalizedSearchableTokens, normalizedQuery)\n const bIndex = optionMatchIndex(b.normalizedSearchableTokens, normalizedQuery)\n if (aIndex !== bIndex) {\n return aIndex - bIndex\n }\n return a.name.localeCompare(b.name)\n })\n nameMatches.forEach(pushUnique)\n }\n\n pushUnique(currentOption)\n pushUnique(priorityOption)\n if (results.length === 0) {\n countryOptions.forEach(pushUnique)\n }\n\n return results\n }, [activeCountry, countryOptions, countryQuery, menuPriorityCountry, showSuggestions])\n\n const suggestionMenuIsOpen = isFocused && showSuggestions && filteredOptions.length > 0\n\n React.useEffect(() => {\n if (!suggestionMenuIsOpen) {\n scrollBehaviorRef.current = \"smooth\"\n }\n }, [suggestionMenuIsOpen])\n\n React.useEffect(() => {\n if (!suggestionMenuIsOpen) {\n setHighlightedIndex(-1)\n return\n }\n\n if (filteredOptions.length === 0) {\n setHighlightedIndex(-1)\n return\n }\n\n setHighlightedIndex((current) => {\n if (current < 0 || current >= filteredOptions.length) {\n return 0\n }\n return current\n })\n }, [filteredOptions, suggestionMenuIsOpen])\n\n const highlightedOption =\n highlightedIndex >= 0 ? filteredOptions[highlightedIndex] ?? null : null\n\n React.useEffect(() => {\n if (highlightedIndex < 0) {\n scrollBehaviorRef.current = \"smooth\"\n }\n }, [highlightedIndex])\n\n const consumeScrollBehavior = React.useCallback(() => {\n const behavior = scrollBehaviorRef.current\n scrollBehaviorRef.current = \"smooth\"\n return behavior\n }, [])\n\n const updateHighlightedOption = React.useCallback(\n (option: CountryOption) => {\n const index = filteredOptions.findIndex((candidate) => candidate.value === option.value)\n if (index !== -1) {\n setHighlightedIndex(index)\n }\n },\n [filteredOptions]\n )\n\n const selectFormatOptionLabel = React.useCallback<\n NonNullable<SelectProps<CountryOption, false>[\"formatOptionLabel\"]>\n >(\n (option, meta) => {\n if (userFormatOptionLabel) {\n return userFormatOptionLabel(option, meta)\n }\n return formatCountryOption(option)\n },\n [userFormatOptionLabel]\n )\n\n const optionLabelRenderer = React.useCallback(\n (option: CountryOption) =>\n selectFormatOptionLabel(option, {\n context: \"menu\",\n inputValue: countryQuery,\n selectValue: [],\n }),\n [countryQuery, selectFormatOptionLabel]\n )\n\n const highlightContextValue = React.useMemo<SuggestionContextValue>(\n () => ({\n highlightedValue: highlightedOption?.value ?? null,\n setHighlightedOption: updateHighlightedOption,\n renderOptionLabel: optionLabelRenderer,\n consumeScrollBehavior,\n }),\n [consumeScrollBehavior, highlightedOption, optionLabelRenderer, updateHighlightedOption]\n )\n\n const activeOption = activeCountry\n ? countryOptions.find((option) => option.value === activeCountry)\n : undefined\n const activeFlag = activeOption?.flag ?? \"\"\n const inlineFlagLabel = activeCountry\n ? resolvedMessages.selectedCountryLabel(activeOption?.name ?? activeCountry)\n : resolvedMessages.selectCountryLabel\n const hasInlineFlag = Boolean(activeCountry && activeFlag)\n const lengthHint =\n lengthIssue === \"TOO_LONG\"\n ? resolvedMessages.lengthTooLong(activeOption?.name ?? activeCountry ?? null)\n : null\n const countryName = activeOption?.name ?? activeCountry ?? null\n\n let validationNode: React.ReactNode = null\n if (lengthHint) {\n const rendered = renderValidationMessage?.({\n message: lengthHint,\n code: \"TOO_LONG\",\n countryName,\n })\n validationNode =\n rendered === undefined ? (\n <p className=\"mt-1 text-xs text-destructive\">\n <span>{lengthHint}</span>\n </p>\n ) : (\n rendered\n )\n }\n\n const appendToBuffer = React.useCallback(\n (char: string) => {\n keyboardBufferRef.current = `${keyboardBufferRef.current}${char}`.slice(-12)\n setCountryQuery(keyboardBufferRef.current)\n setShowSuggestions(true)\n scheduleBufferReset()\n },\n [scheduleBufferReset]\n )\n\n const popBuffer = React.useCallback(() => {\n const current = keyboardBufferRef.current\n if (!current) {\n return\n }\n keyboardBufferRef.current = current.slice(0, -1)\n setCountryQuery(keyboardBufferRef.current)\n if (keyboardBufferRef.current) {\n scheduleBufferReset()\n }\n }, [scheduleBufferReset])\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n onInputKeyDown?.(event)\n if (event.defaultPrevented) {\n return\n }\n\n const key = event.key\n\n if (event.metaKey || event.ctrlKey || event.altKey) {\n return\n }\n\n const target = event.currentTarget\n const value = target.value\n const selectionStart = target.selectionStart ?? 0\n const selectionEnd = target.selectionEnd ?? selectionStart\n const isCollapsedSelection = selectionStart === selectionEnd\n\n if (key === \"Backspace\" && isCollapsedSelection) {\n const nextStart = skipFormattingCharactersLeft(value, selectionStart)\n if (nextStart !== selectionStart) {\n target.setSelectionRange(nextStart, nextStart)\n }\n } else if (key === \"ArrowLeft\" && isCollapsedSelection) {\n const nextStart = skipFormattingCharactersLeft(value, selectionStart)\n if (nextStart !== selectionStart) {\n event.preventDefault()\n target.setSelectionRange(nextStart, nextStart)\n return\n }\n } else if (key === \"ArrowRight\" && isCollapsedSelection) {\n const nextStart = skipFormattingCharactersRight(value, selectionEnd)\n if (nextStart !== selectionEnd) {\n event.preventDefault()\n target.setSelectionRange(nextStart, nextStart)\n return\n }\n }\n\n if (key === \"ArrowDown\") {\n scrollBehaviorRef.current = event.repeat ? \"auto\" : \"smooth\"\n event.preventDefault()\n if (!showSuggestions) {\n setShowSuggestions(true)\n setHighlightedIndex(filteredOptions.length > 0 ? 0 : -1)\n return\n }\n\n if (filteredOptions.length > 0) {\n setHighlightedIndex((current) => {\n const next = current < 0 ? 0 : (current + 1) % filteredOptions.length\n return next\n })\n }\n return\n }\n\n if (key === \"ArrowUp\") {\n scrollBehaviorRef.current = event.repeat ? \"auto\" : \"smooth\"\n event.preventDefault()\n if (!showSuggestions) {\n setShowSuggestions(true)\n setHighlightedIndex(filteredOptions.length > 0 ? filteredOptions.length - 1 : -1)\n return\n }\n\n if (filteredOptions.length > 0) {\n setHighlightedIndex((current) => {\n if (current < 0) {\n return filteredOptions.length - 1\n }\n return (current - 1 + filteredOptions.length) % filteredOptions.length\n })\n }\n return\n }\n\n if (/^[a-z]$/i.test(key)) {\n event.preventDefault()\n if (!showSuggestions) {\n setShowSuggestions(true)\n setHighlightedIndex(filteredOptions.length > 0 ? 0 : -1)\n }\n appendToBuffer(key.toLowerCase())\n return\n }\n\n if (suggestionMenuIsOpen) {\n if (key === \"Backspace\" && keyboardBufferRef.current) {\n event.preventDefault()\n popBuffer()\n return\n }\n\n if (key === \"Escape\") {\n event.preventDefault()\n keyboardBufferRef.current = \"\"\n setCountryQuery(\"\")\n setShowSuggestions(false)\n return\n }\n\n if (key === \"Enter\" && filteredOptions.length > 0) {\n event.preventDefault()\n const targetOption = highlightedOption ?? filteredOptions[0]\n handleCountrySelect(targetOption)\n return\n }\n }\n },\n [\n appendToBuffer,\n filteredOptions,\n handleCountrySelect,\n highlightedOption,\n onInputKeyDown,\n popBuffer,\n showSuggestions,\n suggestionMenuIsOpen,\n ]\n )\n\n const handleFocus = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(true)\n onInputFocus?.(event)\n },\n [onInputFocus]\n )\n\n const handleBlur = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(false)\n setShowSuggestions(false)\n keyboardBufferRef.current = \"\"\n setCountryQuery(\"\")\n onInputBlur?.(event)\n },\n [onInputBlur]\n )\n\n const openCountryMenu = React.useCallback(() => {\n if (disabled || readOnly) {\n return\n }\n\n keyboardBufferRef.current = \"\"\n setCountryQuery(\"\")\n setShowSuggestions(true)\n setHighlightedIndex((current) => (current < 0 ? 0 : current))\n\n requestAnimationFrame(() => {\n inputRef.current?.focus()\n })\n }, [disabled, readOnly])\n\n const shimName = autofillShimName ?? (inputName ? `${inputName}_shim` : undefined)\n\n return (\n <div className={cn(\"relative flex flex-col\", className)}>\n <div className=\"relative\">\n <input\n {...restInputProps}\n ref={inputRef}\n type=\"tel\"\n className={cn(\n \"flex h-10 w-full rounded-md border border-input bg-background py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"pl-11 pr-3\",\n inputClassName\n )}\n name={inputName}\n value={inputValueState}\n onChange={handleInputChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n disabled={disabled}\n readOnly={readOnly}\n autoComplete={inputAutoComplete ?? \"off\"}\n />\n <button\n type=\"button\"\n className={cn(\n \"absolute left-3 top-1/2 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded border text-lg leading-none transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n hasInlineFlag\n ? \"border-transparent\"\n : \"border-dashed border-border text-muted-foreground\",\n disabled\n ? \"cursor-not-allowed opacity-50\"\n : readOnly\n ? \"cursor-default\"\n : \"cursor-pointer hover:bg-muted\"\n )}\n aria-label={inlineFlagLabel}\n onMouseDown={(event) => event.preventDefault()}\n onClick={openCountryMenu}\n tabIndex={-1}\n disabled={disabled}\n >\n <span aria-hidden=\"true\">\n {hasInlineFlag ? activeFlag : \"?\"}\n </span>\n </button>\n </div>\n\n {shimName ? (\n <input\n tabIndex={-1}\n autoComplete=\"tel\"\n name={shimName}\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute left-0 top-0 h-0 w-0 opacity-0\"\n />\n ) : null}\n\n <div\n className=\"absolute left-0 top-full z-30 mt-1\"\n style={{\n pointerEvents: suggestionMenuIsOpen ? \"auto\" : \"none\",\n width: \"min(260px, 100%)\",\n }}\n onMouseDown={(event) => event.preventDefault()}\n >\n {shouldRenderSelect ? (\n <SuggestionContext.Provider value={highlightContextValue}>\n <Select<CountryOption, false>\n {...restForwardedSelectProps}\n instanceId={selectInstanceId}\n menuIsOpen={suggestionMenuIsOpen}\n options={filteredOptions}\n value={null}\n components={mergedSelectComponents}\n styles={mergedSelectStyles}\n isClearable={false}\n isSearchable={false}\n backspaceRemovesValue={false}\n tabSelectsValue={false}\n menuShouldScrollIntoView={false}\n menuPortalTarget={menuPortalTarget}\n menuPosition={userMenuPosition ?? (menuPortalTarget ? \"fixed\" : \"absolute\")}\n onChange={handleCountrySelect}\n classNamePrefix={userClassNamePrefix ?? \"phone-number-suggestions\"}\n placeholder=\"\"\n formatOptionLabel={selectFormatOptionLabel}\n noOptionsMessage={\n noOptionsMessage ?? (() => resolvedMessages.noMatches)\n }\n />\n </SuggestionContext.Provider>\n ) : null}\n </div>\n\n {validationNode}\n </div>\n )\n }\n)\n\nPhoneNumberInput.displayName = \"PhoneNumberInput\"\n"],"mappings":";;;;;;;;;;;AA+DA,IAAM,IACJ;AAOF,SAAS,EAAyB,GAAe;CAC/C,OAAO,EAAM,QAAQ,GAAiC,EAAE;AAC1D;AAEA,SAAS,EAAe,GAAgB;CACtC,KAAK,IAAM,KAAU,GACnB,IAAI,EAAO,WAAW,CAAM,GAC1B,OAAO,EAAO,MAAM,EAAO,MAAM;CAGrC,OAAO;AACT;AAEA,SAAS,GAAoC,GAAgB;CAC3D,IAAM,IAAY,IAAI,KAChB,EAAE,gBAAa,uBAAoB,EAAoB,CAAS;CAMtE,OAJI,GAAa,QAAQ,KAAK,IACrB,IAGF;AACT;AAEA,SAAS,GAAoC,GAAe;CAC1D,IAAM,IAAU,EAAyB,CAAK,CAAC,CAAC,KAAK;CACrD,IAAI,CAAC,GACH,OAAO;CAGT,IAAI,EAAQ,WAAW,GAAG,GAAG;EAC3B,IAAM,IAAS,EAAe,CAAO;EACrC,IAAI,CAAC,GACH,OAAO;EAGT,IAAM,IAAmB,EAAe,CAAM;EAC9C,OAAO,IAAmB,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GACD,kBAAC,UAAD;KACE,MAAK;KACL,WAAW,EACT,wOACA,KACI,uBACA,qDACJ,IACI,kCACA,IACE,mBACA,+BACR;KACA,cAAY;KACZ,cAAc,MAAU,EAAM,eAAe;KAC7C,SAAS;KACT,UAAU;KACA;KAEV,UAAA,kBAAC,QAAD;MAAM,eAAY;MACf,UAAA,KAAgB,KAAa;KAC1B,CAAA;IACA,CAAA,CACL;;GAEJ,KACC,kBAAC,SAAD;IACE,UAAU;IACV,cAAa;IACb,MAAM;IACN,eAAY;IACZ,WAAU;GACX,CAAA,IACC;GAEJ,kBAAC,OAAD;IACE,WAAU;IACV,OAAO;KACL,eAAe,IAAuB,SAAS;KAC/C,OAAO;IACT;IACA,cAAc,MAAU,EAAM,eAAe;IAE5C,UAAA,KACC,kBAAC,GAAkB,UAAnB;KAA4B,OAAO;KACjC,UAAA,kBAAC,IAAD;MACE,GAAI;MACJ,YAAY;MACZ,YAAY;MACZ,SAAS;MACT,OAAO;MACP,YAAY;MACZ,QAAQ;MACR,aAAa;MACb,cAAc;MACd,uBAAuB;MACvB,iBAAiB;MACjB,0BAA0B;MACR;MAClB,cAAc,OAAqB,IAAmB,UAAU;MAChE,UAAU;MACV,iBAAiB,MAAuB;MACxC,aAAY;MACZ,mBAAmB;MACnB,kBACE,aAA2B,EAAiB;KAE/C,CAAA;IACyB,CAAA,IAC1B;GACD,CAAA;GAEJ;EACE;;AAET,CACF;AAEA,EAAiB,cAAc"}
1
+ {"version":3,"file":"index362.js","names":["EXCLUDED_SET","FILTERED_COUNTRIES","getCountries","code","getCountryList"],"sources":["../src/components/PhoneNumberInput/countries.ts"],"sourcesContent":["import { getCountries } from \"libphonenumber-js\"\nimport type { CountryCode } from \"libphonenumber-js\"\n\n\nconst EXCLUDED_COUNTRIES: CountryCode[] = [\"IM\", \"GG\", \"JE\"]\nconst EXCLUDED_SET = new Set(EXCLUDED_COUNTRIES)\n\nconst FILTERED_COUNTRIES = getCountries().filter((code) => !EXCLUDED_SET.has(code))\n\nexport function getCountryList(): CountryCode[] {\n return FILTERED_COUNTRIES\n}\n"],"mappings":";;AAKA,IAAMA,oBAAe,IAAI,IAAI;CADc;CAAM;CAAM;AAC1B,CAAkB,GAEzCC,IAAqBC,EAAa,CAAC,CAAC,QAAQ,MAAS,CAACF,EAAa,IAAIG,CAAI,CAAC;AAElF,SAAgBC,IAAgC;CAC9C,OAAOH;AACT"}
package/dist/index363.js CHANGED
@@ -1,11 +1,132 @@
1
- "use client";
2
- import * as e from "react";
3
- //#region ../../node_modules/@base-ui/utils/useOnFirstRender.mjs
4
- function t(t) {
5
- let n = e.useRef(!0);
6
- n.current && (n.current = !1, t());
1
+ import { getCountryCallingCode as e } from "./index360.js";
2
+ import { getCountryList as t } from "./index362.js";
3
+ var n = t(), r = /* @__PURE__ */ new Map(), i = "__default_locale__", a = Array.from(new Set(n.map((t) => e(t)))).sort((e, t) => t.length - e.length);
4
+ a.reduce((e, t) => Math.max(e, t.length), 0);
5
+ var o = [
6
+ "0011",
7
+ "001",
8
+ "011",
9
+ "00",
10
+ "810"
11
+ ];
12
+ function s(e) {
13
+ return e && n.includes(e) ? e : "US";
14
+ }
15
+ function c(e) {
16
+ if (typeof Intl > "u" || Intl.DisplayNames === void 0) return null;
17
+ try {
18
+ let t = Array.isArray(e) ? e : e ? [e] : void 0;
19
+ return new Intl.DisplayNames(t, { type: "region" });
20
+ } catch {
21
+ return null;
22
+ }
23
+ }
24
+ function l(t) {
25
+ let r = c(t), i = c("en");
26
+ return n.map((t) => {
27
+ let n = e(t), a = r?.of(t) ?? i?.of(t) ?? t, o = i?.of(t) ?? a, s = x(t), c = Array.from(new Set([
28
+ a,
29
+ o,
30
+ t.toUpperCase(),
31
+ t.toLowerCase(),
32
+ ...s
33
+ ].filter(Boolean)));
34
+ return {
35
+ value: t,
36
+ name: a,
37
+ dialCode: n,
38
+ label: `${a} (+${n})`,
39
+ flag: g(t),
40
+ searchableTokens: c,
41
+ normalizedSearchableTokens: c.map((e) => y(e))
42
+ };
43
+ }).sort((e, t) => {
44
+ let n = u(e.value), r = u(t.value);
45
+ return n === r ? e.name.localeCompare(t.name) : n - r;
46
+ });
47
+ }
48
+ function u(t) {
49
+ return t === "US" ? 0 : t === "CA" ? 1 : e(t) === "1" ? 2 : 3;
50
+ }
51
+ function d(e) {
52
+ return e ? Array.isArray(e) ? e.join("\0") : e : i;
53
+ }
54
+ function f(e) {
55
+ if (e !== i) {
56
+ if (e.includes("\0")) {
57
+ let t = e.split("\0").filter(Boolean);
58
+ return t.length === 0 ? void 0 : t.length === 1 ? t[0] ?? void 0 : t;
59
+ }
60
+ return e;
61
+ }
62
+ }
63
+ function p(e, t) {
64
+ let n = r.get(t);
65
+ if (n) return n;
66
+ let i = l(e);
67
+ return r.set(t, i), i;
68
+ }
69
+ function m(e) {
70
+ return {
71
+ code: e.value,
72
+ name: e.name,
73
+ dialCode: e.dialCode,
74
+ flag: e.flag
75
+ };
76
+ }
77
+ function h(t) {
78
+ return {
79
+ code: t,
80
+ name: t,
81
+ dialCode: e(t),
82
+ flag: g(t)
83
+ };
84
+ }
85
+ function g(e) {
86
+ let t = e?.toUpperCase();
87
+ if (!t || t.length !== 2 || /[^A-Z]/.test(t)) return "";
88
+ let n = 127397;
89
+ return String.fromCodePoint(t.charCodeAt(0) + n, t.charCodeAt(1) + n);
90
+ }
91
+ var _ = /[\u0300-\u036f]/g;
92
+ function v(e) {
93
+ return e.normalize("NFD").replace(_, "");
94
+ }
95
+ function y(e) {
96
+ return v(e).toLowerCase();
97
+ }
98
+ function b(e, t) {
99
+ let n = 2 ** 53 - 1;
100
+ for (let r of e) {
101
+ let e = r.indexOf(t);
102
+ e >= 0 && e < n && (n = e);
103
+ }
104
+ return n === 2 ** 53 - 1 ? 2 ** 53 - 1 : n;
105
+ }
106
+ function x(e) {
107
+ switch (e) {
108
+ case "US": return [
109
+ "USA",
110
+ "United States",
111
+ "America",
112
+ "United States of America"
113
+ ];
114
+ case "GB": return [
115
+ "UK",
116
+ "United Kingdom",
117
+ "Great Britain",
118
+ "England"
119
+ ];
120
+ case "AE": return ["UAE", "United Arab Emirates"];
121
+ case "KR": return ["South Korea", "Korea"];
122
+ case "CN": return ["China", "PRC"];
123
+ case "CD": return ["DRC", "Congo-Kinshasa"];
124
+ case "CG": return ["Congo-Brazzaville"];
125
+ case "BR": return ["Brazil"];
126
+ default: return [];
127
+ }
7
128
  }
8
129
  //#endregion
9
- export { t as useOnFirstRender };
130
+ export { o as COMMON_IDD_PREFIXES, a as COUNTRY_DIAL_CODES, h as buildFallbackSelectedCountry, p as getCachedCountryOptions, d as getLocaleCacheKey, s as getValidCountry, y as normalizeSearchValue, b as optionMatchIndex, f as parseLocaleCacheKey, m as toSelectedCountry };
10
131
 
11
132
  //# sourceMappingURL=index363.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index363.js","names":["React"],"sources":["../../../node_modules/@base-ui/utils/useOnFirstRender.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nexport function useOnFirstRender(fn) {\n const ref = React.useRef(true);\n if (ref.current) {\n ref.current = false;\n fn();\n }\n}"],"x_google_ignoreList":[0],"mappings":";;;AAGA,SAAgB,EAAiB,GAAI;CACnC,IAAM,IAAMA,EAAM,OAAO,EAAI;CAC7B,AAAI,EAAI,YACN,EAAI,UAAU,IACd,EAAG;AAEP"}
1
+ {"version":3,"file":"index363.js","names":["COUNTRY_OPTIONS","getCountryList","COUNTRY_OPTIONS_CACHE","DEFAULT_LOCALE_CACHE_KEY","COUNTRY_DIAL_CODES","getCountryCallingCode","code","b","a","max","dial","COMMON_IDD_PREFIXES","getValidCountry","input","createDisplayNames","locales","locale","buildCountryOptions","displayNames","englishDisplayNames","dialCode","country","localizedName","englishName","aliasTokens","getCountryAliases","searchableTokens","countryCodeToFlagEmoji","normalizeSearchValue","token","priorityA","getCountryPriority","priorityB","getLocaleCacheKey","parseLocaleCacheKey","cacheKey","parts","getCachedCountryOptions","cached","built","toSelectedCountry","option","buildFallbackSelectedCountry","upper","base","DIACRITICS_REGEX","stripDiacritics","value","optionMatchIndex","best","tokens","index","query"],"sources":["../src/components/PhoneNumberInput/country-options.ts"],"sourcesContent":["import type { CountryCode } from \"libphonenumber-js\"\nimport { getCountryCallingCode } from \"libphonenumber-js\"\n\nimport type { CountryOption, PhoneNumberSelectedCountry } from \"./types\"\nimport { getCountryList } from \"./countries\"\n\n\nexport const DEFAULT_COUNTRY: CountryCode = \"US\"\nconst COUNTRY_OPTIONS = getCountryList()\n\nconst COUNTRY_OPTIONS_CACHE = new Map<string, CountryOption[]>()\nconst DEFAULT_LOCALE_CACHE_KEY = \"__default_locale__\"\nexport const COUNTRY_DIAL_CODES = Array.from(\n new Set(COUNTRY_OPTIONS.map((code) => getCountryCallingCode(code)))\n).sort((a, b) => b.length - a.length)\nexport const MAX_DIAL_CODE_LENGTH = COUNTRY_DIAL_CODES.reduce(\n (max, dial) => Math.max(max, dial.length),\n 0\n)\nexport const COMMON_IDD_PREFIXES = [\"0011\", \"001\", \"011\", \"00\", \"810\"]\n\nexport function getValidCountry(input: CountryCode | undefined) {\n if (!input) {\n return DEFAULT_COUNTRY\n }\n\n return COUNTRY_OPTIONS.includes(input) ? input : DEFAULT_COUNTRY\n}\n\nfunction createDisplayNames(locale?: string | string[]) {\n if (typeof Intl === \"undefined\" || typeof Intl.DisplayNames === \"undefined\") {\n return null\n }\n\n try {\n const locales = Array.isArray(locale) ? locale : locale ? [locale] : undefined\n return new Intl.DisplayNames(locales, { type: \"region\" })\n } catch {\n return null\n }\n}\n\nfunction buildCountryOptions(locale?: string | string[]) {\n const displayNames = createDisplayNames(locale)\n const englishDisplayNames = createDisplayNames(\"en\")\n\n return COUNTRY_OPTIONS\n .map((country) => {\n const dialCode = getCountryCallingCode(country)\n const localizedName = displayNames?.of(country) ?? englishDisplayNames?.of(country) ?? country\n const englishName = englishDisplayNames?.of(country) ?? localizedName\n const aliasTokens = getCountryAliases(country)\n const searchableTokens = Array.from(\n new Set(\n [localizedName, englishName, country.toUpperCase(), country.toLowerCase(), ...aliasTokens].filter(\n Boolean\n )\n )\n ) as string[]\n return {\n value: country,\n name: localizedName,\n dialCode,\n label: `${localizedName} (+${dialCode})`,\n flag: countryCodeToFlagEmoji(country),\n searchableTokens,\n normalizedSearchableTokens: searchableTokens.map((token) => normalizeSearchValue(token)),\n }\n })\n .sort((a, b) => {\n const priorityA = getCountryPriority(a.value)\n const priorityB = getCountryPriority(b.value)\n if (priorityA !== priorityB) {\n return priorityA - priorityB\n }\n return a.name.localeCompare(b.name)\n })\n}\n\nfunction getCountryPriority(code: CountryCode) {\n if (code === \"US\") return 0\n if (code === \"CA\") return 1\n if (getCountryCallingCode(code) === \"1\") return 2\n return 3\n}\n\nexport function getLocaleCacheKey(locale?: string | string[]) {\n if (!locale) {\n return DEFAULT_LOCALE_CACHE_KEY\n }\n if (Array.isArray(locale)) {\n return locale.join(\"\\u0000\")\n }\n return locale\n}\n\nexport function parseLocaleCacheKey(cacheKey: string): string | string[] | undefined {\n if (cacheKey === DEFAULT_LOCALE_CACHE_KEY) {\n return undefined\n }\n\n if (cacheKey.includes(\"\\u0000\")) {\n const parts = cacheKey.split(\"\\u0000\").filter(Boolean)\n if (parts.length === 0) {\n return undefined\n }\n if (parts.length === 1) {\n return parts[0] ?? undefined\n }\n return parts\n }\n\n return cacheKey\n}\n\nexport function getCachedCountryOptions(locale: string | string[] | undefined, cacheKey: string) {\n const cached = COUNTRY_OPTIONS_CACHE.get(cacheKey)\n if (cached) {\n return cached\n }\n const built = buildCountryOptions(locale)\n COUNTRY_OPTIONS_CACHE.set(cacheKey, built)\n return built\n}\n\nexport function toSelectedCountry(option: CountryOption): PhoneNumberSelectedCountry {\n return {\n code: option.value,\n name: option.name,\n dialCode: option.dialCode,\n flag: option.flag,\n }\n}\n\nexport function buildFallbackSelectedCountry(country: CountryCode): PhoneNumberSelectedCountry {\n return {\n code: country,\n name: country,\n dialCode: getCountryCallingCode(country),\n flag: countryCodeToFlagEmoji(country),\n }\n}\n\nfunction countryCodeToFlagEmoji(country: CountryCode) {\n const upper = country?.toUpperCase()\n\n if (!upper || upper.length !== 2 || /[^A-Z]/.test(upper)) {\n return \"\"\n }\n\n const base = 127397\n return String.fromCodePoint(\n upper.charCodeAt(0) + base,\n upper.charCodeAt(1) + base\n )\n}\n\nconst DIACRITICS_REGEX = /[\\u0300-\\u036f]/g\n\nfunction stripDiacritics(value: string) {\n return value.normalize(\"NFD\").replace(DIACRITICS_REGEX, \"\")\n}\n\nexport function normalizeSearchValue(value: string) {\n return stripDiacritics(value).toLowerCase()\n}\n\nexport function optionMatchIndex(tokens: string[], query: string) {\n let best = Number.MAX_SAFE_INTEGER\n for (const token of tokens) {\n const index = token.indexOf(query)\n if (index >= 0 && index < best) {\n best = index\n }\n }\n return best === Number.MAX_SAFE_INTEGER ? Number.MAX_SAFE_INTEGER : best\n}\n\nfunction getCountryAliases(code: CountryCode): string[] {\n switch (code) {\n case \"US\":\n return [\"USA\", \"United States\", \"America\", \"United States of America\"]\n case \"GB\":\n return [\"UK\", \"United Kingdom\", \"Great Britain\", \"England\"]\n case \"AE\":\n return [\"UAE\", \"United Arab Emirates\"]\n case \"KR\":\n return [\"South Korea\", \"Korea\"]\n case \"CN\":\n return [\"China\", \"PRC\"]\n case \"CD\":\n return [\"DRC\", \"Congo-Kinshasa\"]\n case \"CG\":\n return [\"Congo-Brazzaville\"]\n case \"BR\":\n return [\"Brazil\"]\n default:\n return []\n }\n}\n\n"],"mappings":";;AAQA,IAAMA,IAAkBC,EAAe,GAEjCC,oBAAwB,IAAI,IAA6B,GACzDC,IAA2B,sBACpBC,IAAqB,MAAM,KACtC,IAAI,IAAIJ,EAAgB,KAAK,MAASK,EAAsBC,CAAI,CAAC,CAAC,CACpE,CAAC,CAAC,MAAM,GAAG,MAAMC,EAAE,SAASC,EAAE,MAAM;AACAJ,EAAmB,QACpD,GAAK,MAAS,KAAK,IAAIK,GAAKC,EAAK,MAAM,GACxC,CACF;AACA,IAAaC,IAAsB;CAAC;CAAQ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,EAAgB,GAAe;CACtC,OAAOC,EAAM,UAAU,KAAK,CAAC,CAAC,QAAQF,GAAkB,EAAE;AAC5D;AAEA,SAAgBjB,EAAqB,GAAe;CAClD,OAAOkB,EAAgBC,CAAK,CAAC,CAAC,YAAY;AAC5C;AAEA,SAAgBC,EAAiB,GAAkB,GAAe;CAChE,IAAIC;CACJ,KAAK,IAAMpB,KAASqB,GAAQ;EAC1B,IAAMC,IAAQtB,EAAM,QAAQuB,CAAK;EACjC,AAAID,KAAS,KAAKA,IAAQF,MACxB,IAAOE;CAEX;CACA,OAAOF,kCAA6DA;AACtE;AAEA,SAASxB,EAAkB,GAA6B;CACtD,QAAQnB,GAAR;EACA,KAAK,MACH,OAAO;GAAC;GAAO;GAAiB;GAAW;EAA0B;EACvE,KAAK,MACH,OAAO;GAAC;GAAM;GAAkB;GAAiB;EAAS;EAC5D,KAAK,MACH,OAAO,CAAC,OAAO,sBAAsB;EACvC,KAAK,MACH,OAAO,CAAC,eAAe,OAAO;EAChC,KAAK,MACH,OAAO,CAAC,SAAS,KAAK;EACxB,KAAK,MACH,OAAO,CAAC,OAAO,gBAAgB;EACjC,KAAK,MACH,OAAO,CAAC,mBAAmB;EAC7B,KAAK,MACH,OAAO,CAAC,QAAQ;EAClB,SACE,OAAO,CAAC;CACV;AACF"}
package/dist/index364.js CHANGED
@@ -1,17 +1,46 @@
1
- "use client";
2
- import * as e from "react";
3
- //#region ../../node_modules/@base-ui/utils/usePreviousValue.mjs
4
- function t(t) {
5
- let [n, r] = e.useState({
6
- current: t,
7
- previous: null
8
- });
9
- return Object.is(t, n.current) || r({
10
- current: t,
11
- previous: n.current
12
- }), n.previous;
1
+ import { validatePhoneNumberLength as e } from "./index357.js";
2
+ import { AsYouType as t } from "./index358.js";
3
+ //#region src/components/PhoneNumberInput/normalization.ts
4
+ function n(e) {
5
+ return e.replace(/\D/g, "");
6
+ }
7
+ var r = {
8
+ GG: "GB",
9
+ JE: "GB",
10
+ IM: "GB"
11
+ };
12
+ function i(e) {
13
+ if (e) return r[e] ?? e;
14
+ }
15
+ function a(e, r) {
16
+ if (e === "+") return {
17
+ international: "+",
18
+ national: "",
19
+ formatted: "+",
20
+ phoneNumber: null,
21
+ detectedCountry: void 0
22
+ };
23
+ let a = r ? new t(r) : new t(), o = a.input(e), s = a.getNumber(), c = i(s?.country ?? a.country ?? void 0), l = s?.formatInternational() ?? o;
24
+ return {
25
+ international: l,
26
+ national: s?.formatNational() ?? n(l),
27
+ formatted: o,
28
+ phoneNumber: s,
29
+ detectedCountry: c
30
+ };
31
+ }
32
+ function o(e, t) {
33
+ return e.startsWith(t) ? e.slice(t.length) : e;
34
+ }
35
+ function s(t, n) {
36
+ if (!n || !t) return null;
37
+ try {
38
+ return e(t, n) === "TOO_LONG" ? "TOO_LONG" : null;
39
+ } catch {
40
+ return null;
41
+ }
13
42
  }
14
43
  //#endregion
15
- export { t as usePreviousValue };
44
+ export { a as formatWithAsYouType, s as getLengthIssue, n as sanitizeDigits, o as stripPrefix };
16
45
 
17
46
  //# sourceMappingURL=index364.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index364.js","names":["React"],"sources":["../../../node_modules/@base-ui/utils/usePreviousValue.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\n/**\n * Returns a previous value of its argument.\n * @param value Current value.\n * @returns Previous value, or null if there is no previous value.\n */\nexport function usePreviousValue(value) {\n const [state, setState] = React.useState({\n current: value,\n previous: null\n });\n if (!Object.is(value, state.current)) {\n setState({\n current: value,\n previous: state.current\n });\n }\n return state.previous;\n}"],"x_google_ignoreList":[0],"mappings":";;;AASA,SAAgB,EAAiB,GAAO;CACtC,IAAM,CAAC,GAAO,KAAYA,EAAM,SAAS;EACvC,SAAS;EACT,UAAU;CACZ,CAAC;CAOD,OANK,OAAO,GAAG,GAAO,EAAM,OAAO,KACjC,EAAS;EACP,SAAS;EACT,UAAU,EAAM;CAClB,CAAC,GAEI,EAAM;AACf"}
1
+ {"version":3,"file":"index364.js","names":["sanitizeDigits","value","DETECTED_COUNTRY_OVERRIDES","canonicalizeDetectedCountry","candidate","formatWithAsYouType","formatter","baseCountry","AsYouType","formatted","phoneNumber","detectedCountry","international","stripPrefix","prefix","getLengthIssue","country","validatePhoneNumberLength"],"sources":["../src/components/PhoneNumberInput/normalization.ts"],"sourcesContent":["import type { CountryCode } from \"libphonenumber-js\"\nimport { AsYouType, validatePhoneNumberLength } from \"libphonenumber-js\"\n\n\nexport type LengthIssue = \"TOO_LONG\"\n\nexport function sanitizeDigits(value: string) {\n return value.replace(/\\D/g, \"\")\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\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 }\n }\n\n const formatter = baseCountry ? new AsYouType(baseCountry) : new AsYouType()\n const formatted = formatter.input(value)\n const phoneNumber = formatter.getNumber()\n const detectedCountry = canonicalizeDetectedCountry(\n (phoneNumber?.country ?? formatter.country ?? undefined) as CountryCode | undefined\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 }\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"],"mappings":";;;AAMA,SAAgBA,EAAe,GAAe;CAC5C,OAAOC,EAAM,QAAQ,OAAO,EAAE;AAChC;AAEA,IAAMC,IAAwE;CAC5E,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAEA,SAASC,EAA4B,GAA6D;CAChG,IAAKC,GAGL,OAAOF,EAA2BE,MAAcA;AAClD;AAEA,SAAgBC,EAAoB,GAAe,GAA2B;CAC5E,IAAIJ,MAAU,KACZ,OAAO;EACL,eAAe;EACf,UAAU;EACV,WAAW;EACX,aAAa;EACb,iBAAiB,KAAA;CACnB;CAGF,IAAMK,IAAYC,IAAc,IAAIC,EAAUD,CAAW,IAAI,IAAIC,EAAU,GACrEC,IAAYH,EAAU,MAAML,CAAK,GACjCS,IAAcJ,EAAU,UAAU,GAClCK,IAAkBR,EACrBO,GAAa,WAAWJ,EAAU,WAAW,KAAA,CAChD,GACMM,IAAgBF,GAAa,oBAAoB,KAAKD;CAG5D,OAAO;EACL;EACA,UAJeC,GAAa,eAAe,KAAKV,EAAeY,CAAa;EAK5E;EACA;EACA;CACF;AACF;AAEA,SAAgBC,EAAY,GAAe,GAAgB;CACzD,OAAOZ,EAAM,WAAWa,CAAM,IAAIb,EAAM,MAAMa,EAAO,MAAM,IAAIb;AACjE;AAEA,SAAgBc,EAAe,GAAe,GAAsD;CAClG,IAAI,CAACC,KAAW,CAACf,GACf,OAAO;CAGT,IAAI;EAEF,OADegB,EAA0BhB,GAAOe,CACzC,MAAW,aAAa,aAAa;CAC9C,QAAQ;EACN,OAAO;CACT;AACF"}
package/dist/index365.js CHANGED
@@ -1,8 +1,72 @@
1
- //#region ../../node_modules/@base-ui/utils/isElementDisabled.mjs
1
+ //#region src/components/PhoneNumberInput/selection.ts
2
2
  function e(e) {
3
- return e == null || e.hasAttribute("disabled") || e.getAttribute("aria-disabled") === "true";
3
+ if (!e) return !1;
4
+ let t = e.charCodeAt(0);
5
+ return t >= 48 && t <= 57;
6
+ }
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;
11
+ }
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;
17
+ }
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
+ };
4
68
  }
5
69
  //#endregion
6
- export { e as isElementDisabled };
70
+ export { o as captureSelectionSnapshot, s as resolveSelection, i as skipFormattingCharactersLeft, a as skipFormattingCharactersRight };
7
71
 
8
72
  //# sourceMappingURL=index365.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index365.js","names":[],"sources":["../../../node_modules/@base-ui/utils/isElementDisabled.mjs"],"sourcesContent":["export function isElementDisabled(element) {\n return element == null || element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true';\n}"],"x_google_ignoreList":[0],"mappings":";AAAA,SAAgB,EAAkB,GAAS;CACzC,OAAO,KAAW,QAAQ,EAAQ,aAAa,UAAU,KAAK,EAAQ,aAAa,eAAe,MAAM;AAC1G"}
1
+ {"version":3,"file":"index365.js","names":["isDigitCharacter","char","code","countDigitsBefore","count","limit","index","value","position","findIndexForDigitCount","digitCount","seen","isFormattingCharacter","skipFormattingCharactersLeft","skipFormattingCharactersRight","captureSelectionSnapshot","input","selectionStart","selectionEnd","preserveStartIndex","preserveEndIndex","resolveSelection","snapshot","end","start","resolvedStart","resolvedEnd","clampedStart","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,EAAiB,GAAc;CACtC,IAAI,CAACC,GACH,OAAO;CAET,IAAMC,IAAOD,EAAK,WAAW,CAAC;CAC9B,OAAOC,KAAQ,MAAMA,KAAQ;AAC/B;AAEA,SAASC,EAAkB,GAAe,GAAe;CACvD,IAAIC,IAAQ,GACNC,IAAQ,KAAK,IAAIC,GAAOC,EAAM,MAAM;CAC1C,KAAK,IAAIC,IAAW,GAAGA,IAAWH,GAAO,KAAY,GACnD,AAAIL,EAAiBO,EAAMC,MAAa,EAAE,MACxC,KAAS;CAGb,OAAOJ;AACT;AAEA,SAASK,EAAuB,GAAe,GAAoB;CACjE,IAAIC,KAAc,GAChB,OAAOH,EAAM,WAAW,GAAG,IAAI,KAAK,IAAI,GAAGA,EAAM,MAAM,IAAI;CAG7D,IAAII,IAAO;CACX,KAAK,IAAIL,IAAQ,GAAGA,IAAQC,EAAM,QAAQ,KAAS,GACjD,IAAIP,EAAiBO,EAAMD,MAAU,EAAE,MACrC,KAAQ,GACJK,MAASD,IACX,OAAOJ,IAAQ;CAKrB,OAAOC,EAAM;AACf;AAEA,SAASK,EAAsB,GAAc;CAO3C,OANI,CAACX,KAGDD,EAAiBC,CAAI,IAChB,KAEFA,MAAS;AAClB;AAEA,SAAgBY,EAA6B,GAAe,GAAe;CACzE,IAAIL,IAAWF;CACf,OAAOE,IAAW,KAEXI,EADQL,EAAMC,IAAW,MAAM,EACL,IAG/B;CAEF,OAAOA;AACT;AAEA,SAAgBM,EAA8B,GAAe,GAAe;CAC1E,IAAIN,IAAWF;CACf,OAAOE,IAAWD,EAAM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KAAKA;CAAW,IAGvC;EAAE,OAAOD;EAAc,KAAKC;CAAW;AAChD"}
package/dist/index366.js CHANGED
@@ -1,51 +1,121 @@
1
- "use client";
2
- import { error as e } from "./index203.js";
3
- import * as t from "react";
4
- //#region ../../node_modules/@base-ui/utils/useControlled.mjs
5
- function n({ controlled: n, default: i, name: a, state: o = "value" }) {
6
- let { current: s } = t.useRef(n !== void 0), [c, l] = t.useState(i), u = s ? n : c;
7
- if (process.env.NODE_ENV !== "production") {
8
- t.useEffect(() => {
9
- s !== (n !== void 0) && e([
10
- `A component is changing the ${s ? "" : "un"}controlled ${o} state of ${a} to be ${s ? "un" : ""}controlled.`,
11
- "Elements should not switch from uncontrolled to controlled (or vice versa).",
12
- `Decide between using a controlled or uncontrolled ${a} element for the lifetime of the component.`,
13
- "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.",
14
- "More info: https://fb.me/react-controlled-components"
15
- ].join("\n"));
16
- }, [
17
- o,
18
- a,
19
- n
20
- ]);
21
- let { current: c } = t.useRef(i);
22
- t.useEffect(() => {
23
- !s && r(c) !== r(i) && e([`A component is changing the default ${o} state of an uncontrolled ${a} after being initialized. To suppress this warning opt to use a controlled ${a}.`].join("\n"));
24
- }, [i]);
1
+ import { cn as e } from "./index12.js";
2
+ import { c as t } from "react/compiler-runtime";
3
+ import * as n from "react";
4
+ import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ //#region src/components/PhoneNumberInput/suggestions.tsx
6
+ var o = n.createContext(null);
7
+ function s(e, t) {
8
+ if (typeof e == "function") {
9
+ e(t);
10
+ return;
25
11
  }
26
- return [u, t.useCallback((e) => {
27
- s || l(e);
28
- }, [])];
12
+ e && typeof e == "object" && Reflect.set(e, "current", t);
29
13
  }
30
- function r(e) {
31
- let t = 0, n = /* @__PURE__ */ new WeakMap();
32
- try {
33
- return JSON.stringify(e, function(e, r) {
34
- if (!(e === "_owner" && this != null && typeof this == "object" && "$$typeof" in this)) {
35
- if (typeof r == "bigint") return `__bigint__:${r}`;
36
- if (typeof r == "object" && r) {
37
- let e = n.get(r);
38
- if (e !== void 0) return `__object__:${e}`;
39
- n.set(r, t), t += 1;
40
- }
41
- return r;
42
- }
43
- }) ?? `__top__:${typeof e}`;
44
- } catch {
45
- return "__unserializable__";
46
- }
14
+ var c = (r) => {
15
+ let a = t(30), c = n.useContext(o), l = c?.highlightedValue === r.data.value, u, d, f;
16
+ a[0] === r.innerProps ? (u = a[1], d = a[2], f = a[3]) : ({onMouseMove: u, className: d, ...f} = r.innerProps, a[0] = r.innerProps, a[1] = u, a[2] = d, a[3] = f);
17
+ let m;
18
+ a[4] === c?.renderOptionLabel ? m = a[5] : (m = c?.renderOptionLabel ?? p, a[4] = c?.renderOptionLabel, a[5] = m);
19
+ let h = m, g = n.useRef(null), { innerRef: _ } = r, v;
20
+ a[6] === _ ? v = a[7] : (v = (e) => {
21
+ g.current = e, s(_, e);
22
+ }, a[6] = _, a[7] = v);
23
+ let y = v, b;
24
+ a[8] !== c?.consumeScrollBehavior || a[9] !== l ? (b = () => {
25
+ if (!l) return;
26
+ let e = c?.consumeScrollBehavior, t = e ? e() : "smooth", n = g.current;
27
+ if (!n) return;
28
+ let r = n.parentElement;
29
+ if (!r) return;
30
+ let i = n.offsetTop, a = i + n.offsetHeight, o = r.scrollTop, s = o + r.clientHeight;
31
+ i >= o && a <= s || n.scrollIntoView({
32
+ block: "nearest",
33
+ behavior: t
34
+ });
35
+ }, a[8] = c?.consumeScrollBehavior, a[9] = l, a[10] = b) : b = a[10];
36
+ let x;
37
+ a[11] !== c || a[12] !== l ? (x = [c, l], a[11] = c, a[12] = l, a[13] = x) : x = a[13], n.useEffect(b, x);
38
+ let S;
39
+ a[14] !== c || a[15] !== u || a[16] !== r.data ? (S = (e) => {
40
+ u?.(e), c?.setHighlightedOption(r.data);
41
+ }, a[14] = c, a[15] = u, a[16] = r.data, a[17] = S) : S = a[17];
42
+ let C = S, w = l ? "bg-muted text-foreground" : "text-foreground hover:bg-muted", T;
43
+ a[18] !== d || a[19] !== w ? (T = e("flex cursor-pointer items-center justify-between gap-3 px-3 py-2 text-sm", d, w), a[18] = d, a[19] = w, a[20] = T) : T = a[20];
44
+ let E;
45
+ a[21] !== r.data || a[22] !== h ? (E = h(r.data), a[21] = r.data, a[22] = h, a[23] = E) : E = a[23];
46
+ let D;
47
+ return a[24] !== y || a[25] !== C || a[26] !== f || a[27] !== T || a[28] !== E ? (D = /* @__PURE__ */ i("div", {
48
+ ref: y,
49
+ ...f,
50
+ onMouseMove: C,
51
+ className: T,
52
+ children: E
53
+ }), a[24] = y, a[25] = C, a[26] = f, a[27] = T, a[28] = E, a[29] = D) : D = a[29], D;
54
+ }, l = {
55
+ control: () => ({ display: "none" }),
56
+ menu: (e) => ({
57
+ ...e,
58
+ marginTop: 4,
59
+ borderRadius: "var(--radius)",
60
+ boxShadow: "0 18px 36px rgba(15, 23, 42, 0.18)",
61
+ backgroundColor: "hsl(var(--popover))",
62
+ overflow: "hidden",
63
+ zIndex: 20
64
+ }),
65
+ menuList: (e) => ({
66
+ ...e,
67
+ maxHeight: 240,
68
+ padding: 0
69
+ }),
70
+ option: (e, t) => ({
71
+ ...e,
72
+ fontSize: "0.875rem",
73
+ backgroundColor: t.isFocused ? "hsl(var(--muted))" : t.isSelected ? "hsl(var(--accent))" : "transparent",
74
+ color: t.isSelected ? "hsl(var(--accent-foreground))" : "hsl(var(--foreground))",
75
+ cursor: "pointer"
76
+ }),
77
+ noOptionsMessage: (e) => ({
78
+ ...e,
79
+ fontSize: "0.875rem",
80
+ color: "hsl(var(--muted-foreground))"
81
+ })
82
+ }, u = (e) => {
83
+ let n = t(5), { children: r, innerProps: a, innerRef: o } = e, s;
84
+ n[0] === Symbol.for("react.memo_cache_sentinel") ? (s = {
85
+ height: 0,
86
+ minHeight: 0,
87
+ opacity: 0,
88
+ overflow: "hidden",
89
+ pointerEvents: "none"
90
+ }, n[0] = s) : s = n[0];
91
+ let c;
92
+ return n[1] !== r || n[2] !== a || n[3] !== o ? (c = /* @__PURE__ */ i("div", {
93
+ ...a,
94
+ ref: o,
95
+ style: s,
96
+ children: r
97
+ }), n[1] = r, n[2] = a, n[3] = o, n[4] = c) : c = n[4], c;
98
+ }, d = () => null;
99
+ function f(e) {
100
+ return /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ a("span", {
101
+ className: "flex min-w-0 items-center gap-2",
102
+ children: [e.flag ? /* @__PURE__ */ i("span", {
103
+ "aria-hidden": "true",
104
+ className: "text-lg leading-none",
105
+ children: e.flag
106
+ }) : null, /* @__PURE__ */ i("span", {
107
+ className: "truncate",
108
+ children: e.name
109
+ })]
110
+ }), /* @__PURE__ */ a("span", {
111
+ className: "text-xs text-muted-foreground",
112
+ children: ["+", e.dialCode]
113
+ })] });
114
+ }
115
+ function p(e) {
116
+ return f(e);
47
117
  }
48
118
  //#endregion
49
- export { n as useControlled };
119
+ export { u as HiddenControl, d as NullComponent, o as SuggestionContext, c as SuggestionOption, f as formatCountryOption, l as suggestionSelectStyles };
50
120
 
51
121
  //# sourceMappingURL=index366.js.map