@ikas/storefront 6.1.0-beta.196 → 6.1.0-beta.198
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/components/page/index.js +1 -1
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/button-element-renderer/index.js +1 -1
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-column-element-renderer/index.js +1 -1
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-element-renderer/index.js +1 -1
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/index.js +1 -1
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/product-list-renderer/index.js +1 -1
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/social-element-renderer/index.js +1 -1
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/helpers/index.js +1 -1
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js +1 -1
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js +1 -1
- package/package.json +13 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__spreadArray as e,__awaiter as o,__generator as r}from'./../../ext/tslib/tslib.es6.js';import*as i from"react";import{observer as n}from"mobx-react-lite";import{useRouter as a}from"next/router.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 s}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/customer-form-data-input/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{IkasMerchantSettings as d}from"../../models/data/merchant-settings/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/order-transaction-with-prices/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/campaign-offer/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/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import{IkasThemeJsonCustomData as u}from"../../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{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{Analytics as l}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasPageHead as m}from"./head.js";import{ThemeComponent as p}from"./ThemeComponent.js";import{IkasBaseStore as f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{initIkasEvents as v}from"../../analytics/events.js";import{IkasPageDataInit as g}from"../../page-data-init/index.js";import{setAPIClientConfig as j,listStorefrontPopup as h,SortByDirectionEnum as x}from"@ikas/storefront-api";import w from"../../store/product/index.js";var y=function(t){return o(void 0,void 0,void 0,(function(){var e,i,n,a,s,d,u,l,m,p,v,g,j,h;return r(this,(function(x){switch(x.label){case 0:return e={popups:t},[4,function(){return new Promise((function(t){var e=setInterval((function(){var o=c.getSessionId();o&&(clearInterval(e),t(o))}),100)}))}()];case 1:return x.sent(),(i=c.getSessionId())&&(e.sessionId=i),(n=c.getCdnUrl())&&(e.cdnUrl=n),(a=null===(g=c.getMerchantSettings())||void 0===g?void 0:g.merchantId)&&(e.merchantId=a),S=c.getDomain(),(s=S?S.startsWith("http")?S:"https://".concat(S):"undefined"!=typeof window?window.location.origin:void 0)&&(e.storeUrl=s),(d=c.getCustomerToken())&&(e.customerToken=d),(u=c.getCurrentLocale())&&(e.locale=u),(l=null===(h=null===(j=c.getCurrentRouting())||void 0===j?void 0:j.countryCodes)||void 0===h?void 0:h[0])&&(e.countryCode=l),(m=c.getPriceListId())&&(e.priceListId=m),(p=c.getSalesChannelId())&&(e.salesChannelId=p),y=f.getInstance().customerStore.customer,(v=y?{email:y.email,firstName:y.firstName,lastName:y.lastName,birthDate:y.birthDate,phone:y.phone}:null)&&(e.customer=v),e.services=function(){var t=this,e=f.getInstance();return{searchProducts:function(e){return o(t,void 0,void 0,(function(){var t,o,i;return r(this,(function(r){switch(r.label){case 0:return[4,w.searchProducts(C(e))];case 1:return(null==(t=r.sent())?void 0:t.isSuccess)&&(null===(i=null===(o=t.data)||void 0===o?void 0:o.data)||void 0===i?void 0:i.length)?[2,t.data.data]:[2,[]]}}))}))},addItemToCart:function(i){var n=i.product,a=i.variant,s=i.quantity;return o(t,void 0,void 0,(function(){var t;return r(this,(function(o){switch(o.label){case 0:return[4,e.cartStore.addItem(a,n,null!=s?s:1)];case 1:return[2,{success:!!(null==(t=o.sent())?void 0:t.success)}]}}))}))},saveCustomerFormData:function(i){return o(t,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,e.customerStore.saveCustomerFormData({email:i.email,firstName:i.firstName,lastName:i.lastName,birthDate:i.birthDate||"",phone:i.phone||"",storefrontPopupId:i.popupId,subscriptions:i.subscriptions})];case 1:return t.sent(),[2]}}))}))},getLastViewedProducts:function(){return o(t,void 0,void 0,(function(){var t;return r(this,(function(o){return"function"==typeof(t=e.customerStore).getLastViewedProducts?[2,t.getLastViewedProducts()]:[2,[]]}))}))},formatVariantSellPrice:function(t){return t.formattedSellPrice||""},formatVariantDiscountPrice:function(t){return t.formattedDiscountPrice||null},hasVariantDiscount:function(t){return!!t.hasDiscount},getVariantDiscountPercentage:function(t){var e=t.discountPercentage;return null==e?null:"number"==typeof e?e.toString():e},redirectToProduct:function(t){return!!t.url&&(window.location.href=t.url,!0)}}}(),[2,e]}var y,S}))}))},S=n((function(n){var p=n.propValues,x=n.themeJsonComponents,w=n.customDataList,S=n.pageType,C=n.pageTitle,P=n.pageDescription,I=n.pageSpecificData,k=n.canonicals,D=n.disableIndex,L=n.settings,E=n.configJson,T=n.reInitOnBrowser,V=n.addOgpMetas,F=n.components,R=n.productReviewSummary,A=a(),M=i.useState(),N=M[0],O=M[1];c.init(t(t({},E),{currentPageComponents:F,loginRequiredCallback:function(){A.push("/account/login")}})),f.getInstance().router=A,j();var U=f.getInstance();U.router=A,U.currentPageType=S;var W=i.useState(!1),B=W[0],z=W[1],q=i.useMemo((function(){return(null==N?void 0:N.id)===(null==I?void 0:I.id)&&g.pageSpecificData&&g.isBrowser?S===s.PRODUCT&&g._initProductOnBrowser(g.pageSpecificData):g.setPageSpecificData(I,S,B),g.initPagePropValues(p,x,w.map((function(t){return new u(t)})),L,B)}),e(e([],S!==s.SEARCH?[B]:[],!0),[p,S,L,I,x],!1));i.useEffect((function(){T&&z("undefined"!=typeof window),window.addToCart=U.cartStore._windowAddToCart,U.cartStore.getCart(),U.checkLocalization(),v()}),[]),i.useEffect((function(){I?(null==N?void 0:N.id)!==I.id&&O(I):O(null)}),[I]),i.useEffect((function(){var t=function(){U.customerStore.routeChangeInit()};return A.events.on("routeChangeStart",t),function(){A.events.off("routeChangeStart",t)}}),[]),i.useEffect((function(){!function(t,e){var i,n;o(this,void 0,void 0,(function(){var o,a,d,u,c,m;return r(this,(function(r){switch(r.label){case 0:return o=f.getInstance(),[4,l.pageView(t)];case 1:r.sent(),r.label=2;case 2:return r.trys.push([2,7,,8]),t!==s.PRODUCT?[3,4]:(a=e,[4,l.productView(a)]);case 3:r.sent(),o.customerStore.onProductView(a.id,a.selectedVariant.id),r.label=4;case 4:return t===s.CATEGORY&&(u=null===(i=(d=e).categoryPathItems)||void 0===i?void 0:i.map((function(t){return t.name})).join(" > "),u=d.categoryPathItems&&(null===(n=d.categoryPathItems)||void 0===n?void 0:n.length)>0?u+" > "+d.name:d.name,l.viewCategory(u,d)),t===s.BRAND&&(c=e,l.viewBrand(c)),t!==s.CART?[3,6]:[4,o.cartStore.waitUntilInitialized()];case 5:r.sent(),l.viewCart(o.cartStore.cart),r.label=6;case 6:return[3,8];case 7:return m=r.sent(),console.error(m),[3,8];case 8:return[2]}}))}))}(S,g.pageSpecificData)}),[S,I]),i.useEffect((function(){if("undefined"!=typeof window&&"undefined"!=typeof document){var e,i=!1,n=function(t,e){if(function(t){t.setAttribute("data-ikas-popup-widget","true"),!t.dataset.ikasPopupWidgetUrl&&t.src&&(t.dataset.ikasPopupWidgetUrl=t.src)}(t),"true"===t.dataset.ikasPopupWidgetLoaded)return e(),function(){};var o=function(){t.dataset.ikasPopupWidgetLoaded="true",e()},r=function(e){console.error("[@ikas/storefront] Failed to load popup widget script",t.src,e)};return t.addEventListener("load",o,{once:!0}),t.addEventListener("error",r,{once:!0}),function(){t.removeEventListener("load",o),t.removeEventListener("error",r)}},a=function(t){var o=window.location.href.includes("http://localhost:3333/")?"http://localhost:9000/popup-script-injector.iife.js":"/sf/assets/popup/popup-script-injector.iife.js";if(o){var r=function(){i||function(t){if("function"==typeof window.startIkasPopupWidget)try{window.startIkasPopupWidget(t)}catch(t){console.error("[@ikas/storefront] Failed to start popup widget",t)}}(t)},a=document.querySelector('script[data-ikas-popup-widget="true"]');if(a)e=n(a,r);else{var s=document.createElement("script");s.src=o,s.defer=!0,e=n(s,r),document.body.appendChild(s)}}},s=function(t){var e=window.location.href.includes("http://localhost:3333/")?"http://localhost:9000/style.css":"/sf/assets/popup/style.css";if(e&&!document.querySelector('link[href="'.concat(e,'"]'))){var o=document.createElement("link");o.rel="stylesheet",o.href=e,o.setAttribute("data-ikas-popup-widget","true");o.addEventListener("load",(function(){}),{once:!0}),o.addEventListener("error",(function(t){console.error("[@ikas/storefront] Failed to load popup widget CSS",e,t)}),{once:!0}),document.head.appendChild(o)}};return o(void 0,void 0,void 0,(function(){var e,n,d;return r(this,(function(u){switch(u.label){case 0:return e=c.getStorefrontPopups()||[],[4,(l=e,o(void 0,void 0,void 0,(function(){var e,o,i,n,a;return r(this,(function(r){switch(r.label){case 0:if(!(e=l.map((function(t){return t.id})).filter(Boolean)).length)return[2,l];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,h({idList:e})];case 2:return(null==(o=r.sent())?void 0:o.isSuccess)&&(null===(a=o.data)||void 0===a?void 0:a.length)?(i=o.data,[2,l.map((function(e){var o=i.find((function(t){return t.id===e.id}));return o?t(t({},o),{isFilteredOnServerSide:e.isFilteredOnServerSide}):e}))]):[3,4];case 3:return n=r.sent(),console.error("[@ikas/storefront] Failed to fetch popup details",n),[3,4];case 4:return[2,l]}}))})))];case 1:return n=u.sent(),i?[2]:[4,y(n)];case 2:return d=u.sent(),window.ikasPopupConfig=d,a(d),s(),[2]}var l}))})),function(){i=!0,null==e||e()}}}),[A.asPath,S,null==I?void 0:I.id]);var H=i.useMemo((function(){var t=q.find((function(t){return t.component.isHeader})),e=q.find((function(t){return t.component.isFooter})),o=q.filter((function(t){return!t.component.isHeader&&!t.component.isFooter}))||[];return i.createElement("div",{style:{position:"relative",minHeight:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between"}},i.createElement("div",null,t&&b(t,L,-1),o.map((function(t,e){return b(t,L,e)}))),e&&b(e,L,-1))}),[q,L]),_=i.useMemo((function(){return c.getMerchantSettings()?new d(c.getMerchantSettings()):null}),[c.getMerchantSettings()]);return i.createElement(i.Fragment,null,i.createElement(m,{pageType:S,pageTitle:C,pageDescription:P,pageSpecificData:g.pageSpecificData,canonicals:k&&k.length>0?k:null,disableIndex:D,merchantSettings:_,addOgpMetas:V,productReviewSummary:R,pageComponentPropValues:q}),H)})),b=function(t,e,o){return i.createElement(p,{key:t.pageComponent.id,index:o,pageComponentPropValue:t,settings:e})};function C(t){var e,o,r,i,n,a=null===(e=t.order)||void 0===e?void 0:e.map((function(t){return{direction:"ASC"===t.direction?x.ASC:x.DESC,type:t.type}}));return{input:{page:null!==(o=t.page)&&void 0!==o?o:1,perPage:null!==(r=t.perPage)&&void 0!==r?r:10,order:a,productIdList:t.productIdList,categoryIdList:t.categoryIdList,priceListId:null!==(i=t.priceListId)&&void 0!==i?i:c.getPriceListId(),salesChannelId:null!==(n=t.salesChannelId)&&void 0!==n?n:c.getSalesChannelId()}}}export{S as IkasPage,b as renderComponent};
|
|
1
|
+
import{__assign as t,__spreadArray as e,__awaiter as o,__generator as r}from'./../../ext/tslib/tslib.es6.js';import*as i from"react";import{observer as n}from"mobx-react-lite";import{useRouter as a}from"next/router.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 s}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/customer-form-data-input/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{IkasMerchantSettings as d}from"../../models/data/merchant-settings/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/order-transaction-with-prices/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/campaign-offer/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/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import{IkasThemeJsonCustomData as u}from"../../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{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{Analytics as l}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasPageHead as m}from"./head.js";import{ThemeComponent as p}from"./ThemeComponent.js";import{IkasBaseStore as f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{initIkasEvents as v}from"../../analytics/events.js";import{IkasPageDataInit as g}from"../../page-data-init/index.js";import{setAPIClientConfig as j,listStorefrontPopup as h,SortByDirectionEnum as x}from"@ikas/storefront-api";import w from"../../store/product/index.js";var y=function(t){return o(void 0,void 0,void 0,(function(){var e,i,n,a,s,d,u,l,m,p,v,g,j,h,x;return r(this,(function(y){switch(y.label){case 0:return e={popups:t,cartUrl:""},[4,function(){return new Promise((function(t){var e=setInterval((function(){var o=c.getSessionId();o&&(clearInterval(e),t(o))}),100)}))}()];case 1:return y.sent(),(i=c.getSessionId())&&(e.sessionId=i),(n=c.getCdnUrl())&&(e.cdnUrl=n),(a=null===(j=c.getMerchantSettings())||void 0===j?void 0:j.merchantId)&&(e.merchantId=a),C=c.getDomain(),P=c.getCurrentRouting(),(s=C?C.startsWith("http")?C:"https://".concat(C):"undefined"!=typeof window?window.location.origin+!!P?"/".concat(null==P?void 0:P.path):"":void 0)&&(e.storeUrl=s),d=function(){var t=c.getCurrentRouting();if(t)return"".concat((null==t?void 0:t.path)?"/".concat(t.path):"","/cart")}(),d&&(e.cartUrl=d),(u=c.getCustomerToken())&&(e.customerToken=u),(l=c.getCurrentLocale())&&(e.locale=l),(m=null===(x=null===(h=c.getCurrentRouting())||void 0===h?void 0:h.countryCodes)||void 0===x?void 0:x[0])&&(e.countryCode=m),(p=c.getPriceListId())&&(e.priceListId=p),(v=c.getSalesChannelId())&&(e.salesChannelId=v),S=f.getInstance().customerStore.customer,(g=S?{email:S.email,firstName:S.firstName,lastName:S.lastName,birthDate:S.birthDate,phone:S.phone}:null)&&(e.customer=g),e.services=function(){var t=this,e=f.getInstance();return{searchProducts:function(e){return o(t,void 0,void 0,(function(){var t,o,i;return r(this,(function(r){switch(r.label){case 0:return[4,w.searchProducts(b(e))];case 1:return(null==(t=r.sent())?void 0:t.isSuccess)&&(null===(i=null===(o=t.data)||void 0===o?void 0:o.data)||void 0===i?void 0:i.length)?[2,t.data.data]:[2,[]]}}))}))},addItemToCart:function(i){var n=i.product,a=i.variant,s=i.quantity;return o(t,void 0,void 0,(function(){var t;return r(this,(function(o){switch(o.label){case 0:return[4,e.cartStore.addItem(a,n,null!=s?s:1)];case 1:return[2,{success:!!(null==(t=o.sent())?void 0:t.success)}]}}))}))},saveCustomerFormData:function(i){return o(t,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,e.customerStore.saveCustomerFormData({email:i.email,firstName:i.firstName,lastName:i.lastName,birthDate:i.birthDate||"",phone:i.phone||"",storefrontPopupId:i.popupId,subscriptions:i.subscriptions})];case 1:return t.sent(),[2]}}))}))},getLastViewedProducts:function(){return o(t,void 0,void 0,(function(){var t;return r(this,(function(o){return"function"==typeof(t=e.customerStore).getLastViewedProducts?[2,t.getLastViewedProducts()]:[2,[]]}))}))},formatVariantSellPrice:function(t){return t.formattedSellPrice||""},formatVariantDiscountPrice:function(t){return t.formattedDiscountPrice||null},hasVariantDiscount:function(t){return!!t.hasDiscount},getVariantDiscountPercentage:function(t){var e=t.discountPercentage;return null==e?null:"number"==typeof e?e.toString():e},redirectToProduct:function(t){return!!t.url&&(window.location.href=t.url,!0)}}}(),[2,e]}var S,C,P}))}))},S=n((function(n){var p=n.propValues,x=n.themeJsonComponents,w=n.customDataList,S=n.pageType,b=n.pageTitle,P=n.pageDescription,I=n.pageSpecificData,k=n.canonicals,D=n.disableIndex,L=n.settings,E=n.configJson,T=n.reInitOnBrowser,V=n.addOgpMetas,R=n.components,F=n.productReviewSummary,U=a(),A=i.useState(),M=A[0],N=A[1];c.init(t(t({},E),{currentPageComponents:R,loginRequiredCallback:function(){U.push("/account/login")}})),f.getInstance().router=U,j();var O=f.getInstance();O.router=U,O.currentPageType=S;var W=i.useState(!1),B=W[0],z=W[1],q=i.useMemo((function(){return(null==M?void 0:M.id)===(null==I?void 0:I.id)&&g.pageSpecificData&&g.isBrowser?S===s.PRODUCT&&g._initProductOnBrowser(g.pageSpecificData):g.setPageSpecificData(I,S,B),g.initPagePropValues(p,x,w.map((function(t){return new u(t)})),L,B)}),e(e([],S!==s.SEARCH?[B]:[],!0),[p,S,L,I,x],!1));i.useEffect((function(){T&&z("undefined"!=typeof window),window.addToCart=O.cartStore._windowAddToCart,O.cartStore.getCart(),O.checkLocalization(),v()}),[]),i.useEffect((function(){I?(null==M?void 0:M.id)!==I.id&&N(I):N(null)}),[I]),i.useEffect((function(){var t=function(){O.customerStore.routeChangeInit()};return U.events.on("routeChangeStart",t),function(){U.events.off("routeChangeStart",t)}}),[]),i.useEffect((function(){!function(t,e){var i,n;o(this,void 0,void 0,(function(){var o,a,d,u,c,m;return r(this,(function(r){switch(r.label){case 0:return o=f.getInstance(),[4,l.pageView(t)];case 1:r.sent(),r.label=2;case 2:return r.trys.push([2,7,,8]),t!==s.PRODUCT?[3,4]:(a=e,[4,l.productView(a)]);case 3:r.sent(),o.customerStore.onProductView(a.id,a.selectedVariant.id),r.label=4;case 4:return t===s.CATEGORY&&(u=null===(i=(d=e).categoryPathItems)||void 0===i?void 0:i.map((function(t){return t.name})).join(" > "),u=d.categoryPathItems&&(null===(n=d.categoryPathItems)||void 0===n?void 0:n.length)>0?u+" > "+d.name:d.name,l.viewCategory(u,d)),t===s.BRAND&&(c=e,l.viewBrand(c)),t!==s.CART?[3,6]:[4,o.cartStore.waitUntilInitialized()];case 5:r.sent(),l.viewCart(o.cartStore.cart),r.label=6;case 6:return[3,8];case 7:return m=r.sent(),console.error(m),[3,8];case 8:return[2]}}))}))}(S,g.pageSpecificData)}),[S,I]),i.useEffect((function(){if("undefined"!=typeof window&&"undefined"!=typeof document){var e,i=!1,n=function(t,e){if(function(t){t.setAttribute("data-ikas-popup-widget","true"),!t.dataset.ikasPopupWidgetUrl&&t.src&&(t.dataset.ikasPopupWidgetUrl=t.src)}(t),"true"===t.dataset.ikasPopupWidgetLoaded)return e(),function(){};var o=function(){t.dataset.ikasPopupWidgetLoaded="true",e()},r=function(e){console.error("[@ikas/storefront] Failed to load popup widget script",t.src,e)};return t.addEventListener("load",o,{once:!0}),t.addEventListener("error",r,{once:!0}),function(){t.removeEventListener("load",o),t.removeEventListener("error",r)}},a=function(t){var o=window.location.href.includes("http://localhost:3333/")?"http://localhost:9000/popup-script-injector.iife.js":"/sf/assets/popup/popup-script-injector.iife.js";if(o){var r=function(){i||function(t){if("function"==typeof window.startIkasPopupWidget)try{window.startIkasPopupWidget(t)}catch(t){console.error("[@ikas/storefront] Failed to start popup widget",t)}}(t)},a=document.querySelector('script[data-ikas-popup-widget="true"]');if(a)e=n(a,r);else{var s=document.createElement("script");s.src=o,s.defer=!0,e=n(s,r),document.body.appendChild(s)}}},s=function(t){var e=window.location.href.includes("http://localhost:3333/")?"http://localhost:9000/style.css":"/sf/assets/popup/style.css";if(e&&!document.querySelector('link[href="'.concat(e,'"]'))){var o=document.createElement("link");o.rel="stylesheet",o.href=e,o.setAttribute("data-ikas-popup-widget","true");o.addEventListener("load",(function(){}),{once:!0}),o.addEventListener("error",(function(t){console.error("[@ikas/storefront] Failed to load popup widget CSS",e,t)}),{once:!0}),document.head.appendChild(o)}};return o(void 0,void 0,void 0,(function(){var e,n,d;return r(this,(function(u){switch(u.label){case 0:return e=c.getStorefrontPopups()||[],[4,(l=e,o(void 0,void 0,void 0,(function(){var e,o,i,n,a;return r(this,(function(r){switch(r.label){case 0:if(!(e=l.map((function(t){return t.id})).filter(Boolean)).length)return[2,l];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,h({idList:e})];case 2:return(null==(o=r.sent())?void 0:o.isSuccess)&&(null===(a=o.data)||void 0===a?void 0:a.length)?(i=o.data,[2,l.map((function(e){var o=i.find((function(t){return t.id===e.id}));return o?t(t({},o),{isFilteredOnServerSide:e.isFilteredOnServerSide}):e}))]):[3,4];case 3:return n=r.sent(),console.error("[@ikas/storefront] Failed to fetch popup details",n),[3,4];case 4:return[2,l]}}))})))];case 1:return n=u.sent(),i?[2]:[4,y(n)];case 2:return d=u.sent(),window.ikasPopupConfig=d,a(d),s(),[2]}var l}))})),function(){i=!0,null==e||e()}}}),[U.asPath,S,null==I?void 0:I.id]);var H=i.useMemo((function(){var t=q.find((function(t){return t.component.isHeader})),e=q.find((function(t){return t.component.isFooter})),o=q.filter((function(t){return!t.component.isHeader&&!t.component.isFooter}))||[];return i.createElement("div",{style:{position:"relative",minHeight:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between"}},i.createElement("div",null,t&&C(t,L,-1),o.map((function(t,e){return C(t,L,e)}))),e&&C(e,L,-1))}),[q,L]),_=i.useMemo((function(){return c.getMerchantSettings()?new d(c.getMerchantSettings()):null}),[c.getMerchantSettings()]);return i.createElement(i.Fragment,null,i.createElement(m,{pageType:S,pageTitle:b,pageDescription:P,pageSpecificData:g.pageSpecificData,canonicals:k&&k.length>0?k:null,disableIndex:D,merchantSettings:_,addOgpMetas:V,productReviewSummary:F,pageComponentPropValues:q}),H)})),C=function(t,e,o){return i.createElement(p,{key:t.pageComponent.id,index:o,pageComponentPropValue:t,settings:e})};function b(t){var e,o,r,i,n,a=null===(e=t.order)||void 0===e?void 0:e.map((function(t){return{direction:"ASC"===t.direction?x.ASC:x.DESC,type:t.type}}));return{input:{page:null!==(o=t.page)&&void 0!==o?o:1,perPage:null!==(r=t.perPage)&&void 0!==r?r:10,order:a,productIdList:t.productIdList,categoryIdList:t.categoryIdList,priceListId:null!==(i=t.priceListId)&&void 0!==i?i:c.getPriceListId(),salesChannelId:null!==(n=t.salesChannelId)&&void 0!==n?n:c.getSalesChannelId()}}}export{S as IkasPage,C as renderComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"../../../ext/tslib/tslib.es6.mjs.js";import e from"react";import{observer as n}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{ButtonActionTypeEnum as o}from"../../models/modal/step/elements/button/index.js";import{getHorizontalAlignment as r,injectFontScript as i}from"../../helpers/index.js";var
|
|
1
|
+
import{__assign as t}from"../../../ext/tslib/tslib.es6.mjs.js";import e from"react";import{observer as n}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{ButtonActionTypeEnum as o}from"../../models/modal/step/elements/button/index.js";import{getHorizontalAlignment as r,injectFontScript as i,normalizeUrl as a}from"../../helpers/index.js";var c=n((function(n){var c=n.element,l=n.isStandaloneButtonComponent,s=n.onClose,d=n.disableButtonAction,u=e.useRef(null),m=c,f={display:"flex",alignItems:"center",justifyContent:r(m.horizontalAlignment),padding:"".concat(m.outerVerticalPadding,"px ").concat(m.outerHorizontalPadding,"px"),backgroundColor:m.bgColor},p={color:m.color,backgroundColor:m.buttonBgColor,fontSize:m.fontSize,fontWeight:m.fontWeight,fontFamily:i(m.fontFamily),textAlign:"center",border:"".concat(m.borderWidth,"px ").concat(m.borderStyle," ").concat(m.borderColor),borderRadius:m.borderRadius,padding:"".concat(m.verticalPadding,"px ").concat(m.horizontalPadding,"px")},b={width:"".concat(m.width,"%"),minWidth:"fit-content",cursor:"pointer"},g=e.useCallback((function(){if(u.current&&!d){var t=m.link||void 0;if(!l&&t)u.current.href=a(t)||"",u.current.click();else switch(m.actionType){case o.NAVIGATE_TO_LINK_AND_CLOSE:u.current.href=a(t)||"",null==s||s(!0),u.current.click();break;case o.NAVIGATE_TO_LINK:u.current.href=a(t)||"",u.current.click();break;case o.CLOSE:null==s||s(!0)}}}),[u,u.current]);return e.createElement("div",{style:f},e.createElement("a",{onClick:g,style:b,target:m.openLinkInNewWindow?"_blank":"_self",ref:u},e.createElement("div",{dangerouslySetInnerHTML:{__html:m.text},style:t({},p)})))}));export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{observer as t}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{ImageFitEnum as r}from"../../models/modal/step/elements/image/index.js";var
|
|
1
|
+
import e from"react";import{observer as t}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{ImageFitEnum as r}from"../../models/modal/step/elements/image/index.js";import{normalizeUrl as i}from"../../helpers/index.js";var a=t((function(t){var a=t.element,o=t.popup,d=t.editModeChildren,n=t.isMobile,m=a;m.cdnURL||(m.cdnURL=o.cdnURL),m.merchantId||(m.merchantId=o.merchantId);var c=o.modal.windowSettings,l={width:c.takeFullWidth||n?"100%":c.maxWidth,backgroundColor:m.bgColor,padding:"".concat(m.verticalPadding,"px ").concat(m.horizontalPadding,"px"),borderRadius:m.borderRadius};if(!m.src&&o.isPreviewMode&&d)return e.createElement("div",{style:l},d);var s={objectFit:m.objectFit===r.CONTAIN?"contain":"cover",height:"100%"};return e.createElement("a",{href:i(m.link),style:l,target:"_blank"},m.src&&e.createElement("img",{src:m.src||void 0,width:"100% !important",style:s}))}));export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{observer as t}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{ImagePositionEnum as i,ImageFitEnum as a}from"../../models/modal/step/elements/image/index.js";var o=t((function(t){var o=t.element,
|
|
1
|
+
import e from"react";import{observer as t}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{normalizeUrl as r}from"../../helpers/index.js";import{ImagePositionEnum as i,ImageFitEnum as a}from"../../models/modal/step/elements/image/index.js";var o=t((function(t){var o=t.element,n=t.popup,d=t.editModeChildren,m=o;if(m.cdnURL||(m.cdnURL=n.cdnURL),m.merchantId||(m.merchantId=n.merchantId),!m.src&&n.isPreviewMode&&d)return d;var c={display:"flex",alignItems:"center",justifyContent:m.imagePosition===i.DISABLE_FLOAT?"center":m.imagePosition===i.FLOAT_LEFT?"flex-start":"flex-end",padding:"".concat(m.verticalPadding,"px ").concat(m.horizontalPadding,"px"),backgroundColor:m.bgColor,maxWidth:"100%"},s={borderRadius:"".concat(m.borderRadius,"px"),objectFit:m.objectFit===a.CONTAIN?"contain":"cover",width:"".concat(m.maxWidth,"%")};return e.createElement("a",{href:r(m.link),style:c,target:"_blank"},e.createElement("img",{src:m.src||void 0,width:100===m.maxWidth?"100% !important":void 0,style:s}))}));export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{observer as t}from"../../../../../mobx-react/dist/mobxreact.esm.js";import{PopupTypeEnum as o,PopupPositonEnum as n}from"../models/modal/index.js";import i from"../assets/x-close.js";import{CloseButtonPositionTypeEnum as r,CloseIconTypeEnum as s,CloseButtonDisplayTypeEnum as l}from"../models/modal/close-settings/index.js";import{PopupElementTypeEnum as a,ComponentVerticalAlignmentEnum as d}from"../models/modal/step/elements/base/index.js";import c from"./text-element-renderer/index.js";import m from"./button-element-renderer/index.js";import p from"./space-element-renderer/index.js";import u from"./divider-element-renderer/index.js";import f from"./social-element-renderer/index.js";import P from"./image-element-renderer/index.js";import E from"./image-column-element-renderer/index.js";import x from"./product-list-renderer/index.js";import v from"./form-element-renderer/index.js";import{ImageColumnPositionEnum as g,MobileImageColumnPositionEnum as y}from"../models/modal/step/elements/image-column/index.js";t((function(t){var T,b,C,O,I=t.popup,_=t.dynamicData,h=t.dashboardComponents,M=t.previewMode,w=t.sfProps,S=t.isMobile,A=e.useState(!1),D=A[0],R=A[1]
|
|
1
|
+
import e from"react";import{observer as t}from"../../../../../mobx-react/dist/mobxreact.esm.js";import{PopupTypeEnum as o,PopupPositonEnum as n}from"../models/modal/index.js";import i from"../assets/x-close.js";import{CloseButtonPositionTypeEnum as r,CloseIconTypeEnum as s,CloseButtonDisplayTypeEnum as l}from"../models/modal/close-settings/index.js";import{PopupElementTypeEnum as a,ComponentVerticalAlignmentEnum as d}from"../models/modal/step/elements/base/index.js";import c from"./text-element-renderer/index.js";import m from"./button-element-renderer/index.js";import p from"./space-element-renderer/index.js";import u from"./divider-element-renderer/index.js";import f from"./social-element-renderer/index.js";import P from"./image-element-renderer/index.js";import E from"./image-column-element-renderer/index.js";import x from"./product-list-renderer/index.js";import v from"./form-element-renderer/index.js";import{ImageColumnPositionEnum as g,MobileImageColumnPositionEnum as y}from"../models/modal/step/elements/image-column/index.js";t((function(t){var T,b,C,O,I=t.popup,_=t.dynamicData,h=t.dashboardComponents,M=t.previewMode,w=t.sfProps,S=t.isMobile,A=e.useState(!1),D=A[0],R=A[1],k=I.modal,N=k.teaser,j=!!k.selectedStep.isTeaser,B=k.selectedStep.elements.find((function(e){return e.type===a.IMAGE_COLUMN})),L=j?N.backgroundSettings:k.backgroundSettings,U=j?N.windowSettings:k.windowSettings,H=j?N.closeSettings:k.closeSettings,W=L.allowScrollingWhenPopupOpen,F=I.isPreviewMode||M,V=!!F||k.isVisible;e.useEffect((function(){return document.body.style.overflow=V&&!W?"hidden":"auto",function(){document.body.style.overflow="auto"}}),[V,W]);var G=L.overlay,z=L.border,K="center",X="center";switch(j?o.POPUP:k.type){case o.POPUP:var Y=j?N.position:k.position;Y===n.POPUP_TOP_LEFT?(K="flex-start",X="flex-start"):Y===n.POPUP_TOP_CENTER?(K="center",X="flex-start"):Y===n.POPUP_TOP_RIGHT?(K="flex-end",X="flex-start"):Y===n.POPUP_MIDDLE_LEFT?(K="flex-start",X="center"):Y===n.POPUP_MIDDLE_CENTER?(K="center",X="center"):Y===n.POPUP_MIDDLE_RIGHT?(K="flex-end",X="center"):Y===n.POPUP_BOTTOM_LEFT?(K="flex-start",X="flex-end"):Y===n.POPUP_BOTTOM_CENTER?(K="center",X="flex-end"):Y===n.POPUP_BOTTOM_RIGHT&&(K="flex-end",X="flex-end");break;case o.DRAWER:k.position===n.DRAWER_LEFT?(K="flex-start",X="center"):k.position===n.DRAWER_RIGHT&&(K="flex-end",X="center");break;case o.NOTIFICATION_BAR:k.position===n.NOTIFICATION_BAR_UP?(K="center",X="flex-start"):k.position===n.NOTIFICATION_BAR_DOWN&&(K="center",X="flex-end")}var q=e.useMemo((function(){return 2147483644}),[]),J=e.useMemo((function(){return q+1}),[]),Q=e.useMemo((function(){return J+1}),[]),Z=e.useMemo((function(){return Q+1}),[]),$={position:"fixed",display:"flex",justifyContent:K,alignItems:X,top:0,left:0,right:0,bottom:0,zIndex:q,overflow:"hidden",padding:"".concat(U.outerVerticalPadding,"px ").concat(U.outerHorizontalPadding,"px"),opacity:V?1:0,visibility:V?"visible":"hidden",transition:"opacity 0.3s ease, visibility 0.3s ease"},ee={position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:J,backgroundColor:G?G.bgColor:"",opacity:G?(G.bgOpacity||100)/100:void 0},te={position:"relative",zIndex:Q,backgroundColor:L.bgColor,border:z?"".concat(z.borderWidth,"px ").concat(z.borderStyle," ").concat(z.borderColor):"",borderRadius:"".concat(U.borderRadius,"px"),maxWidth:"100%",maxHeight:"100%",width:U.takeFullWidth?"100%":void 0,minHeight:U.minHeight,height:U.takeFullHeight?"100%":void 0,boxShadow:L.shadow?"0 0 10px ".concat(L.shadow.color):"",overflow:"auto",opacity:V?1:0,visibility:V?"visible":"hidden",transition:"opacity 0.3s ease, visibility 0.3s ease"},oe="";switch(null==B?void 0:B.verticalAlignment){case d.BOTTOM:oe="flex-end";break;case d.MIDDLE:oe="center";break;case d.TOP:oe="flex-start"}var ne=B?B.imagePosition===g.LEFT_ALIGN?"row-reverse":"row":"",ie=B?B.mobilePosition===y.TOP?"column-reverse":"column":"",re={display:"flex",flexDirection:B?S?ie:ne:"column",overflow:"hidden"},se={width:U.takeFullWidth?"100%":U.maxWidth,maxWidth:"100%",overflow:"auto",display:"flex",flexDirection:"column",justifyContent:oe,padding:"".concat(U.innerVerticalPadding,"px ").concat(U.innerHorizontalPadding,"px")},le={position:H.closeButtonPositionType===r.TAKE_SPACE?"relative":"absolute",float:H.closeButtonPositionType===r.TAKE_SPACE?"right":"none",top:8,right:8,zIndex:Z},ae={position:"sticky",padding:"6px",marginLeft:H.closeButtonPositionType===r.TAKE_SPACE?"14px":void 0,display:"flex",justifyContent:"center",alignItems:"center",border:(null===(T=H.iconSettings)||void 0===T?void 0:T.type)===s.WITH_BORDER?"1px solid ".concat(null===(b=H.iconSettings)||void 0===b?void 0:b.color):"",borderRadius:"50%",backgroundColor:null===(C=H.iconSettings)||void 0===C?void 0:C.backgroundColor},de={color:null===(O=H.iconSettings)||void 0===O?void 0:O.color,cursor:"pointer"},ce=function(t){var o=t.type,n=h&&h[o]&&h[o].length?h[o][0]:null,i=n&&I.marketingPopupViewModel?e.createElement(n,{element:t,marketingPopupViewModel:I.marketingPopupViewModel}):void 0;switch(o){case a.TEXT:return e.createElement(c,{element:t});case a.IMAGE:return e.createElement(P,{element:t,popup:I,editModeChildren:i});case a.IMAGE_COLUMN:return S&&B.mobilePosition===y.HIDE?null:e.createElement(E,{element:t,popup:I,editModeChildren:i,isMobile:S});case a.BUTTON:return e.createElement(m,{element:t,onClose:me,isStandaloneButtonComponent:!0});case a.DIVIDER:return e.createElement(u,{element:t});case a.FORM:return e.createElement(v,{element:t,popup:I,isPreviewMode:!!F,sfProps:w,setIsCustomerSaved:R});case a.PRODUCT_LIST:return e.createElement(x,{element:t,products:_.products[t.id],popup:I,editModeChildren:i,isPreviewMode:!!F,sfProps:w,onClose:me});case a.SOCIAL_MEDIA:return e.createElement(f,{element:t,popup:I,editModeChildren:i});case a.SPACE:return e.createElement(p,{element:t})}},me=function(e){if(!F&&k.isVisible){var t=D||e;k.isVisible=!1,w&&w.onModalClose(t),R(!1)}};return e.createElement("div",{className:"ikas-popup-default-styles",id:"ikas-popup-container",style:$},e.createElement("div",{style:te},H.closeButtonDisplayType!==l.ALWAYS_HIDDEN&&e.createElement("div",{style:le,onClick:function(){return me()}},e.createElement("div",{style:ae,className:H.closeButtonDisplayType===l.VISIBLE_ON_HOVER?"visible-on-hover":""},e.createElement(i,{style:de}))),e.createElement("div",{style:re,onClick:function(e){j&&(k.selectedStep=k.steps[0])}},e.createElement("div",{style:se},k.selectedStep.elements.filter((function(e){return e.type!==a.IMAGE_COLUMN})).slice().sort((function(e,t){return e.order-t.order})).map((function(e){return ce(e)}))),B&&ce(B))),e.createElement("div",{style:ee,onClick:function(){return me()}}))}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__spreadArray as t,__assign as e,__awaiter as o,__generator as n}from"../../../ext/tslib/tslib.es6.mjs.js";import i from"react";import{observer as l}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as r,injectFontScript as a}from"../../helpers/index.js";import{ProductListTypeEnum as d,ProductListLayoutEnum as c}from"../../models/modal/step/elements/product/index.js";import s from"../button-element-renderer/index.js";import u from"../../../../../../swiper/modules/navigation.mjs.js";import m from"../../../../../../swiper/modules/scrollbar.mjs.js";import{Swiper as p,SwiperSlide as
|
|
1
|
+
import{__spreadArray as t,__assign as e,__awaiter as o,__generator as n}from"../../../ext/tslib/tslib.es6.mjs.js";import i from"react";import{observer as l}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as r,injectFontScript as a}from"../../helpers/index.js";import{ProductListTypeEnum as d,ProductListLayoutEnum as c}from"../../models/modal/step/elements/product/index.js";import s from"../button-element-renderer/index.js";import u from"../../../../../../swiper/modules/navigation.mjs.js";import m from"../../../../../../swiper/modules/scrollbar.mjs.js";import{Swiper as p,SwiperSlide as g}from"../../../../../../swiper/swiper-react.mjs.js";import v from"../../assets/left-arrow.js";import f from"../../assets/right-arrow.js";import{ProductActionTypeEnum as b}from"../../models/modal/step/elements/product/detail-settings/index.js";import{ComponentHorizontalAlignmentEnum as x}from"../../models/modal/step/elements/base/index.js";var h=l((function(l){var h,y=l.element,w=l.products,P=l.popup,C=l.editModeChildren,E=l.isPreviewMode,S=l.sfProps,j=l.onClose,z=i.useState(null),R=z[0],k=z[1],A=i.useState(!1),D=A[0],I=A[1],W=i.useState(!1),_=W[0],F=W[1],T=y,L=[];if(w&&(L=T.listType===d.SPECIFIC?(null===(h=T.variantPairs)||void 0===h?void 0:h.length)?w.slice().sort((function(t,e){return T.variantPairs.findIndex((function(e){return e.variantId===t.variantId}))-T.variantPairs.findIndex((function(t){return t.variantId===e.variantId}))})):[]:t([],w,!0)),L.length>T.maxProductsToShow&&(L.length=T.maxProductsToShow),!(L&&L.length||!P.isPreviewMode)&&C)return C;if(!L||!L.length)return null;T.gapBetweenProductElements;var U=T.productDetailSettings.image,B=T.productDetailSettings.button,H=T.buttonSettings,M=T.productDetailSettings.discountRatio,N=T.productDetailSettings.finalPrice,O=T.productDetailSettings.originalPrice,V=T.productDetailSettings.name,$=r(T.horizontalAlignment),q=1;T.layout===c.ONE_COLUMN?q=1:T.layout===c.TWO_COLUMN?q=2:T.layout===c.THREE_COLUMN&&(q=3);var G={padding:"".concat(T.outerVerticalPadding,"px ").concat(T.outerHorizontalPadding,"px"),backgroundColor:T.productBgColor,width:"100%",height:"max-content"},J={display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center",height:"100%",cursor:"pointer"},K={display:"flex",justifyContent:$,alignItems:"center",width:"100%",backgroundColor:null==U?void 0:U.bgColor,borderRadius:(null==U?void 0:U.borderRadius)?"".concat(U.borderRadius,"px"):void 0},Q={width:"".concat(null==U?void 0:U.maxWidth,"%"),objectFit:"contain",borderRadius:(null==U?void 0:U.borderRadius)?"".concat(U.borderRadius,"px"):void 0},X={display:"flex",flexDirection:"column",width:"100%"},Y={display:"flex",flexDirection:"column"},Z={backgroundColor:null==V?void 0:V.bgColor,color:null==V?void 0:V.color,fontFamily:V?a(V.fontFamily):void 0,fontSize:null==V?void 0:V.fontSize,fontWeight:null==V?void 0:V.fontWeight,padding:"".concat(null==V?void 0:V.verticalPadding,"px ").concat(null==V?void 0:V.horizontalPadding,"px"),width:"100%",textAlign:null==V?void 0:V.horizontalAlignment,border:"".concat(null==V?void 0:V.borderWidth,"px ").concat(null==V?void 0:V.borderStyle," ").concat(null==V?void 0:V.borderColor),borderRadius:null==V?void 0:V.borderRadius},tt={backgroundColor:null==M?void 0:M.bgColor,color:null==M?void 0:M.color,fontFamily:M?a(M.fontFamily):void 0,fontSize:null==M?void 0:M.fontSize,fontWeight:null==M?void 0:M.fontWeight,padding:"".concat(null==M?void 0:M.verticalPadding,"px ").concat(null==M?void 0:M.horizontalPadding,"px"),width:"fit-content !important",border:"".concat(null==M?void 0:M.borderWidth,"px ").concat(null==M?void 0:M.borderStyle," ").concat(null==M?void 0:M.borderColor),borderRadius:null==M?void 0:M.borderRadius},et={textDecoration:"line-through",backgroundColor:null==O?void 0:O.bgColor,color:null==O?void 0:O.color,fontFamily:O?a(O.fontFamily):void 0,fontSize:null==O?void 0:O.fontSize,fontWeight:null==O?void 0:O.fontWeight,padding:"".concat(null==O?void 0:O.verticalPadding,"px ").concat(null==O?void 0:O.horizontalPadding,"px"),width:"100%",textAlign:null==O?void 0:O.horizontalAlignment,border:"".concat(null==O?void 0:O.borderWidth,"px ").concat(null==O?void 0:O.borderStyle," ").concat(null==O?void 0:O.borderColor),borderRadius:null==O?void 0:O.borderRadius},ot={backgroundColor:null==N?void 0:N.bgColor,color:null==N?void 0:N.color,fontFamily:N?a(N.fontFamily):void 0,fontSize:null==N?void 0:N.fontSize,fontWeight:null==N?void 0:N.fontWeight,padding:"".concat(null==N?void 0:N.verticalPadding,"px ").concat(null==N?void 0:N.horizontalPadding,"px"),width:"100%",textAlign:null==N?void 0:N.horizontalAlignment,border:"".concat(null==N?void 0:N.borderWidth,"px ").concat(null==N?void 0:N.borderStyle," ").concat(null==N?void 0:N.borderColor),borderRadius:null==N?void 0:N.borderRadius},nt={width:"".concat(H.width,"%"),minWidth:"fit-content"},it=e({display:"flex",justifyContent:"center",width:"100%",gap:"10px"},1===q?{position:"absolute",top:"calc(50% - 25px)",alignItems:"center",justifyContent:"space-between",zIndex:10}:void 0),lt={padding:10,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",border:"1px solid #EEF2F6",cursor:"pointer"};return i.createElement("div",{style:G},i.createElement(p,{onSwiper:k,modules:[u,m],spaceBetween:T.gapBetweenProducts,slidesPerView:q,navigation:{nextEl:".custom-next-button",prevEl:".custom-prev-button"},scrollbar:void 0},L.map((function(t,e){return i.createElement(g,{style:{height:"auto"},key:t.variantId},i.createElement("div",{style:J,onClick:function(){return function(t){return o(void 0,void 0,void 0,(function(){var e,o,i,l;return n(this,(function(n){switch(n.label){case 0:return E||!t.url?[3,4]:(null===(l=T.productDetailSettings.button)||void 0===l?void 0:l.action)===b.ADD_TO_CART&&S?[4,S.addProductToCart(t)]:[3,2];case 1:return e=n.sent(),o="","ikasPopupConfig"in window&&window.ikasPopupConfig&&"object"==typeof window.ikasPopupConfig&&window.ikasPopupConfig&&"cartUrl"in window.ikasPopupConfig&&"string"==typeof window.ikasPopupConfig.cartUrl&&(o=window.ikasPopupConfig.cartUrl),e&&((i=document.createElement("a")).href=o,i.target="_self",i.click()),[3,3];case 2:(i=document.createElement("a")).href=t.url,i.target="_self",i.click(),n.label=3;case 3:j(!0),n.label=4;case 4:return[2]}}))}))}(t)}},i.createElement("div",{style:X},!!U&&t.imageURL&&i.createElement("div",{style:K},i.createElement("img",{src:t.imageURL||void 0,alt:t.name||void 0,style:Q})),!!V&&i.createElement("div",{style:Y},!!V&&i.createElement("div",{style:Z},t.name)),(!!O||!!N||!!M)&&i.createElement("div",{style:{display:"flex",flexDirection:"column",gap:2}},!!M&&!!t.discountPrice&&i.createElement("div",{style:{padding:"".concat(M.outerVerticalPadding,"px ").concat(M.outerHorizontalPadding,"px"),width:"100% !important",display:"flex",justifyContent:r(M.horizontalAlignment),alignItems:"center"}},i.createElement("div",{style:tt},function(t){return t.$discountRatio?T.productDetailSettings.discountRatioText?"".concat(t.$discountRatio," ").concat(T.productDetailSettings.discountRatioText):t.$discountRatio:null}(t))),i.createElement("div",{style:{display:"flex",gap:4,flexWrap:"wrap",overflow:"hidden",width:"100%",justifyContent:r((null==O?void 0:O.horizontalAlignment)||(null==N?void 0:N.horizontalAlignment)||x.LEFT),alignItems:"center"}},!!O&&!!t.discountPrice&&i.createElement("div",{style:{padding:"".concat(O.outerVerticalPadding,"px ").concat(O.outerHorizontalPadding,"px")}},i.createElement("div",{style:et},t.price)),!!N&&i.createElement("div",{style:{padding:"".concat(N.outerVerticalPadding,"px ").concat(N.outerHorizontalPadding,"px")}},i.createElement("div",{style:ot},t.discountPrice||t.price))))),!!B&&i.createElement("div",{style:nt},i.createElement(s,{disableButtonAction:!0,element:H}))))})),L.length>1&&i.createElement("div",{style:it},i.createElement("div",{className:"custom-prev-button",style:e(e({},lt),D?{opacity:.5,cursor:"not-allowed"}:{}),onClick:function(){R&&(F(R.isEnd),I(R.isBeginning))}},i.createElement(v,null)),i.createElement("div",{className:"custom-next-button",style:e(e({},lt),_?{opacity:.5,cursor:"not-allowed"}:{}),onClick:function(){R&&(F(R.isEnd),I(R.isBeginning))}},i.createElement(f,null)))))}));export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{observer as t}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as r}from"../../helpers/index.js";var
|
|
1
|
+
import e from"react";import{observer as t}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as r,normalizeUrl as n}from"../../helpers/index.js";var i=t((function(t){var i=t.element,o=i.socialMediaLinks.filter((function(e){return!!e.link})).sort((function(e,t){return e.order-t.order}));if(!o.length&&t.editModeChildren&&t.popup.isPreviewMode)return t.editModeChildren;var a={display:"flex",alignItems:"center",justifyContent:r(i.horizontalAlignment),padding:"".concat(i.verticalPadding,"px ").concat(i.horizontalPadding,"px"),backgroundColor:i.bgColor,width:"100%"},l={display:"flex",alignItems:"center",gap:"".concat(i.gapBetweenLogos,"px")};return e.createElement("div",{style:a},e.createElement("div",{style:l},o.map((function(t,r){return e.createElement("a",{href:n(t.link)||"",key:r,target:"_blank"},e.createElement("img",{src:t.iconUrlWithoutHash||"",width:24,height:24}))}))))}));export{i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../ext/tslib/tslib.es6.mjs.js";import"../../ext/libphonenumber-js/es6/PhoneNumberMatcher.js";import"../../ext/libphonenumber-js/es6/AsYouTypeFormatter.js";import{isValidPhoneNumber as
|
|
1
|
+
import"../../ext/tslib/tslib.es6.mjs.js";import"../../ext/libphonenumber-js/es6/PhoneNumberMatcher.js";import"../../ext/libphonenumber-js/es6/AsYouTypeFormatter.js";import{isValidPhoneNumber as t}from"../../ext/libphonenumber-js/min/exports/isValidPhoneNumber.js";import"../../ext/libphonenumber-js/min/exports/PhoneNumberMatcher.js";import"../../ext/libphonenumber-js/min/exports/AsYouType.js";import"../../ext/libphonenumber-js/min/exports/Metadata.js";import"../../ext/libphonenumber-js/es6/findNumbers/isValidCandidate.js";import"../../ext/libphonenumber-js/index.es6.exports/PhoneNumberSearch.js";import{ComponentHorizontalAlignmentEnum as e}from"../models/modal/step/elements/base/index.js";var n=function(t){var n="";switch(t){case e.LEFT:n="flex-start";break;case e.CENTER:n="center";break;case e.RIGHT:n="flex-end"}return n},r=function(t){if(t.name){var e=t.name.replace(/ /g,"+"),n="";if(t.variants){n+=":";var r=t.variants.some((function(t){return"italic"===t}));if(r&&(n+="ital,"),n+="wght@",r){var a=new RegExp("italic","i");n+=t.variants.reduce((function(t,e){return a.test(e)?t:t+"0,".concat(e.replace("regular","400"),";")}),""),n+=t.variants.reduce((function(t,e){return a.test(e)?t+"1,".concat("italic"===e?"400":e.replace("italic",""),";"):t}),"")}else n+=t.variants.reduce((function(t,e){return t+"".concat(e.replace("regular","400"),";")}),"");n=n.substring(0,n.length-1),n+="&display=swap"}return"https://fonts.googleapis.com/css2?family=".concat(e).concat(n)}},a=function(t){var e="'".concat(t.name,'\', -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif');if(document.getElementById("ikas-popup-font-".concat(t.name)))return e;var n=r(t);if(n){var a=document.createElement("link");return a.setAttribute("id","ikas-popup-font-".concat(t.name)),a.setAttribute("rel","stylesheet"),a.setAttribute("href",n),document.getElementsByTagName("head")[0].appendChild(a),e}},i=function(t){return!(t.length>320)&&/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(t)},s=function(e,n){return t(e,n?n.toUpperCase():"TR")},o=function(t){var e;return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)+(null!==(e=null==t?void 0:t.length)&&void 0!==e?e:0)},m=function(t){if(t&&""!==t.trim()){var e=t.trim();return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("mailto:")||e.startsWith("tel:")||e.startsWith("ftp://")||e.startsWith("//")?e:"https://".concat(e)}};export{o as generateRandomId,r as getGoogleFontHref,n as getHorizontalAlignment,a as injectFontScript,m as normalizeUrl,i as validateEmail,s as validatePhoneNumber};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__extends as i}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as t,observable as e,computed as n}from"mobx";import{PopupElementTypeEnum as a,BaseElement as o}from"../base/index.js";import{POPUP_DEFAULT_IMAGE_PATH as
|
|
1
|
+
import{__extends as i}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as t,observable as e,computed as n}from"mobx";import{PopupElementTypeEnum as a,BaseElement as o}from"../base/index.js";import{POPUP_DEFAULT_IMAGE_PATH as c}from"../../../index.js";var d,s,m,r=1080;(m=d||(d={})).FLOAT_LEFT="FLOAT_LEFT",m.FLOAT_RIGHT="FLOAT_RIGHT",m.DISABLE_FLOAT="DISABLE_FLOAT",function(i){i.CONTAIN="CONTAIN",i.COVER="COVER"}(s||(s={}));var l=function(o){function m(i){var c,m,r,l,g=this;return(g=o.call(this,i)||this).type=a.IMAGE,g.imagePosition=i.imagePosition||d.DISABLE_FLOAT,g.imageId=i.imageId||null,g.bgColor=i.bgColor||"",g.cdnURL=null,g.merchantId=null,g.objectFit=i.objectFit||s.CONTAIN,g.link=i.link||null,g.maxWidth=null!==(c=i.maxWidth)&&void 0!==c?c:100,g.verticalPadding=null!==(m=i.verticalPadding)&&void 0!==m?m:0,g.horizontalPadding=null!==(r=i.horizontalPadding)&&void 0!==r?r:0,g.borderRadius=null!==(l=i.borderRadius)&&void 0!==l?l:0,t(g,{imagePosition:e,imageId:e,bgColor:e,cdnURL:e,merchantId:e,objectFit:e,link:e,maxWidth:e,borderRadius:e,src:n}),g}return i(m,o),Object.defineProperty(m.prototype,"src",{get:function(){if(this.imageId)return this.imageId.includes(c)?"".concat(this.cdnURL).concat(this.imageId):this.imageId.includes("/")?"".concat(this.cdnURL,"images/").concat(this.merchantId).concat(this.imageId,"/image_").concat(r,".jpeg"):"".concat(this.cdnURL,"images/").concat(this.merchantId,"/").concat(this.imageId,"/image_").concat(r,".jpeg")},enumerable:!1,configurable:!0}),m}(o);export{r as IMAGE_SIZE,l as ImageElement,s as ImageFitEnum,d as ImagePositionEnum};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__extends as i}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as
|
|
1
|
+
import{__extends as i}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as n,observable as o,computed as t}from"mobx";import{PopupElementTypeEnum as e,BaseElement as a}from"../base/index.js";import{IMAGE_SIZE as m,ImageFitEnum as s}from"../image/index.js";import{POPUP_DEFAULT_IMAGE_PATH as c}from"../../../index.js";var r,d,l;(l=r||(r={})).LEFT_ALIGN="LEFT_ALIGN",l.RIGTH_ALIGN="RIGTH_ALIGN",function(i){i.TOP="TOP",i.BOTTOM="BOTTOM",i.HIDE="HIDE"}(d||(d={}));var g=function(a){function l(i){var m,c,l,g=this;return(g=a.call(this,i)||this).type=e.IMAGE_COLUMN,g.imagePosition=i.imagePosition||r.RIGTH_ALIGN,g.mobilePosition=i.mobilePosition||d.HIDE,g.imageId=i.imageId||null,g.bgColor=i.bgColor||"",g.cdnURL=null,g.merchantId=null,g.objectFit=i.objectFit||s.COVER,g.link=i.link||null,g.verticalPadding=null!==(m=i.verticalPadding)&&void 0!==m?m:0,g.horizontalPadding=null!==(c=i.horizontalPadding)&&void 0!==c?c:0,g.borderRadius=null!==(l=i.borderRadius)&&void 0!==l?l:0,n(g,{imagePosition:o,mobilePosition:o,imageId:o,bgColor:o,cdnURL:o,merchantId:o,objectFit:o,link:o,borderRadius:o,src:t}),g}return i(l,a),Object.defineProperty(l.prototype,"src",{get:function(){if(this.imageId)return this.imageId.includes(c)?"".concat(this.cdnURL).concat(this.imageId):this.imageId.includes("/")?"".concat(this.cdnURL,"images/").concat(this.merchantId).concat(this.imageId,"/image_").concat(m,".jpeg"):"".concat(this.cdnURL,"images/").concat(this.merchantId,"/").concat(this.imageId,"/image_").concat(m,".jpeg")},enumerable:!1,configurable:!0}),l}(a);export{g as ImageColumnElement,r as ImageColumnPositionEnum,d as MobileImageColumnPositionEnum};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "6.1.0-beta.
|
|
3
|
+
"version": "6.1.0-beta.198",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
"build": "rm -rf build && rollup -c"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ikas/popup-renderer": "1.0.
|
|
21
|
-
"@ikas/popup-script-injector": "1.0.0-alpha.
|
|
20
|
+
"@ikas/popup-renderer": "1.0.227",
|
|
21
|
+
"@ikas/popup-script-injector": "1.0.0-alpha.18",
|
|
22
22
|
"swiper": "11.0.6"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@ikas/storefront-api": "^6.1.0-beta.
|
|
26
|
-
"@ikas/storefront-config": "^6.1.0-beta.
|
|
27
|
-
"@ikas/storefront-model-functions": "^6.1.0-beta.
|
|
28
|
-
"@ikas/storefront-models": "^6.1.0-beta.
|
|
29
|
-
"@ikas/storefront-providers": "^6.1.0-beta.
|
|
25
|
+
"@ikas/storefront-api": "^6.1.0-beta.198",
|
|
26
|
+
"@ikas/storefront-config": "^6.1.0-beta.198",
|
|
27
|
+
"@ikas/storefront-model-functions": "^6.1.0-beta.198",
|
|
28
|
+
"@ikas/storefront-models": "^6.1.0-beta.198",
|
|
29
|
+
"@ikas/storefront-providers": "^6.1.0-beta.198",
|
|
30
30
|
"@ikas/localized-address": "1.0.0-beta.6",
|
|
31
31
|
"@adyen/adyen-web": "^5.57.0",
|
|
32
32
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@ikas/localized-address": "1.0.0-beta.6",
|
|
64
|
-
"@ikas/storefront-api": "^6.1.0-beta.
|
|
65
|
-
"@ikas/storefront-config": "^6.1.0-beta.
|
|
66
|
-
"@ikas/storefront-model-functions": "^6.1.0-beta.
|
|
67
|
-
"@ikas/storefront-models": "^6.1.0-beta.
|
|
68
|
-
"@ikas/storefront-providers": "^6.1.0-beta.
|
|
64
|
+
"@ikas/storefront-api": "^6.1.0-beta.198",
|
|
65
|
+
"@ikas/storefront-config": "^6.1.0-beta.198",
|
|
66
|
+
"@ikas/storefront-model-functions": "^6.1.0-beta.198",
|
|
67
|
+
"@ikas/storefront-models": "^6.1.0-beta.198",
|
|
68
|
+
"@ikas/storefront-providers": "^6.1.0-beta.198",
|
|
69
69
|
"mobx": "^6.1.3",
|
|
70
70
|
"mobx-react-lite": "^3.1.5",
|
|
71
71
|
"next": "12.2.0",
|