/* * International Telephone Input v29.2.3 * git+https://github.com/jackocnr/intl-tel-input.git * Licensed under the MIT license */ "use strict";var _factory=(()=>{var J1=Object.defineProperty;var B2=Object.getOwnPropertyDescriptor;var k2=Object.getOwnPropertyNames;var F2=Object.prototype.hasOwnProperty;var G2=(r,t)=>{for(var n in t)J1(r,n,{get:t[n],enumerable:!0})},W2=(r,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let $ of k2(t))!F2.call(r,$)&&$!==n&&J1(r,$,{get:()=>t[$],enumerable:!(i=B2(t,$))||i.enumerable});return r};var V2=r=>W2(J1({},"__esModule",{value:!0}),r);var $d={};G2($d,{default:()=>sd});var j2=[["af","93",0,null,"0"],["ax","358",1,["18","4","50"],"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","50"],"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","79111","79117"],"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","77003","77007","77008","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,["2689","269","639","7093"],"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"]],Q1=[];for(let r of j2)Q1.push({name:"",iso2:r[0],dialCode:r[1],priority:r[2]||0,areaCodes:r[3]||null,nationalPrefix:r[4]||null});var K2=new Set(Q1.map(r=>r.iso2)),u1=r=>K2.has(r),f1=Q1;var Y={OPEN_COUNTRY_SELECTOR:"open:countryselector",CLOSE_COUNTRY_SELECTOR:"close:countryselector",COUNTRY_CHANGE:"countrychange",INPUT:"input",STRICT_REJECT:"strict:reject"},q1=["container","input","countryContainer","selectedCountry","selectedCountryPrimary","selectedFlag","arrow","selectedDialCode","countrySelector","countrySelectorContainer","searchWrapper","searchIcon","searchInput","searchClear","countryList","countryListItem","countryListItemFlag","countryName","dialCode","countryCheck","noResults"],y={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",STRICT_REJECT_ANIMATION:"iti__strict-reject-animation"},F={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",SPACE:" ",ENTER:"Enter",ESC:"Escape",TAB:"Tab"},d0={PASTE:"insertFromPaste",DELETE_FORWARD:"deleteContentForward"},Q={ALPHA_UNICODE:/\p{L}/u,NON_PLUS_NUMERIC:/[^+0-9]/,NON_PLUS_NUMERIC_GLOBAL:/[^+0-9]/g,HIDDEN_SEARCH_CHAR:/^[a-zA-ZÀ-ÿа-яА-Я ]$/},t0={SEARCH_DEBOUNCE_MS:100,HIDDEN_SEARCH_RESET_MS:1e3,NEXT_TICK:0},Z={NARROW_VIEWPORT_WIDTH:500,FALLBACK_SELECTED_COUNTRY_WITH_DIAL_WIDTH:78,FALLBACK_SELECTED_COUNTRY_NO_DIAL_WIDTH:42,INPUT_PADDING_EXTRA_LEFT:6,DROPDOWN_MARGIN:3,FALLBACK_DROPDOWN_HEIGHT:200},H1={PLUS:"+",NANP:"1"},e0=15,U1={ISO2:"gb",DIAL_CODE:"44",MOBILE_PREFIX:"7",MOBILE_CORE_LENGTH:10},J0={ISO2:"us",DIAL_CODE:"1"},s1={AGGRESSIVE:"AGGRESSIVE",POLITE:"POLITE",OFF:"OFF"},B1=["OFF","DROPDOWN","FULLSCREEN","AUTO"],Y2=["E164","INTERNATIONAL","NATIONAL","RFC3966"],p1=["FIXED_LINE","MOBILE","FIXED_LINE_OR_MOBILE","TOLL_FREE","PREMIUM_RATE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL","UNKNOWN"],Z2=["IS_POSSIBLE","INVALID_COUNTRY_CODE","TOO_SHORT","TOO_LONG","IS_POSSIBLE_LOCAL_ONLY","INVALID_LENGTH"],k1=r=>Object.fromEntries(r.map(t=>[t,t])),w=k1(Y2),a1=k1(p1),n0=k1(Z2),S=k1(B1),q={ISO2:"iso2",DIAL_CODE:"dialCode",INSTANCE_ID:"intlTelInputId"},T={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 z2={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(r){return r===0?"No results found":r===1?"1 result found":`${r} results found`}},Q0=z2;var i0=r=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(r).matches,t2=()=>i0(`(max-width: ${Z.NARROW_VIEWPORT_WIDTH}px)`),X2=()=>{if(typeof navigator<"u"&&typeof window<"u"){let r=i0("(max-height: 600px)"),t=i0("(pointer: coarse)");if(t2()||t&&r)return S.FULLSCREEN}return S.DROPDOWN},G1={countrySelectorMode:S.AUTO,allowedNumberTypes:[a1.MOBILE,a1.FIXED_LINE],allowNumberExtensions:!1,allowPhonewords:!1,classNames:{},containerClass:"",countryNameLocale:"en",countryNameOverrides:{},countryOrder:null,countrySearch:!0,customPlaceholder:null,dropdownAlwaysOpen:!1,dropdownParent:null,excludeCountries:null,matchDropdownWidth:!0,formatAsYouType:!0,hiddenInputs:null,uiTranslations:{},initialCountry:"",initialCountryLookup:null,loadUtils:null,numberDisplayFormat:w.INTERNATIONAL,onlyCountries:null,placeholderNumberPolicy:s1.POLITE,placeholderNumberType:a1.MOBILE,searchInputClass:"",separateDialCode:!0,strictRejectAnimation:!0,showFlags:!0,strictMode:!0},e2=r=>JSON.stringify(r),F1=r=>!!r&&typeof r=="object"&&!Array.isArray(r),J2=r=>typeof r=="function",Q2=r=>{if(!r||typeof r!="object")return!1;let t=r;return t.nodeType===1&&typeof t.tagName=="string"&&typeof t.appendChild=="function"},q0=new Set(Object.values(s1)),q2=new Set(q1),A1=r=>{console.warn(`[intl-tel-input] ${r}`)},x=(r,t,n)=>{A1(`Option '${r}' must be ${t}; got ${e2(n)}. Ignoring.`)},d2=(r,t)=>{let n="an array of iso2 country code strings";if(!Array.isArray(t))return x(r,n,t),!1;let i=[];for(let $ of t){if(typeof $!="string")return x(r,n,t),!1;let u=$.toLowerCase();u1(u)?i.push($):A1(`Invalid iso2 code in '${r}': '${$}'. Skipping.`)}return i},n2=r=>{if(r===void 0)return{};if(!F1(r)){let n=`The second argument must be an options object; got ${e2(r)}. Using defaults.`;return A1(n),{}}let t={};for(let[n,i]of Object.entries(r)){if(!Object.hasOwn(G1,n)){A1(`Unknown option '${n}'. Ignoring.`);continue}switch(n){case"allowNumberExtensions":case"allowPhonewords":case"countrySearch":case"dropdownAlwaysOpen":case"matchDropdownWidth":case"formatAsYouType":case"showFlags":case"separateDialCode":case"strictMode":case"strictRejectAnimation":if(typeof i!="boolean"){x(n,"a boolean",i);break}t[n]=i;break;case"countrySelectorMode":if(typeof i!="string"||!B1.includes(i)){x("countrySelectorMode",`one of ${B1.map($=>`"${$}"`).join(", ")}`,i);break}t[n]=i;break;case"numberDisplayFormat":if(typeof i!="string"||i===w.RFC3966||!(i===w.E164||i===w.INTERNATIONAL||i===w.NATIONAL)){x("numberDisplayFormat",'one of "E164", "INTERNATIONAL", "NATIONAL"',i);break}t[n]=i;break;case"placeholderNumberPolicy":if(typeof i!="string"||!q0.has(i)){let $=Array.from(q0).join(", ");x("placeholderNumberPolicy",`one of ${$}`,i);break}t[n]=i;break;case"containerClass":case"searchInputClass":case"countryNameLocale":if(typeof i!="string"){x(n,"a string",i);break}t[n]=i;break;case"classNames":{if(!F1(i)){x("classNames","an object",i);break}let $={};for(let[u,c]of Object.entries(i))q2.has(u)?typeof c!="string"?x(`classNames.${u}`,"a string",c):$[u]=c.trim().replace(/\s+/g," "):A1(`Unknown slot '${u}' in 'classNames'. Valid slots: ${q1.join(", ")}. Skipping.`);t[n]=$;break}case"countryOrder":{if(i===null)t[n]=i;else{let $=d2(n,i);$!==!1&&(t[n]=$)}break}case"customPlaceholder":case"hiddenInputs":case"initialCountryLookup":case"loadUtils":if(i!==null&&!J2(i)){x(n,"a function or null",i);break}t[n]=i;break;case"dropdownParent":if(i!==null&&!Q2(i)){x("dropdownParent","an HTMLElement or null",i);break}t[n]=i;break;case"excludeCountries":case"onlyCountries":{if(i===null)t[n]=i;else{let $=d2(n,i);$!==!1&&(t[n]=$)}break}case"uiTranslations":if(i&&!F1(i)){x("uiTranslations","an object",i);break}t[n]=i;break;case"countryNameOverrides":if(i&&!F1(i)){x("countryNameOverrides","an object",i);break}t[n]=i;break;case"initialCountry":{if(typeof i!="string"){x("initialCountry","a string",i);break}let $=i.toLowerCase();if($&&!u1($)){x("initialCountry","a valid iso2 country code",i);break}t[n]=i;break}case"placeholderNumberType":if(typeof i!="string"||!p1.includes(i)){let $=p1.join(", ");x("placeholderNumberType",`one of ${$}`,i);break}t[n]=i;break;case"allowedNumberTypes":if(i!==null){if(!Array.isArray(i)){x("allowedNumberTypes","an array of number types or null",i);break}let $=!0;for(let u of i)if(typeof u!="string"||!p1.includes(u)){let c=p1.join(", ");x("allowedNumberTypes",`an array of valid number types (${c})`,u),$=!1;break}$&&(t[n]=i)}else t[n]=null;break}}return t},i2=r=>{r.initialCountry&&(r.initialCountry=r.initialCountry.toLowerCase()),r.onlyCountries?.length&&(r.onlyCountries=r.onlyCountries.map(t=>t.toLowerCase())),r.excludeCountries?.length&&(r.excludeCountries=r.excludeCountries.map(t=>t.toLowerCase())),r.countryOrder&&(r.countryOrder=r.countryOrder.map(t=>t.toLowerCase()))},s2=r=>{r.countrySelectorMode===S.AUTO&&(r.countrySelectorMode=X2()),r.dropdownAlwaysOpen&&(r.countrySelectorMode=S.DROPDOWN),r.countrySelectorMode===S.FULLSCREEN?r.matchDropdownWidth=!1:t2()&&(r.matchDropdownWidth=!0),r.onlyCountries?.length===1&&(r.initialCountry=r.onlyCountries[0]),r.separateDialCode&&r.numberDisplayFormat===w.NATIONAL&&(r.numberDisplayFormat=w.INTERNATIONAL),r.countrySelectorMode!==S.OFF&&!r.showFlags&&!r.separateDialCode&&r.numberDisplayFormat===w.NATIONAL&&(r.numberDisplayFormat=w.INTERNATIONAL),r.uiTranslations={...Q0,...r.uiTranslations}};var z=r=>r.replace(/\D/g,""),s0=(r="")=>r.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();var $0=r=>Object.keys(r).filter(t=>!!r[t]).join(" "),b=(r,t,n)=>{let i=document.createElement(r);return t&&Object.entries(t).forEach(([$,u])=>i.setAttribute($,u)),n&&n.appendChild(i),i};var dd="http://www.w3.org/2000/svg",b1=([r,t,n])=>{let i=document.createElementNS(dd,r);if(t)for(let $ in t)i.setAttribute($,String(t[$]));if(n)for(let $ of n)i.appendChild(b1($));return i},$2=()=>b1(["svg",{class:"iti__search-icon-svg",width:14,height:14,viewBox:"0 0 24 24",focusable:"false",[T.HIDDEN]:"true"},[["circle",{cx:11,cy:11,r:7}],["line",{x1:21,y1:21,x2:16.65,y2:16.65}]]]),r2=r=>{let t=`iti-${r}-clear-mask`;return b1(["svg",{class:"iti__search-clear-svg",width:12,height:12,viewBox:"0 0 16 16",[T.HIDDEN]:"true",focusable:"false"},[["mask",{id:t,maskUnits:"userSpaceOnUse"},[["rect",{width:16,height:16,fill:"white"}],["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"}]]],["circle",{cx:8,cy:8,r:8,class:"iti__search-clear-bg",mask:`url(#${t})`}]]])},o2=()=>b1(["svg",{class:"iti__country-check-svg",width:14,height:14,viewBox:"0 0 16 16",fill:"currentColor",focusable:"false",[T.HIDDEN]:"true"},[["path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"}]]]),r0=()=>b1(["svg",{width:256,height:256,viewBox:"0 0 512 512",class:"iti__globe-svg"},[["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"}],["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"}]]]);var o0=r=>s0(r).replace(/[^\p{L}]+/gu," ").trim(),l2=r=>{let t=new Map;for(let n of r){let i=o0(n.name),$=i.split(" ").filter(Boolean),u=$.map(c=>c[0]||"").join("");t.set(n.iso2,{normalisedName:i,words:$,initials:u,dialCodePlus:`+${n.dialCode}`})}return t},u2=(r,t,n)=>{let i=s0(n),$=o0(n),u=i!==""&&$==="",c=[],f=[],g=[],I=[],L=[],v=[],O=[];for(let M of r){let A=t.get(M.iso2);M.iso2===i?c.push(M):!u&&A.normalisedName.startsWith($)?f.push(M):!u&&A.normalisedName.includes($)?g.push(M):i===M.dialCode||i===A.dialCodePlus?I.push(M):A.dialCodePlus.includes(i)?L.push(M):A.initials.includes(i)&&v.push(M)}let G=$.split(" ").filter(Boolean);if(G.length>1&&c.length===0&&f.length===0&&g.length===0){let M=new Set([...I.map(A=>A.iso2),...L.map(A=>A.iso2),...v.map(A=>A.iso2)]);for(let A of r){if(M.has(A.iso2))continue;let _=t.get(A.iso2);G.some(j=>_.words.some(X=>X.startsWith(j)))&&O.push(A)}}let U=(M,A)=>M.priority-A.priority;return[...c,...f,...g,...I.sort(U),...L.sort(U),...v,...O]},a2=(r,t,n)=>{let i=o0(n);for(let $ of r){let{normalisedName:u}=t.get($.iso2);if(u.startsWith(i))return $}return null};var g1=class r{#d;static toAscii(t){return t?t.replace(/[٠-٩]/g,n=>String.fromCharCode(48+(n.charCodeAt(0)-1632))).replace(/[۰-۹]/g,n=>String.fromCharCode(48+(n.charCodeAt(0)-1776))):""}constructor(t){t&&this.#e(t)}#e(t){/[٠-٩]/.test(t)?this.#d="arabic-indic":/[۰-۹]/.test(t)?this.#d="persian":this.#d="ascii"}denormalise(t){if(!this.#d||this.#d==="ascii")return t;let n=this.#d==="arabic-indic"?1632:1776;return t.replace(/[0-9]/g,i=>String.fromCharCode(n+Number(i)))}normalise(t){return t?(this.#e(t),this.#d==="ascii"?t:r.toAscii(t)):""}isAscii(){return!this.#d||this.#d==="ascii"}};var c2=typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("anchor-name: --x"),m1=class{#d;#e;#T;#C="";#I;#L;#A=null;#M;#H=!1;#t;#n;#h;#o;#g;#i;#b;#u;#a;#$;#l;#f;#N;#W;#r;#m=null;#p=null;#D=new Map;#v=null;#w;telInputEl;hadInitialPlaceholder;constructor(t,n,i){t.dataset[q.INSTANCE_ID]=i.toString(),this.telInputEl=t,this.#d=n,this.#e=i,this.hadInitialPlaceholder=!!t.getAttribute("placeholder"),this.#T=!!this.telInputEl.closest("[dir=rtl]"),this.#C=this.telInputEl.style.paddingLeft}static validateInput(t){let n=t?.tagName;if(!(!!t&&typeof t=="object"&&n==="INPUT"&&typeof t.setAttribute=="function")){let $=Object.prototype.toString.call(t);throw new TypeError(`The first argument must be an HTMLInputElement, not ${$}`)}}#s(t,n){let i=this.#d.classNames[t];return i?`${n} ${i}`:n}buildMarkup(t,n){this.#I=t,this.#L=n,this.telInputEl.classList.add(...this.#s("input","iti__tel-input").split(" ")),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 i=this.#J();this.#Q(i),i.appendChild(this.telInputEl),this.#t1(),this.#i1(),this.#e1(i),this.ensureDropdownWidthSet()}#J(){let{countrySelectorMode:t,showFlags:n,containerClass:i}=this.#d,$=$0({iti:!0,"iti--input-container":!0,"iti--has-country-selector":t!==S.OFF,"iti--show-flags":n,"iti--inline-country-selector":t!==S.FULLSCREEN,[i]:!!i}),u=b("div",{class:this.#s("container",$)});return this.#T&&u.setAttribute("dir","ltr"),this.telInputEl.before(u),u}#Q(t){let{countrySelectorMode:n,separateDialCode:i,showFlags:$}=this.#d,u=n!==S.OFF;if(!u&&!$&&!i)return;this.#t=b("div",{class:this.#s("countryContainer",`iti__country-container ${y.V_HIDE}`)},t),u?(this.#n=b("button",{type:"button",class:this.#s("selectedCountry","iti__selected-country"),[T.EXPANDED]:"false",[T.LABEL]:this.#d.uiTranslations.noCountrySelected,[T.HASPOPUP]:"dialog",[T.CONTROLS]:`iti-${this.#e}__country-selector`},this.#t),this.telInputEl.disabled&&this.#n.setAttribute("disabled","true")):this.#n=b("div",{class:this.#s("selectedCountry","iti__selected-country")},this.#t);let c=b("div",{class:this.#s("selectedCountryPrimary","iti__selected-country-primary")},this.#n);this.#h=b("div",{class:this.#s("selectedFlag",y.FLAG)},c),u&&(this.#g=b("div",{class:this.#s("arrow","iti__arrow"),[T.HIDDEN]:"true"},c)),i&&(this.#o=b("div",{class:this.#s("selectedDialCode","iti__selected-dial-code")},this.#n)),u&&this.#q()}ensureDropdownWidthSet(){let{matchDropdownWidth:t,countrySelectorMode:n}=this.#d;if(n===S.OFF||!t||this.#i.style.width)return;let i=this.telInputEl.offsetWidth;i>0&&(this.#i.style.width=`${i}px`)}#q(){let{matchDropdownWidth:t,countrySelectorMode:n,countrySearch:i,uiTranslations:$,containerClass:u}=this.#d,c=n===S.FULLSCREEN,f=this.#V(),g=t?"":"iti--flexible-dropdown-width";if(this.#i=b("div",{id:`iti-${this.#e}__country-selector`,class:this.#s("countrySelector",`iti__country-selector ${y.HIDE} ${g}`),role:"dialog",[T.MODAL]:"true"}),this.#T&&this.#i.setAttribute("dir","rtl"),i&&this.#d1(),this.#$=b("ul",{class:this.#s("countryList","iti__country-list"),id:`iti-${this.#e}__country-listbox`,role:"listbox",[T.LABEL]:$.countryListAriaLabel},this.#i),this.#n1(),i&&this.#j(),f){let I=$0({iti:!0,"iti--detached-country-selector":!0,"iti--fullscreen-popup":c,"iti--inline-country-selector":!c,[u]:!!u});this.#r=b("div",{class:this.#s("countrySelectorContainer",I)}),this.#r.appendChild(this.#i)}else this.#t.appendChild(this.#i)}#V(){let{countrySelectorMode:t,dropdownParent:n}=this.#d;return t===S.FULLSCREEN?document.body:t===S.DROPDOWN?n:null}#d1(){let{uiTranslations:t,searchInputClass:n}=this.#d,i=b("div",{class:this.#s("searchWrapper","iti__search-input-wrapper")},this.#i);this.#b=b("span",{class:this.#s("searchIcon","iti__search-icon"),[T.HIDDEN]:"true"},i),this.#b.appendChild($2()),this.#u=b("input",{id:`iti-${this.#e}__search-input`,type:"search",class:this.#s("searchInput",`iti__search-input ${n}`),placeholder:t.searchPlaceholder,role:"combobox",[T.EXPANDED]:"true",[T.LABEL]:t.searchPlaceholder,[T.CONTROLS]:`iti-${this.#e}__country-listbox`,[T.AUTOCOMPLETE]:"list",autocomplete:"off"},i),this.#a=b("button",{type:"button",class:this.#s("searchClear",`iti__search-clear ${y.HIDE}`),[T.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},i),this.#a.appendChild(r2(this.#e)),this.#W=b("span",{class:"iti__a11y-text"},this.#i),this.#N=b("div",{class:this.#s("noResults",`iti__no-results ${y.HIDE}`),[T.HIDDEN]:"true"},this.#i),this.#N.textContent=t.searchEmptyState??null}#t1(){this.#t&&(this.#U(),this.#t.classList.remove(y.V_HIDE))}#e1(t){let{hiddenInputs:n}=this.#d;if(!n)return;let i=this.telInputEl.getAttribute("name")||"",$=n(i);if($.phone){let u=this.telInputEl.form?.querySelector(`input[name="${$.phone}"]`);u?this.#l=u:(this.#l=b("input",{type:"hidden",name:$.phone}),t.appendChild(this.#l))}if($.country){let u=this.telInputEl.form?.querySelector(`input[name="${$.country}"]`);u?this.#f=u:(this.#f=b("input",{type:"hidden",name:$.country}),t.appendChild(this.#f))}}#n1(){let t=document.createDocumentFragment(),n=this.#s("countryListItem",y.COUNTRY_ITEM);for(let i=0;i"u"||(this.#w=new ResizeObserver(()=>{this.#n?.offsetWidth&&this.#U()}),this.#w.observe(this.#n))}#s1(){if(!this.telInputEl.parentNode)return 0;let t=document.body,n=this.telInputEl.parentNode.cloneNode(!1);n.style.visibility="hidden",t.appendChild(n);let i=this.#t.cloneNode();n.appendChild(i);let $=this.#n.cloneNode(!0);i.appendChild($);let u=$.offsetWidth;return t.removeChild(n),u}#$1(){if(this.#M!==void 0)return;let{countrySearch:t,matchDropdownWidth:n}=this.#d,{height:i,width:$}=this.#P();this.#M=i,t&&(this.#i.style.height=`${i}px`,!n&&$>0&&(this.#i.style.width=`${$}px`))}#P(){let t=document.body,n=this.#i,i=n.parentNode,$=n.nextSibling;n.classList.remove(y.HIDE);let u=b("div",{class:"iti iti--inline-country-selector"});u.appendChild(n),u.style.visibility="hidden",t.appendChild(u);let c=n.offsetHeight,f=n.offsetWidth;return t.removeChild(u),n.classList.add(y.HIDE),i&&i.insertBefore(n,$),{height:c>0?c:Z.FALLBACK_DROPDOWN_HEIGHT,width:f}}#j(){let{uiTranslations:t}=this.#d,n=this.#$.childElementCount;this.#W.textContent=t.searchSummaryAria(n)}#K(t){let n;if(t==="")n=this.#I;else{let i=g1.toAscii(t);n=u2(this.#I,this.#L,i)}this.#S(n)}prefillSearchWithPlus(){this.#u.value="+",this.#u.focus(),this.#K("")}#c(){let t=this.#u.value.trim();this.#K(t),this.#u.value?this.#a.classList.remove(y.HIDE):this.#a.classList.add(y.HIDE)}#O(){this.#A&&clearTimeout(this.#A),this.#A=setTimeout(()=>{this.#c(),this.#A=null},t0.SEARCH_DEBOUNCE_MS)}#B(){this.#u.value="",this.#u.focus(),this.#c()}#Y(t){let n=this.#$,i=n.getBoundingClientRect(),$=t.getBoundingClientRect(),u=$.top-i.top+n.scrollTop;$.topi.bottom&&(n.scrollTop=u-i.height+$.height)}#E(t,n=!0){if(this.#p?.classList.remove(y.HIGHLIGHT),t){if(t.classList.add(y.HIGHLIGHT),this.#d.countrySearch){let i=t.getAttribute("id")||"";this.#u.setAttribute(T.ACTIVE_DESCENDANT,i)}n&&this.#Y(t),this.#p=t}else this.#p=null}bindHiddenInputSubmitListener(t,n,i){let $=this.telInputEl.form;!$||!this.#l&&!this.#f||$.addEventListener("submit",()=>{this.#l&&(this.#l.value=n()),this.#f&&(this.#f.value=i())},{signal:t})}bindAllInitialCountrySelectorListeners(t,n,i){let $=this.telInputEl.closest("label");$&&$.addEventListener("click",u=>{this.isCountrySelectorOpen()?u.preventDefault():this.telInputEl.focus()},{signal:t}),this.#n.addEventListener("click",()=>{!this.isCountrySelectorOpen()&&!this.telInputEl.disabled&&!this.telInputEl.readOnly&&n()},{signal:t}),this.#t.addEventListener("keydown",u=>{let c=[F.ARROW_UP,F.ARROW_DOWN,F.SPACE,F.ENTER];!this.isCountrySelectorOpen()&&c.includes(u.key)&&(u.preventDefault(),u.stopPropagation(),n()),u.key===F.TAB&&i()},{signal:t})}openCountrySelector(t,n){let{countrySearch:i,dropdownAlwaysOpen:$}=this.#d;if(this.#v=new AbortController,this.#d.countrySelectorMode!==S.FULLSCREEN&&this.#$1(),this.ensureDropdownWidthSet(),this.#r)this.#x();else{let c=this.#G(),f=this.telInputEl.offsetHeight+Z.DROPDOWN_MARGIN;c?this.#i.style.top=`${f}px`:this.#i.style.bottom=`${f}px`}this.#i.classList.remove(y.HIDE),this.#n.setAttribute(T.EXPANDED,"true");let u=this.#m??this.#$.firstElementChild;u&&this.#E(u),i&&!$&&this.#u.focus(),this.#d.countrySelectorMode===S.FULLSCREEN&&this.#r&&window.visualViewport&&window.visualViewport.addEventListener("resize",()=>{this.#l1(),this.#p&&this.#Y(this.#p)},{signal:this.#v.signal}),this.#g.classList.add(y.ARROW_UP),this.#r1(t,n)}#r1(t,n){let i=this.#v.signal;this.#y(i),this.#Z(i,t),this.#d.dropdownAlwaysOpen||this.#k(i,n),this.#o1(i,t,n),this.#d.countrySearch&&this.#R(i),this.#d.countrySelectorMode===S.DROPDOWN&&this.#d.dropdownParent&&!c2&&document.addEventListener("scroll",n,{signal:i,capture:!0,passive:!0})}#y(t){this.#$.addEventListener("mouseover",n=>{let i=n.target?.closest(`.${y.COUNTRY_ITEM}`);i&&this.#E(i,!1)},{signal:t})}#Z(t,n){this.#$.addEventListener("click",i=>{let $=i.target?.closest(`.${y.COUNTRY_ITEM}`);$&&n($)},{signal:t})}#k(t,n){setTimeout(()=>{document.documentElement.addEventListener("click",i=>{this.#i.contains(i.target)||n()},{signal:t})},0)}#o1(t,n,i){let $="",u=null,c=f=>{[F.ARROW_UP,F.ARROW_DOWN,F.ENTER,F.ESC].includes(f.key)&&(f.preventDefault(),f.stopPropagation(),f.key===F.ARROW_UP||f.key===F.ARROW_DOWN?this.#_(f.key):f.key===F.ENTER&&!f.isComposing?n(this.#p):f.key===F.ESC&&(i(),this.#n.focus())),!this.#d.countrySearch&&Q.HIDDEN_SEARCH_CHAR.test(f.key)&&(f.stopPropagation(),u&&clearTimeout(u),$+=f.key.toLowerCase(),this.#z($),u=setTimeout(()=>{$=""},t0.HIDDEN_SEARCH_RESET_MS))};this.#n?.addEventListener("keydown",c,{signal:t}),this.#i?.addEventListener("keydown",c,{signal:t})}#R(t){this.#u.addEventListener("input",()=>this.#O(),{signal:t}),this.#a.addEventListener("click",()=>this.#B(),{signal:t})}#z(t){let n=a2(this.#I,this.#L,t);if(n){let i=this.#D.get(n.iso2);this.#E(i)}}#_(t){let n=t===F.ARROW_UP?this.#p?.previousElementSibling:this.#p?.nextElementSibling;!n&&this.#$.childElementCount>1&&(n=t===F.ARROW_UP?this.#$.lastElementChild:this.#$.firstElementChild),n&&this.#E(n)}#F(t){if(this.#m&&this.#m.dataset[q.ISO2]!==t&&(this.#m.setAttribute(T.SELECTED,"false"),this.#m.querySelector(".iti__country-check")?.remove(),this.#m=null),t&&!this.#m){let n=this.#$.querySelector(`[data-iso2="${t}"]`);n&&(n.setAttribute(T.SELECTED,"true"),b("span",{class:this.#s("countryCheck","iti__country-check"),[T.HIDDEN]:"true"},n).appendChild(o2()),this.#m=n,this.#d.dropdownAlwaysOpen&&this.#E(n))}}#S(t){this.#$.replaceChildren();let n=!0;for(let i of t){let $=this.#D.get(i.iso2);$&&(this.#$.appendChild($),n&&(this.#E($,!1),n=!1))}n?(this.#E(null),this.#N&&this.#N.classList.remove(y.HIDE)):this.#N&&this.#N.classList.add(y.HIDE),this.#$.scrollTop=0,this.#j()}closeCountrySelector(){let{countrySearch:t}=this.#d;this.#v.abort(),this.#v=null,this.#i.classList.add(y.HIDE),this.#n.setAttribute(T.EXPANDED,"false"),t&&(this.#u.removeAttribute(T.ACTIVE_DESCENDANT),this.#u.value="",this.#c(),this.#p&&(this.#p.classList.remove(y.HIGHLIGHT),this.#p=null)),this.#g.classList.remove(y.ARROW_UP),this.#r?(this.#r.remove(),this.#r.style.top="",this.#r.style.bottom="",this.#r.style.paddingLeft="",this.#r.style.paddingRight=""):(this.#i.style.top="",this.#i.style.bottom="")}#G(){if(this.#d.dropdownAlwaysOpen)return!0;let t=this.telInputEl.getBoundingClientRect(),n=t.top,i=window.innerHeight-t.bottom;return i>=this.#M||i>=n}#x(){let t=this.#d.countrySelectorMode===S.FULLSCREEN,n=this.#V();if(t){if(window.innerWidth>=Z.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 this.#X();if(!t&&!c2){let i=this.telInputEl.getBoundingClientRect();this.#r.style.left=`${i.left}px`,this.#G()?this.#r.style.top=`${i.bottom+Z.DROPDOWN_MARGIN}px`:(this.#r.style.top="unset",this.#r.style.bottom=`${window.innerHeight-i.top+Z.DROPDOWN_MARGIN}px`)}n.appendChild(this.#r)}#X(){if(this.#H)return;this.#H=!0;let t=`--iti-anchor-${this.#e}`,n=getComputedStyle(this.telInputEl).anchorName;this.telInputEl.style.anchorName=n&&n!=="none"?`${n}, ${t}`:t,this.#r.style.positionAnchor=t}#l1(){let t=window.visualViewport;if(!t||!this.#r)return;let n=window.innerHeight-t.height;this.#r.style.bottom=`${n}px`}isCountrySelectorOpen(){return!this.#i.classList.contains(y.HIDE)}setLoading(t){this.#h.classList.toggle(y.LOADING,t)}playStrictRejectAnimation(){if(!this.#d.strictRejectAnimation)return;let t=this.telInputEl.parentElement;t&&(t.classList.remove(y.STRICT_REJECT_ANIMATION),t.offsetWidth,t.classList.add(y.STRICT_REJECT_ANIMATION),t.addEventListener("animationend",()=>t.classList.remove(y.STRICT_REJECT_ANIMATION),{once:!0}))}isLoading(){return this.#h.classList.contains(y.LOADING)}setDisabled(t){this.telInputEl.disabled=t,this.#n&&(t?this.#n.setAttribute("disabled","true"):this.#n.removeAttribute("disabled"))}setReadonly(t){this.telInputEl.readOnly=t,this.#n&&(t?this.#n.setAttribute("disabled","true"):this.#n.removeAttribute("disabled"))}setSelectedCountry(t){let{countrySelectorMode:n,showFlags:i,separateDialCode:$,uiTranslations:u}=this.#d,c=t?.name,f=t?.dialCode,g=t?.iso2??"";if(n!==S.OFF&&this.#F(g),this.#n){let I=this.#s("selectedFlag",g&&i?`${y.FLAG} iti__${g}`:`${y.FLAG} ${y.GLOBE}`),L,v,O=null;g?(v=c,L=u.selectedCountryAriaLabel.replace("${countryName}",c).replace("${dialCode}",`+${f}`),i||(O=r0())):(v=u.noCountrySelected,L=u.noCountrySelected,O=r0()),this.#h.className=I,this.#n.setAttribute("title",v),this.#n.setAttribute(T.LABEL,L),O?this.#h.replaceChildren(O):this.#h.replaceChildren()}if($){let I=f?`+${f}`:"";this.#o.textContent=I,this.#U()}}destroy(){this.telInputEl.iti=void 0,delete this.telInputEl.dataset[q.INSTANCE_ID],this.#w?.disconnect(),this.telInputEl.style.paddingLeft=this.#C;let t=this.telInputEl.parentNode;t&&(t.before(this.telInputEl),t.remove()),this.#D.clear()}};var h2=r=>{let{onlyCountries:t,excludeCountries:n}=r;return t?.length?f1.filter(i=>t.includes(i.iso2)):n?.length?f1.filter(i=>!n.includes(i.iso2)):[...f1]},f2=(r,t)=>{let{countryNameLocale:n,countryNameOverrides:i,uiTranslations:$}=t,u=$?.countryNames,c;try{typeof Intl<"u"&&typeof Intl.DisplayNames=="function"?c=new Intl.DisplayNames(n,{type:"region"}):c=null}catch(f){console.error(f),c=null}for(let f of r)f.name=i[f.iso2]||u?.[f.iso2]||c?.of(f.iso2.toUpperCase())||""},p2=r=>{let t=new Set,n=0,i={},$=(c,f)=>{if(!c||!f)return;f.length>n&&(n=f.length),Object.hasOwn(i,f)||(i[f]=[]);let g=i[f];g.includes(c)||g.push(c)},u=[...r].sort((c,f)=>c.priority-f.priority);for(let c of u){t.has(c.dialCode)||t.add(c.dialCode);for(let f=1;f{let{countryOrder:n}=t;r.sort((i,$)=>{if(n){let u=n.indexOf(i.iso2),c=n.indexOf($.iso2),f=u>-1,g=c>-1;if(f||g)return f&&g?u-c:f?-1:1}return i.name.localeCompare($.name)})};var td=new Set(["800","808","870","881","882","883","888","979"]),l0=r=>{let t=z(r).slice(0,3);return r.startsWith("+")&&td.has(t)};var u0=(r,t,n,i)=>{if(!n||!t)return r;let $=`+${i.dialCode}`,u=r[$.length]===" "||r[$.length]==="-"?$.length+1:$.length;return r.substring(u)},m2=(r,t,n,i,$)=>{let u=n?n.formatNumberAsYouType(r,i?.iso2):r,c=i?.dialCode;return $&&t.charAt(0)!=="+"&&u.includes(`+${c}`)?(u.split(`+${c}`)[1]||"").trim():u};var C2=(r,t,n,i)=>{if(n===0&&!i)return 0;let $=0;for(let u=0;u{let t=z(r);if(t.startsWith(H1.NANP)&&t.length>=4){let n=t.substring(1,4);return ed.has(n)}return!1};var nd=0,C1=r=>{if(!C.utils)throw new Error(`intlTelInput.utils is required for ${r}(). See: https://intl-tel-input.com/docs/utils`)},E2=()=>{let r,t;return{promise:new Promise((i,$)=>{r=i,t=$}),resolve:r,reject:t}},v1=class r{id;promise;#d;#e;#T;#C;#I;#L;#A;#M;#H;#t=null;#n=null;#h;#o=!0;#g;#i;#b=!1;#u=null;#a;#$;constructor(t,n={}){this.id=nd++,m1.validateInput(t);let i=n2(n);this.#e={...G1,...i},i2(this.#e),s2(this.#e),this.#d=new m1(t,this.#e,this.id),this.#T=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),this.#i=new g1(t.value),this.promise=this.#N(this.#e),this.#C=h2(this.#e);let{dialCodes:$,dialCodeMaxLength:u,dialCodeToIso2Map:c}=p2(this.#C);this.#A=$,this.#I=u,this.#L=c,this.#M=new Map(this.#C.map(f=>[f.iso2,f])),this.#W()}#l(){let t=this.#d.telInputEl.value.trim();return this.#i.normalise(t)}#f(t){this.#d.telInputEl.value=this.#i.denormalise(t)}#N(t){let{initialCountry:n,initialCountryLookup:i,loadUtils:$}=t,u=!n&&!!i,c=!!$&&!C.utils;return u&&(this.#a=E2()),c&&(this.#$=E2()),Promise.all([this.#a?.promise,this.#$?.promise]).then(()=>{})}#W(){this.#g=new AbortController,this.#r(),this.#d.buildMarkup(this.#C,this.#H),this.#m(),this.#p(),this.#D(),this.#e.dropdownAlwaysOpen&&this.openCountrySelector()}#r(){f2(this.#C,this.#e),g2(this.#C,this.#e),this.#H=l2(this.#C)}#m(t=!1){let n=this.#d.telInputEl.getAttribute("value"),i=this.#i.normalise(n??""),$=this.#l(),c=i&&i.startsWith("+")&&(!$||!$.startsWith("+"))?i:$,f=this.#_(c),g=a0(c),{initialCountry:I,initialCountryLookup:L}=this.#e,v=!I&&!!L,O=v&&C.autoCountry?C.autoCountry:I,G=v&&!t&&!C.autoCountry,U=u1(O);f?g?U?this.#y(O):G||this.#y(J0.ISO2):(U&&this.#y(O),this.#B(c)):U?this.#y(O):G||this.#y(""),c&&this.#O(c)}#p(){this.#J(),this.#e.countrySelectorMode!==S.OFF&&this.#d.bindAllInitialCountrySelectorListeners(this.#g.signal,()=>this.openCountrySelector(),()=>this.#R()),this.#d.bindHiddenInputSubmitListener(this.#g.signal,()=>this.getNumber(),()=>this.#t?.iso2||"")}#D(){if(this.#$){let{loadUtils:t}=this.#e,n=()=>{C.attachUtils(t).catch(()=>{})};C.documentReady()?n():window.addEventListener("load",n,{signal:this.#g.signal})}this.#a&&(this.#t?this.#a.resolve():this.#v())}async#v(){if(C.autoCountry){this.#X();return}if(this.#d.setLoading(!0),!C.startedLoadingAutoCountry&&(C.startedLoadingAutoCountry=!0,typeof this.#e.initialCountryLookup=="function")){let t;try{let n=await Promise.race([this.#e.initialCountryLookup(),new Promise(($,u)=>{t=setTimeout(()=>u(new Error("intl-tel-input: initialCountryLookup timed out after 10s")),1e4)})]),i=typeof n=="string"?n.toLowerCase():"";if(!u1(i)){C.startedLoadingAutoCountry=!1,r.forEachInstance("handleAutoCountryFailure");return}C.autoCountry=i,setTimeout(()=>r.forEachInstance("handleAutoCountryLoaded"))}catch{C.startedLoadingAutoCountry=!1,r.forEachInstance("handleAutoCountryFailure")}finally{t!==void 0&&clearTimeout(t)}}}#w(){this.openCountrySelector(),this.#d.prefillSearchWithPlus()}#s(t){let n=this.#d.telInputEl.selectionStart||0,i=t.substring(0,n-1),$=t.substring(n);return this.#f(i+$),n-1}#J(){this.#t1(),this.#n1(),this.#i1()}#Q(t){this.#s(t),this.#w()}#q(t,n){let i=this.#s(t);this.#d.telInputEl.setSelectionRange(i,i),this.#d.playStrictRejectAnimation(),this.#c(Y.STRICT_REJECT,{source:"key",rejectedInput:n,reason:"invalid"})}#V(t,n){let i=this.#d.telInputEl.selectionStart||0,u=t.substring(0,i).replace(Q.NON_PLUS_NUMERIC_GLOBAL,"").length,c=this.#S(),f=m2(c,t,C.utils,this.#t,this.#e.separateDialCode),g=C2(u,f,i,n);this.#f(f),this.#d.telInputEl.setSelectionRange(g,g)}#d1(t){if(t.startsWith("+")&&this.#t&&this.#_(t)){let n=u0(t,!0,!0,this.#t);this.#f(n)}}#t1(){this.#b=Q.ALPHA_UNICODE.test(this.#l()),this.#d.telInputEl.addEventListener("input",this.#e1,{signal:this.#g.signal})}#e1=t=>{let{strictMode:n,formatAsYouType:i,separateDialCode:$,countrySelectorMode:u,countrySearch:c}=this.#e,f=t?.detail;if(f?.isCountryChange)return;let g=this.#l(),I=t?.inputType===d0.PASTE,L=n&&I;if(this.#T&&!I&&t?.data==="+"&&$&&u!==S.OFF&&c){this.#Q(g);return}if(this.#T&&!I&&n&&(t?.data===" "||t?.data==="-"||t?.data===".")){this.#q(g,t.data);return}if(L){if(this.#$1())return;g=this.#l()}this.#B(g)&&(this.#x(),this.#c(Y.INPUT,{isCountryChange:!0})),!L&&t?.data&&Q.NON_PLUS_NUMERIC.test(t.data)||I&&g&&!n?this.#b=!0:Q.NON_PLUS_NUMERIC.test(g)||(this.#b=!1),i&&!this.#b&&!f?.isSetNumber&&this.#i.isAscii()&&this.#V(g,t?.inputType===d0.DELETE_FORWARD),$&&this.#d1(g)};#n1(){let{strictMode:t,separateDialCode:n}=this.#e;!t&&!n||this.#d.telInputEl.addEventListener("keydown",this.#U,{signal:this.#g.signal})}#U=t=>{let{strictMode:n,separateDialCode:i,countrySelectorMode:$,countrySearch:u}=this.#e;if(!t.key||t.key.length!==1||t.altKey||t.ctrlKey||t.metaKey)return;if(i&&$!==S.OFF&&u&&t.key==="+"){t.preventDefault(),this.#w();return}if(!n)return;let c=this.#l(),g=!c.startsWith("+")&&this.#d.telInputEl.selectionStart===0&&t.key==="+",I=this.#i.normalise(t.key),L=/^[0-9]$/.test(I),v=i?L:g||L,O=this.#d.telInputEl,G=O.selectionStart,U=O.selectionEnd,M=c.slice(0,G??void 0),A=c.slice(U??void 0),_=M+I+A,j=this.#F(_),X=z(j).length>e0;!X&&C.utils&&this.#n&&(X=C.utils.getCoreNumber(j,this.#t?.iso2).length>this.#n);let J=this.#E(j)!==null;(!v||X&&!J&&!g)&&(this.#d.playStrictRejectAnimation(),this.#c(Y.STRICT_REJECT,{source:"key",rejectedInput:t.key,reason:v?"max-length":"invalid"}),t.preventDefault())};#i1(){this.#e.strictMode&&this.#d.telInputEl.addEventListener("paste",this.#s1,{signal:this.#g.signal})}#s1=t=>{let n=this.#d.telInputEl,i=this.#l();this.#u={pastedRaw:t.clipboardData?.getData("text")??"",value:i,selectionStart:n.selectionStart??i.length,selectionEnd:n.selectionEnd??i.length}};#$1(){let t=this.#d.telInputEl,n=this.#u;if(this.#u=null,!n)return!1;let i=n.pastedRaw,$=n.value,u=n.selectionStart,c=n.selectionEnd,f=$.slice(0,u),g=$.slice(c),I=this.#t?.iso2,L=this.#i.normalise(i),v=u===0&&c>0,O=!$.startsWith("+")||v,G=L.replace(Q.NON_PLUS_NUMERIC_GLOBAL,""),U=G.startsWith("+"),M=G.replace(/\+/g,""),A=U&&O?`+${M}`:M,_=f+A+g,j=A!==L?"invalid":null;if(_.length>30)return this.#P(n),!0;let X=z(this.#F(_)).length-e0;if(X>0){if(c!==$.length)return this.#P(n),!0;_=_.slice(0,_.length-X),j="max-length"}if(this.#n&&_.length>5&&C.utils){let J=C.utils.getCoreNumber(_,I);for(;J.length===0&&_.length>0;)_=_.slice(0,-1),J=C.utils.getCoreNumber(_,I);if(!J)return this.#P(n),!0;if(J.length>this.#n)if(c===$.length){let P=J.length-this.#n;_=_.slice(0,_.length-P),j="max-length"}else return this.#P(n),!0}this.#f(_);let E1=u+A.length;return t.setSelectionRange(E1,E1),j&&(L.length>0&&A.length===0&&this.#d.playStrictRejectAnimation(),this.#c(Y.STRICT_REJECT,{source:"paste",rejectedInput:i,reason:j})),!1}#P(t){this.#d.playStrictRejectAnimation(),this.#c(Y.STRICT_REJECT,{source:"paste",rejectedInput:t.pastedRaw,reason:"max-length"}),this.#j(t)}#j(t){this.#f(t.value),this.#d.telInputEl.setSelectionRange(t.selectionStart,t.selectionEnd)}#K(t){let n=Number(this.#d.telInputEl.getAttribute("maxlength"));return n&&t.length>n?t.substring(0,n):t}#c(t,n={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});this.#d.telInputEl.dispatchEvent(i)}openCountrySelector(){this.#d.isCountrySelectorOpen()||(this.#d.openCountrySelector(t=>this.#o1(t),()=>this.#R()),this.#c(Y.OPEN_COUNTRY_SELECTOR))}#O(t){let{numberDisplayFormat:n,separateDialCode:i}=this.#e,$=t;if(C.utils&&this.#t){let u=l0(t),c=!$.startsWith("+")&&!i,f=n===w.NATIONAL&&!u||c,g;f?g=w.NATIONAL:n===w.E164&&!u?g=w.E164:g=w.INTERNATIONAL,$=C.utils.formatNumber($,this.#t?.iso2,g)}$=this.#G($),this.#f($)}#B(t){let n=this.#E(t);return n!==null?this.#y(n):!1}#Y(t){let n=this.#t?.dialCode,i=this.#t?.nationalPrefix;if(t.startsWith("+")||!n)return t;let c=i&&t.startsWith(i)&&!this.#e.separateDialCode?t.substring(1):t;return`+${n}${c}`}#E(t){let n=t.indexOf("+"),i=n>0?t.substring(n):t,$=this.#t?.iso2;i=this.#Y(i);let u=this.#_(i,!0),c=z(i);if(u){let f=z(u),g=this.#L[f];return g.length===1?g[0]===$?null:g[0]:this.#r1(g,f,c)}else if(i.startsWith("+")&&c.length){let f=this.#t?.dialCode||"";return f&&f.startsWith(c)||!$?null:""}else if((!i||i==="+")&&!$&&this.#h)return this.#h;return null}#r1(t,n,i){let $=this.#t?.iso2,u=this.#t?.dialCode;if(!$&&this.#h&&t.includes(this.#h))return this.#h;if(u===H1.NANP&&a0(i))return null;let f=this.#t?.areaCodes,g=this.#t?.priority;if(f){let G=f.map(U=>`${u}${U}`);for(let U of G)if(i.startsWith(U))return null}let L=f&&!(g===0)&&i.length>n.length,v=$&&t.includes($)&&!L,O=$===t[0];return!v&&!O?t[0]:null}#y(t){let n=this.#t?.iso2||"";return this.#t=t?this.#M.get(t):null,this.#t&&(this.#h=this.#t.iso2),this.#d.setSelectedCountry(this.#t),this.#k(),this.#Z(),n!==t}#Z(){let{strictMode:t,placeholderNumberType:n,allowedNumberTypes:i}=this.#e;if(!t||!C.utils)return;let $=this.#t?.iso2;if(!$){this.#n=null;return}let u=C.utils.getExampleNumber($,n,w.E164),c=u;for(;C.utils.isValidNumber(u,$,i);)c=u,u+="0";let f=C.utils.getCoreNumber(c,$);this.#n=f.length,$==="by"&&(this.#n=f.length+1)}#k(){let{placeholderNumberPolicy:t,placeholderNumberType:n,numberDisplayFormat:i,customPlaceholder:$}=this.#e,u=t===s1.AGGRESSIVE||!this.#d.hadInitialPlaceholder&&t===s1.POLITE;if(!C.utils||!u)return;let c=this.#t?C.utils.getExampleNumber(this.#t.iso2,n,i):"";c=this.#G(c),typeof $=="function"&&(c=$(c,this.#t)),this.#d.telInputEl.setAttribute("placeholder",c)}#o1(t){if(!t)return;let n=t.dataset[q.ISO2],i=this.#y(n);this.#R();let $=t.dataset[q.DIAL_CODE];this.#z($);let u=this.#l();this.#O(u),this.#d.telInputEl.focus(),i&&(this.#x(),this.#c(Y.INPUT,{isCountryChange:!0}))}closeCountrySelector(){this.#R()}#R(t){!this.#d.isCountrySelectorOpen()||this.#e.dropdownAlwaysOpen&&!t||(this.#d.closeCountrySelector(),this.#c(Y.CLOSE_COUNTRY_SELECTOR))}#z(t){let n=this.#l();if(!n.startsWith("+"))return;let i=`+${t}`,$=this.#_(n),u;$?u=n.replace($,i):u=i,this.#f(u)}#_(t,n){if(!t.startsWith("+"))return"";let i="",$="",u=!1;for(let c=0;cf)return!1}}return this.#u1("possible")}isValidNumberPrecise(){return this.#o?(C1("isValidNumberPrecise"),this.#u1("precise")):null}#u1(t){let{allowNumberExtensions:n,allowPhonewords:i,allowedNumberTypes:$}=this.#e,u=this.#t?.iso2,c=this.#S();return!this.#t&&!l0(c)||!(t==="precise"?C.utils.isValidNumberPrecise:C.utils.isValidNumber)(c,u,$)?!1:Q.ALPHA_UNICODE.test(c)?!!C.utils.getExtension(c,u)?n:i:!0}setSelectedCountry(t){if(!this.#o)return;let n=t?.toLowerCase();if(!u1(n))throw new Error(`Invalid iso2 code: '${n}'`);let i=this.#t?.iso2;if(!(t&&n!==i||!t&&i))return;this.#y(n),this.#z(this.#t?.dialCode||"");let u=this.#l();this.#O(u),this.#x(),this.#c(Y.INPUT,{isCountryChange:!0})}setNumber(t){if(!this.#o)return;let n=this.#i.normalise(t),i=this.#B(n);this.#O(n),i&&this.#x(),this.#c(Y.INPUT,{isSetNumber:!0})}setPlaceholderNumberType(t){this.#o&&(this.#e.placeholderNumberType=t,this.#k())}setDisabled(t){this.#o&&this.#d.setDisabled(t)}setReadonly(t){this.#o&&this.#d.setReadonly(t)}static forEachInstance(t,...n){let i=[...C.instances.values()],$=n[0];i.forEach(u=>{if(u instanceof r)switch(t){case"handleUtilsLoaded":u.#a1();break;case"handleUtilsFailure":u.#c1($);break;case"handleAutoCountryLoaded":u.#X();break;case"handleAutoCountryFailure":u.#l1();break}})}},id=async r=>{if(C.utils||C.startedLoadingUtils)return null;if(typeof r!="function")throw new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof r}`);C.startedLoadingUtils=!0;try{let n=(await r())?.default;if(!n||typeof n!="object")throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");return C.utils=n,v1.forEachInstance("handleUtilsLoaded"),!0}catch(t){throw v1.forEachInstance("handleUtilsFailure",t),t}},C=Object.assign((r,t)=>{let n=new v1(r,t);return C.instances.set(String(n.id),n),r.iti=n,n},{defaults:G1,documentReady:()=>document.readyState==="complete",getAllCountries:()=>f1,getInstance:r=>{let t=r.dataset[q.INSTANCE_ID];return t?C.instances.get(t)??null:null},instances:new Map,attachUtils:id,startedLoadingUtils:!1,startedLoadingAutoCountry:!1,version:"29.2.3",NUMBER_FORMAT:w,NUMBER_TYPE:a1,VALIDATION_ERROR:n0,PLACEHOLDER_POLICY:s1,COUNTRY_SELECTOR_MODE:S}),c0=C;var y2={};(function(){var r=this||self;function t(d,e){d=d.split(".");var s=r;d[0]in s||typeof s.execScript>"u"||s.execScript("var "+d[0]);for(var o;d.length&&(o=d.shift());)d.length||e===void 0?s[o]&&s[o]!==Object.prototype[o]?s=s[o]:s=s[o]={}:s[o]=e}function n(d,e){function s(){}s.prototype=e.prototype,d.na=e.prototype,d.prototype=new s,d.prototype.constructor=d,d.ta=function(o,l,a){for(var h=Array(arguments.length-2),p=2;p0)?d:e;if(!d.o)return e;if(d=d.u,d===String){if(typeof e=="number")return String(e)}else if(d===Number&&typeof e=="string"&&(e==="Infinity"||e==="-Infinity"||e==="NaN"||p0.test(e)))return Number(e);return e};var p0=/^-?[0-9]+$/;function W1(){}n(W1,R1),W1.prototype.g=function(d,e){return d=new d.h,d.l=this,d.h=e,d.g={},d};function y1(){}n(y1,W1),y1.prototype.h=function(d,e){return d.h==8?!!e:R1.prototype.h.apply(this,arguments)},y1.prototype.g=function(d,e){return y1.na.g.call(this,d,e)};function H(d,e){d!=null&&this.g.apply(this,arguments)}H.prototype.h="",H.prototype.set=function(d){this.h=""+d},H.prototype.g=function(d,e,s){if(this.h+=String(d),e!=null)for(let o=1;o0&&D(d,1)&&m(d,6)==20&&e==0)return d=N(d,1),j1(d,e,s,"");if(s.length>0||!D(d,1))return s}s=N(d,1);var o=N1(d);if(e==0)return j1(s,0,o,"");if(!(s in I1))return o;var l=T1(this,s,L1(s));d=D(d,3)&&m(d,3).length!=0?e==3?";ext="+m(d,3):D(l,13)?m(l,13)+N(d,3):" ext. "+N(d,3):"";d:{l=(W(l,20)||[]).length==0||e==2?W(l,19)||[]:W(l,20)||[];for(var a,h=l.length,p=0;p0?o.replace(a,l.replace(D2,h)):o.replace(a,l),e==3&&(o=o.replace(RegExp("^[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+"),""),o=o.replace(RegExp("[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+","g"),"-"))),j1(s,e,o,d)};function T1(d,e,s){return s=="001"?i1(d,""+e):i1(d,s)}function N1(d){if(!D(d,2))return"";var e=""+m(d,2);return D(d,4)&&m(d,4)&&N(d,8)>0?Array(N(d,8)+1).join("0")+e:e}function j1(d,e,s,o){switch(e){case 0:return"+"+d+s+o;case 1:return"+"+d+" "+s+o;case 3:return"tel:+"+d+"-"+s+o;default:return s+o}}function D1(d,e){switch(e){case 4:return m(d,5);case 3:return m(d,4);case 1:return m(d,3);case 0:case 2:return m(d,2);case 5:return m(d,6);case 6:return m(d,8);case 7:return m(d,7);case 8:return m(d,21);case 9:return m(d,25);case 10:return m(d,28);default:return m(d,1)}}function O0(d,e){var s=R0(d,e);return d=T1(d,N(e,1),s),d==null?-1:(e=N1(e),K1(e,d))}function K1(d,e){return K(d,m(e,1))?K(d,m(e,5))?4:K(d,m(e,4))?3:K(d,m(e,6))?5:K(d,m(e,8))?6:K(d,m(e,7))?7:K(d,m(e,21))?8:K(d,m(e,25))?9:K(d,m(e,28))?10:K(d,m(e,2))?m(e,18)||K(d,m(e,3))?2:0:!m(e,18)&&K(d,m(e,3))?1:-1:-1}function i1(d,e){if(e==null)return null;e=e.toUpperCase();var s=d.g[e];if(s==null){if(s=y0[e],s==null)return null;s=new y1().g(r1.m(),s),d.g[e]=s}return s}function K(d,e){var s=d.length;return e1(e,9)>0&&c1(e).indexOf(s)==-1?!1:d1(N(e,2),d)}function P2(d,e){var s=R0(d,e),o=N(e,1),l=T1(d,o,s);return l==null||s!="001"&&o!=_0(d,s)?l=!1:(d=N1(e),l=K1(d,l)!=-1),l}function R0(d,e){if(e==null)return null;var s=N(e,1);if(s=I1[s],s==null)d=null;else if(s.length==1)d=s[0];else d:{e=N1(e);for(var o,l=s.length,a=0;a-1?4:(s=a[0],s==e?0:s>e?2:a[a.length-1]-1?0:5))}function P1(d,e,s){var o=N1(e);return e=N(e,1),e in I1?(e=T1(d,e,L1(e)),w1(d,o,e,s)):1}function M0(d,e){if(d=d.toString(),d.length==0||d.charAt(0)=="0")return 0;for(var s,o=d.length,l=1;l<=3&&l<=o;++l)if(s=parseInt(d.substring(0,l),10),s in I1)return e.g(d.substring(l)),s;return 0}function D0(d,e,s,o,l,a){if(e.length==0)return 0;e=new H(e);var h;s!=null&&(h=m(s,11)),h==null&&(h="NonMatch");var p=e.toString();if(p.length==0)h=20;else if(S1.test(p))p=p.replace(S1,""),V(e),e.g(L0(p)),h=1;else{if(p=new RegExp(h),A0(e),h=e.toString(),h.search(p)==0){p=h.match(p)[0].length;var E=h.substring(p).match(I0);E&&E[1]!=null&&E[1].length>0&&_1(E[1],V1)=="0"?h=!1:(V(e),e.g(h.substring(p)),h=!0)}else h=!1;h=h?5:20}if(l&&B(a,6,h),h!=20){if(e.h.length<=2)throw Error("Phone number too short after IDD");if(d=M0(e,o),d!=0)return B(a,1,d),d;throw Error("Invalid country calling code")}return s!=null&&(h=N(s,10),p=""+h,E=e.toString(),E.lastIndexOf(p,0)==0&&(p=new H(E.substring(p.length)),E=m(s,1),E=new RegExp(N(E,2)),w0(p,s,null),p=p.toString(),!d1(E,e.toString())&&d1(E,p)||w1(d,e.toString(),s,-1)==3))?(o.g(p),l&&B(a,6,10),B(a,1,h),h):(B(a,1,0),0)}function w0(d,e,s){var o=d.toString(),l=o.length,a=m(e,15);if(l!=0&&a!=null&&a.length!=0&&(a=new RegExp("^(?:"+a+")"),l=a.exec(o))){var h=RegExp,p=m(e,1);p=N(p,2),h=new h(p),p=d1(h,o);var E=l.length-1;e=m(e,16),e==null||e.length==0||l[E]==null||l[E].length==0?(!p||d1(h,o.substring(l[0].length)))&&(s!=null&&E>0&&l[E]!=null&&s.g(l[1]),d.set(o.substring(l[0].length))):(o=o.replace(a,e),(!p||d1(h,o))&&(s!=null&&E>0&&s.g(l[1]),d.set(o)))}}function o1(d,e,s){if(!M1(s)&&e.length>0&&e.charAt(0)!="+")throw Error("Invalid country calling code");return P0(d,e,s,!0)}function P0(d,e,s,o){if(e==null)throw Error("The string supplied did not seem to be a phone number");if(e.length>250)throw Error("The string supplied is too long to be a phone number");var l=new H,a=e.indexOf(";phone-context=");if(a===-1)a=null;else if(a+=15,a>=e.length)a="";else{var h=e.indexOf(";",a);a=h!==-1?e.substring(a,h):e.substring(a)}var p=a;if(p==null?h=!0:p.length===0?h=!1:(h=R2.exec(p),p=_2.exec(p),h=h!==null||p!==null),!h||(a!=null?(a.charAt(0)==="+"&&l.g(a),a=e.indexOf("tel:"),l.g(e.substring(a>=0?a+4:0,e.indexOf(";phone-context=")))):(a=l.g,h=e??"",p=h.search(A2),p>=0?(h=h.substring(p),h=h.replace(v2,""),p=h.search(b2),p>=0&&(h=h.substring(0,p))):h="",a.call(l,h)),a=l.toString(),h=a.indexOf(";isub="),h>0&&(V(l),l.g(a.substring(0,h))),!N0(l.toString())))throw Error("The string supplied did not seem to be a phone number");if(a=l.toString(),!(M1(s)||a!=null&&a.length>0&&S1.test(a)))throw Error("Invalid country calling code");a=new n1,o&&B(a,5,e);d:{if(e=l.toString(),h=e.search(T0),h>=0&&N0(e.substring(0,h))){p=e.match(T0);for(var E=p.length,t1=1;t10){V(l),l.g(e.substring(0,h)),e=p[t1];break d}}e=""}e.length>0&&B(a,3,e),h=i1(d,s),e=new H,p=0,E=l.toString();try{p=D0(d,E,h,e,o,a)}catch(X1){if(X1.message=="Invalid country calling code"&&S1.test(E)){if(E=E.replace(S1,""),p=D0(d,E,h,e,o,a),p==0)throw X1}else throw X1}if(p!=0?(l=L1(p),l!=s&&(h=T1(d,p,l))):(A0(l),e.g(l.toString()),s!=null?(p=N(h,10),B(a,1,p)):o&&(delete a.h[6],a.g&&delete a.g[6])),e.h.length<2||(h!=null&&(s=new H,l=new H(e.toString()),w0(l,h,s),d=w1(d,l.toString(),h,-1),d!=2&&d!=4&&d!=5&&(e=l,o&&s.toString().length>0&&B(a,7,s.toString()))),o=e.toString(),d=o.length,d<2))throw Error("The string supplied is too short to be a phone number");if(d>17)throw Error("The string supplied is too long to be a phone number");if(o.length>1&&o.charAt(0)=="0"){for(B(a,4,!0),d=1;d0?(a.$.g(E),a=!0):a=!1,a)return d.ea=l,d.ia=H0.test(m(o,4)),d.ba=0,!0}return d.v=!1}function k0(d,e){for(var s=[],o=e.length-3,l=d.j.length,a=0;a0&&(e=d.g.toString(),V(d.g),d.g.g(d.o),d.g.g(e),e=d.h.toString(),s=e.lastIndexOf(d.o),V(d.h),d.h.g(e.substring(0,s))),d.o!=V0(d))return d.h.g(" "),F0(d)}return d.u.toString()}switch(d.da.h.length){case 0:case 1:case 2:return d.u.toString();case 3:if(j0(d))d.fa=!0;else return d.o=V0(d),Y1(d);default:return d.fa?(K0(d)&&(d.fa=!1),d.h.toString()+d.g.toString()):d.j.length>0?(e=Y0(d,e),s=G0(d),s.length>0?s:(k0(d,d.g.toString()),B0(d)?W0(d):d.v?x1(d,e):d.u.toString())):Y1(d)}}function F0(d){return d.v=!0,d.fa=!1,d.j=[],d.ba=0,V(d.$),d.ea="",Y1(d)}function G0(d){for(var e=d.g.toString(),s=d.j.length,o=0;o0&&d.h.toString().charAt(s-1)!=" "?d.h+" "+e:d.h+e}function Y1(d){var e=d.g.toString();if(e.length>=3){for(var s=d.aa&&d.o.length==0&&e1(d.l,20)>0?W(d.l,20)||[]:W(d.l,19)||[],o=s.length,l=0;l0&&v0(N(a,4))&&!m(a,6)&&!D(a,5)||(d.o.length!=0||d.aa||v0(N(a,4))||m(a,6))&&H2.test(N(a,2))&&d.j.push(a)}return k0(d,e),e=G0(d),e.length>0?e:B0(d)?W0(d):d.u.toString()}return x1(d,e)}function W0(d){var e=d.g.toString(),s=e.length;if(s>0){for(var o="",l=0;l0&&(d.aa=!0,s=o[0].length,d.h.g(e.substring(0,s)))),V(d.g),d.g.g(e.substring(s)),e.substring(0,s)}function j0(d){var e=d.da.toString(),s=new RegExp("^(?:\\+|"+m(d.l,11)+")");return s=e.match(s),s!=null&&s[0]!=null&&s[0].length>0?(d.aa=!0,s=s[0].length,V(d.g),d.g.g(e.substring(s)),V(d.h),d.h.g(e.substring(0,s)),e.charAt(0)!="+"&&d.h.g(" "),!0):!1}function K0(d){if(d.g.h.length==0)return!1;var e=new H,s=M0(d.g,e);return s==0?!1:(V(d.g),d.g.g(e.toString()),e=L1(s),e=="001"?d.l=i1(d.ha,""+s):e!=d.la&&(d.l=U0(d,e)),d.h.g(""+s).g(" "),d.o="",!0)}function Y0(d,e){var s=d.$.toString();if(s.substring(d.ba).search(d.ga)>=0){var o=s.search(d.ga);return e=s.replace(d.ga,e),V(d.$),d.$.g(e),d.ba=o,e.substring(0,d.ba+1)}return d.j.length==1&&(d.v=!1),d.ea="",d.u.toString()}let Z1={};["E164","INTERNATIONAL","NATIONAL","RFC3966"].forEach((d,e)=>{Z1[d]=e});let l1={};"FIXED_LINE MOBILE FIXED_LINE_OR_MOBILE TOLL_FREE PREMIUM_RATE SHARED_COST VOIP PERSONAL_NUMBER PAGER UAN VOICEMAIL UNKNOWN".split(" ").forEach((d,e)=>{l1[d]=e}),l1.UNKNOWN=-1;let z1={};"IS_POSSIBLE INVALID_COUNTRY_CODE TOO_SHORT TOO_LONG IS_POSSIBLE_LOCAL_ONLY INVALID_LENGTH".split(" ").forEach((d,e)=>{z1[d]=e});let Z0={};Object.keys(l1).forEach(d=>{Z0[l1[d]]=d});let z0={};Object.keys(z1).forEach(d=>{z0[z1[d]]=d});let X0=d=>{let e=[];return d.includes("FIXED_LINE_OR_MOBILE")?(d.includes("MOBILE")||e.push("MOBILE"),d.includes("FIXED_LINE")||e.push("FIXED_LINE")):(d.includes("MOBILE")||d.includes("FIXED_LINE"))&&e.push("FIXED_LINE_OR_MOBILE"),d.concat(e)};t("utils",{}),t("utils.formatNumberAsYouType",(d,e)=>{try{let s=d.replace(/[^+0-9]/g,""),o=new x2(e);e="";for(let l=0;l{try{let l=k.g(),a=o1(l,d,e);var o=P1(l,a,-1);return o==0||o==4?l.format(a,typeof s>"u"?0:Z1[s]):d}catch{return d}}),t("utils.getExampleNumber",(d,e,s)=>{try{let E=k.g();d:{var o=E,l=l1[e];if(M1(d)){var a=D1(i1(o,d),l);try{if(D(a,6)){var h=m(a,6),p=P0(o,h,d,!1);break d}}catch{}}p=null}return E.format(p,Z1[s])}catch{return""}}),t("utils.getExtension",(d,e)=>{try{var s=o1(k.g(),d,e);return m(s,3)}catch{return""}}),t("utils.getNumberType",(d,e)=>{try{let s=k.g(),o=o1(s,d,e),l=O0(s,o);return Z0[l]||null}catch{return null}}),t("utils.getValidationError",(d,e)=>{if(!e)return"INVALID_COUNTRY_CODE";try{let s=k.g(),o=o1(s,d,e),l=P1(s,o,-1);return z0[l]||null}catch(s){return s.message==="Invalid country calling code"?"INVALID_COUNTRY_CODE":d.length<=3||s.message==="Phone number too short after IDD"||s.message==="The string supplied is too short to be a phone number"?"TOO_SHORT":s.message==="The string supplied is too long to be a phone number"?"TOO_LONG":null}}),t("utils.isValidNumber",(d,e,s)=>{try{let o=k.g(),l=o1(o,d,e);if(s){let a=X0(s);for(let h of a)if(P1(o,l,l1[h])===0)return!0;return!1}return P1(o,l,-1)===0}catch{return!1}}),t("utils.isValidNumberPrecise",(d,e,s)=>{try{let o=k.g(),l=o1(o,d,e),a=P2(o,l);if(s){let h=X0(s).map(p=>l1[p]);return a&&h.includes(O0(o,l))}return a}catch{return!1}}),t("utils.getCoreNumber",(d,e)=>{try{var s=o1(k.g(),d,e);return m(s,2).toString()}catch{return""}})}).call(y2);var I2=y2.utils;c0.utils=I2;var sd=c0;return V2($d);})(); var intlTelInput = _factory.default;