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::CL; |
20
|
2
|
|
|
2
|
|
1265
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
228
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
23
|
use strict; |
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
48
|
|
23
|
2
|
|
|
2
|
|
18
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
53
|
|
24
|
2
|
|
|
2
|
|
17
|
use utf8; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
17
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174401; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1', |
30
|
|
|
|
|
|
|
'intl_format' => 'NA', |
31
|
|
|
|
|
|
|
'leading_digits' => ' |
32
|
|
|
|
|
|
|
1(?: |
33
|
|
|
|
|
|
|
[03-589]| |
34
|
|
|
|
|
|
|
21 |
35
|
|
|
|
|
|
|
)| |
36
|
|
|
|
|
|
|
[29]0| |
37
|
|
|
|
|
|
|
78 |
38
|
|
|
|
|
|
|
', |
39
|
|
|
|
|
|
|
'pattern' => '(\\d{4})' |
40
|
|
|
|
|
|
|
}, |
41
|
|
|
|
|
|
|
{ |
42
|
|
|
|
|
|
|
'format' => '$1 $2', |
43
|
|
|
|
|
|
|
'leading_digits' => '2196', |
44
|
|
|
|
|
|
|
'national_rule' => '($1)', |
45
|
|
|
|
|
|
|
'pattern' => '(\\d{5})(\\d{4})' |
46
|
|
|
|
|
|
|
}, |
47
|
|
|
|
|
|
|
{ |
48
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
49
|
|
|
|
|
|
|
'leading_digits' => '44', |
50
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{4})' |
51
|
|
|
|
|
|
|
}, |
52
|
|
|
|
|
|
|
{ |
53
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
54
|
|
|
|
|
|
|
'leading_digits' => '2[1-36]', |
55
|
|
|
|
|
|
|
'national_rule' => '($1)', |
56
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{4})(\\d{4})' |
57
|
|
|
|
|
|
|
}, |
58
|
|
|
|
|
|
|
{ |
59
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
60
|
|
|
|
|
|
|
'leading_digits' => '9[2-9]', |
61
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{4})(\\d{4})' |
62
|
|
|
|
|
|
|
}, |
63
|
|
|
|
|
|
|
{ |
64
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
65
|
|
|
|
|
|
|
'leading_digits' => ' |
66
|
|
|
|
|
|
|
3[2-5]| |
67
|
|
|
|
|
|
|
[47]| |
68
|
|
|
|
|
|
|
5[1-3578]| |
69
|
|
|
|
|
|
|
6[13-57]| |
70
|
|
|
|
|
|
|
8(?: |
71
|
|
|
|
|
|
|
0[1-9]| |
72
|
|
|
|
|
|
|
[1-9] |
73
|
|
|
|
|
|
|
) |
74
|
|
|
|
|
|
|
', |
75
|
|
|
|
|
|
|
'national_rule' => '($1)', |
76
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{4})' |
77
|
|
|
|
|
|
|
}, |
78
|
|
|
|
|
|
|
{ |
79
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
80
|
|
|
|
|
|
|
'leading_digits' => ' |
81
|
|
|
|
|
|
|
60| |
82
|
|
|
|
|
|
|
8 |
83
|
|
|
|
|
|
|
', |
84
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})' |
85
|
|
|
|
|
|
|
}, |
86
|
|
|
|
|
|
|
{ |
87
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
88
|
|
|
|
|
|
|
'leading_digits' => '1', |
89
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{3})(\\d{4})' |
90
|
|
|
|
|
|
|
}, |
91
|
|
|
|
|
|
|
{ |
92
|
|
|
|
|
|
|
'format' => '$1 $2 $3 $4', |
93
|
|
|
|
|
|
|
'leading_digits' => '60', |
94
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{3})' |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
]; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
my $validators = { |
99
|
|
|
|
|
|
|
'geographic' => ' |
100
|
|
|
|
|
|
|
2(?: |
101
|
|
|
|
|
|
|
1982[0-6]| |
102
|
|
|
|
|
|
|
3314[05-9] |
103
|
|
|
|
|
|
|
)\\d{3}| |
104
|
|
|
|
|
|
|
(?: |
105
|
|
|
|
|
|
|
2(?: |
106
|
|
|
|
|
|
|
1(?: |
107
|
|
|
|
|
|
|
160| |
108
|
|
|
|
|
|
|
962 |
109
|
|
|
|
|
|
|
)| |
110
|
|
|
|
|
|
|
3(?: |
111
|
|
|
|
|
|
|
2\\d\\d| |
112
|
|
|
|
|
|
|
3(?: |
113
|
|
|
|
|
|
|
[03467]\\d| |
114
|
|
|
|
|
|
|
1[0-35-9]| |
115
|
|
|
|
|
|
|
2[1-9]| |
116
|
|
|
|
|
|
|
5[0-24-9]| |
117
|
|
|
|
|
|
|
8[0-3] |
118
|
|
|
|
|
|
|
)| |
119
|
|
|
|
|
|
|
600 |
120
|
|
|
|
|
|
|
)| |
121
|
|
|
|
|
|
|
646[59] |
122
|
|
|
|
|
|
|
)| |
123
|
|
|
|
|
|
|
80[1-9]\\d\\d| |
124
|
|
|
|
|
|
|
9(?: |
125
|
|
|
|
|
|
|
3(?: |
126
|
|
|
|
|
|
|
[0-57-9]\\d\\d| |
127
|
|
|
|
|
|
|
6(?: |
128
|
|
|
|
|
|
|
0[02-9]| |
129
|
|
|
|
|
|
|
[1-9]\\d |
130
|
|
|
|
|
|
|
) |
131
|
|
|
|
|
|
|
)| |
132
|
|
|
|
|
|
|
6(?: |
133
|
|
|
|
|
|
|
[0-8]\\d\\d| |
134
|
|
|
|
|
|
|
9(?: |
135
|
|
|
|
|
|
|
[02-79]\\d| |
136
|
|
|
|
|
|
|
1[05-9] |
137
|
|
|
|
|
|
|
) |
138
|
|
|
|
|
|
|
)| |
139
|
|
|
|
|
|
|
7[1-9]\\d\\d| |
140
|
|
|
|
|
|
|
9(?: |
141
|
|
|
|
|
|
|
[03-9]\\d\\d| |
142
|
|
|
|
|
|
|
1(?: |
143
|
|
|
|
|
|
|
[0235-9]\\d| |
144
|
|
|
|
|
|
|
4[0-24-9] |
145
|
|
|
|
|
|
|
)| |
146
|
|
|
|
|
|
|
2(?: |
147
|
|
|
|
|
|
|
[0-79]\\d| |
148
|
|
|
|
|
|
|
8[0-46-9] |
149
|
|
|
|
|
|
|
) |
150
|
|
|
|
|
|
|
) |
151
|
|
|
|
|
|
|
) |
152
|
|
|
|
|
|
|
)\\d{4}| |
153
|
|
|
|
|
|
|
(?: |
154
|
|
|
|
|
|
|
22| |
155
|
|
|
|
|
|
|
3[2-5]| |
156
|
|
|
|
|
|
|
[47][1-35]| |
157
|
|
|
|
|
|
|
5[1-3578]| |
158
|
|
|
|
|
|
|
6[13-57]| |
159
|
|
|
|
|
|
|
8[1-9]| |
160
|
|
|
|
|
|
|
9[2458] |
161
|
|
|
|
|
|
|
)\\d{7} |
162
|
|
|
|
|
|
|
', |
163
|
|
|
|
|
|
|
'pager' => '', |
164
|
|
|
|
|
|
|
'personal_number' => '', |
165
|
|
|
|
|
|
|
'specialrate' => '(600\\d{7,8})', |
166
|
|
|
|
|
|
|
'toll_free' => ' |
167
|
|
|
|
|
|
|
(?: |
168
|
|
|
|
|
|
|
123| |
169
|
|
|
|
|
|
|
8 |
170
|
|
|
|
|
|
|
)00\\d{6} |
171
|
|
|
|
|
|
|
', |
172
|
|
|
|
|
|
|
'voip' => '44\\d{7}' |
173
|
|
|
|
|
|
|
}; |
174
|
|
|
|
|
|
|
my %areanames = (); |
175
|
|
|
|
|
|
|
$areanames{es} = {"5658", "Arica\,\ Arica\ y\ Parinacota", |
176
|
|
|
|
|
|
|
"5661", "Punta\ Arenas\,\ Magallanes", |
177
|
|
|
|
|
|
|
"5626", "Santiago\,\ Región\ Metropolitana", |
178
|
|
|
|
|
|
|
"56211", "Santiago\,\ Región\ Metropolitana", |
179
|
|
|
|
|
|
|
"5623", "Santiago\,\ Región\ Metropolitana", |
180
|
|
|
|
|
|
|
"562198", "Santiago\,\ Región\ Metropolitana", |
181
|
|
|
|
|
|
|
"5667", "Coihaique\,\ Aysén", |
182
|
|
|
|
|
|
|
"5622", "Santiago\,\ Región\ Metropolitana",}; |
183
|
|
|
|
|
|
|
$areanames{en} = {"5665", "Puerto\ Montt\,\ Los\ Lagos", |
184
|
|
|
|
|
|
|
"5622", "Santiago\,\ Metropolitan\ Region", |
185
|
|
|
|
|
|
|
"56539", "Ovalle\,\ Coquimbo", |
186
|
|
|
|
|
|
|
"5675", "Curicó\,\ Maule", |
187
|
|
|
|
|
|
|
"5655", "Antofagasta", |
188
|
|
|
|
|
|
|
"5653243", "Ovalle\,\ Coquimbo", |
189
|
|
|
|
|
|
|
"565325", "Ovalle\,\ Coquimbo", |
190
|
|
|
|
|
|
|
"5667", "Coyhaique\,\ Aisén", |
191
|
|
|
|
|
|
|
"5635", "San\ Antonio\,\ Valparaíso", |
192
|
|
|
|
|
|
|
"5653247", "Ovalle\,\ Coquimbo", |
193
|
|
|
|
|
|
|
"5642", "Chillán\,\ Biobío", |
194
|
|
|
|
|
|
|
"5657", "Iquique\,\ Tarapacá", |
195
|
|
|
|
|
|
|
"5653246", "Ovalle\,\ Coquimbo", |
196
|
|
|
|
|
|
|
"565323", "Ovalle\,\ Coquimbo", |
197
|
|
|
|
|
|
|
"56532453", "Ovalle\,\ Coquimbo", |
198
|
|
|
|
|
|
|
"56538", "Ovalle\,\ Coquimbo", |
199
|
|
|
|
|
|
|
"5653242", "Ovalle\,\ Coquimbo", |
200
|
|
|
|
|
|
|
"5634", "San\ Felipe\,\ Valparaíso", |
201
|
|
|
|
|
|
|
"56537", "Ovalle\,\ Coquimbo", |
202
|
|
|
|
|
|
|
"5663", "Valdivia\,\ Los\ Ríos", |
203
|
|
|
|
|
|
|
"5673", "Linares\,\ Maule", |
204
|
|
|
|
|
|
|
"5653248", "Ovalle\,\ Coquimbo", |
205
|
|
|
|
|
|
|
"56534", "Ovalle\,\ Coquimbo", |
206
|
|
|
|
|
|
|
"5664", "Osorno\,\ Los\ Lagos", |
207
|
|
|
|
|
|
|
"5653249", "Ovalle\,\ Coquimbo", |
208
|
|
|
|
|
|
|
"5641", "Concepción\,\ Biobío", |
209
|
|
|
|
|
|
|
"5633", "Quillota\,\ Valparaíso", |
210
|
|
|
|
|
|
|
"5653240", "Ovalle\,\ Coquimbo", |
211
|
|
|
|
|
|
|
"565320", "Ovalle\,\ Coquimbo", |
212
|
|
|
|
|
|
|
"565321", "Ovalle\,\ Coquimbo", |
213
|
|
|
|
|
|
|
"565327", "Ovalle\,\ Coquimbo", |
214
|
|
|
|
|
|
|
"565322", "Ovalle\,\ Coquimbo", |
215
|
|
|
|
|
|
|
"56532458", "Ovalle\,\ Coquimbo", |
216
|
|
|
|
|
|
|
"562198", "Santiago\,\ Metropolitan\ Region", |
217
|
|
|
|
|
|
|
"565329", "Ovalle\,\ Coquimbo", |
218
|
|
|
|
|
|
|
"5643", "Los\ Angeles\,\ Biobío", |
219
|
|
|
|
|
|
|
"565328", "Ovalle\,\ Coquimbo", |
220
|
|
|
|
|
|
|
"5623", "Santiago\,\ Metropolitan\ Region", |
221
|
|
|
|
|
|
|
"5651", "La\ Serena\,\ Coquimbo", |
222
|
|
|
|
|
|
|
"56531", "Ovalle\,\ Coquimbo", |
223
|
|
|
|
|
|
|
"56211", "Santiago\,\ Metropolitan\ Region", |
224
|
|
|
|
|
|
|
"56532459", "Ovalle\,\ Coquimbo", |
225
|
|
|
|
|
|
|
"56532455", "Ovalle\,\ Coquimbo", |
226
|
|
|
|
|
|
|
"5661", "Punta\ Arenas\,\ Magallanes\ and\ Antártica\ Chilena", |
227
|
|
|
|
|
|
|
"5626", "Santiago\,\ Metropolitan\ Region", |
228
|
|
|
|
|
|
|
"56532454", "Ovalle\,\ Coquimbo", |
229
|
|
|
|
|
|
|
"5671", "Talca\,\ Maule", |
230
|
|
|
|
|
|
|
"5658", "Arica\,\ Arica\ and\ Parinacota", |
231
|
|
|
|
|
|
|
"56530", "Ovalle\,\ Coquimbo", |
232
|
|
|
|
|
|
|
"5653241", "Ovalle\,\ Coquimbo", |
233
|
|
|
|
|
|
|
"5645", "Temuco\,\ Araucanía", |
234
|
|
|
|
|
|
|
"5632", "Valparaíso", |
235
|
|
|
|
|
|
|
"56532456", "Ovalle\,\ Coquimbo", |
236
|
|
|
|
|
|
|
"5653244", "Ovalle\,\ Coquimbo", |
237
|
|
|
|
|
|
|
"56532452", "Ovalle\,\ Coquimbo", |
238
|
|
|
|
|
|
|
"56532457", "Ovalle\,\ Coquimbo", |
239
|
|
|
|
|
|
|
"565326", "Ovalle\,\ Coquimbo", |
240
|
|
|
|
|
|
|
"5652", "Copiapó\,\ Atacama", |
241
|
|
|
|
|
|
|
"56535", "Ovalle\,\ Coquimbo", |
242
|
|
|
|
|
|
|
"56533", "Ovalle\,\ Coquimbo", |
243
|
|
|
|
|
|
|
"5672", "Rancagua\,\ O\'Higgins", |
244
|
|
|
|
|
|
|
"56536", "Ovalle\,\ Coquimbo",}; |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
sub new { |
247
|
16
|
|
|
16
|
1
|
39
|
my $class = shift; |
248
|
16
|
|
|
|
|
30
|
my $number = shift; |
249
|
16
|
|
|
|
|
101
|
$number =~ s/(^\+56|\D)//g; |
250
|
16
|
|
|
|
|
101
|
my $self = bless({ country_code => '56', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
251
|
16
|
100
|
|
|
|
84
|
return $self->is_valid() ? $self : undef; |
252
|
|
|
|
|
|
|
} |
253
|
|
|
|
|
|
|
1; |