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
|
|
1153
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
236
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
15
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
45
|
|
23
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
53
|
|
24
|
2
|
|
|
2
|
|
11
|
use utf8; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
12
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174401; |
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{en} = {"38739", "West\ Herzegovina\ Canton", |
127
|
|
|
|
|
|
|
"38738", "Bosnian\-Podrinje\ Canton\ Goražde", |
128
|
|
|
|
|
|
|
"38730", "Central\ Bosnia\ Canton", |
129
|
|
|
|
|
|
|
"38757", "East\ Sarajevo", |
130
|
|
|
|
|
|
|
"38759", "Trebinje", |
131
|
|
|
|
|
|
|
"38750", "Mrkonjić\ Grad", |
132
|
|
|
|
|
|
|
"38758", "Foča", |
133
|
|
|
|
|
|
|
"38737", "Una\-Sana\ Canton", |
134
|
|
|
|
|
|
|
"38756", "Zvornik", |
135
|
|
|
|
|
|
|
"38731", "Posavina\ Canton", |
136
|
|
|
|
|
|
|
"38734", "Canton\ 10", |
137
|
|
|
|
|
|
|
"38732", "Zenica\-Doboj\ Canton", |
138
|
|
|
|
|
|
|
"38755", "Bijeljina", |
139
|
|
|
|
|
|
|
"38753", "Doboj", |
140
|
|
|
|
|
|
|
"38751", "Banja\ Luka", |
141
|
|
|
|
|
|
|
"38736", "Herzegovina\-Neretva\ Canton", |
142
|
|
|
|
|
|
|
"38733", "Sarajevo\ Canton", |
143
|
|
|
|
|
|
|
"38754", "Šamac", |
144
|
|
|
|
|
|
|
"38752", "Prijedor", |
145
|
|
|
|
|
|
|
"3874", "Brčko\ District", |
146
|
|
|
|
|
|
|
"38735", "Tuzla\ Canton",}; |
147
|
|
|
|
|
|
|
$areanames{hr} = {"38736", "Hercegovačko\-neretvanska\ županija", |
148
|
|
|
|
|
|
|
"38733", "Sarajevska\ županija", |
149
|
|
|
|
|
|
|
"38737", "Unsko\-sanska\ županija", |
150
|
|
|
|
|
|
|
"38735", "Tuzlanska\ županija", |
151
|
|
|
|
|
|
|
"38731", "Županija\ Posavska", |
152
|
|
|
|
|
|
|
"38739", "Županija\ Zapadnohercegovačka", |
153
|
|
|
|
|
|
|
"38738", "Bosansko\-podrinjska\ županija\ Goražde", |
154
|
|
|
|
|
|
|
"38734", "Hercegbosanska\ županija", |
155
|
|
|
|
|
|
|
"38730", "Županija\ Središnja\ Bosna", |
156
|
|
|
|
|
|
|
"38732", "Zeničko\-dobojska\ županija",}; |
157
|
|
|
|
|
|
|
$areanames{sr} = {"38753", "Добој", |
158
|
|
|
|
|
|
|
"38732", "Зеничко\-добојски\ кантон", |
159
|
|
|
|
|
|
|
"38734", "Кантон\ 10", |
160
|
|
|
|
|
|
|
"38755", "Бијељина", |
161
|
|
|
|
|
|
|
"38731", "Посавски\ кантон", |
162
|
|
|
|
|
|
|
"38756", "Зворник", |
163
|
|
|
|
|
|
|
"38754", "Шамац", |
164
|
|
|
|
|
|
|
"38752", "Приједор", |
165
|
|
|
|
|
|
|
"3874", "Брчко\ Дистрикт", |
166
|
|
|
|
|
|
|
"38735", "Тузлански\ кантон", |
167
|
|
|
|
|
|
|
"38733", "Сарајевски\ кантон", |
168
|
|
|
|
|
|
|
"38751", "Бања\ Лука", |
169
|
|
|
|
|
|
|
"38738", "Босанско\-подрињски\ кантон\ Горажде", |
170
|
|
|
|
|
|
|
"38730", "Средњoбосански\ кантон", |
171
|
|
|
|
|
|
|
"38757", "Источно\ Сарајево", |
172
|
|
|
|
|
|
|
"38758", "Фоча", |
173
|
|
|
|
|
|
|
"38750", "Мркоњић\ Град", |
174
|
|
|
|
|
|
|
"38737", "Унско\-сански\ кантон", |
175
|
|
|
|
|
|
|
"38759", "Требиње",}; |
176
|
|
|
|
|
|
|
$areanames{bs} = {"38757", "Istočno\ Sarajevo", |
177
|
|
|
|
|
|
|
"38738", "Bosansko\-podrinjski\ kanton\ Goražde", |
178
|
|
|
|
|
|
|
"38730", "Srednjobosanski\ kanton", |
179
|
|
|
|
|
|
|
"38739", "Zapadnohercegovački\ kanton", |
180
|
|
|
|
|
|
|
"38737", "Unsko\-sanski\ kanton", |
181
|
|
|
|
|
|
|
"38734", "kanton\ 10", |
182
|
|
|
|
|
|
|
"38732", "Zeničko\-dobojski\ kanton", |
183
|
|
|
|
|
|
|
"38731", "Posavski\ kanton", |
184
|
|
|
|
|
|
|
"38733", "Kanton\ Sarajevo", |
185
|
|
|
|
|
|
|
"3874", "Brčko\ Distrikt", |
186
|
|
|
|
|
|
|
"38735", "Tuzlanski\ kanton", |
187
|
|
|
|
|
|
|
"38736", "Hercegovačko\-neretvanski\ kanton",}; |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
sub new { |
190
|
19
|
|
|
19
|
1
|
48
|
my $class = shift; |
191
|
19
|
|
|
|
|
32
|
my $number = shift; |
192
|
19
|
|
|
|
|
116
|
$number =~ s/(^\+387|\D)//g; |
193
|
19
|
|
|
|
|
110
|
my $self = bless({ country_code => '387', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
194
|
19
|
100
|
|
|
|
94
|
return $self if ($self->is_valid()); |
195
|
1
|
|
|
|
|
13
|
$number =~ s/^(?:0)//; |
196
|
1
|
|
|
|
|
11
|
$self = bless({ country_code => '387', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
197
|
1
|
50
|
|
|
|
12
|
return $self->is_valid() ? $self : undef; |
198
|
|
|
|
|
|
|
} |
199
|
|
|
|
|
|
|
1; |