intl-tel-input
Version:
A JavaScript plugin for entering and validating international telephone numbers
16 lines (14 loc) • 291 kB
JavaScript
/*
* International Telephone Input v23.1.1
* https://github.com/jackocnr/intl-tel-input.git
* Licensed under the MIT license
*/
// UMD
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory();
} else {
window.intlTelInput = factory();
}
}(() => {
var factoryOutput=(()=>{var m1=Object.defineProperty;var D2=Object.getOwnPropertyDescriptor;var x2=Object.getOwnPropertyNames;var P2=Object.prototype.hasOwnProperty;var k2=(C,$)=>{for(var n in $)m1(C,n,{get:$[n],enumerable:!0})},R2=(C,$,n,r)=>{if($&&typeof $=="object"||typeof $=="function")for(let u of x2($))!P2.call(C,u)&&u!==n&&m1(C,u,{get:()=>$[u],enumerable:!(r=D2($,u))||r.enumerable});return C};var O2=C=>R2(m1({},"__esModule",{value:!0}),C);var j2={};k2(j2,{default:()=>F2});var $2=[["af","93"],["al","355"],["dz","213"],["as","1",5,["684"]],["ad","376"],["ao","244"],["ai","1",6,["264"]],["ag","1",7,["268"]],["ar","54"],["am","374"],["aw","297"],["ac","247"],["au","61",0],["at","43"],["az","994"],["bs","1",8,["242"]],["bh","973"],["bd","880"],["bb","1",9,["246"]],["by","375"],["be","32"],["bz","501"],["bj","229"],["bm","1",10,["441"]],["bt","975"],["bo","591"],["ba","387"],["bw","267"],["br","55"],["io","246"],["vg","1",11,["284"]],["bn","673"],["bg","359"],["bf","226"],["bi","257"],["kh","855"],["cm","237"],["ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","879","902","905"]],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"]],["cf","236"],["td","235"],["cl","56"],["cn","86"],["cx","61",2,["89164"]],["cc","61",1,["89162"]],["co","57"],["km","269"],["cg","242"],["cd","243"],["ck","682"],["cr","506"],["ci","225"],["hr","385"],["cu","53"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"]],["do","1",2,["809","829","849"]],["ec","593"],["eg","20"],["sv","503"],["gq","240"],["er","291"],["ee","372"],["sz","268"],["et","251"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0],["fr","33"],["gf","594"],["pf","689"],["ga","241"],["gm","220"],["ge","995"],["de","49"],["gh","233"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"]],["gp","590",0],["gu","1",15,["671"]],["gt","502"],["gg","44",1,["1481","7781","7839","7911"]],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36"],["is","354"],["in","91"],["id","62"],["ir","98"],["iq","964"],["ie","353"],["im","44",2,["1624","74576","7524","7924","7624"]],["il","972"],["it","39",0],["jm","1",4,["876","658"]],["jp","81"],["je","44",3,["1534","7509","7700","7797","7829","7937"]],["jo","962"],["kz","7",1,["33","7"]],["ke","254"],["ki","686"],["xk","383"],["kw","965"],["kg","996"],["la","856"],["lv","371"],["lb","961"],["ls","266"],["lr","231"],["ly","218"],["li","423"],["lt","370"],["lu","352"],["mo","853"],["mg","261"],["mw","265"],["my","60"],["mv","960"],["ml","223"],["mt","356"],["mh","692"],["mq","596"],["mr","222"],["mu","230"],["yt","262",1,["269","639"]],["mx","52"],["fm","691"],["md","373"],["mc","377"],["mn","976"],["me","382"],["ms","1",16,["664"]],["ma","212",0],["mz","258"],["mm","95"],["na","264"],["nr","674"],["np","977"],["nl","31"],["nc","687"],["nz","64"],["ni","505"],["ne","227"],["ng","234"],["nu","683"],["nf","672"],["kp","850"],["mk","389"],["mp","1",17,["670"]],["no","47",0],["om","968"],["pk","92"],["pw","680"],["ps","970"],["pa","507"],["pg","675"],["py","595"],["pe","51"],["ph","63"],["pl","48"],["pt","351"],["pr","1",3,["787","939"]],["qa","974"],["re","262",0],["ro","40"],["ru","7",0],["rw","250"],["ws","685"],["sm","378"],["st","239"],["sa","966"],["sn","221"],["rs","381"],["sc","248"],["sl","232"],["sg","65"],["sx","1",21,["721"]],["sk","421"],["si","386"],["sb","677"],["so","252"],["za","27"],["kr","82"],["ss","211"],["es","34"],["lk","94"],["bl","590",1],["sh","290"],["kn","1",18,["869"]],["lc","1",19,["758"]],["mf","590",2],["pm","508"],["vc","1",20,["784"]],["sd","249"],["sr","597"],["sj","47",1,["79"]],["se","46"],["ch","41"],["sy","963"],["tw","886"],["tj","992"],["tz","255"],["th","66"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"]],["tn","216"],["tr","90"],["tm","993"],["tc","1",23,["649"]],["tv","688"],["ug","256"],["ua","380"],["ae","971"],["gb","44",0],["us","1",0],["uy","598"],["vi","1",24,["340"]],["uz","998"],["vu","678"],["va","39",1,["06698"]],["ve","58"],["vn","84"],["wf","681"],["eh","212",1,["5288","5289"]],["ye","967"],["zm","260"],["zw","263"],["ax","358",1,["18"]]],n2=[];for(let C=0;C<$2.length;C++){let $=$2[C];n2[C]={name:"",iso2:$[0],dialCode:$[1],priority:$[2]||0,areaCodes:$[3]||null,nodeById:{}}}var K=n2;var i2={ad:"Andorra",ae:"United Arab Emirates",af:"Afghanistan",ag:"Antigua & Barbuda",ai:"Anguilla",al:"Albania",am:"Armenia",ao:"Angola",aq:"Antarctica",ar:"Argentina",as:"American Samoa",at:"Austria",au:"Australia",aw:"Aruba",ax:"\xC5land Islands",az:"Azerbaijan",ba:"Bosnia & Herzegovina",bb:"Barbados",bd:"Bangladesh",be:"Belgium",bf:"Burkina Faso",bg:"Bulgaria",bh:"Bahrain",bi:"Burundi",bj:"Benin",bl:"St. Barth\xE9lemy",bm:"Bermuda",bn:"Brunei",bo:"Bolivia",bq:"Caribbean Netherlands",br:"Brazil",bs:"Bahamas",bt:"Bhutan",bv:"Bouvet Island",bw:"Botswana",by:"Belarus",bz:"Belize",ca:"Canada",cc:"Cocos (Keeling) Islands",cd:"Congo - Kinshasa",cf:"Central African Republic",cg:"Congo - Brazzaville",ch:"Switzerland",ci:"C\xF4te d\u2019Ivoire",ck:"Cook Islands",cl:"Chile",cm:"Cameroon",cn:"China",co:"Colombia",cr:"Costa Rica",cu:"Cuba",cv:"Cape Verde",cw:"Cura\xE7ao",cx:"Christmas Island",cy:"Cyprus",cz:"Czechia",de:"Germany",dj:"Djibouti",dk:"Denmark",dm:"Dominica",do:"Dominican Republic",dz:"Algeria",ec:"Ecuador",ee:"Estonia",eg:"Egypt",eh:"Western Sahara",er:"Eritrea",es:"Spain",et:"Ethiopia",fi:"Finland",fj:"Fiji",fk:"Falkland Islands",fm:"Micronesia",fo:"Faroe Islands",fr:"France",ga:"Gabon",gb:"United Kingdom",gd:"Grenada",ge:"Georgia",gf:"French Guiana",gg:"Guernsey",gh:"Ghana",gi:"Gibraltar",gl:"Greenland",gm:"Gambia",gn:"Guinea",gp:"Guadeloupe",gq:"Equatorial Guinea",gr:"Greece",gs:"South Georgia & South Sandwich Islands",gt:"Guatemala",gu:"Guam",gw:"Guinea-Bissau",gy:"Guyana",hk:"Hong Kong SAR China",hm:"Heard & McDonald Islands",hn:"Honduras",hr:"Croatia",ht:"Haiti",hu:"Hungary",id:"Indonesia",ie:"Ireland",il:"Israel",im:"Isle of Man",in:"India",io:"British Indian Ocean Territory",iq:"Iraq",ir:"Iran",is:"Iceland",it:"Italy",je:"Jersey",jm:"Jamaica",jo:"Jordan",jp:"Japan",ke:"Kenya",kg:"Kyrgyzstan",kh:"Cambodia",ki:"Kiribati",km:"Comoros",kn:"St. Kitts & Nevis",kp:"North Korea",kr:"South Korea",kw:"Kuwait",ky:"Cayman Islands",kz:"Kazakhstan",la:"Laos",lb:"Lebanon",lc:"St. Lucia",li:"Liechtenstein",lk:"Sri Lanka",lr:"Liberia",ls:"Lesotho",lt:"Lithuania",lu:"Luxembourg",lv:"Latvia",ly:"Libya",ma:"Morocco",mc:"Monaco",md:"Moldova",me:"Montenegro",mf:"St. Martin",mg:"Madagascar",mh:"Marshall Islands",mk:"North Macedonia",ml:"Mali",mm:"Myanmar (Burma)",mn:"Mongolia",mo:"Macao SAR China",mp:"Northern Mariana Islands",mq:"Martinique",mr:"Mauritania",ms:"Montserrat",mt:"Malta",mu:"Mauritius",mv:"Maldives",mw:"Malawi",mx:"Mexico",my:"Malaysia",mz:"Mozambique",na:"Namibia",nc:"New Caledonia",ne:"Niger",nf:"Norfolk Island",ng:"Nigeria",ni:"Nicaragua",nl:"Netherlands",no:"Norway",np:"Nepal",nr:"Nauru",nu:"Niue",nz:"New Zealand",om:"Oman",pa:"Panama",pe:"Peru",pf:"French Polynesia",pg:"Papua New Guinea",ph:"Philippines",pk:"Pakistan",pl:"Poland",pm:"St. Pierre & Miquelon",pn:"Pitcairn Islands",pr:"Puerto Rico",ps:"Palestinian Territories",pt:"Portugal",pw:"Palau",py:"Paraguay",qa:"Qatar",re:"R\xE9union",ro:"Romania",rs:"Serbia",ru:"Russia",rw:"Rwanda",sa:"Saudi Arabia",sb:"Solomon Islands",sc:"Seychelles",sd:"Sudan",se:"Sweden",sg:"Singapore",sh:"St. Helena",si:"Slovenia",sj:"Svalbard & Jan Mayen",sk:"Slovakia",sl:"Sierra Leone",sm:"San Marino",sn:"Senegal",so:"Somalia",sr:"Suriname",ss:"South Sudan",st:"S\xE3o Tom\xE9 & Pr\xEDncipe",sv:"El Salvador",sx:"Sint Maarten",sy:"Syria",sz:"Eswatini",tc:"Turks & Caicos Islands",td:"Chad",tf:"French Southern Territories",tg:"Togo",th:"Thailand",tj:"Tajikistan",tk:"Tokelau",tl:"Timor-Leste",tm:"Turkmenistan",tn:"Tunisia",to:"Tonga",tr:"Turkey",tt:"Trinidad & Tobago",tv:"Tuvalu",tw:"Taiwan",tz:"Tanzania",ua:"Ukraine",ug:"Uganda",um:"U.S. Outlying Islands",us:"United States",uy:"Uruguay",uz:"Uzbekistan",va:"Vatican City",vc:"St. Vincent & Grenadines",ve:"Venezuela",vg:"British Virgin Islands",vi:"U.S. Virgin Islands",vn:"Vietnam",vu:"Vanuatu",wf:"Wallis & Futuna",ws:"Samoa",ye:"Yemen",yt:"Mayotte",za:"South Africa",zm:"Zambia",zw:"Zimbabwe"};var r2={selectedCountryAriaLabel:"Selected country",noCountrySelected:"No country selected",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",zeroSearchResults:"No results found",oneSearchResult:"1 result found",multipleSearchResults:"${count} results found",ac:"Ascension Island",xk:"Kosovo"};var C1={...i2,...r2};for(let C=0;C<K.length;C++)K[C].name=C1[K[C].iso2];var B2=0,u2={allowDropdown:!0,autoPlaceholder:"polite",containerClass:"",countryOrder:null,customPlaceholder:null,dropdownContainer:null,excludeCountries:[],fixDropdownWidth:!0,formatAsYouType:!0,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:null,i18n:{},initialCountry:"",nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",showFlags:!0,separateDialCode:!1,strictMode:!1,useFullscreenPopup:typeof navigator<"u"&&typeof window<"u"?/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=500:!1,utilsScript:"",validationNumberType:"MOBILE"},G2=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],l1=C=>C.replace(/\D/g,""),s2=(C="")=>C.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),o2=C=>{let $=l1(C);if($.charAt(0)==="1"){let n=$.substr(1,3);return G2.indexOf(n)!==-1}return!1},H2=(C,$,n,r)=>{if(n===0&&!r)return 0;let u=0;for(let h=0;h<$.length;h++){if(/[+0-9]/.test($[h])&&u++,u===C&&!r)return h+1;if(r&&u===C+1)return h}return $.length},A=(C,$,n)=>{let r=document.createElement(C);return $&&Object.entries($).forEach(([u,h])=>r.setAttribute(u,h)),n&&n.appendChild(r),r},d1=C=>{let{instances:$}=m;Object.values($).forEach(n=>n[C]())},y1=class{id;promise;telInput;highlightedItem;options;hadInitialPlaceholder;isRTL;isAndroid;selectedCountryData;countries;dialCodeMaxLen;dialCodeToIso2Map;dialCodes;countryContainer;selectedCountry;selectedCountryInner;selectedCountryA11yText;selectedDialCode;dropdownArrow;dropdownContent;searchInput;searchResultsA11yText;countryList;dropdown;hiddenInput;hiddenInputCountry;maxCoreNumberLength;defaultCountry;_handleHiddenInputSubmit;_handleLabelClick;_handleClickSelectedCountry;_handleCountryContainerKeydown;_handleInputEvent;_handleKeydownEvent;_handleWindowScroll;_handleMouseoverCountryList;_handleClickCountryList;_handleClickOffToClose;_handleKeydownOnDropdown;_handleSearchChange;resolveAutoCountryPromise;rejectAutoCountryPromise;resolveUtilsScriptPromise;rejectUtilsScriptPromise;constructor($,n={}){this.id=B2++,this.telInput=$,this.highlightedItem=null,this.options=Object.assign({},u2,n),this.hadInitialPlaceholder=!!$.getAttribute("placeholder")}_init(){this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!1),this.options.separateDialCode&&(this.options.allowDropdown=!0,this.options.nationalMode=!1),!this.options.showFlags&&!this.options.separateDialCode&&(this.options.nationalMode=!1),this.options.useFullscreenPopup&&!this.options.dropdownContainer&&(this.options.dropdownContainer=document.body),this.isAndroid=typeof navigator<"u"?/Android/i.test(navigator.userAgent):!1,this.isRTL=!!this.telInput.closest("[dir=rtl]"),this.options.i18n={...C1,...this.options.i18n};let $=new Promise((r,u)=>{this.resolveAutoCountryPromise=r,this.rejectAutoCountryPromise=u}),n=new Promise((r,u)=>{this.resolveUtilsScriptPromise=r,this.rejectUtilsScriptPromise=u});this.promise=Promise.all([$,n]),this.selectedCountryData={},this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests()}_processCountryData(){this._processAllCountries(),this._processDialCodes(),this._translateCountryNames(),this.options.countryOrder&&(this.options.countryOrder=this.options.countryOrder.map($=>$.toLowerCase())),this._sortCountries()}_sortCountries(){this.countries.sort(($,n)=>{let{countryOrder:r}=this.options;if(r){let u=r.indexOf($.iso2),h=r.indexOf(n.iso2),g=u>-1,p=h>-1;if(g||p)return g&&p?u-h:g?-1:1}return $.name<n.name?-1:$.name>n.name?1:0})}_addToDialCodeMap($,n,r){n.length>this.dialCodeMaxLen&&(this.dialCodeMaxLen=n.length),this.dialCodeToIso2Map.hasOwnProperty(n)||(this.dialCodeToIso2Map[n]=[]);for(let h=0;h<this.dialCodeToIso2Map[n].length;h++)if(this.dialCodeToIso2Map[n][h]===$)return;let u=r!==void 0?r:this.dialCodeToIso2Map[n].length;this.dialCodeToIso2Map[n][u]=$}_processAllCountries(){let{onlyCountries:$,excludeCountries:n}=this.options;if($.length){let r=$.map(u=>u.toLowerCase());this.countries=K.filter(u=>r.indexOf(u.iso2)>-1)}else if(n.length){let r=n.map(u=>u.toLowerCase());this.countries=K.filter(u=>r.indexOf(u.iso2)===-1)}else this.countries=K}_translateCountryNames(){for(let $=0;$<this.countries.length;$++){let n=this.countries[$].iso2.toLowerCase();this.options.i18n.hasOwnProperty(n)&&(this.countries[$].name=this.options.i18n[n])}}_processDialCodes(){this.dialCodes={},this.dialCodeMaxLen=0,this.dialCodeToIso2Map={};for(let $=0;$<this.countries.length;$++){let n=this.countries[$];this.dialCodes[n.dialCode]||(this.dialCodes[n.dialCode]=!0),this._addToDialCodeMap(n.iso2,n.dialCode,n.priority)}for(let $=0;$<this.countries.length;$++){let n=this.countries[$];if(n.areaCodes){let r=this.dialCodeToIso2Map[n.dialCode][0];for(let u=0;u<n.areaCodes.length;u++){let h=n.areaCodes[u];for(let g=1;g<h.length;g++){let p=n.dialCode+h.substr(0,g);this._addToDialCodeMap(r,p),this._addToDialCodeMap(n.iso2,p)}this._addToDialCodeMap(n.iso2,n.dialCode+h)}}}}_generateMarkup(){this.telInput.classList.add("iti__tel-input"),!this.telInput.hasAttribute("autocomplete")&&!(this.telInput.form&&this.telInput.form.hasAttribute("autocomplete"))&&this.telInput.setAttribute("autocomplete","off");let{allowDropdown:$,separateDialCode:n,showFlags:r,containerClass:u,hiddenInput:h,dropdownContainer:g,fixDropdownWidth:p,useFullscreenPopup:y,i18n:I}=this.options,S="iti";$&&(S+=" iti--allow-dropdown"),r&&(S+=" iti--show-flags"),u&&(S+=` ${u}`),y||(S+=" iti--inline-dropdown");let b=A("div",{class:S});if(this.telInput.parentNode?.insertBefore(b,this.telInput),$||r){this.countryContainer=A("div",{class:"iti__country-container"},b),this.selectedCountry=A("button",{type:"button",class:"iti__selected-country",...$&&{"aria-expanded":"false","aria-label":this.options.i18n.selectedCountryAriaLabel,"aria-haspopup":"true","aria-controls":`iti-${this.id}__dropdown-content`,role:"combobox"}},this.countryContainer);let w=A("div",{class:"iti__selected-country-primary"},this.selectedCountry);if(this.selectedCountryInner=A("div",null,w),this.selectedCountryA11yText=A("span",{class:"iti__a11y-text"},this.selectedCountryInner),this.telInput.disabled?this.selectedCountry.setAttribute("aria-disabled","true"):this.selectedCountry.setAttribute("tabindex","0"),$&&(this.dropdownArrow=A("div",{class:"iti__arrow","aria-hidden":"true"},w)),n&&(this.selectedDialCode=A("div",{class:"iti__selected-dial-code"},this.selectedCountry)),$){let M=p?"":"iti--flexible-dropdown-width";if(this.dropdownContent=A("div",{id:`iti-${this.id}__dropdown-content`,class:`iti__dropdown-content iti__hide ${M}`}),this.searchInput=A("input",{type:"text",class:"iti__search-input",placeholder:I.searchPlaceholder,role:"combobox","aria-expanded":"true","aria-label":I.searchPlaceholder,"aria-controls":`iti-${this.id}__country-listbox`,"aria-autocomplete":"list",autocomplete:"off"},this.dropdownContent),this.searchResultsA11yText=A("span",{class:"iti__a11y-text"},this.dropdownContent),this.countryList=A("ul",{class:"iti__country-list",id:`iti-${this.id}__country-listbox`,role:"listbox","aria-label":I.countryListAriaLabel},this.dropdownContent),this._appendListItems(this.countries,"iti__standard"),this._updateSearchResultsText(),g){let R="iti iti--container";y?R+=" iti--fullscreen-popup":R+=" iti--inline-dropdown",this.dropdown=A("div",{class:R}),this.dropdown.appendChild(this.dropdownContent)}else this.countryContainer.appendChild(this.dropdownContent)}}if(b.appendChild(this.telInput),h){let w=this.telInput.getAttribute("name")||"",M=h(w);M.phone&&(this.hiddenInput=A("input",{type:"hidden",name:M.phone}),b.appendChild(this.hiddenInput)),M.country&&(this.hiddenInputCountry=A("input",{type:"hidden",name:M.country}),b.appendChild(this.hiddenInputCountry))}}_appendListItems($,n){for(let r=0;r<$.length;r++){let u=$[r],h=A("li",{id:`iti-${this.id}__item-${u.iso2}`,class:`iti__country ${n}`,tabindex:"-1",role:"option","data-dial-code":u.dialCode,"data-country-code":u.iso2,"aria-selected":"false"},this.countryList);u.nodeById[this.id]=h;let g="";this.options.showFlags&&(g+=`<div class='iti__flag-box'><div class='iti__flag iti__${u.iso2}'></div></div>`),g+=`<span class='iti__country-name'>${u.name}</span>`,g+=`<span class='iti__dial-code'>+${u.dialCode}</span>`,h.insertAdjacentHTML("beforeend",g)}}_setInitialState($=!1){let n=this.telInput.getAttribute("value"),r=this.telInput.value,h=n&&n.charAt(0)==="+"&&(!r||r.charAt(0)!=="+")?n:r,g=this._getDialCode(h),p=o2(h),{initialCountry:y,geoIpLookup:I}=this.options,S=y==="auto"&&I;if(g&&!p)this._updateCountryFromNumber(h);else if(!S||$){let b=y?y.toLowerCase():"";b&&this._getCountryData(b,!0)?this._setCountry(b):g&&p?this._setCountry("us"):this._setCountry()}h&&this._updateValFromNumber(h)}_initListeners(){this._initTelInputListeners(),this.options.allowDropdown&&this._initDropdownListeners(),(this.hiddenInput||this.hiddenInputCountry)&&this.telInput.form&&this._initHiddenInputListener()}_initHiddenInputListener(){this._handleHiddenInputSubmit=()=>{this.hiddenInput&&(this.hiddenInput.value=this.getNumber()),this.hiddenInputCountry&&(this.hiddenInputCountry.value=this.getSelectedCountryData().iso2||"")},this.telInput.form?.addEventListener("submit",this._handleHiddenInputSubmit)}_initDropdownListeners(){this._handleLabelClick=n=>{this.dropdownContent.classList.contains("iti__hide")?this.telInput.focus():n.preventDefault()};let $=this.telInput.closest("label");$&&$.addEventListener("click",this._handleLabelClick),this._handleClickSelectedCountry=()=>{this.dropdownContent.classList.contains("iti__hide")&&!this.telInput.disabled&&!this.telInput.readOnly&&this._openDropdown()},this.selectedCountry.addEventListener("click",this._handleClickSelectedCountry),this._handleCountryContainerKeydown=n=>{this.dropdownContent.classList.contains("iti__hide")&&["ArrowUp","ArrowDown"," ","Enter"].includes(n.key)&&(n.preventDefault(),n.stopPropagation(),this._openDropdown()),n.key==="Tab"&&this._closeDropdown()},this.countryContainer.addEventListener("keydown",this._handleCountryContainerKeydown)}_initRequests(){let{utilsScript:$,initialCountry:n,geoIpLookup:r}=this.options;$&&!m.utils?m.documentReady()?m.loadUtils($):window.addEventListener("load",()=>{m.loadUtils($)}):this.resolveUtilsScriptPromise(),n==="auto"&&r&&!this.selectedCountryData.iso2?this._loadAutoCountry():this.resolveAutoCountryPromise()}_loadAutoCountry(){m.autoCountry?this.handleAutoCountry():m.startedLoadingAutoCountry||(m.startedLoadingAutoCountry=!0,typeof this.options.geoIpLookup=="function"&&this.options.geoIpLookup(($="")=>{let n=$.toLowerCase();n&&this._getCountryData(n,!0)?(m.autoCountry=n,setTimeout(()=>d1("handleAutoCountry"))):(this._setInitialState(!0),d1("rejectAutoCountryPromise"))},()=>{this._setInitialState(!0),d1("rejectAutoCountryPromise")}))}_initTelInputListeners(){let{strictMode:$,formatAsYouType:n,separateDialCode:r,formatOnDisplay:u}=this.options,h=!1,g=()=>{this._openDropdown(),this.searchInput.value="+",this._filterCountries("",!0)};this._handleInputEvent=p=>{if(this.isAndroid&&p?.data==="+"&&r){let b=this.telInput.selectionStart||0,w=this.telInput.value.substring(0,b-1),M=this.telInput.value.substring(b);this.telInput.value=w+M,g();return}this._updateCountryFromNumber(this.telInput.value)&&this._triggerCountryChange();let y=p?.data&&/[^+0-9]/.test(p.data),I=p?.inputType==="insertFromPaste"&&this.telInput.value;y||I&&!$?h=!0:/[^+0-9]/.test(this.telInput.value)||(h=!1);let S=p?.detail&&p.detail.isSetNumber&&!u;if(n&&!h&&!S){let b=this.telInput.selectionStart||0,M=this.telInput.value.substring(0,b).replace(/[^+0-9]/g,"").length,R=p?.inputType==="deleteContentForward",z=this._formatNumberAsYouType(),t1=H2(M,z,b,R);this.telInput.value=z,this.telInput.setSelectionRange(t1,t1)}},this.telInput.addEventListener("input",this._handleInputEvent),($||r)&&(this._handleKeydownEvent=p=>{if(p.key&&p.key.length===1&&!p.altKey&&!p.ctrlKey&&!p.metaKey){if(r&&p.key==="+"){p.preventDefault(),g();return}if($){let y=this.telInput.selectionStart===0&&p.key==="+",I=/^[0-9]$/.test(p.key),S=y||I,b=this._getFullNumber(),w=m.utils.getCoreNumber(b,this.selectedCountryData.iso2),M=this.maxCoreNumberLength&&w.length>=this.maxCoreNumberLength,R=this.telInput.value.substring(this.telInput.selectionStart,this.telInput.selectionEnd),z=/\d/.test(R);(!S||M&&!z)&&p.preventDefault()}}},this.telInput.addEventListener("keydown",this._handleKeydownEvent))}_cap($){let n=parseInt(this.telInput.getAttribute("maxlength")||"",10);return n&&$.length>n?$.substr(0,n):$}_trigger($,n={}){let r=new CustomEvent($,{bubbles:!0,cancelable:!0,detail:n});this.telInput.dispatchEvent(r)}_openDropdown(){let{fixDropdownWidth:$}=this.options;$&&(this.dropdownContent.style.width=`${this.telInput.offsetWidth}px`),this.dropdownContent.classList.remove("iti__hide"),this.selectedCountry.setAttribute("aria-expanded","true"),this._setDropdownPosition();let n=this.countryList.firstElementChild;n&&(this._highlightListItem(n,!1),this.countryList.scrollTop=0),this.searchInput.focus(),this._bindDropdownListeners(),this.dropdownArrow.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}_setDropdownPosition(){if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.options.useFullscreenPopup){let $=this.telInput.getBoundingClientRect(),n=this.telInput.offsetHeight;this.options.dropdownContainer&&(this.dropdown.style.top=`${$.top+n}px`,this.dropdown.style.left=`${$.left}px`,this._handleWindowScroll=()=>this._closeDropdown(),window.addEventListener("scroll",this._handleWindowScroll))}}_bindDropdownListeners(){this._handleMouseoverCountryList=u=>{let h=u.target?.closest(".iti__country");h&&this._highlightListItem(h,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=u=>{let h=u.target?.closest(".iti__country");h&&this._selectListItem(h)},this.countryList.addEventListener("click",this._handleClickCountryList);let $=!0;this._handleClickOffToClose=()=>{$||this._closeDropdown(),$=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose),this._handleKeydownOnDropdown=u=>{["ArrowUp","ArrowDown","Enter","Escape"].includes(u.key)&&(u.preventDefault(),u.stopPropagation(),u.key==="ArrowUp"||u.key==="ArrowDown"?this._handleUpDownKey(u.key):u.key==="Enter"?this._handleEnterKey():u.key==="Escape"&&this._closeDropdown())},document.addEventListener("keydown",this._handleKeydownOnDropdown);let n=()=>{let u=this.searchInput.value.trim();u?this._filterCountries(u):this._filterCountries("",!0)},r=null;this._handleSearchChange=()=>{r&&clearTimeout(r),r=setTimeout(()=>{n(),r=null},100)},this.searchInput.addEventListener("input",this._handleSearchChange),this.searchInput.addEventListener("click",u=>u.stopPropagation())}_filterCountries($,n=!1){let r=!0;this.countryList.innerHTML="";let u=s2($);for(let h=0;h<this.countries.length;h++){let g=this.countries[h],p=s2(g.name),y=`+${g.dialCode}`;if(n||p.includes(u)||y.includes(u)||g.iso2.includes(u)){let I=g.nodeById[this.id];I&&this.countryList.appendChild(I),r&&(this._highlightListItem(I,!1),r=!1)}}r&&this._highlightListItem(null,!1),this.countryList.scrollTop=0,this._updateSearchResultsText()}_updateSearchResultsText(){let{i18n:$}=this.options,n=this.countryList.childElementCount,r;n===0?r=$.zeroSearchResults:n===1?r=$.oneSearchResult:r=$.multipleSearchResults.replace("${count}",n.toString()),this.searchResultsA11yText.textContent=r}_handleUpDownKey($){let n=$==="ArrowUp"?this.highlightedItem?.previousElementSibling:this.highlightedItem?.nextElementSibling;!n&&this.countryList.childElementCount>1&&(n=$==="ArrowUp"?this.countryList.lastElementChild:this.countryList.firstElementChild),n&&(this._scrollTo(n),this._highlightListItem(n,!1))}_handleEnterKey(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}_updateValFromNumber($){let n=$;if(this.options.formatOnDisplay&&m.utils&&this.selectedCountryData){let r=this.options.nationalMode||n.charAt(0)!=="+"&&!this.options.separateDialCode,{NATIONAL:u,INTERNATIONAL:h}=m.utils.numberFormat,g=r?u:h;n=m.utils.formatNumber(n,this.selectedCountryData.iso2,g)}n=this._beforeSetNumber(n),this.telInput.value=n}_updateCountryFromNumber($){let n=$.indexOf("+"),r=n?$.substring(n):$,u=this.selectedCountryData.dialCode;r&&u==="1"&&r.charAt(0)!=="+"&&(r.charAt(0)!=="1"&&(r=`1${r}`),r=`+${r}`),this.options.separateDialCode&&u&&r.charAt(0)!=="+"&&(r=`+${u}${r}`);let g=this._getDialCode(r,!0),p=l1(r),y=null;if(g){let I=this.dialCodeToIso2Map[l1(g)],S=I.indexOf(this.selectedCountryData.iso2)!==-1&&p.length<=g.length-1;if(!(u==="1"&&o2(p))&&!S){for(let w=0;w<I.length;w++)if(I[w]){y=I[w];break}}}else r.charAt(0)==="+"&&p.length?y="":(!r||r==="+")&&!this.selectedCountryData.iso2&&(y=this.defaultCountry);return y!==null?this._setCountry(y):!1}_highlightListItem($,n){let r=this.highlightedItem;if(r&&(r.classList.remove("iti__highlight"),r.setAttribute("aria-selected","false")),this.highlightedItem=$,this.highlightedItem){this.highlightedItem.classList.add("iti__highlight"),this.highlightedItem.setAttribute("aria-selected","true");let u=this.highlightedItem.getAttribute("id")||"";this.selectedCountry.setAttribute("aria-activedescendant",u),this.searchInput.setAttribute("aria-activedescendant",u)}n&&this.highlightedItem.focus()}_getCountryData($,n){for(let r=0;r<this.countries.length;r++)if(this.countries[r].iso2===$)return this.countries[r];if(n)return null;throw new Error(`No country data for '${$}'`)}_setCountry($){let{separateDialCode:n,showFlags:r,i18n:u}=this.options,h=this.selectedCountryData.iso2?this.selectedCountryData:{};if(this.selectedCountryData=$?this._getCountryData($,!1)||{}:{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2),this.selectedCountryInner){let g="",p="";$&&r?(g=`iti__flag iti__${$}`,p=`${this.selectedCountryData.name} +${this.selectedCountryData.dialCode}`):(g="iti__flag iti__globe",p=u.noCountrySelected),this.selectedCountryInner.className=g,this.selectedCountryA11yText.textContent=p}if(this._setSelectedCountryTitleAttribute($,n),n){let g=this.selectedCountryData.dialCode?`+${this.selectedCountryData.dialCode}`:"";this.selectedDialCode.innerHTML=g;let y=(this.selectedCountry.offsetWidth||this._getHiddenSelectedCountryWidth())+8;this.isRTL?this.telInput.style.paddingRight=`${y}px`:this.telInput.style.paddingLeft=`${y}px`}return this._updatePlaceholder(),this._updateMaxLength(),h.iso2!==$}_updateMaxLength(){let{strictMode:$,placeholderNumberType:n,validationNumberType:r}=this.options;if($&&m.utils)if(this.selectedCountryData.iso2){let u=m.utils.numberType[n],h=m.utils.getExampleNumber(this.selectedCountryData.iso2,!1,u,!0),g=h;for(;m.utils.isPossibleNumber(h,this.selectedCountryData.iso2,r);)g=h,h+="0";let p=m.utils.getCoreNumber(g,this.selectedCountryData.iso2);this.maxCoreNumberLength=p.length}else this.maxCoreNumberLength=null}_setSelectedCountryTitleAttribute($=null,n){if(!this.selectedCountry)return;let r;$&&!n?r=`${this.selectedCountryData.name}: +${this.selectedCountryData.dialCode}`:$?r=this.selectedCountryData.name:r="Unknown",this.selectedCountry.setAttribute("title",r)}_getHiddenSelectedCountryWidth(){if(this.telInput.parentNode){let $=this.telInput.parentNode.cloneNode(!1);$.style.visibility="hidden",document.body.appendChild($);let n=this.countryContainer.cloneNode();$.appendChild(n);let r=this.selectedCountry.cloneNode(!0);n.appendChild(r);let u=r.offsetWidth;return document.body.removeChild($),u}return 0}_updatePlaceholder(){let{autoPlaceholder:$,placeholderNumberType:n,nationalMode:r,customPlaceholder:u}=this.options,h=$==="aggressive"||!this.hadInitialPlaceholder&&$==="polite";if(m.utils&&h){let g=m.utils.numberType[n],p=this.selectedCountryData.iso2?m.utils.getExampleNumber(this.selectedCountryData.iso2,r,g):"";p=this._beforeSetNumber(p),typeof u=="function"&&(p=u(p,this.selectedCountryData)),this.telInput.setAttribute("placeholder",p)}}_selectListItem($){let n=this._setCountry($.getAttribute("data-country-code"));this._closeDropdown(),this._updateDialCode($.getAttribute("data-dial-code")),this.telInput.focus(),n&&this._triggerCountryChange()}_closeDropdown(){this.dropdownContent.classList.add("iti__hide"),this.selectedCountry.setAttribute("aria-expanded","false"),this.selectedCountry.removeAttribute("aria-activedescendant"),this.highlightedItem&&this.highlightedItem.setAttribute("aria-selected","false"),this.searchInput.removeAttribute("aria-activedescendant"),this.dropdownArrow.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._handleKeydownOnDropdown),this.searchInput.removeEventListener("input",this._handleSearchChange),document.documentElement.removeEventListener("click",this._handleClickOffToClose),this.countryList.removeEventListener("mouseover",this._handleMouseoverCountryList),this.countryList.removeEventListener("click",this._handleClickCountryList),this.options.dropdownContainer&&(this.options.useFullscreenPopup||window.removeEventListener("scroll",this._handleWindowScroll),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._trigger("close:countrydropdown")}_scrollTo($){let n=this.countryList,r=document.documentElement.scrollTop,u=n.offsetHeight,h=n.getBoundingClientRect().top+r,g=h+u,p=$.offsetHeight,y=$.getBoundingClientRect().top+r,I=y+p,S=y-h+n.scrollTop;if(y<h)n.scrollTop=S;else if(I>g){let b=u-p;n.scrollTop=S-b}}_updateDialCode($){let n=this.telInput.value,r=`+${$}`,u;if(n.charAt(0)==="+"){let h=this._getDialCode(n);h?u=n.replace(h,r):u=r,this.telInput.value=u}}_getDialCode($,n){let r="";if($.charAt(0)==="+"){let u="";for(let h=0;h<$.length;h++){let g=$.charAt(h);if(!isNaN(parseInt(g,10))){if(u+=g,n)this.dialCodeToIso2Map[u]&&(r=$.substr(0,h+1));else if(this.dialCodes[u]){r=$.substr(0,h+1);break}if(u.length===this.dialCodeMaxLen)break}}}return r}_getFullNumber(){let $=this.telInput.value.trim(),{dialCode:n}=this.selectedCountryData,r,u=l1($);return this.options.separateDialCode&&$.charAt(0)!=="+"&&n&&u?r=`+${n}`:r="",r+$}_beforeSetNumber($){let n=$;if(this.options.separateDialCode){let r=this._getDialCode(n);if(r){r=`+${this.selectedCountryData.dialCode}`;let u=n[r.length]===" "||n[r.length]==="-"?r.length+1:r.length;n=n.substr(u)}}return this._cap(n)}_triggerCountryChange(){this._trigger("countrychange")}_formatNumberAsYouType(){let $=this._getFullNumber(),n=m.utils?m.utils.formatNumberAsYouType($,this.selectedCountryData.iso2):$,{dialCode:r}=this.selectedCountryData;return this.options.separateDialCode&&this.telInput.value.charAt(0)!=="+"&&n.includes(`+${r}`)?(n.split(`+${r}`)[1]||"").trim():n}handleAutoCountry(){this.options.initialCountry==="auto"&&m.autoCountry&&(this.defaultCountry=m.autoCountry,this.selectedCountryData.iso2||this.selectedCountryInner.classList.contains("iti__globe")||this.setCountry(this.defaultCountry),this.resolveAutoCountryPromise())}handleUtils(){m.utils&&(this.telInput.value&&this._updateValFromNumber(this.telInput.value),this.selectedCountryData.iso2&&(this._updatePlaceholder(),this._updateMaxLength())),this.resolveUtilsScriptPromise()}destroy(){if(this.options.allowDropdown){this._closeDropdown(),this.selectedCountry.removeEventListener("click",this._handleClickSelectedCountry),this.countryContainer.removeEventListener("keydown",this._handleCountryContainerKeydown);let r=this.telInput.closest("label");r&&r.removeEventListener("click",this._handleLabelClick)}let{form:$}=this.telInput;this._handleHiddenInputSubmit&&$&&$.removeEventListener("submit",this._handleHiddenInputSubmit),this.telInput.removeEventListener("input",this._handleInputEvent),this._handleKeydownEvent&&this.telInput.removeEventListener("keydown",this._handleKeydownEvent),this.telInput.removeAttribute("data-intl-tel-input-id");let n=this.telInput.parentNode;n?.parentNode?.insertBefore(this.telInput,n),n?.parentNode?.removeChild(n),delete m.instances[this.id]}getExtension(){return m.utils?m.utils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""}getNumber($){if(m.utils){let{iso2:n}=this.selectedCountryData;return m.utils.formatNumber(this._getFullNumber(),n,$)}return""}getNumberType(){return m.utils?m.utils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99}getSelectedCountryData(){return this.selectedCountryData}getValidationError(){if(m.utils){let{iso2:$}=this.selectedCountryData;return m.utils.getValidationError(this._getFullNumber(),$)}return-99}isValidNumber(){let $=this._getFullNumber();return/\p{L}/u.test($)?!1:m.utils?m.utils.isPossibleNumber($,this.selectedCountryData.iso2,this.options.validationNumberType):null}isValidNumberPrecise(){let $=this._getFullNumber();return/\p{L}/u.test($)?!1:m.utils?m.utils.isValidNumber($,this.selectedCountryData.iso2):null}setCountry($){let n=$?.toLowerCase(),r=this.selectedCountryData.iso2;($&&n!==r||!$&&r)&&(this._setCountry(n),this._updateDialCode(this.selectedCountryData.dialCode),this._triggerCountryChange())}setNumber($){let n=this._updateCountryFromNumber($);this._updateValFromNumber($),n&&this._triggerCountryChange(),this._trigger("input",{isSetNumber:!0})}setPlaceholderNumberType($){this.options.placeholderNumberType=$,this._updatePlaceholder()}},U2=C=>!m.utils&&!m.startedLoadingUtilsScript?(m.startedLoadingUtilsScript=!0,new Promise(($,n)=>{import(/* webpackIgnore: true */ C).then(({default:r})=>{m.utils=r,d1("handleUtils"),$(!0)}).catch(()=>{d1("rejectUtilsScriptPromise"),n()})})):null,m=Object.assign((C,$)=>{let n=new y1(C,$);return n._init(),C.setAttribute("data-intl-tel-input-id",n.id.toString()),m.instances[n.id]=n,n},{defaults:u2,documentReady:()=>document.readyState==="complete",getCountryData:()=>K,getInstance:C=>{let $=C.getAttribute("data-intl-tel-input-id");return $?m.instances[$]:null},instances:{},loadUtils:U2,version:"23.1.1"}),v1=m;(function(){var C=this||self;function $(d,t){d=d.split(".");var e=C;d[0]in e||typeof e.execScript>"u"||e.execScript("var "+d[0]);for(var i;d.length&&(i=d.shift());)d.length||t===void 0?e[i]&&e[i]!==Object.prototype[i]?e=e[i]:e=e[i]={}:e[i]=t}function n(d,t){function e(){}e.prototype=t.prototype,d.ma=t.prototype,d.prototype=new e,d.prototype.constructor=d,d.sa=function(i,s,o){for(var a=Array(arguments.length-2),l=2;l<arguments.length;l++)a[l-2]=arguments[l];return t.prototype[s].apply(i,a)}}function r(d){let t=[],e=0;for(let i in d)t[e++]=d[i];return t}var u=class{constructor(d){if(h!==h)throw Error("SafeUrl is not meant to be built directly");this.g=d}toString(){return this.g.toString()}},h={};new u("about:invalid#zClosurez"),new u("about:blank");let g={};class p{constructor(){if(g!==g)throw Error("SafeStyle is not meant to be built directly")}toString(){return""}}new p;let y={};class I{constructor(){if(y!==y)throw Error("SafeStyleSheet is not meant to be built directly")}toString(){return""}}new I;let S={};class b{constructor(){var t=C.trustedTypes&&C.trustedTypes.emptyHTML||"";if(S!==S)throw Error("SafeHtml is not meant to be built directly");this.g=t}toString(){return this.g.toString()}}new b;function w(d,t){switch(this.g=d,this.l=!!t.aa,this.h=t.i,this.s=t.type,this.o=!1,this.h){case z:case t1:case l2:case h2:case c2:case R:case M:this.o=!0}this.j=t.defaultValue}var M=1,R=2,z=3,t1=4,l2=6,h2=16,c2=18;function p2(d,t){for(this.h=d,this.g={},d=0;d<t.length;d++){var e=t[d];this.g[e.g]=e}}function g2(d){return d=r(d.g),d.sort(function(t,e){return t.g-e.g}),d}function D(){this.h={},this.j=this.m().g,this.g=this.l=null}D.prototype.has=function(d){return x(this,d.g)},D.prototype.get=function(d,t){return c(this,d.g,t)},D.prototype.set=function(d,t){L(this,d.g,t)},D.prototype.add=function(d,t){b1(this,d.g,t)};function I1(d,t){for(var e=g2(d.m()),i=0;i<e.length;i++){var s=e[i],o=s.g;if(x(t,o)){d.g&&delete d.g[s.g];var a=s.h==11||s.h==10;if(s.l){s=N(t,o);for(var l=0;l<s.length;l++)b1(d,o,a?s[l].clone():s[l])}else s=e1(t,o),a?(a=e1(d,o))?I1(a,s):L(d,o,s.clone()):L(d,o,s)}}}D.prototype.clone=function(){var d=new this.constructor;return d!=this&&(d.h={},d.g&&(d.g={}),I1(d,this)),d};function x(d,t){return d.h[t]!=null}function e1(d,t){var e=d.h[t];if(e==null)return null;if(d.l){if(!(t in d.g)){var i=d.l,s=d.j[t];if(e!=null)if(s.l){for(var o=[],a=0;a<e.length;a++)o[a]=i.h(s,e[a]);e=o}else e=i.h(s,e);return d.g[t]=e}return d.g[t]}return e}function c(d,t,e){var i=e1(d,t);return d.j[t].l?i[e||0]:i}function v(d,t){if(x(d,t))d=c(d,t);else d:{if(d=d.j[t],d.j===void 0)if(t=d.s,t===Boolean)d.j=!1;else if(t===Number)d.j=0;else if(t===String)d.j=d.o?"0":"";else{d=new t;break d}d=d.j}return d}function N(d,t){return e1(d,t)||[]}function G(d,t){return d.j[t].l?x(d,t)?d.h[t].length:0:x(d,t)?1:0}function L(d,t,e){d.h[t]=e,d.g&&(d.g[t]=e)}function b1(d,t,e){d.h[t]||(d.h[t]=[]),d.h[t].push(e),d.g&&delete d.g[t]}function $1(d,t){var e=[],i;for(i in t)i!=0&&e.push(new w(i,t[i]));return new p2(d,e)}function n1(){}n1.prototype.g=function(d){throw new d.h,Error("Unimplemented")},n1.prototype.h=function(d,t){if(d.h==11||d.h==10)return t instanceof D?t:this.g(d.s.prototype.m(),t);if(d.h==14)return typeof t=="string"&&_1.test(t)&&(d=Number(t),0<d)?d:t;if(!d.o)return t;if(d=d.s,d===String){if(typeof t=="number")return String(t)}else if(d===Number&&typeof t=="string"&&(t==="Infinity"||t==="-Infinity"||t==="NaN"||_1.test(t)))return Number(t);return t};var _1=/^-?[0-9]+$/;function h1(){}n(h1,n1),h1.prototype.g=function(d,t){return d=new d.h,d.l=this,d.h=t,d.g={},d};function Z(){}n(Z,h1),Z.prototype.h=function(d,t){return d.h==8?!!t:n1.prototype.h.apply(this,arguments)},Z.prototype.g=function(d,t){return Z.ma.g.call(this,d,t)};function T(d,t){d!=null&&this.g.apply(this,arguments)}T.prototype.h="",T.prototype.set=function(d){this.h=""+d},T.prototype.g=function(d,t,e){if(this.h+=String(d),t!=null)for(let i=1;i<arguments.length;i++)this.h+=arguments[i];return this};function P(d){d.h=""}T.prototype.toString=function(){return this.h};function F(){D.call(this)}n(F,D);var S1=null;function _(){D.call(this)}n(_,D);var w1=null;function j(){D.call(this)}n(j,D);var T1=null;F.prototype.m=function(){var d=S1;return d||(S1=d=$1(F,{0:{name:"NumberFormat",ia:"i18n.phonenumbers.NumberFormat"},1:{name:"pattern",required:!0,i:9,type:String},2:{name:"format",required:!0,i:9,type:String},3:{name:"leading_digits_pattern",aa:!0,i:9,type:String},4:{name:"national_prefix_formatting_rule",i:9,type:String},6:{name:"national_prefix_optional_when_formatting",i:8,defaultValue:!1,type:Boolean},5:{name:"domestic_carrier_code_formatting_rule",i:9,type:String}})),d},F.m=F.prototype.m,_.prototype.m=function(){var d=w1;return d||(w1=d=$1(_,{0:{name:"PhoneNumberDesc",ia:"i18n.phonenumbers.PhoneNumberDesc"},2:{name:"national_number_pattern",i:9,type:String},9:{name:"possible_length",aa:!0,i:5,type:Number},10:{name:"possible_length_local_only",aa:!0,i:5,type:Number},6:{name:"example_number",i:9,type:String}})),d},_.m=_.prototype.m,j.prototype.m=function(){var d=T1;return d||(T1=d=$1(j,{0:{name:"PhoneMetadata",ia:"i18n.phonenumbers.PhoneMetadata"},1:{name:"general_desc",i:11,type:_},2:{name:"fixed_line",i:11,type:_},3:{name:"mobile",i:11,type:_},4:{name:"toll_free",i:11,type:_},5:{name:"premium_rate",i:11,type:_},6:{name:"shared_cost",i:11,type:_},7:{name:"personal_number",i:11,type:_},8:{name:"voip",i:11,type:_},21:{name:"pager",i:11,type:_},25:{name:"uan",i:11,type:_},27:{name:"emergency",i:11,type:_},28:{name:"voicemail",i:11,type:_},29:{name:"short_code",i:11,type:_},30:{name:"standard_rate",i:11,type:_},31:{name:"carrier_specific",i:11,type:_},33:{name:"sms_services",i:11,type:_},24:{name:"no_international_dialling",i:11,type:_},9:{name:"id",required:!0,i:9,type:String},10:{name:"country_code",i:5,type:Number},11:{name:"international_prefix",i:9,type:String},17:{name:"preferred_international_prefix",i:9,type:String},12:{name:"national_prefix",i:9,type:String},13:{name:"preferred_extn_prefix",i:9,type:String},15:{name:"national_prefix_for_parsing",i:9,type:String},16:{name:"national_prefix_transform_rule",i:9,type:String},18:{name:"same_mobile_and_fixed_line_pattern",i:8,defaultValue:!1,type:Boolean},19:{name:"number_format",aa:!0,i:11,type:F},20:{name:"intl_number_format",aa:!0,i:11,type:F},22:{name:"main_country_for_code",i:8,defaultValue:!1,type:Boolean},23:{name:"leading_digits",i:9,type:String}})),d},j.m=j.prototype.m;function H(){D.call(this)}n(H,D);var L1=null,f2={ra:0,qa:1,pa:5,oa:10,na:20};H.prototype.m=function(){var d=L1;return d||(L1=d=$1(H,{0:{name:"PhoneNumber",ia:"i18n.phonenumbers.PhoneNumber"},1:{name:"country_code",required:!0,i:5,type:Number},2:{name:"national_number",required:!0,i:4,type:Number},3:{name:"extension",i:9,type:String},4:{name:"italian_leading_zero",i:8,type:Boolean},8:{name:"number_of_leading_zeros",i:5,defaultValue:1,type:Number},5:{name:"raw_input",i:9,type:String},6:{name:"country_code_source",i:14,defaultValue:0,type:f2},7:{name:"preferred_domestic_carrier_code",i:9,type:String}})),d},H.ctor=H,H.ctor.m=H.prototype.m;var Y={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".split(" "),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"]},E1={AC:[,[,,"(?:[01589]\\d|[46])\\d{4}",,,,,,,[5,6]],[,,"6[2-467]\\d{3}",,,,"62889",,,[5]],[,,"4\\d{4}",,,,"40123",,,[5]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],"AC",247,"00",,,,,,,,,,[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]],[,,"(?:0[1-9]|[1589]\\d)\\d{4}",,,,"542011",,,[6]],,,[,,,,,,,,,[-1]]],AD:[,[,,"(?:1|6\\d)\\d{7}|[135-9]\\d{5}",,,,,,,[6,8,9]],[,,"[78]\\d{5}",,,,"712345",,,[6]],[,,"690\\d{6}|[356]\\d{5}",,,,"312345",,,[6,9]],[,,"180[02]\\d{4}",,,,"18001234",,,[8]],[,,"[19]\\d{5}",,,,"912345",,,[6]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],"AD",376,"00",,,,,,,,[[,"(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],[,"(\\d{4})(\\d{4})","$1 $2",["1"]],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],,[,,,,,,,,,[-1]],,,[,,"1800\\d{4}",,,,,,,[8]],[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]]],AE:[,[,,"(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",,,,,,,[5,6,7,8,9,10,11,12]],[,,"[2-4679][2-8]\\d{6}",,,,"22345678",,,[8],[7]],[,,"5[024-68]\\d{7}",,,,"501234567",,,[9]],[,,"400\\d{6}|800\\d{2,9}",,,,"800123456"],[,,"900[02]\\d{5}",,,,"900234567",,,[9]],[,,"700[05]\\d{5}",,,,"700012345",,,[9]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],"AE",971,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],[,"(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],[,"(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],,[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]],[,,"600[25]\\d{5}",,,,"600212345",,,[9]],,,[,,,,,,,,,[-1]]],AF:[,[,,"[2-7]\\d{8}",,,,,,,[9],[7]],[,,"(?:[25][0-8]|[34][0-4]|6[0-5])[2-9]\\d{6}",,,,"234567890",,,,[7]],[,,"7\\d{8}",,,,"701234567",,,,[7]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],"AF",93,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[1-9]"]],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]]],AG:[,[,,"(?:268|[58]\\d\\d|900)\\d{7}",,,,,,,[10],[7]],[,,"268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}",,,,"2684601234",,,,[7]],[,,"268(?:464|7(?:1[3-9]|[28]\\d|3[0246]|64|7[0-689]))\\d{4}",,,,"2684641234",,,,[7]],[,,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",,,,"8002123456"],[,,"900[2-9]\\d{6}",,,,"9002123456"],[,,,,,,,,,[-1]],[,,"52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}",,,,"5002345678"],[,,"26848[01]\\d{4}",,,,"2684801234",,,,[7]],"AG",1,"011","1",,,"([457]\\d{6})$|1","268$1",,,,,[,,"26840[69]\\d{4}",,,,"2684061234",,,,[7]],,"268",[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]]],AI:[,[,,"(?:264|[58]\\d\\d|900)\\d{7}",,,,,,,[10],[7]],[,,"264(?:292|4(?:6[12]|9[78]))\\d{4}",,,,"2644612345",,,,[7]],[,,"264(?:235|4(?:69|76)|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}",,,,"2642351234",,,,[7]],[,,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",,,,"8002123456"],[,,"900[2-9]\\d{6}",,,,"9002123456"],[,,,,,,,,,[-1]],[,,"52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}",,,,"5002345678"],[,,,,,,,,,[-1]],"AI",1,"011","1",,,"([2457]\\d{6})$|1","264$1",,,,,[,,"264724\\d{4}",,,,"2647241234",,,,[7]],,"264",[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]]],AL:[,[,,"(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",,,,,,,[6,7,8,9],[5]],[,,"4505[0-2]\\d{3}|(?:[2358][16-9]\\d[2-9]|4410)\\d{4}|(?:[2358][2-5][2-9]|4(?:[2-57-9][2-9]|6\\d))\\d{5}",,,,"22345678",,,[8],[5,6,7]],[,,"6(?:[78][2-9]|9\\d)\\d{6}",,,,"672123456",,,[9]],[,,"800\\d{4}",,,,"8001234",,,[7]],[,,"900[1-9]\\d\\d",,,,"900123",,,[6]],[,,"808[1-9]\\d\\d",,,,"808123",,,[6]],[,,"700[2-9]\\d{4}",,,,"70021234",,,[8]],[,,,,,,,,,[-1]],"AL",355,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],[,"(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],[,"(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],,[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]]],AM:[,[,,"(?:[1-489]\\d|55|60|77)\\d{6}",,,,,,,[8],[5,6]],[,,"(?:(?:1[0-25]|47)\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2)\\d{5}",,,,"10123456",,,,[5,6]],[,,"(?:33|4[1349]|55|77|88|9[13-9])\\d{6}",,,,"77123456"],[,,"800\\d{5}",,,,"80012345"],[,,"90[016]\\d{5}",,,,"90012345"],[,,"80[1-4]\\d{5}",,,,"80112345"],[,,,,,,,,,[-1]],[,,"60(?:2[78]|3[5-9]|4[02-9]|5[0-46-9]|[6-8]\\d|9[0-2])\\d{4}",,,,"60271234"],"AM",374,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],[,"(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],[,"(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],[,"(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],,[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]]],AO:[,[,,"[29]\\d{8}",,,,,,,[9]],[,,"2\\d(?:[0134][25-9]|[25-9]\\d)\\d{5}",,,,"222123456"],[,,"9[1-579]\\d{7}",,,,"923123456"],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],"AO",244,"00",,,,,,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2