File: /home/zwafgyp/lacalita/wp-content/plugins/rey-core/inc/elementor/widgets/wc-cart/assets/script.js
!function(e){"use strict";var o={init:function(o){return"undefined"!=typeof wc_cart_params&&(void 0!==e.fn.block&&(this.page_selector=".rey-cartPage.--layout-custom",this.$page=e(this.page_selector,o),this.$form=e(".woocommerce-cart-form",this.$page),this.$totals=e(".cart_totals",this.$page),this.events(),this.move_coupon(),void this.sticky_totals()))},events:function(){var o=this;e(document).on("click",this.page_selector+' button[name="apply_coupon"]',(function(e){e.preventDefault(),o.apply_coupon()})),e(document.body).on("updated_wc_div updated_shipping_method applied_coupon removed_coupon country_to_state_changed",(function(){o.move_coupon()}))},block:function(e){e.is(".processing")||e.parents(".processing").length||e.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},show_notice:function(o,t){t||(t=e(".woocommerce-notices-wrapper:first",this.$page)||e(".cart-empty",this.$page).closest(".woocommerce")||e(".woocommerce-cart-form",this.$page)),t.prepend(o)},apply_coupon:function(){this.block(this.$form);var o=this,t=e("#coupon_code",this.$page),c=t.val(),r={security:wc_cart_params.apply_coupon_nonce,coupon_code:c};e.ajax({type:"POST",url:wc_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","apply_coupon"),data:r,dataType:"html",success:function(t){e(".woocommerce-error, .woocommerce-message, .woocommerce-info",this.$page).remove(),o.show_notice(t),e(document.body).trigger("applied_coupon",[c])},complete:function(){o.$form.removeClass("processing").unblock(),t.val(""),e(document).trigger("wc_update_cart",[!0])}})},move_coupon:function(){if(e(".woocommerce-cart-form__actions .coupon").remove(),!e(".cart_totals .coupon").length&&e("#tmpl-reycore-cart-coupon").length){var o=rey.template("reycore-cart-coupon");e(o()).insertBefore(".wc-proceed-to-checkout")}},sticky_totals:function(){rey.vars.is_desktop&&this.$page.is(".--totals-sticky")&&rey.elements.siteWrapper&&rey.elements.siteWrapper.style.setProperty("--site-wrapper-overflow","visible")}};rey.hooks.addAction("elementor/init",(function(e){e.registerElement({name:"reycore-wc-cart.default",cb:function(e){o.init(e)}})}))}(jQuery);