/* * International Telephone Input v23.0.7 * https://github.com/jackocnr/intl-tel-input.git * Licensed under the MIT license */ // UMD (function(factory) { if (typeof module === 'object' && module.exports) { module.exports = factory(); } else { window.intlTelInput = factory(); } }(() => { var factoryOutput=(()=>{var _=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var x=(l,t)=>{for(var e in t)_(l,e,{get:t[e],enumerable:!0})},P=(l,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of S(t))!M.call(l,n)&&n!==e&&_(l,n,{get:()=>t[n],enumerable:!(i=A(t,n))||i.enumerable});return l};var H=l=>P(_({},"__esModule",{value:!0}),l);var B={};x(B,{Iti:()=>b,default:()=>F});var I=[["af","93"],["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],["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"]],["cc","61",1,["89162"]],["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"]],["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"]],["il","972"],["it","39",0],["jm","1",4,["876","658"]],["jp","81"],["je","44",3,["1534","7509","7700","7797","7829","7937"]],["jo","962"],["kz","7",1,["33","7"]],["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"]],["mx","52"],["fm","691"],["md","373"],["mc","377"],["mn","976"],["me","382"],["ms","1",16,["664"]],["ma","212",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],["ro","40"],["ru","7",0],["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],["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"]],["ye","967"],["zm","260"],["zw","263"],["ax","358",1,["18"]]],w=[];for(let l=0;ll.replace(/\D/g,""),D=(l="")=>l.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),k=l=>{let t=f(l);if(t.charAt(0)==="1"){let e=t.substr(1,3);return R.indexOf(e)!==-1}return!1},z=(l,t,e,i)=>{if(e===0&&!i)return 0;let n=0;for(let s=0;s{let i=document.createElement(l);return t&&Object.entries(t).forEach(([n,s])=>i.setAttribute(n,s)),e&&e.appendChild(i),i},y=l=>{let{instances:t}=o;Object.values(t).forEach(e=>e[l]())},b=class{id;promise;telInput;highlightedItem;options;hadInitialPlaceholder;isRTL;selectedCountryData;countries;dialCodeMaxLen;dialCodeToIso2Map;dialCodes;countryContainer;selectedCountry;selectedCountryInner;selectedCountryA11yText;selectedDialCode;dropdownArrow;dropdownContent;searchInput;searchResultsA11yText;countryList;dropdown;hiddenInput;hiddenInputCountry;maxCoreNumberLength;defaultCountry;_a14;_a9;_a10;_a11;_a12;_handleKeydownEvent;_a4;_a0;_a1;_a2;_a3;_a7;resolveAutoCountryPromise;rejectAutoCountryPromise;resolveUtilsScriptPromise;rejectUtilsScriptPromise;constructor(t,e={}){this.id=O++,this.a=t,this.c=null,this.d=Object.assign({},N,e),this.e=!!t.getAttribute("placeholder")}_init(){this.d.useFullscreenPopup&&(this.d.fixDropdownWidth=!1),this.d.separateDialCode&&(this.d.allowDropdown=!0,this.d.nationalMode=!1),!this.d.showFlags&&!this.d.separateDialCode&&(this.d.nationalMode=!1),this.d.useFullscreenPopup&&!this.d.dropdownContainer&&(this.d.dropdownContainer=document.body),this.isRTL=!!this.a.closest("[dir=rtl]"),this.d.i18n={...E,...this.d.i18n};let t=new Promise((i,n)=>{this.h=i,this.i=n}),e=new Promise((i,n)=>{this.i0=i,this.i1=n});this.promise=Promise.all([t,e]),this.s={},this._b(),this._f(),this._h(),this._i(),this._i3()}_b(){this._d(),this._d2(),this._d0(),this.d.countryOrder&&(this.d.countryOrder=this.d.countryOrder.map(t=>t.toLowerCase())),this._sortCountries()}_sortCountries(){this.p.sort((t,e)=>{let{countryOrder:i}=this.d;if(i){let n=i.indexOf(t.iso2),s=i.indexOf(e.iso2),r=n>-1,a=s>-1;if(r||a)return r&&a?n-s:r?-1:1}return t.namee.name?1:0})}_c(t,e,i){e.length>this.dialCodeMaxLen&&(this.dialCodeMaxLen=e.length),this.q.hasOwnProperty(e)||(this.q[e]=[]);for(let s=0;sn.toLowerCase());this.p=C.filter(n=>i.indexOf(n.iso2)>-1)}else if(e.length){let i=e.map(n=>n.toLowerCase());this.p=C.filter(n=>i.indexOf(n.iso2)===-1)}else this.p=C}_d0(){for(let t=0;t
`),r+=`${n.name}`,r+=`+${n.dialCode}`,s.insertAdjacentHTML("beforeend",r)}}_h(t=!1){let e=this.a.getAttribute("value"),i=this.a.value,s=e&&e.charAt(0)==="+"&&(!i||i.charAt(0)!=="+")?e:i,r=this._5(s),a=k(s),{initialCountry:u}=this.d;if(r&&!a)this._v(s);else if(u!=="auto"||t){let d=u?u.toLowerCase():"";d&&this._y(d,!0)?this._z(d):r&&a?this._z("us"):this._z()}s&&this._u(s)}_i(){this._j(),this.d.allowDropdown&&this._i2(),(this.hiddenInput||this.hiddenInputCountry)&&this.a.form&&this._i0()}_i0(){this._a14=()=>{this.hiddenInput&&(this.hiddenInput.value=this.getNumber()),this.hiddenInputCountry&&(this.hiddenInputCountry.value=this.getSelectedCountryData().iso2||"")},this.a.form?.addEventListener("submit",this._a14)}_i2(){this._a9=e=>{this.dropdownContent.classList.contains("iti__hide")?this.a.focus():e.preventDefault()};let t=this.a.closest("label");t&&t.addEventListener("click",this._a9),this._a10=()=>{this.dropdownContent.classList.contains("iti__hide")&&!this.a.disabled&&!this.a.readOnly&&this._n()},this.selectedCountry.addEventListener("click",this._a10),this._a11=e=>{this.dropdownContent.classList.contains("iti__hide")&&["ArrowUp","ArrowDown"," ","Enter"].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),this._n()),e.key==="Tab"&&this._2()},this.k.addEventListener("keydown",this._a11)}_i3(){this.d.utilsScript&&!o.utils?o.documentReady()?o.loadUtils(this.d.utilsScript):window.addEventListener("load",()=>{o.loadUtils(this.d.utilsScript)}):this.i0(),this.d.initialCountry==="auto"&&!this.s.iso2?this._i4():this.h()}_i4(){o.autoCountry?this.handleAutoCountry():o.startedLoadingAutoCountry||(o.startedLoadingAutoCountry=!0,typeof this.d.geoIpLookup=="function"&&this.d.geoIpLookup((t="")=>{let e=t.toLowerCase();e&&this._y(e,!0)?(o.autoCountry=e,setTimeout(()=>y("handleAutoCountry"))):(this._h(!0),y("rejectAutoCountryPromise"))},()=>{this._h(!0),y("rejectAutoCountryPromise")}))}_j(){let{strictMode:t,formatAsYouType:e,separateDialCode:i}=this.d,n=!1;this._a12=s=>{this._v(this.a.value)&&this._8();let r=s&&s.data&&/[^+0-9]/.test(s.data),a=s&&s.inputType==="insertFromPaste"&&this.a.value;if(r||a&&!t?n=!0:/[^+0-9]/.test(this.a.value)||(n=!1),e&&!n){let u=this.a.selectionStart||0,c=this.a.value.substring(0,u).replace(/[^+0-9]/g,"").length,g=s&&s.inputType==="deleteContentForward",p=this._9(),m=z(c,p,u,g);this.a.value=p,this.a.setSelectionRange(m,m)}},this.a.addEventListener("input",this._a12),(t||i)&&(this._handleKeydownEvent=s=>{if(s.key&&s.key.length===1&&!s.altKey&&!s.ctrlKey&&!s.metaKey){if(i&&s.key==="+"){s.preventDefault(),this._n(),this.searchInput.value="+",this._p3("",!0);return}if(t){let r=this.a.selectionStart===0&&s.key==="+",a=/^[0-9]$/.test(s.key),u=r||a,d=this._6(),c=o.utils.getCoreNumber(d,this.s.iso2),g=this.maxCoreNumberLength&&c.length>=this.maxCoreNumberLength,p=this.a.value.substring(this.a.selectionStart,this.a.selectionEnd),m=/\d/.test(p);(!u||g&&!m)&&s.preventDefault()}}},this.a.addEventListener("keydown",this._handleKeydownEvent))}_j2(t){let e=parseInt(this.a.getAttribute("maxlength")||"",10);return e&&t.length>e?t.substr(0,e):t}_trigger(t){let e=new Event(t,{bubbles:!0,cancelable:!0});this.a.dispatchEvent(e)}_n(){let{fixDropdownWidth:t}=this.d;t&&(this.dropdownContent.style.width=`${this.a.offsetWidth}px`),this.dropdownContent.classList.remove("iti__hide"),this.selectedCountry.setAttribute("aria-expanded","true"),this._o();let e=this.countryList.firstElementChild;e&&(this._x(e,!1),this.countryList.scrollTop=0),this.searchInput.focus(),this._p(),this.u.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}_o(){if(this.d.dropdownContainer&&this.d.dropdownContainer.appendChild(this.dropdown),!this.d.useFullscreenPopup){let t=this.a.getBoundingClientRect(),e=this.a.offsetHeight;this.d.dropdownContainer&&(this.dropdown.style.top=`${t.top+e}px`,this.dropdown.style.left=`${t.left}px`,this._a4=()=>this._2(),window.addEventListener("scroll",this._a4))}}_p(){this._a0=n=>{let s=n.target?.closest(".iti__country");s&&this._x(s,!1)},this.countryList.addEventListener("mouseover",this._a0),this._a1=n=>{let s=n.target?.closest(".iti__country");s&&this._1(s)},this.countryList.addEventListener("click",this._a1);let t=!0;this._a2=()=>{t||this._2(),t=!1},document.documentElement.addEventListener("click",this._a2),this._a3=n=>{["ArrowUp","ArrowDown","Enter","Escape"].includes(n.key)&&(n.preventDefault(),n.stopPropagation(),n.key==="ArrowUp"||n.key==="ArrowDown"?this._q(n.key):n.key==="Enter"?this._r():n.key==="Escape"&&this._2())},document.addEventListener("keydown",this._a3);let e=()=>{let n=this.searchInput.value.trim();n?this._p3(n):this._p3("",!0)},i=null;this._a7=()=>{i&&clearTimeout(i),i=setTimeout(()=>{e(),i=null},100)},this.searchInput.addEventListener("input",this._a7),this.searchInput.addEventListener("click",n=>n.stopPropagation())}_p3(t,e=!1){let i=!0;this.countryList.innerHTML="";let n=D(t);for(let s=0;s1&&(e=t==="ArrowUp"?this.countryList.lastElementChild:this.countryList.firstElementChild),e&&(this._3(e),this._x(e,!1))}_r(){this.c&&this._1(this.c)}_u(t){let e=t;if(this.d.formatOnDisplay&&o.utils&&this.s){let i=this.d.nationalMode||e.charAt(0)!=="+"&&!this.d.separateDialCode,{NATIONAL:n,INTERNATIONAL:s}=o.utils.numberFormat,r=i?n:s;e=o.utils.formatNumber(e,this.s.iso2,r)}e=this._7(e),this.a.value=e}_v(t){let e=t.indexOf("+"),i=e?t.substring(e):t,n=this.s.dialCode;i&&n==="1"&&i.charAt(0)!=="+"&&(i.charAt(0)!=="1"&&(i=`1${i}`),i=`+${i}`),this.d.separateDialCode&&n&&i.charAt(0)!=="+"&&(i=`+${n}${i}`);let r=this._5(i,!0),a=f(i),u=null;if(r){let d=this.q[f(r)],c=d.indexOf(this.s.iso2)!==-1&&a.length<=r.length-1;if(!(n==="1"&&k(a))&&!c){for(let p=0;pr){let g=n-a;e.scrollTop=c-g}}_4(t){let e=this.a.value,i=`+${t}`,n;if(e.charAt(0)==="+"){let s=this._5(e);s?n=e.replace(s,i):n=i,this.a.value=n}}_5(t,e){let i="";if(t.charAt(0)==="+"){let n="";for(let s=0;s!o.utils&&!o.startedLoadingUtilsScript?(o.startedLoadingUtilsScript=!0,new Promise((t,e)=>{import(/* webpackIgnore: true */ l).then(({default:i})=>{o.utils=i,y("handleUtils"),t(!0)}).catch(()=>{y("rejectUtilsScriptPromise"),e()})})):null,o=Object.assign((l,t)=>{let e=new b(l,t);return e._init(),l.setAttribute("data-intl-tel-input-id",e.id.toString()),o.instances[e.id]=e,e},{defaults:N,documentReady:()=>document.readyState==="complete",getCountryData:()=>C,getInstance:l=>{let t=l.getAttribute("data-intl-tel-input-id");return t?o.instances[t]:null},instances:{},loadUtils:j,version:"23.0.7"}),F=o;return H(B);})(); // UMD return factoryOutput.default; })); ; class CCFEF extends elementorModules.frontend.handlers.Base{getDefaultSettings(){return{selectors:{inputTelTextArea:"textarea.ccfef_country_code_data_js",intlInputSpan:".ccfef-editor-intl-input",submitButton:"div.elementor-field-type-submit button"}}}getDefaultElements(){const e=this.getSettings("selectors");return{$textArea:this.$element.find(e.inputTelTextArea),$intlSpanElement:this.$element.find(e.intlInputSpan),$submitButton:this.$element.find(e.submitButton)}}bindEvents(){this.telId=new Array,this.includeCountries={},this.excludeCountries={},this.defaultCountry={},this.iti={},this.getIntlUserData(),this.appendCountryCodeHandler(),this.addCountryCodeInputHandler(),this.removeInputTelSpanEle(),this.intlInputValidation()}appendCountryCodeHandler(){this.telId.forEach(e=>{this.addCountryCodeIconHandler(e.formId,e.fieldId,e.customId)})}addCountryCodeIconHandler(e,t,n){const i=CCFEFCustomData.pluginDir+"assets/intl-tel-input/js/utils.min.js",o=jQuery(`.elementor-widget.elementor-widget-form[data-id="${e}"] .elementor-field-type-tel.elementor-field-group input[type="tel"]#${n}`)[0];if(void 0!==o){let n=[],l=[],r="in";const s=["in","us","gb","ru","fr","de","br","cn","jp","it"],a=`${e}${t}`;if(this.includeCountries.hasOwnProperty(a)&&this.includeCountries[a].length>0&&(r=this.includeCountries[a][0],n=this.includeCountries[a].map(e=>e)),this.excludeCountries.hasOwnProperty(a)&&this.excludeCountries[a].length>0){let e=s.filter(e=>!this.excludeCountries[a].includes(e));r=e[0],l=this.excludeCountries[a].map(e=>e)}this.defaultCountry[a]&&""!==this.defaultCountry[a]&&(r=this.defaultCountry[a]);const d=window.intlTelInput(o,{initialCountry:r,utilsScript:i,formatOnDisplay:!1,formatAsYouType:!0,autoFormat:!1,containerClass:"cfefp-intl-container",useFullscreenPopup:!1,onlyCountries:n,excludeCountries:l,customPlaceholder:function(e,t){let n=e;"in"===t.iso2&&(n=e.replace(/^0+/,""));const i=`+${t.dialCode} ${n}`;return i.replace(/\s/g,"")}});o.removeAttribute("pattern"),this.iti[e+t]=d}}addCountryCodeInputHandler(){const e=this.iti;Object.keys(e).forEach(t=>{const n=e[t],i=n.a;let o=n.getSelectedCountryData(),l=`+${o.dialCode}`,r=!1;const s=()=>{r=!1},a=e=>{const t=n.getSelectedCountryData(),i=`+${t.dialCode}`;if("keydown"===e.type||"input"===e.type)r=!0,clearTimeout(s),setTimeout(s,400),o.dialCode!==t.dialCode?o=t:o.dialCode===t.dialCode&&o.iso2!==t.iso2&&n.setCountry(o.iso2);else if("countrychange"===e.type){if(r)return;o=t}this.updateCountryCodeHandler(e.currentTarget,i,l),l=i};i.addEventListener("keydown",a),i.addEventListener("input",a),i.addEventListener("countrychange",a)})}updateCountryCodeHandler(e,t,n){let i=e.value;t&&"+undefined"===t||["","+"].includes(i)||(t!==n&&(i=i.replace(new RegExp(`^\\${n}`),"")),i.startsWith(t)||(i=i.replace(/\+/g,""),e.value=t+i))}removeInputTelSpanEle(){this.$element.find("span.ccfef-editor-intl-input").remove()}getIntlUserData(){const e=this.elements.$intlSpanElement,t=[];e.each((e,n)=>{const i=jQuery(n),o=i.data("include-countries"),l=i.data("exclude-countries"),r=i.data("defaultCountry"),s=i.data("id"),a=i.data("field-id"),d=i.closest(".elementor-element.elementor-widget-form").data("id"),u=`${d}${a}`;if(""!==o){const e=o.split(",");this.includeCountries[u]=e}if(""!==l){const e=l.split(",");this.excludeCountries[u]=e}""!==r&&(this.defaultCountry[u]=r),t.includes(u)||(this.telId.push({formId:d,fieldId:a,customId:s}),t.push(u))})}intlInputValidation(){this.elements.$submitButton.on("click",e=>{const t=this.iti;Object.keys(t).length>0&&Object.keys(t).forEach(n=>{const i=t[n],o=i.a;""!==o.value&&(o.value=o.value.replace(/[^0-9+]/g,""));const l=o.closest(".elementor-field-group"),r=l.querySelector(".cfefp-intl-container");r&&o.offsetHeight&&r.style.setProperty("--cfefp-intl-tel-button-height",`${o.offsetHeight}px`);const s=jQuery(o).parent();s.find("span.elementor-message").remove();const a=CCFEFCustomData.errorMap;let d='';if(""!==o.value)if(i.isValidNumber())jQuery(o).closest(".cfefp-intl-container").removeClass("elementor-error");else{const t=i.getValidationError();void 0!==t&&a[t]&&(d+=a[t]+"",jQuery(o).closest(".cfefp-intl-container").addClass("elementor-error"),jQuery(o).after(d),e.preventDefault())}})})}}jQuery(window).on("elementor/frontend/init",()=>{const e=e=>{elementorFrontend.elementsHandler.addHandler(CCFEF,{$element:e})};elementorFrontend.hooks.addAction("frontend/element_ready/form.default",e)});;