UNPKG

intl-tel-input

Version:

A JavaScript plugin for entering and validating international telephone numbers

16 lines (14 loc) 301 kB
/* * International Telephone Input v25.3.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 I1=Object.defineProperty;var x2=Object.getOwnPropertyDescriptor;var R2=Object.getOwnPropertyNames;var O2=Object.prototype.hasOwnProperty;var k2=(g,e)=>{for(var n in e)I1(g,n,{get:e[n],enumerable:!0})},B2=(g,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of R2(e))!O2.call(g,u)&&u!==n&&I1(g,u,{get:()=>e[u],enumerable:!(r=x2(e,u))||r.enumerable});return g};var H2=g=>B2(I1({},"__esModule",{value:!0}),g);var Y2={};k2(Y2,{default:()=>Z2});var s2=[["af","93"],["ax","358",1],["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,null,"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"],"0"],["cc","61",1,["89162"],"0"],["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"],"0"],["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"],"0"],["il","972"],["it","39",0],["jm","1",4,["876","658"]],["jp","81"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962"],["kz","7",1,["33","7"],"8"],["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"],"0"],["mx","52"],["fm","691"],["md","373"],["mc","377"],["mn","976"],["me","382"],["ms","1",16,["664"]],["ma","212",0,null,"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,null,"0"],["ro","40"],["ru","7",0,null,"8"],["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,null,"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"],"0"],["ye","967"],["zm","260"],["zw","263"]],u2=[];for(let g=0;g<s2.length;g++){let e=s2[g];u2[g]={name:"",iso2:e[0],dialCode:e[1],priority:e[2]||0,areaCodes:e[3]||null,nodeById:{},nationalPrefix:e[4]||null}}var K=u2;var G2={ad:"Andorra",ae:"United Arab Emirates",af:"Afghanistan",ag:"Antigua & Barbuda",ai:"Anguilla",al:"Albania",am:"Armenia",ao:"Angola",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",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",gt:"Guatemala",gu:"Guam",gw:"Guinea-Bissau",gy:"Guyana",hk:"Hong Kong SAR China",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",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",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",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"},a2=G2;var U2={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"},l2=U2;var F2={...a2,...l2},_1=F2;for(let g=0;g<K.length;g++)K[g].name=_1[K[g].iso2];var K2=0,p2={allowDropdown:!0,autoPlaceholder:"polite",containerClass:"",countryOrder:null,countrySearch:!0,customPlaceholder:null,dropdownContainer:null,excludeCountries:[],fixDropdownWidth:!0,formatAsYouType:!0,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:null,i18n:{},initialCountry:"",loadUtils:null,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,validationNumberTypes:["MOBILE"]},V2=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],c1=g=>g.replace(/\D/g,""),h2=(g="")=>g.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),c2=g=>{let e=c1(g);if(e.charAt(0)==="1"){let n=e.substr(1,3);return V2.includes(n)}return!1},j2=(g,e,n,r)=>{if(n===0&&!r)return 0;let u=0;for(let l=0;l<e.length;l++){if(/[+0-9]/.test(e[l])&&u++,u===g&&!r)return l+1;if(r&&u===g+1)return l}return e.length},T=(g,e,n)=>{let r=document.createElement(g);return e&&Object.entries(e).forEach(([u,l])=>r.setAttribute(u,l)),n&&n.appendChild(r),r},e1=(g,...e)=>{let{instances:n}=f;Object.values(n).forEach(r=>r[g](...e))},b1=class{constructor(e,n={}){this.id=K2++,this.telInput=e,this.highlightedItem=null,this.options=Object.assign({},p2,n),this.hadInitialPlaceholder=!!e.getAttribute("placeholder")}_init(){this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!1),this.options.onlyCountries.length===1&&(this.options.initialCountry=this.options.onlyCountries[0]),this.options.separateDialCode&&(this.options.nationalMode=!1),this.options.allowDropdown&&!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]");let e=this.options.allowDropdown||this.options.separateDialCode;this.showSelectedCountryOnLeft=this.isRTL?!e:e,this.options.separateDialCode&&(this.isRTL?this.originalPaddingRight=this.telInput.style.paddingRight:this.originalPaddingLeft=this.telInput.style.paddingLeft),this.options.i18n={..._1,...this.options.i18n};let n=new Promise((u,l)=>{this.resolveAutoCountryPromise=u,this.rejectAutoCountryPromise=l}),r=new Promise((u,l)=>{this.resolveUtilsScriptPromise=u,this.rejectUtilsScriptPromise=l});this.promise=Promise.all([n,r]),this.selectedCountryData={},this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests()}_processCountryData(){this._processAllCountries(),this._processDialCodes(),this._translateCountryNames(),this._sortCountries()}_sortCountries(){this.options.countryOrder&&(this.options.countryOrder=this.options.countryOrder.map(e=>e.toLowerCase())),this.countries.sort((e,n)=>{let{countryOrder:r}=this.options;if(r){let u=r.indexOf(e.iso2),l=r.indexOf(n.iso2),p=u>-1,y=l>-1;if(p||y)return p&&y?u-l:p?-1:1}return e.name.localeCompare(n.name)})}_addToDialCodeMap(e,n,r){n.length>this.dialCodeMaxLen&&(this.dialCodeMaxLen=n.length),this.dialCodeToIso2Map.hasOwnProperty(n)||(this.dialCodeToIso2Map[n]=[]);for(let l=0;l<this.dialCodeToIso2Map[n].length;l++)if(this.dialCodeToIso2Map[n][l]===e)return;let u=r!==void 0?r:this.dialCodeToIso2Map[n].length;this.dialCodeToIso2Map[n][u]=e}_processAllCountries(){let{onlyCountries:e,excludeCountries:n}=this.options;if(e.length){let r=e.map(u=>u.toLowerCase());this.countries=K.filter(u=>r.includes(u.iso2))}else if(n.length){let r=n.map(u=>u.toLowerCase());this.countries=K.filter(u=>!r.includes(u.iso2))}else this.countries=K}_translateCountryNames(){for(let e=0;e<this.countries.length;e++){let n=this.countries[e].iso2.toLowerCase();this.options.i18n.hasOwnProperty(n)&&(this.countries[e].name=this.options.i18n[n])}}_processDialCodes(){this.dialCodes={},this.dialCodeMaxLen=0,this.dialCodeToIso2Map={};for(let e=0;e<this.countries.length;e++){let n=this.countries[e];this.dialCodes[n.dialCode]||(this.dialCodes[n.dialCode]=!0),this._addToDialCodeMap(n.iso2,n.dialCode,n.priority)}for(let e=0;e<this.countries.length;e++){let n=this.countries[e];if(n.areaCodes){let r=this.dialCodeToIso2Map[n.dialCode][0];for(let u=0;u<n.areaCodes.length;u++){let l=n.areaCodes[u];for(let p=1;p<l.length;p++){let y=l.substr(0,p),m=n.dialCode+y;this._addToDialCodeMap(r,m),this._addToDialCodeMap(n.iso2,m)}this._addToDialCodeMap(n.iso2,n.dialCode+l)}}}}_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:e,separateDialCode:n,showFlags:r,containerClass:u,hiddenInput:l,dropdownContainer:p,fixDropdownWidth:y,useFullscreenPopup:m,countrySearch:_,i18n:I}=this.options,L="iti";e&&(L+=" iti--allow-dropdown"),r&&(L+=" iti--show-flags"),u&&(L+=` ${u}`),m||(L+=" iti--inline-dropdown");let b=T("div",{class:L});if(this.telInput.parentNode?.insertBefore(b,this.telInput),e||r||n){this.countryContainer=T("div",{class:"iti__country-container"},b),this.showSelectedCountryOnLeft?this.countryContainer.style.left="0px":this.countryContainer.style.right="0px",e?(this.selectedCountry=T("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),this.telInput.disabled&&this.selectedCountry.setAttribute("disabled","true")):this.selectedCountry=T("div",{class:"iti__selected-country"},this.countryContainer);let k=T("div",{class:"iti__selected-country-primary"},this.selectedCountry);if(this.selectedCountryInner=T("div",{class:"iti__flag"},k),this.selectedCountryA11yText=T("span",{class:"iti__a11y-text"},this.selectedCountryInner),e&&(this.dropdownArrow=T("div",{class:"iti__arrow","aria-hidden":"true"},k)),n&&(this.selectedDialCode=T("div",{class:"iti__selected-dial-code"},this.selectedCountry)),e){let E=y?"":"iti--flexible-dropdown-width";if(this.dropdownContent=T("div",{id:`iti-${this.id}__dropdown-content`,class:`iti__dropdown-content iti__hide ${E}`}),_&&(this.searchInput=T("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=T("span",{class:"iti__a11y-text"},this.dropdownContent)),this.countryList=T("ul",{class:"iti__country-list",id:`iti-${this.id}__country-listbox`,role:"listbox","aria-label":I.countryListAriaLabel},this.dropdownContent),this._appendListItems(),_&&this._updateSearchResultsText(),p){let N="iti iti--container";m?N+=" iti--fullscreen-popup":N+=" iti--inline-dropdown",this.dropdown=T("div",{class:N}),this.dropdown.appendChild(this.dropdownContent)}else this.countryContainer.appendChild(this.dropdownContent)}}if(b.appendChild(this.telInput),this._updateInputPadding(),l){let k=this.telInput.getAttribute("name")||"",E=l(k);if(E.phone){let N=this.telInput.form?.querySelector(`input[name="${E.phone}"]`);N?this.hiddenInput=N:(this.hiddenInput=T("input",{type:"hidden",name:E.phone}),b.appendChild(this.hiddenInput))}if(E.country){let N=this.telInput.form?.querySelector(`input[name="${E.country}"]`);N?this.hiddenInputCountry=N:(this.hiddenInputCountry=T("input",{type:"hidden",name:E.country}),b.appendChild(this.hiddenInputCountry))}}}_appendListItems(){for(let e=0;e<this.countries.length;e++){let n=this.countries[e],r=e===0?"iti__highlight":"",u=T("li",{id:`iti-${this.id}__item-${n.iso2}`,class:`iti__country ${r}`,tabindex:"-1",role:"option","data-dial-code":n.dialCode,"data-country-code":n.iso2,"aria-selected":"false"},this.countryList);n.nodeById[this.id]=u;let l="";this.options.showFlags&&(l+=`<div class='iti__flag iti__${n.iso2}'></div>`),l+=`<span class='iti__country-name'>${n.name}</span>`,l+=`<span class='iti__dial-code'>+${n.dialCode}</span>`,u.insertAdjacentHTML("beforeend",l)}}_setInitialState(e=!1){let n=this.telInput.getAttribute("value"),r=this.telInput.value,l=n&&n.charAt(0)==="+"&&(!r||r.charAt(0)!=="+")?n:r,p=this._getDialCode(l),y=c2(l),{initialCountry:m,geoIpLookup:_}=this.options,I=m==="auto"&&_;if(p&&!y)this._updateCountryFromNumber(l);else if(!I||e){let L=m?m.toLowerCase():"";L&&this._getCountryData(L,!0)?this._setCountry(L):p&&y?this._setCountry("us"):this._setCountry()}l&&this._updateValFromNumber(l)}_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 e=this.telInput.closest("label");e&&e.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{loadUtils:e,initialCountry:n,geoIpLookup:r}=this.options;e&&!f.utils?(this._handlePageLoad=()=>{window.removeEventListener("load",this._handlePageLoad),f.attachUtils(e)?.catch(()=>{})},f.documentReady()?this._handlePageLoad():window.addEventListener("load",this._handlePageLoad)):this.resolveUtilsScriptPromise(),n==="auto"&&r&&!this.selectedCountryData.iso2?this._loadAutoCountry():this.resolveAutoCountryPromise()}_loadAutoCountry(){f.autoCountry?this.handleAutoCountry():f.startedLoadingAutoCountry||(f.startedLoadingAutoCountry=!0,typeof this.options.geoIpLookup=="function"&&this.options.geoIpLookup((e="")=>{let n=e.toLowerCase();n&&this._getCountryData(n,!0)?(f.autoCountry=n,setTimeout(()=>e1("handleAutoCountry"))):(this._setInitialState(!0),e1("rejectAutoCountryPromise"))},()=>{this._setInitialState(!0),e1("rejectAutoCountryPromise")}))}_openDropdownWithPlus(){this._openDropdown(),this.searchInput.value="+",this._filterCountries("",!0)}_initTelInputListeners(){let{strictMode:e,formatAsYouType:n,separateDialCode:r,formatOnDisplay:u,allowDropdown:l,countrySearch:p}=this.options,y=!1;/\p{L}/u.test(this.telInput.value)&&(y=!0),this._handleInputEvent=m=>{if(this.isAndroid&&m?.data==="+"&&r&&l&&p){let b=this.telInput.selectionStart||0,k=this.telInput.value.substring(0,b-1),E=this.telInput.value.substring(b);this.telInput.value=k+E,this._openDropdownWithPlus();return}this._updateCountryFromNumber(this.telInput.value)&&this._triggerCountryChange();let _=m?.data&&/[^+0-9]/.test(m.data),I=m?.inputType==="insertFromPaste"&&this.telInput.value;_||I&&!e?y=!0:/[^+0-9]/.test(this.telInput.value)||(y=!1);let L=m?.detail&&m.detail.isSetNumber&&!u;if(n&&!y&&!L){let b=this.telInput.selectionStart||0,E=this.telInput.value.substring(0,b).replace(/[^+0-9]/g,"").length,N=m?.inputType==="deleteContentForward",z=this._formatNumberAsYouType(),Z=j2(E,z,b,N);this.telInput.value=z,this.telInput.setSelectionRange(Z,Z)}},this.telInput.addEventListener("input",this._handleInputEvent),(e||r)&&(this._handleKeydownEvent=m=>{if(m.key&&m.key.length===1&&!m.altKey&&!m.ctrlKey&&!m.metaKey){if(r&&l&&p&&m.key==="+"){m.preventDefault(),this._openDropdownWithPlus();return}if(e){let _=this.telInput.value,I=_.charAt(0)==="+",L=!I&&this.telInput.selectionStart===0&&m.key==="+",b=/^[0-9]$/.test(m.key),k=r?b:L||b,E=_.slice(0,this.telInput.selectionStart)+m.key+_.slice(this.telInput.selectionEnd),N=this._getFullNumber(E),z=f.utils.getCoreNumber(N,this.selectedCountryData.iso2),Z=this.maxCoreNumberLength&&z.length>this.maxCoreNumberLength,$1=!1;if(I){let p1=this.selectedCountryData.iso2;$1=this._getCountryFromNumber(N)!==p1}(!k||Z&&!$1&&!L)&&m.preventDefault()}}},this.telInput.addEventListener("keydown",this._handleKeydownEvent))}_cap(e){let n=parseInt(this.telInput.getAttribute("maxlength")||"",10);return n&&e.length>n?e.substr(0,n):e}_trigger(e,n={}){let r=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});this.telInput.dispatchEvent(r)}_openDropdown(){let{fixDropdownWidth:e,countrySearch:n}=this.options;if(e&&(this.dropdownContent.style.width=`${this.telInput.offsetWidth}px`),this.dropdownContent.classList.remove("iti__hide"),this.selectedCountry.setAttribute("aria-expanded","true"),this._setDropdownPosition(),n){let r=this.countryList.firstElementChild;r&&(this._highlightListItem(r,!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 e=this.telInput.getBoundingClientRect(),n=this.telInput.offsetHeight;this.options.dropdownContainer&&(this.dropdown.style.top=`${e.top+n}px`,this.dropdown.style.left=`${e.left}px`,this._handleWindowScroll=()=>this._closeDropdown(),window.addEventListener("scroll",this._handleWindowScroll))}}_bindDropdownListeners(){this._handleMouseoverCountryList=u=>{let l=u.target?.closest(".iti__country");l&&this._highlightListItem(l,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=u=>{let l=u.target?.closest(".iti__country");l&&this._selectListItem(l)},this.countryList.addEventListener("click",this._handleClickCountryList);let e=!0;this._handleClickOffToClose=()=>{e||this._closeDropdown(),e=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose);let n="",r=null;if(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()),!this.options.countrySearch&&/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(u.key)&&(u.stopPropagation(),r&&clearTimeout(r),n+=u.key.toLowerCase(),this._searchForCountry(n),r=setTimeout(()=>{n=""},1e3))},document.addEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch){let u=()=>{let p=this.searchInput.value.trim();p?this._filterCountries(p):this._filterCountries("",!0)},l=null;this._handleSearchChange=()=>{l&&clearTimeout(l),l=setTimeout(()=>{u(),l=null},100)},this.searchInput.addEventListener("input",this._handleSearchChange),this.searchInput.addEventListener("click",p=>p.stopPropagation())}}_searchForCountry(e){for(let n=0;n<this.countries.length;n++){let r=this.countries[n];if(r.name.substr(0,e.length).toLowerCase()===e){let l=r.nodeById[this.id];this._highlightListItem(l,!1),this._scrollTo(l);break}}}_filterCountries(e,n=!1){let r=!0;this.countryList.innerHTML="";let u=h2(e);for(let l=0;l<this.countries.length;l++){let p=this.countries[l],y=h2(p.name),m=p.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map(I=>I[0]).join("").toLowerCase(),_=`+${p.dialCode}`;if(n||y.includes(u)||_.includes(u)||p.iso2.includes(u)||m.includes(u)){let I=p.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:e}=this.options,n=this.countryList.childElementCount,r;n===0?r=e.zeroSearchResults:n===1?r=e.oneSearchResult:r=e.multipleSearchResults.replace("${count}",n.toString()),this.searchResultsA11yText.textContent=r}_handleUpDownKey(e){let n=e==="ArrowUp"?this.highlightedItem?.previousElementSibling:this.highlightedItem?.nextElementSibling;!n&&this.countryList.childElementCount>1&&(n=e==="ArrowUp"?this.countryList.lastElementChild:this.countryList.firstElementChild),n&&(this._scrollTo(n),this._highlightListItem(n,!1))}_handleEnterKey(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}_updateValFromNumber(e){let n=e;if(this.options.formatOnDisplay&&f.utils&&this.selectedCountryData){let r=this.options.nationalMode||n.charAt(0)!=="+"&&!this.options.separateDialCode,{NATIONAL:u,INTERNATIONAL:l}=f.utils.numberFormat,p=r?u:l;n=f.utils.formatNumber(n,this.selectedCountryData.iso2,p)}n=this._beforeSetNumber(n),this.telInput.value=n}_updateCountryFromNumber(e){let n=this._getCountryFromNumber(e);return n!==null?this._setCountry(n):!1}_ensureHasDialCode(e){let{dialCode:n,nationalPrefix:r}=this.selectedCountryData;if(e.charAt(0)==="+"||!n)return e;let p=r&&e.charAt(0)===r&&!this.options.separateDialCode?e.substring(1):e;return`+${n}${p}`}_getCountryFromNumber(e){let n=e.indexOf("+"),r=n?e.substring(n):e,u=this.selectedCountryData.iso2,l=this.selectedCountryData.dialCode;r=this._ensureHasDialCode(r);let p=this._getDialCode(r,!0),y=c1(r);if(p){let m=c1(p),_=this.dialCodeToIso2Map[m];if(!u&&this.defaultCountry&&_.includes(this.defaultCountry))return this.defaultCountry;let I=u&&_.includes(u)&&(y.length===m.length||!this.selectedCountryData.areaCodes);if(!(l==="1"&&c2(y))&&!I){for(let b=0;b<_.length;b++)if(_[b])return _[b]}}else{if(r.charAt(0)==="+"&&y.length)return"";if((!r||r==="+")&&!this.selectedCountryData.iso2)return this.defaultCountry}return null}_highlightListItem(e,n){let r=this.highlightedItem;if(r&&(r.classList.remove("iti__highlight"),r.setAttribute("aria-selected","false")),this.highlightedItem=e,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.options.countrySearch&&this.searchInput.setAttribute("aria-activedescendant",u)}n&&this.highlightedItem.focus()}_getCountryData(e,n){for(let r=0;r<this.countries.length;r++)if(this.countries[r].iso2===e)return this.countries[r];if(n)return null;throw new Error(`No country data for '${e}'`)}_setCountry(e){let{separateDialCode:n,showFlags:r,i18n:u}=this.options,l=this.selectedCountryData.iso2?this.selectedCountryData:{};if(this.selectedCountryData=e?this._getCountryData(e,!1)||{}:{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2),this.selectedCountryInner){let p="",y="";e&&r?(p=`iti__flag iti__${e}`,y=`${this.selectedCountryData.name} +${this.selectedCountryData.dialCode}`):(p="iti__flag iti__globe",y=u.noCountrySelected),this.selectedCountryInner.className=p,this.selectedCountryA11yText.textContent=y}if(this._setSelectedCountryTitleAttribute(e,n),n){let p=this.selectedCountryData.dialCode?`+${this.selectedCountryData.dialCode}`:"";this.selectedDialCode.innerHTML=p,this._updateInputPadding()}return this._updatePlaceholder(),this._updateMaxLength(),l.iso2!==e}_updateInputPadding(){if(this.selectedCountry){let n=(this.selectedCountry.offsetWidth||this._getHiddenSelectedCountryWidth())+6;this.showSelectedCountryOnLeft?this.telInput.style.paddingLeft=`${n}px`:this.telInput.style.paddingRight=`${n}px`}}_updateMaxLength(){let{strictMode:e,placeholderNumberType:n,validationNumberTypes:r}=this.options,{iso2:u}=this.selectedCountryData;if(e&&f.utils)if(u){let l=f.utils.numberType[n],p=f.utils.getExampleNumber(u,!1,l,!0),y=p;for(;f.utils.isPossibleNumber(p,u,r);)y=p,p+="0";let m=f.utils.getCoreNumber(y,u);this.maxCoreNumberLength=m.length,u==="by"&&(this.maxCoreNumberLength=m.length+1)}else this.maxCoreNumberLength=null}_setSelectedCountryTitleAttribute(e=null,n){if(!this.selectedCountry)return;let r;e&&!n?r=`${this.selectedCountryData.name}: +${this.selectedCountryData.dialCode}`:e?r=this.selectedCountryData.name:r="Unknown",this.selectedCountry.setAttribute("title",r)}_getHiddenSelectedCountryWidth(){if(this.telInput.parentNode){let e=this.telInput.parentNode.cloneNode(!1);e.style.visibility="hidden",document.body.appendChild(e);let n=this.countryContainer.cloneNode();e.appendChild(n);let r=this.selectedCountry.cloneNode(!0);n.appendChild(r);let u=r.offsetWidth;return document.body.removeChild(e),u}return 0}_updatePlaceholder(){let{autoPlaceholder:e,placeholderNumberType:n,nationalMode:r,customPlaceholder:u}=this.options,l=e==="aggressive"||!this.hadInitialPlaceholder&&e==="polite";if(f.utils&&l){let p=f.utils.numberType[n],y=this.selectedCountryData.iso2?f.utils.getExampleNumber(this.selectedCountryData.iso2,r,p):"";y=this._beforeSetNumber(y),typeof u=="function"&&(y=u(y,this.selectedCountryData)),this.telInput.setAttribute("placeholder",y)}}_selectListItem(e){let n=this._setCountry(e.getAttribute("data-country-code"));this._closeDropdown(),this._updateDialCode(e.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.options.countrySearch&&this.searchInput.removeAttribute("aria-activedescendant"),this.dropdownArrow.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch&&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._handlePageLoad&&window.removeEventListener("load",this._handlePageLoad),this._trigger("close:countrydropdown")}_scrollTo(e){let n=this.countryList,r=document.documentElement.scrollTop,u=n.offsetHeight,l=n.getBoundingClientRect().top+r,p=l+u,y=e.offsetHeight,m=e.getBoundingClientRect().top+r,_=m+y,I=m-l+n.scrollTop;if(m<l)n.scrollTop=I;else if(_>p){let L=u-y;n.scrollTop=I-L}}_updateDialCode(e){let n=this.telInput.value,r=`+${e}`,u;if(n.charAt(0)==="+"){let l=this._getDialCode(n);l?u=n.replace(l,r):u=r,this.telInput.value=u}}_getDialCode(e,n){let r="";if(e.charAt(0)==="+"){let u="";for(let l=0;l<e.length;l++){let p=e.charAt(l);if(!isNaN(parseInt(p,10))){if(u+=p,n)this.dialCodeToIso2Map[u]&&(r=e.substr(0,l+1));else if(this.dialCodes[u]){r=e.substr(0,l+1);break}if(u.length===this.dialCodeMaxLen)break}}}return r}_getFullNumber(e){let n=e||this.telInput.value.trim(),{dialCode:r}=this.selectedCountryData,u,l=c1(n);return this.options.separateDialCode&&n.charAt(0)!=="+"&&r&&l?u=`+${r}`:u="",u+n}_beforeSetNumber(e){let n=e;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 e=this._getFullNumber(),n=f.utils?f.utils.formatNumberAsYouType(e,this.selectedCountryData.iso2):e,{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"&&f.autoCountry&&(this.defaultCountry=f.autoCountry,this.selectedCountryData.iso2||this.selectedCountryInner.classList.contains("iti__globe")||this.setCountry(this.defaultCountry),this.resolveAutoCountryPromise())}handleUtils(){f.utils&&(this.telInput.value&&this._updateValFromNumber(this.telInput.value),this.selectedCountryData.iso2&&(this._updatePlaceholder(),this._updateMaxLength())),this.resolveUtilsScriptPromise()}destroy(){let{allowDropdown:e,separateDialCode:n}=this.options;if(e){this._closeDropdown(),this.selectedCountry.removeEventListener("click",this._handleClickSelectedCountry),this.countryContainer.removeEventListener("keydown",this._handleCountryContainerKeydown);let l=this.telInput.closest("label");l&&l.removeEventListener("click",this._handleLabelClick)}let{form:r}=this.telInput;this._handleHiddenInputSubmit&&r&&r.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"),n&&(this.isRTL?this.telInput.style.paddingRight=this.originalPaddingRight:this.telInput.style.paddingLeft=this.originalPaddingLeft);let u=this.telInput.parentNode;u?.parentNode?.insertBefore(this.telInput,u),u?.parentNode?.removeChild(u),delete f.instances[this.id]}getExtension(){return f.utils?f.utils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""}getNumber(e){if(f.utils){let{iso2:n}=this.selectedCountryData;return f.utils.formatNumber(this._getFullNumber(),n,e)}return""}getNumberType(){return f.utils?f.utils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99}getSelectedCountryData(){return this.selectedCountryData}getValidationError(){if(f.utils){let{iso2:e}=this.selectedCountryData;return f.utils.getValidationError(this._getFullNumber(),e)}return-99}isValidNumber(){if(!this.selectedCountryData.iso2)return!1;let e=this._getFullNumber(),n=e.search(/\p{L}/u);if(n>-1){let r=e.substring(0,n),u=this._utilsIsPossibleNumber(r),l=this._utilsIsPossibleNumber(e);return u&&l}return this._utilsIsPossibleNumber(e)}_utilsIsPossibleNumber(e){return f.utils?f.utils.isPossibleNumber(e,this.selectedCountryData.iso2,this.options.validationNumberTypes):null}isValidNumberPrecise(){if(!this.selectedCountryData.iso2)return!1;let e=this._getFullNumber(),n=e.search(/\p{L}/u);if(n>-1){let r=e.substring(0,n),u=this._utilsIsValidNumber(r),l=this._utilsIsValidNumber(e);return u&&l}return this._utilsIsValidNumber(e)}_utilsIsValidNumber(e){return f.utils?f.utils.isValidNumber(e,this.selectedCountryData.iso2,this.options.validationNumberTypes):null}setCountry(e){let n=e?.toLowerCase(),r=this.selectedCountryData.iso2;(e&&n!==r||!e&&r)&&(this._setCountry(n),this._updateDialCode(this.selectedCountryData.dialCode),this._triggerCountryChange())}setNumber(e){let n=this._updateCountryFromNumber(e);this._updateValFromNumber(e),n&&this._triggerCountryChange(),this._trigger("input",{isSetNumber:!0})}setPlaceholderNumberType(e){this.options.placeholderNumberType=e,this._updatePlaceholder()}setDisabled(e){this.telInput.disabled=e,e?this.selectedCountry.setAttribute("disabled","true"):this.selectedCountry.removeAttribute("disabled")}},W2=g=>{if(!f.utils&&!f.startedLoadingUtilsScript){let e;if(typeof g=="function")try{e=Promise.resolve(g())}catch(n){return Promise.reject(n)}else return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof g}`));return f.startedLoadingUtilsScript=!0,e.then(n=>{let r=n?.default;if(!r||typeof r!="object")throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");return f.utils=r,e1("handleUtils"),!0}).catch(n=>{throw e1("rejectUtilsScriptPromise",n),n})}return null},f=Object.assign((g,e)=>{let n=new b1(g,e);return n._init(),g.setAttribute("data-intl-tel-input-id",n.id.toString()),f.instances[n.id]=n,n},{defaults:p2,documentReady:()=>document.readyState==="complete",getCountryData:()=>K,getInstance:g=>{let e=g.getAttribute("data-intl-tel-input-id");return e?f.instances[e]:null},instances:{},attachUtils:W2,startedLoadingUtilsScript:!1,startedLoadingAutoCountry:!1,version:"25.3.1"}),S1=f;(function(){var g=this||self;function e(d,t){d=d.split(".");var $=g;d[0]in $||typeof $.execScript>"u"||$.execScript("var "+d[0]);for(var i;d.length&&(i=d.shift());)d.length||t===void 0?$[i]&&$[i]!==Object.prototype[i]?$=$[i]:$=$[i]={}:$[i]=t}function n(d,t){function $(){}$.prototype=t.prototype,d.ma=t.prototype,d.prototype=new $,d.prototype.constructor=d,d.sa=function(i,o,s){for(var a=Array(arguments.length-2),h=2;h<arguments.length;h++)a[h-2]=arguments[h];return t.prototype[o].apply(i,a)}}function r(d){let t=[],$=0;for(let i in d)t[$++]=d[i];return t}var u=class{constructor(d){if(l!==l)throw Error("SafeUrl is not meant to be built directly");this.g=d}toString(){return this.g.toString()}},l={};new u("about:invalid#zClosurez"),new u("about:blank");let p={};class y{constructor(){if(p!==p)throw Error("SafeStyle is not meant to be built directly")}toString(){return""}}new y;let m={};class _{constructor(){if(m!==m)throw Error("SafeStyleSheet is not meant to be built directly")}toString(){return""}}new _;let I={};class L{constructor(){var t=g.trustedTypes&&g.trustedTypes.emptyHTML||"";if(I!==I)throw Error("SafeHtml is not meant to be built directly");this.g=t}toString(){return this.g.toString()}}new L;function b(d,t){switch(this.g=d,this.l=!!t.aa,this.h=t.i,this.s=t.type,this.o=!1,this.h){case N:case z:case Z:case $1:case p1:case E:case k:this.o=!0}this.j=t.defaultValue}var k=1,E=2,N=3,z=4,Z=6,$1=16,p1=18;function L1(d,t){for(this.h=d,this.g={},d=0;d<t.length;d++){var $=t[d];this.g[$.g]=$}}function g2(d){return d=r(d.g),d.sort(function(t,$){return t.g-$.g}),d}function P(){this.h={},this.j=this.m().g,this.g=this.l=null}P.prototype.has=function(d){return x(this,d.g)},P.prototype.get=function(d,t){return c(this,d.g,t)},P.prototype.set=function(d,t){A(this,d.g,t)},P.prototype.add=function(d,t){T1(this,d.g,t)};function w1(d,t){for(var $=g2(d.m()),i=0;i<$.length;i++){var o=$[i],s=o.g;if(x(t,s)){d.g&&delete d.g[o.g];var a=o.h==11||o.h==10;if(o.l){o=D(t,s);for(var h=0;h<o.length;h++)T1(d,s,a?o[h].clone():o[h])}else o=n1(t,s),a?(a=n1(d,s))?w1(a,o):A(d,s,o.clone()):A(d,s,o)}}}P.prototype.clone=function(){var d=new this.constructor;return d!=this&&(d.h={},d.g&&(d.g={}),w1(d,this)),d};function x(d,t){return d.h[t]!=null}function n1(d,t){var $=d.h[t];if($==null)return null;if(d.l){if(!(t in d.g)){var i=d.l,o=d.j[t];if($!=null)if(o.l){for(var s=[],a=0;a<$.length;a++)s[a]=i.h(o,$[a]);$=s}else $=i.h(o,$);return d.g[t]=$}return d.g[t]}return $}function c(d,t,$){var i=n1(d,t);return d.j[t].l?i[$||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 D(d,t){return n1(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 A(d,t,$){d.h[t]=$,d.g&&(d.g[t]=$)}function T1(d,t,$){d.h[t]||(d.h[t]=[]),d.h[t].push($),d.g&&delete d.g[t]}function i1(d,t){var $=[],i;for(i in t)i!=0&&$.push(new b(i,t[i]));return new L1(d,$)}function r1(){}r1.prototype.g=function(d){throw new d.h,Error("Unimplemented")},r1.prototype.h=function(d,t){if(d.h==11||d.h==10)return t instanceof P?t:this.g(d.s.prototype.m(),t);if(d.h==14)return typeof t=="string"&&E1.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"||E1.test(t)))return Number(t);return t};var E1=/^-?[0-9]+$/;function f1(){}n(f1,r1),f1.prototype.g=function(d,t){return d=new d.h,d.l=this,d.h=t,d.g={},d};function J(){}n(J,f1),J.prototype.h=function(d,t){return d.h==8?!!t:r1.prototype.h.apply(this,arguments)},J.prototype.g=function(d,t){return J.ma.g.call(this,d,t)};function w(d,t){d!=null&&this.g.apply(this,arguments)}w.prototype.h="",w.prototype.set=function(d){this.h=""+d},w.prototype.g=function(d,t,$){if(this.h+=String(d),t!=null)for(let i=1;i<arguments.length;i++)this.h+=arguments[i];return this};function R(d){d.h=""}w.prototype.toString=function(){return this.h};function V(){P.call(this)}n(V,P);var N1=null;function S(){P.call(this)}n(S,P);var A1=null;function j(){P.call(this)}n(j,P);var M1=null;V.prototype.m=function(){var d=N1;return d||(N1=d=i1(V,{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},V.m=V.prototype.m,S.prototype.m=function(){var d=A1;return d||(A1=d=i1(S,{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},S.m=S.prototype.m,j.prototype.m=function(){var d=M1;return d||(M1=d=i1(j,{0:{name:"PhoneMetadata",ia:"i18n.phonenumbers.PhoneMetadata"},1:{name:"general_desc",i:11,type:S},2:{name:"fixed_line",i:11,type:S},3:{name:"mobile",i:11,type:S},4:{name:"toll_free",i:11,type:S},5:{name:"premium_rate",i:11,type:S},6:{name:"shared_cost",i:11,type:S},7:{name:"personal_number",i:11,type:S},8:{name:"voip",i:11,type:S},21:{name:"pager",i:11,type:S},25:{name:"uan",i:11,type:S},27:{name:"emergency",i:11,type:S},28:{name:"voicemail",i:11,type:S},29:{name:"short_code",i:11,type:S},30:{name:"standard_rate",i:11,type:S},31:{name:"carrier_specific",i:11,type:S},33:{name:"sms_services",i:11,type:S},24:{name:"no_international_dialling",i:11,type:S},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:V},20:{name:"intl_number_format",aa:!0,i:11,type:V},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 U(){P.call(this)}n(U,P);var D1=null,m2={ra:0,qa:1,pa:5,oa:10,na:20};U.prototype.m=function(){var d=D1;return d||(D1=d=i1(U,{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:m2},7:{name:"preferred_domestic_carrier_code",i:9,type:String}})),d},U.ctor=U,U.ctor.m=U.prototype.m;var q={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"]},P1={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}",,,,"268406