@rpcbase/ui 0.164.0 → 0.166.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 +1 -1
- package/dist/index100.js +9 -24
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +42 -6
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +4 -4
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +52 -7
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +4 -5
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +3 -3
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +15 -5
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +5 -4
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +6 -7
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +16 -5
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +6 -15
- package/dist/index11.js.map +1 -1
- package/dist/index110.js +3 -3
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +2 -2
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +5 -6
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +5 -145
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +4 -39
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +4 -4
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +6 -7
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +24 -13
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +6 -13
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +4 -7
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +1 -1
- package/dist/index120.js +6 -31
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +5 -10
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +4 -10
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +5 -8
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +4 -13
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +8 -101
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +6 -20
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +4 -53
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +4 -72
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +6 -9
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +2 -2
- package/dist/index130.js +145 -20
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +38 -15
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +4 -23
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +7 -6
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +13 -5
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +13 -23
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +8 -35
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +32 -16
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +10 -6
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +10 -4
- package/dist/index139.js.map +1 -1
- package/dist/index14.js +4 -4
- package/dist/index140.js +8 -4
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +13 -4
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +101 -4
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +20 -4
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +53 -6
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +73 -24
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +9 -7
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +20 -6
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +16 -5
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +23 -3
- package/dist/index149.js.map +1 -1
- package/dist/index15.js +1 -1
- package/dist/index150.js +6 -3
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +5 -4
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +23 -3
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +35 -5
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +16 -4
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +6 -3
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +4 -3
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +4 -3
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +4 -33
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +4 -249
- package/dist/index159.js.map +1 -1
- package/dist/index16.js +1 -1
- package/dist/index160.js +3 -114
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +6 -219
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +24 -67
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +7 -20
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +6 -209
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +5 -319
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +3 -130
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +3 -20
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +4 -75
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +3 -18
- package/dist/index169.js.map +1 -1
- package/dist/index17.js +1 -1
- package/dist/index170.js +4 -101
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +4 -5
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +3 -14
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +4 -2
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +24 -7
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +29 -327
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +5 -50
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +62 -41
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +176 -42
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +41 -200
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +3 -12
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +14 -22
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +153 -23
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +27 -396
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +9 -3
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +47 -5
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +10 -67
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +45 -2
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +86 -354
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +75 -250
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +92 -47
- package/dist/index189.js.map +1 -1
- package/dist/index19.js +7 -7
- package/dist/index190.js +46 -40
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +10 -168
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +26 -98
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +8 -24
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +117 -8
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +17 -4
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +15 -5
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +3 -4
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +34 -464
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +19 -184
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +2 -2
- package/dist/index200.js +9 -107
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +8 -262
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +19 -9
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +27 -41
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +16 -4
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +59 -2
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +8 -67
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +66 -84
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +18 -45
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +16 -7
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +1 -1
- package/dist/index210.js +5 -4
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +4 -50
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +6 -67
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +4 -180
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +7 -46
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +17 -58
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +5 -8
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +5 -66
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +13 -19
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +10 -16
- package/dist/index219.js.map +1 -1
- package/dist/index22.js +1 -1
- package/dist/index220.js +14 -5
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +14 -5
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +5 -6
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +6 -4
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +7 -7
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +6 -17
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +9 -5
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +5 -5
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +5 -13
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +9 -10
- package/dist/index229.js.map +1 -1
- package/dist/index23.js +2 -2
- package/dist/index230.js +5 -14
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +4 -13
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +4 -5
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +10 -5
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +10 -7
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +10 -6
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +11 -9
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +11 -5
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +10 -5
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +7 -9
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +1 -1
- package/dist/index240.js +6 -5
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +4 -4
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +6 -4
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +7 -11
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +6 -10
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +55 -10
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +23 -11
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +16 -11
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +7 -10
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +10 -7
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +10 -6
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +21 -5
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +10 -6
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +9 -7
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +9 -6
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +4 -55
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +5 -23
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +15 -15
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +9 -7
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +18 -10
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +15 -10
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +12 -21
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +29 -10
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +12 -9
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +25 -9
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +5 -4
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +5 -6
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +3 -17
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +23 -9
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +112 -18
- package/dist/index269.js.map +1 -1
- package/dist/index27.js +37 -3
- package/dist/index27.js.map +1 -1
- package/dist/index270.js +15 -15
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +522 -10
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +126 -28
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +132 -11
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +20 -25
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +4 -5
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +18 -64
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +12 -48
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +62 -33
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +9 -101
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +3 -125
- package/dist/index28.js.map +1 -1
- package/dist/index280.js +11 -95
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +65 -99
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +62 -22
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +6 -29
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +6 -5
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +4 -2
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +16 -2
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +8 -13
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +5 -154
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +4 -30
- package/dist/index289.js.map +1 -1
- package/dist/index29.js +124 -47
- package/dist/index29.js.map +1 -1
- package/dist/index290.js +545 -9
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +44 -45
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +16 -10
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +6 -44
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +8 -95
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +7 -86
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +8 -105
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +12 -52
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +9 -11
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +13 -37
- package/dist/index299.js.map +1 -1
- package/dist/index30.js +230 -218
- package/dist/index30.js.map +1 -1
- package/dist/index300.js +3 -8
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +20 -114
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +4 -17
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +55 -15
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +68 -4
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +31 -37
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +9 -21
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +153 -10
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +107 -8
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +21 -18
- package/dist/index309.js.map +1 -1
- package/dist/index31.js +49 -42
- package/dist/index31.js.map +1 -1
- package/dist/index310.js +11 -27
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +27 -16
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +5 -5
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +16 -19
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +28 -12
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +13 -5
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +7 -3
- package/dist/index316.js.map +1 -1
- package/dist/index32.js +2638 -38
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +390 -25
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +230 -43
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +20 -30
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +137 -23
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +187 -23
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +75 -127
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +87 -228
- package/dist/index39.js.map +1 -1
- package/dist/index40.js +6 -51
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +804 -2601
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +63 -391
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +7 -232
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +2 -22
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +21 -139
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +230 -183
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +202 -74
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +3 -90
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +6 -5
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +1 -1
- package/dist/index50.js +41 -837
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +26 -65
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +48 -34
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +7 -7
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +15 -2
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +132 -22
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +10 -233
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +203 -191
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +13 -7
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +2 -2
- package/dist/index60.js +44 -24
- package/dist/index60.js.map +1 -1
- package/dist/index62.js +49 -11
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +4 -4
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +5 -47
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +27 -50
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +50 -8
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +8 -14
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +2 -134
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +2 -11
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +11 -216
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +54 -13
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +5 -46
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +7 -49
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +6 -4
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +46 -5
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +205 -27
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +22 -50
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +25 -9
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +400 -2
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +1 -1
- package/dist/index80.js +47 -2
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +604 -52
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +5 -5
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +68 -7
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +2 -6
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +352 -594
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +262 -52
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +60 -4
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +46 -4
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +169 -15
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +1 -1
- package/dist/index90.js +109 -5
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +24 -7
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +8 -17
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +4 -4
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +5 -4
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +4 -5
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +466 -5
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +185 -4
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +107 -4
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +262 -6
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
- package/dist/index317.js +0 -27
- package/dist/index317.js.map +0 -1
- package/dist/index318.js +0 -116
- package/dist/index318.js.map +0 -1
- package/dist/index319.js +0 -19
- package/dist/index319.js.map +0 -1
- package/dist/index320.js +0 -528
- package/dist/index320.js.map +0 -1
- package/dist/index321.js +0 -131
- package/dist/index321.js.map +0 -1
- package/dist/index322.js +0 -137
- package/dist/index322.js.map +0 -1
- package/dist/index323.js +0 -24
- package/dist/index323.js.map +0 -1
- package/dist/index324.js +0 -9
- package/dist/index324.js.map +0 -1
- package/dist/index325.js +0 -9
- package/dist/index325.js.map +0 -1
- package/dist/index326.js +0 -7
- package/dist/index326.js.map +0 -1
- package/dist/index327.js +0 -19
- package/dist/index327.js.map +0 -1
- package/dist/index328.js +0 -12
- package/dist/index328.js.map +0 -1
- package/dist/index329.js +0 -9
- package/dist/index329.js.map +0 -1
- package/dist/index330.js +0 -8
- package/dist/index330.js.map +0 -1
- package/dist/index331.js +0 -549
- package/dist/index331.js.map +0 -1
- package/dist/index332.js +0 -50
- package/dist/index332.js.map +0 -1
- package/dist/index333.js +0 -21
- package/dist/index333.js.map +0 -1
- package/dist/index334.js +0 -10
- package/dist/index334.js.map +0 -1
- package/dist/index335.js +0 -12
- package/dist/index335.js.map +0 -1
- package/dist/index336.js +0 -11
- package/dist/index336.js.map +0 -1
- package/dist/index337.js +0 -12
- package/dist/index337.js.map +0 -1
- package/dist/index338.js +0 -16
- package/dist/index338.js.map +0 -1
- package/dist/index339.js +0 -13
- package/dist/index339.js.map +0 -1
- package/dist/index340.js +0 -17
- package/dist/index340.js.map +0 -1
- package/dist/index341.js +0 -68
- package/dist/index341.js.map +0 -1
- package/dist/index342.js +0 -72
- package/dist/index342.js.map +0 -1
- package/dist/index343.js +0 -12
- package/dist/index343.js.map +0 -1
- package/dist/index344.js +0 -17
- package/dist/index344.js.map +0 -1
- package/dist/index345.js +0 -69
- package/dist/index345.js.map +0 -1
- package/dist/index346.js +0 -71
- package/dist/index346.js.map +0 -1
- package/dist/index347.js +0 -34
- package/dist/index347.js.map +0 -1
- package/dist/index348.js +0 -12
- package/dist/index348.js.map +0 -1
- package/dist/index349.js +0 -156
- package/dist/index349.js.map +0 -1
- package/dist/index350.js +0 -111
- package/dist/index350.js.map +0 -1
- package/dist/index351.js +0 -8
- package/dist/index351.js.map +0 -1
- package/dist/index352.js +0 -59
- package/dist/index352.js.map +0 -1
- package/dist/index353.js +0 -7
- package/dist/index353.js.map +0 -1
- package/dist/index354.js +0 -26
- package/dist/index354.js.map +0 -1
- package/dist/index355.js +0 -19
- package/dist/index355.js.map +0 -1
- package/dist/index356.js +0 -32
- package/dist/index356.js.map +0 -1
- package/dist/index357.js +0 -16
- package/dist/index357.js.map +0 -1
- package/dist/index358.js +0 -10
- package/dist/index358.js.map +0 -1
- package/dist/index359.js +0 -26
- package/dist/index359.js.map +0 -1
- package/dist/index360.js +0 -16
- package/dist/index360.js.map +0 -1
- package/dist/index361.js +0 -31
- package/dist/index361.js.map +0 -1
- package/dist/index362.js +0 -8
- package/dist/index362.js.map +0 -1
package/dist/index187.js
CHANGED
|
@@ -1,367 +1,99 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { DIGIT_PLACEHOLDER as P } from "./index189.js";
|
|
10
|
-
function f(n) {
|
|
11
|
-
"@babel/helpers - typeof";
|
|
12
|
-
return f = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
13
|
-
return typeof e;
|
|
14
|
-
} : function(e) {
|
|
15
|
-
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
16
|
-
}, f(n);
|
|
17
|
-
}
|
|
18
|
-
function S(n, e) {
|
|
19
|
-
return A(n) || _(n, e) || k(n, e) || T();
|
|
20
|
-
}
|
|
21
|
-
function T() {
|
|
22
|
-
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
23
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
24
|
-
}
|
|
25
|
-
function k(n, e) {
|
|
26
|
-
if (n) {
|
|
27
|
-
if (typeof n == "string") return h(n, e);
|
|
28
|
-
var t = {}.toString.call(n).slice(8, -1);
|
|
29
|
-
return t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set" ? Array.from(n) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? h(n, e) : void 0;
|
|
1
|
+
import N from "./index197.js";
|
|
2
|
+
import g from "./index91.js";
|
|
3
|
+
import m, { getCountryCallingCode as s } from "./index96.js";
|
|
4
|
+
import h from "./index200.js";
|
|
5
|
+
import { formatRFC3966 as I } from "./index193.js";
|
|
6
|
+
var l = {
|
|
7
|
+
formatExtension: function(t, r, e) {
|
|
8
|
+
return "".concat(t).concat(e.ext()).concat(r);
|
|
30
9
|
}
|
|
31
|
-
}
|
|
32
|
-
function
|
|
33
|
-
(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
10
|
+
};
|
|
11
|
+
function O(n, t, r, e) {
|
|
12
|
+
if (r ? r = E({}, l, r) : r = l, e = new m(e), n.country && n.country !== "001") {
|
|
13
|
+
if (!e.hasCountry(n.country))
|
|
14
|
+
throw new Error("Unknown country: ".concat(n.country));
|
|
15
|
+
e.selectNumberingPlan(n.country);
|
|
16
|
+
} else if (n.countryCallingCode)
|
|
17
|
+
e.selectNumberingPlan(n.countryCallingCode);
|
|
18
|
+
else return n.phone || "";
|
|
19
|
+
var o = e.countryCallingCode(), a = r.v2 ? n.nationalNumber : n.phone, c;
|
|
20
|
+
switch (t) {
|
|
21
|
+
case "NATIONAL":
|
|
22
|
+
return a ? (c = f(a, n.carrierCode, "NATIONAL", e, r), u(c, n.ext, e, r.formatExtension)) : "";
|
|
23
|
+
case "INTERNATIONAL":
|
|
24
|
+
return a ? (c = f(a, null, "INTERNATIONAL", e, r), c = "+".concat(o, " ").concat(c), u(c, n.ext, e, r.formatExtension)) : "+".concat(o);
|
|
25
|
+
case "E.164":
|
|
26
|
+
return "+".concat(o).concat(a);
|
|
27
|
+
case "RFC3966":
|
|
28
|
+
return I({
|
|
29
|
+
number: "+".concat(o).concat(a),
|
|
30
|
+
ext: n.ext
|
|
31
|
+
});
|
|
32
|
+
// For reference, here's Google's IDD formatter:
|
|
33
|
+
// https://github.com/google/libphonenumber/blob/32719cf74e68796788d1ca45abc85dcdc63ba5b9/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L1546
|
|
34
|
+
// Not saying that this IDD formatter replicates it 1:1, but it seems to work.
|
|
35
|
+
// Who would even need to format phone numbers in IDD format anyway?
|
|
36
|
+
case "IDD":
|
|
37
|
+
if (!r.fromCountry)
|
|
38
|
+
return;
|
|
39
|
+
var i = A(a, n.carrierCode, o, r.fromCountry, e);
|
|
40
|
+
return u(i, n.ext, e, r.formatExtension);
|
|
41
|
+
default:
|
|
42
|
+
throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t, '"'));
|
|
53
43
|
}
|
|
54
44
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
45
|
+
function f(n, t, r, e, o) {
|
|
46
|
+
var a = x(e.formats(), n);
|
|
47
|
+
return a ? g(n, a, {
|
|
48
|
+
useInternationalFormat: r === "INTERNATIONAL",
|
|
49
|
+
withNationalPrefix: !(a.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && o && o.nationalPrefix === !1),
|
|
50
|
+
carrierCode: t,
|
|
51
|
+
metadata: e
|
|
52
|
+
}) : n;
|
|
57
53
|
}
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
function x(n, t) {
|
|
55
|
+
return v(n, function(r) {
|
|
56
|
+
if (r.leadingDigitsPatterns().length > 0) {
|
|
57
|
+
var e = r.leadingDigitsPatterns()[r.leadingDigitsPatterns().length - 1];
|
|
58
|
+
if (t.search(e) !== 0)
|
|
59
|
+
return !1;
|
|
60
|
+
}
|
|
61
|
+
return N(t, r.pattern());
|
|
62
|
+
});
|
|
66
63
|
}
|
|
67
|
-
function
|
|
68
|
-
return
|
|
64
|
+
function u(n, t, r, e) {
|
|
65
|
+
return t ? e(n, t, r) : n;
|
|
69
66
|
}
|
|
70
|
-
function
|
|
71
|
-
var
|
|
72
|
-
|
|
67
|
+
function A(n, t, r, e, o) {
|
|
68
|
+
var a = s(e, o.metadata);
|
|
69
|
+
if (a === r) {
|
|
70
|
+
var c = f(n, t, "NATIONAL", o);
|
|
71
|
+
return r === "1" ? r + " " + c : c;
|
|
72
|
+
}
|
|
73
|
+
var i = h(e, void 0, o.metadata);
|
|
74
|
+
if (i)
|
|
75
|
+
return "".concat(i, " ").concat(r, " ").concat(f(n, null, "INTERNATIONAL", o));
|
|
73
76
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
function E() {
|
|
78
|
+
for (var n = 1, t = arguments.length, r = new Array(t), e = 0; e < t; e++)
|
|
79
|
+
r[e] = arguments[e];
|
|
80
|
+
for (; n < r.length; ) {
|
|
81
|
+
if (r[n])
|
|
82
|
+
for (var o in r[n])
|
|
83
|
+
r[0][o] = r[n][o];
|
|
84
|
+
n++;
|
|
81
85
|
}
|
|
82
|
-
return
|
|
86
|
+
return r[0];
|
|
83
87
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
function v(n, t) {
|
|
89
|
+
for (var r = 0; r < n.length; ) {
|
|
90
|
+
if (t(n[r]))
|
|
91
|
+
return n[r];
|
|
92
|
+
r++;
|
|
89
93
|
}
|
|
90
|
-
|
|
91
|
-
key: "getCountryAndCallingCode",
|
|
92
|
-
value: function(t) {
|
|
93
|
-
var i, a;
|
|
94
|
-
return t && (N(t) ? (i = t.defaultCountry, a = t.defaultCallingCode) : i = t), i && !this.metadata.hasCountry(i) && (i = void 0), [i, a];
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Inputs "next" phone number characters.
|
|
98
|
-
* @param {string} text
|
|
99
|
-
* @return {string} Formatted phone number characters that have been input so far.
|
|
100
|
-
*/
|
|
101
|
-
}, {
|
|
102
|
-
key: "input",
|
|
103
|
-
value: function(t) {
|
|
104
|
-
var i = this.parser.input(t, this.state), a = i.digits, o = i.justLeadingPlus;
|
|
105
|
-
if (o)
|
|
106
|
-
this.formattedOutput = "+";
|
|
107
|
-
else if (a) {
|
|
108
|
-
this.determineTheCountryIfNeeded(), this.state.nationalSignificantNumber && this.formatter.narrowDownMatchingFormats(this.state);
|
|
109
|
-
var r;
|
|
110
|
-
if (this.metadata.hasSelectedNumberingPlan() && (r = this.formatter.format(a, this.state)), r === void 0 && this.parser.reExtractNationalSignificantNumber(this.state)) {
|
|
111
|
-
this.determineTheCountryIfNeeded();
|
|
112
|
-
var u = this.state.getNationalDigits();
|
|
113
|
-
u && (r = this.formatter.format(u, this.state));
|
|
114
|
-
}
|
|
115
|
-
this.formattedOutput = r ? this.getFullNumber(r) : this.getNonFormattedNumber();
|
|
116
|
-
}
|
|
117
|
-
return this.formattedOutput;
|
|
118
|
-
}
|
|
119
|
-
}, {
|
|
120
|
-
key: "reset",
|
|
121
|
-
value: function() {
|
|
122
|
-
var t = this;
|
|
123
|
-
return this.state = new y({
|
|
124
|
-
onCountryChange: function(a) {
|
|
125
|
-
t.country = a;
|
|
126
|
-
},
|
|
127
|
-
onCallingCodeChange: function(a, o) {
|
|
128
|
-
t.metadata.selectNumberingPlan(o, a), t.formatter.reset(t.metadata.numberingPlan, t.state), t.parser.reset(t.metadata.numberingPlan);
|
|
129
|
-
}
|
|
130
|
-
}), this.formatter = new C({
|
|
131
|
-
state: this.state,
|
|
132
|
-
metadata: this.metadata
|
|
133
|
-
}), this.parser = new b({
|
|
134
|
-
defaultCountry: this.defaultCountry,
|
|
135
|
-
defaultCallingCode: this.defaultCallingCode,
|
|
136
|
-
metadata: this.metadata,
|
|
137
|
-
state: this.state,
|
|
138
|
-
onNationalSignificantNumberChange: function() {
|
|
139
|
-
t.determineTheCountryIfNeeded(), t.formatter.reset(t.metadata.numberingPlan, t.state);
|
|
140
|
-
}
|
|
141
|
-
}), this.state.reset({
|
|
142
|
-
country: this.defaultCountry,
|
|
143
|
-
callingCode: this.defaultCallingCode
|
|
144
|
-
}), this.formattedOutput = "", this;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Returns `true` if the phone number is being input in international format.
|
|
148
|
-
* In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
|
|
149
|
-
* @return {boolean}
|
|
150
|
-
*/
|
|
151
|
-
}, {
|
|
152
|
-
key: "isInternational",
|
|
153
|
-
value: function() {
|
|
154
|
-
return this.state.international;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Returns the "calling code" part of the phone number when it's being input
|
|
158
|
-
* in an international format.
|
|
159
|
-
* If no valid calling code has been entered so far, returns `undefined`.
|
|
160
|
-
* @return {string} [callingCode]
|
|
161
|
-
*/
|
|
162
|
-
}, {
|
|
163
|
-
key: "getCallingCode",
|
|
164
|
-
value: function() {
|
|
165
|
-
if (this.isInternational())
|
|
166
|
-
return this.state.callingCode;
|
|
167
|
-
}
|
|
168
|
-
// A legacy alias.
|
|
169
|
-
}, {
|
|
170
|
-
key: "getCountryCallingCode",
|
|
171
|
-
value: function() {
|
|
172
|
-
return this.getCallingCode();
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Returns a two-letter country code of the phone number.
|
|
176
|
-
* Returns `undefined` for "non-geographic" phone numbering plans.
|
|
177
|
-
* Returns `undefined` if no phone number has been input yet.
|
|
178
|
-
* @return {string} [country]
|
|
179
|
-
*/
|
|
180
|
-
}, {
|
|
181
|
-
key: "getCountry",
|
|
182
|
-
value: function() {
|
|
183
|
-
var t = this.state.digits;
|
|
184
|
-
if (t)
|
|
185
|
-
return this._getCountry();
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Returns a two-letter country code of the phone number.
|
|
189
|
-
* Returns `undefined` for "non-geographic" phone numbering plans.
|
|
190
|
-
* @return {string} [country]
|
|
191
|
-
*/
|
|
192
|
-
}, {
|
|
193
|
-
key: "_getCountry",
|
|
194
|
-
value: function() {
|
|
195
|
-
var t = this.state.country;
|
|
196
|
-
return t;
|
|
197
|
-
}
|
|
198
|
-
}, {
|
|
199
|
-
key: "determineTheCountryIfNeeded",
|
|
200
|
-
value: function() {
|
|
201
|
-
(!this.state.country || this.isCountryCallingCodeAmbiguous()) && this.determineTheCountry();
|
|
202
|
-
}
|
|
203
|
-
// Prepends `+CountryCode ` in case of an international phone number
|
|
204
|
-
}, {
|
|
205
|
-
key: "getFullNumber",
|
|
206
|
-
value: function(t) {
|
|
207
|
-
var i = this;
|
|
208
|
-
if (this.isInternational()) {
|
|
209
|
-
var a = function(u) {
|
|
210
|
-
return i.formatter.getInternationalPrefixBeforeCountryCallingCode(i.state, {
|
|
211
|
-
spacing: !!u
|
|
212
|
-
}) + u;
|
|
213
|
-
}, o = this.state.callingCode;
|
|
214
|
-
return a(o ? t ? "".concat(o, " ").concat(t) : o : "".concat(this.state.getDigitsWithoutInternationalPrefix()));
|
|
215
|
-
}
|
|
216
|
-
return t;
|
|
217
|
-
}
|
|
218
|
-
}, {
|
|
219
|
-
key: "getNonFormattedNationalNumberWithPrefix",
|
|
220
|
-
value: function() {
|
|
221
|
-
var t = this.state, i = t.nationalSignificantNumber, a = t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix, o = t.nationalPrefix, r = i, u = a || o;
|
|
222
|
-
return u && (r = u + r), r;
|
|
223
|
-
}
|
|
224
|
-
}, {
|
|
225
|
-
key: "getNonFormattedNumber",
|
|
226
|
-
value: function() {
|
|
227
|
-
var t = this.state.nationalSignificantNumberIsModified;
|
|
228
|
-
return this.getFullNumber(t ? this.state.getNationalDigits() : this.getNonFormattedNationalNumberWithPrefix());
|
|
229
|
-
}
|
|
230
|
-
}, {
|
|
231
|
-
key: "getNonFormattedTemplate",
|
|
232
|
-
value: function() {
|
|
233
|
-
var t = this.getNonFormattedNumber();
|
|
234
|
-
if (t)
|
|
235
|
-
return t.replace(/[\+\d]/g, P);
|
|
236
|
-
}
|
|
237
|
-
}, {
|
|
238
|
-
key: "isCountryCallingCodeAmbiguous",
|
|
239
|
-
value: function() {
|
|
240
|
-
var t = this.state.callingCode, i = this.metadata.getCountryCodesForCallingCode(t);
|
|
241
|
-
return i && i.length > 1;
|
|
242
|
-
}
|
|
243
|
-
// Determines the exact country of the phone number
|
|
244
|
-
// entered so far based on the country phone code
|
|
245
|
-
// and the national phone number.
|
|
246
|
-
}, {
|
|
247
|
-
key: "determineTheCountry",
|
|
248
|
-
value: function() {
|
|
249
|
-
this.state.setCountry(v(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, {
|
|
250
|
-
nationalNumber: this.state.nationalSignificantNumber,
|
|
251
|
-
metadata: this.metadata
|
|
252
|
-
}));
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Returns a E.164 phone number value for the user's input.
|
|
256
|
-
*
|
|
257
|
-
* For example, for country `"US"` and input `"(222) 333-4444"`
|
|
258
|
-
* it will return `"+12223334444"`.
|
|
259
|
-
*
|
|
260
|
-
* For international phone number input, it will also auto-correct
|
|
261
|
-
* some minor errors such as using a national prefix when writing
|
|
262
|
-
* an international phone number. For example, if the user inputs
|
|
263
|
-
* `"+44 0 7400 000000"` then it will return an auto-corrected
|
|
264
|
-
* `"+447400000000"` phone number value.
|
|
265
|
-
*
|
|
266
|
-
* Will return `undefined` if no digits have been input,
|
|
267
|
-
* or when inputting a phone number in national format and no
|
|
268
|
-
* default country or default "country calling code" have been set.
|
|
269
|
-
*
|
|
270
|
-
* @return {string} [value]
|
|
271
|
-
*/
|
|
272
|
-
}, {
|
|
273
|
-
key: "getNumberValue",
|
|
274
|
-
value: function() {
|
|
275
|
-
var t = this.state, i = t.digits, a = t.callingCode, o = t.country, r = t.nationalSignificantNumber;
|
|
276
|
-
if (i) {
|
|
277
|
-
if (this.isInternational())
|
|
278
|
-
return a ? "+" + a + r : "+" + i;
|
|
279
|
-
if (o || a) {
|
|
280
|
-
var u = o ? this.metadata.countryCallingCode() : a;
|
|
281
|
-
return "+" + u + r;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Returns an instance of `PhoneNumber` class.
|
|
287
|
-
* Will return `undefined` if no national (significant) number
|
|
288
|
-
* digits have been entered so far, or if no `defaultCountry` has been
|
|
289
|
-
* set and the user enters a phone number not in international format.
|
|
290
|
-
*/
|
|
291
|
-
}, {
|
|
292
|
-
key: "getNumber",
|
|
293
|
-
value: function() {
|
|
294
|
-
var t = this.state, i = t.nationalSignificantNumber, a = t.carrierCode, o = t.callingCode, r = this._getCountry();
|
|
295
|
-
if (i && !(!r && !o)) {
|
|
296
|
-
if (r && r === this.defaultCountry) {
|
|
297
|
-
var u = new g(this.metadata.metadata);
|
|
298
|
-
u.selectNumberingPlan(r);
|
|
299
|
-
var l = u.numberingPlan.callingCode(), s = this.metadata.getCountryCodesForCallingCode(l);
|
|
300
|
-
if (s.length > 1) {
|
|
301
|
-
var d = p(i, {
|
|
302
|
-
countries: s,
|
|
303
|
-
metadata: this.metadata.metadata
|
|
304
|
-
});
|
|
305
|
-
d && (r = d);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
var m = new c(r || o, i, this.metadata.metadata);
|
|
309
|
-
return a && (m.carrierCode = a), m;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Returns `true` if the phone number is "possible".
|
|
314
|
-
* Is just a shortcut for `PhoneNumber.isPossible()`.
|
|
315
|
-
* @return {boolean}
|
|
316
|
-
*/
|
|
317
|
-
}, {
|
|
318
|
-
key: "isPossible",
|
|
319
|
-
value: function() {
|
|
320
|
-
var t = this.getNumber();
|
|
321
|
-
return t ? t.isPossible() : !1;
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* Returns `true` if the phone number is "valid".
|
|
325
|
-
* Is just a shortcut for `PhoneNumber.isValid()`.
|
|
326
|
-
* @return {boolean}
|
|
327
|
-
*/
|
|
328
|
-
}, {
|
|
329
|
-
key: "isValid",
|
|
330
|
-
value: function() {
|
|
331
|
-
var t = this.getNumber();
|
|
332
|
-
return t ? t.isValid() : !1;
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* @deprecated
|
|
336
|
-
* This method is used in `react-phone-number-input/source/input-control.js`
|
|
337
|
-
* in versions before `3.0.16`.
|
|
338
|
-
*/
|
|
339
|
-
}, {
|
|
340
|
-
key: "getNationalNumber",
|
|
341
|
-
value: function() {
|
|
342
|
-
return this.state.nationalSignificantNumber;
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* Returns the phone number characters entered by the user.
|
|
346
|
-
* @return {string}
|
|
347
|
-
*/
|
|
348
|
-
}, {
|
|
349
|
-
key: "getChars",
|
|
350
|
-
value: function() {
|
|
351
|
-
return (this.state.international ? "+" : "") + this.state.digits;
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* Returns the template for the formatted phone number.
|
|
355
|
-
* @return {string}
|
|
356
|
-
*/
|
|
357
|
-
}, {
|
|
358
|
-
key: "getTemplate",
|
|
359
|
-
value: function() {
|
|
360
|
-
return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || "";
|
|
361
|
-
}
|
|
362
|
-
}]);
|
|
363
|
-
})();
|
|
94
|
+
}
|
|
364
95
|
export {
|
|
365
|
-
|
|
96
|
+
x as chooseFormatForNumber,
|
|
97
|
+
O as default
|
|
366
98
|
};
|
|
367
99
|
//# sourceMappingURL=index187.js.map
|
package/dist/index187.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index187.js","sources":["../../../node_modules/libphonenumber-js/es6/AsYouType.js"],"sourcesContent":["function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport Metadata from './metadata.js';\nimport PhoneNumber from './PhoneNumber.js';\nimport AsYouTypeState from './AsYouTypeState.js';\nimport AsYouTypeFormatter, { DIGIT_PLACEHOLDER } from './AsYouTypeFormatter.js';\nimport AsYouTypeParser, { extractFormattedDigitsAndPlus } from './AsYouTypeParser.js';\nimport getCountryByCallingCode from './helpers/getCountryByCallingCode.js';\nimport getCountryByNationalNumber from './helpers/getCountryByNationalNumber.js';\nimport isObject from './helpers/isObject.js';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\nvar AsYouType = /*#__PURE__*/function () {\n /**\r\n * @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.\r\n * @param {Object} metadata\r\n */\n function AsYouType(optionsOrDefaultCountry, metadata) {\n _classCallCheck(this, AsYouType);\n this.metadata = new Metadata(metadata);\n var _this$getCountryAndCa = this.getCountryAndCallingCode(optionsOrDefaultCountry),\n _this$getCountryAndCa2 = _slicedToArray(_this$getCountryAndCa, 2),\n defaultCountry = _this$getCountryAndCa2[0],\n defaultCallingCode = _this$getCountryAndCa2[1];\n // `this.defaultCountry` and `this.defaultCallingCode` aren't required to be in sync.\n // For example, `this.defaultCountry` could be `\"AR\"` and `this.defaultCallingCode` could be `undefined`.\n // So `this.defaultCountry` and `this.defaultCallingCode` are totally independent.\n this.defaultCountry = defaultCountry;\n this.defaultCallingCode = defaultCallingCode;\n this.reset();\n }\n return _createClass(AsYouType, [{\n key: \"getCountryAndCallingCode\",\n value: function getCountryAndCallingCode(optionsOrDefaultCountry) {\n // Set `defaultCountry` and `defaultCallingCode` options.\n var defaultCountry;\n var defaultCallingCode;\n // Turns out `null` also has type \"object\". Weird.\n if (optionsOrDefaultCountry) {\n if (isObject(optionsOrDefaultCountry)) {\n defaultCountry = optionsOrDefaultCountry.defaultCountry;\n defaultCallingCode = optionsOrDefaultCountry.defaultCallingCode;\n } else {\n defaultCountry = optionsOrDefaultCountry;\n }\n }\n if (defaultCountry && !this.metadata.hasCountry(defaultCountry)) {\n defaultCountry = undefined;\n }\n if (defaultCallingCode) {\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (this.metadata.isNonGeographicCallingCode(defaultCallingCode)) {\n defaultCountry = '001';\n }\n }\n }\n return [defaultCountry, defaultCallingCode];\n }\n\n /**\r\n * Inputs \"next\" phone number characters.\r\n * @param {string} text\r\n * @return {string} Formatted phone number characters that have been input so far.\r\n */\n }, {\n key: \"input\",\n value: function input(text) {\n var _this$parser$input = this.parser.input(text, this.state),\n digits = _this$parser$input.digits,\n justLeadingPlus = _this$parser$input.justLeadingPlus;\n if (justLeadingPlus) {\n this.formattedOutput = '+';\n } else if (digits) {\n this.determineTheCountryIfNeeded();\n // Match the available formats by the currently available leading digits.\n if (this.state.nationalSignificantNumber) {\n this.formatter.narrowDownMatchingFormats(this.state);\n }\n var formattedNationalNumber;\n if (this.metadata.hasSelectedNumberingPlan()) {\n formattedNationalNumber = this.formatter.format(digits, this.state);\n }\n if (formattedNationalNumber === undefined) {\n // See if another national (significant) number could be re-extracted.\n if (this.parser.reExtractNationalSignificantNumber(this.state)) {\n this.determineTheCountryIfNeeded();\n // If it could, then re-try formatting the new national (significant) number.\n var nationalDigits = this.state.getNationalDigits();\n if (nationalDigits) {\n formattedNationalNumber = this.formatter.format(nationalDigits, this.state);\n }\n }\n }\n this.formattedOutput = formattedNationalNumber ? this.getFullNumber(formattedNationalNumber) : this.getNonFormattedNumber();\n }\n return this.formattedOutput;\n }\n }, {\n key: \"reset\",\n value: function reset() {\n var _this = this;\n this.state = new AsYouTypeState({\n onCountryChange: function onCountryChange(country) {\n // Before version `1.6.0`, the official `AsYouType` formatter API\n // included a `.country` property on an `AsYouType` instance.\n // Since that property (along with the others) have been moved to\n // `this.state`, `this.country` property is emulated for compatibility\n // with the old versions.\n _this.country = country;\n },\n onCallingCodeChange: function onCallingCodeChange(callingCode, country) {\n _this.metadata.selectNumberingPlan(country, callingCode);\n _this.formatter.reset(_this.metadata.numberingPlan, _this.state);\n _this.parser.reset(_this.metadata.numberingPlan);\n }\n });\n this.formatter = new AsYouTypeFormatter({\n state: this.state,\n metadata: this.metadata\n });\n this.parser = new AsYouTypeParser({\n defaultCountry: this.defaultCountry,\n defaultCallingCode: this.defaultCallingCode,\n metadata: this.metadata,\n state: this.state,\n onNationalSignificantNumberChange: function onNationalSignificantNumberChange() {\n _this.determineTheCountryIfNeeded();\n _this.formatter.reset(_this.metadata.numberingPlan, _this.state);\n }\n });\n this.state.reset({\n country: this.defaultCountry,\n callingCode: this.defaultCallingCode\n });\n this.formattedOutput = '';\n return this;\n }\n\n /**\r\n * Returns `true` if the phone number is being input in international format.\r\n * In other words, returns `true` if and only if the parsed phone number starts with a `\"+\"`.\r\n * @return {boolean}\r\n */\n }, {\n key: \"isInternational\",\n value: function isInternational() {\n return this.state.international;\n }\n\n /**\r\n * Returns the \"calling code\" part of the phone number when it's being input\r\n * in an international format.\r\n * If no valid calling code has been entered so far, returns `undefined`.\r\n * @return {string} [callingCode]\r\n */\n }, {\n key: \"getCallingCode\",\n value: function getCallingCode() {\n // If the number is being input in national format and some \"default calling code\"\n // has been passed to `AsYouType` constructor, then `this.state.callingCode`\n // is equal to that \"default calling code\".\n //\n // If the number is being input in national format and no \"default calling code\"\n // has been passed to `AsYouType` constructor, then returns `undefined`,\n // even if a \"default country\" has been passed to `AsYouType` constructor.\n //\n if (this.isInternational()) {\n return this.state.callingCode;\n }\n }\n\n // A legacy alias.\n }, {\n key: \"getCountryCallingCode\",\n value: function getCountryCallingCode() {\n return this.getCallingCode();\n }\n\n /**\r\n * Returns a two-letter country code of the phone number.\r\n * Returns `undefined` for \"non-geographic\" phone numbering plans.\r\n * Returns `undefined` if no phone number has been input yet.\r\n * @return {string} [country]\r\n */\n }, {\n key: \"getCountry\",\n value: function getCountry() {\n var digits = this.state.digits;\n // Return `undefined` if no digits have been input yet.\n if (digits) {\n return this._getCountry();\n }\n }\n\n /**\r\n * Returns a two-letter country code of the phone number.\r\n * Returns `undefined` for \"non-geographic\" phone numbering plans.\r\n * @return {string} [country]\r\n */\n }, {\n key: \"_getCountry\",\n value: function _getCountry() {\n var country = this.state.country;\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n // `AsYouType.getCountry()` returns `undefined`\n // for \"non-geographic\" phone numbering plans.\n if (country === '001') {\n return;\n }\n }\n return country;\n }\n }, {\n key: \"determineTheCountryIfNeeded\",\n value: function determineTheCountryIfNeeded() {\n // Suppose a user enters a phone number in international format,\n // and there're several countries corresponding to that country calling code,\n // and a country has been derived from the number, and then\n // a user enters one more digit and the number is no longer\n // valid for the derived country, so the country should be re-derived\n // on every new digit in those cases.\n //\n // If the phone number is being input in national format,\n // then it could be a case when `defaultCountry` wasn't specified\n // when creating `AsYouType` instance, and just `defaultCallingCode` was specified,\n // and that \"calling code\" could correspond to a \"non-geographic entity\",\n // or there could be several countries corresponding to that country calling code.\n // In those cases, `this.country` is `undefined` and should be derived\n // from the number. Again, if country calling code is ambiguous, then\n // `this.country` should be re-derived with each new digit.\n //\n if (!this.state.country || this.isCountryCallingCodeAmbiguous()) {\n this.determineTheCountry();\n }\n }\n\n // Prepends `+CountryCode ` in case of an international phone number\n }, {\n key: \"getFullNumber\",\n value: function getFullNumber(formattedNationalNumber) {\n var _this2 = this;\n if (this.isInternational()) {\n var prefix = function prefix(text) {\n return _this2.formatter.getInternationalPrefixBeforeCountryCallingCode(_this2.state, {\n spacing: text ? true : false\n }) + text;\n };\n var callingCode = this.state.callingCode;\n if (!callingCode) {\n return prefix(\"\".concat(this.state.getDigitsWithoutInternationalPrefix()));\n }\n if (!formattedNationalNumber) {\n return prefix(callingCode);\n }\n return prefix(\"\".concat(callingCode, \" \").concat(formattedNationalNumber));\n }\n return formattedNationalNumber;\n }\n }, {\n key: \"getNonFormattedNationalNumberWithPrefix\",\n value: function getNonFormattedNationalNumberWithPrefix() {\n var _this$state = this.state,\n nationalSignificantNumber = _this$state.nationalSignificantNumber,\n prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix = _this$state.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,\n nationalPrefix = _this$state.nationalPrefix;\n var number = nationalSignificantNumber;\n var prefix = prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix || nationalPrefix;\n if (prefix) {\n number = prefix + number;\n }\n return number;\n }\n }, {\n key: \"getNonFormattedNumber\",\n value: function getNonFormattedNumber() {\n var nationalSignificantNumberIsModified = this.state.nationalSignificantNumberIsModified;\n return this.getFullNumber(nationalSignificantNumberIsModified ? this.state.getNationalDigits() : this.getNonFormattedNationalNumberWithPrefix());\n }\n }, {\n key: \"getNonFormattedTemplate\",\n value: function getNonFormattedTemplate() {\n var number = this.getNonFormattedNumber();\n if (number) {\n return number.replace(/[\\+\\d]/g, DIGIT_PLACEHOLDER);\n }\n }\n }, {\n key: \"isCountryCallingCodeAmbiguous\",\n value: function isCountryCallingCodeAmbiguous() {\n var callingCode = this.state.callingCode;\n var countryCodes = this.metadata.getCountryCodesForCallingCode(callingCode);\n return countryCodes && countryCodes.length > 1;\n }\n\n // Determines the exact country of the phone number\n // entered so far based on the country phone code\n // and the national phone number.\n }, {\n key: \"determineTheCountry\",\n value: function determineTheCountry() {\n this.state.setCountry(getCountryByCallingCode(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, {\n nationalNumber: this.state.nationalSignificantNumber,\n metadata: this.metadata\n }));\n }\n\n /**\r\n * Returns a E.164 phone number value for the user's input.\r\n *\r\n * For example, for country `\"US\"` and input `\"(222) 333-4444\"`\r\n * it will return `\"+12223334444\"`.\r\n *\r\n * For international phone number input, it will also auto-correct\r\n * some minor errors such as using a national prefix when writing\r\n * an international phone number. For example, if the user inputs\r\n * `\"+44 0 7400 000000\"` then it will return an auto-corrected\r\n * `\"+447400000000\"` phone number value.\r\n *\r\n * Will return `undefined` if no digits have been input,\r\n * or when inputting a phone number in national format and no\r\n * default country or default \"country calling code\" have been set.\r\n *\r\n * @return {string} [value]\r\n */\n }, {\n key: \"getNumberValue\",\n value: function getNumberValue() {\n var _this$state2 = this.state,\n digits = _this$state2.digits,\n callingCode = _this$state2.callingCode,\n country = _this$state2.country,\n nationalSignificantNumber = _this$state2.nationalSignificantNumber;\n\n // Will return `undefined` if no digits have been input.\n if (!digits) {\n return;\n }\n if (this.isInternational()) {\n if (callingCode) {\n return '+' + callingCode + nationalSignificantNumber;\n } else {\n return '+' + digits;\n }\n } else {\n if (country || callingCode) {\n var callingCode_ = country ? this.metadata.countryCallingCode() : callingCode;\n return '+' + callingCode_ + nationalSignificantNumber;\n }\n }\n }\n\n /**\r\n * Returns an instance of `PhoneNumber` class.\r\n * Will return `undefined` if no national (significant) number\r\n * digits have been entered so far, or if no `defaultCountry` has been\r\n * set and the user enters a phone number not in international format.\r\n */\n }, {\n key: \"getNumber\",\n value: function getNumber() {\n var _this$state3 = this.state,\n nationalSignificantNumber = _this$state3.nationalSignificantNumber,\n carrierCode = _this$state3.carrierCode,\n callingCode = _this$state3.callingCode;\n\n // `this._getCountry()` is basically same as `this.state.country`\n // with the only change that it return `undefined` in case of a\n // \"non-geographic\" numbering plan instead of `\"001\"` \"internal use\" value.\n var country = this._getCountry();\n if (!nationalSignificantNumber) {\n return;\n }\n\n // `state.country` and `state.callingCode` aren't required to be in sync.\n // For example, `country` could be `\"AR\"` and `callingCode` could be `undefined`.\n // So `country` and `callingCode` are totally independent.\n\n if (!country && !callingCode) {\n return;\n }\n\n // By default, if `defaultCountry` parameter was passed when\n // creating `AsYouType` instance, `state.country` is gonna be\n // that `defaultCountry`, which doesn't entirely conform with\n // `parsePhoneNumber()`'s behavior where it attempts to determine\n // the country more precisely in cases when multiple countries\n // could correspond to the same `countryCallingCode`.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103#note_1417192969\n //\n // Because `AsYouType.getNumber()` method is supposed to be a 1:1\n // equivalent for `parsePhoneNumber(AsYouType.getNumberValue())`,\n // then it should also behave accordingly in cases of `country` ambiguity.\n // That's how users of this library would expect it to behave anyway.\n //\n if (country) {\n if (country === this.defaultCountry) {\n // `state.country` and `state.callingCode` aren't required to be in sync.\n // For example, `state.country` could be `\"AR\"` and `state.callingCode` could be `undefined`.\n // So `state.country` and `state.callingCode` are totally independent.\n var metadata = new Metadata(this.metadata.metadata);\n metadata.selectNumberingPlan(country);\n var _callingCode = metadata.numberingPlan.callingCode();\n var ambiguousCountries = this.metadata.getCountryCodesForCallingCode(_callingCode);\n if (ambiguousCountries.length > 1) {\n var exactCountry = getCountryByNationalNumber(nationalSignificantNumber, {\n countries: ambiguousCountries,\n metadata: this.metadata.metadata\n });\n if (exactCountry) {\n country = exactCountry;\n }\n }\n }\n }\n var phoneNumber = new PhoneNumber(country || callingCode, nationalSignificantNumber, this.metadata.metadata);\n if (carrierCode) {\n phoneNumber.carrierCode = carrierCode;\n }\n // Phone number extensions are not supported by \"As You Type\" formatter.\n return phoneNumber;\n }\n\n /**\r\n * Returns `true` if the phone number is \"possible\".\r\n * Is just a shortcut for `PhoneNumber.isPossible()`.\r\n * @return {boolean}\r\n */\n }, {\n key: \"isPossible\",\n value: function isPossible() {\n var phoneNumber = this.getNumber();\n if (!phoneNumber) {\n return false;\n }\n return phoneNumber.isPossible();\n }\n\n /**\r\n * Returns `true` if the phone number is \"valid\".\r\n * Is just a shortcut for `PhoneNumber.isValid()`.\r\n * @return {boolean}\r\n */\n }, {\n key: \"isValid\",\n value: function isValid() {\n var phoneNumber = this.getNumber();\n if (!phoneNumber) {\n return false;\n }\n return phoneNumber.isValid();\n }\n\n /**\r\n * @deprecated\r\n * This method is used in `react-phone-number-input/source/input-control.js`\r\n * in versions before `3.0.16`.\r\n */\n }, {\n key: \"getNationalNumber\",\n value: function getNationalNumber() {\n return this.state.nationalSignificantNumber;\n }\n\n /**\r\n * Returns the phone number characters entered by the user.\r\n * @return {string}\r\n */\n }, {\n key: \"getChars\",\n value: function getChars() {\n return (this.state.international ? '+' : '') + this.state.digits;\n }\n\n /**\r\n * Returns the template for the formatted phone number.\r\n * @return {string}\r\n */\n }, {\n key: \"getTemplate\",\n value: function getTemplate() {\n return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || '';\n }\n }]);\n}();\nexport { AsYouType as default };\n//# sourceMappingURL=AsYouType.js.map"],"names":["_typeof","o","_slicedToArray","r","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","a","_arrayLikeToArray","e","n","l","i","u","f","_classCallCheck","_defineProperties","_toPropertyKey","_createClass","t","_toPrimitive","AsYouType","optionsOrDefaultCountry","metadata","Metadata","_this$getCountryAndCa","_this$getCountryAndCa2","defaultCountry","defaultCallingCode","isObject","text","_this$parser$input","digits","justLeadingPlus","formattedNationalNumber","nationalDigits","_this","AsYouTypeState","country","callingCode","AsYouTypeFormatter","AsYouTypeParser","_this2","prefix","_this$state","nationalSignificantNumber","prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix","nationalPrefix","number","nationalSignificantNumberIsModified","DIGIT_PLACEHOLDER","countryCodes","getCountryByCallingCode","_this$state2","callingCode_","_this$state3","carrierCode","_callingCode","ambiguousCountries","exactCountry","getCountryByNationalNumber","phoneNumber","PhoneNumber"],"mappings":";;;;;;;;;AAAA,SAASA,EAAQC,GAAG;AAAE;AAA2B,SAAOD,IAAwB,OAAO,UAArB,cAA2C,OAAO,OAAO,YAA1B,WAAqC,SAAUC,GAAG;AAAE,WAAO,OAAOA;AAAA,EAAG,IAAI,SAAUA,GAAG;AAAE,WAAOA,KAAmB,OAAO,UAArB,cAA+BA,EAAE,gBAAgB,UAAUA,MAAM,OAAO,YAAY,WAAW,OAAOA;AAAA,EAAG,GAAGD,EAAQC,CAAC;AAAG;AAC7T,SAASC,EAAeC,GAAG,GAAG;AAAE,SAAOC,EAAgBD,CAAC,KAAKE,EAAsBF,GAAG,CAAC,KAAKG,EAA4BH,GAAG,CAAC,KAAKI,EAAgB;AAAI;AACrJ,SAASA,IAAmB;AAAE,QAAM,IAAI,UAAU;AAAA,mFAA2I;AAAG;AAChM,SAASD,EAA4BH,GAAGK,GAAG;AAAE,MAAIL,GAAG;AAAE,QAAgB,OAAOA,KAAnB,SAAsB,QAAOM,EAAkBN,GAAGK,CAAC;AAAG,QAAI,IAAI,CAAA,EAAG,SAAS,KAAKL,CAAC,EAAE,MAAM,GAAG,EAAE;AAAG,WAAoB,MAAb,YAAkBA,EAAE,gBAAgB,IAAIA,EAAE,YAAY,OAAiB,MAAV,SAAyB,MAAV,QAAc,MAAM,KAAKA,CAAC,IAAoB,MAAhB,eAAqB,2CAA2C,KAAK,CAAC,IAAIM,EAAkBN,GAAGK,CAAC,IAAI;AAAA,EAAQ;AAAE;AACzX,SAASC,EAAkBN,GAAGK,GAAG;AAAE,GAASA,KAAR,QAAaA,IAAIL,EAAE,YAAYK,IAAIL,EAAE;AAAS,WAASO,IAAI,GAAGC,IAAI,MAAMH,CAAC,GAAGE,I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F;AAAA,EACJ,CAAG,CAAC;AACJ,GAAC;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index187.js","sources":["../../../node_modules/libphonenumber-js/es6/format.js"],"sourcesContent":["// This is a port of Google Android `libphonenumber`'s\n// `phonenumberutil.js` of December 31th, 2018.\n//\n// https://github.com/googlei18n/libphonenumber/commits/master/javascript/i18n/phonenumbers/phonenumberutil.js\n\nimport matchesEntirely from './helpers/matchesEntirely.js';\nimport formatNationalNumberUsingFormat from './helpers/formatNationalNumberUsingFormat.js';\nimport Metadata, { getCountryCallingCode } from './metadata.js';\nimport getIddPrefix from './helpers/getIddPrefix.js';\nimport { formatRFC3966 } from './helpers/RFC3966.js';\nvar DEFAULT_OPTIONS = {\n formatExtension: function formatExtension(formattedNumber, extension, metadata) {\n return \"\".concat(formattedNumber).concat(metadata.ext()).concat(extension);\n }\n};\n\n/**\r\n * Formats a phone number.\r\n *\r\n * format(phoneNumberInstance, 'INTERNATIONAL', { ..., v2: true }, metadata)\r\n * format(phoneNumberInstance, 'NATIONAL', { ..., v2: true }, metadata)\r\n *\r\n * format({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL', { ... }, metadata)\r\n * format({ phone: '8005553535', country: 'RU' }, 'NATIONAL', undefined, metadata)\r\n *\r\n * @param {object|PhoneNumber} input — If `options.v2: true` flag is passed, the `input` should be a `PhoneNumber` instance. Otherwise, it should be an object of shape `{ phone: '...', country: '...' }`.\r\n * @param {string} format\r\n * @param {object} [options]\r\n * @param {object} metadata\r\n * @return {string}\r\n */\nexport default function formatNumber(input, format, options, metadata) {\n // Apply default options.\n if (options) {\n // Using ES6 \"rest spread\" syntax here didn't work with `babel`/`istanbul`\n // for some weird reason: this line of code would cause the code coverage\n // to show as not 100%. That's because `babel`/`istanbul`, for some weird reason,\n // apparently doesn't know how to properly exclude Babel polyfills from code coverage.\n //\n // options = { ...DEFAULT_OPTIONS, ...options }\n //\n options = merge({}, DEFAULT_OPTIONS, options);\n } else {\n options = DEFAULT_OPTIONS;\n }\n metadata = new Metadata(metadata);\n if (input.country && input.country !== '001') {\n // Validate `input.country`.\n if (!metadata.hasCountry(input.country)) {\n throw new Error(\"Unknown country: \".concat(input.country));\n }\n metadata.selectNumberingPlan(input.country);\n } else if (input.countryCallingCode) {\n metadata.selectNumberingPlan(input.countryCallingCode);\n } else return input.phone || '';\n var countryCallingCode = metadata.countryCallingCode();\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone;\n\n // This variable should have been declared inside `case`s\n // but Babel has a bug and it says \"duplicate variable declaration\".\n var number;\n switch (format) {\n case 'NATIONAL':\n // Legacy argument support.\n // (`{ country: ..., phone: '' }`)\n if (!nationalNumber) {\n return '';\n }\n number = formatNationalNumber(nationalNumber, input.carrierCode, 'NATIONAL', metadata, options);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n case 'INTERNATIONAL':\n // Legacy argument support.\n // (`{ country: ..., phone: '' }`)\n if (!nationalNumber) {\n return \"+\".concat(countryCallingCode);\n }\n number = formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata, options);\n number = \"+\".concat(countryCallingCode, \" \").concat(number);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n case 'E.164':\n // `E.164` doesn't define \"phone number extensions\".\n return \"+\".concat(countryCallingCode).concat(nationalNumber);\n case 'RFC3966':\n return formatRFC3966({\n number: \"+\".concat(countryCallingCode).concat(nationalNumber),\n ext: input.ext\n });\n\n // For reference, here's Google's IDD formatter:\n // https://github.com/google/libphonenumber/blob/32719cf74e68796788d1ca45abc85dcdc63ba5b9/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L1546\n // Not saying that this IDD formatter replicates it 1:1, but it seems to work.\n // Who would even need to format phone numbers in IDD format anyway?\n case 'IDD':\n if (!options.fromCountry) {\n return;\n // throw new Error('`fromCountry` option not passed for IDD-prefixed formatting.')\n }\n var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata);\n return addExtension(formattedNumber, input.ext, metadata, options.formatExtension);\n default:\n throw new Error(\"Unknown \\\"format\\\" argument passed to \\\"formatNumber()\\\": \\\"\".concat(format, \"\\\"\"));\n }\n}\nfunction formatNationalNumber(number, carrierCode, formatAs, metadata, options) {\n var format = chooseFormatForNumber(metadata.formats(), number);\n if (!format) {\n return number;\n }\n return formatNationalNumberUsingFormat(number, format, {\n useInternationalFormat: formatAs === 'INTERNATIONAL',\n withNationalPrefix: format.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true,\n carrierCode: carrierCode,\n metadata: metadata\n });\n}\nexport function chooseFormatForNumber(availableFormats, nationalNumber) {\n // Using a `for ... of` loop here didn't work with `babel`/`istanbul`:\n // for some weird reason, it showed code coverage less than 100%.\n // That's because `babel`/`istanbul`, for some weird reason,\n // apparently doesn't know how to properly exclude Babel polyfills from code coverage.\n //\n // for (const format of availableFormats) { ... }\n //\n return pickFirstMatchingElement(availableFormats, function (format) {\n // Validate leading digits.\n // The test case for \"else path\" could be found by searching for\n // \"format.leadingDigitsPatterns().length === 0\".\n if (format.leadingDigitsPatterns().length > 0) {\n // The last leading_digits_pattern is used here, as it is the most detailed\n var lastLeadingDigitsPattern = format.leadingDigitsPatterns()[format.leadingDigitsPatterns().length - 1];\n // If leading digits don't match then move on to the next phone number format\n if (nationalNumber.search(lastLeadingDigitsPattern) !== 0) {\n return false;\n }\n }\n // Check that the national number matches the phone number format regular expression\n return matchesEntirely(nationalNumber, format.pattern());\n });\n}\nfunction addExtension(formattedNumber, ext, metadata, formatExtension) {\n return ext ? formatExtension(formattedNumber, ext, metadata) : formattedNumber;\n}\nfunction formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata) {\n var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata.metadata);\n // When calling within the same country calling code.\n if (fromCountryCallingCode === countryCallingCode) {\n var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, 'NATIONAL', metadata);\n // For NANPA regions, return the national format for these regions\n // but prefix it with the country calling code.\n if (countryCallingCode === '1') {\n return countryCallingCode + ' ' + formattedNumber;\n }\n // If regions share a country calling code, the country calling code need\n // not be dialled. This also applies when dialling within a region, so this\n // if clause covers both these cases. Technically this is the case for\n // dialling from La Reunion to other overseas departments of France (French\n // Guiana, Martinique, Guadeloupe), but not vice versa - so we don't cover\n // this edge case for now and for those cases return the version including\n // country calling code. Details here:\n // http://www.petitfute.com/voyage/225-info-pratiques-reunion\n //\n return formattedNumber;\n }\n var iddPrefix = getIddPrefix(fromCountry, undefined, metadata.metadata);\n if (iddPrefix) {\n return \"\".concat(iddPrefix, \" \").concat(countryCallingCode, \" \").concat(formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata));\n }\n}\nfunction merge() {\n var i = 1;\n for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {\n objects[_key] = arguments[_key];\n }\n while (i < objects.length) {\n if (objects[i]) {\n for (var key in objects[i]) {\n objects[0][key] = objects[i][key];\n }\n }\n i++;\n }\n return objects[0];\n}\nfunction pickFirstMatchingElement(elements, testFunction) {\n var i = 0;\n while (i < elements.length) {\n if (testFunction(elements[i])) {\n return elements[i];\n }\n i++;\n }\n}\n//# sourceMappingURL=format.js.map"],"names":["DEFAULT_OPTIONS","formattedNumber","extension","metadata","formatNumber","input","format","options","merge","Metadata","countryCallingCode","nationalNumber","number","formatNationalNumber","addExtension","formatRFC3966","formatIDD","carrierCode","formatAs","chooseFormatForNumber","formatNationalNumberUsingFormat","availableFormats","pickFirstMatchingElement","lastLeadingDigitsPattern","matchesEntirely","ext","formatExtension","fromCountry","fromCountryCallingCode","getCountryCallingCode","iddPrefix","getIddPrefix","i","_len","objects","_key","key","elements","testFunction"],"mappings":";;;;;AAUA,IAAIA,IAAkB;AAAA,EACpB,iBAAiB,SAAyBC,GAAiBC,GAAWC,GAAU;AAC9E,WAAO,GAAG,OAAOF,CAAe,EAAE,OAAOE,EAAS,IAAG,CAAE,EAAE,OAAOD,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