@ikas/storefront 4.11.5 → 4.11.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{__assign as t}from'./../ext/tslib/tslib.es6.js';import{renderComponent as e}from"../components/page/index.js";import{IkasAttributeList as i}from"../models/ui/product-attribute-list/index.js";import{IkasBlogCategory as a}from"../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{IkasBlog as r}from"../models/data/blog/index.js";import{IkasBrand as o}from"../models/data/brand/index.js";import{IkasThemeJsonPageType as n,IkasThemeJsonComponentPropType 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{IkasCategory as u}from"../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{IkasImage as d}from"../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 l}from"../models/data/product/index.js";import{IkasRaffle as p}from"../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{IkasThemeJsonPageComponent as m}from"../models/data/theme-json/page/component/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import{IkasBlogList as c}from"../models/ui/blog-list/index.js";import{IkasBlogCategoryList as f}from"../models/ui/blog-category-list/index.js";import{IkasBrandList as g}from"../models/ui/brand-list/index.js";import{IkasCategoryList as P}from"../models/ui/category-list/index.js";import{IkasNavigationLink as V}from"../models/ui/navigation-link/index.js";import{IkasProductList as j}from"../models/ui/product-list/index.js";import{IkasAttributeDetail as L}from"../models/ui/product-attribute-detail/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{IkasComponentRenderer as v}from"../models/ui/component-renderer/index.js";import{IkasRaffleList as D}from"../models/ui/raffle-list/index.js";import{IkasPageComponentPropValue as h,getPlaceholderBrand as x,getPlaceholderCategory as C,getPlaceholderProduct as T,getPlaceholderBlog as I,getPlaceholderBlogCategory as S,getPlaceholderRaffle as w}from"@ikas/storefront-providers";import b from"lodash/flatten";import{IkasBaseStore as y}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";var _=function(){function _(){}return _.setPageSpecificData=function(e,i,o){if(this.isBrowser=o,e)switch(i){case n.PRODUCT:var s=e;_.pageSpecificData=new l(t(t({},s),{selectedVariantValues:s.selectedVariantValues||s.variants[0].variantValues})),o&&this._initProductOnBrowser(_.pageSpecificData);break;case n.CATEGORY:var d=e;_.pageSpecificData=new u(d);break;case n.BRAND:var m=e;_.pageSpecificData=new u(m);break;case n.BLOG:var c=e;_.pageSpecificData=new r(c);break;case n.BLOG_CATEGORY:var f=e;_.pageSpecificData=new a(f);break;case n.RAFFLE_DETAIL:var g=e;_.pageSpecificData=new p(g)}else this.pageSpecificData=void 0},_.isServer=function(){return"undefined"==typeof window},_.initPagePropValues=function(t,e,i,a,r){return this.flatCustomDataList=b(i.map((function(t){return t.flat}))),t.map((function(t){return _.initPageComponentPropValue(t,e,a,r)}))},_.initPageComponentPropValue=function(e,i,a,r){var o=i.find((function(t){return t.id===e.pageComponent.componentId})),n=null==o?void 0:o.props,s={};return null==n||n.map((function(t){var i=e.propValues[t.name];s[t.name]=_.initPropValue(t,i,a,r)})),new h(t(t({},e),{pageComponent:new m(t(t({},e.pageComponent),{propValues:s,componentId:o.id})),component:o,propValues:s}))},_.initPropValue=function(t,e,i,a){if(null==e)return null;switch(t.type){case s.IMAGE:return _.initImagePropValue(e);case s.IMAGE_LIST:return _.initImageListPropValue(e);case s.BRAND:return _.initBrandPropValue(e);case s.BRAND_LIST:return _.initBrandListPropValue(e);case s.CATEGORY:return _.initCategoryPropValue(e);case s.CATEGORY_LIST:return _.initCategoryListPropValue(e);case s.PRODUCT_LIST:return _.initProductListPropValue(e);case s.PRODUCT_DETAIL:return _.initProductPropValue(e);case s.PRODUCT_ATTRIBUTE:return _.initAttributePropValue(e);case s.PRODUCT_ATTRIBUTE_LIST:return _.initAttributeListPropValue(e);case s.LINK:case s.LIST_OF_LINK:return _.initLinkPropValue(e);case s.COMPONENT:return _.initComponentPropValue(e,i,a);case s.COMPONENT_LIST:return _.initComponentListPropValue(e,i,a);case s.CUSTOM:return _.initCustomDataPropValue(e,i,a);case s.BLOG:return _.initBlogPropValue(e);case s.BLOG_LIST:return _.initBlogListPropValue(e);case s.BLOG_CATEGORY:return _.initBlogCategoryPropValue(e);case s.BLOG_LIST:return _.initBlogCategoryListPropValue(e);case s.RAFFLE:return _.initRafflePropValue(e);case s.RAFFLE_LIST:return _.initRaffleListPropValue(e);case s.SLIDER:return _.initSliderPropValue(e);case s.VIDEO:return _.initVideoPropValue(e);default:return e}},_.initBrandPropValue=function(t){return t.brandPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.brand?new o(t.brand):x()},_.initBrandListPropValue=function(t){return new g(t)},_.initCategoryPropValue=function(t){return t.categoryPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.category?new u(t.category):C()},_.initCategoryListPropValue=function(t){return new P(t)},_.initProductListPropValue=function(t){return new j(t,y.getInstance().router)},_.initProductPropValue=function(e){var i=new l(T());if(e.productDetailPropValue.usePageData&&this.pageSpecificData)i=this.pageSpecificData;else if(e.productDetail){var a=e.productDetail;i=new l(t(t({},a),{selectedVariantValues:a.selectedVariantValues}))}return i},_._initProductOnBrowser=function(t){var e=new URLSearchParams(window.location.search),i=e.get("vid");if(i){var a=t.variants.find((function(t){return t.id===i}));a&&(t.selectedVariantValues=a.variantValues)}else{var r=t.variantTypes.map((function(t){return t.variantType.slug})),o=[];r.forEach((function(i,a){var r=t.variantTypes[a],n=e.get(i);if(n){var s=r.variantType.values.find((function(t){return t.slug===n}));s&&o.push(s)}})),o.length===t.selectedVariantValues.length&&(t.selectedVariantValues=o)}},_.initAttributePropValue=function(e){var i=null;if(e.attributePropValue.usePageData&&this.pageSpecificData)i=this.pageSpecificData;else if(e.productDetail){var a=e.productDetail;i=new l(t(t({},a),{selectedVariantValues:a.selectedVariantValues}))}return new L(i,e.attributePropValue)},_.initAttributeListPropValue=function(e){var a=null;if(e.attributeListPropValue.usePageData&&this.pageSpecificData)a=this.pageSpecificData;else if(e.productDetail){var r=e.productDetail;a=new l(t(t({},r),{selectedVariantValues:r.selectedVariantValues}))}return new i(a,e.attributeListPropValue)},_.initLinkPropValue=function(t){return Array.isArray(t)?t.map((function(t){return new V(t.href,t.label,t.subLinks,t.isExternal||void 0)})):t?new V(t.href,t.label,t.subLinks,t.isExternal||void 0):void 0},_.initImagePropValue=function(t){return new d(t)},_.initImageListPropValue=function(t){return t.map((function(t){return new d(t)}))},_.initCustomDataPropValue=function(t,e,i){if(t&&t.value&&t.customDataId){var a=this.flatCustomDataList.find((function(e){return e.id===t.customDataId}));if(a)return this._initCustomDataPropValue(t,a,e,i)}},_._initCustomDataPropValue=function(t,e,i,a){var r=this;if(!t)return null;var o=t.value;if(null==o)return null;switch(e.type){case s.BRAND:return this.initBrandPropValue(o);case s.BRAND_LIST:return this.initBrandListPropValue(o);case s.CATEGORY_LIST:return this.initCategoryListPropValue(o);case s.CATEGORY:return this.initCategoryPropValue(o);case s.IMAGE_LIST:return this.initImageListPropValue(o);case s.IMAGE:return this.initImagePropValue(o);case s.LINK:return this.initLinkPropValue(o);case s.PRODUCT_DETAIL:return this.initProductPropValue(o);case s.PRODUCT_LIST:return this.initProductListPropValue(o);case s.PRODUCT_ATTRIBUTE:return this.initAttributePropValue(o);case s.PRODUCT_ATTRIBUTE_LIST:return this.initAttributeListPropValue(o);case s.BLOG:return this.initBlogPropValue(o);case s.BLOG_LIST:return this.initBlogListPropValue(o);case s.BLOG_CATEGORY:return this.initBlogCategoryPropValue(o);case s.BLOG_CATEGORY_LIST:return this.initBlogCategoryListPropValue(o);case s.RAFFLE:return this.initRafflePropValue(o);case s.RAFFLE_LIST:return this.initRaffleListPropValue(o);case s.SLIDER:return this.initSliderPropValue(o);case s.VIDEO:return _.initVideoPropValue(o);case s.OBJECT:for(var n={},u=function(t){var e=o[t.key],r=void 0;t.customDataId&&(r=d.flatCustomDataList.find((function(t){return t.id===e.customDataId}))),n[t.key]=d._initCustomDataPropValue(e,r||t,i,a)},d=this,l=0,p=e.nestedData||[];l<p.length;l++){u(p[l])}return n;case s.DYNAMIC_LIST:case s.STATIC_LIST:try{if(!o||!o.length)return null;var m=[],c=e.nestedData[0];return o.forEach((function(t){var e;c.customDataId&&(e=r.flatCustomDataList.find((function(e){return e.id===t.customDataId}))),m.push(r._initCustomDataPropValue(t,e||c,i,a))})),m}catch(t){return[]}case s.COMPONENT:return this.initComponentPropValue(o,i,a);case s.COMPONENT_LIST:return this.initComponentListPropValue(o,i,a);default:return o}},_.initComponentPropValue=function(t,e,i){return this._initComponentPropValue(t,e,i)},_._initComponentPropValue=function(t,i,a){var r=t.length?t[0]:void 0;if(r){var o=new h(r),n=_.initPageComponentPropValue(o,[o.component],i,a);if(n)return new v((function(){return e(n,i,-10)}))}},_.initComponentListPropValue=function(t,e,i){return this._initComponentListPropValue(t,e,i)},_._initComponentListPropValue=function(t,i,a){return t&&t.length?t.map((function(t){var r=new h(t),o=_.initPageComponentPropValue(r,[r.component],i,a);return new v((function(){return e(o,i,-1)}))})):[]},_.initBlogPropValue=function(t){return t.blogPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.blog?new r(t.blog):I()},_.initBlogListPropValue=function(t){return new c(t)},_.initBlogCategoryPropValue=function(t){return t.blogCategoryPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.blogCategory?new a(t.blogCategory):S()},_.initBlogCategoryListPropValue=function(t){return new f(t)},_.initRafflePropValue=function(t){return t.rafflePropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.raffle?new p(t.raffle):new p(w())},_.initRaffleListPropValue=function(t){return new D(t)},_.initSliderPropValue=function(t){return t},_.initVideoPropValue=function(e){return t(t({},e),{thumbnailImage:e.thumbnailImage?new d(e.thumbnailImage):null})},_.pageSpecificData={},_.flatCustomDataList=[],_.isBrowser=!1,_}();export{_ as IkasPageDataInit};
1
+ import{__assign as t}from'./../ext/tslib/tslib.es6.js';import{renderComponent as e}from"../components/page/index.js";import{IkasAttributeList as i}from"../models/ui/product-attribute-list/index.js";import{IkasBlogCategory as a}from"../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{IkasBlog as r}from"../models/data/blog/index.js";import{IkasBrand as o}from"../models/data/brand/index.js";import{IkasThemeJsonPageType as n,IkasThemeJsonComponentPropType 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{IkasCategory as u}from"../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{IkasImage as d}from"../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 l}from"../models/data/product/index.js";import{IkasRaffle as p}from"../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{IkasThemeJsonPageComponent as m}from"../models/data/theme-json/page/component/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import{IkasBlogList as c}from"../models/ui/blog-list/index.js";import{IkasBlogCategoryList as f}from"../models/ui/blog-category-list/index.js";import{IkasBrandList as g}from"../models/ui/brand-list/index.js";import{IkasCategoryList as P}from"../models/ui/category-list/index.js";import{IkasNavigationLink as V}from"../models/ui/navigation-link/index.js";import{IkasProductList as j}from"../models/ui/product-list/index.js";import{IkasAttributeDetail as v}from"../models/ui/product-attribute-detail/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{IkasComponentRenderer as L}from"../models/ui/component-renderer/index.js";import{IkasRaffleList as D}from"../models/ui/raffle-list/index.js";import{IkasPageComponentPropValue as h,getPlaceholderBrand as x,getPlaceholderCategory as C,getPlaceholderProduct as T,getPlaceholderBlog as I,getPlaceholderBlogCategory as S,getPlaceholderRaffle as w}from"@ikas/storefront-providers";import b from"lodash/flatten";import{IkasBaseStore as y}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import{IkasProductVariantFunctions as _}from"@ikas/storefront-model-functions";var O=function(){function O(){}return O.setPageSpecificData=function(e,i,o){var s;if(this.isBrowser=o,e)switch(i){case n.PRODUCT:var d=e;O.pageSpecificData=new l(t(t({},d),{selectedVariantValues:d.selectedVariantValues||(null===(s=d.variants.find((function(t){return _.hasStock(t)})))||void 0===s?void 0:s.variantValues)||d.variants[0].variantValues})),o&&this._initProductOnBrowser(O.pageSpecificData);break;case n.CATEGORY:var m=e;O.pageSpecificData=new u(m);break;case n.BRAND:var c=e;O.pageSpecificData=new u(c);break;case n.BLOG:var f=e;O.pageSpecificData=new r(f);break;case n.BLOG_CATEGORY:var g=e;O.pageSpecificData=new a(g);break;case n.RAFFLE_DETAIL:var P=e;O.pageSpecificData=new p(P)}else this.pageSpecificData=void 0},O.isServer=function(){return"undefined"==typeof window},O.initPagePropValues=function(t,e,i,a,r){return this.flatCustomDataList=b(i.map((function(t){return t.flat}))),t.map((function(t){return O.initPageComponentPropValue(t,e,a,r)}))},O.initPageComponentPropValue=function(e,i,a,r){var o=i.find((function(t){return t.id===e.pageComponent.componentId})),n=null==o?void 0:o.props,s={};return null==n||n.map((function(t){var i=e.propValues[t.name];s[t.name]=O.initPropValue(t,i,a,r)})),new h(t(t({},e),{pageComponent:new m(t(t({},e.pageComponent),{propValues:s,componentId:o.id})),component:o,propValues:s}))},O.initPropValue=function(t,e,i,a){if(null==e)return null;switch(t.type){case s.IMAGE:return O.initImagePropValue(e);case s.IMAGE_LIST:return O.initImageListPropValue(e);case s.BRAND:return O.initBrandPropValue(e);case s.BRAND_LIST:return O.initBrandListPropValue(e);case s.CATEGORY:return O.initCategoryPropValue(e);case s.CATEGORY_LIST:return O.initCategoryListPropValue(e);case s.PRODUCT_LIST:return O.initProductListPropValue(e);case s.PRODUCT_DETAIL:return O.initProductPropValue(e);case s.PRODUCT_ATTRIBUTE:return O.initAttributePropValue(e);case s.PRODUCT_ATTRIBUTE_LIST:return O.initAttributeListPropValue(e);case s.LINK:case s.LIST_OF_LINK:return O.initLinkPropValue(e);case s.COMPONENT:return O.initComponentPropValue(e,i,a);case s.COMPONENT_LIST:return O.initComponentListPropValue(e,i,a);case s.CUSTOM:return O.initCustomDataPropValue(e,i,a);case s.BLOG:return O.initBlogPropValue(e);case s.BLOG_LIST:return O.initBlogListPropValue(e);case s.BLOG_CATEGORY:return O.initBlogCategoryPropValue(e);case s.BLOG_LIST:return O.initBlogCategoryListPropValue(e);case s.RAFFLE:return O.initRafflePropValue(e);case s.RAFFLE_LIST:return O.initRaffleListPropValue(e);case s.SLIDER:return O.initSliderPropValue(e);case s.VIDEO:return O.initVideoPropValue(e);default:return e}},O.initBrandPropValue=function(t){return t.brandPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.brand?new o(t.brand):x()},O.initBrandListPropValue=function(t){return new g(t)},O.initCategoryPropValue=function(t){return t.categoryPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.category?new u(t.category):C()},O.initCategoryListPropValue=function(t){return new P(t)},O.initProductListPropValue=function(t){return new j(t,y.getInstance().router)},O.initProductPropValue=function(e){var i=new l(T());if(e.productDetailPropValue.usePageData&&this.pageSpecificData)i=this.pageSpecificData;else if(e.productDetail){var a=e.productDetail;i=new l(t(t({},a),{selectedVariantValues:a.selectedVariantValues}))}return i},O._initProductOnBrowser=function(t){var e=new URLSearchParams(window.location.search),i=e.get("vid");if(i){var a=t.variants.find((function(t){return t.id===i}));a&&(t.selectedVariantValues=a.variantValues)}else{var r=t.variantTypes.map((function(t){return t.variantType.slug})),o=[];r.forEach((function(i,a){var r=t.variantTypes[a],n=e.get(i);if(n){var s=r.variantType.values.find((function(t){return t.slug===n}));s&&o.push(s)}})),o.length===t.selectedVariantValues.length&&(t.selectedVariantValues=o)}},O.initAttributePropValue=function(e){var i=null;if(e.attributePropValue.usePageData&&this.pageSpecificData)i=this.pageSpecificData;else if(e.productDetail){var a=e.productDetail;i=new l(t(t({},a),{selectedVariantValues:a.selectedVariantValues}))}return new v(i,e.attributePropValue)},O.initAttributeListPropValue=function(e){var a=null;if(e.attributeListPropValue.usePageData&&this.pageSpecificData)a=this.pageSpecificData;else if(e.productDetail){var r=e.productDetail;a=new l(t(t({},r),{selectedVariantValues:r.selectedVariantValues}))}return new i(a,e.attributeListPropValue)},O.initLinkPropValue=function(t){return Array.isArray(t)?t.map((function(t){return new V(t.href,t.label,t.subLinks,t.isExternal||void 0)})):t?new V(t.href,t.label,t.subLinks,t.isExternal||void 0):void 0},O.initImagePropValue=function(t){return new d(t)},O.initImageListPropValue=function(t){return t.map((function(t){return new d(t)}))},O.initCustomDataPropValue=function(t,e,i){if(t&&t.value&&t.customDataId){var a=this.flatCustomDataList.find((function(e){return e.id===t.customDataId}));if(a)return this._initCustomDataPropValue(t,a,e,i)}},O._initCustomDataPropValue=function(t,e,i,a){var r=this;if(!t)return null;var o=t.value;if(null==o)return null;switch(e.type){case s.BRAND:return this.initBrandPropValue(o);case s.BRAND_LIST:return this.initBrandListPropValue(o);case s.CATEGORY_LIST:return this.initCategoryListPropValue(o);case s.CATEGORY:return this.initCategoryPropValue(o);case s.IMAGE_LIST:return this.initImageListPropValue(o);case s.IMAGE:return this.initImagePropValue(o);case s.LINK:return this.initLinkPropValue(o);case s.PRODUCT_DETAIL:return this.initProductPropValue(o);case s.PRODUCT_LIST:return this.initProductListPropValue(o);case s.PRODUCT_ATTRIBUTE:return this.initAttributePropValue(o);case s.PRODUCT_ATTRIBUTE_LIST:return this.initAttributeListPropValue(o);case s.BLOG:return this.initBlogPropValue(o);case s.BLOG_LIST:return this.initBlogListPropValue(o);case s.BLOG_CATEGORY:return this.initBlogCategoryPropValue(o);case s.BLOG_CATEGORY_LIST:return this.initBlogCategoryListPropValue(o);case s.RAFFLE:return this.initRafflePropValue(o);case s.RAFFLE_LIST:return this.initRaffleListPropValue(o);case s.SLIDER:return this.initSliderPropValue(o);case s.VIDEO:return O.initVideoPropValue(o);case s.OBJECT:for(var n={},u=function(t){var e=o[t.key],r=void 0;t.customDataId&&(r=d.flatCustomDataList.find((function(t){return t.id===e.customDataId}))),n[t.key]=d._initCustomDataPropValue(e,r||t,i,a)},d=this,l=0,p=e.nestedData||[];l<p.length;l++){u(p[l])}return n;case s.DYNAMIC_LIST:case s.STATIC_LIST:try{if(!o||!o.length)return null;var m=[],c=e.nestedData[0];return o.forEach((function(t){var e;c.customDataId&&(e=r.flatCustomDataList.find((function(e){return e.id===t.customDataId}))),m.push(r._initCustomDataPropValue(t,e||c,i,a))})),m}catch(t){return[]}case s.COMPONENT:return this.initComponentPropValue(o,i,a);case s.COMPONENT_LIST:return this.initComponentListPropValue(o,i,a);default:return o}},O.initComponentPropValue=function(t,e,i){return this._initComponentPropValue(t,e,i)},O._initComponentPropValue=function(t,i,a){var r=t.length?t[0]:void 0;if(r){var o=new h(r),n=O.initPageComponentPropValue(o,[o.component],i,a);if(n)return new L((function(){return e(n,i,-10)}))}},O.initComponentListPropValue=function(t,e,i){return this._initComponentListPropValue(t,e,i)},O._initComponentListPropValue=function(t,i,a){return t&&t.length?t.map((function(t){var r=new h(t),o=O.initPageComponentPropValue(r,[r.component],i,a);return new L((function(){return e(o,i,-1)}))})):[]},O.initBlogPropValue=function(t){return t.blogPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.blog?new r(t.blog):I()},O.initBlogListPropValue=function(t){return new c(t)},O.initBlogCategoryPropValue=function(t){return t.blogCategoryPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.blogCategory?new a(t.blogCategory):S()},O.initBlogCategoryListPropValue=function(t){return new f(t)},O.initRafflePropValue=function(t){return t.rafflePropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.raffle?new p(t.raffle):new p(w())},O.initRaffleListPropValue=function(t){return new D(t)},O.initSliderPropValue=function(t){return t},O.initVideoPropValue=function(e){return t(t({},e),{thumbnailImage:e.thumbnailImage?new d(e.thumbnailImage):null})},O.pageSpecificData={},O.flatCustomDataList=[],O.isBrowser=!1,O}();export{O as IkasPageDataInit};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "4.11.5",
3
+ "version": "4.11.7",
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.11.5",
21
- "@ikas/storefront-config": "^4.11.5",
22
- "@ikas/storefront-model-functions": "^4.11.5",
23
- "@ikas/storefront-models": "^4.11.5",
24
- "@ikas/storefront-providers": "^4.11.5",
20
+ "@ikas/storefront-api": "^4.11.7",
21
+ "@ikas/storefront-config": "^4.11.7",
22
+ "@ikas/storefront-model-functions": "^4.11.7",
23
+ "@ikas/storefront-models": "^4.11.7",
24
+ "@ikas/storefront-providers": "^4.11.7",
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.11.5",
59
- "@ikas/storefront-config": "^4.11.5",
60
- "@ikas/storefront-model-functions": "^4.11.5",
61
- "@ikas/storefront-models": "^4.11.5",
62
- "@ikas/storefront-providers": "^4.11.5",
58
+ "@ikas/storefront-api": "^4.11.7",
59
+ "@ikas/storefront-config": "^4.11.7",
60
+ "@ikas/storefront-model-functions": "^4.11.7",
61
+ "@ikas/storefront-models": "^4.11.7",
62
+ "@ikas/storefront-providers": "^4.11.7",
63
63
  "mobx": "^6.1.3",
64
64
  "mobx-react-lite": "^3.1.5",
65
65
  "next": "12.2.0",