@ikas/storefront 4.9.2 → 4.10.0-beta.10
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.
- package/build/analytics/analytics.js +1 -1
- package/build/analytics/googleTagManager.d.ts +3 -0
- package/build/analytics/googleTagManager.js +1 -1
- package/build/components/checkout/index.d.ts +2 -0
- package/build/components/checkout/index.js +1 -1
- package/build/models/data/filter-category/index.d.ts +3 -0
- package/build/models/data/filter-category/index.js +1 -1
- package/build/models/data/order/line-item/variant/index.d.ts +1 -0
- package/build/models/data/order/line-item/variant/index.js +1 -1
- package/build/models/data/theme-json/index.js +1 -1
- package/package.json +11 -11
|
@@ -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/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import{IkasBrand as i}from"../models/data/brand/index.js";import"@ikas/storefront-models";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import{IkasCart as s}from"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import{IkasCategory as a}from"../models/data/category/index.js";import{IkasCheckout as c}from"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import{IkasProduct as n}from"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/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/ikas-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{FacebookPixel as d}from"./facebookPixel.js";import{GoogleTagManager as m}from"./googleTagManager.js";import{IkasEventType as l}from"./events.js";import u from"lodash/cloneDeep";import{tryForEach as p}from"../utils/helper.js";import b from"./ikas.js";import{GoogleAnalytics as f}from"./googleAnalytics.js";import{GoogleUniversal as h}from"./googleUniversal.js";import{TiktokPixel as g}from"./tiktokPixel.js";import{IkasBaseStore as j}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";var v=function(){function v(){o(this)}return v.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=j.getInstance()).customerStore.waitUntilInitialized()];case 1:return e.sent(),(o=t.customerStore.customer)?[2,r(r({},o.basicInfo),{consentGranted:t.customerStore.customerConsentGranted})]:[2,null]}}))}))},v.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,v.getCustomerInfo()];case 1:return o=e.sent(),m.pageView(t),h.pageView(window.location.pathname),b.pageView(r),p(v.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]}}))}))},v.productView=function(t){try{if(d.productView(t),m.productView(t),b.productView(t),f.productView(t),h.productView(t),g.productView(t),v.subscribers.length){var e=new n(u(t));p(v.subscribers,(function(t){t.callback({type:l.PRODUCT_VIEW,data:{productDetail:e}})}))}}catch(t){console.error(t)}},v.addToCart=function(t,e,r,o){try{if(d.addToCart(t,e,r),m.addToCart(t,e),b.addToCart(t,e,o),f.addToCart(t,e),h.addToCart(t,e),g.addToCart(t,e),v.subscribers.length){var i=u(t),a=new s(u(o));p(v.subscribers,(function(t){t.callback({type:l.ADD_TO_CART,data:{item:i,quantity:e,cart:a}})}))}}catch(t){console.error(t)}},v.removeFromCart=function(t,e,r){try{if(m.removeFromCart(t,e),f.removeFromCart(t,e),h.removeFromCart(t,e),v.subscribers.length){var o=u(t),i=new s(u(r));p(v.subscribers,(function(t){t.callback({type:l.REMOVE_FROM_CART,data:{item:o,quantity:e,cart:i}})}))}}catch(t){console.error(t)}},v.beginCheckout=function(t){try{var e=localStorage.getItem("gtmBeginCheckout");if(e&&t.id===e)return;if(localStorage.setItem("gtmBeginCheckout",t.id),d.beginCheckout(t),m.beginCheckout(t),b.beginCheckout(t),f.beginCheckout(t),g.beginCheckout(),v.subscribers.length){var r=new c(u(t));p(v.subscribers,(function(t){t.callback({type:l.BEGIN_CHECKOUT,data:{checkout:r}})}))}}catch(t){console.error(t)}},v.purchase=function(t,e){try{if(localStorage.removeItem("gtmBeginCheckout"),d.purchase(t,e.id||""),m.purchase(t,t.orderNumber||""),b.orderSuccess(t),f.purchase(t,t.orderNumber||""),h.purchase(t,t.orderNumber||""),g.purchase(t),v.subscribers.length){var r=new c(u(t)),o=u(e);p(v.subscribers,(function(t){t.callback({type:l.COMPLETE_CHECKOUT,data:{checkout:r,transaction:o}})}))}}catch(t){console.error(t)}},v.checkoutStep=function(t,e){try{if(m.checkoutStep(t,e),b.checkoutStep(t,e),f.checkoutStep(t,e),v.subscribers.length){var r=new c(u(t));p(v.subscribers,(function(t){t.callback({type:l.CHECKOUT_STEP,data:{checkout:r,step:e}})}))}}catch(t){console.error(t)}},v.disableHTML=function(){try{m.disableHTML()}catch(t){console.error(t)}},v.addToWishlist=function(t){try{d.addToWishlist(t),g.addToWishlist(t),v.subscribers.length&&p(v.subscribers,(function(e){e.callback({type:l.ADD_TO_WISHLIST,data:{productId:t}})}))}catch(t){console.error(t)}},v.search=function(t){try{d.search(t),m.search(t),g.search(t),f.search(t),v.subscribers.length&&p(v.subscribers,(function(e){e.callback({type:l.SEARCH,data:{searchKeyword:t}})}))}catch(t){console.error(t)}},v.completeRegistration=function(t){try{d.completeRegistration(),m.completeRegistration(t),g.completeRegistration(),b.customerRegister(),v.subscribers.length&&p(v.subscribers,(function(e){e.callback({type:l.CUSTOMER_REGISTER,data:{email:t.email,firstName:t.firstName,lastName:t.lastName}})}))}catch(t){console.error(t)}},v.createEmailSubscripition=function(t){try{v.subscribers.length&&p(v.subscribers,(function(e){e.callback({type:l.EMAIL_SUBSCRIPTION,data:{email:t}})}))}catch(t){console.error(t)}},v.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,v.getCustomerInfo()];case 1:return(t=e.sent())&&t.email?(m.customerLogin(t),b.customerLogin(),v.subscribers.length&&p(v.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]}}))}))},v.customerLogout=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){try{v.subscribers.length&&p(v.subscribers,(function(t){t.callback({type:l.CUSTOMER_LOGOUT,data:{}})}))}catch(t){console.error(t)}return[2]}))}))},v.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,v.getCustomerInfo()];case 1:return(t=e.sent())&&t.email?(m.customerVisit(t),b.customerVisit(),v.subscribers.length&&p(v.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]}}))}))},v.viewCart=function(t){try{if(t&&(d.viewCart(t),b.viewCart(t),f.viewCart(t),m.viewCart(t),v.subscribers.length)){var e=new s(u(t));p(v.subscribers,(function(t){t.callback({type:l.VIEW_CART,data:{cart:e}})}))}}catch(t){console.error(t)}},v.viewCategory=function(t,e){try{if(d.viewCategory(t),m.viewCategory(e,t),b.viewCategory(e),g.viewCategory(e),v.subscribers.length){var r=new a(u(e));p(v.subscribers,(function(e){e.callback({type:l.VIEW_CATEGORY,data:{categoryPath:t,category:r}})}))}}catch(t){console.error(t)}},v.viewBrand=function(t){try{if(b.viewBrand(t),v.subscribers.length){var e=new i(u(t));p(v.subscribers,(function(t){t.callback({type:l.VIEW_BRAND,data:{brand:e}})}))}}catch(t){console.error(t)}},v.viewSearchResults=function(t,e){try{if(v.subscribers.length){var r=u(e).map((function(t){return new n(t)}));p(v.subscribers,(function(e){e.callback({type:l.VIEW_SEARCH_RESULTS,data:{searchKeyword:t,productDetails:r}})}))}}catch(t){console.error(t)}},v.viewListing=function(t){try{if(v.subscribers.length){var e=u(t).map((function(t){return new n(t)}));p(v.subscribers,(function(t){t.callback({type:l.VIEW_LISTING,data:{productDetails:e}})}))}}catch(t){console.error(t)}},v.contactForm=function(t){try{if(d.contactForm(),g.contactForm(),v.subscribers.length){var e=u(t);p(v.subscribers,(function(t){t.callback({type:l.CONTACT_FORM,data:{form:e}})}))}}catch(t){console.error(t)}},v.subscribers=[],v}();export{v as Analytics};
|
|
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/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import{IkasBrand as i}from"../models/data/brand/index.js";import"@ikas/storefront-models";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import{IkasCart as s}from"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import{IkasCategory as a}from"../models/data/category/index.js";import{IkasCheckout as c}from"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import{IkasProduct as n}from"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/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/ikas-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{FacebookPixel as d}from"./facebookPixel.js";import{GoogleTagManager as m}from"./googleTagManager.js";import{IkasEventType as l}from"./events.js";import u from"lodash/cloneDeep";import{tryForEach as p}from"../utils/helper.js";import b from"./ikas.js";import{GoogleAnalytics as f}from"./googleAnalytics.js";import{GoogleUniversal as h}from"./googleUniversal.js";import{TiktokPixel as g}from"./tiktokPixel.js";import{IkasBaseStore as j}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";var v=function(){function v(){o(this)}return v.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=j.getInstance()).customerStore.waitUntilInitialized()];case 1:return e.sent(),(o=t.customerStore.customer)?[2,r(r({},o.basicInfo),{consentGranted:t.customerStore.customerConsentGranted})]:[2,null]}}))}))},v.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,v.getCustomerInfo()];case 1:return o=e.sent(),m.pageView(t),h.pageView(window.location.pathname),b.pageView(r),p(v.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]}}))}))},v.productView=function(t){try{if(d.productView(t),m.productView(t),b.productView(t),f.productView(t),h.productView(t),g.productView(t),v.subscribers.length){var e=new n(u(t));p(v.subscribers,(function(t){t.callback({type:l.PRODUCT_VIEW,data:{productDetail:e}})}))}}catch(t){console.error(t)}},v.addToCart=function(t,e,r,o){try{if(d.addToCart(t,e,r),m.addToCart(t,e),b.addToCart(t,e,o),f.addToCart(t,e),h.addToCart(t,e),g.addToCart(t,e),v.subscribers.length){var i=u(t),a=new s(u(o));p(v.subscribers,(function(t){t.callback({type:l.ADD_TO_CART,data:{item:i,quantity:e,cart:a}})}))}}catch(t){console.error(t)}},v.removeFromCart=function(t,e,r){try{if(m.removeFromCart(t,e),f.removeFromCart(t,e),h.removeFromCart(t,e),v.subscribers.length){var o=u(t),i=new s(u(r));p(v.subscribers,(function(t){t.callback({type:l.REMOVE_FROM_CART,data:{item:o,quantity:e,cart:i}})}))}}catch(t){console.error(t)}},v.beginCheckout=function(t){try{var e=localStorage.getItem("gtmBeginCheckout");if(e&&t.id===e)return;if(localStorage.setItem("gtmBeginCheckout",t.id),d.beginCheckout(t),m.beginCheckout(t),b.beginCheckout(t),f.beginCheckout(t),g.beginCheckout(),v.subscribers.length){var r=new c(u(t));p(v.subscribers,(function(t){t.callback({type:l.BEGIN_CHECKOUT,data:{checkout:r}})}))}}catch(t){console.error(t)}},v.purchase=function(t,e){try{if(localStorage.removeItem("gtmBeginCheckout"),d.purchase(t,e.id||""),m.purchase(t,t.orderNumber||""),b.orderSuccess(t),f.purchase(t,t.orderNumber||""),h.purchase(t,t.orderNumber||""),g.purchase(t),v.subscribers.length){var r=new c(u(t)),o=u(e);p(v.subscribers,(function(t){t.callback({type:l.COMPLETE_CHECKOUT,data:{checkout:r,transaction:o}})}))}}catch(t){console.error(t)}},v.checkoutStep=function(t,e){try{if(m.checkoutStep(t,e),b.checkoutStep(t,e),f.checkoutStep(t,e),v.subscribers.length){var r=new c(u(t));p(v.subscribers,(function(t){t.callback({type:l.CHECKOUT_STEP,data:{checkout:r,step:e}})}))}}catch(t){console.error(t)}},v.disableHTML=function(){try{m.disableHTML()}catch(t){console.error(t)}},v.addToWishlist=function(t){try{d.addToWishlist(t),g.addToWishlist(t),v.subscribers.length&&p(v.subscribers,(function(e){e.callback({type:l.ADD_TO_WISHLIST,data:{productId:t}})}))}catch(t){console.error(t)}},v.search=function(t){try{d.search(t),m.search(t),g.search(t),f.search(t),v.subscribers.length&&p(v.subscribers,(function(e){e.callback({type:l.SEARCH,data:{searchKeyword:t}})}))}catch(t){console.error(t)}},v.completeRegistration=function(t){try{d.completeRegistration(),m.completeRegistration(t),g.completeRegistration(),b.customerRegister(),v.subscribers.length&&p(v.subscribers,(function(e){e.callback({type:l.CUSTOMER_REGISTER,data:{email:t.email,firstName:t.firstName,lastName:t.lastName}})}))}catch(t){console.error(t)}},v.createEmailSubscripition=function(t){try{v.subscribers.length&&p(v.subscribers,(function(e){e.callback({type:l.EMAIL_SUBSCRIPTION,data:{email:t}})}))}catch(t){console.error(t)}},v.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,v.getCustomerInfo()];case 1:return(t=e.sent())&&t.email?(m.customerLogin(t),b.customerLogin(),v.subscribers.length&&p(v.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]}}))}))},v.customerLogout=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){try{m.customerLogout(),v.subscribers.length&&p(v.subscribers,(function(t){t.callback({type:l.CUSTOMER_LOGOUT,data:{}})}))}catch(t){console.error(t)}return[2]}))}))},v.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,v.getCustomerInfo()];case 1:return(t=e.sent())&&t.email?(m.customerVisit(t),b.customerVisit(),v.subscribers.length&&p(v.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]}}))}))},v.viewCart=function(t){try{if(t&&(d.viewCart(t),b.viewCart(t),f.viewCart(t),m.viewCart(t),v.subscribers.length)){var e=new s(u(t));p(v.subscribers,(function(t){t.callback({type:l.VIEW_CART,data:{cart:e}})}))}}catch(t){console.error(t)}},v.viewCategory=function(t,e){try{if(d.viewCategory(t),m.viewCategory(e,t),b.viewCategory(e),g.viewCategory(e),v.subscribers.length){var r=new a(u(e));p(v.subscribers,(function(e){e.callback({type:l.VIEW_CATEGORY,data:{categoryPath:t,category:r}})}))}}catch(t){console.error(t)}},v.viewBrand=function(t){try{if(b.viewBrand(t),v.subscribers.length){var e=new i(u(t));p(v.subscribers,(function(t){t.callback({type:l.VIEW_BRAND,data:{brand:e}})}))}}catch(t){console.error(t)}},v.viewSearchResults=function(t,e){try{if(v.subscribers.length){var r=u(e).map((function(t){return new n(t)}));p(v.subscribers,(function(e){e.callback({type:l.VIEW_SEARCH_RESULTS,data:{searchKeyword:t,productDetails:r}})}))}}catch(t){console.error(t)}},v.viewListing=function(t){try{if(v.subscribers.length){var e=u(t).map((function(t){return new n(t)}));p(v.subscribers,(function(t){t.callback({type:l.VIEW_LISTING,data:{productDetails:e}})}))}}catch(t){console.error(t)}},v.contactForm=function(t){try{if(d.contactForm(),g.contactForm(),v.subscribers.length){var e=u(t);p(v.subscribers,(function(t){t.callback({type:l.CONTACT_FORM,data:{form:e}})}))}}catch(t){console.error(t)}},v.subscribers=[],v}();export{v as Analytics};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeAutoObservable as e}from"mobx";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"@ikas/storefront-models";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import{IkasProduct as t}from"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/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/ikas-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{CheckoutStep as o}from"../components/checkout/model.js";import"./analytics.js";import"./head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../pages/home.js";import"../pages/_slug_/index.js";import"../pages/pages/_slug_.js";import"../pages/checkout.js";import"../pages/account/index.js";import"../pages/account/addresses.js";import"../pages/account/orders/index.js";import"../pages/account/orders/_id_.js";import"../pages/account/login.js";import"../pages/account/register.js";import"../pages/account/forgot-password.js";import"../pages/account/recover-password.js";import"../pages/cart.js";import"../pages/editor.js";import"../pages/account/favorite-products.js";import"../pages/search.js";import"next/error.js";import"../pages/blog/index.js";import"../pages/blog/_slug_.js";import"../pages/raffle/_slug_.js";import"../pages/raffle/index.js";import"../pages/account/raffles.js";import"../pages/account/activate.js";import{IkasBaseStore as r}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"@ikas/storefront-config";import"lodash/get";import a from"lodash/cloneDeep";var i="undefined"==typeof window,s=function(){function s(){e(this)}return s.pageView=function(e){try{var t={event:"page-view-GTM",page:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.productView=function(e){var t,o;try{var r={event:"view_item-GTM",ecommerce:{items:[d(e)],extraParams:{parent_id:e.id,currency:e.selectedVariant.price.currency,url:"https://".concat(window.location.hostname).concat(e.href),item_image:(null===(o=null===(t=e.selectedVariant.mainImage)||void 0===t?void 0:t.image)||void 0===o?void 0:o.src)||""}}};return!i&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},s.addToCart=function(e,o){var a=r.getInstance().cartStore.cart;try{var s={event:"add_to_cart-GTM",ecommerce:{items:[e instanceof t?d(e,o):n(e,o)],cart:a}};return!i&&window.dataLayer&&window.dataLayer.push(s),s}catch(e){console.error(e)}},s.removeFromCart=function(e,o){var a=r.getInstance().cartStore.cart;try{var s={event:"remove_from_cart-GTM",ecommerce:{items:[e instanceof t?d(e,o):n(e,o)],cart:0===(null==a?void 0:a.itemCount)?null:a}};return!i&&window.dataLayer&&window.dataLayer.push(s),s}catch(e){console.error(e)}},s.beginCheckout=function(e){try{var t={event:"begin_checkout-GTM",ecommerce:{items:e.items.map((function(e){return n(e,e.quantity)}))}};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.purchase=function(e,t){try{var o={event:"purchase-GTM",ecommerce:{purchase:{transaction_id:t,affiliation:window.location.hostname,value:""+e.totalFinalPrice,tax:""+e.totalTax,shipping:""+e.shippingTotal,currency:e.currencyCode,coupon:e.couponCode,items:e.items.map((function(e){return n(e,e.quantity)}))}}};return!i&&window.dataLayer&&window.dataLayer.push(o),o}catch(e){console.error(e)}},s.checkoutStep=function(e,t){var r,s,d=a(e);null===(r=d.shippingAddress)||void 0===r||delete r.checkoutSettings,null===(s=d.billingAddress)||void 0===s||delete s.checkoutSettings;var n="";t===o.INFO?n="checkout_info-GTM":t===o.SHIPPING?n="checkout_shipping-GTM":t===o.PAYMENT?n="checkout_payment-GTM":t===o.SUCCESS&&(n="checkout_success-GTM");try{var m={event:n,ecommerce:{cart:d}};return!i&&window.dataLayer&&window.dataLayer.push(m),m}catch(e){console.error(e)}},s.disableHTML=function(){try{!i&&window.dataLayer&&window.dataLayer.push({"gtm.blocklist":["html","customScripts","customPixels","nonGoogleScripts"]})}catch(e){console.error(e)}},s.completeRegistration=function(e){try{var t={event:"customer_register-GTM",customer:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.search=function(e){try{var t={event:"search-GTM",search_string:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.viewCategory=function(e,t){try{var o={event:"view_category-GTM",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(o),o}catch(e){console.error(e)}},s.customerLogin=function(e){try{var t={event:"customer_login-GTM",customer:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.customerVisit=function(e){try{var t={event:"customer_visit-GTM",customer:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.viewCart=function(e){try{var t={event:"view_cart-GTM",ecommerce:{cart:e}};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s}();function d(e,t){var o;return void 0===t&&(t=1),{item_name:e.name,item_id:e.selectedVariant.id,price:e.selectedVariant.price.finalPrice,item_brand:(null===(o=e.brand)||void 0===o?void 0:o.name)||"",item_category:e.categories.length?e.categories[0].name:"",item_category_2:e.categories.length>1?e.categories[1].name:"",item_category_3:e.categories.length>2?e.categories[2].name:"",item_category_4:e.categories.length>3?e.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){var o;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:null===(o=e.variant.variantValues)||void 0===o?void 0:o.map((function(e){return e.variantValueName})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}export{s as GoogleTagManager};
|
|
1
|
+
import{makeAutoObservable as e}from"mobx";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"@ikas/storefront-models";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import{IkasProduct as t}from"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/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/ikas-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{CheckoutStep as o}from"../components/checkout/model.js";import"./analytics.js";import"./head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../pages/home.js";import"../pages/_slug_/index.js";import"../pages/pages/_slug_.js";import"../pages/checkout.js";import"../pages/account/index.js";import"../pages/account/addresses.js";import"../pages/account/orders/index.js";import"../pages/account/orders/_id_.js";import"../pages/account/login.js";import"../pages/account/register.js";import"../pages/account/forgot-password.js";import"../pages/account/recover-password.js";import"../pages/cart.js";import"../pages/editor.js";import"../pages/account/favorite-products.js";import"../pages/search.js";import"next/error.js";import"../pages/blog/index.js";import"../pages/blog/_slug_.js";import"../pages/raffle/_slug_.js";import"../pages/raffle/index.js";import"../pages/account/raffles.js";import"../pages/account/activate.js";import{IkasBaseStore as r}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"@ikas/storefront-config";import"lodash/get";import a from"lodash/cloneDeep";var i="undefined"==typeof window,s=function(){function s(){e(this)}return s.pageView=function(e){try{var t={event:"page-view-GTM",page:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.productView=function(e){var t,o;try{var r={event:"view_item-GTM",ecommerce:{items:[d(e)],extraParams:{parent_id:e.id,currency:e.selectedVariant.price.currency,url:"https://".concat(window.location.hostname).concat(e.href),item_image:(null===(o=null===(t=e.selectedVariant.mainImage)||void 0===t?void 0:t.image)||void 0===o?void 0:o.src)||""}}};return!i&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},s.addToCart=function(e,o){var a=r.getInstance().cartStore.cart;try{var s={event:"add_to_cart-GTM",ecommerce:{items:[e instanceof t?d(e,o):n(e,o)],cart:a}};return!i&&window.dataLayer&&window.dataLayer.push(s),s}catch(e){console.error(e)}},s.removeFromCart=function(e,o){var a=r.getInstance().cartStore.cart;try{var s={event:"remove_from_cart-GTM",ecommerce:{items:[e instanceof t?d(e,o):n(e,o)],cart:0===(null==a?void 0:a.itemCount)?null:a}};return!i&&window.dataLayer&&window.dataLayer.push(s),s}catch(e){console.error(e)}},s.beginCheckout=function(e){try{var t={event:"begin_checkout-GTM",ecommerce:{items:e.items.map((function(e){return n(e,e.quantity)}))}};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.purchase=function(e,t){try{var o={event:"purchase-GTM",ecommerce:{purchase:{transaction_id:t,affiliation:window.location.hostname,value:""+e.totalFinalPrice,tax:""+e.totalTax,shipping:""+e.shippingTotal,currency:e.currencyCode,coupon:e.couponCode,items:e.items.map((function(e){return n(e,e.quantity)}))}}};return!i&&window.dataLayer&&window.dataLayer.push(o),o}catch(e){console.error(e)}},s.checkoutStep=function(e,t){var r,s,d=a(e);null===(r=d.shippingAddress)||void 0===r||delete r.checkoutSettings,null===(s=d.billingAddress)||void 0===s||delete s.checkoutSettings;var n="";t===o.INFO?n="checkout_info-GTM":t===o.SHIPPING?n="checkout_shipping-GTM":t===o.PAYMENT?n="checkout_payment-GTM":t===o.SUCCESS&&(n="checkout_success-GTM");try{var m={event:n,ecommerce:{cart:d}};return!i&&window.dataLayer&&window.dataLayer.push(m),m}catch(e){console.error(e)}},s.disableHTML=function(){try{!i&&window.dataLayer&&window.dataLayer.push({"gtm.blocklist":["html","customScripts","customPixels","nonGoogleScripts"]})}catch(e){console.error(e)}},s.completeRegistration=function(e){try{var t={event:"customer_register-GTM",customer:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.search=function(e){try{var t={event:"search-GTM",search_string:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.viewCategory=function(e,t){try{var o={event:"view_category-GTM",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(o),o}catch(e){console.error(e)}},s.customerLogin=function(e){try{var t={event:"customer_login-GTM",customer:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.customerLogout=function(){try{var e={event:"customer_logout-GTM"};return!i&&window.dataLayer&&window.dataLayer.push(e),e}catch(e){console.error(e)}},s.customerVisit=function(e){try{var t={event:"customer_visit-GTM",customer:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.viewCart=function(e){try{var t={event:"view_cart-GTM",ecommerce:{cart:e}};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s}();function d(e,t){var o;return void 0===t&&(t=1),{item_name:e.name,item_id:e.selectedVariant.id,price:e.selectedVariant.price.finalPrice,item_brand:(null===(o=e.brand)||void 0===o?void 0:o.name)||"",item_category:e.categories.length?e.categories[0].name:"",item_category_2:e.categories.length>1?e.categories[1].name:"",item_category_3:e.categories.length>2?e.categories[2].name:"",item_category_4:e.categories.length>3?e.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){var o;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:null===(o=e.variant.variantValues)||void 0===o?void 0:o.map((function(e){return e.variantValueName})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}export{s as GoogleTagManager};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { IkasCheckoutSettings } from "../../models/data/checkout-settings";
|
|
3
3
|
import { IkasCheckout } from "../../models/data/checkout";
|
|
4
|
+
import { IkasImage } from "../../models";
|
|
4
5
|
export declare type IkasCheckoutPageProps = {
|
|
5
6
|
checkout: IkasCheckout;
|
|
6
7
|
checkoutSettings: IkasCheckoutSettings;
|
|
@@ -12,6 +13,7 @@ export declare type IkasCheckoutPageProps = {
|
|
|
12
13
|
shippingPolicy: string;
|
|
13
14
|
};
|
|
14
15
|
export declare type IkasCheckoutCustomizationProps = {
|
|
16
|
+
logo?: IkasImage;
|
|
15
17
|
showTax?: boolean;
|
|
16
18
|
buttonBgColor?: string;
|
|
17
19
|
buttonTextColor?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{useRouter as r}from"next/router.js";import n from"next/link.js";import a from"react-tooltip";import s,{CheckoutStep as c}from"./model.js";import{IkasStorefrontConfig as l}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import u from"./steps/step-info/index.js";import{CheckoutStepShipping as p}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as v}from"./steps/step-payment/index.js";import{CouponErrorCode as h,Coupon as g,CartSummary as y}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as E}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/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/ikas-address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as f}from"../../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{StepSuccess as k}from"./steps/step-success/index.js";import{Modal as x}from"./components/modal/index.js";import j from"./components/master-pass/modal-otp/index.js";import C from"./components/master-pass/modal-response/index.js";import b from"./components/master-pass/modal-success/index.js";import{Image as N}from"../image/index.js";import F,{Step as P}from"./components/step-container/index.js";import{StockError as T}from"./components/error/stock-error/index.js";import{FullscreenLoading as S}from"./components/fullscreen-loading/index.js";import M from"./components/notification-box/index.js";import{FormItem as w}from"./components/form-item/index.js";import{FormItemType as A}from"./components/form-item/model.js";import{Button as O}from"./components/button/index.js";import{IkasPageHead as I}from"../page/head.js";import B from"./components/offer-product/index.js";import L from"./components/svg/ikas.js";import V from"./style.module.scss.js";import{Analytics as U}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import R from"./components/epaykolay-button/index.js";var _=i((function(i){var n,m,u,p=i.checkout,v=i.checkoutSettings,h=i.customizationProps,g=i.returnPolicy,f=i.privacyPolicy,N=i.termsOfService,F=i.imprint,P=i.shippingPolicy,M=d().t,w=r(),A=o.useState((function(){return new s(p,v,w,g,f,N,F,P,M,h||{})}))[0],O=o.useMemo((function(){return Date.now()}),[]);A.step===c.PAYMENT&&U.disableHTML();var _=function(o,i,r,n,a){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/get-basket"),[4,fetch(e,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":l.getApiKey()},body:JSON.stringify({cartId:A.checkout.id,customerNumber:o,sessionsState:O,addressDto:r,paymentType:n,totalPrice:a})})];case 1:return[2,t.sent().json()]}}))}))};o.useEffect((function(){A.checkoutSettings.isAccountRequired&&!A.checkout.hasCustomer&&w.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),U.beginCheckout(A.checkout),U.pageView(E.CHECKOUT)}),[]),o.useEffect((function(){A.customizationProps=h,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED")}(h)}),[h]),o.useEffect((function(){if(A.isEPayKolayEnabled)var o=setInterval((function(){var i,r;window.setContainerService&&A.isCheckoutLoaded&&(window.setContainerService(null===(i=l.getMerchantSettings())||void 0===i?void 0:i.merchantId,_,(function(o){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,z(o)];case 1:return[2,e.sent()]}}))}))}),(function(){console.log("Switching to epaykolay"),A.isEPayKolayPayment=!0}),"https://cdn-epeykolay.mncdn.com/".concat((null===(r=l.getApiUrl())||void 0===r?void 0:r.includes("myikas.com"))?"epay":"epay-uat","/")),clearInterval(o))}),100)}),[]);var z=o.useCallback((function(o){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,fetch("".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/complete-payment"),{method:"POST",body:JSON.stringify({data:o,cartId:A.checkout.id}),headers:{"Content-Type":"application/json","x-api-key":l.getApiKey()}})];case 1:return[4,t.sent().json()];case 2:return e=t.sent(),[2,{redirectUrl:"".concat(window.location.pathname,"?id=").concat(A.checkout.id,"&step=").concat(e.success?"success":"info"),orderId:e.orderNumber||null}]}}))}))}),[]);if(!A.isCheckoutLoaded||!A.store.customerStore.initialized)return o.createElement(S,null);if(A.checkout.hasCustomer&&(null===(n=A.store.customerStore.customer)||void 0===n?void 0:n.id)!==(null===(m=A.checkout.customer)||void 0===m?void 0:m.id))return w.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),null;return o.createElement(o.Fragment,null,o.createElement(I,{pageType:E.CHECKOUT,pageTitle:((null===(u=A.merchantSettings)||void 0===u?void 0:u.merchantName)||"")+" - "+M("checkout-page:securePayment"),pageDescription:M("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:V.CheckoutPage},o.createElement(a,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:V.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:[V.Left,A.isEPayKolayPayment?V.epaykolay:""].join(" ")},A.isEPayKolayEnabled&&o.createElement("div",{id:"plateau_ui_placeholder",style:{width:"100%"}}),!A.isEPayKolayPayment&&o.createElement("div",{className:V.LeftContent},o.createElement("div",null,o.createElement(D,{vm:A}),A.hasStockError&&o.createElement("div",{className:V.ErrorContainer},o.createElement(T,{vm:A,error:A.error})),!A.hasStockError&&o.createElement(o.Fragment,null,o.createElement(y,{vm:A,allowExpand:!0}),o.createElement("div",null,A.step!==c.SUCCESS&&A.isEPayKolayEnabled&&o.createElement(R,{onClick:function(){window.frictionless()}})),A.step===c.SUCCESS?o.createElement(k,{vm:A}):o.createElement(o.Fragment,null,A.checkoutCampaignOffer&&o.createElement(B,{vm:A,campaignOffer:A.checkoutCampaignOffer}),A.isCouponCodeRequirementOpen&&o.createElement(H,{vm:A}),o.createElement(K,{vm:A}))),o.createElement("div",{className:V.Space})),o.createElement(Y,{vm:A}))),o.createElement("div",{className:V.Right},o.createElement("div",{className:V.RightContent},o.createElement(y,{vm:A}),!A.isPoweredByHidden&&o.createElement("div",{className:V.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===l.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(L,null))))),!!A.policyModalText&&o.createElement(x,{title:A.policyModalTitle,modalContent:A.policyModalText,onClose:function(){A.policyModalText=""}}),A.isContactModalVisible&&o.createElement(X,{vm:A,setVisible:A.setContactModalVisible}),A.mpVM.isOtpModalVisible&&o.createElement(j,{vm:A,visible:A.mpVM.isOtpModalVisible,type:A.mpVM.otpModalType,onClose:A.mpVM.hideOtpModal}),A.mpVM.isResponseModalVisible&&o.createElement(C,{visible:A.mpVM.isResponseModalVisible,text:A.mpVM.mfsResponseModalText,onClose:A.mpVM.onResponseModalClose}),A.mpVM.isSuccessModalVisible&&o.createElement(b,{visible:A.mpVM.isSuccessModalVisible,type:A.mpVM.successModalType,onClose:A.mpVM.onSuccessModalClose})))})),D=i((function(e){var t,i,r,a=e.vm,s=d().t;return o.createElement("div",{className:V.Header},o.createElement(n,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=a.merchantSettings)||void 0===t?void 0:t.logo)?o.createElement("div",{className:V.Logo},o.createElement(N,{layout:"fill",image:a.merchantSettings.logo,sizes:"360px"})):(null===(i=a.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!a.checkout.hasCustomer&&o.createElement("div",{className:V.LoginText},o.createElement("span",{className:V.LoginCta},s("checkout-page:alreadyHaveAnAccount")),o.createElement(n,{href:"/account/login?redirect="+encodeURIComponent(a.checkoutUrl),passHref:!0},o.createElement("a",{className:V.LoginBtn},s("checkout-page:actions.login")))),a.checkout.hasCustomer&&o.createElement("div",{className:V.CustomerInfo},o.createElement("div",{className:V.Name},a.checkout.customerFullName),o.createElement("div",{className:V.Email},null===(r=a.checkout.customer)||void 0===r?void 0:r.email)))})),H=i((function(e){var t=e.vm,i=d().t,r=o.useState(!1),n=r[0],a=r[1],s=o.useState(null),c=s[0],l=s[1],m=o.useMemo((function(){switch(c){case h.COUPON_CODE_NOT_EXIST:return i("checkout-page:giftCodeErrorDescription");case h.COUPON_CODE_NOT_EXIST_FOR_GUESS:return i("checkout-page:mustBeSignInToApplyCampaign");default:return""}}),[c]);return o.createElement("div",{className:V.CouponContainer},n&&o.createElement("div",{className:V.NotificationContainer},o.createElement(M,{type:"warning",title:i("checkout-page:giftCodeErrorTitle"),content:m,onClose:function(){a(!1),l(null)},ignoreScroll:!0})),o.createElement("div",{style:{marginTop:n?12:0}},o.createElement(g,{vm:t,isOpenCouponCode:!0,isAddingCoupon:!0,setAddingCoupon:function(){},setCouponError:a,setCouponErrorCode:l})))})),K=i((function(e){var t=e.vm,i=d().t,r=o.useMemo((function(){switch(t.step){case c.INFO:return o.createElement(u,{vm:t});case c.SHIPPING:return o.createElement(p,{vm:t});case c.PAYMENT:return o.createElement(v,{vm:t});case c.SUCCESS:return o.createElement(k,{vm:t})}}),[t,t.step]),n=[new P(i("checkout-page:address"),t.step===c.INFO,t.step!==c.INFO,t.step!==c.INFO?o.createElement("div",{className:V.AdressStepInfo},o.createElement(z,{vm:t}),o.createElement("div",{className:V.EditBtn,onClick:t.onBackToInfoClick},i("checkout-page:actions.edit"))):void 0,t.step!==c.INFO?o.createElement("div",{className:V.AddressStepInfoMobile},o.createElement(z,{vm:t})):void 0),new P(i("checkout-page:payment"),t.step===c.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||n.splice(1,0,new P(i("checkout-page:shipping"),t.step===c.SHIPPING,t.step===c.PAYMENT,t.step===c.PAYMENT?o.createElement("div",{className:V.AdressStepInfo},o.createElement(G,{vm:t}),(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:V.EditBtn,onClick:t.onBackToShippingClick},i("checkout-page:actions.edit"))):void 0,t.step===c.PAYMENT?o.createElement("div",{className:V.AddressStepInfoMobile},o.createElement(G,{vm:t})):void 0)),o.createElement(F,{steps:n,stepContent:r})})),z=i((function(e){var t,i,r,n,a,s,c,l,m,u=e.vm,p=d().t,v=u.isDigitalOnly?((null===(t=u.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(i=u.checkout.billingAddress)||void 0===i?void 0:i.lastName)||""):((null===(r=u.checkout.shippingAddress)||void 0===r?void 0:r.firstName)||"")+" "+((null===(n=u.checkout.shippingAddress)||void 0===n?void 0:n.lastName)||"");return o.createElement("div",{className:V.Address},o.createElement("div",{className:[V.Text,V.WithMBottom].join(" ")},(null===(a=u.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===u.deliveryMethod?o.createElement("div",{className:V.Text},v):o.createElement(o.Fragment,null,o.createElement("div",{className:V.Text},p("checkout-page:receiver")),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},v)),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},u.isDigitalOnly?null===(s=u.checkout.billingAddress)||void 0===s?void 0:s.phone:null===(c=u.checkout.shippingAddress)||void 0===c?void 0:c.phone),"in-store"===u.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[V.Text,V.WithMTop].join(" ")},p("checkout-page:pickUpLocation"))),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},u.isDigitalOnly?null===(l=u.checkout.billingAddress)||void 0===l?void 0:l.addressText:null===(m=u.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),G=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:V.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:V.LightText}," / "+(0===t.checkout.shippingLines[0].price?i("checkout-page:free"):m(t.checkout.shippingLines[0].price,t.checkout.currencyCode,t.checkout.currencySymbol)))):i("checkout-page:standartShipping"))})),Y=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:V.Footer},o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},i("checkout-page:returnPolicy")),o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},i("checkout-page:privacyPolicy")),o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},i("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:imprint"),t.policyModalText=t.imprint}},i("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},i("checkout-page:shippingPolicy"))))})),X=i((function(i){var r,n,a,s=i.vm,c=i.setVisible,l=d().t,m=o.useState(!1),u=m[0],p=m[1],v=o.useState(!1),h=v[0],g=v[1],y=o.useState(new f({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];y.email=(null===(r=s.checkout.customer)||void 0===r?void 0:r.email)||"",y.firstName=(null===(n=s.checkout.customer)||void 0===n?void 0:n.firstName)||"",y.lastName=(null===(a=s.checkout.customer)||void 0===a?void 0:a.lastName)||"";var E=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return h?[2,c(!1)]:(p(!0),[4,y.saveContactForm()]);case 1:return e.sent()&&g(!0),p(!1),[2]}}))}))}),[u]);return o.createElement(x,{title:l("checkout-page:contactForm"),modalContent:o.createElement("div",null,h&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(M,{type:"success",title:l("checkout-page:contactFormSent"),content:l("checkout-page:contactFormDescription")})),o.createElement(w,{type:A.TEXT_AREA,label:"",value:y.message||"",onChange:y.onMessageChange,textAreaPlaceholder:l("checkout-page:contactFormCta")}),o.createElement(O,{style:{width:"100%",marginTop:"24px"},text:l(h?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:u,isDisabled:!y.message,onClick:E})),onClose:function(){return c(!1)}})}));export{_ as default};
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{useRouter as r}from"next/router.js";import a from"next/link.js";import n from"react-tooltip";import s,{CheckoutStep as c}from"./model.js";import{IkasStorefrontConfig as l}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import u from"./steps/step-info/index.js";import{CheckoutStepShipping as p}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as v}from"./steps/step-payment/index.js";import{CouponErrorCode as h,Coupon as g,CartSummary as y}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as E}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/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/ikas-address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as f}from"../../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{StepSuccess as k}from"./steps/step-success/index.js";import{Modal as x}from"./components/modal/index.js";import j from"./components/master-pass/modal-otp/index.js";import C from"./components/master-pass/modal-response/index.js";import b from"./components/master-pass/modal-success/index.js";import{Image as N}from"../image/index.js";import P,{Step as F}from"./components/step-container/index.js";import{StockError as T}from"./components/error/stock-error/index.js";import{FullscreenLoading as S}from"./components/fullscreen-loading/index.js";import M from"./components/notification-box/index.js";import{FormItem as w}from"./components/form-item/index.js";import{FormItemType as A}from"./components/form-item/model.js";import{Button as O}from"./components/button/index.js";import{IkasPageHead as I}from"../page/head.js";import B from"./components/offer-product/index.js";import L from"./components/svg/ikas.js";import V from"./style.module.scss.js";import{Analytics as U}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import R from"./components/epaykolay-button/index.js";var _=i((function(i){var a,m,u,p=i.checkout,v=i.checkoutSettings,h=i.customizationProps,g=i.returnPolicy,f=i.privacyPolicy,N=i.termsOfService,P=i.imprint,F=i.shippingPolicy,M=d().t,w=r(),A=o.useState((function(){return new s(p,v,w,g,f,N,P,F,M,h||{})}))[0],O=o.useMemo((function(){return Date.now()}),[]);A.step===c.PAYMENT&&U.disableHTML();var _=function(o,i,r,a,n){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/get-basket"),[4,fetch(e,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":l.getApiKey()},body:JSON.stringify({cartId:A.checkout.id,customerNumber:o,sessionsState:O,addressDto:r,paymentType:a,totalPrice:n})})];case 1:return[2,t.sent().json()]}}))}))};o.useEffect((function(){A.checkoutSettings.isAccountRequired&&!A.checkout.hasCustomer&&w.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),U.beginCheckout(A.checkout),U.pageView(E.CHECKOUT)}),[]),o.useEffect((function(){A.customizationProps=h,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED")}(h)}),[h]),o.useEffect((function(){if(A.isEPayKolayEnabled)var o=setInterval((function(){var i,r;window.setContainerService&&A.isCheckoutLoaded&&(window.setContainerService(null===(i=l.getMerchantSettings())||void 0===i?void 0:i.merchantId,_,(function(o){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,K(o)];case 1:return[2,e.sent()]}}))}))}),(function(){console.log("Switching to epaykolay"),A.isEPayKolayPayment=!0}),"https://cdn-epeykolay.mncdn.com/".concat((null===(r=l.getApiUrl())||void 0===r?void 0:r.includes("myikas.com"))?"epay":"epay-uat","/")),clearInterval(o))}),100)}),[]);var K=o.useCallback((function(o){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,fetch("".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/complete-payment"),{method:"POST",body:JSON.stringify({data:o,cartId:A.checkout.id}),headers:{"Content-Type":"application/json","x-api-key":l.getApiKey()}})];case 1:return[4,t.sent().json()];case 2:return e=t.sent(),[2,{redirectUrl:"".concat(window.location.pathname,"?id=").concat(A.checkout.id,"&step=").concat(e.success?"success":"info"),orderId:e.orderNumber||null}]}}))}))}),[]);if(!A.isCheckoutLoaded||!A.store.customerStore.initialized)return o.createElement(S,null);if(A.checkout.hasCustomer&&(null===(a=A.store.customerStore.customer)||void 0===a?void 0:a.id)!==(null===(m=A.checkout.customer)||void 0===m?void 0:m.id))return w.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),null;return o.createElement(o.Fragment,null,o.createElement(I,{pageType:E.CHECKOUT,pageTitle:((null===(u=A.merchantSettings)||void 0===u?void 0:u.merchantName)||"")+" - "+M("checkout-page:securePayment"),pageDescription:M("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:V.CheckoutPage},o.createElement(n,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:V.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:[V.Left,A.isEPayKolayPayment?V.epaykolay:""].join(" ")},A.isEPayKolayEnabled&&o.createElement("div",{id:"plateau_ui_placeholder",style:{width:"100%"}}),!A.isEPayKolayPayment&&o.createElement("div",{className:V.LeftContent},o.createElement("div",null,o.createElement(D,{vm:A}),A.hasStockError&&o.createElement("div",{className:V.ErrorContainer},o.createElement(T,{vm:A,error:A.error})),!A.hasStockError&&o.createElement(o.Fragment,null,o.createElement(y,{vm:A,allowExpand:!0}),o.createElement("div",null,A.step!==c.SUCCESS&&A.isEPayKolayEnabled&&o.createElement(R,{onClick:function(){window.frictionless()}})),A.step===c.SUCCESS?o.createElement(k,{vm:A}):o.createElement(o.Fragment,null,A.checkoutCampaignOffer&&o.createElement(B,{vm:A,campaignOffer:A.checkoutCampaignOffer}),A.isCouponCodeRequirementOpen&&o.createElement(z,{vm:A}),o.createElement(H,{vm:A}))),o.createElement("div",{className:V.Space})),o.createElement(Y,{vm:A}))),o.createElement("div",{className:V.Right},o.createElement("div",{className:V.RightContent},o.createElement(y,{vm:A}),!A.isPoweredByHidden&&o.createElement("div",{className:V.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===l.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(L,null))))),!!A.policyModalText&&o.createElement(x,{title:A.policyModalTitle,modalContent:A.policyModalText,onClose:function(){A.policyModalText=""}}),A.isContactModalVisible&&o.createElement(X,{vm:A,setVisible:A.setContactModalVisible}),A.mpVM.isOtpModalVisible&&o.createElement(j,{vm:A,visible:A.mpVM.isOtpModalVisible,type:A.mpVM.otpModalType,onClose:A.mpVM.hideOtpModal}),A.mpVM.isResponseModalVisible&&o.createElement(C,{visible:A.mpVM.isResponseModalVisible,text:A.mpVM.mfsResponseModalText,onClose:A.mpVM.onResponseModalClose}),A.mpVM.isSuccessModalVisible&&o.createElement(b,{visible:A.mpVM.isSuccessModalVisible,type:A.mpVM.successModalType,onClose:A.mpVM.onSuccessModalClose})))})),D=i((function(e){var t,i,r,n,s=e.vm,c=d().t;return o.createElement("div",{className:V.Header},o.createElement(a,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=s.customizationProps)||void 0===t?void 0:t.logo)?o.createElement("div",{className:V.Logo},o.createElement(N,{layout:"fill",image:s.customizationProps.logo,sizes:"360px"})):(null===(i=s.merchantSettings)||void 0===i?void 0:i.logo)?o.createElement("div",{className:V.Logo},o.createElement(N,{layout:"fill",image:s.merchantSettings.logo,sizes:"360px"})):(null===(r=s.merchantSettings)||void 0===r?void 0:r.merchantName)||"")),!s.checkout.hasCustomer&&o.createElement("div",{className:V.LoginText},o.createElement("span",{className:V.LoginCta},c("checkout-page:alreadyHaveAnAccount")),o.createElement(a,{href:"/account/login?redirect="+encodeURIComponent(s.checkoutUrl),passHref:!0},o.createElement("a",{className:V.LoginBtn},c("checkout-page:actions.login")))),s.checkout.hasCustomer&&o.createElement("div",{className:V.CustomerInfo},o.createElement("div",{className:V.Name},s.checkout.customerFullName),o.createElement("div",{className:V.Email},null===(n=s.checkout.customer)||void 0===n?void 0:n.email)))})),z=i((function(e){var t=e.vm,i=d().t,r=o.useState(!1),a=r[0],n=r[1],s=o.useState(null),c=s[0],l=s[1],m=o.useMemo((function(){switch(c){case h.COUPON_CODE_NOT_EXIST:return i("checkout-page:giftCodeErrorDescription");case h.COUPON_CODE_NOT_EXIST_FOR_GUESS:return i("checkout-page:mustBeSignInToApplyCampaign");default:return""}}),[c]);return o.createElement("div",{className:V.CouponContainer},a&&o.createElement("div",{className:V.NotificationContainer},o.createElement(M,{type:"warning",title:i("checkout-page:giftCodeErrorTitle"),content:m,onClose:function(){n(!1),l(null)},ignoreScroll:!0})),o.createElement("div",{style:{marginTop:a?12:0}},o.createElement(g,{vm:t,isOpenCouponCode:!0,isAddingCoupon:!0,setAddingCoupon:function(){},setCouponError:n,setCouponErrorCode:l})))})),H=i((function(e){var t=e.vm,i=d().t,r=o.useMemo((function(){switch(t.step){case c.INFO:return o.createElement(u,{vm:t});case c.SHIPPING:return o.createElement(p,{vm:t});case c.PAYMENT:return o.createElement(v,{vm:t});case c.SUCCESS:return o.createElement(k,{vm:t})}}),[t,t.step]),a=[new F(i("checkout-page:address"),t.step===c.INFO,t.step!==c.INFO,t.step!==c.INFO?o.createElement("div",{className:V.AdressStepInfo},o.createElement(K,{vm:t}),o.createElement("div",{className:V.EditBtn,onClick:t.onBackToInfoClick},i("checkout-page:actions.edit"))):void 0,t.step!==c.INFO?o.createElement("div",{className:V.AddressStepInfoMobile},o.createElement(K,{vm:t})):void 0),new F(i("checkout-page:payment"),t.step===c.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||a.splice(1,0,new F(i("checkout-page:shipping"),t.step===c.SHIPPING,t.step===c.PAYMENT,t.step===c.PAYMENT?o.createElement("div",{className:V.AdressStepInfo},o.createElement(G,{vm:t}),(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:V.EditBtn,onClick:t.onBackToShippingClick},i("checkout-page:actions.edit"))):void 0,t.step===c.PAYMENT?o.createElement("div",{className:V.AddressStepInfoMobile},o.createElement(G,{vm:t})):void 0)),o.createElement(P,{steps:a,stepContent:r})})),K=i((function(e){var t,i,r,a,n,s,c,l,m,u=e.vm,p=d().t,v=u.isDigitalOnly?((null===(t=u.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(i=u.checkout.billingAddress)||void 0===i?void 0:i.lastName)||""):((null===(r=u.checkout.shippingAddress)||void 0===r?void 0:r.firstName)||"")+" "+((null===(a=u.checkout.shippingAddress)||void 0===a?void 0:a.lastName)||"");return o.createElement("div",{className:V.Address},o.createElement("div",{className:[V.Text,V.WithMBottom].join(" ")},(null===(n=u.checkout.customer)||void 0===n?void 0:n.email)||""),"address"===u.deliveryMethod?o.createElement("div",{className:V.Text},v):o.createElement(o.Fragment,null,o.createElement("div",{className:V.Text},p("checkout-page:receiver")),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},v)),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},u.isDigitalOnly?null===(s=u.checkout.billingAddress)||void 0===s?void 0:s.phone:null===(c=u.checkout.shippingAddress)||void 0===c?void 0:c.phone),"in-store"===u.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[V.Text,V.WithMTop].join(" ")},p("checkout-page:pickUpLocation"))),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},u.isDigitalOnly?null===(l=u.checkout.billingAddress)||void 0===l?void 0:l.addressText:null===(m=u.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),G=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:V.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:V.LightText}," / "+(0===t.checkout.shippingLines[0].price?i("checkout-page:free"):m(t.checkout.shippingLines[0].price,t.checkout.currencyCode,t.checkout.currencySymbol)))):i("checkout-page:standartShipping"))})),Y=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:V.Footer},o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},i("checkout-page:returnPolicy")),o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},i("checkout-page:privacyPolicy")),o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},i("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:imprint"),t.policyModalText=t.imprint}},i("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},i("checkout-page:shippingPolicy"))))})),X=i((function(i){var r,a,n,s=i.vm,c=i.setVisible,l=d().t,m=o.useState(!1),u=m[0],p=m[1],v=o.useState(!1),h=v[0],g=v[1],y=o.useState(new f({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];y.email=(null===(r=s.checkout.customer)||void 0===r?void 0:r.email)||"",y.firstName=(null===(a=s.checkout.customer)||void 0===a?void 0:a.firstName)||"",y.lastName=(null===(n=s.checkout.customer)||void 0===n?void 0:n.lastName)||"";var E=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return h?[2,c(!1)]:(p(!0),[4,y.saveContactForm()]);case 1:return e.sent()&&g(!0),p(!1),[2]}}))}))}),[u]);return o.createElement(x,{title:l("checkout-page:contactForm"),modalContent:o.createElement("div",null,h&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(M,{type:"success",title:l("checkout-page:contactFormSent"),content:l("checkout-page:contactFormDescription")})),o.createElement(w,{type:A.TEXT_AREA,label:"",value:y.message||"",onChange:y.onMessageChange,textAreaPlaceholder:l("checkout-page:contactFormCta")}),o.createElement(O,{style:{width:"100%",marginTop:"24px"},text:l(h?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:u,isDisabled:!y.message,onClick:E})),onClose:function(){return c(!1)}})}));export{_ as default};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IkasFilterCategory as IFilterCategory } from "@ikas/storefront-models";
|
|
2
2
|
import { IkasHTMLMetaData } from "../html-meta-data";
|
|
3
|
+
import { IkasImage } from "../image";
|
|
3
4
|
export declare class IkasFilterCategory implements IFilterCategory {
|
|
4
5
|
id: string;
|
|
5
6
|
name: string;
|
|
@@ -7,6 +8,8 @@ export declare class IkasFilterCategory implements IFilterCategory {
|
|
|
7
8
|
isAutomated: boolean | null;
|
|
8
9
|
resultCount: number | null;
|
|
9
10
|
isSelected: boolean;
|
|
11
|
+
imageId: string | null;
|
|
12
|
+
image?: IkasImage | null;
|
|
10
13
|
constructor(data: IFilterCategory);
|
|
11
14
|
get slug(): string | undefined;
|
|
12
15
|
get href(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IkasFilterCategoryFunctions as t}from"@ikas/storefront-model-functions";import{makeAutoObservable as e}from"mobx";import{IkasHTMLMetaData as
|
|
1
|
+
import{IkasFilterCategoryFunctions as t}from"@ikas/storefront-model-functions";import{makeAutoObservable as e}from"mobx";import{IkasHTMLMetaData as i}from"../html-meta-data/index.js";import{IkasImage as r}from"../image/index.js";var a=function(){function a(t){this.id=t.id,this.name=t.name,this.metaData=t.metaData?new i(t.metaData):null,this.isAutomated=t.isAutomated,this.resultCount=t.resultCount,this.isSelected=t.isSelected,this.imageId=t.imageId,this.image=t.imageId?new r({id:t.imageId,isVideo:!1}):null,e(this)}return Object.defineProperty(a.prototype,"slug",{get:function(){var t;return null===(t=this.metaData)||void 0===t?void 0:t.slug},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"href",{get:function(){return t.getIkasFilterCategoryHref(this)},enumerable:!1,configurable:!0}),a}();export{a as IkasFilterCategory};
|
|
@@ -25,6 +25,7 @@ export declare class IkasOrderLineVariant implements IOrderLineVariant {
|
|
|
25
25
|
type: number | null;
|
|
26
26
|
unit: IkasOrderLineVariantUnit | null;
|
|
27
27
|
weight: number | null;
|
|
28
|
+
hsCode: string | null;
|
|
28
29
|
variantValues: IkasOrderLineVariantVariantValue[] | null;
|
|
29
30
|
mainImage?: IkasImage | null;
|
|
30
31
|
constructor(data: IOrderLineVariant);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IkasOrderLineItemVariantFunctions as i}from"@ikas/storefront-model-functions";import{IkasImage as n}from"../../../image/index.js";import{IkasOrderLineVariantVariantValue as t}from"./value/index.js";import{IkasOrderLineVariantBrand as l}from"./brand/index.js";import{IkasOrderLineVariantCategory as e}from"./category/index.js";import{IkasOrderLineVariantPrice as s}from"./price/index.js";import{IkasOrderLineVariantTag as u}from"./tag/index.js";import{makeAutoObservable as r}from"mobx";import{IkasOrderLineVariantUnit as a}from"./unit/index.js";import{IkasOrderLineBaseUnit as o}from"../base-unit/index.js";var d=function(){function d(i){var d,m,
|
|
1
|
+
import{IkasOrderLineItemVariantFunctions as i}from"@ikas/storefront-model-functions";import{IkasImage as n}from"../../../image/index.js";import{IkasOrderLineVariantVariantValue as t}from"./value/index.js";import{IkasOrderLineVariantBrand as l}from"./brand/index.js";import{IkasOrderLineVariantCategory as e}from"./category/index.js";import{IkasOrderLineVariantPrice as s}from"./price/index.js";import{IkasOrderLineVariantTag as u}from"./tag/index.js";import{makeAutoObservable as r}from"mobx";import{IkasOrderLineVariantUnit as a}from"./unit/index.js";import{IkasOrderLineBaseUnit as o}from"../base-unit/index.js";var d=function(){function d(i){var d,h,m,p;this.barcodeList=null,this.brand=null,this.categories=null,this.id=null,this.mainImageId=null,this.prices=null,this.productId=null,this.sku=null,this.slug=null,this.tagIds=null,this.taxValue=null,this.type=null,this.weight=null,this.hsCode=null,this.variantValues=null,this.mainImage=null,this.barcodeList=i.barcodeList||null,this.baseUnit=i.baseUnit?new o(i.baseUnit):null,this.brand=i.brand?new l(i.brand):null,this.categories=(null===(d=i.categories)||void 0===d?void 0:d.map((function(i){return new e(i)})))||null,this.id=i.id||null,this.mainImageId=i.mainImageId||null,this.name=i.name,this.prices=(null===(h=i.prices)||void 0===h?void 0:h.map((function(i){return new s(i)})))||null,this.productId=i.productId||null,this.sku=i.sku||null,this.slug=i.slug||null,this.tagIds=i.tagIds||null,this.tags=(null===(m=i.tags)||void 0===m?void 0:m.map((function(i){return new u(i)})))||null,this.taxValue=i.taxValue||null,this.type=i.type||null,this.unit=i.unit?new a(i.unit):null,this.weight=i.weight||null,this.hsCode=i.hsCode||null,this.variantValues=(null===(p=i.variantValues)||void 0===p?void 0:p.map((function(i){return new t(i)})))||null,this.mainImage=i.mainImageId?new n({id:i.mainImageId,isVideo:!1}):null,r(this)}return Object.defineProperty(d.prototype,"href",{get:function(){return i.getIkasOrderLineVariantHref(this)},enumerable:!1,configurable:!0}),d}();export{d as IkasOrderLineVariant};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeAutoObservable as e}from"mobx";import{IkasThemeJsonComponent as o}from"./component/index.js";import{IkasThemeJsonComponentProp as
|
|
1
|
+
import{makeAutoObservable as e}from"mobx";import{IkasThemeJsonComponent as o}from"./component/index.js";import{IkasThemeJsonComponentProp as n}from"./component/prop/index.js";import{IkasThemeJsonCustomData as t}from"./custom-data/index.js";import{IkasThemeJsonPage as r}from"./page/index.js";import{IkasThemeJsonPageComponent as i}from"./page/component/index.js";import{IkasThemeJsonSettings as s}from"./settings/index.js";import{IkasThemeJsonComponentPropType as a,IkasThemeJsonPageType as p}from"@ikas/storefront-models";var u="checkout",m=function(){function u(n){var i;void 0===n&&(n={}),this.name=n.name||"",this.components=n.components?n.components.map((function(e){return new o(e)})):[],this.pages=n.pages?n.pages.map((function(e){return new r(e)})):[],this.settings=n.settings?new s(n.settings):new s,this.customData=n.customData?null===(i=n.customData)||void 0===i?void 0:i.map((function(e){return new t(e)})):[],this.createCheckoutData(),e(this)}return Object.defineProperty(u.prototype,"headerComponent",{get:function(){return this.components.find((function(e){return e.isHeader}))},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"footerComponent",{get:function(){return this.components.find((function(e){return e.isFooter}))},enumerable:!1,configurable:!0}),u.prototype.createCheckoutData=function(){var e=this.components.find((function(e){return"checkout"===e.id})),t=this.pages.find((function(e){return"checkout"===e.id}));e||(e=new o({id:"checkout",dir:"",displayName:"",props:[new n({name:"logo",isRequired:!1,type:a.IMAGE}),new n({name:"showTax",isRequired:!1,type:a.BOOLEAN}),new n({name:"buttonBgColor",isRequired:!1,type:a.COLOR}),new n({name:"buttonTextColor",isRequired:!1,type:a.COLOR}),new n({name:"buttonDisabledBgColor",isRequired:!1,type:a.COLOR}),new n({name:"buttonDisabledTextColor",isRequired:!1,type:a.COLOR}),new n({name:"primaryTextColor",isRequired:!1,type:a.COLOR}),new n({name:"secondaryTextColor",isRequired:!1,type:a.COLOR}),new n({name:"primaryBgColor",isRequired:!1,type:a.COLOR}),new n({name:"secondaryBgColor",isRequired:!1,type:a.COLOR}),new n({name:"borderColor",isRequired:!1,type:a.COLOR}),new n({name:"cardBgColor",isRequired:!1,type:a.COLOR}),new n({name:"errorColor",isRequired:!1,type:a.COLOR}),new n({name:"errorLightColor",isRequired:!1,type:a.COLOR}),new n({name:"warningColor",isRequired:!1,type:a.COLOR}),new n({name:"warningLightColor",isRequired:!1,type:a.COLOR}),new n({name:"successColor",isRequired:!1,type:a.COLOR}),new n({name:"successLightColor",isRequired:!1,type:a.COLOR})]}),this.components.push(e)),t||this.pages.push(new r({id:"checkout",type:p.CHECKOUT,components:[new i({componentId:e.id,propValues:{logo:null,showTax:!0,buttonBgColor:c,buttonTextColor:d,buttonDisabledBgColor:C,buttonDisabledTextColor:l,primaryTextColor:g,secondaryTextColor:O,primaryBgColor:F,secondaryBgColor:R,borderColor:y,cardBgColor:w,errorColor:h,errorLightColor:f,warningColor:L,warningLightColor:b,successColor:q,successLightColor:x}})]}))},u}(),c="#272727",d="#FFFFFF",C="#F7F7F9",l="#8A8B94",g="#272727",O="#8A8B94",F="#FFFFFF",R="#F7F7F9",y="#E5E4E9",w="#F7F7F9",h="#FB4E4E",f="#FCF3F4",L="#FFBC1F",b="#FFFAEE",q="#2DCA73",x="#F6FFED";export{u as CHECKOUT_ID,m as IkasThemeJson};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.10.0-beta.10",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"build": "rm -rf build && rollup -c"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@ikas/storefront-api": "^4.
|
|
21
|
-
"@ikas/storefront-config": "^4.
|
|
22
|
-
"@ikas/storefront-model-functions": "^4.
|
|
23
|
-
"@ikas/storefront-models": "^4.
|
|
24
|
-
"@ikas/storefront-providers": "^4.
|
|
20
|
+
"@ikas/storefront-api": "^4.10.0-beta.10",
|
|
21
|
+
"@ikas/storefront-config": "^4.10.0-beta.10",
|
|
22
|
+
"@ikas/storefront-model-functions": "^4.10.0-beta.10",
|
|
23
|
+
"@ikas/storefront-models": "^4.10.0-beta.10",
|
|
24
|
+
"@ikas/storefront-providers": "^4.10.0-beta.10",
|
|
25
25
|
"@ikas/localized-address": "^1.0.0-beta.3",
|
|
26
26
|
"@adyen/adyen-web": "^5.28.2",
|
|
27
27
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@ikas/localized-address": "^1.0.0-beta.3",
|
|
58
|
-
"@ikas/storefront-api": "^4.
|
|
59
|
-
"@ikas/storefront-config": "^4.
|
|
60
|
-
"@ikas/storefront-model-functions": "^4.
|
|
61
|
-
"@ikas/storefront-models": "^4.
|
|
62
|
-
"@ikas/storefront-providers": "^4.
|
|
58
|
+
"@ikas/storefront-api": "^4.10.0-beta.10",
|
|
59
|
+
"@ikas/storefront-config": "^4.10.0-beta.10",
|
|
60
|
+
"@ikas/storefront-model-functions": "^4.10.0-beta.10",
|
|
61
|
+
"@ikas/storefront-models": "^4.10.0-beta.10",
|
|
62
|
+
"@ikas/storefront-providers": "^4.10.0-beta.10",
|
|
63
63
|
"mobx": "^6.1.3",
|
|
64
64
|
"mobx-react-lite": "^3.1.5",
|
|
65
65
|
"next": "12.2.0",
|