line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# automatically generated file, don't edit |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Copyright 2023 David Cantrell, derived from data from libphonenumber |
6
|
|
|
|
|
|
|
# http://code.google.com/p/libphonenumber/ |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); |
9
|
|
|
|
|
|
|
# you may not use this file except in compliance with the License. |
10
|
|
|
|
|
|
|
# You may obtain a copy of the License at |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0 |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software |
15
|
|
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, |
16
|
|
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
17
|
|
|
|
|
|
|
# See the License for the specific language governing permissions and |
18
|
|
|
|
|
|
|
# limitations under the License. |
19
|
|
|
|
|
|
|
package Number::Phone::StubCountry::BA; |
20
|
2
|
|
|
2
|
|
1272
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
224
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
15
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
56
|
|
23
|
2
|
|
|
2
|
|
16
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
56
|
|
24
|
2
|
|
|
2
|
|
14
|
use utf8; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
17
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131441; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1-$2', |
30
|
|
|
|
|
|
|
'intl_format' => 'NA', |
31
|
|
|
|
|
|
|
'leading_digits' => '[2-9]', |
32
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})' |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
36
|
|
|
|
|
|
|
'leading_digits' => ' |
37
|
|
|
|
|
|
|
6[1-3]| |
38
|
|
|
|
|
|
|
[7-9] |
39
|
|
|
|
|
|
|
', |
40
|
|
|
|
|
|
|
'national_rule' => '0$1', |
41
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{3})' |
42
|
|
|
|
|
|
|
}, |
43
|
|
|
|
|
|
|
{ |
44
|
|
|
|
|
|
|
'format' => '$1 $2-$3', |
45
|
|
|
|
|
|
|
'leading_digits' => ' |
46
|
|
|
|
|
|
|
[3-5]| |
47
|
|
|
|
|
|
|
6[56] |
48
|
|
|
|
|
|
|
', |
49
|
|
|
|
|
|
|
'national_rule' => '0$1', |
50
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{3})' |
51
|
|
|
|
|
|
|
}, |
52
|
|
|
|
|
|
|
{ |
53
|
|
|
|
|
|
|
'format' => '$1 $2 $3 $4', |
54
|
|
|
|
|
|
|
'leading_digits' => '6', |
55
|
|
|
|
|
|
|
'national_rule' => '0$1', |
56
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{3})' |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
]; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
my $validators = { |
61
|
|
|
|
|
|
|
'fixed_line' => ' |
62
|
|
|
|
|
|
|
(?: |
63
|
|
|
|
|
|
|
3(?: |
64
|
|
|
|
|
|
|
[05-79][2-9]| |
65
|
|
|
|
|
|
|
1[4579]| |
66
|
|
|
|
|
|
|
[23][24-9]| |
67
|
|
|
|
|
|
|
4[2-4689]| |
68
|
|
|
|
|
|
|
8[2457-9] |
69
|
|
|
|
|
|
|
)| |
70
|
|
|
|
|
|
|
49[2-579]| |
71
|
|
|
|
|
|
|
5(?: |
72
|
|
|
|
|
|
|
0[2-49]| |
73
|
|
|
|
|
|
|
[13][2-9]| |
74
|
|
|
|
|
|
|
[268][2-4679]| |
75
|
|
|
|
|
|
|
4[4689]| |
76
|
|
|
|
|
|
|
5[2-79]| |
77
|
|
|
|
|
|
|
7[2-69]| |
78
|
|
|
|
|
|
|
9[2-4689] |
79
|
|
|
|
|
|
|
) |
80
|
|
|
|
|
|
|
)\\d{5} |
81
|
|
|
|
|
|
|
', |
82
|
|
|
|
|
|
|
'geographic' => ' |
83
|
|
|
|
|
|
|
(?: |
84
|
|
|
|
|
|
|
3(?: |
85
|
|
|
|
|
|
|
[05-79][2-9]| |
86
|
|
|
|
|
|
|
1[4579]| |
87
|
|
|
|
|
|
|
[23][24-9]| |
88
|
|
|
|
|
|
|
4[2-4689]| |
89
|
|
|
|
|
|
|
8[2457-9] |
90
|
|
|
|
|
|
|
)| |
91
|
|
|
|
|
|
|
49[2-579]| |
92
|
|
|
|
|
|
|
5(?: |
93
|
|
|
|
|
|
|
0[2-49]| |
94
|
|
|
|
|
|
|
[13][2-9]| |
95
|
|
|
|
|
|
|
[268][2-4679]| |
96
|
|
|
|
|
|
|
4[4689]| |
97
|
|
|
|
|
|
|
5[2-79]| |
98
|
|
|
|
|
|
|
7[2-69]| |
99
|
|
|
|
|
|
|
9[2-4689] |
100
|
|
|
|
|
|
|
) |
101
|
|
|
|
|
|
|
)\\d{5} |
102
|
|
|
|
|
|
|
', |
103
|
|
|
|
|
|
|
'mobile' => ' |
104
|
|
|
|
|
|
|
6040\\d{5}| |
105
|
|
|
|
|
|
|
6(?: |
106
|
|
|
|
|
|
|
03| |
107
|
|
|
|
|
|
|
[1-356]| |
108
|
|
|
|
|
|
|
44| |
109
|
|
|
|
|
|
|
7\\d |
110
|
|
|
|
|
|
|
)\\d{6} |
111
|
|
|
|
|
|
|
', |
112
|
|
|
|
|
|
|
'pager' => '', |
113
|
|
|
|
|
|
|
'personal_number' => '', |
114
|
|
|
|
|
|
|
'specialrate' => '(8[12]\\d{6})|(9[0246]\\d{6})|( |
115
|
|
|
|
|
|
|
703[235]0\\d{3}| |
116
|
|
|
|
|
|
|
70(?: |
117
|
|
|
|
|
|
|
2[0-5]| |
118
|
|
|
|
|
|
|
3[0146]| |
119
|
|
|
|
|
|
|
[56]0 |
120
|
|
|
|
|
|
|
)\\d{4} |
121
|
|
|
|
|
|
|
)', |
122
|
|
|
|
|
|
|
'toll_free' => '8[08]\\d{6}', |
123
|
|
|
|
|
|
|
'voip' => '' |
124
|
|
|
|
|
|
|
}; |
125
|
|
|
|
|
|
|
my %areanames = (); |
126
|
|
|
|
|
|
|
$areanames{sr} = {"38755", "Бијељина", |
127
|
|
|
|
|
|
|
"38734", "Кантон\ 10", |
128
|
|
|
|
|
|
|
"38757", "Источно\ Сарајево", |
129
|
|
|
|
|
|
|
"38754", "Шамац", |
130
|
|
|
|
|
|
|
"38737", "Унско\-сански\ кантон", |
131
|
|
|
|
|
|
|
"38735", "Тузлански\ кантон", |
132
|
|
|
|
|
|
|
"38758", "Фоча", |
133
|
|
|
|
|
|
|
"38731", "Посавски\ кантон", |
134
|
|
|
|
|
|
|
"38756", "Зворник", |
135
|
|
|
|
|
|
|
"38733", "Сарајевски\ кантон", |
136
|
|
|
|
|
|
|
"38730", "Средњoбосански\ кантон", |
137
|
|
|
|
|
|
|
"38732", "Зеничко\-добојски\ кантон", |
138
|
|
|
|
|
|
|
"38750", "Мркоњић\ Град", |
139
|
|
|
|
|
|
|
"38752", "Приједор", |
140
|
|
|
|
|
|
|
"38753", "Добој", |
141
|
|
|
|
|
|
|
"38738", "Босанско\-подрињски\ кантон\ Горажде", |
142
|
|
|
|
|
|
|
"38751", "Бања\ Лука", |
143
|
|
|
|
|
|
|
"38759", "Требиње", |
144
|
|
|
|
|
|
|
"3874", "Брчко\ Дистрикт",}; |
145
|
|
|
|
|
|
|
$areanames{en} = {"38755", "Bijeljina", |
146
|
|
|
|
|
|
|
"38734", "Canton\ 10", |
147
|
|
|
|
|
|
|
"38757", "East\ Sarajevo", |
148
|
|
|
|
|
|
|
"38737", "Una\-Sana\ Canton", |
149
|
|
|
|
|
|
|
"38754", "Šamac", |
150
|
|
|
|
|
|
|
"38735", "Tuzla\ Canton", |
151
|
|
|
|
|
|
|
"38756", "Zvornik", |
152
|
|
|
|
|
|
|
"38739", "West\ Herzegovina\ Canton", |
153
|
|
|
|
|
|
|
"38758", "Foča", |
154
|
|
|
|
|
|
|
"38731", "Posavina\ Canton", |
155
|
|
|
|
|
|
|
"38733", "Sarajevo\ Canton", |
156
|
|
|
|
|
|
|
"38732", "Zenica\-Doboj\ Canton", |
157
|
|
|
|
|
|
|
"38730", "Central\ Bosnia\ Canton", |
158
|
|
|
|
|
|
|
"38750", "Mrkonjić\ Grad", |
159
|
|
|
|
|
|
|
"38752", "Prijedor", |
160
|
|
|
|
|
|
|
"38753", "Doboj", |
161
|
|
|
|
|
|
|
"38738", "Bosnian\-Podrinje\ Canton\ Goražde", |
162
|
|
|
|
|
|
|
"38751", "Banja\ Luka", |
163
|
|
|
|
|
|
|
"3874", "Brčko\ District", |
164
|
|
|
|
|
|
|
"38759", "Trebinje", |
165
|
|
|
|
|
|
|
"38736", "Herzegovina\-Neretva\ Canton",}; |
166
|
|
|
|
|
|
|
$areanames{bs} = {"38733", "Kanton\ Sarajevo", |
167
|
|
|
|
|
|
|
"38730", "Srednjobosanski\ kanton", |
168
|
|
|
|
|
|
|
"38732", "Zeničko\-dobojski\ kanton", |
169
|
|
|
|
|
|
|
"38739", "Zapadnohercegovački\ kanton", |
170
|
|
|
|
|
|
|
"38731", "Posavski\ kanton", |
171
|
|
|
|
|
|
|
"38736", "Hercegovačko\-neretvanski\ kanton", |
172
|
|
|
|
|
|
|
"38738", "Bosansko\-podrinjski\ kanton\ Goražde", |
173
|
|
|
|
|
|
|
"3874", "Brčko\ Distrikt", |
174
|
|
|
|
|
|
|
"38757", "Istočno\ Sarajevo", |
175
|
|
|
|
|
|
|
"38734", "kanton\ 10", |
176
|
|
|
|
|
|
|
"38735", "Tuzlanski\ kanton", |
177
|
|
|
|
|
|
|
"38737", "Unsko\-sanski\ kanton",}; |
178
|
|
|
|
|
|
|
$areanames{hr} = {"38738", "Bosansko\-podrinjska\ županija\ Goražde", |
179
|
|
|
|
|
|
|
"38736", "Hercegovačko\-neretvanska\ županija", |
180
|
|
|
|
|
|
|
"38731", "Županija\ Posavska", |
181
|
|
|
|
|
|
|
"38739", "Županija\ Zapadnohercegovačka", |
182
|
|
|
|
|
|
|
"38730", "Županija\ Središnja\ Bosna", |
183
|
|
|
|
|
|
|
"38732", "Zeničko\-dobojska\ županija", |
184
|
|
|
|
|
|
|
"38733", "Sarajevska\ županija", |
185
|
|
|
|
|
|
|
"38737", "Unsko\-sanska\ županija", |
186
|
|
|
|
|
|
|
"38735", "Tuzlanska\ županija", |
187
|
|
|
|
|
|
|
"38734", "Hercegbosanska\ županija",}; |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
sub new { |
190
|
19
|
|
|
19
|
1
|
45
|
my $class = shift; |
191
|
19
|
|
|
|
|
39
|
my $number = shift; |
192
|
19
|
|
|
|
|
124
|
$number =~ s/(^\+387|\D)//g; |
193
|
19
|
|
|
|
|
118
|
my $self = bless({ country_code => '387', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
194
|
19
|
100
|
|
|
|
87
|
return $self if ($self->is_valid()); |
195
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
196
|
1
|
|
|
|
|
10
|
$self = bless({ country_code => '387', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
197
|
1
|
50
|
|
|
|
4
|
return $self->is_valid() ? $self : undef; |
198
|
|
|
|
|
|
|
} |
199
|
|
|
|
|
|
|
1; |