File: //var/www/quadcode/dist/whiteLabel.9160f78b3931b8ea9467.js
(()=>{var e={711:()=>{try{var e=new window.CustomEvent("test");if(e.preventDefault(),!0!==e.defaultPrevented)throw new Error("Could not prevent default")}catch(e){var t=function(e,t){var n,i;return t=t||{bubbles:!1,cancelable:!1,detail:void 0},(n=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i=n.preventDefault,n.preventDefault=function(){i.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};t.prototype=window.Event.prototype,window.CustomEvent=t}},60:(e,t,n)=>{"use strict";var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e};t.Z=function(e,t){var n=[],s=[];return function(){if(e&&e instanceof HTMLElement&&"SELECT"===e.tagName.toUpperCase())n.push(e);else if(e&&"string"==typeof e)for(var r=document.querySelectorAll(e),l=0,u=r.length;l<u;++l)r[l]instanceof HTMLElement&&"SELECT"===r[l].tagName.toUpperCase()&&n.push(r[l]);else if(e&&e.length)for(var c=0,d=e.length;c<d;++c)e[c]instanceof HTMLElement&&"SELECT"===e[c].tagName.toUpperCase()&&n.push(e[c]);for(var h=0,p=n.length;h<p;++h)s.push(a(n[h],i({},o,t)));return s}()},n(711);var o={containerClass:"custom-select-container",openerClass:"custom-select-opener",panelClass:"custom-select-panel",optionClass:"custom-select-option",optgroupClass:"custom-select-optgroup",isSelectedClass:"is-selected",hasFocusClass:"has-focus",isDisabledClass:"is-disabled",isOpenClass:"is-open"};function a(e,t){var n=!1,i="",o=e,a=void 0,s=void 0,r=void 0,l=void 0,u=void 0,c=void 0,d=void 0,h="";function p(e){r&&r.classList.remove(t.hasFocusClass),void 0!==e?((r=e).classList.add(t.hasFocusClass),n&&(e.offsetTop<e.offsetParent.scrollTop||e.offsetTop>e.offsetParent.scrollTop+e.offsetParent.clientHeight-e.clientHeight)&&e.dispatchEvent(new CustomEvent("custom-select:focus-outside-panel",{bubbles:!0}))):r=void 0}function m(e){l&&(l.classList.remove(t.isSelectedClass),l.removeAttribute("id"),s.removeAttribute("aria-activedescendant")),void 0!==e?(e.classList.add(t.isSelectedClass),e.setAttribute("id","customSelect-"+i+"-selectedOption"),s.setAttribute("aria-activedescendant","customSelect-"+i+"-selectedOption"),l=e,s.children[0].textContent=l.customSelectOriginalOption.text):(l=void 0,s.children[0].textContent=""),p(e)}function v(e){var t=[].indexOf.call(o.options,r.customSelectOriginalOption);o.options[t+e]&&p(o.options[t+e].customSelectCstOption)}function f(e){if(e||void 0===e){var i=document.querySelector(".customSelect."+t.isOpenClass);i&&(i.customSelect.open=!1),a.classList.add(t.isOpenClass),a.classList.add(t.isOpenClass),s.setAttribute("aria-expanded","true"),l&&(u.scrollTop=l.offsetTop),a.dispatchEvent(new CustomEvent("custom-select:open")),n=!0}else a.classList.remove(t.isOpenClass),s.setAttribute("aria-expanded","false"),n=!1,p(l),a.dispatchEvent(new CustomEvent("custom-select:close"));return n}function g(e){e.target===s||s.contains(e.target)?n?f(!1):f():e.target.classList&&e.target.classList.contains(t.optionClass)&&u.contains(e.target)?(m(e.target),l.customSelectOriginalOption.selected=!0,f(!1),o.dispatchEvent(new CustomEvent("change"))):e.target===o?s!==document.activeElement&&o!==document.activeElement&&s.focus():n&&!a.contains(e.target)&&f(!1)}function y(e){e.target.classList&&e.target.classList.contains(t.optionClass)&&p(e.target)}function C(e){if(n)switch(e.keyCode){case 13:case 32:m(r),l.customSelectOriginalOption.selected=!0,o.dispatchEvent(new CustomEvent("change")),f(!1);break;case 27:f(!1);break;case 38:v(-1);break;case 40:v(1);break;default:if(e.keyCode>=48&&e.keyCode<=90){d&&clearTimeout(d),d=setTimeout((function(){h=""}),1500),h+=String.fromCharCode(e.keyCode);for(var t=0,i=o.options.length;t<i;t++)if(o.options[t].text.toUpperCase().substr(0,h.length)===h){p(o.options[t].customSelectCstOption);break}}}else 40!==e.keyCode&&38!==e.keyCode&&32!==e.keyCode||f()}function b(){var e=o.selectedIndex;m(-1===e?void 0:o.options[e].customSelectCstOption)}function _(e){var t=e.currentTarget,n=e.target;n.offsetTop<t.scrollTop?t.scrollTop=n.offsetTop:t.scrollTop=n.offsetTop+n.clientHeight-t.clientHeight}function w(){document.addEventListener("click",g),u.addEventListener("mouseover",y),u.addEventListener("custom-select:focus-outside-panel",_),o.addEventListener("change",b),a.addEventListener("keydown",C)}function L(){document.removeEventListener("click",g),u.removeEventListener("mouseover",y),u.removeEventListener("custom-select:focus-outside-panel",_),o.removeEventListener("change",b),a.removeEventListener("keydown",C)}function E(e){var n=e,i=[];if(void 0===n.length)throw new TypeError("Invalid Argument");for(var o=0,a=n.length;o<a;o++)if(n[o]instanceof HTMLElement&&"OPTGROUP"===n[o].tagName.toUpperCase()){var s=document.createElement("div");s.classList.add(t.optgroupClass),s.setAttribute("data-label",n[o].label),s.customSelectOriginalOptgroup=n[o],n[o].customSelectCstOptgroup=s;for(var r=E(n[o].children),l=0,u=r.length;l<u;l++)s.appendChild(r[l]);i.push(s)}else{if(!(n[o]instanceof HTMLElement&&"OPTION"===n[o].tagName.toUpperCase()))throw new TypeError("Invalid Argument");var c=document.createElement("div");c.classList.add(t.optionClass),c.textContent=n[o].text,c.setAttribute("data-value",n[o].value),c.setAttribute("role","option"),c.customSelectOriginalOption=n[o],n[o].customSelectCstOption=c,n[o].selected&&m(c),i.push(c)}return i}function I(e,t,n){var i=void 0;if(void 0===n||n===o)i=u;else{if(!(n instanceof HTMLElement&&"OPTGROUP"===n.tagName.toUpperCase()&&o.contains(n)))throw new TypeError("Invalid Argument");i=n.customSelectCstOptgroup}var a=e instanceof HTMLElement?[e]:e;if(t)for(var s=0,r=a.length;s<r;s++)i===u?o.appendChild(a[s]):i.customSelectOriginalOptgroup.appendChild(a[s]);for(var l=E(a),c=0,d=l.length;c<d;c++)i.appendChild(l[c]);return a}(a=document.createElement("div")).classList.add(t.containerClass,"customSelect"),(s=document.createElement("span")).className=t.openerClass,s.setAttribute("role","combobox"),s.setAttribute("aria-autocomplete","list"),s.setAttribute("aria-expanded","false"),s.innerHTML="<span>\n "+(-1!==o.selectedIndex?o.options[o.selectedIndex].text:"")+"\n </span>",u=document.createElement("div");for(var k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",S=0;S<5;S++)i+=k.charAt(Math.floor(Math.random()*k.length));return u.id="customSelect-"+i+"-panel",u.className=t.panelClass,u.setAttribute("role","listbox"),s.setAttribute("aria-owns",u.id),I(o.children,!1),a.appendChild(s),o.parentNode.replaceChild(a,o),a.appendChild(o),a.appendChild(u),document.querySelector('label[for="'+o.id+'"]')?c=document.querySelector('label[for="'+o.id+'"]'):"LABEL"===a.parentNode.tagName.toUpperCase()&&(c=a.parentNode),void 0!==c&&(c.setAttribute("id","customSelect-"+i+"-label"),s.setAttribute("aria-labelledby","customSelect-"+i+"-label")),o.disabled?a.classList.add(t.isDisabledClass):(s.setAttribute("tabindex","0"),o.setAttribute("tabindex","-1"),w()),a.customSelect={get pluginOptions(){return t},get open(){return n},set open(e){f(e)},get disabled(){return o.disabled},set disabled(e){!function(e){e&&!o.disabled?(a.classList.add(t.isDisabledClass),o.disabled=!0,s.removeAttribute("tabindex"),a.dispatchEvent(new CustomEvent("custom-select:disabled")),L()):!e&&o.disabled&&(a.classList.remove(t.isDisabledClass),o.disabled=!1,s.setAttribute("tabindex","0"),a.dispatchEvent(new CustomEvent("custom-select:enabled")),w())}(e)},get value(){return o.value},set value(e){var t,n;t=e,(n=o.querySelector("option[value='"+t+"']"))||(n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],i=!0,o=!1,a=void 0;try{for(var s,r=e[Symbol.iterator]();!(i=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{!i&&r.return&&r.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(o.options,1)[0]),n.selected=!0,m(o.options[o.selectedIndex].customSelectCstOption)},append:function(e,t){return I(e,!0,t)},insertBefore:function(e,t){return function(e,t){var n=void 0;if(t instanceof HTMLElement&&"OPTION"===t.tagName.toUpperCase()&&o.contains(t))n=t.customSelectCstOption;else{if(!(t instanceof HTMLElement&&"OPTGROUP"===t.tagName.toUpperCase()&&o.contains(t)))throw new TypeError("Invalid Argument");n=t.customSelectCstOptgroup}var i=E(e.length?e:[e]);return n.parentNode.insertBefore(i[0],n),t.parentNode.insertBefore(e.length?e[0]:e,t)}(e,t)},remove:function(e){var t=void 0;if(e instanceof HTMLElement&&"OPTION"===e.tagName.toUpperCase()&&o.contains(e))t=e.customSelectCstOption;else{if(!(e instanceof HTMLElement&&"OPTGROUP"===e.tagName.toUpperCase()&&o.contains(e)))throw new TypeError("Invalid Argument");t=e.customSelectCstOptgroup}t.parentNode.removeChild(t);var n=e.parentNode.removeChild(e);return b(),n},empty:function(){for(var e=[];o.children.length;)u.removeChild(u.children[0]),e.push(o.removeChild(o.children[0]));return m(),e},destroy:function(){for(var e=0,t=o.options.length;e<t;e++)delete o.options[e].customSelectCstOption;for(var n=o.getElementsByTagName("optgroup"),i=0,s=n.length;i<s;i++)delete n.customSelectCstOptgroup;return L(),a.parentNode.replaceChild(o,a)},opener:s,select:o,panel:u,container:a},o.customSelect=a.customSelect,a.customSelect}},197:e=>{var t;t=function(e){"use strict";return function(){for(var t=[["Afghanistan (افغانستان)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (الجزائر)","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua and Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia (Հայաստան)","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria (Österreich)","at","43"],["Azerbaijan (Azərbaycan)","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain (البحرين)","bh","973"],["Bangladesh (বাংলাদেশ)","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus (Беларусь)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan (འབྲུག)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria (България)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (កម្ពុជា)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (中国)","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros (جزر القمر)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (Κύπρος)","cy","357"],["Czech Republic (Česká republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (مصر)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (საქართველო)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["Gibraltar","gi","350"],["Greece (Ελλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (香港)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ísland)","is","354"],["India (भारत)","in","91"],["Indonesia","id","62"],["Iran (ایران)","ir","98"],["Iraq (العراق)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel (ישראל)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan (日本)","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan (الأردن)","jo","962"],["Kazakhstan (Казахстан)","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (الكويت)","kw","965"],["Kyrgyzstan (Кыргызстан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (لبنان)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (ليبيا)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (澳門)","mo","853"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (موريتانيا)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Монгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco (المغرب)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (မြန်မာ)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नेपाल)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (조선 민주주의 인민 공화국)","kp","850"],["North Macedonia (Северна Македонија)","mk","389"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway (Norge)","no","47",0],["Oman (عُمان)","om","968"],["Pakistan (پاکستان)","pk","92"],["Palau","pw","680"],["Palestine (فلسطين)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (قطر)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (Россия)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1",18,["869"]],["Saint Lucia","lc","1",19,["758"]],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1",20,["784"]],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239"],["Saudi Arabia (المملكة العربية السعودية)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (Србија)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (대한민국)","kr","82"],["South Sudan (جنوب السودان)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (ශ්රී ලංකාව)","lk","94"],["Sudan (السودان)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1,["79"]],["Sweden (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (سوريا)","sy","963"],["Taiwan (台灣)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (ไทย)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1",22,["868"]],["Tunisia (تونس)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1",24,["340"]],["Uganda","ug","256"],["Ukraine (Україна)","ua","380"],["United Arab Emirates (الإمارات العربية المتحدة)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (Oʻzbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam (Việt Nam)","vn","84"],["Wallis and Futuna (Wallis-et-Futuna)","wf","681"],["Western Sahara (الصحراء الغربية)","eh","212",1,["5288","5289"]],["Yemen (اليمن)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],n=0;n<t.length;n++){var i=t[n];t[n]={name:i[0],iso2:i[1],dialCode:i[2],priority:i[3]||0,areaCodes:i[4]||null}}function o(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function s(t){var n=function(t,n){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(i!==e){var o=i.call(t,n);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof n?n:String(n)}var r={getInstance:function(e){var t=e.getAttribute("data-intl-tel-input-id");return window.intlTelInputGlobals.instances[t]},instances:{},documentReady:function(){return"complete"===document.readyState}};"object"==typeof window&&(window.intlTelInputGlobals=r);var l=0,u={allowDropdown:!0,autoInsertDialCode:!1,autoPlaceholder:"polite",customContainer:"",customPlaceholder:null,dropdownContainer:null,excludeCountries:[],formatOnDisplay:!0,geoIpLookup:null,hiddenInput:"",initialCountry:"",localizedCountries:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,showFlags:!0,utilsScript:""},c=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],d=function(e,t){for(var n=Object.keys(e),i=0;i<n.length;i++)t(n[i],e[n[i]])},h=function(e){d(window.intlTelInputGlobals.instances,(function(t){window.intlTelInputGlobals.instances[t][e]()}))},p=function(){function n(e,t){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this.id=l++,this.telInput=e,this.activeItem=null,this.highlightedItem=null;var o=t||{};this.options={},d(u,(function(e,t){i.options[e]=o.hasOwnProperty(e)?o[e]:t})),this.hadInitialPlaceholder=Boolean(e.getAttribute("placeholder"))}var i,s;return i=n,s=[{key:"_init",value:function(){var e=this;this.options.nationalMode&&(this.options.autoInsertDialCode=!1),this.options.separateDialCode&&(this.options.autoInsertDialCode=!1);var t=this.options.allowDropdown&&!this.options.separateDialCode;if(!this.options.showFlags&&t&&(this.options.showFlags=!0),this.isMobile=/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.isMobile&&(document.body.classList.add("iti-mobile"),this.options.dropdownContainer||(this.options.dropdownContainer=document.body)),this.isRTL=!!this.telInput.closest("[dir=rtl]"),"undefined"!=typeof Promise){var n=new Promise((function(t,n){e.resolveAutoCountryPromise=t,e.rejectAutoCountryPromise=n})),i=new Promise((function(t,n){e.resolveUtilsScriptPromise=t,e.rejectUtilsScriptPromise=n}));this.promise=Promise.all([n,i])}else this.resolveAutoCountryPromise=this.rejectAutoCountryPromise=function(){},this.resolveUtilsScriptPromise=this.rejectUtilsScriptPromise=function(){};this.selectedCountryData={},this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests()}},{key:"_processCountryData",value:function(){this._processAllCountries(),this._processCountryCodes(),this._processPreferredCountries(),this.options.localizedCountries&&this._translateCountriesByLocale(),(this.options.onlyCountries.length||this.options.localizedCountries)&&this.countries.sort(this._countryNameSort)}},{key:"_addCountryCode",value:function(t,n,i){n.length>this.countryCodeMaxLen&&(this.countryCodeMaxLen=n.length),this.countryCodes.hasOwnProperty(n)||(this.countryCodes[n]=[]);for(var o=0;o<this.countryCodes[n].length;o++)if(this.countryCodes[n][o]===t)return;var a=i!==e?i:this.countryCodes[n].length;this.countryCodes[n][a]=t}},{key:"_processAllCountries",value:function(){if(this.options.onlyCountries.length){var e=this.options.onlyCountries.map((function(e){return e.toLowerCase()}));this.countries=t.filter((function(t){return e.indexOf(t.iso2)>-1}))}else if(this.options.excludeCountries.length){var n=this.options.excludeCountries.map((function(e){return e.toLowerCase()}));this.countries=t.filter((function(e){return-1===n.indexOf(e.iso2)}))}else this.countries=t}},{key:"_translateCountriesByLocale",value:function(){for(var e=0;e<this.countries.length;e++){var t=this.countries[e].iso2.toLowerCase();this.options.localizedCountries.hasOwnProperty(t)&&(this.countries[e].name=this.options.localizedCountries[t])}}},{key:"_countryNameSort",value:function(e,t){return e.name<t.name?-1:e.name>t.name?1:0}},{key:"_processCountryCodes",value:function(){this.countryCodeMaxLen=0,this.dialCodes={},this.countryCodes={};for(var e=0;e<this.countries.length;e++){var t=this.countries[e];this.dialCodes[t.dialCode]||(this.dialCodes[t.dialCode]=!0),this._addCountryCode(t.iso2,t.dialCode,t.priority)}for(var n=0;n<this.countries.length;n++){var i=this.countries[n];if(i.areaCodes)for(var o=this.countryCodes[i.dialCode][0],a=0;a<i.areaCodes.length;a++){for(var s=i.areaCodes[a],r=1;r<s.length;r++){var l=i.dialCode+s.substr(0,r);this._addCountryCode(o,l),this._addCountryCode(i.iso2,l)}this._addCountryCode(i.iso2,i.dialCode+s)}}}},{key:"_processPreferredCountries",value:function(){this.preferredCountries=[];for(var e=0;e<this.options.preferredCountries.length;e++){var t=this.options.preferredCountries[e].toLowerCase(),n=this._getCountryData(t,!1,!0);n&&this.preferredCountries.push(n)}}},{key:"_createEl",value:function(e,t,n){var i=document.createElement(e);return t&&d(t,(function(e,t){return i.setAttribute(e,t)})),n&&n.appendChild(i),i}},{key:"_generateMarkup",value:function(){this.telInput.hasAttribute("autocomplete")||this.telInput.form&&this.telInput.form.hasAttribute("autocomplete")||this.telInput.setAttribute("autocomplete","off");var e=this.options,t=e.allowDropdown,n=e.separateDialCode,i=e.showFlags,a=e.customContainer,s=e.hiddenInput,r=e.dropdownContainer,l="iti";t&&(l+=" iti--allow-dropdown"),n&&(l+=" iti--separate-dial-code"),i&&(l+=" iti--show-flags"),a&&(l+=" ".concat(a));var u=this._createEl("div",{class:l});this.telInput.parentNode.insertBefore(u,this.telInput);var c=t||i||n;if(c&&(this.flagsContainer=this._createEl("div",{class:"iti__flag-container"},u)),u.appendChild(this.telInput),c&&(this.selectedFlag=this._createEl("div",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&i.push.apply(i,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach((function(t){o(e,t,n[t])}))}return e}({class:"iti__selected-flag"},t&&{role:"combobox","aria-haspopup":"listbox","aria-controls":"iti-".concat(this.id,"__country-listbox"),"aria-expanded":"false","aria-label":"Telephone country code"}),this.flagsContainer)),i&&(this.selectedFlagInner=this._createEl("div",{class:"iti__flag"},this.selectedFlag)),this.selectedFlag&&this.telInput.disabled&&this.selectedFlag.setAttribute("aria-disabled","true"),n&&(this.selectedDialCode=this._createEl("div",{class:"iti__selected-dial-code"},this.selectedFlag)),t&&(this.telInput.disabled||this.selectedFlag.setAttribute("tabindex","0"),this.dropdownArrow=this._createEl("div",{class:"iti__arrow"},this.selectedFlag),this.countryList=this._createEl("ul",{class:"iti__country-list iti__hide",id:"iti-".concat(this.id,"__country-listbox"),role:"listbox","aria-label":"List of countries"}),this.preferredCountries.length&&(this._appendListItems(this.preferredCountries,"iti__preferred",!0),this._createEl("li",{class:"iti__divider",role:"separator","aria-disabled":"true"},this.countryList)),this._appendListItems(this.countries,"iti__standard"),r?(this.dropdown=this._createEl("div",{class:"iti iti--container"}),this.dropdown.appendChild(this.countryList)):this.flagsContainer.appendChild(this.countryList)),s){var d=s,h=this.telInput.getAttribute("name");if(h){var p=h.lastIndexOf("[");-1!==p&&(d="".concat(h.substr(0,p),"[").concat(d,"]"))}this.hiddenInput=this._createEl("input",{type:"hidden",name:d}),u.appendChild(this.hiddenInput)}}},{key:"_appendListItems",value:function(e,t,n){for(var i="",o=0;o<e.length;o++){var a=e[o],s=n?"-preferred":"";i+="<li class='iti__country ".concat(t,"' tabIndex='-1' id='iti-").concat(this.id,"__item-").concat(a.iso2).concat(s,"' role='option' data-dial-code='").concat(a.dialCode,"' data-country-code='").concat(a.iso2,"' aria-selected='false'>"),this.options.showFlags&&(i+="<div class='iti__flag-box'><div class='iti__flag iti__".concat(a.iso2,"'></div></div>")),i+="<span class='iti__country-name'>".concat(a.name,"</span>"),i+="<span class='iti__dial-code'>+".concat(a.dialCode,"</span>"),i+="</li>"}this.countryList.insertAdjacentHTML("beforeend",i)}},{key:"_setInitialState",value:function(){var e=this.telInput.getAttribute("value"),t=this.telInput.value,n=!e||"+"!==e.charAt(0)||t&&"+"===t.charAt(0)?t:e,i=this._getDialCode(n),o=this._isRegionlessNanp(n),a=this.options,s=a.initialCountry,r=a.autoInsertDialCode;i&&!o?this._updateFlagFromNumber(n):"auto"!==s&&(s?this._setFlag(s.toLowerCase()):i&&o?this._setFlag("us"):(this.defaultCountry=this.preferredCountries.length?this.preferredCountries[0].iso2:this.countries[0].iso2,n||this._setFlag(this.defaultCountry)),!n&&r&&(this.telInput.value="+".concat(this.selectedCountryData.dialCode))),n&&this._updateValFromNumber(n)}},{key:"_initListeners",value:function(){this._initKeyListeners(),this.options.autoInsertDialCode&&this._initBlurListeners(),this.options.allowDropdown&&this._initDropdownListeners(),this.hiddenInput&&this._initHiddenInputListener()}},{key:"_initHiddenInputListener",value:function(){var e=this;this._handleHiddenInputSubmit=function(){e.hiddenInput.value=e.getNumber()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleHiddenInputSubmit)}},{key:"_getClosestLabel",value:function(){for(var e=this.telInput;e&&"LABEL"!==e.tagName;)e=e.parentNode;return e}},{key:"_initDropdownListeners",value:function(){var e=this;this._handleLabelClick=function(t){e.countryList.classList.contains("iti__hide")?e.telInput.focus():t.preventDefault()};var t=this._getClosestLabel();t&&t.addEventListener("click",this._handleLabelClick),this._handleClickSelectedFlag=function(){!e.countryList.classList.contains("iti__hide")||e.telInput.disabled||e.telInput.readOnly||e._showDropdown()},this.selectedFlag.addEventListener("click",this._handleClickSelectedFlag),this._handleFlagsContainerKeydown=function(t){e.countryList.classList.contains("iti__hide")&&-1!==["ArrowUp","Up","ArrowDown","Down"," ","Enter"].indexOf(t.key)&&(t.preventDefault(),t.stopPropagation(),e._showDropdown()),"Tab"===t.key&&e._closeDropdown()},this.flagsContainer.addEventListener("keydown",this._handleFlagsContainerKeydown)}},{key:"_initRequests",value:function(){var e=this;this.options.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.options.utilsScript):window.addEventListener("load",(function(){window.intlTelInputGlobals.loadUtils(e.options.utilsScript)})):this.resolveUtilsScriptPromise(),"auto"===this.options.initialCountry?this._loadAutoCountry():this.resolveAutoCountryPromise()}},{key:"_loadAutoCountry",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.options.geoIpLookup&&this.options.geoIpLookup((function(e){window.intlTelInputGlobals.autoCountry=e.toLowerCase(),setTimeout((function(){return h("handleAutoCountry")}))}),(function(){return h("rejectAutoCountryPromise")})))}},{key:"_initKeyListeners",value:function(){var e=this;this._handleKeyupEvent=function(){e._updateFlagFromNumber(e.telInput.value)&&e._triggerCountryChange()},this.telInput.addEventListener("keyup",this._handleKeyupEvent),this._handleClipboardEvent=function(){setTimeout(e._handleKeyupEvent)},this.telInput.addEventListener("cut",this._handleClipboardEvent),this.telInput.addEventListener("paste",this._handleClipboardEvent)}},{key:"_cap",value:function(e){var t=this.telInput.getAttribute("maxlength");return t&&e.length>t?e.substr(0,t):e}},{key:"_initBlurListeners",value:function(){var e=this;this._handleSubmitOrBlurEvent=function(){e._removeEmptyDialCode()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.addEventListener("blur",this._handleSubmitOrBlurEvent)}},{key:"_removeEmptyDialCode",value:function(){if("+"===this.telInput.value.charAt(0)){var e=this._getNumeric(this.telInput.value);e&&this.selectedCountryData.dialCode!==e||(this.telInput.value="")}}},{key:"_getNumeric",value:function(e){return e.replace(/\D/g,"")}},{key:"_trigger",value:function(e){var t=document.createEvent("Event");t.initEvent(e,!0,!0),this.telInput.dispatchEvent(t)}},{key:"_showDropdown",value:function(){this.countryList.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._setDropdownPosition(),this.activeItem&&(this._highlightListItem(this.activeItem,!1),this._scrollTo(this.activeItem,!0)),this._bindDropdownListeners(),this.dropdownArrow.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}},{key:"_toggleClass",value:function(e,t,n){n&&!e.classList.contains(t)?e.classList.add(t):!n&&e.classList.contains(t)&&e.classList.remove(t)}},{key:"_setDropdownPosition",value:function(){var e=this;if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.isMobile){var t=this.telInput.getBoundingClientRect(),n=window.pageYOffset||document.documentElement.scrollTop,i=t.top+n,o=this.countryList.offsetHeight,a=i+this.telInput.offsetHeight+o<n+window.innerHeight,s=i-o>n;if(this._toggleClass(this.countryList,"iti__country-list--dropup",!a&&s),this.options.dropdownContainer){var r=!a&&s?0:this.telInput.offsetHeight;this.dropdown.style.top="".concat(i+r,"px"),this.dropdown.style.left="".concat(t.left+document.body.scrollLeft,"px"),this._handleWindowScroll=function(){return e._closeDropdown()},window.addEventListener("scroll",this._handleWindowScroll)}}}},{key:"_getClosestListItem",value:function(e){for(var t=e;t&&t!==this.countryList&&!t.classList.contains("iti__country");)t=t.parentNode;return t===this.countryList?null:t}},{key:"_bindDropdownListeners",value:function(){var e=this;this._handleMouseoverCountryList=function(t){var n=e._getClosestListItem(t.target);n&&e._highlightListItem(n,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=function(t){var n=e._getClosestListItem(t.target);n&&e._selectListItem(n)},this.countryList.addEventListener("click",this._handleClickCountryList);var t=!0;this._handleClickOffToClose=function(){t||e._closeDropdown(),t=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose);var n="",i=null;this._handleKeydownOnDropdown=function(t){t.preventDefault(),"ArrowUp"===t.key||"Up"===t.key||"ArrowDown"===t.key||"Down"===t.key?e._handleUpDownKey(t.key):"Enter"===t.key?e._handleEnterKey():"Escape"===t.key?e._closeDropdown():/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(t.key)&&(i&&clearTimeout(i),n+=t.key.toLowerCase(),e._searchForCountry(n),i=setTimeout((function(){n=""}),1e3))},document.addEventListener("keydown",this._handleKeydownOnDropdown)}},{key:"_handleUpDownKey",value:function(e){var t="ArrowUp"===e||"Up"===e?this.highlightedItem.previousElementSibling:this.highlightedItem.nextElementSibling;t&&(t.classList.contains("iti__divider")&&(t="ArrowUp"===e||"Up"===e?t.previousElementSibling:t.nextElementSibling),this._highlightListItem(t,!0))}},{key:"_handleEnterKey",value:function(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}},{key:"_searchForCountry",value:function(e){for(var t=0;t<this.countries.length;t++)if(this._startsWith(this.countries[t].name,e)){var n=this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(this.countries[t].iso2));this._highlightListItem(n,!1),this._scrollTo(n,!0);break}}},{key:"_startsWith",value:function(e,t){return e.substr(0,t.length).toLowerCase()===t}},{key:"_updateValFromNumber",value:function(e){var t=e;if(this.options.formatOnDisplay&&window.intlTelInputUtils&&this.selectedCountryData){var n=this.options.nationalMode||"+"!==t.charAt(0)&&!this.options.separateDialCode,i=intlTelInputUtils.numberFormat,o=i.NATIONAL,a=i.INTERNATIONAL,s=n?o:a;t=intlTelInputUtils.formatNumber(t,this.selectedCountryData.iso2,s)}t=this._beforeSetNumber(t),this.telInput.value=t}},{key:"_updateFlagFromNumber",value:function(e){var t=e,n=this.selectedCountryData.dialCode;t&&"1"===n&&"+"!==t.charAt(0)&&("1"!==t.charAt(0)&&(t="1".concat(t)),t="+".concat(t)),this.options.separateDialCode&&n&&"+"!==t.charAt(0)&&(t="+".concat(n).concat(t));var i=this._getDialCode(t,!0),o=this._getNumeric(t),a=null;if(i){var s=this.countryCodes[this._getNumeric(i)],r=-1!==s.indexOf(this.selectedCountryData.iso2)&&o.length<=i.length-1;if(!("1"===n&&this._isRegionlessNanp(o)||r))for(var l=0;l<s.length;l++)if(s[l]){a=s[l];break}}else"+"===t.charAt(0)&&o.length?a="":t&&"+"!==t||(a=this.defaultCountry);return null!==a&&this._setFlag(a)}},{key:"_isRegionlessNanp",value:function(e){var t=this._getNumeric(e);if("1"===t.charAt(0)){var n=t.substr(1,3);return-1!==c.indexOf(n)}return!1}},{key:"_highlightListItem",value:function(e,t){var n=this.highlightedItem;n&&n.classList.remove("iti__highlight"),this.highlightedItem=e,this.highlightedItem.classList.add("iti__highlight"),this.selectedFlag.setAttribute("aria-activedescendant",e.getAttribute("id")),t&&this.highlightedItem.focus()}},{key:"_getCountryData",value:function(e,n,i){for(var o=n?t:this.countries,a=0;a<o.length;a++)if(o[a].iso2===e)return o[a];if(i)return null;throw new Error("No country data for '".concat(e,"'"))}},{key:"_setFlag",value:function(e){var t=this.options,n=t.allowDropdown,i=t.separateDialCode,o=t.showFlags,a=this.selectedCountryData.iso2?this.selectedCountryData:{};if(this.selectedCountryData=e?this._getCountryData(e,!1,!1):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2),o&&this.selectedFlagInner.setAttribute("class","iti__flag iti__".concat(e)),this._setSelectedCountryFlagTitleAttribute(e,i),i){var s=this.selectedCountryData.dialCode?"+".concat(this.selectedCountryData.dialCode):"";this.selectedDialCode.innerHTML=s;var r=this.selectedFlag.offsetWidth||this._getHiddenSelectedFlagWidth();this.isRTL?this.telInput.style.paddingRight="".concat(r+6,"px"):this.telInput.style.paddingLeft="".concat(r+6,"px")}if(this._updatePlaceholder(),n){var l=this.activeItem;if(l&&(l.classList.remove("iti__active"),l.setAttribute("aria-selected","false")),e){var u=this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(e,"-preferred"))||this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(e));u.setAttribute("aria-selected","true"),u.classList.add("iti__active"),this.activeItem=u}}return a.iso2!==e}},{key:"_setSelectedCountryFlagTitleAttribute",value:function(e,t){var n;this.selectedFlag&&(n=e&&!t?"".concat(this.selectedCountryData.name,": +").concat(this.selectedCountryData.dialCode):e?this.selectedCountryData.name:"Unknown",this.selectedFlag.setAttribute("title",n))}},{key:"_getHiddenSelectedFlagWidth",value:function(){var e=this.telInput.parentNode.cloneNode();e.style.visibility="hidden",document.body.appendChild(e);var t=this.flagsContainer.cloneNode();e.appendChild(t);var n=this.selectedFlag.cloneNode(!0);t.appendChild(n);var i=n.offsetWidth;return e.parentNode.removeChild(e),i}},{key:"_updatePlaceholder",value:function(){var e="aggressive"===this.options.autoPlaceholder||!this.hadInitialPlaceholder&&"polite"===this.options.autoPlaceholder;if(window.intlTelInputUtils&&e){var t=intlTelInputUtils.numberType[this.options.placeholderNumberType],n=this.selectedCountryData.iso2?intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.options.nationalMode,t):"";n=this._beforeSetNumber(n),"function"==typeof this.options.customPlaceholder&&(n=this.options.customPlaceholder(n,this.selectedCountryData)),this.telInput.setAttribute("placeholder",n)}}},{key:"_selectListItem",value:function(e){var t=this._setFlag(e.getAttribute("data-country-code"));this._closeDropdown(),this._updateDialCode(e.getAttribute("data-dial-code")),this.telInput.focus();var n=this.telInput.value.length;this.telInput.setSelectionRange(n,n),t&&this._triggerCountryChange()}},{key:"_closeDropdown",value:function(){this.countryList.classList.add("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","false"),this.selectedFlag.removeAttribute("aria-activedescendant"),this.dropdownArrow.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._handleKeydownOnDropdown),document.documentElement.removeEventListener("click",this._handleClickOffToClose),this.countryList.removeEventListener("mouseover",this._handleMouseoverCountryList),this.countryList.removeEventListener("click",this._handleClickCountryList),this.options.dropdownContainer&&(this.isMobile||window.removeEventListener("scroll",this._handleWindowScroll),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._trigger("close:countrydropdown")}},{key:"_scrollTo",value:function(e,t){var n=this.countryList,i=window.pageYOffset||document.documentElement.scrollTop,o=n.offsetHeight,a=n.getBoundingClientRect().top+i,s=a+o,r=e.offsetHeight,l=e.getBoundingClientRect().top+i,u=l+r,c=l-a+n.scrollTop,d=o/2-r/2;if(l<a)t&&(c-=d),n.scrollTop=c;else if(u>s){t&&(c+=d);var h=o-r;n.scrollTop=c-h}}},{key:"_updateDialCode",value:function(e){var t,n=this.telInput.value,i="+".concat(e);if("+"===n.charAt(0)){var o=this._getDialCode(n);t=o?n.replace(o,i):i,this.telInput.value=t}else this.options.autoInsertDialCode&&(t=n?i+n:i,this.telInput.value=t)}},{key:"_getDialCode",value:function(e,t){var n="";if("+"===e.charAt(0))for(var i="",o=0;o<e.length;o++){var a=e.charAt(o);if(!isNaN(parseInt(a,10))){if(i+=a,t)this.countryCodes[i]&&(n=e.substr(0,o+1));else if(this.dialCodes[i]){n=e.substr(0,o+1);break}if(i.length===this.countryCodeMaxLen)break}}return n}},{key:"_getFullNumber",value:function(){var e=this.telInput.value.trim(),t=this.selectedCountryData.dialCode,n=this._getNumeric(e);return(this.options.separateDialCode&&"+"!==e.charAt(0)&&t&&n?"+".concat(t):"")+e}},{key:"_beforeSetNumber",value:function(e){var t=e;if(this.options.separateDialCode){var n=this._getDialCode(t);if(n){var i=" "===t[(n="+".concat(this.selectedCountryData.dialCode)).length]||"-"===t[n.length]?n.length+1:n.length;t=t.substr(i)}}return this._cap(t)}},{key:"_triggerCountryChange",value:function(){this._trigger("countrychange")}},{key:"handleAutoCountry",value:function(){"auto"===this.options.initialCountry&&(this.defaultCountry=window.intlTelInputGlobals.autoCountry,this.telInput.value||this.setCountry(this.defaultCountry),this.resolveAutoCountryPromise())}},{key:"handleUtils",value:function(){window.intlTelInputUtils&&(this.telInput.value&&this._updateValFromNumber(this.telInput.value),this._updatePlaceholder()),this.resolveUtilsScriptPromise()}},{key:"destroy",value:function(){var e=this.telInput.form;if(this.options.allowDropdown){this._closeDropdown(),this.selectedFlag.removeEventListener("click",this._handleClickSelectedFlag),this.flagsContainer.removeEventListener("keydown",this._handleFlagsContainerKeydown);var t=this._getClosestLabel();t&&t.removeEventListener("click",this._handleLabelClick)}this.hiddenInput&&e&&e.removeEventListener("submit",this._handleHiddenInputSubmit),this.options.autoInsertDialCode&&(e&&e.removeEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.removeEventListener("blur",this._handleSubmitOrBlurEvent)),this.telInput.removeEventListener("keyup",this._handleKeyupEvent),this.telInput.removeEventListener("cut",this._handleClipboardEvent),this.telInput.removeEventListener("paste",this._handleClipboardEvent),this.telInput.removeAttribute("data-intl-tel-input-id");var n=this.telInput.parentNode;n.parentNode.insertBefore(this.telInput,n),n.parentNode.removeChild(n),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""}},{key:"getNumber",value:function(e){if(window.intlTelInputUtils){var t=this.selectedCountryData.iso2;return intlTelInputUtils.formatNumber(this._getFullNumber(),t,e)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.selectedCountryData}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var e=this.selectedCountryData.iso2;return intlTelInputUtils.getValidationError(this._getFullNumber(),e)}return-99}},{key:"isValidNumber",value:function(){var e=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(e,this.selectedCountryData.iso2):null}},{key:"isPossibleNumber",value:function(){var e=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isPossibleNumber(e,this.selectedCountryData.iso2):null}},{key:"setCountry",value:function(e){var t=e.toLowerCase();this.selectedCountryData.iso2!==t&&(this._setFlag(t),this._updateDialCode(this.selectedCountryData.dialCode),this._triggerCountryChange())}},{key:"setNumber",value:function(e){var t=this._updateFlagFromNumber(e);this._updateValFromNumber(e),t&&this._triggerCountryChange()}},{key:"setPlaceholderNumberType",value:function(e){this.options.placeholderNumberType=e,this._updatePlaceholder()}}],s&&a(i.prototype,s),Object.defineProperty(i,"prototype",{writable:!1}),n}();r.getCountryData=function(){return t};var m=function(e,t,n){var i=document.createElement("script");i.onload=function(){h("handleUtils"),t&&t()},i.onerror=function(){h("rejectUtilsScriptPromise"),n&&n()},i.className="iti-load-utils",i.async=!0,i.src=e,document.body.appendChild(i)};return r.loadUtils=function(e){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise((function(t,n){return m(e,t,n)}));m(e)}return null},r.defaults=u,r.version="18.2.1",function(e,t){var n=new p(e,t);return n._init(),e.setAttribute("data-intl-tel-input-id",n.id),window.intlTelInputGlobals.instances[n.id]=n,n}}()},e.exports?e.exports=t():window.intlTelInput=t()},699:(e,t,n)=>{e.exports=n(197)}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=(e={})=>{for(let t in e){const n=document.getElementById(t+"-error"),i=document.querySelector(`[for="${t}"]`);n&&(n.innerHTML=e[t]),i&&(e[t].length>1?i.classList.add("error"):i.classList.remove("error"))}},t=t=>{if(!t)return;const n=[],i=[],o=t=>{switch(t.id){case"first_name":case"first_name-popup":""===t.value.trim()?(i.push(!0),n[t.id]="Required"):(i.push(!1),n[t.id]="");break;case"terms_agree":case"terms_agree-popup":t.checked?(i.push(!1),n[t.id]=""):(i.push(!0),n[t.id]="Required");break;case"range":case"range-popup":Number(t.value)?(i.push(!1),n[t.id]=""):(i.push(!0),n[t.id]="Required");break;case"phone":case"phone-popup":let e=/^[\d\+][\d\(\)\ -]{4,14}\d$/;const o=t.value.trim();""===o?(i.push(!0),n[t.id]="Required"):!e.test(o)||o.length<10?(i.push(!0),n[t.id]="Not valid phone"):(i.push(!1),n[t.id]="");break;case"email":case"email-popup":""===t.value.trim()?(i.push(!0),n[t.id]="Required"):/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t.value.trim())?(i.push(!1),n[t.id]=""):(i.push(!0),n[t.id]="Not valid email")}e(n)};return t.length>1&&!t.id?t.forEach((e=>{o(e)})):o(t),i.includes(!0)};var i=n(60);const o=e=>{window.dataLayer?(console.log("event data sent",e),window.dataLayer.push(e)):console.error("no dataLayer")};var a=n(699),s=n.n(a);const r=new URL(window.location),l=()=>{const e=document.querySelectorAll(".blockHeroImg");document.querySelectorAll(".blockHeroTheme").forEach((e=>{const t=e.querySelector(".blockHeroImg");e.style.height=t.offsetHeight+"px"}));const t=document.querySelectorAll(".blockHeroThemeItemM"),n=document.querySelectorAll(".blockHeroThemeItem"),i=document.querySelector(".blockHeroThemeItems"),o=document.querySelector("#blockHeroImage"),a=document.querySelector(".blockHeroThemeLoader"),s=document.querySelector(".blockHeroThemeLoaderProgress");let r=null,l=null,u=[];const c=t=>{t.forEach((n=>{n.addEventListener("click",(()=>{if(r||(r=n.dataset.color),t.forEach((e=>{e.classList.contains("active")&&(r=e.dataset.color,e.classList.remove("active"))})),n.classList.add("active"),e.length>=2)e.forEach((e=>{e.dataset.color===n.dataset.color?e.classList.add("active"):l||e.dataset.color!==r||(e.classList.add("hide"),l=setTimeout((()=>{e.classList.remove("hide"),e.classList.remove("active"),clearTimeout(l),l=null}),300))}));else{a.style.opacity=1,s.style.width=0,i.style.pointerEvents="none";const e=new Image;e.onChangeSize=function(e,t){a.style.opacity=1,s.style.width=parseInt(e/t*100)+"%",parseInt(e/t*100)>=95&&(o.style.opacity=0),100===parseInt(e/t*100)&&(o.style.opacity=1)},e.onload=function(){i.style.pointerEvents="all",u.map((e=>e.color)).includes(n.dataset.color)||u.push({color:n.dataset.color,src:e.src});const t=u.find((e=>e.color===n.dataset.color));t&&(o.src=t.src),a.style.opacity=0;let r=setTimeout((()=>{s.style.width=0,clearTimeout(r)}),500)},e.load(`../../../assets/white-label-cfd-broker/hero/CTA_pic_${n.dataset.color}.png`)}}))}))};c(n),c(t)},u=()=>{const e=document.querySelectorAll('[data-widget="button"]');0!==e.length&&e.forEach((e=>{"popup"===e.dataset.action&&e.addEventListener("click",(()=>{document.querySelector('[data-widget="popup"]').classList.contains("open")?(()=>{const e=document.querySelector('[data-widget="popup"]');e&&e.classList.remove("open")})():(()=>{const e=document.querySelector('[data-widget="popup"]');e&&e.classList.add("open")})()}))}))};Image.prototype.onChangeSize,Image.prototype.load=function(e){var t=this,n=XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(e){if(n.response){var i=new Blob([n.response]);t.src=window.URL.createObjectURL(i)}},n.onprogress=function(e){t.onChangeSize&&t.onChangeSize(e.loaded,e.total)},n.send()},window.addEventListener("beforeunload",(function(e){e.preventDefault(),e.returnValue="",document.querySelectorAll("input, select").forEach((e=>{"checkbox"===e.type?e.checked=!1:e.value="";const t=document.querySelector(`[for="${e.id}"]`);t&&(t.classList.remove("focus"),t.classList.remove("error"))}))})),(()=>{const e=window.location;if(e.hash){const t=e.hash.replace("#",""),n=document.getElementById(t);n&&n.scrollIntoView({block:"start",behavior:"smooth"})}})(),(()=>{const e=document.querySelector(".header");window.addEventListener("scroll",(function(){window.scrollY>100?e.classList.add("active"):e.classList.remove("active")})),window.scrollY>100?e.classList.add("active"):e.classList.remove("active")})(),document.querySelectorAll('[data-play="video"]').forEach((e=>{const t=()=>{const n=e.getBoundingClientRect().top;n+e.clientHeight<=window.innerHeight&&n>=0&&(e.play(),document.removeEventListener("scroll",t))};t(),document.addEventListener("scroll",t)}));const c=document.querySelectorAll('[data-widget="form"]');l(),document.querySelectorAll('[data-action="scrollForm"]').forEach((e=>{e.addEventListener("click",(()=>{const e=document.querySelector('[data-widget="form"]');e&&e.scrollIntoView({block:"center",behavior:"smooth"})}))})),((e,t,n={})=>{const i=document.querySelector(`[data-widget="${e}"]`),a=document.querySelector(`[data-click-on-close="${e}"]`),s=i?.querySelector(".modal__content")||i?.querySelector(".modal-once__content"),r=document.querySelectorAll(`[data-role="${e}"]`),l=document.querySelectorAll(`[data-role="${e}-close"]`);if(0===r.length&&!i)return!1;const u=()=>(["contacts","saas","saas2"].includes(e)&&o({event:"saas_form_opening"}),document.body.style.overflow="hidden",i.classList.add("active")),c=()=>(n.onClose&&n.onClose(),document.body.style.overflow=null,i.classList.remove("active"));r.forEach((e=>{e.addEventListener("click",(()=>{u()}),!1)})),t&&(n.timeout?setTimeout(u,n.timeout):u()),n.clickOutside&&(s.addEventListener("click",(e=>{e.stopPropagation()})),i.addEventListener("click",(e=>{c()}))),a&&a.addEventListener("click",c,!1),l&&l.length>0&&l.forEach((e=>{e.addEventListener("click",c,!1)}))})("once",!1,{onClose:()=>{localStorage.setItem("form_once_opened","true")}}),(()=>{const e=document.querySelector('[data-widget="once"]'),t=localStorage.getItem("form_once_opened");e&&!t&&setTimeout((()=>{e.classList.add("active")}),15e3)})(),window.addEventListener("load",(()=>{l(),u()}));const d=new URLSearchParams(window.location.search).entries();for(const e of d)localStorage.setItem("form__"+e[0],e[1]);c.forEach((n=>{((n,a)=>{if(!n)return;const l={actionUrl:"https://quadcode.foach.site/api/wl/cfdBroker",data:{referrer:"/lp/white-label-cfd-broker"},error:!1};let u,c;if(window.matchMedia("(max-width: 1023px)").matches||(u="popup"===a?(0,i.Z)(document.getElementById("range-popup")):(0,i.Z)(document.getElementById("range"))),"popup"===a){const e=document.getElementById("phone-popup");if(!e)return;c=s()(e,{initialCountry:"auto",geoIpLookup:function(e){fetch("https://ipapi.co/json").then((function(e){return e.json()})).then((function(t){e(t.country_code)})).catch((function(){e("us")}))},hiddenInput:"full_number",nationalMode:!1,autoInsertDialCode:!0,formatOnDisplay:!0,autoHideDialCode:!0,separateDialCode:!0,autoPlaceholder:!1,preferredCountries:["gb","us","de","es","fr","it","pt","zh"],utilsScript:"https://cdn.jsdelivr.net/npm/intl-tel-input@18.1.1/build/js/utils.js"}),e.addEventListener("input",(function(){l.data["full_number-popup"]=c.getNumber()})),e.addEventListener("focus",(e=>{e.target.parentElement.parentElement&&e.target.parentElement.parentElement.classList.add("focus")})),e.addEventListener("blur",(t=>{t.target.parentElement.parentElement&&!e.value&&t.target.parentElement.parentElement.classList.remove("focus")}))}else{const e=document.getElementById("phone");if(!e)return;c=s()(e,{initialCountry:"auto",geoIpLookup:function(e){fetch("https://ipapi.co/json").then((function(e){return e.json()})).then((function(t){e(t.country_code)})).catch((function(){e("us")}))},hiddenInput:"full_number",nationalMode:!1,autoInsertDialCode:!0,formatOnDisplay:!0,autoHideDialCode:!0,separateDialCode:!0,autoPlaceholder:!1,preferredCountries:["gb","us","de","es","fr","it","pt","zh"],utilsScript:"https://cdn.jsdelivr.net/npm/intl-tel-input@18.1.1/build/js/utils.js"}),e.addEventListener("input",(function(){l.data.full_number=c.getNumber()})),e.addEventListener("focus",(e=>{e.target.parentElement.parentElement&&e.target.parentElement.parentElement.classList.add("focus")})),e.addEventListener("blur",(t=>{t.target.parentElement.parentElement&&!e.value&&t.target.parentElement.parentElement.classList.remove("focus")}))}let d=localStorage.getItem("form__lang");const h=n.querySelectorAll("input, select"),p=n.querySelector('[data-action="submit"]'),m=n.querySelector('[data-action="form-success"]'),v=n.querySelector('[data-action="form-success-button"]'),f=n.querySelector('[data-action="form-error"]'),g=n.querySelector('[data-action="form-error-button"]'),y=n.querySelector('[data-action="form-content"]');u?.[0]?.select?.addEventListener("change",(e=>{"popup"===a?l.data["range-popup"]=e.target.value:l.data.range=e.target.value,e.target.parentElement.parentElement.classList.add("focus"),e.target.parentElement.parentElement.classList.remove("error"),e.target.parentElement.parentElement.parentElement.getElementsByClassName("formFieldItemError")[0].remove()})),h.forEach((e=>{e&&(e.addEventListener("input",(n=>{l.error=t(e,e.id),l.data[e.id]=e.value,n.target.parentElement&&e.value&&n.target.parentElement.classList.add("focus")})),e.addEventListener("focus",(e=>{e.target.parentElement&&e.target.parentElement.classList.add("focus")})),e.addEventListener("blur",(t=>{t.target.parentElement&&!e.value&&t.target.parentElement.classList.remove("focus")})))})),p.addEventListener("click",(async n=>{n.preventDefault(),d=localStorage.getItem("form__lang"),l.error=t(h),l.data.landing_url=r.host+r.pathname;for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);t.includes("form__")&&(l.data[t.replace("form__","")]=localStorage.getItem(t))}"popup"===a&&Object.keys(l.data).forEach((e=>{let t=l.data[e];delete l.data[e],l.data[e.replace("-popup","")]=t})),l.data.phone&&(l.data.phone=l.data.full_number),l.data.full_number&&delete l.data.full_number,l.data.lang_by_browser=d,l.error||(p.classList.add("loading"),await fetch(l.actionUrl,{method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify(l.data)}).then((e=>e.json())).then((t=>{t.errors?e(t.errors):t.success&&(o({event:"saas_form_sent"}),y.style.display="none",m.style.display="flex")})).catch((()=>{y.style.display="none",f.style.display="flex"})).finally((()=>{p.classList.remove("loading")})))})),v.addEventListener("click",(()=>{h.forEach((e=>{"checkbox"===e.type?e.checked=!1:e.value="";const t=document.querySelector(`[for="${e.id}"]`);t&&(t.classList.remove("focus"),t.classList.remove("error"))})),y.style.display="block",m.style.display="none"})),g.addEventListener("click",(()=>{h.forEach((e=>{"checkbox"===e.type?e.checked=!1:e.value="";const t=document.querySelector(`[for="${e.id}"]`);t&&(t.classList.remove("focus"),t.classList.remove("error"))})),y.style.display="block",f.style.display="none"}))})(n,n.dataset.name)}))})()})();