@rpcbase/ui 0.183.0 → 0.185.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.
- package/dist/index10.js +25 -24
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +107 -5
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +262 -4
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +9 -4
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +42 -6
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +4 -145
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +45 -38
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +52 -5
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +4 -7
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +3 -12
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +15 -13
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +34 -66
- package/dist/index11.js.map +1 -1
- package/dist/index110.js +5 -7
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +7 -31
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +16 -10
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +4 -10
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +4 -8
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +5 -13
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +5 -101
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +5 -20
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +4 -53
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +6 -72
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +556 -525
- package/dist/index12.js.map +1 -1
- package/dist/index120.js +24 -9
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +6 -20
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +4 -16
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +6 -23
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +5 -6
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +4 -5
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +5 -23
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +5 -35
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +9 -16
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +5 -6
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +128 -118
- package/dist/index13.js.map +1 -1
- package/dist/index130.js +4 -4
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +4 -4
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +6 -4
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +145 -4
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +39 -3
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +4 -6
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +8 -24
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +13 -7
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +13 -6
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +7 -5
- package/dist/index139.js.map +1 -1
- package/dist/index14.js +74 -74
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +31 -3
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +10 -3
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +10 -4
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +8 -3
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +13 -4
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +101 -3
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +20 -4
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +53 -3
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +71 -45
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +9 -205
- package/dist/index149.js.map +1 -1
- package/dist/index15.js +763 -624
- package/dist/index15.js.map +1 -1
- package/dist/index150.js +20 -21
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +16 -24
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +23 -399
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +6 -46
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +5 -605
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +23 -5
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +34 -68
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +16 -2
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +6 -363
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +4 -261
- package/dist/index159.js.map +1 -1
- package/dist/index16.js +20 -22
- package/dist/index16.js.map +1 -1
- package/dist/index160.js +4 -60
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +4 -46
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +4 -169
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +3 -109
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +6 -24
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +24 -8
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +7 -4
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +6 -5
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +5 -4
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +3 -466
- package/dist/index169.js.map +1 -1
- package/dist/index17.js +17 -17
- package/dist/index17.js.map +1 -1
- package/dist/index170.js +3 -185
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +4 -107
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +3 -262
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +4 -9
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +3 -42
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +3 -4
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +3 -58
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +46 -8
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +201 -62
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +22 -20
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +411 -341
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +24 -16
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +398 -4
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +604 -4
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +13 -6
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +154 -4
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +30 -7
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +9 -17
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +47 -5
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +11 -5
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +44 -13
- package/dist/index189.js.map +1 -1
- package/dist/index19.js +626 -660
- package/dist/index19.js.map +1 -1
- package/dist/index190.js +95 -10
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +86 -14
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +105 -14
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +52 -5
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +11 -6
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +37 -7
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +8 -6
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +116 -9
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +17 -5
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +15 -5
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +442 -634
- package/dist/index20.js.map +1 -1
- package/dist/index200.js +3 -9
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +36 -5
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +20 -5
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +9 -4
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +8 -11
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +19 -10
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +28 -10
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +16 -11
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +58 -11
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +8 -10
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +254 -200
- package/dist/index21.js.map +1 -1
- package/dist/index210.js +66 -7
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +19 -6
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +16 -5
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +5 -6
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +5 -7
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +6 -6
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +4 -55
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +7 -16
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +17 -7
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +5 -10
- package/dist/index219.js.map +1 -1
- package/dist/index22.js +1 -1
- package/dist/index22.js.map +1 -1
- package/dist/index220.js +5 -10
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +13 -21
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +10 -10
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +14 -9
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +14 -9
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +5 -4
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +6 -5
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +7 -16
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +6 -9
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +9 -18
- package/dist/index229.js.map +1 -1
- package/dist/index23.js +27 -34
- package/dist/index23.js.map +1 -1
- package/dist/index230.js +5 -15
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +5 -12
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +9 -29
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +5 -12
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +5 -25
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +4 -5
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +11 -24
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +10 -28
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +11 -5
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +11 -67
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +219 -222
- package/dist/index24.js.map +1 -1
- package/dist/index240.js +11 -180
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +10 -46
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +7 -13
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +6 -154
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +5 -30
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +6 -9
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +7 -47
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +6 -11
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +54 -43
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +13 -92
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +46 -50
- package/dist/index25.js.map +1 -1
- package/dist/index250.js +7 -86
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +8 -103
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +9 -51
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +21 -11
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +10 -37
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +8 -7
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +9 -116
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +4 -17
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +5 -15
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +16 -3
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +9 -36
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +18 -20
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +15 -9
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +12 -8
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +28 -18
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +11 -27
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +23 -14
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +5 -4
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +24 -18
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +29 -13
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +5 -5
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +68 -3
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +179 -22
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +43 -109
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +20 -15
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +4 -524
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +18 -127
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +12 -133
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +5 -21
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +3 -6
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +3 -37
- package/dist/index28.js.map +1 -1
- package/dist/index280.js +23 -5
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +113 -4
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +15 -15
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +524 -8
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +127 -5
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +133 -4
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +5 -545
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +6 -47
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +4 -18
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +15 -6
- package/dist/index289.js.map +1 -1
- package/dist/index29.js +37 -3
- package/dist/index29.js.map +1 -1
- package/dist/index290.js +8 -8
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +5 -7
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +4 -8
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +545 -12
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +47 -10
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +17 -13
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +7 -69
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +9 -9
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +8 -14
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +9 -66
- package/dist/index299.js.map +1 -1
- package/dist/index3.js.map +1 -1
- package/dist/index30.js +3 -125
- package/dist/index30.js.map +1 -1
- package/dist/index300.js +12 -64
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +9 -4
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +14 -56
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +65 -68
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +68 -30
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +9 -9
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +13 -152
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +65 -107
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +4 -3
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +56 -23
- package/dist/index309.js.map +1 -1
- package/dist/index31.js +120 -227
- package/dist/index31.js.map +1 -1
- package/dist/index310.js +68 -16
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +31 -29
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +9 -13
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +153 -7
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +107 -22
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +4 -13
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +22 -27
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +16 -5
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +32 -0
- package/dist/index318.js.map +1 -0
- package/dist/index319.js +16 -0
- package/dist/index319.js.map +1 -0
- package/dist/index32.js +229 -21
- package/dist/index32.js.map +1 -1
- package/dist/index320.js +10 -0
- package/dist/index320.js.map +1 -0
- package/dist/index321.js +26 -0
- package/dist/index321.js.map +1 -0
- package/dist/index322.js +16 -0
- package/dist/index322.js.map +1 -0
- package/dist/index323.js +31 -0
- package/dist/index323.js.map +1 -0
- package/dist/index324.js +8 -0
- package/dist/index324.js.map +1 -0
- package/dist/index33.js +23 -50
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +50 -2640
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +2598 -351
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +375 -214
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +230 -19
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +18 -138
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +113 -170
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +17 -15
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +209 -64
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +86 -94
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +118 -5
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +5 -843
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +832 -54
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +57 -8
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +8 -2
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +2 -24
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +11 -233
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +19 -205
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +34 -34
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +7 -3
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +2 -7
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +22 -46
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +232 -25
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +50 -47
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +2 -8
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +2 -15
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +5 -133
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +7 -10
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +5 -216
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +154 -120
- package/dist/index6.js.map +1 -1
- package/dist/index60.js +2 -13
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +2 -34
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +6 -46
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +33 -7
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +24 -47
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +8 -4
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +11 -5
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +202 -25
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +4 -50
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +48 -9
- package/dist/index69.js.map +1 -1
- package/dist/index7.js +29 -24
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +49 -10
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +7 -53
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +14 -5
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +133 -7
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +10 -5
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +217 -2
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +13 -2
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +47 -52
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +49 -4
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +4 -5
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +21 -24
- package/dist/index8.js.map +1 -1
- package/dist/index80.js +5 -15
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +28 -6
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +50 -8
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +9 -17
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +5 -4
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +68 -4
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +2 -6
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +363 -5
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +261 -4
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +60 -4
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +138 -187
- package/dist/index9.js.map +1 -1
- package/dist/index90.js +46 -6
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +169 -24
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +109 -6
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +24 -4
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +8 -7
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +4 -5
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +5 -4
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +4 -5
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +466 -4
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +185 -8
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
package/dist/index20.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index20.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","props","forwardedRef","value","defaultCountry","countryProp","locale","onChange","onCountryChange","className","inputClassName","disabled","readOnly","selectProps","autofillShimName","messagesProp","renderValidationMessage","restProps","onInputFocus","onInputBlur","onInputKeyDown","inputName","inputAutoComplete","restInputProps","hasConfiguredCountry","localeCacheKey","getLocaleCacheKey","localeForBuild","parseLocaleCacheKey","resolvedMessages","resolveMessages","countryOptions","getCachedCountryOptions","resolveSelectedCountry","country","match","candidate","toSelectedCountry","buildFallbackSelectedCountry","fallbackCountry","getValidCountry","DEFAULT_COUNTRY","option","hasResolvedCountryRef","initialStateRef","lastNormalizedRef","baseCountryForInit","normalized","normalizeInputValue","international","phoneNumber","detectedCountry","inferredCountry","hasExplicitInternationalPrefix","formatWithAsYouType","canonicalDetectedCountry","resolvedCountry","rawDigits","sanitizeDigits","hasExplicitPlus","internationalDigits","initialDialCode","getCountryCallingCode","initialHasPrefix","detectNationalPrefixForDisplay","suggestion","getSuggestionState","inferredCountryToApply","nextDialCode","finalHasPrefix","displayValue","injectNationalPrefixDisplay","displayDetectedCountry","allowInlineFlag","shouldDisplayExplicitCountrySelection","initialState","uncontrolledCountry","setUncontrolledCountry","inputValueState","setInputValueState","countryQuery","setCountryQuery","showSuggestions","setShowSuggestions","highlightedIndex","setHighlightedIndex","isFocused","setIsFocused","lengthIssue","setLengthIssue","hasExplicitCountrySelection","setHasExplicitCountrySelection","manualSelectionCountryRef","keyboardBufferRef","bufferTimeoutRef","scrollBehaviorRef","pendingSelectionRef","consumeScrollBehavior","behavior","isCountryControlled","selectedCountry","activeCountry","inputRef","selection","input","start","end","selectOverrides","userSelectStyles","userSelectComponents","userClassNamePrefix","userFormatOptionLabel","forwardedSelectProps","noOptionsMessage","restForwardedSelectProps","mergedSelectStyles","suggestionSelectStyles","mergedSelectComponents","baseComponents","HiddenControl","NullComponent","overrides","SuggestionOption","hasAnnouncedCountryRef","notifyCountryChange","baseCountryForSync","previousNormalized","nextCountry","initialHasTypedTrunk","finalCountry","hasTypedTrunk","shouldShowInlineFlag","getLengthIssue","current","emitChange","details","scheduleBufferReset","handleInputChange","event","target","snapshot","captureSelectionSnapshot","raw","baseCountryForInput","dialCode","typedDigits","startsWithDialCode","hasLeadingZero","isIddPrefix","COMMON_IDD_PREFIXES","prefix","shouldRemoveNationalPrefix","resolveSelection","national","normalizedDigits","nationalDigits","stripPrefix","handleCountrySelect","previousDigits","currentDial","rebasedDigits","filteredOptions","results","pushUnique","existing","fallbackOption","currentOption","query","digitQuery","normalizedQuery","normalizeSearchValue","a","b","aExact","bExact","token","aIndex","optionMatchIndex","bIndex","suggestionMenuIsOpen","highlightedOption","updateHighlightedOption","index","selectFormatOptionLabel","meta","formatCountryOption","optionLabelRenderer","highlightContextValue","activeOption","activeFlag","inlineFlagLabel","hasInlineFlag","lengthHint","countryName","validationNode","rendered","jsx","appendToBuffer","char","popBuffer","handleKeyDown","key","selectionStart","selectionEnd","isCollapsedSelection","nextStart","skipFormattingCharactersLeft","skipFormattingCharactersRight","handleFocus","handleBlur","openCountryMenu","shimName","cn","jsxs","SuggestionContext","Select"],"mappings":";;;;;;;;;;AAoEO,MAAMA,KAAmBC,EAAM;AAAA,EACpC,SAA0BC,IAAOC,IAAc;AAC7C,UAAM;AAAA,MACJ,OAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,SAASC;AAAA,MACT,QAAAC;AAAA,MACA,UAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,WAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,UAAAC;AAAA,MACA,UAAAC;AAAA,MACA,aAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,UAAUC;AAAA,MACV,yBAAAC;AAAA,MACA,GAAGC;AAAA,IAAA,IACDhB,IAEE;AAAA,MACJ,SAASiB;AAAA,MACT,QAAQC;AAAA,MACR,WAAWC;AAAA,MACX,MAAMC;AAAA,MACN,cAAcC;AAAA,MACd,GAAGC;AAAA,IAAA,IACDN,IAEEO,IACJ,OAAOpB,MAAmB,YAAY,OAAOC,KAAgB,UAEzDoB,KAAiBC,GAAkBpB,EAAM,GACzCqB,KAAiB3B,EAAM;AAAA,MAC3B,MAAM4B,GAAoBH,EAAc;AAAA,MACxC,CAACA,EAAc;AAAA,IAAA,GAEXI,KAAmB7B,EAAM;AAAA,MAC7B,MAAM8B,GAAgBH,IAAgBZ,EAAY;AAAA,MAClD,CAACY,IAAgBZ,EAAY;AAAA,IAAA,GAEzBgB,IAAiB/B,EAAM;AAAA,MAC3B,MAAMgC,GAAwBL,IAAgBF,EAAc;AAAA,MAC5D,CAACA,IAAgBE,EAAc;AAAA,IAAA,GAE3BM,KAAyBjC,EAAM;AAAA,MACnC,CAACkC,MAAqD;AACpD,cAAMC,IAA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;AAAA,MAAA,IAEV;AAAA,MAEJf,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAO;AAAA,YACL,eAAejB,IAAuB,SAAS;AAAA,YAC/C,OAAO;AAAA,UAAA;AAAA,UAET,aAAa,CAACzC,MAAUA,EAAM,eAAA;AAAA,UAE9B,UAAA0D,gBAAAA,EAAAA,IAACkB,GAAkB,UAAlB,EAA2B,OAAO3B,IACjC,UAAAS,gBAAAA,EAAAA;AAAAA,YAACmB;AAAA,YAAA;AAAA,cACE,GAAGrG;AAAA,cACJ,YAAYiE;AAAA,cACZ,SAASlB;AAAA,cACT,OAAO;AAAA,cACP,YAAY5C;AAAA,cACZ,QAAQF;AAAA,cACR,aAAa;AAAA,cACb,cAAc;AAAA,cACd,uBAAuB;AAAA,cACvB,iBAAiB;AAAA,cACjB,0BAA0B;AAAA,cAC1B,UAAU0C;AAAA,cACV,iBAAiB/C,MAAuB;AAAA,cACxC,aAAY;AAAA,cACZ,mBAAmByE;AAAA,cACnB,kBACAtE,OAAqB,MAAMpF,GAAiB;AAAA,YAAA;AAAA,UAAA,EAEhD,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,MAGCqK;AAAA,IAAA,GACH;AAAA,EAEJ;AACF;AAEAnM,GAAiB,cAAc;"}
|
|
1
|
+
{"version":3,"file":"index20.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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EAAAA,GACH;AAEJ,CACF;AAEA3Q,GAAiB8S,cAAc;"}
|
package/dist/index200.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { startOfWeekYear as a } from "./index294.js";
|
|
4
|
-
import { toDate as i } from "./index280.js";
|
|
5
|
-
function k(r, t) {
|
|
6
|
-
const e = i(r, t?.in), o = +m(e, t) - +a(e, t);
|
|
7
|
-
return Math.round(o / f) + 1;
|
|
1
|
+
function r(e, n) {
|
|
2
|
+
return e = e || "", new RegExp("^(?:" + n + ")$").test(e);
|
|
8
3
|
}
|
|
9
4
|
export {
|
|
10
|
-
|
|
11
|
-
k as getWeek
|
|
5
|
+
r as default
|
|
12
6
|
};
|
|
13
7
|
//# sourceMappingURL=index200.js.map
|
package/dist/index200.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index200.js","sources":["../../../node_modules/
|
|
1
|
+
{"version":3,"file":"index200.js","sources":["../../../node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js"],"sourcesContent":["/**\r\n * Checks whether the entire input sequence can be matched\r\n * against the regular expression.\r\n * @return {boolean}\r\n */\nexport default function matchesEntirely(text, regularExpressionText) {\n // If the assigning of the `''` default value is moved to the arguments above,\n // the code coverage would decrease for some weird reason.\n text = text || '';\n return new RegExp('^(?:' + regularExpressionText + ')$').test(text);\n}\n//# sourceMappingURL=matchesEntirely.js.map"],"names":["matchesEntirely","text","regularExpressionText"],"mappings":"AAKe,SAASA,EAAgBC,GAAMC,GAAuB;AAGnE,SAAAD,IAAOA,KAAQ,IACR,IAAI,OAAO,SAASC,IAAwB,IAAI,EAAE,KAAKD,CAAI;AACpE;","x_google_ignoreList":[0]}
|
package/dist/index201.js
CHANGED
|
@@ -1,9 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import l from "./index206.js";
|
|
2
|
+
import o from "./index200.js";
|
|
3
|
+
import u from "./index183.js";
|
|
4
|
+
import N from "./index102.js";
|
|
5
|
+
function g(e, n, r) {
|
|
6
|
+
var i = l(e, r), a = i.carrierCode, t = i.nationalNumber;
|
|
7
|
+
if (t !== e) {
|
|
8
|
+
if (!m(e, t, r))
|
|
9
|
+
return {
|
|
10
|
+
nationalNumber: e
|
|
11
|
+
};
|
|
12
|
+
if (r.numberingPlan.possibleLengths() && (n || (n = N(r.numberingPlan.callingCode(), {
|
|
13
|
+
nationalNumber: t,
|
|
14
|
+
metadata: r
|
|
15
|
+
})), !f(t, n, r)))
|
|
16
|
+
return {
|
|
17
|
+
nationalNumber: e
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
nationalNumber: t,
|
|
22
|
+
carrierCode: a
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function m(e, n, r) {
|
|
26
|
+
return !(o(e, r.nationalNumberPattern()) && !o(n, r.nationalNumberPattern()));
|
|
27
|
+
}
|
|
28
|
+
function f(e, n, r) {
|
|
29
|
+
switch (u(e, n, r)) {
|
|
30
|
+
case "TOO_SHORT":
|
|
31
|
+
case "INVALID_LENGTH":
|
|
32
|
+
return !1;
|
|
33
|
+
default:
|
|
34
|
+
return !0;
|
|
35
|
+
}
|
|
4
36
|
}
|
|
5
37
|
export {
|
|
6
|
-
|
|
7
|
-
f as isAfter
|
|
38
|
+
g as default
|
|
8
39
|
};
|
|
9
40
|
//# sourceMappingURL=index201.js.map
|
package/dist/index201.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index201.js","sources":["../../../node_modules/
|
|
1
|
+
{"version":3,"file":"index201.js","sources":["../../../node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js"],"sourcesContent":["import extractNationalNumberFromPossiblyIncompleteNumber from './extractNationalNumberFromPossiblyIncompleteNumber.js';\nimport matchesEntirely from './matchesEntirely.js';\nimport checkNumberLength from './checkNumberLength.js';\nimport getCountryByCallingCode from './getCountryByCallingCode.js';\n\n/**\r\n * Strips national prefix and carrier code from a complete phone number.\r\n * The difference from the non-\"FromCompleteNumber\" function is that\r\n * it won't extract national prefix if the resultant number is too short\r\n * to be a complete number for the selected phone numbering plan.\r\n * @param {string} number — Complete phone number digits.\r\n * @param {string?} country — Country, if known.\r\n * @param {Metadata} metadata — Metadata with a phone numbering plan selected.\r\n * @return {object} `{ nationalNumber: string, carrierCode: string? }`.\r\n */\nexport default function extractNationalNumber(number, country, metadata) {\n // Parsing national prefixes and carrier codes\n // is only required for local phone numbers\n // but some people don't understand that\n // and sometimes write international phone numbers\n // with national prefixes (or maybe even carrier codes).\n // http://ucken.blogspot.ru/2016/03/trunk-prefixes-in-skype4b.html\n // Google's original library forgives such mistakes\n // and so does this library, because it has been requested:\n // https://github.com/catamphetamine/libphonenumber-js/issues/127\n var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(number, metadata),\n carrierCode = _extractNationalNumbe.carrierCode,\n nationalNumber = _extractNationalNumbe.nationalNumber;\n if (nationalNumber !== number) {\n if (!shouldHaveExtractedNationalPrefix(number, nationalNumber, metadata)) {\n // Don't strip the national prefix.\n return {\n nationalNumber: number\n };\n }\n // Check the national (significant) number length after extracting national prefix and carrier code.\n // Legacy generated metadata (before `1.0.18`) didn't support the \"possible lengths\" feature.\n if (metadata.numberingPlan.possibleLengths()) {\n // If an exact `country` is not specified, attempt to detect it from the assumed national number.\n if (!country) {\n country = getCountryByCallingCode(metadata.numberingPlan.callingCode(), {\n nationalNumber: nationalNumber,\n metadata: metadata\n });\n }\n\n // The number remaining after stripping the national prefix and carrier code\n // should be long enough to have a possible length for the country.\n // Otherwise, don't strip the national prefix and carrier code,\n // since the original number could be a valid number.\n // This check has been copy-pasted \"as is\" from Google's original library:\n // https://github.com/google/libphonenumber/blob/876268eb1ad6cdc1b7b5bef17fc5e43052702d57/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3236-L3250\n // It doesn't check for the \"possibility\" of the original `number`.\n // I guess it's fine not checking that one. It works as is anyway.\n if (!isPossibleIncompleteNationalNumber(nationalNumber, country, metadata)) {\n // Don't strip the national prefix.\n return {\n nationalNumber: number\n };\n }\n }\n }\n return {\n nationalNumber: nationalNumber,\n carrierCode: carrierCode\n };\n}\n\n// In some countries, the same digit could be a national prefix\n// or a leading digit of a valid phone number.\n// For example, in Russia, national prefix is `8`,\n// and also `800 555 35 35` is a valid number\n// in which `8` is not a national prefix, but the first digit\n// of a national (significant) number.\n// Same's with Belarus:\n// `82004910060` is a valid national (significant) number,\n// but `2004910060` is not.\n// To support such cases (to prevent the code from always stripping\n// national prefix), a condition is imposed: a national prefix\n// is not extracted when the original number is \"viable\" and the\n// resultant number is not, a \"viable\" national number being the one\n// that matches `national_number_pattern`.\nfunction shouldHaveExtractedNationalPrefix(nationalNumberBefore, nationalNumberAfter, metadata) {\n // The equivalent in Google's code is:\n // https://github.com/google/libphonenumber/blob/e326fa1fc4283bb05eb35cb3c15c18f98a31af33/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L2969-L3004\n if (matchesEntirely(nationalNumberBefore, metadata.nationalNumberPattern()) && !matchesEntirely(nationalNumberAfter, metadata.nationalNumberPattern())) {\n return false;\n }\n // This \"is possible\" national number (length) check has been commented out\n // because it's superceded by the (effectively) same check done in the\n // `extractNationalNumber()` function after it calls `shouldHaveExtractedNationalPrefix()`.\n // In other words, why run the same check twice if it could only be run once.\n // // Check the national (significant) number length after extracting national prefix and carrier code.\n // // Fixes a minor \"weird behavior\" bug: https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/57\n // // (Legacy generated metadata (before `1.0.18`) didn't support the \"possible lengths\" feature).\n // if (metadata.possibleLengths()) {\n // \tif (isPossibleIncompleteNationalNumber(nationalNumberBefore, metadata) &&\n // \t\t!isPossibleIncompleteNationalNumber(nationalNumberAfter, metadata)) {\n // \t\treturn false\n // \t}\n // }\n return true;\n}\nfunction isPossibleIncompleteNationalNumber(nationalNumber, country, metadata) {\n switch (checkNumberLength(nationalNumber, country, metadata)) {\n case 'TOO_SHORT':\n case 'INVALID_LENGTH':\n // This library ignores \"local-only\" phone numbers (for simplicity).\n // See the readme for more info on what are \"local-only\" phone numbers.\n // case 'IS_POSSIBLE_LOCAL_ONLY':\n return false;\n default:\n return true;\n }\n}\n//# sourceMappingURL=extractNationalNumber.js.map"],"names":["extractNationalNumber","number","country","metadata","_extractNationalNumbe","extractNationalNumberFromPossiblyIncompleteNumber","carrierCode","nationalNumber","shouldHaveExtractedNationalPrefix","getCountryByCallingCode","isPossibleIncompleteNationalNumber","nationalNumberBefore","nationalNumberAfter","matchesEntirely","checkNumberLength"],"mappings":";;;;AAee,SAASA,EAAsBC,GAAQC,GAASC,GAAU;AAUvE,MAAIC,IAAwBC,EAAkDJ,GAAQE,CAAQ,GAC5FG,IAAcF,EAAsB,aACpCG,IAAiBH,EAAsB;AACzC,MAAIG,MAAmBN,GAAQ;AAC7B,QAAI,CAACO,EAAkCP,GAAQM,GAAgBJ,CAAQ;AAErE,aAAO;AAAA,QACL,gBAAgBF;AAAA,MACxB;AAII,QAAIE,EAAS,cAAc,sBAEpBD,MACHA,IAAUO,EAAwBN,EAAS,cAAc,YAAW,GAAI;AAAA,MACtE,gBAAgBI;AAAA,MAChB,UAAUJ;AAAA,IACpB,CAAS,IAWC,CAACO,EAAmCH,GAAgBL,GAASC,CAAQ;AAEvE,aAAO;AAAA,QACL,gBAAgBF;AAAA,MAC1B;AAAA,EAGE;AACA,SAAO;AAAA,IACL,gBAAgBM;AAAA,IAChB,aAAaD;AAAA,EACjB;AACA;AAgBA,SAASE,EAAkCG,GAAsBC,GAAqBT,GAAU;AAG9F,SAAI,EAAAU,EAAgBF,GAAsBR,EAAS,sBAAqB,CAAE,KAAK,CAACU,EAAgBD,GAAqBT,EAAS,sBAAqB,CAAE;AAiBvJ;AACA,SAASO,EAAmCH,GAAgBL,GAASC,GAAU;AAC7E,UAAQW,EAAkBP,GAAgBL,GAASC,CAAQ,GAAC;AAAA,IAC1D,KAAK;AAAA,IACL,KAAK;AAIH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACb;AACA;","x_google_ignoreList":[0]}
|
package/dist/index202.js
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import s, { isPhoneContextValid as x, PLUS_SIGN as F, RFC3966_PREFIX_ as a, RFC3966_PHONE_CONTEXT_ as d, RFC3966_ISDN_SUBADDRESS_ as m } from "./index274.js";
|
|
2
|
+
import v from "./index191.js";
|
|
3
|
+
function S(r, _) {
|
|
4
|
+
var f = _.extractFormattedPhoneNumber, e = s(r);
|
|
5
|
+
if (!x(e))
|
|
6
|
+
throw new v("NOT_A_NUMBER");
|
|
7
|
+
var t;
|
|
8
|
+
if (e === null)
|
|
9
|
+
t = f(r) || "";
|
|
10
|
+
else {
|
|
11
|
+
t = "", e.charAt(0) === F && (t += e);
|
|
12
|
+
var n = r.indexOf(a), o;
|
|
13
|
+
n >= 0 ? o = n + a.length : o = 0;
|
|
14
|
+
var h = r.indexOf(d);
|
|
15
|
+
t += r.substring(o, h);
|
|
16
|
+
}
|
|
17
|
+
var i = t.indexOf(m);
|
|
18
|
+
if (i > 0 && (t = t.substring(0, i)), t !== "")
|
|
19
|
+
return t;
|
|
4
20
|
}
|
|
5
21
|
export {
|
|
6
|
-
|
|
7
|
-
f as isBefore
|
|
22
|
+
S as default
|
|
8
23
|
};
|
|
9
24
|
//# sourceMappingURL=index202.js.map
|
package/dist/index202.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index202.js","sources":["../../../node_modules/
|
|
1
|
+
{"version":3,"file":"index202.js","sources":["../../../node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js"],"sourcesContent":["import extractPhoneContext, { isPhoneContextValid, PLUS_SIGN, RFC3966_PREFIX_, RFC3966_PHONE_CONTEXT_, RFC3966_ISDN_SUBADDRESS_ } from './extractPhoneContext.js';\nimport ParseError from '../ParseError.js';\n\n/**\r\n * @param {string} numberToParse\r\n * @param {string} nationalNumber\r\n * @return {}\r\n */\nexport default function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(numberToParse, _ref) {\n var extractFormattedPhoneNumber = _ref.extractFormattedPhoneNumber;\n var phoneContext = extractPhoneContext(numberToParse);\n if (!isPhoneContextValid(phoneContext)) {\n throw new ParseError('NOT_A_NUMBER');\n }\n var phoneNumberString;\n if (phoneContext === null) {\n // Extract a possible number from the string passed in.\n // (this strips leading characters that could not be the start of a phone number)\n phoneNumberString = extractFormattedPhoneNumber(numberToParse) || '';\n } else {\n phoneNumberString = '';\n\n // If the phone context contains a phone number prefix, we need to capture\n // it, whereas domains will be ignored.\n if (phoneContext.charAt(0) === PLUS_SIGN) {\n phoneNumberString += phoneContext;\n }\n\n // Now append everything between the \"tel:\" prefix and the phone-context.\n // This should include the national number, an optional extension or\n // isdn-subaddress component. Note we also handle the case when \"tel:\" is\n // missing, as we have seen in some of the phone number inputs.\n // In that case, we append everything from the beginning.\n var indexOfRfc3966Prefix = numberToParse.indexOf(RFC3966_PREFIX_);\n var indexOfNationalNumber;\n // RFC 3966 \"tel:\" prefix is preset at this stage because\n // `isPhoneContextValid()` requires it to be present.\n /* istanbul ignore else */\n if (indexOfRfc3966Prefix >= 0) {\n indexOfNationalNumber = indexOfRfc3966Prefix + RFC3966_PREFIX_.length;\n } else {\n indexOfNationalNumber = 0;\n }\n var indexOfPhoneContext = numberToParse.indexOf(RFC3966_PHONE_CONTEXT_);\n phoneNumberString += numberToParse.substring(indexOfNationalNumber, indexOfPhoneContext);\n }\n\n // Delete the isdn-subaddress and everything after it if it is present.\n // Note extension won't appear at the same time with isdn-subaddress\n // according to paragraph 5.3 of the RFC3966 spec.\n var indexOfIsdn = phoneNumberString.indexOf(RFC3966_ISDN_SUBADDRESS_);\n if (indexOfIsdn > 0) {\n phoneNumberString = phoneNumberString.substring(0, indexOfIsdn);\n }\n // If both phone context and isdn-subaddress are absent but other\n // parameters are present, the parameters are left in nationalNumber.\n // This is because we are concerned about deleting content from a potential\n // number string when there is no strong evidence that the number is\n // actually written in RFC3966.\n\n if (phoneNumberString !== '') {\n return phoneNumberString;\n }\n}\n//# sourceMappingURL=extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js.map"],"names":["extractFormattedPhoneNumberFromPossibleRfc3966NumberUri","numberToParse","_ref","extractFormattedPhoneNumber","phoneContext","extractPhoneContext","isPhoneContextValid","ParseError","phoneNumberString","PLUS_SIGN","indexOfRfc3966Prefix","RFC3966_PREFIX_","indexOfNationalNumber","indexOfPhoneContext","RFC3966_PHONE_CONTEXT_","indexOfIsdn","RFC3966_ISDN_SUBADDRESS_"],"mappings":";;AAQe,SAASA,EAAwDC,GAAeC,GAAM;AACnG,MAAIC,IAA8BD,EAAK,6BACnCE,IAAeC,EAAoBJ,CAAa;AACpD,MAAI,CAACK,EAAoBF,CAAY;AACnC,UAAM,IAAIG,EAAW,cAAc;AAErC,MAAIC;AACJ,MAAIJ,MAAiB;AAGnB,IAAAI,IAAoBL,EAA4BF,CAAa,KAAK;AAAA,OAC7D;AACL,IAAAO,IAAoB,IAIhBJ,EAAa,OAAO,CAAC,MAAMK,MAC7BD,KAAqBJ;AAQvB,QAAIM,IAAuBT,EAAc,QAAQU,CAAe,GAC5DC;AAIJ,IAAIF,KAAwB,IAC1BE,IAAwBF,IAAuBC,EAAgB,SAE/DC,IAAwB;AAE1B,QAAIC,IAAsBZ,EAAc,QAAQa,CAAsB;AACtE,IAAAN,KAAqBP,EAAc,UAAUW,GAAuBC,CAAmB;AAAA,EACzF;AAKA,MAAIE,IAAcP,EAAkB,QAAQQ,CAAwB;AAUpE,MATID,IAAc,MAChBP,IAAoBA,EAAkB,UAAU,GAAGO,CAAW,IAQ5DP,MAAsB;AACxB,WAAOA;AAEX;","x_google_ignoreList":[0]}
|
package/dist/index203.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import f from "./index98.js";
|
|
2
|
+
var u = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;
|
|
3
|
+
function D(t, r, a) {
|
|
4
|
+
var e = new f(a);
|
|
5
|
+
if (e.selectNumberingPlan(t, r), e.defaultIDDPrefix())
|
|
6
|
+
return e.defaultIDDPrefix();
|
|
7
|
+
if (u.test(e.IDDPrefix()))
|
|
8
|
+
return e.IDDPrefix();
|
|
3
9
|
}
|
|
4
10
|
export {
|
|
5
|
-
|
|
6
|
-
e as isDate
|
|
11
|
+
D as default
|
|
7
12
|
};
|
|
8
13
|
//# sourceMappingURL=index203.js.map
|
package/dist/index203.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index203.js","sources":["../../../node_modules/
|
|
1
|
+
{"version":3,"file":"index203.js","sources":["../../../node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js"],"sourcesContent":["import Metadata from '../metadata.js';\n\n/**\r\n * Pattern that makes it easy to distinguish whether a region has a single\r\n * international dialing prefix or not. If a region has a single international\r\n * prefix (e.g. 011 in USA), it will be represented as a string that contains\r\n * a sequence of ASCII digits, and possibly a tilde, which signals waiting for\r\n * the tone. If there are multiple available international prefixes in a\r\n * region, they will be represented as a regex string that always contains one\r\n * or more characters that are not ASCII digits or a tilde.\r\n */\nvar SINGLE_IDD_PREFIX_REG_EXP = /^[\\d]+(?:[~\\u2053\\u223C\\uFF5E][\\d]+)?$/;\n\n// If the `country` supports IDD calling, it returns a preferred IDD prefix.\n// If the `country` doesn't support IDD calling, it returns `undefined`.\nexport default function getIddPrefix(country, callingCode, metadata) {\n var countryMetadata = new Metadata(metadata);\n countryMetadata.selectNumberingPlan(country, callingCode);\n if (countryMetadata.defaultIDDPrefix()) {\n return countryMetadata.defaultIDDPrefix();\n }\n if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {\n return countryMetadata.IDDPrefix();\n }\n}\n//# sourceMappingURL=getIddPrefix.js.map"],"names":["SINGLE_IDD_PREFIX_REG_EXP","getIddPrefix","country","callingCode","metadata","countryMetadata","Metadata"],"mappings":";AAWA,IAAIA,IAA4B;AAIjB,SAASC,EAAaC,GAASC,GAAaC,GAAU;AACnE,MAAIC,IAAkB,IAAIC,EAASF,CAAQ;AAE3C,MADAC,EAAgB,oBAAoBH,GAASC,CAAW,GACpDE,EAAgB;AAClB,WAAOA,EAAgB,iBAAgB;AAEzC,MAAIL,EAA0B,KAAKK,EAAgB,UAAS,CAAE;AAC5D,WAAOA,EAAgB,UAAS;AAEpC;","x_google_ignoreList":[0]}
|
package/dist/index204.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
);
|
|
9
|
-
return +t(o) == +t(i);
|
|
1
|
+
import { VALID_DIGITS as A } from "./index94.js";
|
|
2
|
+
var g = ";ext=", t = function(a) {
|
|
3
|
+
return "([".concat(A, "]{1,").concat(a, "})");
|
|
4
|
+
};
|
|
5
|
+
function D(x) {
|
|
6
|
+
var a = "20", o = "15", i = "9", F = "6", n = "[ \\t,]*", e = "[:\\..]?[ \\t,-]*", r = "#?", s = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)", E = "(?:[xx##~~]|int|int)", l = "[- ]+", u = "[ \\t]*", v = "(?:,{2}|;)", b = g + t(a), m = n + s + e + t(a) + r, p = n + E + e + t(i) + r, L = l + t(F) + "#", f = u + v + e + t(o) + r, c = u + "(?:,)+" + e + t(i) + r;
|
|
7
|
+
return b + "|" + m + "|" + p + "|" + L + "|" + f + "|" + c;
|
|
10
8
|
}
|
|
11
9
|
export {
|
|
12
|
-
|
|
13
|
-
s as isSameDay
|
|
10
|
+
D as default
|
|
14
11
|
};
|
|
15
12
|
//# sourceMappingURL=index204.js.map
|