@ikas/storefront 2.0.61-alpha.6 → 2.0.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import o from'../ext/split-on-first/index.js';export{default}from"../node_modules/split-on-first/index.js";
1
+ import e from'../ext/strict-uri-encode/index.js';export{default}from"../node_modules/strict-uri-encode/index.js";
@@ -1 +1 @@
1
- import e from'../ext/strict-uri-encode/index.js';export{default}from"../node_modules/strict-uri-encode/index.js";
1
+ import o from'../ext/split-on-first/index.js';export{default}from"../node_modules/split-on-first/index.js";
@@ -1 +1 @@
1
- import{makeAutoObservable as e}from"mobx";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/merchant-settings/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as t}from"../models/ui/product-detail/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{CheckoutStep as r}from"../components/checkout/model.js";import{IkasStorefrontConfig as o}from"../storefront/index.js";var a="undefined"==typeof window,i=function(){function i(){e(this)}return i.pageView=function(e){try{var t={event:"page-view",page:e};return!a&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.productView=function(e){var t;try{var r={event:"view_item",ecommerce:{items:[n(e)],extraParams:{parent_id:e.product.id,currency:e.selectedVariant.price.currency,url:"https://".concat(window.location.hostname).concat(e.href),item_image:(null===(t=e.selectedVariant.mainImage)||void 0===t?void 0:t.src)||""}}};return!a&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.addToCart=function(e,r){var i=o.store.cartStore.cart;try{var m={event:"add_to_cart",ecommerce:{items:[e instanceof t?n(e,r):d(e,r)],cart:i}};return!a&&window.dataLayer&&window.dataLayer.push(m),m}catch(e){console.error(e)}},i.removeFromCart=function(e,r){var i=o.store.cartStore.cart;try{var m={event:"remove_from_cart",ecommerce:{items:[e instanceof t?n(e,r):d(e,r)],cart:0===(null==i?void 0:i.itemCount)?null:i}};return!a&&window.dataLayer&&window.dataLayer.push(m),m}catch(e){console.error(e)}},i.beginCheckout=function(e){var t;try{var r={event:"begin_checkout",ecommerce:{items:null===(t=e.cart)||void 0===t?void 0:t.items.map((function(e){return d(e,e.quantity)}))}};return!a&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.purchase=function(e,t){var r,o,i;try{var n={event:"purchase",ecommerce:{purchase:{transaction_id:t,affiliation:window.location.hostname,value:""+e.totalFinalPrice,tax:""+(null===(r=e.cart)||void 0===r?void 0:r.totalTax),shipping:""+e.shippingTotal,currency:null===(o=e.cart)||void 0===o?void 0:o.currencyCode,coupon:e.couponCode,items:null===(i=e.cart)||void 0===i?void 0:i.items.map((function(e){return d(e,e.quantity)}))}}};return!a&&window.dataLayer&&window.dataLayer.push(n),n}catch(e){console.error(e)}},i.checkoutStep=function(e,t){var o,i="";t===r.INFO?i="checkout_info":t===r.SHIPPING?i="checkout_shipping":t===r.PAYMENT?i="checkout_payment":t===r.SUCCESS&&(i="checkout_success");try{var n={event:i,ecommerce:{items:null===(o=e.cart)||void 0===o?void 0:o.items.map((function(e){return d(e,e.quantity)}))}};return!a&&window.dataLayer&&window.dataLayer.push(n),n}catch(e){console.error(e)}},i.disableHTML=function(){try{!a&&window.dataLayer&&window.dataLayer.push({"gtm.blocklist":["html","customScripts","customPixels","nonGoogleScripts"]})}catch(e){console.error(e)}},i.completeRegistration=function(){try{var e={event:"customer_register"};return!a&&window.dataLayer&&window.dataLayer.push(e),e}catch(e){console.error(e)}},i.search=function(e){try{var t={event:"search",search_string:e};return!a&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.viewCategory=function(e,t){try{var r={event:"view_category",ecommerce:{category:[{id:e.id,name:e.name,metaData:e.metaData,href:e.href,image:e.image,path:t}]}};return!a&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.customerLogin=function(e){try{var t={event:"customer_login",email:e};return!a&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.customerVisit=function(e){try{var t={event:"customer_visit",email:e};return!a&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i}();function n(e,t){var r;return void 0===t&&(t=1),{item_name:e.product.name,item_id:e.selectedVariant.id,price:e.selectedVariant.price.finalPrice,item_brand:(null===(r=e.product.brand)||void 0===r?void 0:r.name)||"",item_category:e.product.categories.length?e.product.categories[0].name:"",item_category_2:e.product.categories.length>1?e.product.categories[1].name:"",item_category_3:e.product.categories.length>2?e.product.categories[2].name:"",item_category_4:e.product.categories.length>3?e.product.categories[3].name:"",item_variant:e.selectedVariant.variantValues.map((function(e){return e.name})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}function d(e,t){return void 0===t&&(t=1),{item_name:e.variant.name,item_id:e.variant.id,price:""+e.finalPrice,item_brand:"",item_category:"",item_category_2:"",item_category_3:"",item_category_4:"",item_variant:e.variant.variantValues.map((function(e){return e.variantValueName})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}export{i as GoogleTagManager};
1
+ import{makeAutoObservable as e}from"mobx";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/merchant-settings/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as t}from"../models/ui/product-detail/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{CheckoutStep as r}from"../components/checkout/model.js";import{IkasStorefrontConfig as o}from"../storefront/index.js";var a="undefined"==typeof window,i=function(){function i(){e(this)}return i.pageView=function(e){try{var t={event:"page-view-GTM",page:e};return!a&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.productView=function(e){var t;try{var r={event:"view_item-GTM",ecommerce:{items:[n(e)],extraParams:{parent_id:e.product.id,currency:e.selectedVariant.price.currency,url:"https://".concat(window.location.hostname).concat(e.href),item_image:(null===(t=e.selectedVariant.mainImage)||void 0===t?void 0:t.src)||""}}};return!a&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.addToCart=function(e,r){var i=o.store.cartStore.cart;try{var m={event:"add_to_cart-GTM",ecommerce:{items:[e instanceof t?n(e,r):d(e,r)],cart:i}};return!a&&window.dataLayer&&window.dataLayer.push(m),m}catch(e){console.error(e)}},i.removeFromCart=function(e,r){var i=o.store.cartStore.cart;try{var m={event:"remove_from_cart-GTM",ecommerce:{items:[e instanceof t?n(e,r):d(e,r)],cart:0===(null==i?void 0:i.itemCount)?null:i}};return!a&&window.dataLayer&&window.dataLayer.push(m),m}catch(e){console.error(e)}},i.beginCheckout=function(e){var t;try{var r={event:"begin_checkout-GTM",ecommerce:{items:null===(t=e.cart)||void 0===t?void 0:t.items.map((function(e){return d(e,e.quantity)}))}};return!a&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.purchase=function(e,t){var r,o,i;try{var n={event:"purchase-GTM",ecommerce:{purchase:{transaction_id:t,affiliation:window.location.hostname,value:""+e.totalFinalPrice,tax:""+(null===(r=e.cart)||void 0===r?void 0:r.totalTax),shipping:""+e.shippingTotal,currency:null===(o=e.cart)||void 0===o?void 0:o.currencyCode,coupon:e.couponCode,items:null===(i=e.cart)||void 0===i?void 0:i.items.map((function(e){return d(e,e.quantity)}))}}};return!a&&window.dataLayer&&window.dataLayer.push(n),n}catch(e){console.error(e)}},i.checkoutStep=function(e,t){var o,i="";t===r.INFO?i="checkout_info-GTM":t===r.SHIPPING?i="checkout_shipping-GTM":t===r.PAYMENT?i="checkout_payment-GTM":t===r.SUCCESS&&(i="checkout_success-GTM");try{var n={event:i,ecommerce:{items:null===(o=e.cart)||void 0===o?void 0:o.items.map((function(e){return d(e,e.quantity)}))}};return!a&&window.dataLayer&&window.dataLayer.push(n),n}catch(e){console.error(e)}},i.disableHTML=function(){try{!a&&window.dataLayer&&window.dataLayer.push({"gtm.blocklist":["html","customScripts","customPixels","nonGoogleScripts"]})}catch(e){console.error(e)}},i.completeRegistration=function(){try{var e={event:"customer_register-GTM"};return!a&&window.dataLayer&&window.dataLayer.push(e),e}catch(e){console.error(e)}},i.search=function(e){try{var t={event:"search-GTM",search_string:e};return!a&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.viewCategory=function(e,t){try{var r={event:"view_category-GTM",ecommerce:{category:[{id:e.id,name:e.name,metaData:e.metaData,href:e.href,image:e.image,path:t}]}};return!a&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.customerLogin=function(e){try{var t={event:"customer_login-GTM",email:e};return!a&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.customerVisit=function(e){try{var t={event:"customer_visit-GTM",email:e};return!a&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i}();function n(e,t){var r;return void 0===t&&(t=1),{item_name:e.product.name,item_id:e.selectedVariant.id,price:e.selectedVariant.price.finalPrice,item_brand:(null===(r=e.product.brand)||void 0===r?void 0:r.name)||"",item_category:e.product.categories.length?e.product.categories[0].name:"",item_category_2:e.product.categories.length>1?e.product.categories[1].name:"",item_category_3:e.product.categories.length>2?e.product.categories[2].name:"",item_category_4:e.product.categories.length>3?e.product.categories[3].name:"",item_variant:e.selectedVariant.variantValues.map((function(e){return e.name})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}function d(e,t){return void 0===t&&(t=1),{item_name:e.variant.name,item_id:e.variant.id,price:""+e.finalPrice,item_brand:"",item_category:"",item_category_2:"",item_category_3:"",item_category_4:"",item_variant:e.variant.variantValues.map((function(e){return e.variantValueName})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}export{i as GoogleTagManager};