(()=>{"use strict";function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);e&&(c=c.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,c)}return n}function e(e){for(var c=1;c<arguments.length;c++){var r=null!=arguments[c]?arguments[c]:{};c%2?t(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function n(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}var r="undefined"!=typeof window&&"function"==typeof window.jQuery?window.jQuery:null;!function(t,n,r){function a(){var a=t.location.href,o=void 0!==n.title?n.title:"",i=n.querySelector(".ht-ctc-chat"),s={},_={};var l=function(){var t="",e=9999;try{t=navigator.userAgent||"",e=screen.width||9999}catch(t){}return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)||e<=1025?"yes":"no"}(),u=new Map,d=["__proto__","prototype","constructor","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],h=function(t){return!("string"!=typeof t||0===t.length||!/^[a-zA-Z0-9_-]+$/.test(t))&&!d.includes(t)};function v(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t&&"object"===c(t)&&h(e)&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:n}function f(t,e,n){return!(!t||"object"!==c(t)||!h(e))&&(t[e]=n,!0)}function p(){if(localStorage.getItem("ht_ctc_storage"))try{var t=JSON.parse(localStorage.getItem("ht_ctc_storage"));u=new Map(Object.entries(t||{}))}catch(t){u=new Map}else u=new Map}function y(t){return!(!h(t)||!u.has(t))&&u.get(t)}function g(t,e){if(p(),h(t)){u.set(t,e);var n=JSON.stringify(Object.fromEntries(u));localStorage.setItem("ht_ctc_storage",n)}}function m(t){return t instanceof Element?[t]:"string"==typeof t?Array.from(n.querySelectorAll(t)):[]}p();var b={show:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=m(t);if(r)return".ctc_opt_in"===t?void r(t).fadeOut(200).fadeIn(200).fadeOut(200).fadeIn(200):void r(t).show(e||void 0);o.forEach(function(t){c&&c.split(/\s+/).forEach(function(e){e.trim()&&t.classList.add(e.trim())}),a&&a.split(/\s+/).forEach(function(e){e.trim()&&t.classList.remove(e.trim())}),e?t.style.setProperty("--ht-ctc-el-duration","".concat(e,"ms")):t.style.removeProperty("--ht-ctc-el-duration"),n&&function(t,e){if(t&&e){"none"===t.style.display&&(t.style.display="");var n=e.split(/\s+/).filter(Boolean);n.forEach(function(e){t.classList.remove(e),t.offsetWidth,t.classList.add(e)});var c=function(){n.forEach(function(e){return t.classList.remove(e)}),t.removeEventListener("animationend",c),clearTimeout(r)},r=setTimeout(c,2e3);t.addEventListener("animationend",c)}}(t,n),c||a||e||n||(t.style.display="block")})},hide:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=m(t);r?r(t).hide(e):o.forEach(function(t){c&&t.classList.add(c),a&&t.classList.remove(a),e?t.style.setProperty("--ht-ctc-el-duration","".concat(e,"ms")):t.style.removeProperty("--ht-ctc-el-duration"),n&&t.classList.add("ht-ctc-".concat(n)),c||a||e||n||(t.style.display="none")})}};function k(){n.dispatchEvent(new CustomEvent("ht_ctc_event_configure",{detail:{ctc:s,ctc_values:_}}));var t=n.querySelector(".ht_ctc_chat_data");t&&t.remove();var e={config:{ctc:s,ctc_values:_,is_mobile:l,url:a,post_title:o},api:{storage:{get:y,set:g,raw:u},ui:b,greetings:{open:S,close:x,closeAfterClick:L,initListeners:E,display:w},notifications:{display:C,stop:T},chat:{openLink:D,displaySettings:j},utils:{isSafeObjectKey:h,getSafeProperty:v,setSafeProperty:f}}};n.dispatchEvent(new CustomEvent("ht_ctc_event_init",{detail:e})),n.dispatchEvent(new CustomEvent("ht_ctc_event_settings",{detail:{ctc:s}})),function(){if(i){n.dispatchEvent(new CustomEvent("ht_ctc_event_chat")),j(i),i.addEventListener("click",function(){n.querySelector(".ht_ctc_chat_greetings_box")||D(i)}),E(),i&&i.addEventListener("click",function(t){if(t.target.closest(".ht_ctc_chat_greetings_box_link")){t.preventDefault();var e=n.querySelector("#ctc_opt");e?e.checked||y("g_optin")?(D(i),L()):b.show(".ctc_opt_in","","ht-ctc-fade-in","",""):(D(i),L()),n.dispatchEvent(new CustomEvent("ht_ctc_event_greetings"))}});var t=n.querySelector("#ctc_opt");t&&t.addEventListener("change",function(){t.checked&&(n.querySelector(".ctc_opt_in")&&b.hide(".ctc_opt_in",100),g("g_optin","y"),setTimeout(function(){D(i),L()},500))})}}(),n.addEventListener("click",function(t){var e=t.target.closest(".ht-ctc-sc-chat");e&&D(e)}),n.addEventListener("click",function(t){var e=t.target.closest(".ctc_chat, #ctc_chat");e&&(D(e),e.classList.contains("ctc_woo_place")&&t.preventDefault());var n=t.target.closest('[href="#ctc_chat"]');n&&(t.preventDefault(),D(n))})}function E(){if(i){var t=n.querySelector(".ht_ctc_chat_greetings_box");t&&i.addEventListener("click",function(e){e.target.closest(".ht_ctc_chat_style")&&(t.classList.contains("ctc_greetings_opened")?x("user_closed"):S("user_opened"))}),i.addEventListener("click",function(t){t.target.closest(".ctc_greetings_close_btn")&&x("user_closed")})}}function w(){var t=n.querySelector(".ht_ctc_chat_greetings_box");if(t){if(s.g_device){if("yes"!==l&&"mobile"===s.g_device)return void t.remove();if("yes"===l&&"desktop"===s.g_device)return void t.remove()}n.dispatchEvent(new CustomEvent("ht_ctc_event_after_chat_displayed",{detail:{ctc:s,greetings_open:S,greetings_close:x}})),s.g_init&&"user_closed"!==y("g_user_action")&&("default"===s.g_init?"yes"!==l&&S("init"):"open"===s.g_init&&S("init"));var e=n.querySelectorAll('.ctc_greetings, #ctc_greetings, .ctc_greetings_now, [href="#ctc_greetings"]');e.length>0&&e.forEach(function(t){t.addEventListener("click",function(t){t.preventDefault(),x("element"),S("element")})})}}function S(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"open";T();var e=n.querySelector(".ht-ctc-chat .ctc_cta_stick");e&&e.remove();var c=n.querySelector(".ht_ctc_chat_greetings_box");c&&(b.show(".ht_ctc_chat_greetings_box","init"===t?70:400,"","ht_ctc_greetings_box_open",""),c.classList.add("ctc_greetings_opened"),c.classList.remove("ctc_greetings_closed")),g("g_action",t),"user_opened"===t&&g("g_user_action",t),function(){if(!n.querySelector(".ctc_greetings_modal"))return;if(!n.querySelector(".ht_ctc_modal_backdrop")){var t=function(e){"Escape"===e.key&&(x("user_closed"),n.removeEventListener("keydown",t))},e=n.createElement("div");e.className="ht_ctc_modal_backdrop",n.body.appendChild(e),e.addEventListener("click",function(){x("user_closed")}),n.addEventListener("keydown",t)}}()}function L(){O(),setTimeout(function(){x("chat_clicked")},500)}function x(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"close";O(),"element"===t?b.hide(".ht_ctc_chat_greetings_box",70,"","ht-ctc-display-unset",""):b.hide(".ht_ctc_chat_greetings_box",400,"","","ht_ctc_greetings_box_open");var e=n.querySelector(".ht_ctc_chat_greetings_box");e&&(e.classList.add("ctc_greetings_closed"),e.classList.remove("ctc_greetings_opened")),g("g_action",t),"user_closed"===t&&g("g_user_action",t)}function O(){var t=n.querySelector(".ht_ctc_modal_backdrop");t&&t.remove()}function j(t){s.schedule&&"yes"===s.schedule?n.dispatchEvent(new CustomEvent("ht_ctc_event_display",{detail:{ctc:s,display_chat:q,ht_ctc_chat:t,online_content:P}})):(q(t),P())}function q(t){if("yes"===l){if("show"===s.dis_m){var e=n.querySelector(".ht_ctc_desktop_chat");e&&e.remove(),t.style.cssText=s.pos_m+s.css,s.side_m&&t.style.setProperty("--side",s.side_m),A(t)}}else if("show"===s.dis_d){var c=n.querySelector(".ht_ctc_mobile_chat");c&&c.remove(),t.style.cssText=s.pos_d+s.css,s.side_d&&t.style.setProperty("--side",s.side_d),A(t)}}function A(t){var e=s.se;e=parseInt(s.se),isNaN(e)?b.show(t,"","","ht-ctc-display-unset",""):b.show(t,e,"","ht-ctc-display-unset",""),w(),C(),function(t){var e=t.classList.contains("ht_ctc_entry_animation")?1200:120;setTimeout(function(){t.classList.add("ht_ctc_animation",s.ani)},e);var c=n.querySelector(".ht-ctc-chat"),r=n.querySelector(".ht-ctc-chat .ht-ctc-cta-hover");c&&r&&(c.addEventListener("mouseenter",function(){b.show(".ht-ctc-chat .ht-ctc-cta-hover",120,"","ht-ctc-cta-stick","ht-ctc-opacity-hide")}),c.addEventListener("mouseleave",function(){b.hide(".ht-ctc-chat .ht-ctc-cta-hover",100,"","ht-ctc-opacity-hide","ht-ctc-cta-stick")}))}(t)}function P(){n.querySelector(".for_greetings_header_image_badge")&&(n.querySelectorAll(".for_greetings_header_image_badge").forEach(function(t){t.classList.add("g_header_badge_online")}),b.show(".for_greetings_header_image_badge","","","ht-ctc-display-unset",""))}function C(){var t=n.querySelector(".ht_ctc_notification");if(t&&"stop"!==y("n_badge")){var e=n.querySelector(".ctc_nb");if(e){var c=e.closest(".ht_ctc_style"),r=n.querySelector(".ht_ctc_badge");if(c&&r){var a,o,i=null===(a=c.querySelector(".ctc_nb"))||void 0===a?void 0:a.getAttribute("data-nb_top"),_=null===(o=c.querySelector(".ctc_nb"))||void 0===o?void 0:o.getAttribute("data-nb_right");null!==i&&(r.style.top=i),null!==_&&(r.style.right=_)}}var l=s.n_time?1e3*s.n_time:150;setTimeout(function(){t.style.display=""},l)}}function T(){var t=n.querySelector(".ht_ctc_notification");t&&(g("n_badge","stop"),t.remove())}function I(r){if(s.analytics&&"session"===s.analytics){if(sessionStorage.getItem("ht_ctc_analytics"))return;sessionStorage.setItem("ht_ctc_analytics","done")}function i(e){var c=s.chat_number&&""!==s.chat_number?s.chat_number:s.number;try{n.dispatchEvent(new CustomEvent("ht_ctc_event_apply_variables",{detail:{templateString:e}})),e=(e=(e=(e=void 0!==t.apply_variables_value?t.apply_variables_value:e).replace("{number}",c)).replace("{title}",o)).replace("{url}",a)}catch(t){}return e}var l="event_"+Math.floor(1e4+9e4*Math.random());s.ctc_pixel_event_id=l,n.dispatchEvent(new CustomEvent("ht_ctc_event_analytics"));var u=s.chat_number&&""!==s.chat_number?s.chat_number:s.number,d=new Map,p=function(){return Object.fromEntries(d)},y="Click to Chat for WhatsApp",g="chat: "+u,m=o+", "+a;if(s.ga){var b=s.g_an_event_name&&""!==s.g_an_event_name?s.g_an_event_name:"click to chat";b=i(b),Array.isArray(_.g_an_params)&&_.g_an_params.forEach(function(t){if("string"==typeof t&&h(t)){var e=v(_,t);if(e&&"object"===c(e)){var n=e.key,r=e.value;"string"==typeof n&&(n=i(n),r=i(r),h(n)&&d.set(n,r))}}});var k=0,E="no",w=[];if("undefined"!=typeof dataLayer)try{var S=function(t,e){t&&"string"==typeof t&&""!==t.trim()&&(w.includes(t)||w.push(t))};"undefined"==typeof gtag&&(t.gtag=function(){var t;(t=dataLayer).push.apply(t,arguments)},E="yes");var L=[];try{var x,O=null===(x=t.google_tag_data)||void 0===x?void 0:x.tidr;null!=O&&O.destination&&"object"===c(O.destination)&&Object.keys(O.destination).forEach(function(t){S(t)})}catch(t){}try{var j,q=null===(j=t.google_tag_data)||void 0===j||null===(j=j.tidr)||void 0===j?void 0:j.container;q&&"object"===c(q)&&Object.values(q).forEach(function(t){Array.isArray(t.destinations)&&t.destinations.forEach(function(t){"string"==typeof t&&t.startsWith("G-")&&S(t)})})}catch(t){}try{Array.isArray(t.dataLayer)&&t.dataLayer.forEach(function(t){Array.isArray(t)&&"config"===t[0]&&"string"==typeof t[1]?S(t[1]):null!=t&&t.send_to&&"string"==typeof t.send_to&&S(t.send_to)})}catch(t){}w.forEach(function(t){var e;e=(e=t).toUpperCase(),L.includes(e)||(L.push(e),(e.startsWith("G-")||e.startsWith("GT-"))&&(d.set("send_to",e),gtag("event",b,p()),k++))})}catch(t){}if(0===k&&"no"===E)if("undefined"!=typeof gtag)gtag("event",b,p());else if("undefined"!=typeof ga&&void 0!==ga.getAll){ga.getAll()[0].send("event",y,g,m)}else"undefined"!=typeof __gaTracker&&__gaTracker("send","event",y,g,m)}if("undefined"!=typeof dataLayer){if(s.gtm){var A=s.gtm_event_name||"Click to chat";A=i(A);var P={};P.event=A,Array.isArray(_.gtm_params)&&_.gtm_params.forEach(function(t){if("string"==typeof t&&h(t)){var e=v(_,t);if(e&&"object"===c(e)){var n=i(e.key),r=i(e.value);h(n)&&f(P,n,r)}}}),dataLayer.push(P)}if(s.g_an_gtm){var C=e(e({},p()),{},{event:null!=b?b:"chat_click",ref:"dataLayer push ga admin values"});dataLayer.push(C)}}if(s.ads&&"undefined"!=typeof gtag_report_conversion&&gtag_report_conversion(),s.fb&&"undefined"!=typeof fbq){var T=s.pixel_event_name&&""!==s.pixel_event_name?s.pixel_event_name:"Click to Chat by HoliThemes",I=_.pixel_event_type&&""!==_.pixel_event_type?_.pixel_event_type:"trackCustom",D=new Map;Array.isArray(_.pixel_params)&&_.pixel_params.forEach(function(t){if("string"==typeof t&&h(t)){var e=v(_,t);if(e&&"object"===c(e)){var n=e.key,r=e.value;"string"==typeof n&&(n=i(n),r=i(r),h(n)&&D.set(n,r))}}}),s.ctc_pixel_event_id="",fbq(I,T,Object.fromEntries(D),{eventID:l})}}function D(e){n.dispatchEvent(new CustomEvent("ht_ctc_event_number",{detail:{ctc:s}}));var r=s.number,a=s.pre_filled;if(e.hasAttribute("data-number")&&""!==e.getAttribute("data-number")&&(r=e.getAttribute("data-number")),e.hasAttribute("data-pre_filled")){var o=e.getAttribute("data-pre_filled")||"";a=(s.prefix_pre_filled?s.prefix_pre_filled:"")+o}try{a=a.replaceAll("%","%25");var i=t.location.href;a=a.replace(/\[url]/gi,i),a=encodeURIComponent(decodeURI(a))}catch(t){}if(""!==r||s.custom_url_m&&""!==s.custom_url_m||s.custom_url_d&&""!==s.custom_url_d){var _="https://wa.me/"+r+"?text="+a,u=s.url_target_d?s.url_target_d:"_blank";"yes"===l?(s.url_structure_m&&"wa_colon"===s.url_structure_m&&(_="whatsapp://send?phone="+r+"&text="+a,u="_self"),s.custom_url_m&&""!==s.custom_url_m&&(_=s.custom_url_m)):(s.url_structure_d&&"web"===s.url_structure_d&&(_="https://web.whatsapp.com/send?phone="+r+"&text="+a),s.custom_url_d&&""!==s.custom_url_d&&(_=s.custom_url_d));var d="popup"===u?"scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=788,height=514,left=100,top=100":"noopener";t.open(_,u,d),s.chat_number=r,I(),function(t){var e=s&&s.hook_url;if(!e)return;if(Array.isArray(M)){var r={};M.forEach(function(t,e){f(r,"value"+(e+1),t)}),s.hook_v=r}n.dispatchEvent(new CustomEvent("ht_ctc_event_hook",{detail:{ctc:s,number:t}}));var a,o=s.hook_v&&"object"===c(s.hook_v)?s.hook_v:{};s.hook_url&&(e=s.hook_url);var i="application/x-www-form-urlencoded;charset=UTF-8";if("json"===s.webhook_format){var _=new URLSearchParams;Object.keys(o).forEach(function(t){var e=v(o,t);_.append(t,"object"===c(e)?JSON.stringify(e):e)}),a=_.toString()}else a=new URLSearchParams(o).toString();fetch(e,{method:"POST",headers:{"Content-Type":i},body:a}).then(function(t){}).catch(function(t){})}(r),T()}else if(s.no_number){var h=n.querySelector(".ctc-no-number-message");h&&(h.style.display="block")}}"undefined"!=typeof ht_ctc_chat_var&&(s=ht_ctc_chat_var),"undefined"!=typeof ht_ctc_variables&&(_=ht_ctc_variables),0===Object.keys(s).length||0===Object.keys(_).length?function(){var e=n.querySelector(".ht_ctc_chat_data");if(0===Object.keys(s).length&&e)try{var c=(null==e?void 0:e.getAttribute("data-settings"))||"";s=JSON.parse(c),t.ht_ctc_chat_var=s}catch(t){}0===Object.keys(_).length&&(_={g_an_event_name:"click to chat",pixel_event_name:"Click to Chat by HoliThemes",pixel_event_type:"trackCustom",g_an_params:["g_an_param_1","g_an_param_2","g_an_param_3"],g_an_param_1:{key:"number",value:"{number}"},g_an_param_2:{key:"title",value:"{title}"},g_an_param_3:{key:"url",value:"{url}"},pixel_params:["pixel_param_1","pixel_param_2","pixel_param_3","pixel_param_4"],pixel_param_1:{key:"Category",value:"Click to Chat for WhatsApp"},pixel_param_2:{key:"return_type",value:"chat"},pixel_param_3:{key:"ID",value:"{number}"},pixel_param_4:{key:"Title",value:"{title}"}},t.ht_ctc_variables=_);k()}():k();var M=s.hook_v?s.hook_v:""}r||function(){var t=n.querySelector(".ht_ctc_chat_greetings_box"),e=n.querySelector(".ht_ctc_greetings");t&&e&&(e.style.setProperty("pointer-events","none"),t.classList.add("ht_ctc_greetings_box"),t.style.removeProperty("display"),t.style.setProperty("pointer-events","auto"));var c=n.querySelector(".ht-ctc-chat .ht-ctc-cta-hover");c&&(c.classList.add("ht-ctc-opacity-hide"),c.style.removeProperty("display"))}(),"loading"!==n.readyState?a():n.addEventListener("DOMContentLoaded",a)}(window,document,r)})();
jQuery(document).ready(function($){
window.xooEl=window.xooEl||{};
function objectifyForm($form){
var form=$form instanceof jQuery ? $form[0]:$form;
var formData=new FormData(form);
var result={};
formData.forEach(function(value, name){
if(value instanceof File) return;
if(result.hasOwnProperty(name)){
if(!Array.isArray(result[name])){
result[name]=[result[name]];
}
result[name].push(value);
}else{
result[name]=value;
}});
return result;
}
function parse_notice(message, type){
type=(typeof type!=='undefined') ? type:'error';
return xoo_el_localize.html.notice[ type ].replace('%s', message);
}
var classReferral={
'xoo-el-login-tgr': 'login',
'xoo-el-reg-tgr': 'register',
}
function getReferral(className){
return classReferral[className] ? classReferral[className]:'';
}
function getFormsTrigger($container){
$container=$container||'';
var isSingle=false;
if($container.length&&$container.find('.xoo-el-section[data-section="single"]').length){
isSingle=true;
}
var formsTrigger={
'xoo-el-sing-tgr': 'single',
'xoo-el-login-tgr': isSingle ? 'single':'login',
'xoo-el-reg-tgr': isSingle ? 'single':'register',
'xoo-el-lostpw-tgr': 'lostpw',
'xoo-el-resetpw-tgr': 'resetpw',
'xoo-el-forcereg-tgr': 'register',
'xoo-el-forcelogin-tgr': 'login',
}
return formsTrigger;
}
class Container{
constructor($container){
this.$container=$container;
this.$tabs=$container.find('ul.xoo-el-tabs').length ? $container.find('ul.xoo-el-tabs'):null;
this.display=$container.hasClass('xoo-el-form-inline') ? 'inline':'popup';
this.formRetries=0;
if(this.$container.attr('data-active')){
this.toggleForm(this.$container.attr('data-active'));
}
this.createFormsTriggerHTML();
this.eventHandlers();
}
createFormsTriggerHTML(){
var HTML='<div style="display: none!important;">';
$.each(getFormsTrigger(this.$container), function(triggerClass, type){
HTML +='<span class="'+triggerClass+'"></span>';
})
HTML +='</div>';
this.$container.append(HTML);
}
eventHandlers(){
this.$container.on('submit', '.xoo-el-action-form', this.submitForm.bind(this)) ;
this.$container.on('click', '.xoo-el-edit-em', this.emailFieldEditClick.bind(this));
$(document.body).on('xoo_el_form_submitted', this.singleFormProcess.bind(this));
this.formTriggerEvent();
}
emailFieldEditClick(e){
this.toggleForm('single');
this.$container.find('input[name="xoo-el-sing-user"]').val($(e.currentTarget).siblings('input').val()).focus().trigger('keyup');
}
formTriggerEvent(){
var container=this,
formsTrigger=getFormsTrigger(container.$container);
$.each(formsTrigger, function(triggerClass, formType){
$(container.$container).on('click', '.' + triggerClass, function(e){
e.preventDefault();
e.stopImmediatePropagation();
container.toggleForm(formType, getReferral(triggerClass));
})
});
}
toggleForm(formType, referral){
referral=referral||'';
this.$container.attr('data-active', formType);
var $section=this.$container.find('.xoo-el-section[data-section="'+formType+'"]'),
activeClass='xoo-el-active';
if($section.length){
var $sectionForm=$section.find('form');
this.$container.find('.xoo-el-section').removeClass(activeClass);
$section.addClass(activeClass);
$section.find('.xoo-el-notice').html('').hide();
$section.find('.xoo-el-action-form').show();
if($sectionForm.length&&referral&&$sectionForm.find('input[name="_xoo_el_referral"]').length){
$sectionForm.find('input[name="_xoo_el_referral"]').val(referral);
}}
if(this.$tabs){
this.$tabs.find('li').removeClass(activeClass);
if(this.$tabs.find('li[data-tab="'+formType+'"]').length){
this.$tabs.find('li[data-tab="'+formType+'"]').addClass(activeClass);
}}
$(document.body).trigger('xoo_el_form_toggled', [ formType, this, referral ]);
this.$container.triggerHandler('xoo_el_form_toggled', [ formType, this, referral ]);
}
submitForm(e){
e.preventDefault();
var $form=$(e.currentTarget),
$button=$form.find('button[type="submit"]'),
$section=$form.parents('.xoo-el-section'),
buttonTxt=$button.text(),
$notice=$section.find('.xoo-el-notice'),
formType=$section.attr('data-section'),
container=this;
$notice.html('');
$button.html(xoo_el_localize.html.spinner).addClass('xoo-el-processing');
var form_data=new FormData($form[0]);
form_data.append('action', 'xoo_el_form_action');
form_data.append('display', container.display);
$.ajax({
url: xoo_el_localize.adminurl,
type: 'POST',
processData: false,
contentType: false,
cache: false,
enctype: 'multipart/form-data',
data: form_data,
complete: function(xhr, status){
$button.removeClass('xoo-el-processing').html(buttonTxt);
if(( status!=='success'||!xhr.responseJSON||xhr.responseJSON.error===undefined) ){
if(container.formRetries < 2){
$form.submit();
container.formRetries++;
return;
}
if(xoo_el_localize.errorLog==='yes'){
$notice.html(parse_notice("We could not process your request, please check console or try again later.", 'error') ).show();
}
else if(status!=='error'){
location.reload();
}}
},
success: function(response){
container.formRetries=0;
if(response.error===undefined){
console.log(response);
return;
}
if(response.notice){
$notice.html(response.notice).show();
if(container.display==='inline'){
$('html, body').animate({ scrollTop: $notice.offset().top - 100}, 500);
}}
if(response.error===0){
if(response.redirect){
setTimeout(function(){
window.location=response.redirect;
}, xoo_el_localize.redirectDelay);
}else{
$form.hide();
}
$form.trigger('reset');
if(formType==='resetpw'&&xoo_el_localize.resetPwPattern==='link'){
$form.add('.xoo-el-resetpw-hnotice').remove();
}}
$(document.body).trigger('xoo_el_form_submitted', [ response, $form, container ]);
$form.triggerHandler('xoo_el_form_submitted', [ response, $form, container ]);
}}).
fail(function(jqXHR, textStatus, errorThrown){
if(container.formRetries < 2) return;
$('body, .xoo-el-popup-notice').addClass('xoo-el-popup-notice-active');
var iframe=$('.xoo-el-notice-wrap iframe').get(0);
iframe.contentWindow.document.open();
iframe.contentWindow.document.write(jqXHR.responseText);
iframe.contentWindow.document.close();
var iframeDocument=iframe.contentWindow.document;
var style=iframeDocument.createElement("style");
style.textContent=$('.xoo-el-notice-iframestyle').text();
iframeDocument.head.appendChild(style);
})
}
singleFormProcess(e, response, $form, container){
if(this!==container) return;
if(response.field){
var $field=this.$container.find(response.field);
if($field.length){
this.toggleForm($field.closest('.xoo-el-section').attr('data-section'));
$field.closest('form').show();
$field.val(response.fieldValue);
$field.closest('.xoo-el-section').find('.xoo-el-notice').html(response.notice).show();
var $fieldCont=$field.closest('.xoo-aff-group');
if(!$fieldCont.find('.xoo-el-edit-em').length){
$fieldCont.addClass('xoo-el-block-edit');
$(xoo_el_localize.html.editField).insertAfter($field);
}}
}}
}
class Popup{
constructor($popup){
this.$popup=$popup;
this.eventHandlers();
}
eventHandlers(){
if(!xoo_el_localize.preventClosing){
this.$popup.on('click', '.xoo-el-close, .xoo-el-modal, .xoo-el-opac', this.closeOnClick.bind(this));
$(document.body).on('xoo_el_popup_toggled.xooEscEvent', this.onPopupToggled.bind(this));
}
$(document.body).on('xoo_el_form_submitted', this.onFormSubmitSuccess.bind(this));
this.$popup.on('click', '.xoo-el-action-btn', this.setScrollBarOnSubmit.bind(this));
$(window).on('hashchange load', this.openViaHash.bind(this));
this.triggerPopupOnClick();
if(xoo_el_localize.checkout&&xoo_el_localize.checkout.loginEnabled==='yes'){
$('body').on('click', '.wc-block-checkout__login-prompt, .wc-block-must-login-prompt', this.checkoutPageLinkClick.bind(this));
}}
onPopupToggled(e, type){
if($('body').hasClass('xoo-el-popup-active')){
$(document).on('keydown.xooEscClose', this.closeOnEscPress.bind(this));
}else{
$(document).off('keydown.xooEscClose');
}}
closeOnEscPress(e){
if(event.key==="Escape"||event.keyCode===27){
popup.toggle('hide');
}}
checkoutPageLinkClick(e){
e.preventDefault();
$(e.currentTarget).attr('data-redirect', xoo_el_localize.checkout.loginRedirect).addClass('xoo-el-login-tgr').trigger('click');
}
triggerPopupOnClick(){
$.each(getFormsTrigger(this.$popup), function(triggerClass, formType){
$(document.body).on('click', '.' + triggerClass, function(e){
if($(this).parents('.xoo-el-form-container').length) return true;
e.preventDefault();
e.stopImmediatePropagation();
popup.toggle('show');
if($(this).attr('data-redirect') ){
popup.$popup.find('input[name="xoo_el_redirect"]').val($(this).attr('data-redirect'));
}
popup.$popup.find('.'+triggerClass).trigger('click');
return false;
})
})
}
toggle(type){
var $els=this.$popup.add('body'),
activeClass='xoo-el-popup-active';
if(type==='show'){
$els.addClass(activeClass);
}
else if(type==='hide'){
$els.removeClass(activeClass);
}else{
$els.toggleClass(activeClass);
}
$(document.body).trigger('xoo_el_popup_toggled', [ type ]);
}
closeOnClick(e){
var elClassList=e.target.classList;
if(elClassList.contains('xoo-el-close')||elClassList.contains('xoo-el-modal')||elClassList.contains('xoo-el-opac')){
this.toggle('hide');
}}
setScrollbarPosition(position){
this.$popup.find('.xoo-el-srcont').scrollTop=position||0;
}
onFormSubmitSuccess(e, response, $form, container){
this.setScrollbarPosition();
}
setScrollBarOnSubmit(e){
var invalid_els=$(e.currentTarget).closest('form').find('input:invalid');
if(invalid_els.length===0) return;
this.setScrollbarPosition(invalid_els.filter(":first").closest('.xoo-aff-group').position().top);
}
openViaHash(){
var hash=$(location).attr('hash');
if(hash==='#login'||hash==='#register'){
this.toggle('show');
var uri=window.location.toString(),
clean_uri=uri.substring(0, uri.indexOf("#"));
window.history.replaceState({},
document.title, clean_uri
);
}
if(hash==='#login'){
this.$popup.find('.xoo-el-login-tgr').trigger('click');
}
else if(hash==='#register'){
this.$popup.find('.xoo-el-reg-tgr').trigger('click');
}}
}
class Form{
constructor($form){
this.$form=$form;
}
eventHandlers(){
}}
var popup=null;
if($('.xoo-el-container').length){
popup=new Popup($('.xoo-el-container'));
}
if(xoo_el_localize.isLoggedIn==="no"&&xoo_el_localize.autoOpenPopup==='yes'&&localStorage.getItem("xoo_el_popup_opened")!=="yes"){
if(xoo_el_localize.autoOpenPopupOnce==="yes"){
localStorage.setItem("xoo_el_popup_opened", "yes");
}
setTimeout(function(){
popup.toggle('show');
}, xoo_el_localize.aoDelay);
}
$('.xoo-el-form-container').each(function(key, el){
new Container($(el));
})
if($('form.xoo-el-form-resetpw').length&&xoo_el_localize.resetPwPattern==="link"){
if($('.xoo-el-form-inline').length){
$([document.documentElement, document.body]).animate({
scrollTop: $(".xoo-el-form-inline").offset().top
}, 500);
}else{
if(popup){
popup.toggle('show');
}}
}
if($('body.woocommerce-checkout').length&&$('.xoo-el-form-inline').length&&$('a.showlogin').length){
var $inlineForm=$('.xoo-el-form-inline');
$inlineForm.hide();
$(document.body).on('click', 'a.showlogin', function(){
$inlineForm.slideToggle();
$inlineForm.find('.xoo-el-login-tgr').trigger('click');
});
}
if(popup&&xoo_el_localize.loginClass&&$('.'+xoo_el_localize.loginClass).length){
$('body:not(.logged-in) .'+xoo_el_localize.loginClass).on('click', function(e){
e.preventDefault();
e.stopImmediatePropagation();
popup.toggle('show');
popup.$popup.find('.xoo-el-login-tgr').trigger('click');
});
}
if(popup&&xoo_el_localize.registerClass&&$('.'+xoo_el_localize.registerClass).length){
$('body:not(.logged-in) .'+xoo_el_localize.registerClass).on('click', function(e){
e.preventDefault();
e.stopImmediatePropagation();
popup.toggle('show');
popup.$popup.find('.xoo-el-reg-tgr').trigger('click');
});
}
$('.xoo-el-notice-close').on('click', function(){
$('body, .xoo-el-popup-notice').removeClass('xoo-el-popup-notice-active');
})
class CodeFormHandler{
constructor($codeForm){
const existing=CodeFormHandler.instances.get($codeForm[0]);
if(existing) return existing;
this.$codeForm=$codeForm;
this.codeFormID=this.$codeForm.data('code');
this.$parentForm=this.$codeForm.data('parentform') ? $(this.$codeForm.siblings(this.$codeForm.data('parentform')).get(0)):$();
this.CodePasted=false;
this.resendData={};
this.$noticeCont=this.$codeForm.find('.xoo-el-code-notice');
this.$submitBtn=this.$codeForm.find('.xoo-el-code-submit-btn');
this.submitBtnTxt=this.$submitBtn.html();
this.$inputs=this.$codeForm.find('.xoo-el-code-input');
this.$resendLink=this.$codeForm.find('.xoo-el-code-resend-link');
this.noticeTimout=this.resendTimer=false;
this.parentFormValues={}
this.codesent=false;
this.$container=this.$codeForm.closest('.xoo-el-form-container');
this.events();
CodeFormHandler.instances.set($codeForm[0], this);
}
events(){
this.$resendLink.on('click', { _thisObj: this }, this.resendCode);
this.$codeForm.find('.xoo-el-code-no-change').on('click', { _thisObj: this }, this.changeParentInput);
this.$codeForm.on('submit', { _thisObj: this }, this.onSubmit);
this.$inputs.on('paste', { _thisObj: this }, this.onCodeInputPaste);
this.$inputs.on('input', { _thisObj: this }, this.onCodeInputChange);
this.$inputs.on('keydown ', { _thisObj: this }, this.beforeCodeInputChange);
this.$container.on('xoo_el_form_toggled', this.onParentFormToggled.bind(this))
}
onParentFormToggled(e, formType, containerObj, referral){
let _thisObj=this;
if(_thisObj.codesent){
_thisObj.$parentForm.hide();
_thisObj.$codeForm.show();
}}
onCodeInputPaste(event){
var _thisObj=event.data._thisObj,
_this=$(this);
_thisObj.CodePasted=true;
setTimeout(function(){
var inputVal=_this.val().trim(),
inputValLength=inputVal.length;
_thisObj.$inputs.val('');
for (var i=0; i < inputValLength; ++i){
var chr=inputVal.charAt(i),
$Codeinput=$(_thisObj.$inputs.get(i));
if($Codeinput.length){
$Codeinput.val(chr);
}
if(i===(inputValLength - 1)){
$Codeinput.focus();
}}
if(inputValLength===_thisObj.$inputs.length){
_thisObj.$codeForm.trigger('submit');
}
_thisObj.CodePasted=false;
}, 10)
}
onCodeInputChange(event){
var _thisObj=event.data._thisObj,
inputVal=$(this).val(),
inputValLength=inputVal.length;
if(inputValLength > 1&&!_thisObj.CodePasted){
$(this).trigger('paste');
return;
}
if(_thisObj.CodePasted||_thisObj.processing){
return;
}
_thisObj.processing=true;
var $nextInput=$(this).next('input.xoo-el-code-input'),
$prevInput=$(this).prev('input.xoo-el-code-input');
if(inputValLength&&$nextInput.length!==0){
$nextInput.focus();
}
_thisObj.processing=false;
}
beforeCodeInputChange(event){
var _thisObj=event.data._thisObj,
inputVal=$(this).val(),
inputValLength=inputVal.length;
var $nextInput=$(this).next('input.xoo-el-code-input'),
$prevInput=$(this).prev('input.xoo-el-code-input');
if(inputVal.length&&event.keyCode!=8&&event.keyCode!==13){
if($nextInput.length&&!$nextInput.val()){
$nextInput.focus();
}else{
$(this).val('');
}}
if(!inputValLength&&event.keyCode==8&&$prevInput.length!==0){
$prevInput.focus();
}}
onSubmit(event){
event.preventDefault();
var _thisObj=event.data._thisObj;
if(!_thisObj.validateInputs()||!_thisObj.getCodeValue().length) return false;
_thisObj.$submitBtn.html(xoo_el_localize.html.spinner).addClass('xoo-el-processing');
_thisObj.verifyCode();
}
changeParentInput(event){
var _thisObj=event.data._thisObj;
_thisObj.codesent=false;
_thisObj.$codeForm.hide();
_thisObj.$parentForm.show();
_thisObj.$inputs.val('');
}
resendCode(event){
event.preventDefault();
var _thisObj=event.data._thisObj;
_thisObj.startResendTimer();
var form_data={
action: 'xoo_el_resend_code',
'parentFormData': objectifyForm(_thisObj.$parentForm),
}
form_data=Object.assign({}, form_data, _thisObj.resendData);
_thisObj.$resendLink.addClass('xoo-el-processing');
$.ajax({
url: xoo_el_localize.adminurl,
type: 'POST',
data: form_data,
success: function(response){
_thisObj.$resendLink.trigger('xoo_el_code_resent', [ response, _thisObj ]);
_thisObj.$resendLink.removeClass('xoo-el-processing');
if(response.notice){
_thisObj.showNotice(response.notice);
}},
complete: function(){
}});
}
validateInputs(){
var passedValidation=true;
this.$inputs.each(function(index, input){
var $input=$(input);
if($input.val().trim()===''){
$input.focus();
passedValidation=false;
return false;
}});
return passedValidation;
}
onSuccess(response){
this.$codeForm.removeAttr('data-processing');
this.codesent=false;
this.$codeForm.hide();
this.$inputs.val('');
if(this.$parentForm.length){
if(response.notice){
this.$parentForm.closest('.xoo-el-section').find('.xoo-el-notice').html(response.notice).show();
}
this.$parentForm.show();
}}
startResendTimer(){
var _thisObj=this,
$cont=this.$codeForm.find('.xoo-el-code-resend'),
$resendLink=$cont.find('.xoo-el-code-resend-link'),
$timer=$cont.find('.xoo-el-code-resend-timer'),
resendTime=parseInt(xoo_el_localize.resend_wait);
if(resendTime===0) return;
$resendLink.addClass('xoo-el-disabled');
clearInterval(this.resendTimer);
this.resendTimer=setInterval(function(){
$timer.html('('+resendTime+')');
if(resendTime <=0){
clearInterval(_thisObj.resendTimer);
$resendLink.removeClass('xoo-el-disabled');
$timer.html('');
}
resendTime--;
},1000)
}
showNotice(notice){
var _thisObj=this;
clearTimeout(this.noticeTimout);
this.$noticeCont.html(notice).show();
this.noticeTimout=setTimeout(function(){
_thisObj.$noticeCont.hide();
},4000)
}
onCodeSent(response){
var _thisObj=this;
if(response.error) return;
_thisObj.codesent=true;
_thisObj.$codeForm.show();
if(response.code_txt){
_thisObj.$codeForm.find('.xoo-el-code-no-txt').html(response.code_txt);
}
setTimeout(function(){
_thisObj.$inputs.first().trigger('click');
_thisObj.$inputs.first().focus();
_thisObj.$inputs.first().attr('autofocus', true);
}, 500)
_thisObj.startResendTimer();
_thisObj.parentFormValues=_thisObj.$parentForm.serialize();
_thisObj.$codeForm.attr('data-processing','yes');
_thisObj.$parentForm.hide();
}
verifyCode(data){
var _thisObj=this;
var form_data=$.extend({
'code': _thisObj.getCodeValue(),
'action': 'xoo_el_code_form_submit',
'xoo_el_code_ajax': _thisObj.codeFormID,
'parentFormData': objectifyForm(_thisObj.$parentForm)
}, data);
$.ajax({
url: xoo_el_localize.adminurl,
type: 'POST',
data: form_data,
success: function(response){
_thisObj.$submitBtn.removeClass('xoo-el-processing').html(_thisObj.submitBtnTxt);
if(response.notice){
_thisObj.showNotice(response.notice);
}
if(response.error===0){
_thisObj.onSuccess(response);
_thisObj.$codeForm.trigger('xoo_el_on_code_success', [response]);
}}
});
}
validateFormSubmit(){
if(this.validateInputs()&&this.getCodeValue().length){
this.$submitBtn.html(xoo_el_localize.html.spinner).addClass('xoo-el-processing');
return true;
}}
getCodeValue(){
var code='';
this.$inputs.each(function(index, input){
code +=$(input).val();
});
return code;
}}
CodeFormHandler.instances=new WeakMap();
$('.xoo-el-code-form').each(function(index, codeForm){
new CodeFormHandler($(codeForm));
});
window.xooEl.CodeFormHandler=CodeFormHandler;
if(xoo_el_localize.resetPwPattern==="code"){
class lostPasswordFormHandler{
constructor($form){
this.$form=$form;
this.$section=this.$form.closest('.xoo-el-section');
this.$resetPwSection=this.$section.siblings('[data-section="resetpw"]');
this.$resetPwForm=this.$resetPwSection.find('.xoo-el-form-resetpw');
this.$container=this.$section.closest('.xoo-el-form-container');
this.codeFormHandler=new CodeFormHandler($form.siblings('.xoo-el-code-form'));
this.events();
}
events(){
this.$form.on('xoo_el_form_submitted', this.onFormSubmit.bind(this));
this.$resetPwForm.on('xoo_el_form_submitted', this.onResetPWFormSubmit.bind(this));
this.codeFormHandler.$codeForm.on('xoo_el_on_code_success', this.onCodeVerificationSuccess.bind(this));
this.$container.on('xoo_el_form_toggled', this.onLostPasswordFormToggle.bind(this));
}
onFormSubmit(e, response, $form, container){
let _thisObj=this;
_thisObj.codeFormHandler.onCodeSent(response);
_thisObj.$resetPwSection.removeAttr('data-verified','yes');
}
onResetPWFormSubmit(e, response, $form, containerObj){
let _thisObj=this;
_thisObj.$resetPwSection.removeAttr('data-verified','yes');
if(response.error){
_thisObj.$section.find('.xoo-el-notice').html(response.notice).show();
if(response.error_code==='code_reset'){
containerObj.toggleForm('lostpw');
}}else{
containerObj.toggleForm('login');
this.$container.find('.xoo-el-section[data-section="login"]').find('.xoo-el-notice').html(response.notice).show();
}}
onCodeVerificationSuccess(e, response){
let _thisObj=this;
_thisObj.$container.find('.xoo-el-resetpw-tgr').trigger('click');
_thisObj.$resetPwSection.attr('data-verified','yes');
}
onLostPasswordFormToggle(e, formType, containerObj, referral){
let _thisObj=this;
if(formType!=='lostpw') return;
if(_thisObj.$resetPwSection.attr('data-verified')==="yes"){
containerObj.toggleForm('resetpw');
}}
}
$('form.xoo-el-form-lostpw').each(function(index, el){
new lostPasswordFormHandler($(el));
})
}});
(()=>{var t={507:(t,e,r)=>{"use strict";r.d(e,{A:()=>A});var n=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var i=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var o=function(t,e){return function(r,o,s,c=10){const l=t[e];if(!i(r))return;if(!n(o))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof c)return void console.error("If specified, the hook priority must be a number.");const a={callback:s,priority:c,namespace:o};if(l[r]){const t=l[r].handlers;let e;for(e=t.length;e>0&&!(c>=t[e-1].priority);e--);e===t.length?t[e]=a:t.splice(e,0,a),l.__current.forEach((t=>{t.name===r&&t.currentIndex>=e&&t.currentIndex++}))}else l[r]={handlers:[a],runs:0};"hookAdded"!==r&&t.doAction("hookAdded",r,o,s,c)}};var s=function(t,e,r=!1){return function(o,s){const c=t[e];if(!i(o))return;if(!r&&!n(s))return;if(!c[o])return 0;let l=0;if(r)l=c[o].handlers.length,c[o]={runs:c[o].runs,handlers:[]};else{const t=c[o].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===s&&(t.splice(e,1),l++,c.__current.forEach((t=>{t.name===o&&t.currentIndex>=e&&t.currentIndex--})))}return"hookRemoved"!==o&&t.doAction("hookRemoved",o,s),l}};var c=function(t,e){return function(r,n){const i=t[e];return void 0!==n?r in i&&i[r].handlers.some((t=>t.namespace===n)):r in i}};var l=function(t,e,r,n){return function(i,...o){const s=t[e];s[i]||(s[i]={handlers:[],runs:0}),s[i].runs++;const c=s[i].handlers;if(!c||!c.length)return r?o[0]:void 0;const l={name:i,currentIndex:0};return(n?async function(){try{s.__current.add(l);let t=r?o[0]:void 0;for(;l.currentIndex<c.length;){const e=c[l.currentIndex];t=await e.callback.apply(null,o),r&&(o[0]=t),l.currentIndex++}return r?t:void 0}finally{s.__current.delete(l)}}:function(){try{s.__current.add(l);let t=r?o[0]:void 0;for(;l.currentIndex<c.length;){t=c[l.currentIndex].callback.apply(null,o),r&&(o[0]=t),l.currentIndex++}return r?t:void 0}finally{s.__current.delete(l)}})()}};var a=function(t,e){return function(){const r=t[e],n=Array.from(r.__current);return n.at(-1)?.name??null}};var d=function(t,e){return function(r){const n=t[e];return void 0===r?n.__current.size>0:Array.from(n.__current).some((t=>t.name===r))}};var u=function(t,e){return function(r){const n=t[e];if(i(r))return n[r]&&n[r].runs?n[r].runs:0}};class h{actions;filters;addAction;addFilter;removeAction;removeFilter;hasAction;hasFilter;removeAllActions;removeAllFilters;doAction;doActionAsync;applyFilters;applyFiltersAsync;currentAction;currentFilter;doingAction;doingFilter;didAction;didFilter;constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=o(this,"actions"),this.addFilter=o(this,"filters"),this.removeAction=s(this,"actions"),this.removeFilter=s(this,"filters"),this.hasAction=c(this,"actions"),this.hasFilter=c(this,"filters"),this.removeAllActions=s(this,"actions",!0),this.removeAllFilters=s(this,"filters",!0),this.doAction=l(this,"actions",!1,!1),this.doActionAsync=l(this,"actions",!1,!0),this.applyFilters=l(this,"filters",!0,!1),this.applyFiltersAsync=l(this,"filters",!0,!0),this.currentAction=a(this,"actions"),this.currentFilter=a(this,"filters"),this.doingAction=d(this,"actions"),this.doingFilter=d(this,"filters"),this.didAction=u(this,"actions"),this.didFilter=u(this,"filters")}}var A=function(){return new h}},8770:()=>{}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{actions:()=>x,addAction:()=>s,addFilter:()=>c,applyFilters:()=>m,applyFiltersAsync:()=>v,createHooks:()=>t.A,currentAction:()=>y,currentFilter:()=>F,defaultHooks:()=>o,didAction:()=>b,didFilter:()=>k,doAction:()=>f,doActionAsync:()=>p,doingAction:()=>_,doingFilter:()=>g,filters:()=>w,hasAction:()=>d,hasFilter:()=>u,removeAction:()=>l,removeAllActions:()=>h,removeAllFilters:()=>A,removeFilter:()=>a});var t=r(507),e=r(8770),i={};for(const t in e)["default","actions","addAction","addFilter","applyFilters","applyFiltersAsync","createHooks","currentAction","currentFilter","defaultHooks","didAction","didFilter","doAction","doActionAsync","doingAction","doingFilter","filters","hasAction","hasFilter","removeAction","removeAllActions","removeAllFilters","removeFilter"].indexOf(t)<0&&(i[t]=()=>e[t]);r.d(n,i);const o=(0,t.A)(),{addAction:s,addFilter:c,removeAction:l,removeFilter:a,hasAction:d,hasFilter:u,removeAllActions:h,removeAllFilters:A,doAction:f,doActionAsync:p,applyFilters:m,applyFiltersAsync:v,currentAction:y,currentFilter:F,doingAction:_,doingFilter:g,didAction:b,didFilter:k,actions:x,filters:w}=o})(),(window.wp=window.wp||{}).hooks=n})();
(()=>{"use strict";var t={d:(n,e)=>{for(var r in e)t.o(e,r)&&!t.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:e[r]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};t.r(n),t.d(n,{__:()=>F,_n:()=>L,_nx:()=>D,_x:()=>w,createI18n:()=>h,defaultI18n:()=>b,getLocaleData:()=>g,hasTranslation:()=>O,isRTL:()=>P,resetLocaleData:()=>x,setLocaleData:()=>v,sprintf:()=>l,subscribe:()=>m});var e,r,a,i,o=/%(((\d+)\$)|(\(([$_a-zA-Z][$_a-zA-Z0-9]*)\)))?[ +0#-]*\d*(\.(\d+|\*))?(ll|[lhqL])?([cduxXefgsp%])/g;function l(t,...n){return function(t,...n){var e=0;return Array.isArray(n[0])&&(n=n[0]),t.replace(o,(function(){var t,r,a,i,o;return t=arguments[3],r=arguments[5],"%"===(i=arguments[9])?"%":("*"===(a=arguments[7])&&(a=n[e],e++),void 0===r?(void 0===t&&(t=e+1),e++,o=n[t-1]):n[0]&&"object"==typeof n[0]&&n[0].hasOwnProperty(r)&&(o=n[0][r]),"f"===i?o=parseFloat(o)||0:"d"===i&&(o=parseInt(o)||0),void 0!==a&&("f"===i?o=o.toFixed(a):"s"===i&&(o=o.substr(0,a))),null!=o?o:"")}))}(t,...n)}e={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},r=["(","?"],a={")":["("],":":["?","?:"]},i=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var s={"!":function(t){return!t},"*":function(t,n){return t*n},"/":function(t,n){return t/n},"%":function(t,n){return t%n},"+":function(t,n){return t+n},"-":function(t,n){return t-n},"<":function(t,n){return t<n},"<=":function(t,n){return t<=n},">":function(t,n){return t>n},">=":function(t,n){return t>=n},"==":function(t,n){return t===n},"!=":function(t,n){return t!==n},"&&":function(t,n){return t&&n},"||":function(t,n){return t||n},"?:":function(t,n,e){if(t)throw n;return e}};function u(t){var n=function(t){for(var n,o,l,s,u=[],d=[];n=t.match(i);){for(o=n[0],(l=t.substr(0,n.index).trim())&&u.push(l);s=d.pop();){if(a[o]){if(a[o][0]===s){o=a[o][1]||o;break}}else if(r.indexOf(s)>=0||e[s]<e[o]){d.push(s);break}u.push(s)}a[o]||d.push(o),t=t.substr(n.index+o.length)}return(t=t.trim())&&u.push(t),u.concat(d.reverse())}(t);return function(t){return function(t,n){var e,r,a,i,o,l,u=[];for(e=0;e<t.length;e++){if(o=t[e],i=s[o]){for(r=i.length,a=Array(r);r--;)a[r]=u.pop();try{l=i.apply(null,a)}catch(t){return t}}else l=n.hasOwnProperty(o)?n[o]:+o;u.push(l)}return u[0]}(n,t)}}var d={contextDelimiter:"",onMissingKey:null};function c(t,n){var e;for(e in this.data=t,this.pluralForms={},this.options={},d)this.options[e]=void 0!==n&&e in n?n[e]:d[e]}c.prototype.getPluralForm=function(t,n){var e,r,a,i=this.pluralForms[t];return i||("function"!=typeof(a=(e=this.data[t][""])["Plural-Forms"]||e["plural-forms"]||e.plural_forms)&&(r=function(t){var n,e,r;for(n=t.split(";"),e=0;e<n.length;e++)if(0===(r=n[e].trim()).indexOf("plural="))return r.substr(7)}(e["Plural-Forms"]||e["plural-forms"]||e.plural_forms),a=function(t){var n=u(t);return function(t){return+n({n:t})}}(r)),i=this.pluralForms[t]=a),i(n)},c.prototype.dcnpgettext=function(t,n,e,r,a){var i,o,l;return i=void 0===a?0:this.getPluralForm(t,a),o=e,n&&(o=n+this.options.contextDelimiter+e),(l=this.data[t][o])&&l[i]?l[i]:(this.options.onMissingKey&&this.options.onMissingKey(e,t),0===i?e:r)};const p={plural_forms:t=>1===t?0:1},f=/^i18n\.(n?gettext|has_translation)(_|$)/,h=(t,n,e)=>{const r=new c({}),a=new Set,i=()=>{a.forEach((t=>t()))},o=(t,n="default")=>{r.data[n]={...r.data[n],...t},r.data[n][""]={...p,...r.data[n]?.[""]},delete r.pluralForms[n]},l=(t,n)=>{o(t,n),i()},s=(t="default",n,e,a,i)=>(r.data[t]||o(void 0,t),r.dcnpgettext(t,n,e,a,i)),u=t=>t||"default",d=(t,n,r)=>{let a=s(r,n,t);return e?(a=e.applyFilters("i18n.gettext_with_context",a,t,n,r),e.applyFilters("i18n.gettext_with_context_"+u(r),a,t,n,r)):a};if(t&&l(t,n),e){const t=t=>{f.test(t)&&i()};e.addAction("hookAdded","core/i18n",t),e.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:(t="default")=>r.data[t],setLocaleData:l,addLocaleData:(t,n="default")=>{r.data[n]={...r.data[n],...t,"":{...p,...r.data[n]?.[""],...t?.[""]}},delete r.pluralForms[n],i()},resetLocaleData:(t,n)=>{r.data={},r.pluralForms={},l(t,n)},subscribe:t=>(a.add(t),()=>a.delete(t)),__:(t,n)=>{let r=s(n,void 0,t);return e?(r=e.applyFilters("i18n.gettext",r,t,n),e.applyFilters("i18n.gettext_"+u(n),r,t,n)):r},_x:d,_n:(t,n,r,a)=>{let i=s(a,void 0,t,n,r);return e?(i=e.applyFilters("i18n.ngettext",i,t,n,r,a),e.applyFilters("i18n.ngettext_"+u(a),i,t,n,r,a)):i},_nx:(t,n,r,a,i)=>{let o=s(i,a,t,n,r);return e?(o=e.applyFilters("i18n.ngettext_with_context",o,t,n,r,a,i),e.applyFilters("i18n.ngettext_with_context_"+u(i),o,t,n,r,a,i)):o},isRTL:()=>"rtl"===d("ltr","text direction"),hasTranslation:(t,n,a)=>{const i=n?n+""+t:t;let o=!!r.data?.[a??"default"]?.[i];return e&&(o=e.applyFilters("i18n.has_translation",o,t,n,a),o=e.applyFilters("i18n.has_translation_"+u(a),o,t,n,a)),o}}},_=window.wp.hooks,y=h(void 0,void 0,_.defaultHooks);var b=y;const g=y.getLocaleData.bind(y),v=y.setLocaleData.bind(y),x=y.resetLocaleData.bind(y),m=y.subscribe.bind(y),F=y.__.bind(y),w=y._x.bind(y),L=y._n.bind(y),D=y._nx.bind(y),P=y.isRTL.bind(y),O=y.hasTranslation.bind(y);(window.wp=window.wp||{}).i18n=n})();