# automatically generated file, don't edit



# Copyright 2011 David Cantrell, derived from data from libphonenumber
# http://code.google.com/p/libphonenumber/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
package Number::Phone::StubCountry::BW;
use base qw(Number::Phone::StubCountry);

use strict;
use warnings;
use utf8;
our $VERSION = 1.20200904144527;

my $formatters = [
                {
                  'format' => '$1 $2',
                  'leading_digits' => '90',
                  'pattern' => '(\\d{2})(\\d{5})'
                },
                {
                  'format' => '$1 $2',
                  'leading_digits' => '[2-6]',
                  'pattern' => '(\\d{3})(\\d{4})'
                },
                {
                  'format' => '$1 $2 $3',
                  'leading_digits' => '7',
                  'pattern' => '(\\d{2})(\\d{3})(\\d{3})'
                }
              ];

my $validators = {
                'fixed_line' => '
          (?:
            2(?:
              4[0-48]|
              6[0-24]|
              9[0578]
            )|
            3(?:
              1[0-35-9]|
              55|
              [69]\\d|
              7[013]
            )|
            4(?:
              6[03]|
              7[1267]|
              9[0-5]
            )|
            5(?:
              3[0389]|
              4[0489]|
              7[1-47]|
              88|
              9[0-49]
            )|
            6(?:
              2[1-35]|
              5[149]|
              8[067]
            )
          )\\d{4}
        ',
                'geographic' => '
          (?:
            2(?:
              4[0-48]|
              6[0-24]|
              9[0578]
            )|
            3(?:
              1[0-35-9]|
              55|
              [69]\\d|
              7[013]
            )|
            4(?:
              6[03]|
              7[1267]|
              9[0-5]
            )|
            5(?:
              3[0389]|
              4[0489]|
              7[1-47]|
              88|
              9[0-49]
            )|
            6(?:
              2[1-35]|
              5[149]|
              8[067]
            )
          )\\d{4}
        ',
                'mobile' => '
          77200\\d{3}|
          7(?:
            [1-6]\\d|
            7[013-9]
          )\\d{5}
        ',
                'pager' => '',
                'personal_number' => '',
                'specialrate' => '(90\\d{5})',
                'toll_free' => '',
                'voip' => '
          79(?:
            1(?:
              [01]\\d|
              20
            )|
            2[0-2]\\d
          )\\d{3}
        '
              };
my %areanames = ();
$areanames{en}->{26724} = "Francistown";
$areanames{en}->{26726} = "Selebi\-Phikwe";
$areanames{en}->{26729} = "Letlhakane\/Orapa";
$areanames{en}->{267310} = "Gaborone\ \(outer\)";
$areanames{en}->{267312} = "Gaborone";
$areanames{en}->{267313} = "Gaborone";
$areanames{en}->{267315} = "Gaborone";
$areanames{en}->{267316} = "Gaborone";
$areanames{en}->{267317} = "Gaborone";
$areanames{en}->{267318} = "Gaborone";
$areanames{en}->{267319} = "Gaborone";
$areanames{en}->{26735} = "Gaborone";
$areanames{en}->{26736} = "Gaborone";
$areanames{en}->{267370} = "Gaborone";
$areanames{en}->{267371} = "Gaborone";
$areanames{en}->{267390} = "Gaborone";
$areanames{en}->{267391} = "Gaborone";
$areanames{en}->{267392} = "Gaborone";
$areanames{en}->{267393} = "Gaborone";
$areanames{en}->{267394} = "Gaborone";
$areanames{en}->{267395} = "Gaborone";
$areanames{en}->{267397} = "Gaborone";
$areanames{en}->{26746} = "Serowe";
$areanames{en}->{26747} = "Mahalapye";
$areanames{en}->{26749} = "Palapye";
$areanames{en}->{267530} = "Lobatse";
$areanames{en}->{267533} = "Lobatse";
$areanames{en}->{267538} = "Ramotswa";
$areanames{en}->{267539} = "Ramotswa";
$areanames{en}->{26754} = "Barolong\/Ngwaketse";
$areanames{en}->{26757} = "Mochudi";
$areanames{en}->{26758} = "Jwaneng";
$areanames{en}->{26759} = "Molepolole";
$areanames{en}->{26762} = "Kasane";
$areanames{en}->{267651} = "Kgalagadi";
$areanames{en}->{267654} = "Kgalagadi";
$areanames{en}->{267659} = "Gantsi";
$areanames{en}->{26768} = "Maun";

    sub new {
      my $class = shift;
      my $number = shift;
      $number =~ s/(^\+267|\D)//g;
      my $self = bless({ number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class);
        return $self->is_valid() ? $self : undef;
    }
1;