@ikas/storefront 6.1.0-beta.195 → 6.1.0-beta.197

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 i from"next/head.js";import{useRouter as a}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 r}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"../../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{IkasIndexPageSeoSetting as n}from"../../models/data/storefront/index-page-seo-setting/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{IkasProductList as s}from"../../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 d}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"../paypal-express-checkout/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 l}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var c=o((function(o){var s,c,g,f=o.pageType,v=o.pageTitle,h=o.pageDescription,j=o.canonicals,x=o.disableIndex,y=o.pageSpecificData,b=o.merchantSettings,T=o.addOgpMetas,C=o.productReviewSummary,D=o.pageComponentPropValues,L=a(),O="undefined"!=typeof window,k="local"===process.env.NEXT_PUBLIC_ENV,w=L.asPath.split(/[?#]/)[0].replace("/",""),P=(w="/"===w.charAt(w.length-1)?w.slice(0,-1):w).startsWith("pages/"),R=d.getCurrentRouting(),E=((null===(s=d.getMerchantSettings())||void 0===s?void 0:s.defaultLocale)||"tr")===(null==R?void 0:R.locale),I=!!y&&f===r.PRODUCT,_=!!y&&f===r.CATEGORY,S=!!y&&f===r.BRAND,V=I||_||S,A=null;(I||S||_)&&(A=y);var M=null===(c=null==A?void 0:A.translations)||void 0===c?void 0:c.find((function(e){return e.locale===(null==R?void 0:R.locale)})),N=(null==R?void 0:R.path)?"/"+R.path:"",B=k?"http://localhost:3333":"https://"+d.getDomain(),U=null===(g=d.getIndexPageSeoSettings())||void 0===g?void 0:g.find((function(e){return e.locale===d.getCurrentLocale()})),G=U?new n(U):null;t.useEffect((function(){document.documentElement.lang=d.getCurrentLocale()}),[f,y]);var F=t.useMemo((function(){if(y&&y.href)return"".concat(B).concat(y.href)}),[y]),Y=t.useMemo((function(){if(y&&y.href){var e=y.href;return N?"".concat(B).concat(N).concat(e):"".concat(B).concat(e)}}),[y]),z=t.useMemo((function(){var e,t,o,i=[];if(T){if(i.push({property:"og:type",content:"website"}),i.push({property:"og:site_name",content:(null==G?void 0:G.pageTitle)||"https://"+d.getDomain()}),v&&i.push({property:"og:title",content:v}),h&&i.push({property:"og:description",content:h}),f===r.INDEX){var a=null,n=null;!v&&(null==G?void 0:G.pageTitle)&&(a=G.pageTitle),!h&&(null==G?void 0:G.description)&&(n=G.description),(s=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===f})))&&(a=u(y,f,s.titleTemplate||""),n=u(y,f,s.descriptionTemplate||"")),a&&i.push({property:"og:title",content:a}),n&&i.push({property:"og:description",content:n})}if(f===r.PRODUCT||f===r.CATEGORY||f===r.BRAND){var s,l=null,c=null;if((s=null===(t=d.getMetaTemplates())||void 0===t?void 0:t.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===f})))&&(l=u(y,f,s.titleTemplate||""),c=u(y,f,s.descriptionTemplate||"")),!v){var p=l||V&&E&&(null==A?void 0:A.name)||V&&!E&&(null==M?void 0:M.name);p&&i.push({property:"og:title",content:p})}if(!h){var m=c||V&&!E&&(null==M?void 0:M.description);m&&i.push({property:"og:description",content:m})}}i.push({property:"og:url",content:Y||(O?window.location.href:"")||"https://".concat(d.getDomain())});var g=null;if(y&&f===r.PRODUCT){var j=y.selectedVariant.mainImage;(null==j?void 0:j.image)&&(g={property:"og:image",content:j.image.src.replace(".webp",".jpg")})}if(y&&f===r.CATEGORY){var x=y;x.image&&(g={property:"og:image",content:x.image.src.replace(".webp",".jpg")})}if(y&&f===r.BRAND){var C=y;C.image&&(g={property:"og:image",content:C.image.src.replace(".webp",".jpg")})}if(y&&f===r.BLOG_CATEGORY){var D=y;D.image&&(g={property:"og:image",content:D.image.src.replace(".webp",".jpg")})}if(y&&f===r.BLOG){var L=y;L.image&&(g={property:"og:image",content:L.image.src.replace(".webp",".jpg")})}!g&&(null==G?void 0:G.icon)&&(g={property:"og:image",content:null===(o=null==G?void 0:G.icon)||void 0===o?void 0:o.src.replace(".webp",".jpg")}),!g&&(null==b?void 0:b.logo)&&(g={property:"og:image",content:b.logo.src.replace(".webp",".jpg")}),g&&i.push(g)}return i}),[v,y,F,h,b,T,b]),H=t.useMemo((function(){var t=[],o=(null==G?void 0:G.pageTitle)||(null==b?void 0:b.merchantName)||"";if(b){var i={"@context":"https://schema.org","@type":"Website",url:"https://"+d.getDomain()},a=function(t){var o,i,a,r,n,s,l=(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:l,image:l,url:"https://"+d.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===(a=null===(i=t.address)||void 0===i?void 0:i.city)||void 0===a?void 0:a.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(r=t.address)||void 0===r?void 0:r.postalCode,addressCountry:null===(s=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===s?void 0:s.code})}}(b);t.push(i),t.push(a)}if(y&&f===r.PRODUCT){var n=y,s=function(t,o){var i,a,n,s,l,c,p;try{var m=["c7d934c7-2d44-43c3-b023-de7aa93fe435"],g=null===(i=d.getMerchantSettings())||void 0===i?void 0:i.merchantId,f=d.getCurrentRouting(),v=null==f?void 0:f.path,h=function(e){return v?"https://".concat(d.getDomain(),"/").concat(v).concat(e):"https://".concat(d.getDomain()).concat(e)},j=t.selectedVariant,x=null,y=null===(a=d.getMetaTemplates())||void 0===a?void 0:a.find((function(e){return e.locale===d.getCurrentLocale()&&r.PRODUCT}));return y&&(x=u(t,r.PRODUCT,y.descriptionTemplate||"")),e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:(null===(n=t.metaData)||void 0===n?void 0:n.description)||x,image:null===(s=j.images)||void 0===s?void 0:s.map((function(e){return e.image?e.image.src:""})),productId:j.id,sku:j.sku,mpn:(null===(l=j.barcodeList)||void 0===l?void 0:l.length)?j.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(c=t.brand)||void 0===c?void 0:c.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),m.some((function(e){return e!==g}))?{offers:{"@type":"Offer",url:h(t.href),priceCurrency:j.price.currency||"TRY",price:(null!==(p=j.campaignPrice)&&void 0!==p?p:j.price.finalPrice).toFixed(2),priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:j.stock>0||j.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}:{})}catch(e){}}(n,C||null);if(s&&t.push(s),n.categories.length)(c=p(n.categories[0],o,n))&&t.push(c)}if(y&&f===r.CATEGORY){var l=function(e){var t,o;try{var i=d.getCurrentRouting(),a=null==i?void 0:i.path,r=function(e){return a?"https://".concat(d.getDomain(),"/").concat(a).concat(e):"https://".concat(d.getDomain()).concat(e)};return{"@context":"http://schema.org","@type":"CollectionPage",url:r(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){}}(y),c=p(y,o),g=m(D);l&&t.push(l),c&&t.push(c),g&&t.push(g)}y&&f===r.BRAND&&((g=m(D))&&t.push(g));if(y&&f===r.BLOG){var v=function(t){var o;try{var i="https://".concat(d.getDomain()).concat(t.href),a=function(e){var t=new Date(e),o=t.getFullYear(),i=(t.getMonth()+1).toString().padStart(2,"0"),a=t.getDate().toString().padStart(2,"0");return"".concat(o,"-").concat(i,"-").concat(a)},r="".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:i,datePublished:a(t.createdAt),dateCreated:a(t.createdAt),dateModified:a(t.updatedAt),description:t.shortDescription,articleBody:n,author:{"@type":"Person",name:r}})}catch(e){}}(y);v&&t.push(v)}return t}),[y,b]),X=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===f}));return t?u(y,f,t.titleTemplate||""):null}),[f,y]),W=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===f}));return t?u(y,f,t.descriptionTemplate||""):null}),[f,y]),J=t.useMemo((function(){return!d.getFavicon()&&(null==G?void 0:G.favIcon)?G.favIcon:null}),[]),q=[];d.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){q.push({routing:e,hrefLang:e.locale+"-"+t})})):q.push({routing:e,hrefLang:e.locale})}));var K=function(e){var t,o,i,a,r,n=y,s=null===(o=null===(t=null==n?void 0:n.metaData)||void 0===t?void 0:t.translations)||void 0===o?void 0:o.find((function(t){return t.locale===e.locale}));if(s&&(null==s?void 0:s.slug))return s.slug;var d=q.find((function(e){return!e.routing.path}));return d&&(null===(r=null===(a=null===(i=null==n?void 0:n.metaData)||void 0===i?void 0:i.translations)||void 0===a?void 0:a.find((function(e){return e.locale===d.routing.locale})))||void 0===r?void 0:r.slug)||""},Q=l.getInstance();return t.createElement(i,null,t.createElement("title",null,v||X||(V?E?(null==A?void 0:A.name)||"":(null==M?void 0:M.name)||"":(null==G?void 0:G.pageTitle)||"")),t.createElement("meta",{name:"description",content:h||W||(V?(null==M?void 0:M.description)||"":(null==G?void 0:G.description)||"")}),q.length>1&&q.filter((function(e){return!P||e.routing.id===(null==R?void 0:R.id)})).map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(B+(e.routing.path?"/"+e.routing.path:""),"/").concat(K(e.routing))})})),!!x&&t.createElement("meta",{name:"robots",content:"noindex"}),!!T&&z.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!j&&j.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(B).concat(N).concat(e)})})),J&&t.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(J,"/image_180.webp"),type:"image/webp"}),!j&&Q.currentPageType!==r.NOT_FOUND&&t.createElement("link",{rel:"canonical",href:"".concat(B).concat(N,"/").concat(w)}),!!H.length&&H.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function p(e,t,o){try{var i=l.getInstance(),a=d.getCurrentRouting(),n=null==a?void 0:a.path,s=function(e){return n?"https://".concat(d.getDomain(),"/").concat(n).concat(e):"https://".concat(d.getDomain()).concat(e)},c=[{"@type":"ListItem",position:1,name:t,item:"https://".concat(d.getDomain())}];return(c=c.concat(e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+2,name:e.name,item:s(e.href)}})))).push({"@type":"ListItem",position:c.length+1,name:e.name,item:s(e.href)}),i.currentPageType===r.PRODUCT&&o&&c.push({"@type":"ListItem",position:c.length+1,name:o.name,item:s(o.productHref)}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:c}}catch(e){}}function m(e){try{var t=d.getCurrentRouting(),o=null==t?void 0:t.path;if(e){var i=(e.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[]).find((function(e){return Object.values(e.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}))}));if(i){var a=Object.values(i.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}));if(a)return{"@context":"http://schema.org","@type":"ItemList",itemListElement:(a.data||[]).slice(0,10).map((function(e,t){var i,a,r,n;return{"@type":"ListItem",position:t+1,item:{"@type":"Product",name:e.name,image:(null===(a=null===(i=e.selectedVariant.mainImage)||void 0===i?void 0:i.image)||void 0===a?void 0:a.src)||"",offers:{"@type":"Offer",url:(n=e.href,o?"https://".concat(d.getDomain(),"/").concat(o).concat(n):"https://".concat(d.getDomain()).concat(n)),priceCurrency:e.selectedVariant.price.currency||"TRY",price:(null!==(r=e.selectedVariant.campaignPrice)&&void 0!==r?r:e.selectedVariant.finalPrice).toFixed(2),availability:e.selectedVariant.stock>0||e.selectedVariant.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}}}))}}}}catch(e){}}function u(e,t,o){var i,a,n=o;try{switch(t){case r.PRODUCT:var s=e,d=s.name,l=(null===(i=s.brand)||void 0===i?void 0:i.name)||"",c=s.selectedVariant.sku||"",p=(null===(a=s.selectedVariant.barcodeList)||void 0===a?void 0:a.length)?s.selectedVariant.barcodeList[0]:"",m=s.selectedVariant.campaignPrice?s.selectedVariant.formattedCampaignPrice:s.selectedVariant.formattedFinalPrice;n.includes("{{name}}")&&(n=g(n,"{{name}}",d)),n.includes("{{brand}}")&&(n=g(n,"{{brand}}",l)),n.includes("{{sku}}")&&(n=g(n,"{{sku}}",c)),n.includes("{{barcode}}")&&(n=g(n,"{{barcode}}",p)),n.includes("{{price}}")&&(n=g(n,"{{price}}",m.toString()));break;case r.BRAND:case r.CATEGORY:case r.BLOG_CATEGORY:var u=e.name||"";n.includes("{{name}}")&&(n=g(n,"{{name}}",u));break;case r.BLOG:var f=e.title;n.includes("{{name}}")&&(n=g(n,"{{name}}",f))}}catch(e){}return n.trimEnd()}function g(e,t,o){var i=new RegExp(t,"g");return e.replace(i,o)}export{c 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 i from"next/head.js";import{useRouter as a}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 r}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"../../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{IkasIndexPageSeoSetting as n}from"../../models/data/storefront/index-page-seo-setting/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{IkasProductList as s}from"../../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 d}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"../paypal-express-checkout/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 l}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var c=o((function(o){var s,c,g,f=o.pageType,v=o.pageTitle,h=o.pageDescription,j=o.canonicals,x=o.disableIndex,y=o.pageSpecificData,b=o.merchantSettings,T=o.addOgpMetas,C=o.productReviewSummary,D=o.pageComponentPropValues,O=a(),L="undefined"!=typeof window,w="local"===process.env.NEXT_PUBLIC_ENV,k=O.asPath.split(/[?#]/)[0].replace("/",""),P=(k="/"===k.charAt(k.length-1)?k.slice(0,-1):k).startsWith("pages/"),R=f===r.BLOG,E=d.getCurrentRouting(),I=((null===(s=d.getMerchantSettings())||void 0===s?void 0:s.defaultLocale)||"tr")===(null==E?void 0:E.locale),S=!!y&&f===r.PRODUCT,_=!!y&&f===r.CATEGORY,V=!!y&&f===r.BRAND,A=S||_||V,M=null;(S||V||_)&&(M=y);var N=null===(c=null==M?void 0:M.translations)||void 0===c?void 0:c.find((function(e){return e.locale===(null==E?void 0:E.locale)})),B=(null==E?void 0:E.path)?"/"+E.path:"",G=w?"http://localhost:3333":"https://"+d.getDomain(),U=null===(g=d.getIndexPageSeoSettings())||void 0===g?void 0:g.find((function(e){return e.locale===d.getCurrentLocale()})),F=U?new n(U):null;t.useEffect((function(){document.documentElement.lang=d.getCurrentLocale()}),[f,y]);var Y=t.useMemo((function(){if(y&&y.href)return"".concat(G).concat(y.href)}),[y]),z=t.useMemo((function(){if(y&&y.href){var e=y.href;return B?"".concat(G).concat(B).concat(e):"".concat(G).concat(e)}}),[y]),H=t.useMemo((function(){var e,t,o,i=[];if(T){if(i.push({property:"og:type",content:"website"}),i.push({property:"og:site_name",content:(null==F?void 0:F.pageTitle)||"https://"+d.getDomain()}),v&&i.push({property:"og:title",content:v}),h&&i.push({property:"og:description",content:h}),f===r.INDEX){var a=null,n=null;!v&&(null==F?void 0:F.pageTitle)&&(a=F.pageTitle),!h&&(null==F?void 0:F.description)&&(n=F.description),(s=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===f})))&&(a=u(y,f,s.titleTemplate||""),n=u(y,f,s.descriptionTemplate||"")),a&&i.push({property:"og:title",content:a}),n&&i.push({property:"og:description",content:n})}if(f===r.PRODUCT||f===r.CATEGORY||f===r.BRAND){var s,l=null,c=null;if((s=null===(t=d.getMetaTemplates())||void 0===t?void 0:t.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===f})))&&(l=u(y,f,s.titleTemplate||""),c=u(y,f,s.descriptionTemplate||"")),!v){var p=l||A&&I&&(null==M?void 0:M.name)||A&&!I&&(null==N?void 0:N.name);p&&i.push({property:"og:title",content:p})}if(!h){var m=c||A&&!I&&(null==N?void 0:N.description);m&&i.push({property:"og:description",content:m})}}i.push({property:"og:url",content:z||(L?window.location.href:"")||"https://".concat(d.getDomain())});var g=null;if(y&&f===r.PRODUCT){var j=y.selectedVariant.mainImage;(null==j?void 0:j.image)&&(g={property:"og:image",content:j.image.src.replace(".webp",".jpg")})}if(y&&f===r.CATEGORY){var x=y;x.image&&(g={property:"og:image",content:x.image.src.replace(".webp",".jpg")})}if(y&&f===r.BRAND){var C=y;C.image&&(g={property:"og:image",content:C.image.src.replace(".webp",".jpg")})}if(y&&f===r.BLOG_CATEGORY){var D=y;D.image&&(g={property:"og:image",content:D.image.src.replace(".webp",".jpg")})}if(y&&f===r.BLOG){var O=y;O.image&&(g={property:"og:image",content:O.image.src.replace(".webp",".jpg")})}!g&&(null==F?void 0:F.icon)&&(g={property:"og:image",content:null===(o=null==F?void 0:F.icon)||void 0===o?void 0:o.src.replace(".webp",".jpg")}),!g&&(null==b?void 0:b.logo)&&(g={property:"og:image",content:b.logo.src.replace(".webp",".jpg")}),g&&i.push(g)}return i}),[v,y,Y,h,b,T,b]),X=t.useMemo((function(){var t=[],o=(null==F?void 0:F.pageTitle)||(null==b?void 0:b.merchantName)||"";if(b){var i={"@context":"https://schema.org","@type":"Website",url:"https://"+d.getDomain()},a=function(t){var o,i,a,r,n,s,l=(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:l,image:l,url:"https://"+d.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===(a=null===(i=t.address)||void 0===i?void 0:i.city)||void 0===a?void 0:a.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(r=t.address)||void 0===r?void 0:r.postalCode,addressCountry:null===(s=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===s?void 0:s.code})}}(b);t.push(i),t.push(a)}if(y&&f===r.PRODUCT){var n=y,s=function(t,o){var i,a,n,s,l,c,p;try{var m=["c7d934c7-2d44-43c3-b023-de7aa93fe435"],g=null===(i=d.getMerchantSettings())||void 0===i?void 0:i.merchantId,f=d.getCurrentRouting(),v=null==f?void 0:f.path,h=function(e){return v?"https://".concat(d.getDomain(),"/").concat(v).concat(e):"https://".concat(d.getDomain()).concat(e)},j=t.selectedVariant,x=null,y=null===(a=d.getMetaTemplates())||void 0===a?void 0:a.find((function(e){return e.locale===d.getCurrentLocale()&&r.PRODUCT}));return y&&(x=u(t,r.PRODUCT,y.descriptionTemplate||"")),e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:(null===(n=t.metaData)||void 0===n?void 0:n.description)||x,image:null===(s=j.images)||void 0===s?void 0:s.map((function(e){return e.image?e.image.src:""})),productId:j.id,sku:j.sku,mpn:(null===(l=j.barcodeList)||void 0===l?void 0:l.length)?j.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(c=t.brand)||void 0===c?void 0:c.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),m.some((function(e){return e!==g}))?{offers:{"@type":"Offer",url:h(t.href),priceCurrency:j.price.currency||"TRY",price:(null!==(p=j.campaignPrice)&&void 0!==p?p:j.price.finalPrice).toFixed(2),priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:j.stock>0||j.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}:{})}catch(e){}}(n,C||null);if(s&&t.push(s),n.categories.length)(c=p(n.categories[0],o,n))&&t.push(c)}if(y&&f===r.CATEGORY){var l=function(e){var t,o;try{var i=d.getCurrentRouting(),a=null==i?void 0:i.path,r=function(e){return a?"https://".concat(d.getDomain(),"/").concat(a).concat(e):"https://".concat(d.getDomain()).concat(e)};return{"@context":"http://schema.org","@type":"CollectionPage",url:r(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){}}(y),c=p(y,o),g=m(D);l&&t.push(l),c&&t.push(c),g&&t.push(g)}y&&f===r.BRAND&&((g=m(D))&&t.push(g));if(y&&f===r.BLOG){var v=function(t){var o;try{var i="https://".concat(d.getDomain()).concat(t.href),a="".concat(t.writer.firstName," ").concat(t.writer.lastName),r=(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:i,datePublished:new Date(t.createdAt).toISOString(),dateCreated:new Date(t.createdAt).toISOString(),dateModified:new Date(t.updatedAt).toISOString(),description:t.shortDescription,articleBody:r,author:{"@type":"Person",name:a}})}catch(e){}}(y);v&&t.push(v)}return t}),[y,b]),W=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===f}));return t?u(y,f,t.titleTemplate||""):null}),[f,y]),J=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===f}));return t?u(y,f,t.descriptionTemplate||""):null}),[f,y]),q=t.useMemo((function(){return!d.getFavicon()&&(null==F?void 0:F.favIcon)?F.favIcon:null}),[]),K=[];d.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){K.push({routing:e,hrefLang:e.locale+"-"+t})})):K.push({routing:e,hrefLang:e.locale})}));var Q=function(e){var t,o,i,a,r,n=y,s=null===(o=null===(t=null==n?void 0:n.metaData)||void 0===t?void 0:t.translations)||void 0===o?void 0:o.find((function(t){return t.locale===e.locale}));if(s&&(null==s?void 0:s.slug))return s.slug;var d=K.find((function(e){return!e.routing.path}));return d&&(null===(r=null===(a=null===(i=null==n?void 0:n.metaData)||void 0===i?void 0:i.translations)||void 0===a?void 0:a.find((function(e){return e.locale===d.routing.locale})))||void 0===r?void 0:r.slug)||""},Z=l.getInstance();return t.createElement(i,null,t.createElement("title",null,v||W||(A?I?(null==M?void 0:M.name)||"":(null==N?void 0:N.name)||"":(null==F?void 0:F.pageTitle)||"")),t.createElement("meta",{name:"description",content:h||J||(A?(null==N?void 0:N.description)||"":(null==F?void 0:F.description)||"")}),K.length>1&&!P&&!R&&K.filter((function(e){return!P||e.routing.id===(null==E?void 0:E.id)})).map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(G+(e.routing.path?"/"+e.routing.path:""),"/").concat(Q(e.routing))})})),!!x&&t.createElement("meta",{name:"robots",content:"noindex"}),!!T&&H.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!j&&j.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(G).concat(B).concat(e)})})),q&&t.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(q,"/image_180.webp"),type:"image/webp"}),!j&&Z.currentPageType!==r.NOT_FOUND&&t.createElement("link",{rel:"canonical",href:"".concat(G).concat(B,"/").concat(k)}),!!X.length&&X.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function p(e,t,o){try{var i=l.getInstance(),a=d.getCurrentRouting(),n=null==a?void 0:a.path,s=function(e){return n?"https://".concat(d.getDomain(),"/").concat(n).concat(e):"https://".concat(d.getDomain()).concat(e)},c=[{"@type":"ListItem",position:1,name:t,item:"https://".concat(d.getDomain())}];return(c=c.concat(e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+2,name:e.name,item:s(e.href)}})))).push({"@type":"ListItem",position:c.length+1,name:e.name,item:s(e.href)}),i.currentPageType===r.PRODUCT&&o&&c.push({"@type":"ListItem",position:c.length+1,name:o.name,item:s(o.productHref)}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:c}}catch(e){}}function m(e){try{var t=d.getCurrentRouting(),o=null==t?void 0:t.path;if(e){var i=(e.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[]).find((function(e){return Object.values(e.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}))}));if(i){var a=Object.values(i.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}));if(a)return{"@context":"http://schema.org","@type":"ItemList",itemListElement:(a.data||[]).slice(0,10).map((function(e,t){var i,a,r,n;return{"@type":"ListItem",position:t+1,item:{"@type":"Product",name:e.name,image:(null===(a=null===(i=e.selectedVariant.mainImage)||void 0===i?void 0:i.image)||void 0===a?void 0:a.src)||"",offers:{"@type":"Offer",url:(n=e.href,o?"https://".concat(d.getDomain(),"/").concat(o).concat(n):"https://".concat(d.getDomain()).concat(n)),priceCurrency:e.selectedVariant.price.currency||"TRY",price:(null!==(r=e.selectedVariant.campaignPrice)&&void 0!==r?r:e.selectedVariant.finalPrice).toFixed(2),availability:e.selectedVariant.stock>0||e.selectedVariant.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}}}))}}}}catch(e){}}function u(e,t,o){var i,a,n=o;try{switch(t){case r.PRODUCT:var s=e,d=s.name,l=(null===(i=s.brand)||void 0===i?void 0:i.name)||"",c=s.selectedVariant.sku||"",p=(null===(a=s.selectedVariant.barcodeList)||void 0===a?void 0:a.length)?s.selectedVariant.barcodeList[0]:"",m=s.selectedVariant.campaignPrice?s.selectedVariant.formattedCampaignPrice:s.selectedVariant.formattedFinalPrice;n.includes("{{name}}")&&(n=g(n,"{{name}}",d)),n.includes("{{brand}}")&&(n=g(n,"{{brand}}",l)),n.includes("{{sku}}")&&(n=g(n,"{{sku}}",c)),n.includes("{{barcode}}")&&(n=g(n,"{{barcode}}",p)),n.includes("{{price}}")&&(n=g(n,"{{price}}",m.toString()));break;case r.BRAND:case r.CATEGORY:case r.BLOG_CATEGORY:var u=e.name||"";n.includes("{{name}}")&&(n=g(n,"{{name}}",u));break;case r.BLOG:var f=e.title;n.includes("{{name}}")&&(n=g(n,"{{name}}",f))}}catch(e){}return n.trimEnd()}function g(e,t,o){var i=new RegExp(t,"g");return e.replace(i,o)}export{c as IkasPageHead};
@@ -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 a=n((function(n){var a=n.element,c=n.isStandaloneButtonComponent,l=n.onClose,s=n.disableButtonAction,d=e.useRef(null),u=a,m={display:"flex",alignItems:"center",justifyContent:r(u.horizontalAlignment),padding:"".concat(u.outerVerticalPadding,"px ").concat(u.outerHorizontalPadding,"px"),backgroundColor:u.bgColor},f={color:u.color,backgroundColor:u.buttonBgColor,fontSize:u.fontSize,fontWeight:u.fontWeight,fontFamily:i(u.fontFamily),textAlign:"center",border:"".concat(u.borderWidth,"px ").concat(u.borderStyle," ").concat(u.borderColor),borderRadius:u.borderRadius,padding:"".concat(u.verticalPadding,"px ").concat(u.horizontalPadding,"px")},p={width:"".concat(u.width,"%"),minWidth:"fit-content",cursor:"pointer"},b=e.useCallback((function(){if(d.current&&!s){var t=u.link||void 0;if(!c&&t)d.current.href=t||"",d.current.click();else switch(u.actionType){case o.NAVIGATE_TO_LINK_AND_CLOSE:d.current.href=t||"",null==l||l(!0),d.current.click();break;case o.NAVIGATE_TO_LINK:d.current.href=t||"",d.current.click();break;case o.CLOSE:null==l||l(!0)}}}),[d,d.current]);return e.createElement("div",{style:m},e.createElement("a",{onClick:b,style:p,target:u.openLinkInNewWindow?"_blank":"_self",ref:d},e.createElement("div",{dangerouslySetInnerHTML:{__html:u.text},style:t({},f)})))}));export{a as default};
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 i=t((function(t){var i=t.element,a=t.popup,o=t.editModeChildren,d=t.isMobile,n=i;n.cdnURL||(n.cdnURL=a.cdnURL),n.merchantId||(n.merchantId=a.merchantId);var c=a.modal.windowSettings,m={width:c.takeFullWidth||d?"100%":c.maxWidth,backgroundColor:n.bgColor,padding:"".concat(n.verticalPadding,"px ").concat(n.horizontalPadding,"px"),borderRadius:n.borderRadius};if(!n.src&&a.isPreviewMode&&o)return e.createElement("div",{style:m},o);var l={objectFit:n.objectFit===r.CONTAIN?"contain":"cover",height:"100%"};return e.createElement("a",{href:n.link||void 0,style:m,target:"_blank"},n.src&&e.createElement("img",{src:n.src||void 0,width:"100% !important",style:l}))}));export{i as default};
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,r=t.popup,n=t.editModeChildren,d=o;if(d.cdnURL||(d.cdnURL=r.cdnURL),d.merchantId||(d.merchantId=r.merchantId),!d.src&&r.isPreviewMode&&n)return n;var c={display:"flex",alignItems:"center",justifyContent:d.imagePosition===i.DISABLE_FLOAT?"center":d.imagePosition===i.FLOAT_LEFT?"flex-start":"flex-end",padding:"".concat(d.verticalPadding,"px ").concat(d.horizontalPadding,"px"),backgroundColor:d.bgColor,maxWidth:"100%"},m={borderRadius:"".concat(d.borderRadius,"px"),objectFit:d.objectFit===a.CONTAIN?"contain":"cover",width:"".concat(d.maxWidth,"%")};return e.createElement("a",{href:d.link||void 0,style:c,target:"_blank"},e.createElement("img",{src:d.src||void 0,width:100===d.maxWidth?"100% !important":void 0,style:m}))}));export{o as default};
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];e.useEffect((function(){return function(){document.body.style.overflow="auto"}}),[]);var 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;document.body.style.overflow=V&&!W?"hidden":"auto";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
+ 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 e from"react";import{observer as t}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as r}from"../../helpers/index.js";var n=t((function(t){var n=t.element,i=n.socialMediaLinks.filter((function(e){return!!e.link})).sort((function(e,t){return e.order-t.order}));if(!i.length&&t.editModeChildren&&t.popup.isPreviewMode)return t.editModeChildren;var o={display:"flex",alignItems:"center",justifyContent:r(n.horizontalAlignment),padding:"".concat(n.verticalPadding,"px ").concat(n.horizontalPadding,"px"),backgroundColor:n.bgColor,width:"100%"},a={display:"flex",alignItems:"center",gap:"".concat(n.gapBetweenLogos,"px")};return e.createElement("div",{style:o},e.createElement("div",{style:a},i.map((function(t,r){return e.createElement("a",{href:t.link||"",key:r,target:"_blank"},e.createElement("img",{src:t.iconUrlWithoutHash||"",width:24,height:24}))}))))}));export{n as default};
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 e}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 t}from"../models/modal/step/elements/base/index.js";var n=function(e){var n="";switch(e){case t.LEFT:n="flex-start";break;case t.CENTER:n="center";break;case t.RIGHT:n="flex-end"}return n},r=function(e){if(e.name){var t=e.name.replace(/ /g,"+"),n="";if(e.variants){n+=":";var r=e.variants.some((function(e){return"italic"===e}));if(r&&(n+="ital,"),n+="wght@",r){var a=new RegExp("italic","i");n+=e.variants.reduce((function(e,t){return a.test(t)?e:e+"0,".concat(t.replace("regular","400"),";")}),""),n+=e.variants.reduce((function(e,t){return a.test(t)?e+"1,".concat("italic"===t?"400":t.replace("italic",""),";"):e}),"")}else n+=e.variants.reduce((function(e,t){return e+"".concat(t.replace("regular","400"),";")}),"");n=n.substring(0,n.length-1),n+="&display=swap"}return"https://fonts.googleapis.com/css2?family=".concat(t).concat(n)}},a=function(e){var t="'".concat(e.name,'\', -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif');if(document.getElementById("ikas-popup-font-".concat(e.name)))return t;var n=r(e);if(n){var a=document.createElement("link");return a.setAttribute("id","ikas-popup-font-".concat(e.name)),a.setAttribute("rel","stylesheet"),a.setAttribute("href",n),document.getElementsByTagName("head")[0].appendChild(a),t}},i=function(e){return!(e.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(e)},s=function(t,n){return e(t,n?n.toUpperCase():"TR")},o=function(e){var t;return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)+(null!==(t=null==e?void 0:e.length)&&void 0!==t?t:0)};export{o as generateRandomId,r as getGoogleFontHref,n as getHorizontalAlignment,a as injectFontScript,i as validateEmail,s as validatePhoneNumber};
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 d}from"../../../index.js";var r,s,m,l=1080;(m=r||(r={})).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 c=function(o){function m(i){var d,m,l,c,g=this;return(g=o.call(this,i)||this).type=a.IMAGE,g.imagePosition=i.imagePosition||r.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!==(d=i.maxWidth)&&void 0!==d?d:100,g.verticalPadding=null!==(m=i.verticalPadding)&&void 0!==m?m:0,g.horizontalPadding=null!==(l=i.horizontalPadding)&&void 0!==l?l:0,g.borderRadius=null!==(c=i.borderRadius)&&void 0!==c?c: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(d)?"".concat(this.cdnURL).concat(this.imageId):this.imageId.includes("/")?"".concat(this.cdnURL,"images/").concat(this.merchantId,"/").concat(this.imageId,"/image_").concat(1080,".jpeg"):void 0},enumerable:!1,configurable:!0}),m}(o);export{l as IMAGE_SIZE,c as ImageElement,s as ImageFitEnum,r as ImagePositionEnum};
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 o,observable as e,computed as n}from"mobx";import{PopupElementTypeEnum as t,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 r}from"../../../index.js";var l,d,c;(c=l||(l={})).LEFT_ALIGN="LEFT_ALIGN",c.RIGTH_ALIGN="RIGTH_ALIGN",function(i){i.TOP="TOP",i.BOTTOM="BOTTOM",i.HIDE="HIDE"}(d||(d={}));var I=function(a){function c(i){var m,r,c,I=this;return(I=a.call(this,i)||this).type=t.IMAGE_COLUMN,I.imagePosition=i.imagePosition||l.RIGTH_ALIGN,I.mobilePosition=i.mobilePosition||d.HIDE,I.imageId=i.imageId||null,I.bgColor=i.bgColor||"",I.cdnURL=null,I.merchantId=null,I.objectFit=i.objectFit||s.COVER,I.link=i.link||null,I.verticalPadding=null!==(m=i.verticalPadding)&&void 0!==m?m:0,I.horizontalPadding=null!==(r=i.horizontalPadding)&&void 0!==r?r:0,I.borderRadius=null!==(c=i.borderRadius)&&void 0!==c?c:0,o(I,{imagePosition:e,mobilePosition:e,imageId:e,bgColor:e,cdnURL:e,merchantId:e,objectFit:e,link:e,borderRadius:e,src:n}),I}return i(c,a),Object.defineProperty(c.prototype,"src",{get:function(){if(this.imageId)return this.imageId.includes(r)?"".concat(this.cdnURL).concat(this.imageId):this.imageId.includes("/")?"".concat(this.cdnURL,"images/").concat(this.merchantId,"/").concat(this.imageId,"/image_").concat(m,".jpeg"):void 0},enumerable:!1,configurable:!0}),c}(a);export{I as ImageColumnElement,l as ImageColumnPositionEnum,d as MobileImageColumnPositionEnum};
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.195",
3
+ "version": "6.1.0-beta.197",
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.211",
21
- "@ikas/popup-script-injector": "1.0.0-alpha.14",
20
+ "@ikas/popup-renderer": "1.0.225",
21
+ "@ikas/popup-script-injector": "1.0.0-alpha.16",
22
22
  "swiper": "11.0.6"
23
23
  },
24
24
  "devDependencies": {
25
- "@ikas/storefront-api": "^6.1.0-beta.195",
26
- "@ikas/storefront-config": "^6.1.0-beta.195",
27
- "@ikas/storefront-model-functions": "^6.1.0-beta.195",
28
- "@ikas/storefront-models": "^6.1.0-beta.195",
29
- "@ikas/storefront-providers": "^6.1.0-beta.195",
25
+ "@ikas/storefront-api": "^6.1.0-beta.197",
26
+ "@ikas/storefront-config": "^6.1.0-beta.197",
27
+ "@ikas/storefront-model-functions": "^6.1.0-beta.197",
28
+ "@ikas/storefront-models": "^6.1.0-beta.197",
29
+ "@ikas/storefront-providers": "^6.1.0-beta.197",
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.195",
65
- "@ikas/storefront-config": "^6.1.0-beta.195",
66
- "@ikas/storefront-model-functions": "^6.1.0-beta.195",
67
- "@ikas/storefront-models": "^6.1.0-beta.195",
68
- "@ikas/storefront-providers": "^6.1.0-beta.195",
64
+ "@ikas/storefront-api": "^6.1.0-beta.197",
65
+ "@ikas/storefront-config": "^6.1.0-beta.197",
66
+ "@ikas/storefront-model-functions": "^6.1.0-beta.197",
67
+ "@ikas/storefront-models": "^6.1.0-beta.197",
68
+ "@ikas/storefront-providers": "^6.1.0-beta.197",
69
69
  "mobx": "^6.1.3",
70
70
  "mobx-react-lite": "^3.1.5",
71
71
  "next": "12.2.0",