@ikas/storefront 5.0.13 → 5.0.14

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.
Files changed (93) hide show
  1. package/build/analytics/analytics.d.ts +2 -1
  2. package/build/analytics/analytics.js +1 -1
  3. package/build/analytics/events.d.ts +2 -1
  4. package/build/analytics/events.js +1 -1
  5. package/build/analytics/googleAnalytics.js +1 -1
  6. package/build/analytics/googleTagManager.js +1 -1
  7. package/build/analytics/ikas.d.ts +3 -1
  8. package/build/analytics/ikas.js +1 -1
  9. package/build/components/checkout/components/address-form/model.js +1 -1
  10. package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
  11. package/build/components/checkout/components/customer-addresses/model.js +1 -1
  12. package/build/components/checkout/components/offer-product/index.js +1 -1
  13. package/build/components/checkout/components/quick-registration/model.js +1 -1
  14. package/build/components/checkout/index.js +1 -1
  15. package/build/components/checkout/model.d.ts +1 -0
  16. package/build/components/checkout/model.js +1 -1
  17. package/build/components/checkout/steps/step-payment/billing-address/index.js +1 -1
  18. package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
  19. package/build/components/checkout/steps/step-success/index.js +1 -1
  20. package/build/components/page/head.js +1 -1
  21. package/build/components/page/index.js +1 -1
  22. package/build/components/page-editor/ThemeComponentEditor.js +1 -1
  23. package/build/components/page-editor/model.js +1 -1
  24. package/build/components/popup/index.js +1 -1
  25. package/build/components/popup/renderer/index.d.ts +0 -3
  26. package/build/components/popup/renderer/index.js +1 -1
  27. package/build/components/popup/renderer/model.js +1 -1
  28. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/divider-element-renderer/index.js +1 -1
  29. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/index.js +1 -1
  30. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/input-item-view/index.js +1 -1
  31. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-element-renderer/index.js +1 -1
  32. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/product-list-renderer/index.js +1 -1
  33. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/text-element-renderer/index.js +1 -1
  34. package/build/ext/@ikas/popup-renderer/build/popup-renderer/helpers/index.js +1 -1
  35. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/background-settings/index.js +1 -1
  36. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/close-settings/index.js +1 -1
  37. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/index.js +1 -1
  38. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js +1 -1
  39. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/divider/index.js +1 -1
  40. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-email/index.js +1 -1
  41. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-phone/index.js +1 -1
  42. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js +1 -1
  43. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js +1 -1
  44. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js +1 -1
  45. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/detail-settings/index.js +1 -1
  46. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js +1 -1
  47. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/social/index.js +1 -1
  48. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/text/index.js +1 -1
  49. package/build/hooks/useCustomerReviews.js +1 -1
  50. package/build/hooks/useStore.js +1 -1
  51. package/build/index.js +1 -1
  52. package/build/models/data/checkout-settings/index.d.ts +2 -1
  53. package/build/models/data/checkout-settings/index.js +1 -1
  54. package/build/models/data/index.d.ts +7 -0
  55. package/build/models/data/product/campaign/data/index.d.ts +2 -0
  56. package/build/models/data/product/campaign/data/index.js +1 -1
  57. package/build/models/data/product/campaign/product-tiered-discount/index.d.ts +20 -0
  58. package/build/models/data/product/campaign/product-tiered-discount/index.js +1 -0
  59. package/build/models/data/product/index.d.ts +36 -1
  60. package/build/models/data/product/index.js +1 -1
  61. package/build/models/data/storefront-popup/index.d.ts +1 -1
  62. package/build/models/data/storefront-popup/index.js +1 -1
  63. package/build/models/ui/blog-category-list/index.js +1 -1
  64. package/build/models/ui/brand-list/index.js +1 -1
  65. package/build/models/ui/category-list/index.js +1 -1
  66. package/build/models/ui/customer-review-list/index.d.ts +1 -1
  67. package/build/models/ui/customer-review-list/index.js +1 -1
  68. package/build/models/ui/customer-review-summary-list/index.js +1 -1
  69. package/build/models/ui/product-list/index.js +1 -1
  70. package/build/models/ui/raffle-list/index.js +1 -1
  71. package/build/models/ui/validator/form/account-info.js +1 -1
  72. package/build/models/ui/validator/form/address.js +1 -1
  73. package/build/models/ui/validator/form/ikas-address.js +1 -1
  74. package/build/models/ui/validator/form/register.js +1 -1
  75. package/build/page-data-init/index.js +1 -1
  76. package/build/pages/checkout.js +1 -1
  77. package/build/pages/pages/_slug_.js +1 -1
  78. package/build/store/blog/index.js +1 -1
  79. package/build/store/brand/index.js +1 -1
  80. package/build/store/cart/index.js +1 -1
  81. package/build/store/category/index.js +1 -1
  82. package/build/store/checkout/index.js +1 -1
  83. package/build/store/customer/api.js +1 -1
  84. package/build/store/customer/index.js +1 -1
  85. package/build/store/html-meta-data/index.js +1 -1
  86. package/build/store/location/index.js +1 -1
  87. package/build/store/product/index.js +1 -1
  88. package/package.json +12 -12
  89. package/build/ext/swiper/modules/navigation.css.js +0 -1
  90. package/build/ext/swiper/modules/pagination.css.js +0 -1
  91. package/build/ext/swiper/swiper.css.js +0 -1
  92. /package/build/models/data/storefront-popup/{storefront-popup-date-f/304/261lter/index.d.ts" → storefront-popup-date-filter/index.d.ts} +0 -0
  93. /package/build/models/data/storefront-popup/{storefront-popup-date-f/304/261lter/index.js" → storefront-popup-date-filter/index.js} +0 -0
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";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{IkasPaymentMethodType as a,IkasPaymentGatewayType as n,IkasPaymentGatewayTransactionFeeType as o,IkasPaymentGatewayAdditionalPriceType 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/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/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{CreditCardForm as m}from"../../../components/credit-card-form/index.js";import{Installments as d}from"./installments/index.js";import i from"../../../components/select-box/index.js";import l from"./style.module.scss.js";import"@ikas/storefront-config";import{formatCurrency as s}from"../../../../../utils/currency.js";import{useTranslation as c}from"../../../../../utils/i18n.js";import p from"../../../components/svg/external.js";import y from"next/dynamic";import u from"../../../components/credit-card-form/model.js";import x from"../../../components/master-pass/credit-card-form/index.js";import{Toggle as v}from"../../../components/toggle/index.js";import f from"../../../components/select-box/style.module.scss.js";import E from"../../../components/master-pass/payment-gateway/svg/master-card.js";import j from"../../../components/master-pass/payment-gateway/svg/troy.js";import g from"../../../components/master-pass/payment-gateway/svg/visa.js";var P=y((function(){return import("../../../components/stripe/index.js").then((function(e){return e.default}))})),w=y((function(){return import("../../../components/adyen/index.js").then((function(e){return e.Adyen}))})),C=y((function(){return import("../../../components/klarna/index.js").then((function(e){return e.Klarna}))})),h=t((function(t){var y=t.vm,h=c().t,k=function(t){return e.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",flexWrap:"wrap"}},t.children)},G=function(t){return e.createElement("div",{className:l.AdditionalPrice},t.children)},I=function(e){return 0===e.amount?"":"".concat(e.amountType===o.AMOUNT?s(e.amount,y.checkout.currencyCode,y.checkout.currencySymbol):" %"+e.amount).concat(e.type===r.DECREMENT?" "+h("checkout-page:paymentMethodDiscount"):" "+h("checkout-page:paymentMethodAdditionalPrice"))},N=function(e){return"STRIPE"===e.code},M=function(){var t,a=y.selectedPaymentGatewayIndex===y.klarnaPaymentGatewayIndex;return y.klarnaPaymentGateway?e.createElement("div",{className:f.SelectBoxContainer},e.createElement("div",{className:"".concat(f.SelectBox," ").concat(a?f.Selected:""),onClick:function(){y.setPaymentGateway(y.klarnaPaymentGatewayIndex),y.mpVM.selectedCard=void 0}},e.createElement("div",{className:f.TopContent},e.createElement(v,{value:a,label:y.klarnaPaymentGateway.name,removePadding:!0}),e.createElement("div",{className:f.RightContent},(null===(t=y.klarnaPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(G,null,I(y.klarnaPaymentGateway.additionalPrices[0])):e.createElement(k,null,!!y.klarnaPaymentGateway.logoUrl&&e.createElement("div",{className:l.PaymentLogoContainer},e.createElement("img",{src:y.klarnaPaymentGateway.logoUrl}))))),e.createElement("div",{className:"".concat(a?f.BottomContent:""," ").concat(a?"":l.Hidden)},e.createElement(C,{vm:y}),y.klarnaError&&e.createElement("div",{className:l.ErrorMessage},y.klarnaError.data)))):null},b=function(){var t=y.selectedPaymentGatewayIndex===y.adyenPaymentGatewayIndex;return y.adyenPaymentGateway?e.createElement("div",{className:f.SelectBoxContainer},e.createElement("div",{className:"".concat(f.SelectBox," ").concat(f.AdyenSelectBox),onClick:function(){y.setPaymentGateway(y.adyenPaymentGatewayIndex),y.mpVM.selectedCard=void 0}},e.createElement("div",{className:f.TopContent}),e.createElement("div",{className:"".concat(t?f.BottomContent:""," ")},e.createElement(w,{vm:y,isSelected:t})))):null},T=function(){var t,a=y.selectedPaymentGatewayIndex===y.payPalPaymentGatewayIndex;return y.payPalPaymentGateway?e.createElement("div",{className:f.SelectBoxContainer},e.createElement("div",{className:"".concat(f.SelectBox," ").concat(a?f.Selected:""),onClick:function(){y.setPaymentGateway(y.payPalPaymentGatewayIndex),y.mpVM.selectedCard=void 0}},e.createElement("div",{className:f.TopContent},e.createElement(v,{value:a,label:y.payPalPaymentGateway.name,removePadding:!0}),e.createElement("div",{className:f.RightContent},(null===(t=y.payPalPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(G,null,I(y.payPalPaymentGateway.additionalPrices[0])):e.createElement(k,null,!!y.payPalPaymentGateway.logoUrl&&e.createElement("div",{className:l.PaymentLogoContainer},e.createElement("img",{src:y.payPalPaymentGateway.logoUrl}))))))):null};return e.createElement(e.Fragment,null,!!y.mpVM.cards.length&&y.mpVM.cards.map((function(t,o){var r,m=y.paymentGateways.find((function(e){return e.id===t.paymentGatewayId})),s=e.createElement("button",{className:l.MasterPassSelectBoxDeleteButton,onClick:function(e){e.stopPropagation(),y.mpVM.deleteCard({store:y.store,checkout:y.checkout,card:t})}},h("checkout-page:masterPass.paymentGatewaySelectBox.delete")),c=function(e){return t.Value1.startsWith(e)},p=c("4"),x=c("5")||c("6"),v=c("9"),f=e.createElement("div",{style:{display:"flex",alignItems:"center"}},e.createElement("span",{className:l.MasterPassSelectBoxLabelLogo},p&&e.createElement(g,null),x&&e.createElement(E,null),v&&e.createElement(j,null)),t.Name," ",t.Value1),P=(null==m?void 0:m.id)&&m.paymentMethodType===a.CREDIT_CARD&&m.type===n.INTERNAL?y.installmentInfo&&e.createElement(d,{vm:y}):void 0;return e.createElement(i,{key:o,isSelected:(null===(r=y.mpVM.selectedCard)||void 0===r?void 0:r.UniqueId)===t.UniqueId,label:f,rightContent:s,bottomContent:P,onClick:function(){var e;(null===(e=y.mpVM.selectedCard)||void 0===e?void 0:e.UniqueId)!==t.UniqueId&&(y.checkout.selectedPaymentGateway=null,y.cardData=new u,y.installmentInfo=void 0,y.mpVM.selectedCard=t,t.Value1&&t.paymentGatewayId&&y.checkout.totalFinalPrice&&y.retrieveInstallmentInfo({input:{orderId:y.checkout.id,binNumber:t.Value1.slice(0,6),paymentGatewayId:t.paymentGatewayId,price:y.checkout.totalFinalPrice,currencyCode:y.checkout.currencyCode}}))}})})),y.paymentGateways.filter((function(e){return"in-store"!==y.deliveryMethod&&!y.isDigitalOnly||e.paymentMethodType!==a.CASH_ON_DELIVERY&&e.paymentMethodType!==a.CREDIT_CARD_ON_DELIVERY})).map((function(t,o){var r;if(function(e){return"KLARNA"===e.code}(t)&&y.klarnaPaymentGateway)return M();if(function(e){return"ADYEN_PLATFORM"===e.code}(t)&&y.adyenPaymentGateway)return b();if(function(e){return"PAYPAL"===e.code}(t)&&y.payPalPaymentGateway)return T();var s=t.paymentMethodType===a.CREDIT_CARD&&t.type===n.INTERNAL?e.createElement(e.Fragment,null,N(t)?e.createElement(e.Fragment,null,e.createElement(P,{vm:y,pg:t}),y.stripeError&&e.createElement("div",{className:l.ErrorMessage},y.stripeError.data)):e.createElement("div",null,e.createElement(m,{vm:y}),y.isPaymentGatewayHasMasterPass&&e.createElement(x,{vm:y}),y.installmentInfo&&e.createElement(d,{vm:y}))):t.description?e.createElement(e.Fragment,null,t.type===n.EXTERNAL&&e.createElement("div",{style:{height:"52px",display:"flex",justifyContent:"center",margin:"24px 0"}},e.createElement(p,null)),e.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}})):void 0;return e.createElement(i,{key:t.id,label:t.paymentMethodType===a.CREDIT_CARD&&t.type===n.INTERNAL?N(t)?" ":h("checkout-page:creditCard"):t.name,isSelected:y.selectedPaymentGatewayIndex===o,rightContent:(null===(r=t.additionalPrices)||void 0===r?void 0:r.length)?e.createElement(G,null,I(t.additionalPrices[0])):e.createElement(k,null,!!t.logoUrl&&e.createElement("div",{className:l.PaymentLogoContainer},e.createElement("img",{src:t.logoUrl}))),bottomContent:s,onClick:function(){y.selectedPaymentGatewayIndex!==o&&(y.setPaymentGateway(o),y.mpVM.selectedCard=void 0)}})})))}));export{h as PaymentGateways};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";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{IkasPaymentMethodType as a,IkasPaymentGatewayType as n,IkasPaymentGatewayTransactionFeeType as o,IkasPaymentGatewayAdditionalPriceType 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/package/index.js";import"../../../../../models/data/order/transaction/index.js";import"../../../../../models/data/order/index.js";import"../../../../../models/data/payment-gateway/index.js";import"../../../../../models/data/product/attribute-value/index.js";import"../../../../../models/data/product/filter/index.js";import"../../../../../models/data/product/campaign-offer/index.js";import"../../../../../models/data/product/option-set/option/index.js";import"../../../../../models/data/product/option-set/index.js";import"../../../../../models/data/product/stock-location/index.js";import"../../../../../models/data/product/variant/price/index.js";import"../../../../../models/data/product/variant/index.js";import"../../../../../models/data/variant-type/index.js";import"../../../../../models/data/product/index.js";import"../../../../../models/data/raffle/index.js";import"../../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../../models/data/state/index.js";import"../../../../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../../../models/data/storefront-popup/index.js";import"../../../../../models/data/theme-json/index.js";import"../../../../../models/data/theme-json/component/index.js";import"../../../../../models/data/theme-json/custom-data/index.js";import"../../../../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import{CreditCardForm as d}from"../../../components/credit-card-form/index.js";import{Installments as m}from"./installments/index.js";import i from"../../../components/select-box/index.js";import s from"./style.module.scss.js";import"@ikas/storefront-config";import{formatCurrency as l}from"../../../../../utils/currency.js";import{useTranslation as c}from"../../../../../utils/i18n.js";import p from"../../../components/svg/external.js";import u from"next/dynamic";import y from"../../../components/credit-card-form/model.js";import x from"../../../components/master-pass/credit-card-form/index.js";import{Toggle as f}from"../../../components/toggle/index.js";import v from"../../../components/select-box/style.module.scss.js";import j from"../../../components/master-pass/payment-gateway/svg/master-card.js";import E from"../../../components/master-pass/payment-gateway/svg/troy.js";import g from"../../../components/master-pass/payment-gateway/svg/visa.js";var P=u((function(){return import("../../../components/stripe/index.js").then((function(e){return e.default}))})),w=u((function(){return import("../../../components/adyen/index.js").then((function(e){return e.Adyen}))})),C=u((function(){return import("../../../components/klarna/index.js").then((function(e){return e.Klarna}))})),h=t((function(t){var u=t.vm,h=c().t,k=function(t){return e.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",flexWrap:"wrap"}},t.children)},G=function(t){return e.createElement("div",{className:s.AdditionalPrice},t.children)},I=function(e){return 0===e.amount?"":"".concat(e.amountType===o.AMOUNT?l(e.amount,u.checkout.currencyCode,u.checkout.currencySymbol):" %"+e.amount).concat(e.type===r.DECREMENT?" "+h("checkout-page:paymentMethodDiscount"):" "+h("checkout-page:paymentMethodAdditionalPrice"))},N=function(e){return"STRIPE"===e.code},M=function(){var t,a=u.selectedPaymentGatewayIndex===u.klarnaPaymentGatewayIndex;return u.klarnaPaymentGateway?e.createElement("div",{className:v.SelectBoxContainer},e.createElement("div",{className:"".concat(v.SelectBox," ").concat(a?v.Selected:""),onClick:function(){u.setPaymentGateway(u.klarnaPaymentGatewayIndex),u.mpVM.selectedCard=void 0}},e.createElement("div",{className:v.TopContent},e.createElement(f,{value:a,label:u.klarnaPaymentGateway.name,removePadding:!0}),e.createElement("div",{className:v.RightContent},(null===(t=u.klarnaPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(G,null,I(u.klarnaPaymentGateway.additionalPrices[0])):e.createElement(k,null,!!u.klarnaPaymentGateway.logoUrl&&e.createElement("div",{className:s.PaymentLogoContainer},e.createElement("img",{src:u.klarnaPaymentGateway.logoUrl}))))),e.createElement("div",{className:"".concat(a?v.BottomContent:""," ").concat(a?"":s.Hidden)},e.createElement(C,{vm:u}),u.klarnaError&&e.createElement("div",{className:s.ErrorMessage},u.klarnaError.data)))):null},b=function(){var t=u.selectedPaymentGatewayIndex===u.adyenPaymentGatewayIndex;return u.adyenPaymentGateway?e.createElement("div",{className:v.SelectBoxContainer},e.createElement("div",{className:"".concat(v.SelectBox," ").concat(v.AdyenSelectBox),onClick:function(){u.setPaymentGateway(u.adyenPaymentGatewayIndex),u.mpVM.selectedCard=void 0}},e.createElement("div",{className:v.TopContent}),e.createElement("div",{className:"".concat(t?v.BottomContent:""," ")},e.createElement(w,{vm:u,isSelected:t})))):null},T=function(){var t,a=u.selectedPaymentGatewayIndex===u.payPalPaymentGatewayIndex;return u.payPalPaymentGateway?e.createElement("div",{className:v.SelectBoxContainer},e.createElement("div",{className:"".concat(v.SelectBox," ").concat(a?v.Selected:""),onClick:function(){u.setPaymentGateway(u.payPalPaymentGatewayIndex),u.mpVM.selectedCard=void 0}},e.createElement("div",{className:v.TopContent},e.createElement(f,{value:a,label:u.payPalPaymentGateway.name,removePadding:!0}),e.createElement("div",{className:v.RightContent},(null===(t=u.payPalPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(G,null,I(u.payPalPaymentGateway.additionalPrices[0])):e.createElement(k,null,!!u.payPalPaymentGateway.logoUrl&&e.createElement("div",{className:s.PaymentLogoContainer},e.createElement("img",{src:u.payPalPaymentGateway.logoUrl}))))))):null};return e.createElement(e.Fragment,null,!!u.mpVM.cards.length&&u.mpVM.cards.map((function(t,o){var r,d=u.paymentGateways.find((function(e){return e.id===t.paymentGatewayId})),l=e.createElement("button",{className:s.MasterPassSelectBoxDeleteButton,onClick:function(e){e.stopPropagation(),u.mpVM.deleteCard({store:u.store,checkout:u.checkout,card:t})}},h("checkout-page:masterPass.paymentGatewaySelectBox.delete")),c=function(e){return t.Value1.startsWith(e)},p=c("4"),x=c("5")||c("6"),f=c("9"),v=e.createElement("div",{style:{display:"flex",alignItems:"center"}},e.createElement("span",{className:s.MasterPassSelectBoxLabelLogo},p&&e.createElement(g,null),x&&e.createElement(j,null),f&&e.createElement(E,null)),t.Name," ",t.Value1),P=(null==d?void 0:d.id)&&d.paymentMethodType===a.CREDIT_CARD&&d.type===n.INTERNAL?u.installmentInfo&&e.createElement(m,{vm:u}):void 0;return e.createElement(i,{key:o,isSelected:(null===(r=u.mpVM.selectedCard)||void 0===r?void 0:r.UniqueId)===t.UniqueId,label:v,rightContent:l,bottomContent:P,onClick:function(){var e;(null===(e=u.mpVM.selectedCard)||void 0===e?void 0:e.UniqueId)!==t.UniqueId&&(u.checkout.selectedPaymentGateway=null,u.cardData=new y,u.installmentInfo=void 0,u.mpVM.selectedCard=t,t.Value1&&t.paymentGatewayId&&u.checkout.totalFinalPrice&&u.retrieveInstallmentInfo({input:{orderId:u.checkout.id,binNumber:t.Value1.slice(0,6),paymentGatewayId:t.paymentGatewayId,price:u.checkout.totalFinalPrice,currencyCode:u.checkout.currencyCode}}))}})})),u.paymentGateways.filter((function(e){return"in-store"!==u.deliveryMethod&&!u.isDigitalOnly||e.paymentMethodType!==a.CASH_ON_DELIVERY&&e.paymentMethodType!==a.CREDIT_CARD_ON_DELIVERY})).map((function(t,o){var r;if(function(e){return"KLARNA"===e.code}(t)&&u.klarnaPaymentGateway)return M();if(function(e){return"ADYEN_PLATFORM"===e.code}(t)&&u.adyenPaymentGateway)return b();if(function(e){return"PAYPAL"===e.code}(t)&&u.payPalPaymentGateway)return T();var l=t.paymentMethodType===a.CREDIT_CARD&&t.type===n.INTERNAL?e.createElement(e.Fragment,null,N(t)?e.createElement(e.Fragment,null,e.createElement(P,{vm:u,pg:t}),u.stripeError&&e.createElement("div",{className:s.ErrorMessage},u.stripeError.data)):e.createElement("div",null,e.createElement(d,{vm:u}),u.isPaymentGatewayHasMasterPass&&e.createElement(x,{vm:u}),u.installmentInfo&&e.createElement(m,{vm:u}))):t.description?e.createElement(e.Fragment,null,t.type===n.EXTERNAL&&e.createElement("div",{style:{height:"52px",display:"flex",justifyContent:"center",margin:"24px 0"}},e.createElement(p,null)),e.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}})):void 0;return e.createElement(i,{key:t.id,label:t.paymentMethodType===a.CREDIT_CARD&&t.type===n.INTERNAL?N(t)?" ":h("checkout-page:creditCard"):t.name,isSelected:u.selectedPaymentGatewayIndex===o,rightContent:(null===(r=t.additionalPrices)||void 0===r?void 0:r.length)?e.createElement(G,null,I(t.additionalPrices[0])):e.createElement(k,null,!!t.logoUrl&&e.createElement("div",{className:s.PaymentLogoContainer},e.createElement("img",{src:t.logoUrl}))),bottomContent:l,onClick:function(){u.selectedPaymentGatewayIndex!==o&&(u.setPaymentGateway(o),u.mpVM.selectedCard=void 0)}})})))}));export{h as PaymentGateways};
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";import{Button as a}from"../../components/button/index.js";import{CART_LS_KEY as o}from"../../../../store/cart/index.js";import s from"./style.module.scss.js";import r from"../../components/svg/success-circle.js";import i from"../../components/expandable-section/index.js";import n from"../../components/credit-card-form/svg/amex.js";import c from"../../components/credit-card-form/svg/master-card.js";import d from"../../components/credit-card-form/svg/troy.js";import l from"../../components/credit-card-form/svg/visa.js";import"@ikas/storefront-config";import{formatCurrency as m}from"../../../../utils/currency.js";import{useTranslation as u}from"../../../../utils/i18n.js";import"../../../../models/data/blog/category/index.js";import"../../../../models/data/blog/content/index.js";import"../../../../models/data/blog/meta-data/index.js";import"../../../../models/data/blog/tag/index.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import{IkasPaymentMethodType as p,IkasPaymentGatewayType as v,IkasOrderPackageStatus as E,IkasTransactionCardAssociation as f}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/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/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 g from"../../components/offer-product/index.js";import{Analytics as h}from"../../../../analytics/analytics.js";import"../../../../analytics/head/index.js";import{QuickRegistration as x}from"../../components/quick-registration/index.js";import{ProductFiles as k}from"../../components/product-files/index.js";import j from"../../components/offer-product/offer-arrows/index.js";import y from"../../components/offer-product/offer-dots/index.js";import T from"../../components/svg/shopping-bag.js";import{CartSummary as I}from"../../components/cart-summary/index.js";import N from"../../components/offer-product/useCampaignOffer.js";var A=t((function(t){var E,A,L,P,C,D,S,R,O,_,b,M=t.vm,w=u().t,F=N(M,!0),Y=F.setActiveIndex,U=F.setIsActiveOverlay,B=F.handlePrev,V=F.handleNext,z=F.isActiveOverlay,K=F.activeIndex,G=F.isMobile;e.useEffect((function(){if("undefined"!=typeof localStorage){var e=localStorage.getItem(o);e&&e===M.checkout.id&&(M.successTransaction&&h.purchase(M.checkout,M.successTransaction),localStorage.removeItem(o)),window&&window.handleKlarna&&window.handleKlarna(void 0)}}),[]);var H=((null===(E=M.checkout.customer)||void 0===E?void 0:E.firstName)||"")+" "+((null===(A=M.checkout.customer)||void 0===A?void 0:A.lastName)||""),Q=((null===(L=M.checkout.shippingAddress)||void 0===L?void 0:L.firstName)||"")+" "+((null===(P=M.checkout.shippingAddress)||void 0===P?void 0:P.lastName)||""),q=M.paymentGateways.find((function(e){var t;return e.id===(null===(t=M.successTransaction)||void 0===t?void 0:t.paymentGatewayId)})),J=function(e){switch(e){case p.APP_PAYMENT:return w("checkout-page:appPayment");case p.BANK_REDIRECT:return w("checkout-page:bankRedirect");case p.BUY_ONLINE_PAY_AT_STORE:return w("checkout-page:buyOnlinePayAtStore");case p.CASH:return w("checkout-page:cash");case p.CASH_ON_DELIVERY:return w("checkout-page:cashOnDelivery");case p.CREDIT_CARD:return w("checkout-page:creditCard");case p.CREDIT_CARD_ON_DELIVERY:return w("checkout-page:creditCardOnDelivery");case p.DIRECT_DEBIT:return w("checkout-page:directDebit");case p.GIFT_CARD:return w("checkout-page:giftCard");case p.MONEY_ORDER:return w("checkout-page:moneyOrder");case p.OTHER:return w("checkout-page:other");case p.PAY_LATER:return w("checkout-page:payLater");case p.SLICE_IT:return w("checkout-page:sliceIt");case p.WALLET:return w("checkout-page:wallet");default:return""}},X=null===(C=M.successTransaction)||void 0===C?void 0:C.paymentMethodDetail,W=null===(D=M.successTransaction)||void 0===D?void 0:D.paymentGatewayCode,Z=e.useMemo((function(){var t,a,o,r,i,u,E;return e.createElement("div",{className:[s.InfoGrid].join(" ")},!M.isFree&&e.createElement("div",null,e.createElement("div",{className:s.InfoTitle},w("checkout-page:paymentMethod")),q&&e.createElement(e.Fragment,null,!!q.logoUrl&&e.createElement("div",{className:s.PaymentLogoContainer},e.createElement("img",{src:q.logoUrl})),!q.logoUrl&&e.createElement("div",{className:s.InfoText},q.paymentMethodType===p.CREDIT_CARD&&q.type===v.INTERNAL?w("checkout-page:creditCard"):q.name),"STRIPE"!==q.code&&"PAYPAL"!==q.code&&"KLARNA"!==q.code||!(null===(t=M.successTransaction)||void 0===t?void 0:t.paymentMethod)?!!q.description&&q.type!==v.EXTERNAL&&e.createElement("div",{className:s.InfoText},e.createElement("div",{dangerouslySetInnerHTML:{__html:q.description}})):e.createElement("div",{className:s.InfoText},J(M.successTransaction.paymentMethod))),"E_PAY_KOLAY"===W&&e.createElement(e.Fragment,null,e.createElement("div",{className:s.EPayKolayLogoContainer},e.createElement("img",{src:"https://cdn.myikas.com/sf/assets/payment/epaykolay.png"})),!!(null===(a=M.successTransaction)||void 0===a?void 0:a.paymentMethod)&&e.createElement("div",{className:s.InfoText},J(null===(o=M.successTransaction)||void 0===o?void 0:o.paymentMethod))),"E_PAY_KOLAY"!==W&&"STRIPE"!==W&&"PAYPAL"!==W&&"KLARNA"!==W&&"CREDIT_CARD"===(null===(r=M.successTransaction)||void 0===r?void 0:r.paymentMethod)&&e.createElement(e.Fragment,null,e.createElement("div",{className:s.InfoText},e.createElement("div",{className:s.CardLogoContainer},function(){var t,a;switch(null===(a=null===(t=M.successTransaction)||void 0===t?void 0:t.paymentMethodDetail)||void 0===a?void 0:a.cardAssociation){case f.AMERICAN_EXPRESS:return e.createElement(n,null);case f.MASTER_CARD:return e.createElement(c,null);case f.TROY:return e.createElement(d,null);case f.VISA:return e.createElement(l,null);default:return e.createElement("div",null)}}()),e.createElement("span",null,"**** ".concat((null==X?void 0:X.lastFourDigits)||""))),(null===(i=null==X?void 0:X.installment)||void 0===i?void 0:i.installmentCount)&&X.installment.installmentCount>1&&e.createElement(e.Fragment,null,e.createElement("div",{className:s.InfoText},"".concat(X.installment.installmentCount," ").concat(w("checkout-page:installments"))),null!==X.installment.installmentPrice&&e.createElement("div",{className:s.InfoText},"".concat(X.installment.installmentCount," x ").concat(m(X.installment.installmentPrice,M.checkout.currencyCode,M.checkout.currencySymbol)))))),e.createElement("div",null,e.createElement("div",{className:s.InfoTitle},w("checkout-page:billingAddress")),!!(null===(u=M.checkout.billingAddress)||void 0===u?void 0:u.company)&&e.createElement("div",{className:[s.InfoText,s.InfoTextBold].join(" ")},M.checkout.billingAddress.company),e.createElement("div",{className:s.InfoText},null===(E=M.checkout.billingAddress)||void 0===E?void 0:E.addressText)))}),[]),$=e.useMemo((function(){return e.createElement(I,{vm:M,isSuccessPageSummary:!0})}),[]),ee=e.useMemo((function(){var t,a,o,r,i;return e.createElement("div",{className:[s.InfoGrid].join(" ")},e.createElement("div",null,e.createElement("div",{className:s.InfoTitle},w("checkout-page:contactInfo")),e.createElement("div",{className:s.InfoText},null===(t=M.checkout.customer)||void 0===t?void 0:t.email),e.createElement("div",{className:s.InfoText},H),!!(null===(a=M.checkout.shippingAddress)||void 0===a?void 0:a.phone)&&e.createElement("div",{className:s.InfoText},null===(o=M.checkout.shippingAddress)||void 0===o?void 0:o.phone)),e.createElement("div",null,"in-store"===M.deliveryMethod&&e.createElement(e.Fragment,null,e.createElement("div",{className:s.InfoTitle},w("checkout-page:receiver")),e.createElement("div",{className:[s.InfoText,s.withMBottom].join(" ")},Q)),e.createElement("div",{className:s.InfoTitle},"address"===M.deliveryMethod?w("checkout-page:shippingAddress"):w("checkout-page:pickUpLocation")),!!(null===(r=M.checkout.shippingAddress)||void 0===r?void 0:r.company)&&e.createElement("div",{className:[s.InfoText,s.InfoTextBold].join(" ")},M.checkout.shippingAddress.company),e.createElement("div",{className:s.InfoText},null===(i=M.checkout.shippingAddress)||void 0===i?void 0:i.addressText)))}),[]),te=!!(null===(S=M.customizationProps)||void 0===S?void 0:S.campaignOffersEnableMiddlePhase)&&!!(null===(R=M.customizationProps)||void 0===R?void 0:R.showCampaignIsBiggerImage)&&G&&z,ae=!!(null===(O=M.customizationProps)||void 0===O?void 0:O.campaignOffersEnableMiddlePhase)&&!!(null===(_=M.customizationProps)||void 0===_?void 0:_.showCampaignIsBiggerImage)&&G&&!z;return e.createElement(e.Fragment,null,!!(null===(b=M.customizationProps)||void 0===b?void 0:b.campaignOffersEnableMiddlePhase)&&z&&M.campaignOffers&&M.campaignOffers.length>0&&G&&e.createElement("div",{className:[s.MiddlePhaseOverlay,te?s.MiddlePhaseOverlayPopup:""].join(" ")}),M.campaignOffers&&!!M.campaignOffers.length&&M.isCampaignOfferLoaded&&e.createElement("div",{className:[s.CampaignOfferMain,te?s.OverlayPopupMain:""].join(" ")},e.createElement("div",{className:s.OfferSlider},M.campaignOffers.map((function(t,a){var o;return e.createElement(g,{vm:M,campaignOffer:t,index:a,activeIndex:K,offersLength:(null===(o=M.campaignOffers)||void 0===o?void 0:o.length)||0,handlePrev:B,handleNext:V,setActiveIndex:function(e){return Y(e)},isPopupShow:te,closePopup:function(){return U(!1)},isPopupClosed:ae,showPopup:function(){return U(!0)},step:M.step})}))),M.campaignOffers.length>1&&e.createElement(j,{handlePrev:B,handleNext:V}),M.campaignOffers.length>1&&e.createElement(y,{isPopupShow:te,vm:M,activeIndex:K})),e.createElement("div",{className:s.StepSuccess},e.createElement("div",{className:s.SuccessTitleContainer},e.createElement(r,{className:s.SuccessCircle}),e.createElement("span",{className:s.SuccessTitle},w("checkout-page:orderSuccessTitle"))),e.createElement("div",{className:s.SuccessSubTitle},w(M.isDigitalOnly?"checkout-page:orderSuccessDigitalOnlyDescription":"address"===M.deliveryMethod?"checkout-page:orderSuccessDescription":"checkout-page:orderSuccessInStoreDeliveryDescription",{customerName:H})),M.productFiles.length>0&&e.createElement(k,{vm:M}),e.createElement("div",null,e.createElement("div",{className:s.OrderSummaryMain},e.createElement("div",null,e.createElement("span",{className:s.InfoTitle},w("checkout-page:orderNo")),e.createElement("span",{className:s.InfoText},"#"+(M.checkout.orderNumber||""))),e.createElement("div",null,e.createElement("span",{className:s.InfoTitle},w("checkout-page:orderDate")),e.createElement("span",{className:s.InfoText},M.checkout.dateStr)),e.createElement("div",{className:s.OrderAmountInfoMain},e.createElement("span",{className:s.InfoTitle},w("checkout-page:orderAmount")),e.createElement("span",{className:s.OrderAmountInfo},e.createElement("span",null,"".concat(m(M.finalPrice||0,M.checkout.currencyCode,M.checkout.currencySymbol))),e.createElement("span",{className:s.Slash},"/"),e.createElement("span",{className:s.OrderItemCount},e.createElement(T,null),e.createElement("span",null," ",M.checkout.itemQuantity," ",w("checkout-page:cartItemProduct"))))))),M.hasQuickRegistration&&e.createElement(x,{vm:M}),e.createElement("div",{className:s.HideOnDesktop},e.createElement(i,{title:w("checkout-page:summary")},$)),e.createElement(i,{title:w("checkout-page:paymentSummary")},Z),!M.isDigitalOnly&&e.createElement(i,{title:w("checkout-page:shippingSummary")},ee),e.createElement("div",{className:s.Actions},e.createElement("div",{className:s.HelpText},e.createElement("span",null,w("checkout-page:helpCtaQuestion")),e.createElement("span",{style:{marginLeft:"4px"},className:s.Cta,onClick:function(){return M.setContactModalVisible(!0)}},w("checkout-page:helpCta"))),e.createElement(a,{text:w("checkout-page:actions.backToShopping"),onClick:M.onBackToShoppingClick,style:{flex:"0 0 auto"}}))))}));t((function(t){var a,o=t.vm,r=u().t,i=s.Yellow;switch(o.checkout.orderPackageStatus){case E.FULFILLED:case E.PARTIALLY_FULFILLED:case E.DELIVERED:case E.PARTIALLY_DELIVERED:i=s.Green;break;case E.CANCELLED:case E.PARTIALLY_CANCELLED:case E.CANCEL_REJECTED:case E.CANCEL_REQUESTED:i=s.Red}return e.createElement("div",{className:[s.OrderStatus,i].join(" ")},o.checkout.orderPackageStatus?null===(a=[{types:[E.UNFULFILLED],text:r("checkout-page:orderPackageStatus.unfulfilled")},{types:[E.READY_FOR_SHIPMENT],text:r("checkout-page:orderPackageStatus.readyForShipment")},{types:[E.PARTIALLY_FULFILLED],text:r("checkout-page:orderPackageStatus.partiallyFulfilled")},{types:[E.FULFILLED],text:r("checkout-page:orderPackageStatus.fulfilled")},{types:[E.DELIVERED],text:r("checkout-page:orderPackageStatus.delivered")},{types:[E.PARTIALLY_DELIVERED],text:r("checkout-page:orderPackageStatus.partiallyDelivered")},{types:[E.UNABLE_TO_DELIVER],text:r("checkout-page:orderPackageStatus.unableToDeliver")},{types:[E.CANCELLED,E.PARTIALLY_CANCELLED],text:r("checkout-page:orderPackageStatus.cancelled")},{types:[E.CANCEL_REJECTED],text:r("checkout-page:orderPackageStatus.cancelRejected")},{types:[E.REFUNDED,E.PARTIALLY_REFUNDED],text:r("checkout-page:orderPackageStatus.refunded")},{types:[E.REFUND_REQUEST_ACCEPTED],text:r("checkout-page:orderPackageStatus.refundRequestAccepted")},{types:[E.REFUND_REJECTED],text:r("checkout-page:orderPackageStatus.refundRejected")},{types:[E.REFUND_REQUESTED],text:r("checkout-page:orderPackageStatus.refundRequested")}].find((function(e){return e.types.includes(o.checkout.orderPackageStatus)})))||void 0===a?void 0:a.text:"")}));export{A as StepSuccess};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import{Button as a}from"../../components/button/index.js";import{CART_LS_KEY as o}from"../../../../store/cart/index.js";import s from"./style.module.scss.js";import r from"../../components/svg/success-circle.js";import i from"../../components/expandable-section/index.js";import n from"../../components/credit-card-form/svg/amex.js";import c from"../../components/credit-card-form/svg/master-card.js";import d from"../../components/credit-card-form/svg/troy.js";import l from"../../components/credit-card-form/svg/visa.js";import"@ikas/storefront-config";import{formatCurrency as m}from"../../../../utils/currency.js";import{useTranslation as p}from"../../../../utils/i18n.js";import"../../../../models/data/blog/category/index.js";import"../../../../models/data/blog/content/index.js";import"../../../../models/data/blog/meta-data/index.js";import"../../../../models/data/blog/tag/index.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import{IkasPaymentMethodType as u,IkasPaymentGatewayType as f,IkasOrderPackageStatus as v,IkasTransactionCardAssociation as E}from"@ikas/storefront-models";import"mobx";import"../../../../models/data/campaign-offer/index.js";import"../../../../models/data/cart/campaign-offer/index.js";import"../../../../models/data/cart/index.js";import"../../../../models/data/category/path-item/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/checkout/index.js";import"../../../../models/data/checkout-settings/index.js";import"../../../../models/data/city/index.js";import"../../../../models/data/country/index.js";import"../../../../models/data/customer/address/region/index.js";import"../../../../models/data/customer/address/index.js";import"../../../../models/data/customer/address/ikas-localized-customer-address.js";import"../../../../models/data/customer/attribute/index.js";import"../../../../models/data/customer/review/summary/index.js";import"../../../../models/data/customer/review/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/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/package/index.js";import"../../../../models/data/order/transaction/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/payment-gateway/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product/filter/index.js";import"../../../../models/data/product/campaign-offer/index.js";import"../../../../models/data/product/option-set/option/index.js";import"../../../../models/data/product/option-set/index.js";import"../../../../models/data/product/stock-location/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../models/data/state/index.js";import"../../../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../../models/data/storefront-popup/index.js";import"../../../../models/data/theme-json/index.js";import"../../../../models/data/theme-json/component/index.js";import"../../../../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 g from"../../components/offer-product/index.js";import{Analytics as h}from"../../../../analytics/analytics.js";import"../../../../analytics/head/index.js";import{QuickRegistration as x}from"../../components/quick-registration/index.js";import{ProductFiles as j}from"../../components/product-files/index.js";import k from"../../components/offer-product/offer-arrows/index.js";import y from"../../components/offer-product/offer-dots/index.js";import T from"../../components/svg/shopping-bag.js";import{CartSummary as I}from"../../components/cart-summary/index.js";import N from"../../components/offer-product/useCampaignOffer.js";var A=t((function(t){var v,A,L,P,C,D,S,R,O,_,b,M=t.vm,w=p().t,F=N(M,!0),Y=F.setActiveIndex,U=F.setIsActiveOverlay,B=F.handlePrev,V=F.handleNext,z=F.isActiveOverlay,K=F.activeIndex,G=F.isMobile;e.useEffect((function(){if("undefined"!=typeof localStorage){var e=localStorage.getItem(o);e&&e===M.checkout.id&&(M.successTransaction&&h.purchase(M.checkout,M.successTransaction),localStorage.removeItem(o)),window&&window.handleKlarna&&window.handleKlarna(void 0)}}),[]);var H=((null===(v=M.checkout.customer)||void 0===v?void 0:v.firstName)||"")+" "+((null===(A=M.checkout.customer)||void 0===A?void 0:A.lastName)||""),Q=((null===(L=M.checkout.shippingAddress)||void 0===L?void 0:L.firstName)||"")+" "+((null===(P=M.checkout.shippingAddress)||void 0===P?void 0:P.lastName)||""),q=M.paymentGateways.find((function(e){var t;return e.id===(null===(t=M.successTransaction)||void 0===t?void 0:t.paymentGatewayId)})),J=function(e){switch(e){case u.APP_PAYMENT:return w("checkout-page:appPayment");case u.BANK_REDIRECT:return w("checkout-page:bankRedirect");case u.BUY_ONLINE_PAY_AT_STORE:return w("checkout-page:buyOnlinePayAtStore");case u.CASH:return w("checkout-page:cash");case u.CASH_ON_DELIVERY:return w("checkout-page:cashOnDelivery");case u.CREDIT_CARD:return w("checkout-page:creditCard");case u.CREDIT_CARD_ON_DELIVERY:return w("checkout-page:creditCardOnDelivery");case u.DIRECT_DEBIT:return w("checkout-page:directDebit");case u.GIFT_CARD:return w("checkout-page:giftCard");case u.MONEY_ORDER:return w("checkout-page:moneyOrder");case u.OTHER:return w("checkout-page:other");case u.PAY_LATER:return w("checkout-page:payLater");case u.SLICE_IT:return w("checkout-page:sliceIt");case u.WALLET:return w("checkout-page:wallet");default:return""}},X=null===(C=M.successTransaction)||void 0===C?void 0:C.paymentMethodDetail,W=null===(D=M.successTransaction)||void 0===D?void 0:D.paymentGatewayCode,Z=e.useMemo((function(){var t,a,o,r,i,p,v;return e.createElement("div",{className:[s.InfoGrid].join(" ")},!M.isFree&&e.createElement("div",null,e.createElement("div",{className:s.InfoTitle},w("checkout-page:paymentMethod")),q&&e.createElement(e.Fragment,null,!!q.logoUrl&&e.createElement("div",{className:s.PaymentLogoContainer},e.createElement("img",{src:q.logoUrl})),!q.logoUrl&&e.createElement("div",{className:s.InfoText},q.paymentMethodType===u.CREDIT_CARD&&q.type===f.INTERNAL?w("checkout-page:creditCard"):q.name),"STRIPE"!==q.code&&"PAYPAL"!==q.code&&"KLARNA"!==q.code||!(null===(t=M.successTransaction)||void 0===t?void 0:t.paymentMethod)?!!q.description&&q.type!==f.EXTERNAL&&e.createElement("div",{className:s.InfoText},e.createElement("div",{dangerouslySetInnerHTML:{__html:q.description}})):e.createElement("div",{className:s.InfoText},J(M.successTransaction.paymentMethod))),"E_PAY_KOLAY"===W&&e.createElement(e.Fragment,null,e.createElement("div",{className:s.EPayKolayLogoContainer},e.createElement("img",{src:"https://cdn.myikas.com/sf/assets/payment/epaykolay.png"})),!!(null===(a=M.successTransaction)||void 0===a?void 0:a.paymentMethod)&&e.createElement("div",{className:s.InfoText},J(null===(o=M.successTransaction)||void 0===o?void 0:o.paymentMethod))),"E_PAY_KOLAY"!==W&&"STRIPE"!==W&&"PAYPAL"!==W&&"KLARNA"!==W&&"CREDIT_CARD"===(null===(r=M.successTransaction)||void 0===r?void 0:r.paymentMethod)&&e.createElement(e.Fragment,null,e.createElement("div",{className:s.InfoText},e.createElement("div",{className:s.CardLogoContainer},function(){var t,a;switch(null===(a=null===(t=M.successTransaction)||void 0===t?void 0:t.paymentMethodDetail)||void 0===a?void 0:a.cardAssociation){case E.AMERICAN_EXPRESS:return e.createElement(n,null);case E.MASTER_CARD:return e.createElement(c,null);case E.TROY:return e.createElement(d,null);case E.VISA:return e.createElement(l,null);default:return e.createElement("div",null)}}()),e.createElement("span",null,"**** ".concat((null==X?void 0:X.lastFourDigits)||""))),(null===(i=null==X?void 0:X.installment)||void 0===i?void 0:i.installmentCount)&&X.installment.installmentCount>1&&e.createElement(e.Fragment,null,e.createElement("div",{className:s.InfoText},"".concat(X.installment.installmentCount," ").concat(w("checkout-page:installments"))),null!==X.installment.installmentPrice&&e.createElement("div",{className:s.InfoText},"".concat(X.installment.installmentCount," x ").concat(m(X.installment.installmentPrice,M.checkout.currencyCode,M.checkout.currencySymbol)))))),e.createElement("div",null,e.createElement("div",{className:s.InfoTitle},w("checkout-page:billingAddress")),!!(null===(p=M.checkout.billingAddress)||void 0===p?void 0:p.company)&&e.createElement("div",{className:[s.InfoText,s.InfoTextBold].join(" ")},M.checkout.billingAddress.company),e.createElement("div",{className:s.InfoText},null===(v=M.checkout.billingAddress)||void 0===v?void 0:v.addressText)))}),[]),$=e.useMemo((function(){return e.createElement(I,{vm:M,isSuccessPageSummary:!0})}),[]),ee=e.useMemo((function(){var t,a,o,r,i;return e.createElement("div",{className:[s.InfoGrid].join(" ")},e.createElement("div",null,e.createElement("div",{className:s.InfoTitle},w("checkout-page:contactInfo")),e.createElement("div",{className:s.InfoText},null===(t=M.checkout.customer)||void 0===t?void 0:t.email),e.createElement("div",{className:s.InfoText},H),!!(null===(a=M.checkout.shippingAddress)||void 0===a?void 0:a.phone)&&e.createElement("div",{className:s.InfoText},null===(o=M.checkout.shippingAddress)||void 0===o?void 0:o.phone)),e.createElement("div",null,"in-store"===M.deliveryMethod&&e.createElement(e.Fragment,null,e.createElement("div",{className:s.InfoTitle},w("checkout-page:receiver")),e.createElement("div",{className:[s.InfoText,s.withMBottom].join(" ")},Q)),e.createElement("div",{className:s.InfoTitle},"address"===M.deliveryMethod?w("checkout-page:shippingAddress"):w("checkout-page:pickUpLocation")),!!(null===(r=M.checkout.shippingAddress)||void 0===r?void 0:r.company)&&e.createElement("div",{className:[s.InfoText,s.InfoTextBold].join(" ")},M.checkout.shippingAddress.company),e.createElement("div",{className:s.InfoText},null===(i=M.checkout.shippingAddress)||void 0===i?void 0:i.addressText)))}),[]),te=!!(null===(S=M.customizationProps)||void 0===S?void 0:S.campaignOffersEnableMiddlePhase)&&!!(null===(R=M.customizationProps)||void 0===R?void 0:R.showCampaignIsBiggerImage)&&G&&z,ae=!!(null===(O=M.customizationProps)||void 0===O?void 0:O.campaignOffersEnableMiddlePhase)&&!!(null===(_=M.customizationProps)||void 0===_?void 0:_.showCampaignIsBiggerImage)&&G&&!z;return e.createElement(e.Fragment,null,!!(null===(b=M.customizationProps)||void 0===b?void 0:b.campaignOffersEnableMiddlePhase)&&z&&M.campaignOffers&&M.campaignOffers.length>0&&G&&e.createElement("div",{className:[s.MiddlePhaseOverlay,te?s.MiddlePhaseOverlayPopup:""].join(" ")}),M.campaignOffers&&!!M.campaignOffers.length&&M.isCampaignOfferLoaded&&e.createElement("div",{className:[s.CampaignOfferMain,te?s.OverlayPopupMain:""].join(" ")},e.createElement("div",{className:s.OfferSlider},M.campaignOffers.map((function(t,a){var o;return e.createElement(g,{vm:M,campaignOffer:t,index:a,activeIndex:K,offersLength:(null===(o=M.campaignOffers)||void 0===o?void 0:o.length)||0,handlePrev:B,handleNext:V,setActiveIndex:function(e){return Y(e)},isPopupShow:te,closePopup:function(){return U(!1)},isPopupClosed:ae,showPopup:function(){return U(!0)},step:M.step})}))),M.campaignOffers.length>1&&e.createElement(k,{handlePrev:B,handleNext:V}),M.campaignOffers.length>1&&e.createElement(y,{isPopupShow:te,vm:M,activeIndex:K})),e.createElement("div",{className:s.StepSuccess},e.createElement("div",{className:s.SuccessTitleContainer},e.createElement(r,{className:s.SuccessCircle}),e.createElement("span",{className:s.SuccessTitle},w("checkout-page:orderSuccessTitle"))),e.createElement("div",{className:s.SuccessSubTitle},w(M.isDigitalOnly?"checkout-page:orderSuccessDigitalOnlyDescription":"address"===M.deliveryMethod?"checkout-page:orderSuccessDescription":"checkout-page:orderSuccessInStoreDeliveryDescription",{customerName:H})),M.productFiles.length>0&&e.createElement(j,{vm:M}),e.createElement("div",null,e.createElement("div",{className:s.OrderSummaryMain},e.createElement("div",null,e.createElement("span",{className:s.InfoTitle},w("checkout-page:orderNo")),e.createElement("span",{className:s.InfoText},"#"+(M.checkout.orderNumber||""))),e.createElement("div",null,e.createElement("span",{className:s.InfoTitle},w("checkout-page:orderDate")),e.createElement("span",{className:s.InfoText},M.checkout.dateStr)),e.createElement("div",{className:s.OrderAmountInfoMain},e.createElement("span",{className:s.InfoTitle},w("checkout-page:orderAmount")),e.createElement("span",{className:s.OrderAmountInfo},e.createElement("span",null,"".concat(m(M.finalPrice||0,M.checkout.currencyCode,M.checkout.currencySymbol))),e.createElement("span",{className:s.Slash},"/"),e.createElement("span",{className:s.OrderItemCount},e.createElement(T,null),e.createElement("span",null," ",M.checkout.itemQuantity," ",w("checkout-page:cartItemProduct"))))))),M.hasQuickRegistration&&e.createElement(x,{vm:M}),e.createElement("div",{className:s.HideOnDesktop},e.createElement(i,{title:w("checkout-page:summary")},$)),e.createElement(i,{title:w("checkout-page:paymentSummary")},Z),!M.isDigitalOnly&&e.createElement(i,{title:w("checkout-page:shippingSummary")},ee),e.createElement("div",{className:s.Actions},e.createElement("div",{className:s.HelpText},e.createElement("span",null,w("checkout-page:helpCtaQuestion")),e.createElement("span",{style:{marginLeft:"4px"},className:s.Cta,onClick:function(){return M.setContactModalVisible(!0)}},w("checkout-page:helpCta"))),e.createElement(a,{text:w("checkout-page:actions.backToShopping"),onClick:M.onBackToShoppingClick,style:{flex:"0 0 auto"}}))))}));t((function(t){var a,o=t.vm,r=p().t,i=s.Yellow;switch(o.checkout.orderPackageStatus){case v.FULFILLED:case v.PARTIALLY_FULFILLED:case v.DELIVERED:case v.PARTIALLY_DELIVERED:i=s.Green;break;case v.CANCELLED:case v.PARTIALLY_CANCELLED:case v.CANCEL_REJECTED:case v.CANCEL_REQUESTED:i=s.Red}return e.createElement("div",{className:[s.OrderStatus,i].join(" ")},o.checkout.orderPackageStatus?null===(a=[{types:[v.UNFULFILLED],text:r("checkout-page:orderPackageStatus.unfulfilled")},{types:[v.READY_FOR_SHIPMENT],text:r("checkout-page:orderPackageStatus.readyForShipment")},{types:[v.PARTIALLY_FULFILLED],text:r("checkout-page:orderPackageStatus.partiallyFulfilled")},{types:[v.FULFILLED],text:r("checkout-page:orderPackageStatus.fulfilled")},{types:[v.DELIVERED],text:r("checkout-page:orderPackageStatus.delivered")},{types:[v.PARTIALLY_DELIVERED],text:r("checkout-page:orderPackageStatus.partiallyDelivered")},{types:[v.UNABLE_TO_DELIVER],text:r("checkout-page:orderPackageStatus.unableToDeliver")},{types:[v.CANCELLED,v.PARTIALLY_CANCELLED],text:r("checkout-page:orderPackageStatus.cancelled")},{types:[v.CANCEL_REJECTED],text:r("checkout-page:orderPackageStatus.cancelRejected")},{types:[v.REFUNDED,v.PARTIALLY_REFUNDED],text:r("checkout-page:orderPackageStatus.refunded")},{types:[v.REFUND_REQUEST_ACCEPTED],text:r("checkout-page:orderPackageStatus.refundRequestAccepted")},{types:[v.REFUND_REJECTED],text:r("checkout-page:orderPackageStatus.refundRejected")},{types:[v.REFUND_REQUESTED],text:r("checkout-page:orderPackageStatus.refundRequested")}].find((function(e){return e.types.includes(o.checkout.orderPackageStatus)})))||void 0===a?void 0:a.text:"")}));export{A as StepSuccess};
@@ -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 i}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/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{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"../../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 c}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var l=o((function(o){var s,l,g,v=o.pageType,f=o.pageTitle,h=o.pageDescription,j=o.canonicals,x=o.disableIndex,y=o.pageSpecificData,b=o.merchantSettings,C=o.addOgpMetas,k=o.productReviewSummary,D=o.pageComponentPropValues,T=i(),w="undefined"!=typeof window,L="local"===process.env.NEXT_PUBLIC_ENV,P=T.asPath.split("?")[0].replace("/",""),E=(P="/"===P.charAt(P.length-1)?P.slice(0,-1):P).startsWith("pages/"),O=d.getCurrentRouting(),R=(null==O?void 0:O.path)?"/"+O.path:"",I=L?"http://localhost:3333":"https://"+d.getDomain(),_=null===(s=d.getIndexPageSeoSettings())||void 0===s?void 0:s.find((function(e){return e.locale===d.getCurrentLocale()})),S=_?new n(_):null;t.useEffect((function(){document.documentElement.lang=d.getCurrentLocale()}),[v,y]);var V=t.useMemo((function(){if(y&&y.href)return"".concat(I).concat(y.href)}),[y]),A=t.useMemo((function(){var e,t,o=[];if(C){if(o.push({property:"og:type",content:"website"}),o.push({property:"og:site_name",content:"https://"+d.getDomain()}),f&&o.push({property:"og:title",content:f}),h&&o.push({property:"og:description",content:h}),v===r.INDEX){var a=null,i=null;!f&&(null==S?void 0:S.pageTitle)&&(a=S.pageTitle),!h&&(null==S?void 0:S.description)&&(i=S.description);var n=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===v}));n&&(a=u(y,v,n.titleTemplate||""),i=u(y,v,n.descriptionTemplate||"")),a&&o.push({property:"og:title",content:a}),i&&o.push({property:"og:description",content:i})}if(o.push({property:"og:url",content:V||(w?window.location.href:"")||"https://".concat(d.getDomain())}),y&&v===r.PRODUCT){var s=y.selectedVariant.mainImage;(null==s?void 0:s.image)&&o.push({property:"og:image",content:s.image.src.replace(".webp",".jpg")})}else(null==S?void 0:S.icon)?o.push({property:"og:image",content:null===(t=null==S?void 0:S.icon)||void 0===t?void 0:t.src.replace(".webp",".jpg")}):(null==b?void 0:b.logo)&&o.push({property:"og:image",content:b.logo.src.replace(".webp",".jpg")});if(y&&v===r.CATEGORY){var c=y;c.image&&o.push({property:"og:image",content:c.image.src.replace(".webp",".jpg")})}if(y&&v===r.BRAND){var l=y;l.image&&o.push({property:"og:image",content:l.image.src.replace(".webp",".jpg")})}}return o}),[f,y,V,h,b,C,b]),N=t.useMemo((function(){var t=[];if(b){var o={"@context":"https://schema.org","@type":"Website",url:"https://"+d.getDomain()},a=function(t){var o,a,i,r,n,s,c=(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:c,image:c,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===(i=null===(a=t.address)||void 0===a?void 0:a.city)||void 0===i?void 0:i.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(o),t.push(a)}if(y&&v===r.PRODUCT){var i=y,n=function(t,o){var a,i,r,n,s;try{var c=d.getCurrentRouting(),l=null==c?void 0:c.path,m=function(e){return l?"https://".concat(d.getDomain(),"/").concat(l).concat(e):"https://".concat(d.getDomain()).concat(e)},p=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===(i=p.images)||void 0===i?void 0:i.map((function(e){return e.image?e.image.src:""})),productId:p.id,sku:p.sku,mpn:(null===(r=p.barcodeList)||void 0===r?void 0:r.length)?p.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:m(t.href),priceCurrency:p.price.currency||"TRY",price:(null!==(s=p.campaignPrice)&&void 0!==s?s:p.price.finalPrice).toFixed(2),priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:p.stock>0||p.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(i,k||null);if(n&&t.push(n),i.categories.length)(c=m(i.categories[0],i))&&t.push(c)}if(y&&v===r.CATEGORY){var s=function(e){var t,o;try{var a=d.getCurrentRouting(),i=null==a?void 0:a.path,r=function(e){return i?"https://".concat(d.getDomain(),"/").concat(i).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=m(y),l=p(D);s&&t.push(s),c&&t.push(c),l&&t.push(l)}y&&v===r.BRAND&&((l=p(D))&&t.push(l));if(y&&v===r.BLOG){var u=function(t){var o;try{var a="https://".concat(d.getDomain()).concat(t.href),i=function(e){var t=new Date(e),o=t.getFullYear(),a=(t.getMonth()+1).toString().padStart(2,"0"),i=t.getDate().toString().padStart(2,"0");return"".concat(o,"-").concat(a,"-").concat(i)},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:a,datePublished:i(t.createdAt),dateCreated:i(t.createdAt),dateModified:i(t.updatedAt),description:t.shortDescription,articleBody:n,author:{"@type":"Person",name:r}})}catch(e){}}(y);u&&t.push(u)}return t}),[y,b]),M=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===v}));return t?u(y,v,t.titleTemplate||""):null}),[v,y]),B=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===v}));return t?u(y,v,t.descriptionTemplate||""):null}),[v,y]),U=t.useMemo((function(){return!d.getFavicon()&&(null==S?void 0:S.favIcon)?S.favIcon:null}),[]),F=t.useCallback((function(){var e=d.getCustom();return!!e&&!!e.isEPayKolayEnabled}),[]),G=[];d.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){G.push({routing:e,hrefLang:e.locale+"-"+t})})):G.push({routing:e,hrefLang:e.locale})}));var Y=function(e){var t,o,a,i,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=G.find((function(e){return!e.routing.path}));return d&&(null===(r=null===(i=null===(a=null==n?void 0:n.metaData)||void 0===a?void 0:a.translations)||void 0===i?void 0:i.find((function(e){return e.locale===d.routing.locale})))||void 0===r?void 0:r.slug)||""},H=c.getInstance();return t.createElement(a,null,t.createElement("title",null,f||M||(null==S?void 0:S.pageTitle)||""),t.createElement("meta",{name:"description",content:h||B||(null==S?void 0:S.description)||""}),v===r.CHECKOUT&&F()&&t.createElement("script",{type:"text/javascript",src:"https://cdn-epeykolay.mncdn.com/".concat((null===(l=d.getApiUrl())||void 0===l?void 0:l.includes("myikas.com"))?"epay":"epay-uat","/").concat((null===(g=d.getApiUrl())||void 0===g?void 0:g.includes("myikas.com"))?"containerServices":"containerServicesTest",".js")}),G.length>1&&G.filter((function(e){return!E||e.routing.id===(null==O?void 0:O.id)})).map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(I+(e.routing.path?"/"+e.routing.path:""),"/").concat(Y(e.routing))})})),!!x&&t.createElement("meta",{name:"robots",content:"noindex"}),!!C&&A.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(I).concat(R).concat(e)})})),U&&t.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(U,"/image_180.webp"),type:"image/webp"}),!j&&H.currentPageType!==r.NOT_FOUND&&t.createElement("link",{rel:"canonical",href:"".concat(I).concat(R,"/").concat(P)}),!!N.length&&N.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function m(e,t){try{var o=c.getInstance(),a=d.getCurrentRouting(),i=null==a?void 0:a.path,n=function(e){return i?"https://".concat(d.getDomain(),"/").concat(i).concat(e):"https://".concat(d.getDomain()).concat(e)},s=e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+1,name:e.name,item:n(e.href)}}));return s.push({"@type":"ListItem",position:e.categoryPathItems.length+1,name:e.name,item:n(e.href)}),o.currentPageType===r.PRODUCT&&t&&s.push({"@type":"ListItem",position:s.length+1,name:t.name,item:n(t.productHref)}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:s}}catch(e){}}function p(e){try{var t=d.getCurrentRouting(),o=null==t?void 0:t.path;if(e){var a=(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(a){var i=Object.values(a.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}));if(i)return{"@context":"http://schema.org","@type":"ItemList",itemListElement:(i.data||[]).slice(0,10).map((function(e,t){var a,i,r,n;return{"@type":"ListItem",position:t+1,item:{"@type":"Product",name:e.name,image:(null===(i=null===(a=e.selectedVariant.mainImage)||void 0===a?void 0:a.image)||void 0===i?void 0:i.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 a,i,n=o;try{switch(t){case r.PRODUCT:var s=e,d=s.name,c=(null===(a=s.brand)||void 0===a?void 0:a.name)||"",l=s.selectedVariant.sku||"",m=(null===(i=s.selectedVariant.barcodeList)||void 0===i?void 0:i.length)?s.selectedVariant.barcodeList[0]:"",p=s.selectedVariant.campaignPrice?s.selectedVariant.formattedCampaignPrice:s.selectedVariant.formattedFinalPrice;n.includes("{{name}}")&&(n=g(n,"{{name}}",d)),n.includes("{{brand}}")&&(n=g(n,"{{brand}}",c)),n.includes("{{sku}}")&&(n=g(n,"{{sku}}",l)),n.includes("{{barcode}}")&&(n=g(n,"{{barcode}}",m)),n.includes("{{price}}")&&(n=g(n,"{{price}}",p.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 v=e.title;n.includes("{{name}}")&&(n=g(n,"{{name}}",v))}}catch(e){}return n.trimEnd()}function g(e,t,o){var a=new RegExp(t,"g");return e.replace(a,o)}export{l 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/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"../../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 c}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var l=o((function(o){var s,l=o.pageType,g=o.pageTitle,f=o.pageDescription,v=o.canonicals,h=o.disableIndex,j=o.pageSpecificData,x=o.merchantSettings,y=o.addOgpMetas,b=o.productReviewSummary,C=o.pageComponentPropValues,D=a(),L="undefined"!=typeof window,k="local"===process.env.NEXT_PUBLIC_ENV,w=D.asPath.split("?")[0].replace("/",""),T=(w="/"===w.charAt(w.length-1)?w.slice(0,-1):w).startsWith("pages/"),O=d.getCurrentRouting(),P=(null==O?void 0:O.path)?"/"+O.path:"",E=k?"http://localhost:3333":"https://"+d.getDomain(),R=null===(s=d.getIndexPageSeoSettings())||void 0===s?void 0:s.find((function(e){return e.locale===d.getCurrentLocale()})),_=R?new n(R):null;t.useEffect((function(){document.documentElement.lang=d.getCurrentLocale()}),[l,j]);var I=t.useMemo((function(){if(j&&j.href)return"".concat(E).concat(j.href)}),[j]),V=t.useMemo((function(){var e,t,o=[];if(y){if(o.push({property:"og:type",content:"website"}),o.push({property:"og:site_name",content:"https://"+d.getDomain()}),g&&o.push({property:"og:title",content:g}),f&&o.push({property:"og:description",content:f}),l===r.INDEX){var i=null,a=null;!g&&(null==_?void 0:_.pageTitle)&&(i=_.pageTitle),!f&&(null==_?void 0:_.description)&&(a=_.description);var n=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===l}));n&&(i=u(j,l,n.titleTemplate||""),a=u(j,l,n.descriptionTemplate||"")),i&&o.push({property:"og:title",content:i}),a&&o.push({property:"og:description",content:a})}o.push({property:"og:url",content:I||(L?window.location.href:"")||"https://".concat(d.getDomain())});var s=null;if(j&&l===r.PRODUCT){var c=j.selectedVariant.mainImage;(null==c?void 0:c.image)&&(s={property:"og:image",content:c.image.src.replace(".webp",".jpg")})}if(j&&l===r.CATEGORY){var p=j;p.image&&(s={property:"og:image",content:p.image.src.replace(".webp",".jpg")})}if(j&&l===r.BRAND){var m=j;m.image&&(s={property:"og:image",content:m.image.src.replace(".webp",".jpg")})}if(j&&l===r.BLOG_CATEGORY){var v=j;v.image&&(s={property:"og:image",content:v.image.src.replace(".webp",".jpg")})}if(j&&l===r.BLOG){var h=j;h.image&&(s={property:"og:image",content:h.image.src.replace(".webp",".jpg")})}!s&&(null==_?void 0:_.icon)&&(s={property:"og:image",content:null===(t=null==_?void 0:_.icon)||void 0===t?void 0:t.src.replace(".webp",".jpg")}),!s&&(null==x?void 0:x.logo)&&(s={property:"og:image",content:x.logo.src.replace(".webp",".jpg")}),s&&o.push(s)}return o}),[g,j,I,f,x,y,x]),S=t.useMemo((function(){var t=[],o=(null==_?void 0:_.pageTitle)||(null==x?void 0:x.merchantName)||"";if(x){var i={"@context":"https://schema.org","@type":"Website",url:"https://"+d.getDomain()},a=function(t){var o,i,a,r,n,s,c=(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:c,image:c,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})}}(x);t.push(i),t.push(a)}if(j&&l===r.PRODUCT){var n=j,s=function(t,o){var i,a,r,n,s;try{var c=d.getCurrentRouting(),l=null==c?void 0:c.path,p=function(e){return l?"https://".concat(d.getDomain(),"/").concat(l).concat(e):"https://".concat(d.getDomain()).concat(e)},m=t.selectedVariant;return e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:null===(i=t.metaData)||void 0===i?void 0:i.description,image:null===(a=m.images)||void 0===a?void 0:a.map((function(e){return e.image?e.image.src:""})),productId:m.id,sku:m.sku,mpn:(null===(r=m.barcodeList)||void 0===r?void 0:r.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:p(t.href),priceCurrency:m.price.currency||"TRY",price:(null!==(s=m.campaignPrice)&&void 0!==s?s:m.price.finalPrice).toFixed(2),priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:m.stock>0||m.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(n,b||null);if(s&&t.push(s),n.categories.length)(u=p(n.categories[0],o,n))&&t.push(u)}if(j&&l===r.CATEGORY){var c=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){}}(j),u=p(j,o),g=m(C);c&&t.push(c),u&&t.push(u),g&&t.push(g)}j&&l===r.BRAND&&((g=m(C))&&t.push(g));if(j&&l===r.BLOG){var f=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){}}(j);f&&t.push(f)}return t}),[j,x]),N=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===l}));return t?u(j,l,t.titleTemplate||""):null}),[l,j]),A=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===l}));return t?u(j,l,t.descriptionTemplate||""):null}),[l,j]),B=t.useMemo((function(){return!d.getFavicon()&&(null==_?void 0:_.favIcon)?_.favIcon:null}),[]),M=[];d.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){M.push({routing:e,hrefLang:e.locale+"-"+t})})):M.push({routing:e,hrefLang:e.locale})}));var F=function(e){var t,o,i,a,r,n=j,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=M.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)||""},G=c.getInstance();return t.createElement(i,null,t.createElement("title",null,g||N||(null==_?void 0:_.pageTitle)||""),t.createElement("meta",{name:"description",content:f||A||(null==_?void 0:_.description)||""}),M.length>1&&M.filter((function(e){return!T||e.routing.id===(null==O?void 0:O.id)})).map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(E+(e.routing.path?"/"+e.routing.path:""),"/").concat(F(e.routing))})})),!!h&&t.createElement("meta",{name:"robots",content:"noindex"}),!!y&&V.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!v&&v.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(E).concat(P).concat(e)})})),B&&t.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(B,"/image_180.webp"),type:"image/webp"}),!v&&G.currentPageType!==r.NOT_FOUND&&t.createElement("link",{rel:"canonical",href:"".concat(E).concat(P,"/").concat(w)}),!!S.length&&S.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=c.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)},l=[{"@type":"ListItem",position:1,name:t,item:"https://".concat(d.getDomain())}];return(l=l.concat(e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+2,name:e.name,item:s(e.href)}})))).push({"@type":"ListItem",position:l.length+1,name:e.name,item:s(e.href)}),i.currentPageType===r.PRODUCT&&o&&l.push({"@type":"ListItem",position:l.length+1,name:o.name,item:s(o.productHref)}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:l}}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,c=(null===(i=s.brand)||void 0===i?void 0:i.name)||"",l=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}}",c)),n.includes("{{sku}}")&&(n=g(n,"{{sku}}",l)),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{l as IkasPageHead};
@@ -1 +1 @@
1
- import{__assign as e,__awaiter as t,__generator as o}from'./../../ext/tslib/tslib.es6.js';import*as i from"react";import{observer as r}from"mobx-react-lite";import{useRouter as a}from"next/router.js";import s from"next/dynamic";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 d}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasMerchantSettings as n}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/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/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import{IkasThemeJsonCustomData as m}from"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as l}from"@ikas/storefront-config";import{Analytics as p}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasPageHead as c}from"./head.js";import{ThemeComponent as u}from"./ThemeComponent.js";import{IkasBaseStore as f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{initIkasEvents as j}from"../../analytics/events.js";import{IkasPageDataInit as x}from"../../page-data-init/index.js";import{setAPIClientConfig as g}from"@ikas/storefront-api";var v=s((function(){return import("../popup/index.js").then((function(e){return e.PopupListRendererForPage}))}),{ssr:!1}),y=r((function(r){var s=r.propValues,u=r.themeJsonComponents,y=r.customDataList,w=r.pageType,b=r.pageTitle,S=r.pageDescription,C=r.pageSpecificData,P=r.canonicals,k=r.disableIndex,D=r.settings,T=r.configJson,E=r.reInitOnBrowser,I=r.addOgpMetas,M=r.components,R=r.productReviewSummary,V=a(),O=i.useState(),z=O[0],F=O[1];l.init(e(e({},T),{currentPageComponents:M,loginRequiredCallback:function(){V.push("/account/login")}})),f.getInstance().router=V,g();var A=f.getInstance();A.router=V,A.currentPageType=w;var B=i.useState(!1),H=B[0],L=B[1],U=i.useMemo((function(){return(null==z?void 0:z.id)===(null==C?void 0:C.id)&&x.pageSpecificData&&x.isBrowser?w===d.PRODUCT&&x._initProductOnBrowser(x.pageSpecificData):x.setPageSpecificData(C,w,H),x.initPagePropValues(s,u,y.map((function(e){return new m(e)})),D,H)}),[H,s,w,D,C,u]);i.useEffect((function(){E&&L("undefined"!=typeof window),window.addToCart=A.cartStore._windowAddToCart,A.cartStore.getCart(),A.checkLocalization(),j()}),[]),i.useEffect((function(){C?(null==z?void 0:z.id)!==C.id&&F(C):F(null)}),[C]),i.useEffect((function(){var e=function(){A.customerStore.routeChangeInit()};return V.events.on("routeChangeStart",e),function(){V.events.off("routeChangeStart",e)}}),[]),i.useEffect((function(){!function(e,i){var r,a;t(this,void 0,void 0,(function(){var t,s,n,m,l;return o(this,(function(o){switch(o.label){case 0:t=f.getInstance(),p.pageView(e),o.label=1;case 1:return o.trys.push([1,4,,5]),e===d.PRODUCT&&(s=i,p.productView(s),t.customerStore.onProductView(s.id,s.selectedVariant.id)),e===d.CATEGORY&&(m=null===(r=(n=i).categoryPathItems)||void 0===r?void 0:r.map((function(e){return e.name})).join(" > "),m=n.categoryPathItems&&(null===(a=n.categoryPathItems)||void 0===a?void 0:a.length)>0?m+" > "+n.name:n.name,p.viewCategory(m,n)),e!==d.CART?[3,3]:[4,t.cartStore.waitUntilInitialized()];case 2:o.sent(),p.viewCart(t.cartStore.cart),o.label=3;case 3:return[3,5];case 4:return l=o.sent(),console.error(l),[3,5];case 5:return[2]}}))}))}(w,x.pageSpecificData)}),[w,C]);var _=i.useMemo((function(){var e=U.find((function(e){return e.component.isHeader})),t=U.find((function(e){return e.component.isFooter})),o=U.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[];return i.createElement("div",{style:{position:"relative",minHeight:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between"}},i.createElement("div",null,e&&h(e,D,-1),o.map((function(e,t){return h(e,D,t)}))),t&&h(t,D,-1),i.createElement(v,null))}),[U,D]),J=i.useMemo((function(){return l.getMerchantSettings()?new n(l.getMerchantSettings()):null}),[l.getMerchantSettings()]);return i.createElement(i.Fragment,null,i.createElement(c,{pageType:w,pageTitle:b,pageDescription:S,pageSpecificData:x.pageSpecificData,canonicals:P,disableIndex:k,merchantSettings:J,addOgpMetas:I,productReviewSummary:R,pageComponentPropValues:U}),_)})),h=function(e,t,o){return i.createElement(u,{key:e.pageComponent.id,index:o,pageComponentPropValue:e,settings:t})};export{y as IkasPage,h as renderComponent};
1
+ import{__assign as e,__awaiter as t,__generator as o}from'./../../ext/tslib/tslib.es6.js';import*as i from"react";import{observer as r}from"mobx-react-lite";import{useRouter as a}from"next/router.js";import s from"next/dynamic";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 d}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasMerchantSettings as n}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import{IkasThemeJsonCustomData as m}from"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import{Analytics as l}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasPageHead as c}from"./head.js";import{ThemeComponent as u}from"./ThemeComponent.js";import{IkasBaseStore as f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{initIkasEvents as j}from"../../analytics/events.js";import{IkasPageDataInit as x}from"../../page-data-init/index.js";import{setAPIClientConfig as g}from"@ikas/storefront-api";var v=s((function(){return import("../popup/index.js").then((function(e){return e.PopupListRendererForPage}))}),{ssr:!1}),y=r((function(r){var s=r.propValues,u=r.themeJsonComponents,y=r.customDataList,w=r.pageType,b=r.pageTitle,S=r.pageDescription,C=r.pageSpecificData,P=r.canonicals,D=r.disableIndex,k=r.settings,T=r.configJson,E=r.reInitOnBrowser,I=r.addOgpMetas,R=r.components,M=r.productReviewSummary,V=a(),O=i.useState(),z=O[0],B=O[1];p.init(e(e({},T),{currentPageComponents:R,loginRequiredCallback:function(){V.push("/account/login")}})),f.getInstance().router=V,g();var A=f.getInstance();A.router=V,A.currentPageType=w;var F=i.useState(!1),H=F[0],L=F[1],U=i.useMemo((function(){return(null==z?void 0:z.id)===(null==C?void 0:C.id)&&x.pageSpecificData&&x.isBrowser?w===d.PRODUCT&&x._initProductOnBrowser(x.pageSpecificData):x.setPageSpecificData(C,w,H),x.initPagePropValues(s,u,y.map((function(e){return new m(e)})),k,H)}),[H,s,w,k,C,u]);i.useEffect((function(){E&&L("undefined"!=typeof window),window.addToCart=A.cartStore._windowAddToCart,A.cartStore.getCart(),A.checkLocalization(),j()}),[]),i.useEffect((function(){C?(null==z?void 0:z.id)!==C.id&&B(C):B(null)}),[C]),i.useEffect((function(){var e=function(){A.customerStore.routeChangeInit()};return V.events.on("routeChangeStart",e),function(){V.events.off("routeChangeStart",e)}}),[]),i.useEffect((function(){!function(e,i){var r,a;t(this,void 0,void 0,(function(){var t,s,n,m,p,c;return o(this,(function(o){switch(o.label){case 0:t=f.getInstance(),l.pageView(e),o.label=1;case 1:return o.trys.push([1,4,,5]),e===d.PRODUCT&&(s=i,l.productView(s),t.customerStore.onProductView(s.id,s.selectedVariant.id)),e===d.CATEGORY&&(m=null===(r=(n=i).categoryPathItems)||void 0===r?void 0:r.map((function(e){return e.name})).join(" > "),m=n.categoryPathItems&&(null===(a=n.categoryPathItems)||void 0===a?void 0:a.length)>0?m+" > "+n.name:n.name,l.viewCategory(m,n)),e===d.BRAND&&(p=i,l.viewBrand(p)),e!==d.CART?[3,3]:[4,t.cartStore.waitUntilInitialized()];case 2:o.sent(),l.viewCart(t.cartStore.cart),o.label=3;case 3:return[3,5];case 4:return c=o.sent(),console.error(c),[3,5];case 5:return[2]}}))}))}(w,x.pageSpecificData)}),[w,C]);var _=i.useMemo((function(){var e=U.find((function(e){return e.component.isHeader})),t=U.find((function(e){return e.component.isFooter})),o=U.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[];return i.createElement("div",{style:{position:"relative",minHeight:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between"}},i.createElement("div",null,e&&h(e,k,-1),o.map((function(e,t){return h(e,k,t)}))),t&&h(t,k,-1),i.createElement(v,null))}),[U,k]),J=i.useMemo((function(){return p.getMerchantSettings()?new n(p.getMerchantSettings()):null}),[p.getMerchantSettings()]);return i.createElement(i.Fragment,null,i.createElement(c,{pageType:w,pageTitle:b,pageDescription:S,pageSpecificData:x.pageSpecificData,canonicals:P,disableIndex:D,merchantSettings:J,addOgpMetas:I,productReviewSummary:M,pageComponentPropValues:U}),_)})),h=function(e,t,o){return i.createElement(u,{key:e.pageComponent.id,index:o,pageComponentPropValue:e,settings:t})};export{y as IkasPage,h as renderComponent};
@@ -1 +1 @@
1
- import{__extends as e,__assign as o}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import r from"./error/index.js";import{makeObservable as i,computed as n}from"mobx";import a from"../checkout/index.js";import{Observer as d}from"mobx-react-lite";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as s,IkasOrderLineItemStatus as m,IkasCheckoutRequirement as l,IkasCouponCodeRequirement as p,IkasThemeJsonComponentPropType as u}from"@ikas/storefront-models";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import{IkasCheckout as c}from"../../models/data/checkout/index.js";import{IkasCheckoutSettings as f}from"../../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{IkasOrderLineItem as v}from"../../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/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/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 j}from"@ikas/storefront-config";import{IkasPageDataInit as g}from"../../page-data-init/index.js";import{IkasBaseStore as x}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";var y=function(y){function h(e){var o=y.call(this,e)||this;return o.state={hasError:!1},o.onMouseEnter=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseOver(r.id)},o.onMouseLeave=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseLeave(r.id)},o.onClick=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onClick(r.id)},o.ref=t.createRef(),i(o,{pageComponentPropValue:n,propValues:n,isSelected:n,isHovered:n,hasNullValue:n,rendered:n,Component:n}),o}return e(h,y),h.prototype.componentDidMount=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},h.prototype.componentDidUpdate=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},h.getDerivedStateFromError=function(e){return console.error(e),{hasError:!0}},Object.defineProperty(h.prototype,"pageComponentPropValue",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.initializedPropValues.find((function(e){return e.pageComponent.id===t.id}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"propValues",{get:function(){var e,t,r=this.props.vm,i=null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.propValues;(null===(t=r.page)||void 0===t?void 0:t.type)===s.CHECKOUT&&(i={checkout:new c({currencyCode:"TRY",currencySymbol:"₺",orderLineItems:[new v({id:"",createdAt:0,updatedAt:0,currencyCode:"TRY",currencySymbol:"₺",discount:null,discountPrice:null,finalPrice:100,options:null,originalOrderLineItemId:null,price:100,quantity:1,status:m.UNFULFILLED,statusUpdatedAt:null,stockLocationId:null,taxValue:null,unitPrice:null,finalUnitPrice:null,variant:{barcodeList:null,brand:null,categories:null,fileId:null,id:null,mainImageId:null,name:"",prices:null,productId:null,sku:null,slug:null,tagIds:null,taxValue:null,type:null,weight:null,hsCode:null,variantValues:[],baseUnit:null,unit:null,tags:null,bundleProducts:null},orderedAt:0})]}),checkoutSettings:new f({createdAt:0,updatedAt:0,id:"",giftPackagePriceList:null,identityNumberRequirement:l.OPTIONAL,isAccountRequired:!1,isGiftPackageEnabled:!1,isQuickRegistrationEnabled:!1,isShowPostalCode:!0,isTermsAndConditionsDefaultChecked:null,options:null,phoneRequirement:l.OPTIONAL,postalCodeRequirement:l.OPTIONAL,showCheckoutNote:!0,showTermsAndConditionsCheckbox:!0,storefrontId:"",couponCodeRequirement:p.DEFAULT}),customizationProps:o({},i),returnPolicy:"",privacyPolicy:"",termsOfService:"",imprint:"",shippingPolicy:""});return i},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isSelected",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.selectedPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isHovered",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.hoveredPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"hasNullValue",{get:function(){var e,o=this;return!!(null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.props.some((function(e){var t;if(e.isRequired){var r=(o.propValues||{})[e.name],i=null===(t=o.pageComponentPropValue)||void 0===t?void 0:t.component.props.find((function(o){return o.id===e.requiredPropId}));if(i){var n=(o.propValues||{})[i.name];if(i.type===u.BOOLEAN&&!n||i.type===u.CUSTOM&&n!==e.requiredEnumOptionValue)return!1}return null===r||null==r}})))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"rendered",{get:function(){var e,i,n=this.Component,a=this.props.vm;return this.hasNullValue||this.state.hasError?t.createElement(r,{name:null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.displayName}):t.createElement(n,o({},this.propValues,{store:x.getInstance(),settings:null===(i=a.theme)||void 0===i?void 0:i.settings,pageSpecificData:g.pageSpecificData}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"Component",{get:function(){var e,o=this.props,t=o.vm,r=o.pageComponent,i=j.getCurrentPageComponents();if(!i)return null;var n=i[r.componentId];return(null===(e=t.page)||void 0===e?void 0:e.type)===s.CHECKOUT&&(n=a),n},enumerable:!1,configurable:!0}),h.prototype.render=function(){var e=this;return t.createElement(d,null,(function(){var o;return e.state.hasError?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onClick:e.onClick},t.createElement(r,{name:null===(o=e.pageComponentPropValue)||void 0===o?void 0:o.component.displayName})):j.getCurrentPageComponents()?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave},e.rendered):(console.error("Components for the page not found."),null)}))},h}(t.Component);export{y as ThemeEditorComponent};
1
+ import{__extends as e,__assign as o}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import r from"./error/index.js";import{makeObservable as i,computed as n}from"mobx";import a from"../checkout/index.js";import{Observer as d}from"mobx-react-lite";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as s,IkasOrderLineItemStatus as m,IkasCheckoutRequirement as p,IkasCouponCodeRequirement as l,IkasThemeJsonComponentPropType as u}from"@ikas/storefront-models";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import{IkasCheckout as c}from"../../models/data/checkout/index.js";import{IkasCheckoutSettings as f}from"../../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{IkasOrderLineItem as j}from"../../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/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../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 v}from"@ikas/storefront-config";import{IkasPageDataInit as g}from"../../page-data-init/index.js";import{IkasBaseStore as x}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";var y=function(y){function h(e){var o=y.call(this,e)||this;return o.state={hasError:!1},o.onMouseEnter=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseOver(r.id)},o.onMouseLeave=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseLeave(r.id)},o.onClick=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onClick(r.id)},o.ref=t.createRef(),i(o,{pageComponentPropValue:n,propValues:n,isSelected:n,isHovered:n,hasNullValue:n,rendered:n,Component:n}),o}return e(h,y),h.prototype.componentDidMount=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},h.prototype.componentDidUpdate=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},h.getDerivedStateFromError=function(e){return console.error(e),{hasError:!0}},Object.defineProperty(h.prototype,"pageComponentPropValue",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.initializedPropValues.find((function(e){return e.pageComponent.id===t.id}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"propValues",{get:function(){var e,t,r=this.props.vm,i=null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.propValues;(null===(t=r.page)||void 0===t?void 0:t.type)===s.CHECKOUT&&(i={checkout:new c({currencyCode:"TRY",currencySymbol:"₺",orderLineItems:[new j({id:"",createdAt:0,updatedAt:0,currencyCode:"TRY",currencySymbol:"₺",discount:null,discountPrice:null,finalPrice:100,options:null,originalOrderLineItemId:null,price:100,quantity:1,status:m.UNFULFILLED,statusUpdatedAt:null,stockLocationId:null,taxValue:null,unitPrice:null,finalUnitPrice:null,variant:{barcodeList:null,brand:null,categories:null,fileId:null,id:null,mainImageId:null,name:"",prices:null,productId:null,sku:null,slug:null,tagIds:null,taxValue:null,type:null,weight:null,hsCode:null,variantValues:[],baseUnit:null,unit:null,tags:null,bundleProducts:null},orderedAt:0})]}),checkoutSettings:new f({createdAt:0,updatedAt:0,id:"",giftPackagePriceList:null,identityNumberRequirement:p.OPTIONAL,isAccountRequired:!1,isGiftPackageEnabled:!1,isQuickRegistrationEnabled:!1,isShowPostalCode:!0,isTermsAndConditionsDefaultChecked:null,options:null,phoneRequirement:p.OPTIONAL,postalCodeRequirement:p.OPTIONAL,showCheckoutNote:!0,showTermsAndConditionsCheckbox:!0,storefrontId:"",couponCodeRequirement:l.DEFAULT,corporateInvoiceRequirement:null}),customizationProps:o({},i),returnPolicy:"",privacyPolicy:"",termsOfService:"",imprint:"",shippingPolicy:""});return i},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isSelected",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.selectedPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isHovered",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.hoveredPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"hasNullValue",{get:function(){var e,o=this;return!!(null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.props.some((function(e){var t;if(e.isRequired){var r=(o.propValues||{})[e.name],i=null===(t=o.pageComponentPropValue)||void 0===t?void 0:t.component.props.find((function(o){return o.id===e.requiredPropId}));if(i){var n=(o.propValues||{})[i.name];if(i.type===u.BOOLEAN&&!n||i.type===u.CUSTOM&&n!==e.requiredEnumOptionValue)return!1}return null===r||null==r}})))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"rendered",{get:function(){var e,i,n=this.Component,a=this.props.vm;return this.hasNullValue||this.state.hasError?t.createElement(r,{name:null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.displayName}):t.createElement(n,o({},this.propValues,{store:x.getInstance(),settings:null===(i=a.theme)||void 0===i?void 0:i.settings,pageSpecificData:g.pageSpecificData}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"Component",{get:function(){var e,o=this.props,t=o.vm,r=o.pageComponent,i=v.getCurrentPageComponents();if(!i)return null;var n=i[r.componentId];return(null===(e=t.page)||void 0===e?void 0:e.type)===s.CHECKOUT&&(n=a),n},enumerable:!1,configurable:!0}),h.prototype.render=function(){var e=this;return t.createElement(d,null,(function(){var o;return e.state.hasError?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onClick:e.onClick},t.createElement(r,{name:null===(o=e.pageComponentPropValue)||void 0===o?void 0:o.component.displayName})):v.getCurrentPageComponents()?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave},e.rendered):(console.error("Components for the page not found."),null)}))},h}(t.Component);export{y as ThemeEditorComponent};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import{IkasBlogMetaDataTargetType as o}from"../../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 n}from"@ikas/storefront-models";import{reaction as a,makeAutoObservable as s,runInAction as r}from"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{IkasHTMLMetaDataTargetType as d}from"../../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/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{IkasThemeJson as p}from"../../models/data/theme-json/index.js";import{IkasStorefront as c}from"../../models/data/storefront/index.js";import{IkasThemeJsonComponent as l}from"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import{IkasThemeJsonPageComponent as m}from"../../models/data/theme-json/page/component/index.js";import{IkasThemeJsonSettings as u}from"../../models/data/theme-json/settings/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{IkasPageDataProvider as g}from"@ikas/storefront-providers";import{IkasPageDataInit as h}from"../../page-data-init/index.js";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"../page/index.js";import"../page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"./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 f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";import E from"../../store/html-meta-data/index.js";import v from"../../store/blog/index.js";import P from"../../store/raffle/index.js";import O from"../../store/product/index.js";import{setAPIClientConfig as T,listCustomerSettings as C}from"@ikas/storefront-api";var _,j=function(){function j(a){var O=this;this.theme=null,this.page=null,this.selectedPageComponentId=null,this.hoveredPageComponentId=null,this.componentRefs={},this.isLoading=!1,this.updateId="",this.locale="en",this.pageParams={},this.apiKey=null,this.pageDataProvider=null,this.initializedPropValues=[],this.startMessaging=function(){window.addEventListener("message",O.onMessage,!1),O.sendMessage(_.FRAME_DID_LOAD,"5.0.0"),O.createLoadingListener()},this.onMessage=function(i){return e(O,void 0,void 0,(function(){var e,o;return t(this,(function(t){switch(t.label){case 0:switch(e=i.data.type,o=i.data.data,e){case _.UPDATE_FRAME_DATA:return[3,1];case _.UPDATE_THEME_JSON:return[3,3];case _.UPDATE_PROP_VALUE:return[3,5];case _.UPDATE_PAGE_PARAMS:return[3,7];case _.UPDATE_PAGE_COMPONENT_ORDER:return[3,9];case _.ADD_COMPONENT:return[3,11];case _.DELETE_COMPONENT:return[3,12];case _.UPDATE_COMPONENT:return[3,13];case _.ADD_PAGE_COMPONENT:return[3,14];case _.DELETE_PAGE_COMPONENT:return[3,16];case _.SET_SELECTED_COMPONENT:return[3,17];case _.SET_HOVERED_COMPONENT:return[3,18];case _.SCROLL_TO_COMPONENT:return[3,19];case _.EDITOR_RELOAD:return[3,20];case _.UPDATE_THEME_SETTINGS:return[3,21]}return[3,22];case 1:return[4,this.handleUpdateFrameData(o)];case 2:case 4:case 6:case 8:case 10:case 15:return t.sent(),[3,23];case 3:return[4,this.handleUpdateThemeJson(o)];case 5:return[4,this.handleUpdatePropValue(o)];case 7:return[4,this.handleUpdatePageParams(o)];case 9:return[4,this.handleUpdatePageComponentOrder(o)];case 11:return this.handleAddNewComponent(o),[3,23];case 12:return this.handleDeleteComponent(o),[3,23];case 13:return this.handleUpdateComponent(o),[3,23];case 14:return[4,this.handleAddNewPageComponent(o)];case 16:return this.handleDeletePageComponent(o),[3,23];case 17:return this.handleSetSelectedComponent(o),[3,23];case 18:return this.handleSetHoveredComponent(o),[3,23];case 19:return this.handleScrollToComponent(o),[3,23];case 20:return this.handleEditorReload(),[3,23];case 21:return this.updateThemeSettings(o),[3,23];case 22:return[3,23];case 23:return[2]}}))}))},this.onClick=function(e){O.sendMessage(_.COMPONENT_CLICK,{componentId:e})},this.onMouseOver=function(e){O.sendMessage(_.COMPONENT_MOUSE_OVER,{componentId:e})},this.onMouseLeave=function(e){O.sendMessage(_.COMPONENT_MOUSE_LEAVE,{componentId:e})},this.onPageChange=function(i){return e(O,void 0,void 0,(function(){var e,a,s,p,c,l,m,u,g,h,O,T,C,j=this;return t(this,(function(t){switch(t.label){case 0:return e=i.slice(1),a=e.split("?"),e=a[0],s=a[1],this.pageParams={},i.startsWith("/account/orders/")?p=n.ORDER_DETAIL:i.startsWith("/account/orders")?p=n.ORDERS:i.startsWith("/account/addresses")?p=n.ADDRESSES:i.startsWith("/account/favorite-products")?p=n.FAVORITE_PRODUCTS:i.startsWith("/account/forgot-password")?p=n.FORGOT_PASSWORD:i.startsWith("/account/login")?p=n.LOGIN:i.startsWith("/account/raffles")?p=n.RAFFLE_ACCOUNT:i.startsWith("/account/recover-password")?p=n.RECOVER_PASSWORD:i.startsWith("/account/activate")?p=n.ACTIVATE_CUSTOMER:i.startsWith("/account/register")?p=n.REGISTER:i.startsWith("/account")?p=n.ACCOUNT:i.startsWith("/blog/")?p=n.BLOG:i.startsWith("/blog")?p=n.BLOG_INDEX:i.startsWith("/pages")?(p=n.CUSTOM,this.pageParams={slug:e.split("/")[1]}):p=i.startsWith("/raffle/")?n.RAFFLE_DETAIL:i.startsWith("/raffle")?n.RAFFLE:i.startsWith("/404")?n.NOT_FOUND:"/cart"===i||"/cart/"===i?n.CART:i.startsWith("/checkout")?n.CHECKOUT:"/"===i?n.INDEX:i.startsWith("/search")?n.SEARCH:n.PRODUCT,p!==n.PRODUCT?[3,6]:[4,E.listHTMLMetaData({slug:{eq:e}})];case 1:return(l=t.sent()).isSuccess&&(null===(g=l.data)||void 0===g?void 0:g.length)?(m=l.data[0]).targetType!==d.PRODUCT?[3,3]:[4,this.getVariantIdFromParams(m.targetId,s)]:[3,5];case 2:return c=t.sent(),this.pageParams={productId:m.targetId,variantId:c,slug:e},[3,4];case 3:if(m.targetType===d.CATEGORY)p=n.CATEGORY,this.pageParams={categoryId:m.targetId,slug:e};else{if(m.targetType!==d.BRAND)return[2];p=n.BRAND,this.pageParams={brandId:m.targetId,slug:e}}t.label=4;case 4:return[3,6];case 5:return[2];case 6:return p!==n.BLOG?[3,8]:[4,v.listBlogMetaData({slug:{eq:e}})];case 7:if(!(l=t.sent()).isSuccess||!(null===(O=null===(h=l.data)||void 0===h?void 0:h.data)||void 0===O?void 0:O.length))return[2];if((m=l.data.data[0]).targetType===o.BLOG)this.pageParams={blogId:m.targetId,slug:e};else{if(m.targetType!==o.BLOG_CATEGORY)return[2];p=n.BLOG_CATEGORY,this.pageParams={blogCategoryId:m.targetId,slug:e}}t.label=8;case 8:return p!==n.RAFFLE_DETAIL?[3,10]:[4,P.listRaffleMetaData({slug:{eq:e}})];case 9:if(!(l=t.sent()).isSuccess||!(null===(T=l.data)||void 0===T?void 0:T.length))return[2];m=l.data[0],this.pageParams={raffleId:m.targetId,slug:e},t.label=10;case 10:return this.isLoading=!0,[4,this.getPagePropValues(this.theme,p,this.pageParams)];case 11:return u=t.sent(),r((function(){var e,t;f.getInstance().currentPageType=p,j.pageDataProvider=u,p===n.CUSTOM?j.page=null===(e=j.theme)||void 0===e?void 0:e.pages.find((function(e){return e.type===p&&e.slug===j.pageParams.slug})):j.page=null===(t=j.theme)||void 0===t?void 0:t.pages.find((function(e){return e.type===p})),j.setCurrentPageType(),requestAnimationFrame((function(){document.body.scrollTop=0,document.scrollingElement&&(document.scrollingElement.scrollTop=0)}))})),this.sendMessage(_.EDITOR_PAGE_CHANGE,{pageType:p,pageParams:this.pageParams,pageSpecificData:(null===(C=this.pageDataProvider)||void 0===C?void 0:C.pageSpecificData)||null}),this.isLoading=!1,[2]}}))}))},this.onLoadingChange=function(){O.sendMessage(_.EDITOR_LOADING_CHANGE,{isLoading:O.isLoading})},this.sendMessage=function(e,t){window.parent.postMessage({type:e,data:JSON.parse(JSON.stringify(t))},"*")},this.getPagePropValues=function(i,o,a){return e(O,void 0,void 0,(function(){var e,s,r;return t(this,(function(t){switch(t.label){case 0:return e=new g(i,a,o),(a.blogId||a.blogCategoryId)&&(e.possiblePageTypes=[n.BLOG,n.BLOG_CATEGORY]),a.raffleId&&(e.possiblePageTypes=[n.RAFFLE_DETAIL]),[4,e.getPageData()];case 1:return t.sent(),e.pageSpecificData?(h.setPageSpecificData(e.pageSpecificData,o,!0),o===n.PRODUCT&&h.pageSpecificData&&(s=h.pageSpecificData,(r=s.variants.find((function(e){return e.id===a.variantId})))&&(s.selectedVariantValues=r.variantValues))):h.pageSpecificData=void 0,this.initializedPropValues=h.initPagePropValues(e.$pageComponentPropValues,i.components,i.customData,i.settings,!1),[2,e]}}))}))},this.setComponentRef=function(e,t){O.componentRefs[t.id]=e},this.isScrolledIntoView=function(e){var t=e.getBoundingClientRect(),i=t.top,o=t.bottom;return i<window.innerHeight&&o>=0&&o<window.innerHeight&&i>0},this.handleUpdateFrameData=function(o){return e(O,void 0,void 0,(function(){var e,n,a,s,r,d,l=this;return t(this,(function(t){switch(t.label){case 0:return this.theme=new p(o.theme),this.page=null===(r=this.theme)||void 0===r?void 0:r.pages.find((function(e){return e.id===o.selectedPage.id})),this.pageParams=o.pageParams,this.apiKey=o.apiKey,this.locale=o.locale||"en",this.translations=o.translations||void 0,this.setCurrentPageType(),this.page?((e=o.storefront?new c(o.storefront):null)&&(n=e.routings.find((function(e){return e.locale===l.locale})),i.init({storefrontId:e.id,storefrontRoutingId:null==n?void 0:n.id,storefrontThemeId:e.mainStorefrontThemeId||void 0,salesChannelId:e.salesChannelId||void 0,priceListId:(null==n?void 0:n.priceListId)||void 0,routings:e.routings,stockPreference:null===(d=this.theme)||void 0===d?void 0:d.settings.stockPreference,translations:this.translations||i.getTranslations(),isEditor:!0,apiKey:o.apiKey,apiUrl:o.apiUrl,cdnUrl:o.cdnUrl,merchantSettings:o.merchantSettings}),T(),this.setCustomerSettings()),a=Date.now()+"",this.updateId=a,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})]):[2];case 1:return s=t.sent(),this.updateId===a&&(this.pageDataProvider=s,this.isLoading=!1),[2]}}))}))},this.setCustomerSettings=function(){return e(O,void 0,void 0,(function(){var e,o,n;return t(this,(function(t){switch(t.label){case 0:return i.getCustomerSettings()?[3,2]:[4,C({storefrontId:{eq:i.getStorefrontId()}})];case 1:(e=t.sent()).isSuccess&&(null===(n=e.data)||void 0===n?void 0:n.data.length)&&(o=e.data.data[0],i.init({customerSettings:o})),t.label=2;case 2:return[2]}}))}))},this.handleUpdateThemeJson=function(i){return e(O,void 0,void 0,(function(){return t(this,(function(e){return this.theme=new p(i.theme),[2]}))}))},this.handleUpdatePropValue=function(i){return e(O,void 0,void 0,(function(){var e,o,n,a,s,r,d,p=this;return t(this,(function(t){switch(t.label){case 0:return e=i.propName,o=i.value,(n=null===(d=null===(r=this.selectedComponent)||void 0===r?void 0:r.props)||void 0===d?void 0:d.find((function(t){return t.name===e})))&&this.selectedPageComponent?(a=this.initializedPropValues.find((function(e){return e.pageComponent.id===p.selectedPageComponentId})),this.pageDataProvider&&a?(this.selectedPageComponent.propValues[e]=o,[4,this.pageDataProvider.getPageComponentPropValue(this.selectedPageComponent,n)]):[2]):[2];case 1:return(s=t.sent())&&JSON.stringify(s).includes("href")?[4,this.pageDataProvider.setLinkSlugs()]:[3,3];case 2:t.sent(),t.label=3;case 3:return a.propValues[e]=h.initPropValue(n,s,this.theme.settings,!0),[2]}}))}))},this.handleUpdatePageParams=function(i){return e(O,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageParams=i.pageParams,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})];case 1:return e=t.sent(),this.pageDataProvider=e,this.isLoading=!1,[2]}}))}))},this.handleUpdatePageComponentOrder=function(i){return e(O,void 0,void 0,(function(){return t(this,(function(e){return this.specification?this.specification.components=i.pageComponents.map((function(e){return new m(e)})):this.page.components=i.pageComponents.map((function(e){return new m(e)})),[2]}))}))},this.handleAddNewComponent=function(e){var t,i=new l(e.component);null===(t=O.theme)||void 0===t||t.components.push(i)},this.handleDeleteComponent=function(e){var t,i;(null===(t=O.theme)||void 0===t?void 0:t.components)&&(O.theme.components=O.theme.components.filter((function(t){return t.id!==e.componentId})));var o=O.pageComponents.filter((function(t){return t.componentId!==e.componentId}))||[];O.specification&&O.specification.components&&(O.specification.components=o),!O.specification&&(null===(i=O.page)||void 0===i?void 0:i.components)&&(O.page.components=o)},this.handleUpdateComponent=function(e){var t=O.theme.components.findIndex((function(t){return t.id===e.component.id}));-1!==t&&(O.theme.components[t]=new l(e.component))},this.handleAddNewPageComponent=function(i){return e(O,void 0,void 0,(function(){var e,o,a,s,r,d,p;return t(this,(function(t){switch(t.label){case 0:return e=new m(i.pageComponent),this.pageComponents.some((function(t){return t.id===e.id}))?[2]:[4,this.pageDataProvider.getPageComponentPropValues(e)];case 1:return o=t.sent(),a=h.initPageComponentPropValue(o,[o.component],this.theme.settings,!0),this.initializedPropValues.push(a),(null===(d=this.page)||void 0===d?void 0:d.type)===n.CHECKOUT?[2]:(s=null===(p=this.theme)||void 0===p?void 0:p.components.find((function(t){return t.id===e.componentId})),r=this.pageComponents.find((function(e){return e.componentId===(null==s?void 0:s.id)})),(null==s?void 0:s.isCommon)&&r||(i.customIndex?this.pageComponents.splice(i.customIndex,0,e):this.pageComponents.push(e)),[2])}}))}))},this.handleDeletePageComponent=function(e){O.specification?O.specification.components=O.pageComponents.filter((function(t){return t.id!==e.pageComponentId})):O.page.components=O.pageComponents.filter((function(t){return t.id!==e.pageComponentId}))},this.handleSetSelectedComponent=function(e){O.selectedPageComponentId=e.componentId},this.handleSetHoveredComponent=function(e){O.hoveredPageComponentId=e.componentId},this.handleScrollToComponent=function(e){var t=e.componentId,i=O.componentRefs[t];i&&(O.isScrolledIntoView(i)||window.scrollTo({top:i.offsetTop,behavior:"smooth"}))},this.handleEditorReload=function(){window.location.reload()},this.updateThemeSettings=function(e){var t=e.settings;O.theme&&(O.theme.settings=new u(t))},this.router=a,s(this),this.startMessaging()}return Object.defineProperty(j.prototype,"specification",{get:function(){var e,t,i,o,a,s,r,d=this,p=this.page;return(null==p?void 0:p.type)===n.PRODUCT&&(r=null===(e=p.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.productId)}))),(null==p?void 0:p.type)===n.CATEGORY&&(r=null===(t=p.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.categoryId)}))),(null==p?void 0:p.type)===n.BRAND&&(r=null===(i=p.specifications)||void 0===i?void 0:i.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.brandId)}))),(null==p?void 0:p.type)===n.BLOG&&(r=null===(o=p.specifications)||void 0===o?void 0:o.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogId)}))),(null==p?void 0:p.type)===n.BLOG_CATEGORY&&(r=null===(a=p.specifications)||void 0===a?void 0:a.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogCategoryId)}))),(null==p?void 0:p.type)===n.RAFFLE_DETAIL&&(r=null===(s=p.specifications)||void 0===s?void 0:s.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.raffleId)}))),r},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"pageComponents",{get:function(){var e;return this.specification?this.specification.components:(null===(e=this.page)||void 0===e?void 0:e.components)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedPageComponent",{get:function(){var e=this;return this.pageComponents.find((function(t){return t.id===e.selectedPageComponentId}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedComponent",{get:function(){var e,t=this;return null===(e=this.theme)||void 0===e?void 0:e.components.find((function(e){var i;return e.id===(null===(i=t.selectedPageComponent)||void 0===i?void 0:i.componentId)}))},enumerable:!1,configurable:!0}),j.prototype.createLoadingListener=function(){var e=this;a((function(){return e.isLoading}),(function(){e.onLoadingChange()}))},j.prototype.getVariantIdFromParams=function(o,n){var a,s;return e(this,void 0,void 0,(function(){var e,r,d,p,c,l,m;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=new URLSearchParams("?"+n),[4,O.searchProducts({input:{productIdList:[o],priceListId:i.getPriceListId(),salesChannelId:i.getSalesChannelId()}})];case 1:return(r=t.sent()).isSuccess&&!(null===(s=null===(a=null==r?void 0:r.data)||void 0===a?void 0:a.data)||void 0===s?void 0:s.length)?[2]:(d=r.data.data[0],p=d.variantTypes.map((function(e){return e.variantType.slug})),c=[],p.forEach((function(t,i){var o=d.variantTypes[i],n=e.get(t);if(n){var a=o.variantType.values.find((function(e){return e.slug===n}));a&&c.push(a)}})),(l=d.variants.find((function(e){return e.variantValues.every((function(e){return c.some((function(t){return t.id===e.id}))}))})))?[2,l.id]:[3,3]);case 2:return m=t.sent(),console.error(m),[3,3];case 3:return[2]}}))}))},j.prototype.setCurrentPageType=function(){this.page&&(f.getInstance().currentPageType=this.page.type)},j}();!function(e){e.FRAME_DID_LOAD="FRAME_DID_LOAD",e.UPDATE_FRAME_DATA="UPDATE_FRAME_DATA",e.UPDATE_THEME_JSON="UPDATE_THEME_JSON",e.UPDATE_PROP_VALUE="UPDATE_PROP_VALUE",e.UPDATE_PAGE_PARAMS="UPDATE_PAGE_PARAMS",e.UPDATE_PAGE_COMPONENT_ORDER="UPDATE_PAGE_COMPONENT_ORDER",e.ADD_COMPONENT="ADD_COMPONENT",e.DELETE_COMPONENT="DELETE_COMPONENT",e.UPDATE_COMPONENT="UPDATE_COMPONENT",e.ADD_PAGE_COMPONENT="ADD_PAGE_COMPONENT",e.DELETE_PAGE_COMPONENT="DELETE_PAGE_COMPONENT",e.COMPONENT_MOUSE_OVER="COMPONENT_MOUSE_OVER",e.COMPONENT_MOUSE_LEAVE="COMPONENT_MOUSE_LEAVE",e.COMPONENT_CLICK="COMPONENT_CLICK",e.SET_SELECTED_COMPONENT="SET_SELECTED_COMPONENT",e.SET_HOVERED_COMPONENT="SET_HOVERED_COMPONENT",e.SCROLL_TO_COMPONENT="SCROLL_TO_COMPONENT",e.UPDATE_THEME_SETTINGS="UPDATE_THEME_SETTINGS",e.EDITOR_PAGE_CHANGE="EDITOR_PAGE_CHANGE",e.EDITOR_LOADING_CHANGE="EDITOR_LOADING_CHANGE",e.EDITOR_RELOAD="EDITOR_RELOAD"}(_||(_={}));export{_ as BridgeMessageType,j as default};
1
+ import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as o}from"@ikas/storefront-config";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import{IkasBlogMetaDataTargetType as i}from"../../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 n}from"@ikas/storefront-models";import{reaction as s,makeAutoObservable as a,runInAction as r}from"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{IkasHTMLMetaDataTargetType as d}from"../../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/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{IkasThemeJson as p}from"../../models/data/theme-json/index.js";import{IkasStorefront as l}from"../../models/data/storefront/index.js";import{IkasThemeJsonComponent as c}from"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import{IkasThemeJsonPageComponent as m}from"../../models/data/theme-json/page/component/index.js";import{IkasThemeJsonSettings as u}from"../../models/data/theme-json/settings/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{IkasPageDataProvider as g}from"@ikas/storefront-providers";import{IkasPageDataInit as h}from"../../page-data-init/index.js";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"../page/index.js";import"../page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"./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 f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";import E from"../../store/html-meta-data/index.js";import v from"../../store/blog/index.js";import P from"../../store/raffle/index.js";import O from"../../store/product/index.js";import{setAPIClientConfig as T,listCustomerSettings as C}from"@ikas/storefront-api";var _,j=function(){function j(s){var O=this;this.theme=null,this.page=null,this.selectedPageComponentId=null,this.hoveredPageComponentId=null,this.componentRefs={},this.isLoading=!1,this.updateId="",this.locale="en",this.pageParams={},this.apiKey=null,this.pageDataProvider=null,this.initializedPropValues=[],this.startMessaging=function(){window.addEventListener("message",O.onMessage,!1),O.sendMessage(_.FRAME_DID_LOAD,"5.0.0"),O.createLoadingListener()},this.onMessage=function(o){return e(O,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:switch(e=o.data.type,i=o.data.data,e){case _.UPDATE_FRAME_DATA:return[3,1];case _.UPDATE_THEME_JSON:return[3,3];case _.UPDATE_PROP_VALUE:return[3,5];case _.UPDATE_PAGE_PARAMS:return[3,7];case _.UPDATE_PAGE_COMPONENT_ORDER:return[3,9];case _.ADD_COMPONENT:return[3,11];case _.DELETE_COMPONENT:return[3,12];case _.UPDATE_COMPONENT:return[3,13];case _.ADD_PAGE_COMPONENT:return[3,14];case _.DELETE_PAGE_COMPONENT:return[3,16];case _.SET_SELECTED_COMPONENT:return[3,17];case _.SET_HOVERED_COMPONENT:return[3,18];case _.SCROLL_TO_COMPONENT:return[3,19];case _.EDITOR_RELOAD:return[3,20];case _.UPDATE_THEME_SETTINGS:return[3,21]}return[3,22];case 1:return[4,this.handleUpdateFrameData(i)];case 2:case 4:case 6:case 8:case 10:case 15:return t.sent(),[3,23];case 3:return[4,this.handleUpdateThemeJson(i)];case 5:return[4,this.handleUpdatePropValue(i)];case 7:return[4,this.handleUpdatePageParams(i)];case 9:return[4,this.handleUpdatePageComponentOrder(i)];case 11:return this.handleAddNewComponent(i),[3,23];case 12:return this.handleDeleteComponent(i),[3,23];case 13:return this.handleUpdateComponent(i),[3,23];case 14:return[4,this.handleAddNewPageComponent(i)];case 16:return this.handleDeletePageComponent(i),[3,23];case 17:return this.handleSetSelectedComponent(i),[3,23];case 18:return this.handleSetHoveredComponent(i),[3,23];case 19:return this.handleScrollToComponent(i),[3,23];case 20:return this.handleEditorReload(),[3,23];case 21:return this.updateThemeSettings(i),[3,23];case 22:return[3,23];case 23:return[2]}}))}))},this.onClick=function(e){O.sendMessage(_.COMPONENT_CLICK,{componentId:e})},this.onMouseOver=function(e){O.sendMessage(_.COMPONENT_MOUSE_OVER,{componentId:e})},this.onMouseLeave=function(e){O.sendMessage(_.COMPONENT_MOUSE_LEAVE,{componentId:e})},this.onPageChange=function(o){return e(O,void 0,void 0,(function(){var e,s,a,p,l,c,m,u,g,h,O,T,C,j=this;return t(this,(function(t){switch(t.label){case 0:return e=o.slice(1),s=e.split("?"),e=s[0],a=s[1],this.pageParams={},o.startsWith("/account/orders/")?p=n.ORDER_DETAIL:o.startsWith("/account/orders")?p=n.ORDERS:o.startsWith("/account/addresses")?p=n.ADDRESSES:o.startsWith("/account/favorite-products")?p=n.FAVORITE_PRODUCTS:o.startsWith("/account/forgot-password")?p=n.FORGOT_PASSWORD:o.startsWith("/account/login")?p=n.LOGIN:o.startsWith("/account/raffles")?p=n.RAFFLE_ACCOUNT:o.startsWith("/account/recover-password")?p=n.RECOVER_PASSWORD:o.startsWith("/account/activate")?p=n.ACTIVATE_CUSTOMER:o.startsWith("/account/register")?p=n.REGISTER:o.startsWith("/account")?p=n.ACCOUNT:o.startsWith("/blog/")?p=n.BLOG:o.startsWith("/blog")?p=n.BLOG_INDEX:o.startsWith("/pages")?(p=n.CUSTOM,this.pageParams={slug:e.split("/")[1]}):p=o.startsWith("/raffle/")?n.RAFFLE_DETAIL:o.startsWith("/raffle")?n.RAFFLE:o.startsWith("/404")?n.NOT_FOUND:"/cart"===o||"/cart/"===o?n.CART:o.startsWith("/checkout")?n.CHECKOUT:"/"===o?n.INDEX:o.startsWith("/search")?n.SEARCH:n.PRODUCT,p!==n.PRODUCT?[3,6]:[4,E.listHTMLMetaData({slug:{eq:e}})];case 1:return(c=t.sent()).isSuccess&&(null===(g=c.data)||void 0===g?void 0:g.length)?(m=c.data[0]).targetType!==d.PRODUCT?[3,3]:[4,this.getVariantIdFromParams(m.targetId,a)]:[3,5];case 2:return l=t.sent(),this.pageParams={productId:m.targetId,variantId:l,slug:e},[3,4];case 3:if(m.targetType===d.CATEGORY)p=n.CATEGORY,this.pageParams={categoryId:m.targetId,slug:e};else{if(m.targetType!==d.BRAND)return[2];p=n.BRAND,this.pageParams={brandId:m.targetId,slug:e}}t.label=4;case 4:return[3,6];case 5:return[2];case 6:return p!==n.BLOG?[3,8]:[4,v.listBlogMetaData({slug:{eq:e}})];case 7:if(!(c=t.sent()).isSuccess||!(null===(O=null===(h=c.data)||void 0===h?void 0:h.data)||void 0===O?void 0:O.length))return[2];if((m=c.data.data[0]).targetType===i.BLOG)this.pageParams={blogId:m.targetId,slug:e};else{if(m.targetType!==i.BLOG_CATEGORY)return[2];p=n.BLOG_CATEGORY,this.pageParams={blogCategoryId:m.targetId,slug:e}}t.label=8;case 8:return p!==n.RAFFLE_DETAIL?[3,10]:[4,P.listRaffleMetaData({slug:{eq:e}})];case 9:if(!(c=t.sent()).isSuccess||!(null===(T=c.data)||void 0===T?void 0:T.length))return[2];m=c.data[0],this.pageParams={raffleId:m.targetId,slug:e},t.label=10;case 10:return this.isLoading=!0,[4,this.getPagePropValues(this.theme,p,this.pageParams)];case 11:return u=t.sent(),r((function(){var e,t;f.getInstance().currentPageType=p,j.pageDataProvider=u,p===n.CUSTOM?j.page=null===(e=j.theme)||void 0===e?void 0:e.pages.find((function(e){return e.type===p&&e.slug===j.pageParams.slug})):j.page=null===(t=j.theme)||void 0===t?void 0:t.pages.find((function(e){return e.type===p})),j.setCurrentPageType(),requestAnimationFrame((function(){document.body.scrollTop=0,document.scrollingElement&&(document.scrollingElement.scrollTop=0)}))})),this.sendMessage(_.EDITOR_PAGE_CHANGE,{pageType:p,pageParams:this.pageParams,pageSpecificData:(null===(C=this.pageDataProvider)||void 0===C?void 0:C.pageSpecificData)||null}),this.isLoading=!1,[2]}}))}))},this.onLoadingChange=function(){O.sendMessage(_.EDITOR_LOADING_CHANGE,{isLoading:O.isLoading})},this.sendMessage=function(e,t){window.parent.postMessage({type:e,data:JSON.parse(JSON.stringify(t))},"*")},this.getPagePropValues=function(o,i,s){return e(O,void 0,void 0,(function(){var e,a,r;return t(this,(function(t){switch(t.label){case 0:return e=new g(o,s,i),(s.blogId||s.blogCategoryId)&&(e.possiblePageTypes=[n.BLOG,n.BLOG_CATEGORY]),s.raffleId&&(e.possiblePageTypes=[n.RAFFLE_DETAIL]),[4,e.getPageData()];case 1:return t.sent(),e.pageSpecificData?(h.setPageSpecificData(e.pageSpecificData,i,!0),i===n.PRODUCT&&h.pageSpecificData&&(a=h.pageSpecificData,(r=a.variants.find((function(e){return e.id===s.variantId})))&&(a.selectedVariantValues=r.variantValues))):h.pageSpecificData=void 0,this.initializedPropValues=h.initPagePropValues(e.$pageComponentPropValues,o.components,o.customData,o.settings,!1),[2,e]}}))}))},this.setComponentRef=function(e,t){O.componentRefs[t.id]=e},this.isScrolledIntoView=function(e){var t=e.getBoundingClientRect(),o=t.top,i=t.bottom;return o<window.innerHeight&&i>=0&&i<window.innerHeight&&o>0},this.handleUpdateFrameData=function(i){return e(O,void 0,void 0,(function(){var e,n,s,a,r,d,c=this;return t(this,(function(t){switch(t.label){case 0:return this.theme=new p(i.theme),this.page=null===(r=this.theme)||void 0===r?void 0:r.pages.find((function(e){return e.id===i.selectedPage.id})),this.pageParams=i.pageParams,this.apiKey=i.apiKey,this.locale=i.locale||"en",this.translations=i.translations||void 0,this.setCurrentPageType(),this.page?((e=i.storefront?new l(i.storefront):null)&&(n=e.routings.find((function(e){return e.locale===c.locale})),o.init({storefrontId:e.id,storefrontRoutingId:null==n?void 0:n.id,storefrontThemeId:e.mainStorefrontThemeId||void 0,salesChannelId:e.salesChannelId||void 0,priceListId:(null==n?void 0:n.priceListId)||void 0,routings:e.routings,stockPreference:null===(d=this.theme)||void 0===d?void 0:d.settings.stockPreference,translations:this.translations||o.getTranslations(),isEditor:!0,apiKey:i.apiKey,apiUrl:i.apiUrl,cdnUrl:i.cdnUrl,merchantSettings:i.merchantSettings}),T(),this.setCustomerSettings()),s=Date.now()+"",this.updateId=s,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})]):[2];case 1:return a=t.sent(),this.updateId===s&&(this.pageDataProvider=a,this.isLoading=!1),[2]}}))}))},this.setCustomerSettings=function(){return e(O,void 0,void 0,(function(){var e,i,n;return t(this,(function(t){switch(t.label){case 0:return o.getCustomerSettings()?[3,2]:[4,C({storefrontId:{eq:o.getStorefrontId()}})];case 1:(e=t.sent()).isSuccess&&(null===(n=e.data)||void 0===n?void 0:n.data.length)&&(i=e.data.data[0],o.init({customerSettings:i})),t.label=2;case 2:return[2]}}))}))},this.handleUpdateThemeJson=function(o){return e(O,void 0,void 0,(function(){return t(this,(function(e){return this.theme=new p(o.theme),[2]}))}))},this.handleUpdatePropValue=function(o){return e(O,void 0,void 0,(function(){var e,i,n,s,a,r,d,p=this;return t(this,(function(t){switch(t.label){case 0:return e=o.propName,i=o.value,(n=null===(d=null===(r=this.selectedComponent)||void 0===r?void 0:r.props)||void 0===d?void 0:d.find((function(t){return t.name===e})))&&this.selectedPageComponent?(s=this.initializedPropValues.find((function(e){return e.pageComponent.id===p.selectedPageComponentId})),this.pageDataProvider&&s?(this.selectedPageComponent.propValues[e]=i,[4,this.pageDataProvider.getPageComponentPropValue(this.selectedPageComponent,n)]):[2]):[2];case 1:return(a=t.sent())&&JSON.stringify(a).includes("href")?[4,this.pageDataProvider.setLinkSlugs()]:[3,3];case 2:t.sent(),t.label=3;case 3:return s.propValues[e]=h.initPropValue(n,a,this.theme.settings,!0),[2]}}))}))},this.handleUpdatePageParams=function(o){return e(O,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageParams=o.pageParams,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})];case 1:return e=t.sent(),this.pageDataProvider=e,this.isLoading=!1,[2]}}))}))},this.handleUpdatePageComponentOrder=function(o){return e(O,void 0,void 0,(function(){return t(this,(function(e){return this.specification?this.specification.components=o.pageComponents.map((function(e){return new m(e)})):this.page.components=o.pageComponents.map((function(e){return new m(e)})),[2]}))}))},this.handleAddNewComponent=function(e){var t,o=new c(e.component);null===(t=O.theme)||void 0===t||t.components.push(o)},this.handleDeleteComponent=function(e){var t,o;(null===(t=O.theme)||void 0===t?void 0:t.components)&&(O.theme.components=O.theme.components.filter((function(t){return t.id!==e.componentId})));var i=O.pageComponents.filter((function(t){return t.componentId!==e.componentId}))||[];O.specification&&O.specification.components&&(O.specification.components=i),!O.specification&&(null===(o=O.page)||void 0===o?void 0:o.components)&&(O.page.components=i)},this.handleUpdateComponent=function(e){var t=O.theme.components.findIndex((function(t){return t.id===e.component.id}));-1!==t&&(O.theme.components[t]=new c(e.component))},this.handleAddNewPageComponent=function(o){return e(O,void 0,void 0,(function(){var e,i,s,a,r,d,p;return t(this,(function(t){switch(t.label){case 0:return e=new m(o.pageComponent),this.pageComponents.some((function(t){return t.id===e.id}))?[2]:[4,this.pageDataProvider.getPageComponentPropValues(e)];case 1:return i=t.sent(),s=h.initPageComponentPropValue(i,[i.component],this.theme.settings,!0),this.initializedPropValues.push(s),(null===(d=this.page)||void 0===d?void 0:d.type)===n.CHECKOUT?[2]:(a=null===(p=this.theme)||void 0===p?void 0:p.components.find((function(t){return t.id===e.componentId})),r=this.pageComponents.find((function(e){return e.componentId===(null==a?void 0:a.id)})),(null==a?void 0:a.isCommon)&&r||(o.customIndex?this.pageComponents.splice(o.customIndex,0,e):this.pageComponents.push(e)),[2])}}))}))},this.handleDeletePageComponent=function(e){O.specification?O.specification.components=O.pageComponents.filter((function(t){return t.id!==e.pageComponentId})):O.page.components=O.pageComponents.filter((function(t){return t.id!==e.pageComponentId}))},this.handleSetSelectedComponent=function(e){O.selectedPageComponentId=e.componentId},this.handleSetHoveredComponent=function(e){O.hoveredPageComponentId=e.componentId},this.handleScrollToComponent=function(e){var t=e.componentId,o=O.componentRefs[t];o&&(O.isScrolledIntoView(o)||window.scrollTo({top:o.offsetTop,behavior:"smooth"}))},this.handleEditorReload=function(){window.location.reload()},this.updateThemeSettings=function(e){var t=e.settings;O.theme&&(O.theme.settings=new u(t))},this.router=s,a(this),this.startMessaging()}return Object.defineProperty(j.prototype,"specification",{get:function(){var e,t,o,i,s,a,r,d=this,p=this.page;return(null==p?void 0:p.type)===n.PRODUCT&&(r=null===(e=p.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.productId)}))),(null==p?void 0:p.type)===n.CATEGORY&&(r=null===(t=p.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.categoryId)}))),(null==p?void 0:p.type)===n.BRAND&&(r=null===(o=p.specifications)||void 0===o?void 0:o.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.brandId)}))),(null==p?void 0:p.type)===n.BLOG&&(r=null===(i=p.specifications)||void 0===i?void 0:i.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogId)}))),(null==p?void 0:p.type)===n.BLOG_CATEGORY&&(r=null===(s=p.specifications)||void 0===s?void 0:s.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogCategoryId)}))),(null==p?void 0:p.type)===n.RAFFLE_DETAIL&&(r=null===(a=p.specifications)||void 0===a?void 0:a.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.raffleId)}))),r},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"pageComponents",{get:function(){var e;return this.specification?this.specification.components:(null===(e=this.page)||void 0===e?void 0:e.components)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedPageComponent",{get:function(){var e=this;return this.pageComponents.find((function(t){return t.id===e.selectedPageComponentId}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedComponent",{get:function(){var e,t=this;return null===(e=this.theme)||void 0===e?void 0:e.components.find((function(e){var o;return e.id===(null===(o=t.selectedPageComponent)||void 0===o?void 0:o.componentId)}))},enumerable:!1,configurable:!0}),j.prototype.createLoadingListener=function(){var e=this;s((function(){return e.isLoading}),(function(){e.onLoadingChange()}))},j.prototype.getVariantIdFromParams=function(i,n){var s,a;return e(this,void 0,void 0,(function(){var e,r,d,p,l,c,m;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=new URLSearchParams("?"+n),[4,O.searchProducts({input:{productIdList:[i],priceListId:o.getPriceListId(),salesChannelId:o.getSalesChannelId()}})];case 1:return(r=t.sent()).isSuccess&&!(null===(a=null===(s=null==r?void 0:r.data)||void 0===s?void 0:s.data)||void 0===a?void 0:a.length)?[2]:(d=r.data.data[0],p=d.variantTypes.map((function(e){return e.variantType.slug})),l=[],p.forEach((function(t,o){var i=d.variantTypes[o],n=e.get(t);if(n){var s=i.variantType.values.find((function(e){return e.slug===n}));s&&l.push(s)}})),(c=d.variants.find((function(e){return e.variantValues.every((function(e){return l.some((function(t){return t.id===e.id}))}))})))?[2,c.id]:[3,3]);case 2:return m=t.sent(),console.error(m),[3,3];case 3:return[2]}}))}))},j.prototype.setCurrentPageType=function(){this.page&&(f.getInstance().currentPageType=this.page.type)},j}();!function(e){e.FRAME_DID_LOAD="FRAME_DID_LOAD",e.UPDATE_FRAME_DATA="UPDATE_FRAME_DATA",e.UPDATE_THEME_JSON="UPDATE_THEME_JSON",e.UPDATE_PROP_VALUE="UPDATE_PROP_VALUE",e.UPDATE_PAGE_PARAMS="UPDATE_PAGE_PARAMS",e.UPDATE_PAGE_COMPONENT_ORDER="UPDATE_PAGE_COMPONENT_ORDER",e.ADD_COMPONENT="ADD_COMPONENT",e.DELETE_COMPONENT="DELETE_COMPONENT",e.UPDATE_COMPONENT="UPDATE_COMPONENT",e.ADD_PAGE_COMPONENT="ADD_PAGE_COMPONENT",e.DELETE_PAGE_COMPONENT="DELETE_PAGE_COMPONENT",e.COMPONENT_MOUSE_OVER="COMPONENT_MOUSE_OVER",e.COMPONENT_MOUSE_LEAVE="COMPONENT_MOUSE_LEAVE",e.COMPONENT_CLICK="COMPONENT_CLICK",e.SET_SELECTED_COMPONENT="SET_SELECTED_COMPONENT",e.SET_HOVERED_COMPONENT="SET_HOVERED_COMPONENT",e.SCROLL_TO_COMPONENT="SCROLL_TO_COMPONENT",e.UPDATE_THEME_SETTINGS="UPDATE_THEME_SETTINGS",e.EDITOR_PAGE_CHANGE="EDITOR_PAGE_CHANGE",e.EDITOR_LOADING_CHANGE="EDITOR_LOADING_CHANGE",e.EDITOR_RELOAD="EDITOR_RELOAD"}(_||(_={}));export{_ as BridgeMessageType,j as default};
@@ -1 +1 @@
1
- import*as e from"react";import{observer as r}from"mobx-react-lite";import{IkasStorefrontConfig as o}from"@ikas/storefront-config";import t from"../../hooks/useDimension.js";import i from"./renderer/index.js";import{checkSavedSessionForPopups as n}from"./utils/index.js";import{IkasStorefrontPopupDeviceTypeEnum as m}from"@ikas/storefront-models";var s=r((function(){var r=t().isMobile;e.useEffect((function(){n()}),[]);var s=o.getStorefrontPopups().filter((function(e){return r?[m.ALL,m.MOBILE].includes(e.visibleDevice):[m.ALL,m.DESKTOP].includes(e.visibleDevice)}));return e.createElement(e.Fragment,null,s.map((function(r,o){return e.createElement(i,{storefrontPopup:r,key:r.id})})))}));export{s as PopupListRendererForPage};
1
+ import{__spreadArray as e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as r}from"mobx-react-lite";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import o from"../../hooks/useDimension.js";import n from"./renderer/index.js";import{checkSavedSessionForPopups as s}from"./utils/index.js";import{IkasStorefrontPopupDeviceTypeEnum as m}from"@ikas/storefront-models";var l=r((function(){var r=o().isMobile,l=t.useState([]),f=l[0],p=l[1];return t.useEffect((function(){s();var t=i.getStorefrontPopups().filter((function(e){return r?[m.ALL,m.MOBILE].includes(e.visibleDevice):[m.ALL,m.DESKTOP].includes(e.visibleDevice)}));if(t.length){var o=document.createElement("link");o.type="text/css",o.rel="stylesheet",o.href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",document.head.appendChild(o),p(e([],t,!0))}}),[]),t.createElement(t.Fragment,null,f.map((function(e,r){return t.createElement(n,{storefrontPopup:e,key:e.id})})))}));export{l as PopupListRendererForPage};
@@ -1,8 +1,5 @@
1
1
  import * as React from "react";
2
2
  import { IkasStorefrontPopup } from "../../../models/data/storefront-popup";
3
- import "swiper/css";
4
- import "swiper/css/navigation";
5
- import "swiper/css/pagination";
6
3
  import "react-date-picker/dist/DatePicker.css";
7
4
  declare type IkasStorefrontPopupRendererProps = {
8
5
  storefrontPopup: IkasStorefrontPopup;