vendor: 4,888 bytes, line 1
1import{p as I,b as he}from"./BSN3s4iL.js";import{n as ye,i as ve}from"./BD1gkGGt.js";import{B as be,Z as ge,m as S,U as Ce,s as we,_ as Se,o as f,c as h,L as E,$ as M,q as b,b as O,u as v,h as B,t as _,p as j,J as Oe,a0 as xe,F as ke,r as De,a1 as Be,a2 as H,I as L,l as Ie,j as T,y as $,a3 as _e,d as Me,Y as Te}from"./BOoPbIQF.js";const Ne=[["Afghanistan (â«Ø§ÙØºØ§ÙØ³ØªØ§Ùâ¬â)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (â«Ø§Ùجزائرâ¬â)","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua and Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia (ÕÕ¡ÕµÕ¡Õ½Õ¿Õ¡Õ¶)","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria (Ãsterreich)","at","43"],["Azerbaijan (AzÉrbaycan)","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain (â«Ø§ÙØ¨ØØ±ÙÙâ¬â)","bh","973"],["Bangladesh (বাà¦à¦²à¦¾à¦¦à§à¦¶)","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus (ÐелаÑÑÑÑ)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan (འà½à¾²à½´à½)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (ÐоÑна и ХеÑÑеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria (ÐÑлгаÑиÑ)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (ááááá»áá¶)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (ä¸å½)","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros (â«Ø¬Ø²Ø± اÙÙÙ
رâ¬â)","km","269"],["Congo (DRC) (République démocratique du Congo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte dâIvoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (ÎÏÏÏοÏ)","cy","357"],["Czech Republic (Äeská republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (â«Ù
صرâ¬â)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (á¡áá¥áá ááááá)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["Gibraltar","gi","350"],["Greece (Îλλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (馿¸¯)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ãsland)","is","354"],["India (à¤à¤¾à¤°à¤¤)","in","91"],["Indonesia","id","62"],["Iran (â«Ø§ÛراÙâ¬â)","ir","98"],["Iraq (â«Ø§ÙعراÙâ¬â)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel (â«×שר××â¬â)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan (æ¥æ¬)","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan (â«Ø§ÙأردÙâ¬â)","jo","962"],["Kazakhstan (ÐазаÑ
ÑÑан)","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (â«Ø§ÙÙÙÙØªâ¬â)","kw","965"],["Kyrgyzstan (ÐÑÑг
1ÑзÑÑан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (â«ÙØ¨ÙØ§Ùâ¬â)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (â«ÙÙØ¨Ùاâ¬â)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (æ¾³é)","mo","853"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (â«Ù
ÙØ±ÙتاÙÙØ§â¬â)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Ðонгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco (â«Ø§ÙÙ
غربâ¬â)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (áá¼ááºáá¬)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नà¥à¤ªà¤¾à¤²)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (ì¡°ì 민주주ì ì¸ë¯¼ ê³µíêµ)","kp","850"],["North Macedonia (СевеÑна ÐакедониÑа)","mk","389"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway (Norge)","no","47",0],["Oman (â«Ø¹ÙÙ
اÙâ¬â)","om","968"],["Pakistan (â«Ù¾Ø§Ú©Ø³ØªØ§Ùâ¬â)","pk","92"],["Palau","pw","680"],["Palestine (â«ÙÙØ³Ø·ÙÙâ¬â)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (â«Ùطرâ¬â)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (РоÑÑиÑ)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1",18,["869"]],["Saint Lucia","lc","1",19,["758"]],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1",20,["784"]],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and PrÃncipe (São Tomé e PrÃncipe)","st","239"],["Saudi Arabia (â«Ø§ÙÙ
Ù
ÙÙØ© Ø§ÙØ¹Ø±Ø¨ÙØ© Ø§ÙØ³Ø¹ÙØ¯ÙØ©â¬â)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (СÑбиÑа)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (ëí민êµ)","kr","82"],["South Sudan (â«Ø¬ÙÙØ¨ Ø§ÙØ³ÙداÙâ¬â)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (à·à·âර෠ලà¶à¶à·à·)","lk","94"],["Sudan (â«Ø§ÙØ³ÙØ¯Ø§Ùâ¬â)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1,["79"]],["Sweden (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (â«Ø³ÙØ±ÙØ§â¬â)","sy","963"],["Taiwan (å°ç£)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (à¹à¸à¸¢)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1",22,["868"]],["Tunisia (â«ØªÙÙØ³â¬â)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1",24,["340"]],["Uganda","ug","256"],["Ukraine (УкÑаÑна)","ua","380"],["United Arab Emirates (â«Ø§ÙØ¥Ù
ارات Ø§ÙØ¹Ø±Ø¨ÙØ© اÙÙ
ØªØØ¯Ø©â¬â)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (OÊ»zbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam (Viá»t Nam)","vn","84"],["Wallis and Futuna (Wallis-et-Futuna)","wf","681"],["Western Sahara (â«Ø§ÙØµØØ±Ø§Ø¡ Ø§ÙØºØ±Ø¨ÙØ©â¬â)","eh","212",1,["5288","5289"]],["Yemen (â«Ø§ÙÙÙ
Ùâ¬â)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Ã
land Islands","ax","358",1,["18"]]],Ve=Ne.map(([t,i,d,s=0,u=null])=>({name:t,iso2:i.toUpperCase(),dialCode:d,priority:s,areaCodes:u}));function Pe(){return fetch("https://ip2c.org/s").then(t=>t.text()).then(t=>{const i=(t||"").toString();if(!i||i[0]!=="1")throw new Error("unable to fetch the country");return i.substr(2,2)})}function Ae(t,i){if(t.setSelectionRange)t.focus(),t.setSelectionRange(i,i);else if("createTextRange"in t&&typeof t.createTextRange=="function"){const d=t.createTextRange();d.collapse(!0),d.moveEnd("character",i),d.moveStart("character",i),d.select()}}const Re=[{name:"allCountries",type:Array,default:Ve,description:"All countries that are used in <code>libphonenumber-js</code>, can be overridden by this prop",inDemo:!1},{name:"autoFormat",type:Boolean,default:!0,description:"Auto update the input to the formatted phone number when it's valid",inDemo:!0}
vendor: 4,522 bytes, line 1
1,{name:"customValidate",type:[Boolean,RegExp],default:!1,description:"Custom validation RegExp for input",inDemo:!1},{name:"defaultCountry",default:"",type:[String,Number],description:"Default country (by iso2 or dialCode), will override the country fetched from IP address of user",inDemo:!1},{name:"disabled",default:!1,type:Boolean,description:"Disable <code>vue-tel-input</code>, including the input & flag dropdown",inDemo:!1},{name:"autoDefaultCountry",default:!0,type:Boolean,description:"To fetch default country based on IP address of user",inDemo:!1},{name:"dropdownOptions",type:Object,description:"Options for dropdown, see below",inDemo:!1},{name:"dropdownOptions.ariaLabel",default:"Country Code Selector",type:String,description:"Aria label for the country code selector dropdown",inDemo:!1},{name:"dropdownOptions.disabled",default:!1,type:Boolean,description:"Disable dropdown",inDemo:!1},{name:"dropdownOptions.showDialCodeInList",default:!0,type:Boolean,description:"Show dial code in the dropdown list",inDemo:!0},{name:"dropdownOptions.showDialCodeInSelection",default:!1,type:Boolean,description:"Show dial code in the dropdown selection",inDemo:!0},{name:"dropdownOptions.showFlags",default:!0,type:Boolean,description:"Show flags in the dropdown selection and list",inDemo:!0},{name:"dropdownOptions.showSearchBox",default:!1,type:Boolean,description:"Show country search box",inDemo:!0},{name:"dropdownOptions.searchBoxPlaceholder",default:"",type:String,description:"Placeholder for the search box",inDemo:!1},{name:"dropdownOptions.tabindex",default:0,type:Number,description:"Native dropdown <code>tabindex</code> attribute",inDemo:!1},{name:"ignoredCountries",default:[],type:Array,description:"List of countries will NOT be shown on the dropdown",inDemo:!1},{name:"inputOptions",type:Object,description:"Options for input, see below",inDemo:!1},{name:"inputOptions.autocomplete",type:String,default:"on",description:"Native input <code>autocomplete</code> attribute",inDemo:!1},{name:"inputOptions.autofocus",type:Boolean,default:!1,description:"Native input <code>autofocus</code> attribute",inDemo:!1},{name:"inputOptions.aria-describedby",default:"",type:String,description:"Native input <code>aria-describedby</code> attribute",inDemo:!1},{name:"inputOptions.id",default:"",type:String,description:"Native input <code>id</code> attribute",inDemo:!1},{name:"inputOptions.inputmode",default:void 0,type:String,description:"Native input <code>inputmode</code> attribute",inDemo:!1},{name:"inputOptions.maxlength",default:25,type:Number,description:"Native input <code>maxlength</code> attribute",inDemo:!1},{name:"inputOptions.name",default:"telephone",type:String,description:"Native input <code>name</code> attribute",inDemo:!1},{name:"inputOptions.showDialCode",default:!1,type:Boolean,description:"Show dial code in input",inDemo:!1},{name:"inputOptions.placeholder",default:"Enter a phone number",type:String,description:"Placeholder for the input",inDemo:!1},{name:"inputOptions.readonly",default:!1,type:Boolean,description:"Native input <code>readonly</code> attribute",inDemo:!1},{name:"inputOptions.required",default:!1,type:Boolean,description:"Native input <code>required</code> attribute",inDemo:!1},{name:"inputOptions.tabindex",default:0,type:Number,description:"Native input <code>tabindex</code> attribute",inDemo:!1},{name:"inputOptions.type",default:"tel",type:String,description:"Native input <code>type</code> attribute",inDemo:!1},{name:"inputOptions.styleClasses",default:"",type:[String,Array,Object],description:"Custom classes for the <code>input</code>",inDemo:!1},{name:"invalidMsg",default:"",type:String,description:"",inDemo:!1},{name:"mode",default:"auto",type:String,description:"Allowed values: <code>'auto'</code> (Default set by phone), <code>'international'</code> (Format number with the dial code i.e. + 61), <code>'national'</code> (Format number without dial code i.e. 0321232)",inDemo:!0,options:["auto","national","international"]},{name:"onlyCountries",default:[],type:Array,description:"List of countries will be shown on the dropdown",inDemo:!1},{name:"preferredCountries",default:[],type:Array,description:"Preferred countries list, will be on top of the dropdown",inDemo:!1},{name:"styleClasses",default:"",type:[String,Array,Object],description:"Custom classes for the wrapper",inDemo:!1},{name:"validCharactersOnly",default:!1,type:Boolean,description:"Only allow valid characters in a phone number (will also verify in <code>mounted</code>
1, so phone number with invalid characters will be shown as an empty string)",inDemo:!1},{name:"strictValidation",default:!1,type:Boolean,description:"Use strict phone number validation with full metadata (libphonenumber-js/max). When false (default), uses minimal metadata for smaller bundle size. When true, validates phone number patterns more precisely but increases bundle size by ~145KB.",inDemo:!1}],ze=[...Re].reduce((t,i)=>{if(i.name.includes(".")){const[d,s]=i.name.split(".");t[d]?Object.assign(t[d],{[s]:i.default}):Object.assign(t,{[d]:{[s]:i.default}})}else Object.assign(t,{[i.name]:i.default});return t},{}),W={options:{...ze}};function c(t){const i=W.options[t];return typeof i>"u"?W.options[t]:i}function N(t){return t?.toLowerCase()}function V(t){return t?.toUpperCase()}let x=null,G=null;async function Fe(){return x||G||(G=ye(()=>import("./BZecZlUC.js"),[],import.meta.url).then(t=>(x=t.parsePhoneNumberFromString,x)),G)}function J(t,i,d=!1){return d?x?i?x(t,i):x(t):i?I(t,i):I(t):i?I(t,i):I(t)}function Q(){return x!==null}const Ee={beforeMount(t,i,d){if(typeof i.value!="function"){const s=d.context.name;let u=`[Vue-click-outside:] provided expression ${i.expression} is not a function, but has to be`;s&&(u+=`Found in component ${s}`)}t.clickOutsideEvent=function(s){const u=s.composedPath?s.composedPath():s.path;t===s.target||t.contains(s.target)||u.includes(t)||i.value(s,t)},document.body.addEventListener("click",t.clickOutsideEvent)},unmounted(t){document.body.removeEventListener("click",t.clickOutsideEvent)}},je=["aria-label","aria-expanded","tabindex"],Le={class:"vti__selection"},Ge={key:1,class:"vti__country-code"},qe={class:"vti__dropdown-arrow"},Ke={key:0,class:"vti__search_box_container"},Ue=["placeholder"],He=["onClick","onMousemove","aria-selected"],$e={key:1},We=["type","autocomplete","autofocus","inputmode","disabled","id","maxlength","name","placeholder","readonly","required","tabindex","value","aria-describedby"],Je=be({name:"VueTelInput",directives:{clickOutside:Ee},__name:"vue-tel-input",props:H({allCountries:{type:Array,default:()=>c("allCountries")},autoFormat:{type:Boolean,default:()=>c("autoFormat")},customValidate:{type:[Boolean,RegExp],default:()=>c("customValidate")},defaultCountry:{type:[String,Number],default:()=>c("defaultCountry")},disabled:{type:Boolean,default:()=>c("disabled")},autoDefaultCountry:{type:Boolean,default:()=>c("autoDefaultCountry")},dropdownOptions:{type:Object,default:()=>c("dropdownOptions")},ignoredCountries:{type:Array,default:()=>c("ignoredCountries")},inputOptions:{type:Object,default:()=>c("inputOptions")},invalidMsg:{type:String,default:()=>c("invalidMsg")},mode:{type:String,default:()=>c("mode")},onlyCountries:{type:Array,default:()=>c("onlyCountries")},preferredCountries:{type:Array,default:()=>c("preferredCountries")},validCharactersOnly:{type:Boolean,default:()=>c("validCharactersOnly")},styleClasses:{type:[String,Array,Object],default:()=>c("styleClasses")},strictValidation:{type:Boolean,default:()=>c("strictValidation")}},{modelValue:{type:String},modelModifiers:{}}),emits:H(["blur","close","country-changed","enter","focus","on-input","open","space","validate"],["update:modelValue"]),setup(t,{expose:i,emit:d}){const s=L(),u=L(),g=L(),m=d,o=t,k=Ie(Q()),D=ge(t,"modelValue");S(D,(a,n)=>{oe()?e.phone=a??"":$(()=>{e.phone=n??"",q()})});const e=Ce({phone:"",activeCountryCode:void 0,open:!1,finishMounted:!1,selectedIndex:null,typeToFindInput:"",typeToFindTimer:void 0,dropdownOpenDirection:"below",parsedPlaceholder:o.inputOptions.placeholder,searchQuery:""});S(()=>e.open,a=>{a?(fe(),m("open")):m("close")});const P=T(()=>o.onlyCountries.length?o.allCountries.filter(({iso2:a})=>o.onlyCountries.some(n=>V(n)===a)):o.ignoredCountries.length?o.allCountries.filter(({iso2:a})=>!o.ignoredCountries.includes(V(a))&&!o.ignoredCountries.includes(N(a))):o.allCountries),z=T(()=>A(e.activeCountryCode));S(z,(a,n)=>{if(!a&&n!=null&&n.iso2){e.activeCountryCode=n.iso2;return}a!=null&&a.iso2&&m("country-changed",a)});const Z=T(()=>{var a;const n=N(o.mode);return n==="auto"?(a=e.phone)!=null&&a.startsWith("+")?"international":"national":["national","international","e.164","rfc3966","idd"].includes(n)?n:"international"}),C=T(()=>{const a=[...ee(o.preferredCountries).map(r=>({...r,preferred:!0}
1)),...P.value];if(!o.dropdownOptions.showSearchBox)return a;const n=e.searchQuery.toLowerCase().replace(/[~`!@#$%^&*()+={}\[\];:\'\"<>.,\/\\\?-_]/g,"");return a.filter(r=>new RegExp(n,"i").test(r.name)||new RegExp(n,"i").test(r.iso2)||new RegExp(n,"i").test(r.dialCode))}),y=T(()=>{var a;k.value;const n=e.phone.startsWith("+")?J(e.phone,void 0,o.strictValidation):J(e.phone,e.activeCountryCode,o.strictValidation),r={country:n?.country,countryCode:n?.country,formatted:e.phone,valid:n?.isValid(),possible:(a=n?.isPossible)==null?void 0:a.call(n),nationalNumber:n?.nationalNumber};return r.valid&&(r.formatted=n?.format(V(Z.value))),n!=null&&n.country&&(o.ignoredCountries.length||o.onlyCountries.length)&&!A(n.country)&&(r.valid=!1,r.possible=!1,n.country=null),n?{...r,...n}:r});S(()=>y.value.countryCode,a=>{a&&(e.activeCountryCode=a)}),S(()=>y.value.valid,()=>{m("validate",y.value)}),S(()=>y.value.formatted,a=>{!o.autoFormat||o.customValidate||(R(a),$(()=>{a&&!D.value&&(e.phone=a)}))}),S(()=>o.inputOptions.placeholder,Y),we(()=>{o.strictValidation&&!Q()&&Fe().then(()=>{k.value=!0,m("validate",y.value)}),D.value&&(e.phone=D.value.trim()),ne(),X().then(()=>{var a;!e.phone&&(a=o.inputOptions)!=null&&a.showDialCode&&e.activeCountryCode&&(e.phone=`+${e.activeCountryCode}`),m("validate",y.value)}).catch(console.error).then(()=>{e.finishMounted=!0})});function Y(){e.parsedPlaceholder=o.inputOptions.placeholder}function X(){return new Promise(a=>{var n;if(((n=e.phone)==null?void 0:n[0])==="+"){a();return}if(o.defaultCountry){if(typeof o.defaultCountry=="string"){w(o.defaultCountry),a();return}if(typeof o.defaultCountry=="number"){const l=ae(o.defaultCountry);if(l){w(l.iso2),a();return}}}const r=o.preferredCountries[0]||P.value[0];o.autoDefaultCountry?Pe().then(l=>{w(l||e.activeCountryCode)}).catch(l=>{w(r)}).then(()=>{a()}):(w(r),a())})}function ee(a=[]){return a.map(A).filter(Boolean)}function A(a=""){return P.value.find(n=>n.iso2===V(a))}function ae(a){return P.value.find(n=>Number(n.dialCode)===a)}function te(a,n){const r=e.selectedIndex===a,l=a===o.preferredCountries.length-1,p=o.preferredCountries.some(F=>V(F)===n);return{highlighted:r,"last-preferred":l,preferred:p}}function w(a){var n,r,l;let p=a;if(typeof p=="string"&&(p=A(p)),!!p){if(((n=e.phone)==null?void 0:n[0])==="+"&&p.iso2&&y.value.nationalNumber){e.activeCountryCode=p.iso2,e.phone=((r=I(y.value.nationalNumber,p.iso2))==null?void 0:r.formatInternational())??"";return}if((l=o.inputOptions)!=null&&l.showDialCode&&p){e.phone=`+${p.dialCode}`,e.activeCountryCode=p.iso2;return}e.activeCountryCode=p.iso2,R(e.phone)}}function ne(){const a=e.phone;if(o.validCharactersOnly){const n=e.phone.match(/[()\-+0-9\s]*/g);e.phone=n.join("")}if(o.customValidate&&o.customValidate instanceof RegExp){const n=e.phone.match(o.customValidate);e.phone=n.join("")}a!==e.phone&&R(e.phone)}function oe(){return o.validCharactersOnly&&!/^[()\-+0-9\s]*$/.test(e.phone)?!1:o.customValidate?ie():!0}function ie(){return o.customValidate instanceof RegExp?o.customValidate.test(e.phone):!1}function q(){var a;(a=g.value)==null||a.setCustomValidity(y.value.valid?"":o.invalidMsg),R(e.phone)}function R(a){D.value=a,m("on-input",a,y.value,g.value)}function re(a){m("blur",a)}function le(a){Ae(g.value,e.phone.length),m("focus",a)}function se(a){m("enter",a)}function ue(a){m("space",a)}function de(){var a;(a=g.value)==null||a.focus()}function pe(){var a;(a=g.value)==null||a.blur()}function K(){o.disabled||o.dropdownOptions.disabled||(e.searchQuery="",e.open=!e.open)}function ce(){e.open=!1}function me(a){if(a.keyCode===40){a.preventDefault(),e.open=!0,e.selectedIndex===null?e.selectedIndex=0:e.selectedIndex=Math.min(C.value.length-1,e.selectedIndex+1);const n=u.value.children[e.selectedIndex];n.focus(),n.offsetTop+n.clientHeight>u.value.scrollTop+u.value.clientHeight&&(u.value.scrollTop=n.offsetTop-u.value.clientHeight+n.clientHeight)}else if(a.keyCode===38){a.preventDefault(),e.open=!0,e.selectedIndex===null?e.selectedIndex=C.value.length-1:e.selectedIndex=Math.max(0,e.selectedIndex-1);const n=u.value.children[e.selectedIndex];n.focus(),n.offsetTop<u.value.scrollTop&&(u.value.scrollTop=n.offsetTop)}else if(a.keyCode===13)e.selectedIndex!==null&&w(C.value[e.selectedIndex]),e.open=!e.open;else if(e.open){e.typeToFindInput+=a.key,clearTimeout(e.typeToFindTimer),e.typeToFindTimer=setTimeout(()=>{e.typeToFindInput=""},700);const n=C.value.slice(o.preferredCountries.length).findIndex(r=>N(r.name).startsWith(e.typeToFindInput));if(n>=0){e.selectedIndex=o.preferredCountries.length+n;const r=u.value.children[e.selectedIndex],l=r.offsetTop<u.value.scrollTop,p=r.offsetTop+r.clientHeight>u.value.scrollTop+u.value.clientHeight;(l||p)&&(u.value.scrollTop=r.offsetTop-u.value.clientHeight/2)}}}function U(){e.selectedIndex=C.value.map(a=>a.iso2).indexOf(e.activeCountryCode),e.open=!1}function fe(){window.innerHeight-s.value.getBoundingClientRect().bottom>200?e.dropdownOpenDirection="below":e.dropdownOpenDirection="above"}return i({focus:de,blur:pe}),(a,n)=>{const r=Se("click-outside");return f(),h("div",{ref_key:"refRoot",ref:s,class:b(["vue-tel-input",t.styleClasses,{disabled:t.disabled}])},[E((f(),h("div",{"aria-label":t.dropdownOptions.ariaLabel,"aria-haspopup":"listbox","aria-expanded":e.open,role:"button",class:b(["vti__dropdown",{open:e.open,disabled:t.dropdownOptions.disabled}]),tabindex:t.dropdownOptions.tabindex,onKeydown:[me,M(K,["space"]),M(U,["esc"]),M(U,["tab"])],onClick:K},[O("span",Le,[t.dropdownOptions.showFlags?(f(),h("span",{key:0,class:b(["vti__flag",v(N)(e.activeCountryCode)])},null,2)):B("",!0),t.dropdownOptions.showDialCodeInSelection?(f(),h("span",Ge," +"+_(z.value&&z.value.dialCode),1)):B("",!0),j(a.$slots,"arrow-icon",{open:e.open},()=>[O("span",qe,_(e.open?"â²":"â¼"),1)])]),e.open?(f(),h("ul",{key:0,ref_key:"refList",ref:u,class:b(["vti__dropdown-list",e.dropdownOpenDirection]),role:"listbox"},[t.dropdownOptions.showSearchBox?(f(),h("div",Ke,[j(a.$slots,"search-icon"),E(O("input",{class:b(["vti__input","vti__search_box"]),"aria-label":"Search by country name or country code",placeholder:t.dropdownOptions.searchBoxPlaceholder||(C.value.length?C.value[0].name:""),type:"text","onUpdate:modelValue":n[0]||(n[0]=l=>e.searchQuery=l),onClick:n[1]||(n[1]=Oe(()=>{},["stop"]))},null,8,Ue),[[xe,e.searchQuery]])])):B("",!0),(f(!0),h(ke,null,De(C.value,(l,p)=>
1(f(),h("li",{role:"option",class:b(["vti__dropdown-item",te(p,l.iso2)]),key:l.iso2+(l.preferred?"-preferred":""),tabindex:"-1",onClick:F=>w(l),onMousemove:F=>e.selectedIndex=p,"aria-selected":e.activeCountryCode===l.iso2&&!l.preferred},[t.dropdownOptions.showFlags?(f(),h("span",{key:0,class:b(["vti__flag",v(N)(l.iso2)])},null,2)):B("",!0),O("strong",null,_(l.name),1),t.dropdownOptions.showDialCodeInList?(f(),h("span",$e," +"+_(l.dialCode),1)):B("",!0)],42,He))),128))],2)):B("",!0)],42,je)),[[r,ce]]),E(O("input",{"onUpdate:modelValue":n[2]||(n[2]=l=>e.phone=l),ref_key:"refInput",ref:g,type:t.inputOptions.type,autocomplete:t.inputOptions.autocomplete,autofocus:t.inputOptions.autofocus,inputmode:t.inputOptions.inputmode,class:b(["vti__input","vti__phone",t.inputOptions.styleClasses]),disabled:t.disabled,id:t.inputOptions.id,maxlength:t.inputOptions.maxlength,name:t.inputOptions.name,placeholder:e.parsedPlaceholder,readonly:t.inputOptions.readonly,required:t.inputOptions.required,tabindex:t.inputOptions.tabindex,value:D.value,"aria-describedby":t.inputOptions["aria-describedby"],onBlur:re,onFocus:le,onInput:q,onKeyup:[M(se,["enter"]),M(ue,["space"])]},null,42,We),[[Be,e.phone]]),j(a.$slots,"icon-right")],2)}}}),Qe={class:"input__message input__message--invalid"},Ze={class:"input__message input__message--valid"},Ye={__name:"FormFieldsWInputTelInter",props:{name:{type:String,required:!0},placeholder:{type:String,default:""},theme:{type:String,default:"light"}},setup(t){const i=t,d=_e(),{value:s,meta:u,handleBlur:g}=he(()=>i.name);return s.value&&!I(String(s.value))?.isValid()&&(s.value=""),(m,o)=>(f(),h("div",{class:b(["input__wrapper group",[{"is-invalid":v(u).touched&&!v(u).valid,"is-valid":!!v(s)&&v(u).valid},`input--${t.theme}`]])},[Me(v(Je),{id:v(d),modelValue:v(s),"onUpdate:modelValue":o[0]||(o[0]=k=>Te(s)?s.value=k:null),"preferred-countries":["RU","KZ","BY"],placeholder:t.placeholder,name:t.name,class:"h-full [.input--dark_&]:border-green-700 [.input--dark_&]:focus-within:border-green-700 [.input--dark_&]:focus:border-green-700 [.input--light_&]:border-white-600 [.input--light_&]:focus-within:border-white-600 [.input--light_&]:focus:border-white-600","valid-characters-only":!0,"input-options":{autocomplete:"off",placeholder:t.placeholder,showDialCode:!0,styleClasses:["input__field"]},onBlur:o[1]||(o[1]=k=>v(g)(k,!0))},null,8,["id","modelValue","placeholder","name","input-options"]),O("span",Qe,_(m.$t("form_invalid_msg")),1),O("span",Ze,_(m.$t("form_valid_msg")),1)],2))}},ta=ve(Ye,[["__scopeId","data-v-902498be"]]);export{ta as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.