(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.jQuery;var n=e.n(t);const o=window.wcStripe.actions;var i=e.n(o);const d=window.wcStripe.utils;new class{constructor(){this.initialize()}initialize(){n()(document.body).on("updated_cart_totals",this.onCartDOMUpdated.bind(this)),n()(document.body).on("added_to_cart",this.onAddedToCart.bind(this)),n()(document.body).on("removed_from_cart",this.onRemovedFromCart.bind(this)),n()(document.body).on("wc_fragments_refreshed wc_fragments_loaded",this.onCartFragmentsChanged.bind(this)),n()(document.body).on("update_checkout",this.onUpdateCheckout.bind(this)),n()(document.body).on("updated_checkout",this.onUpdatedCheckout.bind(this)),n()(document.body).on("change",'input[name="payment_method"]',this.onPaymentMethodSelected.bind(this)),n()(document.body).on("payment_method_selected",this.onPaymentMethodSelected.bind(this)),n()("form.checkout").on("checkout_place_order_success",this.onPlaceOrderSuccess.bind(this)),n()(document.body).on("change",'[name="billing_phone"],[name="shipping_phone"],[name="billing_email"]',this.onCheckoutFieldChange.bind(this)),n()(document.body).on("change",'input[name^="shipping_method"]',this.onShippingMethodChange.bind(this)),n()(document.body).on("checkout_error",this.onCheckoutError.bind(this)),window.addEventListener("hashchange",this.onHashChange.bind(this)),window.location.hash&&i().addAction("stripe_sdk_loaded",e=>this.onHashChange(e),20),window.location.search&&this.queryHasReviewParams()&&n()(()=>{this.processOrderReview()}),document.addEventListener("wc-stripe:mini-cart-ready",({detail:e})=>{i().doAction("mini_cart_ready",e)}),document.addEventListener("wc-stripe:mini-cart-updated",({detail:e})=>{i().doAction("mini_cart_updated",e.cart)}),document.addEventListener("wc-stripe:single-product-variation-changed",({detail:e})=>{i().doAction("single_product_variation_changed",e.variationId,e.variation)}),document.addEventListener("wc-stripe:single-product-variation-reset",()=>{i().doAction("single_product_variation_reset")})}onCartDOMUpdated(e){let t=null;window?.wcStripeCartData?.cart&&(t=window.wcStripeCartData,window.wcStripeCartData=null),i().doAction("cart_dom_updated",e,t)}onAddedToCart(e,t){const n=t?.wc_stripe_data||{};i().doAction("added_to_cart",e,n)}onRemovedFromCart(e,t){const n=t?.wc_stripe_data||{};i().doAction("removed_from_cart",e,n)}onUpdateCheckout(e){i().doAction("update_checkout",e)}onUpdatedCheckout(e,t={}){i().doAction("updated_checkout",e,t)}onPaymentMethodSelected(e){i().doAction("payment_method_selected",n()('[name="payment_method"]:checked').val())}onCartFragmentsChanged(e){i().doAction("cart_fragments_changed",e)}onCheckoutFieldChange(e){i().doAction("checkout_field_changed",e.currentTarget)}onShippingMethodChange(e){i().doAction("shipping_method_changed",n()(e.currentTarget).val())}onCheckoutError(e,t){const o=n()('[name="payment_method"]:checked').val();i().doAction("checkout_error_"+o,t)}onPlaceOrderSuccess(e,t,n){const o=(0,d.isNextActionRequired)(t?.redirect||"");return!o||!o.hasOwnProperty("client_secret")||(this._intentHandled=!0,"payment_intent"===o.type?i().doAction("payment_intent_requires_actions",o):i().doAction("setup_intent_requires_actions",o),!0)}onHashChange(e){try{const e=(0,d.isNextActionRequired)(window.location.hash);if(!e||!e.hasOwnProperty("client_secret"))return;if(history.replaceState({},"",window.location.pathname),this._intentHandled)return void(this._intentHandled=!1);"payment_intent"===e.type?i().doAction("payment_intent_requires_actions",e):i().doAction("setup_intent_requires_actions",e)}catch(e){console.error("Error parsing 3DS response hash:",e)}}processOrderReview(){const e=(0,d.parseOrderReviewParams)(window.location.search||"");e&&i().doAction("checkout_order_review",e)}queryHasReviewParams(){return null!==(0,d.parseOrderReviewParams)(window.location.search||"")}},(this.wcStripe=this.wcStripe||{}).domEvents={}.default})();