/* eslint-disable */
/** 
 * @license
 * Copyright (C) 2010 The Libphonenumber Authors
 *
 * 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.
 */

/**
 * https://github.com/google/libphonenumber.git
 */

/**
 * A mapping from a country calling code to the region codes which denote the
 * region represented by that country calling code. In the case of multiple
 * countries sharing a calling code, such as the NANPA regions, the one
 * indicated with "isMainCountryForCode" in the metadata should be first.
 * @type {!Object.<number, Array.<string>>}
 */
/**
 * @todo COUNTRIES 与后端数据库保持同步
 */
const GOOGLE_PHONE_CODE_MAP = {
'1':["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"]
,'7':["RU","KZ"]
,'20':["EG"]
,'27':["ZA"]
,'30':["GR"]
,'31':["NL"]
,'32':["BE"]
,'33':["FR"]
,'34':["ES"]
,'36':["HU"]
,'39':["IT","VA"]
,'40':["RO"]
,'41':["CH"]
,'43':["AT"]
,'44':["GB","GG","IM","JE"]
,'45':["DK"]
,'46':["SE"]
,'47':["NO","SJ"]
,'48':["PL"]
,'49':["DE"]
,'51':["PE"]
,'52':["MX"]
,'53':["CU"]
,'54':["AR"]
,'55':["BR"]
,'56':["CL"]
,'57':["CO"]
,'58':["VE"]
,'60':["MY"]
,'61':["AU","CC","CX"]
,'62':["ID"]
,'63':["PH"]
,'64':["NZ"]
,'65':["SG"]
,'66':["TH"]
,'81':["JP"]
,'82':["KR"]
,'84':["VN"]
,'86':["CN"]
,'90':["TR"]
,'91':["IN"]
,'92':["PK"]
,'93':["AF"]
,'94':["LK"]
,'95':["MM"]
,'98':["IR"]
,'211':["SS"]
,'212':["MA","EH"]
,'213':["DZ"]
,'216':["TN"]
,'218':["LY"]
,'220':["GM"]
,'221':["SN"]
,'222':["MR"]
,'223':["ML"]
,'224':["GN"]
,'225':["CI"]
,'226':["BF"]
,'227':["NE"]
,'228':["TG"]
,'229':["BJ"]
,'230':["MU"]
,'231':["LR"]
,'232':["SL"]
,'233':["GH"]
,'234':["NG"]
,'235':["TD"]
,'236':["CF"]
,'237':["CM"]
,'238':["CV"]
,'239':["ST"]
,'240':["GQ"]
,'241':["GA"]
,'242':["CG"]
,'243':["CD"]
,'244':["AO"]
,'245':["GW"]
,'246':["IO"]
,'247':["AC"]
,'248':["SC"]
,'249':["SD"]
,'250':["RW"]
,'251':["ET"]
,'252':["SO"]
,'253':["DJ"]
,'254':["KE"]
,'255':["TZ"]
,'256':["UG"]
,'257':["BI"]
,'258':["MZ"]
,'260':["ZM"]
,'261':["MG"]
,'262':["RE","YT"]
,'263':["ZW"]
,'264':["NA"]
,'265':["MW"]
,'266':["LS"]
,'267':["BW"]
,'268':["SZ"]
,'269':["KM"]
,'290':["SH","TA"]
,'291':["ER"]
,'297':["AW"]
,'298':["FO"]
,'299':["GL"]
,'350':["GI"]
,'351':["PT"]
,'352':["LU"]
,'353':["IE"]
,'354':["IS"]
,'355':["AL"]
,'356':["MT"]
,'357':["CY"]
,'358':["FI","AX"]
,'359':["BG"]
,'370':["LT"]
,'371':["LV"]
,'372':["EE"]
,'373':["MD"]
,'374':["AM"]
,'375':["BY"]
,'376':["AD"]
,'377':["MC"]
,'378':["SM"]
,'380':["UA"]
,'381':["RS"]
,'382':["ME"]
,'383':["XK"]
,'385':["HR"]
,'386':["SI"]
,'387':["BA"]
,'389':["MK"]
,'420':["CZ"]
,'421':["SK"]
,'423':["LI"]
,'500':["FK"]
,'501':["BZ"]
,'502':["GT"]
,'503':["SV"]
,'504':["HN"]
,'505':["NI"]
,'506':["CR"]
,'507':["PA"]
,'508':["PM"]
,'509':["HT"]
,'590':["GP","BL","MF"]
,'591':["BO"]
,'592':["GY"]
,'593':["EC"]
,'594':["GF"]
,'595':["PY"]
,'596':["MQ"]
,'597':["SR"]
,'598':["UY"]
,'599':["CW","BQ"]
,'670':["TL"]
,'672':["NF"]
,'673':["BN"]
,'674':["NR"]
,'675':["PG"]
,'676':["TO"]
,'677':["SB"]
,'678':["VU"]
,'679':["FJ"]
,'680':["PW"]
,'681':["WF"]
,'682':["CK"]
,'683':["NU"]
,'685':["WS"]
,'686':["KI"]
,'687':["NC"]
,'688':["TV"]
,'689':["PF"]
,'690':["TK"]
,'691':["FM"]
,'692':["MH"]
,'800':["001"]
,'808':["001"]
,'850':["KP"]
,'852':["HK"]
,'853':["MO"]
,'855':["KH"]
,'856':["LA"]
,'870':["001"]
,'878':["001"]
,'880':["BD"]
,'881':["001"]
,'882':["001"]
,'883':["001"]
,'886':["TW"]
,'888':["001"]
,'960':["MV"]
,'961':["LB"]
,'962':["JO"]
,'963':["SY"]
,'964':["IQ"]
,'965':["KW"]
,'966':["SA"]
,'967':["YE"]
,'968':["OM"]
,'970':["PS"]
,'971':["AE"]
,'972':["IL"]
,'973':["BH"]
,'974':["QA"]
,'975':["BT"]
,'976':["MN"]
,'977':["NP"]
,'979':["001"]
,'992':["TJ"]
,'993':["TM"]
,'994':["AZ"]
,'995':["GE"]
,'996':["KG"]
,'998':["UZ"]
};
const PHONE_CODE_MAP = [
    {
        "countryCode": "US",
        "phoneCode": "+1"
    },
    {
        "countryCode": "CA",
        "phoneCode": "+1"
    },
    {
        "countryCode": "GB",
        "phoneCode": "+44"
    },
    {
        "countryCode": "FR",
        "phoneCode": "+33"
    },
    {
        "countryCode": "DE",
        "phoneCode": "+49"
    },
    {
        "countryCode": "AU",
        "phoneCode": "+61"
    },
    {
        "countryCode": "IE",
        "phoneCode": "+353"
    },
    {
        "countryCode": "ZA",
        "phoneCode": "+27"
    },
    {
        "countryCode": "AX",
        "phoneCode": "+358-18"
    },
    {
        "countryCode": "AL",
        "phoneCode": "+355"
    },
    {
        "countryCode": "DZ",
        "phoneCode": "+213"
    },
    {
        "countryCode": "AS",
        "phoneCode": "+244"
    },
    {
        "countryCode": "AO",
        "phoneCode": "+244"
    },
    {
        "countryCode": "AI",
        "phoneCode": "+1-264"
    },
    {
        "countryCode": "AQ",
        "phoneCode": "+6721"
    },
    {
        "countryCode": "AG",
        "phoneCode": "+1-268"
    },
    {
        "countryCode": "AR",
        "phoneCode": "+54"
    },
    {
        "countryCode": "AM",
        "phoneCode": "+374"
    },
    {
        "countryCode": "AW",
        "phoneCode": "+297"
    },
    {
        "countryCode": "AT",
        "phoneCode": "+43"
    },
    {
        "countryCode": "AZ",
        "phoneCode": "+374-97"
    },
    {
        "countryCode": "BH",
        "phoneCode": "+973"
    },
    {
        "countryCode": "BD",
        "phoneCode": "+880"
    },
    {
        "countryCode": "BB",
        "phoneCode": "+1-246"
    },
    {
        "countryCode": "BY",
        "phoneCode": "+375"
    },
    {
        "countryCode": "BE",
        "phoneCode": "+32"
    },
    {
        "countryCode": "BZ",
        "phoneCode": "+501"
    },
    {
        "countryCode": "BJ",
        "phoneCode": "+229"
    },
    {
        "countryCode": "BM",
        "phoneCode": "+1-441"
    },
    {
        "countryCode": "BT",
        "phoneCode": "+975"
    },
    {
        "countryCode": "BO",
        "phoneCode": "+591"
    },
    {
        "countryCode": "BA",
        "phoneCode": "+387"
    },
    {
        "countryCode": "BW",
        "phoneCode": "+267"
    },
    {
        "countryCode": "BV",
        "phoneCode": "+47"
    },
    {
        "countryCode": "BR",
        "phoneCode": "+55"
    },
    {
        "countryCode": "IO",
        "phoneCode": "+246"
    },
    {
        "countryCode": "VG",
        "phoneCode": "+1-284"
    },
    {
        "countryCode": "BN",
        "phoneCode": "+673"
    },
    {
        "countryCode": "BG",
        "phoneCode": "+359"
    },
    {
        "countryCode": "BF",
        "phoneCode": "+226"
    },
    {
        "countryCode": "BI",
        "phoneCode": "+257"
    },
    {
        "countryCode": "KH",
        "phoneCode": "+855"
    },
    {
        "countryCode": "CM",
        "phoneCode": "+237"
    },
    {
        "countryCode": "CV",
        "phoneCode": "+238"
    },
    {
        "countryCode": "BQ",
        "phoneCode": "+599"
    },
    {
        "countryCode": "KY",
        "phoneCode": "+1-345"
    },
    {
        "countryCode": "CF",
        "phoneCode": "+236"
    },
    {
        "countryCode": "TD",
        "phoneCode": "+235"
    },
    {
        "countryCode": "CL",
        "phoneCode": "+56"
    },
    {
        "countryCode": "CN",
        "phoneCode": "+86"
    },
    {
        "countryCode": "CX",
        "phoneCode": "+61"
    },
    {
        "countryCode": "CC",
        "phoneCode": "+61"
    },
    {
        "countryCode": "CO",
        "phoneCode": "+57"
    },
    {
        "countryCode": "CG",
        "phoneCode": "+242"
    },
    {
        "countryCode": "CK",
        "phoneCode": "+682"
    },
    {
        "countryCode": "CR",
        "phoneCode": "+506"
    },
    {
        "countryCode": "CI",
        "phoneCode": "+225"
    },
    {
        "countryCode": "HR",
        "phoneCode": "+385"
    },
    {
        "countryCode": "CU",
        "phoneCode": "+53"
    },
    {
        "countryCode": "CY",
        "phoneCode": "+90-392"
    },
    {
        "countryCode": "CZ",
        "phoneCode": "+420"
    },
    {
        "countryCode": "CD",
        "phoneCode": "+243"
    },
    {
        "countryCode": "DK",
        "phoneCode": "+45"
    },
    {
        "countryCode": "DJ",
        "phoneCode": "+253"
    },
    {
        "countryCode": "DM",
        "phoneCode": "+1-767"
    },
    {
        "countryCode": "DO",
        "phoneCode": "+1-809and1-829"
    },
    {
        "countryCode": "EC",
        "phoneCode": "+593"
    },
    {
        "countryCode": "EG",
        "phoneCode": "+20"
    },
    {
        "countryCode": "SV",
        "phoneCode": "+503"
    },
    {
        "countryCode": "GQ",
        "phoneCode": "+240"
    },
    {
        "countryCode": "ER",
        "phoneCode": "+291"
    },
    {
        "countryCode": "EE",
        "phoneCode": "+372"
    },
    {
        "countryCode": "ET",
        "phoneCode": "+251"
    },
    {
        "countryCode": "FK",
        "phoneCode": "+500"
    },
    {
        "countryCode": "FO",
        "phoneCode": "+298"
    },
    {
        "countryCode": "FM",
        "phoneCode": "+691"
    },
    {
        "countryCode": "FJ",
        "phoneCode": "+679"
    },
    {
        "countryCode": "FI",
        "phoneCode": "+358"
    },
    {
        "countryCode": "GF",
        "phoneCode": "+594"
    },
    {
        "countryCode": "PF",
        "phoneCode": "+689"
    },
    {
        "countryCode": "TF",
        "phoneCode": "+33"
    },
    {
        "countryCode": "GA",
        "phoneCode": "+241"
    },
    {
        "countryCode": "GM",
        "phoneCode": "+220"
    },
    {
        "countryCode": "GE",
        "phoneCode": "+995"
    },
    {
        "countryCode": "GH",
        "phoneCode": "+233"
    },
    {
        "countryCode": "GI",
        "phoneCode": "+350"
    },
    {
        "countryCode": "GR",
        "phoneCode": "+30"
    },
    {
        "countryCode": "GL",
        "phoneCode": "+299"
    },
    {
        "countryCode": "GD",
        "phoneCode": "+1-473"
    },
    {
        "countryCode": "GP",
        "phoneCode": "+590"
    },
    {
        "countryCode": "GU",
        "phoneCode": "+1-671"
    },
    {
        "countryCode": "GT",
        "phoneCode": "+502"
    },
    {
        "countryCode": "GG",
        "phoneCode": "+44"
    },
    {
        "countryCode": "GN",
        "phoneCode": "+224"
    },
    {
        "countryCode": "GW",
        "phoneCode": "+245"
    },
    {
        "countryCode": "GY",
        "phoneCode": "+592"
    },
    {
        "countryCode": "HT",
        "phoneCode": "+509"
    },
    {
        "countryCode": "HM",
        "phoneCode": "+672"
    },
    {
        "countryCode": "HN",
        "phoneCode": "+504"
    },
    {
        "countryCode": "HK",
        "phoneCode": "+852"
    },
    {
        "countryCode": "HU",
        "phoneCode": "+36"
    },
    {
        "countryCode": "IS",
        "phoneCode": "+354"
    },
    {
        "countryCode": "IN",
        "phoneCode": "+91"
    },
    {
        "countryCode": "ID",
        "phoneCode": "+62"
    },
    {
        "countryCode": "IR",
        "phoneCode": "+98"
    },
    {
        "countryCode": "IQ",
        "phoneCode": "+964"
    },
    {
        "countryCode": "IM",
        "phoneCode": "+44"
    },
    {
        "countryCode": "IT",
        "phoneCode": "+39"
    },
    {
        "countryCode": "JM",
        "phoneCode": "+1-876"
    },
    {
        "countryCode": "JP",
        "phoneCode": "+81"
    },
    {
        "countryCode": "JE",
        "phoneCode": "+44"
    },
    {
        "countryCode": "JO",
        "phoneCode": "+962"
    },
    {
        "countryCode": "KZ",
        "phoneCode": "+7"
    },
    {
        "countryCode": "KE",
        "phoneCode": "+254"
    },
    {
        "countryCode": "KI",
        "phoneCode": "+686"
    },
    {
        "countryCode": "KW",
        "phoneCode": "+965"
    },
    {
        "countryCode": "KG",
        "phoneCode": "+996"
    },
    {
        "countryCode": "LA",
        "phoneCode": "+856"
    },
    {
        "countryCode": "LV",
        "phoneCode": "+371"
    },
    {
        "countryCode": "LB",
        "phoneCode": "+961"
    },
    {
        "countryCode": "LS",
        "phoneCode": "+266"
    },
    {
        "countryCode": "LR",
        "phoneCode": "+231"
    },
    {
        "countryCode": "LY",
        "phoneCode": "+218"
    },
    {
        "countryCode": "LI",
        "phoneCode": "+423"
    },
    {
        "countryCode": "LT",
        "phoneCode": "+370"
    },
    {
        "countryCode": "LU",
        "phoneCode": "+352"
    },
    {
        "countryCode": "MO",
        "phoneCode": "+853"
    },
    {
        "countryCode": "MG",
        "phoneCode": "+261"
    },
    {
        "countryCode": "MW",
        "phoneCode": "+265"
    },
    {
        "countryCode": "MY",
        "phoneCode": "+60"
    },
    {
        "countryCode": "MV",
        "phoneCode": "+960"
    },
    {
        "countryCode": "ML",
        "phoneCode": "+223"
    },
    {
        "countryCode": "MT",
        "phoneCode": "+356"
    },
    {
        "countryCode": "MH",
        "phoneCode": "+692"
    },
    {
        "countryCode": "MQ",
        "phoneCode": "+596"
    },
    {
        "countryCode": "MR",
        "phoneCode": "+222"
    },
    {
        "countryCode": "MU",
        "phoneCode": "+230"
    },
    {
        "countryCode": "YT",
        "phoneCode": "+262"
    },
    {
        "countryCode": "MX",
        "phoneCode": "+52"
    },
    {
        "countryCode": "MD",
        "phoneCode": "+373-533"
    },
    {
        "countryCode": "MC",
        "phoneCode": "+377"
    },
    {
        "countryCode": "MN",
        "phoneCode": "+976"
    },
    {
        "countryCode": "ME",
        "phoneCode": "+382"
    },
    {
        "countryCode": "MS",
        "phoneCode": "+1-664"
    },
    {
        "countryCode": "MA",
        "phoneCode": "+212"
    },
    {
        "countryCode": "MZ",
        "phoneCode": "+258"
    },
    {
        "countryCode": "MM",
        "phoneCode": "+95"
    },
    {
        "countryCode": "NA",
        "phoneCode": "+264"
    },
    {
        "countryCode": "NR",
        "phoneCode": "+674"
    },
    {
        "countryCode": "NP",
        "phoneCode": "+977"
    },
    {
        "countryCode": "NL",
        "phoneCode": "+31"
    },
    {
        "countryCode": "NC",
        "phoneCode": "+687"
    },
    {
        "countryCode": "NZ",
        "phoneCode": "+64"
    },
    {
        "countryCode": "NI",
        "phoneCode": "+505"
    },
    {
        "countryCode": "NE",
        "phoneCode": "+227"
    },
    {
        "countryCode": "NG",
        "phoneCode": "+234"
    },
    {
        "countryCode": "NU",
        "phoneCode": "+683"
    },
    {
        "countryCode": "NF",
        "phoneCode": "+672"
    },
    {
        "countryCode": "KP",
        "phoneCode": "+850"
    },
    {
        "countryCode": "MP",
        "phoneCode": "+1-670"
    },
    {
        "countryCode": "NO",
        "phoneCode": "+47"
    },
    {
        "countryCode": "OM",
        "phoneCode": "+968"
    },
    {
        "countryCode": "PK",
        "phoneCode": "+92"
    },
    {
        "countryCode": "PW",
        "phoneCode": "+680"
    },
    {
        "countryCode": "PA",
        "phoneCode": "+507"
    },
    {
        "countryCode": "PG",
        "phoneCode": "+675"
    },
    {
        "countryCode": "PY",
        "phoneCode": "+595"
    },
    {
        "countryCode": "PE",
        "phoneCode": "+51"
    },
    {
        "countryCode": "PN",
        "phoneCode": "+649"
    },
    {
        "countryCode": "PL",
        "phoneCode": "+48"
    },
    {
        "countryCode": "PT",
        "phoneCode": "+351"
    },
    {
        "countryCode": "PR",
        "phoneCode": "+1-787"
    },
    {
        "countryCode": "QA",
        "phoneCode": "+974"
    },
    {
        "countryCode": "MK",
        "phoneCode": "+389"
    },
    {
        "countryCode": "RE",
        "phoneCode": "+262"
    },
    {
        "countryCode": "RO",
        "phoneCode": "+40"
    },
    {
        "countryCode": "RU",
        "phoneCode": "+7"
    },
    {
        "countryCode": "RW",
        "phoneCode": "+250"
    },
    {
        "countryCode": "BL",
        "phoneCode": "+590"
    },
    {
        "countryCode": "MF",
        "phoneCode": "+590"
    },
    {
        "countryCode": "PM",
        "phoneCode": "+508"
    },
    {
        "countryCode": "WS",
        "phoneCode": "+685"
    },
    {
        "countryCode": "SM",
        "phoneCode": "+378"
    },
    {
        "countryCode": "ST",
        "phoneCode": "+239"
    },
    {
        "countryCode": "SA",
        "phoneCode": "+966"
    },
    {
        "countryCode": "SN",
        "phoneCode": "+221"
    },
    {
        "countryCode": "RS",
        "phoneCode": "+381"
    },
    {
        "countryCode": "SC",
        "phoneCode": "+248"
    },
    {
        "countryCode": "SL",
        "phoneCode": "+232"
    },
    {
        "countryCode": "SG",
        "phoneCode": "+65"
    },
    {
        "countryCode": "SK",
        "phoneCode": "+421"
    },
    {
        "countryCode": "SI",
        "phoneCode": "+386"
    },
    {
        "countryCode": "SB",
        "phoneCode": "+677"
    },
    {
        "countryCode": "SO",
        "phoneCode": "+252"
    },
    {
        "countryCode": "GS",
        "phoneCode": "+500"
    },
    {
        "countryCode": "KR",
        "phoneCode": "+82"
    },
    {
        "countryCode": "SS",
        "phoneCode": "+211"
    },
    {
        "countryCode": "ES",
        "phoneCode": "+34"
    },
    {
        "countryCode": "LK",
        "phoneCode": "+94"
    },
    {
        "countryCode": "SH",
        "phoneCode": "+290"
    },
    {
        "countryCode": "KN",
        "phoneCode": "+1-869"
    },
    {
        "countryCode": "LC",
        "phoneCode": "+1-758"
    },
    {
        "countryCode": "VC",
        "phoneCode": "+1-784"
    },
    {
        "countryCode": "SD",
        "phoneCode": "+249"
    },
    {
        "countryCode": "SR",
        "phoneCode": "+597"
    },
    {
        "countryCode": "SZ",
        "phoneCode": "+268"
    },
    {
        "countryCode": "SE",
        "phoneCode": "+46"
    },
    {
        "countryCode": "SY",
        "phoneCode": "+963"
    },
    {
        "countryCode": "TJ",
        "phoneCode": "+992"
    },
    {
        "countryCode": "TZ",
        "phoneCode": "+255"
    },
    {
        "countryCode": "SJ",
        "phoneCode": "+47"
    },
    {
        "countryCode": "TH",
        "phoneCode": "+66"
    },
    {
        "countryCode": "BS",
        "phoneCode": "+1-242"
    },
    {
        "countryCode": "KM",
        "phoneCode": "+269"
    },
    {
        "countryCode": "PH",
        "phoneCode": "+63"
    },
    {
        "countryCode": "TL",
        "phoneCode": "+670"
    },
    {
        "countryCode": "TG",
        "phoneCode": "+228"
    },
    {
        "countryCode": "TK",
        "phoneCode": "+690"
    },
    {
        "countryCode": "TO",
        "phoneCode": "+676"
    },
    {
        "countryCode": "TT",
        "phoneCode": "+1-868"
    },
    {
        "countryCode": "TN",
        "phoneCode": "+216"
    },
    {
        "countryCode": "TR",
        "phoneCode": "+90"
    },
    {
        "countryCode": "TM",
        "phoneCode": "+993"
    },
    {
        "countryCode": "TC",
        "phoneCode": "+1-649"
    },
    {
        "countryCode": "TV",
        "phoneCode": "+688"
    },
    {
        "countryCode": "UG",
        "phoneCode": "+256"
    },
    {
        "countryCode": "UA",
        "phoneCode": "+380"
    },
    {
        "countryCode": "AE",
        "phoneCode": "+971"
    },
    {
        "countryCode": "UM",
        "phoneCode": "+268"
    },
    {
        "countryCode": "VI",
        "phoneCode": "+1-340"
    },
    {
        "countryCode": "UY",
        "phoneCode": "+598"
    },
    {
        "countryCode": "UZ",
        "phoneCode": "+998"
    },
    {
        "countryCode": "VU",
        "phoneCode": "+678"
    },
    {
        "countryCode": "VA",
        "phoneCode": "+379"
    },
    {
        "countryCode": "VE",
        "phoneCode": "+58"
    },
    {
        "countryCode": "VN",
        "phoneCode": "+84"
    },
    {
        "countryCode": "WF",
        "phoneCode": "+681"
    },
    {
        "countryCode": "EH",
        "phoneCode": "+212"
    },
    {
        "countryCode": "YE",
        "phoneCode": "+967"
    },
    {
        "countryCode": "ZM",
        "phoneCode": "+260"
    },
    {
        "countryCode": "ZW",
        "phoneCode": "+263"
    }
];

const COUNTRIES =[
    {
        "id": 1,
        "code": "AF",
        "name": "Afghanistan"
    },
    {
        "id": 2,
        "code": "AX",
        "name": "Åland Islands"
    },
    {
        "id": 3,
        "code": "AL",
        "name": "Albania"
    },
    {
        "id": 4,
        "code": "DZ",
        "name": "Algeria"
    },
    {
        "id": 5,
        "code": "AS",
        "name": "American Samoa"
    },
    {
        "id": 6,
        "code": "AD",
        "name": "Andorra"
    },
    {
        "id": 7,
        "code": "AO",
        "name": "Angola"
    },
    {
        "id": 8,
        "code": "AI",
        "name": "Anguilla"
    },
    {
        "id": 9,
        "code": "AQ",
        "name": "Antarctica"
    },
    {
        "id": 10,
        "code": "AG",
        "name": "Antigua & Barbuda"
    },
    {
        "id": 11,
        "code": "AR",
        "name": "Argentina"
    },
    {
        "id": 12,
        "code": "AM",
        "name": "Armenia"
    },
    {
        "id": 13,
        "code": "AW",
        "name": "Aruba"
    },
    {
        "id": 14,
        "code": "AC",
        "name": "Ascension Island"
    },
    {
        "id": 15,
        "code": "AU",
        "name": "Australia"
    },
    {
        "id": 16,
        "code": "AT",
        "name": "Austria"
    },
    {
        "id": 17,
        "code": "AZ",
        "name": "Azerbaijan"
    },
    {
        "id": 18,
        "code": "BS",
        "name": "Bahamas"
    },
    {
        "id": 19,
        "code": "BH",
        "name": "Bahrain"
    },
    {
        "id": 20,
        "code": "BD",
        "name": "Bangladesh"
    },
    {
        "id": 21,
        "code": "BB",
        "name": "Barbados"
    },
    {
        "id": 22,
        "code": "BY",
        "name": "Belarus"
    },
    {
        "id": 23,
        "code": "BE",
        "name": "Belgium"
    },
    {
        "id": 24,
        "code": "BZ",
        "name": "Belize"
    },
    {
        "id": 25,
        "code": "BJ",
        "name": "Benin"
    },
    {
        "id": 26,
        "code": "BM",
        "name": "Bermuda"
    },
    {
        "id": 27,
        "code": "BT",
        "name": "Bhutan"
    },
    {
        "id": 28,
        "code": "BO",
        "name": "Bolivia"
    },
    {
        "id": 29,
        "code": "BA",
        "name": "Bosnia & Herzegovina"
    },
    {
        "id": 30,
        "code": "BW",
        "name": "Botswana"
    },
    {
        "id": 31,
        "code": "BR",
        "name": "Brazil"
    },
    {
        "id": 32,
        "code": "IO",
        "name": "British Indian Ocean Territory"
    },
    {
        "id": 33,
        "code": "VG",
        "name": "British Virgin Islands"
    },
    {
        "id": 34,
        "code": "BN",
        "name": "Brunei"
    },
    {
        "id": 35,
        "code": "BG",
        "name": "Bulgaria"
    },
    {
        "id": 36,
        "code": "BF",
        "name": "Burkina Faso"
    },
    {
        "id": 37,
        "code": "BI",
        "name": "Burundi"
    },
    {
        "id": 38,
        "code": "KH",
        "name": "Cambodia"
    },
    {
        "id": 39,
        "code": "CM",
        "name": "Cameroon"
    },
    {
        "id": 40,
        "code": "CA",
        "name": "Canada"
    },
    {
        "id": 41,
        "code": "IC",
        "name": "Canary Islands"
    },
    {
        "id": 42,
        "code": "CV",
        "name": "Cape Verde"
    },
    {
        "id": 43,
        "code": "BQ",
        "name": "Caribbean Netherlands"
    },
    {
        "id": 44,
        "code": "KY",
        "name": "Cayman Islands"
    },
    {
        "id": 45,
        "code": "CF",
        "name": "Central African Republic"
    },
    {
        "id": 46,
        "code": "EA",
        "name": "Ceuta & Melilla"
    },
    {
        "id": 47,
        "code": "TD",
        "name": "Chad"
    },
    {
        "id": 48,
        "code": "CL",
        "name": "Chile"
    },
    {
        "id": 49,
        "code": "CN",
        "name": "China"
    },
    {
        "id": 50,
        "code": "CX",
        "name": "Christmas Island"
    },
    {
        "id": 51,
        "code": "CC",
        "name": "Cocos (Keeling) Islands"
    },
    {
        "id": 52,
        "code": "CO",
        "name": "Colombia"
    },
    {
        "id": 53,
        "code": "KM",
        "name": "Comoros"
    },
    {
        "id": 54,
        "code": "CG",
        "name": "Congo - Brazzaville"
    },
    {
        "id": 55,
        "code": "CD",
        "name": "Congo - Kinshasa"
    },
    {
        "id": 56,
        "code": "CK",
        "name": "Cook Islands"
    },
    {
        "id": 57,
        "code": "CR",
        "name": "Costa Rica"
    },
    {
        "id": 58,
        "code": "CI",
        "name": "Côte d’Ivoire"
    },
    {
        "id": 59,
        "code": "HR",
        "name": "Croatia"
    },
    {
        "id": 60,
        "code": "CU",
        "name": "Cuba"
    },
    {
        "id": 61,
        "code": "CW",
        "name": "Curaçao"
    },
    {
        "id": 62,
        "code": "CY",
        "name": "Cyprus"
    },
    {
        "id": 63,
        "code": "CZ",
        "name": "Czechia"
    },
    {
        "id": 64,
        "code": "DK",
        "name": "Denmark"
    },
    {
        "id": 65,
        "code": "DG",
        "name": "Diego Garcia"
    },
    {
        "id": 66,
        "code": "DJ",
        "name": "Djibouti"
    },
    {
        "id": 67,
        "code": "DM",
        "name": "Dominica"
    },
    {
        "id": 68,
        "code": "DO",
        "name": "Dominican Republic"
    },
    {
        "id": 69,
        "code": "EC",
        "name": "Ecuador"
    },
    {
        "id": 70,
        "code": "EG",
        "name": "Egypt"
    },
    {
        "id": 71,
        "code": "SV",
        "name": "El Salvador"
    },
    {
        "id": 72,
        "code": "GQ",
        "name": "Equatorial Guinea"
    },
    {
        "id": 73,
        "code": "ER",
        "name": "Eritrea"
    },
    {
        "id": 74,
        "code": "EE",
        "name": "Estonia"
    },
    {
        "id": 75,
        "code": "ET",
        "name": "Ethiopia"
    },
    {
        "id": 76,
        "code": "EZ",
        "name": "Eurozone"
    },
    {
        "id": 77,
        "code": "FK",
        "name": "Falkland Islands"
    },
    {
        "id": 78,
        "code": "FO",
        "name": "Faroe Islands"
    },
    {
        "id": 79,
        "code": "FJ",
        "name": "Fiji"
    },
    {
        "id": 80,
        "code": "FI",
        "name": "Finland"
    },
    {
        "id": 81,
        "code": "FR",
        "name": "France"
    },
    {
        "id": 82,
        "code": "GF",
        "name": "French Guiana"
    },
    {
        "id": 83,
        "code": "PF",
        "name": "French Polynesia"
    },
    {
        "id": 84,
        "code": "TF",
        "name": "French Southern Territories"
    },
    {
        "id": 85,
        "code": "GA",
        "name": "Gabon"
    },
    {
        "id": 86,
        "code": "GM",
        "name": "Gambia"
    },
    {
        "id": 87,
        "code": "GE",
        "name": "Georgia"
    },
    {
        "id": 88,
        "code": "DE",
        "name": "Germany"
    },
    {
        "id": 89,
        "code": "GH",
        "name": "Ghana"
    },
    {
        "id": 90,
        "code": "GI",
        "name": "Gibraltar"
    },
    {
        "id": 91,
        "code": "GR",
        "name": "Greece"
    },
    {
        "id": 92,
        "code": "GL",
        "name": "Greenland"
    },
    {
        "id": 93,
        "code": "GD",
        "name": "Grenada"
    },
    {
        "id": 94,
        "code": "GP",
        "name": "Guadeloupe"
    },
    {
        "id": 95,
        "code": "GU",
        "name": "Guam"
    },
    {
        "id": 96,
        "code": "GT",
        "name": "Guatemala"
    },
    {
        "id": 97,
        "code": "GG",
        "name": "Guernsey"
    },
    {
        "id": 98,
        "code": "GN",
        "name": "Guinea"
    },
    {
        "id": 99,
        "code": "GW",
        "name": "Guinea-Bissau"
    },
    {
        "id": 100,
        "code": "GY",
        "name": "Guyana"
    },
    {
        "id": 101,
        "code": "HT",
        "name": "Haiti"
    },
    {
        "id": 102,
        "code": "HN",
        "name": "Honduras"
    },
    {
        "id": 103,
        "code": "HK",
        "name": "Hong Kong SAR China"
    },
    {
        "id": 104,
        "code": "HU",
        "name": "Hungary"
    },
    {
        "id": 105,
        "code": "IS",
        "name": "Iceland"
    },
    {
        "id": 106,
        "code": "IN",
        "name": "India"
    },
    {
        "id": 107,
        "code": "ID",
        "name": "Indonesia"
    },
    {
        "id": 108,
        "code": "IR",
        "name": "Iran"
    },
    {
        "id": 109,
        "code": "IQ",
        "name": "Iraq"
    },
    {
        "id": 110,
        "code": "IE",
        "name": "Ireland"
    },
    {
        "id": 111,
        "code": "IM",
        "name": "Isle of Man"
    },
    {
        "id": 112,
        "code": "IL",
        "name": "Israel"
    },
    {
        "id": 113,
        "code": "IT",
        "name": "Italy"
    },
    {
        "id": 114,
        "code": "JM",
        "name": "Jamaica"
    },
    {
        "id": 115,
        "code": "JP",
        "name": "Japan"
    },
    {
        "id": 116,
        "code": "JE",
        "name": "Jersey"
    },
    {
        "id": 117,
        "code": "JO",
        "name": "Jordan"
    },
    {
        "id": 118,
        "code": "KZ",
        "name": "Kazakhstan"
    },
    {
        "id": 119,
        "code": "KE",
        "name": "Kenya"
    },
    {
        "id": 120,
        "code": "KI",
        "name": "Kiribati"
    },
    {
        "id": 121,
        "code": "XK",
        "name": "Kosovo"
    },
    {
        "id": 122,
        "code": "KW",
        "name": "Kuwait"
    },
    {
        "id": 123,
        "code": "KG",
        "name": "Kyrgyzstan"
    },
    {
        "id": 124,
        "code": "LA",
        "name": "Laos"
    },
    {
        "id": 125,
        "code": "LV",
        "name": "Latvia"
    },
    {
        "id": 126,
        "code": "LB",
        "name": "Lebanon"
    },
    {
        "id": 127,
        "code": "LS",
        "name": "Lesotho"
    },
    {
        "id": 128,
        "code": "LR",
        "name": "Liberia"
    },
    {
        "id": 129,
        "code": "LY",
        "name": "Libya"
    },
    {
        "id": 130,
        "code": "LI",
        "name": "Liechtenstein"
    },
    {
        "id": 131,
        "code": "LT",
        "name": "Lithuania"
    },
    {
        "id": 132,
        "code": "LU",
        "name": "Luxembourg"
    },
    {
        "id": 133,
        "code": "MO",
        "name": "Macau SAR China"
    },
    {
        "id": 134,
        "code": "MK",
        "name": "Macedonia"
    },
    {
        "id": 135,
        "code": "MG",
        "name": "Madagascar"
    },
    {
        "id": 136,
        "code": "MW",
        "name": "Malawi"
    },
    {
        "id": 137,
        "code": "MY",
        "name": "Malaysia"
    },
    {
        "id": 138,
        "code": "MV",
        "name": "Maldives"
    },
    {
        "id": 139,
        "code": "ML",
        "name": "Mali"
    },
    {
        "id": 140,
        "code": "MT",
        "name": "Malta"
    },
    {
        "id": 141,
        "code": "MH",
        "name": "Marshall Islands"
    },
    {
        "id": 142,
        "code": "MQ",
        "name": "Martinique"
    },
    {
        "id": 143,
        "code": "MR",
        "name": "Mauritania"
    },
    {
        "id": 144,
        "code": "MU",
        "name": "Mauritius"
    },
    {
        "id": 145,
        "code": "YT",
        "name": "Mayotte"
    },
    {
        "id": 146,
        "code": "MX",
        "name": "Mexico"
    },
    {
        "id": 147,
        "code": "FM",
        "name": "Micronesia"
    },
    {
        "id": 148,
        "code": "MD",
        "name": "Moldova"
    },
    {
        "id": 149,
        "code": "MC",
        "name": "Monaco"
    },
    {
        "id": 150,
        "code": "MN",
        "name": "Mongolia"
    },
    {
        "id": 151,
        "code": "ME",
        "name": "Montenegro"
    },
    {
        "id": 152,
        "code": "MS",
        "name": "Montserrat"
    },
    {
        "id": 153,
        "code": "MA",
        "name": "Morocco"
    },
    {
        "id": 154,
        "code": "MZ",
        "name": "Mozambique"
    },
    {
        "id": 155,
        "code": "MM",
        "name": "Myanmar (Burma)"
    },
    {
        "id": 156,
        "code": "NA",
        "name": "Namibia"
    },
    {
        "id": 157,
        "code": "NR",
        "name": "Nauru"
    },
    {
        "id": 158,
        "code": "NP",
        "name": "Nepal"
    },
    {
        "id": 159,
        "code": "NL",
        "name": "Netherlands"
    },
    {
        "id": 160,
        "code": "NC",
        "name": "New Caledonia"
    },
    {
        "id": 161,
        "code": "NZ",
        "name": "New Zealand"
    },
    {
        "id": 162,
        "code": "NI",
        "name": "Nicaragua"
    },
    {
        "id": 163,
        "code": "NE",
        "name": "Niger"
    },
    {
        "id": 164,
        "code": "NG",
        "name": "Nigeria"
    },
    {
        "id": 165,
        "code": "NU",
        "name": "Niue"
    },
    {
        "id": 166,
        "code": "NF",
        "name": "Norfolk Island"
    },
    {
        "id": 167,
        "code": "KP",
        "name": "North Korea"
    },
    {
        "id": 168,
        "code": "MP",
        "name": "Northern Mariana Islands"
    },
    {
        "id": 169,
        "code": "NO",
        "name": "Norway"
    },
    {
        "id": 170,
        "code": "OM",
        "name": "Oman"
    },
    {
        "id": 171,
        "code": "PK",
        "name": "Pakistan"
    },
    {
        "id": 172,
        "code": "PW",
        "name": "Palau"
    },
    {
        "id": 173,
        "code": "PS",
        "name": "Palestinian Territories"
    },
    {
        "id": 174,
        "code": "PA",
        "name": "Panama"
    },
    {
        "id": 175,
        "code": "PG",
        "name": "Papua New Guinea"
    },
    {
        "id": 176,
        "code": "PY",
        "name": "Paraguay"
    },
    {
        "id": 177,
        "code": "PE",
        "name": "Peru"
    },
    {
        "id": 178,
        "code": "PH",
        "name": "Philippines"
    },
    {
        "id": 179,
        "code": "PN",
        "name": "Pitcairn Islands"
    },
    {
        "id": 180,
        "code": "PL",
        "name": "Poland"
    },
    {
        "id": 181,
        "code": "PT",
        "name": "Portugal"
    },
    {
        "id": 182,
        "code": "PR",
        "name": "Puerto Rico"
    },
    {
        "id": 183,
        "code": "QA",
        "name": "Qatar"
    },
    {
        "id": 184,
        "code": "RE",
        "name": "Réunion"
    },
    {
        "id": 185,
        "code": "RO",
        "name": "Romania"
    },
    {
        "id": 186,
        "code": "RU",
        "name": "Russia"
    },
    {
        "id": 187,
        "code": "RW",
        "name": "Rwanda"
    },
    {
        "id": 188,
        "code": "WS",
        "name": "Samoa"
    },
    {
        "id": 189,
        "code": "SM",
        "name": "San Marino"
    },
    {
        "id": 190,
        "code": "ST",
        "name": "São Tomé & Príncipe"
    },
    {
        "id": 191,
        "code": "SA",
        "name": "Saudi Arabia"
    },
    {
        "id": 192,
        "code": "SN",
        "name": "Senegal"
    },
    {
        "id": 193,
        "code": "RS",
        "name": "Serbia"
    },
    {
        "id": 194,
        "code": "SC",
        "name": "Seychelles"
    },
    {
        "id": 195,
        "code": "SL",
        "name": "Sierra Leone"
    },
    {
        "id": 196,
        "code": "SG",
        "name": "Singapore"
    },
    {
        "id": 197,
        "code": "SX",
        "name": "Sint Maarten"
    },
    {
        "id": 198,
        "code": "SK",
        "name": "Slovakia"
    },
    {
        "id": 199,
        "code": "SI",
        "name": "Slovenia"
    },
    {
        "id": 200,
        "code": "SB",
        "name": "Solomon Islands"
    },
    {
        "id": 201,
        "code": "SO",
        "name": "Somalia"
    },
    {
        "id": 202,
        "code": "ZA",
        "name": "South Africa"
    },
    {
        "id": 203,
        "code": "GS",
        "name": "South Georgia & South Sandwich Islands"
    },
    {
        "id": 204,
        "code": "KR",
        "name": "South Korea"
    },
    {
        "id": 205,
        "code": "SS",
        "name": "South Sudan"
    },
    {
        "id": 206,
        "code": "ES",
        "name": "Spain"
    },
    {
        "id": 207,
        "code": "LK",
        "name": "Sri Lanka"
    },
    {
        "id": 208,
        "code": "BL",
        "name": "St. Barthélemy"
    },
    {
        "id": 209,
        "code": "SH",
        "name": "St. Helena"
    },
    {
        "id": 210,
        "code": "KN",
        "name": "St. Kitts & Nevis"
    },
    {
        "id": 211,
        "code": "LC",
        "name": "St. Lucia"
    },
    {
        "id": 212,
        "code": "MF",
        "name": "St. Martin"
    },
    {
        "id": 213,
        "code": "PM",
        "name": "St. Pierre & Miquelon"
    },
    {
        "id": 214,
        "code": "VC",
        "name": "St. Vincent & Grenadines"
    },
    {
        "id": 215,
        "code": "SD",
        "name": "Sudan"
    },
    {
        "id": 216,
        "code": "SR",
        "name": "Suriname"
    },
    {
        "id": 217,
        "code": "SJ",
        "name": "Svalbard & Jan Mayen"
    },
    {
        "id": 218,
        "code": "SZ",
        "name": "Swaziland"
    },
    {
        "id": 219,
        "code": "SE",
        "name": "Sweden"
    },
    {
        "id": 220,
        "code": "CH",
        "name": "Switzerland"
    },
    {
        "id": 221,
        "code": "SY",
        "name": "Syria"
    },
    {
        "id": 222,
        "code": "TW",
        "name": "Taiwan"
    },
    {
        "id": 223,
        "code": "TJ",
        "name": "Tajikistan"
    },
    {
        "id": 224,
        "code": "TZ",
        "name": "Tanzania"
    },
    {
        "id": 225,
        "code": "TH",
        "name": "Thailand"
    },
    {
        "id": 226,
        "code": "TL",
        "name": "Timor-Leste"
    },
    {
        "id": 227,
        "code": "TG",
        "name": "Togo"
    },
    {
        "id": 228,
        "code": "TK",
        "name": "Tokelau"
    },
    {
        "id": 229,
        "code": "TO",
        "name": "Tonga"
    },
    {
        "id": 230,
        "code": "TT",
        "name": "Trinidad & Tobago"
    },
    {
        "id": 231,
        "code": "TA",
        "name": "Tristan da Cunha"
    },
    {
        "id": 232,
        "code": "TN",
        "name": "Tunisia"
    },
    {
        "id": 233,
        "code": "TR",
        "name": "Turkey"
    },
    {
        "id": 234,
        "code": "TM",
        "name": "Turkmenistan"
    },
    {
        "id": 235,
        "code": "TC",
        "name": "Turks & Caicos Islands"
    },
    {
        "id": 236,
        "code": "TV",
        "name": "Tuvalu"
    },
    {
        "id": 237,
        "code": "UM",
        "name": "U.S. Outlying Islands"
    },
    {
        "id": 238,
        "code": "VI",
        "name": "U.S. Virgin Islands"
    },
    {
        "id": 239,
        "code": "UG",
        "name": "Uganda"
    },
    {
        "id": 240,
        "code": "UA",
        "name": "Ukraine"
    },
    {
        "id": 241,
        "code": "AE",
        "name": "United Arab Emirates"
    },
    {
        "id": 242,
        "code": "GB",
        "name": "United Kingdom"
    },
    {
        "id": 244,
        "code": "US",
        "name": "United States"
    },
    {
        "id": 245,
        "code": "UY",
        "name": "Uruguay"
    },
    {
        "id": 246,
        "code": "UZ",
        "name": "Uzbekistan"
    },
    {
        "id": 247,
        "code": "VU",
        "name": "Vanuatu"
    },
    {
        "id": 248,
        "code": "VA",
        "name": "Vatican City"
    },
    {
        "id": 249,
        "code": "VE",
        "name": "Venezuela"
    },
    {
        "id": 250,
        "code": "VN",
        "name": "Vietnam"
    },
    {
        "id": 251,
        "code": "WF",
        "name": "Wallis & Futuna"
    },
    {
        "id": 252,
        "code": "EH",
        "name": "Western Sahara"
    },
    {
        "id": 253,
        "code": "YE",
        "name": "Yemen"
    },
    {
        "id": 254,
        "code": "ZM",
        "name": "Zambia"
    },
    {
        "id": 255,
        "code": "ZW",
        "name": "Zimbabwe"
    }
];

function getCountryByCode(code: string) {
    return COUNTRIES.find((country) => country.code === code);
}
function generateGooglePhoneCodeMap() {
    const res = [];
    for( let i = 0; i < COUNTRIES.length; i++) {
        const country = COUNTRIES[i];
        for (const code of Object.keys(GOOGLE_PHONE_CODE_MAP) as (keyof typeof GOOGLE_PHONE_CODE_MAP)[]) {
            const countryCodes = GOOGLE_PHONE_CODE_MAP[code];
            if(countryCodes.indexOf(country.code) >= 0) {
                res.push({
                    ...country,
                    phoneCode: code
                });
            }
        }

    }

    return res;

}


function generatePhoneCodeMap() {
    const res: Array<{
        "id": number,
        "code": string,
        "name": string,
        "phoneCode": string
    }> = [];
    for( let i = 0; i < COUNTRIES.length; i++) {
        const country = COUNTRIES[i];
        PHONE_CODE_MAP.forEach((item) => {
            if(item.countryCode === country.code) {
                res.push({
                    ...country,
                    phoneCode: item.phoneCode,
                });
            }
        });
    }

    return res;
}