@ikas/storefront 6.1.0-beta.5 → 6.1.0-beta.50

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 (35) hide show
  1. package/build/analytics/analytics.d.ts +1 -1
  2. package/build/analytics/analytics.js +1 -1
  3. package/build/analytics/ikasV3.d.ts +5 -0
  4. package/build/analytics/ikasV3.js +1 -1
  5. package/build/components/checkout/components/cart-summary/index.d.ts +2 -0
  6. package/build/components/checkout/components/cart-summary/index.js +1 -1
  7. package/build/components/checkout/components/cart-summary/style.module.scss.js +1 -1
  8. package/build/components/checkout/components/customer-addresses/index.js +1 -1
  9. package/build/components/checkout/components/input-with-button/style.module.scss.js +1 -1
  10. package/build/components/checkout/components/offer-product/index.js +1 -1
  11. package/build/components/checkout/components/stripe/checkout-form.js +1 -1
  12. package/build/components/checkout/index.js +1 -1
  13. package/build/components/checkout/model.d.ts +3 -0
  14. package/build/components/checkout/model.js +1 -1
  15. package/build/components/checkout/steps/step-success/index.js +1 -1
  16. package/build/components/page/head.js +1 -1
  17. package/build/components/page/index.js +1 -1
  18. package/build/components/page-editor/ThemeComponentEditor.js +1 -1
  19. package/build/components/popup/index.js +1 -1
  20. package/build/models/data/order/gift-card-line/index.d.ts +8 -0
  21. package/build/models/data/order/gift-card-line/index.js +1 -0
  22. package/build/models/data/order/index.d.ts +2 -0
  23. package/build/models/data/order/index.js +1 -1
  24. package/build/models/data/order/line-item/bundle-product-settings/index.d.ts +7 -0
  25. package/build/models/data/order/line-item/bundle-product-settings/index.js +1 -0
  26. package/build/models/data/order/line-item/index.d.ts +2 -0
  27. package/build/models/data/order/line-item/index.js +1 -1
  28. package/build/models/data/product/index.js +1 -1
  29. package/build/models/ui/product-list/index.js +1 -1
  30. package/build/page-data-init/index.js +1 -1
  31. package/build/pages/checkout.js +1 -1
  32. package/build/store/cart/api.d.ts +2 -1
  33. package/build/store/cart/api.js +1 -1
  34. package/build/store/customer/index.js +1 -1
  35. package/package.json +11 -11
@@ -1 +1 @@
1
- import{__spreadArray as e}from'./../../../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as a}from"mobx-react-lite";import{Button as o}from"../../components/button/index.js";import{CART_LS_KEY as s}from"../../../../store/cart/index.js";import r from"./style.module.scss.js";import i from"../../components/svg/success-circle.js";import n from"../../components/expandable-section/index.js";import c from"../../components/credit-card-form/svg/amex.js";import d from"../../components/credit-card-form/svg/master-card.js";import l from"../../components/credit-card-form/svg/troy.js";import m from"../../components/credit-card-form/svg/visa.js";import"@ikas/storefront-config";import{formatCurrency as p}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 f,IkasPaymentGatewayType as v,IkasOrderPackageStatus as g,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/order-transaction-with-prices/index.js";import"../../../../models/data/order/package/index.js";import"../../../../models/data/order/transaction/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/payment-gateway/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product/filter/index.js";import"../../../../models/data/product/campaign-offer/index.js";import"../../../../models/data/product/option-set/option/index.js";import"../../../../models/data/product/option-set/index.js";import"../../../../models/data/product/stock-location/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../models/data/state/index.js";import"../../../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../../models/data/storefront-popup/index.js";import"../../../../models/data/theme-json/index.js";import"../../../../models/data/theme-json/component/index.js";import"../../../../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 h from"../../components/offer-product/index.js";import{Analytics as x}from"../../../../analytics/analytics.js";import"../../../../analytics/head/index.js";import{QuickRegistration as k}from"../../components/quick-registration/index.js";import{ProductFiles as j}from"../../components/product-files/index.js";import y from"../../components/offer-product/offer-arrows/index.js";import N from"../../components/offer-product/offer-dots/index.js";import I from"../../components/svg/shopping-bag.js";import{CartSummary as A}from"../../components/cart-summary/index.js";import T from"../../components/offer-product/useCampaignOffer.js";var P="eventSentCartIds",S=a((function(a){var g,P,S,L,C,D,R,O,b,_,M,w=a.vm,F=u().t,Y=T(w,!0),U=Y.setActiveIndex,V=Y.setIsActiveOverlay,z=Y.handlePrev,B=Y.handleNext,K=Y.isActiveOverlay,G=Y.activeIndex,H=Y.isMobile;t.useEffect((function(){if("undefined"!=typeof localStorage){var t=localStorage.getItem(s),a=localStorage.getItem("eventSentCartIds");if(t&&t===w.checkout.id){if(w.successTransaction){var o=JSON.parse(a||"[]");if(!o.some((function(e){return e===w.checkout.id}))){var r=w.checkout.orderedAt,i=Date.now();Math.floor(Math.abs(i-r)/1e3)<30&&x.purchase(w.checkout,w.successTransaction),localStorage.setItem("eventSentCartIds",JSON.stringify(e(e([],o,!0),[w.checkout.id],!1)))}}localStorage.removeItem(s)}window&&window.handleKlarna&&window.handleKlarna(void 0)}}),[]);var Q=((null===(g=w.checkout.customer)||void 0===g?void 0:g.firstName)||"")+" "+((null===(P=w.checkout.customer)||void 0===P?void 0:P.lastName)||""),J=((null===(S=w.checkout.shippingAddress)||void 0===S?void 0:S.firstName)||"")+" "+((null===(L=w.checkout.shippingAddress)||void 0===L?void 0:L.lastName)||""),q=w.paymentGateways.find((function(e){var t;return e.id===(null===(t=w.successTransaction)||void 0===t?void 0:t.paymentGatewayId)})),X=function(e){switch(e){case f.APP_PAYMENT:return F("checkout-page:appPayment");case f.BANK_REDIRECT:return F("checkout-page:bankRedirect");case f.BUY_ONLINE_PAY_AT_STORE:return F("checkout-page:buyOnlinePayAtStore");case f.CASH:return F("checkout-page:cash");case f.CASH_ON_DELIVERY:return F("checkout-page:cashOnDelivery");case f.CREDIT_CARD:return F("checkout-page:creditCard");case f.CREDIT_CARD_ON_DELIVERY:return F("checkout-page:creditCardOnDelivery");case f.DIRECT_DEBIT:return F("checkout-page:directDebit");case f.GIFT_CARD:return F("checkout-page:giftCard");case f.MONEY_ORDER:return F("checkout-page:moneyOrder");case f.OTHER:return F("checkout-page:other");case f.PAY_LATER:return F("checkout-page:payLater");case f.SLICE_IT:return F("checkout-page:sliceIt");case f.WALLET:return F("checkout-page:wallet");default:return""}},W=null===(C=w.successTransaction)||void 0===C?void 0:C.paymentMethodDetail,Z=null===(D=w.successTransaction)||void 0===D?void 0:D.paymentGatewayCode,$=t.useMemo((function(){var e,a,o,s,i,n,u,g,h,x;return t.createElement("div",{className:[r.InfoGrid].join(" ")},!w.isFree&&t.createElement("div",{className:r.PaymentMethodMain},t.createElement("div",{className:r.InfoTitle},F("checkout-page:paymentMethod")),q&&t.createElement(t.Fragment,null,!!q.logoUrl&&t.createElement("div",{className:r.PaymentLogoContainer},t.createElement("img",{src:q.logoUrl})),!q.logoUrl&&t.createElement("div",{className:r.InfoText},q.paymentMethodType===f.CREDIT_CARD&&q.type===v.INTERNAL?F("checkout-page:creditCard"):q.name),"STRIPE"!==q.code&&"STRIPE_EU"!==q.code&&"PAYPAL"!==q.code&&"KLARNA"!==q.code||!(null===(e=w.successTransaction)||void 0===e?void 0:e.paymentMethod)?!!q.description&&q.type!==v.EXTERNAL&&t.createElement("div",{className:r.InfoText},t.createElement("div",{dangerouslySetInnerHTML:{__html:q.description}})):t.createElement("div",{className:r.InfoText},X(w.successTransaction.paymentMethod))),"E_PAY_KOLAY"===Z&&t.createElement(t.Fragment,null,t.createElement("div",{className:r.EPayKolayLogoContainer},t.createElement("img",{src:"https://cdn.myikas.com/sf/assets/payment/epaykolay.png"})),!!(null===(a=w.successTransaction)||void 0===a?void 0:a.paymentMethod)&&t.createElement("div",{className:r.InfoText},X(null===(o=w.successTransaction)||void 0===o?void 0:o.paymentMethod))),"E_PAY_KOLAY"!==Z&&"STRIPE"!==Z&&"STRIPE_EU"!==Z&&"PAYPAL"!==Z&&"KLARNA"!==Z&&"CREDIT_CARD"===(null===(s=w.successTransaction)||void 0===s?void 0:s.paymentMethod)&&t.createElement(t.Fragment,null,t.createElement("div",{className:r.InfoText},t.createElement("div",{className:r.CardLogoContainer},function(){var e,a;switch(null===(a=null===(e=w.successTransaction)||void 0===e?void 0:e.paymentMethodDetail)||void 0===a?void 0:a.cardAssociation){case E.AMERICAN_EXPRESS:return t.createElement(c,null);case E.MASTER_CARD:return t.createElement(d,null);case E.TROY:return t.createElement(l,null);case E.VISA:return t.createElement(m,null);default:return t.createElement("div",null)}}()),t.createElement("span",null,"**** ".concat((null==W?void 0:W.lastFourDigits)||""))),(null===(i=null==W?void 0:W.installment)||void 0===i?void 0:i.installmentCount)&&W.installment.installmentCount>1&&t.createElement(t.Fragment,null,t.createElement("div",{className:r.InfoText},"".concat(W.installment.installmentCount," ").concat(F("checkout-page:installments"))),null!==W.installment.installmentPrice&&t.createElement("div",{className:r.InfoText},"".concat(W.installment.installmentCount," x ").concat(p(W.installment.installmentPrice,w.checkout.currencyCode,w.checkout.currencySymbol)))))),t.createElement("div",null,t.createElement("div",{className:r.InfoTitle},F("checkout-page:billingAddress")),!!(null===(n=w.checkout.billingAddress)||void 0===n?void 0:n.firstName)&&t.createElement("div",{className:[r.InfoText,r.InfoTextPrimary].join(" ")},w.checkout.billingAddress.firstName," ",w.checkout.billingAddress.lastName),!!(null===(u=w.checkout.billingAddress)||void 0===u?void 0:u.company)&&t.createElement("div",{className:r.InfoText},w.checkout.billingAddress.company),(!!(null===(g=w.checkout.billingAddress)||void 0===g?void 0:g.taxOffice)||!!(null===(h=w.checkout.billingAddress)||void 0===h?void 0:h.taxNumber))&&t.createElement("div",{className:r.InfoText},w.checkout.billingAddress.taxOffice," ",w.checkout.billingAddress.taxNumber),t.createElement("div",{className:r.InfoText},null===(x=w.checkout.billingAddress)||void 0===x?void 0:x.addressText)))}),[]),ee=t.useMemo((function(){return t.createElement(A,{vm:w,isSuccessPageSummary:!0})}),[]),te=t.useMemo((function(){var e,a,o,s,i,n;return t.createElement("div",{className:[r.InfoGrid].join(" ")},t.createElement("div",null,t.createElement("div",{className:r.InfoTitle},F("checkout-page:contactInfo")),t.createElement("div",{className:r.InfoText},null===(e=w.checkout.customer)||void 0===e?void 0:e.email),t.createElement("div",{className:r.InfoText},Q),!!(null===(a=w.checkout.shippingAddress)||void 0===a?void 0:a.phone)&&t.createElement("div",{className:r.InfoText},null===(o=w.checkout.shippingAddress)||void 0===o?void 0:o.phone)),t.createElement("div",null,"in-store"===w.deliveryMethod&&t.createElement(t.Fragment,null,t.createElement("div",{className:r.InfoTitle},F("checkout-page:receiver")),t.createElement("div",{className:[r.InfoText,r.withMBottom].join(" ")},J)),t.createElement("div",{className:r.InfoTitle},"address"===w.deliveryMethod?F("checkout-page:shippingAddress"):F("checkout-page:pickUpLocation")),!!(null===(s=w.checkout.shippingAddress)||void 0===s?void 0:s.firstName)&&t.createElement("div",{className:[r.InfoText,r.InfoTextPrimary].join(" ")},w.checkout.shippingAddress.firstName," ",w.checkout.shippingAddress.lastName),!!(null===(i=w.checkout.shippingAddress)||void 0===i?void 0:i.company)&&t.createElement("div",{className:r.InfoText},w.checkout.shippingAddress.company),t.createElement("div",{className:r.InfoText},null===(n=w.checkout.shippingAddress)||void 0===n?void 0:n.addressText)))}),[]),ae=!!(null===(R=w.customizationProps)||void 0===R?void 0:R.campaignOffersEnableMiddlePhase)&&!!(null===(O=w.customizationProps)||void 0===O?void 0:O.showCampaignIsBiggerImage)&&H&&K,oe=!!(null===(b=w.customizationProps)||void 0===b?void 0:b.campaignOffersEnableMiddlePhase)&&!!(null===(_=w.customizationProps)||void 0===_?void 0:_.showCampaignIsBiggerImage)&&H&&!K;return t.createElement(t.Fragment,null,!!(null===(M=w.customizationProps)||void 0===M?void 0:M.campaignOffersEnableMiddlePhase)&&K&&w.campaignOffers&&w.campaignOffers.length>0&&H&&t.createElement("div",{className:[r.MiddlePhaseOverlay,ae?r.MiddlePhaseOverlayPopup:""].join(" ")}),w.campaignOffers&&!!w.campaignOffers.length&&w.isCampaignOfferLoaded&&t.createElement("div",{className:[r.CampaignOfferMain,ae?r.OverlayPopupMain:""].join(" ")},t.createElement("div",{className:r.OfferSlider},w.campaignOffers.map((function(e,a){var o;return t.createElement(h,{vm:w,campaignOffer:e,index:a,activeIndex:G,offersLength:(null===(o=w.campaignOffers)||void 0===o?void 0:o.length)||0,handlePrev:z,handleNext:B,setActiveIndex:function(e){return U(e)},isPopupShow:ae,closePopup:function(){return V(!1)},isPopupClosed:oe,showPopup:function(){return V(!0)},step:w.step})}))),w.campaignOffers.length>1&&t.createElement(y,{handlePrev:z,handleNext:B}),w.campaignOffers.length>1&&t.createElement(N,{isPopupShow:ae,vm:w,activeIndex:G})),t.createElement("div",{className:r.StepSuccess},t.createElement("div",{className:r.SuccessTitleContainer},t.createElement(i,{className:r.SuccessCircle}),t.createElement("span",{className:r.SuccessTitle},F("checkout-page:orderSuccessTitle"))),t.createElement("div",{className:r.SuccessSubTitle},F(w.isDigitalOnly?"checkout-page:orderSuccessDigitalOnlyDescription":"address"===w.deliveryMethod?"checkout-page:orderSuccessDescription":"checkout-page:orderSuccessInStoreDeliveryDescription",{customerName:Q})),w.productFiles.length>0&&t.createElement(j,{vm:w}),t.createElement("div",null,t.createElement("div",{className:r.OrderSummaryMain},t.createElement("div",null,t.createElement("span",{className:r.InfoTitle},F("checkout-page:orderNo")),t.createElement("span",{className:r.InfoText},"#"+(w.checkout.orderNumber||""))),t.createElement("div",null,t.createElement("span",{className:r.InfoTitle},F("checkout-page:orderDate")),t.createElement("span",{className:r.InfoText},w.checkout.dateStr)),t.createElement("div",{className:r.OrderAmountInfoMain},t.createElement("span",{className:r.InfoTitle},F("checkout-page:orderAmount")),t.createElement("span",{className:r.OrderAmountInfo},t.createElement("span",null,"".concat(p(w.finalPrice||0,w.checkout.currencyCode,w.checkout.currencySymbol))),t.createElement("span",{className:r.Slash},"/"),t.createElement("span",{className:r.OrderItemCount},t.createElement(I,null),t.createElement("span",null," ",w.checkout.itemQuantity," ",F("checkout-page:cartItemProduct"))))))),w.hasQuickRegistration&&t.createElement(k,{vm:w}),t.createElement("div",{className:r.HideOnDesktop},t.createElement(n,{title:F("checkout-page:summary")},ee)),t.createElement(n,{expanded:!0,title:F("checkout-page:paymentSummary")},$),!w.isDigitalOnly&&t.createElement(n,{title:F("checkout-page:shippingSummary")},te),t.createElement("div",{className:r.Actions},t.createElement("div",{className:r.HelpText},t.createElement("span",null,F("checkout-page:helpCtaQuestion")),t.createElement("span",{style:{marginLeft:"4px"},className:r.Cta,onClick:function(){return w.setContactModalVisible(!0)}},F("checkout-page:helpCta"))),t.createElement(o,{text:F("checkout-page:actions.backToShopping"),onClick:w.onBackToShoppingClick,style:{flex:"0 0 auto"}}))))}));a((function(e){var a,o=e.vm,s=u().t,i=r.Yellow;switch(o.checkout.orderPackageStatus){case g.FULFILLED:case g.PARTIALLY_FULFILLED:case g.DELIVERED:case g.PARTIALLY_DELIVERED:i=r.Green;break;case g.CANCELLED:case g.PARTIALLY_CANCELLED:case g.CANCEL_REJECTED:case g.CANCEL_REQUESTED:i=r.Red}return t.createElement("div",{className:[r.OrderStatus,i].join(" ")},o.checkout.orderPackageStatus?null===(a=[{types:[g.UNFULFILLED],text:s("checkout-page:orderPackageStatus.unfulfilled")},{types:[g.READY_FOR_SHIPMENT],text:s("checkout-page:orderPackageStatus.readyForShipment")},{types:[g.PARTIALLY_FULFILLED],text:s("checkout-page:orderPackageStatus.partiallyFulfilled")},{types:[g.FULFILLED],text:s("checkout-page:orderPackageStatus.fulfilled")},{types:[g.DELIVERED],text:s("checkout-page:orderPackageStatus.delivered")},{types:[g.PARTIALLY_DELIVERED],text:s("checkout-page:orderPackageStatus.partiallyDelivered")},{types:[g.UNABLE_TO_DELIVER],text:s("checkout-page:orderPackageStatus.unableToDeliver")},{types:[g.CANCELLED,g.PARTIALLY_CANCELLED],text:s("checkout-page:orderPackageStatus.cancelled")},{types:[g.CANCEL_REJECTED],text:s("checkout-page:orderPackageStatus.cancelRejected")},{types:[g.REFUNDED,g.PARTIALLY_REFUNDED],text:s("checkout-page:orderPackageStatus.refunded")},{types:[g.REFUND_REQUEST_ACCEPTED],text:s("checkout-page:orderPackageStatus.refundRequestAccepted")},{types:[g.REFUND_REJECTED],text:s("checkout-page:orderPackageStatus.refundRejected")},{types:[g.REFUND_REQUESTED],text:s("checkout-page:orderPackageStatus.refundRequested")}].find((function(e){return e.types.includes(o.checkout.orderPackageStatus)})))||void 0===a?void 0:a.text:"")}));export{P as SENT_CART_IDS_LS_KEY,S as StepSuccess};
1
+ import{__spreadArray as e}from'./../../../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as a}from"mobx-react-lite";import{Button as o}from"../../components/button/index.js";import{CART_LS_KEY as s}from"../../../../store/cart/index.js";import n from"./style.module.scss.js";import r from"../../components/svg/success-circle.js";import i from"../../components/expandable-section/index.js";import c from"../../components/credit-card-form/svg/amex.js";import l from"../../components/credit-card-form/svg/master-card.js";import d from"../../components/credit-card-form/svg/troy.js";import m from"../../components/credit-card-form/svg/visa.js";import"@ikas/storefront-config";import{formatCurrency as u}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 v,IkasPaymentGatewayType as f,IkasOrderPackageStatus as g,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/order-transaction-with-prices/index.js";import"../../../../models/data/order/package/index.js";import"../../../../models/data/order/transaction/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/payment-gateway/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product/filter/index.js";import"../../../../models/data/product/campaign-offer/index.js";import"../../../../models/data/product/option-set/option/index.js";import"../../../../models/data/product/option-set/index.js";import"../../../../models/data/product/stock-location/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../models/data/state/index.js";import"../../../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../../models/data/storefront-popup/index.js";import"../../../../models/data/theme-json/index.js";import"../../../../models/data/theme-json/component/index.js";import"../../../../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 h from"../../components/offer-product/index.js";import{Analytics as x}from"../../../../analytics/analytics.js";import"../../../../analytics/head/index.js";import{QuickRegistration as k}from"../../components/quick-registration/index.js";import{ProductFiles as y}from"../../components/product-files/index.js";import j from"../../components/offer-product/offer-arrows/index.js";import N from"../../components/offer-product/offer-dots/index.js";import I from"../../components/svg/shopping-bag.js";import{CartSummary as T}from"../../components/cart-summary/index.js";import A from"../../components/offer-product/useCampaignOffer.js";var C="eventSentCartIds",D=a((function(a){var g,C,D,P,S,L,R,M,b,O,_,F,w=a.vm,Y=p().t,U=A(w,!0),V=U.setActiveIndex,z=U.setIsActiveOverlay,B=U.handlePrev,G=U.handleNext,K=U.isActiveOverlay,H=U.activeIndex,Q=U.isMobile;t.useEffect((function(){if("undefined"!=typeof localStorage){var t=localStorage.getItem(s),a=localStorage.getItem("eventSentCartIds");if(t&&t===w.checkout.id){if(w.successTransaction){var o=JSON.parse(a||"[]");if(!o.some((function(e){return e===w.checkout.id}))){var n=w.checkout.orderedAt,r=Date.now();Math.floor(Math.abs(r-n)/1e3)<30&&x.purchase(w.checkout,w.successTransaction),localStorage.setItem("eventSentCartIds",JSON.stringify(e(e([],o,!0),[w.checkout.id],!1)))}}localStorage.removeItem(s)}window&&window.handleKlarna&&window.handleKlarna(void 0)}}),[]);var J=((null===(g=w.checkout.customer)||void 0===g?void 0:g.firstName)||"")+" "+((null===(C=w.checkout.customer)||void 0===C?void 0:C.lastName)||""),q=((null===(D=w.checkout.shippingAddress)||void 0===D?void 0:D.firstName)||"")+" "+((null===(P=w.checkout.shippingAddress)||void 0===P?void 0:P.lastName)||""),X=w.paymentGateways.find((function(e){var t;return e.id===(null===(t=w.successTransaction)||void 0===t?void 0:t.paymentGatewayId)})),W=function(e){var a,o;switch(e||(null===(o=null===(a=w.successTransaction)||void 0===a?void 0:a.paymentMethodDetail)||void 0===o?void 0:o.cardAssociation)){case E.AMERICAN_EXPRESS:return t.createElement(c,null);case E.MASTER_CARD:return t.createElement(l,null);case E.TROY:return t.createElement(d,null);case E.VISA:return t.createElement(m,null);default:return t.createElement("div",null)}},Z=function(e){switch(e){case v.APP_PAYMENT:return Y("checkout-page:appPayment");case v.BANK_REDIRECT:return Y("checkout-page:bankRedirect");case v.BUY_ONLINE_PAY_AT_STORE:return Y("checkout-page:buyOnlinePayAtStore");case v.CASH:return Y("checkout-page:cash");case v.CASH_ON_DELIVERY:return Y("checkout-page:cashOnDelivery");case v.CREDIT_CARD:return Y("checkout-page:creditCard");case v.CREDIT_CARD_ON_DELIVERY:return Y("checkout-page:creditCardOnDelivery");case v.DIRECT_DEBIT:return Y("checkout-page:directDebit");case v.GIFT_CARD:return Y("checkout-page:giftCard");case v.MONEY_ORDER:return Y("checkout-page:moneyOrder");case v.OTHER:return Y("checkout-page:other");case v.PAY_LATER:return Y("checkout-page:payLater");case v.SLICE_IT:return Y("checkout-page:sliceIt");case v.WALLET:return Y("checkout-page:wallet");default:return""}},$=null===(S=w.successTransaction)||void 0===S?void 0:S.paymentMethodDetail,ee=null===(L=w.successTransaction)||void 0===L?void 0:L.paymentGatewayCode,te=null===(R=w.successTransactions)||void 0===R?void 0:R.some((function(e){return e.paymentMethod===v.GIFT_CARD})),ae=t.useMemo((function(){var e;return null===(e=w.successTransactions)||void 0===e?void 0:e.map((function(e){var a,o,s;return t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},Z(e.paymentMethod)),e.paymentMethod===v.CREDIT_CARD&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},t.createElement("div",{className:n.CardLogoContainer},W(null===(a=e.paymentMethodDetail)||void 0===a?void 0:a.cardAssociation)),t.createElement("span",null,"**** ".concat((null==$?void 0:$.lastFourDigits)||""))),(null===(s=null===(o=e.paymentMethodDetail)||void 0===o?void 0:o.installment)||void 0===s?void 0:s.installmentCount)&&e.paymentMethodDetail.installment.installmentCount>1&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},"".concat(e.paymentMethodDetail.installment.installmentCount," ").concat(Y("checkout-page:installments"))),null!==e.paymentMethodDetail.installment.installmentPrice&&t.createElement("div",{className:n.InfoText},"".concat(e.paymentMethodDetail.installment.installmentCount," x ").concat(u(e.paymentMethodDetail.installment.installmentPrice,w.checkout.currencyCode,w.checkout.currencySymbol))))))}))}),[]),oe=t.useMemo((function(){var e,a,o,s,r,i,c,l,d,m;return t.createElement("div",{className:[n.InfoGrid].join(" ")},!w.isFree&&t.createElement("div",{className:n.PaymentMethodMain},t.createElement("div",{className:n.InfoTitle},Y("checkout-page:paymentMethod")),te?ae:t.createElement(t.Fragment,null,X&&t.createElement(t.Fragment,null,!!X.logoUrl&&t.createElement("div",{className:n.PaymentLogoContainer},t.createElement("img",{src:X.logoUrl})),!X.logoUrl&&t.createElement("div",{className:n.InfoText},X.paymentMethodType===v.CREDIT_CARD&&X.type===f.INTERNAL?Y("checkout-page:creditCard"):X.name),"STRIPE"!==X.code&&"STRIPE_EU"!==X.code&&"PAYPAL"!==X.code&&"KLARNA"!==X.code||!(null===(e=w.successTransaction)||void 0===e?void 0:e.paymentMethod)?!!X.description&&X.type!==f.EXTERNAL&&t.createElement("div",{className:n.InfoText},t.createElement("div",{dangerouslySetInnerHTML:{__html:X.description}})):t.createElement("div",{className:n.InfoText},Z(w.successTransaction.paymentMethod))),"E_PAY_KOLAY"===ee&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.EPayKolayLogoContainer},t.createElement("img",{src:"https://cdn.myikas.com/sf/assets/payment/epaykolay.png"})),!!(null===(a=w.successTransaction)||void 0===a?void 0:a.paymentMethod)&&t.createElement("div",{className:n.InfoText},Z(null===(o=w.successTransaction)||void 0===o?void 0:o.paymentMethod))),"E_PAY_KOLAY"!==ee&&"STRIPE"!==ee&&"STRIPE_EU"!==ee&&"PAYPAL"!==ee&&"KLARNA"!==ee&&"CREDIT_CARD"===(null===(s=w.successTransaction)||void 0===s?void 0:s.paymentMethod)&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},t.createElement("div",{className:n.CardLogoContainer},W()),t.createElement("span",null,"**** ".concat((null==$?void 0:$.lastFourDigits)||""))),(null===(r=null==$?void 0:$.installment)||void 0===r?void 0:r.installmentCount)&&$.installment.installmentCount>1&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},"".concat($.installment.installmentCount," ").concat(Y("checkout-page:installments"))),null!==$.installment.installmentPrice&&t.createElement("div",{className:n.InfoText},"".concat($.installment.installmentCount," x ").concat(u($.installment.installmentPrice,w.checkout.currencyCode,w.checkout.currencySymbol))))))),!!w.isFree&&!!te&&t.createElement("div",{className:n.PaymentMethodMain},t.createElement("div",{className:n.InfoTitle},Y("checkout-page:paymentMethod")),ae),t.createElement("div",null,t.createElement("div",{className:n.InfoTitle},Y("checkout-page:billingAddress")),!!(null===(i=w.checkout.billingAddress)||void 0===i?void 0:i.firstName)&&t.createElement("div",{className:[n.InfoText,n.InfoTextPrimary].join(" ")},w.checkout.billingAddress.firstName," ",w.checkout.billingAddress.lastName),!!(null===(c=w.checkout.billingAddress)||void 0===c?void 0:c.company)&&t.createElement("div",{className:n.InfoText},w.checkout.billingAddress.company),(!!(null===(l=w.checkout.billingAddress)||void 0===l?void 0:l.taxOffice)||!!(null===(d=w.checkout.billingAddress)||void 0===d?void 0:d.taxNumber))&&t.createElement("div",{className:n.InfoText},w.checkout.billingAddress.taxOffice," ",w.checkout.billingAddress.taxNumber),t.createElement("div",{className:n.InfoText},null===(m=w.checkout.billingAddress)||void 0===m?void 0:m.addressText)))}),[]),se=t.useMemo((function(){return t.createElement(T,{vm:w,isSuccessPageSummary:!0})}),[]),ne=t.useMemo((function(){var e,a,o,s,r,i;return t.createElement("div",{className:[n.InfoGrid].join(" ")},t.createElement("div",null,t.createElement("div",{className:n.InfoTitle},Y("checkout-page:contactInfo")),t.createElement("div",{className:n.InfoText},null===(e=w.checkout.customer)||void 0===e?void 0:e.email),t.createElement("div",{className:n.InfoText},J),!!(null===(a=w.checkout.shippingAddress)||void 0===a?void 0:a.phone)&&t.createElement("div",{className:n.InfoText},null===(o=w.checkout.shippingAddress)||void 0===o?void 0:o.phone)),t.createElement("div",null,"in-store"===w.deliveryMethod&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoTitle},Y("checkout-page:receiver")),t.createElement("div",{className:[n.InfoText,n.withMBottom].join(" ")},q)),t.createElement("div",{className:n.InfoTitle},"address"===w.deliveryMethod?Y("checkout-page:shippingAddress"):Y("checkout-page:pickUpLocation")),!!(null===(s=w.checkout.shippingAddress)||void 0===s?void 0:s.firstName)&&t.createElement("div",{className:[n.InfoText,n.InfoTextPrimary].join(" ")},w.checkout.shippingAddress.firstName," ",w.checkout.shippingAddress.lastName),!!(null===(r=w.checkout.shippingAddress)||void 0===r?void 0:r.company)&&t.createElement("div",{className:n.InfoText},w.checkout.shippingAddress.company),t.createElement("div",{className:n.InfoText},null===(i=w.checkout.shippingAddress)||void 0===i?void 0:i.addressText)))}),[]),re=!!(null===(M=w.customizationProps)||void 0===M?void 0:M.campaignOffersEnableMiddlePhase)&&!!(null===(b=w.customizationProps)||void 0===b?void 0:b.showCampaignIsBiggerImage)&&Q&&K,ie=!!(null===(O=w.customizationProps)||void 0===O?void 0:O.campaignOffersEnableMiddlePhase)&&!!(null===(_=w.customizationProps)||void 0===_?void 0:_.showCampaignIsBiggerImage)&&Q&&!K;return t.createElement(t.Fragment,null,!!(null===(F=w.customizationProps)||void 0===F?void 0:F.campaignOffersEnableMiddlePhase)&&K&&w.campaignOffers&&w.campaignOffers.length>0&&Q&&t.createElement("div",{className:[n.MiddlePhaseOverlay,re?n.MiddlePhaseOverlayPopup:""].join(" ")}),w.campaignOffers&&!!w.campaignOffers.length&&w.isCampaignOfferLoaded&&t.createElement("div",{className:[n.CampaignOfferMain,re?n.OverlayPopupMain:""].join(" ")},t.createElement("div",{className:n.OfferSlider},w.campaignOffers.map((function(e,a){var o;return t.createElement(h,{vm:w,campaignOffer:e,index:a,activeIndex:H,offersLength:(null===(o=w.campaignOffers)||void 0===o?void 0:o.length)||0,handlePrev:B,handleNext:G,setActiveIndex:function(e){return V(e)},isPopupShow:re,closePopup:function(){return z(!1)},isPopupClosed:ie,showPopup:function(){return z(!0)},step:w.step})}))),w.campaignOffers.length>1&&t.createElement(j,{handlePrev:B,handleNext:G}),w.campaignOffers.length>1&&t.createElement(N,{isPopupShow:re,vm:w,activeIndex:H})),t.createElement("div",{className:n.StepSuccess},t.createElement("div",{className:n.SuccessTitleContainer},t.createElement(r,{className:n.SuccessCircle}),t.createElement("span",{className:n.SuccessTitle},Y("checkout-page:orderSuccessTitle"))),t.createElement("div",{className:n.SuccessSubTitle},Y(w.isDigitalOnly?"checkout-page:orderSuccessDigitalOnlyDescription":"address"===w.deliveryMethod?"checkout-page:orderSuccessDescription":"checkout-page:orderSuccessInStoreDeliveryDescription",{customerName:J})),w.productFiles.length>0&&t.createElement(y,{vm:w}),t.createElement("div",null,t.createElement("div",{className:n.OrderSummaryMain},t.createElement("div",null,t.createElement("span",{className:n.InfoTitle},Y("checkout-page:orderNo")),t.createElement("span",{className:n.InfoText},"#"+(w.checkout.orderNumber||""))),t.createElement("div",null,t.createElement("span",{className:n.InfoTitle},Y("checkout-page:orderDate")),t.createElement("span",{className:n.InfoText},w.checkout.dateStr)),t.createElement("div",{className:n.OrderAmountInfoMain},t.createElement("span",{className:n.InfoTitle},Y("checkout-page:orderAmount")),t.createElement("span",{className:n.OrderAmountInfo},t.createElement("span",null,"".concat(u(w.finalPrice||0,w.checkout.currencyCode,w.checkout.currencySymbol))),t.createElement("span",{className:n.Slash},"/"),t.createElement("span",{className:n.OrderItemCount},t.createElement(I,null),t.createElement("span",null," ",w.checkout.itemQuantity," ",Y("checkout-page:cartItemProduct"))))))),w.hasQuickRegistration&&t.createElement(k,{vm:w}),t.createElement("div",{className:n.HideOnDesktop},t.createElement(i,{title:Y("checkout-page:summary")},se)),t.createElement(i,{expanded:!0,title:Y("checkout-page:paymentSummary")},oe),!w.isDigitalOnly&&t.createElement(i,{title:Y("checkout-page:shippingSummary")},ne),t.createElement("div",{className:n.Actions},t.createElement("div",{className:n.HelpText},t.createElement("span",null,Y("checkout-page:helpCtaQuestion")),t.createElement("span",{style:{marginLeft:"4px"},className:n.Cta,onClick:function(){return w.setContactModalVisible(!0)}},Y("checkout-page:helpCta"))),t.createElement(o,{text:Y("checkout-page:actions.backToShopping"),onClick:w.onBackToShoppingClick,style:{flex:"0 0 auto"}}))))}));a((function(e){var a,o=e.vm,s=p().t,r=n.Yellow;switch(o.checkout.orderPackageStatus){case g.FULFILLED:case g.PARTIALLY_FULFILLED:case g.DELIVERED:case g.PARTIALLY_DELIVERED:r=n.Green;break;case g.CANCELLED:case g.PARTIALLY_CANCELLED:case g.CANCEL_REJECTED:case g.CANCEL_REQUESTED:r=n.Red}return t.createElement("div",{className:[n.OrderStatus,r].join(" ")},o.checkout.orderPackageStatus?null===(a=[{types:[g.UNFULFILLED],text:s("checkout-page:orderPackageStatus.unfulfilled")},{types:[g.READY_FOR_SHIPMENT],text:s("checkout-page:orderPackageStatus.readyForShipment")},{types:[g.PARTIALLY_FULFILLED],text:s("checkout-page:orderPackageStatus.partiallyFulfilled")},{types:[g.FULFILLED],text:s("checkout-page:orderPackageStatus.fulfilled")},{types:[g.DELIVERED],text:s("checkout-page:orderPackageStatus.delivered")},{types:[g.PARTIALLY_DELIVERED],text:s("checkout-page:orderPackageStatus.partiallyDelivered")},{types:[g.UNABLE_TO_DELIVER],text:s("checkout-page:orderPackageStatus.unableToDeliver")},{types:[g.CANCELLED,g.PARTIALLY_CANCELLED],text:s("checkout-page:orderPackageStatus.cancelled")},{types:[g.CANCEL_REJECTED],text:s("checkout-page:orderPackageStatus.cancelRejected")},{types:[g.REFUNDED,g.PARTIALLY_REFUNDED],text:s("checkout-page:orderPackageStatus.refunded")},{types:[g.REFUND_REQUEST_ACCEPTED],text:s("checkout-page:orderPackageStatus.refundRequestAccepted")},{types:[g.REFUND_REJECTED],text:s("checkout-page:orderPackageStatus.refundRejected")},{types:[g.REFUND_REQUESTED],text:s("checkout-page:orderPackageStatus.refundRequested")}].find((function(e){return e.types.includes(o.checkout.orderPackageStatus)})))||void 0===a?void 0:a.text:"")}));export{C as SENT_CART_IDS_LS_KEY,D 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 i from"next/head.js";import{useRouter as a}from"next/router";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as r}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import{IkasIndexPageSeoSetting as n}from"../../models/data/storefront/index-page-seo-setting/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import{IkasProductList as s}from"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as d}from"@ikas/storefront-config";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"./index.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"../page-editor/loader/style.module.scss.js";import"../google-captcha/index.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import"../../pages/account/activate.js";import{IkasBaseStore as l}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var c=o((function(o){var s,c=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,T=a(),D="undefined"!=typeof window,L="local"===process.env.NEXT_PUBLIC_ENV,w=T.asPath.split("?")[0].replace("/",""),k=(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:"",R=L?"http://localhost:3333":"https://"+d.getDomain(),E=null===(s=d.getIndexPageSeoSettings())||void 0===s?void 0:s.find((function(e){return e.locale===d.getCurrentLocale()})),_=E?new n(E):null;t.useEffect((function(){document.documentElement.lang=d.getCurrentLocale()}),[c,j]);var I=t.useMemo((function(){if(j&&j.href)return"".concat(R).concat(j.href)}),[j]),V=t.useMemo((function(){var e,t,o,i=[];if(y){if(i.push({property:"og:type",content:"website"}),i.push({property:"og:site_name",content:"https://"+d.getDomain()}),g&&i.push({property:"og:title",content:g}),f&&i.push({property:"og:description",content:f}),c===r.INDEX){var a=null,n=null;!g&&(null==_?void 0:_.pageTitle)&&(a=_.pageTitle),!f&&(null==_?void 0:_.description)&&(n=_.description),(s=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===c})))&&(a=u(j,c,s.titleTemplate||""),n=u(j,c,s.descriptionTemplate||"")),a&&i.push({property:"og:title",content:a}),n&&i.push({property:"og:description",content:n})}if(c===r.PRODUCT){var s,l=null,p=null;(s=null===(t=d.getMetaTemplates())||void 0===t?void 0:t.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===c})))&&(l=u(j,c,s.titleTemplate||""),p=u(j,c,s.descriptionTemplate||"")),l&&!g&&i.push({property:"og:title",content:l}),p&&!f&&i.push({property:"og:description",content:p})}i.push({property:"og:url",content:I||(D?window.location.href:"")||"https://".concat(d.getDomain())});var m=null;if(j&&c===r.PRODUCT){var v=j.selectedVariant.mainImage;(null==v?void 0:v.image)&&(m={property:"og:image",content:v.image.src.replace(".webp",".jpg")})}if(j&&c===r.CATEGORY){var h=j;h.image&&(m={property:"og:image",content:h.image.src.replace(".webp",".jpg")})}if(j&&c===r.BRAND){var b=j;b.image&&(m={property:"og:image",content:b.image.src.replace(".webp",".jpg")})}if(j&&c===r.BLOG_CATEGORY){var C=j;C.image&&(m={property:"og:image",content:C.image.src.replace(".webp",".jpg")})}if(j&&c===r.BLOG){var T=j;T.image&&(m={property:"og:image",content:T.image.src.replace(".webp",".jpg")})}!m&&(null==_?void 0:_.icon)&&(m={property:"og:image",content:null===(o=null==_?void 0:_.icon)||void 0===o?void 0:o.src.replace(".webp",".jpg")}),!m&&(null==x?void 0:x.logo)&&(m={property:"og:image",content:x.logo.src.replace(".webp",".jpg")}),m&&i.push(m)}return i}),[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,l=(null==t?void 0:t.logo)?t.logo.src:void 0;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:l,image:l,url:"https://"+d.getDomain(),telephone:null==t?void 0:t.phone,address:e(e({"@type":"PostalAddress",streetAddress:null===(o=t.address)||void 0===o?void 0:o.addressLine1,addressLocality:null===(a=null===(i=t.address)||void 0===i?void 0:i.city)||void 0===a?void 0:a.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(r=t.address)||void 0===r?void 0:r.postalCode,addressCountry:null===(s=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===s?void 0:s.code})}}(x);t.push(i),t.push(a)}if(j&&c===r.PRODUCT){var n=j,s=function(t,o){var i,a,r,n,s;try{var l=d.getCurrentRouting(),c=null==l?void 0:l.path,p=function(e){return c?"https://".concat(d.getDomain(),"/").concat(c).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&&c===r.CATEGORY){var l=function(e){var t,o;try{var i=d.getCurrentRouting(),a=null==i?void 0:i.path,r=function(e){return a?"https://".concat(d.getDomain(),"/").concat(a).concat(e):"https://".concat(d.getDomain()).concat(e)};return{"@context":"http://schema.org","@type":"CollectionPage",url:r(e.href),name:null===(t=e.metaData)||void 0===t?void 0:t.pageTitle,description:null===(o=e.metaData)||void 0===o?void 0:o.description,image:e.image?e.image.src:void 0}}catch(e){}}(j),u=p(j,o),g=m(C);l&&t.push(l),u&&t.push(u),g&&t.push(g)}j&&c===r.BRAND&&((g=m(C))&&t.push(g));if(j&&c===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===c}));return t?u(j,c,t.titleTemplate||""):null}),[c,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===c}));return t?u(j,c,t.descriptionTemplate||""):null}),[c,j]),M=t.useMemo((function(){return!d.getFavicon()&&(null==_?void 0:_.favIcon)?_.favIcon:null}),[]),B=[];d.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){B.push({routing:e,hrefLang:e.locale+"-"+t})})):B.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=B.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=l.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)||""}),B.length>1&&B.filter((function(e){return!k||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(R+(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(R).concat(P).concat(e)})})),M&&t.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(M,"/image_180.webp"),type:"image/webp"}),!v&&G.currentPageType!==r.NOT_FOUND&&t.createElement("link",{rel:"canonical",href:"".concat(R).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=l.getInstance(),a=d.getCurrentRouting(),n=null==a?void 0:a.path,s=function(e){return n?"https://".concat(d.getDomain(),"/").concat(n).concat(e):"https://".concat(d.getDomain()).concat(e)},c=[{"@type":"ListItem",position:1,name:t,item:"https://".concat(d.getDomain())}];return(c=c.concat(e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+2,name:e.name,item:s(e.href)}})))).push({"@type":"ListItem",position:c.length+1,name:e.name,item:s(e.href)}),i.currentPageType===r.PRODUCT&&o&&c.push({"@type":"ListItem",position:c.length+1,name:o.name,item:s(o.productHref)}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:c}}catch(e){}}function m(e){try{var t=d.getCurrentRouting(),o=null==t?void 0:t.path;if(e){var i=(e.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[]).find((function(e){return Object.values(e.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}))}));if(i){var a=Object.values(i.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}));if(a)return{"@context":"http://schema.org","@type":"ItemList",itemListElement:(a.data||[]).slice(0,10).map((function(e,t){var i,a,r,n;return{"@type":"ListItem",position:t+1,item:{"@type":"Product",name:e.name,image:(null===(a=null===(i=e.selectedVariant.mainImage)||void 0===i?void 0:i.image)||void 0===a?void 0:a.src)||"",offers:{"@type":"Offer",url:(n=e.href,o?"https://".concat(d.getDomain(),"/").concat(o).concat(n):"https://".concat(d.getDomain()).concat(n)),priceCurrency:e.selectedVariant.price.currency||"TRY",price:(null!==(r=e.selectedVariant.campaignPrice)&&void 0!==r?r:e.selectedVariant.finalPrice).toFixed(2),availability:e.selectedVariant.stock>0||e.selectedVariant.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}}}))}}}}catch(e){}}function u(e,t,o){var i,a,n=o;try{switch(t){case r.PRODUCT:var s=e,d=s.name,l=(null===(i=s.brand)||void 0===i?void 0:i.name)||"",c=s.selectedVariant.sku||"",p=(null===(a=s.selectedVariant.barcodeList)||void 0===a?void 0:a.length)?s.selectedVariant.barcodeList[0]:"",m=s.selectedVariant.campaignPrice?s.selectedVariant.formattedCampaignPrice:s.selectedVariant.formattedFinalPrice;n.includes("{{name}}")&&(n=g(n,"{{name}}",d)),n.includes("{{brand}}")&&(n=g(n,"{{brand}}",l)),n.includes("{{sku}}")&&(n=g(n,"{{sku}}",c)),n.includes("{{barcode}}")&&(n=g(n,"{{barcode}}",p)),n.includes("{{price}}")&&(n=g(n,"{{price}}",m.toString()));break;case r.BRAND:case r.CATEGORY:case r.BLOG_CATEGORY:var u=e.name||"";n.includes("{{name}}")&&(n=g(n,"{{name}}",u));break;case r.BLOG:var f=e.title;n.includes("{{name}}")&&(n=g(n,"{{name}}",f))}}catch(e){}return n.trimEnd()}function g(e,t,o){var i=new RegExp(t,"g");return e.replace(i,o)}export{c as IkasPageHead};
1
+ import{__assign as e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import i from"next/head.js";import{useRouter as a}from"next/router";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as r}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import{IkasIndexPageSeoSetting as n}from"../../models/data/storefront/index-page-seo-setting/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import{IkasProductList as s}from"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as d}from"@ikas/storefront-config";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"./index.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"../page-editor/loader/style.module.scss.js";import"../google-captcha/index.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import"../../pages/account/activate.js";import{IkasBaseStore as l}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var c=o((function(o){var s,c=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,T=a(),D="undefined"!=typeof window,L="local"===process.env.NEXT_PUBLIC_ENV,w=T.asPath.split("?")[0].replace("/",""),k=(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:"",R=L?"http://localhost:3333":"https://"+d.getDomain(),E=null===(s=d.getIndexPageSeoSettings())||void 0===s?void 0:s.find((function(e){return e.locale===d.getCurrentLocale()})),_=E?new n(E):null;t.useEffect((function(){document.documentElement.lang=d.getCurrentLocale()}),[c,j]);var I=t.useMemo((function(){if(j&&j.href)return"".concat(R).concat(j.href)}),[j]),V=t.useMemo((function(){var e,t,o,i=[];if(y){if(i.push({property:"og:type",content:"website"}),i.push({property:"og:site_name",content:"https://"+d.getDomain()}),g&&i.push({property:"og:title",content:g}),f&&i.push({property:"og:description",content:f}),c===r.INDEX){var a=null,n=null;!g&&(null==_?void 0:_.pageTitle)&&(a=_.pageTitle),!f&&(null==_?void 0:_.description)&&(n=_.description),(s=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===c})))&&(a=u(j,c,s.titleTemplate||""),n=u(j,c,s.descriptionTemplate||"")),a&&i.push({property:"og:title",content:a}),n&&i.push({property:"og:description",content:n})}if(c===r.PRODUCT){var s,l=null,p=null;(s=null===(t=d.getMetaTemplates())||void 0===t?void 0:t.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===c})))&&(l=u(j,c,s.titleTemplate||""),p=u(j,c,s.descriptionTemplate||"")),l&&!g&&i.push({property:"og:title",content:l}),p&&!f&&i.push({property:"og:description",content:p})}i.push({property:"og:url",content:I||(D?window.location.href:"")||"https://".concat(d.getDomain())});var m=null;if(j&&c===r.PRODUCT){var v=j.selectedVariant.mainImage;(null==v?void 0:v.image)&&(m={property:"og:image",content:v.image.src.replace(".webp",".jpg")})}if(j&&c===r.CATEGORY){var h=j;h.image&&(m={property:"og:image",content:h.image.src.replace(".webp",".jpg")})}if(j&&c===r.BRAND){var b=j;b.image&&(m={property:"og:image",content:b.image.src.replace(".webp",".jpg")})}if(j&&c===r.BLOG_CATEGORY){var C=j;C.image&&(m={property:"og:image",content:C.image.src.replace(".webp",".jpg")})}if(j&&c===r.BLOG){var T=j;T.image&&(m={property:"og:image",content:T.image.src.replace(".webp",".jpg")})}!m&&(null==_?void 0:_.icon)&&(m={property:"og:image",content:null===(o=null==_?void 0:_.icon)||void 0===o?void 0:o.src.replace(".webp",".jpg")}),!m&&(null==x?void 0:x.logo)&&(m={property:"og:image",content:x.logo.src.replace(".webp",".jpg")}),m&&i.push(m)}return i}),[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,l=(null==t?void 0:t.logo)?t.logo.src:void 0;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:l,image:l,url:"https://"+d.getDomain(),telephone:null==t?void 0:t.phone,address:e(e({"@type":"PostalAddress",streetAddress:null===(o=t.address)||void 0===o?void 0:o.addressLine1,addressLocality:null===(a=null===(i=t.address)||void 0===i?void 0:i.city)||void 0===a?void 0:a.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(r=t.address)||void 0===r?void 0:r.postalCode,addressCountry:null===(s=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===s?void 0:s.code})}}(x);t.push(i),t.push(a)}if(j&&c===r.PRODUCT){var n=j,s=function(t,o){var i,a,n,s,l,c;try{var p=d.getCurrentRouting(),m=null==p?void 0:p.path,g=function(e){return m?"https://".concat(d.getDomain(),"/").concat(m).concat(e):"https://".concat(d.getDomain()).concat(e)},f=t.selectedVariant,v=null,h=null===(i=d.getMetaTemplates())||void 0===i?void 0:i.find((function(e){return e.locale===d.getCurrentLocale()&&r.PRODUCT}));return h&&(v=u(t,r.PRODUCT,h.descriptionTemplate||"")),e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:(null===(a=t.metaData)||void 0===a?void 0:a.description)||v,image:null===(n=f.images)||void 0===n?void 0:n.map((function(e){return e.image?e.image.src:""})),productId:f.id,sku:f.sku,mpn:(null===(s=f.barcodeList)||void 0===s?void 0:s.length)?f.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(l=t.brand)||void 0===l?void 0:l.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:g(t.href),priceCurrency:f.price.currency||"TRY",price:(null!==(c=f.campaignPrice)&&void 0!==c?c:f.price.finalPrice).toFixed(2),priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:f.stock>0||f.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(n,b||null);if(s&&t.push(s),n.categories.length)(g=p(n.categories[0],o,n))&&t.push(g)}if(j&&c===r.CATEGORY){var l=function(e){var t,o;try{var i=d.getCurrentRouting(),a=null==i?void 0:i.path,r=function(e){return a?"https://".concat(d.getDomain(),"/").concat(a).concat(e):"https://".concat(d.getDomain()).concat(e)};return{"@context":"http://schema.org","@type":"CollectionPage",url:r(e.href),name:null===(t=e.metaData)||void 0===t?void 0:t.pageTitle,description:null===(o=e.metaData)||void 0===o?void 0:o.description,image:e.image?e.image.src:void 0}}catch(e){}}(j),g=p(j,o),f=m(C);l&&t.push(l),g&&t.push(g),f&&t.push(f)}j&&c===r.BRAND&&((f=m(C))&&t.push(f));if(j&&c===r.BLOG){var v=function(t){var o;try{var i="https://".concat(d.getDomain()).concat(t.href),a=function(e){var t=new Date(e),o=t.getFullYear(),i=(t.getMonth()+1).toString().padStart(2,"0"),a=t.getDate().toString().padStart(2,"0");return"".concat(o,"-").concat(i,"-").concat(a)},r="".concat(t.writer.firstName," ").concat(t.writer.lastName),n=(new DOMParser).parseFromString(t.blogContent.content,"text/html").body.textContent;return e(e({"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,image:null===(o=t.image)||void 0===o?void 0:o.src},t.category&&{genre:t.category.name}),{url:i,datePublished:a(t.createdAt),dateCreated:a(t.createdAt),dateModified:a(t.updatedAt),description:t.shortDescription,articleBody:n,author:{"@type":"Person",name:r}})}catch(e){}}(j);v&&t.push(v)}return t}),[j,x]),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===c}));return t?u(j,c,t.titleTemplate||""):null}),[c,j]),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===c}));return t?u(j,c,t.descriptionTemplate||""):null}),[c,j]),A=t.useMemo((function(){return!d.getFavicon()&&(null==_?void 0:_.favIcon)?_.favIcon:null}),[]),B=[];d.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){B.push({routing:e,hrefLang:e.locale+"-"+t})})):B.push({routing:e,hrefLang:e.locale})}));var U=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=B.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)||""},F=l.getInstance();return t.createElement(i,null,t.createElement("title",null,g||M||(null==_?void 0:_.pageTitle)||""),t.createElement("meta",{name:"description",content:f||N||(null==_?void 0:_.description)||""}),B.length>1&&B.filter((function(e){return!k||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(R+(e.routing.path?"/"+e.routing.path:""),"/").concat(U(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(R).concat(P).concat(e)})})),A&&t.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(A,"/image_180.webp"),type:"image/webp"}),!v&&F.currentPageType!==r.NOT_FOUND&&t.createElement("link",{rel:"canonical",href:"".concat(R).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=l.getInstance(),a=d.getCurrentRouting(),n=null==a?void 0:a.path,s=function(e){return n?"https://".concat(d.getDomain(),"/").concat(n).concat(e):"https://".concat(d.getDomain()).concat(e)},c=[{"@type":"ListItem",position:1,name:t,item:"https://".concat(d.getDomain())}];return(c=c.concat(e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+2,name:e.name,item:s(e.href)}})))).push({"@type":"ListItem",position:c.length+1,name:e.name,item:s(e.href)}),i.currentPageType===r.PRODUCT&&o&&c.push({"@type":"ListItem",position:c.length+1,name:o.name,item:s(o.productHref)}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:c}}catch(e){}}function m(e){try{var t=d.getCurrentRouting(),o=null==t?void 0:t.path;if(e){var i=(e.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[]).find((function(e){return Object.values(e.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}))}));if(i){var a=Object.values(i.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}));if(a)return{"@context":"http://schema.org","@type":"ItemList",itemListElement:(a.data||[]).slice(0,10).map((function(e,t){var i,a,r,n;return{"@type":"ListItem",position:t+1,item:{"@type":"Product",name:e.name,image:(null===(a=null===(i=e.selectedVariant.mainImage)||void 0===i?void 0:i.image)||void 0===a?void 0:a.src)||"",offers:{"@type":"Offer",url:(n=e.href,o?"https://".concat(d.getDomain(),"/").concat(o).concat(n):"https://".concat(d.getDomain()).concat(n)),priceCurrency:e.selectedVariant.price.currency||"TRY",price:(null!==(r=e.selectedVariant.campaignPrice)&&void 0!==r?r:e.selectedVariant.finalPrice).toFixed(2),availability:e.selectedVariant.stock>0||e.selectedVariant.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}}}))}}}}catch(e){}}function u(e,t,o){var i,a,n=o;try{switch(t){case r.PRODUCT:var s=e,d=s.name,l=(null===(i=s.brand)||void 0===i?void 0:i.name)||"",c=s.selectedVariant.sku||"",p=(null===(a=s.selectedVariant.barcodeList)||void 0===a?void 0:a.length)?s.selectedVariant.barcodeList[0]:"",m=s.selectedVariant.campaignPrice?s.selectedVariant.formattedCampaignPrice:s.selectedVariant.formattedFinalPrice;n.includes("{{name}}")&&(n=g(n,"{{name}}",d)),n.includes("{{brand}}")&&(n=g(n,"{{brand}}",l)),n.includes("{{sku}}")&&(n=g(n,"{{sku}}",c)),n.includes("{{barcode}}")&&(n=g(n,"{{barcode}}",p)),n.includes("{{price}}")&&(n=g(n,"{{price}}",m.toString()));break;case r.BRAND:case r.CATEGORY:case r.BLOG_CATEGORY:var u=e.name||"";n.includes("{{name}}")&&(n=g(n,"{{name}}",u));break;case r.BLOG:var f=e.title;n.includes("{{name}}")&&(n=g(n,"{{name}}",f))}}catch(e){}return n.trimEnd()}function g(e,t,o){var i=new RegExp(t,"g");return e.replace(i,o)}export{c as IkasPageHead};
@@ -1 +1 @@
1
- import{__assign as 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/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import{IkasThemeJsonCustomData as 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,{key:Date.now()}))}),[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
+ 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/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import{IkasThemeJsonCustomData as 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,{key:Date.now()}))}),[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&&P.length>0?P:null,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 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/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../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,showCompanyInfoInShippingAddress:null,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
+ 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/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../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,bundleProductSettings:null,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,showCompanyInfoInShippingAddress:null,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{__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 n from"../../hooks/useDimension.js";import o from"./renderer/index.js";import{checkSavedSessionForPopups as s,checkIsPopupSavedToLocalStorage as l}from"./utils/index.js";import{IkasStorefrontPopupPageFilterTypeEnum as u,IkasStorefrontPopupPageFilterDataTypeEnum as p,IkasStorefrontPopupDeviceTypeEnum as c}from"@ikas/storefront-models";import{IkasBaseStore as a}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";var m=r((function(){var r=n().isMobile,m=t.useState([]),d=m[0],f=m[1];return t.useEffect((function(){s(),a.getInstance().currentPageType;var t=[],n=i.getStorefrontPopups().filter((function(e){var i;if(l(e.id))return!1;var n=[];if((null===(i=e.pageFilters)||void 0===i?void 0:i.length)&&(n=e.pageFilters.filter((function(e){return e.pageType===u.CUSTOM}))).length){var o=window.location.href;o.includes("http://localhost:3333/")&&(o=o.replace("http://localhost:3333/","https://bundle.myikas.dev/")),n.forEach((function(e){var r;null===(r=e.filters)||void 0===r||r.forEach((function(e){e.type===p.CONTAINS&&o.includes(e.value)?t.push(p.CONTAINS):e.type===p.DOES_NOT_CONTAIN&&o.includes(e.value)?t.push(p.DOES_NOT_CONTAIN):e.type===p.EXACT_MATCH&&o===e.value&&t.push(p.EXACT_MATCH)}))}))}if(t.includes(p.DOES_NOT_CONTAIN))return!1;var s=function(){return r?[c.ALL,c.MOBILE].includes(e.visibleDevice):[c.ALL,c.DESKTOP].includes(e.visibleDevice)};return(t.length||!(!t.length&&!e.isFilteredOnServerSide))&&s()})),o=document.head.querySelector('link[href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css"]');if(n.length&&!o){var m=document.createElement("link");m.type="text/css",m.rel="stylesheet",m.href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",document.head.appendChild(m)}f(e([],n,!0))}),[r]),t.createElement(t.Fragment,null,d.map((function(e,r){return t.createElement(o,{storefrontPopup:e,key:e.id})})))}));export{m as PopupListRendererForPage};
1
+ import{__awaiter as e,__generator as t,__spreadArray as r}from'./../../ext/tslib/tslib.es6.js';import*as n from"react";import{observer as i}from"mobx-react-lite";import{IkasStorefrontConfig as o}from"@ikas/storefront-config";import s from"../../hooks/useDimension.js";import l from"./renderer/index.js";import{checkSavedSessionForPopups as u,checkIsPopupSavedToLocalStorage as c}from"./utils/index.js";import{IkasStorefrontPopupPageFilterTypeEnum as a,IkasStorefrontPopupPageFilterDataTypeEnum as d,IkasStorefrontPopupDeviceTypeEnum as p}from"@ikas/storefront-models";var f=i((function(){var i=s().isMobile,f=n.useState([]),m=f[0],v=f[1];return n.useEffect((function(){e(void 0,void 0,void 0,(function(){var e,n,s,l;return t(this,(function(t){switch(t.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){var r=o.getSessionId();r&&(clearInterval(t),e(r))}),100)}))];case 1:return t.sent(),u(),e=[],n=o.getStorefrontPopups().filter((function(t){var r;if(c(t.id))return!1;var n=[];if((null===(r=t.pageFilters)||void 0===r?void 0:r.length)&&(n=t.pageFilters.filter((function(e){return e.pageType===a.CUSTOM}))).length){var o=window.location.href;o.includes("http://localhost:3333/")&&(o=o.replace("http://localhost:3333/","https://bundle.myikas.dev/")),n.forEach((function(t){var r;null===(r=t.filters)||void 0===r||r.forEach((function(t){t.type===d.CONTAINS&&o.includes(t.value)?e.push(d.CONTAINS):t.type===d.DOES_NOT_CONTAIN&&o.includes(t.value)?e.push(d.DOES_NOT_CONTAIN):t.type===d.EXACT_MATCH&&o===t.value&&e.push(d.EXACT_MATCH)}))}))}if(e.includes(d.DOES_NOT_CONTAIN))return!1;var s=function(){return i?[p.ALL,p.MOBILE].includes(t.visibleDevice):[p.ALL,p.DESKTOP].includes(t.visibleDevice)};return(e.length||!(!e.length&&!t.isFilteredOnServerSide))&&s()})),s=document.head.querySelector('link[href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css"]'),n.length&&!s&&((l=document.createElement("link")).type="text/css",l.rel="stylesheet",l.href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",document.head.appendChild(l)),v(r([],n,!0)),[2]}}))}))}),[i]),n.createElement(n.Fragment,null,m.map((function(e,t){return n.createElement(l,{storefrontPopup:e,key:e.id})})))}));export{f as PopupListRendererForPage};
@@ -0,0 +1,8 @@
1
+ import { IkasOrderGiftCardLine as IOrderGiftCardLine } from "@ikas/storefront-models";
2
+ export declare class IkasOrderGiftCardLine implements IOrderGiftCardLine {
3
+ amount: number;
4
+ code: string;
5
+ giftCardId: string;
6
+ id: string;
7
+ constructor(data: IOrderGiftCardLine);
8
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as t}from"mobx";var i=function(i){this.amount=i.amount||0,this.code=i.code||"",this.giftCardId=i.giftCardId||"",this.id=i.id||"",t(this)};export{i as IkasOrderGiftCardLine};
@@ -12,6 +12,7 @@ import { IkasOrderTaxLine } from "./tax-line";
12
12
  import { IkasBaseModel } from "../base";
13
13
  import { IkasOrderCancelReason, IkasOrderPackageStatus, IkasOrderPaymentStatus, IkasOrderShippingMethod, IkasOrderStatus } from "@ikas/storefront-models";
14
14
  import { IkasOrder as IOrder } from "@ikas/storefront-models";
15
+ import { IkasOrderGiftCardLine } from "./gift-card-line";
15
16
  declare type IOrderConstructorData = {
16
17
  refundSettings?: IkasOrderRefundSettings | null;
17
18
  } & IOrder;
@@ -23,6 +24,7 @@ export declare class IkasOrder extends IkasBaseModel implements IOrder {
23
24
  currencySymbol: string | null;
24
25
  customer: IkasOrderCustomer | null;
25
26
  customerId: string | null;
27
+ giftCardLines: IkasOrderGiftCardLine[] | null;
26
28
  giftPackageLines: IkasOrderGiftPackageLine[] | null;
27
29
  giftPackageNote: string | null;
28
30
  invoices: IkasInvoice[] | null;
@@ -1 +1 @@
1
- import{__extends as e}from'./../../../ext/tslib/tslib.es6.js';import{IkasOrderAddress as t}from"./address/index.js";import{IkasOrderShippingLine as n}from"./shipping-line/index.js";import{IkasOrderLineItem as r}from"./line-item/index.js";import{IkasOrderCustomer as o}from"./customer/index.js";import{IkasOrderGiftPackageLine as i}from"./gift-line/index.js";import{IkasInvoice as u}from"./invoice/index.js";import{IkasOrderPaymentMethod as l}from"./payment-method/index.js";import{IkasOrderAdjustment as s}from"./adjustment/index.js";import{IkasOrderPackage as a}from"./package/index.js";import{IkasOrderTaxLine as d}from"./tax-line/index.js";import{IkasBaseModel as c}from"../base/index.js";import{IkasCampaignType as m,IkasOrderShippingMethod as p,IkasOrderStatus as f}from"@ikas/storefront-models";export{IkasOrderCancelReason,IkasOrderPackageStatus,IkasOrderPaymentStatus,IkasOrderShippingMethod,IkasOrderStatus}from"@ikas/storefront-models";import{makeObservable as g,observable as b,computed as y}from"mobx";import{IkasOrderFunctions as h}from"@ikas/storefront-model-functions";import{formatCurrency as P}from"../../../utils/currency.js";var j=function(c){function j(e,m){var h,P,j,A,k,v,I,S,O,x,C=this;(C=c.call(this,e)||this).billingAddress=null,C.cancelReason=null,C.cancelledAt=null,C.currencySymbol=null,C.customer=null,C.customerId=null,C.giftPackageLines=null,C.giftPackageNote=null,C.invoices=null,C.isGiftPackage=null,C.note=null,C.orderAdjustments=null,C.orderNumber=null,C.orderPackageStatus=null,C.orderPackages=null,C.orderPaymentStatus=null,C.orderedAt=null,C.priceListId=null,C.paymentMethods=null,C.shippingAddress=null,C.shippingLines=null,C.taxLines=null,C.billingAddress=e.billingAddress?new t(e.billingAddress):null,C.cancelReason=e.cancelReason||null,C.cancelledAt=e.cancelledAt||null,C.currencyCode=e.currencyCode||"",C.currencySymbol=e.currencySymbol||null,C.customer=e.customer?new o(e.customer):null,C.customerId=e.customerId||null,C.giftPackageLines=(null===(h=e.giftPackageLines)||void 0===h?void 0:h.map((function(e){return new i(e)})))||null,C.giftPackageNote=e.giftPackageNote||null,C.invoices=(null===(P=e.invoices)||void 0===P?void 0:P.map((function(e){return new u(e)})))||null,C.isGiftPackage=e.isGiftPackage||null,C.note=e.note||null,C.orderAdjustments=(null===(j=e.orderAdjustments)||void 0===j?void 0:j.map((function(e){return new s(e)})))||null,C.orderLineItems=(null===(A=e.orderLineItems)||void 0===A?void 0:A.map((function(e){return new r(e)})).filter((function(e){return!e.deleted})))||[],C.orderNumber=e.orderNumber||null,C.orderPackageStatus=e.orderPackageStatus||null,C.orderPackages=(null===(k=e.orderPackages)||void 0===k?void 0:k.map((function(e){return new a(e)})))||null,C.orderPaymentStatus=e.orderPaymentStatus||null,C.orderedAt=e.orderedAt||null,C.priceListId=e.priceListId||null,C.paymentMethods=(null===(v=e.paymentMethods)||void 0===v?void 0:v.map((function(e){return new l(e)})))||null,C.shippingAddress=e.shippingAddress?new t(e.shippingAddress):null,C.shippingLines=(null===(I=e.shippingLines)||void 0===I?void 0:I.map((function(e){return new n(e)})))||null,C.shippingMethod=e.shippingMethod||p.SHIPMENT,C.status=e.status||f.CREATED,C.taxLines=(null===(S=e.taxLines)||void 0===S?void 0:S.map((function(e){return new d(e)})))||null,C.totalFinalPrice=null!==(O=e.totalFinalPrice)&&void 0!==O?O:0,C.totalPrice=null!==(x=e.totalPrice)&&void 0!==x?x:0,C.refundSettings=e.refundSettings;var T={billingAddress:b,cancelReason:b,cancelledAt:b,currencyCode:b,currencySymbol:b,customer:b,customerId:b,giftPackageLines:b,giftPackageNote:b,invoices:b,isGiftPackage:b,note:b,orderAdjustments:b,orderLineItems:b,orderNumber:b,orderPackageStatus:b,orderPackages:b,orderPaymentStatus:b,orderedAt:b,paymentMethods:b,shippingAddress:b,shippingLines:b,shippingMethod:b,status:b,taxLines:b,totalFinalPrice:b,totalPrice:b,refundSettings:b,items:y,itemCount:y,refundableItems:y,unfullfilledItems:y,refundedItems:y,totalTax:y,formattedTotalTax:y,shippingTotal:y,formattedShippingTotal:y,formattedTotalFinalPrice:y,formattedTotalPrice:y,hasCustomer:y,hasValidCustomerEmail:y,customerFullName:y,formattedDate:y,couponAdjustment:y,nonCouponAdjustments:y,orderProductFileIds:y};return m&&(delete T.billingAddress,delete T.shippingAddress),g(C,T),C}return e(j,c),Object.defineProperty(j.prototype,"items",{get:function(){return this.orderLineItems},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"itemCount",{get:function(){var e;return(null===(e=this.items)||void 0===e?void 0:e.length)||0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"itemQuantity",{get:function(){return this.items.reduce((function(e,t){return e+t.quantity}),0)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"refundableItems",{get:function(){return this.refundSettings?h.getRefundableItems(this,this.refundSettings):[]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"displayedPackages",{get:function(){return h.getDisplayedPackages(this).map((function(e){return new a(e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"unfullfilledItems",{get:function(){return h.getUnfullfilledItems(this)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"refundedItems",{get:function(){return h.getRefundedItems(this)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"totalTax",{get:function(){return h.getTotalTax(this)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedTotalTax",{get:function(){return P(this.totalTax,this.currencyCode,this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"shippingTotal",{get:function(){return h.getShippingTotal(this)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedShippingTotal",{get:function(){return P(this.shippingTotal,this.currencyCode,this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedTotalFinalPrice",{get:function(){return P(this.totalFinalPrice,this.currencyCode,this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedTotalPrice",{get:function(){return P(this.totalPrice,this.currencyCode,this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"hasCustomer",{get:function(){return h.hasCustomer(this)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"hasValidCustomerEmail",{get:function(){return h.hasValidCustomerEmail(this)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"customerFullName",{get:function(){return h.getCustomerFullName(this)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedDate",{get:function(){return h.getFormattedDate(this)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"couponAdjustment",{get:function(){return h.getCouponAdjustment(this)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"nonCouponAdjustments",{get:function(){return h.getNonCouponAdjustments(this)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isRefundEnabled",{get:function(){return this.refundableItems.some((function(e){return null!==e.refundQuantity}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"displayedOrderAdjustments",{get:function(){var e;return null===(e=this.orderAdjustments)||void 0===e?void 0:e.filter((function(e){return e.campaignType!==m.FREE_SHIPPING}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"orderProductFileIds",{get:function(){return h.getOrderProductFiles(this)},enumerable:!1,configurable:!0}),j}(c);export{j as IkasOrder};
1
+ import{__extends as e}from'./../../../ext/tslib/tslib.es6.js';import{IkasOrderAddress as t}from"./address/index.js";import{IkasOrderShippingLine as n}from"./shipping-line/index.js";import{IkasOrderLineItem as r}from"./line-item/index.js";import{IkasOrderCustomer as o}from"./customer/index.js";import{IkasOrderGiftPackageLine as i}from"./gift-line/index.js";import{IkasInvoice as u}from"./invoice/index.js";import{IkasOrderPaymentMethod as l}from"./payment-method/index.js";import{IkasOrderAdjustment as s}from"./adjustment/index.js";import{IkasOrderPackage as a}from"./package/index.js";import{IkasOrderTaxLine as d}from"./tax-line/index.js";import{IkasBaseModel as c}from"../base/index.js";import{IkasCampaignType as m,IkasOrderShippingMethod as p,IkasOrderStatus as f}from"@ikas/storefront-models";export{IkasOrderCancelReason,IkasOrderPackageStatus,IkasOrderPaymentStatus,IkasOrderShippingMethod,IkasOrderStatus}from"@ikas/storefront-models";import{makeObservable as g,observable as b,computed as y}from"mobx";import{IkasOrderFunctions as h}from"@ikas/storefront-model-functions";import{formatCurrency as P}from"../../../utils/currency.js";import{IkasOrderGiftCardLine as j}from"./gift-card-line/index.js";var v=function(c){function v(e,m){var h,P,v,A,k,I,S,O,x,C,L,T=this;(T=c.call(this,e)||this).billingAddress=null,T.cancelReason=null,T.cancelledAt=null,T.currencySymbol=null,T.customer=null,T.customerId=null,T.giftPackageLines=null,T.giftPackageNote=null,T.invoices=null,T.isGiftPackage=null,T.note=null,T.orderAdjustments=null,T.orderNumber=null,T.orderPackageStatus=null,T.orderPackages=null,T.orderPaymentStatus=null,T.orderedAt=null,T.priceListId=null,T.paymentMethods=null,T.shippingAddress=null,T.shippingLines=null,T.taxLines=null,T.billingAddress=e.billingAddress?new t(e.billingAddress):null,T.cancelReason=e.cancelReason||null,T.cancelledAt=e.cancelledAt||null,T.currencyCode=e.currencyCode||"",T.currencySymbol=e.currencySymbol||null,T.customer=e.customer?new o(e.customer):null,T.customerId=e.customerId||null,T.giftCardLines=(null===(h=e.giftCardLines)||void 0===h?void 0:h.map((function(e){return new j(e)})))||null,T.giftPackageLines=(null===(P=e.giftPackageLines)||void 0===P?void 0:P.map((function(e){return new i(e)})))||null,T.giftPackageNote=e.giftPackageNote||null,T.invoices=(null===(v=e.invoices)||void 0===v?void 0:v.map((function(e){return new u(e)})))||null,T.isGiftPackage=e.isGiftPackage||null,T.note=e.note||null,T.orderAdjustments=(null===(A=e.orderAdjustments)||void 0===A?void 0:A.map((function(e){return new s(e)})))||null,T.orderLineItems=(null===(k=e.orderLineItems)||void 0===k?void 0:k.map((function(e){return new r(e)})).filter((function(e){return!e.deleted})))||[],T.orderNumber=e.orderNumber||null,T.orderPackageStatus=e.orderPackageStatus||null,T.orderPackages=(null===(I=e.orderPackages)||void 0===I?void 0:I.map((function(e){return new a(e)})))||null,T.orderPaymentStatus=e.orderPaymentStatus||null,T.orderedAt=e.orderedAt||null,T.priceListId=e.priceListId||null,T.paymentMethods=(null===(S=e.paymentMethods)||void 0===S?void 0:S.map((function(e){return new l(e)})))||null,T.shippingAddress=e.shippingAddress?new t(e.shippingAddress):null,T.shippingLines=(null===(O=e.shippingLines)||void 0===O?void 0:O.map((function(e){return new n(e)})))||null,T.shippingMethod=e.shippingMethod||p.SHIPMENT,T.status=e.status||f.CREATED,T.taxLines=(null===(x=e.taxLines)||void 0===x?void 0:x.map((function(e){return new d(e)})))||null,T.totalFinalPrice=null!==(C=e.totalFinalPrice)&&void 0!==C?C:0,T.totalPrice=null!==(L=e.totalPrice)&&void 0!==L?L:0,T.refundSettings=e.refundSettings;var F={billingAddress:b,cancelReason:b,cancelledAt:b,currencyCode:b,currencySymbol:b,customer:b,customerId:b,giftCardLines:b,giftPackageLines:b,giftPackageNote:b,invoices:b,isGiftPackage:b,note:b,orderAdjustments:b,orderLineItems:b,orderNumber:b,orderPackageStatus:b,orderPackages:b,orderPaymentStatus:b,orderedAt:b,paymentMethods:b,shippingAddress:b,shippingLines:b,shippingMethod:b,status:b,taxLines:b,totalFinalPrice:b,totalPrice:b,refundSettings:b,items:y,itemCount:y,refundableItems:y,unfullfilledItems:y,refundedItems:y,totalTax:y,formattedTotalTax:y,shippingTotal:y,formattedShippingTotal:y,formattedTotalFinalPrice:y,formattedTotalPrice:y,hasCustomer:y,hasValidCustomerEmail:y,customerFullName:y,formattedDate:y,couponAdjustment:y,nonCouponAdjustments:y,orderProductFileIds:y};return m&&(delete F.billingAddress,delete F.shippingAddress),g(T,F),T}return e(v,c),Object.defineProperty(v.prototype,"items",{get:function(){return this.orderLineItems},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"itemCount",{get:function(){var e;return(null===(e=this.items)||void 0===e?void 0:e.length)||0},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"itemQuantity",{get:function(){return this.items.reduce((function(e,t){return e+t.quantity}),0)},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"refundableItems",{get:function(){return this.refundSettings?h.getRefundableItems(this,this.refundSettings):[]},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"displayedPackages",{get:function(){return h.getDisplayedPackages(this).map((function(e){return new a(e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"unfullfilledItems",{get:function(){return h.getUnfullfilledItems(this)},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"refundedItems",{get:function(){return h.getRefundedItems(this)},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"totalTax",{get:function(){return h.getTotalTax(this)},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"formattedTotalTax",{get:function(){return P(this.totalTax,this.currencyCode,this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"shippingTotal",{get:function(){return h.getShippingTotal(this)},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"formattedShippingTotal",{get:function(){return P(this.shippingTotal,this.currencyCode,this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"formattedTotalFinalPrice",{get:function(){return P(this.totalFinalPrice,this.currencyCode,this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"formattedTotalPrice",{get:function(){return P(this.totalPrice,this.currencyCode,this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"hasCustomer",{get:function(){return h.hasCustomer(this)},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"hasValidCustomerEmail",{get:function(){return h.hasValidCustomerEmail(this)},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"customerFullName",{get:function(){return h.getCustomerFullName(this)},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"formattedDate",{get:function(){return h.getFormattedDate(this)},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"couponAdjustment",{get:function(){return h.getCouponAdjustment(this)},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"nonCouponAdjustments",{get:function(){return h.getNonCouponAdjustments(this)},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"isRefundEnabled",{get:function(){return this.refundableItems.some((function(e){return null!==e.refundQuantity}))},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"displayedOrderAdjustments",{get:function(){var e;return null===(e=this.orderAdjustments)||void 0===e?void 0:e.filter((function(e){return e.campaignType!==m.FREE_SHIPPING}))},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"orderProductFileIds",{get:function(){return h.getOrderProductFiles(this)},enumerable:!1,configurable:!0}),v}(c);export{v as IkasOrder};
@@ -0,0 +1,7 @@
1
+ import { IkasOrderLineBundleProductSettings as IOrderLineBundleProductSettings } from "@ikas/storefront-models";
2
+ export declare class IkasOrderLineBundleProductSettings implements IOrderLineBundleProductSettings {
3
+ bundleLineId: string;
4
+ bundleLineQuantity: number;
5
+ name: string | null;
6
+ constructor(data: IOrderLineBundleProductSettings);
7
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as n}from"mobx";var i=function(i){this.bundleLineId=i.bundleLineId||"",this.bundleLineQuantity=i.bundleLineQuantity||0,this.name=i.name||null,n(this)};export{i as IkasOrderLineBundleProductSettings};
@@ -2,11 +2,13 @@ import { IkasOrderLineItem as IOrderLineItem, IkasOrderLineItemStatus } from "@i
2
2
  import { IkasOrderLineDiscount } from "./discount";
3
3
  import { IkasOrderLineVariant } from "./variant";
4
4
  import { IkasOrderLineItemOption } from "./option";
5
+ import { IkasOrderLineBundleProductSettings } from "./bundle-product-settings";
5
6
  import { IkasBaseModel } from "../../base";
6
7
  declare type IOrderLineItemConstructorParams = {
7
8
  refundQuantity?: number;
8
9
  } & IOrderLineItem;
9
10
  export declare class IkasOrderLineItem extends IkasBaseModel implements IOrderLineItem {
11
+ bundleProductSettings: IkasOrderLineBundleProductSettings | null;
10
12
  currencyCode: string | null;
11
13
  currencySymbol: string | null;
12
14
  discount: IkasOrderLineDiscount | null;
@@ -1 +1 @@
1
- import{__extends as t}from'./../../../../ext/tslib/tslib.es6.js';export{IkasOrderLineItemStatus}from"@ikas/storefront-models";import{IkasOrderLineDiscount as e}from"./discount/index.js";import{IkasOrderLineVariant as i}from"./variant/index.js";import{IkasOrderLineItemOption as r}from"./option/index.js";import{IkasBaseModel as n}from"../../base/index.js";import{makeObservable as o,observable as u,computed as c,action as a}from"mobx";import{IkasOrderLineItemFunctions as l}from"@ikas/storefront-model-functions";import{formatCurrency as d}from"../../../../utils/currency.js";import{IkasBaseStore as s}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";var f=function(n){function f(t){var l,d,s,f,y,m=this;return(m=n.call(this,t)||this).currencyCode=null,m.discount=null,m.discountPrice=null,m.finalPrice=null,m.options=null,m.originalOrderLineItemId=null,m.statusUpdatedAt=null,m.stockLocationId=null,m.taxValue=null,m._refundQuantity=null,m.currencyCode=t.currencyCode||null,m.currencySymbol=t.currencySymbol||null,m.discount=t.discount?new e(t.discount):null,m.discountPrice=null!==(l=t.discountPrice)&&void 0!==l?l:null,m.finalPrice=null!==(d=t.finalPrice)&&void 0!==d?d:null,m.finalUnitPrice=null!==(s=t.finalUnitPrice)&&void 0!==s?s:null,m.options=(null===(f=t.options)||void 0===f?void 0:f.map((function(t){return new r(t)})))||null,m.originalOrderLineItemId=t.originalOrderLineItemId||null,m.price=t.price,m.quantity=t.quantity,m.status=t.status,m.statusUpdatedAt=t.statusUpdatedAt,m.stockLocationId=t.stockLocationId,m.taxValue=t.taxValue,m.unitPrice=null!==(y=t.unitPrice)&&void 0!==y?y:null,m.variant=new i(t.variant),m.orderedAt=t.orderedAt,m.refundQuantity=t.refundQuantity,o(m,{currencyCode:u,currencySymbol:u,discount:u,discountPrice:u,finalPrice:u,finalUnitPrice:u,options:u,originalOrderLineItemId:u,price:u,quantity:u,status:u,statusUpdatedAt:u,stockLocationId:u,taxValue:u,unitPrice:u,variant:u,orderedAt:u,_refundQuantity:u,priceWithQuantity:c,formattedPriceWithQuantity:c,overridenPriceWithQuantity:c,formattedOverridenPriceWithQuantity:c,formattedFinalPrice:c,formattedUnitPrice:c,formattedFinalUnitPrice:c,formattedDiscountPrice:c,finalPriceWithQuantity:c,formattedFinalPriceWithQuantity:c,tax:c,formattedTax:c,refundQuantity:c,editLineItem:a.bound}),m}return t(f,n),Object.defineProperty(f.prototype,"priceWithQuantity",{get:function(){return l.getPriceWithQuantity(this)},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"formattedPriceWithQuantity",{get:function(){return d(this.priceWithQuantity,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"overridenPriceWithQuantity",{get:function(){return l.getOverridenPriceWithQuantity(this)},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"formattedOverridenPriceWithQuantity",{get:function(){return d(this.overridenPriceWithQuantity||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"formattedFinalPrice",{get:function(){return d(this.finalPrice||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"formattedUnitPrice",{get:function(){return d(this.unitPrice||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"formattedFinalUnitPrice",{get:function(){return d(this.finalUnitPrice||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"unitPriceText",{get:function(){var t,e,i;if(null!==this.finalUnitPrice)return"".concat(d(this.finalUnitPrice,this.currencyCode||"",this.currencySymbol||"")," / ").concat((null===(e=null===(t=this.variant.baseUnit)||void 0===t?void 0:t.unit)||void 0===e?void 0:e.name)||(null===(i=this.variant.baseUnit)||void 0===i?void 0:i.type))},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"formattedDiscountPrice",{get:function(){return d(this.discountPrice||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"finalPriceWithQuantity",{get:function(){return l.getFinalPriceWithQuantity(this)},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"formattedFinalPriceWithQuantity",{get:function(){return d(this.finalPriceWithQuantity||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"tax",{get:function(){return l.getTax(this)},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"formattedTax",{get:function(){return d(this.tax,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"hasDiscount",{get:function(){return l.hasDiscount(this)},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"refundQuantity",{get:function(){return this._refundQuantity},set:function(t){t?(t>this.quantity&&(t=this.quantity),t<=0&&(t=null),this._refundQuantity=t):this._refundQuantity=null},enumerable:!1,configurable:!0}),f.prototype.editLineItem=function(){var t,e=this.variant.href||"";e=e.includes("?")?e+"&editLineID="+this.id:e+"?editLineID="+this.id,null===(t=s.getInstance().router)||void 0===t||t.push(e)},f}(n);export{f as IkasOrderLineItem};
1
+ import{__extends as t}from'./../../../../ext/tslib/tslib.es6.js';export{IkasOrderLineItemStatus}from"@ikas/storefront-models";import{IkasOrderLineDiscount as e}from"./discount/index.js";import{IkasOrderLineVariant as i}from"./variant/index.js";import{IkasOrderLineItemOption as n}from"./option/index.js";import{IkasOrderLineBundleProductSettings as r}from"./bundle-product-settings/index.js";import{IkasBaseModel as o}from"../../base/index.js";import{makeObservable as u,observable as c,computed as a,action as l}from"mobx";import{IkasOrderLineItemFunctions as d}from"@ikas/storefront-model-functions";import{formatCurrency as s}from"../../../../utils/currency.js";import{IkasBaseStore as f}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";var y=function(o){function y(t){var d,s,f,y,m,p=this;return(p=o.call(this,t)||this).bundleProductSettings=null,p.currencyCode=null,p.discount=null,p.discountPrice=null,p.finalPrice=null,p.options=null,p.originalOrderLineItemId=null,p.statusUpdatedAt=null,p.stockLocationId=null,p.taxValue=null,p._refundQuantity=null,p.bundleProductSettings=t.bundleProductSettings?new r(t.bundleProductSettings):null,p.currencyCode=t.currencyCode||null,p.currencySymbol=t.currencySymbol||null,p.discount=t.discount?new e(t.discount):null,p.discountPrice=null!==(d=t.discountPrice)&&void 0!==d?d:null,p.finalPrice=null!==(s=t.finalPrice)&&void 0!==s?s:null,p.finalUnitPrice=null!==(f=t.finalUnitPrice)&&void 0!==f?f:null,p.options=(null===(y=t.options)||void 0===y?void 0:y.map((function(t){return new n(t)})))||null,p.originalOrderLineItemId=t.originalOrderLineItemId||null,p.price=t.price,p.quantity=t.quantity,p.status=t.status,p.statusUpdatedAt=t.statusUpdatedAt,p.stockLocationId=t.stockLocationId,p.taxValue=t.taxValue,p.unitPrice=null!==(m=t.unitPrice)&&void 0!==m?m:null,p.variant=new i(t.variant),p.orderedAt=t.orderedAt,p.refundQuantity=t.refundQuantity,u(p,{bundleProductSettings:c,currencyCode:c,currencySymbol:c,discount:c,discountPrice:c,finalPrice:c,finalUnitPrice:c,options:c,originalOrderLineItemId:c,price:c,quantity:c,status:c,statusUpdatedAt:c,stockLocationId:c,taxValue:c,unitPrice:c,variant:c,orderedAt:c,_refundQuantity:c,priceWithQuantity:a,formattedPriceWithQuantity:a,overridenPriceWithQuantity:a,formattedOverridenPriceWithQuantity:a,formattedFinalPrice:a,formattedUnitPrice:a,formattedFinalUnitPrice:a,formattedDiscountPrice:a,finalPriceWithQuantity:a,formattedFinalPriceWithQuantity:a,tax:a,formattedTax:a,refundQuantity:a,editLineItem:l.bound}),p}return t(y,o),Object.defineProperty(y.prototype,"priceWithQuantity",{get:function(){return d.getPriceWithQuantity(this)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"formattedPriceWithQuantity",{get:function(){return s(this.priceWithQuantity,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"overridenPriceWithQuantity",{get:function(){return d.getOverridenPriceWithQuantity(this)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"formattedOverridenPriceWithQuantity",{get:function(){return s(this.overridenPriceWithQuantity||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"formattedFinalPrice",{get:function(){return s(this.finalPrice||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"formattedUnitPrice",{get:function(){return s(this.unitPrice||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"formattedFinalUnitPrice",{get:function(){return s(this.finalUnitPrice||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"unitPriceText",{get:function(){var t,e,i,n;if(null!==this.finalUnitPrice){var r=null===(t=this.variant.baseUnit)||void 0===t?void 0:t.baseAmount,o=(null===(i=null===(e=this.variant.baseUnit)||void 0===e?void 0:e.unit)||void 0===i?void 0:i.name)||(null===(n=this.variant.baseUnit)||void 0===n?void 0:n.type);return"".concat(s(this.finalUnitPrice,this.currencyCode||"",this.currencySymbol||"")," / ").concat(r&&1!==r?r:"").concat(o)}},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"formattedDiscountPrice",{get:function(){return s(this.discountPrice||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"finalPriceWithQuantity",{get:function(){return d.getFinalPriceWithQuantity(this)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"formattedFinalPriceWithQuantity",{get:function(){return s(this.finalPriceWithQuantity||0,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"tax",{get:function(){return d.getTax(this)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"formattedTax",{get:function(){return s(this.tax,this.currencyCode||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"hasDiscount",{get:function(){return d.hasDiscount(this)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"refundQuantity",{get:function(){return this._refundQuantity},set:function(t){t?(t>this.quantity&&(t=this.quantity),t<=0&&(t=null),this._refundQuantity=t):this._refundQuantity=null},enumerable:!1,configurable:!0}),y.prototype.editLineItem=function(){var t,e=this.variant.href||"";e=e.includes("?")?e+"&editLineID="+this.id:e+"?editLineID="+this.id,null===(t=f.getInstance().router)||void 0===t||t.push(e)},y}(o);export{y as IkasOrderLineItem};