intl-tel-input 27.2.0 → 27.2.1

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,9 +1,9 @@
1
1
  /*
2
- * International Telephone Input v27.2.0
2
+ * International Telephone Input v27.2.1
3
3
  * git+https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
6
- "use strict";var _factory=(()=>{var z=Object.defineProperty;var Nt=Object.getOwnPropertyDescriptor;var Dt=Object.getOwnPropertyNames;var _t=Object.prototype.hasOwnProperty;var Ot=(n,t)=>{for(var e in t)z(n,e,{get:t[e],enumerable:!0})},St=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Dt(t))!_t.call(n,s)&&s!==e&&z(n,s,{get:()=>t[s],enumerable:!(i=Nt(t,s))||i.enumerable});return n};var Pt=n=>St(z({},"__esModule",{value:!0}),n);var Gt={};Ot(Gt,{Iti:()=>M,default:()=>Vt});var Rt=[["af","93",0,null,"0"],["ax","358",1,["18","4"],"0"],["al","355",0,null,"0"],["dz","213",0,null,"0"],["as","1",5,["684"],"1"],["ad","376"],["ao","244"],["ai","1",6,["264"],"1"],["ag","1",7,["268"],"1"],["ar","54",0,null,"0"],["am","374",0,null,"0"],["aw","297"],["ac","247"],["au","61",0,["4"],"0"],["at","43",0,null,"0"],["az","994",0,null,"0"],["bs","1",8,["242"],"1"],["bh","973"],["bd","880",0,null,"0"],["bb","1",9,["246"],"1"],["by","375",0,null,"8"],["be","32",0,null,"0"],["bz","501"],["bj","229"],["bm","1",10,["441"],"1"],["bt","975"],["bo","591",0,null,"0"],["ba","387",0,null,"0"],["bw","267"],["br","55",0,null,"0"],["io","246"],["vg","1",11,["284"],"1"],["bn","673"],["bg","359",0,null,"0"],["bf","226"],["bi","257"],["kh","855",0,null,"0"],["cm","237"],["ca","1",1,["204","226","236","249","250","257","263","289","306","343","354","365","367","368","382","403","416","418","428","431","437","438","450","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","942"],"1"],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"],"1"],["cf","236"],["td","235"],["cl","56"],["cn","86",0,null,"0"],["cx","61",2,["4","89164"],"0"],["cc","61",1,["4","89162"],"0"],["co","57",0,null,"0"],["km","269"],["cg","242"],["cd","243",0,null,"0"],["ck","682"],["cr","506"],["ci","225"],["hr","385",0,null,"0"],["cu","53",0,null,"0"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"],"1"],["do","1",2,["809","829","849"],"1"],["ec","593",0,null,"0"],["eg","20",0,null,"0"],["sv","503"],["gq","240"],["er","291",0,null,"0"],["ee","372"],["sz","268"],["et","251",0,null,"0"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0,["4"],"0"],["fr","33",0,null,"0"],["gf","594",0,null,"0"],["pf","689"],["ga","241"],["gm","220"],["ge","995",0,null,"0"],["de","49",0,null,"0"],["gh","233",0,null,"0"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"],"1"],["gp","590",0,null,"0"],["gu","1",15,["671"],"1"],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36",0,null,"06"],["is","354"],["in","91",0,null,"0"],["id","62",0,null,"0"],["ir","98",0,null,"0"],["iq","964",0,null,"0"],["ie","353",0,null,"0"],["im","44",2,["1624","74576","7524","7624","7924"],"0"],["il","972",0,null,"0"],["it","39",0,["3"]],["jm","1",4,["658","876"],"1"],["jp","81",0,null,"0"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962",0,null,"0"],["kz","7",1,["33","7"],"8"],["ke","254",0,null,"0"],["ki","686",0,null,"0"],["xk","383",0,null,"0"],["kw","965"],["kg","996",0,null,"0"],["la","856",0,null,"0"],["lv","371"],["lb","961",0,null,"0"],["ls","266"],["lr","231",0,null,"0"],["ly","218",0,null,"0"],["li","423",0,null,"0"],["lt","370",0,null,"0"],["lu","352"],["mo","853"],["mg","261",0,null,"0"],["mw","265",0,null,"0"],["my","60",0,null,"0"],["mv","960"],["ml","223"],["mt","356"],["mh","692",0,null,"1"],["mq","596",0,null,"0"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373",0,null,"0"],["mc","377",0,null,"0"],["mn","976",0,null,"0"],["me","382",0,null,"0"],["ms","1",16,["664"],"1"],["ma","212",0,["6","7"],"0"],["mz","258"],["mm","95",0,null,"0"],["na","264",0,null,"0"],["nr","674"],["np","977",0,null,"0"],["nl","31",0,null,"0"],["nc","687"],["nz","64",0,null,"0"],["ni","505"],["ne","227"],["ng","234",0,null,"0"],["nu","683"],["nf","672"],["kp","850",0,null,"0"],["mk","389",0,null,"0"],["mp","1",17,["670"],"1"],["no","47",0,["4","9"]],["om","968"],["pk","92",0,null,"0"],["pw","680"],["ps","970",0,null,"0"],["pa","507"],["pg","675"],["py","595",0,null,"0"],["pe","51",0,null,"0"],["ph","63",0,null,"0"],["pl","48"],["pt","351"],["pr","1",3,["787","939"],"1"],["qa","974"],["re","262",0,null,"0"],["ro","40",0,null,"0"],["ru","7",0,["33"],"8"],["rw","250",0,null,"0"],["ws","685"],["sm","378"],["st","239"],["sa","966",0,null,"0"],["sn","221"],["rs","381",0,null,"0"],["sc","248"],["sl","232",0,null,"0"],["sg","65"],["sx","1",21,["721"],"1"],["sk","421",0,null,"0"],["si","386",0,null,"0"],["sb","677"],["so","252",0,null,"0"],["za","27",0,null,"0"],["kr","82",0,null,"0"],["ss","211",0,null,"0"],["es","34"],["lk","94",0,null,"0"],["bl","590",1,null,"0"],["sh","290"],["kn","1",18,["869"],"1"],["lc","1",19,["758"],"1"],["mf","590",2,null,"0"],["pm","508",0,null,"0"],["vc","1",20,["784"],"1"],["sd","249",0,null,"0"],["sr","597"],["sj","47",1,["4","79","9"]],["se","46",0,null,"0"],["ch","41",0,null,"0"],["sy","963",0,null,"0"],["tw","886",0,null,"0"],["tj","992"],["tz","255",0,null,"0"],["th","66",0,null,"0"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"],"1"],["tn","216"],["tr","90",0,null,"0"],["tm","993",0,null,"8"],["tc","1",23,["649"],"1"],["tv","688"],["vi","1",24,["340"],"1"],["ug","256",0,null,"0"],["ua","380",0,null,"0"],["ae","971",0,null,"0"],["gb","44",0,null,"0"],["us","1",0,null,"1"],["uy","598",0,null,"0"],["uz","998"],["vu","678"],["va","39",1,["06698","3"]],["ve","58",0,null,"0"],["vn","84",0,null,"0"],["wf","681"],["eh","212",1,["5288","5289","6","7"],"0"],["ye","967",0,null,"0"],["zm","260",0,null,"0"],["zw","263",0,null,"0"]],X=[];for(let n of Rt)X.push({name:"",iso2:n[0],dialCode:n[1],priority:n[2]||0,areaCodes:n[3]||null,nationalPrefix:n[4]||null,normalisedName:"",initials:"",dialCodePlus:""});var Mt=new Set(X.map(n=>n.iso2)),N=n=>Mt.has(n),O=X;var b={OPEN_COUNTRY_DROPDOWN:"open:countrydropdown",CLOSE_COUNTRY_DROPDOWN:"close:countrydropdown",COUNTRY_CHANGE:"countrychange",INPUT:"input",STRICT_REJECT:"strict:reject"},d={HIDE:"iti__hide",V_HIDE:"iti__v-hide",ARROW_UP:"iti__arrow--up",GLOBE:"iti__globe",FLAG:"iti__flag",LOADING:"iti__loading",COUNTRY_ITEM:"iti__country",HIGHLIGHT:"iti__highlight"},C={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",SPACE:" ",ENTER:"Enter",ESC:"Escape",TAB:"Tab"},q={PASTE:"insertFromPaste",DELETE_FORWARD:"deleteContentForward"},v={ALPHA_UNICODE:/\p{L}/u,NON_PLUS_NUMERIC:/[^+0-9]/,NON_PLUS_NUMERIC_GLOBAL:/[^+0-9]/g,HIDDEN_SEARCH_CHAR:/^[a-zA-ZÀ-ÿа-яА-Я ]$/},J={SEARCH_DEBOUNCE_MS:100,HIDDEN_SEARCH_RESET_MS:1e3,NEXT_TICK:0},Q={UNKNOWN_NUMBER_TYPE:-99,UNKNOWN_VALIDATION_ERROR:-99},L={NARROW_VIEWPORT_WIDTH:500,FALLBACK_SELECTED_WITH_DIAL_WIDTH:78,FALLBACK_SELECTED_NO_DIAL_WIDTH:42,INPUT_PADDING_EXTRA_LEFT:6,DROPDOWN_MARGIN:3,FALLBACK_DROPDOWN_HEIGHT:200},B={PLUS:"+",NANP:"1"},F={ISO2:"gb",DIAL_CODE:"44",MOBILE_PREFIX:"7",MOBILE_CORE_LENGTH:10},nt={ISO2:"us",DIAL_CODE:"1"},S={AGGRESSIVE:"aggressive",POLITE:"polite",OFF:"off"},k={AUTO:"auto"},xt=["FIXED_LINE","MOBILE","FIXED_LINE_OR_MOBILE","TOLL_FREE","PREMIUM_RATE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL","UNKNOWN"],U=new Set(xt),A={ISO2:"countryCode",DIAL_CODE:"dialCode",INSTANCE_ID:"intlTelInputId"},h={EXPANDED:"aria-expanded",LABEL:"aria-label",SELECTED:"aria-selected",ACTIVE_DESCENDANT:"aria-activedescendant",HASPOPUP:"aria-haspopup",CONTROLS:"aria-controls",HIDDEN:"aria-hidden",AUTOCOMPLETE:"aria-autocomplete",MODAL:"aria-modal"};var Ht={selectedCountryAriaLabel:"Change country for phone number, currently selected ${countryName} (${dialCode})",noCountrySelected:"Select country for phone number",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",clearSearchAriaLabel:"Clear search",searchEmptyState:"No results found",searchSummaryAria(n){return n===0?"No results found":n===1?"1 result found":`${n} results found`}},ot=Ht;var Z=n=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(n).matches,ut=()=>Z(`(max-width: ${L.NARROW_VIEWPORT_WIDTH}px)`),kt=()=>{if(typeof navigator<"u"&&typeof window<"u"){let n=Z("(max-height: 600px)"),t=Z("(pointer: coarse)");return ut()||t&&n}return!1},V={allowDropdown:!0,allowedNumberTypes:["MOBILE","FIXED_LINE"],allowNumberExtensions:!1,allowPhonewords:!1,autoPlaceholder:S.POLITE,containerClass:"",countryNameLocale:"en",countryOrder:null,countrySearch:!0,customPlaceholder:null,dropdownAlwaysOpen:!1,dropdownContainer:null,excludeCountries:null,fixDropdownWidth:!0,formatAsYouType:!0,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:null,i18n:{},initialCountry:"",loadUtils:null,nationalMode:!0,onlyCountries:null,placeholderNumberType:"MOBILE",searchInputClass:"",separateDialCode:!1,showFlags:!0,strictMode:!1,useFullscreenPopup:kt()},ct=n=>JSON.stringify(n),lt=n=>!!n&&typeof n=="object"&&!Array.isArray(n),Ut=n=>typeof n=="function",Wt=n=>{if(!n||typeof n!="object")return!1;let t=n;return t.nodeType===1&&typeof t.tagName=="string"&&typeof t.appendChild=="function"},rt=new Set(Object.values(S)),j=n=>{console.warn(`[intl-tel-input] ${n}`)},E=(n,t,e)=>{j(`Option '${n}' must be ${t}; got ${ct(e)}. Ignoring.`)},at=(n,t)=>{let e="an array of iso2 country code strings";if(!Array.isArray(t))return E(n,e,t),!1;let i=[];for(let s of t){if(typeof s!="string")return E(n,e,t),!1;let o=s.toLowerCase();N(o)?i.push(s):j(`Invalid iso2 code in '${n}': '${s}'. Skipping.`)}return i},dt=n=>{if(n===void 0)return{};if(!lt(n)){let e=`The second argument must be an options object; got ${ct(n)}. Using defaults.`;return j(e),{}}let t={};for(let[e,i]of Object.entries(n)){if(!Object.hasOwn(V,e)){j(`Unknown option '${e}'. Ignoring.`);continue}switch(e){case"allowDropdown":case"allowNumberExtensions":case"allowPhonewords":case"countrySearch":case"dropdownAlwaysOpen":case"fixDropdownWidth":case"formatAsYouType":case"formatOnDisplay":case"nationalMode":case"showFlags":case"separateDialCode":case"strictMode":case"useFullscreenPopup":if(typeof i!="boolean"){E(e,"a boolean",i);break}t[e]=i;break;case"autoPlaceholder":if(typeof i!="string"||!rt.has(i)){let s=Array.from(rt).join(", ");E("autoPlaceholder",`one of ${s}`,i);break}t[e]=i;break;case"containerClass":case"searchInputClass":case"countryNameLocale":if(typeof i!="string"){E(e,"a string",i);break}t[e]=i;break;case"countryOrder":{if(i===null)t[e]=i;else{let s=at(e,i);s!==!1&&(t[e]=s)}break}case"customPlaceholder":case"geoIpLookup":case"hiddenInput":case"loadUtils":if(i!==null&&!Ut(i)){E(e,"a function or null",i);break}t[e]=i;break;case"dropdownContainer":if(i!==null&&!Wt(i)){E("dropdownContainer","an HTMLElement or null",i);break}t[e]=i;break;case"excludeCountries":case"onlyCountries":{if(i===null)t[e]=i;else{let s=at(e,i);s!==!1&&(t[e]=s)}break}case"i18n":if(i&&!lt(i)){E("i18n","an object",i);break}t[e]=i;break;case"initialCountry":{if(typeof i!="string"){E("initialCountry","a string",i);break}let s=i.toLowerCase();if(s&&s!==k.AUTO&&!N(s)){E("initialCountry","a valid iso2 country code or 'auto'",i);break}t[e]=i;break}case"placeholderNumberType":if(typeof i!="string"||!U.has(i)){let s=Array.from(U).join(", ");E("placeholderNumberType",`one of ${s}`,i);break}t[e]=i;break;case"allowedNumberTypes":if(i!==null){if(!Array.isArray(i)){E("allowedNumberTypes","an array of number types or null",i);break}let s=!0;for(let o of i)if(typeof o!="string"||!U.has(o)){let l=Array.from(U).join(", ");E("allowedNumberTypes",`an array of valid number types (${l})`,o),s=!1;break}s&&(t[e]=i)}else t[e]=null;break}}return t},ht=n=>{n.initialCountry&&(n.initialCountry=n.initialCountry.toLowerCase()),n.onlyCountries?.length&&(n.onlyCountries=n.onlyCountries.map(t=>t.toLowerCase())),n.excludeCountries?.length&&(n.excludeCountries=n.excludeCountries.map(t=>t.toLowerCase())),n.countryOrder&&(n.countryOrder=n.countryOrder.map(t=>t.toLowerCase()))},pt=n=>{n.dropdownAlwaysOpen&&(n.useFullscreenPopup=!1,n.allowDropdown=!0),n.useFullscreenPopup?n.fixDropdownWidth=!1:ut()&&(n.fixDropdownWidth=!0),n.onlyCountries?.length===1&&(n.initialCountry=n.onlyCountries[0]),n.separateDialCode&&(n.nationalMode=!1),n.allowDropdown&&!n.showFlags&&!n.separateDialCode&&(n.nationalMode=!1),n.useFullscreenPopup&&!n.dropdownContainer&&(n.dropdownContainer=document.body),n.i18n={...ot,...n.i18n}};var w=n=>n.replace(/\D/g,""),W=(n="")=>n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();var G=n=>Object.keys(n).filter(t=>!!n[t]).join(" "),f=(n,t,e)=>{let i=document.createElement(n);return t&&Object.entries(t).forEach(([s,o])=>i.setAttribute(s,o)),e&&e.appendChild(i),i};var ft=()=>`
6
+ "use strict";var _factory=(()=>{var z=Object.defineProperty;var Nt=Object.getOwnPropertyDescriptor;var Dt=Object.getOwnPropertyNames;var _t=Object.prototype.hasOwnProperty;var Ot=(n,t)=>{for(var e in t)z(n,e,{get:t[e],enumerable:!0})},St=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Dt(t))!_t.call(n,s)&&s!==e&&z(n,s,{get:()=>t[s],enumerable:!(i=Nt(t,s))||i.enumerable});return n};var Pt=n=>St(z({},"__esModule",{value:!0}),n);var Gt={};Ot(Gt,{Iti:()=>M,default:()=>Vt});var Rt=[["af","93",0,null,"0"],["ax","358",1,["18","4"],"0"],["al","355",0,null,"0"],["dz","213",0,null,"0"],["as","1",5,["684"],"1"],["ad","376"],["ao","244"],["ai","1",6,["264"],"1"],["ag","1",7,["268"],"1"],["ar","54",0,null,"0"],["am","374",0,null,"0"],["aw","297"],["ac","247"],["au","61",0,["4"],"0"],["at","43",0,null,"0"],["az","994",0,null,"0"],["bs","1",8,["242"],"1"],["bh","973"],["bd","880",0,null,"0"],["bb","1",9,["246"],"1"],["by","375",0,null,"8"],["be","32",0,null,"0"],["bz","501"],["bj","229"],["bm","1",10,["441"],"1"],["bt","975"],["bo","591",0,null,"0"],["ba","387",0,null,"0"],["bw","267"],["br","55",0,null,"0"],["io","246"],["vg","1",11,["284"],"1"],["bn","673"],["bg","359",0,null,"0"],["bf","226"],["bi","257"],["kh","855",0,null,"0"],["cm","237"],["ca","1",1,["204","226","236","249","250","257","263","289","306","343","354","365","367","368","382","403","416","418","428","431","437","438","450","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","942"],"1"],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"],"1"],["cf","236"],["td","235"],["cl","56"],["cn","86",0,null,"0"],["cx","61",2,["4","89164"],"0"],["cc","61",1,["4","89162"],"0"],["co","57",0,null,"0"],["km","269"],["cg","242"],["cd","243",0,null,"0"],["ck","682"],["cr","506"],["ci","225"],["hr","385",0,null,"0"],["cu","53",0,null,"0"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"],"1"],["do","1",2,["809","829","849"],"1"],["ec","593",0,null,"0"],["eg","20",0,null,"0"],["sv","503"],["gq","240"],["er","291",0,null,"0"],["ee","372"],["sz","268"],["et","251",0,null,"0"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0,["4"],"0"],["fr","33",0,null,"0"],["gf","594",0,null,"0"],["pf","689"],["ga","241"],["gm","220"],["ge","995",0,null,"0"],["de","49",0,null,"0"],["gh","233",0,null,"0"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"],"1"],["gp","590",0,null,"0"],["gu","1",15,["671"],"1"],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36",0,null,"06"],["is","354"],["in","91",0,null,"0"],["id","62",0,null,"0"],["ir","98",0,null,"0"],["iq","964",0,null,"0"],["ie","353",0,null,"0"],["im","44",2,["1624","74576","7524","7624","7924"],"0"],["il","972",0,null,"0"],["it","39",0,["3"]],["jm","1",4,["658","876"],"1"],["jp","81",0,null,"0"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962",0,null,"0"],["kz","7",1,["33","7"],"8"],["ke","254",0,null,"0"],["ki","686",0,null,"0"],["xk","383",0,null,"0"],["kw","965"],["kg","996",0,null,"0"],["la","856",0,null,"0"],["lv","371"],["lb","961",0,null,"0"],["ls","266"],["lr","231",0,null,"0"],["ly","218",0,null,"0"],["li","423",0,null,"0"],["lt","370",0,null,"0"],["lu","352"],["mo","853"],["mg","261",0,null,"0"],["mw","265",0,null,"0"],["my","60",0,null,"0"],["mv","960"],["ml","223"],["mt","356"],["mh","692",0,null,"1"],["mq","596",0,null,"0"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373",0,null,"0"],["mc","377",0,null,"0"],["mn","976",0,null,"0"],["me","382",0,null,"0"],["ms","1",16,["664"],"1"],["ma","212",0,["6","7"],"0"],["mz","258"],["mm","95",0,null,"0"],["na","264",0,null,"0"],["nr","674"],["np","977",0,null,"0"],["nl","31",0,null,"0"],["nc","687"],["nz","64",0,null,"0"],["ni","505"],["ne","227"],["ng","234",0,null,"0"],["nu","683"],["nf","672"],["kp","850",0,null,"0"],["mk","389",0,null,"0"],["mp","1",17,["670"],"1"],["no","47",0,["4","9"]],["om","968"],["pk","92",0,null,"0"],["pw","680"],["ps","970",0,null,"0"],["pa","507"],["pg","675"],["py","595",0,null,"0"],["pe","51",0,null,"0"],["ph","63",0,null,"0"],["pl","48"],["pt","351"],["pr","1",3,["787","939"],"1"],["qa","974"],["re","262",0,null,"0"],["ro","40",0,null,"0"],["ru","7",0,["33"],"8"],["rw","250",0,null,"0"],["ws","685"],["sm","378"],["st","239"],["sa","966",0,null,"0"],["sn","221"],["rs","381",0,null,"0"],["sc","248"],["sl","232",0,null,"0"],["sg","65"],["sx","1",21,["721"],"1"],["sk","421",0,null,"0"],["si","386",0,null,"0"],["sb","677"],["so","252",0,null,"0"],["za","27",0,null,"0"],["kr","82",0,null,"0"],["ss","211",0,null,"0"],["es","34"],["lk","94",0,null,"0"],["bl","590",1,null,"0"],["sh","290"],["kn","1",18,["869"],"1"],["lc","1",19,["758"],"1"],["mf","590",2,null,"0"],["pm","508",0,null,"0"],["vc","1",20,["784"],"1"],["sd","249",0,null,"0"],["sr","597"],["sj","47",1,["4","79","9"]],["se","46",0,null,"0"],["ch","41",0,null,"0"],["sy","963",0,null,"0"],["tw","886",0,null,"0"],["tj","992"],["tz","255",0,null,"0"],["th","66",0,null,"0"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"],"1"],["tn","216"],["tr","90",0,null,"0"],["tm","993",0,null,"8"],["tc","1",23,["649"],"1"],["tv","688"],["vi","1",24,["340"],"1"],["ug","256",0,null,"0"],["ua","380",0,null,"0"],["ae","971",0,null,"0"],["gb","44",0,null,"0"],["us","1",0,null,"1"],["uy","598",0,null,"0"],["uz","998"],["vu","678"],["va","39",1,["06698","3"]],["ve","58",0,null,"0"],["vn","84",0,null,"0"],["wf","681"],["eh","212",1,["5288","5289","6","7"],"0"],["ye","967",0,null,"0"],["zm","260",0,null,"0"],["zw","263",0,null,"0"]],X=[];for(let n of Rt)X.push({name:"",iso2:n[0],dialCode:n[1],priority:n[2]||0,areaCodes:n[3]||null,nationalPrefix:n[4]||null,normalisedName:"",initials:"",dialCodePlus:""});var Mt=new Set(X.map(n=>n.iso2)),N=n=>Mt.has(n),O=X;var b={OPEN_COUNTRY_DROPDOWN:"open:countrydropdown",CLOSE_COUNTRY_DROPDOWN:"close:countrydropdown",COUNTRY_CHANGE:"countrychange",INPUT:"input",STRICT_REJECT:"strict:reject"},d={HIDE:"iti__hide",V_HIDE:"iti__v-hide",ARROW_UP:"iti__arrow--up",GLOBE:"iti__globe",FLAG:"iti__flag",LOADING:"iti__loading",COUNTRY_ITEM:"iti__country",HIGHLIGHT:"iti__highlight"},C={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",SPACE:" ",ENTER:"Enter",ESC:"Escape",TAB:"Tab"},q={PASTE:"insertFromPaste",DELETE_FORWARD:"deleteContentForward"},A={ALPHA_UNICODE:/\p{L}/u,NON_PLUS_NUMERIC:/[^+0-9]/,NON_PLUS_NUMERIC_GLOBAL:/[^+0-9]/g,HIDDEN_SEARCH_CHAR:/^[a-zA-ZÀ-ÿа-яА-Я ]$/},J={SEARCH_DEBOUNCE_MS:100,HIDDEN_SEARCH_RESET_MS:1e3,NEXT_TICK:0},Q={UNKNOWN_NUMBER_TYPE:-99,UNKNOWN_VALIDATION_ERROR:-99},L={NARROW_VIEWPORT_WIDTH:500,FALLBACK_SELECTED_WITH_DIAL_WIDTH:78,FALLBACK_SELECTED_NO_DIAL_WIDTH:42,INPUT_PADDING_EXTRA_LEFT:6,DROPDOWN_MARGIN:3,FALLBACK_DROPDOWN_HEIGHT:200},F={PLUS:"+",NANP:"1"},B={ISO2:"gb",DIAL_CODE:"44",MOBILE_PREFIX:"7",MOBILE_CORE_LENGTH:10},nt={ISO2:"us",DIAL_CODE:"1"},S={AGGRESSIVE:"aggressive",POLITE:"polite",OFF:"off"},k={AUTO:"auto"},xt=["FIXED_LINE","MOBILE","FIXED_LINE_OR_MOBILE","TOLL_FREE","PREMIUM_RATE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL","UNKNOWN"],U=new Set(xt),v={ISO2:"countryCode",DIAL_CODE:"dialCode",INSTANCE_ID:"intlTelInputId"},h={EXPANDED:"aria-expanded",LABEL:"aria-label",SELECTED:"aria-selected",ACTIVE_DESCENDANT:"aria-activedescendant",HASPOPUP:"aria-haspopup",CONTROLS:"aria-controls",HIDDEN:"aria-hidden",AUTOCOMPLETE:"aria-autocomplete",MODAL:"aria-modal"};var Ht={selectedCountryAriaLabel:"Change country for phone number, currently selected ${countryName} (${dialCode})",noCountrySelected:"Select country for phone number",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",clearSearchAriaLabel:"Clear search",searchEmptyState:"No results found",searchSummaryAria(n){return n===0?"No results found":n===1?"1 result found":`${n} results found`}},ot=Ht;var Z=n=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(n).matches,ut=()=>Z(`(max-width: ${L.NARROW_VIEWPORT_WIDTH}px)`),kt=()=>{if(typeof navigator<"u"&&typeof window<"u"){let n=Z("(max-height: 600px)"),t=Z("(pointer: coarse)");return ut()||t&&n}return!1},V={allowDropdown:!0,allowedNumberTypes:["MOBILE","FIXED_LINE"],allowNumberExtensions:!1,allowPhonewords:!1,autoPlaceholder:S.POLITE,containerClass:"",countryNameLocale:"en",countryOrder:null,countrySearch:!0,customPlaceholder:null,dropdownAlwaysOpen:!1,dropdownContainer:null,excludeCountries:null,fixDropdownWidth:!0,formatAsYouType:!0,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:null,i18n:{},initialCountry:"",loadUtils:null,nationalMode:!0,onlyCountries:null,placeholderNumberType:"MOBILE",searchInputClass:"",separateDialCode:!1,showFlags:!0,strictMode:!1,useFullscreenPopup:kt()},ct=n=>JSON.stringify(n),rt=n=>!!n&&typeof n=="object"&&!Array.isArray(n),Ut=n=>typeof n=="function",Wt=n=>{if(!n||typeof n!="object")return!1;let t=n;return t.nodeType===1&&typeof t.tagName=="string"&&typeof t.appendChild=="function"},lt=new Set(Object.values(S)),j=n=>{console.warn(`[intl-tel-input] ${n}`)},E=(n,t,e)=>{j(`Option '${n}' must be ${t}; got ${ct(e)}. Ignoring.`)},at=(n,t)=>{let e="an array of iso2 country code strings";if(!Array.isArray(t))return E(n,e,t),!1;let i=[];for(let s of t){if(typeof s!="string")return E(n,e,t),!1;let o=s.toLowerCase();N(o)?i.push(s):j(`Invalid iso2 code in '${n}': '${s}'. Skipping.`)}return i},dt=n=>{if(n===void 0)return{};if(!rt(n)){let e=`The second argument must be an options object; got ${ct(n)}. Using defaults.`;return j(e),{}}let t={};for(let[e,i]of Object.entries(n)){if(!Object.hasOwn(V,e)){j(`Unknown option '${e}'. Ignoring.`);continue}switch(e){case"allowDropdown":case"allowNumberExtensions":case"allowPhonewords":case"countrySearch":case"dropdownAlwaysOpen":case"fixDropdownWidth":case"formatAsYouType":case"formatOnDisplay":case"nationalMode":case"showFlags":case"separateDialCode":case"strictMode":case"useFullscreenPopup":if(typeof i!="boolean"){E(e,"a boolean",i);break}t[e]=i;break;case"autoPlaceholder":if(typeof i!="string"||!lt.has(i)){let s=Array.from(lt).join(", ");E("autoPlaceholder",`one of ${s}`,i);break}t[e]=i;break;case"containerClass":case"searchInputClass":case"countryNameLocale":if(typeof i!="string"){E(e,"a string",i);break}t[e]=i;break;case"countryOrder":{if(i===null)t[e]=i;else{let s=at(e,i);s!==!1&&(t[e]=s)}break}case"customPlaceholder":case"geoIpLookup":case"hiddenInput":case"loadUtils":if(i!==null&&!Ut(i)){E(e,"a function or null",i);break}t[e]=i;break;case"dropdownContainer":if(i!==null&&!Wt(i)){E("dropdownContainer","an HTMLElement or null",i);break}t[e]=i;break;case"excludeCountries":case"onlyCountries":{if(i===null)t[e]=i;else{let s=at(e,i);s!==!1&&(t[e]=s)}break}case"i18n":if(i&&!rt(i)){E("i18n","an object",i);break}t[e]=i;break;case"initialCountry":{if(typeof i!="string"){E("initialCountry","a string",i);break}let s=i.toLowerCase();if(s&&s!==k.AUTO&&!N(s)){E("initialCountry","a valid iso2 country code or 'auto'",i);break}t[e]=i;break}case"placeholderNumberType":if(typeof i!="string"||!U.has(i)){let s=Array.from(U).join(", ");E("placeholderNumberType",`one of ${s}`,i);break}t[e]=i;break;case"allowedNumberTypes":if(i!==null){if(!Array.isArray(i)){E("allowedNumberTypes","an array of number types or null",i);break}let s=!0;for(let o of i)if(typeof o!="string"||!U.has(o)){let r=Array.from(U).join(", ");E("allowedNumberTypes",`an array of valid number types (${r})`,o),s=!1;break}s&&(t[e]=i)}else t[e]=null;break}}return t},ht=n=>{n.initialCountry&&(n.initialCountry=n.initialCountry.toLowerCase()),n.onlyCountries?.length&&(n.onlyCountries=n.onlyCountries.map(t=>t.toLowerCase())),n.excludeCountries?.length&&(n.excludeCountries=n.excludeCountries.map(t=>t.toLowerCase())),n.countryOrder&&(n.countryOrder=n.countryOrder.map(t=>t.toLowerCase()))},pt=n=>{n.dropdownAlwaysOpen&&(n.useFullscreenPopup=!1,n.allowDropdown=!0),n.useFullscreenPopup?n.fixDropdownWidth=!1:ut()&&(n.fixDropdownWidth=!0),n.onlyCountries?.length===1&&(n.initialCountry=n.onlyCountries[0]),n.separateDialCode&&(n.nationalMode=!1),n.allowDropdown&&!n.showFlags&&!n.separateDialCode&&(n.nationalMode=!1),n.useFullscreenPopup&&!n.dropdownContainer&&(n.dropdownContainer=document.body),n.i18n={...ot,...n.i18n}};var w=n=>n.replace(/\D/g,""),W=(n="")=>n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();var G=n=>Object.keys(n).filter(t=>!!n[t]).join(" "),f=(n,t,e)=>{let i=document.createElement(n);return t&&Object.entries(t).forEach(([s,o])=>i.setAttribute(s,o)),e&&e.appendChild(i),i};var ft=()=>`
7
7
  <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${h.HIDDEN}="true">
8
8
  <circle cx="11" cy="11" r="7" />
9
9
  <line x1="21" y1="21" x2="16.65" y2="16.65" />
@@ -21,5 +21,5 @@
21
21
  <svg width="256" height="256" viewBox="0 0 512 512" class="iti__globe-svg">
22
22
  <path d="M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39"/>
23
23
  <path d="m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40"/>
24
- </svg>`;var yt=(n,t)=>{let e=W(t),i=[],s=[],o=[],l=[],r=[],a=[];for(let c of n)c.iso2===e?i.push(c):c.normalisedName.startsWith(e)?s.push(c):c.normalisedName.includes(e)?o.push(c):e===c.dialCode||e===c.dialCodePlus?l.push(c):c.dialCodePlus.includes(e)?r.push(c):c.initials.includes(e)&&a.push(c);let p=(c,m)=>c.priority-m.priority;return[...i,...s,...o,...l.sort(p),...r.sort(p),...a]},Et=(n,t)=>{let e=W(t);for(let i of n)if(i.normalisedName.startsWith(e))return i;return null};var P=class n{#t;#i;#v;#E="";#I;#A=null;#_;#m;#e;#c;#g;#o;#s;#f;#r;#u;#n;#a;#d;#T;#H;#l;#C=null;#h=null;#O=new Map;#N=null;telInputEl;hadInitialPlaceholder;constructor(t,e,i){t.dataset[A.INSTANCE_ID]=i.toString(),this.telInputEl=t,this.#t=e,this.#i=i,this.hadInitialPlaceholder=!!t.getAttribute("placeholder"),this.#v=!!this.telInputEl.closest("[dir=rtl]"),this.#E=this.telInputEl.style.paddingLeft}static validateInput(t){let e=t?.tagName;if(!(!!t&&typeof t=="object"&&e==="INPUT"&&typeof t.setAttribute=="function")){let s=Object.prototype.toString.call(t);throw new TypeError(`The first argument must be an HTMLInputElement, not ${s}`)}}buildMarkup(t){this.#I=t,this.telInputEl.classList.add("iti__tel-input"),this.telInputEl.hasAttribute("type")||this.telInputEl.setAttribute("type","tel"),this.telInputEl.hasAttribute("autocomplete")||this.telInputEl.setAttribute("autocomplete","tel"),this.telInputEl.hasAttribute("inputmode")||this.telInputEl.setAttribute("inputmode","tel");let e=this.#k();this.#U(e),e.appendChild(this.telInputEl),this.#q(),this.#J(e),this.ensureDropdownWidthSet()}#k(){let{allowDropdown:t,showFlags:e,containerClass:i,useFullscreenPopup:s}=this.#t,o=G({iti:!0,"iti--allow-dropdown":t,"iti--show-flags":e,"iti--inline-dropdown":!s,[i]:!!i}),l=f("div",{class:o});return this.#v&&l.setAttribute("dir","ltr"),this.telInputEl.before(l),l}#U(t){let{allowDropdown:e,separateDialCode:i,showFlags:s}=this.#t;if(!e&&!s&&!i)return;this.#m=f("div",{class:`iti__country-container ${d.V_HIDE}`},t),e?(this.#e=f("button",{type:"button",class:"iti__selected-country",[h.EXPANDED]:"false",[h.LABEL]:this.#t.i18n.noCountrySelected,[h.HASPOPUP]:"dialog",[h.CONTROLS]:`iti-${this.#i}__dropdown-content`},this.#m),this.telInputEl.disabled&&this.#e.setAttribute("disabled","true")):this.#e=f("div",{class:"iti__selected-country"},this.#m);let o=f("div",{class:"iti__selected-country-primary"},this.#e);this.#c=f("div",{class:d.FLAG},o),e&&(this.#o=f("div",{class:"iti__arrow",[h.HIDDEN]:"true"},o)),i&&(this.#g=f("div",{class:"iti__selected-dial-code"},this.#e)),e&&this.#z()}ensureDropdownWidthSet(){let{fixDropdownWidth:t,allowDropdown:e}=this.#t;if(!e||!t||this.#s.style.width)return;let i=this.telInputEl.offsetWidth;i>0&&(this.#s.style.width=`${i}px`)}#z(){let{fixDropdownWidth:t,useFullscreenPopup:e,countrySearch:i,i18n:s,dropdownContainer:o,containerClass:l}=this.#t,r=t?"":"iti--flexible-dropdown-width";if(this.#s=f("div",{id:`iti-${this.#i}__dropdown-content`,class:`iti__dropdown-content ${d.HIDE} ${r}`,role:"dialog",[h.MODAL]:"true"}),this.#v&&this.#s.setAttribute("dir","rtl"),i&&this.#X(),this.#n=f("ul",{class:"iti__country-list",id:`iti-${this.#i}__country-listbox`,role:"listbox",[h.LABEL]:s.countryListAriaLabel},this.#s),this.#Q(),i&&this.#B(),e||(this.#_=this.#tt(),i&&(this.#s.style.height=`${this.#_}px`)),o){let a=G({iti:!0,"iti--container":!0,"iti--fullscreen-popup":e,"iti--inline-dropdown":!e,[l]:!!l});this.#l=f("div",{class:a}),this.#l.appendChild(this.#s)}else this.#m.appendChild(this.#s)}#X(){let{i18n:t,searchInputClass:e}=this.#t,i=f("div",{class:"iti__search-input-wrapper"},this.#s);this.#f=f("span",{class:"iti__search-icon",[h.HIDDEN]:"true"},i),this.#f.innerHTML=ft(),this.#r=f("input",{id:`iti-${this.#i}__search-input`,type:"search",class:`iti__search-input ${e}`,placeholder:t.searchPlaceholder,role:"combobox",[h.EXPANDED]:"true",[h.LABEL]:t.searchPlaceholder,[h.CONTROLS]:`iti-${this.#i}__country-listbox`,[h.AUTOCOMPLETE]:"list",autocomplete:"off"},i),this.#u=f("button",{type:"button",class:`iti__search-clear ${d.HIDE}`,[h.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},i),this.#u.innerHTML=mt(this.#i),this.#H=f("span",{class:"iti__a11y-text"},this.#s),this.#T=f("div",{class:`iti__no-results ${d.HIDE}`,[h.HIDDEN]:"true"},this.#s),this.#T.textContent=t.searchEmptyState??null}#q(){this.#m&&(this.#W(),this.#m.classList.remove(d.V_HIDE))}#J(t){let{hiddenInput:e}=this.#t;if(!e)return;let i=this.telInputEl.getAttribute("name")||"",s=e(i);if(s.phone){let o=this.telInputEl.form?.querySelector(`input[name="${s.phone}"]`);o?this.#a=o:(this.#a=f("input",{type:"hidden",name:s.phone}),t.appendChild(this.#a))}if(s.country){let o=this.telInputEl.form?.querySelector(`input[name="${s.country}"]`);o?this.#d=o:(this.#d=f("input",{type:"hidden",name:s.country}),t.appendChild(this.#d))}}#Q(){let t=document.createDocumentFragment();for(let e=0;e<this.#I.length;e++){let i=this.#I[e],s=G({[d.COUNTRY_ITEM]:!0}),o=f("li",{id:`iti-${this.#i}__item-${i.iso2}`,class:s,tabindex:"-1",role:"option",[h.SELECTED]:"false"});o.dataset[A.DIAL_CODE]=i.dialCode,o.dataset[A.ISO2]=i.iso2,this.#O.set(i.iso2,o),this.#t.showFlags&&f("div",{class:`${d.FLAG} iti__${i.iso2}`},o);let l=f("span",{class:"iti__country-name"},o);l.textContent=`${i.name} `;let r=f("span",{class:"iti__dial-code"},l);this.#v&&r.setAttribute("dir","ltr"),r.textContent=`(+${i.dialCode})`,t.appendChild(o)}this.#n.appendChild(t)}#W(){if(this.#e){let t=this.#t.separateDialCode?L.FALLBACK_SELECTED_WITH_DIAL_WIDTH:L.FALLBACK_SELECTED_NO_DIAL_WIDTH,i=(this.#e.offsetWidth||this.#Z()||t)+L.INPUT_PADDING_EXTRA_LEFT;this.telInputEl.style.paddingLeft=`${i}px`}}static#$(){let t;try{t=window.top.document.body}catch{t=document.body}return t}#Z(){if(!this.telInputEl.parentNode)return 0;let t=n.#$(),e=this.telInputEl.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.#m.cloneNode();e.appendChild(i);let s=this.#e.cloneNode(!0);i.appendChild(s);let o=s.offsetWidth;return t.removeChild(e),o}#tt(){let t=n.#$();this.#s.classList.remove(d.HIDE);let e=f("div",{class:"iti iti--inline-dropdown"});e.appendChild(this.#s),e.style.visibility="hidden",t.appendChild(e);let i=this.#s.offsetHeight;return t.removeChild(e),e.style.visibility="",this.#s.classList.add(d.HIDE),i>0?i:L.FALLBACK_DROPDOWN_HEIGHT}#B(){let{i18n:t}=this.#t,e=this.#n.childElementCount;this.#H.textContent=t.searchSummaryAria(e)}#F(t){let e;t===""?e=this.#I:e=yt(this.#I,t),this.#D(e)}prefillSearchWithPlus(){this.#r.value="+",this.#r.focus(),this.#F("")}#P(){let t=this.#r.value.trim();this.#F(t),this.#r.value?this.#u.classList.remove(d.HIDE):this.#u.classList.add(d.HIDE)}#p(){this.#A&&clearTimeout(this.#A),this.#A=setTimeout(()=>{this.#P(),this.#A=null},J.SEARCH_DEBOUNCE_MS)}#R(){this.#r.value="",this.#r.focus(),this.#P()}#w(t){let e=this.#n,i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),o=s.top-i.top+e.scrollTop;s.top<i.top?e.scrollTop=o:s.bottom>i.bottom&&(e.scrollTop=o-i.height+s.height)}#y(t,e=!0){if(this.#h?.classList.remove(d.HIGHLIGHT),t){if(t.classList.add(d.HIGHLIGHT),this.#t.countrySearch){let i=t.getAttribute("id")||"";this.#r.setAttribute(h.ACTIVE_DESCENDANT,i)}e&&this.#w(t),this.#h=t}else this.#h=null}bindHiddenInputSubmitListener(t,e,i){let s=this.telInputEl.form;!s||!this.#a&&!this.#d||s.addEventListener("submit",()=>{this.#a&&(this.#a.value=e()),this.#d&&(this.#d.value=i())},{signal:t})}bindAllInitialDropdownListeners(t,e,i){let s=this.telInputEl.closest("label");s&&s.addEventListener("click",o=>{this.isDropdownOpen()?o.preventDefault():this.telInputEl.focus()},{signal:t}),this.#e.addEventListener("click",()=>{!this.isDropdownOpen()&&!this.telInputEl.disabled&&!this.telInputEl.readOnly&&e()},{signal:t}),this.#m.addEventListener("keydown",o=>{let l=[C.ARROW_UP,C.ARROW_DOWN,C.SPACE,C.ENTER];!this.isDropdownOpen()&&l.includes(o.key)&&(o.preventDefault(),o.stopPropagation(),e()),o.key===C.TAB&&i()},{signal:t})}openDropdown(t,e){let{countrySearch:i,dropdownAlwaysOpen:s,dropdownContainer:o}=this.#t;if(this.#N=new AbortController,this.ensureDropdownWidthSet(),o)this.#L();else{let r=this.#x(),a=this.telInputEl.offsetHeight+L.DROPDOWN_MARGIN;r?this.#s.style.top=`${a}px`:this.#s.style.bottom=`${a}px`}this.#s.classList.remove(d.HIDE),this.#e.setAttribute(h.EXPANDED,"true");let l=this.#C??this.#n.firstElementChild;l&&this.#y(l),i&&!s&&this.#r.focus(),this.#t.useFullscreenPopup&&this.#l&&window.visualViewport&&window.visualViewport.addEventListener("resize",()=>{this.#K(),this.#h&&this.#w(this.#h)},{signal:this.#N.signal}),this.#o.classList.add(d.ARROW_UP),this.#et(t,e)}#et(t,e){let i=this.#N.signal;this.#j(i),this.#it(i,t),this.#t.dropdownAlwaysOpen||this.#b(i,e),this.#V(i,t,e),this.#t.countrySearch&&this.#M(i),!this.#t.useFullscreenPopup&&this.#t.dropdownContainer&&window.addEventListener("scroll",e,{signal:i})}#j(t){this.#n.addEventListener("mouseover",e=>{let i=e.target?.closest(`.${d.COUNTRY_ITEM}`);i&&this.#y(i,!1)},{signal:t})}#it(t,e){this.#n.addEventListener("click",i=>{let s=i.target?.closest(`.${d.COUNTRY_ITEM}`);s&&e(s)},{signal:t})}#b(t,e){setTimeout(()=>{document.documentElement.addEventListener("click",i=>{this.#s.contains(i.target)||e()},{signal:t})},0)}#V(t,e,i){let s="",o=null,l=r=>{[C.ARROW_UP,C.ARROW_DOWN,C.ENTER,C.ESC].includes(r.key)&&(r.preventDefault(),r.stopPropagation(),r.key===C.ARROW_UP||r.key===C.ARROW_DOWN?this.#S(r.key):r.key===C.ENTER&&!r.isComposing?e(this.#h):r.key===C.ESC&&(i(),this.#e.focus())),!this.#t.countrySearch&&r.target!==this.telInputEl&&v.HIDDEN_SEARCH_CHAR.test(r.key)&&(r.stopPropagation(),o&&clearTimeout(o),s+=r.key.toLowerCase(),this.#st(s),o=setTimeout(()=>{s=""},J.HIDDEN_SEARCH_RESET_MS))};document.addEventListener("keydown",l,{signal:t})}#M(t){this.#r.addEventListener("input",()=>this.#p(),{signal:t}),this.#u.addEventListener("click",()=>this.#R(),{signal:t})}#st(t){let e=Et(this.#I,t);if(e){let i=this.#O.get(e.iso2);this.#y(i)}}#S(t){let e=t===C.ARROW_UP?this.#h?.previousElementSibling:this.#h?.nextElementSibling;!e&&this.#n.childElementCount>1&&(e=t===C.ARROW_UP?this.#n.lastElementChild:this.#n.firstElementChild),e&&this.#y(e)}#G(t){if(this.#C&&this.#C.dataset[A.ISO2]!==t&&(this.#C.setAttribute(h.SELECTED,"false"),this.#C.querySelector(".iti__country-check")?.remove(),this.#C=null),t&&!this.#C){let e=this.#n.querySelector(`[data-country-code="${t}"]`);if(e){e.setAttribute(h.SELECTED,"true");let i=f("span",{class:"iti__country-check",[h.HIDDEN]:"true"},e);i.innerHTML=Ct(),this.#C=e,this.#t.dropdownAlwaysOpen&&this.#y(e)}}}#D(t){this.#n.replaceChildren();let e=!0;for(let i of t){let s=this.#O.get(i.iso2);s&&(this.#n.appendChild(s),e&&(this.#y(s,!1),e=!1))}e?(this.#y(null),this.#T&&this.#T.classList.remove(d.HIDE)):this.#T&&this.#T.classList.add(d.HIDE),this.#n.scrollTop=0,this.#B()}closeDropdown(){let{countrySearch:t,dropdownContainer:e}=this.#t;this.#N.abort(),this.#N=null,this.#s.classList.add(d.HIDE),this.#e.setAttribute(h.EXPANDED,"false"),t&&(this.#r.removeAttribute(h.ACTIVE_DESCENDANT),this.#r.value="",this.#P(),this.#h&&(this.#h.classList.remove(d.HIGHLIGHT),this.#h=null)),this.#o.classList.remove(d.ARROW_UP),e?(this.#l.remove(),this.#l.style.top="",this.#l.style.bottom="",this.#l.style.paddingLeft="",this.#l.style.paddingRight=""):(this.#s.style.top="",this.#s.style.bottom="")}#x(){if(this.#t.dropdownAlwaysOpen)return!0;let t=this.telInputEl.getBoundingClientRect(),e=t.top,i=window.innerHeight-t.bottom;return i>=this.#_||i>=e}#L(){let{dropdownContainer:t,useFullscreenPopup:e}=this.#t;if(e){if(window.innerWidth>=L.NARROW_VIEWPORT_WIDTH){let i=this.telInputEl.getBoundingClientRect();this.#l.style.paddingLeft=`${i.left}px`,this.#l.style.paddingRight=`${window.innerWidth-i.right}px`}}else{let i=this.telInputEl.getBoundingClientRect();this.#l.style.left=`${i.left}px`,this.#x()?this.#l.style.top=`${i.bottom+L.DROPDOWN_MARGIN}px`:(this.#l.style.top="unset",this.#l.style.bottom=`${window.innerHeight-i.top+L.DROPDOWN_MARGIN}px`)}t.appendChild(this.#l)}#K(){let t=window.visualViewport;if(!t||!this.#l)return;let e=window.innerHeight-t.height;this.#l.style.bottom=`${e}px`}isDropdownOpen(){return!this.#s.classList.contains(d.HIDE)}setLoading(t){this.#c.classList.toggle(d.LOADING,t)}isLoading(){return this.#c.classList.contains(d.LOADING)}setDisabled(t){this.telInputEl.disabled=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setReadonly(t){this.telInputEl.readOnly=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setCountry(t){let{allowDropdown:e,showFlags:i,separateDialCode:s,i18n:o}=this.#t,l=t?.name,r=t?.dialCode,a=t?.iso2??"";if(e&&this.#G(a),this.#e){let p=a&&i?`${d.FLAG} iti__${a}`:`${d.FLAG} ${d.GLOBE}`,c,m,y;a?(m=l,c=o.selectedCountryAriaLabel.replace("${countryName}",l).replace("${dialCode}",`+${r}`),y=i?"":tt()):(m=o.noCountrySelected,c=o.noCountrySelected,y=tt()),this.#c.className=p,this.#e.setAttribute("title",m),this.#e.setAttribute(h.LABEL,c),this.#c.innerHTML=y}if(s){let p=r?`+${r}`:"";this.#g.textContent=p,this.#W()}}destroy(){this.telInputEl.iti=void 0,delete this.telInputEl.dataset[A.INSTANCE_ID],this.telInputEl.style.paddingLeft=this.#E;let t=this.telInputEl.parentNode;t&&(t.before(this.telInputEl),t.remove()),this.#O.clear()}};var gt=n=>{let{onlyCountries:t,excludeCountries:e}=n;return t?.length?O.filter(i=>t.includes(i.iso2)):e?.length?O.filter(i=>!e.includes(i.iso2)):[...O]},bt=(n,t)=>{let{countryNameLocale:e,i18n:i}=t,s;try{typeof Intl<"u"&&typeof Intl.DisplayNames=="function"?s=new Intl.DisplayNames(e,{type:"region"}):s=null}catch(o){console.error(o),s=null}for(let o of n)o.name=i[o.iso2]||s?.of(o.iso2.toUpperCase())||""},It=n=>{let t=new Set,e=0,i={},s=(l,r)=>{if(!l||!r)return;r.length>e&&(e=r.length),Object.hasOwn(i,r)||(i[r]=[]);let a=i[r];a.includes(l)||a.push(l)},o=[...n].sort((l,r)=>l.priority-r.priority);for(let l of o){t.has(l.dialCode)||t.add(l.dialCode);for(let r=1;r<l.dialCode.length;r++){let a=l.dialCode.substring(0,r);s(l.iso2,a)}if(s(l.iso2,l.dialCode),l.areaCodes){let r=i[l.dialCode][0];for(let a of l.areaCodes){for(let p=1;p<a.length;p++){let c=a.substring(0,p),m=l.dialCode+c;s(r,m),s(l.iso2,m)}s(l.iso2,l.dialCode+a)}}}return{dialCodes:t,dialCodeMaxLength:e,dialCodeToIso2Map:i}},Lt=(n,t)=>{let{countryOrder:e}=t;n.sort((i,s)=>{if(e){let o=e.indexOf(i.iso2),l=e.indexOf(s.iso2),r=o>-1,a=l>-1;if(r||a)return r&&a?o-l:r?-1:1}return i.name.localeCompare(s.name)})},vt=n=>{for(let t of n)t.normalisedName=W(t.name),t.initials=t.normalisedName.split(/[^a-z]/).map(e=>e[0]).join(""),t.dialCodePlus=`+${t.dialCode}`};var $t=new Set(["800","808","870","881","882","883","888","979"]),et=n=>{let t=w(n).slice(0,3);return n.startsWith("+")&&$t.has(t)};var it=(n,t,e,i)=>{if(!e||!t)return n;let s=`+${i.dialCode}`,o=n[s.length]===" "||n[s.length]==="-"?s.length+1:s.length;return n.substring(o)},At=(n,t,e,i,s)=>{let o=e?e.formatNumberAsYouType(n,i?.iso2):n,l=i?.dialCode;return s&&t.charAt(0)!=="+"&&o.includes(`+${l}`)?(o.split(`+${l}`)[1]||"").trim():o};var Tt=(n,t,e,i)=>{if(e===0&&!i)return 0;let s=0;for(let o=0;o<t.length;o++){if(/[+0-9]/.test(t[o])&&s++,s===n&&!i)return o+1;if(i&&s===n+1)return o}return t.length};var Bt=new Set(["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"]),st=n=>{let t=w(n);if(t.startsWith(B.NANP)&&t.length>=4){let e=t.substring(1,4);return Bt.has(e)}return!1};var K=class{#t;constructor(t){t&&this.#i(t)}#i(t){/[\u0660-\u0669]/.test(t)?this.#t="arabic-indic":/[\u06F0-\u06F9]/.test(t)?this.#t="persian":this.#t="ascii"}denormalise(t){if(!this.#t||this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776;return t.replace(/[0-9]/g,i=>String.fromCharCode(e+Number(i)))}normalise(t){if(!t)return"";if(this.#i(t),this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776,i=this.#t==="arabic-indic"?/[\u0660-\u0669]/g:/[\u06F0-\u06F9]/g;return t.replace(i,s=>String.fromCharCode(48+(s.charCodeAt(0)-e)))}isAscii(){return!this.#t||this.#t==="ascii"}};var Ft=0,R=n=>{if(!u.utils)throw new Error(`intlTelInput.utils is required for ${n}(). See: https://intl-tel-input.com/docs/utils`)},wt=()=>{let n,t;return{promise:new Promise((i,s)=>{n=i,t=s}),resolve:n,reject:t}},M=class n{id;promise;#t;#i;#v;#E;#I;#A;#_;#m;#e=null;#c=null;#g;#o=!0;#s;#f;#r=!1;#u;#n;constructor(t,e={}){this.id=Ft++,P.validateInput(t);let i=dt(e);this.#i={...V,...i},ht(this.#i),pt(this.#i),this.#t=new P(t,this.#i,this.id),this.#v=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),this.#f=new K(t.value),this.promise=this.#T(this.#i),this.#E=gt(this.#i);let{dialCodes:s,dialCodeMaxLength:o,dialCodeToIso2Map:l}=It(this.#E);this.#_=s,this.#I=o,this.#A=l,this.#m=new Map(this.#E.map(r=>[r.iso2,r])),this.#H()}#a(){let t=this.#t.telInputEl.value.trim();return this.#f.normalise(t)}#d(t){this.#t.telInputEl.value=this.#f.denormalise(t)}#T(t){let{initialCountry:e,geoIpLookup:i,loadUtils:s}=t,o=e===k.AUTO&&!!i,l=!!s&&!u.utils;return o&&(this.#u=wt()),l&&(this.#n=wt()),Promise.all([this.#u?.promise,this.#n?.promise]).then(()=>{})}#H(){this.#s=new AbortController,this.#l(),this.#t.buildMarkup(this.#E),this.#C(),this.#h(),this.#O(),this.#i.dropdownAlwaysOpen&&this.#R()}#l(){bt(this.#E,this.#i),Lt(this.#E,this.#i),vt(this.#E)}#C(t=!1){let e=this.#t.telInputEl.getAttribute("value"),i=this.#f.normalise(e??""),s=this.#a(),l=i&&i.startsWith("+")&&(!s||!s.startsWith("+"))?i:s,r=this.#D(l),a=st(l),{initialCountry:p,geoIpLookup:c}=this.#i,m=p===k.AUTO&&c,y=m&&u.autoCountry?u.autoCountry:p,T=m&&!t&&!u.autoCountry,I=N(y);r?a?I?this.#b(y):T||this.#b(nt.ISO2):(I&&this.#b(y),this.#y(l)):I?this.#b(y):T||this.#b(""),l&&this.#w(l)}#h(){this.#z(),this.#i.allowDropdown&&this.#t.bindAllInitialDropdownListeners(this.#s.signal,()=>this.#R(),()=>this.#S()),this.#t.bindHiddenInputSubmitListener(this.#s.signal,()=>this.getNumber(),()=>this.#e?.iso2||"")}#O(){if(this.#n){let{loadUtils:t}=this.#i,e=()=>{u.attachUtils(t)?.catch(()=>{})};u.documentReady()?e():window.addEventListener("load",e,{signal:this.#s.signal})}this.#u&&(this.#e?this.#u.resolve():this.#N())}#N(){if(u.autoCountry){this.#ot();return}if(this.#t.setLoading(!0),!u.startedLoadingAutoCountry&&(u.startedLoadingAutoCountry=!0,typeof this.#i.geoIpLookup=="function")){let t=(i="")=>{let s=i.toLowerCase();N(s)?(u.autoCountry=s,setTimeout(()=>n.forEachInstance("handleAutoCountryLoaded"))):n.forEachInstance("handleAutoCountryFailure")},e=()=>{n.forEachInstance("handleAutoCountryFailure")};this.#i.geoIpLookup(t,e)}}#k(){this.#R(),this.#t.prefillSearchWithPlus()}#U(t){let e=this.#t.telInputEl.selectionStart||0,i=t.substring(0,e-1),s=t.substring(e);return this.#d(i+s),e-1}#z(){this.#W(),this.#Z(),this.#B()}#X(t){this.#U(t),this.#k()}#q(t,e){let i=this.#U(t);this.#t.telInputEl.setSelectionRange(i,i),this.#p(b.STRICT_REJECT,{source:"key",rejectedInput:e,reason:"invalid"})}#J(t,e){let i=this.#t.telInputEl.selectionStart||0,o=t.substring(0,i).replace(v.NON_PLUS_NUMERIC_GLOBAL,"").length,l=this.#L(),r=At(l,t,u.utils,this.#e,this.#i.separateDialCode),a=Tt(o,r,i,e);this.#d(r),this.#t.telInputEl.setSelectionRange(a,a)}#Q(t){if(t.startsWith("+")&&this.#e&&this.#D(t)){let e=it(t,!0,!0,this.#e);this.#d(e)}}#W(){this.#r=v.ALPHA_UNICODE.test(this.#a()),this.#t.telInputEl.addEventListener("input",this.#$,{signal:this.#s.signal})}#$=t=>{let{strictMode:e,formatAsYouType:i,separateDialCode:s,allowDropdown:o,countrySearch:l}=this.#i,r=t?.detail;if(r?.isCountryChange)return;let a=this.#a();if(this.#v&&t?.data==="+"&&s&&o&&l){this.#X(a);return}if(this.#v&&e&&(t?.data===" "||t?.data==="-"||t?.data===".")){this.#q(a,t.data);return}this.#y(a)&&this.#Y();let p=t?.data&&v.NON_PLUS_NUMERIC.test(t.data),c=t?.inputType===q.PASTE&&a;p||c&&!e?this.#r=!0:v.NON_PLUS_NUMERIC.test(a)||(this.#r=!1),i&&!this.#r&&!r?.isSetNumber&&this.#f.isAscii()&&this.#J(a,t?.inputType===q.DELETE_FORWARD),s&&this.#Q(a)};#Z(){let{strictMode:t,separateDialCode:e}=this.#i;!t&&!e||this.#t.telInputEl.addEventListener("keydown",this.#tt,{signal:this.#s.signal})}#tt=t=>{let{strictMode:e,separateDialCode:i,allowDropdown:s,countrySearch:o}=this.#i;if(!t.key||t.key.length!==1||t.altKey||t.ctrlKey||t.metaKey)return;if(i&&s&&o&&t.key==="+"){t.preventDefault(),this.#k();return}if(!e)return;let l=this.#a(),a=!l.startsWith("+")&&this.#t.telInputEl.selectionStart===0&&t.key==="+",p=this.#f.normalise(t.key),c=/^[0-9]$/.test(p),m=i?c:a||c,y=this.#t.telInputEl,T=y.selectionStart,I=y.selectionEnd,$=l.slice(0,T??void 0),x=l.slice(I??void 0),g=$+p+x,D=this.#x(g),H=!1;u.utils&&this.#c&&(H=u.utils.getCoreNumber(D,this.#e?.iso2).length>this.#c);let Y=this.#j(D)!==null;(!m||H&&!Y&&!a)&&(this.#p(b.STRICT_REJECT,{source:"key",rejectedInput:t.key,reason:m?"max-length":"invalid"}),t.preventDefault())};#B(){this.#i.strictMode&&this.#t.telInputEl.addEventListener("paste",this.#F,{signal:this.#s.signal})}#F=t=>{t.preventDefault();let e=this.#t.telInputEl,i=e.selectionStart,s=e.selectionEnd,o=this.#a(),l=o.slice(0,i??void 0),r=o.slice(s??void 0),a=this.#e?.iso2,p=t.clipboardData.getData("text"),c=this.#f.normalise(p),m=i===0&&s>0,y=!o.startsWith("+")||m,T=c.replace(v.NON_PLUS_NUMERIC_GLOBAL,""),I=T.startsWith("+"),$=T.replace(/\+/g,""),x=I&&y?`+${$}`:$,g=l+x+r,D=x!==c?"invalid":null;if(g.length>5&&u.utils){let _=u.utils.getCoreNumber(g,a);for(;_.length===0&&g.length>0;)g=g.slice(0,-1),_=u.utils.getCoreNumber(g,a);if(!_){this.#p(b.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:"max-length"});return}if(this.#c&&_.length>this.#c)if(e.selectionEnd===o.length){let Y=_.length-this.#c;g=g.slice(0,g.length-Y),D="max-length"}else{this.#p(b.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:"max-length"});return}}this.#d(g);let H=i+x.length;e.setSelectionRange(H,H),e.dispatchEvent(new InputEvent("input",{bubbles:!0})),D&&this.#p(b.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:D})};#P(t){let e=Number(this.#t.telInputEl.getAttribute("maxlength"));return e&&t.length>e?t.substring(0,e):t}#p(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.#t.telInputEl.dispatchEvent(i)}#R(){this.#t.openDropdown(t=>this.#st(t),()=>this.#S()),this.#p(b.OPEN_COUNTRY_DROPDOWN)}#w(t){let{formatOnDisplay:e,nationalMode:i,separateDialCode:s}=this.#i,o=t;if(e&&u.utils&&this.#e){let l=et(t),r=i&&!l||!o.startsWith("+")&&!s,{NATIONAL:a,INTERNATIONAL:p}=u.utils.numberFormat,c=r?a:p;o=u.utils.formatNumber(o,this.#e?.iso2,c)}o=this.#K(o),this.#d(o)}#y(t){let e=this.#j(t);return e!==null?this.#b(e):!1}#et(t){let e=this.#e?.dialCode,i=this.#e?.nationalPrefix;if(t.startsWith("+")||!e)return t;let l=i&&t.startsWith(i)&&!this.#i.separateDialCode?t.substring(1):t;return`+${e}${l}`}#j(t){let e=t.indexOf("+"),i=e>0?t.substring(e):t,s=this.#e?.iso2;i=this.#et(i);let o=this.#D(i,!0),l=w(i);if(o){let r=w(o),a=this.#A[r];return a.length===1?a[0]===s?null:a[0]:this.#it(a,r,l)}else if(i.startsWith("+")&&l.length){let r=this.#e?.dialCode||"";return r&&r.startsWith(l)?null:""}else if((!i||i==="+")&&!s&&this.#g)return this.#g;return null}#it(t,e,i){let s=this.#e?.iso2,o=this.#e?.dialCode;if(!s&&this.#g&&t.includes(this.#g))return this.#g;if(o===B.NANP&&st(i))return null;let r=this.#e?.areaCodes,a=this.#e?.priority;if(r){let T=r.map(I=>`${o}${I}`);for(let I of T)if(i.startsWith(I))return null}let c=r&&!(a===0)&&i.length>e.length,m=s&&t.includes(s)&&!c,y=s===t[0];return!m&&!y?t[0]:null}#b(t){let e=this.#e?.iso2||"";return this.#e=t?this.#m.get(t):null,this.#e&&(this.#g=this.#e.iso2),this.#t.setCountry(this.#e),this.#M(),this.#V(),e!==t}#V(){let{strictMode:t,placeholderNumberType:e,allowedNumberTypes:i}=this.#i;if(!t||!u.utils)return;let s=this.#e?.iso2;if(!s){this.#c=null;return}let o=u.utils.numberType[e],l=u.utils.getExampleNumber(s,!1,o,!0),r=l;for(;u.utils.isPossibleNumber(l,s,i);)r=l,l+="0";let a=u.utils.getCoreNumber(r,s);this.#c=a.length,s==="by"&&(this.#c=a.length+1)}#M(){let{autoPlaceholder:t,placeholderNumberType:e,nationalMode:i,customPlaceholder:s}=this.#i,o=t===S.AGGRESSIVE||!this.#t.hadInitialPlaceholder&&t===S.POLITE;if(!u.utils||!o)return;let l=u.utils.numberType[e],r=this.#e?u.utils.getExampleNumber(this.#e.iso2,i,l):"";r=this.#K(r),typeof s=="function"&&(r=s(r,this.#e)),this.#t.telInputEl.setAttribute("placeholder",r)}#st(t){if(!t)return;let e=t.dataset[A.ISO2],i=this.#b(e);this.#S();let s=t.dataset[A.DIAL_CODE];if(this.#G(s),this.#i.formatOnDisplay){let o=this.#a();this.#w(o)}this.#t.telInputEl.focus(),i&&(this.#Y(),this.#p(b.INPUT,{isCountryChange:!0}))}#S(t){!this.#t.isDropdownOpen()||this.#i.dropdownAlwaysOpen&&!t||(this.#t.closeDropdown(),this.#p(b.CLOSE_COUNTRY_DROPDOWN))}#G(t){let e=this.#a();if(!e.startsWith("+"))return;let i=`+${t}`,s=this.#D(e),o;s?o=e.replace(s,i):o=i,this.#d(o)}#D(t,e){if(!t.startsWith("+"))return"";let i="",s="",o=!1;for(let l=0;l<t.length;l++){let r=t.charAt(l);if(!/[0-9]/.test(r))continue;if(s+=r,!!!this.#A[s])break;if(this.#_.has(s)){if(i=t.substring(0,l+1),o=!0,!e)break}else e&&o&&(i=t.substring(0,l+1));if(s.length===this.#I)break}return i}#x(t){let e=this.#e?.dialCode,i=w(t);return(this.#i.separateDialCode&&!t.startsWith("+")&&e&&i?`+${e}`:"")+t}#L(){let t=this.#a();return this.#x(t)}#K(t){let e=!!this.#D(t),i=it(t,e,this.#i.separateDialCode,this.#e);return this.#P(i)}#nt(){let t=this.#e;if(!t)return null;let{iso2:e,dialCode:i,name:s}=t;return{iso2:e,dialCode:i,name:s}}#Y(){let t=this.#nt();this.#p(b.COUNTRY_CHANGE,t)}#ot(){if(!(!this.#u||!u.autoCountry)){if(!this.#o){this.#u.resolve();return}this.#t.isLoading()?this.setCountry(u.autoCountry):this.#g=u.autoCountry,this.#t.setLoading(!1),this.#u.resolve()}}#rt(){if(!this.#o){this.#u?.reject();return}this.#C(!0),this.#t.setLoading(!1),this.#u?.reject()}#at(){if(!this.#o){this.#n?.resolve();return}if(!u.utils){this.#n?.resolve();return}let t=this.#a();t&&this.#w(t),this.#e&&(this.#M(),this.#V()),this.#n?.resolve()}#ut(t){if(!this.#o){this.#n?.reject(t);return}this.#n?.reject(t)}destroy(){this.#o&&(this.#o=!1,this.#i.allowDropdown&&this.#S(!0),this.#s.abort(),this.#t.destroy(),u.instances.delete(String(this.id)))}isActive(){return this.#o}getExtension(){return this.#o?(R("getExtension"),u.utils.getExtension(this.#L(),this.#e?.iso2)):""}getNumber(t){if(!this.#o)return"";R("getNumber");let e=this.#e?.iso2,i=this.#L(),s=u.utils.formatNumber(i,e,t);return this.#f.denormalise(s)}getNumberType(){return this.#o?(R("getNumberType"),u.utils.getNumberType(this.#L(),this.#e?.iso2)):Q.UNKNOWN_NUMBER_TYPE}getSelectedCountryData(){return this.#nt()}getValidationError(){if(!this.#o)return Q.UNKNOWN_VALIDATION_ERROR;R("getValidationError");let t=this.#e?.iso2;return u.utils.getValidationError(this.#L(),t)}isValidNumber(){if(!this.#o)return null;R("isValidNumber");let t=this.#e?.dialCode,e=this.#e?.iso2,i=this.#L(),s=u.utils.getCoreNumber(i,e);if(s){if(t===F.DIAL_CODE&&s[0]===F.MOBILE_PREFIX&&s.length!==F.MOBILE_CORE_LENGTH)return!1;if(!v.ALPHA_UNICODE.test(i)&&t){let l=i.startsWith("+")?i.slice(1+t.length):i,r=w(l).length;if(s.length>r)return!1}}return this.#lt("possible")}isValidNumberPrecise(){return this.#o?(R("isValidNumberPrecise"),this.#lt("precise")):null}#lt(t){let{allowNumberExtensions:e,allowPhonewords:i,allowedNumberTypes:s}=this.#i,o=this.#e?.iso2,l=this.#L();return!this.#e&&!et(l)||!(t==="precise"?u.utils.isValidNumber:u.utils.isPossibleNumber)(l,o,s)?!1:v.ALPHA_UNICODE.test(l)?!!u.utils.getExtension(l,o)?e:i:!0}setCountry(t){if(!this.#o)return;let e=t?.toLowerCase();if(!N(e))throw new Error(`Invalid iso2 code: '${e}'`);let i=this.#e?.iso2;if(t&&e!==i||!t&&i){if(this.#b(e),this.#G(this.#e?.dialCode||""),this.#i.formatOnDisplay){let o=this.#a();this.#w(o)}this.#Y(),this.#p(b.INPUT,{isCountryChange:!0})}}setNumber(t){if(!this.#o)return;let e=this.#f.normalise(t),i=this.#y(e);this.#w(e),i&&this.#Y(),this.#p(b.INPUT,{isSetNumber:!0})}setPlaceholderNumberType(t){this.#o&&(this.#i.placeholderNumberType=t,this.#M())}setDisabled(t){this.#o&&this.#t.setDisabled(t)}setReadonly(t){this.#o&&this.#t.setReadonly(t)}static forEachInstance(t,...e){let i=[...u.instances.values()],s=e[0];i.forEach(o=>{if(o instanceof n)switch(t){case"handleUtilsLoaded":o.#at();break;case"handleUtilsFailure":o.#ut(s);break;case"handleAutoCountryLoaded":o.#ot();break;case"handleAutoCountryFailure":o.#rt();break}})}},jt=n=>{if(!u.utils&&!u.startedLoadingUtils){let t;if(typeof n=="function")try{t=Promise.resolve(n())}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 utils module, not ${typeof n}`));return u.startedLoadingUtils=!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 u.utils=i,M.forEachInstance("handleUtilsLoaded"),!0}).catch(e=>{throw M.forEachInstance("handleUtilsFailure",e),e})}return null},u=Object.assign((n,t)=>{let e=new M(n,t);return u.instances.set(String(e.id),e),n.iti=e,e},{defaults:V,documentReady:()=>document.readyState==="complete",getCountryData:()=>O,getInstance:n=>{let t=n.dataset[A.INSTANCE_ID];return t?u.instances.get(t)??null:null},instances:new Map,attachUtils:jt,startedLoadingUtils:!1,startedLoadingAutoCountry:!1,version:"27.2.0"}),Vt=u;return Pt(Gt);})();
24
+ </svg>`;var yt=(n,t)=>{let e=W(t),i=[],s=[],o=[],r=[],l=[],a=[];for(let c of n)c.iso2===e?i.push(c):c.normalisedName.startsWith(e)?s.push(c):c.normalisedName.includes(e)?o.push(c):e===c.dialCode||e===c.dialCodePlus?r.push(c):c.dialCodePlus.includes(e)?l.push(c):c.initials.includes(e)&&a.push(c);let p=(c,m)=>c.priority-m.priority;return[...i,...s,...o,...r.sort(p),...l.sort(p),...a]},Et=(n,t)=>{let e=W(t);for(let i of n)if(i.normalisedName.startsWith(e))return i;return null};var P=class n{#t;#i;#A;#E="";#I;#v=null;#_;#m;#e;#c;#g;#o;#s;#f;#l;#u;#n;#a;#d;#T;#H;#r;#C=null;#h=null;#O=new Map;#N=null;telInputEl;hadInitialPlaceholder;constructor(t,e,i){t.dataset[v.INSTANCE_ID]=i.toString(),this.telInputEl=t,this.#t=e,this.#i=i,this.hadInitialPlaceholder=!!t.getAttribute("placeholder"),this.#A=!!this.telInputEl.closest("[dir=rtl]"),this.#E=this.telInputEl.style.paddingLeft}static validateInput(t){let e=t?.tagName;if(!(!!t&&typeof t=="object"&&e==="INPUT"&&typeof t.setAttribute=="function")){let s=Object.prototype.toString.call(t);throw new TypeError(`The first argument must be an HTMLInputElement, not ${s}`)}}buildMarkup(t){this.#I=t,this.telInputEl.classList.add("iti__tel-input"),this.telInputEl.hasAttribute("type")||this.telInputEl.setAttribute("type","tel"),this.telInputEl.hasAttribute("autocomplete")||this.telInputEl.setAttribute("autocomplete","tel"),this.telInputEl.hasAttribute("inputmode")||this.telInputEl.setAttribute("inputmode","tel");let e=this.#k();this.#U(e),e.appendChild(this.telInputEl),this.#q(),this.#J(e),this.ensureDropdownWidthSet()}#k(){let{allowDropdown:t,showFlags:e,containerClass:i,useFullscreenPopup:s}=this.#t,o=G({iti:!0,"iti--allow-dropdown":t,"iti--show-flags":e,"iti--inline-dropdown":!s,[i]:!!i}),r=f("div",{class:o});return this.#A&&r.setAttribute("dir","ltr"),this.telInputEl.before(r),r}#U(t){let{allowDropdown:e,separateDialCode:i,showFlags:s}=this.#t;if(!e&&!s&&!i)return;this.#m=f("div",{class:`iti__country-container ${d.V_HIDE}`},t),e?(this.#e=f("button",{type:"button",class:"iti__selected-country",[h.EXPANDED]:"false",[h.LABEL]:this.#t.i18n.noCountrySelected,[h.HASPOPUP]:"dialog",[h.CONTROLS]:`iti-${this.#i}__dropdown-content`},this.#m),this.telInputEl.disabled&&this.#e.setAttribute("disabled","true")):this.#e=f("div",{class:"iti__selected-country"},this.#m);let o=f("div",{class:"iti__selected-country-primary"},this.#e);this.#c=f("div",{class:d.FLAG},o),e&&(this.#o=f("div",{class:"iti__arrow",[h.HIDDEN]:"true"},o)),i&&(this.#g=f("div",{class:"iti__selected-dial-code"},this.#e)),e&&this.#z()}ensureDropdownWidthSet(){let{fixDropdownWidth:t,allowDropdown:e}=this.#t;if(!e||!t||this.#s.style.width)return;let i=this.telInputEl.offsetWidth;i>0&&(this.#s.style.width=`${i}px`)}#z(){let{fixDropdownWidth:t,useFullscreenPopup:e,countrySearch:i,i18n:s,dropdownContainer:o,containerClass:r}=this.#t,l=t?"":"iti--flexible-dropdown-width";if(this.#s=f("div",{id:`iti-${this.#i}__dropdown-content`,class:`iti__dropdown-content ${d.HIDE} ${l}`,role:"dialog",[h.MODAL]:"true"}),this.#A&&this.#s.setAttribute("dir","rtl"),i&&this.#X(),this.#n=f("ul",{class:"iti__country-list",id:`iti-${this.#i}__country-listbox`,role:"listbox",[h.LABEL]:s.countryListAriaLabel},this.#s),this.#Q(),i&&this.#F(),e||(this.#_=this.#tt(),i&&(this.#s.style.height=`${this.#_}px`)),o){let a=G({iti:!0,"iti--container":!0,"iti--fullscreen-popup":e,"iti--inline-dropdown":!e,[r]:!!r});this.#r=f("div",{class:a}),this.#r.appendChild(this.#s)}else this.#m.appendChild(this.#s)}#X(){let{i18n:t,searchInputClass:e}=this.#t,i=f("div",{class:"iti__search-input-wrapper"},this.#s);this.#f=f("span",{class:"iti__search-icon",[h.HIDDEN]:"true"},i),this.#f.innerHTML=ft(),this.#l=f("input",{id:`iti-${this.#i}__search-input`,type:"search",class:`iti__search-input ${e}`,placeholder:t.searchPlaceholder,role:"combobox",[h.EXPANDED]:"true",[h.LABEL]:t.searchPlaceholder,[h.CONTROLS]:`iti-${this.#i}__country-listbox`,[h.AUTOCOMPLETE]:"list",autocomplete:"off"},i),this.#u=f("button",{type:"button",class:`iti__search-clear ${d.HIDE}`,[h.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},i),this.#u.innerHTML=mt(this.#i),this.#H=f("span",{class:"iti__a11y-text"},this.#s),this.#T=f("div",{class:`iti__no-results ${d.HIDE}`,[h.HIDDEN]:"true"},this.#s),this.#T.textContent=t.searchEmptyState??null}#q(){this.#m&&(this.#W(),this.#m.classList.remove(d.V_HIDE))}#J(t){let{hiddenInput:e}=this.#t;if(!e)return;let i=this.telInputEl.getAttribute("name")||"",s=e(i);if(s.phone){let o=this.telInputEl.form?.querySelector(`input[name="${s.phone}"]`);o?this.#a=o:(this.#a=f("input",{type:"hidden",name:s.phone}),t.appendChild(this.#a))}if(s.country){let o=this.telInputEl.form?.querySelector(`input[name="${s.country}"]`);o?this.#d=o:(this.#d=f("input",{type:"hidden",name:s.country}),t.appendChild(this.#d))}}#Q(){let t=document.createDocumentFragment();for(let e=0;e<this.#I.length;e++){let i=this.#I[e],s=G({[d.COUNTRY_ITEM]:!0}),o=f("li",{id:`iti-${this.#i}__item-${i.iso2}`,class:s,tabindex:"-1",role:"option",[h.SELECTED]:"false"});o.dataset[v.DIAL_CODE]=i.dialCode,o.dataset[v.ISO2]=i.iso2,this.#O.set(i.iso2,o),this.#t.showFlags&&f("div",{class:`${d.FLAG} iti__${i.iso2}`},o);let r=f("span",{class:"iti__country-name"},o);r.textContent=`${i.name} `;let l=f("span",{class:"iti__dial-code"},r);this.#A&&l.setAttribute("dir","ltr"),l.textContent=`(+${i.dialCode})`,t.appendChild(o)}this.#n.appendChild(t)}#W(){if(this.#e){let t=this.#t.separateDialCode?L.FALLBACK_SELECTED_WITH_DIAL_WIDTH:L.FALLBACK_SELECTED_NO_DIAL_WIDTH,i=(this.#e.offsetWidth||this.#Z()||t)+L.INPUT_PADDING_EXTRA_LEFT;this.telInputEl.style.paddingLeft=`${i}px`}}static#$(){let t;try{t=window.top.document.body}catch{t=document.body}return t}#Z(){if(!this.telInputEl.parentNode)return 0;let t=n.#$(),e=this.telInputEl.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.#m.cloneNode();e.appendChild(i);let s=this.#e.cloneNode(!0);i.appendChild(s);let o=s.offsetWidth;return t.removeChild(e),o}#tt(){let t=n.#$();this.#s.classList.remove(d.HIDE);let e=f("div",{class:"iti iti--inline-dropdown"});e.appendChild(this.#s),e.style.visibility="hidden",t.appendChild(e);let i=this.#s.offsetHeight;return t.removeChild(e),e.style.visibility="",this.#s.classList.add(d.HIDE),i>0?i:L.FALLBACK_DROPDOWN_HEIGHT}#F(){let{i18n:t}=this.#t,e=this.#n.childElementCount;this.#H.textContent=t.searchSummaryAria(e)}#B(t){let e;t===""?e=this.#I:e=yt(this.#I,t),this.#D(e)}prefillSearchWithPlus(){this.#l.value="+",this.#l.focus(),this.#B("")}#P(){let t=this.#l.value.trim();this.#B(t),this.#l.value?this.#u.classList.remove(d.HIDE):this.#u.classList.add(d.HIDE)}#p(){this.#v&&clearTimeout(this.#v),this.#v=setTimeout(()=>{this.#P(),this.#v=null},J.SEARCH_DEBOUNCE_MS)}#R(){this.#l.value="",this.#l.focus(),this.#P()}#w(t){let e=this.#n,i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),o=s.top-i.top+e.scrollTop;s.top<i.top?e.scrollTop=o:s.bottom>i.bottom&&(e.scrollTop=o-i.height+s.height)}#y(t,e=!0){if(this.#h?.classList.remove(d.HIGHLIGHT),t){if(t.classList.add(d.HIGHLIGHT),this.#t.countrySearch){let i=t.getAttribute("id")||"";this.#l.setAttribute(h.ACTIVE_DESCENDANT,i)}e&&this.#w(t),this.#h=t}else this.#h=null}bindHiddenInputSubmitListener(t,e,i){let s=this.telInputEl.form;!s||!this.#a&&!this.#d||s.addEventListener("submit",()=>{this.#a&&(this.#a.value=e()),this.#d&&(this.#d.value=i())},{signal:t})}bindAllInitialDropdownListeners(t,e,i){let s=this.telInputEl.closest("label");s&&s.addEventListener("click",o=>{this.isDropdownOpen()?o.preventDefault():this.telInputEl.focus()},{signal:t}),this.#e.addEventListener("click",()=>{!this.isDropdownOpen()&&!this.telInputEl.disabled&&!this.telInputEl.readOnly&&e()},{signal:t}),this.#m.addEventListener("keydown",o=>{let r=[C.ARROW_UP,C.ARROW_DOWN,C.SPACE,C.ENTER];!this.isDropdownOpen()&&r.includes(o.key)&&(o.preventDefault(),o.stopPropagation(),e()),o.key===C.TAB&&i()},{signal:t})}openDropdown(t,e){let{countrySearch:i,dropdownAlwaysOpen:s,dropdownContainer:o}=this.#t;if(this.#N=new AbortController,this.ensureDropdownWidthSet(),o)this.#L();else{let l=this.#x(),a=this.telInputEl.offsetHeight+L.DROPDOWN_MARGIN;l?this.#s.style.top=`${a}px`:this.#s.style.bottom=`${a}px`}this.#s.classList.remove(d.HIDE),this.#e.setAttribute(h.EXPANDED,"true");let r=this.#C??this.#n.firstElementChild;r&&this.#y(r),i&&!s&&this.#l.focus(),this.#t.useFullscreenPopup&&this.#r&&window.visualViewport&&window.visualViewport.addEventListener("resize",()=>{this.#K(),this.#h&&this.#w(this.#h)},{signal:this.#N.signal}),this.#o.classList.add(d.ARROW_UP),this.#et(t,e)}#et(t,e){let i=this.#N.signal;this.#j(i),this.#it(i,t),this.#t.dropdownAlwaysOpen||this.#b(i,e),this.#V(i,t,e),this.#t.countrySearch&&this.#M(i),!this.#t.useFullscreenPopup&&this.#t.dropdownContainer&&window.addEventListener("scroll",e,{signal:i})}#j(t){this.#n.addEventListener("mouseover",e=>{let i=e.target?.closest(`.${d.COUNTRY_ITEM}`);i&&this.#y(i,!1)},{signal:t})}#it(t,e){this.#n.addEventListener("click",i=>{let s=i.target?.closest(`.${d.COUNTRY_ITEM}`);s&&e(s)},{signal:t})}#b(t,e){setTimeout(()=>{document.documentElement.addEventListener("click",i=>{this.#s.contains(i.target)||e()},{signal:t})},0)}#V(t,e,i){let s="",o=null,r=l=>{[C.ARROW_UP,C.ARROW_DOWN,C.ENTER,C.ESC].includes(l.key)&&(l.preventDefault(),l.stopPropagation(),l.key===C.ARROW_UP||l.key===C.ARROW_DOWN?this.#S(l.key):l.key===C.ENTER&&!l.isComposing?e(this.#h):l.key===C.ESC&&(i(),this.#e.focus())),!this.#t.countrySearch&&l.target!==this.telInputEl&&A.HIDDEN_SEARCH_CHAR.test(l.key)&&(l.stopPropagation(),o&&clearTimeout(o),s+=l.key.toLowerCase(),this.#st(s),o=setTimeout(()=>{s=""},J.HIDDEN_SEARCH_RESET_MS))};document.addEventListener("keydown",r,{signal:t})}#M(t){this.#l.addEventListener("input",()=>this.#p(),{signal:t}),this.#u.addEventListener("click",()=>this.#R(),{signal:t})}#st(t){let e=Et(this.#I,t);if(e){let i=this.#O.get(e.iso2);this.#y(i)}}#S(t){let e=t===C.ARROW_UP?this.#h?.previousElementSibling:this.#h?.nextElementSibling;!e&&this.#n.childElementCount>1&&(e=t===C.ARROW_UP?this.#n.lastElementChild:this.#n.firstElementChild),e&&this.#y(e)}#G(t){if(this.#C&&this.#C.dataset[v.ISO2]!==t&&(this.#C.setAttribute(h.SELECTED,"false"),this.#C.querySelector(".iti__country-check")?.remove(),this.#C=null),t&&!this.#C){let e=this.#n.querySelector(`[data-country-code="${t}"]`);if(e){e.setAttribute(h.SELECTED,"true");let i=f("span",{class:"iti__country-check",[h.HIDDEN]:"true"},e);i.innerHTML=Ct(),this.#C=e,this.#t.dropdownAlwaysOpen&&this.#y(e)}}}#D(t){this.#n.replaceChildren();let e=!0;for(let i of t){let s=this.#O.get(i.iso2);s&&(this.#n.appendChild(s),e&&(this.#y(s,!1),e=!1))}e?(this.#y(null),this.#T&&this.#T.classList.remove(d.HIDE)):this.#T&&this.#T.classList.add(d.HIDE),this.#n.scrollTop=0,this.#F()}closeDropdown(){let{countrySearch:t,dropdownContainer:e}=this.#t;this.#N.abort(),this.#N=null,this.#s.classList.add(d.HIDE),this.#e.setAttribute(h.EXPANDED,"false"),t&&(this.#l.removeAttribute(h.ACTIVE_DESCENDANT),this.#l.value="",this.#P(),this.#h&&(this.#h.classList.remove(d.HIGHLIGHT),this.#h=null)),this.#o.classList.remove(d.ARROW_UP),e?(this.#r.remove(),this.#r.style.top="",this.#r.style.bottom="",this.#r.style.paddingLeft="",this.#r.style.paddingRight=""):(this.#s.style.top="",this.#s.style.bottom="")}#x(){if(this.#t.dropdownAlwaysOpen)return!0;let t=this.telInputEl.getBoundingClientRect(),e=t.top,i=window.innerHeight-t.bottom;return i>=this.#_||i>=e}#L(){let{dropdownContainer:t,useFullscreenPopup:e}=this.#t;if(e){if(window.innerWidth>=L.NARROW_VIEWPORT_WIDTH){let i=this.telInputEl.getBoundingClientRect();this.#r.style.paddingLeft=`${i.left}px`,this.#r.style.paddingRight=`${window.innerWidth-i.right}px`}}else{let i=this.telInputEl.getBoundingClientRect();this.#r.style.left=`${i.left}px`,this.#x()?this.#r.style.top=`${i.bottom+L.DROPDOWN_MARGIN}px`:(this.#r.style.top="unset",this.#r.style.bottom=`${window.innerHeight-i.top+L.DROPDOWN_MARGIN}px`)}t.appendChild(this.#r)}#K(){let t=window.visualViewport;if(!t||!this.#r)return;let e=window.innerHeight-t.height;this.#r.style.bottom=`${e}px`}isDropdownOpen(){return!this.#s.classList.contains(d.HIDE)}setLoading(t){this.#c.classList.toggle(d.LOADING,t)}isLoading(){return this.#c.classList.contains(d.LOADING)}setDisabled(t){this.telInputEl.disabled=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setReadonly(t){this.telInputEl.readOnly=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setCountry(t){let{allowDropdown:e,showFlags:i,separateDialCode:s,i18n:o}=this.#t,r=t?.name,l=t?.dialCode,a=t?.iso2??"";if(e&&this.#G(a),this.#e){let p=a&&i?`${d.FLAG} iti__${a}`:`${d.FLAG} ${d.GLOBE}`,c,m,y;a?(m=r,c=o.selectedCountryAriaLabel.replace("${countryName}",r).replace("${dialCode}",`+${l}`),y=i?"":tt()):(m=o.noCountrySelected,c=o.noCountrySelected,y=tt()),this.#c.className=p,this.#e.setAttribute("title",m),this.#e.setAttribute(h.LABEL,c),this.#c.innerHTML=y}if(s){let p=l?`+${l}`:"";this.#g.textContent=p,this.#W()}}destroy(){this.telInputEl.iti=void 0,delete this.telInputEl.dataset[v.INSTANCE_ID],this.telInputEl.style.paddingLeft=this.#E;let t=this.telInputEl.parentNode;t&&(t.before(this.telInputEl),t.remove()),this.#O.clear()}};var gt=n=>{let{onlyCountries:t,excludeCountries:e}=n;return t?.length?O.filter(i=>t.includes(i.iso2)):e?.length?O.filter(i=>!e.includes(i.iso2)):[...O]},bt=(n,t)=>{let{countryNameLocale:e,i18n:i}=t,s;try{typeof Intl<"u"&&typeof Intl.DisplayNames=="function"?s=new Intl.DisplayNames(e,{type:"region"}):s=null}catch(o){console.error(o),s=null}for(let o of n)o.name=i[o.iso2]||s?.of(o.iso2.toUpperCase())||""},It=n=>{let t=new Set,e=0,i={},s=(r,l)=>{if(!r||!l)return;l.length>e&&(e=l.length),Object.hasOwn(i,l)||(i[l]=[]);let a=i[l];a.includes(r)||a.push(r)},o=[...n].sort((r,l)=>r.priority-l.priority);for(let r of o){t.has(r.dialCode)||t.add(r.dialCode);for(let l=1;l<r.dialCode.length;l++){let a=r.dialCode.substring(0,l);s(r.iso2,a)}if(s(r.iso2,r.dialCode),r.areaCodes){let l=i[r.dialCode][0];for(let a of r.areaCodes){for(let p=1;p<a.length;p++){let c=a.substring(0,p),m=r.dialCode+c;s(l,m),s(r.iso2,m)}s(r.iso2,r.dialCode+a)}}}return{dialCodes:t,dialCodeMaxLength:e,dialCodeToIso2Map:i}},Lt=(n,t)=>{let{countryOrder:e}=t;n.sort((i,s)=>{if(e){let o=e.indexOf(i.iso2),r=e.indexOf(s.iso2),l=o>-1,a=r>-1;if(l||a)return l&&a?o-r:l?-1:1}return i.name.localeCompare(s.name)})},At=n=>{for(let t of n)t.normalisedName=W(t.name),t.initials=t.normalisedName.split(/[^a-z]/).map(e=>e[0]).join(""),t.dialCodePlus=`+${t.dialCode}`};var $t=new Set(["800","808","870","881","882","883","888","979"]),et=n=>{let t=w(n).slice(0,3);return n.startsWith("+")&&$t.has(t)};var it=(n,t,e,i)=>{if(!e||!t)return n;let s=`+${i.dialCode}`,o=n[s.length]===" "||n[s.length]==="-"?s.length+1:s.length;return n.substring(o)},vt=(n,t,e,i,s)=>{let o=e?e.formatNumberAsYouType(n,i?.iso2):n,r=i?.dialCode;return s&&t.charAt(0)!=="+"&&o.includes(`+${r}`)?(o.split(`+${r}`)[1]||"").trim():o};var Tt=(n,t,e,i)=>{if(e===0&&!i)return 0;let s=0;for(let o=0;o<t.length;o++){if(/[+0-9]/.test(t[o])&&s++,s===n&&!i)return o+1;if(i&&s===n+1)return o}return t.length};var Ft=new Set(["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"]),st=n=>{let t=w(n);if(t.startsWith(F.NANP)&&t.length>=4){let e=t.substring(1,4);return Ft.has(e)}return!1};var K=class{#t;constructor(t){t&&this.#i(t)}#i(t){/[\u0660-\u0669]/.test(t)?this.#t="arabic-indic":/[\u06F0-\u06F9]/.test(t)?this.#t="persian":this.#t="ascii"}denormalise(t){if(!this.#t||this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776;return t.replace(/[0-9]/g,i=>String.fromCharCode(e+Number(i)))}normalise(t){if(!t)return"";if(this.#i(t),this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776,i=this.#t==="arabic-indic"?/[\u0660-\u0669]/g:/[\u06F0-\u06F9]/g;return t.replace(i,s=>String.fromCharCode(48+(s.charCodeAt(0)-e)))}isAscii(){return!this.#t||this.#t==="ascii"}};var Bt=0,R=n=>{if(!u.utils)throw new Error(`intlTelInput.utils is required for ${n}(). See: https://intl-tel-input.com/docs/utils`)},wt=()=>{let n,t;return{promise:new Promise((i,s)=>{n=i,t=s}),resolve:n,reject:t}},M=class n{id;promise;#t;#i;#A;#E;#I;#v;#_;#m;#e=null;#c=null;#g;#o=!0;#s;#f;#l=!1;#u;#n;constructor(t,e={}){this.id=Bt++,P.validateInput(t);let i=dt(e);this.#i={...V,...i},ht(this.#i),pt(this.#i),this.#t=new P(t,this.#i,this.id),this.#A=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),this.#f=new K(t.value),this.promise=this.#T(this.#i),this.#E=gt(this.#i);let{dialCodes:s,dialCodeMaxLength:o,dialCodeToIso2Map:r}=It(this.#E);this.#_=s,this.#I=o,this.#v=r,this.#m=new Map(this.#E.map(l=>[l.iso2,l])),this.#H()}#a(){let t=this.#t.telInputEl.value.trim();return this.#f.normalise(t)}#d(t){this.#t.telInputEl.value=this.#f.denormalise(t)}#T(t){let{initialCountry:e,geoIpLookup:i,loadUtils:s}=t,o=e===k.AUTO&&!!i,r=!!s&&!u.utils;return o&&(this.#u=wt()),r&&(this.#n=wt()),Promise.all([this.#u?.promise,this.#n?.promise]).then(()=>{})}#H(){this.#s=new AbortController,this.#r(),this.#t.buildMarkup(this.#E),this.#C(),this.#h(),this.#O(),this.#i.dropdownAlwaysOpen&&this.#R()}#r(){bt(this.#E,this.#i),Lt(this.#E,this.#i),At(this.#E)}#C(t=!1){let e=this.#t.telInputEl.getAttribute("value"),i=this.#f.normalise(e??""),s=this.#a(),r=i&&i.startsWith("+")&&(!s||!s.startsWith("+"))?i:s,l=this.#D(r),a=st(r),{initialCountry:p,geoIpLookup:c}=this.#i,m=p===k.AUTO&&c,y=m&&u.autoCountry?u.autoCountry:p,T=m&&!t&&!u.autoCountry,I=N(y);l?a?I?this.#b(y):T||this.#b(nt.ISO2):(I&&this.#b(y),this.#y(r)):I?this.#b(y):T||this.#b(""),r&&this.#w(r)}#h(){this.#z(),this.#i.allowDropdown&&this.#t.bindAllInitialDropdownListeners(this.#s.signal,()=>this.#R(),()=>this.#S()),this.#t.bindHiddenInputSubmitListener(this.#s.signal,()=>this.getNumber(),()=>this.#e?.iso2||"")}#O(){if(this.#n){let{loadUtils:t}=this.#i,e=()=>{u.attachUtils(t)?.catch(()=>{})};u.documentReady()?e():window.addEventListener("load",e,{signal:this.#s.signal})}this.#u&&(this.#e?this.#u.resolve():this.#N())}#N(){if(u.autoCountry){this.#ot();return}if(this.#t.setLoading(!0),!u.startedLoadingAutoCountry&&(u.startedLoadingAutoCountry=!0,typeof this.#i.geoIpLookup=="function")){let t=(i="")=>{let s=i.toLowerCase();N(s)?(u.autoCountry=s,setTimeout(()=>n.forEachInstance("handleAutoCountryLoaded"))):n.forEachInstance("handleAutoCountryFailure")},e=()=>{n.forEachInstance("handleAutoCountryFailure")};this.#i.geoIpLookup(t,e)}}#k(){this.#R(),this.#t.prefillSearchWithPlus()}#U(t){let e=this.#t.telInputEl.selectionStart||0,i=t.substring(0,e-1),s=t.substring(e);return this.#d(i+s),e-1}#z(){this.#W(),this.#Z(),this.#F()}#X(t){this.#U(t),this.#k()}#q(t,e){let i=this.#U(t);this.#t.telInputEl.setSelectionRange(i,i),this.#p(b.STRICT_REJECT,{source:"key",rejectedInput:e,reason:"invalid"})}#J(t,e){let i=this.#t.telInputEl.selectionStart||0,o=t.substring(0,i).replace(A.NON_PLUS_NUMERIC_GLOBAL,"").length,r=this.#L(),l=vt(r,t,u.utils,this.#e,this.#i.separateDialCode),a=Tt(o,l,i,e);this.#d(l),this.#t.telInputEl.setSelectionRange(a,a)}#Q(t){if(t.startsWith("+")&&this.#e&&this.#D(t)){let e=it(t,!0,!0,this.#e);this.#d(e)}}#W(){this.#l=A.ALPHA_UNICODE.test(this.#a()),this.#t.telInputEl.addEventListener("input",this.#$,{signal:this.#s.signal})}#$=t=>{let{strictMode:e,formatAsYouType:i,separateDialCode:s,allowDropdown:o,countrySearch:r}=this.#i,l=t?.detail;if(l?.isCountryChange)return;let a=this.#a();if(this.#A&&t?.data==="+"&&s&&o&&r){this.#X(a);return}if(this.#A&&e&&(t?.data===" "||t?.data==="-"||t?.data===".")){this.#q(a,t.data);return}this.#y(a)&&this.#Y();let p=t?.data&&A.NON_PLUS_NUMERIC.test(t.data),c=t?.inputType===q.PASTE&&a;p||c&&!e?this.#l=!0:A.NON_PLUS_NUMERIC.test(a)||(this.#l=!1),i&&!this.#l&&!l?.isSetNumber&&this.#f.isAscii()&&this.#J(a,t?.inputType===q.DELETE_FORWARD),s&&this.#Q(a)};#Z(){let{strictMode:t,separateDialCode:e}=this.#i;!t&&!e||this.#t.telInputEl.addEventListener("keydown",this.#tt,{signal:this.#s.signal})}#tt=t=>{let{strictMode:e,separateDialCode:i,allowDropdown:s,countrySearch:o}=this.#i;if(!t.key||t.key.length!==1||t.altKey||t.ctrlKey||t.metaKey)return;if(i&&s&&o&&t.key==="+"){t.preventDefault(),this.#k();return}if(!e)return;let r=this.#a(),a=!r.startsWith("+")&&this.#t.telInputEl.selectionStart===0&&t.key==="+",p=this.#f.normalise(t.key),c=/^[0-9]$/.test(p),m=i?c:a||c,y=this.#t.telInputEl,T=y.selectionStart,I=y.selectionEnd,$=r.slice(0,T??void 0),x=r.slice(I??void 0),g=$+p+x,D=this.#x(g),H=!1;u.utils&&this.#c&&(H=u.utils.getCoreNumber(D,this.#e?.iso2).length>this.#c);let Y=this.#j(D)!==null;(!m||H&&!Y&&!a)&&(this.#p(b.STRICT_REJECT,{source:"key",rejectedInput:t.key,reason:m?"max-length":"invalid"}),t.preventDefault())};#F(){this.#i.strictMode&&this.#t.telInputEl.addEventListener("paste",this.#B,{signal:this.#s.signal})}#B=t=>{t.preventDefault();let e=this.#t.telInputEl,i=e.selectionStart,s=e.selectionEnd,o=this.#a(),r=o.slice(0,i??void 0),l=o.slice(s??void 0),a=this.#e?.iso2,p=t.clipboardData.getData("text"),c=this.#f.normalise(p),m=i===0&&s>0,y=!o.startsWith("+")||m,T=c.replace(A.NON_PLUS_NUMERIC_GLOBAL,""),I=T.startsWith("+"),$=T.replace(/\+/g,""),x=I&&y?`+${$}`:$,g=r+x+l,D=x!==c?"invalid":null;if(g.length>5&&u.utils){let _=u.utils.getCoreNumber(g,a);for(;_.length===0&&g.length>0;)g=g.slice(0,-1),_=u.utils.getCoreNumber(g,a);if(!_){this.#p(b.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:"max-length"});return}if(this.#c&&_.length>this.#c)if(e.selectionEnd===o.length){let Y=_.length-this.#c;g=g.slice(0,g.length-Y),D="max-length"}else{this.#p(b.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:"max-length"});return}}this.#d(g);let H=i+x.length;e.setSelectionRange(H,H),e.dispatchEvent(new InputEvent("input",{bubbles:!0})),D&&this.#p(b.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:D})};#P(t){let e=Number(this.#t.telInputEl.getAttribute("maxlength"));return e&&t.length>e?t.substring(0,e):t}#p(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.#t.telInputEl.dispatchEvent(i)}#R(){this.#t.openDropdown(t=>this.#st(t),()=>this.#S()),this.#p(b.OPEN_COUNTRY_DROPDOWN)}#w(t){let{formatOnDisplay:e,nationalMode:i,separateDialCode:s}=this.#i,o=t;if(e&&u.utils&&this.#e){let r=et(t),l=i&&!r||!o.startsWith("+")&&!s,{NATIONAL:a,INTERNATIONAL:p}=u.utils.numberFormat,c=l?a:p;o=u.utils.formatNumber(o,this.#e?.iso2,c)}o=this.#K(o),this.#d(o)}#y(t){let e=this.#j(t);return e!==null?this.#b(e):!1}#et(t){let e=this.#e?.dialCode,i=this.#e?.nationalPrefix;if(t.startsWith("+")||!e)return t;let r=i&&t.startsWith(i)&&!this.#i.separateDialCode?t.substring(1):t;return`+${e}${r}`}#j(t){let e=t.indexOf("+"),i=e>0?t.substring(e):t,s=this.#e?.iso2;i=this.#et(i);let o=this.#D(i,!0),r=w(i);if(o){let l=w(o),a=this.#v[l];return a.length===1?a[0]===s?null:a[0]:this.#it(a,l,r)}else if(i.startsWith("+")&&r.length){let l=this.#e?.dialCode||"";return l&&l.startsWith(r)?null:""}else if((!i||i==="+")&&!s&&this.#g)return this.#g;return null}#it(t,e,i){let s=this.#e?.iso2,o=this.#e?.dialCode;if(!s&&this.#g&&t.includes(this.#g))return this.#g;if(o===F.NANP&&st(i))return null;let l=this.#e?.areaCodes,a=this.#e?.priority;if(l){let T=l.map(I=>`${o}${I}`);for(let I of T)if(i.startsWith(I))return null}let c=l&&!(a===0)&&i.length>e.length,m=s&&t.includes(s)&&!c,y=s===t[0];return!m&&!y?t[0]:null}#b(t){let e=this.#e?.iso2||"";return this.#e=t?this.#m.get(t):null,this.#e&&(this.#g=this.#e.iso2),this.#t.setCountry(this.#e),this.#M(),this.#V(),e!==t}#V(){let{strictMode:t,placeholderNumberType:e,allowedNumberTypes:i}=this.#i;if(!t||!u.utils)return;let s=this.#e?.iso2;if(!s){this.#c=null;return}let o=u.utils.numberType[e],r=u.utils.getExampleNumber(s,!1,o,!0),l=r;for(;u.utils.isPossibleNumber(r,s,i);)l=r,r+="0";let a=u.utils.getCoreNumber(l,s);this.#c=a.length,s==="by"&&(this.#c=a.length+1)}#M(){let{autoPlaceholder:t,placeholderNumberType:e,nationalMode:i,customPlaceholder:s}=this.#i,o=t===S.AGGRESSIVE||!this.#t.hadInitialPlaceholder&&t===S.POLITE;if(!u.utils||!o)return;let r=u.utils.numberType[e],l=this.#e?u.utils.getExampleNumber(this.#e.iso2,i,r):"";l=this.#K(l),typeof s=="function"&&(l=s(l,this.#e)),this.#t.telInputEl.setAttribute("placeholder",l)}#st(t){if(!t)return;let e=t.dataset[v.ISO2],i=this.#b(e);this.#S();let s=t.dataset[v.DIAL_CODE];if(this.#G(s),this.#i.formatOnDisplay){let o=this.#a();this.#w(o)}this.#t.telInputEl.focus(),i&&(this.#Y(),this.#p(b.INPUT,{isCountryChange:!0}))}#S(t){!this.#t.isDropdownOpen()||this.#i.dropdownAlwaysOpen&&!t||(this.#t.closeDropdown(),this.#p(b.CLOSE_COUNTRY_DROPDOWN))}#G(t){let e=this.#a();if(!e.startsWith("+"))return;let i=`+${t}`,s=this.#D(e),o;s?o=e.replace(s,i):o=i,this.#d(o)}#D(t,e){if(!t.startsWith("+"))return"";let i="",s="",o=!1;for(let r=0;r<t.length;r++){let l=t.charAt(r);if(!/[0-9]/.test(l))continue;if(s+=l,!!!this.#v[s])break;if(this.#_.has(s)){if(i=t.substring(0,r+1),o=!0,!e)break}else e&&o&&(i=t.substring(0,r+1));if(s.length===this.#I)break}return i}#x(t){let e=this.#e?.dialCode,i=w(t);return(this.#i.separateDialCode&&!t.startsWith("+")&&e&&i?`+${e}`:"")+t}#L(){let t=this.#a();return this.#x(t)}#K(t){let e=!!this.#D(t),i=it(t,e,this.#i.separateDialCode,this.#e);return this.#P(i)}#nt(){let t=this.#e;if(!t)return null;let{iso2:e,dialCode:i,name:s}=t;return{iso2:e,dialCode:i,name:s}}#Y(){let t=this.#nt();this.#p(b.COUNTRY_CHANGE,t)}#ot(){if(!(!this.#u||!u.autoCountry)){if(!this.#o){this.#u.resolve();return}this.#t.isLoading()?this.setCountry(u.autoCountry):this.#g=u.autoCountry,this.#t.setLoading(!1),this.#u.resolve()}}#lt(){if(!this.#o){this.#u?.reject();return}this.#C(!0),this.#t.setLoading(!1),this.#u?.reject()}#at(){if(!this.#o){this.#n?.resolve();return}if(!u.utils){this.#n?.resolve();return}let t=this.#a();t&&this.#w(t),this.#e&&(this.#M(),this.#V()),this.#n?.resolve()}#ut(t){if(!this.#o){this.#n?.reject(t);return}this.#n?.reject(t)}destroy(){this.#o&&(this.#o=!1,this.#i.allowDropdown&&this.#S(!0),this.#s.abort(),this.#t.destroy(),u.instances.delete(String(this.id)))}isActive(){return this.#o}getExtension(){return this.#o?(R("getExtension"),u.utils.getExtension(this.#L(),this.#e?.iso2)):""}getNumber(t){if(!this.#o)return"";R("getNumber");let e=this.#e?.iso2,i=this.#L(),s=u.utils.formatNumber(i,e,t);return this.#f.denormalise(s)}getNumberType(){return this.#o?(R("getNumberType"),u.utils.getNumberType(this.#L(),this.#e?.iso2)):Q.UNKNOWN_NUMBER_TYPE}getSelectedCountryData(){return this.#nt()}getValidationError(){if(!this.#o)return Q.UNKNOWN_VALIDATION_ERROR;R("getValidationError");let t=this.#e?.iso2;return u.utils.getValidationError(this.#L(),t)}isValidNumber(){if(!this.#o)return null;R("isValidNumber");let t=this.#e?.dialCode,e=this.#e?.iso2,i=this.#L(),s=u.utils.getCoreNumber(i,e);if(s){if(t===B.DIAL_CODE&&s[0]===B.MOBILE_PREFIX&&s.length!==B.MOBILE_CORE_LENGTH)return!1;if(!A.ALPHA_UNICODE.test(i)&&t){let r=i.startsWith("+")?i.slice(1+t.length):i,l=w(r).length;if(s.length>l)return!1}}return this.#rt("possible")}isValidNumberPrecise(){return this.#o?(R("isValidNumberPrecise"),this.#rt("precise")):null}#rt(t){let{allowNumberExtensions:e,allowPhonewords:i,allowedNumberTypes:s}=this.#i,o=this.#e?.iso2,r=this.#L();return!this.#e&&!et(r)||!(t==="precise"?u.utils.isValidNumber:u.utils.isPossibleNumber)(r,o,s)?!1:A.ALPHA_UNICODE.test(r)?!!u.utils.getExtension(r,o)?e:i:!0}setCountry(t){if(!this.#o)return;let e=t?.toLowerCase();if(!N(e))throw new Error(`Invalid iso2 code: '${e}'`);let i=this.#e?.iso2;if(t&&e!==i||!t&&i){if(this.#b(e),this.#G(this.#e?.dialCode||""),this.#i.formatOnDisplay){let o=this.#a();this.#w(o)}this.#Y(),this.#p(b.INPUT,{isCountryChange:!0})}}setNumber(t){if(!this.#o)return;let e=this.#f.normalise(t),i=this.#y(e);this.#w(e),i&&this.#Y(),this.#p(b.INPUT,{isSetNumber:!0})}setPlaceholderNumberType(t){this.#o&&(this.#i.placeholderNumberType=t,this.#M())}setDisabled(t){this.#o&&this.#t.setDisabled(t)}setReadonly(t){this.#o&&this.#t.setReadonly(t)}static forEachInstance(t,...e){let i=[...u.instances.values()],s=e[0];i.forEach(o=>{if(o instanceof n)switch(t){case"handleUtilsLoaded":o.#at();break;case"handleUtilsFailure":o.#ut(s);break;case"handleAutoCountryLoaded":o.#ot();break;case"handleAutoCountryFailure":o.#lt();break}})}},jt=n=>{if(!u.utils&&!u.startedLoadingUtils){let t;if(typeof n=="function")try{t=Promise.resolve(n())}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 utils module, not ${typeof n}`));return u.startedLoadingUtils=!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 u.utils=i,M.forEachInstance("handleUtilsLoaded"),!0}).catch(e=>{throw M.forEachInstance("handleUtilsFailure",e),e})}return null},u=Object.assign((n,t)=>{let e=new M(n,t);return u.instances.set(String(e.id),e),n.iti=e,e},{defaults:V,documentReady:()=>document.readyState==="complete",getCountryData:()=>O,getInstance:n=>{let t=n.dataset[v.INSTANCE_ID];return t?u.instances.get(t)??null:null},instances:new Map,attachUtils:jt,startedLoadingUtils:!1,startedLoadingAutoCountry:!1,version:"27.2.1"}),Vt=u;return Pt(Gt);})();
25
25
  var intlTelInput = _factory.default;
@@ -4571,7 +4571,7 @@ var intlTelInput = Object.assign(
4571
4571
  attachUtils,
4572
4572
  startedLoadingUtils: false,
4573
4573
  startedLoadingAutoCountry: false,
4574
- version: "27.2.0"
4574
+ version: "27.2.1"
4575
4575
  }
4576
4576
  );
4577
4577
  var intlTelInput_default = intlTelInput;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v27.2.0
2
+ * International Telephone Input v27.2.1
3
3
  * git+https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -4602,7 +4602,7 @@ var _factory = (() => {
4602
4602
  attachUtils,
4603
4603
  startedLoadingUtils: false,
4604
4604
  startedLoadingAutoCountry: false,
4605
- version: "27.2.0"
4605
+ version: "27.2.1"
4606
4606
  }
4607
4607
  );
4608
4608
  var intlTelInput_default = intlTelInput;