(function(factory){
if(typeof module==='object'&&module.exports){
module.exports=factory();
}else{
window.intlTelInput=factory();
}}(()=> {
var factoryOutput=(()=> {
var __defProp=Object.defineProperty;
var __getOwnPropDesc=Object.getOwnPropertyDescriptor;
var __getOwnPropNames=Object.getOwnPropertyNames;
var __hasOwnProp=Object.prototype.hasOwnProperty;
var __export=(target, all)=> {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps=(to, from, except, desc)=> {
if(from&&typeof from==="object"||typeof from==="function"){
for (let key of __getOwnPropNames(from))
if(!__hasOwnProp.call(to, key)&&key!==except)
__defProp(to, key, { get: ()=> from[key], enumerable: !(desc=__getOwnPropDesc(from, key))||desc.enumerable });
}
return to;
};
var __toCommonJS=(mod)=> __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var intl_tel_input_exports={};
__export(intl_tel_input_exports, {
Iti: ()=> Iti,
default: ()=> intl_tel_input_default
});
var rawCountryData=[
[
"af",
"93"
],
[
"ax",
"358",
1
],
[
"al",
"355"
],
[
"dz",
"213"
],
[
"as",
"1",
5,
["684"]
],
[
"ad",
"376"
],
[
"ao",
"244"
],
[
"ai",
"1",
6,
["264"]
],
[
"ag",
"1",
7,
["268"]
],
[
"ar",
"54"
],
[
"am",
"374"
],
[
"aw",
"297"
],
[
"ac",
"247"
],
[
"au",
"61",
0,
null,
"0"
],
[
"at",
"43"
],
[
"az",
"994"
],
[
"bs",
"1",
8,
["242"]
],
[
"bh",
"973"
],
[
"bd",
"880"
],
[
"bb",
"1",
9,
["246"]
],
[
"by",
"375"
],
[
"be",
"32"
],
[
"bz",
"501"
],
[
"bj",
"229"
],
[
"bm",
"1",
10,
["441"]
],
[
"bt",
"975"
],
[
"bo",
"591"
],
[
"ba",
"387"
],
[
"bw",
"267"
],
[
"br",
"55"
],
[
"io",
"246"
],
[
"vg",
"1",
11,
["284"]
],
[
"bn",
"673"
],
[
"bg",
"359"
],
[
"bf",
"226"
],
[
"bi",
"257"
],
[
"kh",
"855"
],
[
"cm",
"237"
],
[
"ca",
"1",
1,
["204", "226", "236", "249", "250", "263", "289", "306", "343", "354", "365", "367", "368", "382", "387", "403", "416", "418", "428", "431", "437", "438", "450", "584", "468", "474", "506", "514", "519", "548", "579", "581", "584", "587", "604", "613", "639", "647", "672", "683", "705", "709", "742", "753", "778", "780", "782", "807", "819", "825", "867", "873", "879", "902", "905"]
],
[
"cv",
"238"
],
[
"bq",
"599",
1,
["3", "4", "7"]
],
[
"ky",
"1",
12,
["345"]
],
[
"cf",
"236"
],
[
"td",
"235"
],
[
"cl",
"56"
],
[
"cn",
"86"
],
[
"cx",
"61",
2,
["89164"],
"0"
],
[
"cc",
"61",
1,
["89162"],
"0"
],
[
"co",
"57"
],
[
"km",
"269"
],
[
"cg",
"242"
],
[
"cd",
"243"
],
[
"ck",
"682"
],
[
"cr",
"506"
],
[
"ci",
"225"
],
[
"hr",
"385"
],
[
"cu",
"53"
],
[
"cw",
"599",
0
],
[
"cy",
"357"
],
[
"cz",
"420"
],
[
"dk",
"45"
],
[
"dj",
"253"
],
[
"dm",
"1",
13,
["767"]
],
[
"do",
"1",
2,
["809", "829", "849"]
],
[
"ec",
"593"
],
[
"eg",
"20"
],
[
"sv",
"503"
],
[
"gq",
"240"
],
[
"er",
"291"
],
[
"ee",
"372"
],
[
"sz",
"268"
],
[
"et",
"251"
],
[
"fk",
"500"
],
[
"fo",
"298"
],
[
"fj",
"679"
],
[
"fi",
"358",
0
],
[
"fr",
"33"
],
[
"gf",
"594"
],
[
"pf",
"689"
],
[
"ga",
"241"
],
[
"gm",
"220"
],
[
"ge",
"995"
],
[
"de",
"49"
],
[
"gh",
"233"
],
[
"gi",
"350"
],
[
"gr",
"30"
],
[
"gl",
"299"
],
[
"gd",
"1",
14,
["473"]
],
[
"gp",
"590",
0
],
[
"gu",
"1",
15,
["671"]
],
[
"gt",
"502"
],
[
"gg",
"44",
1,
["1481", "7781", "7839", "7911"],
"0"
],
[
"gn",
"224"
],
[
"gw",
"245"
],
[
"gy",
"592"
],
[
"ht",
"509"
],
[
"hn",
"504"
],
[
"hk",
"852"
],
[
"hu",
"36"
],
[
"is",
"354"
],
[
"in",
"91"
],
[
"id",
"62"
],
[
"ir",
"98"
],
[
"iq",
"964"
],
[
"ie",
"353"
],
[
"im",
"44",
2,
["1624", "74576", "7524", "7924", "7624"],
"0"
],
[
"il",
"972"
],
[
"it",
"39",
0
],
[
"jm",
"1",
4,
["876", "658"]
],
[
"jp",
"81"
],
[
"je",
"44",
3,
["1534", "7509", "7700", "7797", "7829", "7937"],
"0"
],
[
"jo",
"962"
],
[
"kz",
"7",
1,
["33", "7"],
"8"
],
[
"ke",
"254"
],
[
"ki",
"686"
],
[
"xk",
"383"
],
[
"kw",
"965"
],
[
"kg",
"996"
],
[
"la",
"856"
],
[
"lv",
"371"
],
[
"lb",
"961"
],
[
"ls",
"266"
],
[
"lr",
"231"
],
[
"ly",
"218"
],
[
"li",
"423"
],
[
"lt",
"370"
],
[
"lu",
"352"
],
[
"mo",
"853"
],
[
"mg",
"261"
],
[
"mw",
"265"
],
[
"my",
"60"
],
[
"mv",
"960"
],
[
"ml",
"223"
],
[
"mt",
"356"
],
[
"mh",
"692"
],
[
"mq",
"596"
],
[
"mr",
"222"
],
[
"mu",
"230"
],
[
"yt",
"262",
1,
["269", "639"],
"0"
],
[
"mx",
"52"
],
[
"fm",
"691"
],
[
"md",
"373"
],
[
"mc",
"377"
],
[
"mn",
"976"
],
[
"me",
"382"
],
[
"ms",
"1",
16,
["664"]
],
[
"ma",
"212",
0,
null,
"0"
],
[
"mz",
"258"
],
[
"mm",
"95"
],
[
"na",
"264"
],
[
"nr",
"674"
],
[
"np",
"977"
],
[
"nl",
"31"
],
[
"nc",
"687"
],
[
"nz",
"64"
],
[
"ni",
"505"
],
[
"ne",
"227"
],
[
"ng",
"234"
],
[
"nu",
"683"
],
[
"nf",
"672"
],
[
"kp",
"850"
],
[
"mk",
"389"
],
[
"mp",
"1",
17,
["670"]
],
[
"no",
"47",
0
],
[
"om",
"968"
],
[
"pk",
"92"
],
[
"pw",
"680"
],
[
"ps",
"970"
],
[
"pa",
"507"
],
[
"pg",
"675"
],
[
"py",
"595"
],
[
"pe",
"51"
],
[
"ph",
"63"
],
[
"pl",
"48"
],
[
"pt",
"351"
],
[
"pr",
"1",
3,
["787", "939"]
],
[
"qa",
"974"
],
[
"re",
"262",
0,
null,
"0"
],
[
"ro",
"40"
],
[
"ru",
"7",
0,
null,
"8"
],
[
"rw",
"250"
],
[
"ws",
"685"
],
[
"sm",
"378"
],
[
"st",
"239"
],
[
"sa",
"966"
],
[
"sn",
"221"
],
[
"rs",
"381"
],
[
"sc",
"248"
],
[
"sl",
"232"
],
[
"sg",
"65"
],
[
"sx",
"1",
21,
["721"]
],
[
"sk",
"421"
],
[
"si",
"386"
],
[
"sb",
"677"
],
[
"so",
"252"
],
[
"za",
"27"
],
[
"kr",
"82"
],
[
"ss",
"211"
],
[
"es",
"34"
],
[
"lk",
"94"
],
[
"bl",
"590",
1
],
[
"sh",
"290"
],
[
"kn",
"1",
18,
["869"]
],
[
"lc",
"1",
19,
["758"]
],
[
"mf",
"590",
2
],
[
"pm",
"508"
],
[
"vc",
"1",
20,
["784"]
],
[
"sd",
"249"
],
[
"sr",
"597"
],
[
"sj",
"47",
1,
["79"]
],
[
"se",
"46"
],
[
"ch",
"41"
],
[
"sy",
"963"
],
[
"tw",
"886"
],
[
"tj",
"992"
],
[
"tz",
"255"
],
[
"th",
"66"
],
[
"tl",
"670"
],
[
"tg",
"228"
],
[
"tk",
"690"
],
[
"to",
"676"
],
[
"tt",
"1",
22,
["868"]
],
[
"tn",
"216"
],
[
"tr",
"90"
],
[
"tm",
"993"
],
[
"tc",
"1",
23,
["649"]
],
[
"tv",
"688"
],
[
"ug",
"256"
],
[
"ua",
"380"
],
[
"ae",
"971"
],
[
"gb",
"44",
0,
null,
"0"
],
[
"us",
"1",
0
],
[
"uy",
"598"
],
[
"vi",
"1",
24,
["340"]
],
[
"uz",
"998"
],
[
"vu",
"678"
],
[
"va",
"39",
1,
["06698"]
],
[
"ve",
"58"
],
[
"vn",
"84"
],
[
"wf",
"681"
],
[
"eh",
"212",
1,
["5288", "5289"],
"0"
],
[
"ye",
"967"
],
[
"zm",
"260"
],
[
"zw",
"263"
]
];
var allCountries=[];
for (let i=0; i < rawCountryData.length; i++){
const c=rawCountryData[i];
allCountries[i]={
name: "",
iso2: c[0],
dialCode: c[1],
priority: c[2]||0,
areaCodes: c[3]||null,
nodeById: {},
nationalPrefix: c[4]||null
};}
var data_default=allCountries;
var countryTranslations={
ad: "Andorra",
ae: "United Arab Emirates",
af: "Afghanistan",
ag: "Antigua & Barbuda",
ai: "Anguilla",
al: "Albania",
am: "Armenia",
ao: "Angola",
ar: "Argentina",
as: "American Samoa",
at: "Austria",
au: "Australia",
aw: "Aruba",
ax: "\xC5land Islands",
az: "Azerbaijan",
ba: "Bosnia & Herzegovina",
bb: "Barbados",
bd: "Bangladesh",
be: "Belgium",
bf: "Burkina Faso",
bg: "Bulgaria",
bh: "Bahrain",
bi: "Burundi",
bj: "Benin",
bl: "St. Barth\xE9lemy",
bm: "Bermuda",
bn: "Brunei",
bo: "Bolivia",
bq: "Caribbean Netherlands",
br: "Brazil",
bs: "Bahamas",
bt: "Bhutan",
bw: "Botswana",
by: "Belarus",
bz: "Belize",
ca: "Canada",
cc: "Cocos (Keeling) Islands",
cd: "Congo - Kinshasa",
cf: "Central African Republic",
cg: "Congo - Brazzaville",
ch: "Switzerland",
ci: "C\xF4te d\u2019Ivoire",
ck: "Cook Islands",
cl: "Chile",
cm: "Cameroon",
cn: "China",
co: "Colombia",
cr: "Costa Rica",
cu: "Cuba",
cv: "Cape Verde",
cw: "Cura\xE7ao",
cx: "Christmas Island",
cy: "Cyprus",
cz: "Czechia",
de: "Germany",
dj: "Djibouti",
dk: "Denmark",
dm: "Dominica",
do: "Dominican Republic",
dz: "Algeria",
ec: "Ecuador",
ee: "Estonia",
eg: "Egypt",
eh: "Western Sahara",
er: "Eritrea",
es: "Spain",
et: "Ethiopia",
fi: "Finland",
fj: "Fiji",
fk: "Falkland Islands",
fm: "Micronesia",
fo: "Faroe Islands",
fr: "France",
ga: "Gabon",
gb: "United Kingdom",
gd: "Grenada",
ge: "Georgia",
gf: "French Guiana",
gg: "Guernsey",
gh: "Ghana",
gi: "Gibraltar",
gl: "Greenland",
gm: "Gambia",
gn: "Guinea",
gp: "Guadeloupe",
gq: "Equatorial Guinea",
gr: "Greece",
gt: "Guatemala",
gu: "Guam",
gw: "Guinea-Bissau",
gy: "Guyana",
hk: "Hong Kong SAR China",
hn: "Honduras",
hr: "Croatia",
ht: "Haiti",
hu: "Hungary",
id: "Indonesia",
ie: "Ireland",
il: "Israel",
im: "Isle of Man",
in: "India",
io: "British Indian Ocean Territory",
iq: "Iraq",
ir: "Iran",
is: "Iceland",
it: "Italy",
je: "Jersey",
jm: "Jamaica",
jo: "Jordan",
jp: "Japan",
ke: "Kenya",
kg: "Kyrgyzstan",
kh: "Cambodia",
ki: "Kiribati",
km: "Comoros",
kn: "St. Kitts & Nevis",
kp: "North Korea",
kr: "South Korea",
kw: "Kuwait",
ky: "Cayman Islands",
kz: "Kazakhstan",
la: "Laos",
lb: "Lebanon",
lc: "St. Lucia",
li: "Liechtenstein",
lk: "Sri Lanka",
lr: "Liberia",
ls: "Lesotho",
lt: "Lithuania",
lu: "Luxembourg",
lv: "Latvia",
ly: "Libya",
ma: "Morocco",
mc: "Monaco",
md: "Moldova",
me: "Montenegro",
mf: "St. Martin",
mg: "Madagascar",
mh: "Marshall Islands",
mk: "North Macedonia",
ml: "Mali",
mm: "Myanmar (Burma)",
mn: "Mongolia",
mo: "Macao SAR China",
mp: "Northern Mariana Islands",
mq: "Martinique",
mr: "Mauritania",
ms: "Montserrat",
mt: "Malta",
mu: "Mauritius",
mv: "Maldives",
mw: "Malawi",
mx: "Mexico",
my: "Malaysia",
mz: "Mozambique",
na: "Namibia",
nc: "New Caledonia",
ne: "Niger",
nf: "Norfolk Island",
ng: "Nigeria",
ni: "Nicaragua",
nl: "Netherlands",
no: "Norway",
np: "Nepal",
nr: "Nauru",
nu: "Niue",
nz: "New Zealand",
om: "Oman",
pa: "Panama",
pe: "Peru",
pf: "French Polynesia",
pg: "Papua New Guinea",
ph: "Philippines",
pk: "Pakistan",
pl: "Poland",
pm: "St. Pierre & Miquelon",
pr: "Puerto Rico",
ps: "Palestinian Territories",
pt: "Portugal",
pw: "Palau",
py: "Paraguay",
qa: "Qatar",
re: "R\xE9union",
ro: "Romania",
rs: "Serbia",
ru: "Russia",
rw: "Rwanda",
sa: "Saudi Arabia",
sb: "Solomon Islands",
sc: "Seychelles",
sd: "Sudan",
se: "Sweden",
sg: "Singapore",
sh: "St. Helena",
si: "Slovenia",
sj: "Svalbard & Jan Mayen",
sk: "Slovakia",
sl: "Sierra Leone",
sm: "San Marino",
sn: "Senegal",
so: "Somalia",
sr: "Suriname",
ss: "South Sudan",
st: "S\xE3o Tom\xE9 & Pr\xEDncipe",
sv: "El Salvador",
sx: "Sint Maarten",
sy: "Syria",
sz: "Eswatini",
tc: "Turks & Caicos Islands",
td: "Chad",
tg: "Togo",
th: "Thailand",
tj: "Tajikistan",
tk: "Tokelau",
tl: "Timor-Leste",
tm: "Turkmenistan",
tn: "Tunisia",
to: "Tonga",
tr: "Turkey",
tt: "Trinidad & Tobago",
tv: "Tuvalu",
tw: "Taiwan",
tz: "Tanzania",
ua: "Ukraine",
ug: "Uganda",
us: "United States",
uy: "Uruguay",
uz: "Uzbekistan",
va: "Vatican City",
vc: "St. Vincent & Grenadines",
ve: "Venezuela",
vg: "British Virgin Islands",
vi: "U.S. Virgin Islands",
vn: "Vietnam",
vu: "Vanuatu",
wf: "Wallis & Futuna",
ws: "Samoa",
ye: "Yemen",
yt: "Mayotte",
za: "South Africa",
zm: "Zambia",
zw: "Zimbabwe"
};
var countries_default=countryTranslations;
var interfaceTranslations={
selectedCountryAriaLabel: "Selected country",
noCountrySelected: "No country selected",
countryListAriaLabel: "List of countries",
searchPlaceholder: "Search",
zeroSearchResults: "No results found",
oneSearchResult: "1 result found",
multipleSearchResults: "${count} results found",
ac: "Ascension Island",
xk: "Kosovo"
};
var interface_default=interfaceTranslations;
var allTranslations={ ...countries_default, ...interface_default };
var en_default=allTranslations;
for (let i=0; i < data_default.length; i++){
data_default[i].name=en_default[data_default[i].iso2];
}
var id=0;
var defaults={
allowDropdown: true,
autoPlaceholder: "polite",
containerClass: "",
countryOrder: null,
countrySearch: true,
customPlaceholder: null,
dropdownContainer: null,
excludeCountries: [],
fixDropdownWidth: true,
formatAsYouType: true,
formatOnDisplay: true,
geoIpLookup: null,
hiddenInput: null,
i18n: {},
initialCountry: "",
loadUtils: null,
nationalMode: true,
onlyCountries: [],
placeholderNumberType: "MOBILE",
showFlags: true,
separateDialCode: false,
strictMode: false,
useFullscreenPopup: typeof navigator!=="undefined"&&typeof window!=="undefined" ? (
/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent
)||window.innerWidth <=500
):false,
validationNumberTypes: ["MOBILE"]
};
var regionlessNanpNumbers=[
"800",
"822",
"833",
"844",
"855",
"866",
"877",
"880",
"881",
"882",
"883",
"884",
"885",
"886",
"887",
"888",
"889"
];
var getNumeric=(s)=> s.replace(/\D/g, "");
var normaliseString=(s="")=> s.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
var isRegionlessNanp=(number)=> {
const numeric=getNumeric(number);
if(numeric.charAt(0)==="1"){
const areaCode=numeric.substr(1, 3);
return regionlessNanpNumbers.includes(areaCode);
}
return false;
};
var translateCursorPosition=(relevantChars, formattedValue, prevCaretPos, isDeleteForwards)=> {
if(prevCaretPos===0&&!isDeleteForwards){
return 0;
}
let count=0;
for (let i=0; i < formattedValue.length; i++){
if(/[+0-9]/.test(formattedValue[i])){
count++;
}
if(count===relevantChars&&!isDeleteForwards){
return i + 1;
}
if(isDeleteForwards&&count===relevantChars + 1){
return i;
}}
return formattedValue.length;
};
var createEl=(name, attrs, container)=> {
const el=document.createElement(name);
if(attrs){
Object.entries(attrs).forEach(([key, value])=> el.setAttribute(key, value));
}
if(container){
container.appendChild(el);
}
return el;
};
var forEachInstance=(method, ...args)=> {
const { instances }=intlTelInput;
Object.values(instances).forEach((instance)=> instance[method](...args));
};
var Iti=class {
constructor(input, customOptions={}){
this.id=id++;
this.telInput=input;
this.highlightedItem=null;
this.options=Object.assign({}, defaults, customOptions);
this.hadInitialPlaceholder=Boolean(input.getAttribute("placeholder"));
}
_init(){
if(this.options.useFullscreenPopup){
this.options.fixDropdownWidth=false;
}
if(this.options.onlyCountries.length===1){
this.options.initialCountry=this.options.onlyCountries[0];
}
if(this.options.separateDialCode){
this.options.nationalMode=false;
}
if(this.options.allowDropdown&&!this.options.showFlags&&!this.options.separateDialCode){
this.options.nationalMode=false;
}
if(this.options.useFullscreenPopup&&!this.options.dropdownContainer){
this.options.dropdownContainer=document.body;
}
this.isAndroid=typeof navigator!=="undefined" ? /Android/i.test(navigator.userAgent):false;
this.isRTL = !!this.telInput.closest("[dir=rtl]");
const showOnDefaultSide=this.options.allowDropdown||this.options.separateDialCode;
this.showSelectedCountryOnLeft=this.isRTL ? !showOnDefaultSide:showOnDefaultSide;
if(this.options.separateDialCode){
if(this.isRTL){
this.originalPaddingRight=this.telInput.style.paddingRight;
}else{
this.originalPaddingLeft=this.telInput.style.paddingLeft;
}}
this.options.i18n={ ...en_default, ...this.options.i18n };
const autoCountryPromise=new Promise((resolve, reject)=> {
this.resolveAutoCountryPromise=resolve;
this.rejectAutoCountryPromise=reject;
});
const utilsScriptPromise=new Promise((resolve, reject)=> {
this.resolveUtilsScriptPromise=resolve;
this.rejectUtilsScriptPromise=reject;
});
this.promise=Promise.all([autoCountryPromise, utilsScriptPromise]);
this.selectedCountryData={};
this._processCountryData();
this._generateMarkup();
this._setInitialState();
this._initListeners();
this._initRequests();
}
_processCountryData(){
this._processAllCountries();
this._processDialCodes();
this._translateCountryNames();
this._sortCountries();
}
_sortCountries(){
if(this.options.countryOrder){
this.options.countryOrder=this.options.countryOrder.map((country)=> country.toLowerCase());
}
this.countries.sort((a, b)=> {
const { countryOrder }=this.options;
if(countryOrder){
const aIndex=countryOrder.indexOf(a.iso2);
const bIndex=countryOrder.indexOf(b.iso2);
const aIndexExists=aIndex > -1;
const bIndexExists=bIndex > -1;
if(aIndexExists||bIndexExists){
if(aIndexExists&&bIndexExists){
return aIndex - bIndex;
}
return aIndexExists ? -1:1;
}}
return a.name.localeCompare(b.name);
});
}
_addToDialCodeMap(iso2, dialCode, priority){
if(dialCode.length > this.dialCodeMaxLen){
this.dialCodeMaxLen=dialCode.length;
}
if(!this.dialCodeToIso2Map.hasOwnProperty(dialCode)){
this.dialCodeToIso2Map[dialCode]=[];
}
for (let i=0; i < this.dialCodeToIso2Map[dialCode].length; i++){
if(this.dialCodeToIso2Map[dialCode][i]===iso2){
return;
}}
const index=priority!==void 0 ? priority:this.dialCodeToIso2Map[dialCode].length;
this.dialCodeToIso2Map[dialCode][index]=iso2;
}
_processAllCountries(){
const { onlyCountries, excludeCountries }=this.options;
if(onlyCountries.length){
const lowerCaseOnlyCountries=onlyCountries.map((country)=> country.toLowerCase()
);
this.countries=data_default.filter((country)=> lowerCaseOnlyCountries.includes(country.iso2)
);
}else if(excludeCountries.length){
const lowerCaseExcludeCountries=excludeCountries.map((country)=> country.toLowerCase()
);
this.countries=data_default.filter((country)=> !lowerCaseExcludeCountries.includes(country.iso2)
);
}else{
this.countries=data_default;
}}
_translateCountryNames(){
for (let i=0; i < this.countries.length; i++){
const iso2=this.countries[i].iso2.toLowerCase();
if(this.options.i18n.hasOwnProperty(iso2)){
this.countries[i].name=this.options.i18n[iso2];
}}
}
_processDialCodes(){
this.dialCodes={};
this.dialCodeMaxLen=0;
this.dialCodeToIso2Map={};
for (let i=0; i < this.countries.length; i++){
const c=this.countries[i];
if(!this.dialCodes[c.dialCode]){
this.dialCodes[c.dialCode]=true;
}
this._addToDialCodeMap(c.iso2, c.dialCode, c.priority);
}
for (let i=0; i < this.countries.length; i++){
const c=this.countries[i];
if(c.areaCodes){
const rootIso2Code=this.dialCodeToIso2Map[c.dialCode][0];
for (let j=0; j < c.areaCodes.length; j++){
const areaCode=c.areaCodes[j];
for (let k=1; k < areaCode.length; k++){
const partialAreaCode=areaCode.substr(0, k);
const partialDialCode=c.dialCode + partialAreaCode;
this._addToDialCodeMap(rootIso2Code, partialDialCode);
this._addToDialCodeMap(c.iso2, partialDialCode);
}
this._addToDialCodeMap(c.iso2, c.dialCode + areaCode);
}}
}}
_generateMarkup(){
this.telInput.classList.add("iti__tel-input");
if(!this.telInput.hasAttribute("autocomplete")&&!(this.telInput.form&&this.telInput.form.hasAttribute("autocomplete"))){
this.telInput.setAttribute("autocomplete", "off");
}
const {
allowDropdown,
separateDialCode,
showFlags,
containerClass,
hiddenInput,
dropdownContainer,
fixDropdownWidth,
useFullscreenPopup,
countrySearch,
i18n
}=this.options;
let parentClass="iti";
if(allowDropdown){
parentClass +=" iti--allow-dropdown";
}
if(showFlags){
parentClass +=" iti--show-flags";
}
if(containerClass){
parentClass +=` ${containerClass}`;
}
if(!useFullscreenPopup){
parentClass +=" iti--inline-dropdown";
}
const wrapper=createEl("div", { class: parentClass });
this.telInput.parentNode?.insertBefore(wrapper, this.telInput);
if(allowDropdown||showFlags||separateDialCode){
this.countryContainer=createEl(
"div",
{ class: "iti__country-container" },
wrapper
);
if(this.showSelectedCountryOnLeft){
this.countryContainer.style.left="0px";
}else{
this.countryContainer.style.right="0px";
}
if(allowDropdown){
this.selectedCountry=createEl(
"button",
{
type: "button",
class: "iti__selected-country",
"aria-expanded": "false",
"aria-label": this.options.i18n.selectedCountryAriaLabel,
"aria-haspopup": "true",
"aria-controls": `iti-${this.id}__dropdown-content`,
"role": "combobox"
},
this.countryContainer
);
if(this.telInput.disabled){
this.selectedCountry.setAttribute("disabled", "true");
}}else{
this.selectedCountry=createEl(
"div",
{ class: "iti__selected-country" },
this.countryContainer
);
}
const selectedCountryPrimary=createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner=createEl("div", { class: "iti__flag" }, selectedCountryPrimary);
this.selectedCountryA11yText=createEl(
"span",
{ class: "iti__a11y-text" },
this.selectedCountryInner
);
if(allowDropdown){
this.dropdownArrow=createEl(
"div",
{ class: "iti__arrow", "aria-hidden": "true" },
selectedCountryPrimary
);
}
if(separateDialCode){
this.selectedDialCode=createEl(
"div",
{ class: "iti__selected-dial-code" },
this.selectedCountry
);
}
if(allowDropdown){
const extraClasses=fixDropdownWidth ? "":"iti--flexible-dropdown-width";
this.dropdownContent=createEl("div", {
id: `iti-${this.id}__dropdown-content`,
class: `iti__dropdown-content iti__hide ${extraClasses}`
});
if(countrySearch){
this.searchInput=createEl(
"input",
{
type: "text",
class: "iti__search-input",
placeholder: i18n.searchPlaceholder,
role: "combobox",
"aria-expanded": "true",
"aria-label": i18n.searchPlaceholder,
"aria-controls": `iti-${this.id}__country-listbox`,
"aria-autocomplete": "list",
"autocomplete": "off"
},
this.dropdownContent
);
this.searchResultsA11yText=createEl(
"span",
{ class: "iti__a11y-text" },
this.dropdownContent
);
}
this.countryList=createEl(
"ul",
{
class: "iti__country-list",
id: `iti-${this.id}__country-listbox`,
role: "listbox",
"aria-label": i18n.countryListAriaLabel
},
this.dropdownContent
);
this._appendListItems();
if(countrySearch){
this._updateSearchResultsText();
}
if(dropdownContainer){
let dropdownClasses="iti iti--container";
if(useFullscreenPopup){
dropdownClasses +=" iti--fullscreen-popup";
}else{
dropdownClasses +=" iti--inline-dropdown";
}
this.dropdown=createEl("div", { class: dropdownClasses });
this.dropdown.appendChild(this.dropdownContent);
}else{
this.countryContainer.appendChild(this.dropdownContent);
}}
}
wrapper.appendChild(this.telInput);
this._updateInputPadding();
if(hiddenInput){
const telInputName=this.telInput.getAttribute("name")||"";
const names=hiddenInput(telInputName);
if(names.phone){
const existingInput=this.telInput.form?.querySelector(`input[name="${names.phone}"]`);
if(existingInput){
this.hiddenInput=existingInput;
}else{
this.hiddenInput=createEl("input", {
type: "hidden",
name: names.phone
});
wrapper.appendChild(this.hiddenInput);
}}
if(names.country){
const existingInput=this.telInput.form?.querySelector(`input[name="${names.country}"]`);
if(existingInput){
this.hiddenInputCountry=existingInput;
}else{
this.hiddenInputCountry=createEl("input", {
type: "hidden",
name: names.country
});
wrapper.appendChild(this.hiddenInputCountry);
}}
}}
_appendListItems(){
for (let i=0; i < this.countries.length; i++){
const c=this.countries[i];
const extraClass=i===0 ? "iti__highlight":"";
const listItem=createEl(
"li",
{
id: `iti-${this.id}__item-${c.iso2}`,
class: `iti__country ${extraClass}`,
tabindex: "-1",
role: "option",
"data-dial-code": c.dialCode,
"data-country-code": c.iso2,
"aria-selected": "false"
},
this.countryList
);
c.nodeById[this.id]=listItem;
let content="";
if(this.options.showFlags){
content +=`<div class='iti__flag iti__${c.iso2}'></div>`;
}
content +=`<span class='iti__country-name'>${c.name}</span>`;
content +=`<span class='iti__dial-code'>+${c.dialCode}</span>`;
listItem.insertAdjacentHTML("beforeend", content);
}}
_setInitialState(overrideAutoCountry=false){
const attributeValue=this.telInput.getAttribute("value");
const inputValue=this.telInput.value;
const useAttribute=attributeValue&&attributeValue.charAt(0)==="+"&&(!inputValue||inputValue.charAt(0)!=="+");
const val=useAttribute ? attributeValue:inputValue;
const dialCode=this._getDialCode(val);
const isRegionlessNanpNumber=isRegionlessNanp(val);
const { initialCountry, geoIpLookup }=this.options;
const isAutoCountry=initialCountry==="auto"&&geoIpLookup;
if(dialCode&&!isRegionlessNanpNumber){
this._updateCountryFromNumber(val);
}else if(!isAutoCountry||overrideAutoCountry){
const lowerInitialCountry=initialCountry ? initialCountry.toLowerCase():"";
const isValidInitialCountry=lowerInitialCountry&&this._getCountryData(lowerInitialCountry, true);
if(isValidInitialCountry){
this._setCountry(lowerInitialCountry);
}else{
if(dialCode&&isRegionlessNanpNumber){
this._setCountry("us");
}else{
this._setCountry();
}}
}
if(val){
this._updateValFromNumber(val);
}}
_initListeners(){
this._initTelInputListeners();
if(this.options.allowDropdown){
this._initDropdownListeners();
}
if((this.hiddenInput||this.hiddenInputCountry)&&this.telInput.form){
this._initHiddenInputListener();
}}
_initHiddenInputListener(){
this._handleHiddenInputSubmit=()=> {
if(this.hiddenInput){
this.hiddenInput.value=this.getNumber();
}
if(this.hiddenInputCountry){
this.hiddenInputCountry.value=this.getSelectedCountryData().iso2||"";
}};
this.telInput.form?.addEventListener("submit",
this._handleHiddenInputSubmit
);
}
_initDropdownListeners(){
this._handleLabelClick=(e)=> {
if(this.dropdownContent.classList.contains("iti__hide")){
this.telInput.focus();
}else{
e.preventDefault();
}};
const label=this.telInput.closest("label");
if(label){
label.addEventListener("click", this._handleLabelClick);
}
this._handleClickSelectedCountry=()=> {
if(this.dropdownContent.classList.contains("iti__hide")&&!this.telInput.disabled&&!this.telInput.readOnly){
this._openDropdown();
}};
this.selectedCountry.addEventListener("click", this._handleClickSelectedCountry);
this._handleCountryContainerKeydown=(e)=> {
const isDropdownHidden=this.dropdownContent.classList.contains("iti__hide");
if(isDropdownHidden&&["ArrowUp", "ArrowDown", " ", "Enter"].includes(e.key)){
e.preventDefault();
e.stopPropagation();
this._openDropdown();
}
if(e.key==="Tab"){
this._closeDropdown();
}};
this.countryContainer.addEventListener("keydown",
this._handleCountryContainerKeydown
);
}
_initRequests(){
let { loadUtils, initialCountry, geoIpLookup }=this.options;
if(loadUtils&&!intlTelInput.utils){
this._handlePageLoad=()=> {
window.removeEventListener("load", this._handlePageLoad);
intlTelInput.attachUtils(loadUtils)?.catch(()=> {
});
};
if(intlTelInput.documentReady()){
this._handlePageLoad();
}else{
window.addEventListener("load", this._handlePageLoad);
}}else{
this.resolveUtilsScriptPromise();
}
const isAutoCountry=initialCountry==="auto"&&geoIpLookup;
if(isAutoCountry&&!this.selectedCountryData.iso2){
this._loadAutoCountry();
}else{
this.resolveAutoCountryPromise();
}}
_loadAutoCountry(){
if(intlTelInput.autoCountry){
this.handleAutoCountry();
}else if(!intlTelInput.startedLoadingAutoCountry){
intlTelInput.startedLoadingAutoCountry=true;
if(typeof this.options.geoIpLookup==="function"){
this.options.geoIpLookup((iso2="")=> {
const iso2Lower=iso2.toLowerCase();
const isValidIso2=iso2Lower&&this._getCountryData(iso2Lower, true);
if(isValidIso2){
intlTelInput.autoCountry=iso2Lower;
setTimeout(()=> forEachInstance("handleAutoCountry"));
}else{
this._setInitialState(true);
forEachInstance("rejectAutoCountryPromise");
}},
()=> {
this._setInitialState(true);
forEachInstance("rejectAutoCountryPromise");
}
);
}}
}
_openDropdownWithPlus(){
this._openDropdown();
this.searchInput.value="+";
this._filterCountries("", true);
}
_initTelInputListeners(){
const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay, allowDropdown, countrySearch }=this.options;
let userOverrideFormatting=false;
if(/\p{L}/u.test(this.telInput.value)){
userOverrideFormatting=true;
}
this._handleInputEvent=(e)=> {
if(this.isAndroid&&e?.data==="+"&&separateDialCode&&allowDropdown&&countrySearch){
const currentCaretPos=this.telInput.selectionStart||0;
const valueBeforeCaret=this.telInput.value.substring(0, currentCaretPos - 1);
const valueAfterCaret=this.telInput.value.substring(currentCaretPos);
this.telInput.value=valueBeforeCaret + valueAfterCaret;
this._openDropdownWithPlus();
return;
}
if(this._updateCountryFromNumber(this.telInput.value)){
this._triggerCountryChange();
}
const isFormattingChar=e?.data&&/[^+0-9]/.test(e.data);
const isPaste=e?.inputType==="insertFromPaste"&&this.telInput.value;
if(isFormattingChar||isPaste&&!strictMode){
userOverrideFormatting=true;
}else if(!/[^+0-9]/.test(this.telInput.value)){
userOverrideFormatting=false;
}
const disableFormatOnSetNumber=e?.detail&&e.detail["isSetNumber"]&&!formatOnDisplay;
if(formatAsYouType&&!userOverrideFormatting&&!disableFormatOnSetNumber){
const currentCaretPos=this.telInput.selectionStart||0;
const valueBeforeCaret=this.telInput.value.substring(0, currentCaretPos);
const relevantCharsBeforeCaret=valueBeforeCaret.replace(/[^+0-9]/g, "").length;
const isDeleteForwards=e?.inputType==="deleteContentForward";
const formattedValue=this._formatNumberAsYouType();
const newCaretPos=translateCursorPosition(relevantCharsBeforeCaret, formattedValue, currentCaretPos, isDeleteForwards);
this.telInput.value=formattedValue;
this.telInput.setSelectionRange(newCaretPos, newCaretPos);
}};
this.telInput.addEventListener("input", this._handleInputEvent);
if(strictMode||separateDialCode){
this._handleKeydownEvent=(e)=> {
if(e.key&&e.key.length===1&&!e.altKey&&!e.ctrlKey&&!e.metaKey){
if(separateDialCode&&allowDropdown&&countrySearch&&e.key==="+"){
e.preventDefault();
this._openDropdownWithPlus();
return;
}
if(strictMode){
const value=this.telInput.value;
const alreadyHasPlus=value.charAt(0)==="+";
const isInitialPlus = !alreadyHasPlus&&this.telInput.selectionStart===0&&e.key==="+";
const isNumeric=/^[0-9]$/.test(e.key);
const isAllowedChar=separateDialCode ? isNumeric:isInitialPlus||isNumeric;
const newValue=value.slice(0, this.telInput.selectionStart) + e.key + value.slice(this.telInput.selectionEnd);
const newFullNumber=this._getFullNumber(newValue);
const coreNumber=intlTelInput.utils.getCoreNumber(newFullNumber, this.selectedCountryData.iso2);
const hasExceededMaxLength=this.maxCoreNumberLength&&coreNumber.length > this.maxCoreNumberLength;
let isChangingDialCode=false;
if(alreadyHasPlus){
const currentCountry=this.selectedCountryData.iso2;
const newCountry=this._getCountryFromNumber(newFullNumber);
isChangingDialCode=newCountry!==currentCountry;
}
if(!isAllowedChar||hasExceededMaxLength&&!isChangingDialCode&&!isInitialPlus){
e.preventDefault();
}}
}};
this.telInput.addEventListener("keydown", this._handleKeydownEvent);
}}
_cap(number){
const max=parseInt(this.telInput.getAttribute("maxlength")||"", 10);
return max&&number.length > max ? number.substr(0, max):number;
}
_trigger(name, detailProps={}){
const e=new CustomEvent(name, {
bubbles: true,
cancelable: true,
detail: detailProps
});
this.telInput.dispatchEvent(e);
}
_openDropdown(){
const { fixDropdownWidth, countrySearch }=this.options;
if(fixDropdownWidth){
this.dropdownContent.style.width=`${this.telInput.offsetWidth}px`;
}
this.dropdownContent.classList.remove("iti__hide");
this.selectedCountry.setAttribute("aria-expanded", "true");
this._setDropdownPosition();
if(countrySearch){
const firstCountryItem=this.countryList.firstElementChild;
if(firstCountryItem){
this._highlightListItem(firstCountryItem, false);
this.countryList.scrollTop=0;
}
this.searchInput.focus();
}
this._bindDropdownListeners();
this.dropdownArrow.classList.add("iti__arrow--up");
this._trigger("open:countrydropdown");
}
_setDropdownPosition(){
if(this.options.dropdownContainer){
this.options.dropdownContainer.appendChild(this.dropdown);
}
if(!this.options.useFullscreenPopup){
const inputPosRelativeToVP=this.telInput.getBoundingClientRect();
const inputHeight=this.telInput.offsetHeight;
if(this.options.dropdownContainer){
this.dropdown.style.top=`${inputPosRelativeToVP.top + inputHeight}px`;
this.dropdown.style.left=`${inputPosRelativeToVP.left}px`;
this._handleWindowScroll=()=> this._closeDropdown();
window.addEventListener("scroll", this._handleWindowScroll);
}}
}
_bindDropdownListeners(){
this._handleMouseoverCountryList=(e)=> {
const listItem=e.target?.closest(".iti__country");
if(listItem){
this._highlightListItem(listItem, false);
}};
this.countryList.addEventListener("mouseover",
this._handleMouseoverCountryList
);
this._handleClickCountryList=(e)=> {
const listItem=e.target?.closest(".iti__country");
if(listItem){
this._selectListItem(listItem);
}};
this.countryList.addEventListener("click", this._handleClickCountryList);
let isOpening=true;
this._handleClickOffToClose=()=> {
if(!isOpening){
this._closeDropdown();
}
isOpening=false;
};
document.documentElement.addEventListener("click",
this._handleClickOffToClose
);
let query="";
let queryTimer=null;
this._handleKeydownOnDropdown=(e)=> {
if(["ArrowUp", "ArrowDown", "Enter", "Escape"].includes(e.key)){
e.preventDefault();
e.stopPropagation();
if(e.key==="ArrowUp"||e.key==="ArrowDown"){
this._handleUpDownKey(e.key);
}else if(e.key==="Enter"){
this._handleEnterKey();
}else if(e.key==="Escape"){
this._closeDropdown();
}}
if(!this.options.countrySearch&&/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(e.key)){
e.stopPropagation();
if(queryTimer){
clearTimeout(queryTimer);
}
query +=e.key.toLowerCase();
this._searchForCountry(query);
queryTimer=setTimeout(()=> {
query="";
}, 1e3);
}};
document.addEventListener("keydown", this._handleKeydownOnDropdown);
if(this.options.countrySearch){
const doFilter=()=> {
const inputQuery=this.searchInput.value.trim();
if(inputQuery){
this._filterCountries(inputQuery);
}else{
this._filterCountries("", true);
}};
let keyupTimer=null;
this._handleSearchChange=()=> {
if(keyupTimer){
clearTimeout(keyupTimer);
}
keyupTimer=setTimeout(()=> {
doFilter();
keyupTimer=null;
}, 100);
};
this.searchInput.addEventListener("input", this._handleSearchChange);
this.searchInput.addEventListener("click", (e)=> e.stopPropagation());
}}
_searchForCountry(query){
for (let i=0; i < this.countries.length; i++){
const c=this.countries[i];
const startsWith=c.name.substr(0, query.length).toLowerCase()===query;
if(startsWith){
const listItem=c.nodeById[this.id];
this._highlightListItem(listItem, false);
this._scrollTo(listItem);
break;
}}
}
_filterCountries(query, isReset=false){
let noCountriesAddedYet=true;
this.countryList.innerHTML="";
const normalisedQuery=normaliseString(query);
for (let i=0; i < this.countries.length; i++){
const c=this.countries[i];
const normalisedCountryName=normaliseString(c.name);
const countryInitials=c.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((word)=> word[0]).join("").toLowerCase();
const fullDialCode=`+${c.dialCode}`;
if(isReset||normalisedCountryName.includes(normalisedQuery)||fullDialCode.includes(normalisedQuery)||c.iso2.includes(normalisedQuery)||countryInitials.includes(normalisedQuery)){
const listItem=c.nodeById[this.id];
if(listItem){
this.countryList.appendChild(listItem);
}
if(noCountriesAddedYet){
this._highlightListItem(listItem, false);
noCountriesAddedYet=false;
}}
}
if(noCountriesAddedYet){
this._highlightListItem(null, false);
}
this.countryList.scrollTop=0;
this._updateSearchResultsText();
}
_updateSearchResultsText(){
const { i18n }=this.options;
const count=this.countryList.childElementCount;
let searchText;
if(count===0){
searchText=i18n.zeroSearchResults;
}else if(count===1){
searchText=i18n.oneSearchResult;
}else{
searchText=i18n.multipleSearchResults.replace("${count}", count.toString());
}
this.searchResultsA11yText.textContent=searchText;
}
_handleUpDownKey(key){
let next=key==="ArrowUp" ? this.highlightedItem?.previousElementSibling:this.highlightedItem?.nextElementSibling;
if(!next&&this.countryList.childElementCount > 1){
next=key==="ArrowUp" ? this.countryList.lastElementChild:this.countryList.firstElementChild;
}
if(next){
this._scrollTo(next);
this._highlightListItem(next, false);
}}
_handleEnterKey(){
if(this.highlightedItem){
this._selectListItem(this.highlightedItem);
}}
_updateValFromNumber(fullNumber){
let number=fullNumber;
if(this.options.formatOnDisplay&&intlTelInput.utils&&this.selectedCountryData){
const useNational=this.options.nationalMode||number.charAt(0)!=="+"&&!this.options.separateDialCode;
const { NATIONAL, INTERNATIONAL }=intlTelInput.utils.numberFormat;
const format=useNational ? NATIONAL:INTERNATIONAL;
number=intlTelInput.utils.formatNumber(number,
this.selectedCountryData.iso2,
format
);
}
number=this._beforeSetNumber(number);
this.telInput.value=number;
}
_updateCountryFromNumber(fullNumber){
const iso2=this._getCountryFromNumber(fullNumber);
if(iso2!==null){
return this._setCountry(iso2);
}
return false;
}
_ensureHasDialCode(number){
const { dialCode, nationalPrefix }=this.selectedCountryData;
const alreadyHasPlus=number.charAt(0)==="+";
if(alreadyHasPlus||!dialCode){
return number;
}
const hasPrefix=nationalPrefix&&number.charAt(0)===nationalPrefix&&!this.options.separateDialCode;
const cleanNumber=hasPrefix ? number.substring(1):number;
return `+${dialCode}${cleanNumber}`;
}
_getCountryFromNumber(fullNumber){
const plusIndex=fullNumber.indexOf("+");
let number=plusIndex ? fullNumber.substring(plusIndex):fullNumber;
const selectedIso2=this.selectedCountryData.iso2;
const selectedDialCode=this.selectedCountryData.dialCode;
number=this._ensureHasDialCode(number);
const dialCodeMatch=this._getDialCode(number, true);
const numeric=getNumeric(number);
if(dialCodeMatch){
const dialCodeMatchNumeric=getNumeric(dialCodeMatch);
const iso2Codes=this.dialCodeToIso2Map[dialCodeMatchNumeric];
if(!selectedIso2&&this.defaultCountry&&iso2Codes.includes(this.defaultCountry)){
return this.defaultCountry;
}
const alreadySelected=selectedIso2&&iso2Codes.includes(selectedIso2)&&(numeric.length===dialCodeMatchNumeric.length||!this.selectedCountryData.areaCodes);
const isRegionlessNanpNumber=selectedDialCode==="1"&&isRegionlessNanp(numeric);
if(!isRegionlessNanpNumber&&!alreadySelected){
for (let j=0; j < iso2Codes.length; j++){
if(iso2Codes[j]){
return iso2Codes[j];
}}
}}else if(number.charAt(0)==="+"&&numeric.length){
return "";
}else if((!number||number==="+")&&!this.selectedCountryData.iso2){
return this.defaultCountry;
}
return null;
}
_highlightListItem(listItem, shouldFocus){
const prevItem=this.highlightedItem;
if(prevItem){
prevItem.classList.remove("iti__highlight");
prevItem.setAttribute("aria-selected", "false");
}
this.highlightedItem=listItem;
if(this.highlightedItem){
this.highlightedItem.classList.add("iti__highlight");
this.highlightedItem.setAttribute("aria-selected", "true");
const activeDescendant=this.highlightedItem.getAttribute("id")||"";
this.selectedCountry.setAttribute("aria-activedescendant", activeDescendant);
if(this.options.countrySearch){
this.searchInput.setAttribute("aria-activedescendant", activeDescendant);
}}
if(shouldFocus){
this.highlightedItem.focus();
}}
_getCountryData(iso2, allowFail){
for (let i=0; i < this.countries.length; i++){
if(this.countries[i].iso2===iso2){
return this.countries[i];
}}
if(allowFail){
return null;
}
throw new Error(`No country data for '${iso2}'`);
}
_setCountry(iso2){
const { separateDialCode, showFlags, i18n }=this.options;
const prevCountry=this.selectedCountryData.iso2 ? this.selectedCountryData:{};
this.selectedCountryData=iso2 ? this._getCountryData(iso2, false)||{}:{};
if(this.selectedCountryData.iso2){
this.defaultCountry=this.selectedCountryData.iso2;
}
if(this.selectedCountryInner){
let flagClass="";
let a11yText="";
if(iso2&&showFlags){
flagClass=`iti__flag iti__${iso2}`;
a11yText=`${this.selectedCountryData.name} +${this.selectedCountryData.dialCode}`;
}else{
flagClass="iti__flag iti__globe";
a11yText=i18n.noCountrySelected;
}
this.selectedCountryInner.className=flagClass;
this.selectedCountryA11yText.textContent=a11yText;
}
this._setSelectedCountryTitleAttribute(iso2, separateDialCode);
if(separateDialCode){
const dialCode=this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}`:"";
this.selectedDialCode.innerHTML=dialCode;
this._updateInputPadding();
}
this._updatePlaceholder();
this._updateMaxLength();
return prevCountry.iso2!==iso2;
}
_updateInputPadding(){
if(this.selectedCountry){
const selectedCountryWidth=this.selectedCountry.offsetWidth||this._getHiddenSelectedCountryWidth();
const inputPadding=selectedCountryWidth + 6;
if(this.showSelectedCountryOnLeft){
this.telInput.style.paddingLeft=`${inputPadding}px`;
}else{
this.telInput.style.paddingRight=`${inputPadding}px`;
}}
}
_updateMaxLength(){
const { strictMode, placeholderNumberType, validationNumberTypes }=this.options;
const { iso2 }=this.selectedCountryData;
if(strictMode&&intlTelInput.utils){
if(iso2){
const numberType=intlTelInput.utils.numberType[placeholderNumberType];
let exampleNumber=intlTelInput.utils.getExampleNumber(iso2,
false,
numberType,
true
);
let validNumber=exampleNumber;
while (intlTelInput.utils.isPossibleNumber(exampleNumber, iso2, validationNumberTypes)){
validNumber=exampleNumber;
exampleNumber +="0";
}
const coreNumber=intlTelInput.utils.getCoreNumber(validNumber, iso2);
this.maxCoreNumberLength=coreNumber.length;
if(iso2==="by"){
this.maxCoreNumberLength=coreNumber.length + 1;
}}else{
this.maxCoreNumberLength=null;
}}
}
_setSelectedCountryTitleAttribute(iso2=null, separateDialCode){
if(!this.selectedCountry){
return;
}
let title;
if(iso2&&!separateDialCode){
title=`${this.selectedCountryData.name}: +${this.selectedCountryData.dialCode}`;
}else if(iso2){
title=this.selectedCountryData.name;
}else{
title="Unknown";
}
this.selectedCountry.setAttribute("title", title);
}
_getHiddenSelectedCountryWidth(){
if(this.telInput.parentNode){
const containerClone=this.telInput.parentNode.cloneNode(false);
containerClone.style.visibility="hidden";
document.body.appendChild(containerClone);
const countryContainerClone=this.countryContainer.cloneNode();
containerClone.appendChild(countryContainerClone);
const selectedCountryClone=this.selectedCountry.cloneNode(true);
countryContainerClone.appendChild(selectedCountryClone);
const width=selectedCountryClone.offsetWidth;
document.body.removeChild(containerClone);
return width;
}
return 0;
}
_updatePlaceholder(){
const {
autoPlaceholder,
placeholderNumberType,
nationalMode,
customPlaceholder
}=this.options;
const shouldSetPlaceholder=autoPlaceholder==="aggressive"||!this.hadInitialPlaceholder&&autoPlaceholder==="polite";
if(intlTelInput.utils&&shouldSetPlaceholder){
const numberType=intlTelInput.utils.numberType[placeholderNumberType];
let placeholder=this.selectedCountryData.iso2 ? intlTelInput.utils.getExampleNumber(this.selectedCountryData.iso2,
nationalMode,
numberType
):"";
placeholder=this._beforeSetNumber(placeholder);
if(typeof customPlaceholder==="function"){
placeholder=customPlaceholder(placeholder, this.selectedCountryData);
}
this.telInput.setAttribute("placeholder", placeholder);
}}
_selectListItem(listItem){
const countryChanged=this._setCountry(listItem.getAttribute("data-country-code")
);
this._closeDropdown();
this._updateDialCode(listItem.getAttribute("data-dial-code"));
this.telInput.focus();
if(countryChanged){
this._triggerCountryChange();
}}
_closeDropdown(){
this.dropdownContent.classList.add("iti__hide");
this.selectedCountry.setAttribute("aria-expanded", "false");
this.selectedCountry.removeAttribute("aria-activedescendant");
if(this.highlightedItem){
this.highlightedItem.setAttribute("aria-selected", "false");
}
if(this.options.countrySearch){
this.searchInput.removeAttribute("aria-activedescendant");
}
this.dropdownArrow.classList.remove("iti__arrow--up");
document.removeEventListener("keydown", this._handleKeydownOnDropdown);
if(this.options.countrySearch){
this.searchInput.removeEventListener("input", this._handleSearchChange);
}
document.documentElement.removeEventListener("click",
this._handleClickOffToClose
);
this.countryList.removeEventListener("mouseover",
this._handleMouseoverCountryList
);
this.countryList.removeEventListener("click", this._handleClickCountryList);
if(this.options.dropdownContainer){
if(!this.options.useFullscreenPopup){
window.removeEventListener("scroll", this._handleWindowScroll);
}
if(this.dropdown.parentNode){
this.dropdown.parentNode.removeChild(this.dropdown);
}}
if(this._handlePageLoad){
window.removeEventListener("load", this._handlePageLoad);
}
this._trigger("close:countrydropdown");
}
_scrollTo(element){
const container=this.countryList;
const scrollTop=document.documentElement.scrollTop;
const containerHeight=container.offsetHeight;
const containerTop=container.getBoundingClientRect().top + scrollTop;
const containerBottom=containerTop + containerHeight;
const elementHeight=element.offsetHeight;
const elementTop=element.getBoundingClientRect().top + scrollTop;
const elementBottom=elementTop + elementHeight;
const newScrollTop=elementTop - containerTop + container.scrollTop;
if(elementTop < containerTop){
container.scrollTop=newScrollTop;
}else if(elementBottom > containerBottom){
const heightDifference=containerHeight - elementHeight;
container.scrollTop=newScrollTop - heightDifference;
}}
_updateDialCode(newDialCodeBare){
const inputVal=this.telInput.value;
const newDialCode=`+${newDialCodeBare}`;
let newNumber;
if(inputVal.charAt(0)==="+"){
const prevDialCode=this._getDialCode(inputVal);
if(prevDialCode){
newNumber=inputVal.replace(prevDialCode, newDialCode);
}else{
newNumber=newDialCode;
}
this.telInput.value=newNumber;
}}
_getDialCode(number, includeAreaCode){
let dialCode="";
if(number.charAt(0)==="+"){
let numericChars="";
for (let i=0; i < number.length; i++){
const c=number.charAt(i);
if(!isNaN(parseInt(c, 10))){
numericChars +=c;
if(includeAreaCode){
if(this.dialCodeToIso2Map[numericChars]){
dialCode=number.substr(0, i + 1);
}}else{
if(this.dialCodes[numericChars]){
dialCode=number.substr(0, i + 1);
break;
}}
if(numericChars.length===this.dialCodeMaxLen){
break;
}}
}}
return dialCode;
}
_getFullNumber(overrideVal){
const val=overrideVal||this.telInput.value.trim();
const { dialCode }=this.selectedCountryData;
let prefix;
const numericVal=getNumeric(val);
if(this.options.separateDialCode&&val.charAt(0)!=="+"&&dialCode&&numericVal){
prefix=`+${dialCode}`;
}else{
prefix="";
}
return prefix + val;
}
_beforeSetNumber(fullNumber){
let number=fullNumber;
if(this.options.separateDialCode){
let dialCode=this._getDialCode(number);
if(dialCode){
dialCode=`+${this.selectedCountryData.dialCode}`;
const start=number[dialCode.length]===" "||number[dialCode.length]==="-" ? dialCode.length + 1:dialCode.length;
number=number.substr(start);
}}
return this._cap(number);
}
_triggerCountryChange(){
this._trigger("countrychange");
}
_formatNumberAsYouType(){
const val=this._getFullNumber();
const result=intlTelInput.utils ? intlTelInput.utils.formatNumberAsYouType(val, this.selectedCountryData.iso2):val;
const { dialCode }=this.selectedCountryData;
if(this.options.separateDialCode&&this.telInput.value.charAt(0)!=="+"&&result.includes(`+${dialCode}`)){
const afterDialCode=result.split(`+${dialCode}`)[1]||"";
return afterDialCode.trim();
}
return result;
}
handleAutoCountry(){
if(this.options.initialCountry==="auto"&&intlTelInput.autoCountry){
this.defaultCountry=intlTelInput.autoCountry;
const hasSelectedCountryOrGlobe=this.selectedCountryData.iso2||this.selectedCountryInner.classList.contains("iti__globe");
if(!hasSelectedCountryOrGlobe){
this.setCountry(this.defaultCountry);
}
this.resolveAutoCountryPromise();
}}
handleUtils(){
if(intlTelInput.utils){
if(this.telInput.value){
this._updateValFromNumber(this.telInput.value);
}
if(this.selectedCountryData.iso2){
this._updatePlaceholder();
this._updateMaxLength();
}}
this.resolveUtilsScriptPromise();
}
destroy(){
const { allowDropdown, separateDialCode }=this.options;
if(allowDropdown){
this._closeDropdown();
this.selectedCountry.removeEventListener("click",
this._handleClickSelectedCountry
);
this.countryContainer.removeEventListener("keydown",
this._handleCountryContainerKeydown
);
const label=this.telInput.closest("label");
if(label){
label.removeEventListener("click", this._handleLabelClick);
}}
const { form }=this.telInput;
if(this._handleHiddenInputSubmit&&form){
form.removeEventListener("submit", this._handleHiddenInputSubmit);
}
this.telInput.removeEventListener("input", this._handleInputEvent);
if(this._handleKeydownEvent){
this.telInput.removeEventListener("keydown", this._handleKeydownEvent);
}
this.telInput.removeAttribute("data-intl-tel-input-id");
if(separateDialCode){
if(this.isRTL){
this.telInput.style.paddingRight=this.originalPaddingRight;
}else{
this.telInput.style.paddingLeft=this.originalPaddingLeft;
}}
const wrapper=this.telInput.parentNode;
wrapper?.parentNode?.insertBefore(this.telInput, wrapper);
wrapper?.parentNode?.removeChild(wrapper);
delete intlTelInput.instances[this.id];
}
getExtension(){
if(intlTelInput.utils){
return intlTelInput.utils.getExtension(this._getFullNumber(),
this.selectedCountryData.iso2
);
}
return "";
}
getNumber(format){
if(intlTelInput.utils){
const { iso2 }=this.selectedCountryData;
return intlTelInput.utils.formatNumber(this._getFullNumber(),
iso2,
format
);
}
return "";
}
getNumberType(){
if(intlTelInput.utils){
return intlTelInput.utils.getNumberType(this._getFullNumber(),
this.selectedCountryData.iso2
);
}
return -99;
}
getSelectedCountryData(){
return this.selectedCountryData;
}
getValidationError(){
if(intlTelInput.utils){
const { iso2 }=this.selectedCountryData;
return intlTelInput.utils.getValidationError(this._getFullNumber(), iso2);
}
return -99;
}
isValidNumber(){
if(!this.selectedCountryData.iso2){
return false;
}
const val=this._getFullNumber();
const alphaCharPosition=val.search(/\p{L}/u);
if(alphaCharPosition > -1){
const beforeAlphaChar=val.substring(0, alphaCharPosition);
const beforeAlphaIsValid=this._utilsIsPossibleNumber(beforeAlphaChar);
const isValid=this._utilsIsPossibleNumber(val);
return beforeAlphaIsValid&&isValid;
}
return this._utilsIsPossibleNumber(val);
}
_utilsIsPossibleNumber(val){
return intlTelInput.utils ? intlTelInput.utils.isPossibleNumber(val, this.selectedCountryData.iso2, this.options.validationNumberTypes):null;
}
isValidNumberPrecise(){
if(!this.selectedCountryData.iso2){
return false;
}
const val=this._getFullNumber();
const alphaCharPosition=val.search(/\p{L}/u);
if(alphaCharPosition > -1){
const beforeAlphaChar=val.substring(0, alphaCharPosition);
const beforeAlphaIsValid=this._utilsIsValidNumber(beforeAlphaChar);
const isValid=this._utilsIsValidNumber(val);
return beforeAlphaIsValid&&isValid;
}
return this._utilsIsValidNumber(val);
}
_utilsIsValidNumber(val){
return intlTelInput.utils ? intlTelInput.utils.isValidNumber(val, this.selectedCountryData.iso2, this.options.validationNumberTypes):null;
}
setCountry(iso2){
const iso2Lower=iso2?.toLowerCase();
const currentCountry=this.selectedCountryData.iso2;
const isCountryChange=iso2&&iso2Lower!==currentCountry||!iso2&&currentCountry;
if(isCountryChange){
this._setCountry(iso2Lower);
this._updateDialCode(this.selectedCountryData.dialCode);
this._triggerCountryChange();
}}
setNumber(number){
const countryChanged=this._updateCountryFromNumber(number);
this._updateValFromNumber(number);
if(countryChanged){
this._triggerCountryChange();
}
this._trigger("input", { isSetNumber: true });
}
setPlaceholderNumberType(type){
this.options.placeholderNumberType=type;
this._updatePlaceholder();
}
setDisabled(disabled){
this.telInput.disabled=disabled;
if(disabled){
this.selectedCountry.setAttribute("disabled", "true");
}else{
this.selectedCountry.removeAttribute("disabled");
}}
};
var attachUtils=(source)=> {
if(!intlTelInput.utils&&!intlTelInput.startedLoadingUtilsScript){
let loadCall;
if(typeof source==="function"){
try {
loadCall=Promise.resolve(source());
} catch (error){
return Promise.reject(error);
}}else{
return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof source}`));
}
intlTelInput.startedLoadingUtilsScript=true;
return loadCall.then((module)=> {
const utils=module?.default;
if(!utils||typeof utils!=="object"){
throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");
}
intlTelInput.utils=utils;
forEachInstance("handleUtils");
return true;
}).catch((error)=> {
forEachInstance("rejectUtilsScriptPromise", error);
throw error;
});
}
return null;
};
var intlTelInput=Object.assign((input, options)=> {
const iti=new Iti(input, options);
iti._init();
input.setAttribute("data-intl-tel-input-id", iti.id.toString());
intlTelInput.instances[iti.id]=iti;
return iti;
},
{
defaults,
documentReady: ()=> document.readyState==="complete",
getCountryData: ()=> data_default,
getInstance: (input)=> {
const id2=input.getAttribute("data-intl-tel-input-id");
return id2 ? intlTelInput.instances[id2]:null;
},
instances: {},
attachUtils,
startedLoadingUtilsScript: false,
startedLoadingAutoCountry: false,
version: "25.3.0"
}
);
var intl_tel_input_default=intlTelInput;
return __toCommonJS(intl_tel_input_exports);
})();
return factoryOutput.default;
}));
var MSE_STORAGE_EXPIRY_1_DAY=1,MSE_STORAGE_EXPIRY_2_DAYS=2,MSE_STORAGE_EXPIRY_7_DAYS=7,MSE_STORAGE_EXPIRY_365_DAYS=365;function launch_mystickyelements(e){var t="desktop",s=1;e=void 0!==e?e:1,/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(t="mobile"),jQuery(".mystickyelements-fixed .mystickyelements-lists").each((function(){if(!(s>1)){var i=1;jQuery(this).find("li").each((function(){if(jQuery(this).hasClass("mystickyelements-minimize"))jQuery(this).hasClass("element-minimize")&&jQuery(this).trigger("click");else if(jQuery(this).hasClass("element-"+t+"-on"))return e==i?(jQuery(this).addClass("elements-active"),jQuery(this).parent().parent().parent().hasClass("mystickyelements-on-click")||jQuery(this).parent().parent().parent().addClass("mystickyelements-on-click"),!1):void i++})),s++}}))}function close_mystickyelements(){/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),jQuery(".mystickyelements-fixed .mystickyelements-lists").each((function(){jQuery(this).find("li").each((function(){jQuery(this).hasClass("elements-active")&&jQuery(this).removeClass("elements-active")}))}))}function hide_mystickyelements(){jQuery(".mystickyelements-fixed").each((function(){jQuery(this).hide(),MSESetStorageWithExpiry("hide_mystickyelements","closed",MSE_STORAGE_EXPIRY_365_DAYS)}))}function show_mystickyelements(){jQuery(".mystickyelements-fixed").each((function(){jQuery(this).show(),MSESetStorageWithExpiry("hide_mystickyelements","opened",MSE_STORAGE_EXPIRY_1_DAY)}))}function MSESetStorageWithExpiry(e,t,s){if(s){const i=Date.now()+24*s*60*60*1e3;localStorage.setItem(e,JSON.stringify({value:t,expiry:i}))}else localStorage.setItem(e,t)}function MSEGetStorageWithExpiry(e){const t=localStorage.getItem(e);if(!t)return null;try{const s=JSON.parse(t);return s&&"object"==typeof s&&"expiry"in s?Date.now()>s.expiry?(localStorage.removeItem(e),null):s.value:s}catch(e){return t}}function checkForMSEStorageString(e,t){var s=MSEGetStorageWithExpiry("mystickyelementWidget_"+e),i=[];if(null!=s&&""!=s&&(i=JSON.parse(s)),i.length>0)for(var n=0;n<i.length;n++)if(i[n].k==t)return i[n].v;return null}function saveMSEStorageString(e,t){var s=MSEGetStorageWithExpiry("mystickyelementWidget_"+e),i=[];null!=s&&""!=s&&(i=JSON.parse(s));var n=!1;if(i.length>0)for(var m=0;m<i.length;m++)i[m].k==t&&(n=!0,i[m].v=new Date);n||i.push({k:t,v:new Date}),MSESetStorageWithExpiry("mystickyelementWidget_"+e,s=JSON.stringify(i),MSE_STORAGE_EXPIRY_7_DAYS)}function checkMSEStorageExpired(e,t){var s=checkForMSEStorageString(e,t);if(null!=s&&""!=s){s=new Date(s);var i=Math.abs(new Date-s);return Math.floor(i/864e5)>=MSE_STORAGE_EXPIRY_2_DAYS}return!0}function MSECheckStorageWithExpiry(e){const t=localStorage.getItem(e);if(!t)return!1;try{const e=JSON.parse(t);return!e||"object"!=typeof e||!("expiry"in e)||Date.now()>e.expiry}catch(e){return!0}}function MSELocalStorageGetSimple(e){return localStorage.getItem(e)}function MSELocalStorageSetSimple(e,t){localStorage.setItem(e,t)}!function(e){"use strict";var t="",s="",i=0,n=!1,m=0,o=-1;function l(){return/Android|webOS|iPhone|iPad|Mac|Macintosh|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?"mobile":"desktop"}function a(){if(e(window).width()<=1024){if(e(".mystickyelements-fixed").hasClass("mystickyelements-position-mobile-top")){var t=e(".mystickyelements-fixed").height();e("html").attr("style","margin-top: "+t+"px !important")}}else e("html").css("margin-top","")}function c(){if(0!==e(".element-contact-form").length){var m=e(window).height(),o=e(".mystickyelements-fixed").position().top,l=(e(".element-contact-form").offset().top,e("#mystickyelements-contact-form #stickyelements-form").innerHeight()+e(".element-contact-form .contact-form-heading").innerHeight());if(m<l){var a=m-70;e("#mystickyelements-contact-form .element-contact-form").css("max-height",a+"px"),e("#mystickyelements-contact-form .element-contact-form").css("overflowY","auto");var c=o-10;e(window).width()>1025&&!e(".mystickyelements-fixed").hasClass("mystickyelements-position-bottom")&&e("#mystickyelements-contact-form .element-contact-form").css("top","-"+c+"px"),e(window).width()<1024&&!e(".mystickyelements-fixed").hasClass("mystickyelements-position-mobile-bottom")&&e("#mystickyelements-contact-form .element-contact-form").css("top","-"+c+"px")}else{var r=e("ul.mystickyelements-lists .mystickyelements-minimize").height();null===r&&(r=0);c=o-(m-l)+r+10;e(window).width()>1025&&!e(".mystickyelements-fixed").hasClass("mystickyelements-position-bottom")&&e("#mystickyelements-contact-form .element-contact-form").css("top","-"+c+"px"),e(window).width()<1024&&!e(".mystickyelements-fixed").hasClass("mystickyelements-position-mobile-bottom")&&e("#mystickyelements-contact-form .element-contact-form").css("top","-"+c+"px"),e("#mystickyelements-contact-form .element-contact-form").css("overflowY",""),e("#mystickyelements-contact-form .element-contact-form").css("max-height","")}}var y="";/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(y="mobile-");var h=0;e(".mystickyelements-fixed ul li").each((function(){if(e(this).hasClass("elements-active")&&!e(this).parents(".mystickyelements-fixed").hasClass("mystickyelements-on-click")&&e(this).parents(".mystickyelements-fixed").addClass("mystickyelements-on-click"),"1"===mystickyelements.google_analytics&&!0!==e(this).hasClass("mystickyelements-minimize")&&"mystickyelements-contact-form"!==e(this).attr("id"))if(0!==e(this).find("a").length){var m=e(this).attr("id").split("mystickyelements-social-");e(this).find("a").addClass("update-analytics"),e(this).find("a").attr("data-social-slug",m[1])}else e(this).addClass("analytics-update");e(".mystickyelements-position-"+y+"left #"+e(this).attr("id")+" .mystickyelements-social-icon").css("border-radius",""),e(".mystickyelements-position-"+y+"right #"+e(this).attr("id")+" .mystickyelements-social-icon").css("border-radius",""),0==i&&(e(window).width()>1024&&!e(this).hasClass("element-desktop-on")&&(n=!0),e(window).width()<1025&&!e(this).hasClass("element-mobile-on")&&(n=!0)),1==i&&!0===n&&(e(window).width()>1024&&(s=e(this).attr("id")),e(window).width()<1025&&(s=e(this).attr("id"))),e(window).width()>1024&&e(this).hasClass("element-desktop-on")&&(t=e(this).attr("id")),e(window).width()<1025&&e(this).hasClass("element-mobile-on")&&(t=e(this).attr("id"),h++),i++})),e(".mystickyelements-fixed.mystickyelements-position-mobile-bottom").addClass("mystickyelements-bottom-social-channel-"+h),e(".mystickyelements-fixed.mystickyelements-position-mobile-top").addClass("mystickyelements-top-social-channel-"+h),""!=t?"mystickyelements-contact-form"===t?(e(".mystickyelements-position-"+y+"left #"+t+" .mystickyelements-social-icon").css("border-bottom-left-radius","10px"),e(".mystickyelements-position-"+y+"right #"+t+" .mystickyelements-social-icon").css("border-top-left-radius","10px"),e(".mystickyelements-position-"+y+"bottom #"+t+" .mystickyelements-social-icon").css("border-top-right-radius","10px"),1!==e("li.mystickyelements-minimize").length&&(e(".mystickyelements-position-"+y+"left #"+t+" .mystickyelements-social-icon").css("border-bottom-right-radius","10px"),e(".mystickyelements-position-"+y+"right #"+t+" .mystickyelements-social-icon").css("border-top-right-radius","10px"))):"mystickyelements-contact-form"!==t&&(1===i?(e(".mystickyelements-position-"+y+"left #"+t+" .mystickyelements-social-icon").css("border-radius","0px 10px 10px 0"),e(".mystickyelements-position"+y+"-right #"+t+" .mystickyelements-social-icon").css("border-radius","10px 0 0 10px")):(e(".mystickyelements-position-"+y+"left #"+t+" .mystickyelements-social-icon").css("border-bottom-right-radius","10px"),e(".mystickyelements-position-"+y+"right #"+t+" .mystickyelements-social-icon").css("border-bottom-left-radius","10px"),e(".mystickyelements-position-"+y+"bottom #"+t+" .mystickyelements-social-icon").css("border-top-right-radius","10px"))):(e(".mystickyelement-credit").hide(),e(".mystickyelements-fixed").hide()),""!=s&&"mystickyelements-contact-form"!==s&&1!==e("li.mystickyelements-minimize").length&&(e(".mystickyelements-position-"+y+"left #"+s+" .mystickyelements-social-icon").css("border-top-right-radius","10px"),e(".mystickyelements-position-"+y+"right #"+s+" .mystickyelements-social-icon").css("border-top-left-radius","10px"),e(".mystickyelements-position-"+y+"bottom #"+s+" .mystickyelements-social-icon").css("border-top-left-radius","10px"))}function r(e){e.parent().parent().removeClass("elements-active")}e(document).ready((function(){function t(e){e.find("a").attr("href","#"),m++,o=0}function s(e,t){o=1,m++,e.find("a").attr("href",t)}function i(i,n){var l=i.data("tab-setting"),a=(i.data("click"),i.find("a").data("url"));"mobile"==n?function(i,n,l,a){if("hover"==n&&"enable"==i.data("mobile-behavior")){if(i.data("click","1"),0!=m)return void s(i,a);t(i)}else if("click"==n&&"enable"==i.data("flyout")){if(i.data("click","1"),0!=m)return void s(i,a);t(i)}else{if("click"==n&&"disable"==i.data("flyout"))return i.children("a").length?e(".mystickyelements-on-click .elements-active").removeClass("elements-active"):i.parent("li").addClass("elements-active"),void(o=1);o=1}}(i,l,0,a):function(i,n,l,a){if("enable"==i.data("flyout")){if(i.data("click","1"),0!=m)return void s(i,a);t(i)}else if("disable"==i.data("flyout"))i.children("a").length?e(".mystickyelements-on-click .elements-active").removeClass("elements-active"):i.parent("li").addClass("elements-active"),o=1,i.find("a").attr("href",a)}(i,0,0,a)}(e(".mystickyelements-fixed .mystickyelements-lists").each((function(){var t=e(this),s=(t.data("mystickyelement-widget"),MSEGetStorageWithExpiry("minimize_desktop")),i=MSEGetStorageWithExpiry("minimize_mobile");"minimize"!=s&&"minimize"!=i||(t.addClass("mystickyelement-minimize"),t.find(".mystickyelements-minimize").addClass("element-minimize"),t.find(".mystickyelements-minimize span").hasClass("minimize-position-left")?t.find(".mystickyelements-minimize span").html("&rarr;"):t.find(".mystickyelements-minimize span").html("&larr;")),"closed"==MSEGetStorageWithExpiry("closed_contactform")&&t.find(".mystickyelements-contact-form").removeClass("elements-open-form-active")})),"true"==localStorage.getItem("elements-default-active")?e(".mystickyelements-social-icon-li,.mystickyelements-contact-form").removeClass("elements-active"):(1==e(".mystickyelements-social-icon-li").hasClass("elements-default-active")&&e(".mystickyelements-social-icon-li.elements-default-active").addClass("elements-active elements-hover-active"),1==e(".mystickyelements-contact-form").hasClass("elements-default-active")&&e(".mystickyelements-contact-form.elements-default-active").addClass("elements-active elements-hover-active")),"closed"==MSEGetStorageWithExpiry("hide_mystickyelements")&&e(".mystickyelements-fixed").each((function(){jQuery(this).hide()})),e(".elements-open-form-active").each((function(){var t=e(this),s=e(this).data("time-delay");setTimeout((function(e){e.addClass("elements-active")}),1e3*s,t)})),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&e(".mystickyelements-fixed").addClass("mystickyelements-on-click").removeClass("mystickyelements-on-hover"),e("#stickyelements-form").on("submit",(function(t){t.preventDefault();var s=e(this).data("close-after");e("#stickyelements-form .mse-input-error").removeClass("mse-input-error"),e("#stickyelements-form .mse-input-message").remove();var i=0;e("#stickyelements-form .required").length&&e("#stickyelements-form .required").each((function(){""==e.trim(e(this).val())&&(e(this).addClass("mse-input-error"),e(this).after("<span class='mse-input-message'>This field is required</span>"),i++)})),e("#stickyelements-form .email.required:not(.mse-input-error)").length&&e("#stickyelements-form .email.required:not(.mse-input-error)").each((function(){var t=e.trim(e(this).val());/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(t)||(e(this).addClass("mse-input-error"),e(this).after("<span class='mse-input-message'>Email address is not valid</span>"),i++)}));var n=e(this).find(".iti__selected-dial-code").text(),m="action=mystickyelements_contact_form&"+jQuery("form#stickyelements-form").serialize()+"&security="+mystickyelements.ajax_nonce;return""!=n&&(m="action=mystickyelements_contact_form&"+jQuery("form#stickyelements-form").serialize()+"&security="+mystickyelements.ajax_nonce+"&contact_code="+n),0==i&&jQuery.ajax({url:mystickyelements.ajaxurl,type:"post",data:m,beforeSend:function(){e("#stickyelements-submit-form").prop("disabled",!0)},success:function(t){if(e("#stickyelements-submit-form").prop("disabled",!1),e("#stickyelements-form .mse-input-error").removeClass("mse-input-error"),e("#stickyelements-form .mse-input-message").remove(),"1"==(t=e.parseJSON(t)).error)for(var i=0;i<t.errors.length;i++)"mse-form-error"!=t.errors[i].key?(e("#stickyelements-form #"+t.errors[i].key).addClass("mse-input-error"),e("#stickyelements-form #"+t.errors[i].key).after("<span class='mse-input-message'>"+t.errors[i].message+"</span>")):(e("#mse-form-error").removeClass("mse-form-success-message").addClass("mse-form-error-message").show(),e("#mse-form-error").html(t.errors[i].message));else"0"==t.status?(e("#mse-form-error").removeClass("mse-form-success-message").addClass("mse-form-error-message").show(),e("#mse-form-error").html(t.message)):(e("#mse-form-error").removeClass("mse-form-error-message").addClass("mse-form-success-message").show(),e("#mse-form-error").html(t.message),e('#stickyelements-form input[type="text"], #stickyelements-form input[type="tel"], #stickyelements-form input[type="email"]').val(""),e("#stickyelements-form textarea").val(""),MSESetStorageWithExpiry("closed_contactform","closed",MSE_STORAGE_EXPIRY_1_DAY));return setTimeout((function(){e(".mse-form-success-message").slideUp("slow")}),5e3),1==t.status&&""!=t.redirect_link?window.location=t.redirect_link:void 0!==s&&""!=s&&(s*=1e3,setTimeout((function(){e(".mystickyelements-fixed .mystickyelements-contact-form ").removeClass("elements-active"),e(".mystickyelements-fixed .mystickyelements-contact-form ").removeClass("element-contact-active")}),s)),!1}}),!1})),e(".mystickyelements-on-click .mystickyelements-social-icon").on("click touch",(function(t){var s=e(this).data("click"),n=l(),a=e(this);(e(this).parent("li").hasClass("mystickyelements-contact-form")||("0"==s&&(e(".mystickyelements-social-icon").data("click","0"),m=0),i(a,n),1!=o))&&(e(this).parent("li").hasClass("elements-active")?(e(this).parent("li").removeClass("elements-active"),MSESetStorageWithExpiry("closed_contactform","closed",MSE_STORAGE_EXPIRY_1_DAY),t.preventDefault()):(e(".mystickyelements-on-click .elements-active").removeClass("elements-active"),e(this).parent("li").addClass("elements-active")))})),e(".mystickyelements-on-hover .mystickyelements-social-icon").on("click",(function(t){e(this).parent("li").hasClass("elements-active")&&0==e(this).children("a").length&&(e(this).parent("li").removeClass("elements-hover-active"),t.preventDefault(),e(this).parent().parent().parent().parent(".mystickyelements-on-hover").removeClass("mystickyelements-on-click"))})),e(".mystickyelements-on-hover .mystickyelements-social-icon-li").on("mouseenter",(function(){e(this).hasClass("elements-active"),e(this).hasClass("elements-active")||(e(".mystickyelements-on-click .elements-active").removeClass("elements-active"),e(this).addClass("elements-active"),e(this).addClass("elements-hover-active"),e(this).parent().parent().parent(".mystickyelements-on-hover").addClass("mystickyelements-on-click"))})).on("mouseleave",(function(){e(this).removeClass("elements-active"),e(this).removeClass("elements-hover-active"),e(this).parent().parent().parent(".mystickyelements-on-hover").removeClass("mystickyelements-on-click"),(e(".mystickyelements-social-icon-li").hasClass("elements-default-active")||e(".mystickyelements-contact-form").hasClass("elements-default-active"))&&localStorage.setItem("elements-default-active",!0)})),e(".mystickyelements-on-hover ul li.mystickyelements-contact-form").on("mouseenter",(function(){e(this).parents(".mystickyelement-lists-wrap").find("li.elements-active").removeClass("elements-active elements-hover-active"),e(this).addClass("element-contact-active")})).on("mouseleave",(function(){e(this).removeClass("element-contact-active"),(e(".mystickyelements-social-icon-li").hasClass("elements-default-active")||e(".mystickyelements-contact-form").hasClass("elements-default-active"))&&localStorage.setItem("elements-default-active",!0)})),e(".element-contact-close").on("click touch",(function(t){e(".mystickyelements-contact-form").removeClass("elements-active"),e(".mystickyelements-contact-form").removeClass("element-contact-active"),MSESetStorageWithExpiry("closed_contactform","closed",MSE_STORAGE_EXPIRY_1_DAY),(e(".mystickyelements-social-icon-li").hasClass("elements-default-active")||e(".mystickyelements-contact-form").hasClass("elements-default-active"))&&localStorage.setItem("elements-default-active",!0)})),e("#stickyelements-form input:not(#stickyelements-submit-form), #stickyelements-form textarea ").on("keyup",(function(t){e(this).val()&&(e(this).css("background-color","#EFF5F8"),e(this).css("border-color","#7761DF"))})),c(),e("li.mystickyelements-minimize").on("click",(function(t){var s,i,n,m;e(this).toggleClass("element-minimize"),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?(i="mobile",n="mobile-",m="element-mobile-on"):(i="desktop",n="",m="element-desktop-on"),!0===e(this).hasClass("element-minimize")?(MSESetStorageWithExpiry("minimize_"+i,"minimize",MSE_STORAGE_EXPIRY_1_DAY),s=!0):(MSESetStorageWithExpiry("minimize_"+i,"minimize_not",MSE_STORAGE_EXPIRY_1_DAY),s=!1),e(".mystickyelements-position-"+n+"left ul li").each((function(){1==e(this).hasClass(m)&&(1==e(".mystickyelements-fixed").hasClass("mystickyelements-size-large")?e(this).animate({width:"toggle",left:!0===s?"-=80":""}):e(this).animate({width:"toggle",left:!0===s?"-=50":""}))})),e(".mystickyelements-position-"+n+"right ul li").each((function(){1==e(this).hasClass(m)&&(1==e(".mystickyelements-fixed").hasClass("mystickyelements-size-large")?e(this).animate({width:"toggle",left:!0===s?"+=80":""},300,(function(){})):e(this).animate({width:"toggle",left:!0===s?"+=50":""},300,(function(){})))})),e(".mystickyelements-position-"+n+"bottom ul li").each((function(){1==e(this).hasClass(m)&&(e(this).css("position","relative"),1==e(".mystickyelements-fixed").hasClass("mystickyelements-size-large")?e(this).animate({height:"toggle",bottom:!0===s?"-=80":""},300,(function(){e(this).css("position",!0===s?"relative":"static")})):e(this).animate({height:"toggle",bottom:!0===s?"-=60":""},300,(function(){e(this).css("position",!0===s?"relative":"static")})))})),e(".mystickyelements-position-"+n+"top ul li").each((function(){1==e(this).hasClass(m)&&(e(this).css("position","relative"),1==e(".mystickyelements-fixed").hasClass("mystickyelements-size-large")?e(this).animate({height:"toggle",top:!0===s?"-=80":""},300,(function(){e(this).css("position",!0===s?"relative":"static")})):e(this).animate({height:"toggle",top:!0===s?"-=60":""},300,(function(){e(this).css("position",!0===s?"relative":"static")})))})),!0===e("span.mystickyelements-minimize").hasClass("minimize-position-"+n+"left")?!0===e("li.mystickyelements-minimize").hasClass("element-minimize")?e(".mystickyelements-minimize.minimize-position-"+n+"left").html("&rarr;"):e(".mystickyelements-minimize.minimize-position-"+n+"left").html("&larr;"):!0===e("span.mystickyelements-minimize").hasClass("minimize-position-"+n+"bottom")?!0===e("li.mystickyelements-minimize").hasClass("element-minimize")?e(".mystickyelements-minimize.minimize-position-"+n+"bottom").html("&uarr;"):e(".mystickyelements-minimize.minimize-position-"+n+"bottom").html("&darr;"):!0===e("span.mystickyelements-minimize").hasClass("minimize-position-"+n+"top")?!0===e("li.mystickyelements-minimize").hasClass("element-minimize")?e(".mystickyelements-minimize.minimize-position-"+n+"top").html("&darr;"):e(".mystickyelements-minimize.minimize-position-"+n+"top").html("&uarr;"):!0===e("li.mystickyelements-minimize").hasClass("element-minimize")?e(".mystickyelements-minimize.minimize-position-"+n+"right").html("&larr;"):e(".mystickyelements-minimize.minimize-position-"+n+"right").html("&rarr;")})),e(".mystickyelements-fixed ul li").each((function(){if(e(this).hasClass("mystickyelements-custom-html-main")&&e(this).hasClass("mystickyelements-custom-html-iframe"))e(this).find(".mystickyelements-custom-html").height(),e(".mystickyelements-fixed ul").height()})),setTimeout((function(){e(".mystickyelements-entry-effect-fade.entry-effect,.mystickyelements-entry-effect-slide-in.entry-effect").css("transition","all 0s ease 0s")}),1e3),e(".mystickyelements-fixed ul li").on("click",(function(){e(this).hasClass("mystickyelements-custom-html-iframe")?e(".mystickyelements-fixed").toggleClass("mystickyelements-custom-html-iframe-open"):e(".mystickyelements-fixed").removeClass("mystickyelements-custom-html-iframe-open")})),e(".mystickyelements-fixed").addClass("entry-effect"),e(window).width()>1024)&&(e(".mystickyelements-position-bottom .mystickyelements-lists").width()<300&&e(".mystickyelements-position-bottom .mystickyelements-contact-form .element-contact-form").width("300"));if(a(),1==e("#phone_formate").val()){var n=document.querySelector("#contact-form-phone");window.intlTelInput(n,{dropdownContainer:document.body,initialCountry:"auto",separateDialCode:!0,utilsScript:mystickyelements.plugin_url+"intl-tel-input-src/build/js/utils.js"});e("#contact-form-phone").addClass("tel_formate")}})),e(window).on("resize",(function(){c(),a()})),jQuery(document).on("click",".mystickyelements-social-text a",(function(){m=0,r(e(this))})),jQuery(document).on("click",".mystickyelements-social-icon a",(function(){var t=l(),s=e(this);"mobile"==t?"hover"==e(this).data("tab-setting")&&"enable"!==e(this).data("mobile-behavior")||"click"==e(this).data("tab-setting")&&"enable"!==e(this).data("flyout")?r(s):m>1&&(r(s),m=0):"enable"!==e(this).data("flyout")?r(s):m>1&&(r(s),m=0)})),jQuery("body").mouseup((function(t){0===e(t.target).closest(".mystickyelement-lists-wrap").length&&(m=0,jQuery(".mystickyelements-social-icon-li,.mystickyelements-contact-form").removeClass("elements-active"),(e(".mystickyelements-social-icon-li").hasClass("elements-default-active")||e(".mystickyelements-contact-form").hasClass("elements-default-active"))&&localStorage.setItem("elements-default-active",!0))})),jQuery(document).on("click",".iti--allow-dropdown",(function(){jQuery(this).closest(".mystickyelements-contact-form").addClass("country-code-trigger"),jQuery(this).closest(".mystickyelements-contact-form").removeClass("element-contact-active"),jQuery(this).closest(".mystickyelements-contact-form").addClass("elements-active")})),jQuery(document).on("click","ul.iti__country-list li",(function(){e(".mystickyelements-contact-form").each((function(t){"hover"==jQuery(this).data("tab-opt")&&1==e(this).data("isphone-formate")&&e(this).hasClass("elements-active")?(jQuery(this).addClass("element-contact-active"),jQuery(this).removeClass("elements-active"),jQuery(this).removeClass("country-code-trigger")):(jQuery(this).removeClass("element-contact-active"),jQuery(this).addClass("elements-active"),jQuery(this).removeClass("country-code-trigger"))}))}))}(jQuery);
document.documentElement.className+=" js_active ",document.documentElement.className+="ontouchstart"in document.documentElement?" vc_mobile ":" vc_desktop ",function(){for(var prefix=["-webkit-","-moz-","-ms-","-o-",""],i=0;i<prefix.length;i++)prefix[i]+"transform"in document.documentElement.style&&(document.documentElement.className+=" vc_transform ")}(),function($){"function"!=typeof window.vc_js&&(window.vc_js=function(){"use strict";vc_toggleBehaviour(),vc_tabsBehaviour(),vc_accordionBehaviour(),vc_teaserGrid(),vc_carouselBehaviour(),vc_slidersBehaviour(),vc_prettyPhoto(),vc_pinterest(),vc_progress_bar(),vc_plugin_flexslider(),vc_gridBehaviour(),vc_rowBehaviour(),vc_prepareHoverBox(),vc_googleMapsPointer(),vc_ttaActivation(),jQuery(document).trigger("vc_js"),window.setTimeout(vc_waypoints,500)}),"function"!=typeof window.vc_plugin_flexslider&&(window.vc_plugin_flexslider=function($parent){($parent?$parent.find(".wpb_flexslider"):jQuery(".wpb_flexslider")).each(function(){var this_element=jQuery(this),sliderTimeout=1e3*parseInt(this_element.attr("data-interval"),10),sliderFx=this_element.attr("data-flex_fx"),slideshow=0==sliderTimeout?!1:!0;this_element.is(":visible")&&this_element.flexslider({animation:sliderFx,slideshow:slideshow,slideshowSpeed:sliderTimeout,sliderSpeed:800,smoothHeight:!0})})}),"function"!=typeof window.vc_googleplus&&(window.vc_googleplus=function(){var po,s;0<jQuery(".wpb_googleplus").length&&((po=document.createElement("script")).type="text/javascript",po.async=!0,po.src="https://apis.google.com/js/plusone.js",(s=document.getElementsByTagName("script")[0]).parentNode.insertBefore(po,s))}),"function"!=typeof window.vc_pinterest&&(window.vc_pinterest=function(){var po,s;0<jQuery(".wpb_pinterest").length&&((po=document.createElement("script")).type="text/javascript",po.async=!0,po.src="https://assets.pinterest.com/js/pinit.js",(s=document.getElementsByTagName("script")[0]).parentNode.insertBefore(po,s))}),"function"!=typeof window.vc_progress_bar&&(window.vc_progress_bar=function(){void 0!==jQuery.fn.vcwaypoint&&jQuery(".vc_progress_bar").each(function(){var $el=jQuery(this);$el.vcwaypoint(function(){$el.find(".vc_single_bar").each(function(index){var bar=jQuery(this).find(".vc_bar"),val=bar.data("percentage-value");setTimeout(function(){bar.css({width:val+"%"})},200*index)})},{offset:"85%"})})}),"function"!=typeof window.vc_waypoints&&(window.vc_waypoints=function(){void 0!==jQuery.fn.vcwaypoint&&jQuery(".wpb_animate_when_almost_visible:not(.wpb_start_animation)").each(function(){var $el=jQuery(this);$el.vcwaypoint(function(){$el.addClass("wpb_start_animation animated")},{offset:"85%"})})}),"function"!=typeof window.vc_toggleBehaviour&&(window.vc_toggleBehaviour=function($el){function event(e){e&&e.preventDefault&&e.preventDefault();var element=jQuery(this).closest(".vc_toggle"),e=element.find(".vc_toggle_content");element.hasClass("vc_toggle_active")?e.slideUp({duration:300,complete:function(){element.removeClass("vc_toggle_active")}}):e.slideDown({duration:300,complete:function(){element.addClass("vc_toggle_active")}})}($el?$el.hasClass("vc_toggle_title")?$el.unbind("click"):$el.find(".vc_toggle_title").off("click"):jQuery(".vc_toggle_title").off("click")).on("click",event)}),"function"!=typeof window.vc_tabsBehaviour&&(window.vc_tabsBehaviour=function($tab){var ver,old_version;jQuery.ui&&($tab=$tab||jQuery(".wpb_tabs, .wpb_tour"),ver=jQuery.ui&&jQuery.ui.version?jQuery.ui.version.split("."):"1.10",old_version=1===parseInt(ver[0],10)&&parseInt(ver[1],10)<9,$tab.each(function(index){var interval=jQuery(this).attr("data-interval"),tabs_array=[],$tabs=jQuery(this).find(".wpb_tour_tabs_wrapper").tabs({show:function(event,ui){wpb_prepare_tab_content(event,ui)},activate:function(event,ui){wpb_prepare_tab_content(event,ui)}});if(interval&&0<interval)try{$tabs.tabs("rotate",1e3*interval)}catch(err){window.console&&window.console.warn&&console.warn("tabs behaviours error",err)}jQuery(this).find(".wpb_tab").each(function(){tabs_array.push(this.id)}),jQuery(this).find(".wpb_tabs_nav li").on("click",function(e){return e&&e.preventDefault&&e.preventDefault(),old_version?$tabs.tabs("select",jQuery("a",this).attr("href")):$tabs.tabs("option","active",jQuery(this).index()),!1}),jQuery(this).find(".wpb_prev_slide a, .wpb_next_slide a").on("click",function(e){var index;e&&e.preventDefault&&e.preventDefault(),old_version?(index=$tabs.tabs("option","selected"),jQuery(this).parent().hasClass("wpb_next_slide")?index++:index--,index<0?index=$tabs.tabs("length")-1:index>=$tabs.tabs("length")&&(index=0),$tabs.tabs("select",index)):(index=$tabs.tabs("option","active"),e=$tabs.find(".wpb_tab").length,index=jQuery(this).parent().hasClass("wpb_next_slide")?e<=index+1?0:index+1:index-1<0?e-1:index-1,$tabs.tabs("option","active",index))})}))}),"function"!=typeof window.vc_accordionBehaviour&&(window.vc_accordionBehaviour=function(){jQuery(".wpb_accordion").each(function(index){var $this=jQuery(this),active_tab=($this.attr("data-interval"),!isNaN(jQuery(this).data("active-tab"))&&0<parseInt($this.data("active-tab"),10)&&parseInt($this.data("active-tab"),10)-1),collapsible=!1===active_tab||"yes"===$this.data("collapsible"),active_tab=$this.find(".wpb_accordion_wrapper").accordion({header:"> div > h3",autoHeight:!1,heightStyle:"content",active:active_tab,collapsible:collapsible,navigation:!0,activate:vc_accordionActivate,change:function(event,ui){void 0!==jQuery.fn.isotope&&ui.newContent.find(".isotope").isotope("layout"),vc_carouselBehaviour(ui.newPanel)}});!0===$this.data("vcDisableKeydown")&&(active_tab.data("uiAccordion")._keydown=function(){})})}),"function"!=typeof window.vc_teaserGrid&&(window.vc_teaserGrid=function(){var layout_modes={fitrows:"fitRows",masonry:"masonry"};jQuery(".wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)").each(function(){var $container=jQuery(this),$thumbs=$container.find(".wpb_thumbnails"),layout_mode=$thumbs.attr("data-layout-mode");$thumbs.isotope({itemSelector:".isotope-item",layoutMode:void 0===layout_modes[layout_mode]?"fitRows":layout_modes[layout_mode]}),$container.find(".categories_filter a").data("isotope",$thumbs).on("click",function(e){e&&e.preventDefault&&e.preventDefault();e=jQuery(this).data("isotope");jQuery(this).parent().parent().find(".active").removeClass("active"),jQuery(this).parent().addClass("active"),e.isotope({filter:jQuery(this).attr("data-filter")})}),jQuery(window).on("load resize",function(){$thumbs.isotope("layout")})})}),"function"!=typeof window.vc_carouselBehaviour&&(window.vc_carouselBehaviour=function($parent){($parent?$parent.find(".wpb_carousel"):jQuery(".wpb_carousel")).each(function(){var $this=jQuery(this);!0!==$this.data("carousel_enabled")&&$this.is(":visible")&&($this.data("carousel_enabled",!0),getColumnsCount(jQuery(this)),jQuery(this).hasClass("columns_count_1"),($this=jQuery(this).find(".wpb_thumbnails-fluid li")).css({"margin-right":$this.css("margin-left"),"margin-left":0}),($this=jQuery(this).find("ul.wpb_thumbnails-fluid")).width($this.width()+300))})}),"function"!=typeof window.vc_slidersBehaviour&&(window.vc_slidersBehaviour=function(){jQuery(".wpb_gallery_slides").each(function(index){var $imagesGrid,sliderTimeout,this_element=jQuery(this);this_element.hasClass("wpb_slider_nivo")?(0===(sliderTimeout=1e3*this_element.attr("data-interval"))&&(sliderTimeout=9999999999),this_element.find(".nivoSlider").nivoSlider({effect:"boxRainGrow,boxRain,boxRainReverse,boxRainGrowReverse",slices:15,boxCols:8,boxRows:4,animSpeed:800,pauseTime:sliderTimeout,startSlide:0,directionNav:!0,directionNavHide:!0,controlNav:!0,keyboardNav:!1,pauseOnHover:!0,manualAdvance:!1,prevText:"Prev",nextText:"Next"})):this_element.hasClass("wpb_image_grid")&&(jQuery.fn.imagesLoaded?$imagesGrid=this_element.find(".wpb_image_grid_ul").imagesLoaded(function(){$imagesGrid.isotope({itemSelector:".isotope-item",layoutMode:"fitRows"})}):this_element.find(".wpb_image_grid_ul").isotope({itemSelector:".isotope-item",layoutMode:"fitRows"}))})}),"function"!=typeof window.vc_prettyPhoto&&(window.vc_prettyPhoto=function(){try{jQuery&&jQuery.fn&&jQuery.fn.prettyPhoto&&jQuery('a.prettyphoto, .gallery-icon a[href*=".jpg"]').prettyPhoto({animationSpeed:"normal",hook:"data-rel",padding:15,opacity:.7,showTitle:!0,allowresize:!0,counter_separator_label:"/",hideflash:!1,deeplinking:!1,modal:!1,callback:function(){-1<location.href.indexOf("#!prettyPhoto")&&(location.hash="")},social_tools:""})}catch(err){window.console&&window.console.warn&&window.console.warn("vc_prettyPhoto initialize error",err)}}),"function"!=typeof window.vc_google_fonts&&(window.vc_google_fonts=function(){return window.console&&window.console.warn&&window.console.warn("function vc_google_fonts is deprecated, no need to use it"),!1}),window.vcParallaxSkroll=!1,"function"!=typeof window.vc_rowBehaviour&&(window.vc_rowBehaviour=function(){var $=window.jQuery,currentThemeSlug=window.vcData.currentTheme.slug;function fullWidthRow(){var $elements;void 0!==window.wpb_disable_full_width_row_js&&window.wpb_disable_full_width_row_js||($elements=$('[data-vc-full-width="true"]'),$.each($elements,function(key,item){var el_margin_left,el_margin_right,offset,width,cssProps,padding,paddingRight,$el=$(this),$el_full=($el.addClass("vc_hidden"),$el.next(".vc_row-full-width"));($el_full=$el_full.length?$el_full:$el.parent().next(".vc_row-full-width")).length&&(el_margin_left=parseInt($el.css("margin-left"),10),el_margin_right=parseInt($el.css("margin-right"),10),offset=0-$el_full.offset().left-el_margin_left,width=$(window).width(),cssProps={position:"relative",left:offset="rtl"===$el.css("direction")?(offset=offset-$el_full.width()+width)+el_margin_left+el_margin_right:offset,"box-sizing":"border-box",width:width,"max-width":width},"twentytwenty"===currentThemeSlug?(cssProps.left=0,cssProps.marginLeft=0):"twentytwentyone"===currentThemeSlug?cssProps.left=0:"twentytwentytwo"===currentThemeSlug&&(cssProps.left=-$el_full.position().left+"px"),$el.css(cssProps),$el.data("vcStretchContent")||("rtl"===$el.css("direction")?((padding=offset)<0&&(padding=0),(paddingRight=offset)<0&&(paddingRight=0)):(paddingRight=width-(padding=(padding=-1*offset)<0?0:padding)-$el_full.width()+el_margin_left+el_margin_right)<0&&(paddingRight=0),$el.css({"padding-left":padding+"px","padding-right":paddingRight+"px"})),$el.attr("data-vc-full-width-init","true"),$el.removeClass("vc_hidden"),$(document).trigger("vc-full-width-row-single",{el:$el,offset:offset,marginLeft:el_margin_left,marginRight:el_margin_right,elFull:$el_full,width:width,maxWidth:width}))}),$(document).trigger("vc-full-width-row",$elements))}function fullHeightRow(){var windowHeight,offsetTop,$element=$(".vc_row-o-full-height:first");$element.length&&(windowHeight=$(window).height(),(offsetTop=$element.offset().top)<windowHeight&&$element.css("min-height",100-offsetTop/(windowHeight/100)+"vh")),$(document).trigger("vc-full-height-row",$element)}$(window).off("resize.vcRowBehaviour").on("resize.vcRowBehaviour",fullWidthRow).on("resize.vcRowBehaviour",fullHeightRow),fullWidthRow(),fullHeightRow(),(0<window.navigator.userAgent.indexOf("MSIE ")||navigator.userAgent.match(/Trident.*rv\:11\./))&&$(".vc_row-o-full-height").each(function(){"flex"===$(this).css("display")&&$(this).wrap('<div class="vc_ie-flexbox-fixer"></div>')}),vc_initVideoBackgrounds();var callSkrollInit=!1;if(window.vcParallaxSkroll&&window.vcParallaxSkroll.destroy(),$(".vc_parallax-inner").remove(),$("[data-5p-top-bottom]").removeAttr("data-5p-top-bottom data-30p-top-bottom"),$("[data-vc-parallax]").each(function(){var skrollrSize,$parallaxElement,parallaxImage,youtubeId;callSkrollInit=!0,"on"===$(this).data("vcParallaxOFade")&&$(this).children().attr("data-5p-top-bottom","opacity:0;").attr("data-30p-top-bottom","opacity:1;"),skrollrSize=100*$(this).data("vcParallax"),($parallaxElement=$("<div />").addClass("vc_parallax-inner").appendTo($(this))).height(skrollrSize+"%"),parallaxImage=$(this).data("vcParallaxImage"),(youtubeId=vcExtractYoutubeId(parallaxImage))?insertYoutubeVideoAsBackground($parallaxElement,youtubeId):void 0!==parallaxImage&&$parallaxElement.css("background-image","url("+parallaxImage+")"),$parallaxElement.attr("data-bottom-top","top: "+-(skrollrSize-100)+"%;").attr("data-top-bottom","top: 0%;")}),callSkrollInit&&window.skrollr)window.vcParallaxSkroll=skrollr.init({forceHeight:!1,smoothScrolling:!1,mobileCheck:function(){return!1}}),window.vcParallaxSkroll}),"function"!=typeof window.vc_gridBehaviour&&(window.vc_gridBehaviour=function(){jQuery.fn.vcGrid&&jQuery("[data-vc-grid]").vcGrid()}),"function"!=typeof window.getColumnsCount&&(window.getColumnsCount=function(el){for(var find=!1,i=1;!1===find;){if(el.hasClass("columns_count_"+i))return find=!0,i;i++}}),"function"!=typeof window.wpb_prepare_tab_content&&(window.wpb_prepare_tab_content=function(event,ui){var panel=ui.panel||ui.newPanel,$pie_charts=panel.find(".vc_pie_chart:not(.vc_ready)"),$round_charts=panel.find(".vc_round-chart"),$line_charts=panel.find(".vc_line-chart"),$carousel=panel.find('[data-ride="vc_carousel"]');vc_carouselBehaviour(),vc_plugin_flexslider(panel),ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var grid=jQuery(this).data("vcGrid");grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()}),panel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&panel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var grid=jQuery(this).data("vcGrid");grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()}),$pie_charts.length&&jQuery.fn.vcChat&&$pie_charts.vcChat(),$round_charts.length&&jQuery.fn.vcRoundChart&&$round_charts.vcRoundChart({reload:!1}),$line_charts.length&&jQuery.fn.vcLineChart&&$line_charts.vcLineChart({reload:!1}),$carousel.length&&jQuery.fn.carousel&&$carousel.carousel("resizeAction"),ui=panel.find(".isotope, .wpb_image_grid_ul"),$pie_charts=panel.find(".wpb_gmaps_widget"),0<ui.length&&ui.isotope("layout"),$pie_charts.length&&!$pie_charts.is(".map_ready")&&(($round_charts=$pie_charts.find("iframe")).attr("src",$round_charts.attr("src")),$pie_charts.addClass("map_ready")),panel.parents(".isotope").length&&panel.parents(".isotope").each(function(){jQuery(this).isotope("layout")}),$(document).trigger("wpb_prepare_tab_content",panel)}),"function"!=typeof window.vc_ttaActivation&&(window.vc_ttaActivation=function(){jQuery("[data-vc-accordion]").on("show.vc.accordion",function(e){var $=window.jQuery,ui={};ui.newPanel=$(this).data("vc.accordion").getTarget(),window.wpb_prepare_tab_content(e,ui)})}),"function"!=typeof window.vc_accordionActivate&&(window.vc_accordionActivate=function(event,ui){var $pie_charts,$round_charts,$line_charts,$carousel;ui.newPanel.length&&ui.newHeader.length&&($pie_charts=ui.newPanel.find(".vc_pie_chart:not(.vc_ready)"),$round_charts=ui.newPanel.find(".vc_round-chart"),$line_charts=ui.newPanel.find(".vc_line-chart"),$carousel=ui.newPanel.find('[data-ride="vc_carousel"]'),void 0!==jQuery.fn.isotope&&ui.newPanel.find(".isotope, .wpb_image_grid_ul").isotope("layout"),ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var grid=jQuery(this).data("vcGrid");grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()}),vc_carouselBehaviour(ui.newPanel),vc_plugin_flexslider(ui.newPanel),$pie_charts.length&&jQuery.fn.vcChat&&$pie_charts.vcChat(),$round_charts.length&&jQuery.fn.vcRoundChart&&$round_charts.vcRoundChart({reload:!1}),$line_charts.length&&jQuery.fn.vcLineChart&&$line_charts.vcLineChart({reload:!1}),$carousel.length&&jQuery.fn.carousel&&$carousel.carousel("resizeAction"),ui.newPanel.parents(".isotope").length&&ui.newPanel.parents(".isotope").each(function(){jQuery(this).isotope("layout")}))}),"function"!=typeof window.initVideoBackgrounds&&(window.initVideoBackgrounds=function(){return window.console&&window.console.warn&&window.console.warn("this function is deprecated use vc_initVideoBackgrounds"),vc_initVideoBackgrounds()}),"function"!=typeof window.vc_initVideoBackgrounds&&(window.vc_initVideoBackgrounds=function(){jQuery("[data-vc-video-bg]").each(function(){var youtubeUrl,$element=jQuery(this);$element.data("vcVideoBg")?(youtubeUrl=$element.data("vcVideoBg"),(youtubeUrl=vcExtractYoutubeId(youtubeUrl))&&($element.find(".vc_video-bg").remove(),insertYoutubeVideoAsBackground($element,youtubeUrl)),jQuery(window).on("grid:items:added",function(event,$grid){$element.has($grid).length&&vcResizeVideoBackground($element)})):$element.find(".vc_video-bg").remove()})}),"function"!=typeof window.insertYoutubeVideoAsBackground&&(window.insertYoutubeVideoAsBackground=function($element,youtubeId,counter){if("undefined"==typeof YT||void 0===YT.Player)return 100<(counter=void 0===counter?0:counter)?void console.warn("Too many attempts to load YouTube api"):void setTimeout(function(){insertYoutubeVideoAsBackground($element,youtubeId,counter++)},100);var $container=$element.prepend('<div class="vc_video-bg vc_hidden-xs"><div class="inner"></div></div>').find(".inner");new YT.Player($container[0],{width:"100%",height:"100%",videoId:youtubeId,playerVars:{playlist:youtubeId,iv_load_policy:3,enablejsapi:1,disablekb:1,autoplay:1,controls:0,showinfo:0,rel:0,loop:1,wmode:"transparent"},events:{onReady:function(event){event.target.mute().setLoop(!0)}}}),vcResizeVideoBackground($element),jQuery(window).on("resize",function(){vcResizeVideoBackground($element)})}),"function"!=typeof window.vcResizeVideoBackground&&(window.vcResizeVideoBackground=function($element){var iframeW,iframeH,marginLeft,marginTop,containerW=$element.innerWidth(),containerH=$element.innerHeight();containerW/containerH<16/9?(iframeW=containerH*(16/9),iframeH=containerH,marginLeft=-Math.round((iframeW-containerW)/2)+"px",marginTop=-Math.round((iframeH-containerH)/2)+"px"):(iframeH=(iframeW=containerW)*(9/16),marginTop=-Math.round((iframeH-containerH)/2)+"px",marginLeft=-Math.round((iframeW-containerW)/2)+"px"),iframeW+="px",iframeH+="px",$element.find(".vc_video-bg iframe").css({maxWidth:"1000%",marginLeft:marginLeft,marginTop:marginTop,width:iframeW,height:iframeH})}),"function"!=typeof window.vcExtractYoutubeId&&(window.vcExtractYoutubeId=function(url){if(void 0===url)return!1;url=url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);return null!==url&&url[1]}),"function"!=typeof window.vc_googleMapsPointer&&(window.vc_googleMapsPointer=function(){var $=window.jQuery,$wpbGmapsWidget=$(".wpb_gmaps_widget");$wpbGmapsWidget.on("click",function(){$("iframe",this).css("pointer-events","auto")}),$wpbGmapsWidget.on("mouseleave",function(){$("iframe",this).css("pointer-events","none")}),$(".wpb_gmaps_widget iframe").css("pointer-events","none")}),"function"!=typeof window.vc_setHoverBoxPerspective&&(window.vc_setHoverBoxPerspective=function(hoverBox){hoverBox.each(function(){var $this=jQuery(this),width=$this.width();$this.css("perspective",4*width+"px")})}),"function"!=typeof window.vc_setHoverBoxHeight&&(window.vc_setHoverBoxHeight=function(hoverBox){hoverBox.each(function(){var $this=jQuery(this),hoverBoxInner=$this.find(".vc-hoverbox-inner"),frontHeight=(hoverBoxInner.css("min-height",0),$this.find(".vc-hoverbox-front-inner").outerHeight()),$this=$this.find(".vc-hoverbox-back-inner").outerHeight(),frontHeight=$this<frontHeight?frontHeight:$this;hoverBoxInner.css("min-height",(frontHeight=frontHeight<250?250:frontHeight)+"px")})}),"function"!=typeof window.vc_prepareHoverBox&&(window.vc_prepareHoverBox=function(){var hoverBox=jQuery(".vc-hoverbox");vc_setHoverBoxHeight(hoverBox),vc_setHoverBoxPerspective(hoverBox)}),jQuery(document).ready(window.vc_prepareHoverBox),jQuery(window).on("resize",window.vc_prepareHoverBox),jQuery(document).ready(function($){window.vc_js()})}(window.jQuery);