@ikas/storefront 4.8.4 → 4.8.6

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 e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import a from"next/head.js";import{useRouter as r}from"next/router";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 i}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"../../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 s}from"@ikas/storefront-config";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"./index.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"../page-editor/loader/style.module.scss.js";import"../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 n}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var d=o((function(o){var n,d,l=o.pageType,p=o.pageTitle,u=o.pageDescription,g=o.canonicals,h=o.disableIndex,v=o.pageSpecificData,f=o.merchantSettings,j=o.addOgpMetas,x=o.productReviewSummary,y=r(),b="undefined"!=typeof window,k="local"===process.env.NEXT_PUBLIC_ENV,C=y.asPath.split("?")[0].replace("/","");C="/"===C.charAt(C.length-1)?C.slice(0,-1):C;var E=s.getCurrentRouting(),T=(null==E?void 0:E.path)?"/"+E.path:"",D=k?"http://localhost:3333":"https://"+s.getDomain();t.useEffect((function(){document.documentElement.lang=s.getCurrentLocale()}),[l,v]);var L=t.useMemo((function(){if(v&&v.href)return"".concat(D).concat(v.href)}),[v]),w=t.useMemo((function(){var e,t=[];if(j){if(t.push({property:"og:type",content:"website"}),t.push({property:"og:site_name",content:"https://"+s.getDomain()}),p&&t.push({property:"og:title",content:p}),u&&t.push({property:"og:description",content:u}),l===i.INDEX){var o=null,a=null,r=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===l}));r&&(o=c(v,l,r.titleTemplate||""),a=c(v,l,r.descriptionTemplate||"")),o&&t.push({property:"og:title",content:o}),a&&t.push({property:"og:description",content:a})}if(t.push({property:"og:url",content:L||(b?window.location.href:"")||"https://".concat(s.getDomain())}),v&&l===i.PRODUCT){var n=v.selectedVariant.mainImage;(null==n?void 0:n.image)&&t.push({property:"og:image",content:n.image.src})}else(null==f?void 0:f.logo)&&t.push({property:"og:image",content:f.logo.src});if(v&&l===i.CATEGORY){var d=v;d.image&&t.push({property:"og:image",content:d.image.src})}if(v&&l===i.BRAND){var m=v;m.image&&t.push({property:"og:image",content:m.image.src})}}return t}),[p,v,L,u,f,j,f]),O=t.useMemo((function(){var t=[];if(f){var o={"@context":"https://schema.org","@type":"Website",url:"https://"+s.getDomain()},a=function(t){var o,a,r,i,n,d,m=(null==t?void 0:t.logo)?t.logo.src:void 0;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:m,image:m,url:"https://"+s.getDomain(),telephone:null==t?void 0:t.phone,address:e(e({"@type":"PostalAddress",streetAddress:null===(o=t.address)||void 0===o?void 0:o.addressLine1,addressLocality:null===(r=null===(a=t.address)||void 0===a?void 0:a.city)||void 0===r?void 0:r.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(i=t.address)||void 0===i?void 0:i.postalCode,addressCountry:null===(d=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===d?void 0:d.code})}}(f);t.push(o),t.push(a)}if(v&&l===i.PRODUCT){var r=v,n=function(t,o){var a,r,i,n;try{var d="https://".concat(s.getDomain()).concat(t.href),m=t.selectedVariant;return e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:null===(a=t.metaData)||void 0===a?void 0:a.description,image:null===(r=m.images)||void 0===r?void 0:r.map((function(e){return e.image?e.image.src:""})),productId:m.id,sku:m.sku,mpn:(null===(i=m.barcodeList)||void 0===i?void 0:i.length)?m.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(n=t.brand)||void 0===n?void 0:n.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:d,priceCurrency:m.price.currency||"TRY",price:m.price.finalPrice,priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:m.stock>0?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(r,x||null);if(n&&t.push(n),r.categories.length)(c=m(r.categories[0]))&&t.push(c)}if(v&&l===i.CATEGORY){var d=function(e){var t,o;try{return{"@context":"http://schema.org","@type":"CollectionPage",url:"https://".concat(s.getDomain()).concat(e.href),name:null===(t=e.metaData)||void 0===t?void 0:t.pageTitle,description:null===(o=e.metaData)||void 0===o?void 0:o.description,image:e.image?e.image.src:void 0}}catch(e){}}(v),c=m(v);d&&t.push(d),c&&t.push(c)}if(v&&l===i.BLOG){var p=function(t){var o;try{var a="https://".concat(s.getDomain()).concat(t.href),r=function(e){var t=new Date(e),o=t.getFullYear(),a=(t.getMonth()+1).toString().padStart(2,"0"),r=t.getDate().toString().padStart(2,"0");return"".concat(o,"-").concat(a,"-").concat(r)},i="".concat(t.writer.firstName," ").concat(t.writer.lastName),n=(new DOMParser).parseFromString(t.blogContent.content,"text/html").body.textContent;return e(e({"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,image:null===(o=t.image)||void 0===o?void 0:o.src},t.category&&{genre:t.category.name}),{url:a,datePublished:r(t.createdAt),dateCreated:r(t.createdAt),dateModified:r(t.updatedAt),description:t.shortDescription,articleBody:n,author:{"@type":"Person",name:i}})}catch(e){}}(v);p&&t.push(p)}return t}),[v,f]),P=t.useMemo((function(){var e,t=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===l}));return t?c(v,l,t.titleTemplate||""):null}),[l,v]),R=t.useMemo((function(){var e,t=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===l}));return t?c(v,l,t.descriptionTemplate||""):null}),[l,v]),_=t.useCallback((function(){var e=s.getCustom();return!!e&&!!e.isEPayKolayEnabled}),[]),A=[];return s.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){A.push({routing:e,hrefLang:e.locale+"-"+t})})):A.push({routing:e,hrefLang:e.locale})})),t.createElement(a,null,t.createElement("title",null,p||P||""),t.createElement("meta",{name:"description",content:u||R||""}),l===i.CHECKOUT&&_()&&t.createElement("script",{type:"text/javascript",src:"https://cdn-epeykolay.mncdn.com/".concat((null===(n=s.getApiUrl())||void 0===n?void 0:n.includes("myikas.com"))?"epay":"epay-uat","/").concat((null===(d=s.getApiUrl())||void 0===d?void 0:d.includes("myikas.com"))?"containerServices":"containerServicesTest",".js")}),A.length>1&&A.map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(D+(e.routing.path?"/"+e.routing.path:""),"/").concat(C)})})),!!h&&t.createElement("meta",{name:"robots",content:"noindex"}),!!j&&w.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!g&&g.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(D).concat(T).concat(e)})})),t.createElement("link",{rel:"canonical",href:"".concat(D).concat(T,"/").concat(C)}),!!O.length&&O.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function m(e){try{var t=n.getInstance(),o=e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+1,name:e.name,item:"https://"+s.getDomain()+e.href}}));return t.currentPageType===i.CATEGORY&&o.push({"@type":"ListItem",position:e.categoryPathItems.length+1,name:e.name,item:"https://"+s.getDomain()+e.href}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:e.categoryPathItems.length?o:[{"@type":"ListItem",position:1,name:e.name,item:"https://"+s.getDomain()+e.href}]}}catch(e){}}function c(e,t,o){var a,r,s=o;try{switch(t){case i.PRODUCT:var n=e,d=n.name,m=(null===(a=n.brand)||void 0===a?void 0:a.name)||"",c=n.selectedVariant.sku||"",l=(null===(r=n.selectedVariant.barcodeList)||void 0===r?void 0:r.length)?n.selectedVariant.barcodeList[0]:"";s.includes("{{name}}")&&(s=s.replace("{{name}}",d)),s.includes("{{brand}}")&&(s=s.replace("{{brand}}",m)),s.includes("{{sku}}")&&(s=s.replace("{{sku}}",c)),s.includes("{{barcode}}")&&(s=s.replace("{{barcode}}",l));break;case i.BRAND:case i.CATEGORY:case i.BLOG_CATEGORY:var p=e.name||"";s.includes("{{name}}")&&(s=s.replace("{{name}}",p));break;case i.BLOG:var u=e.title;s.includes("{{name}}")&&(s=s.replace("{{name}}",u))}}catch(e){}return s.trimEnd()}export{d as IkasPageHead};
1
+ import{__assign as e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import a from"next/head.js";import{useRouter as r}from"next/router";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 i}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"../../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 n}from"@ikas/storefront-config";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"./index.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"../page-editor/loader/style.module.scss.js";import"../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 s}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var d=o((function(o){var s,d,l=o.pageType,p=o.pageTitle,u=o.pageDescription,g=o.canonicals,h=o.disableIndex,f=o.pageSpecificData,v=o.merchantSettings,j=o.addOgpMetas,x=o.productReviewSummary,y=r(),b="undefined"!=typeof window,k="local"===process.env.NEXT_PUBLIC_ENV,C=y.asPath.split("?")[0].replace("/",""),E=(C="/"===C.charAt(C.length-1)?C.slice(0,-1):C).startsWith("pages/"),L=n.getCurrentRouting(),T=(null==L?void 0:L.path)?"/"+L.path:"",D=k?"http://localhost:3333":"https://"+n.getDomain();t.useEffect((function(){document.documentElement.lang=n.getCurrentLocale()}),[l,f]);var w=t.useMemo((function(){if(f&&f.href)return"".concat(D).concat(f.href)}),[f]),O=t.useMemo((function(){var e,t=[];if(j){if(t.push({property:"og:type",content:"website"}),t.push({property:"og:site_name",content:"https://"+n.getDomain()}),p&&t.push({property:"og:title",content:p}),u&&t.push({property:"og:description",content:u}),l===i.INDEX){var o=null,a=null,r=null===(e=n.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===n.getCurrentLocale()&&e.pageType===l}));r&&(o=c(f,l,r.titleTemplate||""),a=c(f,l,r.descriptionTemplate||"")),o&&t.push({property:"og:title",content:o}),a&&t.push({property:"og:description",content:a})}if(t.push({property:"og:url",content:w||(b?window.location.href:"")||"https://".concat(n.getDomain())}),f&&l===i.PRODUCT){var s=f.selectedVariant.mainImage;(null==s?void 0:s.image)&&t.push({property:"og:image",content:s.image.src})}else(null==v?void 0:v.logo)&&t.push({property:"og:image",content:v.logo.src});if(f&&l===i.CATEGORY){var d=f;d.image&&t.push({property:"og:image",content:d.image.src})}if(f&&l===i.BRAND){var m=f;m.image&&t.push({property:"og:image",content:m.image.src})}}return t}),[p,f,w,u,v,j,v]),P=t.useMemo((function(){var t=[];if(v){var o={"@context":"https://schema.org","@type":"Website",url:"https://"+n.getDomain()},a=function(t){var o,a,r,i,s,d,m=(null==t?void 0:t.logo)?t.logo.src:void 0;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:m,image:m,url:"https://"+n.getDomain(),telephone:null==t?void 0:t.phone,address:e(e({"@type":"PostalAddress",streetAddress:null===(o=t.address)||void 0===o?void 0:o.addressLine1,addressLocality:null===(r=null===(a=t.address)||void 0===a?void 0:a.city)||void 0===r?void 0:r.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(i=t.address)||void 0===i?void 0:i.postalCode,addressCountry:null===(d=null===(s=t.address)||void 0===s?void 0:s.country)||void 0===d?void 0:d.code})}}(v);t.push(o),t.push(a)}if(f&&l===i.PRODUCT){var r=f,s=function(t,o){var a,r,i,s;try{var d="https://".concat(n.getDomain()).concat(t.href),m=t.selectedVariant;return e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:null===(a=t.metaData)||void 0===a?void 0:a.description,image:null===(r=m.images)||void 0===r?void 0:r.map((function(e){return e.image?e.image.src:""})),productId:m.id,sku:m.sku,mpn:(null===(i=m.barcodeList)||void 0===i?void 0:i.length)?m.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(s=t.brand)||void 0===s?void 0:s.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:d,priceCurrency:m.price.currency||"TRY",price:m.price.finalPrice,priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:m.stock>0?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(r,x||null);if(s&&t.push(s),r.categories.length)(c=m(r.categories[0]))&&t.push(c)}if(f&&l===i.CATEGORY){var d=function(e){var t,o;try{return{"@context":"http://schema.org","@type":"CollectionPage",url:"https://".concat(n.getDomain()).concat(e.href),name:null===(t=e.metaData)||void 0===t?void 0:t.pageTitle,description:null===(o=e.metaData)||void 0===o?void 0:o.description,image:e.image?e.image.src:void 0}}catch(e){}}(f),c=m(f);d&&t.push(d),c&&t.push(c)}if(f&&l===i.BLOG){var p=function(t){var o;try{var a="https://".concat(n.getDomain()).concat(t.href),r=function(e){var t=new Date(e),o=t.getFullYear(),a=(t.getMonth()+1).toString().padStart(2,"0"),r=t.getDate().toString().padStart(2,"0");return"".concat(o,"-").concat(a,"-").concat(r)},i="".concat(t.writer.firstName," ").concat(t.writer.lastName),s=(new DOMParser).parseFromString(t.blogContent.content,"text/html").body.textContent;return e(e({"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,image:null===(o=t.image)||void 0===o?void 0:o.src},t.category&&{genre:t.category.name}),{url:a,datePublished:r(t.createdAt),dateCreated:r(t.createdAt),dateModified:r(t.updatedAt),description:t.shortDescription,articleBody:s,author:{"@type":"Person",name:i}})}catch(e){}}(f);p&&t.push(p)}return t}),[f,v]),R=t.useMemo((function(){var e,t=null===(e=n.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===n.getCurrentLocale()&&e.pageType===l}));return t?c(f,l,t.titleTemplate||""):null}),[l,f]),_=t.useMemo((function(){var e,t=null===(e=n.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===n.getCurrentLocale()&&e.pageType===l}));return t?c(f,l,t.descriptionTemplate||""):null}),[l,f]),A=t.useCallback((function(){var e=n.getCustom();return!!e&&!!e.isEPayKolayEnabled}),[]),S=[];return n.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){S.push({routing:e,hrefLang:e.locale+"-"+t})})):S.push({routing:e,hrefLang:e.locale})})),t.createElement(a,null,t.createElement("title",null,p||R||""),t.createElement("meta",{name:"description",content:u||_||""}),l===i.CHECKOUT&&A()&&t.createElement("script",{type:"text/javascript",src:"https://cdn-epeykolay.mncdn.com/".concat((null===(s=n.getApiUrl())||void 0===s?void 0:s.includes("myikas.com"))?"epay":"epay-uat","/").concat((null===(d=n.getApiUrl())||void 0===d?void 0:d.includes("myikas.com"))?"containerServices":"containerServicesTest",".js")}),S.length>1?E?t.createElement("link",{key:S[0].routing.id+S[0].hrefLang,rel:"alternate",hrefLang:S[0].hrefLang,href:"".concat(D+(S[0].routing.path?"/"+S[0].routing.path:""),"/").concat(C)}):S.map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(D+(e.routing.path?"/"+e.routing.path:""),"/").concat(C)})})):null,!!h&&t.createElement("meta",{name:"robots",content:"noindex"}),!!j&&O.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!g&&g.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(D).concat(T).concat(e)})})),t.createElement("link",{rel:"canonical",href:"".concat(D).concat(T,"/").concat(C)}),!!P.length&&P.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function m(e){try{var t=s.getInstance(),o=e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+1,name:e.name,item:"https://"+n.getDomain()+e.href}}));return t.currentPageType===i.CATEGORY&&o.push({"@type":"ListItem",position:e.categoryPathItems.length+1,name:e.name,item:"https://"+n.getDomain()+e.href}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:e.categoryPathItems.length?o:[{"@type":"ListItem",position:1,name:e.name,item:"https://"+n.getDomain()+e.href}]}}catch(e){}}function c(e,t,o){var a,r,n=o;try{switch(t){case i.PRODUCT:var s=e,d=s.name,m=(null===(a=s.brand)||void 0===a?void 0:a.name)||"",c=s.selectedVariant.sku||"",l=(null===(r=s.selectedVariant.barcodeList)||void 0===r?void 0:r.length)?s.selectedVariant.barcodeList[0]:"";n.includes("{{name}}")&&(n=n.replace("{{name}}",d)),n.includes("{{brand}}")&&(n=n.replace("{{brand}}",m)),n.includes("{{sku}}")&&(n=n.replace("{{sku}}",c)),n.includes("{{barcode}}")&&(n=n.replace("{{barcode}}",l));break;case i.BRAND:case i.CATEGORY:case i.BLOG_CATEGORY:var p=e.name||"";n.includes("{{name}}")&&(n=n.replace("{{name}}",p));break;case i.BLOG:var u=e.title;n.includes("{{name}}")&&(n=n.replace("{{name}}",u))}}catch(e){}return n.trimEnd()}export{d as IkasPageHead};
@@ -1 +1 @@
1
- import{makeAutoObservable as t}from"mobx";import r from"lodash/groupBy";var u=function(){function u(r,u){this.product=null,this.product=r,this.attributeListPropValue=u,t(this)}return Object.defineProperty(u.prototype,"values",{get:function(){var t,u=this;if(!this.product)return[];var i=this.product.hasVariant?this.product.selectedVariant.attributes:[];this.product.attributes.forEach((function(t){i.some((function(r){return r.productAttributeId===t.productAttributeId}))||i.push(t)}));var e=this.product.hasVariant?r(i.filter((function(t){var r;return null===(r=u.attributeListPropValue.attributeIds)||void 0===r?void 0:r.includes(t.productAttributeId||"")})),"productAttributeId"):r(this.product.attributes.filter((function(t){var r;return null===(r=u.attributeListPropValue.attributeIds)||void 0===r?void 0:r.includes(t.productAttributeId||"")})),"productAttributeId");return(null===(t=this.attributeListPropValue.attributeIds)||void 0===t?void 0:t.map((function(t){var r=e[t];if((null==r?void 0:r.length)&&r[0].productAttribute)return{attribute:r[0].productAttribute,values:r}})).filter((function(t){return!!t})))||[]},enumerable:!1,configurable:!0}),u}();export{u as IkasAttributeList};
1
+ import{makeAutoObservable as t}from"mobx";import r from"lodash/groupBy";var u=function(){function u(r,u){this.product=null,this.product=r,this.attributeListPropValue=u,t(this)}return Object.defineProperty(u.prototype,"values",{get:function(){var t,u=this;if(!this.product)return[];var i=this.product.hasVariant?this.product.selectedVariant.attributes:[];this.product.attributes.forEach((function(t){var r;i.some((function(r){return r.productAttributeId===t.productAttributeId}))||i.push.apply(i,(null===(r=u.product)||void 0===r?void 0:r.attributes.filter((function(r){return r.productAttributeId===t.productAttributeId})))||[])}));var e=this.product.hasVariant?r(i.filter((function(t){var r;return null===(r=u.attributeListPropValue.attributeIds)||void 0===r?void 0:r.includes(t.productAttributeId||"")})),"productAttributeId"):r(this.product.attributes.filter((function(t){var r;return null===(r=u.attributeListPropValue.attributeIds)||void 0===r?void 0:r.includes(t.productAttributeId||"")})),"productAttributeId");return(null===(t=this.attributeListPropValue.attributeIds)||void 0===t?void 0:t.map((function(t){var r=e[t];if((null==r?void 0:r.length)&&r[0].productAttribute)return{attribute:r[0].productAttribute,values:r}})).filter((function(t){return!!t})))||[]},enumerable:!1,configurable:!0}),u}();export{u as IkasAttributeList};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "4.8.4",
3
+ "version": "4.8.6",
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.8.4",
21
- "@ikas/storefront-config": "^4.8.4",
22
- "@ikas/storefront-model-functions": "^4.8.4",
23
- "@ikas/storefront-models": "^4.8.4",
24
- "@ikas/storefront-providers": "^4.8.4",
20
+ "@ikas/storefront-api": "^4.8.6",
21
+ "@ikas/storefront-config": "^4.8.6",
22
+ "@ikas/storefront-model-functions": "^4.8.6",
23
+ "@ikas/storefront-models": "^4.8.6",
24
+ "@ikas/storefront-providers": "^4.8.6",
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.8.4",
59
- "@ikas/storefront-config": "^4.8.4",
60
- "@ikas/storefront-model-functions": "^4.8.4",
61
- "@ikas/storefront-models": "^4.8.4",
62
- "@ikas/storefront-providers": "^4.8.4",
58
+ "@ikas/storefront-api": "^4.8.6",
59
+ "@ikas/storefront-config": "^4.8.6",
60
+ "@ikas/storefront-model-functions": "^4.8.6",
61
+ "@ikas/storefront-models": "^4.8.6",
62
+ "@ikas/storefront-providers": "^4.8.6",
63
63
  "mobx": "^6.1.3",
64
64
  "mobx-react-lite": "^3.1.5",
65
65
  "next": "12.2.0",