@ikas/storefront 2.0.34 → 2.0.35-alpha.2

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 e from'../ext/decode-uri-component/index.js';export{default}from"../node_modules/decode-uri-component/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 o from'../ext/split-on-first/index.js';export{default}from"../node_modules/split-on-first/index.js";
1
+ import e from'../ext/decode-uri-component/index.js';export{default}from"../node_modules/decode-uri-component/index.js";
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__assign as r}from'../ext/tslib/tslib.es6.js';import{makeAutoObservable as o}from"mobx";import"../models/data/blog/index.js";import{IkasBrand as i}from"../models/data/brand/index.js";import{IkasCategory as s}from"../models/data/category/index.js";import{IkasCheckout as a}from"../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/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/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 c}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{FacebookPixel as n}from"./facebookPixel.js";import{GoogleTagManager as d}from"./googleTagManager.js";import{IkasCart as u}from"../models/data/cart/index.js";import{IkasEventType as l}from"./events.js";import{IkasStorefrontConfig as m}from"../storefront/index.js";import p from'../ext/lodash/cloneDeep.js';import{tryForEach as b}from"../utils/helper.js";import"../utils/i18n.js";import f from"./ikas.js";var h=function(){function h(){o(this)}return h.getCustomerInfo=function(){return t(this,void 0,void 0,(function(){var t,o;return e(this,(function(e){switch(e.label){case 0:return[4,(t=m.store).customerStore.waitUntilInitialized()];case 1:return e.sent(),(o=t.customerStore.customer)?[2,r(r({},o.basicInfo),{consentGranted:t.customerStore.customerConsentGranted})]:[2,null]}}))}))},h.pageView=function(r){return t(this,void 0,void 0,(function(){var t,o,i;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=window.location.href,[4,h.getCustomerInfo()];case 1:return o=e.sent(),d.pageView(t),f.pageView(r),b(h.subscribers,(function(e){e.callback({type:l.PAGE_VIEW,data:{url:t,pageType:r,customer:o}})})),[3,3];case 2:return i=e.sent(),console.error(i),[3,3];case 3:return[2]}}))}))},h.productView=function(t){try{if(n.productView(t),d.productView(t),f.productView(t),h.subscribers.length){var e=p(t),r=new c(e.product,e.selectedVariantValues);b(h.subscribers,(function(t){t.callback({type:l.PRODUCT_VIEW,data:{productDetail:r}})}))}}catch(t){console.error(t)}},h.addToCart=function(t,e,r,o){try{if(n.addToCart(t,e,r),d.addToCart(t,e),f.addToCart(t,e,o),h.subscribers.length){var i=p(t),s=new u(p(o));b(h.subscribers,(function(t){t.callback({type:l.ADD_TO_CART,data:{item:i,quantity:e,cart:s}})}))}}catch(t){console.error(t)}},h.removeFromCart=function(t,e,r){try{if(d.removeFromCart(t,e),h.subscribers.length){var o=p(t),i=new u(p(r));b(h.subscribers,(function(t){t.callback({type:l.REMOVE_FROM_CART,data:{item:o,quantity:e,cart:i}})}))}}catch(t){console.error(t)}},h.beginCheckout=function(t){try{var e=localStorage.getItem("gtmBeginCheckout");if(e&&t.id===e)return;if(localStorage.setItem("gtmBeginCheckout",t.id),n.beginCheckout(t),d.beginCheckout(t),f.beginCheckout(t),h.subscribers.length){var r=new a(p(t));b(h.subscribers,(function(t){t.callback({type:l.BEGIN_CHECKOUT,data:{checkout:r}})}))}}catch(t){console.error(t)}},h.purchase=function(t,e){try{if(localStorage.removeItem("gtmBeginCheckout"),n.purchase(t,e.id||""),d.purchase(t,e.id||""),f.orderSuccess(t),h.subscribers.length){var r=new a(p(t)),o=p(e);b(h.subscribers,(function(t){t.callback({type:l.COMPLETE_CHECKOUT,data:{checkout:r,transaction:o}})}))}}catch(t){console.error(t)}},h.checkoutStep=function(t,e){try{if(d.checkoutStep(t,e),f.checkoutStep(t,e),h.subscribers.length){var r=new a(p(t));b(h.subscribers,(function(t){t.callback({type:l.CHECKOUT_STEP,data:{checkout:r,step:e}})}))}}catch(t){console.error(t)}},h.disableHTML=function(){try{d.disableHTML()}catch(t){console.error(t)}},h.addToWishlist=function(t){try{n.addToWishlist(t),h.subscribers.length&&b(h.subscribers,(function(e){e.callback({type:l.ADD_TO_WISHLIST,data:{productId:t}})}))}catch(t){console.error(t)}},h.search=function(t){try{n.search(t),d.search(t),h.subscribers.length&&b(h.subscribers,(function(e){e.callback({type:l.SEARCH,data:{searchKeyword:t}})}))}catch(t){console.error(t)}},h.completeRegistration=function(t,e){try{n.completeRegistration(),d.completeRegistration(),f.customerRegister(),h.subscribers.length&&b(h.subscribers,(function(e){e.callback({type:l.CUSTOMER_REGISTER,data:{email:t}})}))}catch(t){console.error(t)}},h.customerLogin=function(){return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,h.getCustomerInfo()];case 1:return(t=e.sent())&&t.email?(d.customerLogin(t.email),f.customerLogin(),h.subscribers.length&&b(h.subscribers,(function(e){e.callback({type:l.CUSTOMER_LOGIN,data:{customer:t}})})),[3,3]):[2];case 2:return r=e.sent(),console.error(r),[3,3];case 3:return[2]}}))}))},h.customerLogout=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){try{h.subscribers.length&&b(h.subscribers,(function(t){t.callback({type:l.CUSTOMER_LOGOUT,data:{}})}))}catch(t){console.error(t)}return[2]}))}))},h.customerVisit=function(){return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,h.getCustomerInfo()];case 1:return(t=e.sent())&&t.email?(d.customerVisit(t.email),f.customerVisit(),h.subscribers.length&&b(h.subscribers,(function(e){e.callback({type:l.CUSTOMER_VISIT,data:{customer:t}})})),[3,3]):[2];case 2:return r=e.sent(),console.error(r),[3,3];case 3:return[2]}}))}))},h.viewCart=function(t){try{if(t&&(n.viewCart(t),f.viewCart(t),h.subscribers.length)){var e=new u(p(t));b(h.subscribers,(function(t){t.callback({type:l.VIEW_CART,data:{cart:e}})}))}}catch(t){console.error(t)}},h.viewCategory=function(t,e){try{if(n.viewCategory(t),d.viewCategory(e,t),f.viewCategory(e),h.subscribers.length){var r=new s(p(e));b(h.subscribers,(function(e){e.callback({type:l.VIEW_CATEGORY,data:{categoryPath:t,category:r}})}))}}catch(t){console.error(t)}},h.viewBrand=function(t){try{if(f.viewBrand(t),h.subscribers.length){var e=new i(p(t));b(h.subscribers,(function(t){t.callback({type:l.VIEW_BRAND,data:{brand:e}})}))}}catch(t){console.error(t)}},h.viewSearchResults=function(t,e){try{if(h.subscribers.length){var r=p(e).map((function(t){return new c(t.product,t.selectedVariantValues)}));b(h.subscribers,(function(e){e.callback({type:l.VIEW_SEARCH_RESULTS,data:{searchKeyword:t,productDetails:r}})}))}}catch(t){console.error(t)}},h.viewListing=function(t){try{if(h.subscribers.length){var e=p(t).map((function(t){return new c(t.product,t.selectedVariantValues)}));b(h.subscribers,(function(t){t.callback({type:l.VIEW_LISTING,data:{productDetails:e}})}))}}catch(t){console.error(t)}},h.contactForm=function(t){try{if(n.contactForm(),h.subscribers.length){var e=p(t);b(h.subscribers,(function(t){t.callback({type:l.CONTACT_FORM,data:{form:e}})}))}}catch(t){console.error(t)}},h.subscribers=[],h}();export{h as Analytics};
1
+ import{__awaiter as e,__generator as t,__assign as r}from'../ext/tslib/tslib.es6.js';import{makeAutoObservable as o}from"mobx";import"../models/data/blog/index.js";import{IkasBrand as i}from"../models/data/brand/index.js";import{IkasCategory as s}from"../models/data/category/index.js";import{IkasCheckout as a}from"../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/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/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 c}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{FacebookPixel as n}from"./facebookPixel.js";import{GoogleTagManager as u}from"./googleTagManager.js";import{IkasCart as d}from"../models/data/cart/index.js";import{IkasEventType as m}from"./events.js";import{IkasStorefrontConfig as l}from"../storefront/index.js";import p from'../ext/lodash/cloneDeep.js';import{tryForEach as b}from"../utils/helper.js";import"../utils/i18n.js";import f from"./ikas.js";import{GoogleAnalytics as h}from"./googleAnalytics.js";import{GoogleUniversal as g}from"./googleUniversal.js";var v=function(){function v(){o(this)}return v.getCustomerInfo=function(){return e(this,void 0,void 0,(function(){var e,o;return t(this,(function(t){switch(t.label){case 0:return[4,(e=l.store).customerStore.waitUntilInitialized()];case 1:return t.sent(),(o=e.customerStore.customer)?[2,r(r({},o.basicInfo),{consentGranted:e.customerStore.customerConsentGranted})]:[2,null]}}))}))},v.pageView=function(r){return e(this,void 0,void 0,(function(){var e,o,i;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=window.location.href,[4,v.getCustomerInfo()];case 1:return o=t.sent(),u.pageView(e),f.pageView(r),b(v.subscribers,(function(t){t.callback({type:m.PAGE_VIEW,data:{url:e,pageType:r,customer:o}})})),[3,3];case 2:return i=t.sent(),console.error(i),[3,3];case 3:return[2]}}))}))},v.productView=function(e){try{if(n.productView(e),u.productView(e),f.productView(e),h.productView(e),g.productView(e),v.subscribers.length){var t=p(e),r=new c(t.product,t.selectedVariantValues);b(v.subscribers,(function(e){e.callback({type:m.PRODUCT_VIEW,data:{productDetail:r}})}))}}catch(e){console.error(e)}},v.addToCart=function(e,t,r,o){try{if(n.addToCart(e,t,r),u.addToCart(e,t),f.addToCart(e,t,o),h.addToCart(e,t),g.addToCart(e,t),v.subscribers.length){var i=p(e),s=new d(p(o));b(v.subscribers,(function(e){e.callback({type:m.ADD_TO_CART,data:{item:i,quantity:t,cart:s}})}))}}catch(e){console.error(e)}},v.removeFromCart=function(e,t,r){try{if(u.removeFromCart(e,t),h.removeFromCart(e,t),g.removeFromCart(e,t),v.subscribers.length){var o=p(e),i=new d(p(r));b(v.subscribers,(function(e){e.callback({type:m.REMOVE_FROM_CART,data:{item:o,quantity:t,cart:i}})}))}}catch(e){console.error(e)}},v.beginCheckout=function(e){try{var t=localStorage.getItem("gtmBeginCheckout");if(t&&e.id===t)return;if(localStorage.setItem("gtmBeginCheckout",e.id),n.beginCheckout(e),u.beginCheckout(e),f.beginCheckout(e),h.beginCheckout(e),v.subscribers.length){var r=new a(p(e));b(v.subscribers,(function(e){e.callback({type:m.BEGIN_CHECKOUT,data:{checkout:r}})}))}}catch(e){console.error(e)}},v.purchase=function(e,t){try{if(localStorage.removeItem("gtmBeginCheckout"),n.purchase(e,e.orderNumber||""),u.purchase(e,e.orderNumber||""),f.orderSuccess(e),h.purchase(e,e.orderNumber||""),g.purchase(e,e.orderNumber||""),v.subscribers.length){var r=new a(p(e)),o=p(t);b(v.subscribers,(function(e){e.callback({type:m.COMPLETE_CHECKOUT,data:{checkout:r,transaction:o}})}))}}catch(e){console.error(e)}},v.checkoutStep=function(e,t){try{if(u.checkoutStep(e,t),f.checkoutStep(e,t),h.checkoutStep(e,t),v.subscribers.length){var r=new a(p(e));b(v.subscribers,(function(e){e.callback({type:m.CHECKOUT_STEP,data:{checkout:r,step:t}})}))}}catch(e){console.error(e)}},v.disableHTML=function(){try{u.disableHTML()}catch(e){console.error(e)}},v.addToWishlist=function(e){try{n.addToWishlist(e),v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.ADD_TO_WISHLIST,data:{productId:e}})}))}catch(e){console.error(e)}},v.search=function(e){try{n.search(e),u.search(e),v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.SEARCH,data:{searchKeyword:e}})}))}catch(e){console.error(e)}},v.completeRegistration=function(e,t){try{n.completeRegistration(),u.completeRegistration(),f.customerRegister(),v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.CUSTOMER_REGISTER,data:{email:e}})}))}catch(e){console.error(e)}},v.customerLogin=function(){return e(this,void 0,void 0,(function(){var e,r;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,v.getCustomerInfo()];case 1:return(e=t.sent())&&e.email?(u.customerLogin(e.email),f.customerLogin(),v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.CUSTOMER_LOGIN,data:{customer:e}})})),[3,3]):[2];case 2:return r=t.sent(),console.error(r),[3,3];case 3:return[2]}}))}))},v.customerLogout=function(){return e(this,void 0,void 0,(function(){return t(this,(function(e){try{v.subscribers.length&&b(v.subscribers,(function(e){e.callback({type:m.CUSTOMER_LOGOUT,data:{}})}))}catch(e){console.error(e)}return[2]}))}))},v.customerVisit=function(){return e(this,void 0,void 0,(function(){var e,r;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,v.getCustomerInfo()];case 1:return(e=t.sent())&&e.email?(u.customerVisit(e.email),f.customerVisit(),v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.CUSTOMER_VISIT,data:{customer:e}})})),[3,3]):[2];case 2:return r=t.sent(),console.error(r),[3,3];case 3:return[2]}}))}))},v.viewCart=function(e){try{if(e&&(n.viewCart(e),f.viewCart(e),h.viewCart(e),v.subscribers.length)){var t=new d(p(e));b(v.subscribers,(function(e){e.callback({type:m.VIEW_CART,data:{cart:t}})}))}}catch(e){console.error(e)}},v.viewCategory=function(e,t){try{if(n.viewCategory(e),u.viewCategory(t,e),f.viewCategory(t),v.subscribers.length){var r=new s(p(t));b(v.subscribers,(function(t){t.callback({type:m.VIEW_CATEGORY,data:{categoryPath:e,category:r}})}))}}catch(e){console.error(e)}},v.viewBrand=function(e){try{if(f.viewBrand(e),v.subscribers.length){var t=new i(p(e));b(v.subscribers,(function(e){e.callback({type:m.VIEW_BRAND,data:{brand:t}})}))}}catch(e){console.error(e)}},v.viewSearchResults=function(e,t){try{if(v.subscribers.length){var r=p(t).map((function(e){return new c(e.product,e.selectedVariantValues)}));b(v.subscribers,(function(t){t.callback({type:m.VIEW_SEARCH_RESULTS,data:{searchKeyword:e,productDetails:r}})}))}}catch(e){console.error(e)}},v.viewListing=function(e){try{if(v.subscribers.length){var t=p(e).map((function(e){return new c(e.product,e.selectedVariantValues)}));b(v.subscribers,(function(e){e.callback({type:m.VIEW_LISTING,data:{productDetails:t}})}))}}catch(e){console.error(e)}},v.contactForm=function(e){try{if(n.contactForm(),v.subscribers.length){var t=p(e);b(v.subscribers,(function(e){e.callback({type:m.CONTACT_FORM,data:{form:t}})}))}}catch(e){console.error(e)}},v.subscribers=[],v}();export{v as Analytics};
@@ -0,0 +1,13 @@
1
+ import { IkasProductDetail, IkasOrderLineItem, IkasCheckout } from "../models";
2
+ import { IkasCart } from "../models/data/cart";
3
+ import { CheckoutStep } from "../components/checkout/model";
4
+ export declare class GoogleAnalytics {
5
+ constructor();
6
+ static productView(productDetail: IkasProductDetail): void;
7
+ static addToCart(item: IkasProductDetail | IkasOrderLineItem, quantity: number): void;
8
+ static removeFromCart(item: IkasProductDetail | IkasOrderLineItem, quantity: number): void;
9
+ static viewCart(cart: IkasCart): void;
10
+ static beginCheckout(checkout: IkasCheckout): void;
11
+ static purchase(checkout: IkasCheckout, orderId: string): void;
12
+ static checkoutStep(checkout: IkasCheckout, step: CheckoutStep): void;
13
+ }
@@ -0,0 +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/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/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 i}from"../components/checkout/model.js";var o="undefined"==typeof window,r=function(){function r(){e(this)}return r.productView=function(e){try{return void(!o&&window.gtag&&window.gtag("event","view_item",{currency:""===e.selectedVariant.price.currency?"TRY":e.selectedVariant.price.currency,value:e.selectedVariant.price.finalPrice,items:[a(e)]}))}catch(e){console.error(e)}},r.addToCart=function(e,i){try{return void(!o&&window.gtag&&window.gtag("event","add_to_cart",{currency:e instanceof t?""===e.selectedVariant.price.currency?"TRY":e.selectedVariant.price.currency:e.currencyCode,value:e instanceof t?e.selectedVariant.price.finalPrice:e.finalPrice,items:[e instanceof t?a(e,i):n(e,i)]}))}catch(e){console.error(e)}},r.removeFromCart=function(e,i){try{return void(!o&&window.gtag&&window.gtag("event","remove_from_cart",{currency:e instanceof t?""===e.selectedVariant.price.currency?"TRY":e.selectedVariant.price.currency:e.currencyCode,value:e instanceof t?e.selectedVariant.price.finalPrice:e.finalPrice,items:[e instanceof t?a(e,i):n(e,i)]}))}catch(e){console.error(e)}},r.viewCart=function(e){try{return void(!o&&window.gtag&&window.gtag("event","view_cart",{currency:e.currencyCode,value:e.totalPrice,items:e.items.map((function(e){return n(e,e.quantity)}))}))}catch(e){console.error(e)}},r.beginCheckout=function(e){var t,i;try{return void(!o&&window.gtag&&window.gtag("event","begin_checkout",{currency:null===(t=e.cart)||void 0===t?void 0:t.currencyCode,value:e.totalFinalPrice,items:null===(i=e.cart)||void 0===i?void 0:i.items.map((function(e){return n(e,e.quantity)}))}))}catch(e){console.error(e)}},r.purchase=function(e,t){var i,r,a;try{return void(!o&&window.gtag&&window.gtag("event","purchase",{transaction_id:t,affiliation:window.location.hostname,value:""+e.totalFinalPrice,tax:""+(null===(i=e.cart)||void 0===i?void 0:i.totalTax),shipping:""+e.shippingTotal,currency:null===(r=e.cart)||void 0===r?void 0:r.currencyCode,coupon:e.couponCode,items:null===(a=e.cart)||void 0===a?void 0:a.items.map((function(e){return n(e,e.quantity)}))}))}catch(e){console.error(e)}},r.checkoutStep=function(e,t){var r,a,d,c,m;if(t===i.SHIPPING)try{return void(!o&&window.gtag&&window.gtag("event","add_shipping_info",{currency:null===(r=e.cart)||void 0===r?void 0:r.currencyCode,value:e.totalFinalPrice,shipping_tier:"Ground",coupon:e.couponCode,items:null===(a=e.cart)||void 0===a?void 0:a.items.map((function(e){return n(e,e.quantity)}))}))}catch(e){console.error(e)}if(t===i.PAYMENT)try{return void(!o&&window.gtag&&window.gtag("event","add_payment_info",{currency:null===(d=e.cart)||void 0===d?void 0:d.currencyCode,value:e.totalFinalPrice,coupon:e.couponCode,payment_type:null===(c=e.selectedPaymentGateway)||void 0===c?void 0:c.paymentMethodType,items:null===(m=e.cart)||void 0===m?void 0:m.items.map((function(e){return n(e,e.quantity)}))}))}catch(e){console.error(e)}},r}();function a(e,t){var i;return void 0===t&&(t=1),{item_name:e.product.name,item_id:e.selectedVariant.id,price:e.selectedVariant.price.finalPrice,item_brand:(null===(i=e.product.brand)||void 0===i?void 0:i.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 n(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{r as GoogleAnalytics};
@@ -64,6 +64,7 @@ export declare class GoogleTagManager {
64
64
  index: number;
65
65
  quantity: number;
66
66
  })[];
67
+ cart: import("../models/data/cart").IkasCart | null | undefined;
67
68
  };
68
69
  } | undefined;
69
70
  static removeFromCart(item: IkasProductDetail | IkasOrderLineItem, quantity: number): {
@@ -98,6 +99,7 @@ export declare class GoogleTagManager {
98
99
  index: number;
99
100
  quantity: number;
100
101
  })[];
102
+ cart: import("../models/data/cart").IkasCart | null | undefined;
101
103
  };
102
104
  } | undefined;
103
105
  static beginCheckout(checkout: IkasCheckout): {
@@ -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/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/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";var o="undefined"==typeof window,i=function(){function i(){e(this)}return i.pageView=function(e){try{var t={event:"page-view",page:e};return!o&&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:[a(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!o&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.addToCart=function(e,r){try{var i={event:"add_to_cart",ecommerce:{items:[e instanceof t?a(e,r):n(e,r)]}};return!o&&window.dataLayer&&window.dataLayer.push(i),i}catch(e){console.error(e)}},i.removeFromCart=function(e,r){try{var i={event:"remove_from_cart",ecommerce:{items:[e instanceof t?a(e,r):n(e,r)]}};return!o&&window.dataLayer&&window.dataLayer.push(i),i}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 n(e,e.quantity)}))}};return!o&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.purchase=function(e,t){var r,i,a;try{var d={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===(i=e.cart)||void 0===i?void 0:i.currencyCode,coupon:e.couponCode,items:null===(a=e.cart)||void 0===a?void 0:a.items.map((function(e){return n(e,e.quantity)}))}}};return!o&&window.dataLayer&&window.dataLayer.push(d),d}catch(e){console.error(e)}},i.checkoutStep=function(e,t){var i,a="";t===r.INFO?a="checkout_info":t===r.SHIPPING?a="checkout_shipping":t===r.PAYMENT?a="checkout_payment":t===r.SUCCESS&&(a="checkout_success");try{var d={event:a,ecommerce:{items:null===(i=e.cart)||void 0===i?void 0:i.items.map((function(e){return n(e,e.quantity)}))}};return!o&&window.dataLayer&&window.dataLayer.push(d),d}catch(e){console.error(e)}},i.disableHTML=function(){try{!o&&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!o&&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!o&&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!o&&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!o&&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!o&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i}();function a(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 n(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/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/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 i="undefined"==typeof window,a=function(){function a(){e(this)}return a.pageView=function(e){try{var t={event:"page-view",page:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},a.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!i&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},a.addToCart=function(e,r){var a=o.store.cartStore.cart;try{var m={event:"add_to_cart",ecommerce:{items:[e instanceof t?n(e,r):d(e,r)],cart:a}};return!i&&window.dataLayer&&window.dataLayer.push(m),m}catch(e){console.error(e)}},a.removeFromCart=function(e,r){var a=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==a?void 0:a.itemCount)?null:a}};return!i&&window.dataLayer&&window.dataLayer.push(m),m}catch(e){console.error(e)}},a.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!i&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},a.purchase=function(e,t){var r,o,a;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===(a=e.cart)||void 0===a?void 0:a.items.map((function(e){return d(e,e.quantity)}))}}};return!i&&window.dataLayer&&window.dataLayer.push(n),n}catch(e){console.error(e)}},a.checkoutStep=function(e,t){var o,a="";t===r.INFO?a="checkout_info":t===r.SHIPPING?a="checkout_shipping":t===r.PAYMENT?a="checkout_payment":t===r.SUCCESS&&(a="checkout_success");try{var n={event:a,ecommerce:{items:null===(o=e.cart)||void 0===o?void 0:o.items.map((function(e){return d(e,e.quantity)}))}};return!i&&window.dataLayer&&window.dataLayer.push(n),n}catch(e){console.error(e)}},a.disableHTML=function(){try{!i&&window.dataLayer&&window.dataLayer.push({"gtm.blocklist":["html","customScripts","customPixels","nonGoogleScripts"]})}catch(e){console.error(e)}},a.completeRegistration=function(){try{var e={event:"customer_register"};return!i&&window.dataLayer&&window.dataLayer.push(e),e}catch(e){console.error(e)}},a.search=function(e){try{var t={event:"search",search_string:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},a.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!i&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},a.customerLogin=function(e){try{var t={event:"customer_login",email:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},a.customerVisit=function(e){try{var t={event:"customer_visit",email:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},a}();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{a as GoogleTagManager};
@@ -0,0 +1,8 @@
1
+ import { IkasProductDetail, IkasOrderLineItem, IkasCheckout } from "../models";
2
+ export declare class GoogleUniversal {
3
+ constructor();
4
+ static productView(productDetail: IkasProductDetail): void;
5
+ static addToCart(item: IkasProductDetail | IkasOrderLineItem, quantity: number): void;
6
+ static removeFromCart(item: IkasProductDetail | IkasOrderLineItem, quantity: number): void;
7
+ static purchase(checkout: IkasCheckout, orderId: string): void;
8
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as o}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/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/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";var i="undefined"==typeof window,e=function(){function e(){o(this)}return e.productView=function(o){try{return void(!i&&window.ga&&(window.ga("ec:addProduct",function(o,t){var i;return{id:o.selectedVariant.id,name:o.product.name,brand:(null===(i=o.product.brand)||void 0===i?void 0:i.name)||"",category:o.product.categories.map((function(o){return o.name})).join(" / "),variant:o.selectedVariant.variantValues.map((function(o){return o.name})).join(" / ")}}(o)),window.ga("ec:setAction","detail"),window.ga("send","pageview")))}catch(o){console.error(o)}},e.addToCart=function(o,e){try{return void(!i&&window.ga&&(window.ga("ec:addProduct",o instanceof t?r(o,e):a(o,e)),window.ga("ec:setAction","add"),window.ga("send","event","UX","click","add to cart")))}catch(o){console.error(o)}},e.removeFromCart=function(o,e){try{return void(!i&&window.ga&&(window.ga("ec:addProduct",o instanceof t?r(o,e):a(o,e)),window.ga("ec:setAction","remove"),window.ga("send","event","UX","click","add to cart")))}catch(o){console.error(o)}},e.purchase=function(o,t){var e,r,d;try{return void(!i&&window.ga&&(window.ga("set","currencyCode",null===(e=o.cart)||void 0===e?void 0:e.currencyCode),null===(r=o.cart)||void 0===r||r.items.map((function(o){return window.ga("ec:addProduct",a(o,o.quantity))})),window.ga("ec:setAction","purchase",{id:t,affiliation:window.location.hostname,revenue:""+o.totalFinalPrice,tax:""+(null===(d=o.cart)||void 0===d?void 0:d.totalTax),shipping:""+o.shippingTotal,coupon:o.couponCode}),window.ga("send","pageview")))}catch(o){console.error(o)}},e}();function r(o,t){var i;return void 0===t&&(t=1),{id:o.selectedVariant.id,name:o.product.name,brand:(null===(i=o.product.brand)||void 0===i?void 0:i.name)||"",category:o.product.categories.map((function(o){return o.name})).join(" / "),variant:o.selectedVariant.variantValues.map((function(o){return o.name})).join(" / "),price:o.selectedVariant.price.finalPrice,quantity:t}}function a(o,t){return void 0===t&&(t=1),{name:o.variant.name,id:o.variant.id,price:""+o.finalPrice,brand:"",category:"",variant:o.variant.variantValues.map((function(o){return o.variantValueName})).join(" / "),quantity:t}}export{e as GoogleUniversal};
@@ -1 +1 @@
1
- import*as e from"react";import{IkasStorefrontConfig as t}from"../../storefront/index.js";import n from'../../ext/html-react-parser/index.js';import{getIkasEventsScript as r}from"../events.js";import{observer as a}from"mobx-react-lite";var o=a((function(a){var o=a.blockHTML,s=t.gtmId,i=t.fbpId,c=t.storefrontJSScripts;return e.createElement(e.Fragment,null,o&&!t.isEditor&&e.createElement("script",{dangerouslySetInnerHTML:{__html:"dataLayer = [{'gtm.blocklist': ['html']}];"}}),s&&!t.isEditor&&e.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','".concat(s,"');")}}),i&&!t.isEditor&&e.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"!function(f,b,e,v,n,t,s)\n {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n n.queue=[];t=b.createElement(e);t.async=!0;\n t.src=v;s=b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t,s)}(window, document,'script',\n 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '".concat(i,"');\n fbq('track', 'PageView');")}}),n(r()),c.map((function(e){return n(e)})))})),s=function(){var n=t.gtmId,r=t.fbpId;return e.createElement(e.Fragment,null,n&&!t.isEditor&&e.createElement("noscript",{dangerouslySetInnerHTML:{__html:'<iframe src="https://www.googletagmanager.com/ns.html?id='.concat(n,'" height="0" width="0" style="display:none;visibility:hidden"></iframe>')}}),r&&!t.isEditor&&e.createElement("noscript",{dangerouslySetInnerHTML:{__html:'<img height="1" width="1" style="display:none" \n src="https://www.facebook.com/tr?id='.concat(r,'&ev=PageView&noscript=1"/>')}}))};export{s as AnalyticsBody,o as AnalyticsHead};
1
+ import*as e from"react";import{IkasStorefrontConfig as t}from"../../storefront/index.js";import n from'../../ext/html-react-parser/index.js';import{getIkasEventsScript as r}from"../events.js";import{observer as a}from"mobx-react-lite";var s=a((function(a){var s=a.blockHTML,o=t.gtmId,i=t.fbpId,c=t.storefrontJSScripts,l=t.analytics4Id,m=t.universalAnalyticsId;return e.createElement(e.Fragment,null,s&&!t.isEditor&&e.createElement("script",{dangerouslySetInnerHTML:{__html:"dataLayer = [{'gtm.blocklist': ['html']}];"}}),o&&!t.isEditor&&e.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','".concat(o,"');")}}),i&&!t.isEditor&&e.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"!function(f,b,e,v,n,t,s)\n {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n n.queue=[];t=b.createElement(e);t.async=!0;\n t.src=v;s=b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t,s)}(window, document,'script',\n 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '".concat(i,"');\n fbq('track', 'PageView');")}}),l&&!t.isEditor&&e.createElement(e.Fragment,null,e.createElement("script",{async:!0,src:"https://www.googletagmanager.com/gtag/js?id=".concat(l)}),e.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '".concat(l,"');")}})),m&&!t.isEditor&&e.createElement(e.Fragment,null,e.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;\n ga('create', '".concat(m,"', 'auto');\n ga('require', 'ec');\n ga('send', 'pageview');")}}),e.createElement("script",{async:!0,src:"https://www.google-analytics.com/analytics.js"})),n(r()),c.map((function(e){return n(e)})))})),o=function(){var n=t.gtmId,r=t.fbpId;return e.createElement(e.Fragment,null,n&&!t.isEditor&&e.createElement("noscript",{dangerouslySetInnerHTML:{__html:'<iframe src="https://www.googletagmanager.com/ns.html?id='.concat(n,'" height="0" width="0" style="display:none;visibility:hidden"></iframe>')}}),r&&!t.isEditor&&e.createElement("noscript",{dangerouslySetInnerHTML:{__html:'<img height="1" width="1" style="display:none" \n src="https://www.facebook.com/tr?id='.concat(r,'&ev=PageView&noscript=1"/>')}}))};export{o as AnalyticsBody,s as AnalyticsHead};
@@ -44,6 +44,8 @@ export interface getStorefront_getStorefront {
44
44
  emailSettingsId: string | null;
45
45
  fbpId: string | null;
46
46
  gtmId: string | null;
47
+ analytics4Id: string | null;
48
+ universalAnalyticsId: string | null;
47
49
  id: string;
48
50
  localizations: getStorefront_getStorefront_localizations[];
49
51
  mainStorefrontThemeId: string | null;
@@ -1 +1 @@
1
- import{__awaiter as n,__generator as e,__makeTemplateObject as t}from'../../ext/tslib/tslib.es6.js';import{apollo as r}from"../apollo.js";import o from'../../ext/graphql-tag/src/index.js';import{IkasStorefront as a}from"../../models/data/storefront/index.js";var i,d=function(){function d(){}return d.getStorefront=function(d){return n(this,void 0,void 0,(function(){var n,s,l,m,u;return e(this,(function(e){switch(e.label){case 0:n=o(i||(i=t(["\n query getStorefront($id: String!) {\n getStorefront(id: $id) {\n createdAt\n emailSettingsId\n fbpId\n gtmId\n id\n localizations {\n createdAt\n id\n isDefault\n locale\n name\n }\n mainStorefrontThemeId\n name\n salesChannelId\n routings {\n countryCodes\n createdAt\n domain\n id\n locale\n path\n priceListId\n updatedAt\n dynamicCurrencySettings {\n roundingFormat\n targetCurrencyCode\n }\n }\n status\n themes {\n createdAt\n id\n isMainTheme\n name\n status\n themeId\n themeVersionId\n updatedAt\n }\n }\n }\n "],["\n query getStorefront($id: String!) {\n getStorefront(id: $id) {\n createdAt\n emailSettingsId\n fbpId\n gtmId\n id\n localizations {\n createdAt\n id\n isDefault\n locale\n name\n }\n mainStorefrontThemeId\n name\n salesChannelId\n routings {\n countryCodes\n createdAt\n domain\n id\n locale\n path\n priceListId\n updatedAt\n dynamicCurrencySettings {\n roundingFormat\n targetCurrencyCode\n }\n }\n status\n themes {\n createdAt\n id\n isMainTheme\n name\n status\n themeId\n themeVersionId\n updatedAt\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,r.getClient().query({query:n,variables:{id:d}})];case 2:return s=e.sent(),l=s.data,(m=s.errors)&&m.length&&console.log(m),l?[2,new a(l.getStorefront)]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},d}();export{d as IkasStorefrontAPI};
1
+ import{__awaiter as n,__generator as e,__makeTemplateObject as t}from'../../ext/tslib/tslib.es6.js';import{apollo as r}from"../apollo.js";import a from'../../ext/graphql-tag/src/index.js';import{IkasStorefront as i}from"../../models/data/storefront/index.js";var d,o=function(){function o(){}return o.getStorefront=function(o){return n(this,void 0,void 0,(function(){var n,s,l,c,u;return e(this,(function(e){switch(e.label){case 0:n=a(d||(d=t(["\n query getStorefront($id: String!) {\n getStorefront(id: $id) {\n createdAt\n emailSettingsId\n fbpId\n gtmId\n analytics4Id\n universalAnalyticsId\n id\n localizations {\n createdAt\n id\n isDefault\n locale\n name\n }\n mainStorefrontThemeId\n name\n salesChannelId\n routings {\n countryCodes\n createdAt\n domain\n id\n locale\n path\n priceListId\n updatedAt\n dynamicCurrencySettings {\n roundingFormat\n targetCurrencyCode\n }\n }\n status\n themes {\n createdAt\n id\n isMainTheme\n name\n status\n themeId\n themeVersionId\n updatedAt\n }\n }\n }\n "],["\n query getStorefront($id: String!) {\n getStorefront(id: $id) {\n createdAt\n emailSettingsId\n fbpId\n gtmId\n analytics4Id\n universalAnalyticsId\n id\n localizations {\n createdAt\n id\n isDefault\n locale\n name\n }\n mainStorefrontThemeId\n name\n salesChannelId\n routings {\n countryCodes\n createdAt\n domain\n id\n locale\n path\n priceListId\n updatedAt\n dynamicCurrencySettings {\n roundingFormat\n targetCurrencyCode\n }\n }\n status\n themes {\n createdAt\n id\n isMainTheme\n name\n status\n themeId\n themeVersionId\n updatedAt\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,r.getClient().query({query:n,variables:{id:o}})];case 2:return s=e.sent(),l=s.data,(c=s.errors)&&c.length&&console.log(c),l?[2,new i(l.getStorefront)]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},o}();export{o as IkasStorefrontAPI};