(()=>{"use strict";const t=t=>!(t=>null===t)(t)&&t instanceof Object&&t.constructor===Object;function e(e,o){return t(e)&&o in e}const o=window.wp.data,n=window.wc.wcSettings,c=((0,window.wp.i18n.__)("Unable to get cart data from the API.","woocommerce"),o=>!(!t(o)||!e(o,"push"))&&"function"==typeof o.push);document.addEventListener("DOMContentLoaded",(()=>{c(window._wca)}));const i=t=>{const e=t.split("?")[0];return"/"!==e.charAt(e.length-1)?e+"/":e};document.addEventListener("DOMContentLoaded",(()=>{const t=(0,o.select)("wc/store/cart");t?t.hasFinishedResolution("getCartTotals")&&((t=>{var o;const a=(0,n.getSetting)("storePages",{});if(!e(a,"cart"))return;if(i(null==a||null===(o=a.cart)||void 0===o?void 0:o.permalink)!==i(window.location.href))return;if(!c(window._wca))return;const r=(0,n.getSetting)("wc-blocks-jetpack-woocommerce-analytics_cart_checkout_info",{});window._wca.push({_en:"woocommerceanalytics_cart_view",products_count:t.items.length,order_value:t.totals.total_price,products:JSON.stringify(t.items.map((t=>({pp:t.totals.line_total,pq:t.quantity,pi:t.id,pn:t.name,pt:t.type})))),...r})})(t.getCartData()),(t=>{var o;const a=(0,n.getSetting)("storePages",{});if(!e(a,"checkout"))return;if(i(null==a||null===(o=a.checkout)||void 0===o?void 0:o.permalink)!==i(window.location.href))return;if(!c(window._wca))return;const r=(0,n.getSetting)("wc-blocks-jetpack-woocommerce-analytics_cart_checkout_info",{});window._wca.push({_en:"woocommerceanalytics_checkout_view",products_count:t.items.length,order_value:t.totals.total_price,products:JSON.stringify(t.items.map((t=>({pp:t.totals.line_total,pq:t.quantity,pi:t.id,pn:t.name})))),...r})})(t.getCartData())):(()=>{const t=(0,n.getSetting)("wc-blocks-jetpack-woocommerce-analytics_order_received_properties",!1);t&&c(window._wca)&&window._wca.push({_en:"woocommerceanalytics_order_confirmation_view",...t})})()}))})();