!function(e){"use strict";document.addEventListener("rey-DOMContentLoaded",(function(r){!function(){var r=e(".rey-woocurrency"),c=e(".rey-woocurrencyMobile"),n=e(".woocommerce-currency-switcher",r),t=e(".woocommerce-currency-switcher-form",r);if(n.length){var o=function(r){r.preventDefault(),n.val(e(r.currentTarget).attr("data-currency")).trigger("change")};e('.rey-woocurrency-item[href="#"]',r).on("click",o),e('.rey-woocurrency-item[href="#"]',c).on("click",o)}else if(t.length){var a=function(r){r.preventDefault(),e('input[type="hidden"][name="woocommerce-currency-switcher"]',t).val(e(r.currentTarget).attr("data-currency")),t.trigger("submit")};e('.rey-woocurrency-item[data-type="woocs"]',r).on("click",a),e('.rey-woocurrency-item[data-type="woocs"]',c).on("click",a)}if(r.hasClass("--type-aelia")){var i=function(r){r.preventDefault();var c=e(r.currentTarget).attr("data-currency")||"";c&&(e(r.currentTarget).addClass("--loading"),e.post(window.location.href,{aelia_cs_currency:c},(function(e){window.location=window.location.href})))};e('.rey-woocurrency-item[href="#"]',r).on("click",i),e('.rey-woocurrency-item[href="#"]',c).on("click",i)}r.hasClass("--aelia-countries")&&e("select",r).on("change",(function(r){r.preventDefault();var c=e(this);c.closest(".rey-woocurrency").addClass("--loading");var n={};n[c.attr("name")]=c.val(),e.post(window.location.href,n,(function(e){window.location=window.location.href}))}));r.hasClass("--type-wcml")&&"undefined"!=typeof wcml_load_currency&&e('.rey-woocurrency-item[href="#"][data-currency]').on("click",(function(r){r.preventDefault();var c=e(this);c.closest(".rey-woocurrency").addClass("--loading");var n=c.attr("data-currency");wcml_load_currency(n,!0)}))}()}))}(jQuery);