intl-tel-input 25.10.5 → 25.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v25.10.5
2
+ * International Telephone Input v25.10.6
3
3
  * https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -1267,6 +1267,13 @@ var factoryOutput = (() => {
1267
1267
  // Tuvalu
1268
1268
  "688"
1269
1269
  ],
1270
+ [
1271
+ "vi",
1272
+ // U.S. Virgin Islands
1273
+ "1",
1274
+ 24,
1275
+ ["340"]
1276
+ ],
1270
1277
  [
1271
1278
  "ug",
1272
1279
  // Uganda
@@ -1301,13 +1308,6 @@ var factoryOutput = (() => {
1301
1308
  // Uruguay
1302
1309
  "598"
1303
1310
  ],
1304
- [
1305
- "vi",
1306
- // U.S. Virgin Islands
1307
- "1",
1308
- 24,
1309
- ["340"]
1310
- ],
1311
1311
  [
1312
1312
  "uz",
1313
1313
  // Uzbekistan
@@ -1883,6 +1883,9 @@ var factoryOutput = (() => {
1883
1883
  }
1884
1884
  //* Add a dial code to this.dialCodeToIso2Map.
1885
1885
  _addToDialCodeMap(iso2, dialCode, priority) {
1886
+ if (!iso2 || !dialCode) {
1887
+ return;
1888
+ }
1886
1889
  if (dialCode.length > this.dialCodeMaxLen) {
1887
1890
  this.dialCodeMaxLen = dialCode.length;
1888
1891
  }
@@ -1937,6 +1940,11 @@ var factoryOutput = (() => {
1937
1940
  }
1938
1941
  this._addToDialCodeMap(c.iso2, c.dialCode, c.priority);
1939
1942
  }
1943
+ if (this.options.onlyCountries.length || this.options.excludeCountries.length) {
1944
+ this.dialCodes.forEach((dialCode) => {
1945
+ this.dialCodeToIso2Map[dialCode] = this.dialCodeToIso2Map[dialCode].filter(Boolean);
1946
+ });
1947
+ }
1940
1948
  for (const c of this.countries) {
1941
1949
  if (c.areaCodes) {
1942
1950
  const rootIso2Code = this.dialCodeToIso2Map[c.dialCode][0];
@@ -2355,7 +2363,7 @@ var factoryOutput = (() => {
2355
2363
  _openDropdownWithPlus() {
2356
2364
  this._openDropdown();
2357
2365
  this.searchInput.value = "+";
2358
- this._filterCountries("", true);
2366
+ this._filterCountries("");
2359
2367
  }
2360
2368
  //* Initialize the tel input listeners.
2361
2369
  _initTelInputListeners() {
@@ -2538,11 +2546,7 @@ var factoryOutput = (() => {
2538
2546
  if (this.options.countrySearch) {
2539
2547
  const doFilter = () => {
2540
2548
  const inputQuery = this.searchInput.value.trim();
2541
- if (inputQuery) {
2542
- this._filterCountries(inputQuery);
2543
- } else {
2544
- this._filterCountries("", true);
2545
- }
2549
+ this._filterCountries(inputQuery);
2546
2550
  if (this.searchInput.value) {
2547
2551
  this.searchClearButton.classList.remove("iti__hide");
2548
2552
  } else {
@@ -2581,42 +2585,44 @@ var factoryOutput = (() => {
2581
2585
  }
2582
2586
  }
2583
2587
  //* Country search enabled: Filter the countries according to the search query.
2584
- _filterCountries(query, isReset = false) {
2588
+ _filterCountries(query) {
2585
2589
  let noCountriesAddedYet = true;
2586
2590
  this.countryList.innerHTML = "";
2587
2591
  const normalisedQuery = normaliseString(query);
2588
- const queryLength = normalisedQuery.length;
2589
- const iso2Matches = [];
2590
- const nameStartWith = [];
2591
- const nameContains = [];
2592
- const dialCodeMatches = [];
2593
- const dialCodeContains = [];
2594
- const initialsMatches = [];
2595
- for (const c of this.countries) {
2596
- if (isReset || queryLength === 0) {
2597
- nameContains.push(c);
2598
- } else if (c.iso2 === normalisedQuery) {
2599
- iso2Matches.push(c);
2600
- } else if (c.normalisedName.startsWith(normalisedQuery)) {
2601
- nameStartWith.push(c);
2602
- } else if (c.normalisedName.includes(normalisedQuery)) {
2603
- nameContains.push(c);
2604
- } else if (normalisedQuery === c.dialCode || normalisedQuery === c.dialCodePlus) {
2605
- dialCodeMatches.push(c);
2606
- } else if (c.dialCodePlus.includes(normalisedQuery)) {
2607
- dialCodeContains.push(c);
2608
- } else if (c.initials.includes(normalisedQuery)) {
2609
- initialsMatches.push(c);
2592
+ let matchedCountries;
2593
+ if (query === "") {
2594
+ matchedCountries = this.countries;
2595
+ } else {
2596
+ const iso2Matches = [];
2597
+ const nameStartWith = [];
2598
+ const nameContains = [];
2599
+ const dialCodeMatches = [];
2600
+ const dialCodeContains = [];
2601
+ const initialsMatches = [];
2602
+ for (const c of this.countries) {
2603
+ if (c.iso2 === normalisedQuery) {
2604
+ iso2Matches.push(c);
2605
+ } else if (c.normalisedName.startsWith(normalisedQuery)) {
2606
+ nameStartWith.push(c);
2607
+ } else if (c.normalisedName.includes(normalisedQuery)) {
2608
+ nameContains.push(c);
2609
+ } else if (normalisedQuery === c.dialCode || normalisedQuery === c.dialCodePlus) {
2610
+ dialCodeMatches.push(c);
2611
+ } else if (c.dialCodePlus.includes(normalisedQuery)) {
2612
+ dialCodeContains.push(c);
2613
+ } else if (c.initials.includes(normalisedQuery)) {
2614
+ initialsMatches.push(c);
2615
+ }
2610
2616
  }
2617
+ matchedCountries = [
2618
+ ...iso2Matches.sort((a, b) => a.priority - b.priority),
2619
+ ...nameStartWith.sort((a, b) => a.priority - b.priority),
2620
+ ...nameContains.sort((a, b) => a.priority - b.priority),
2621
+ ...dialCodeMatches.sort((a, b) => a.priority - b.priority),
2622
+ ...dialCodeContains.sort((a, b) => a.priority - b.priority),
2623
+ ...initialsMatches.sort((a, b) => a.priority - b.priority)
2624
+ ];
2611
2625
  }
2612
- const matchedCountries = [
2613
- ...iso2Matches.sort((a, b) => a.priority - b.priority),
2614
- ...nameStartWith.sort((a, b) => a.priority - b.priority),
2615
- ...nameContains.sort((a, b) => a.priority - b.priority),
2616
- ...dialCodeMatches.sort((a, b) => a.priority - b.priority),
2617
- ...dialCodeContains.sort((a, b) => a.priority - b.priority),
2618
- ...initialsMatches.sort((a, b) => a.priority - b.priority)
2619
- ];
2620
2626
  for (const c of matchedCountries) {
2621
2627
  const listItem = c.nodeById[this.id];
2622
2628
  if (listItem) {
@@ -2723,22 +2729,27 @@ var factoryOutput = (() => {
2723
2729
  if (dialCodeMatch) {
2724
2730
  const dialCodeMatchNumeric = getNumeric(dialCodeMatch);
2725
2731
  const iso2Codes = this.dialCodeToIso2Map[dialCodeMatchNumeric];
2732
+ if (iso2Codes.length === 1) {
2733
+ if (iso2Codes[0] === selectedIso2) {
2734
+ return null;
2735
+ }
2736
+ return iso2Codes[0];
2737
+ }
2726
2738
  if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
2727
2739
  return this.defaultCountry;
2728
2740
  }
2741
+ const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
2742
+ if (isRegionlessNanpNumber) {
2743
+ return null;
2744
+ }
2729
2745
  const hasAreaCodesButNoneMatched = this.selectedCountryData.areaCodes && numeric.length > dialCodeMatchNumeric.length;
2730
2746
  const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && !hasAreaCodesButNoneMatched;
2731
- const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
2732
- if (!isRegionlessNanpNumber && !alreadySelected) {
2733
- for (const iso2 of iso2Codes) {
2734
- if (iso2) {
2735
- return iso2;
2736
- }
2737
- }
2747
+ if (!alreadySelected) {
2748
+ return iso2Codes[0];
2738
2749
  }
2739
2750
  } else if (number.charAt(0) === "+" && numeric.length) {
2740
2751
  return "";
2741
- } else if ((!number || number === "+") && !this.selectedCountryData.iso2) {
2752
+ } else if ((!number || number === "+") && !selectedIso2) {
2742
2753
  return this.defaultCountry;
2743
2754
  }
2744
2755
  return null;
@@ -3287,7 +3298,7 @@ var factoryOutput = (() => {
3287
3298
  attachUtils,
3288
3299
  startedLoadingUtilsScript: false,
3289
3300
  startedLoadingAutoCountry: false,
3290
- version: "25.10.5"
3301
+ version: "25.10.6"
3291
3302
  }
3292
3303
  );
3293
3304
  var intl_tel_input_default = intlTelInput;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v25.10.5
2
+ * International Telephone Input v25.10.6
3
3
  * https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -13,18 +13,18 @@
13
13
  }
14
14
  }(() => {
15
15
 
16
- var factoryOutput=(()=>{var w=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var H=Object.prototype.hasOwnProperty;var R=(a,t)=>{for(var e in t)w(a,e,{get:t[e],enumerable:!0})},O=(a,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of x(t))!H.call(a,n)&&n!==e&&w(a,n,{get:()=>t[n],enumerable:!(i=P(t,n))||i.enumerable});return a};var B=a=>O(w({},"__esModule",{value:!0}),a);var Y={};R(Y,{Iti:()=>I,default:()=>q});var F=[["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"]],N=[];for(let a of F)N.push({name:"",iso2:a[0],dialCode:a[1],priority:a[2]||0,areaCodes:a[3]||null,nodeById:{},nationalPrefix:a[4]||null});var v=N;var U={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"},E=U;var z={selectedCountryAriaLabel:"Change country, selected ${countryName} (${dialCode})",noCountrySelected:"Select country",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",clearSearchAriaLabel:"Clear search",zeroSearchResults:"No results found",oneSearchResult:"1 result found",multipleSearchResults:"${count} results found",ac:"Ascension Island",xk:"Kosovo"},D=z;var j={...E,...D},L=j;for(let a of v)a.name=L[a.iso2];var $=0,T=a=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(a).matches,V=()=>{if(typeof navigator<"u"&&typeof window<"u"){let a=/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t=T("(max-width: 500px)"),e=T("(max-height: 600px)"),i=T("(pointer: coarse)");return a||t||i&&e}return!1},M={allowPhonewords:!1,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:V(),validationNumberTypes:["MOBILE"]},K=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],_=a=>a.replace(/\D/g,""),S=(a="")=>a.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),A=a=>{let t=_(a);if(t.charAt(0)==="1"){let e=t.substring(1,4);return K.includes(e)}return!1},W=(a,t,e,i)=>{if(e===0&&!i)return 0;let n=0;for(let s=0;s<t.length;s++){if(/[+0-9]/.test(t[s])&&n++,n===a&&!i)return s+1;if(i&&n===a+1)return s}return t.length},m=(a,t,e)=>{let i=document.createElement(a);return t&&Object.entries(t).forEach(([n,s])=>i.setAttribute(n,s)),e&&e.appendChild(i),i},b=(a,...t)=>{let{instances:e}=l;Object.values(e).forEach(i=>i[a](...t))},I=class a{static _buildClassNames(t){return Object.keys(t).filter(e=>!!t[e]).join(" ")}constructor(t,e={}){this.id=$++,this.a=t,this.c=null,this.options=Object.assign({},M,e),this.e=!!t.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.x=typeof navigator<"u"?/Android/i.test(navigator.userAgent):!1,this.v=!!this.a.closest("[dir=rtl]"),this.a.dir="ltr";let t=this.options.allowDropdown||this.options.separateDialCode;this.w=this.v?!t:t,this.options.separateDialCode&&(this.v?this.n1=this.a.style.paddingRight:this.n2=this.a.style.paddingLeft),this.options.i18n={...L,...this.options.i18n};let e=new Promise((n,s)=>{this.h=n,this.i=s}),i=new Promise((n,s)=>{this.i0=n,this.i1=s});this.promise=Promise.all([e,i]),this.s={},this._b(),this._f(),this._h(),this._i(),this._i3()}_b(){this._d(),this._d2(),this._d0(),this._sortCountries(),this.z0=new Map(this.countries.map(t=>[t.iso2,t])),this._cacheSearchTokens()}_cacheSearchTokens(){for(let t of this.countries)t.normalisedName=S(t.name),t.initials=t.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map(e=>e[0]).join("").toLowerCase(),t.dialCodePlus=`+${t.dialCode}`}_sortCountries(){this.options.countryOrder&&(this.options.countryOrder=this.options.countryOrder.map(t=>t.toLowerCase())),this.countries.sort((t,e)=>{let{countryOrder:i}=this.options;if(i){let n=i.indexOf(t.iso2),s=i.indexOf(e.iso2),r=n>-1,o=s>-1;if(r||o)return r&&o?n-s:r?-1:1}return t.name.localeCompare(e.name)})}_c(t,e,i){e.length>this.y&&(this.y=e.length),this.q.hasOwnProperty(e)||(this.q[e]=[]);let n=this.q[e];if(n.includes(t))return;let s=i!==void 0?i:n.length;n[s]=t}_d(){let{onlyCountries:t,excludeCountries:e}=this.options;if(t.length){let i=t.map(n=>n.toLowerCase());this.countries=v.filter(n=>i.includes(n.iso2))}else if(e.length){let i=e.map(n=>n.toLowerCase());this.countries=v.filter(n=>!i.includes(n.iso2))}else this.countries=v}_d0(){for(let t of this.countries){let e=t.iso2.toLowerCase();this.options.i18n.hasOwnProperty(e)&&(t.name=this.options.i18n[e])}}_d2(){this.dialCodes=new Set,this.y=0,this.q={};for(let t of this.countries)this.dialCodes.has(t.dialCode)||this.dialCodes.add(t.dialCode),this._c(t.iso2,t.dialCode,t.priority);for(let t of this.countries)if(t.areaCodes){let e=this.q[t.dialCode][0];for(let i of t.areaCodes){for(let n=1;n<i.length;n++){let s=i.substring(0,n),r=t.dialCode+s;this._c(e,r),this._c(t.iso2,r)}this._c(t.iso2,t.dialCode+i)}}}_f(){this.a.classList.add("iti__tel-input"),!this.a.hasAttribute("autocomplete")&&!(this.a.form&&this.a.form.hasAttribute("autocomplete"))&&this.a.setAttribute("autocomplete","off");let{allowDropdown:t,separateDialCode:e,showFlags:i,containerClass:n,hiddenInput:s,dropdownContainer:r,fixDropdownWidth:o,useFullscreenPopup:d,countrySearch:C,i18n:c}=this.options,p=a._buildClassNames({iti:!0,"iti--allow-dropdown":t,"iti--show-flags":i,"iti--inline-dropdown":!d,[n]:!!n}),g=m("div",{class:p});if(this.a.parentNode?.insertBefore(g,this.a),t||i||e){this.k=m("div",{class:"iti__country-container iti__v-hide"},g),this.w?this.k.style.left="0px":this.k.style.right="0px",t?(this.selectedCountry=m("button",{type:"button",class:"iti__selected-country","aria-expanded":"false","aria-label":this.options.i18n.noCountrySelected,"aria-haspopup":"dialog","aria-controls":`iti-${this.id}__dropdown-content`},this.k),this.a.disabled&&this.selectedCountry.setAttribute("disabled","true")):this.selectedCountry=m("div",{class:"iti__selected-country"},this.k);let u=m("div",{class:"iti__selected-country-primary"},this.selectedCountry);if(this.l=m("div",{class:"iti__flag"},u),t&&(this.u=m("div",{class:"iti__arrow","aria-hidden":"true"},u)),e&&(this.t=m("div",{class:"iti__selected-dial-code",dir:"ltr"},this.selectedCountry)),t){let h=o?"":"iti--flexible-dropdown-width";if(this.m0=m("div",{id:`iti-${this.id}__dropdown-content`,class:`iti__dropdown-content iti__hide ${h}`,role:"dialog","aria-modal":"true"}),C){let y=m("div",{class:"iti__search-input-wrapper"},this.m0);this.m2=m("span",{class:"iti__search-icon","aria-hidden":"true"},y),this.m2.innerHTML=`
16
+ var factoryOutput=(()=>{var w=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var H=Object.prototype.hasOwnProperty;var R=(a,t)=>{for(var e in t)w(a,e,{get:t[e],enumerable:!0})},B=(a,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of x(t))!H.call(a,n)&&n!==e&&w(a,n,{get:()=>t[n],enumerable:!(i=P(t,n))||i.enumerable});return a};var O=a=>B(w({},"__esModule",{value:!0}),a);var Y={};R(Y,{Iti:()=>I,default:()=>q});var F=[["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"],["vi","1",24,["340"]],["ug","256"],["ua","380"],["ae","971"],["gb","44",0,null,"0"],["us","1",0],["uy","598"],["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"]],N=[];for(let a of F)N.push({name:"",iso2:a[0],dialCode:a[1],priority:a[2]||0,areaCodes:a[3]||null,nodeById:{},nationalPrefix:a[4]||null});var v=N;var U={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"},E=U;var z={selectedCountryAriaLabel:"Change country, selected ${countryName} (${dialCode})",noCountrySelected:"Select country",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",clearSearchAriaLabel:"Clear search",zeroSearchResults:"No results found",oneSearchResult:"1 result found",multipleSearchResults:"${count} results found",ac:"Ascension Island",xk:"Kosovo"},D=z;var j={...E,...D},L=j;for(let a of v)a.name=L[a.iso2];var $=0,T=a=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(a).matches,V=()=>{if(typeof navigator<"u"&&typeof window<"u"){let a=/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t=T("(max-width: 500px)"),e=T("(max-height: 600px)"),i=T("(pointer: coarse)");return a||t||i&&e}return!1},M={allowPhonewords:!1,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:V(),validationNumberTypes:["MOBILE"]},K=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],_=a=>a.replace(/\D/g,""),S=(a="")=>a.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),A=a=>{let t=_(a);if(t.charAt(0)==="1"){let e=t.substring(1,4);return K.includes(e)}return!1},W=(a,t,e,i)=>{if(e===0&&!i)return 0;let n=0;for(let s=0;s<t.length;s++){if(/[+0-9]/.test(t[s])&&n++,n===a&&!i)return s+1;if(i&&n===a+1)return s}return t.length},m=(a,t,e)=>{let i=document.createElement(a);return t&&Object.entries(t).forEach(([n,s])=>i.setAttribute(n,s)),e&&e.appendChild(i),i},b=(a,...t)=>{let{instances:e}=l;Object.values(e).forEach(i=>i[a](...t))},I=class a{static _buildClassNames(t){return Object.keys(t).filter(e=>!!t[e]).join(" ")}constructor(t,e={}){this.id=$++,this.a=t,this.c=null,this.options=Object.assign({},M,e),this.e=!!t.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.x=typeof navigator<"u"?/Android/i.test(navigator.userAgent):!1,this.v=!!this.a.closest("[dir=rtl]"),this.a.dir="ltr";let t=this.options.allowDropdown||this.options.separateDialCode;this.w=this.v?!t:t,this.options.separateDialCode&&(this.v?this.n1=this.a.style.paddingRight:this.n2=this.a.style.paddingLeft),this.options.i18n={...L,...this.options.i18n};let e=new Promise((n,s)=>{this.h=n,this.i=s}),i=new Promise((n,s)=>{this.i0=n,this.i1=s});this.promise=Promise.all([e,i]),this.s={},this._b(),this._f(),this._h(),this._i(),this._i3()}_b(){this._d(),this._d2(),this._d0(),this._sortCountries(),this.z0=new Map(this.countries.map(t=>[t.iso2,t])),this._cacheSearchTokens()}_cacheSearchTokens(){for(let t of this.countries)t.normalisedName=S(t.name),t.initials=t.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map(e=>e[0]).join("").toLowerCase(),t.dialCodePlus=`+${t.dialCode}`}_sortCountries(){this.options.countryOrder&&(this.options.countryOrder=this.options.countryOrder.map(t=>t.toLowerCase())),this.countries.sort((t,e)=>{let{countryOrder:i}=this.options;if(i){let n=i.indexOf(t.iso2),s=i.indexOf(e.iso2),o=n>-1,r=s>-1;if(o||r)return o&&r?n-s:o?-1:1}return t.name.localeCompare(e.name)})}_c(t,e,i){if(!t||!e)return;e.length>this.y&&(this.y=e.length),this.q.hasOwnProperty(e)||(this.q[e]=[]);let n=this.q[e];if(n.includes(t))return;let s=i!==void 0?i:n.length;n[s]=t}_d(){let{onlyCountries:t,excludeCountries:e}=this.options;if(t.length){let i=t.map(n=>n.toLowerCase());this.countries=v.filter(n=>i.includes(n.iso2))}else if(e.length){let i=e.map(n=>n.toLowerCase());this.countries=v.filter(n=>!i.includes(n.iso2))}else this.countries=v}_d0(){for(let t of this.countries){let e=t.iso2.toLowerCase();this.options.i18n.hasOwnProperty(e)&&(t.name=this.options.i18n[e])}}_d2(){this.dialCodes=new Set,this.y=0,this.q={};for(let t of this.countries)this.dialCodes.has(t.dialCode)||this.dialCodes.add(t.dialCode),this._c(t.iso2,t.dialCode,t.priority);(this.options.onlyCountries.length||this.options.excludeCountries.length)&&this.dialCodes.forEach(t=>{this.q[t]=this.q[t].filter(Boolean)});for(let t of this.countries)if(t.areaCodes){let e=this.q[t.dialCode][0];for(let i of t.areaCodes){for(let n=1;n<i.length;n++){let s=i.substring(0,n),o=t.dialCode+s;this._c(e,o),this._c(t.iso2,o)}this._c(t.iso2,t.dialCode+i)}}}_f(){this.a.classList.add("iti__tel-input"),!this.a.hasAttribute("autocomplete")&&!(this.a.form&&this.a.form.hasAttribute("autocomplete"))&&this.a.setAttribute("autocomplete","off");let{allowDropdown:t,separateDialCode:e,showFlags:i,containerClass:n,hiddenInput:s,dropdownContainer:o,fixDropdownWidth:r,useFullscreenPopup:d,countrySearch:c,i18n:p}=this.options,u=a._buildClassNames({iti:!0,"iti--allow-dropdown":t,"iti--show-flags":i,"iti--inline-dropdown":!d,[n]:!!n}),h=m("div",{class:u});if(this.a.parentNode?.insertBefore(h,this.a),t||i||e){this.k=m("div",{class:"iti__country-container iti__v-hide"},h),this.w?this.k.style.left="0px":this.k.style.right="0px",t?(this.selectedCountry=m("button",{type:"button",class:"iti__selected-country","aria-expanded":"false","aria-label":this.options.i18n.noCountrySelected,"aria-haspopup":"dialog","aria-controls":`iti-${this.id}__dropdown-content`},this.k),this.a.disabled&&this.selectedCountry.setAttribute("disabled","true")):this.selectedCountry=m("div",{class:"iti__selected-country"},this.k);let y=m("div",{class:"iti__selected-country-primary"},this.selectedCountry);if(this.l=m("div",{class:"iti__flag"},y),t&&(this.u=m("div",{class:"iti__arrow","aria-hidden":"true"},y)),e&&(this.t=m("div",{class:"iti__selected-dial-code",dir:"ltr"},this.selectedCountry)),t){let g=r?"":"iti--flexible-dropdown-width";if(this.m0=m("div",{id:`iti-${this.id}__dropdown-content`,class:`iti__dropdown-content iti__hide ${g}`,role:"dialog","aria-modal":"true"}),c){let C=m("div",{class:"iti__search-input-wrapper"},this.m0);this.m2=m("span",{class:"iti__search-icon","aria-hidden":"true"},C),this.m2.innerHTML=`
17
17
  <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" aria-hidden="true">
18
18
  <circle cx="11" cy="11" r="7" />
19
19
  <line x1="21" y1="21" x2="16.65" y2="16.65" />
20
- </svg>`,this.m1=m("input",{id:`iti-${this.id}__search-input`,type:"search",class:"iti__search-input",placeholder:c.searchPlaceholder,role:"combobox","aria-expanded":"true","aria-label":c.searchPlaceholder,"aria-controls":`iti-${this.id}__country-listbox`,"aria-autocomplete":"list",autocomplete:"off"},y),this.m3=m("button",{type:"button",class:"iti__search-clear iti__hide","aria-label":c.clearSearchAriaLabel,tabindex:"-1"},y);let f=`iti-${this.id}-clear-mask`;this.m3.innerHTML=`
20
+ </svg>`,this.m1=m("input",{id:`iti-${this.id}__search-input`,type:"search",class:"iti__search-input",placeholder:p.searchPlaceholder,role:"combobox","aria-expanded":"true","aria-label":p.searchPlaceholder,"aria-controls":`iti-${this.id}__country-listbox`,"aria-autocomplete":"list",autocomplete:"off"},C),this.m3=m("button",{type:"button",class:"iti__search-clear iti__hide","aria-label":p.clearSearchAriaLabel,tabindex:"-1"},C);let f=`iti-${this.id}-clear-mask`;this.m3.innerHTML=`
21
21
  <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
22
22
  <mask id="${f}" maskUnits="userSpaceOnUse">
23
23
  <rect width="16" height="16" fill="white" />
24
24
  <path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
25
25
  </mask>
26
26
  <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${f})" />
27
- </svg>`,this.m5=m("span",{class:"iti__a11y-text"},this.m0),this.m4=m("div",{class:"iti__no-results iti__hide","aria-hidden":"true"},this.m0),this.m4.textContent=c.zeroSearchResults}if(this.countryList=m("ul",{class:"iti__country-list",id:`iti-${this.id}__country-listbox`,role:"listbox","aria-label":c.countryListAriaLabel},this.m0),this._g(),C&&this._p4(),r){let y=a._buildClassNames({iti:!0,"iti--container":!0,"iti--fullscreen-popup":d,"iti--inline-dropdown":!d,[n]:!!n});this.dropdown=m("div",{class:y}),this.dropdown.appendChild(this.m0)}else this.k.appendChild(this.m0)}}if(g.appendChild(this.a),this.k&&(this._z3(),this.k.classList.remove("iti__v-hide")),s){let u=this.a.getAttribute("name")||"",h=s(u);if(h.phone){let y=this.a.form?.querySelector(`input[name="${h.phone}"]`);y?this.hiddenInput=y:(this.hiddenInput=m("input",{type:"hidden",name:h.phone}),g.appendChild(this.hiddenInput))}if(h.country){let y=this.a.form?.querySelector(`input[name="${h.country}"]`);y?this.m9=y:(this.m9=m("input",{type:"hidden",name:h.country}),g.appendChild(this.m9))}}}_g(){for(let t=0;t<this.countries.length;t++){let e=this.countries[t],i=t===0?"iti__highlight":"",n=m("li",{id:`iti-${this.id}__item-${e.iso2}`,class:`iti__country ${i}`,tabindex:"-1",role:"option","data-dial-code":e.dialCode,"data-country-code":e.iso2,"aria-selected":"false"},this.countryList);e.nodeById[this.id]=n;let s="";this.options.showFlags&&(s+=`<div class='iti__flag iti__${e.iso2}'></div>`),s+=`<span class='iti__country-name'>${e.name}</span>`,s+=`<span class='iti__dial-code' dir='ltr'>+${e.dialCode}</span>`,n.insertAdjacentHTML("beforeend",s)}}_h(t=!1){let e=this.a.getAttribute("value"),i=this.a.value,s=e&&e.charAt(0)==="+"&&(!i||i.charAt(0)!=="+")?e:i,r=this._5(s),o=A(s),{initialCountry:d,geoIpLookup:C}=this.options,c=d==="auto"&&C;if(r&&!o)this._v(s);else if(!c||t){let p=d?d.toLowerCase():"";p&&this._y(p,!0)?this._z(p):r&&o?this._z("us"):this._z()}s&&this._u(s)}_i(){this._j(),this.options.allowDropdown&&this._i2(),(this.hiddenInput||this.m9)&&this.a.form&&this._i0()}_i0(){this._a14=()=>{this.hiddenInput&&(this.hiddenInput.value=this.getNumber()),this.m9&&(this.m9.value=this.getSelectedCountryData().iso2||"")},this.a.form?.addEventListener("submit",this._a14)}_i2(){this._a9=e=>{this.m0.classList.contains("iti__hide")?this.a.focus():e.preventDefault()};let t=this.a.closest("label");t&&t.addEventListener("click",this._a9),this._a10=()=>{this.m0.classList.contains("iti__hide")&&!this.a.disabled&&!this.a.readOnly&&this._openDropdown()},this.selectedCountry.addEventListener("click",this._a10),this._a11=e=>{this.m0.classList.contains("iti__hide")&&["ArrowUp","ArrowDown"," ","Enter"].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),this._openDropdown()),e.key==="Tab"&&this._2()},this.k.addEventListener("keydown",this._a11)}_i3(){let{loadUtils:t,initialCountry:e,geoIpLookup:i}=this.options;t&&!l.utils?(this._a8=()=>{window.removeEventListener("load",this._a8),l.attachUtils(t)?.catch(()=>{})},l.documentReady()?this._a8():window.addEventListener("load",this._a8)):this.i0(),e==="auto"&&i&&!this.s.iso2?this._i4():this.h()}_i4(){l.autoCountry?this.handleAutoCountry():l.startedLoadingAutoCountry||(l.startedLoadingAutoCountry=!0,typeof this.options.geoIpLookup=="function"&&this.options.geoIpLookup((t="")=>{let e=t.toLowerCase();e&&this._y(e,!0)?(l.autoCountry=e,setTimeout(()=>b("handleAutoCountry"))):(this._h(!0),b("rejectAutoCountryPromise"))},()=>{this._h(!0),b("rejectAutoCountryPromise")}))}_n0(){this._openDropdown(),this.m1.value="+",this._p3("",!0)}_j(){let{strictMode:t,formatAsYouType:e,separateDialCode:i,allowDropdown:n,countrySearch:s}=this.options,r=!1;/\p{L}/u.test(this.a.value)&&(r=!0),this._a12=o=>{if(this.x&&o?.data==="+"&&i&&n&&s){let p=this.a.selectionStart||0,g=this.a.value.substring(0,p-1),u=this.a.value.substring(p);this.a.value=g+u,this._n0();return}this._v(this.a.value)&&this._8();let d=o?.data&&/[^+0-9]/.test(o.data),C=o?.inputType==="insertFromPaste"&&this.a.value;d||C&&!t?r=!0:/[^+0-9]/.test(this.a.value)||(r=!1);let c=o?.detail&&o.detail.isSetNumber;if(e&&!r&&!c){let p=this.a.selectionStart||0,u=this.a.value.substring(0,p).replace(/[^+0-9]/g,"").length,h=o?.inputType==="deleteContentForward",y=this._9(),f=W(u,y,p,h);this.a.value=y,this.a.setSelectionRange(f,f)}},this.a.addEventListener("input",this._a12),(t||i)&&(this._a5=o=>{if(o.key&&o.key.length===1&&!o.altKey&&!o.ctrlKey&&!o.metaKey){if(i&&n&&s&&o.key==="+"){o.preventDefault(),this._n0();return}if(t){let d=this.a.value,c=!(d.charAt(0)==="+")&&this.a.selectionStart===0&&o.key==="+",p=/^[0-9]$/.test(o.key),g=i?p:c||p,u=d.slice(0,this.a.selectionStart)+o.key+d.slice(this.a.selectionEnd),h=this._6(u),y=l.utils.getCoreNumber(h,this.s.iso2),f=this.n0&&y.length>this.n0,k=this._v0(h)!==null;(!g||f&&!k&&!c)&&o.preventDefault()}}},this.a.addEventListener("keydown",this._a5))}_j2(t){let e=parseInt(this.a.getAttribute("maxlength")||"",10);return e&&t.length>e?t.substring(0,e):t}_trigger(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.a.dispatchEvent(i)}_openDropdown(){let{fixDropdownWidth:t,countrySearch:e}=this.options;if(t&&(this.m0.style.width=`${this.a.offsetWidth}px`),this.m0.classList.remove("iti__hide"),this.selectedCountry.setAttribute("aria-expanded","true"),this._o(),e){let i=this.countryList.firstElementChild;i&&(this._x(i,!1),this.countryList.scrollTop=0),this.m1.focus()}this._p(),this.u.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}_o(){if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.options.useFullscreenPopup){let t=this.a.getBoundingClientRect(),e=this.a.offsetHeight;this.options.dropdownContainer&&(this.dropdown.style.top=`${t.top+e}px`,this.dropdown.style.left=`${t.left}px`,this._a4=()=>this._2(),window.addEventListener("scroll",this._a4))}}_p(){this._a0=i=>{let n=i.target?.closest(".iti__country");n&&this._x(n,!1)},this.countryList.addEventListener("mouseover",this._a0),this._a1=i=>{let n=i.target?.closest(".iti__country");n&&this._1(n)},this.countryList.addEventListener("click",this._a1),this._a2=i=>{!!i.target.closest(`#iti-${this.id}__dropdown-content`)||this._2()},setTimeout(()=>{document.documentElement.addEventListener("click",this._a2)},0);let t="",e=null;if(this._a3=i=>{["ArrowUp","ArrowDown","Enter","Escape"].includes(i.key)&&(i.preventDefault(),i.stopPropagation(),i.key==="ArrowUp"||i.key==="ArrowDown"?this._q(i.key):i.key==="Enter"?this._r():i.key==="Escape"&&this._2()),!this.options.countrySearch&&/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(i.key)&&(i.stopPropagation(),e&&clearTimeout(e),t+=i.key.toLowerCase(),this._p0(t),e=setTimeout(()=>{t=""},1e3))},document.addEventListener("keydown",this._a3),this.options.countrySearch){let i=()=>{let s=this.m1.value.trim();s?this._p3(s):this._p3("",!0),this.m1.value?this.m3.classList.remove("iti__hide"):this.m3.classList.add("iti__hide")},n=null;this._a7=()=>{n&&clearTimeout(n),n=setTimeout(()=>{i(),n=null},100)},this.m1.addEventListener("input",this._a7),this._a6=()=>{this.m1.value="",this.m1.focus(),i()},this.m3.addEventListener("click",this._a6)}}_p0(t){for(let e of this.countries)if(e.name.substring(0,t.length).toLowerCase()===t){let n=e.nodeById[this.id];this._x(n,!1),this._3(n);break}}_p3(t,e=!1){let i=!0;this.countryList.innerHTML="";let n=S(t),s=n.length,r=[],o=[],d=[],C=[],c=[],p=[];for(let u of this.countries)e||s===0?d.push(u):u.iso2===n?r.push(u):u.normalisedName.startsWith(n)?o.push(u):u.normalisedName.includes(n)?d.push(u):n===u.dialCode||n===u.dialCodePlus?C.push(u):u.dialCodePlus.includes(n)?c.push(u):u.initials.includes(n)&&p.push(u);let g=[...r.sort((u,h)=>u.priority-h.priority),...o.sort((u,h)=>u.priority-h.priority),...d.sort((u,h)=>u.priority-h.priority),...C.sort((u,h)=>u.priority-h.priority),...c.sort((u,h)=>u.priority-h.priority),...p.sort((u,h)=>u.priority-h.priority)];for(let u of g){let h=u.nodeById[this.id];h&&(this.countryList.appendChild(h),i&&(this._x(h,!1),i=!1))}i?(this._x(null,!1),this.m4&&this.m4.classList.remove("iti__hide")):this.m4&&this.m4.classList.add("iti__hide"),this.countryList.scrollTop=0,this._p4()}_p4(){let{i18n:t}=this.options,e=this.countryList.childElementCount,i;e===0?i=t.zeroSearchResults:t.searchResultsText?i=t.searchResultsText(e):e===1?i=t.oneSearchResult:i=t.multipleSearchResults.replace("${count}",e.toString()),this.m5.textContent=i}_q(t){let e=t==="ArrowUp"?this.c?.previousElementSibling:this.c?.nextElementSibling;!e&&this.countryList.childElementCount>1&&(e=t==="ArrowUp"?this.countryList.lastElementChild:this.countryList.firstElementChild),e&&(this._3(e),this._x(e,!1))}_r(){this.c&&this._1(this.c)}_u(t){let e=t;if(this.options.formatOnDisplay&&l.utils&&this.s){let i=this.options.nationalMode||e.charAt(0)!=="+"&&!this.options.separateDialCode,{NATIONAL:n,INTERNATIONAL:s}=l.utils.numberFormat,r=i?n:s;e=l.utils.formatNumber(e,this.s.iso2,r)}e=this._7(e),this.a.value=e}_v(t){let e=this._v0(t);return e!==null?this._z(e):!1}_u0(t){let{dialCode:e,nationalPrefix:i}=this.s;if(t.charAt(0)==="+"||!e)return t;let r=i&&t.charAt(0)===i&&!this.options.separateDialCode?t.substring(1):t;return`+${e}${r}`}_v0(t){let e=t.indexOf("+"),i=e?t.substring(e):t,n=this.s.iso2,s=this.s.dialCode;i=this._u0(i);let r=this._5(i,!0),o=_(i);if(r){let d=_(r),C=this.q[d];if(!n&&this.j&&C.includes(this.j))return this.j;let c=this.s.areaCodes&&o.length>d.length,p=n&&C.includes(n)&&!c;if(!(s==="1"&&A(o))&&!p){for(let u of C)if(u)return u}}else{if(i.charAt(0)==="+"&&o.length)return"";if((!i||i==="+")&&!this.s.iso2)return this.j}return null}_x(t,e){let i=this.c;if(i&&(i.classList.remove("iti__highlight"),i.setAttribute("aria-selected","false")),this.c=t,this.c&&(this.c.classList.add("iti__highlight"),this.c.setAttribute("aria-selected","true"),this.options.countrySearch)){let n=this.c.getAttribute("id")||"";this.m1.setAttribute("aria-activedescendant",n)}e&&this.c.focus()}_y(t,e){let i=this.z0.get(t);if(i)return i;if(e)return null;throw new Error(`No country data for '${t}'`)}_z(t){let{separateDialCode:e,showFlags:i,i18n:n}=this.options,s=this.s.iso2||"";if(this.s=t?this._y(t,!1)||{}:{},this.s.iso2&&(this.j=this.s.iso2),this.selectedCountry){let r=t&&i?`iti__flag iti__${t}`:"iti__flag iti__globe",o,d;if(t){let{name:C,dialCode:c}=this.s;d=C,o=n.selectedCountryAriaLabel.replace("${countryName}",C).replace("${dialCode}",`+${c}`)}else d=n.noCountrySelected,o=n.noCountrySelected;this.l.className=r,this.selectedCountry.setAttribute("title",d),this.selectedCountry.setAttribute("aria-label",o)}if(e){let r=this.s.dialCode?`+${this.s.dialCode}`:"";this.t.innerHTML=r,this._z3()}return this._0(),this._z4(),s!==t}_z3(){if(this.selectedCountry){let t=this.options.separateDialCode?78:42,i=(this.selectedCountry.offsetWidth||this._z2()||t)+6;this.w?this.a.style.paddingLeft=`${i}px`:this.a.style.paddingRight=`${i}px`}}_z4(){let{strictMode:t,placeholderNumberType:e,validationNumberTypes:i}=this.options,{iso2:n}=this.s;if(t&&l.utils)if(n){let s=l.utils.numberType[e],r=l.utils.getExampleNumber(n,!1,s,!0),o=r;for(;l.utils.isPossibleNumber(r,n,i);)o=r,r+="0";let d=l.utils.getCoreNumber(o,n);this.n0=d.length,n==="by"&&(this.n0=d.length+1)}else this.n0=null}_z2(){if(this.a.parentNode){let t;try{t=window.top.document.body}catch{t=document.body}let e=this.a.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.k.cloneNode();e.appendChild(i);let n=this.selectedCountry.cloneNode(!0);i.appendChild(n);let s=n.offsetWidth;return t.removeChild(e),s}return 0}_0(){let{autoPlaceholder:t,placeholderNumberType:e,nationalMode:i,customPlaceholder:n}=this.options,s=t==="aggressive"||!this.e&&t==="polite";if(l.utils&&s){let r=l.utils.numberType[e],o=this.s.iso2?l.utils.getExampleNumber(this.s.iso2,i,r):"";o=this._7(o),typeof n=="function"&&(o=n(o,this.s)),this.a.setAttribute("placeholder",o)}}_1(t){let e=this._z(t.getAttribute("data-country-code"));this._2(),this._4(t.getAttribute("data-dial-code")),this.options.formatOnDisplay&&this._u(this.a.value),this.a.focus(),e&&this._8()}_2(){this.m0.classList.add("iti__hide"),this.selectedCountry.setAttribute("aria-expanded","false"),this.c&&this.c.setAttribute("aria-selected","false"),this.options.countrySearch&&this.m1.removeAttribute("aria-activedescendant"),this.u.classList.remove("iti__arrow--up"),this.options.countrySearch&&(this.m1.removeEventListener("input",this._a7),this.m3.removeEventListener("click",this._a6)),document.documentElement.removeEventListener("click",this._a2),this.countryList.removeEventListener("mouseover",this._a0),this.countryList.removeEventListener("click",this._a1),this.options.dropdownContainer&&(this.options.useFullscreenPopup||window.removeEventListener("scroll",this._a4),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._a8&&window.removeEventListener("load",this._a8),this._trigger("close:countrydropdown")}_3(t){let e=this.countryList,i=document.documentElement.scrollTop,n=e.offsetHeight,s=e.getBoundingClientRect().top+i,r=s+n,o=t.offsetHeight,d=t.getBoundingClientRect().top+i,C=d+o,c=d-s+e.scrollTop;if(d<s)e.scrollTop=c;else if(C>r){let p=n-o;e.scrollTop=c-p}}_4(t){let e=this.a.value,i=`+${t}`,n;if(e.charAt(0)==="+"){let s=this._5(e);s?n=e.replace(s,i):n=i,this.a.value=n}}_5(t,e){let i="";if(t.charAt(0)==="+"){let n="";for(let s=0;s<t.length;s++){let r=t.charAt(s);if(!isNaN(parseInt(r,10))){if(n+=r,e)this.q[n]&&(i=t.substring(0,s+1));else if(this.dialCodes.has(n)){i=t.substring(0,s+1);break}if(n.length===this.y)break}}}return i}_6(t){let e=t||this.a.value.trim(),{dialCode:i}=this.s,n,s=_(e);return this.options.separateDialCode&&e.charAt(0)!=="+"&&i&&s?n=`+${i}`:n="",n+e}_7(t){let e=t;if(this.options.separateDialCode){let i=this._5(e);if(i){i=`+${this.s.dialCode}`;let n=e[i.length]===" "||e[i.length]==="-"?i.length+1:i.length;e=e.substring(n)}}return this._j2(e)}_8(){this._trigger("countrychange")}_9(){let t=this._6(),e=l.utils?l.utils.formatNumberAsYouType(t,this.s.iso2):t,{dialCode:i}=this.s;return this.options.separateDialCode&&this.a.value.charAt(0)!=="+"&&e.includes(`+${i}`)?(e.split(`+${i}`)[1]||"").trim():e}handleAutoCountry(){this.options.initialCountry==="auto"&&l.autoCountry&&(this.j=l.autoCountry,this.s.iso2||this.l.classList.contains("iti__globe")||this.setCountry(this.j),this.h())}handleUtils(){l.utils&&(this.a.value&&this._u(this.a.value),this.s.iso2&&(this._0(),this._z4())),this.i0()}destroy(){this.a.iti=void 0;let{allowDropdown:t,separateDialCode:e}=this.options;if(t){this._2(),this.selectedCountry.removeEventListener("click",this._a10),this.k.removeEventListener("keydown",this._a11);let s=this.a.closest("label");s&&s.removeEventListener("click",this._a9)}let{form:i}=this.a;this._a14&&i&&i.removeEventListener("submit",this._a14),this.a.removeEventListener("input",this._a12),this._a5&&this.a.removeEventListener("keydown",this._a5),this.a.removeAttribute("data-intl-tel-input-id"),e&&(this.v?this.a.style.paddingRight=this.n1:this.a.style.paddingLeft=this.n2);let n=this.a.parentNode;n?.parentNode?.insertBefore(this.a,n),n?.parentNode?.removeChild(n),delete l.instances[this.id]}getExtension(){return l.utils?l.utils.getExtension(this._6(),this.s.iso2):""}getNumber(t){if(l.utils){let{iso2:e}=this.s;return l.utils.formatNumber(this._6(),e,t)}return""}getNumberType(){return l.utils?l.utils.getNumberType(this._6(),this.s.iso2):-99}getSelectedCountryData(){return this.s}getValidationError(){if(l.utils){let{iso2:t}=this.s;return l.utils.getValidationError(this._6(),t)}return-99}isValidNumber(){return this._9b(!1)}isValidNumberPrecise(){return this._9b(!0)}_9a(t){return l.utils?l.utils.isPossibleNumber(t,this.s.iso2,this.options.validationNumberTypes):null}_9b(t){if(!this.s.iso2)return!1;let e=r=>t?this._9c(r):this._9a(r),i=this._6(),n=i.search(/\p{L}/u);if(n>-1&&!this.options.allowPhonewords){let r=i.substring(0,n),o=e(r),d=e(i);return o&&d}return e(i)}_9c(t){return l.utils?l.utils.isValidNumber(t,this.s.iso2,this.options.validationNumberTypes):null}setCountry(t){let e=t?.toLowerCase(),i=this.s.iso2;(t&&e!==i||!t&&i)&&(this._z(e),this._4(this.s.dialCode),this.options.formatOnDisplay&&this._u(this.a.value),this._8())}setNumber(t){let e=this._v(t);this._u(t),e&&this._8(),this._trigger("input",{isSetNumber:!0})}setPlaceholderNumberType(t){this.options.placeholderNumberType=t,this._0()}setDisabled(t){this.a.disabled=t,t?this.selectedCountry.setAttribute("disabled","true"):this.selectedCountry.removeAttribute("disabled")}},G=a=>{if(!l.utils&&!l.startedLoadingUtilsScript){let t;if(typeof a=="function")try{t=Promise.resolve(a())}catch(e){return Promise.reject(e)}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 a}`));return l.startedLoadingUtilsScript=!0,t.then(e=>{let i=e?.default;if(!i||typeof i!="object")throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");return l.utils=i,b("handleUtils"),!0}).catch(e=>{throw b("rejectUtilsScriptPromise",e),e})}return null},l=Object.assign((a,t)=>{let e=new I(a,t);return e._init(),a.setAttribute("data-intl-tel-input-id",e.id.toString()),l.instances[e.id]=e,a.iti=e,e},{defaults:M,documentReady:()=>document.readyState==="complete",getCountryData:()=>v,getInstance:a=>{let t=a.getAttribute("data-intl-tel-input-id");return t?l.instances[t]:null},instances:{},attachUtils:G,startedLoadingUtilsScript:!1,startedLoadingAutoCountry:!1,version:"25.10.5"}),q=l;return B(Y);})();
27
+ </svg>`,this.m5=m("span",{class:"iti__a11y-text"},this.m0),this.m4=m("div",{class:"iti__no-results iti__hide","aria-hidden":"true"},this.m0),this.m4.textContent=p.zeroSearchResults}if(this.countryList=m("ul",{class:"iti__country-list",id:`iti-${this.id}__country-listbox`,role:"listbox","aria-label":p.countryListAriaLabel},this.m0),this._g(),c&&this._p4(),o){let C=a._buildClassNames({iti:!0,"iti--container":!0,"iti--fullscreen-popup":d,"iti--inline-dropdown":!d,[n]:!!n});this.dropdown=m("div",{class:C}),this.dropdown.appendChild(this.m0)}else this.k.appendChild(this.m0)}}if(h.appendChild(this.a),this.k&&(this._z3(),this.k.classList.remove("iti__v-hide")),s){let y=this.a.getAttribute("name")||"",g=s(y);if(g.phone){let C=this.a.form?.querySelector(`input[name="${g.phone}"]`);C?this.hiddenInput=C:(this.hiddenInput=m("input",{type:"hidden",name:g.phone}),h.appendChild(this.hiddenInput))}if(g.country){let C=this.a.form?.querySelector(`input[name="${g.country}"]`);C?this.m9=C:(this.m9=m("input",{type:"hidden",name:g.country}),h.appendChild(this.m9))}}}_g(){for(let t=0;t<this.countries.length;t++){let e=this.countries[t],i=t===0?"iti__highlight":"",n=m("li",{id:`iti-${this.id}__item-${e.iso2}`,class:`iti__country ${i}`,tabindex:"-1",role:"option","data-dial-code":e.dialCode,"data-country-code":e.iso2,"aria-selected":"false"},this.countryList);e.nodeById[this.id]=n;let s="";this.options.showFlags&&(s+=`<div class='iti__flag iti__${e.iso2}'></div>`),s+=`<span class='iti__country-name'>${e.name}</span>`,s+=`<span class='iti__dial-code' dir='ltr'>+${e.dialCode}</span>`,n.insertAdjacentHTML("beforeend",s)}}_h(t=!1){let e=this.a.getAttribute("value"),i=this.a.value,s=e&&e.charAt(0)==="+"&&(!i||i.charAt(0)!=="+")?e:i,o=this._5(s),r=A(s),{initialCountry:d,geoIpLookup:c}=this.options,p=d==="auto"&&c;if(o&&!r)this._v(s);else if(!p||t){let u=d?d.toLowerCase():"";u&&this._y(u,!0)?this._z(u):o&&r?this._z("us"):this._z()}s&&this._u(s)}_i(){this._j(),this.options.allowDropdown&&this._i2(),(this.hiddenInput||this.m9)&&this.a.form&&this._i0()}_i0(){this._a14=()=>{this.hiddenInput&&(this.hiddenInput.value=this.getNumber()),this.m9&&(this.m9.value=this.getSelectedCountryData().iso2||"")},this.a.form?.addEventListener("submit",this._a14)}_i2(){this._a9=e=>{this.m0.classList.contains("iti__hide")?this.a.focus():e.preventDefault()};let t=this.a.closest("label");t&&t.addEventListener("click",this._a9),this._a10=()=>{this.m0.classList.contains("iti__hide")&&!this.a.disabled&&!this.a.readOnly&&this._openDropdown()},this.selectedCountry.addEventListener("click",this._a10),this._a11=e=>{this.m0.classList.contains("iti__hide")&&["ArrowUp","ArrowDown"," ","Enter"].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),this._openDropdown()),e.key==="Tab"&&this._2()},this.k.addEventListener("keydown",this._a11)}_i3(){let{loadUtils:t,initialCountry:e,geoIpLookup:i}=this.options;t&&!l.utils?(this._a8=()=>{window.removeEventListener("load",this._a8),l.attachUtils(t)?.catch(()=>{})},l.documentReady()?this._a8():window.addEventListener("load",this._a8)):this.i0(),e==="auto"&&i&&!this.s.iso2?this._i4():this.h()}_i4(){l.autoCountry?this.handleAutoCountry():l.startedLoadingAutoCountry||(l.startedLoadingAutoCountry=!0,typeof this.options.geoIpLookup=="function"&&this.options.geoIpLookup((t="")=>{let e=t.toLowerCase();e&&this._y(e,!0)?(l.autoCountry=e,setTimeout(()=>b("handleAutoCountry"))):(this._h(!0),b("rejectAutoCountryPromise"))},()=>{this._h(!0),b("rejectAutoCountryPromise")}))}_n0(){this._openDropdown(),this.m1.value="+",this._p3("")}_j(){let{strictMode:t,formatAsYouType:e,separateDialCode:i,allowDropdown:n,countrySearch:s}=this.options,o=!1;/\p{L}/u.test(this.a.value)&&(o=!0),this._a12=r=>{if(this.x&&r?.data==="+"&&i&&n&&s){let u=this.a.selectionStart||0,h=this.a.value.substring(0,u-1),y=this.a.value.substring(u);this.a.value=h+y,this._n0();return}this._v(this.a.value)&&this._8();let d=r?.data&&/[^+0-9]/.test(r.data),c=r?.inputType==="insertFromPaste"&&this.a.value;d||c&&!t?o=!0:/[^+0-9]/.test(this.a.value)||(o=!1);let p=r?.detail&&r.detail.isSetNumber;if(e&&!o&&!p){let u=this.a.selectionStart||0,y=this.a.value.substring(0,u).replace(/[^+0-9]/g,"").length,g=r?.inputType==="deleteContentForward",C=this._9(),f=W(y,C,u,g);this.a.value=C,this.a.setSelectionRange(f,f)}},this.a.addEventListener("input",this._a12),(t||i)&&(this._a5=r=>{if(r.key&&r.key.length===1&&!r.altKey&&!r.ctrlKey&&!r.metaKey){if(i&&n&&s&&r.key==="+"){r.preventDefault(),this._n0();return}if(t){let d=this.a.value,p=!(d.charAt(0)==="+")&&this.a.selectionStart===0&&r.key==="+",u=/^[0-9]$/.test(r.key),h=i?u:p||u,y=d.slice(0,this.a.selectionStart)+r.key+d.slice(this.a.selectionEnd),g=this._6(y),C=l.utils.getCoreNumber(g,this.s.iso2),f=this.n0&&C.length>this.n0,k=this._v0(g)!==null;(!h||f&&!k&&!p)&&r.preventDefault()}}},this.a.addEventListener("keydown",this._a5))}_j2(t){let e=parseInt(this.a.getAttribute("maxlength")||"",10);return e&&t.length>e?t.substring(0,e):t}_trigger(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.a.dispatchEvent(i)}_openDropdown(){let{fixDropdownWidth:t,countrySearch:e}=this.options;if(t&&(this.m0.style.width=`${this.a.offsetWidth}px`),this.m0.classList.remove("iti__hide"),this.selectedCountry.setAttribute("aria-expanded","true"),this._o(),e){let i=this.countryList.firstElementChild;i&&(this._x(i,!1),this.countryList.scrollTop=0),this.m1.focus()}this._p(),this.u.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}_o(){if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.options.useFullscreenPopup){let t=this.a.getBoundingClientRect(),e=this.a.offsetHeight;this.options.dropdownContainer&&(this.dropdown.style.top=`${t.top+e}px`,this.dropdown.style.left=`${t.left}px`,this._a4=()=>this._2(),window.addEventListener("scroll",this._a4))}}_p(){this._a0=i=>{let n=i.target?.closest(".iti__country");n&&this._x(n,!1)},this.countryList.addEventListener("mouseover",this._a0),this._a1=i=>{let n=i.target?.closest(".iti__country");n&&this._1(n)},this.countryList.addEventListener("click",this._a1),this._a2=i=>{!!i.target.closest(`#iti-${this.id}__dropdown-content`)||this._2()},setTimeout(()=>{document.documentElement.addEventListener("click",this._a2)},0);let t="",e=null;if(this._a3=i=>{["ArrowUp","ArrowDown","Enter","Escape"].includes(i.key)&&(i.preventDefault(),i.stopPropagation(),i.key==="ArrowUp"||i.key==="ArrowDown"?this._q(i.key):i.key==="Enter"?this._r():i.key==="Escape"&&this._2()),!this.options.countrySearch&&/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(i.key)&&(i.stopPropagation(),e&&clearTimeout(e),t+=i.key.toLowerCase(),this._p0(t),e=setTimeout(()=>{t=""},1e3))},document.addEventListener("keydown",this._a3),this.options.countrySearch){let i=()=>{let s=this.m1.value.trim();this._p3(s),this.m1.value?this.m3.classList.remove("iti__hide"):this.m3.classList.add("iti__hide")},n=null;this._a7=()=>{n&&clearTimeout(n),n=setTimeout(()=>{i(),n=null},100)},this.m1.addEventListener("input",this._a7),this._a6=()=>{this.m1.value="",this.m1.focus(),i()},this.m3.addEventListener("click",this._a6)}}_p0(t){for(let e of this.countries)if(e.name.substring(0,t.length).toLowerCase()===t){let n=e.nodeById[this.id];this._x(n,!1),this._3(n);break}}_p3(t){let e=!0;this.countryList.innerHTML="";let i=S(t),n;if(t==="")n=this.countries;else{let s=[],o=[],r=[],d=[],c=[],p=[];for(let u of this.countries)u.iso2===i?s.push(u):u.normalisedName.startsWith(i)?o.push(u):u.normalisedName.includes(i)?r.push(u):i===u.dialCode||i===u.dialCodePlus?d.push(u):u.dialCodePlus.includes(i)?c.push(u):u.initials.includes(i)&&p.push(u);n=[...s.sort((u,h)=>u.priority-h.priority),...o.sort((u,h)=>u.priority-h.priority),...r.sort((u,h)=>u.priority-h.priority),...d.sort((u,h)=>u.priority-h.priority),...c.sort((u,h)=>u.priority-h.priority),...p.sort((u,h)=>u.priority-h.priority)]}for(let s of n){let o=s.nodeById[this.id];o&&(this.countryList.appendChild(o),e&&(this._x(o,!1),e=!1))}e?(this._x(null,!1),this.m4&&this.m4.classList.remove("iti__hide")):this.m4&&this.m4.classList.add("iti__hide"),this.countryList.scrollTop=0,this._p4()}_p4(){let{i18n:t}=this.options,e=this.countryList.childElementCount,i;e===0?i=t.zeroSearchResults:t.searchResultsText?i=t.searchResultsText(e):e===1?i=t.oneSearchResult:i=t.multipleSearchResults.replace("${count}",e.toString()),this.m5.textContent=i}_q(t){let e=t==="ArrowUp"?this.c?.previousElementSibling:this.c?.nextElementSibling;!e&&this.countryList.childElementCount>1&&(e=t==="ArrowUp"?this.countryList.lastElementChild:this.countryList.firstElementChild),e&&(this._3(e),this._x(e,!1))}_r(){this.c&&this._1(this.c)}_u(t){let e=t;if(this.options.formatOnDisplay&&l.utils&&this.s){let i=this.options.nationalMode||e.charAt(0)!=="+"&&!this.options.separateDialCode,{NATIONAL:n,INTERNATIONAL:s}=l.utils.numberFormat,o=i?n:s;e=l.utils.formatNumber(e,this.s.iso2,o)}e=this._7(e),this.a.value=e}_v(t){let e=this._v0(t);return e!==null?this._z(e):!1}_u0(t){let{dialCode:e,nationalPrefix:i}=this.s;if(t.charAt(0)==="+"||!e)return t;let o=i&&t.charAt(0)===i&&!this.options.separateDialCode?t.substring(1):t;return`+${e}${o}`}_v0(t){let e=t.indexOf("+"),i=e?t.substring(e):t,n=this.s.iso2,s=this.s.dialCode;i=this._u0(i);let o=this._5(i,!0),r=_(i);if(o){let d=_(o),c=this.q[d];if(c.length===1)return c[0]===n?null:c[0];if(!n&&this.j&&c.includes(this.j))return this.j;if(s==="1"&&A(r))return null;let u=this.s.areaCodes&&r.length>d.length;if(!(n&&c.includes(n)&&!u))return c[0]}else{if(i.charAt(0)==="+"&&r.length)return"";if((!i||i==="+")&&!n)return this.j}return null}_x(t,e){let i=this.c;if(i&&(i.classList.remove("iti__highlight"),i.setAttribute("aria-selected","false")),this.c=t,this.c&&(this.c.classList.add("iti__highlight"),this.c.setAttribute("aria-selected","true"),this.options.countrySearch)){let n=this.c.getAttribute("id")||"";this.m1.setAttribute("aria-activedescendant",n)}e&&this.c.focus()}_y(t,e){let i=this.z0.get(t);if(i)return i;if(e)return null;throw new Error(`No country data for '${t}'`)}_z(t){let{separateDialCode:e,showFlags:i,i18n:n}=this.options,s=this.s.iso2||"";if(this.s=t?this._y(t,!1)||{}:{},this.s.iso2&&(this.j=this.s.iso2),this.selectedCountry){let o=t&&i?`iti__flag iti__${t}`:"iti__flag iti__globe",r,d;if(t){let{name:c,dialCode:p}=this.s;d=c,r=n.selectedCountryAriaLabel.replace("${countryName}",c).replace("${dialCode}",`+${p}`)}else d=n.noCountrySelected,r=n.noCountrySelected;this.l.className=o,this.selectedCountry.setAttribute("title",d),this.selectedCountry.setAttribute("aria-label",r)}if(e){let o=this.s.dialCode?`+${this.s.dialCode}`:"";this.t.innerHTML=o,this._z3()}return this._0(),this._z4(),s!==t}_z3(){if(this.selectedCountry){let t=this.options.separateDialCode?78:42,i=(this.selectedCountry.offsetWidth||this._z2()||t)+6;this.w?this.a.style.paddingLeft=`${i}px`:this.a.style.paddingRight=`${i}px`}}_z4(){let{strictMode:t,placeholderNumberType:e,validationNumberTypes:i}=this.options,{iso2:n}=this.s;if(t&&l.utils)if(n){let s=l.utils.numberType[e],o=l.utils.getExampleNumber(n,!1,s,!0),r=o;for(;l.utils.isPossibleNumber(o,n,i);)r=o,o+="0";let d=l.utils.getCoreNumber(r,n);this.n0=d.length,n==="by"&&(this.n0=d.length+1)}else this.n0=null}_z2(){if(this.a.parentNode){let t;try{t=window.top.document.body}catch{t=document.body}let e=this.a.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.k.cloneNode();e.appendChild(i);let n=this.selectedCountry.cloneNode(!0);i.appendChild(n);let s=n.offsetWidth;return t.removeChild(e),s}return 0}_0(){let{autoPlaceholder:t,placeholderNumberType:e,nationalMode:i,customPlaceholder:n}=this.options,s=t==="aggressive"||!this.e&&t==="polite";if(l.utils&&s){let o=l.utils.numberType[e],r=this.s.iso2?l.utils.getExampleNumber(this.s.iso2,i,o):"";r=this._7(r),typeof n=="function"&&(r=n(r,this.s)),this.a.setAttribute("placeholder",r)}}_1(t){let e=this._z(t.getAttribute("data-country-code"));this._2(),this._4(t.getAttribute("data-dial-code")),this.options.formatOnDisplay&&this._u(this.a.value),this.a.focus(),e&&this._8()}_2(){this.m0.classList.add("iti__hide"),this.selectedCountry.setAttribute("aria-expanded","false"),this.c&&this.c.setAttribute("aria-selected","false"),this.options.countrySearch&&this.m1.removeAttribute("aria-activedescendant"),this.u.classList.remove("iti__arrow--up"),this.options.countrySearch&&(this.m1.removeEventListener("input",this._a7),this.m3.removeEventListener("click",this._a6)),document.documentElement.removeEventListener("click",this._a2),this.countryList.removeEventListener("mouseover",this._a0),this.countryList.removeEventListener("click",this._a1),this.options.dropdownContainer&&(this.options.useFullscreenPopup||window.removeEventListener("scroll",this._a4),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._a8&&window.removeEventListener("load",this._a8),this._trigger("close:countrydropdown")}_3(t){let e=this.countryList,i=document.documentElement.scrollTop,n=e.offsetHeight,s=e.getBoundingClientRect().top+i,o=s+n,r=t.offsetHeight,d=t.getBoundingClientRect().top+i,c=d+r,p=d-s+e.scrollTop;if(d<s)e.scrollTop=p;else if(c>o){let u=n-r;e.scrollTop=p-u}}_4(t){let e=this.a.value,i=`+${t}`,n;if(e.charAt(0)==="+"){let s=this._5(e);s?n=e.replace(s,i):n=i,this.a.value=n}}_5(t,e){let i="";if(t.charAt(0)==="+"){let n="";for(let s=0;s<t.length;s++){let o=t.charAt(s);if(!isNaN(parseInt(o,10))){if(n+=o,e)this.q[n]&&(i=t.substring(0,s+1));else if(this.dialCodes.has(n)){i=t.substring(0,s+1);break}if(n.length===this.y)break}}}return i}_6(t){let e=t||this.a.value.trim(),{dialCode:i}=this.s,n,s=_(e);return this.options.separateDialCode&&e.charAt(0)!=="+"&&i&&s?n=`+${i}`:n="",n+e}_7(t){let e=t;if(this.options.separateDialCode){let i=this._5(e);if(i){i=`+${this.s.dialCode}`;let n=e[i.length]===" "||e[i.length]==="-"?i.length+1:i.length;e=e.substring(n)}}return this._j2(e)}_8(){this._trigger("countrychange")}_9(){let t=this._6(),e=l.utils?l.utils.formatNumberAsYouType(t,this.s.iso2):t,{dialCode:i}=this.s;return this.options.separateDialCode&&this.a.value.charAt(0)!=="+"&&e.includes(`+${i}`)?(e.split(`+${i}`)[1]||"").trim():e}handleAutoCountry(){this.options.initialCountry==="auto"&&l.autoCountry&&(this.j=l.autoCountry,this.s.iso2||this.l.classList.contains("iti__globe")||this.setCountry(this.j),this.h())}handleUtils(){l.utils&&(this.a.value&&this._u(this.a.value),this.s.iso2&&(this._0(),this._z4())),this.i0()}destroy(){this.a.iti=void 0;let{allowDropdown:t,separateDialCode:e}=this.options;if(t){this._2(),this.selectedCountry.removeEventListener("click",this._a10),this.k.removeEventListener("keydown",this._a11);let s=this.a.closest("label");s&&s.removeEventListener("click",this._a9)}let{form:i}=this.a;this._a14&&i&&i.removeEventListener("submit",this._a14),this.a.removeEventListener("input",this._a12),this._a5&&this.a.removeEventListener("keydown",this._a5),this.a.removeAttribute("data-intl-tel-input-id"),e&&(this.v?this.a.style.paddingRight=this.n1:this.a.style.paddingLeft=this.n2);let n=this.a.parentNode;n?.parentNode?.insertBefore(this.a,n),n?.parentNode?.removeChild(n),delete l.instances[this.id]}getExtension(){return l.utils?l.utils.getExtension(this._6(),this.s.iso2):""}getNumber(t){if(l.utils){let{iso2:e}=this.s;return l.utils.formatNumber(this._6(),e,t)}return""}getNumberType(){return l.utils?l.utils.getNumberType(this._6(),this.s.iso2):-99}getSelectedCountryData(){return this.s}getValidationError(){if(l.utils){let{iso2:t}=this.s;return l.utils.getValidationError(this._6(),t)}return-99}isValidNumber(){return this._9b(!1)}isValidNumberPrecise(){return this._9b(!0)}_9a(t){return l.utils?l.utils.isPossibleNumber(t,this.s.iso2,this.options.validationNumberTypes):null}_9b(t){if(!this.s.iso2)return!1;let e=o=>t?this._9c(o):this._9a(o),i=this._6(),n=i.search(/\p{L}/u);if(n>-1&&!this.options.allowPhonewords){let o=i.substring(0,n),r=e(o),d=e(i);return r&&d}return e(i)}_9c(t){return l.utils?l.utils.isValidNumber(t,this.s.iso2,this.options.validationNumberTypes):null}setCountry(t){let e=t?.toLowerCase(),i=this.s.iso2;(t&&e!==i||!t&&i)&&(this._z(e),this._4(this.s.dialCode),this.options.formatOnDisplay&&this._u(this.a.value),this._8())}setNumber(t){let e=this._v(t);this._u(t),e&&this._8(),this._trigger("input",{isSetNumber:!0})}setPlaceholderNumberType(t){this.options.placeholderNumberType=t,this._0()}setDisabled(t){this.a.disabled=t,t?this.selectedCountry.setAttribute("disabled","true"):this.selectedCountry.removeAttribute("disabled")}},G=a=>{if(!l.utils&&!l.startedLoadingUtilsScript){let t;if(typeof a=="function")try{t=Promise.resolve(a())}catch(e){return Promise.reject(e)}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 a}`));return l.startedLoadingUtilsScript=!0,t.then(e=>{let i=e?.default;if(!i||typeof i!="object")throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");return l.utils=i,b("handleUtils"),!0}).catch(e=>{throw b("rejectUtilsScriptPromise",e),e})}return null},l=Object.assign((a,t)=>{let e=new I(a,t);return e._init(),a.setAttribute("data-intl-tel-input-id",e.id.toString()),l.instances[e.id]=e,a.iti=e,e},{defaults:M,documentReady:()=>document.readyState==="complete",getCountryData:()=>v,getInstance:a=>{let t=a.getAttribute("data-intl-tel-input-id");return t?l.instances[t]:null},instances:{},attachUtils:G,startedLoadingUtilsScript:!1,startedLoadingAutoCountry:!1,version:"25.10.6"}),q=l;return O(Y);})();
28
28
 
29
29
  // UMD
30
30
  return factoryOutput.default;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v25.10.5
2
+ * International Telephone Input v25.10.6
3
3
  * https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -1266,6 +1266,13 @@ var factoryOutput = (() => {
1266
1266
  // Tuvalu
1267
1267
  "688"
1268
1268
  ],
1269
+ [
1270
+ "vi",
1271
+ // U.S. Virgin Islands
1272
+ "1",
1273
+ 24,
1274
+ ["340"]
1275
+ ],
1269
1276
  [
1270
1277
  "ug",
1271
1278
  // Uganda
@@ -1300,13 +1307,6 @@ var factoryOutput = (() => {
1300
1307
  // Uruguay
1301
1308
  "598"
1302
1309
  ],
1303
- [
1304
- "vi",
1305
- // U.S. Virgin Islands
1306
- "1",
1307
- 24,
1308
- ["340"]
1309
- ],
1310
1310
  [
1311
1311
  "uz",
1312
1312
  // Uzbekistan
@@ -1882,6 +1882,9 @@ var factoryOutput = (() => {
1882
1882
  }
1883
1883
  //* Add a dial code to this.dialCodeToIso2Map.
1884
1884
  _addToDialCodeMap(iso2, dialCode, priority) {
1885
+ if (!iso2 || !dialCode) {
1886
+ return;
1887
+ }
1885
1888
  if (dialCode.length > this.dialCodeMaxLen) {
1886
1889
  this.dialCodeMaxLen = dialCode.length;
1887
1890
  }
@@ -1936,6 +1939,11 @@ var factoryOutput = (() => {
1936
1939
  }
1937
1940
  this._addToDialCodeMap(c.iso2, c.dialCode, c.priority);
1938
1941
  }
1942
+ if (this.options.onlyCountries.length || this.options.excludeCountries.length) {
1943
+ this.dialCodes.forEach((dialCode) => {
1944
+ this.dialCodeToIso2Map[dialCode] = this.dialCodeToIso2Map[dialCode].filter(Boolean);
1945
+ });
1946
+ }
1939
1947
  for (const c of this.countries) {
1940
1948
  if (c.areaCodes) {
1941
1949
  const rootIso2Code = this.dialCodeToIso2Map[c.dialCode][0];
@@ -2354,7 +2362,7 @@ var factoryOutput = (() => {
2354
2362
  _openDropdownWithPlus() {
2355
2363
  this._openDropdown();
2356
2364
  this.searchInput.value = "+";
2357
- this._filterCountries("", true);
2365
+ this._filterCountries("");
2358
2366
  }
2359
2367
  //* Initialize the tel input listeners.
2360
2368
  _initTelInputListeners() {
@@ -2537,11 +2545,7 @@ var factoryOutput = (() => {
2537
2545
  if (this.options.countrySearch) {
2538
2546
  const doFilter = () => {
2539
2547
  const inputQuery = this.searchInput.value.trim();
2540
- if (inputQuery) {
2541
- this._filterCountries(inputQuery);
2542
- } else {
2543
- this._filterCountries("", true);
2544
- }
2548
+ this._filterCountries(inputQuery);
2545
2549
  if (this.searchInput.value) {
2546
2550
  this.searchClearButton.classList.remove("iti__hide");
2547
2551
  } else {
@@ -2580,42 +2584,44 @@ var factoryOutput = (() => {
2580
2584
  }
2581
2585
  }
2582
2586
  //* Country search enabled: Filter the countries according to the search query.
2583
- _filterCountries(query, isReset = false) {
2587
+ _filterCountries(query) {
2584
2588
  let noCountriesAddedYet = true;
2585
2589
  this.countryList.innerHTML = "";
2586
2590
  const normalisedQuery = normaliseString(query);
2587
- const queryLength = normalisedQuery.length;
2588
- const iso2Matches = [];
2589
- const nameStartWith = [];
2590
- const nameContains = [];
2591
- const dialCodeMatches = [];
2592
- const dialCodeContains = [];
2593
- const initialsMatches = [];
2594
- for (const c of this.countries) {
2595
- if (isReset || queryLength === 0) {
2596
- nameContains.push(c);
2597
- } else if (c.iso2 === normalisedQuery) {
2598
- iso2Matches.push(c);
2599
- } else if (c.normalisedName.startsWith(normalisedQuery)) {
2600
- nameStartWith.push(c);
2601
- } else if (c.normalisedName.includes(normalisedQuery)) {
2602
- nameContains.push(c);
2603
- } else if (normalisedQuery === c.dialCode || normalisedQuery === c.dialCodePlus) {
2604
- dialCodeMatches.push(c);
2605
- } else if (c.dialCodePlus.includes(normalisedQuery)) {
2606
- dialCodeContains.push(c);
2607
- } else if (c.initials.includes(normalisedQuery)) {
2608
- initialsMatches.push(c);
2591
+ let matchedCountries;
2592
+ if (query === "") {
2593
+ matchedCountries = this.countries;
2594
+ } else {
2595
+ const iso2Matches = [];
2596
+ const nameStartWith = [];
2597
+ const nameContains = [];
2598
+ const dialCodeMatches = [];
2599
+ const dialCodeContains = [];
2600
+ const initialsMatches = [];
2601
+ for (const c of this.countries) {
2602
+ if (c.iso2 === normalisedQuery) {
2603
+ iso2Matches.push(c);
2604
+ } else if (c.normalisedName.startsWith(normalisedQuery)) {
2605
+ nameStartWith.push(c);
2606
+ } else if (c.normalisedName.includes(normalisedQuery)) {
2607
+ nameContains.push(c);
2608
+ } else if (normalisedQuery === c.dialCode || normalisedQuery === c.dialCodePlus) {
2609
+ dialCodeMatches.push(c);
2610
+ } else if (c.dialCodePlus.includes(normalisedQuery)) {
2611
+ dialCodeContains.push(c);
2612
+ } else if (c.initials.includes(normalisedQuery)) {
2613
+ initialsMatches.push(c);
2614
+ }
2609
2615
  }
2616
+ matchedCountries = [
2617
+ ...iso2Matches.sort((a, b) => a.priority - b.priority),
2618
+ ...nameStartWith.sort((a, b) => a.priority - b.priority),
2619
+ ...nameContains.sort((a, b) => a.priority - b.priority),
2620
+ ...dialCodeMatches.sort((a, b) => a.priority - b.priority),
2621
+ ...dialCodeContains.sort((a, b) => a.priority - b.priority),
2622
+ ...initialsMatches.sort((a, b) => a.priority - b.priority)
2623
+ ];
2610
2624
  }
2611
- const matchedCountries = [
2612
- ...iso2Matches.sort((a, b) => a.priority - b.priority),
2613
- ...nameStartWith.sort((a, b) => a.priority - b.priority),
2614
- ...nameContains.sort((a, b) => a.priority - b.priority),
2615
- ...dialCodeMatches.sort((a, b) => a.priority - b.priority),
2616
- ...dialCodeContains.sort((a, b) => a.priority - b.priority),
2617
- ...initialsMatches.sort((a, b) => a.priority - b.priority)
2618
- ];
2619
2625
  for (const c of matchedCountries) {
2620
2626
  const listItem = c.nodeById[this.id];
2621
2627
  if (listItem) {
@@ -2722,22 +2728,27 @@ var factoryOutput = (() => {
2722
2728
  if (dialCodeMatch) {
2723
2729
  const dialCodeMatchNumeric = getNumeric(dialCodeMatch);
2724
2730
  const iso2Codes = this.dialCodeToIso2Map[dialCodeMatchNumeric];
2731
+ if (iso2Codes.length === 1) {
2732
+ if (iso2Codes[0] === selectedIso2) {
2733
+ return null;
2734
+ }
2735
+ return iso2Codes[0];
2736
+ }
2725
2737
  if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
2726
2738
  return this.defaultCountry;
2727
2739
  }
2740
+ const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
2741
+ if (isRegionlessNanpNumber) {
2742
+ return null;
2743
+ }
2728
2744
  const hasAreaCodesButNoneMatched = this.selectedCountryData.areaCodes && numeric.length > dialCodeMatchNumeric.length;
2729
2745
  const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && !hasAreaCodesButNoneMatched;
2730
- const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
2731
- if (!isRegionlessNanpNumber && !alreadySelected) {
2732
- for (const iso2 of iso2Codes) {
2733
- if (iso2) {
2734
- return iso2;
2735
- }
2736
- }
2746
+ if (!alreadySelected) {
2747
+ return iso2Codes[0];
2737
2748
  }
2738
2749
  } else if (number.charAt(0) === "+" && numeric.length) {
2739
2750
  return "";
2740
- } else if ((!number || number === "+") && !this.selectedCountryData.iso2) {
2751
+ } else if ((!number || number === "+") && !selectedIso2) {
2741
2752
  return this.defaultCountry;
2742
2753
  }
2743
2754
  return null;
@@ -3286,7 +3297,7 @@ var factoryOutput = (() => {
3286
3297
  attachUtils,
3287
3298
  startedLoadingUtilsScript: false,
3288
3299
  startedLoadingAutoCountry: false,
3289
- version: "25.10.5"
3300
+ version: "25.10.6"
3290
3301
  }
3291
3302
  );
3292
3303
  var intl_tel_input_default = intlTelInput;