@rpcbase/ui 0.225.0 → 0.227.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 (612) hide show
  1. package/dist/components/PhoneNumberInput/index.d.ts +1 -1
  2. package/dist/components/PhoneNumberInput/index.d.ts.map +1 -1
  3. package/dist/components/PhoneNumberInput/normalization.d.ts +0 -28
  4. package/dist/components/PhoneNumberInput/normalization.d.ts.map +1 -1
  5. package/dist/components/PhoneNumberInput/suggestions.d.ts.map +1 -1
  6. package/dist/components/PhoneNumberInput/types.d.ts +4 -4
  7. package/dist/components/PhoneNumberInput/types.d.ts.map +1 -1
  8. package/dist/index106.js +36 -36
  9. package/dist/index118.js +6 -6
  10. package/dist/index121.js +10 -10
  11. package/dist/index123.js +2 -2
  12. package/dist/index124.js +3 -3
  13. package/dist/index125.js +1 -1
  14. package/dist/index127.js +2 -2
  15. package/dist/index129.js +2 -2
  16. package/dist/index150.js +11 -5
  17. package/dist/index150.js.map +1 -1
  18. package/dist/index151.js +63 -63
  19. package/dist/index151.js.map +1 -1
  20. package/dist/index152.js +38 -2
  21. package/dist/index152.js.map +1 -1
  22. package/dist/index153.js +13 -363
  23. package/dist/index153.js.map +1 -1
  24. package/dist/index154.js +23 -261
  25. package/dist/index154.js.map +1 -1
  26. package/dist/index155.js +108 -58
  27. package/dist/index155.js.map +1 -1
  28. package/dist/index156.js +13 -47
  29. package/dist/index156.js.map +1 -1
  30. package/dist/index157.js +4 -169
  31. package/dist/index157.js.map +1 -1
  32. package/dist/index158.js +4 -110
  33. package/dist/index158.js.map +1 -1
  34. package/dist/index159.js +5 -25
  35. package/dist/index159.js.map +1 -1
  36. package/dist/index160.js +12 -8
  37. package/dist/index160.js.map +1 -1
  38. package/dist/index161.js +19 -4
  39. package/dist/index161.js.map +1 -1
  40. package/dist/index162.js +13 -6
  41. package/dist/index162.js.map +1 -1
  42. package/dist/index163.js +261 -4
  43. package/dist/index163.js.map +1 -1
  44. package/dist/index164.js +4 -466
  45. package/dist/index164.js.map +1 -1
  46. package/dist/index165.js +27 -185
  47. package/dist/index165.js.map +1 -1
  48. package/dist/index166.js +124 -105
  49. package/dist/index166.js.map +1 -1
  50. package/dist/index167.js +5 -262
  51. package/dist/index167.js.map +1 -1
  52. package/dist/index168.js +78 -9
  53. package/dist/index168.js.map +1 -1
  54. package/dist/index169.js +63 -39
  55. package/dist/index169.js.map +1 -1
  56. package/dist/index170.js +8 -4
  57. package/dist/index170.js.map +1 -1
  58. package/dist/index171.js +16 -12
  59. package/dist/index171.js.map +1 -1
  60. package/dist/index172.js +89 -65
  61. package/dist/index172.js.map +1 -1
  62. package/dist/index173.js +66 -38
  63. package/dist/index173.js.map +1 -1
  64. package/dist/index174.js +45 -13
  65. package/dist/index174.js.map +1 -1
  66. package/dist/index175.js +5 -23
  67. package/dist/index175.js.map +1 -1
  68. package/dist/index176.js +66 -108
  69. package/dist/index176.js.map +1 -1
  70. package/dist/index177.js +2 -13
  71. package/dist/index177.js.map +1 -1
  72. package/dist/index178.js +363 -4
  73. package/dist/index178.js.map +1 -1
  74. package/dist/index179.js +262 -4
  75. package/dist/index179.js.map +1 -1
  76. package/dist/index18.js +383 -401
  77. package/dist/index18.js.map +1 -1
  78. package/dist/index180.js +61 -5
  79. package/dist/index180.js.map +1 -1
  80. package/dist/index181.js +46 -11
  81. package/dist/index181.js.map +1 -1
  82. package/dist/index182.js +168 -18
  83. package/dist/index182.js.map +1 -1
  84. package/dist/index183.js +110 -13
  85. package/dist/index183.js.map +1 -1
  86. package/dist/index184.js +24 -261
  87. package/dist/index184.js.map +1 -1
  88. package/dist/index185.js +8 -5
  89. package/dist/index185.js.map +1 -1
  90. package/dist/index186.js +5 -28
  91. package/dist/index186.js.map +1 -1
  92. package/dist/index187.js +5 -126
  93. package/dist/index187.js.map +1 -1
  94. package/dist/index188.js +4 -5
  95. package/dist/index188.js.map +1 -1
  96. package/dist/index189.js +465 -77
  97. package/dist/index189.js.map +1 -1
  98. package/dist/index190.js +181 -62
  99. package/dist/index190.js.map +1 -1
  100. package/dist/index191.js +107 -8
  101. package/dist/index191.js.map +1 -1
  102. package/dist/index192.js +262 -15
  103. package/dist/index192.js.map +1 -1
  104. package/dist/index193.js +8 -91
  105. package/dist/index193.js.map +1 -1
  106. package/dist/index194.js +42 -65
  107. package/dist/index194.js.map +1 -1
  108. package/dist/index195.js +4 -45
  109. package/dist/index195.js.map +1 -1
  110. package/dist/index196.js +20 -59
  111. package/dist/index196.js.map +1 -1
  112. package/dist/index197.js +66 -8
  113. package/dist/index197.js.map +1 -1
  114. package/dist/index198.js +6 -66
  115. package/dist/index198.js.map +1 -1
  116. package/dist/index199.js +11 -19
  117. package/dist/index199.js.map +1 -1
  118. package/dist/index200.js +48 -14
  119. package/dist/index200.js.map +1 -1
  120. package/dist/index201.js +4 -6
  121. package/dist/index201.js.map +1 -1
  122. package/dist/index202.js +29 -5
  123. package/dist/index202.js.map +1 -1
  124. package/dist/index203.js +16 -6
  125. package/dist/index203.js.map +1 -1
  126. package/dist/index204.js +5 -4
  127. package/dist/index204.js.map +1 -1
  128. package/dist/index205.js +21 -6
  129. package/dist/index205.js.map +1 -1
  130. package/dist/index206.js +51 -16
  131. package/dist/index206.js.map +1 -1
  132. package/dist/index207.js +25 -4
  133. package/dist/index207.js.map +1 -1
  134. package/dist/index208.js +41 -4
  135. package/dist/index208.js.map +1 -1
  136. package/dist/index209.js +39 -12
  137. package/dist/index209.js.map +1 -1
  138. package/dist/index210.js +45 -10
  139. package/dist/index210.js.map +1 -1
  140. package/dist/index211.js +20 -13
  141. package/dist/index211.js.map +1 -1
  142. package/dist/index212.js +70 -13
  143. package/dist/index212.js.map +1 -1
  144. package/dist/index213.js +17 -4
  145. package/dist/index213.js.map +1 -1
  146. package/dist/index214.js +11 -5
  147. package/dist/index214.js.map +1 -1
  148. package/dist/index215.js +27 -6
  149. package/dist/index215.js.map +1 -1
  150. package/dist/index216.js +13 -5
  151. package/dist/index216.js.map +1 -1
  152. package/dist/index217.js +17 -53
  153. package/dist/index217.js.map +1 -1
  154. package/dist/index218.js +36 -8
  155. package/dist/index218.js.map +1 -1
  156. package/dist/index219.js +262 -4
  157. package/dist/index219.js.map +1 -1
  158. package/dist/index220.js +278 -4
  159. package/dist/index220.js.map +1 -1
  160. package/dist/index221.js +68 -8
  161. package/dist/index221.js.map +1 -1
  162. package/dist/index222.js +99 -4
  163. package/dist/index222.js.map +1 -1
  164. package/dist/index223.js +83 -4
  165. package/dist/index223.js.map +1 -1
  166. package/dist/index224.js +3 -3
  167. package/dist/index224.js.map +1 -1
  168. package/dist/index225.js +29 -10
  169. package/dist/index225.js.map +1 -1
  170. package/dist/index226.js +16 -9
  171. package/dist/index226.js.map +1 -1
  172. package/dist/index227.js +35 -10
  173. package/dist/index227.js.map +1 -1
  174. package/dist/index228.js +16 -10
  175. package/dist/index228.js.map +1 -1
  176. package/dist/index229.js +3 -10
  177. package/dist/index229.js.map +1 -1
  178. package/dist/index230.js +26 -9
  179. package/dist/index230.js.map +1 -1
  180. package/dist/index231.js +28 -6
  181. package/dist/index231.js.map +1 -1
  182. package/dist/index232.js +4 -6
  183. package/dist/index232.js.map +1 -1
  184. package/dist/index233.js +78 -4
  185. package/dist/index233.js.map +1 -1
  186. package/dist/index234.js +269 -5
  187. package/dist/index234.js.map +1 -1
  188. package/dist/index235.js +11 -6
  189. package/dist/index235.js.map +1 -1
  190. package/dist/index236.js +10 -5
  191. package/dist/index236.js.map +1 -1
  192. package/dist/index237.js +25 -29
  193. package/dist/index237.js.map +1 -1
  194. package/dist/index238.js +16 -12
  195. package/dist/index238.js.map +1 -1
  196. package/dist/index239.js +124 -24
  197. package/dist/index239.js.map +1 -1
  198. package/dist/index240.js +5 -5
  199. package/dist/index240.js.map +1 -1
  200. package/dist/index241.js +40 -16
  201. package/dist/index241.js.map +1 -1
  202. package/dist/index242.js +65 -7
  203. package/dist/index242.js.map +1 -1
  204. package/dist/index243.js +13 -10
  205. package/dist/index243.js.map +1 -1
  206. package/dist/index244.js +7 -10
  207. package/dist/index244.js.map +1 -1
  208. package/dist/index245.js +5 -21
  209. package/dist/index245.js.map +1 -1
  210. package/dist/index246.js +3 -10
  211. package/dist/index246.js.map +1 -1
  212. package/dist/index247.js +10 -9
  213. package/dist/index247.js.map +1 -1
  214. package/dist/index248.js +7 -9
  215. package/dist/index248.js.map +1 -1
  216. package/dist/index249.js +133 -4
  217. package/dist/index249.js.map +1 -1
  218. package/dist/index250.js +399 -5
  219. package/dist/index250.js.map +1 -1
  220. package/dist/index251.js +52 -16
  221. package/dist/index251.js.map +1 -1
  222. package/dist/index252.js +11 -9
  223. package/dist/index252.js.map +1 -1
  224. package/dist/index253.js +11 -18
  225. package/dist/index253.js.map +1 -1
  226. package/dist/index254.js +58 -15
  227. package/dist/index254.js.map +1 -1
  228. package/dist/index255.js +8 -12
  229. package/dist/index255.js.map +1 -1
  230. package/dist/index256.js +65 -12
  231. package/dist/index256.js.map +1 -1
  232. package/dist/index257.js +17 -152
  233. package/dist/index257.js.map +1 -1
  234. package/dist/index258.js +15 -29
  235. package/dist/index258.js.map +1 -1
  236. package/dist/index259.js +5 -9
  237. package/dist/index259.js.map +1 -1
  238. package/dist/index260.js +4 -47
  239. package/dist/index260.js.map +1 -1
  240. package/dist/index261.js +6 -11
  241. package/dist/index261.js.map +1 -1
  242. package/dist/index262.js +4 -44
  243. package/dist/index262.js.map +1 -1
  244. package/dist/index263.js +6 -95
  245. package/dist/index263.js.map +1 -1
  246. package/dist/index264.js +16 -86
  247. package/dist/index264.js.map +1 -1
  248. package/dist/index265.js +4 -105
  249. package/dist/index265.js.map +1 -1
  250. package/dist/index266.js +4 -52
  251. package/dist/index266.js.map +1 -1
  252. package/dist/index267.js +12 -11
  253. package/dist/index267.js.map +1 -1
  254. package/dist/index268.js +9 -37
  255. package/dist/index268.js.map +1 -1
  256. package/dist/index269.js +13 -8
  257. package/dist/index269.js.map +1 -1
  258. package/dist/index270.js +13 -116
  259. package/dist/index270.js.map +1 -1
  260. package/dist/index271.js +4 -17
  261. package/dist/index271.js.map +1 -1
  262. package/dist/index272.js +5 -15
  263. package/dist/index272.js.map +1 -1
  264. package/dist/index273.js +6 -3
  265. package/dist/index273.js.map +1 -1
  266. package/dist/index274.js +5 -36
  267. package/dist/index274.js.map +1 -1
  268. package/dist/index275.js +53 -19
  269. package/dist/index275.js.map +1 -1
  270. package/dist/index276.js +8 -9
  271. package/dist/index276.js.map +1 -1
  272. package/dist/index277.js +4 -8
  273. package/dist/index277.js.map +1 -1
  274. package/dist/index278.js +4 -19
  275. package/dist/index278.js.map +1 -1
  276. package/dist/index279.js +8 -28
  277. package/dist/index279.js.map +1 -1
  278. package/dist/index280.js +4 -16
  279. package/dist/index280.js.map +1 -1
  280. package/dist/index281.js +4 -66
  281. package/dist/index281.js.map +1 -1
  282. package/dist/index282.js +3 -8
  283. package/dist/index282.js.map +1 -1
  284. package/dist/index283.js +10 -11
  285. package/dist/index283.js.map +1 -1
  286. package/dist/index284.js +9 -8
  287. package/dist/index284.js.map +1 -1
  288. package/dist/index285.js +9 -5
  289. package/dist/index285.js.map +1 -1
  290. package/dist/index286.js +10 -13
  291. package/dist/index286.js.map +1 -1
  292. package/dist/index287.js +10 -3
  293. package/dist/index287.js.map +1 -1
  294. package/dist/index288.js +9 -3
  295. package/dist/index288.js.map +1 -1
  296. package/dist/index289.js +6 -99
  297. package/dist/index289.js.map +1 -1
  298. package/dist/index290.js +5 -17
  299. package/dist/index290.js.map +1 -1
  300. package/dist/index291.js +4 -5
  301. package/dist/index291.js.map +1 -1
  302. package/dist/index292.js +5 -29
  303. package/dist/index292.js.map +1 -1
  304. package/dist/index293.js +6 -51
  305. package/dist/index293.js.map +1 -1
  306. package/dist/index294.js +5 -133
  307. package/dist/index294.js.map +1 -1
  308. package/dist/index295.js +15 -7
  309. package/dist/index295.js.map +1 -1
  310. package/dist/index296.js +8 -5
  311. package/dist/index296.js.map +1 -1
  312. package/dist/index297.js +11 -4
  313. package/dist/index297.js.map +1 -1
  314. package/dist/index298.js +10 -11
  315. package/dist/index298.js.map +1 -1
  316. package/dist/index299.js +21 -21
  317. package/dist/index299.js.map +1 -1
  318. package/dist/index300.js +10 -122
  319. package/dist/index300.js.map +1 -1
  320. package/dist/index301.js +9 -27
  321. package/dist/index301.js.map +1 -1
  322. package/dist/index302.js +9 -32
  323. package/dist/index302.js.map +1 -1
  324. package/dist/index303.js +4 -73
  325. package/dist/index303.js.map +1 -1
  326. package/dist/index304.js +5 -262
  327. package/dist/index304.js.map +1 -1
  328. package/dist/index305.js +14 -26
  329. package/dist/index305.js.map +1 -1
  330. package/dist/index306.js +9 -6
  331. package/dist/index306.js.map +1 -1
  332. package/dist/index307.js +18 -142
  333. package/dist/index307.js.map +1 -1
  334. package/dist/index308.js +15 -61
  335. package/dist/index308.js.map +1 -1
  336. package/dist/index309.js +10 -47
  337. package/dist/index309.js.map +1 -1
  338. package/dist/index310.js +28 -13
  339. package/dist/index310.js.map +1 -1
  340. package/dist/index311.js +13 -20
  341. package/dist/index311.js.map +1 -1
  342. package/dist/index312.js +25 -11
  343. package/dist/index312.js.map +1 -1
  344. package/dist/index313.js +5 -50
  345. package/dist/index313.js.map +1 -1
  346. package/dist/index314.js +8 -16
  347. package/dist/index314.js.map +1 -1
  348. package/dist/index315.js +11 -21
  349. package/dist/index315.js.map +1 -1
  350. package/dist/index316.js +7 -50
  351. package/dist/index316.js.map +1 -1
  352. package/dist/index317.js +13 -25
  353. package/dist/index317.js.map +1 -1
  354. package/dist/index318.js +3 -41
  355. package/dist/index318.js.map +1 -1
  356. package/dist/index319.js +3 -39
  357. package/dist/index319.js.map +1 -1
  358. package/dist/index320.js +18 -45
  359. package/dist/index320.js.map +1 -1
  360. package/dist/index321.js +5 -20
  361. package/dist/index321.js.map +1 -1
  362. package/dist/index322.js +49 -68
  363. package/dist/index322.js.map +1 -1
  364. package/dist/index323.js +119 -14
  365. package/dist/index323.js.map +1 -1
  366. package/dist/index324.js +32 -11
  367. package/dist/index324.js.map +1 -1
  368. package/dist/index325.js +73 -13
  369. package/dist/index325.js.map +1 -1
  370. package/dist/index326.js +142 -18
  371. package/dist/index326.js.map +1 -1
  372. package/dist/index327.js +61 -36
  373. package/dist/index327.js.map +1 -1
  374. package/dist/index328.js +49 -278
  375. package/dist/index328.js.map +1 -1
  376. package/dist/index329.js +15 -69
  377. package/dist/index329.js.map +1 -1
  378. package/dist/index330.js +7 -82
  379. package/dist/index330.js.map +1 -1
  380. package/dist/index331.js +5 -4
  381. package/dist/index331.js.map +1 -1
  382. package/dist/index332.js +11 -29
  383. package/dist/index332.js.map +1 -1
  384. package/dist/index333.js +21 -16
  385. package/dist/index333.js.map +1 -1
  386. package/dist/index334.js +14 -35
  387. package/dist/index334.js.map +1 -1
  388. package/dist/index335.js +154 -16
  389. package/dist/index335.js.map +1 -1
  390. package/dist/index336.js +30 -3
  391. package/dist/index336.js.map +1 -1
  392. package/dist/index337.js +9 -26
  393. package/dist/index337.js.map +1 -1
  394. package/dist/index338.js +49 -4
  395. package/dist/index338.js.map +1 -1
  396. package/dist/index339.js +10 -77
  397. package/dist/index339.js.map +1 -1
  398. package/dist/index34.js +4 -4
  399. package/dist/index340.js +43 -268
  400. package/dist/index340.js.map +1 -1
  401. package/dist/index341.js +95 -11
  402. package/dist/index341.js.map +1 -1
  403. package/dist/index342.js +87 -11
  404. package/dist/index342.js.map +1 -1
  405. package/dist/index343.js +104 -24
  406. package/dist/index343.js.map +1 -1
  407. package/dist/index344.js +52 -16
  408. package/dist/index344.js.map +1 -1
  409. package/dist/index345.js +10 -124
  410. package/dist/index345.js.map +1 -1
  411. package/dist/index346.js +37 -5
  412. package/dist/index346.js.map +1 -1
  413. package/dist/index347.js +7 -39
  414. package/dist/index347.js.map +1 -1
  415. package/dist/index348.js +108 -57
  416. package/dist/index348.js.map +1 -1
  417. package/dist/index349.js +18 -14
  418. package/dist/index349.js.map +1 -1
  419. package/dist/index35.js +5 -5
  420. package/dist/index350.js +15 -7
  421. package/dist/index350.js.map +1 -1
  422. package/dist/index351.js +3 -5
  423. package/dist/index351.js.map +1 -1
  424. package/dist/index352.js +36 -3
  425. package/dist/index352.js.map +1 -1
  426. package/dist/index353.js +20 -10
  427. package/dist/index353.js.map +1 -1
  428. package/dist/index354.js +9 -7
  429. package/dist/index354.js.map +1 -1
  430. package/dist/index355.js +7 -398
  431. package/dist/index355.js.map +1 -1
  432. package/dist/index356.js +18 -51
  433. package/dist/index356.js.map +1 -1
  434. package/dist/index357.js +28 -11
  435. package/dist/index357.js.map +1 -1
  436. package/dist/index358.js +16 -11
  437. package/dist/index358.js.map +1 -1
  438. package/dist/index359.js +4 -5
  439. package/dist/index359.js.map +1 -1
  440. package/dist/index36.js +10 -10
  441. package/dist/index360.js +11 -17
  442. package/dist/index360.js.map +1 -1
  443. package/dist/index361.js +16 -12
  444. package/dist/index361.js.map +1 -1
  445. package/dist/index362.js +5 -20
  446. package/dist/index362.js.map +1 -1
  447. package/dist/index363.js +20 -8
  448. package/dist/index363.js.map +1 -1
  449. package/dist/index364.js +44 -25
  450. package/dist/index364.js.map +1 -1
  451. package/dist/index365.js +18 -27
  452. package/dist/index365.js.map +1 -1
  453. package/dist/index366.js +5 -138
  454. package/dist/index366.js.map +1 -1
  455. package/dist/index367.js +199 -11
  456. package/dist/index367.js.map +1 -1
  457. package/dist/index368.js +75 -224
  458. package/dist/index368.js.map +1 -1
  459. package/dist/index369.js +4 -3
  460. package/dist/index369.js.map +1 -1
  461. package/dist/index37.js +3 -3
  462. package/dist/index370.js +18 -20
  463. package/dist/index370.js.map +1 -1
  464. package/dist/index371.js +12 -77
  465. package/dist/index371.js.map +1 -1
  466. package/dist/index372.js +9 -12
  467. package/dist/index372.js.map +1 -1
  468. package/dist/index373.js +26 -4
  469. package/dist/index373.js.map +1 -1
  470. package/dist/index374.js +26 -77
  471. package/dist/index374.js.map +1 -1
  472. package/dist/index375.js +134 -197
  473. package/dist/index375.js.map +1 -1
  474. package/dist/index376.js +11 -70
  475. package/dist/index376.js.map +1 -1
  476. package/dist/index377.js +227 -9
  477. package/dist/index377.js.map +1 -1
  478. package/dist/index378.js +3 -15
  479. package/dist/index378.js.map +1 -1
  480. package/dist/index379.js +18 -15
  481. package/dist/index379.js.map +1 -1
  482. package/dist/index38.js +4 -4
  483. package/dist/index380.js +78 -4
  484. package/dist/index380.js.map +1 -1
  485. package/dist/index381.js +12 -12
  486. package/dist/index381.js.map +1 -1
  487. package/dist/index382.js +3 -5
  488. package/dist/index382.js.map +1 -1
  489. package/dist/index383.js +70 -19
  490. package/dist/index383.js.map +1 -1
  491. package/dist/index384.js +9 -45
  492. package/dist/index384.js.map +1 -1
  493. package/dist/index385.js +16 -18
  494. package/dist/index385.js.map +1 -1
  495. package/dist/index386.js +21 -5
  496. package/dist/index386.js.map +1 -1
  497. package/dist/index387.js +3 -5
  498. package/dist/index387.js.map +1 -1
  499. package/dist/index388.js +3 -5
  500. package/dist/index388.js.map +1 -1
  501. package/dist/index389.js +5 -4
  502. package/dist/index389.js.map +1 -1
  503. package/dist/index39.js +5 -5
  504. package/dist/index390.js +4 -15
  505. package/dist/index390.js.map +1 -1
  506. package/dist/index391.js +4 -9
  507. package/dist/index391.js.map +1 -1
  508. package/dist/index392.js +15 -5
  509. package/dist/index392.js.map +1 -1
  510. package/dist/index393.js +8 -4
  511. package/dist/index393.js.map +1 -1
  512. package/dist/index394.js +5 -545
  513. package/dist/index394.js.map +1 -1
  514. package/dist/index395.js +5 -47
  515. package/dist/index395.js.map +1 -1
  516. package/dist/index396.js +543 -15
  517. package/dist/index396.js.map +1 -1
  518. package/dist/index397.js +47 -6
  519. package/dist/index397.js.map +1 -1
  520. package/dist/index398.js +17 -7
  521. package/dist/index398.js.map +1 -1
  522. package/dist/index399.js +5 -6
  523. package/dist/index399.js.map +1 -1
  524. package/dist/index40.js +3 -3
  525. package/dist/index400.js +7 -7
  526. package/dist/index400.js.map +1 -1
  527. package/dist/index401.js +6 -11
  528. package/dist/index401.js.map +1 -1
  529. package/dist/index402.js +7 -8
  530. package/dist/index402.js.map +1 -1
  531. package/dist/index403.js +11 -12
  532. package/dist/index403.js.map +1 -1
  533. package/dist/index404.js +8 -14
  534. package/dist/index404.js.map +1 -1
  535. package/dist/index405.js +12 -491
  536. package/dist/index405.js.map +1 -1
  537. package/dist/index406.js +15 -3
  538. package/dist/index406.js.map +1 -1
  539. package/dist/index407.js +492 -3
  540. package/dist/index407.js.map +1 -1
  541. package/dist/index408.js +7 -4
  542. package/dist/index408.js.map +1 -1
  543. package/dist/index409.js +2 -56
  544. package/dist/index409.js.map +1 -1
  545. package/dist/index41.js +10 -10
  546. package/dist/index410.js +43 -67
  547. package/dist/index410.js.map +1 -1
  548. package/dist/index411.js +56 -31
  549. package/dist/index411.js.map +1 -1
  550. package/dist/index412.js +8 -9
  551. package/dist/index412.js.map +1 -1
  552. package/dist/index413.js +2 -153
  553. package/dist/index413.js.map +1 -1
  554. package/dist/index414.js +54 -107
  555. package/dist/index414.js.map +1 -1
  556. package/dist/index415.js +55 -7
  557. package/dist/index415.js.map +1 -1
  558. package/dist/index416.js +5 -2
  559. package/dist/index416.js.map +1 -1
  560. package/dist/index417.js +54 -42
  561. package/dist/index417.js.map +1 -1
  562. package/dist/index418.js +68 -56
  563. package/dist/index418.js.map +1 -1
  564. package/dist/index419.js +31 -8
  565. package/dist/index419.js.map +1 -1
  566. package/dist/index420.js +9 -2
  567. package/dist/index420.js.map +1 -1
  568. package/dist/index421.js +152 -54
  569. package/dist/index421.js.map +1 -1
  570. package/dist/index422.js +108 -56
  571. package/dist/index422.js.map +1 -1
  572. package/dist/index423.js +2 -16
  573. package/dist/index423.js.map +1 -1
  574. package/dist/index424.js +2 -29
  575. package/dist/index424.js.map +1 -1
  576. package/dist/index425.js +2 -13
  577. package/dist/index425.js.map +1 -1
  578. package/dist/index426.js +2 -7
  579. package/dist/index426.js.map +1 -1
  580. package/dist/index427.js +16 -2
  581. package/dist/index427.js.map +1 -1
  582. package/dist/index428.js +29 -2
  583. package/dist/index428.js.map +1 -1
  584. package/dist/index429.js +13 -2
  585. package/dist/index429.js.map +1 -1
  586. package/dist/index430.js +7 -2
  587. package/dist/index430.js.map +1 -1
  588. package/dist/index44.js +22 -21
  589. package/dist/index44.js.map +1 -1
  590. package/dist/index45.js +22 -196
  591. package/dist/index45.js.map +1 -1
  592. package/dist/index47.js +48 -40
  593. package/dist/index47.js.map +1 -1
  594. package/dist/index48.js +2 -2
  595. package/dist/index49.js +34 -34
  596. package/dist/index50.js +29 -29
  597. package/dist/index51.js +2 -2
  598. package/dist/index52.js +12 -12
  599. package/dist/index53.js +4 -4
  600. package/dist/index54.js +1 -1
  601. package/dist/index55.js +22 -22
  602. package/dist/index56.js +5 -5
  603. package/dist/index57.js +5 -5
  604. package/dist/index58.js +8 -8
  605. package/dist/index59.js +5 -5
  606. package/dist/index60.js +17 -17
  607. package/dist/index61.js +5 -5
  608. package/dist/index62.js +3 -3
  609. package/dist/index76.js +1 -1
  610. package/dist/index77.js +2 -2
  611. package/dist/index78.js +2 -2
  612. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index18.js","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 DEFAULT_COUNTRY,\n COMMON_IDD_PREFIXES,\n buildFallbackSelectedCountry,\n getCachedCountryOptions,\n getLocaleCacheKey,\n getValidCountry,\n normalizeSearchValue,\n optionMatchIndex,\n parseLocaleCacheKey,\n toSelectedCountry,\n} from \"./country-options\"\nimport {\n detectNationalPrefixForDisplay,\n formatWithAsYouType,\n getLengthIssue,\n getSuggestionState,\n injectNationalPrefixDisplay,\n normalizeInputValue,\n sanitizeDigits,\n shouldDisplayExplicitCountrySelection,\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\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 hasConfiguredCountry =\n typeof defaultCountry === \"string\" || typeof countryProp === \"string\"\n\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 fallbackCountry = 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 hasResolvedCountryRef = React.useRef<boolean>(hasConfiguredCountry)\n\n const initialStateRef = React.useRef<{\n country: CountryCode\n inputValue: string\n normalizedValue: string\n hasExplicitCountrySelection: boolean\n } | null>(null)\n const lastNormalizedRef = React.useRef<string>(\"\")\n\n if (!initialStateRef.current) {\n if (!value) {\n initialStateRef.current = {\n country: fallbackCountry,\n inputValue: \"\",\n normalizedValue: \"\",\n hasExplicitCountrySelection: false,\n }\n lastNormalizedRef.current = \"\"\n } else {\n const baseCountryForInit = hasConfiguredCountry ? fallbackCountry : undefined\n const normalized = normalizeInputValue(value, baseCountryForInit, { allowJustPlus: true })\n if (!normalized) {\n initialStateRef.current = {\n country: fallbackCountry,\n inputValue: \"\",\n normalizedValue: \"\",\n hasExplicitCountrySelection: false,\n }\n lastNormalizedRef.current = \"\"\n } else {\n const {\n international,\n phoneNumber,\n detectedCountry,\n inferredCountry,\n hasExplicitInternationalPrefix,\n } = formatWithAsYouType(normalized, baseCountryForInit)\n const canonicalDetectedCountry = detectedCountry ?? undefined\n let resolvedCountry = canonicalDetectedCountry ?? fallbackCountry\n const rawDigits = sanitizeDigits(value ?? \"\")\n const hasExplicitPlus = typeof value === \"string\" ? /^\\s*\\+/.test(value) : false\n const internationalDigits = sanitizeDigits(international)\n const initialDialCode = getCountryCallingCode(resolvedCountry)\n const initialHasPrefix = detectNationalPrefixForDisplay(\n rawDigits,\n internationalDigits,\n initialDialCode,\n hasExplicitPlus\n )\n\n const suggestion = getSuggestionState(\n normalized,\n baseCountryForInit,\n phoneNumber ?? undefined,\n {\n hasRemovedNationalPrefix: initialHasPrefix,\n detectedCountry: canonicalDetectedCountry,\n hasExplicitInternationalPrefix,\n }\n )\n\n const inferredCountryToApply =\n !suggestion.shouldSuggest && !canonicalDetectedCountry ? inferredCountry : undefined\n\n\n if (inferredCountryToApply) {\n resolvedCountry = inferredCountryToApply\n }\n\n const resolvedFromValue =\n Boolean(canonicalDetectedCountry) || Boolean(inferredCountryToApply)\n if (resolvedFromValue) {\n hasResolvedCountryRef.current = true\n }\n\n const nextDialCode = getCountryCallingCode(resolvedCountry)\n const finalHasPrefix = inferredCountryToApply\n ? detectNationalPrefixForDisplay(\n rawDigits,\n internationalDigits,\n nextDialCode,\n hasExplicitPlus\n )\n : initialHasPrefix\n\n const displayValue = injectNationalPrefixDisplay(international, nextDialCode, {\n force: finalHasPrefix,\n })\n\n const displayDetectedCountry = canonicalDetectedCountry ?? undefined\n const allowInlineFlag = hasResolvedCountryRef.current\n initialStateRef.current = {\n country: resolvedCountry,\n inputValue: displayValue,\n normalizedValue: normalized,\n hasExplicitCountrySelection:\n allowInlineFlag &&\n shouldDisplayExplicitCountrySelection(suggestion, {\n detectedCountry: displayDetectedCountry,\n hasExplicitInternationalPrefix,\n }),\n }\n lastNormalizedRef.current = normalized\n }\n }\n }\n\n const initialState = initialStateRef.current\n\n const [uncontrolledCountry, setUncontrolledCountry] = React.useState(initialState.country)\n const [inputValueState, setInputValueState] = React.useState(initialState.inputValue)\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 [lengthIssue, setLengthIssue] = React.useState<LengthIssue | null>(null)\n const [hasExplicitCountrySelection, setHasExplicitCountrySelection] = React.useState(\n initialState.hasExplicitCountrySelection\n )\n const manualSelectionCountryRef = React.useRef<CountryCode | null>(null)\n\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 consumeScrollBehavior = React.useCallback(() => {\n const behavior = scrollBehaviorRef.current\n scrollBehaviorRef.current = \"smooth\"\n return behavior\n }, [])\n\n const isCountryControlled = typeof countryProp === \"string\"\n const selectedCountry = isCountryControlled ? countryProp : uncontrolledCountry\n const activeCountry = selectedCountry ?? fallbackCountry\n\n const inputRef = React.useRef<HTMLInputElement | null>(null)\n\n React.useImperativeHandle(forwardedRef, () => inputRef.current as HTMLInputElement, [])\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 {\n styles: userSelectStyles,\n components: userSelectComponents,\n classNamePrefix: userClassNamePrefix,\n formatOptionLabel: userFormatOptionLabel,\n ...forwardedSelectProps\n } = selectOverrides\n const { noOptionsMessage, ...restForwardedSelectProps } = forwardedSelectProps\n\n const mergedSelectStyles = React.useMemo<StylesConfig<CountryOption, false>>(\n () => ({\n ...suggestionSelectStyles,\n ...(userSelectStyles ?? {}),\n }),\n [userSelectStyles]\n )\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 const hasAnnouncedCountryRef = React.useRef(false)\n\n const notifyCountryChange = React.useCallback(\n (country: CountryCode) => {\n hasAnnouncedCountryRef.current = true\n const selection = resolveSelectedCountry(country)\n onCountryChange?.(country, selection)\n return selection\n },\n [onCountryChange, resolveSelectedCountry]\n )\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 baseCountryForSync = hasResolvedCountryRef.current ? activeCountry : undefined\n const previousNormalized = lastNormalizedRef.current\n const normalized = normalizeInputValue(value, baseCountryForSync, {\n allowJustPlus: true,\n previousValue: previousNormalized,\n })\n lastNormalizedRef.current = normalized\n keyboardBufferRef.current = \"\"\n\n if (!normalized) {\n setInputValueState(\"\")\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n const nextCountry = hasConfiguredCountry ? fallbackCountry : activeCountry\n if (!isCountryControlled && uncontrolledCountry !== nextCountry) {\n setUncontrolledCountry(nextCountry)\n notifyCountryChange(nextCountry)\n }\n return\n }\n\n if (normalized === \"0\") {\n setInputValueState(\"0\")\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n return\n }\n\n if (normalized === \"+\") {\n setInputValueState(\"+\")\n setShowSuggestions(true)\n setCountryQuery(\"\")\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n const nextCountry = hasConfiguredCountry ? fallbackCountry : activeCountry\n if (!isCountryControlled && uncontrolledCountry !== nextCountry) {\n setUncontrolledCountry(nextCountry)\n notifyCountryChange(nextCountry)\n }\n return\n }\n\n const {\n international,\n phoneNumber,\n detectedCountry,\n inferredCountry,\n hasExplicitInternationalPrefix,\n } = formatWithAsYouType(normalized, baseCountryForSync)\n const canonicalDetectedCountry = detectedCountry ?? undefined\n let nextCountry = canonicalDetectedCountry ?? baseCountryForSync ?? activeCountry\n const rawDigits = sanitizeDigits(value ?? \"\")\n const hasExplicitPlus = typeof value === \"string\" ? /^\\s*\\+/.test(value) : false\n const internationalDigits = sanitizeDigits(international)\n const initialDialCode = getCountryCallingCode(nextCountry)\n const initialHasTypedTrunk = detectNationalPrefixForDisplay(\n rawDigits,\n internationalDigits,\n initialDialCode,\n hasExplicitPlus\n )\n\n const suggestion = getSuggestionState(\n normalized,\n baseCountryForSync,\n phoneNumber ?? undefined,\n {\n hasRemovedNationalPrefix: initialHasTypedTrunk,\n detectedCountry: canonicalDetectedCountry,\n hasExplicitInternationalPrefix,\n }\n )\n\n const inferredCountryToApply =\n !suggestion.shouldSuggest && !canonicalDetectedCountry ? inferredCountry : undefined\n const finalCountry = inferredCountryToApply ?? nextCountry\n\n const resolvedFromValue =\n Boolean(canonicalDetectedCountry) || Boolean(inferredCountryToApply)\n if (resolvedFromValue) {\n hasResolvedCountryRef.current = true\n }\n\n if (!isCountryControlled && finalCountry !== uncontrolledCountry) {\n setUncontrolledCountry(finalCountry)\n notifyCountryChange(finalCountry)\n }\n\n nextCountry = finalCountry\n\n if (\n manualSelectionCountryRef.current &&\n manualSelectionCountryRef.current !== nextCountry\n ) {\n manualSelectionCountryRef.current = null\n }\n\n const nextDialCode = getCountryCallingCode(nextCountry)\n const hasTypedTrunk = inferredCountryToApply\n ? detectNationalPrefixForDisplay(\n rawDigits,\n internationalDigits,\n nextDialCode,\n hasExplicitPlus\n )\n : initialHasTypedTrunk\n\n const displayValue = injectNationalPrefixDisplay(international, nextDialCode, {\n force: hasTypedTrunk,\n })\n const displayDetectedCountry = canonicalDetectedCountry ?? undefined\n const manualSelectionActive = manualSelectionCountryRef.current != null\n const shouldShowInlineFlag =\n manualSelectionActive ||\n shouldDisplayExplicitCountrySelection(suggestion, {\n detectedCountry: displayDetectedCountry,\n hasExplicitInternationalPrefix,\n })\n\n setInputValueState(displayValue)\n setShowSuggestions(suggestion.shouldSuggest)\n setCountryQuery(suggestion.query)\n setLengthIssue(hasResolvedCountryRef.current ? getLengthIssue(normalized, nextCountry) : null)\n setHasExplicitCountrySelection(hasResolvedCountryRef.current && shouldShowInlineFlag)\n }, [\n value,\n activeCountry,\n fallbackCountry,\n hasConfiguredCountry,\n isCountryControlled,\n notifyCountryChange,\n uncontrolledCountry,\n ])\n\n React.useEffect(() => {\n if (hasAnnouncedCountryRef.current) {\n return\n }\n if (!hasResolvedCountryRef.current) {\n return\n }\n const current = selectedCountry ?? fallbackCountry\n if (!current) {\n return\n }\n notifyCountryChange(current)\n }, [fallbackCountry, notifyCountryChange, selectedCountry])\n\n React.useEffect(() => {\n if (isCountryControlled && countryProp && countryProp !== uncontrolledCountry) {\n setUncontrolledCountry(countryProp)\n }\n }, [countryProp, isCountryControlled, uncontrolledCountry])\n\n const emitChange = React.useCallback(\n (details: Omit<PhoneNumberChangeDetails, \"selectedCountry\">) => {\n const selection = resolveSelectedCountry(details.country)\n onChange?.({\n ...details,\n selectedCountry: selection,\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 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 baseCountryForInput = hasResolvedCountryRef.current ? activeCountry : undefined\n const dialCode = baseCountryForInput ? getCountryCallingCode(baseCountryForInput) : \"\"\n const typedDigits = sanitizeDigits(raw)\n const hasExplicitPlus = raw.trim().startsWith(\"+\")\n const startsWithDialCode = dialCode ? typedDigits.startsWith(dialCode) : false\n const hasLeadingZero = typedDigits.startsWith(\"0\")\n const isIddPrefix = COMMON_IDD_PREFIXES.some((prefix) => typedDigits.startsWith(prefix))\n\n const shouldRemoveNationalPrefix =\n Boolean(baseCountryForInput) &&\n !isIddPrefix &&\n ((startsWithDialCode && typedDigits.slice(dialCode.length).startsWith(\"0\")) ||\n (!hasExplicitPlus && hasLeadingZero && typedDigits.length > 1) ||\n (hasExplicitPlus && hasLeadingZero && typedDigits.length > 1 && !startsWithDialCode))\n\n const previousNormalized = lastNormalizedRef.current\n const normalized = normalizeInputValue(raw, baseCountryForInput, {\n allowJustPlus: true,\n removeNationalPrefix: shouldRemoveNationalPrefix,\n previousValue: previousNormalized,\n })\n lastNormalizedRef.current = normalized\n\n if (!normalized) {\n setInputValueState(\"\")\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n pendingSelectionRef.current = resolveSelection(snapshot, \"\")\n\n const nextCountry = hasConfiguredCountry ? fallbackCountry : activeCountry\n\n if (!isCountryControlled && uncontrolledCountry !== nextCountry) {\n setUncontrolledCountry(nextCountry)\n notifyCountryChange(nextCountry)\n }\n\n const nextDialCode = getCountryCallingCode(nextCountry)\n emitChange({\n formattedInternational: \"\",\n formattedNational: \"\",\n e164: null,\n country: nextCountry,\n countryCallingCode: nextDialCode,\n nationalNumber: \"\",\n rawInput: \"\",\n isValid: false,\n })\n return\n }\n\n if (normalized === \"0\") {\n setInputValueState(\"0\")\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n pendingSelectionRef.current = resolveSelection(snapshot, \"0\")\n\n const nextCountry = hasConfiguredCountry ? fallbackCountry : activeCountry\n\n if (!isCountryControlled && uncontrolledCountry !== nextCountry) {\n setUncontrolledCountry(nextCountry)\n notifyCountryChange(nextCountry)\n }\n\n const nextDialCode = getCountryCallingCode(nextCountry)\n emitChange({\n formattedInternational: \"0\",\n formattedNational: \"0\",\n e164: null,\n country: nextCountry,\n countryCallingCode: nextDialCode,\n nationalNumber: \"0\",\n rawInput: \"0\",\n isValid: false,\n })\n return\n }\n\n if (normalized === \"+\") {\n setInputValueState(\"+\")\n setShowSuggestions(true)\n setCountryQuery(\"\")\n setHighlightedIndex(0)\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n pendingSelectionRef.current = resolveSelection(snapshot, \"+\")\n\n const nextCountry = hasConfiguredCountry ? fallbackCountry : activeCountry\n\n if (!isCountryControlled && uncontrolledCountry !== nextCountry) {\n setUncontrolledCountry(nextCountry)\n notifyCountryChange(nextCountry)\n }\n\n const nextDialCode = getCountryCallingCode(nextCountry)\n emitChange({\n formattedInternational: \"+\",\n formattedNational: \"\",\n e164: null,\n country: nextCountry,\n countryCallingCode: nextDialCode,\n nationalNumber: \"\",\n rawInput: \"+\",\n isValid: false,\n })\n return\n }\n\n const {\n international,\n national,\n phoneNumber,\n detectedCountry,\n inferredCountry,\n hasExplicitInternationalPrefix,\n } = formatWithAsYouType(normalized, baseCountryForInput)\n const canonicalDetectedCountry = detectedCountry ?? undefined\n let nextCountry = canonicalDetectedCountry ?? baseCountryForInput ?? activeCountry\n\n const internationalDigits = sanitizeDigits(international)\n const initialDialCode = getCountryCallingCode(nextCountry)\n const initialHasTypedTrunk = detectNationalPrefixForDisplay(\n typedDigits,\n internationalDigits,\n initialDialCode,\n hasExplicitPlus\n )\n\n const suggestion = getSuggestionState(\n normalized,\n baseCountryForInput,\n phoneNumber ?? undefined,\n {\n hasRemovedNationalPrefix: initialHasTypedTrunk,\n detectedCountry: canonicalDetectedCountry,\n hasExplicitInternationalPrefix,\n }\n )\n\n const inferredCountryToApply =\n !suggestion.shouldSuggest && !canonicalDetectedCountry ? inferredCountry : undefined\n const finalCountry = inferredCountryToApply ?? nextCountry\n\n const resolvedFromInput =\n Boolean(canonicalDetectedCountry) || Boolean(inferredCountryToApply)\n if (resolvedFromInput) {\n hasResolvedCountryRef.current = true\n }\n\n if (!isCountryControlled && finalCountry !== uncontrolledCountry) {\n setUncontrolledCountry(finalCountry)\n notifyCountryChange(finalCountry)\n }\n\n nextCountry = finalCountry\n\n if (\n manualSelectionCountryRef.current &&\n manualSelectionCountryRef.current !== nextCountry\n ) {\n manualSelectionCountryRef.current = null\n }\n\n const nextDialCode = getCountryCallingCode(nextCountry)\n const normalizedDigits = sanitizeDigits(normalized)\n const nationalDigits = stripPrefix(normalizedDigits, nextDialCode)\n const hasTypedTrunk = inferredCountryToApply\n ? detectNationalPrefixForDisplay(\n typedDigits,\n internationalDigits,\n nextDialCode,\n hasExplicitPlus\n )\n : initialHasTypedTrunk\n\n const displayValue = injectNationalPrefixDisplay(international, nextDialCode, {\n force: hasTypedTrunk,\n })\n\n const displayDetectedCountry = canonicalDetectedCountry ?? undefined\n\n pendingSelectionRef.current = resolveSelection(snapshot, displayValue)\n setInputValueState(displayValue)\n setShowSuggestions(suggestion.shouldSuggest)\n setCountryQuery(suggestion.query)\n setHighlightedIndex(suggestion.shouldSuggest ? 0 : -1)\n setLengthIssue(hasResolvedCountryRef.current ? getLengthIssue(normalized, nextCountry) : null)\n const manualSelectionActive = manualSelectionCountryRef.current != null\n const shouldShowInlineFlag =\n manualSelectionActive ||\n shouldDisplayExplicitCountrySelection(suggestion, {\n detectedCountry: displayDetectedCountry,\n hasExplicitInternationalPrefix,\n })\n setHasExplicitCountrySelection(hasResolvedCountryRef.current && shouldShowInlineFlag)\n emitChange({\n formattedInternational: international,\n formattedNational: national,\n e164: phoneNumber?.number ?? null,\n country: nextCountry,\n countryCallingCode: nextDialCode,\n nationalNumber: nationalDigits,\n rawInput: normalized,\n isValid: phoneNumber?.isValid() ?? false,\n })\n },\n [\n activeCountry,\n emitChange,\n fallbackCountry,\n hasConfiguredCountry,\n isCountryControlled,\n notifyCountryChange,\n uncontrolledCountry,\n ]\n )\n\n const handleCountrySelect = React.useCallback(\n (option: SingleValue<CountryOption>) => {\n if (!option) {\n return\n }\n\n const previousDigits = sanitizeDigits(lastNormalizedRef.current || inputValueState)\n const currentDial = getCountryCallingCode(activeCountry)\n const digitsWithoutCurrentDial = previousDigits.startsWith(currentDial)\n ? previousDigits.slice(currentDial.length)\n : previousDigits\n let rebasedDigits = digitsWithoutCurrentDial\n if (!rebasedDigits) {\n rebasedDigits = option.dialCode\n } else if (!rebasedDigits.startsWith(option.dialCode)) {\n rebasedDigits = `${option.dialCode}${rebasedDigits}`\n }\n const normalized = `+${rebasedDigits}`\n lastNormalizedRef.current = normalized\n const { international, national, phoneNumber } = formatWithAsYouType(\n normalized,\n option.value\n )\n const nextCountry = option.value\n manualSelectionCountryRef.current = nextCountry\n hasResolvedCountryRef.current = true\n\n setInputValueState(international)\n pendingSelectionRef.current = {\n start: international.length,\n end: international.length,\n }\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(getLengthIssue(normalized, nextCountry))\n\n if (!isCountryControlled && nextCountry !== uncontrolledCountry) {\n setUncontrolledCountry(nextCountry)\n }\n\n notifyCountryChange(nextCountry)\n\n const normalizedDigits = sanitizeDigits(normalized)\n const dialCode = phoneNumber?.countryCallingCode ?? option.dialCode\n const nationalDigits = stripPrefix(normalizedDigits, dialCode)\n setHasExplicitCountrySelection(true)\n emitChange({\n formattedInternational: international,\n formattedNational: national,\n e164: phoneNumber?.number ?? null,\n country: nextCountry,\n countryCallingCode: dialCode,\n nationalNumber: nationalDigits,\n rawInput: normalized,\n isValid: phoneNumber?.isValid() ?? false,\n })\n\n requestAnimationFrame(() => {\n inputRef.current?.focus()\n })\n },\n [activeCountry, emitChange, inputValueState, isCountryControlled, notifyCountryChange, uncontrolledCountry]\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) => {\n if (!results.some((existing) => existing.value === option.value)) {\n results.push(option)\n }\n }\n\n const fallbackOption = countryOptions.find((option) => option.value === fallbackCountry)\n const currentOption = countryOptions.find((option) => option.value === activeCountry)\n const query = countryQuery.trim()\n const digitQuery = sanitizeDigits(query)\n const normalizedQuery = normalizeSearchValue(query)\n\n if (!digitQuery && !normalizedQuery) {\n if (fallbackOption) {\n pushUnique(fallbackOption)\n }\n if (currentOption) {\n pushUnique(currentOption)\n }\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 if (currentOption) {\n pushUnique(currentOption)\n }\n if (fallbackOption) {\n pushUnique(fallbackOption)\n }\n if (results.length === 0) {\n countryOptions.forEach(pushUnique)\n }\n\n return results\n }, [activeCountry, countryOptions, countryQuery, fallbackCountry, 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 React.useEffect(() => {\n if (highlightedIndex < 0) {\n scrollBehaviorRef.current = \"smooth\"\n }\n }, [highlightedIndex])\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 = countryOptions.find((option) => option.value === activeCountry)\n const activeFlag = activeOption?.flag ?? \"\"\n const inlineFlagLabel = hasExplicitCountrySelection\n ? resolvedMessages.selectedCountryLabel(activeOption?.name ?? activeCountry ?? null)\n : resolvedMessages.selectCountryLabel\n const hasInlineFlag = hasExplicitCountrySelection && Boolean(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 target = highlightedOption ?? filteredOptions[0]\n handleCountrySelect(target)\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 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 <SuggestionContext.Provider value={highlightContextValue}>\n <Select<CountryOption, false>\n {...restForwardedSelectProps}\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 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 </div>\n\n {validationNode}\n </div>\n )\n }\n)\n\nPhoneNumberInput.displayName = \"PhoneNumberInput\"\n"],"names":["PhoneNumberInput","React","forwardRef","props","forwardedRef","value","defaultCountry","country","countryProp","locale","onChange","onCountryChange","className","inputClassName","disabled","readOnly","selectProps","autofillShimName","messages","messagesProp","renderValidationMessage","restProps","onFocus","onInputFocus","onBlur","onInputBlur","onKeyDown","onInputKeyDown","name","inputName","autoComplete","inputAutoComplete","restInputProps","hasConfiguredCountry","localeCacheKey","getLocaleCacheKey","localeForBuild","useMemo","parseLocaleCacheKey","resolvedMessages","resolveMessages","countryOptions","getCachedCountryOptions","resolveSelectedCountry","useCallback","match","find","candidate","toSelectedCountry","buildFallbackSelectedCountry","fallbackCountry","getValidCountry","DEFAULT_COUNTRY","some","option","hasResolvedCountryRef","useRef","initialStateRef","lastNormalizedRef","current","inputValue","normalizedValue","hasExplicitCountrySelection","baseCountryForInit","undefined","normalized","normalizeInputValue","allowJustPlus","international","phoneNumber","detectedCountry","inferredCountry","hasExplicitInternationalPrefix","formatWithAsYouType","canonicalDetectedCountry","resolvedCountry","rawDigits","sanitizeDigits","hasExplicitPlus","test","internationalDigits","initialDialCode","getCountryCallingCode","initialHasPrefix","detectNationalPrefixForDisplay","suggestion","getSuggestionState","hasRemovedNationalPrefix","inferredCountryToApply","shouldSuggest","nextDialCode","finalHasPrefix","displayValue","injectNationalPrefixDisplay","force","displayDetectedCountry","allowInlineFlag","shouldDisplayExplicitCountrySelection","initialState","uncontrolledCountry","setUncontrolledCountry","useState","inputValueState","setInputValueState","countryQuery","setCountryQuery","showSuggestions","setShowSuggestions","highlightedIndex","setHighlightedIndex","isFocused","setIsFocused","lengthIssue","setLengthIssue","setHasExplicitCountrySelection","manualSelectionCountryRef","keyboardBufferRef","bufferTimeoutRef","scrollBehaviorRef","pendingSelectionRef","consumeScrollBehavior","behavior","isCountryControlled","selectedCountry","activeCountry","inputRef","useImperativeHandle","useLayoutEffect","selection","input","start","end","setSelectionRange","selectOverrides","styles","userSelectStyles","components","userSelectComponents","classNamePrefix","userClassNamePrefix","formatOptionLabel","userFormatOptionLabel","forwardedSelectProps","noOptionsMessage","restForwardedSelectProps","mergedSelectStyles","suggestionSelectStyles","mergedSelectComponents","baseComponents","Control","HiddenControl","IndicatorsContainer","NullComponent","DropdownIndicator","IndicatorSeparator","ValueContainer","overrides","Option","SuggestionOption","hasAnnouncedCountryRef","notifyCountryChange","useEffect","window","clearTimeout","baseCountryForSync","previousNormalized","previousValue","nextCountry","initialHasTypedTrunk","finalCountry","hasTypedTrunk","shouldShowInlineFlag","query","getLengthIssue","emitChange","details","scheduleBufferReset","setTimeout","handleInputChange","event","target","snapshot","captureSelectionSnapshot","raw","baseCountryForInput","dialCode","typedDigits","trim","startsWith","startsWithDialCode","hasLeadingZero","isIddPrefix","COMMON_IDD_PREFIXES","prefix","shouldRemoveNationalPrefix","Boolean","slice","length","removeNationalPrefix","resolveSelection","formattedInternational","formattedNational","e164","countryCallingCode","nationalNumber","rawInput","isValid","national","normalizedDigits","nationalDigits","stripPrefix","number","handleCountrySelect","previousDigits","currentDial","rebasedDigits","requestAnimationFrame","focus","filteredOptions","results","pushUnique","existing","push","fallbackOption","currentOption","digitQuery","normalizedQuery","normalizeSearchValue","forEach","filter","sort","a","b","aExact","bExact","normalizedSearchableTokens","token","includes","aIndex","optionMatchIndex","bIndex","localeCompare","suggestionMenuIsOpen","highlightedOption","updateHighlightedOption","index","findIndex","selectFormatOptionLabel","meta","formatCountryOption","optionLabelRenderer","context","selectValue","highlightContextValue","highlightedValue","setHighlightedOption","renderOptionLabel","activeOption","activeFlag","flag","inlineFlagLabel","selectedCountryLabel","selectCountryLabel","hasInlineFlag","lengthHint","lengthTooLong","countryName","validationNode","rendered","message","code","jsx","appendToBuffer","char","popBuffer","handleKeyDown","defaultPrevented","key","metaKey","ctrlKey","altKey","currentTarget","selectionStart","selectionEnd","isCollapsedSelection","nextStart","skipFormattingCharactersLeft","preventDefault","skipFormattingCharactersRight","repeat","toLowerCase","handleFocus","handleBlur","openCountryMenu","shimName","cn","jsxs","pointerEvents","width","SuggestionContext","Select","noMatches","displayName"],"mappings":";;;;;;;;;;AAoEO,MAAMA,KAAmBC,EAAMC,WACpC,SAA0BC,IAAOC,IAAc;AAC7C,QAAM;AAAA,IACJC,OAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,SAASC;AAAAA,IACTC,QAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,UAAUC;AAAAA,IACVC,yBAAAA;AAAAA,IACA,GAAGC;AAAAA,EAAAA,IACDlB,IAEE;AAAA,IACJmB,SAASC;AAAAA,IACTC,QAAQC;AAAAA,IACRC,WAAWC;AAAAA,IACXC,MAAMC;AAAAA,IACNC,cAAcC;AAAAA,IACd,GAAGC;AAAAA,EAAAA,IACDX,IAEEY,IACJ,OAAO3B,MAAmB,YAAY,OAAOE,KAAgB,UAEzD0B,KAAiBC,GAAkB1B,EAAM,GACzC2B,KAAiBnC,EAAMoC,QAC3B,MAAMC,GAAoBJ,EA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UAAAC,IACA,cAAcgB,MAAqB,OAAM;AAAA,MAE3CgP,gBAAAA,MAAC,UAAA,EACC,MAAK,UACL,WAAWwB,GACT,wOACAhC,KACI,uBACA,qDACJzP,KACI,kCACAC,KACE,mBACA,+BACR,GACA,cAAYqP,IACZ,aAAcjF,OAAUA,EAAM4G,eAAAA,GAC9B,SAASM,IACT,UAAU,IACV,UAAAvR,IAEA,UAAAiQ,gBAAAA,EAAAA,IAAC,UAAK,eAAY,QACfR,UAAAA,KAAgBL,KAAa,KAChC,EAAA,CACF;AAAA,IAAA,GACF;AAAA,IAECoC,KACCvB,gBAAAA,EAAAA,IAAC,SAAA,EACC,UAAU,IACV,cAAa,OACb,MAAMuB,IACN,eAAY,QACZ,WAAU,+DAA6D,IAEvE;AAAA,IAEJvB,gBAAAA,EAAAA,IAAC,OAAA,EACC,WAAU,sCACV,OAAO;AAAA,MACL0B,eAAevD,IAAuB,SAAS;AAAA,MAC/CwD,OAAO;AAAA,IAAA,GAET,aAAcvH,CAAAA,MAAUA,EAAM4G,kBAE9B,UAAAhB,gBAAAA,EAAAA,IAAC4B,GAAkB,UAAlB,EAA2B,OAAO9C,IACjC,UAAAkB,gBAAAA,EAAAA,IAAC6B,IAAA,EACC,GAAI5J,IACJ,YAAYkG,GACZ,SAASxB,GACT,OAAO,MACP,YAAYvE,IACZ,QAAQF,IACR,aAAa,IACb,cAAc,IACd,uBAAuB,IACvB,iBAAiB,IACjB,0BAA0B,IAC1B,UAAUmE,IACV,iBAAiBzE,MAAuB,4BACxC,aAAY,IACZ,mBAAmB4G,IACnB,kBACAxG,OAAqB,MAAMxG,GAAiBsQ,YAC7C,EAAA,CAEL,EAAA,CACF;AAAA,IAEGlC;AAAAA,EAAAA,GACH;AAEJ,CACF;AAEA3Q,GAAiB8S,cAAc;"}
1
+ {"version":3,"file":"index18.js","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 [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 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 {\n styles: userSelectStyles,\n components: userSelectComponents,\n classNamePrefix: userClassNamePrefix,\n formatOptionLabel: userFormatOptionLabel,\n menuPortalTarget: userMenuPortalTarget,\n menuPosition: userMenuPosition,\n ...forwardedSelectProps\n } = selectOverrides\n const { noOptionsMessage, ...restForwardedSelectProps } = forwardedSelectProps\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 base = {\n ...provided,\n zIndex: 1300,\n }\n\n return userMenuPortal ? userMenuPortal(base, state) : base\n },\n }\n },\n [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 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 <SuggestionContext.Provider value={highlightContextValue}>\n <Select<CountryOption, false>\n {...restForwardedSelectProps}\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 </div>\n\n {validationNode}\n </div>\n )\n }\n)\n\nPhoneNumberInput.displayName = \"PhoneNumberInput\"\n"],"names":["INVISIBLE_FORMATTING_CHARACTERS","stripInvisibleFormatting","value","replace","stripIddPrefix","digits","prefix","COMMON_IDD_PREFIXES","startsWith","slice","length","normalizeImplicitInternationalInput","candidate","phoneNumber","detectedCountry","formatWithAsYouType","isValid","normalizeExplicitInternationalInput","cleaned","trim","sanitizeDigits","digitsWithoutIdd","normalizeInternationalInput","explicitInternational","getDialCode","country","parsedDialCode","getCountryCallingCode","getInputValueForSelectedCountry","option","options","dialCode","normalizedInternational","allowImplicitInternational","normalizedDigits","currentDialCode","countryCallingCode","nationalDigits","nationalNumber","preferSelectedCountry","parsed","lengthIssue","getLengthIssue","rawInput","parsePhoneInput","rawValue","baseCountry","displayValue","formattedInternational","formattedNational","e164","normalized","international","national","formatted","hasInternationalPrefix","stripPrefix","formatInternational","formatNational","number","PhoneNumberInput","React","forwardRef","props","forwardedRef","defaultCountry","countryProp","locale","onChange","onCountryChange","className","inputClassName","disabled","readOnly","selectProps","autofillShimName","messages","messagesProp","renderValidationMessage","restProps","onFocus","onInputFocus","onBlur","onInputBlur","onKeyDown","onInputKeyDown","name","inputName","autoComplete","inputAutoComplete","restInputProps","controlledCountry","localeCacheKey","getLocaleCacheKey","localeForBuild","useMemo","parseLocaleCacheKey","resolvedMessages","resolveMessages","countryOptions","getCachedCountryOptions","resolveSelectedCountry","useCallback","match","find","toSelectedCountry","buildFallbackSelectedCountry","menuPriorityCountry","getValidCountry","DEFAULT_COUNTRY","some","initialStateRef","useRef","current","initialState","undefined","uncontrolledCountry","setUncontrolledCountry","useState","inputValueState","setInputValueState","countryQuery","setCountryQuery","showSuggestions","setShowSuggestions","highlightedIndex","setHighlightedIndex","isFocused","setIsFocused","setLengthIssue","manualSelectionCountryRef","keyboardBufferRef","bufferTimeoutRef","scrollBehaviorRef","pendingSelectionRef","hasNotifiedCountryRef","lastNotifiedCountryRef","inputRef","activeCountry","explicitFormattingCountry","useImperativeHandle","useLayoutEffect","selection","input","start","end","setSelectionRange","selectOverrides","styles","userSelectStyles","components","userSelectComponents","classNamePrefix","userClassNamePrefix","formatOptionLabel","userFormatOptionLabel","menuPortalTarget","userMenuPortalTarget","menuPosition","userMenuPosition","forwardedSelectProps","noOptionsMessage","restForwardedSelectProps","defaultMenuPortalTarget","setDefaultMenuPortalTarget","hasUserMenuPortalTarget","mergedSelectStyles","userMenuPortal","menuPortal","suggestionSelectStyles","provided","state","base","zIndex","document","portalTarget","closest","body","mergedSelectComponents","baseComponents","Control","HiddenControl","IndicatorsContainer","NullComponent","DropdownIndicator","IndicatorSeparator","ValueContainer","overrides","Option","SuggestionOption","useEffect","window","clearTimeout","emitChange","details","selectedCountry","scheduleBufferReset","setTimeout","applyParsedInput","snapshot","resolveSelection","handleInputChange","event","target","captureSelectionSnapshot","raw","normalizedExplicitInternational","manualCountry","manualDialCode","activeManualCountry","rawDigits","manualOption","handleCountrySelect","nextInputValue","requestAnimationFrame","focus","filteredOptions","results","pushUnique","existing","push","priorityOption","currentOption","query","digitQuery","normalizedQuery","normalizeSearchValue","forEach","filter","sort","a","b","aExact","bExact","normalizedSearchableTokens","token","includes","aIndex","optionMatchIndex","bIndex","localeCompare","suggestionMenuIsOpen","highlightedOption","consumeScrollBehavior","behavior","updateHighlightedOption","index","findIndex","selectFormatOptionLabel","meta","formatCountryOption","optionLabelRenderer","context","inputValue","selectValue","highlightContextValue","highlightedValue","setHighlightedOption","renderOptionLabel","activeOption","activeFlag","flag","inlineFlagLabel","selectedCountryLabel","selectCountryLabel","hasInlineFlag","Boolean","lengthHint","lengthTooLong","countryName","validationNode","rendered","message","code","jsx","appendToBuffer","char","popBuffer","handleKeyDown","defaultPrevented","key","metaKey","ctrlKey","altKey","currentTarget","selectionStart","selectionEnd","isCollapsedSelection","nextStart","skipFormattingCharactersLeft","preventDefault","skipFormattingCharactersRight","repeat","test","toLowerCase","targetOption","handleFocus","handleBlur","openCountryMenu","shimName","cn","jsxs","pointerEvents","width","Suggest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BuP,cAAc;"}
package/dist/index180.js CHANGED
@@ -1,8 +1,64 @@
1
- import { CommonPopupDataAttributes as e } from "./index173.js";
2
- let y = (function(n) {
3
- return n[n.open = e.open] = "open", n[n.closed = e.closed] = "closed", n[n.startingStyle = e.startingStyle] = "startingStyle", n[n.endingStyle = e.endingStyle] = "endingStyle", n.nested = "data-nested", n.nestedDialogOpen = "data-nested-dialog-open", n;
4
- })({});
1
+ function f(r, t) {
2
+ var e = typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
3
+ if (e) return (e = e.call(r)).next.bind(e);
4
+ if (Array.isArray(r) || (e = v(r)) || t) {
5
+ e && (r = e);
6
+ var n = 0;
7
+ return function() {
8
+ return n >= r.length ? { done: !0 } : { done: !1, value: r[n++] };
9
+ };
10
+ }
11
+ throw new TypeError(`Invalid attempt to iterate non-iterable instance.
12
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
13
+ }
14
+ function v(r, t) {
15
+ if (r) {
16
+ if (typeof r == "string") return c(r, t);
17
+ var e = {}.toString.call(r).slice(8, -1);
18
+ return e === "Object" && r.constructor && (e = r.constructor.name), e === "Map" || e === "Set" ? Array.from(r) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? c(r, t) : void 0;
19
+ }
20
+ }
21
+ function c(r, t) {
22
+ (t == null || t > r.length) && (t = r.length);
23
+ for (var e = 0, n = Array(t); e < t; e++) n[e] = r[e];
24
+ return n;
25
+ }
26
+ var h = "x", u = new RegExp(h);
27
+ function s(r, t) {
28
+ if (t < 1)
29
+ return "";
30
+ for (var e = ""; t > 1; )
31
+ t & 1 && (e += r), t >>= 1, r += r;
32
+ return e + r;
33
+ }
34
+ function y(r, t) {
35
+ return r[t] === ")" && t++, p(r.slice(0, t));
36
+ }
37
+ function p(r) {
38
+ for (var t = [], e = 0; e < r.length; )
39
+ r[e] === "(" ? t.push(e) : r[e] === ")" && t.pop(), e++;
40
+ var n = 0, a = "";
41
+ t.push(r.length);
42
+ for (var o = 0, l = t; o < l.length; o++) {
43
+ var i = l[o];
44
+ a += r.slice(n, i), n = i + 1;
45
+ }
46
+ return a;
47
+ }
48
+ function d(r, t, e) {
49
+ for (var n = f(e.split("")), a; !(a = n()).done; ) {
50
+ var o = a.value;
51
+ if (r.slice(t + 1).search(u) < 0)
52
+ return;
53
+ t = r.search(u), r = r.replace(u, o);
54
+ }
55
+ return [r, t];
56
+ }
5
57
  export {
6
- y as DialogPopupDataAttributes
58
+ h as DIGIT_PLACEHOLDER,
59
+ y as cutAndStripNonPairedParens,
60
+ d as populateTemplateWithDigits,
61
+ s as repeat,
62
+ p as stripNonPairedParens
7
63
  };
8
64
  //# sourceMappingURL=index180.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index180.js","sources":["../../../node_modules/@base-ui/react/esm/dialog/popup/DialogPopupDataAttributes.js"],"sourcesContent":["import { CommonPopupDataAttributes } from \"../../utils/popupStateMapping.js\";\nexport let DialogPopupDataAttributes = function (DialogPopupDataAttributes) {\n /**\n * Present when the dialog is open.\n */\n DialogPopupDataAttributes[DialogPopupDataAttributes[\"open\"] = CommonPopupDataAttributes.open] = \"open\";\n /**\n * Present when the dialog is closed.\n */\n DialogPopupDataAttributes[DialogPopupDataAttributes[\"closed\"] = CommonPopupDataAttributes.closed] = \"closed\";\n /**\n * Present when the dialog is animating in.\n */\n DialogPopupDataAttributes[DialogPopupDataAttributes[\"startingStyle\"] = CommonPopupDataAttributes.startingStyle] = \"startingStyle\";\n /**\n * Present when the dialog is animating out.\n */\n DialogPopupDataAttributes[DialogPopupDataAttributes[\"endingStyle\"] = CommonPopupDataAttributes.endingStyle] = \"endingStyle\";\n /**\n * Present when the dialog is nested within another dialog.\n */\n DialogPopupDataAttributes[\"nested\"] = \"data-nested\";\n /**\n * Present when the dialog has other open dialogs nested within it.\n */\n DialogPopupDataAttributes[\"nestedDialogOpen\"] = \"data-nested-dialog-open\";\n return DialogPopupDataAttributes;\n}({});"],"names":["DialogPopupDataAttributes","CommonPopupDataAttributes"],"mappings":";AACU,IAACA,KAA4B,SAAUA,GAA2B;AAI1E,SAAAA,EAA0BA,EAA0B,OAAUC,EAA0B,IAAI,IAAI,QAIhGD,EAA0BA,EAA0B,SAAYC,EAA0B,MAAM,IAAI,UAIpGD,EAA0BA,EAA0B,gBAAmBC,EAA0B,aAAa,IAAI,iBAIlHD,EAA0BA,EAA0B,cAAiBC,EAA0B,WAAW,IAAI,eAI9GD,EAA0B,SAAY,eAItCA,EAA0B,mBAAsB,2BACzCA;AACT,GAAE,CAAA,CAAE;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index180.js","sources":["../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\n// Should be the same as `DIGIT_PLACEHOLDER` in `libphonenumber-metadata-generator`.\nexport var DIGIT_PLACEHOLDER = 'x'; // '\\u2008' (punctuation space)\nvar DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER);\n\n// Counts all occurences of a symbol in a string.\n// Unicode-unsafe (because using `.split()`).\nexport function countOccurences(symbol, string) {\n var count = 0;\n // Using `.split('')` to iterate through a string here\n // to avoid requiring `Symbol.iterator` polyfill.\n // `.split('')` is generally not safe for Unicode,\n // but in this particular case for counting brackets it is safe.\n // for (const character of string)\n for (var _iterator = _createForOfIteratorHelperLoose(string.split('')), _step; !(_step = _iterator()).done;) {\n var character = _step.value;\n if (character === symbol) {\n count++;\n }\n }\n return count;\n}\n\n// Repeats a string (or a symbol) N times.\n// http://stackoverflow.com/questions/202605/repeat-string-javascript\nexport function repeat(string, times) {\n if (times < 1) {\n return '';\n }\n var result = '';\n while (times > 1) {\n if (times & 1) {\n result += string;\n }\n times >>= 1;\n string += string;\n }\n return result + string;\n}\nexport function cutAndStripNonPairedParens(string, cutBeforeIndex) {\n if (string[cutBeforeIndex] === ')') {\n cutBeforeIndex++;\n }\n return stripNonPairedParens(string.slice(0, cutBeforeIndex));\n}\nexport function closeNonPairedParens(template, cut_before) {\n var retained_template = template.slice(0, cut_before);\n var opening_braces = countOccurences('(', retained_template);\n var closing_braces = countOccurences(')', retained_template);\n var dangling_braces = opening_braces - closing_braces;\n while (dangling_braces > 0 && cut_before < template.length) {\n if (template[cut_before] === ')') {\n dangling_braces--;\n }\n cut_before++;\n }\n return template.slice(0, cut_before);\n}\nexport function stripNonPairedParens(string) {\n var dangling_braces = [];\n var i = 0;\n while (i < string.length) {\n if (string[i] === '(') {\n dangling_braces.push(i);\n } else if (string[i] === ')') {\n dangling_braces.pop();\n }\n i++;\n }\n var start = 0;\n var cleared_string = '';\n dangling_braces.push(string.length);\n for (var _i = 0, _dangling_braces = dangling_braces; _i < _dangling_braces.length; _i++) {\n var index = _dangling_braces[_i];\n cleared_string += string.slice(start, index);\n start = index + 1;\n }\n return cleared_string;\n}\nexport function populateTemplateWithDigits(template, position, digits) {\n // Using `.split('')` to iterate through a string here\n // to avoid requiring `Symbol.iterator` polyfill.\n // `.split('')` is generally not safe for Unicode,\n // but in this particular case for `digits` it is safe.\n // for (const digit of digits)\n for (var _iterator2 = _createForOfIteratorHelperLoose(digits.split('')), _step2; !(_step2 = _iterator2()).done;) {\n var digit = _step2.value;\n // If there is room for more digits in current `template`,\n // then set the next digit in the `template`,\n // and return the formatted digits so far.\n // If more digits are entered than the current format could handle.\n if (template.slice(position + 1).search(DIGIT_PLACEHOLDER_MATCHER) < 0) {\n return;\n }\n position = template.search(DIGIT_PLACEHOLDER_MATCHER);\n template = template.replace(DIGIT_PLACEHOLDER_MATCHER, digit);\n }\n return [template, position];\n}\n//# sourceMappingURL=AsYouTypeFormatter.util.js.map"],"names":["_createForOfIteratorHelperLoose","e","t","_unsupportedIterableToArray","o","a","_arrayLikeToArray","DIGIT_PLACEHOLDER","DIGIT_PLACEHOLDER_MATCHER","repeat","string","times","result","cutAndStripNonPairedParens","cutBeforeIndex","stripNonPairedParens","dangling_braces","i","start","cleared_string","_i","_dangling_braces","index","populateTemplateWithDigits","template","position","digits","_iterator2","_step2","digit"],"mappings":"AAAA,SAASA,EAAgC,GAAGC,GAAG;AAAE,MAAIC,IAAmB,OAAO,SAAtB,OAAgC,EAAE,OAAO,QAAQ,KAAK,EAAE,YAAY;AAAG,MAAIA,EAAG,SAAQA,IAAIA,EAAE,KAAK,CAAC,GAAG,KAAK,KAAKA,CAAC;AAAG,MAAI,MAAM,QAAQ,CAAC,MAAMA,IAAIC,EAA4B,CAAC,MAAMF,GAAuC;AAAE,IAAAC,MAAM,IAAIA;AAAI,QAAIE,IAAI;AAAG,WAAO,WAAY;AAAE,aAAOA,KAAK,EAAE,SAAS,EAAE,MAAM,GAAE,IAAK,EAAE,MAAM,IAAI,OAAO,EAAEA,GAAG,EAAC;AAAA,IAAI;AAAA,EAAG;AAAE,QAAM,IAAI,UAAU;AAAA,mFAAuI;AAAG;AACziB,SAASD,EAA4B,GAAGE,GAAG;AAAE,MAAI,GAAG;AAAE,QAAg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EAAiB,QAAQD,KAAM;AACvF,QAAIE,IAAQD,EAAiBD,CAAE;AAC/B,IAAAD,KAAkBT,EAAO,MAAMQ,GAAOI,CAAK,GAC3CJ,IAAQI,IAAQ;AAAA,EAClB;AACA,SAAOH;AACT;AACO,SAASI,EAA2BC,GAAUC,GAAUC,GAAQ;AAMrE,WAASC,IAAa3B,EAAgC0B,EAAO,MAAM,EAAE,CAAC,GAAGE,GAAQ,EAAEA,IAASD,EAAU,GAAI,QAAO;AAC/G,QAAIE,IAAQD,EAAO;AAKnB,QAAIJ,EAAS,MAAMC,IAAW,CAAC,EAAE,OAAOjB,CAAyB,IAAI;AACnE;AAEF,IAAAiB,IAAWD,EAAS,OAAOhB,CAAyB,GACpDgB,IAAWA,EAAS,QAAQhB,GAA2BqB,CAAK;AAAA,EAC9D;AACA,SAAO,CAACL,GAAUC,CAAQ;AAC5B;","x_google_ignoreList":[0]}
package/dist/index181.js CHANGED
@@ -1,15 +1,50 @@
1
- import r from "./index191.js";
2
- import * as t from "react";
3
- const e = /* @__PURE__ */ t.createContext(void 0);
4
- process.env.NODE_ENV !== "production" && (e.displayName = "DialogPortalContext");
5
- function a() {
6
- const o = t.useContext(e);
7
- if (o === void 0)
8
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Dialog.Portal> is missing." : r(26));
9
- return o;
1
+ import f from "./index334.js";
2
+ import u from "./index183.js";
3
+ import m from "./index184.js";
4
+ function p(a, t, r) {
5
+ var e = r.metadata, n = r.shouldTryNationalPrefixFormattingRule, o = r.getSeparatorAfterNationalPrefix, i = new RegExp("^(?:".concat(t.pattern(), ")$"));
6
+ if (i.test(a.nationalSignificantNumber))
7
+ return N(a, t, {
8
+ metadata: e,
9
+ shouldTryNationalPrefixFormattingRule: n,
10
+ getSeparatorAfterNationalPrefix: o
11
+ });
12
+ }
13
+ function c(a, t, r) {
14
+ return f(a, t, r) === "IS_POSSIBLE";
15
+ }
16
+ function N(a, t, r) {
17
+ var e = r.metadata, n = r.shouldTryNationalPrefixFormattingRule, o = r.getSeparatorAfterNationalPrefix;
18
+ if (a.nationalSignificantNumber, a.international, a.nationalPrefix, a.carrierCode, n(t)) {
19
+ var i = l(a, t, {
20
+ useNationalPrefixFormattingRule: !0,
21
+ getSeparatorAfterNationalPrefix: o,
22
+ metadata: e
23
+ });
24
+ if (i)
25
+ return i;
26
+ }
27
+ return l(a, t, {
28
+ useNationalPrefixFormattingRule: !1,
29
+ getSeparatorAfterNationalPrefix: o,
30
+ metadata: e
31
+ });
32
+ }
33
+ function l(a, t, r) {
34
+ var e = r.metadata, n = r.useNationalPrefixFormattingRule, o = r.getSeparatorAfterNationalPrefix, i = m(a.nationalSignificantNumber, t, {
35
+ carrierCode: a.carrierCode,
36
+ useInternationalFormat: a.international,
37
+ withNationalPrefix: n,
38
+ metadata: e
39
+ });
40
+ if (n || (a.nationalPrefix ? i = a.nationalPrefix + o(t) + i : a.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix && (i = a.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix + " " + i)), g(i, a))
41
+ return i;
42
+ }
43
+ function g(a, t) {
44
+ return u(a) === t.getNationalDigits();
10
45
  }
11
46
  export {
12
- e as DialogPortalContext,
13
- a as useDialogPortalContext
47
+ c as canFormatCompleteNumber,
48
+ p as default
14
49
  };
15
50
  //# sourceMappingURL=index181.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index181.js","sources":["../../../node_modules/@base-ui/react/esm/dialog/portal/DialogPortalContext.js"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DialogPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DialogPortalContext.displayName = \"DialogPortalContext\";\nexport function useDialogPortalContext() {\n const value = React.useContext(DialogPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Dialog.Portal> is missing.' : _formatErrorMessage(26));\n }\n return value;\n}"],"names":["DialogPortalContext","React","useDialogPortalContext","value","_formatErrorMessage"],"mappings":";;AAIY,MAACA,IAAmC,gBAAAC,EAAM,cAAc,MAAS;AACzE,QAAQ,IAAI,aAAa,iBAAcD,EAAoB,cAAc;AACtE,SAASE,IAAyB;AACvC,QAAMC,IAAQF,EAAM,WAAWD,CAAmB;AAClD,MAAIG,MAAU;AACZ,UAAM,IAAI,MAAM,QAAQ,IAAI,aAAa,eAAe,yCAAyCC,EAAoB,EAAE,CAAC;AAE1H,SAAOD;AACT;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index181.js","sources":["../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js"],"sourcesContent":["import checkNumberLength from './helpers/checkNumberLength.js';\nimport parseDigits from './helpers/parseDigits.js';\nimport formatNationalNumberUsingFormat from './helpers/formatNationalNumberUsingFormat.js';\nexport default function formatCompleteNumber(state, format, _ref) {\n var metadata = _ref.metadata,\n shouldTryNationalPrefixFormattingRule = _ref.shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref.getSeparatorAfterNationalPrefix;\n var matcher = new RegExp(\"^(?:\".concat(format.pattern(), \")$\"));\n if (matcher.test(state.nationalSignificantNumber)) {\n return formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, {\n metadata: metadata,\n shouldTryNationalPrefixFormattingRule: shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix\n });\n }\n}\nexport function canFormatCompleteNumber(nationalSignificantNumber, country, metadata) {\n return checkNumberLength(nationalSignificantNumber, country, metadata) === 'IS_POSSIBLE';\n}\nfunction formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, _ref2) {\n var metadata = _ref2.metadata,\n shouldTryNationalPrefixFormattingRule = _ref2.shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref2.getSeparatorAfterNationalPrefix;\n // `format` has already been checked for `nationalPrefix` requirement.\n\n var nationalSignificantNumber = state.nationalSignificantNumber,\n international = state.international,\n nationalPrefix = state.nationalPrefix,\n carrierCode = state.carrierCode;\n\n // Format the number with using `national_prefix_formatting_rule`.\n // If the resulting formatted number is a valid formatted number, then return it.\n //\n // Google's AsYouType formatter is different in a way that it doesn't try\n // to format using the \"national prefix formatting rule\", and instead it\n // simply prepends a national prefix followed by a \" \" character.\n // This code does that too, but as a fallback.\n // The reason is that \"national prefix formatting rule\" may use parentheses,\n // which wouldn't be included has it used the simpler Google's way.\n //\n if (shouldTryNationalPrefixFormattingRule(format)) {\n var formattedNumber = formatNationalNumber(state, format, {\n useNationalPrefixFormattingRule: true,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,\n metadata: metadata\n });\n if (formattedNumber) {\n return formattedNumber;\n }\n }\n\n // Format the number without using `national_prefix_formatting_rule`.\n return formatNationalNumber(state, format, {\n useNationalPrefixFormattingRule: false,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,\n metadata: metadata\n });\n}\nfunction formatNationalNumber(state, format, _ref3) {\n var metadata = _ref3.metadata,\n useNationalPrefixFormattingRule = _ref3.useNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref3.getSeparatorAfterNationalPrefix;\n var formattedNationalNumber = formatNationalNumberUsingFormat(state.nationalSignificantNumber, format, {\n carrierCode: state.carrierCode,\n useInternationalFormat: state.international,\n withNationalPrefix: useNationalPrefixFormattingRule,\n metadata: metadata\n });\n if (!useNationalPrefixFormattingRule) {\n if (state.nationalPrefix) {\n // If a national prefix was extracted, then just prepend it,\n // followed by a \" \" character.\n formattedNationalNumber = state.nationalPrefix + getSeparatorAfterNationalPrefix(format) + formattedNationalNumber;\n } else if (state.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix) {\n formattedNationalNumber = state.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix + ' ' + formattedNationalNumber;\n }\n }\n if (isValidFormattedNationalNumber(formattedNationalNumber, state)) {\n return formattedNationalNumber;\n }\n}\n\n// Check that the formatted phone number contains exactly\n// the same digits that have been input by the user.\n// For example, when \"0111523456789\" is input for `AR` country,\n// the extracted `this.nationalSignificantNumber` is \"91123456789\",\n// which means that the national part of `this.digits` isn't simply equal to\n// `this.nationalPrefix` + `this.nationalSignificantNumber`.\n//\n// Also, a `format` can add extra digits to the `this.nationalSignificantNumber`\n// being formatted via `metadata[country].national_prefix_transform_rule`.\n// For example, for `VI` country, it prepends `340` to the national number,\n// and if this check hasn't been implemented, then there would be a bug\n// when `340` \"area coude\" is \"duplicated\" during input for `VI` country:\n// https://github.com/catamphetamine/libphonenumber-js/issues/318\n//\n// So, all these \"gotchas\" are filtered out.\n//\n// In the original Google's code, the comments say:\n// \"Check that we didn't remove nor add any extra digits when we matched\n// this formatting pattern. This usually happens after we entered the last\n// digit during AYTF. Eg: In case of MX, we swallow mobile token (1) when\n// formatted but AYTF should retain all the number entered and not change\n// in order to match a format (of same leading digits and length) display\n// in that way.\"\n// \"If it's the same (i.e entered number and format is same), then it's\n// safe to return this in formatted number as nothing is lost / added.\"\n// Otherwise, don't use this format.\n// https://github.com/google/libphonenumber/commit/3e7c1f04f5e7200f87fb131e6f85c6e99d60f510#diff-9149457fa9f5d608a11bb975c6ef4bc5\n// https://github.com/google/libphonenumber/commit/3ac88c7106e7dcb553bcc794b15f19185928a1c6#diff-2dcb77e833422ee304da348b905cde0b\n//\nfunction isValidFormattedNationalNumber(formattedNationalNumber, state) {\n return parseDigits(formattedNationalNumber) === state.getNationalDigits();\n}\n//# sourceMappingURL=AsYouTypeFormatter.complete.js.map"],"names":["formatCompleteNumber","state","format","_ref","metadata","shouldTryNationalPrefixFormattingRule","getSeparatorAfterNationalPrefix","matcher","formatNationalNumberWithAndWithoutNationalPrefixFormattingRule","canFormatCompleteNumber","nationalSignificantNumber","country","checkNumberLength","_ref2","formattedNumber","formatNationalNumber","_ref3","useNationalPrefixFormattingRule","formattedNationalNumber","formatNationalNumberUsingFormat","isValidFormattedN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