@salla.sa/twilight-components 3.0.25 → 3.0.27
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.
- package/dist/cjs/{Helper-BSFw7uVh.js → Helper-CFeUiEPn.js} +1 -1
- package/dist/cjs/{filepond-DzJcpvBM.js → filepond-Cn3JTrL1.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-BILkbyw_.js → filepond-plugin-file-poster-BOIM6p80.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-DIJUAZji.js → filepond-plugin-file-validate-size-YTjl_kR1.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-4lpOf3hf.js → filepond-plugin-file-validate-type-ByB9Nk2o.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-DtE3Wj_4.js → filepond-plugin-image-edit-DT7UG1he.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-Dc_jwifJ.js → filepond-plugin-image-exif-orientation-CNqCjRvG.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-D_8qt0dd.js → filepond-plugin-image-preview-dsQXwutz.js} +1 -1
- package/dist/cjs/{index-D0d25H-r.js → index-DF5Yp06H.js} +6 -6
- package/dist/cjs/info-Do5bVPmK.js +13 -0
- package/dist/cjs/{intlTelInput-DqmuleM6.js → intlTelInput-CRlVjvSW.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +2 -2
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +3 -9
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-applied-filters.cjs.entry.js +2 -2
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-summary-card.cjs.entry.js +120 -5
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_9.cjs.entry.js +2 -2
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +2 -2
- package/dist/cjs/salla-filters.cjs.entry.js +2 -2
- package/dist/cjs/salla-free-shipping-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-free-shipping-tag.cjs.entry.js +1 -1
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-mobile-update-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-items.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-payment.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-rewards.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +27 -6
- package/dist/cjs/salla-orders.cjs.entry.js +2 -2
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +2 -2
- package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +2 -2
- package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +2 -2
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-thank-you-header.cjs.entry.js +1 -1
- package/dist/cjs/salla-thank-you-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-summary.cjs.entry.js +2 -2
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-DP9Hy8IR.js → vanilla-picker-qYmOs8Yb.js} +1 -1
- package/dist/collection/components/salla-cart-summary-card/salla-cart-summary-card.css +152 -59
- package/dist/collection/components/salla-cart-summary-card/salla-cart-summary-card.js +123 -4
- package/dist/collection/components/salla-order-totals-card/salla-order-totals-card.css +3 -0
- package/dist/collection/components/salla-order-totals-card/salla-order-totals-card.js +25 -4
- package/dist/components/index.js +2 -2
- package/dist/components/info.js +11 -0
- package/dist/components/salla-bottom-alert.js +2 -8
- package/dist/components/salla-cart-summary-card.js +124 -5
- package/dist/components/salla-order-totals-card.js +26 -5
- package/dist/docs.json +3 -3
- package/dist/esm/{Helper-DmnUAusv.js → Helper-DE5KHY4U.js} +1 -1
- package/dist/esm/{filepond-DZbzdjkK.js → filepond-DbayHaoA.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-D9cjvoj-.js → filepond-plugin-file-poster-Dy8NIhDv.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-D-kjllC-.js → filepond-plugin-file-validate-size-Bn4zxXDf.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-D9hsNaJl.js → filepond-plugin-file-validate-type-DmygkxtH.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-CDHAxJY8.js → filepond-plugin-image-edit-BuO-l19h.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-BGKiclwK.js → filepond-plugin-image-exif-orientation-COCmniWP.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-BUjvnt8G.js → filepond-plugin-image-preview-D1i9Fj6F.js} +1 -1
- package/dist/esm/{index-ze9e0dxM.js → index-DvJClBwJ.js} +6 -6
- package/dist/esm/info-OdOOjQZO.js +11 -0
- package/dist/esm/{intlTelInput-BkYRB6km.js → intlTelInput-WsfvuLBW.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +2 -2
- package/dist/esm/salla-add-product-button_5.entry.js +2 -2
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +3 -9
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-applied-filters.entry.js +2 -2
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-attachment-view_9.entry.js +11 -11
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_3.entry.js +1 -1
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-cart-summary-card.entry.js +120 -5
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +1 -1
- package/dist/esm/salla-comment-form_9.entry.js +2 -2
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +2 -2
- package/dist/esm/salla-filters.entry.js +2 -2
- package/dist/esm/salla-free-shipping-banner.entry.js +1 -1
- package/dist/esm/salla-free-shipping-tag.entry.js +1 -1
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gift-card-redeem_2.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +1 -1
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +2 -2
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_3.entry.js +1 -1
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-mobile-update-modal.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item_2.entry.js +2 -2
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-branch.entry.js +1 -1
- package/dist/esm/salla-order-cancel.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/salla-order-items.entry.js +1 -1
- package/dist/esm/salla-order-options-modal.entry.js +1 -1
- package/dist/esm/salla-order-payment.entry.js +1 -1
- package/dist/esm/salla-order-rewards.entry.js +1 -1
- package/dist/esm/salla-order-shipments.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +27 -6
- package/dist/esm/salla-orders.entry.js +2 -2
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-card.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +2 -2
- package/dist/esm/salla-products-slider.entry.js +2 -2
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +2 -2
- package/dist/esm/salla-rating-modal.entry.js +2 -2
- package/dist/esm/salla-review-factors-tags.entry.js +1 -1
- package/dist/esm/salla-review-order-item.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search-product-card.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +2 -2
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +1 -1
- package/dist/esm/salla-thank-you-header.entry.js +1 -1
- package/dist/esm/salla-thank-you-page.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/salla-wishlist-summary.entry.js +2 -2
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-CxhuwWDi.js → vanilla-picker-DdilrJ6c.js} +1 -1
- package/dist/twilight/{p-bd06c200.entry.js → p-00c35c9f.entry.js} +1 -1
- package/dist/twilight/{p-67cf7454.entry.js → p-00f9aefc.entry.js} +1 -1
- package/dist/twilight/{p-da60995f.entry.js → p-029f809b.entry.js} +1 -1
- package/dist/twilight/{p-dceb3725.entry.js → p-02a06dcb.entry.js} +1 -1
- package/dist/twilight/{p-3ec3e9fb.entry.js → p-03dc3837.entry.js} +1 -1
- package/dist/twilight/{p-024ecda2.entry.js → p-054f32c4.entry.js} +1 -1
- package/dist/twilight/{p-78c04993.entry.js → p-069df650.entry.js} +1 -1
- package/dist/twilight/p-0a1a172d.entry.js +4 -0
- package/dist/twilight/{p-de10d0c3.entry.js → p-0ac5f79f.entry.js} +1 -1
- package/dist/twilight/{p-331003bc.entry.js → p-0c1bbd55.entry.js} +1 -1
- package/dist/twilight/{p-d89328d7.entry.js → p-0c4e99b4.entry.js} +1 -1
- package/dist/twilight/{p-fb955257.entry.js → p-0c65d35a.entry.js} +1 -1
- package/dist/twilight/{p-b297fe2e.entry.js → p-0d357ae2.entry.js} +1 -1
- package/dist/twilight/{p-11eb8675.entry.js → p-0ded0dc1.entry.js} +1 -1
- package/dist/twilight/p-13309e4e.entry.js +4 -0
- package/dist/twilight/{p-bf5b5f52.entry.js → p-16d49b35.entry.js} +1 -1
- package/dist/twilight/{p-f9dd6b3e.entry.js → p-19896b94.entry.js} +1 -1
- package/dist/twilight/{p-dbb4db25.entry.js → p-1b6b5a3c.entry.js} +1 -1
- package/dist/twilight/{p-d2396143.entry.js → p-1ce1b6dc.entry.js} +1 -1
- package/dist/twilight/{p-3a2ff4d6.entry.js → p-1d1bef93.entry.js} +1 -1
- package/dist/twilight/{p-4cf81a44.entry.js → p-1fce7e50.entry.js} +1 -1
- package/dist/twilight/{p-c122e9c1.entry.js → p-1ff27daa.entry.js} +1 -1
- package/dist/twilight/{p-97c5b11d.entry.js → p-22db0366.entry.js} +1 -1
- package/dist/twilight/p-24abaa09.entry.js +4 -0
- package/dist/twilight/{p-37b64e36.entry.js → p-29349910.entry.js} +1 -1
- package/dist/twilight/{p-d300a117.entry.js → p-29e3685e.entry.js} +1 -1
- package/dist/twilight/{p-71ce8e4f.entry.js → p-301a42aa.entry.js} +1 -1
- package/dist/twilight/{p-e849f5ef.entry.js → p-30919203.entry.js} +1 -1
- package/dist/twilight/{p-4c191ab4.entry.js → p-309edef2.entry.js} +1 -1
- package/dist/twilight/{p-7731e280.entry.js → p-3356b015.entry.js} +1 -1
- package/dist/twilight/{p-8d3c5d1f.entry.js → p-366403da.entry.js} +1 -1
- package/dist/twilight/{p-446e3f38.entry.js → p-36ee91e5.entry.js} +1 -1
- package/dist/twilight/{p-ed96c703.entry.js → p-388e49fe.entry.js} +1 -1
- package/dist/twilight/p-3a5604b1.entry.js +4 -0
- package/dist/twilight/{p-2dcd24fe.entry.js → p-3eae2216.entry.js} +1 -1
- package/dist/twilight/{p-5ceda3d5.entry.js → p-41b57414.entry.js} +1 -1
- package/dist/twilight/{p-776f9492.entry.js → p-43eb35a7.entry.js} +1 -1
- package/dist/twilight/{p-0c022fbd.entry.js → p-44621e3a.entry.js} +1 -1
- package/dist/twilight/{p-ffc7f526.entry.js → p-450cdcc4.entry.js} +1 -1
- package/dist/twilight/{p-5d8937c5.entry.js → p-46ae40a3.entry.js} +1 -1
- package/dist/twilight/{p-6d6b99fe.entry.js → p-4d5abe91.entry.js} +1 -1
- package/dist/twilight/{p-519cf4c2.entry.js → p-4e9c9419.entry.js} +1 -1
- package/dist/twilight/{p-5f9d87ec.entry.js → p-50898992.entry.js} +1 -1
- package/dist/twilight/{p-8b0b6bca.entry.js → p-52011986.entry.js} +1 -1
- package/dist/twilight/{p-cbd056ba.entry.js → p-52e24b0f.entry.js} +1 -1
- package/dist/twilight/{p-b6098938.entry.js → p-536a1841.entry.js} +1 -1
- package/dist/twilight/{p-47c79c49.entry.js → p-5865e825.entry.js} +1 -1
- package/dist/twilight/{p-20949dfb.entry.js → p-591694a7.entry.js} +1 -1
- package/dist/twilight/{p-474d882c.entry.js → p-60cd3462.entry.js} +1 -1
- package/dist/twilight/{p-9acfe389.entry.js → p-628ef86c.entry.js} +1 -1
- package/dist/twilight/{p-dfde387f.entry.js → p-630cce26.entry.js} +1 -1
- package/dist/twilight/{p-a7566af2.entry.js → p-6569bfee.entry.js} +1 -1
- package/dist/twilight/{p-57fafaba.entry.js → p-66f02fad.entry.js} +1 -1
- package/dist/twilight/{p-cdeaf60b.entry.js → p-6936e0a4.entry.js} +1 -1
- package/dist/twilight/{p-7fffa509.entry.js → p-6c5bd5ad.entry.js} +1 -1
- package/dist/twilight/{p-93571975.entry.js → p-6d0ad265.entry.js} +1 -1
- package/dist/twilight/{p-9fe5c0f5.entry.js → p-6e79128e.entry.js} +1 -1
- package/dist/twilight/{p-07e581af.entry.js → p-6ff4df6b.entry.js} +1 -1
- package/dist/twilight/{p-bb137dbb.entry.js → p-73f1697f.entry.js} +1 -1
- package/dist/twilight/{p-008740fe.entry.js → p-741cc4a4.entry.js} +1 -1
- package/dist/twilight/{p-c6f09614.entry.js → p-74e3b033.entry.js} +1 -1
- package/dist/twilight/{p-02b7dfcc.entry.js → p-7e421e8a.entry.js} +1 -1
- package/dist/twilight/{p-08be494e.entry.js → p-8056b437.entry.js} +1 -1
- package/dist/twilight/{p-89598ad3.entry.js → p-84b35a50.entry.js} +1 -1
- package/dist/twilight/{p-2aa9147c.entry.js → p-85bf4c43.entry.js} +1 -1
- package/dist/twilight/{p-0fd15433.entry.js → p-85e43124.entry.js} +1 -1
- package/dist/twilight/{p-1ca39f1c.entry.js → p-8a614038.entry.js} +1 -1
- package/dist/twilight/{p-BjUh9YCs.js → p-8iHhuUVM.js} +1 -1
- package/dist/twilight/{p-455a4702.entry.js → p-93439ac4.entry.js} +1 -1
- package/dist/twilight/{p-cb961f05.entry.js → p-963eb26d.entry.js} +1 -1
- package/dist/twilight/{p-bf65d2fa.entry.js → p-989e3cd6.entry.js} +1 -1
- package/dist/twilight/{p-4ec15515.entry.js → p-98cf67a5.entry.js} +1 -1
- package/dist/twilight/{p-16e2a110.entry.js → p-9ec3124c.entry.js} +1 -1
- package/dist/twilight/{p-9dd7cf71.entry.js → p-9ed41657.entry.js} +1 -1
- package/dist/twilight/{p-CICtuB_u.js → p-B1r6DqQZ.js} +1 -1
- package/dist/twilight/{p-DOUAavek.js → p-B8bJ6Bp4.js} +1 -1
- package/dist/twilight/{p-BpJsOjKP.js → p-BAfdlulm.js} +1 -1
- package/dist/twilight/{p-cykIAOlk.js → p-BHVWJBhN.js} +1 -1
- package/dist/twilight/{p-BlPdaFn2.js → p-BddjrRgx.js} +1 -1
- package/dist/twilight/{p-wYYV5ykR.js → p-CeKF1bL-.js} +1 -1
- package/dist/twilight/{p-ze9e0dxM.js → p-DvJClBwJ.js} +1 -1
- package/dist/twilight/{p-B8nGVDvQ.js → p-FYANWJHV.js} +1 -1
- package/dist/twilight/p-OdOOjQZO.js +4 -0
- package/dist/twilight/{p-C9ldyQUq.js → p-UebnA4Q1.js} +1 -1
- package/dist/twilight/{p-830abcc1.entry.js → p-a460c4be.entry.js} +1 -1
- package/dist/twilight/{p-792494c8.entry.js → p-a7297a33.entry.js} +1 -1
- package/dist/twilight/{p-f23ada45.entry.js → p-ac4b8722.entry.js} +1 -1
- package/dist/twilight/{p-5b118b5b.entry.js → p-accfd79c.entry.js} +1 -1
- package/dist/twilight/{p-e23b84bf.entry.js → p-adfdfe9d.entry.js} +1 -1
- package/dist/twilight/{p-73649c81.entry.js → p-ae1c28e0.entry.js} +1 -1
- package/dist/twilight/{p-f7c06bee.entry.js → p-b06cad39.entry.js} +1 -1
- package/dist/twilight/{p-59694c45.entry.js → p-b47ffe8e.entry.js} +1 -1
- package/dist/twilight/{p-75ad7f14.entry.js → p-be357093.entry.js} +1 -1
- package/dist/twilight/{p-8077d8b6.entry.js → p-c1b6d4ba.entry.js} +1 -1
- package/dist/twilight/{p-5e0f85ae.entry.js → p-c9e04a12.entry.js} +1 -1
- package/dist/twilight/{p-b71673ee.entry.js → p-ca20c66e.entry.js} +1 -1
- package/dist/twilight/{p-97fa91db.entry.js → p-cc84061b.entry.js} +1 -1
- package/dist/twilight/{p-d089ac6d.entry.js → p-cefd664d.entry.js} +1 -1
- package/dist/twilight/{p-a7849674.entry.js → p-d1fac437.entry.js} +1 -1
- package/dist/twilight/{p-7a985fe3.entry.js → p-d6015b0c.entry.js} +1 -1
- package/dist/twilight/{p-a865995d.entry.js → p-d6728c04.entry.js} +1 -1
- package/dist/twilight/{p-e3dd9502.entry.js → p-d7537ab1.entry.js} +1 -1
- package/dist/twilight/{p-9a2567e2.entry.js → p-d81a6a32.entry.js} +1 -1
- package/dist/twilight/{p-12a52f1b.entry.js → p-d8856c7b.entry.js} +1 -1
- package/dist/twilight/{p-45a7d444.entry.js → p-da3c7ee3.entry.js} +1 -1
- package/dist/twilight/{p-75f7f1d8.entry.js → p-e276cb82.entry.js} +1 -1
- package/dist/twilight/{p-c0301e00.entry.js → p-e73bc00f.entry.js} +1 -1
- package/dist/twilight/{p-03b2df97.entry.js → p-e785df2d.entry.js} +1 -1
- package/dist/twilight/{p-da0349f9.entry.js → p-e81d544a.entry.js} +1 -1
- package/dist/twilight/{p-7790a9a1.entry.js → p-e8414134.entry.js} +1 -1
- package/dist/twilight/{p-d61298f8.entry.js → p-ea0de552.entry.js} +1 -1
- package/dist/twilight/{p-a1a650ab.entry.js → p-ea58a665.entry.js} +1 -1
- package/dist/twilight/{p-770142fe.entry.js → p-f6b86d47.entry.js} +1 -1
- package/dist/twilight/{p-f054cf8e.entry.js → p-fbd7def8.entry.js} +1 -1
- package/dist/twilight/{p-CNQaYCUJ.js → p-zPvqMpJX.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-cart-summary-card/salla-cart-summary-card.d.ts +26 -0
- package/dist/types/components/salla-order-totals-card/interfaces.d.ts +8 -3
- package/dist/types/components/salla-order-totals-card/salla-order-totals-card.d.ts +2 -1
- package/package.json +5 -5
- package/dist/twilight/p-0c0b2b36.entry.js +0 -4
- package/dist/twilight/p-61b98119.entry.js +0 -4
- package/dist/twilight/p-8d096f95.entry.js +0 -4
- package/dist/twilight/p-be8c42f1.entry.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as e,H as s,a as r}from"./p-ze9e0dxM.js";import{S as a}from"./p-Ctkfc4K-.js";import{l as i}from"./p-BChI23pG.js";import{A as o}from"./p-DCZbpt2a.js";import{C as c}from"./p-gFG8By9O.js";const n=class{constructor(e){t(this,e),this.internalOffers=[],this.showAll=!1,this.freeLabel="",this.receivedOffer="",this.discountAmountLabel="",this.showMoreOffers="",this.cartUpdateEvents=["cart::latest.fetched","cart::item.updated","cart::item.added","cart::item.deleted","cart::coupon.added","cart::coupon.deleted"],this.isAttached=!1,this.hasLoaded=!1,this.icons={DiscountCouponIcon:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>discount-coupon</title>\n<path d="M27 28h-22c-0.552 0-1-0.448-1-1v0c0-1.657-1.343-3-3-3v0c-0.552 0-1-0.448-1-1v0-12c0-0.552 0.448-1 1-1v0c1.657 0 3-1.343 3-3v0c0-0.552 0.448-1 1-1v0h22c0.552 0 1 0.448 1 1v0c0 1.657 1.343 3 3 3v0c0.552 0 1 0.448 1 1v0 12c0 0.552-0.448 1-1 1v0c-1.657 0-3 1.343-3 3v0c0 0.552-0.448 1-1 1v0zM5.9 26h20.2c0.415-1.964 1.936-3.485 3.867-3.894l0.033-0.006v-10.2c-1.964-0.415-3.485-1.936-3.894-3.867l-0.006-0.033h-20.2c-0.415 1.964-1.936 3.485-3.867 3.894l-0.033 0.006v10.2c1.964 0.415 3.485 1.936 3.894 3.867l0.006 0.033zM20 7h2v3h-2v-3zM20 12h2v4h-2v-4zM20 18h2v4h-2v-4zM20 24h2v3h-2v-3zM9 16c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM9 12c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM15 24c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM15 20c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM7 24c-0.552-0-1-0.448-1-1 0-0.244 0.088-0.468 0.233-0.642l-0.001 0.002 10-12c0.185-0.221 0.461-0.36 0.769-0.36 0.553 0 1.001 0.448 1.001 1.001 0 0.245-0.088 0.469-0.233 0.643l0.001-0.002-10 12c-0.185 0.22-0.46 0.358-0.767 0.358-0.001 0-0.002 0-0.003 0h0z"></path>\n</svg>\n',GiftIcon:i,FireIcon:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>fire</title>\n<path d="M21.56 3.009c-0.052-0.047-0.116-0.065-0.173-0.103-0.073-0.048-0.143-0.1-0.223-0.132-0.083-0.033-0.165-0.047-0.252-0.063-0.081-0.016-0.16-0.035-0.243-0.035-0.089 0-0.172 0.020-0.26 0.037-0.080 0.016-0.159 0.028-0.236 0.059-0.084 0.035-0.157 0.088-0.235 0.14-0.053 0.036-0.115 0.053-0.165 0.097-0.049 0.044-0.988 0.895-2.288 2.255-2.364-2.839-4.476-4.815-4.576-4.908-0.056-0.052-0.127-0.075-0.188-0.115-0.075-0.049-0.143-0.105-0.224-0.137-0.080-0.032-0.163-0.041-0.245-0.057-0.085-0.016-0.167-0.040-0.252-0.040-0.084 0-0.163 0.023-0.245 0.039-0.087 0.016-0.172 0.025-0.253 0.059-0.080 0.032-0.147 0.087-0.22 0.135-0.063 0.041-0.133 0.064-0.189 0.116-0.453 0.423-11.092 10.408-11.092 18.095 0 7.977 4.935 13.549 12 13.549h8.667c6.673 0 11.333-5.115 11.333-12.439 0-7.052-10.013-16.167-10.44-16.552zM20.667 29.333h-7.777c-2.924 0-4.889-2.044-4.889-5.084 0-2.317 2.816-6.441 4.888-8.887 0.76 0.909 2.755 3.397 3.969 5.869 0.212 0.431 0.639 0.715 1.117 0.743 0.489 0.031 0.937-0.203 1.197-0.605 0.552-0.849 1.109-1.596 1.497-2.093 1.491 1.897 3.331 4.78 3.331 6.399 0 2.188-1.34 3.659-3.333 3.659zM26.537 27.052c0.081-0.44 0.129-0.899 0.129-1.377 0-3.269-3.713-7.847-4.46-8.735l-0.523-0.617c-0.507-0.599-1.528-0.599-2.035 0l-0.531 0.627c-0.147 0.175-0.495 0.599-0.936 1.187-1.595-2.597-3.495-4.776-3.595-4.889l-0.697-0.793c-0.507-0.577-1.499-0.577-2.004 0l-0.697 0.795c-0.6 0.684-5.856 6.803-5.856 11.001 0 0.881 0.127 1.712 0.356 2.484-1.896-1.933-3.023-4.821-3.023-8.283 0-4.915 6.073-11.997 9.329-15.255 1.001 1.008 2.692 2.789 4.368 4.927 0.243 0.309 0.609 0.496 1.001 0.509h0.048c0.376 0 0.735-0.159 0.988-0.439 0.889-0.981 1.693-1.795 2.269-2.359 3.051 2.965 8.663 9.323 8.663 13.727 0 3.171-1.031 5.769-2.796 7.491z"></path>\n</svg>\n',SpecialDiscountIcon:a,TagMoneyIcon:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tag-money</title>\n<path d="M20.567 11.433c-0.521-0.521-1.364-0.521-1.885 0l-0.524 0.524c-1.28-0.819-3.091-0.681-4.191 0.419-0.631 0.631-0.976 1.468-0.976 2.359 0 0.889 0.347 1.727 0.976 2.357l0.943 0.943c0.171 0.171 0.195 0.368 0.195 0.472s-0.025 0.301-0.196 0.472c-0.169 0.169-0.367 0.195-0.471 0.195s-0.301-0.025-0.472-0.195l-2.357-2.357c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l0.944 0.941-0.472 0.472c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l0.519-0.519c0.54 0.359 1.173 0.553 1.837 0.553 0.892 0 1.729-0.348 2.357-0.976 0.631-0.631 0.976-1.467 0.976-2.357s-0.347-1.727-0.976-2.357l-0.943-0.943c-0.26-0.26-0.26-0.684 0-0.944 0.259-0.259 0.683-0.261 0.944 0l1.885 1.887c0.521 0.521 1.364 0.521 1.885 0 0.521-0.52 0.521-1.364 0-1.885l-0.472-0.472 0.472-0.472c0.521-0.521 0.521-1.365 0.001-1.887zM28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></path>\n</svg>\n'},this.visibleOffersCount=3,this.handleCartItemUpdated=t=>{const e=t.data?.cart?.items?.find((t=>String(t.id)===String(this.itemId)));e&&(this.internalQuantity=e.quantity,this.internalOffers=e.detailed_offers||[],this.internalProductPrice=e.product_price)},this.toggleShowAll=()=>{this.showAll=!this.showAll}}bindCartListeners(){this.isAttached&&this.cartUpdateEvents.forEach((t=>salla.event.on(t,this.handleCartItemUpdated)))}connectedCallback(){this.isAttached=!0,this.hasLoaded&&this.bindCartListeners(),this.langUnsubscribe=salla.lang.subscribe((()=>{this.freeLabel=salla.lang.get("common.elements.freeExclam"),this.receivedOffer=salla.lang.get("pages.cart.received_offer"),this.discountAmountLabel=salla.lang.get("pages.cart.discount_amount"),this.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")}))}disconnectedCallback(){this.isAttached=!1,this.cartUpdateEvents.forEach((t=>salla.event.off(t,this.handleCartItemUpdated))),this.langUnsubscribe?.()}async componentWillLoad(){await Salla.onReady(),await salla.lang.onLoaded(),this.internalQuantity=this.quantity,this.internalOffers=this.parseOffers(this.offers),this.internalProductPrice=this.productPrice}componentDidLoad(){this.hasLoaded=!0,this.bindCartListeners()}parseOffers(t){try{if("string"!=typeof t)return console.warn("Offers is not a string. Returning as-is.",t),Array.isArray(t)?t:[];const e=JSON.parse(t||"[]");return Array.isArray(e)?e:[]}catch(t){return console.error("Failed to parse offers",t),[]}}get visibleOffers(){return this.internalOffers.slice(0,this.visibleOffersCount)}get hiddenOffers(){return this.internalOffers.slice(this.visibleOffersCount)}getPaidQty(t,e){return t-e.free_quantity}renderOffer(t,s){const r=this.getPaidQty(t,s);return e("div",{class:"s-cart-item-offers-box"},s.free_quantity>0&&r>0&&e("div",{class:"s-cart-item-offers-paid-free"},e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(r)," × ",e("span",{innerHTML:salla.money(this.internalProductPrice)})),e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(s.free_quantity)," ×",e("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),e("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),e("div",{class:"s-cart-item-offers-details"},e("span",{class:"s-cart-item-offers-icon",innerHTML:this.icons[s.discount_icon]||""}),e("div",null,e("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",s.offer_name)),e("p",{class:"s-cart-item-offers-discount"},e("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(s.discount_amount.toFixed(2)))})))))}render(){return this.internalOffers?.length?e("div",{class:"s-cart-item-offers-container",id:`offers_list_${this.itemId}`},this.visibleOffers.map((t=>this.renderOffer(this.internalQuantity,t))),this.internalOffers?.length>this.visibleOffersCount&&e("div",{class:"s-cart-item-offers-show-more"},e("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},e("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,e("span",{innerHTML:o,class:{"s-cart-item-offers-arrow-icon":!0,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&e("div",{class:"s-cart-item-offers-collapsed",id:`offers_${this.itemId}`},this.hiddenOffers.map((t=>this.renderOffer(this.internalQuantity,t))))):null}};n.style="/*!twlt*/:host{display:block}.s-cart-item-offers-box{margin-bottom:0.75rem}.s-cart-item-offers-container{margin-top:1.25rem}.s-cart-item-offers-paid-free{margin-bottom:0.75rem}.s-cart-item-offers-paid-free>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.25rem * var(--tw-space-y-reverse))}.s-cart-item-offers-paid-free{font-weight:500}.s-cart-item-offers-line{text-align:start}.s-cart-item-offers-regular-price{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-cart-item-offers-free-label{margin-left:0.5rem;margin-right:0.5rem;display:inline-block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.s-cart-item-offers-details{display:flex;align-items:flex-start;gap:0.625rem;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.s-cart-item-offers-icon{--tw-translate-y:-3px;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.s-cart-item-offers-icon svg{width:18px;fill:currentColor}.s-cart-item-offers-title{margin-bottom:0.5rem;font-weight:500}.s-cart-item-offers-message{font-size:0.875rem;line-height:1.25rem}.s-cart-item-offers-discount{margin-top:0px;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-cart-item-offers-show-more-btn{display:flex;align-items:center;justify-content:flex-start !important;background-color:transparent !important;padding-left:0px !important;padding-right:0px !important;font-size:0.875rem;line-height:1.25rem}.s-cart-item-offers-show-more-btn:hover{--tw-text-opacity:1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.s-cart-item-offers-arrow-icon{margin-left:0.125rem;margin-right:0.125rem;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-cart-item-offers-arrow-open{--tw-rotate:-180deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-cart-item-offers-show-more-btn svg{width:18px}.s-cart-item-offers-show-more-label{display:flex;align-items:center}.s-cart-item-offers-collapsed{margin-top:0.5rem}";const l=class{constructor(e){t(this,e),this.cartSummaryCount=salla.storage.get("cart.summary.count")||0,this.cartSummaryTotal=salla.storage.get("cart.summary.total")||0,this.cartLabel="ar"===salla.config.get("user.language_code")?"السلة":"Cart",this.handleCheckoutClick=t=>{salla.mobile?.isSpaWebview?.()&&salla.mobile.openCheckout&&(t.preventDefault(),salla.mobile.openCheckout(this.getCartLink()))}}connectedCallback(){this.cartUpdatedListener=t=>{this.cartSummaryCount=t.count||0,this.cartSummaryTotal=t.total||0},salla.cart.event.onUpdated(this.cartUpdatedListener)}disconnectedCallback(){salla.cart.event.offUpdated(this.cartUpdatedListener)}async animateToCart(t){if(document.querySelectorAll(".s-cart-thumb").forEach((t=>t.remove())),!t?.src)return void salla.log("Failed to get the img element");let e=this.host.querySelector("#s-cart-icon"),s=e.getBoundingClientRect(),r=s.top+window.scrollY,a=s.left+window.scrollX,i=t.getBoundingClientRect(),o=t.offsetWidth+"px",c=t.offsetHeight+"px",n=i.top,l=i.left,h=document.createElement("img");h.src=t.getAttribute("src"),h.className="s-cart-thumb",h.setAttribute("style","object-fit:cover; width:"+o+"; height:"+c+"; top:"+n+"px; left:"+l+"px;z-index:99999999; "),document.body.append(h);let f=document.querySelector(".s-cart-thumb");e.classList.remove("animated","rubberBand");const m=window.scrollY>0?r-window.scrollY-40:r-40,d=window.scrollY>0?r-window.scrollY+10:r+10;this.flyToCart(f,e,{top:n,left:l,flyTop:m,dropTop:d,btnLeft:a})}flyToCart(t,e,s){const r=t=>t>=1?1:1-Math.pow(2,-10*t),a=(t,e,s)=>t+(e-t)*s,i=(e,s,r)=>{t.style.width=t.style.height=`${e}px`,t.style.top=`${s}px`,t.style.left=`${r}px`};let o;t.style.opacity="1",i(150,s.top,s.left),t.style.borderRadius="20%";const c=n=>{o??(o=n);const l=n-o;if(l>=200){const e=r((l-200)/1200);i(a(150,30,e),a(s.top,s.flyTop,e),a(s.left,s.btnLeft,e)),t.style.borderRadius=`${a(20,50,e)}%`}if(l>=900){const e=r((l-900)/1e3);i(a(30,0,e),a(s.flyTop,s.dropTop,e),a(s.btnLeft,s.btnLeft+10,e)),t.style.opacity=""+(1-e)}if(l>=1200)return e.classList.add("animated","rubberBand"),void t.remove();requestAnimationFrame(c)};requestAnimationFrame(c)}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}getCartLink(){let t=salla.url.get("cart");const e=salla.storage.get("scope")||salla.config.get("store.scope");if(e&&e.id)try{const s=new URL(t);return s.searchParams.set("scope",e.id),e.allocation_type&&s.searchParams.set("allocation_type",e.allocation_type),e.allocation_id&&s.searchParams.set("allocation_id",e.allocation_id),s.toString()}catch(s){const r=t.includes("?")?"&":"?",a=new URLSearchParams;return a.set("scope",String(e.id)),e.allocation_type&&a.set("allocation_type",e.allocation_type),e.allocation_id&&a.set("allocation_id",e.allocation_id),`${t}${r}${a.toString()}`}return t}render(){return e(s,{key:"2f17568bd94a520d429ee40b1e80c41bf74f6296"},e("a",{key:"34787b44d5d2ad57c591121a807f395334951651",class:"s-cart-summary-wrapper",href:this.getCartLink(),onClick:this.handleCheckoutClick},e("div",{key:"7392396a000d5ccbc327eb77e5a835578ac4e6c4",id:"s-cart-icon"},e("slot",{key:"11e9b13d938f0870696c09394f599a643f69fde9",name:"icon"},e("i",{key:"1094fc352cdd55e7ff9f72fe6ae023d06f5ea680",class:"s-cart-summary-icon",innerHTML:c}))),e("span",{key:"5a61fce2f185193637e44ba9b3d6da31deab73fd",class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),e("p",{key:"9571d3e7d563694d2cab2c7806b384c643eb9b44",class:"s-cart-summary-content"},this.showCartLabel&&e("span",{key:"eeb5fed8da2dcdae09f38d6f26cfefc2b28e3e5b",class:"s-cart-summary-label"},this.cartLabel),e("b",{key:"e81072c0a81d5e3f22a09794bebced80e7706025",class:"s-cart-summary-total",innerHTML:salla.money(this.cartSummaryTotal)}))))}get host(){return r(this)}};l.style='/*!twlt*/.block{display:block}.transition{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-cart-summary-wrapper{text-decoration:none;color:var(--color-text);transition:all .5s cubic-bezier(0.2, 1, 0.3, 1);align-items:center;font-weight:bolder;position:relative;display:inline-flex}.s-cart-thumb{position:fixed;transition:all 0.3s cubic-bezier(0.2, 1, 0.3, 1)}.s-cart-summary-icon svg{height:1.25rem;width:1.25rem;fill:var(--color-text)}.s-cart-summary-count{position:absolute;top:-8px;left:-15px;display:inline-flex;height:1.25rem;width:1.25rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1));padding:0.25rem;font-size:0.75rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-cart-summary-count:where([dir="rtl"],[dir="rtl"] *){left:unset;right:-15px}';export{n as salla_cart_item_offers,l as salla_cart_summary}
|
|
4
|
+
import{r as t,h as e,H as s,a as r}from"./p-DvJClBwJ.js";import{S as a}from"./p-Ctkfc4K-.js";import{l as i}from"./p-BChI23pG.js";import{A as o}from"./p-DCZbpt2a.js";import{C as c}from"./p-gFG8By9O.js";const n=class{constructor(e){t(this,e),this.internalOffers=[],this.showAll=!1,this.freeLabel="",this.receivedOffer="",this.discountAmountLabel="",this.showMoreOffers="",this.cartUpdateEvents=["cart::latest.fetched","cart::item.updated","cart::item.added","cart::item.deleted","cart::coupon.added","cart::coupon.deleted"],this.isAttached=!1,this.hasLoaded=!1,this.icons={DiscountCouponIcon:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>discount-coupon</title>\n<path d="M27 28h-22c-0.552 0-1-0.448-1-1v0c0-1.657-1.343-3-3-3v0c-0.552 0-1-0.448-1-1v0-12c0-0.552 0.448-1 1-1v0c1.657 0 3-1.343 3-3v0c0-0.552 0.448-1 1-1v0h22c0.552 0 1 0.448 1 1v0c0 1.657 1.343 3 3 3v0c0.552 0 1 0.448 1 1v0 12c0 0.552-0.448 1-1 1v0c-1.657 0-3 1.343-3 3v0c0 0.552-0.448 1-1 1v0zM5.9 26h20.2c0.415-1.964 1.936-3.485 3.867-3.894l0.033-0.006v-10.2c-1.964-0.415-3.485-1.936-3.894-3.867l-0.006-0.033h-20.2c-0.415 1.964-1.936 3.485-3.867 3.894l-0.033 0.006v10.2c1.964 0.415 3.485 1.936 3.894 3.867l0.006 0.033zM20 7h2v3h-2v-3zM20 12h2v4h-2v-4zM20 18h2v4h-2v-4zM20 24h2v3h-2v-3zM9 16c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM9 12c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM15 24c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM15 20c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM7 24c-0.552-0-1-0.448-1-1 0-0.244 0.088-0.468 0.233-0.642l-0.001 0.002 10-12c0.185-0.221 0.461-0.36 0.769-0.36 0.553 0 1.001 0.448 1.001 1.001 0 0.245-0.088 0.469-0.233 0.643l0.001-0.002-10 12c-0.185 0.22-0.46 0.358-0.767 0.358-0.001 0-0.002 0-0.003 0h0z"></path>\n</svg>\n',GiftIcon:i,FireIcon:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>fire</title>\n<path d="M21.56 3.009c-0.052-0.047-0.116-0.065-0.173-0.103-0.073-0.048-0.143-0.1-0.223-0.132-0.083-0.033-0.165-0.047-0.252-0.063-0.081-0.016-0.16-0.035-0.243-0.035-0.089 0-0.172 0.020-0.26 0.037-0.080 0.016-0.159 0.028-0.236 0.059-0.084 0.035-0.157 0.088-0.235 0.14-0.053 0.036-0.115 0.053-0.165 0.097-0.049 0.044-0.988 0.895-2.288 2.255-2.364-2.839-4.476-4.815-4.576-4.908-0.056-0.052-0.127-0.075-0.188-0.115-0.075-0.049-0.143-0.105-0.224-0.137-0.080-0.032-0.163-0.041-0.245-0.057-0.085-0.016-0.167-0.040-0.252-0.040-0.084 0-0.163 0.023-0.245 0.039-0.087 0.016-0.172 0.025-0.253 0.059-0.080 0.032-0.147 0.087-0.22 0.135-0.063 0.041-0.133 0.064-0.189 0.116-0.453 0.423-11.092 10.408-11.092 18.095 0 7.977 4.935 13.549 12 13.549h8.667c6.673 0 11.333-5.115 11.333-12.439 0-7.052-10.013-16.167-10.44-16.552zM20.667 29.333h-7.777c-2.924 0-4.889-2.044-4.889-5.084 0-2.317 2.816-6.441 4.888-8.887 0.76 0.909 2.755 3.397 3.969 5.869 0.212 0.431 0.639 0.715 1.117 0.743 0.489 0.031 0.937-0.203 1.197-0.605 0.552-0.849 1.109-1.596 1.497-2.093 1.491 1.897 3.331 4.78 3.331 6.399 0 2.188-1.34 3.659-3.333 3.659zM26.537 27.052c0.081-0.44 0.129-0.899 0.129-1.377 0-3.269-3.713-7.847-4.46-8.735l-0.523-0.617c-0.507-0.599-1.528-0.599-2.035 0l-0.531 0.627c-0.147 0.175-0.495 0.599-0.936 1.187-1.595-2.597-3.495-4.776-3.595-4.889l-0.697-0.793c-0.507-0.577-1.499-0.577-2.004 0l-0.697 0.795c-0.6 0.684-5.856 6.803-5.856 11.001 0 0.881 0.127 1.712 0.356 2.484-1.896-1.933-3.023-4.821-3.023-8.283 0-4.915 6.073-11.997 9.329-15.255 1.001 1.008 2.692 2.789 4.368 4.927 0.243 0.309 0.609 0.496 1.001 0.509h0.048c0.376 0 0.735-0.159 0.988-0.439 0.889-0.981 1.693-1.795 2.269-2.359 3.051 2.965 8.663 9.323 8.663 13.727 0 3.171-1.031 5.769-2.796 7.491z"></path>\n</svg>\n',SpecialDiscountIcon:a,TagMoneyIcon:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tag-money</title>\n<path d="M20.567 11.433c-0.521-0.521-1.364-0.521-1.885 0l-0.524 0.524c-1.28-0.819-3.091-0.681-4.191 0.419-0.631 0.631-0.976 1.468-0.976 2.359 0 0.889 0.347 1.727 0.976 2.357l0.943 0.943c0.171 0.171 0.195 0.368 0.195 0.472s-0.025 0.301-0.196 0.472c-0.169 0.169-0.367 0.195-0.471 0.195s-0.301-0.025-0.472-0.195l-2.357-2.357c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l0.944 0.941-0.472 0.472c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l0.519-0.519c0.54 0.359 1.173 0.553 1.837 0.553 0.892 0 1.729-0.348 2.357-0.976 0.631-0.631 0.976-1.467 0.976-2.357s-0.347-1.727-0.976-2.357l-0.943-0.943c-0.26-0.26-0.26-0.684 0-0.944 0.259-0.259 0.683-0.261 0.944 0l1.885 1.887c0.521 0.521 1.364 0.521 1.885 0 0.521-0.52 0.521-1.364 0-1.885l-0.472-0.472 0.472-0.472c0.521-0.521 0.521-1.365 0.001-1.887zM28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></path>\n</svg>\n'},this.visibleOffersCount=3,this.handleCartItemUpdated=t=>{const e=t.data?.cart?.items?.find((t=>String(t.id)===String(this.itemId)));e&&(this.internalQuantity=e.quantity,this.internalOffers=e.detailed_offers||[],this.internalProductPrice=e.product_price)},this.toggleShowAll=()=>{this.showAll=!this.showAll}}bindCartListeners(){this.isAttached&&this.cartUpdateEvents.forEach((t=>salla.event.on(t,this.handleCartItemUpdated)))}connectedCallback(){this.isAttached=!0,this.hasLoaded&&this.bindCartListeners(),this.langUnsubscribe=salla.lang.subscribe((()=>{this.freeLabel=salla.lang.get("common.elements.freeExclam"),this.receivedOffer=salla.lang.get("pages.cart.received_offer"),this.discountAmountLabel=salla.lang.get("pages.cart.discount_amount"),this.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")}))}disconnectedCallback(){this.isAttached=!1,this.cartUpdateEvents.forEach((t=>salla.event.off(t,this.handleCartItemUpdated))),this.langUnsubscribe?.()}async componentWillLoad(){await Salla.onReady(),await salla.lang.onLoaded(),this.internalQuantity=this.quantity,this.internalOffers=this.parseOffers(this.offers),this.internalProductPrice=this.productPrice}componentDidLoad(){this.hasLoaded=!0,this.bindCartListeners()}parseOffers(t){try{if("string"!=typeof t)return console.warn("Offers is not a string. Returning as-is.",t),Array.isArray(t)?t:[];const e=JSON.parse(t||"[]");return Array.isArray(e)?e:[]}catch(t){return console.error("Failed to parse offers",t),[]}}get visibleOffers(){return this.internalOffers.slice(0,this.visibleOffersCount)}get hiddenOffers(){return this.internalOffers.slice(this.visibleOffersCount)}getPaidQty(t,e){return t-e.free_quantity}renderOffer(t,s){const r=this.getPaidQty(t,s);return e("div",{class:"s-cart-item-offers-box"},s.free_quantity>0&&r>0&&e("div",{class:"s-cart-item-offers-paid-free"},e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(r)," × ",e("span",{innerHTML:salla.money(this.internalProductPrice)})),e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(s.free_quantity)," ×",e("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),e("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),e("div",{class:"s-cart-item-offers-details"},e("span",{class:"s-cart-item-offers-icon",innerHTML:this.icons[s.discount_icon]||""}),e("div",null,e("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",s.offer_name)),e("p",{class:"s-cart-item-offers-discount"},e("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(s.discount_amount.toFixed(2)))})))))}render(){return this.internalOffers?.length?e("div",{class:"s-cart-item-offers-container",id:`offers_list_${this.itemId}`},this.visibleOffers.map((t=>this.renderOffer(this.internalQuantity,t))),this.internalOffers?.length>this.visibleOffersCount&&e("div",{class:"s-cart-item-offers-show-more"},e("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},e("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,e("span",{innerHTML:o,class:{"s-cart-item-offers-arrow-icon":!0,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&e("div",{class:"s-cart-item-offers-collapsed",id:`offers_${this.itemId}`},this.hiddenOffers.map((t=>this.renderOffer(this.internalQuantity,t))))):null}};n.style="/*!twlt*/:host{display:block}.s-cart-item-offers-box{margin-bottom:0.75rem}.s-cart-item-offers-container{margin-top:1.25rem}.s-cart-item-offers-paid-free{margin-bottom:0.75rem}.s-cart-item-offers-paid-free>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.25rem * var(--tw-space-y-reverse))}.s-cart-item-offers-paid-free{font-weight:500}.s-cart-item-offers-line{text-align:start}.s-cart-item-offers-regular-price{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-cart-item-offers-free-label{margin-left:0.5rem;margin-right:0.5rem;display:inline-block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.s-cart-item-offers-details{display:flex;align-items:flex-start;gap:0.625rem;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.s-cart-item-offers-icon{--tw-translate-y:-3px;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.s-cart-item-offers-icon svg{width:18px;fill:currentColor}.s-cart-item-offers-title{margin-bottom:0.5rem;font-weight:500}.s-cart-item-offers-message{font-size:0.875rem;line-height:1.25rem}.s-cart-item-offers-discount{margin-top:0px;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-cart-item-offers-show-more-btn{display:flex;align-items:center;justify-content:flex-start !important;background-color:transparent !important;padding-left:0px !important;padding-right:0px !important;font-size:0.875rem;line-height:1.25rem}.s-cart-item-offers-show-more-btn:hover{--tw-text-opacity:1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.s-cart-item-offers-arrow-icon{margin-left:0.125rem;margin-right:0.125rem;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-cart-item-offers-arrow-open{--tw-rotate:-180deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-cart-item-offers-show-more-btn svg{width:18px}.s-cart-item-offers-show-more-label{display:flex;align-items:center}.s-cart-item-offers-collapsed{margin-top:0.5rem}";const l=class{constructor(e){t(this,e),this.cartSummaryCount=salla.storage.get("cart.summary.count")||0,this.cartSummaryTotal=salla.storage.get("cart.summary.total")||0,this.cartLabel="ar"===salla.config.get("user.language_code")?"السلة":"Cart",this.handleCheckoutClick=t=>{salla.mobile?.isSpaWebview?.()&&salla.mobile.openCheckout&&(t.preventDefault(),salla.mobile.openCheckout(this.getCartLink()))}}connectedCallback(){this.cartUpdatedListener=t=>{this.cartSummaryCount=t.count||0,this.cartSummaryTotal=t.total||0},salla.cart.event.onUpdated(this.cartUpdatedListener)}disconnectedCallback(){salla.cart.event.offUpdated(this.cartUpdatedListener)}async animateToCart(t){if(document.querySelectorAll(".s-cart-thumb").forEach((t=>t.remove())),!t?.src)return void salla.log("Failed to get the img element");let e=this.host.querySelector("#s-cart-icon"),s=e.getBoundingClientRect(),r=s.top+window.scrollY,a=s.left+window.scrollX,i=t.getBoundingClientRect(),o=t.offsetWidth+"px",c=t.offsetHeight+"px",n=i.top,l=i.left,h=document.createElement("img");h.src=t.getAttribute("src"),h.className="s-cart-thumb",h.setAttribute("style","object-fit:cover; width:"+o+"; height:"+c+"; top:"+n+"px; left:"+l+"px;z-index:99999999; "),document.body.append(h);let f=document.querySelector(".s-cart-thumb");e.classList.remove("animated","rubberBand");const m=window.scrollY>0?r-window.scrollY-40:r-40,d=window.scrollY>0?r-window.scrollY+10:r+10;this.flyToCart(f,e,{top:n,left:l,flyTop:m,dropTop:d,btnLeft:a})}flyToCart(t,e,s){const r=t=>t>=1?1:1-Math.pow(2,-10*t),a=(t,e,s)=>t+(e-t)*s,i=(e,s,r)=>{t.style.width=t.style.height=`${e}px`,t.style.top=`${s}px`,t.style.left=`${r}px`};let o;t.style.opacity="1",i(150,s.top,s.left),t.style.borderRadius="20%";const c=n=>{o??(o=n);const l=n-o;if(l>=200){const e=r((l-200)/1200);i(a(150,30,e),a(s.top,s.flyTop,e),a(s.left,s.btnLeft,e)),t.style.borderRadius=`${a(20,50,e)}%`}if(l>=900){const e=r((l-900)/1e3);i(a(30,0,e),a(s.flyTop,s.dropTop,e),a(s.btnLeft,s.btnLeft+10,e)),t.style.opacity=""+(1-e)}if(l>=1200)return e.classList.add("animated","rubberBand"),void t.remove();requestAnimationFrame(c)};requestAnimationFrame(c)}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}getCartLink(){let t=salla.url.get("cart");const e=salla.storage.get("scope")||salla.config.get("store.scope");if(e&&e.id)try{const s=new URL(t);return s.searchParams.set("scope",e.id),e.allocation_type&&s.searchParams.set("allocation_type",e.allocation_type),e.allocation_id&&s.searchParams.set("allocation_id",e.allocation_id),s.toString()}catch(s){const r=t.includes("?")?"&":"?",a=new URLSearchParams;return a.set("scope",String(e.id)),e.allocation_type&&a.set("allocation_type",e.allocation_type),e.allocation_id&&a.set("allocation_id",e.allocation_id),`${t}${r}${a.toString()}`}return t}render(){return e(s,{key:"2f17568bd94a520d429ee40b1e80c41bf74f6296"},e("a",{key:"34787b44d5d2ad57c591121a807f395334951651",class:"s-cart-summary-wrapper",href:this.getCartLink(),onClick:this.handleCheckoutClick},e("div",{key:"7392396a000d5ccbc327eb77e5a835578ac4e6c4",id:"s-cart-icon"},e("slot",{key:"11e9b13d938f0870696c09394f599a643f69fde9",name:"icon"},e("i",{key:"1094fc352cdd55e7ff9f72fe6ae023d06f5ea680",class:"s-cart-summary-icon",innerHTML:c}))),e("span",{key:"5a61fce2f185193637e44ba9b3d6da31deab73fd",class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),e("p",{key:"9571d3e7d563694d2cab2c7806b384c643eb9b44",class:"s-cart-summary-content"},this.showCartLabel&&e("span",{key:"eeb5fed8da2dcdae09f38d6f26cfefc2b28e3e5b",class:"s-cart-summary-label"},this.cartLabel),e("b",{key:"e81072c0a81d5e3f22a09794bebced80e7706025",class:"s-cart-summary-total",innerHTML:salla.money(this.cartSummaryTotal)}))))}get host(){return r(this)}};l.style='/*!twlt*/.block{display:block}.transition{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-cart-summary-wrapper{text-decoration:none;color:var(--color-text);transition:all .5s cubic-bezier(0.2, 1, 0.3, 1);align-items:center;font-weight:bolder;position:relative;display:inline-flex}.s-cart-thumb{position:fixed;transition:all 0.3s cubic-bezier(0.2, 1, 0.3, 1)}.s-cart-summary-icon svg{height:1.25rem;width:1.25rem;fill:var(--color-text)}.s-cart-summary-count{position:absolute;top:-8px;left:-15px;display:inline-flex;height:1.25rem;width:1.25rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1));padding:0.25rem;font-size:0.75rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-cart-summary-count:where([dir="rtl"],[dir="rtl"] *){left:unset;right:-15px}';export{n as salla_cart_item_offers,l as salla_cart_summary}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as i,h as s,H as a,a as t}from"./p-DvJClBwJ.js";import{g as e,a as l,b as r,i as n}from"./p-CnTwkF6y.js";const h=class{constructor(s){i(this,s),this.fromProductCard=!1,this.showFreeShipping=!1,this.isFree=!1,this.timerHidden=!1,this.label=""}disconnectedCallback(){this.unsubscribe?.()}refreshTimer(){this.timerHidden=!1===e()?.visible}async componentWillLoad(){try{await salla.onReady(),await salla.lang.onLoaded();const i="en"===salla.lang.getLocale?.()?"Free shipping":"شحن مجاني";l()&&(this.unsubscribe=r((()=>this.refreshTimer()))),this.refreshTimer(),this.label=salla.lang.getWithDefault?.("pages.products.free_shipping",i)||i,this.fromProductCard?this.isFree=this.showFreeShipping:this.productId&&(this.isFree=await n(this.productId))}catch(i){salla?.logger?.warn?.("salla-free-shipping-tag: init failed",i)}}render(){return!this.isFree||this.timerHidden?null:s(a,null,s("div",{class:"s-free-shipping-tag"},s("svg",{viewBox:"0 0 24 24","aria-hidden":"true"},s("path",{d:"M3 6.5h11v9H3zM14 9.5h3.6l2.9 3.2v2.8H14"}),s("circle",{cx:"7.5",cy:"17",r:"1.8"}),s("circle",{cx:"17",cy:"17",r:"1.8"})),s("span",{class:"s-free-shipping-tag-label"},this.label)))}get host(){return t(this)}};h.style="/*!twlt*/salla-free-shipping-tag{display:block}.s-free-shipping-tag{display:inline-flex;align-items:center;gap:6px;margin-block-start:0.5rem;margin-bottom:1.25rem;padding:4px 10px;border-radius:8px;font-size:13px;line-height:1.4;color:#7a4b0c;background:rgba(245, 158, 11, 0.14)}.s-free-shipping-tag svg{inline-size:16px;block-size:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.visible{visibility:visible}.hidden{display:none}";export{h as salla_free_shipping_tag}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as r,F as t,H as o}from"./p-
|
|
4
|
+
import{r as e,h as r,F as t,H as o}from"./p-DvJClBwJ.js";const i=class{constructor(r){e(this,r)}parseOrderDetailsData(e){this.parsedOrderDetailsData=e,this.parsedOrderDetailsData="string"==typeof this.orderDetails?JSON.parse(e):e}componentWillLoad(){void 0!==this.orderDetails&&this.parseOrderDetailsData(this.orderDetails)}renderOrderDetailsContent(){return this.parsedOrderDetailsData?[this.parsedOrderDetailsData.options&&this.parsedOrderDetailsData.options.length>0&&r("salla-order-details-options",{options:this.parsedOrderDetailsData.options}),this.parsedOrderDetailsData.sub_products&&this.parsedOrderDetailsData.sub_products.length>0&&r(t,null,r("h2",{class:"s-order-details-bundle-title"},salla.lang.get("pages.orders.sub_products")),r("div",{class:"s-order-details-bundle-content"},this.parsedOrderDetailsData.sub_products.map((e=>r("salla-order-details-multiple-bundle-product",{key:e?.id,productDetails:e})))))]:null}render(){return r(o,{key:"dee58b4aee9e961e401f19024b35524874c85f6f",class:"s-order-details-wrapper"},this.renderOrderDetailsContent())}static get watchers(){return{orderDetails:["parseOrderDetailsData"]}}};i.style='/*!twlt*/.s-order-details-multiple-bundle-product{display:flex;height:auto;width:100%;flex-direction:column;align-items:flex-start;justify-content:flex-start;border-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));outline:2px solid transparent;outline-offset:0px}.s-order-details-wrapper{display:block}.s-order-details-bundle-content{display:flex;flex-direction:column;gap:1rem;padding-top:1rem;padding-bottom:1rem}.s-order-details-bundle-title{margin-bottom:0.75rem;font-size:0.875rem;line-height:1.25rem;font-weight:700}.s-order-details-product{display:flex;align-items:center;justify-content:space-between;gap:0.75rem}.s-order-details-product-content{min-width:0px}.s-order-details-product-info{display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-order-details-product-image{display:flex;height:3.5rem;width:3.5rem;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-order-details-product-image img{height:100%;width:100%;object-fit:cover}.s-order-details-product-details{display:flex;min-width:0px;flex-grow:1;flex-direction:column;gap:0.25rem}.s-order-details-product-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1));text-decoration-line:none}.s-order-details-product-name:hover{color:var(--color-primary)}.s-order-details-product-price{font-size:0.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-order-details-product-price-sale{--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-order-details-product-regular-price{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-order-details-product-quantity{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-order-details-options{margin-top:1rem}.s-order-details-option{display:flex;align-items:center;justify-content:space-between;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding-top:0.5rem;padding-bottom:0.5rem}.s-order-details-option:last-child{border-bottom-width:0px}.s-order-details-option-name{font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-order-details-option-value{text-align:right;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-order-details-option-value:where([dir="rtl"],[dir="rtl"] *){text-align:left}.s-order-details-options-title{margin-top:1.25rem;margin-bottom:0.875rem;font-size:0.875rem;line-height:1.25rem;font-weight:700}.s-order-details-options-container{margin-bottom:0.5rem;display:flow-root;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem}.s-order-details-options-container-borderless{margin-bottom:0.5rem;display:flow-root}.s-order-details-options-list>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse));--tw-divide-opacity:1;border-color:rgb(243 244 246 / var(--tw-divide-opacity, 1))}.s-order-details-options-list{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.s-order-details-options-item{display:flex;align-items:center;justify-content:space-between;padding-top:0.625rem;padding-bottom:0.625rem}.s-order-details-options-item-name{margin-bottom:0.5rem}@media (min-width: 768px){.s-order-details-options-item-name{margin-bottom:0px}}.s-order-details-options-item-value{font-weight:500}.s-order-details-options-item-value-image{font-weight:500;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-order-details-options-item-value-text{font-size:0.75rem;line-height:1rem;font-weight:500}.s-order-details-option-image-container{display:flex}.s-order-details-option-image-container>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.625rem * var(--tw-space-x-reverse));margin-left:calc(0.625rem * calc(1 - var(--tw-space-x-reverse)))}.s-order-details-option-image-container:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-order-details-option-image{height:1.5rem;width:1.5rem;border-radius:0.375rem;object-fit:cover}.s-order-details-option-color-swatch{display:inline-block;height:1.5rem;width:1.5rem;border-radius:9999px;--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-order-details-option-color-swatch:where([dir="ltr"],[dir="ltr"] *){margin-left:0.5rem}.s-order-details-option-color-swatch:where([dir="rtl"],[dir="rtl"] *){margin-right:0.5rem}.s-order-details-option-file-link{font-size:0.875rem;line-height:1.25rem;color:var(--color-primary);text-decoration-line:underline}.s-order-details-option-color-picker{display:flex;width:fit-content;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.s-order-details-option-color-picker-content{display:flex;align-items:center;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.s-order-details-option-color-picker-content:where([dir="ltr"],[dir="ltr"] *){border-right-width:1px;padding-right:0.25rem}.s-order-details-option-color-picker-content:where([dir="rtl"],[dir="rtl"] *){border-left-width:1px;padding-left:0.25rem}.s-order-details-option-color-picker-text{padding-left:0.25rem;padding-right:0.25rem;font-size:0.75rem;line-height:1rem}.s-order-details-option-color-picker-swatch{display:inline-block;height:1rem;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding:0.25rem;--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-order-details-option-color-picker-swatch:where([dir="ltr"],[dir="ltr"] *){margin-left:0.25rem}.s-order-details-option-color-picker-swatch:where([dir="rtl"],[dir="rtl"] *){margin-right:0.25rem}.s-order-details-option-color-picker-button{padding-left:0.25rem;padding-right:0.25rem;padding-top:0.25rem}.s-order-details-option-color-picker-icon{pointer-events:none;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-order-details-option-map-button{font-size:0.875rem;line-height:1.25rem;color:var(--color-primary)}.s-order-details-option-default-text{font-size:0.75rem;line-height:1rem}.s-order-details-option-color-copy-icon svg{height:1rem;width:1rem;fill:#6b7280}';export{i as salla_order_details}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,H as i}from"./p-
|
|
4
|
+
import{r as s,h as t,H as i}from"./p-DvJClBwJ.js";const r=class{constructor(t){s(this,t),this.placeholderImage=salla.url.cdn("images/s-empty.png")}getProductImage(){return this.productDetails?.image?"string"==typeof this.productDetails.image?this.productDetails.image:this.productDetails.image.url||this.placeholderImage||salla.url.cdn("images/s-empty.png"):this.placeholderImage}getProductImageAlt(){return this.productDetails?.image&&"string"!=typeof this.productDetails.image?this.productDetails.image.alt||this.productDetails?.name||"":this.productDetails?.name||""}getAccordionId(){return`accordion-${this.productDetails?.id||"default"}`}getAccordionKey(){return this.productDetails?.id||"default"}shouldBeCollapsible(){return void 0!==this.collapsible?this.collapsible:this.productDetails?.options?.length>0}renderOptions(){return this.productDetails?.options?.length?t("salla-accordion-body",null,t("div",{class:"s-order-details-options"},t("salla-order-details-options",{options:this.productDetails.options}))):null}render(){if(!this.productDetails)return null;const s=this.shouldBeCollapsible();return t(i,{class:"s-order-details-bundle-wrapper"},t("salla-accordion",{key:this.getAccordionKey(),collapsed:!1,bordered:!0,collapsible:s,id:this.getAccordionId(),size:"sm"},t("salla-accordion-head",null,t("div",{class:"s-order-details-product"},t("div",{class:"s-order-details-product-content"},t("div",{class:"s-order-details-product-info"},t("div",{class:"s-order-details-product-image"},t("img",{src:this.getProductImage(),alt:this.getProductImageAlt()})),t("div",{class:"s-order-details-product-details"},t("a",{href:this.productDetails?.url||"#",class:"s-order-details-product-name"},this.productDetails?.name||""),this.productDetails?.quantity&&t("span",{class:"s-order-details-product-quantity"},"×",this.productDetails.quantity)))))),this.renderOptions()))}};r.style="";export{r as salla_order_details_multiple_bundle_product}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as i,F as s,a as t}from"./p-
|
|
4
|
+
import{r as e,h as i,F as s,a as t}from"./p-DvJClBwJ.js";const a={title:{ar:"تحديث رقم الجوال",en:"Update your mobile number"},clarification:{ar:"رقم الجوال مكرر مع حساب آخر يبدو أنك تملك حساباً مسبقاً بهذا الرقم! يرجى تسجيل الدخول عبر البريد الإلكتروني، أو المتابعة باستخدام رقم جوال جديد.",en:"This mobile number is duplicated with another account. It looks like you already have an account with this number! Please log in with your email, or continue with a new mobile number."},choice:{ar:"هل هذا الرقم رقم جوالك؟ أكّد رقمك الحالي أو أدخل رقماً جديداً لإتمام الطلب.",en:"Is this your mobile number? Confirm your current number or enter a new one to complete the order."},same_number:{ar:"تأكيد رقمي الحالي",en:"Confirm my current number"},new_number:{ar:"استخدام رقم جديد",en:"Use a new number"},send_code:{ar:"إرسال رمز التحقق",en:"Send verification code"},exists:{ar:"رقم الجوال موجود مسبقاً",en:"Mobile number exists"},blocked:{ar:"يرجى إدخال رقم جوال جديد لإتمام الطلب",en:"Please provide a new mobile number to complete the order"},too_many:{ar:"تجاوزت عدد المحاولات المسموح بها، حاول مرة أخرى بعد 10 دقائق",en:"Too many attempts, please try again after 10 minutes"},back:{ar:"رجوع",en:"Back"}},l=class{constructor(i){e(this,i),this.options=["new_number"],this.step="mobile",this.mode="new_number",this.errorMessage="",this.fieldError="",this.phone={},this.completed=!1,this.sending=!1,this.flow=0,this.dialCode="",this.verifyCode=e=>("same_number"===this.mode?salla.api.profile.requiredMobile("requiredMobileSameVerify",{code:e.code}):salla.api.profile.requiredMobile("requiredMobileUpdate",{...this.phone,code:e.code})).then((e=>(this.completed=!0,salla.event.emit("mobile-update::updated",e),this.modal.close(),e))),this.resendCode=()=>this.requestCode().catch((e=>{this.fail(e,salla.lang.get("common.errors.error_occurred"))}))}t(e){const i=a[e],s="ar"===salla.lang.locale?i.ar:i.en;return salla.lang.getWithDefault({back:"common.elements.back",send_code:"pages.checkout.send_code"}[e]||`pages.mobile_update.${e}`,s)}async open(e={}){this.options=e.options?.length?e.options:["new_number"],this.completed=!1,this.sending=!1,this.flow++,this.errorMessage="",this.fieldError="",this.step=this.options.includes("same_number")?"choice":"mobile",this.mode="new_number",await this.modal.open()}onVisibilityChanged(e){e||this.completed||salla.event.emit("mobile-update::dismissed")}fail(e,i=""){const s=e?.response?.status,t=[].concat((e?.response?.data?.error?.fields||{}).phone||[])[0];this.errorMessage="",this.fieldError="",429!==s&&t?this.fieldError=this.t("exists"):this.errorMessage=429===s?this.t("too_many"):e?.response?.data?.error?.message||i}async sendCode(){if(this.sending)return;this.errorMessage="",this.fieldError="";const e=this.flow;this.sending=!0;try{if("new_number"===this.mode){if(!await this.telInput.isValid())return;const e=await this.telInput.getValues();this.phone={phone:e.phone,country_code:e.countryCode},this.dialCode=String(e.countryKey||"")}await this.requestCode(),e===this.flow&&(this.step="verify")}catch(i){e===this.flow&&this.fail(i,salla.lang.get("common.errors.error_occurred"))}finally{e===this.flow&&(this.sending=!1)}}requestCode(){return"same_number"===this.mode?salla.api.profile.requiredMobile("requiredMobileSameSend"):salla.api.profile.requiredMobile("requiredMobileSend",this.phone)}componentDidRender(){"verify"===this.step&&this.verify&&!this.verify.dataset.opened&&(this.verify.dataset.opened="true",this.verify.open({type:"mobile"}))}chooseMode(e){if(!this.sending){if(this.mode=e,this.errorMessage="",this.fieldError="","same_number"===e)return this.sendCode();this.step="mobile"}}changeNumber(){this.step="same_number"===this.mode?"choice":"mobile",this.errorMessage="",this.fieldError=""}sentTo(){return"same_number"===this.mode?String(salla.config.get("user.mobile","")||""):`${this.dialCode}${this.phone.phone||""}`}clarification(){return this.options.includes("same_number")?this.t("choice"):this.t("clarification")}body(){return"choice"===this.step?i(s,null,i("p",{class:"s-mobile-update-message"},this.clarification()),i("salla-button",{class:"s-mobile-update-same",width:"wide",onClick:()=>this.chooseMode("same_number")},this.t("same_number")),i("salla-button",{class:"s-mobile-update-new",width:"wide",color:"light",onClick:()=>this.chooseMode("new_number")},this.t("new_number"))):"mobile"===this.step?i(s,null,i("p",{class:"s-mobile-update-message"},this.clarification()),!this.options.includes("same_number")&&i("p",{class:"s-mobile-update-blocked"},this.t("blocked")),i("div",{class:"s-mobile-update-field"},i("salla-tel-input",{ref:e=>this.telInput=e}),this.fieldError&&i("span",{class:"s-tel-input-error-msg s-mobile-update-field-error"},this.fieldError)),i("salla-button",{class:"s-mobile-update-send",width:"wide",onClick:()=>this.sendCode()},this.t("send_code")),this.options.includes("same_number")&&i("salla-button",{class:"s-mobile-update-back",width:"wide",color:"light",fill:"outline",onClick:()=>{this.sending||(this.step="choice",this.errorMessage="",this.fieldError="")}},this.t("back"))):i(s,null,i("salla-verify",{display:"inline",type:"mobile",autoReload:!1,verifyHandler:this.verifyCode,resendHandler:this.resendCode,ref:e=>{this.verify=e}},i("b",{slot:"mobile",class:"s-mobile-update-number",dir:"ltr"},this.sentTo())),i("salla-button",{class:"s-mobile-update-change",width:"wide",color:"light",fill:"outline",onClick:()=>this.changeNumber()},this.t("back")))}render(){return i("salla-modal",{key:"9b414affef0063fc82fb99b0a065062aacf840be",class:"s-mobile-update-modal",width:"xs","is-closable":!0,"modal-title":this.t("title"),ref:e=>this.modal=e,onModalVisibilityChanged:e=>this.onVisibilityChanged(!!e.detail)},i("div",{key:"2de95104b0b048b47baa4a7472cea566e4e961e4",class:"s-mobile-update-content"},this.body(),this.errorMessage&&i("span",{key:"f8ccbd204e9dcaa31a48b2beb974a4b5d8691d53",class:"s-mobile-update-error"},this.errorMessage)))}get host(){return t(this)}};l.style="/*!twlt*/.s-mobile-update-content,.s-mobile-update-content salla-verify .s-verify-body{display:flex;flex-direction:column;gap:1rem}.s-mobile-update-message,.s-mobile-update-blocked{margin:0}.s-mobile-update-field{display:flex;flex-direction:column;gap:0.25rem}.s-mobile-update-field-error{display:block;color:#ef4444;font-size:0.875rem}.s-mobile-update-number{display:block;text-align:center}.s-mobile-update-content .s-verify-footer{display:flex;flex-direction:column;gap:1rem}.\\!visible{visibility:visible !important}.visible{visibility:visible}.inline{display:inline}.outline{outline-style:solid}";export{l as salla_mobile_update_modal}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,f as a,h as e}from"./p-ze9e0dxM.js";import{S as l}from"./p-D4oPi1Ov.js";import{C as s}from"./p-BsLF_HK7.js";const r=class{constructor(a){t(this,a),this.activeTabType="",this.tabsKey=0,this.selectedItem=void 0,this.allowEmail=!0,this.allowMobile=!0,this.requireEmail=!1,salla.onReady((()=>{this.is_loggedin=salla.config.isUser()}))}connectedCallback(){this.loyaltyOpenListener=()=>this.open(),this.onLoggedInListener=()=>{this.is_loggedin=!0},this.cartUpdatedListener=t=>{this.prizePoints=t.loyalty.prize?.points,this.prizeTitle=t.loyalty.prize?.title,this.customerPoints=t.loyalty.customer_points||this.customerPoints},salla.event.on("loyalty::open",this.loyaltyOpenListener),salla.auth.event.onLoggedIn(this.onLoggedInListener),salla.cart.event.onUpdated(this.cartUpdatedListener),this.langUnsubscribe=salla.lang.subscribe((()=>{this.guestMessage=salla.lang.get("pages.loyalty_program.guest_message"),this.translationLoaded=!0,a(this)}))}disconnectedCallback(){salla.event.off("loyalty::open",this.loyaltyOpenListener),salla.auth.event.offLoggedIn(this.onLoggedInListener),salla.cart.event.offUpdated(this.cartUpdatedListener),this.langUnsubscribe?.()}onTabSelected(t){const a=this.loyaltyProgram?.prizes.find((a=>a.title===t.detail?.name));a&&(this.activeTabType=a.type)}setSelectedPrizeItem(t){this.selectedItem=this.selectedItem&&this.selectedItem?.id==t.id?void 0:t}handleLongText(t){return t.length>150?t.substring(0,150)+"...":t}prizeItem(t){return e("div",{onClick:()=>this.setSelectedPrizeItem(t),class:{"s-loyalty-prize-item-selected":!!this.selectedItem&&this.selectedItem?.id==t.id,"s-loyalty-prize-item":!0}},e("img",{class:"s-loyalty-prize-item-image",src:t.image,alt:t.name}),e("div",{class:"s-loyalty-prize-item-title"},t.name),e("div",{class:"s-loyalty-prize-item-subtitle"},this.handleLongText(t.description)),e("div",{class:"s-loyalty-prize-item-points"},t.cost_points," ",salla.lang.get("pages.loyalty_program.point"),e("div",{class:"s-loyalty-prize-item-check"},e("div",null))))}getConfirmationModal(){return[e("salla-placeholder",{alignment:"center",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80">\n<title>star3</title>\n <defs>\n <style>\n .a {\n fill: none !important;\n }\n\n .b {\n fill: #ff9e01;\n }\n\n .c {\n fill: #fff;\n opacity: 0.1;\n }\n\n </style>\n </defs>\n <g transform="translate(-683 -269)">\n <rect class="a" width="80" height="80" transform="translate(683 269)" />\n <g transform="translate(684.539 261.216)">\n <path class="b"\n d="M110.117,37.062,90.024,35.2,82.043,16.665a1.61,1.61,0,0,0-2.958,0L71.1,35.2,51.011,37.062a1.61,1.61,0,0,0-.914,2.813l15.16,13.318L60.821,72.878a1.61,1.61,0,0,0,2.393,1.739l17.351-10.3,17.351,10.3a1.61,1.61,0,0,0,2.393-1.739L95.871,53.192l15.16-13.318A1.61,1.61,0,0,0,110.117,37.062Z"\n transform="translate(-42.104 -4.011)" />\n <g transform="translate(0 10.971)">\n <path class="b"\n d="M93.54,12.016c1.024,1.423,3.915,7.533,5.568,11.094a.559.559,0,0,1-.891.641c-2.853-2.7-7.73-7.377-8.754-8.8a2.512,2.512,0,0,1,4.077-2.935Z"\n transform="translate(-75.621 -10.971)" />\n <path class="b"\n d="M360.909,12.016c-1.024,1.423-3.915,7.533-5.568,11.094a.559.559,0,0,0,.891.641c2.853-2.7,7.73-7.377,8.754-8.8a2.512,2.512,0,0,0-4.077-2.935Z"\n transform="translate(-301.908 -10.971)" />\n <path class="b"\n d="M427.538,284.659c-1.667-.543-8.366-1.441-12.261-1.934a.559.559,0,0,0-.34,1.044c3.436,1.9,9.377,5.123,11.044,5.666a2.512,2.512,0,0,0,1.558-4.776Z"\n transform="translate(-352.351 -241.894)" />\n <path class="b"\n d="M1.734,284.659c1.667-.543,8.366-1.441,12.261-1.934a.559.559,0,0,1,.34,1.044c-3.436,1.9-9.377,5.123-11.044,5.666a2.512,2.512,0,0,1-1.558-4.776Z"\n transform="translate(0 -241.894)" />\n <path class="b"\n d="M239.794,412.414c0-1.753,1.224-8.4,1.963-12.257a.559.559,0,0,1,1.1,0c.739,3.855,1.963,10.5,1.963,12.257a2.512,2.512,0,0,1-5.023,0Z"\n transform="translate(-203.768 -341.301)" />\n </g>\n <path class="c"\n d="M84.945,23.4l-2.9-6.74a1.61,1.61,0,0,0-2.958,0L71.1,35.2,51.011,37.062a1.61,1.61,0,0,0-.914,2.813l15.16,13.318L60.821,72.878a1.61,1.61,0,0,0,2.393,1.739l2.309-1.371A125,125,0,0,1,84.945,23.4Z"\n transform="translate(-42.104 -4.011)" />\n </g>\n </g>\n</svg>\n',class:"s-loyalty-confirmation-modal-content"},e("div",{slot:"title",class:"s-loyalty-confirmation-title"},salla.lang.get("pages.loyalty_program.exchange_points")),e("div",{slot:"description"},salla.lang.get("pages.loyalty_program.are_you_sure_to_exchange")," ( ",e("strong",null,this.selectedItem?.cost_points)," ",salla.lang.get("pages.loyalty_program.point")," ) ",salla.lang.get("pages.loyalty_program.for")," ( ",e("strong",null,this.selectedItem?.name)," )")),e("div",{class:"s-loyalty-confirmation-actions"},e("salla-button",{fill:"outline",width:"wide",onClick:()=>this.cancelProcess()},salla.lang.get("pages.loyalty_program.cancellation")),e("salla-button",{loading:this.buttonLoading,width:"wide",onClick:()=>this.exchangeLoyaltyPoint()},salla.lang.get("pages.loyalty_program.confirm")))]}getAfterExchangeUI(){return e("slot",{name:"points-applied-widget"},e("salla-list-tile",{class:"s-loyalty-after-exchange"},e("div",{slot:"title",class:"s-loyalty-after-exchange-title"},this.prizeTitle," - ",this.prizePoints," ",salla.lang.get("pages.loyalty_program.point")),e("div",{slot:"action",class:"s-loyalty-after-exchange-action"},e("salla-button",{class:"s-loyalty-after-exchange-reset",shape:"icon",fill:"outline",color:"danger",size:"small",onClick:()=>this.resetExchange()},e("span",{innerHTML:s})))))}async open(){return this.is_loggedin?(this.modal?.open(),await salla.loyalty.getProgram().then((t=>{this.loyaltyProgram=t.data,this.activeTabType=this.loyaltyProgram.prizes[0]?.type||"",this.tabsKey++})).catch((t=>{this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data})).finally((()=>this.modal?.stopLoading()))):salla.event.dispatch("login::open")}async close(){return this.modal.close()}async resetExchange(){return await salla.loyalty.reset()}getApiErrorMessage(t){return t?.response?.data?.error?.message||t?.response?.data?.message||("string"==typeof t?t:null)||salla.lang.get("common.errors.error_occurred")}async openConfirmation(){return await this.modal.close().then((()=>this.confirmationModal?.open())).catch((t=>console.log(t)))}async cancelProcess(){return await this.confirmationModal.close().then((()=>this.selectedItem=null)).catch((t=>console.log(t)))}async exchangeLoyaltyPoint(){this.buttonLoading=!0;const t=this.selectedItem;await salla.loyalty.exchange(t?.id).then((async()=>{"FREE_PRODUCT"==t?.key&&salla.url.is_page("cart")&&window.location.reload(),await this.cancelProcess()})).catch((t=>{salla.notify.error(this.getApiErrorMessage(t))})),this.buttonLoading=!1}render(){return this.prizePoints?this.getAfterExchangeUI():[e("slot",{name:"widget"},this.customerPoints?e("salla-list-tile",{class:"s-loyalty-widget"},e("div",{slot:"icon",class:"s-loyalty-widget-icon",innerHTML:l}),e("div",{slot:"subtitle"},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_total_point_summary",{balance:this.customerPoints}):this.guestMessage,e("salla-button",{shape:"link",color:"primary",onClick:()=>salla.event.dispatch("loyalty::open")},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_point_exchange_now"):salla.lang.get("blocks.header.login")))):""),e("salla-modal",{noPadding:!0,width:"sm",ref:t=>this.confirmationModal=t},this.getConfirmationModal()),e("salla-modal",{isLoading:!0,"has-skeleton":!0,width:"md",ref:t=>this.modal=t},e("div",{slot:"loading"},e("div",{class:"s-loyalty-skeleton"},e("salla-list-tile",{class:"s-loyalty-header"},e("div",{slot:"icon",class:"s-loyalty-header-icon"},e("salla-skeleton",{type:"circle",height:"6rem",width:"6rem"})),e("div",{slot:"title",class:"s-loyalty-header-title mb-5"},e("salla-skeleton",{height:"15px",width:"50%"})),e("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},e("salla-skeleton",{height:"10px"}),e("salla-skeleton",{height:"10px",width:"75%"}))),e("div",{class:"s-loyalty-skeleton-cards"},[...Array(3)].map((()=>e("div",{class:"s-loyalty-prize-item swiper-slide"},e("salla-skeleton",{height:"9rem"}),e("div",{class:"s-loyalty-prize-item-title"},e("salla-skeleton",{height:"15px",width:"75%"})),e("div",{class:"s-loyalty-prize-item-subtitle"},e("salla-skeleton",{height:"10px",width:"50%"}),e("salla-skeleton",{height:"10px",width:"25%"})),e("div",{class:"s-loyalty-prize-item-points"},e("salla-skeleton",{height:"15px",width:"100px"}),e("div",{class:"s-loyalty-prize-item-check"},e("salla-skeleton",{height:"1rem",width:"1rem",type:"circle"}))))))))),!this.hasError&&this.loyaltyProgram?[e("salla-list-tile",{id:"s-loyalty-header",class:"s-loyalty-header"},e("div",{slot:"icon",class:"s-loyalty-header-icon",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" width="54.079" height="53.191" viewBox="0 0 54.079 53.191"><defs><style>.a{fill:#ee9d0d;}.b{fill:#c7830b;}.c{fill:#ea2b2d;}.d{fill:#cb2527;}.e{fill:#6699ce;}.f{fill:#faa6b2;}.g{fill:#a6deff;}.h{fill:#eeb436;}.i{fill:#f72d2f;}</style></defs><path class="a" d="M40,248H77.3v25.88a2.1,2.1,0,0,1-2.1,2.1H42.1a2.1,2.1,0,0,1-2.1-2.1Z" transform="translate(-38.135 -222.787)"/><path class="b" d="M250.632,248.711v12.755L236.2,248h13.67Z" transform="translate(-211.463 -222.787)"/><path class="b" d="M333.957,336v3.207L330.52,336Z" transform="translate(-294.787 -300.528)"/><path class="c" d="M226.194,32.048l-.5.185a5.035,5.035,0,0,0-3.072,3.292l-.468,1.585-.759.414a5.035,5.035,0,0,0-2.422,3l8.865,8.271,5.09-5.456.262-6.205a5.191,5.191,0,0,0-7-5.083Z" transform="translate(-196.246 -31.722)"/><path class="c" d="M358.628,175.48l-.15.509a5.034,5.034,0,0,1-3.072,3.292l-1.55.577-.359.785a5.034,5.034,0,0,1-2.822,2.624L341.81,175l5.09-5.455,6.172-.69a5.191,5.191,0,0,1,5.555,6.629Z" transform="translate(-304.761 -152.837)"/><path class="d" d="M168,248h7.461v27.978H168Z" transform="translate(-151.213 -222.787)"/><path class="c" d="M40,336H77.3v7.461H40Z" transform="translate(-38.135 -300.528)"/><path class="d" d="M333.957,336v3.207L330.52,336Z" transform="translate(-294.787 -300.528)"/><path class="a" d="M2.1,0H40.8a2.1,2.1,0,0,1,2.1,2.1V9.326H0V2.1A2.1,2.1,0,0,1,2.1,0Z" transform="matrix(0.731, 0.682, -0.682, 0.731, 18.641, 4.976)"/><path class="d" d="M0,0H9.326V9.326H0Z" transform="matrix(0.731, 0.682, -0.682, 0.731, 30.912, 16.424)"/><path class="d" d="M286.857,79.389a.931.931,0,0,1-.74-.365l-.615-.8a12.516,12.516,0,0,1-2.528-9,.933.933,0,0,1,1.855.2,10.66,10.66,0,0,0,2.153,7.667l.615.8a.933.933,0,0,1-.739,1.5Z" transform="translate(-252.718 -64.113)"/><path class="c" d="M185.485,178.151l-.039.014a30.78,30.78,0,0,1-12.034,1.906l-2.381-.1,4.092,3.817-1.181,4,3.728-1.206a30.775,30.775,0,0,0,9.833-5.315l.71-.572Z" transform="translate(-153.891 -161.081)"/><path class="d" d="M363.834,194.779a12.51,12.51,0,0,1-6.93-2.1l-.843-.559a.933.933,0,1,1,1.031-1.554l.842.558a10.659,10.659,0,0,0,7.8,1.618.933.933,0,1,1,.328,1.836A12.663,12.663,0,0,1,363.834,194.779Z" transform="translate(-316.982 -171.914)"/><path class="c" d="M275,202.524l-.012.04a30.776,30.776,0,0,0-1.069,12.137l.265,2.369-4.092-3.817-3.909,1.455.945-3.8a30.776,30.776,0,0,1,4.622-10.177l.521-.748Z" transform="translate(-237.949 -180.364)"/><circle class="e" cx="1.865" cy="1.865" r="1.865" transform="translate(10.259 0.032)"/><circle class="f" cx="1.865" cy="1.865" r="1.865" transform="translate(0 21.482)"/><path class="g" d="M36.663,36.663a.933.933,0,0,1-.885-.638l-.048-.143a2.946,2.946,0,0,0-2.8-2.017.933.933,0,1,1,0-1.865A4.808,4.808,0,0,1,37.5,35.292l.048.143a.933.933,0,0,1-.885,1.228Z" transform="translate(-31.067 -31.968)"/><path class="g" d="M79.493,194.438a.929.929,0,0,1-.506-.15l-.185-.12a2.074,2.074,0,0,0-2.192-.047.933.933,0,0,1-.947-1.607,3.929,3.929,0,0,1,4.153.088l.185.12a.933.933,0,0,1-.508,1.716Z" transform="translate(-69.235 -173.283)"/><path class="h" d="M27.751,85.141l2.88,2.644,3.811-.874-1.624,3.556,2.008,3.354-3.884-.446-2.569,2.946L27.6,92.49,24,90.957l3.4-1.922Z" transform="translate(-24 -78.914)"/><path class="h" d="M82.174,227.375l-.959,3.772,2.564,2.928-3.884.254L77.9,237.673l-1.442-3.615-3.8-.862,2.993-2.488-.353-3.876,3.291,2.078Z" transform="translate(-66.992 -204.086)"/><path class="i" d="M300.471,141.9l-5.455-5.09,5.09-5.456a8.342,8.342,0,0,1,5.455,5.09Z" transform="translate(-263.422 -119.737)"/></svg>'}),e("div",{slot:"title",class:"s-loyalty-header-title"},this.loyaltyProgram.prize_promotion_title),e("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},this.loyaltyProgram.prize_promotion_description)),e("salla-tabs",{key:this.tabsKey},this.loyaltyProgram.prizes.map((t=>e("salla-tab-header",{slot:"header",name:t.title},e("span",null,t.title)))),this.loyaltyProgram.prizes.map(((t,a)=>e("salla-tab-content",{slot:"content",name:t.title},e("salla-slider",{class:"s-loyalty-slider",loop:!1,"controls-outer":!0,id:"loyalty-popup-slider-"+a,type:"carousel"},e("div",{slot:"items"},t.items.map((t=>this.prizeItem(t))))))))),"FREE_PRODUCT"===this.activeTabType?.toUpperCase()&&(salla.config.get("store.features")||[]).includes("loyalty-system-v2")?e("a",{href:salla.url.get(""),class:"s-loyalty-program-redeem-btn s-button-element s-button-btn s-button-solid s-button-wide s-button-primary s-button-wrap"},salla.lang.get("pages.loyalty_program.shop_now")):e("salla-button",{disabled:!this.selectedItem,width:"wide",class:"s-loyalty-program-redeem-btn",onClick:()=>this.openConfirmation()},salla.lang.get("pages.loyalty_program.exchange_points"))]:e("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?e("span",{slot:"description"},this.errorMessage):""))]}};r.style='/*!twlt*/.mb-5{margin-bottom:1.25rem}.outline{outline-style:solid}.s-loyalty-placeholder{display:flex;align-items:center;justify-content:center}.s-button-btn{position:relative;display:inline-flex;flex:1 1 0%;user-select:none;flex-direction:row-reverse;align-items:center;justify-content:center;white-space:nowrap;border-radius:var(--s-radius, 0.25rem);border-style:solid;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-btn:hover{opacity:0.8}.s-button-primary{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-button-primary:hover{background-color:var(--color-primary-dark)}.s-button-wrap{pointer-events:none}.s-button-wrap svg{height:1.25rem;width:1.25rem;fill:currentColor}.s-button-element:not(:disabled):not([loading]){pointer-events:auto}.s-button-wide{width:100%}.s-loyalty-prize-item.swiper-slide{margin-left:5px;margin-right:5px;margin-bottom:0.5rem;display:flex;width:calc(33.33% - 10px);min-width:200px;cursor:pointer;flex-direction:column}.s-loyalty-prize-item.swiper-slide>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.75rem * var(--tw-space-y-reverse))}.s-loyalty-prize-item.swiper-slide{overflow:hidden;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));background-size:cover;padding:0px !important;text-align:center;font-size:1.875rem;line-height:2.25rem}.s-loyalty-prize-item-selected{--tw-translate-y:-0.125rem !important;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;border-width:1px;border-style:solid;border-color:var(--color-primary);--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transition-property:all;transition-duration:300ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-loyalty-prize-item-selected .s-loyalty-prize-item-check{display:flex;align-items:center;justify-content:center;border-color:var(--color-primary)}.s-loyalty-prize-item-selected .s-loyalty-prize-item-check>div{height:0.625rem;width:0.625rem;border-radius:9999px;background-color:var(--color-primary)}.s-loyalty-prize-item-image{height:9rem;width:100%;background-size:cover;object-fit:cover}.s-loyalty-prize-item-title{padding-left:0.5rem;padding-right:0.5rem;font-size:1rem;line-height:1.5rem;font-weight:700}.s-loyalty-prize-item-subtitle{padding-left:0.5rem;padding-right:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-loyalty-prize-item-check{position:absolute;height:1rem;width:1rem;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-loyalty-prize-item-check:where([dir="ltr"],[dir="ltr"] *){left:1.25rem}.s-loyalty-prize-item-check:where([dir="rtl"],[dir="rtl"] *){right:1.25rem}.s-loyalty-prize-item-points{margin-top:auto !important;display:flex;width:100%;align-items:center;justify-content:center;border-top-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.75rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary)}.s-loyalty-program-redeem-btn{overflow:hidden;transition-property:all;transition-duration:300ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-loyalty-header{margin-bottom:1.25rem;display:block}@media (max-width: 768px){.s-loyalty-modal .s-modal-body{max-height:100%;overflow-y:scroll}}.s-loyalty-skeleton .s-list-tile-item-content{display:block;width:100%}.s-loyalty-header-icon{position:relative;display:flex;height:6rem;width:6rem;align-items:center;justify-content:center;border-radius:9999px;background-color:#ff9e011a}.s-loyalty-header-icon>img{height:3rem;width:3rem}.s-loyalty-header-title{margin-bottom:0.5rem;font-size:1.25rem;line-height:1.75rem}.s-loyalty-header-subtitle{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-loyalty-activator-icon{display:flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.s-loyalty-activator-icon>svg{fill:#fff}.s-loyalty-confirmation-modal-content .s-placeholder-title{margin-bottom:0.75rem}.s-loyalty-confirmation-modal-content .s-placeholder-icon svg b{--tw-text-opacity:1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.s-loyalty-confirmation-modal-content .s-placeholder-description{padding-left:1.25rem;padding-right:1.25rem}.s-loyalty-confirmation-actions{margin-top:1.25rem;display:flex;align-items:center;justify-content:space-between}.s-loyalty-confirmation-actions>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-loyalty-confirmation-actions{padding:1.25rem;padding-top:0.5rem}.s-loyalty-confirmation-actions:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-loyalty-widget .s-list-tile-item{padding:0px !important}.s-loyalty-widget-icon{display:flex;height:4rem;width:4rem;align-items:center;justify-content:center;border-radius:9999px;background-color:var(--color-primary)}.s-loyalty-widget-icon>svg{width:1.5rem;fill:#fff}.s-loyalty-after-exchange .s-list-tile-item{position:relative;justify-content:space-between;overflow:hidden;border-radius:var(--s-radius, 0.25rem);padding-top:0.75rem;padding-bottom:0.75rem}.s-loyalty-after-exchange .s-list-tile-item::after{pointer-events:none;position:absolute;inset:0px;display:block;height:100%;width:100%;background-color:var(--color-primary);opacity:.08;--tw-content:\'\';content:var(--tw-content)}.s-loyalty-after-exchange .s-list-tile-item .s-list-tile-item-title{font-size:15px}.s-loyalty-after-exchange-reset{height:1.5rem}.s-loyalty-after-exchange-reset button{--tw-border-opacity:1;border-color:rgb(248 113 113 / var(--tw-border-opacity, 1));font-size:15px}.s-loyalty-after-exchange-reset button span{display:flex;--tw-scale-x:.75;--tw-scale-y:.75;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));align-items:center;justify-content:center}.s-loyalty-after-exchange-reset button svg{height:1.5rem !important;width:1.5rem !important;fill:#f87171}.s-loyalty-after-exchange-reset button:hover svg{fill:#fff}.s-loyalty-after-exchange-action{display:flex;align-items:center;justify-content:center}.s-loyalty-placeholder{display:flex;align-items:center;justify-content:center}.s-loyalty-skeleton .s-loyalty-header-subtitle>salla-skeleton{margin-bottom:0.75rem;display:block}.s-loyalty-skeleton .s-loyalty-prize-item-subtitle>salla-skeleton{margin-bottom:0.75rem;display:block}.s-loyalty-skeleton .s-loyalty-header-title{margin-bottom:1.25rem}.s-loyalty-skeleton-cards{display:flex;align-items:center}.s-loyalty-skeleton .s-loyalty-prize-item{position:relative;cursor:unset !important;text-align:center}.s-loyalty-skeleton .s-loyalty-prize-item .s-skeleton-wrapper{margin-left:auto;margin-right:auto}.s-loyalty-skeleton .s-loyalty-prize-item-check{border-width:0px}.s-loyalty-slider{margin-bottom:0.625rem;display:block}.s-loyalty-slider .swiper-wrapper{height:auto !important}.s-loyalty-container{padding:0.625rem}.s-loyalty-points-history-no-content .icon{margin-bottom:1rem;display:flex;height:8rem;width:8rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:3rem;line-height:1;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}';export{r as salla_loyalty}
|
|
4
|
+
import{r as t,f as a,h as e}from"./p-DvJClBwJ.js";import{S as l}from"./p-D4oPi1Ov.js";import{C as s}from"./p-BsLF_HK7.js";const r=class{constructor(a){t(this,a),this.activeTabType="",this.tabsKey=0,this.selectedItem=void 0,this.allowEmail=!0,this.allowMobile=!0,this.requireEmail=!1,salla.onReady((()=>{this.is_loggedin=salla.config.isUser()}))}connectedCallback(){this.loyaltyOpenListener=()=>this.open(),this.onLoggedInListener=()=>{this.is_loggedin=!0},this.cartUpdatedListener=t=>{this.prizePoints=t.loyalty.prize?.points,this.prizeTitle=t.loyalty.prize?.title,this.customerPoints=t.loyalty.customer_points||this.customerPoints},salla.event.on("loyalty::open",this.loyaltyOpenListener),salla.auth.event.onLoggedIn(this.onLoggedInListener),salla.cart.event.onUpdated(this.cartUpdatedListener),this.langUnsubscribe=salla.lang.subscribe((()=>{this.guestMessage=salla.lang.get("pages.loyalty_program.guest_message"),this.translationLoaded=!0,a(this)}))}disconnectedCallback(){salla.event.off("loyalty::open",this.loyaltyOpenListener),salla.auth.event.offLoggedIn(this.onLoggedInListener),salla.cart.event.offUpdated(this.cartUpdatedListener),this.langUnsubscribe?.()}onTabSelected(t){const a=this.loyaltyProgram?.prizes.find((a=>a.title===t.detail?.name));a&&(this.activeTabType=a.type)}setSelectedPrizeItem(t){this.selectedItem=this.selectedItem&&this.selectedItem?.id==t.id?void 0:t}handleLongText(t){return t.length>150?t.substring(0,150)+"...":t}prizeItem(t){return e("div",{onClick:()=>this.setSelectedPrizeItem(t),class:{"s-loyalty-prize-item-selected":!!this.selectedItem&&this.selectedItem?.id==t.id,"s-loyalty-prize-item":!0}},e("img",{class:"s-loyalty-prize-item-image",src:t.image,alt:t.name}),e("div",{class:"s-loyalty-prize-item-title"},t.name),e("div",{class:"s-loyalty-prize-item-subtitle"},this.handleLongText(t.description)),e("div",{class:"s-loyalty-prize-item-points"},t.cost_points," ",salla.lang.get("pages.loyalty_program.point"),e("div",{class:"s-loyalty-prize-item-check"},e("div",null))))}getConfirmationModal(){return[e("salla-placeholder",{alignment:"center",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80">\n<title>star3</title>\n <defs>\n <style>\n .a {\n fill: none !important;\n }\n\n .b {\n fill: #ff9e01;\n }\n\n .c {\n fill: #fff;\n opacity: 0.1;\n }\n\n </style>\n </defs>\n <g transform="translate(-683 -269)">\n <rect class="a" width="80" height="80" transform="translate(683 269)" />\n <g transform="translate(684.539 261.216)">\n <path class="b"\n d="M110.117,37.062,90.024,35.2,82.043,16.665a1.61,1.61,0,0,0-2.958,0L71.1,35.2,51.011,37.062a1.61,1.61,0,0,0-.914,2.813l15.16,13.318L60.821,72.878a1.61,1.61,0,0,0,2.393,1.739l17.351-10.3,17.351,10.3a1.61,1.61,0,0,0,2.393-1.739L95.871,53.192l15.16-13.318A1.61,1.61,0,0,0,110.117,37.062Z"\n transform="translate(-42.104 -4.011)" />\n <g transform="translate(0 10.971)">\n <path class="b"\n d="M93.54,12.016c1.024,1.423,3.915,7.533,5.568,11.094a.559.559,0,0,1-.891.641c-2.853-2.7-7.73-7.377-8.754-8.8a2.512,2.512,0,0,1,4.077-2.935Z"\n transform="translate(-75.621 -10.971)" />\n <path class="b"\n d="M360.909,12.016c-1.024,1.423-3.915,7.533-5.568,11.094a.559.559,0,0,0,.891.641c2.853-2.7,7.73-7.377,8.754-8.8a2.512,2.512,0,0,0-4.077-2.935Z"\n transform="translate(-301.908 -10.971)" />\n <path class="b"\n d="M427.538,284.659c-1.667-.543-8.366-1.441-12.261-1.934a.559.559,0,0,0-.34,1.044c3.436,1.9,9.377,5.123,11.044,5.666a2.512,2.512,0,0,0,1.558-4.776Z"\n transform="translate(-352.351 -241.894)" />\n <path class="b"\n d="M1.734,284.659c1.667-.543,8.366-1.441,12.261-1.934a.559.559,0,0,1,.34,1.044c-3.436,1.9-9.377,5.123-11.044,5.666a2.512,2.512,0,0,1-1.558-4.776Z"\n transform="translate(0 -241.894)" />\n <path class="b"\n d="M239.794,412.414c0-1.753,1.224-8.4,1.963-12.257a.559.559,0,0,1,1.1,0c.739,3.855,1.963,10.5,1.963,12.257a2.512,2.512,0,0,1-5.023,0Z"\n transform="translate(-203.768 -341.301)" />\n </g>\n <path class="c"\n d="M84.945,23.4l-2.9-6.74a1.61,1.61,0,0,0-2.958,0L71.1,35.2,51.011,37.062a1.61,1.61,0,0,0-.914,2.813l15.16,13.318L60.821,72.878a1.61,1.61,0,0,0,2.393,1.739l2.309-1.371A125,125,0,0,1,84.945,23.4Z"\n transform="translate(-42.104 -4.011)" />\n </g>\n </g>\n</svg>\n',class:"s-loyalty-confirmation-modal-content"},e("div",{slot:"title",class:"s-loyalty-confirmation-title"},salla.lang.get("pages.loyalty_program.exchange_points")),e("div",{slot:"description"},salla.lang.get("pages.loyalty_program.are_you_sure_to_exchange")," ( ",e("strong",null,this.selectedItem?.cost_points)," ",salla.lang.get("pages.loyalty_program.point")," ) ",salla.lang.get("pages.loyalty_program.for")," ( ",e("strong",null,this.selectedItem?.name)," )")),e("div",{class:"s-loyalty-confirmation-actions"},e("salla-button",{fill:"outline",width:"wide",onClick:()=>this.cancelProcess()},salla.lang.get("pages.loyalty_program.cancellation")),e("salla-button",{loading:this.buttonLoading,width:"wide",onClick:()=>this.exchangeLoyaltyPoint()},salla.lang.get("pages.loyalty_program.confirm")))]}getAfterExchangeUI(){return e("slot",{name:"points-applied-widget"},e("salla-list-tile",{class:"s-loyalty-after-exchange"},e("div",{slot:"title",class:"s-loyalty-after-exchange-title"},this.prizeTitle," - ",this.prizePoints," ",salla.lang.get("pages.loyalty_program.point")),e("div",{slot:"action",class:"s-loyalty-after-exchange-action"},e("salla-button",{class:"s-loyalty-after-exchange-reset",shape:"icon",fill:"outline",color:"danger",size:"small",onClick:()=>this.resetExchange()},e("span",{innerHTML:s})))))}async open(){return this.is_loggedin?(this.modal?.open(),await salla.loyalty.getProgram().then((t=>{this.loyaltyProgram=t.data,this.activeTabType=this.loyaltyProgram.prizes[0]?.type||"",this.tabsKey++})).catch((t=>{this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data})).finally((()=>this.modal?.stopLoading()))):salla.event.dispatch("login::open")}async close(){return this.modal.close()}async resetExchange(){return await salla.loyalty.reset()}getApiErrorMessage(t){return t?.response?.data?.error?.message||t?.response?.data?.message||("string"==typeof t?t:null)||salla.lang.get("common.errors.error_occurred")}async openConfirmation(){return await this.modal.close().then((()=>this.confirmationModal?.open())).catch((t=>console.log(t)))}async cancelProcess(){return await this.confirmationModal.close().then((()=>this.selectedItem=null)).catch((t=>console.log(t)))}async exchangeLoyaltyPoint(){this.buttonLoading=!0;const t=this.selectedItem;await salla.loyalty.exchange(t?.id).then((async()=>{"FREE_PRODUCT"==t?.key&&salla.url.is_page("cart")&&window.location.reload(),await this.cancelProcess()})).catch((t=>{salla.notify.error(this.getApiErrorMessage(t))})),this.buttonLoading=!1}render(){return this.prizePoints?this.getAfterExchangeUI():[e("slot",{name:"widget"},this.customerPoints?e("salla-list-tile",{class:"s-loyalty-widget"},e("div",{slot:"icon",class:"s-loyalty-widget-icon",innerHTML:l}),e("div",{slot:"subtitle"},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_total_point_summary",{balance:this.customerPoints}):this.guestMessage,e("salla-button",{shape:"link",color:"primary",onClick:()=>salla.event.dispatch("loyalty::open")},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_point_exchange_now"):salla.lang.get("blocks.header.login")))):""),e("salla-modal",{noPadding:!0,width:"sm",ref:t=>this.confirmationModal=t},this.getConfirmationModal()),e("salla-modal",{isLoading:!0,"has-skeleton":!0,width:"md",ref:t=>this.modal=t},e("div",{slot:"loading"},e("div",{class:"s-loyalty-skeleton"},e("salla-list-tile",{class:"s-loyalty-header"},e("div",{slot:"icon",class:"s-loyalty-header-icon"},e("salla-skeleton",{type:"circle",height:"6rem",width:"6rem"})),e("div",{slot:"title",class:"s-loyalty-header-title mb-5"},e("salla-skeleton",{height:"15px",width:"50%"})),e("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},e("salla-skeleton",{height:"10px"}),e("salla-skeleton",{height:"10px",width:"75%"}))),e("div",{class:"s-loyalty-skeleton-cards"},[...Array(3)].map((()=>e("div",{class:"s-loyalty-prize-item swiper-slide"},e("salla-skeleton",{height:"9rem"}),e("div",{class:"s-loyalty-prize-item-title"},e("salla-skeleton",{height:"15px",width:"75%"})),e("div",{class:"s-loyalty-prize-item-subtitle"},e("salla-skeleton",{height:"10px",width:"50%"}),e("salla-skeleton",{height:"10px",width:"25%"})),e("div",{class:"s-loyalty-prize-item-points"},e("salla-skeleton",{height:"15px",width:"100px"}),e("div",{class:"s-loyalty-prize-item-check"},e("salla-skeleton",{height:"1rem",width:"1rem",type:"circle"}))))))))),!this.hasError&&this.loyaltyProgram?[e("salla-list-tile",{id:"s-loyalty-header",class:"s-loyalty-header"},e("div",{slot:"icon",class:"s-loyalty-header-icon",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" width="54.079" height="53.191" viewBox="0 0 54.079 53.191"><defs><style>.a{fill:#ee9d0d;}.b{fill:#c7830b;}.c{fill:#ea2b2d;}.d{fill:#cb2527;}.e{fill:#6699ce;}.f{fill:#faa6b2;}.g{fill:#a6deff;}.h{fill:#eeb436;}.i{fill:#f72d2f;}</style></defs><path class="a" d="M40,248H77.3v25.88a2.1,2.1,0,0,1-2.1,2.1H42.1a2.1,2.1,0,0,1-2.1-2.1Z" transform="translate(-38.135 -222.787)"/><path class="b" d="M250.632,248.711v12.755L236.2,248h13.67Z" transform="translate(-211.463 -222.787)"/><path class="b" d="M333.957,336v3.207L330.52,336Z" transform="translate(-294.787 -300.528)"/><path class="c" d="M226.194,32.048l-.5.185a5.035,5.035,0,0,0-3.072,3.292l-.468,1.585-.759.414a5.035,5.035,0,0,0-2.422,3l8.865,8.271,5.09-5.456.262-6.205a5.191,5.191,0,0,0-7-5.083Z" transform="translate(-196.246 -31.722)"/><path class="c" d="M358.628,175.48l-.15.509a5.034,5.034,0,0,1-3.072,3.292l-1.55.577-.359.785a5.034,5.034,0,0,1-2.822,2.624L341.81,175l5.09-5.455,6.172-.69a5.191,5.191,0,0,1,5.555,6.629Z" transform="translate(-304.761 -152.837)"/><path class="d" d="M168,248h7.461v27.978H168Z" transform="translate(-151.213 -222.787)"/><path class="c" d="M40,336H77.3v7.461H40Z" transform="translate(-38.135 -300.528)"/><path class="d" d="M333.957,336v3.207L330.52,336Z" transform="translate(-294.787 -300.528)"/><path class="a" d="M2.1,0H40.8a2.1,2.1,0,0,1,2.1,2.1V9.326H0V2.1A2.1,2.1,0,0,1,2.1,0Z" transform="matrix(0.731, 0.682, -0.682, 0.731, 18.641, 4.976)"/><path class="d" d="M0,0H9.326V9.326H0Z" transform="matrix(0.731, 0.682, -0.682, 0.731, 30.912, 16.424)"/><path class="d" d="M286.857,79.389a.931.931,0,0,1-.74-.365l-.615-.8a12.516,12.516,0,0,1-2.528-9,.933.933,0,0,1,1.855.2,10.66,10.66,0,0,0,2.153,7.667l.615.8a.933.933,0,0,1-.739,1.5Z" transform="translate(-252.718 -64.113)"/><path class="c" d="M185.485,178.151l-.039.014a30.78,30.78,0,0,1-12.034,1.906l-2.381-.1,4.092,3.817-1.181,4,3.728-1.206a30.775,30.775,0,0,0,9.833-5.315l.71-.572Z" transform="translate(-153.891 -161.081)"/><path class="d" d="M363.834,194.779a12.51,12.51,0,0,1-6.93-2.1l-.843-.559a.933.933,0,1,1,1.031-1.554l.842.558a10.659,10.659,0,0,0,7.8,1.618.933.933,0,1,1,.328,1.836A12.663,12.663,0,0,1,363.834,194.779Z" transform="translate(-316.982 -171.914)"/><path class="c" d="M275,202.524l-.012.04a30.776,30.776,0,0,0-1.069,12.137l.265,2.369-4.092-3.817-3.909,1.455.945-3.8a30.776,30.776,0,0,1,4.622-10.177l.521-.748Z" transform="translate(-237.949 -180.364)"/><circle class="e" cx="1.865" cy="1.865" r="1.865" transform="translate(10.259 0.032)"/><circle class="f" cx="1.865" cy="1.865" r="1.865" transform="translate(0 21.482)"/><path class="g" d="M36.663,36.663a.933.933,0,0,1-.885-.638l-.048-.143a2.946,2.946,0,0,0-2.8-2.017.933.933,0,1,1,0-1.865A4.808,4.808,0,0,1,37.5,35.292l.048.143a.933.933,0,0,1-.885,1.228Z" transform="translate(-31.067 -31.968)"/><path class="g" d="M79.493,194.438a.929.929,0,0,1-.506-.15l-.185-.12a2.074,2.074,0,0,0-2.192-.047.933.933,0,0,1-.947-1.607,3.929,3.929,0,0,1,4.153.088l.185.12a.933.933,0,0,1-.508,1.716Z" transform="translate(-69.235 -173.283)"/><path class="h" d="M27.751,85.141l2.88,2.644,3.811-.874-1.624,3.556,2.008,3.354-3.884-.446-2.569,2.946L27.6,92.49,24,90.957l3.4-1.922Z" transform="translate(-24 -78.914)"/><path class="h" d="M82.174,227.375l-.959,3.772,2.564,2.928-3.884.254L77.9,237.673l-1.442-3.615-3.8-.862,2.993-2.488-.353-3.876,3.291,2.078Z" transform="translate(-66.992 -204.086)"/><path class="i" d="M300.471,141.9l-5.455-5.09,5.09-5.456a8.342,8.342,0,0,1,5.455,5.09Z" transform="translate(-263.422 -119.737)"/></svg>'}),e("div",{slot:"title",class:"s-loyalty-header-title"},this.loyaltyProgram.prize_promotion_title),e("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},this.loyaltyProgram.prize_promotion_description)),e("salla-tabs",{key:this.tabsKey},this.loyaltyProgram.prizes.map((t=>e("salla-tab-header",{slot:"header",name:t.title},e("span",null,t.title)))),this.loyaltyProgram.prizes.map(((t,a)=>e("salla-tab-content",{slot:"content",name:t.title},e("salla-slider",{class:"s-loyalty-slider",loop:!1,"controls-outer":!0,id:"loyalty-popup-slider-"+a,type:"carousel"},e("div",{slot:"items"},t.items.map((t=>this.prizeItem(t))))))))),"FREE_PRODUCT"===this.activeTabType?.toUpperCase()&&(salla.config.get("store.features")||[]).includes("loyalty-system-v2")?e("a",{href:salla.url.get(""),class:"s-loyalty-program-redeem-btn s-button-element s-button-btn s-button-solid s-button-wide s-button-primary s-button-wrap"},salla.lang.get("pages.loyalty_program.shop_now")):e("salla-button",{disabled:!this.selectedItem,width:"wide",class:"s-loyalty-program-redeem-btn",onClick:()=>this.openConfirmation()},salla.lang.get("pages.loyalty_program.exchange_points"))]:e("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?e("span",{slot:"description"},this.errorMessage):""))]}};r.style='/*!twlt*/.mb-5{margin-bottom:1.25rem}.outline{outline-style:solid}.s-loyalty-placeholder{display:flex;align-items:center;justify-content:center}.s-button-btn{position:relative;display:inline-flex;flex:1 1 0%;user-select:none;flex-direction:row-reverse;align-items:center;justify-content:center;white-space:nowrap;border-radius:var(--s-radius, 0.25rem);border-style:solid;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-btn:hover{opacity:0.8}.s-button-primary{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-button-primary:hover{background-color:var(--color-primary-dark)}.s-button-wrap{pointer-events:none}.s-button-wrap svg{height:1.25rem;width:1.25rem;fill:currentColor}.s-button-element:not(:disabled):not([loading]){pointer-events:auto}.s-button-wide{width:100%}.s-loyalty-prize-item.swiper-slide{margin-left:5px;margin-right:5px;margin-bottom:0.5rem;display:flex;width:calc(33.33% - 10px);min-width:200px;cursor:pointer;flex-direction:column}.s-loyalty-prize-item.swiper-slide>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.75rem * var(--tw-space-y-reverse))}.s-loyalty-prize-item.swiper-slide{overflow:hidden;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));background-size:cover;padding:0px !important;text-align:center;font-size:1.875rem;line-height:2.25rem}.s-loyalty-prize-item-selected{--tw-translate-y:-0.125rem !important;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;border-width:1px;border-style:solid;border-color:var(--color-primary);--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transition-property:all;transition-duration:300ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-loyalty-prize-item-selected .s-loyalty-prize-item-check{display:flex;align-items:center;justify-content:center;border-color:var(--color-primary)}.s-loyalty-prize-item-selected .s-loyalty-prize-item-check>div{height:0.625rem;width:0.625rem;border-radius:9999px;background-color:var(--color-primary)}.s-loyalty-prize-item-image{height:9rem;width:100%;background-size:cover;object-fit:cover}.s-loyalty-prize-item-title{padding-left:0.5rem;padding-right:0.5rem;font-size:1rem;line-height:1.5rem;font-weight:700}.s-loyalty-prize-item-subtitle{padding-left:0.5rem;padding-right:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-loyalty-prize-item-check{position:absolute;height:1rem;width:1rem;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-loyalty-prize-item-check:where([dir="ltr"],[dir="ltr"] *){left:1.25rem}.s-loyalty-prize-item-check:where([dir="rtl"],[dir="rtl"] *){right:1.25rem}.s-loyalty-prize-item-points{margin-top:auto !important;display:flex;width:100%;align-items:center;justify-content:center;border-top-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.75rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary)}.s-loyalty-program-redeem-btn{overflow:hidden;transition-property:all;transition-duration:300ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-loyalty-header{margin-bottom:1.25rem;display:block}@media (max-width: 768px){.s-loyalty-modal .s-modal-body{max-height:100%;overflow-y:scroll}}.s-loyalty-skeleton .s-list-tile-item-content{display:block;width:100%}.s-loyalty-header-icon{position:relative;display:flex;height:6rem;width:6rem;align-items:center;justify-content:center;border-radius:9999px;background-color:#ff9e011a}.s-loyalty-header-icon>img{height:3rem;width:3rem}.s-loyalty-header-title{margin-bottom:0.5rem;font-size:1.25rem;line-height:1.75rem}.s-loyalty-header-subtitle{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-loyalty-activator-icon{display:flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.s-loyalty-activator-icon>svg{fill:#fff}.s-loyalty-confirmation-modal-content .s-placeholder-title{margin-bottom:0.75rem}.s-loyalty-confirmation-modal-content .s-placeholder-icon svg b{--tw-text-opacity:1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.s-loyalty-confirmation-modal-content .s-placeholder-description{padding-left:1.25rem;padding-right:1.25rem}.s-loyalty-confirmation-actions{margin-top:1.25rem;display:flex;align-items:center;justify-content:space-between}.s-loyalty-confirmation-actions>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-loyalty-confirmation-actions{padding:1.25rem;padding-top:0.5rem}.s-loyalty-confirmation-actions:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-loyalty-widget .s-list-tile-item{padding:0px !important}.s-loyalty-widget-icon{display:flex;height:4rem;width:4rem;align-items:center;justify-content:center;border-radius:9999px;background-color:var(--color-primary)}.s-loyalty-widget-icon>svg{width:1.5rem;fill:#fff}.s-loyalty-after-exchange .s-list-tile-item{position:relative;justify-content:space-between;overflow:hidden;border-radius:var(--s-radius, 0.25rem);padding-top:0.75rem;padding-bottom:0.75rem}.s-loyalty-after-exchange .s-list-tile-item::after{pointer-events:none;position:absolute;inset:0px;display:block;height:100%;width:100%;background-color:var(--color-primary);opacity:.08;--tw-content:\'\';content:var(--tw-content)}.s-loyalty-after-exchange .s-list-tile-item .s-list-tile-item-title{font-size:15px}.s-loyalty-after-exchange-reset{height:1.5rem}.s-loyalty-after-exchange-reset button{--tw-border-opacity:1;border-color:rgb(248 113 113 / var(--tw-border-opacity, 1));font-size:15px}.s-loyalty-after-exchange-reset button span{display:flex;--tw-scale-x:.75;--tw-scale-y:.75;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));align-items:center;justify-content:center}.s-loyalty-after-exchange-reset button svg{height:1.5rem !important;width:1.5rem !important;fill:#f87171}.s-loyalty-after-exchange-reset button:hover svg{fill:#fff}.s-loyalty-after-exchange-action{display:flex;align-items:center;justify-content:center}.s-loyalty-placeholder{display:flex;align-items:center;justify-content:center}.s-loyalty-skeleton .s-loyalty-header-subtitle>salla-skeleton{margin-bottom:0.75rem;display:block}.s-loyalty-skeleton .s-loyalty-prize-item-subtitle>salla-skeleton{margin-bottom:0.75rem;display:block}.s-loyalty-skeleton .s-loyalty-header-title{margin-bottom:1.25rem}.s-loyalty-skeleton-cards{display:flex;align-items:center}.s-loyalty-skeleton .s-loyalty-prize-item{position:relative;cursor:unset !important;text-align:center}.s-loyalty-skeleton .s-loyalty-prize-item .s-skeleton-wrapper{margin-left:auto;margin-right:auto}.s-loyalty-skeleton .s-loyalty-prize-item-check{border-width:0px}.s-loyalty-slider{margin-bottom:0.625rem;display:block}.s-loyalty-slider .swiper-wrapper{height:auto !important}.s-loyalty-container{padding:0.625rem}.s-loyalty-points-history-no-content .icon{margin-bottom:1rem;display:flex;height:8rem;width:8rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:3rem;line-height:1;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}';export{r as salla_loyalty}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as e}from"./p-ze9e0dxM.js";const r=class{constructor(e){t(this,e),this.factors=[]}getReviewFactorLabel(t){if(t.label)return t.label;const e=(salla.lang.locale||"ar").startsWith("ar")?["ضعيف","مقبول","جيد","جيد جدا","ممتاز"]:["Poor","Average","Good","Very good","Excellent"],r=[salla.lang.getWithDefault("pages.rating.poor",e[0]),salla.lang.getWithDefault("pages.rating.average",e[1]),salla.lang.getWithDefault("pages.rating.good",e[2]),salla.lang.getWithDefault("pages.rating.very_good",e[3]),salla.lang.getWithDefault("pages.rating.excellent",e[4])],i=Number(t.rating||0);return r[Math.max(1,Math.min(5,Math.round(i)))-1]||""}render(){return this.factors?.length?e("div",{class:"s-comments-item-review-factors"},this.factors.map((t=>e("div",{class:"s-comments-item-review-factor-row"},e("div",{class:"s-comments-item-review-factor-value"},e("span",{class:"s-comments-item-review-factor-label text-left rtl:text-right"},this.getReviewFactorLabel(t)),e("salla-rating-stars",{size:"mini",class:"s-comments-item-review-factor-stars",value:t.rating})),e("span",{class:"s-comments-item-review-factor-name"},t.name))))):null}};r.style='/*!twlt*/:host{display:block}salla-comment-item .s-comments-flex-1{min-width:0}.s-comments-item-review-factors-toggle{display:inline-flex;align-items:center;gap:0.35rem;padding:0;border:0;background:transparent;color:#0f6a7c;font-size:0.9rem;font-weight:500;cursor:pointer}.s-comments-item-review-factors-chevron{line-height:1;transform:rotate(180deg);transition:transform 0.2s ease}.s-comments-item-review-factors-chevron.is-open{transform:rotate(0deg)}.s-comments-item-review-factors{border:1px solid #e8e8e8;background:rgba(255, 255, 255, 0.3);border-radius:0.6rem;width:min(100%, 26rem);max-width:100%;margin:0 0 1rem;padding:0.85rem 1rem}@media (max-width: 767px){.s-comments-item-review-factors{width:100%;padding:0.75rem}}.s-comments-item-review-factor-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;direction:ltr;min-width:0}@media (max-width: 767px){.s-comments-item-review-factor-row{flex-direction:row;align-items:stretch;gap:0.35rem}}.s-comments-item-review-factor-row+.s-comments-item-review-factor-row{margin-top:0.5rem}.s-comments-item-review-factor-label,.s-comments-item-review-factor-name{color:#4b5563;font-size:0.9rem;line-height:1.45}.s-comments-item-review-factor-name{min-width:6.5rem;text-align:end;flex-shrink:0}@media (max-width: 767px){.s-comments-item-review-factor-name{min-width:5rem;text-align:end}}.s-comments-item-review-factor-label{display:inline-block;min-width:4.75rem}@media (max-width: 767px){.s-comments-item-review-factor-label{min-width:0;flex:1 1 auto}}.s-comments-item-review-factor-value{display:inline-flex;align-items:center;gap:0.35rem;min-width:0}@media (max-width: 767px){.s-comments-item-review-factor-value{width:100%;justify-content:space-between;gap:0.25rem}}.s-rating-stars-wrapper{gap:0 !important}.visible{visibility:visible}.relative{position:relative}.mb-4{margin-bottom:1rem}.mt-2{margin-top:0.5rem}.mt-6{margin-top:1.5rem}.block{display:block}.flex{display:flex}.hidden{display:none}.w-auto{width:auto}.flex-row{flex-direction:row}.gap-4{gap:1rem}.text-left{text-align:left}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-button-btn{position:relative;display:inline-flex;flex:1 1 0%;user-select:none;flex-direction:row-reverse;align-items:center;justify-content:center;white-space:nowrap;border-radius:var(--s-radius, 0.25rem);border-style:solid;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-btn:hover{opacity:0.8}.s-button-primary{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-button-primary:hover{background-color:var(--color-primary-dark)}.s-button-text{pointer-events:none;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-loader{margin-left:0.5rem;margin-right:0.5rem;display:flex;align-items:center;justify-content:center;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-button-loader::before{display:inline-block;height:1rem;content:var(--tw-content);width:1rem}@keyframes spin{to{content:var(--tw-content);transform:rotate(360deg)}}.s-button-loader::before{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;border-style:solid;border-top-color:var(--color-primary);border-left-color:var(--color-primary);border-bottom-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-border-opacity:1;border-right-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;margin:0px !important;--tw-translate-y:-50%;--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-comments-item-like-btn{margin-top:0.5rem}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-comments-item-like-btn span svg{height:0.75rem;width:0.75rem}.has-error .s-form-control,.has-error .s-tel-input-control,.has-error .s-datetime-picker-input{border-color:#ff443a;color:#ff443a}.s-ltr{direction:ltr}.s-form-control{display:block;width:100%;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-form-control:focus{border-color:var(--color-primary);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.s-comments-page-container{margin-right:auto;margin-left:auto;width:100%;padding-left:0px;padding-right:0px}.s-comments-container{margin-right:auto;margin-left:auto;width:100%;padding-right:0.5rem;padding-left:0.5rem}.s-comments-title{margin-bottom:0.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}@media (min-width: 640px){.s-comments-title{margin-bottom:1.25rem}}.s-comments-count-label{font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-comments-count-label:is(.dark *){--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-comments-testimonials .s-comments-count-label{margin-bottom:2rem}.s-comments-item-wrapper{font-size:0.875rem;line-height:1.25rem}.s-comments-item-inner{display:flex}.s-comments-item-inner>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.75rem * var(--tw-space-x-reverse));margin-left:calc(0.75rem * calc(1 - var(--tw-space-x-reverse)))}.s-comments-item-inner:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-comments-item{margin-bottom:2rem;display:block;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-bottom:2rem}.s-comments-item:last-child{border-width:0px;padding-bottom:0px}.s-comments-item-admin-wrapper{margin-top:2rem;display:flex}.s-comments-item-admin-wrapper:where([dir="ltr"],[dir="ltr"] *){padding-left:2rem}@media (min-width: 768px){.s-comments-item-admin-wrapper:where([dir="ltr"],[dir="ltr"] *){padding-left:4rem}}.s-comments-item-admin-wrapper:where([dir="rtl"],[dir="rtl"] *){padding-right:2rem}@media (min-width: 768px){.s-comments-item-admin-wrapper:where([dir="rtl"],[dir="rtl"] *){padding-right:4rem}}.s-comments-item-avatar{flex:none}.s-comments-item-avatar-img{height:2.5rem;width:2.5rem;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));object-fit:cover}.s-comments-item-timestamp{display:flex;align-items:center;gap:0.375rem;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-comments-item-timestamp:is(.dark *){--tw-text-opacity:1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.s-comments-item-time{display:block;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1));opacity:0;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-comments-item-time:is(.dark *){--tw-text-opacity:1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.s-comments-item-timestamp:hover span{opacity:1}.s-comments-item-pending-text{margin-top:0.5rem;display:inline-block;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));padding-left:0.625rem;padding-right:0.625rem;padding-top:0.125rem;padding-bottom:0.125rem}.s-comments-item-has-order-check-icon{display:flex;height:1.25rem;width:1.25rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1));font-size:0.75rem;line-height:1rem}.s-comments-item-pinned-icon{display:flex;height:1.25rem;width:1.25rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-comments-item-reply-icon svg{height:1rem;width:1rem;fill:#9ca3af}.s-comments-item-has-order-check-icon svg{height:0.75rem;width:0.75rem}.s-comments-item-pinned-icon i{font-size:0.75rem;line-height:1rem}.s-comments-item-has-order-check-text{margin-top:0.125rem;display:inline-block;--tw-translate-y:-2px;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-comments-item-has-order-check-text:where([dir="ltr"],[dir="ltr"] *){margin-left:0.25rem}.s-comments-item-has-order-check-text:where([dir="rtl"],[dir="rtl"] *){margin-right:0.25rem}.s-comments-item-user-info-name{display:inline-block;--tw-translate-y:-2px;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));font-size:1rem;line-height:1.5rem;font-weight:700}.s-comments-item-user-info-name:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}.s-comments-item-user-info-name:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}.s-comments-item-user-info-name-with-margin{display:inline-block;--tw-translate-y:-2px;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));font-size:1rem;line-height:1.5rem;font-weight:700}.s-comments-item-user-info-name-with-margin:where([dir="ltr"],[dir="ltr"] *){margin-right:2.5rem}.s-comments-item-user-info-name-with-margin:where([dir="rtl"],[dir="rtl"] *){margin-left:2.5rem}.s-comments-item-pinned-icon-with-margin{display:flex;height:1.25rem;width:1.25rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-comments-item-pinned-icon-with-margin:where([dir="ltr"],[dir="ltr"] *){margin-right:2.5rem;margin-left:0.5rem}.s-comments-item-pinned-icon-with-margin:where([dir="rtl"],[dir="rtl"] *){margin-left:2.5rem;margin-right:0.5rem}.s-comments-item-stars{margin-bottom:0.625rem;width:100%}.s-comments-item-stars>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.25rem * var(--tw-space-x-reverse));margin-left:calc(0.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-comments-item-stars{font-size:0.75rem;line-height:1rem}.s-comments-item-stars:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-comments-item-rated-widget{margin-top:0.125rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-comments-item-rated-widget:where([dir="ltr"],[dir="ltr"] *){margin-left:0.25rem}.s-comments-item-rated-widget:where([dir="rtl"],[dir="rtl"] *){margin-right:0.25rem}.s-comments-flex-1{flex:1 1 0%}.s-comments-flex{display:flex}.s-comments-item-user-info{margin-bottom:0.25rem;display:flex;align-items:center}.s-comments-item-user-wrapper{margin-bottom:0.5rem;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between}@media (min-width: 768px){.s-comments-item-user-wrapper{margin-bottom:0px}}.s-comments-item-content{max-width:none;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-comments-item-content:is(.dark *){--tw-text-opacity:1;color:rgb(249 250 251 / var(--tw-text-opacity, 1))}.s-comments-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;padding-top:2.5rem;padding-bottom:5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-comments-placeholder p{padding-top:0.5rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-comments-placeholder span{margin-bottom:1rem;display:flex;height:8rem;width:8rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:3rem;line-height:1;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-comments-placeholder span svg{margin-left:auto;margin-right:auto;height:4rem;width:4rem;fill:#d1d5db;text-align:center}.s-comments-item-like-btn{margin-top:0.5rem}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-comments-item-like-btn span svg{height:0.75rem;width:0.75rem}.s-comments-item-images{margin-top:0.5rem;display:flex;align-items:center;gap:0.75rem}.s-comments-item-images img{height:5rem;width:5rem;cursor:pointer;border-radius:0.375rem;object-fit:cover}@media (min-width: 640px){.s-comments-item-images img{height:120px;width:120px}}.s-comments-item-images-slider{margin-top:1.25rem}.s-comments-item-images-slider .s-modal-close{background-color:transparent}.s-comments-item-images-slider-thumb{height:auto;width:100%;max-width:250px}@media (min-width: 640px){.s-comments-item-images-slider-thumb{width:50%;max-width:320px}}@media (min-width: 768px){.s-comments-item-images-slider-thumb{width:33.333333%}}@media (min-width: 1024px){.s-comments-item-images-slider-thumb{width:25%}}.s-comments-item-images-slider-thumb img{height:100%;width:100%;object-fit:cover}.s-comments-header{margin-top:1.5rem;margin-bottom:1.5rem;display:flex;align-items:center;justify-content:space-between}.s-comments-header:not(.has-total){justify-content:flex-end !important}.s-comments-sort-input{width:10rem}.s-comments-filter-wrapper{display:flex;align-items:center}.s-comments-filter-label{display:none;white-space:nowrap}@media (min-width: 640px){.s-comments-filter-label{display:block}}.s-comments-filter-label:where([dir="ltr"],[dir="ltr"] *){margin-right:0.75rem}.s-comments-filter-label:where([dir="rtl"],[dir="rtl"] *){margin-left:0.75rem}.s-comments-container salla-reviews-summary{margin-top:1.5rem}.s-comments-item-content-container{display:flex;flex-direction:row;align-items:center;gap:0.5rem}.rtl\\:text-right:where([dir="rtl"],[dir="rtl"] *){text-align:right}';export{r as salla_comment_factors}
|
|
4
|
+
import{r as t,h as e}from"./p-DvJClBwJ.js";const r=class{constructor(e){t(this,e),this.factors=[]}getReviewFactorLabel(t){if(t.label)return t.label;const e=(salla.lang.locale||"ar").startsWith("ar")?["ضعيف","مقبول","جيد","جيد جدا","ممتاز"]:["Poor","Average","Good","Very good","Excellent"],r=[salla.lang.getWithDefault("pages.rating.poor",e[0]),salla.lang.getWithDefault("pages.rating.average",e[1]),salla.lang.getWithDefault("pages.rating.good",e[2]),salla.lang.getWithDefault("pages.rating.very_good",e[3]),salla.lang.getWithDefault("pages.rating.excellent",e[4])],i=Number(t.rating||0);return r[Math.max(1,Math.min(5,Math.round(i)))-1]||""}render(){return this.factors?.length?e("div",{class:"s-comments-item-review-factors"},this.factors.map((t=>e("div",{class:"s-comments-item-review-factor-row"},e("div",{class:"s-comments-item-review-factor-value"},e("span",{class:"s-comments-item-review-factor-label text-left rtl:text-right"},this.getReviewFactorLabel(t)),e("salla-rating-stars",{size:"mini",class:"s-comments-item-review-factor-stars",value:t.rating})),e("span",{class:"s-comments-item-review-factor-name"},t.name))))):null}};r.style='/*!twlt*/:host{display:block}salla-comment-item .s-comments-flex-1{min-width:0}.s-comments-item-review-factors-toggle{display:inline-flex;align-items:center;gap:0.35rem;padding:0;border:0;background:transparent;color:#0f6a7c;font-size:0.9rem;font-weight:500;cursor:pointer}.s-comments-item-review-factors-chevron{line-height:1;transform:rotate(180deg);transition:transform 0.2s ease}.s-comments-item-review-factors-chevron.is-open{transform:rotate(0deg)}.s-comments-item-review-factors{border:1px solid #e8e8e8;background:rgba(255, 255, 255, 0.3);border-radius:0.6rem;width:min(100%, 26rem);max-width:100%;margin:0 0 1rem;padding:0.85rem 1rem}@media (max-width: 767px){.s-comments-item-review-factors{width:100%;padding:0.75rem}}.s-comments-item-review-factor-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;direction:ltr;min-width:0}@media (max-width: 767px){.s-comments-item-review-factor-row{flex-direction:row;align-items:stretch;gap:0.35rem}}.s-comments-item-review-factor-row+.s-comments-item-review-factor-row{margin-top:0.5rem}.s-comments-item-review-factor-label,.s-comments-item-review-factor-name{color:#4b5563;font-size:0.9rem;line-height:1.45}.s-comments-item-review-factor-name{min-width:6.5rem;text-align:end;flex-shrink:0}@media (max-width: 767px){.s-comments-item-review-factor-name{min-width:5rem;text-align:end}}.s-comments-item-review-factor-label{display:inline-block;min-width:4.75rem}@media (max-width: 767px){.s-comments-item-review-factor-label{min-width:0;flex:1 1 auto}}.s-comments-item-review-factor-value{display:inline-flex;align-items:center;gap:0.35rem;min-width:0}@media (max-width: 767px){.s-comments-item-review-factor-value{width:100%;justify-content:space-between;gap:0.25rem}}.s-rating-stars-wrapper{gap:0 !important}.visible{visibility:visible}.relative{position:relative}.mb-4{margin-bottom:1rem}.mt-2{margin-top:0.5rem}.mt-6{margin-top:1.5rem}.block{display:block}.flex{display:flex}.hidden{display:none}.w-auto{width:auto}.flex-row{flex-direction:row}.gap-4{gap:1rem}.text-left{text-align:left}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-button-btn{position:relative;display:inline-flex;flex:1 1 0%;user-select:none;flex-direction:row-reverse;align-items:center;justify-content:center;white-space:nowrap;border-radius:var(--s-radius, 0.25rem);border-style:solid;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-btn:hover{opacity:0.8}.s-button-primary{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-button-primary:hover{background-color:var(--color-primary-dark)}.s-button-text{pointer-events:none;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-loader{margin-left:0.5rem;margin-right:0.5rem;display:flex;align-items:center;justify-content:center;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-button-loader::before{display:inline-block;height:1rem;content:var(--tw-content);width:1rem}@keyframes spin{to{content:var(--tw-content);transform:rotate(360deg)}}.s-button-loader::before{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;border-style:solid;border-top-color:var(--color-primary);border-left-color:var(--color-primary);border-bottom-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-border-opacity:1;border-right-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;margin:0px !important;--tw-translate-y:-50%;--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-comments-item-like-btn{margin-top:0.5rem}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-comments-item-like-btn span svg{height:0.75rem;width:0.75rem}.has-error .s-form-control,.has-error .s-tel-input-control,.has-error .s-datetime-picker-input{border-color:#ff443a;color:#ff443a}.s-ltr{direction:ltr}.s-form-control{display:block;width:100%;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-form-control:focus{border-color:var(--color-primary);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.s-comments-page-container{margin-right:auto;margin-left:auto;width:100%;padding-left:0px;padding-right:0px}.s-comments-container{margin-right:auto;margin-left:auto;width:100%;padding-right:0.5rem;padding-left:0.5rem}.s-comments-title{margin-bottom:0.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}@media (min-width: 640px){.s-comments-title{margin-bottom:1.25rem}}.s-comments-count-label{font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-comments-count-label:is(.dark *){--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-comments-testimonials .s-comments-count-label{margin-bottom:2rem}.s-comments-item-wrapper{font-size:0.875rem;line-height:1.25rem}.s-comments-item-inner{display:flex}.s-comments-item-inner>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.75rem * var(--tw-space-x-reverse));margin-left:calc(0.75rem * calc(1 - var(--tw-space-x-reverse)))}.s-comments-item-inner:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-comments-item{margin-bottom:2rem;display:block;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-bottom:2rem}.s-comments-item:last-child{border-width:0px;padding-bottom:0px}.s-comments-item-admin-wrapper{margin-top:2rem;display:flex}.s-comments-item-admin-wrapper:where([dir="ltr"],[dir="ltr"] *){padding-left:2rem}@media (min-width: 768px){.s-comments-item-admin-wrapper:where([dir="ltr"],[dir="ltr"] *){padding-left:4rem}}.s-comments-item-admin-wrapper:where([dir="rtl"],[dir="rtl"] *){padding-right:2rem}@media (min-width: 768px){.s-comments-item-admin-wrapper:where([dir="rtl"],[dir="rtl"] *){padding-right:4rem}}.s-comments-item-avatar{flex:none}.s-comments-item-avatar-img{height:2.5rem;width:2.5rem;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));object-fit:cover}.s-comments-item-timestamp{display:flex;align-items:center;gap:0.375rem;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-comments-item-timestamp:is(.dark *){--tw-text-opacity:1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.s-comments-item-time{display:block;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1));opacity:0;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-comments-item-time:is(.dark *){--tw-text-opacity:1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.s-comments-item-timestamp:hover span{opacity:1}.s-comments-item-pending-text{margin-top:0.5rem;display:inline-block;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));padding-left:0.625rem;padding-right:0.625rem;padding-top:0.125rem;padding-bottom:0.125rem}.s-comments-item-has-order-check-icon{display:flex;height:1.25rem;width:1.25rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1));font-size:0.75rem;line-height:1rem}.s-comments-item-pinned-icon{display:flex;height:1.25rem;width:1.25rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-comments-item-reply-icon svg{height:1rem;width:1rem;fill:#9ca3af}.s-comments-item-has-order-check-icon svg{height:0.75rem;width:0.75rem}.s-comments-item-pinned-icon i{font-size:0.75rem;line-height:1rem}.s-comments-item-has-order-check-text{margin-top:0.125rem;display:inline-block;--tw-translate-y:-2px;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-comments-item-has-order-check-text:where([dir="ltr"],[dir="ltr"] *){margin-left:0.25rem}.s-comments-item-has-order-check-text:where([dir="rtl"],[dir="rtl"] *){margin-right:0.25rem}.s-comments-item-user-info-name{display:inline-block;--tw-translate-y:-2px;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));font-size:1rem;line-height:1.5rem;font-weight:700}.s-comments-item-user-info-name:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}.s-comments-item-user-info-name:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}.s-comments-item-user-info-name-with-margin{display:inline-block;--tw-translate-y:-2px;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));font-size:1rem;line-height:1.5rem;font-weight:700}.s-comments-item-user-info-name-with-margin:where([dir="ltr"],[dir="ltr"] *){margin-right:2.5rem}.s-comments-item-user-info-name-with-margin:where([dir="rtl"],[dir="rtl"] *){margin-left:2.5rem}.s-comments-item-pinned-icon-with-margin{display:flex;height:1.25rem;width:1.25rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-comments-item-pinned-icon-with-margin:where([dir="ltr"],[dir="ltr"] *){margin-right:2.5rem;margin-left:0.5rem}.s-comments-item-pinned-icon-with-margin:where([dir="rtl"],[dir="rtl"] *){margin-left:2.5rem;margin-right:0.5rem}.s-comments-item-stars{margin-bottom:0.625rem;width:100%}.s-comments-item-stars>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.25rem * var(--tw-space-x-reverse));margin-left:calc(0.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-comments-item-stars{font-size:0.75rem;line-height:1rem}.s-comments-item-stars:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-comments-item-rated-widget{margin-top:0.125rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-comments-item-rated-widget:where([dir="ltr"],[dir="ltr"] *){margin-left:0.25rem}.s-comments-item-rated-widget:where([dir="rtl"],[dir="rtl"] *){margin-right:0.25rem}.s-comments-flex-1{flex:1 1 0%}.s-comments-flex{display:flex}.s-comments-item-user-info{margin-bottom:0.25rem;display:flex;align-items:center}.s-comments-item-user-wrapper{margin-bottom:0.5rem;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between}@media (min-width: 768px){.s-comments-item-user-wrapper{margin-bottom:0px}}.s-comments-item-content{max-width:none;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-comments-item-content:is(.dark *){--tw-text-opacity:1;color:rgb(249 250 251 / var(--tw-text-opacity, 1))}.s-comments-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;padding-top:2.5rem;padding-bottom:5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-comments-placeholder p{padding-top:0.5rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-comments-placeholder span{margin-bottom:1rem;display:flex;height:8rem;width:8rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:3rem;line-height:1;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-comments-placeholder span svg{margin-left:auto;margin-right:auto;height:4rem;width:4rem;fill:#d1d5db;text-align:center}.s-comments-item-like-btn{margin-top:0.5rem}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-comments-item-like-btn span svg{height:0.75rem;width:0.75rem}.s-comments-item-images{margin-top:0.5rem;display:flex;align-items:center;gap:0.75rem}.s-comments-item-images img{height:5rem;width:5rem;cursor:pointer;border-radius:0.375rem;object-fit:cover}@media (min-width: 640px){.s-comments-item-images img{height:120px;width:120px}}.s-comments-item-images-slider{margin-top:1.25rem}.s-comments-item-images-slider .s-modal-close{background-color:transparent}.s-comments-item-images-slider-thumb{height:auto;width:100%;max-width:250px}@media (min-width: 640px){.s-comments-item-images-slider-thumb{width:50%;max-width:320px}}@media (min-width: 768px){.s-comments-item-images-slider-thumb{width:33.333333%}}@media (min-width: 1024px){.s-comments-item-images-slider-thumb{width:25%}}.s-comments-item-images-slider-thumb img{height:100%;width:100%;object-fit:cover}.s-comments-header{margin-top:1.5rem;margin-bottom:1.5rem;display:flex;align-items:center;justify-content:space-between}.s-comments-header:not(.has-total){justify-content:flex-end !important}.s-comments-sort-input{width:10rem}.s-comments-filter-wrapper{display:flex;align-items:center}.s-comments-filter-label{display:none;white-space:nowrap}@media (min-width: 640px){.s-comments-filter-label{display:block}}.s-comments-filter-label:where([dir="ltr"],[dir="ltr"] *){margin-right:0.75rem}.s-comments-filter-label:where([dir="rtl"],[dir="rtl"] *){margin-left:0.75rem}.s-comments-container salla-reviews-summary{margin-top:1.5rem}.s-comments-item-content-container{display:flex;flex-direction:row;align-items:center;gap:0.5rem}.rtl\\:text-right:where([dir="rtl"],[dir="rtl"] *){text-align:right}';export{r as salla_comment_factors}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as i}from"./p-
|
|
4
|
+
import{r as e,h as i}from"./p-DvJClBwJ.js";import{G as s}from"./p-OF8QcbMM.js";const l=class{constructor(i){e(this,i),this.minAge=10,this.withCustomFields=!1,this.customFields=[],this.isEditable=!0,this.disableAction=!1,this.isLoading=!0,this.first_name_trans=salla.lang.get("pages.profile.first_name"),this.last_name_trans=salla.lang.get("pages.profile.last_name"),this.birthday_trans=salla.lang.get("pages.profile.birthday"),this.birthday_placeholder_trans=salla.lang.get("pages.profile.birthday_placeholder"),this.gender_trans=salla.lang.get("pages.profile.gender"),this.gender_placeholder_trans=salla.lang.get("pages.profile.gender_placeholder"),this.male_trans=salla.lang.get("pages.profile.male"),this.female_trans=salla.lang.get("pages.profile.female"),this.email_trans=salla.lang.get("common.elements.email"),this.mobile_trans=salla.lang.get("common.elements.mobile"),this.save_btn_trans=salla.lang.get("common.elements.save"),this.drag_and_drop_trans=salla.lang.get("common.uploader.drag_and_drop"),this.browse_trans=salla.lang.get("common.uploader.browse"),this.email_required_trans=salla.lang.get("pages.checkout.email_required"),this.invalid_email_trans=salla.lang.get("pages.error.invalid_value",{attribute:"email"})}connectedCallback(){this.langUnsubscribe=salla.lang.subscribe((()=>{this.first_name_trans=salla.lang.get("pages.profile.first_name"),this.last_name_trans=salla.lang.get("pages.profile.last_name"),this.birthday_trans=salla.lang.get("pages.profile.birthday"),this.birthday_placeholder_trans=salla.lang.get("pages.profile.birthday_placeholder"),this.gender_trans=salla.lang.get("pages.profile.gender"),this.gender_placeholder_trans=salla.lang.get("pages.profile.gender_placeholder"),this.male_trans=salla.lang.get("pages.profile.male"),this.female_trans=salla.lang.get("pages.profile.female"),this.email_trans=salla.lang.get("common.elements.email"),this.mobile_trans=salla.lang.get("common.elements.mobile"),this.save_btn_trans=salla.lang.get("common.elements.save"),this.drag_and_drop_trans=salla.lang.get("common.uploader.drag_and_drop"),this.browse_trans=salla.lang.get("common.uploader.browse"),this.email_required_trans=salla.lang.get("pages.checkout.email_required"),this.invalid_email_trans=salla.lang.get("pages.error.invalid_value",{attribute:"email"})}))}disconnectedCallback(){this.langUnsubscribe?.()}phoneNumberFieldEventHandler(e){e.detail.number?(this.userData.phone.number=Number.parseInt(e.detail.number),this.userData.phone.country=e.detail.country_code,this.disableAction=!1):this.disableAction=!0}handleFieldChange(e,i,s=!1){i.target.value?(this.userData[e]=i.target.value,this.disableAction=!1):s&&(this.disableAction=!0)}handleEmailInput(e,i){const s=document.getElementById("email-error"),l=i.target.value;if(!l)return this.disableAction=!0,void(s.textContent=this.email_required_trans);/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(l)||(this.disableAction=!0,s.textContent=this.invalid_email_trans),s.textContent="",this.userData[e]=l,this.disableAction=!1}submitForm(e){e.preventDefault(),this.disableAction=!0;const i=Object.assign({},this.userData);i.phone=void 0,i.phone=this.userData.phone.number,i.country_code=this.userData.phone.country,salla.api.profile.update(i).finally((()=>{this.disableAction=!1}))}getBirthDateRestriction(){const e=new Date,i=e.getFullYear()-this.minAge;return e.setFullYear(i),e}fetchData(){return this.withCustomFields&&salla.api.profile.getFields().then((e=>{this.customFields=e||[]})),salla.api.profile.info().then((e=>{this.userData=e.data})).finally((()=>{this.isLoading=!1,this.isEditable=!Salla.config.get("store.features").includes("sso-login")}))}renderLoadingSection(){return i("div",{class:"s-user-profile-skeleton-wrapper"},Array.from({length:6},((e,s)=>i("salla-skeleton",{class:"skeleton-item",width:"100%",height:"50px",key:s}))))}componentWillLoad(){Salla.onReady().then((()=>this.fetchData()))}render(){return this.isLoading?this.renderLoadingSection():[i("form",{onSubmit:e=>this.submitForm(e)},i("div",{class:"s-user-profile-wrapper"},i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"first-name",class:"s-user-profile-field-label"},this.first_name_trans),i("input",{disabled:!this.isEditable,type:"text",name:"first_name",value:this.userData.first_name,id:"first-name",required:!0,autocomplete:"first_name",class:"form-input",onChange:e=>this.handleFieldChange("first_name",e)})),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"last-name",class:"s-user-profile-field-label"},this.last_name_trans),i("input",{disabled:!this.isEditable,type:"text",name:"last_name",value:this.userData.last_name,id:"last-name",required:!0,autocomplete:"last_name",class:"form-input",onChange:e=>this.handleFieldChange("last_name",e)})),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"birthday",class:"s-user-profile-field-label"},this.birthday_trans),i("salla-datetime-picker",{disabled:!this.isEditable,dateFormat:"Y-m-d",value:this.userData.birthday,placeholder:this.birthday_placeholder_trans,required:!0,maxDate:this.getBirthDateRestriction(),name:"birthday",onPicked:e=>this.handleFieldChange("birthday",e)})),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"gender",class:"s-user-profile-field-label"},this.gender_trans),i("select",{disabled:!this.isEditable,class:"form-input",name:"gender",required:!0,onChange:e=>this.handleFieldChange("gender",e)},i("option",{value:""},this.gender_placeholder_trans),i("option",{value:s.Male,selected:this.userData.gender===s.Male},this.male_trans),i("option",{value:s.Female,selected:this.userData.gender===s.Female},this.female_trans))),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"email",class:"s-user-profile-field-label"},this.email_trans),i("input",{disabled:!this.isEditable,type:"email",name:"email",value:this.userData.email,id:"email",class:"form-input",required:!0,onInput:e=>this.handleEmailInput("email",e)}),i("p",{id:"email-error",class:"s-user-profile-field-error"})),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"international-mobile",class:"s-user-profile-field-label"},this.mobile_trans),i("salla-tel-input",{disabled:!this.isEditable,name:"international-mobile","country-code":this.userData.phone.country,phone:`${this.userData.phone.number}`,onPhoneEntered:e=>this.phoneNumberFieldEventHandler(e)}))),i("salla-button",{type:"submit",loading:this.disableAction,disabled:this.disableAction||!this.isEditable,"loader-position":"end",class:"s-user-profile-submit"},this.save_btn_trans)),this.customFields.length?i("salla-custom-fields",{fields:this.customFields,isEditable:this.isEditable}):null]}};l.style="/*!twlt*/:host{display:block}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.s-user-profile-wrapper{display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));gap:1.5rem}@media (min-width: 640px){.s-user-profile-wrapper{grid-template-columns:repeat(2, minmax(0, 1fr));gap:2rem}}.s-user-profile-field-label{margin-bottom:0.5rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-user-profile-field-error{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-user-profile-submit{margin-top:1.5rem;width:100%}.s-user-profile-filepond-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-user-profile-filepond-placeholder-icon{margin-bottom:0.25rem}.s-user-profile-filepond-placeholder-icon svg{height:1.5rem;width:1.5rem;fill:#7c8082}.s-user-profile-skeleton-wrapper{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));grid-template-rows:repeat(3, minmax(0, 1fr));gap:3rem}";export{l as salla_user_profile}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as t,h as a,H as s,a as r}from"./p-DvJClBwJ.js";import{I as i}from"./p-OdOOjQZO.js";const e=[{label:"100px",value:"56px"},{label:"72px",value:"64px"},{label:"96px",value:"48px"}],n=class{constructor(a){t(this,a),this.validateForms=!0,this.cartCount=0,this.cartTotal=0,this.cartTotalDiscount=0,this.cartCashbackAmount=0,this.cartSubTotal=0,this.cartOptionsTotal=0,this.cartServiceFees=[],this.cartShippingCost=0,this.cartTaxAmount=0,this.cartHasShipping=!1,this.isOpen=!1,this.isDesktop=!1,this.isLoading=!0,this.feeTip=null,this.showFeeTip=(t,a)=>{const s=a.currentTarget;if(!s)return;const r=s.getBoundingClientRect();this.feeTip={key:t,top:Math.round(r.bottom+8),left:this.clampFeeTipLeft(r.left+r.width/2)},this.bindFeeTipDismiss()},this.hideFeeTip=()=>{this.feeTip=null,this.unbindFeeTipDismiss()},this.originalParent=null,this.originalNextSibling=null,this.bodyObserver=null,this.mediaQueryList=null,this.submitObserver=null,this.isSubmitting=!1,this.feeTipDismissBound=!1,this.mqlChangeHandler=t=>{this.isDesktop=t.matches,this.applyMode()},this.cartEventNames=["cart::details.fetched","cart::updated","cart::latest.fetched","cart::coupon.added","cart::coupon.deleted"],this.cartEventHandler=t=>this.applyCartData(this.extractCart(t)),this.releaseSubmitLoading=()=>{this.submitObserver?.disconnect(),this.submitObserver=null,this.submitObserverTimeout&&(clearTimeout(this.submitObserverTimeout),this.submitObserverTimeout=void 0),this.host.querySelector("#s-cart-summary-card-submit")?.removeAttribute?.("loading")},this.toggleSheet=()=>{this.isDesktop||(this.isOpen=!this.isOpen,this.isOpen||this.hideFeeTip())},this.handleSubmit=async t=>{if(this.isSubmitting)return void t.preventDefault();if(this.isSubmitting=!0,this.validateForms&&!await this.validateCartForms())return t.preventDefault(),salla.notify?.error?.(salla.lang?.get?.("common.messages.required_fields")),void(this.isSubmitting=!1);const a=this.host.querySelector("#s-cart-summary-card-submit");a&&(a.load?.(),this.submitObserver?.disconnect(),this.submitObserverTimeout&&clearTimeout(this.submitObserverTimeout),this.submitObserver=new MutationObserver((()=>{a.hasAttribute("loading")||a.setAttribute("loading","")})),this.submitObserver.observe(a,{attributes:!0,attributeFilter:["loading"]}),this.submitObserverTimeout=window.setTimeout((()=>{this.submitObserver?.disconnect(),this.submitObserver=null,a.removeAttribute?.("loading")}),1e4)),salla.cart?.submit?.(),window.setTimeout((()=>{this.isSubmitting=!1}),1500)}}componentWillLoad(){this.mediaQueryList=window.matchMedia(this.desktopMediaQuery()),this.isDesktop=this.mediaQueryList.matches,this.isDesktop&&(this.isOpen=!0),this.init()}async init(){await salla.onReady(),await salla.lang.onLoaded(),this.loadTranslations(),this.cartEventNames.forEach((t=>salla.event.on(t,this.cartEventHandler))),salla.event.on("cart::submit.failed",this.releaseSubmitLoading),this.fetchCart()}loadTranslations(){this.summaryLabel=salla.lang.get("pages.cart.summary"),this.itemsTotalLabel=salla.lang.get("pages.cart.items_total"),this.itemsTotalNoTaxLabel=salla.lang.get("pages.cart.items_total_without_tax"),this.optionsTotalLabel=salla.lang.get("pages.cart.order_options_total"),this.shippingCostLabel=salla.lang.get("pages.cart.shipping_cost"),this.vatTaxLabel=salla.lang.get("pages.cart.VAT_tax_amount"),this.savedLabel=salla.lang.get("pages.cart.discount"),this.discountBadge=salla.lang.get("pages.cart.saved"),this.cashbackLabel=salla.lang.get("pages.checkout.cashback"),this.finalTotalLabel=salla.lang.get("pages.cart.final_total"),this.pricesTaxedLabel=salla.lang.get("pages.cart.prices_taxed"),this.completeOrderLabel=salla.lang.get("pages.cart.complete_order"),this.openSummaryLabel=salla.lang.get("pages.cart.open_summary"),this.closeSummaryLabel=salla.lang.get("pages.cart.close_summary"),this.minimumLabel=salla.lang.get("pages.cart.minimum"),this.maximumLabel=salla.lang.get("pages.cart.up_to"),this.itemsCountTemplate=salla.lang.get("pages.cart.items_with_count")}num(t){if(null==t)return 0;if("number"==typeof t)return isFinite(t)?t:0;if("string"==typeof t)return parseFloat(t)||0;if("object"==typeof t){if("amount"in t)return this.num(t.amount);if("value"in t)return this.num(t.value);if("formatted"in t)return this.num(t.formatted)}return 0}optionalBound(t){if(null==t||""===t)return null;const a=this.num(t);return Number.isFinite(a)&&a>0?a:null}mapServiceFees(t){return t.flatMap(((t,a)=>{const s=String(t?.title??"").trim(),r=this.num(t?.amount);return!s||r<=0?[]:[{key:String(a),title:s,amount:r,minAmount:this.optionalBound(t?.min_amount??t?.min_service_amount),maxAmount:this.optionalBound(t?.max_amount??t?.max_service_amount)}]}))}plainMoney(t){return this.money(t).replace(/<i[^>]*sicon-sar[^>]*>.*?<\/i>/gi," SAR").replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()}serviceFeeBoundLines(t){const a=[];return null!==t.minAmount&&a.push({label:this.minimumLabel,amount:t.minAmount}),null!==t.maxAmount&&a.push({label:this.maximumLabel,amount:t.maxAmount}),a}clampFeeTipLeft(t){const a=Math.min(220,Math.max(132,window.innerWidth-24))/2,s=12+a,r=window.innerWidth-12-a;return r<=s?Math.round(window.innerWidth/2):Math.round(Math.min(Math.max(t,s),r))}bindFeeTipDismiss(){this.feeTipDismissBound||(window.addEventListener("scroll",this.hideFeeTip,!0),window.addEventListener("resize",this.hideFeeTip),this.feeTipDismissBound=!0)}unbindFeeTipDismiss(){this.feeTipDismissBound&&(window.removeEventListener("scroll",this.hideFeeTip,!0),window.removeEventListener("resize",this.hideFeeTip),this.feeTipDismissBound=!1)}renderServiceFeeBoundsTip(t){const s=this.serviceFeeBoundLines(t);return s.length?a("span",{class:"s-cart-summary-card-fee-tip-wrap",onMouseEnter:a=>this.showFeeTip(t.key,a),onMouseLeave:this.hideFeeTip},a("button",{type:"button",class:"s-cart-summary-card-fee-tip","aria-label":s.map((t=>`${t.label}: ${this.plainMoney(t.amount)}`)).join(", "),innerHTML:i,onFocus:a=>this.showFeeTip(t.key,a),onBlur:this.hideFeeTip})):null}renderFixedFeeTipBubble(){if(!this.feeTip)return null;const t=this.cartServiceFees.find((t=>t.key===this.feeTip.key)),s=t?this.serviceFeeBoundLines(t):[];return s.length?a("span",{class:"s-cart-summary-card-fee-tip-bubble",role:"tooltip",style:{top:`${this.feeTip.top}px`,left:`${this.feeTip.left}px`}},s.map((t=>a("span",{class:"s-cart-summary-card-fee-tip-line",key:t.label},a("span",{class:"s-cart-summary-card-fee-tip-line-label"},t.label),a("span",{class:"s-cart-summary-card-fee-tip-line-value"},this.plainMoney(t.amount)))))):null}breakpointPx(){return 1024}desktopMediaQuery(){return`(min-width: ${this.breakpointPx()}px)`}componentDidLoad(){this.originalParent=this.host.parentElement,this.originalNextSibling=this.host.nextSibling,this.mediaQueryList||(this.mediaQueryList=window.matchMedia(this.desktopMediaQuery()),this.isDesktop=this.mediaQueryList.matches),this.applyMode(),this.mediaQueryList.addEventListener?this.mediaQueryList.addEventListener("change",this.mqlChangeHandler):this.mediaQueryList.addListener(this.mqlChangeHandler)}applyMode(){this.isDesktop?(this.isOpen=!0,this.bodyObserver?.disconnect(),this.bodyObserver=null,this.originalParent&&this.host.parentElement!==this.originalParent&&this.originalParent.insertBefore(this.host,this.originalNextSibling?.parentNode===this.originalParent?this.originalNextSibling:null)):this.pinToBodyEnd()}pinToBodyEnd(){this.host.parentElement===document.body&&document.body.lastElementChild===this.host||document.body.appendChild(this.host),this.bodyObserver||(this.bodyObserver=new MutationObserver((()=>{this.isDesktop||document.body.lastElementChild===this.host||document.body.appendChild(this.host)})),this.bodyObserver.observe(document.body,{childList:!0}))}disconnectedCallback(){Promise.resolve().then((()=>{this.host.isConnected||(this.bodyObserver?.disconnect(),this.submitObserver?.disconnect(),this.submitObserverTimeout&&(clearTimeout(this.submitObserverTimeout),this.submitObserverTimeout=void 0),this.mediaQueryList?.removeEventListener?this.mediaQueryList.removeEventListener("change",this.mqlChangeHandler):this.mediaQueryList?.removeListener(this.mqlChangeHandler),this.mediaQueryList=null,this.unbindFeeTipDismiss(),this.cartEventNames.forEach((t=>salla.event.off(t,this.cartEventHandler))),salla.event.off("cart::submit.failed",this.releaseSubmitLoading))}))}fetchCart(){const t=salla.config?.get?.("page.id"),a=salla.cart?.api?.details?.(t);a&&"function"==typeof a.then?a.then((t=>this.applyCartData(this.extractCart(t)))).catch((()=>this.applyCachedSummary())):this.applyCachedSummary()}applyCachedSummary(){const t=salla.storage?.get?.("cart.summary");t&&"object"==typeof t&&this.applyCartData(t,!1),this.isLoading=!1}extractCart(t){return t?t.data?.cart?t.data.cart:t.cart?t.cart:t:null}applyCartData(t,a){if(!t)return;this.isLoading=!1,void 0!==t.count&&(this.cartCount=this.num(t.count)),void 0!==t.total&&(this.cartTotal=this.num(t.total));const s=t.total_discount??t.discount;void 0!==s&&(this.cartTotalDiscount=this.num(s));const r=a??(void 0!==t.sub_total&&void 0!==t.total);void 0!==t.cashback_amount?this.cartCashbackAmount=this.num(t.cashback_amount):r&&(this.cartCashbackAmount=0),void 0!==t.sub_total&&(this.cartSubTotal=this.num(t.sub_total)),void 0!==t.options_total&&(this.cartOptionsTotal=this.num(t.options_total)),void 0!==t.tax_amount&&(this.cartTaxAmount=this.num(t.tax_amount)),Array.isArray(t.service_fees)?this.cartServiceFees=this.mapServiceFees(t.service_fees):r&&(this.cartServiceFees=[]);const i=!!t.free_shipping_bar?.has_free_shipping;void 0!==t.shipping_cost?this.cartShippingCost=this.num(t.shipping_cost):void 0!==t.real_shipping_cost&&(this.cartShippingCost=i?0:this.num(t.real_shipping_cost)),this.cartHasShipping=this.cartShippingCost>0||!!t.has_shipping}async validateCartForms(){let t=!0;document.querySelectorAll('form[id^="item-"]').forEach((a=>{a.reportValidity()||(t=!1)}));const a=Array.from(document.querySelectorAll('form[id^="item-"] salla-product-options'));for(const s of a)"function"!=typeof s.reportValidity||await s.reportValidity()||(t=!1);return t}decimalPlaces(t){const a=String(t),s=a.indexOf(".");return-1===s||a.includes("e")?0:a.length-s-1}roundToCurrency(t){const a=Math.min(Math.max(2,this.decimalPlaces(this.cartTotal),this.decimalPlaces(this.cartTotalDiscount)),4),s=Math.pow(10,a);return Math.round(t*s)/s}money(t){try{if("undefined"!=typeof salla&&"function"==typeof salla.money)return salla.money(t)}catch(t){}return String(t??0)}getItemsLabel(){return this.itemsCountTemplate?.replace(":count",String(this.cartCount))??""}renderSkeleton(){return a(s,{class:{"s-cart-summary-card":!0,"s-cart-summary-card--loading":!0,"s-cart-summary-card--desktop":this.isDesktop,"s-cart-summary-card--mobile":!this.isDesktop}},this.isDesktop&&a("div",{class:"s-cart-summary-card-sheet-wrap s-cart-summary-card-sheet-wrap--open"},a("div",{class:"s-cart-summary-card-sheet"},a("header",{class:"s-cart-summary-card-sheet-header"},a("h3",{class:"s-cart-summary-card-sheet-title"},a("salla-skeleton",{width:"140px",height:"16px"}))),e.map((({label:t,value:s},r)=>a("div",{class:"s-cart-summary-card-line",key:r},a("salla-skeleton",{width:t,height:"16px"}),a("salla-skeleton",{width:s,height:"16px"})))))),a("div",{class:"s-cart-summary-card-bar"},a("div",{class:"s-cart-summary-card-bar-label"},a("div",{class:"s-cart-summary-card-bar-label-main"},a("salla-skeleton",{width:"90px",height:"16px"}),a("salla-skeleton",{width:"48px",height:"12px"}))),a("div",{class:"s-cart-summary-card-bar-totals"},a("div",{class:"s-cart-summary-card-bar-totals-row"},a("salla-skeleton",{width:"80px",height:"20px"})))),a("div",{class:"s-cart-summary-card-action"},a("salla-skeleton",{width:"100%",height:"44px"})))}render(){if(this.isLoading)return this.renderSkeleton();const t=this.cartTotalDiscount>0,r=this.cartCashbackAmount>0,i=this.cartTaxAmount?this.itemsTotalNoTaxLabel:this.itemsTotalLabel;return a(s,{class:{"s-cart-summary-card":!0,"s-cart-summary-card--open":this.isOpen,"s-cart-summary-card--desktop":this.isDesktop,"s-cart-summary-card--mobile":!this.isDesktop}},a("div",{class:{"s-cart-summary-card-sheet-wrap":!0,"s-cart-summary-card-sheet-wrap--open":this.isOpen},"aria-hidden":this.isOpen?"false":"true"},a("div",{class:"s-cart-summary-card-sheet",style:this.isDesktop?{}:{transform:this.isOpen?"translateY(0)":"translateY(100%)",transition:"transform 0.4s cubic-bezier(0.32, 0.72, 0, 1)"}},a("header",{class:"s-cart-summary-card-sheet-header"},a("h3",{class:"s-cart-summary-card-sheet-title"},this.summaryLabel)),a("div",{class:"s-cart-summary-card-line"},a("span",null,i),a("b",{innerHTML:this.money(this.cartSubTotal)})),this.cartOptionsTotal>0&&a("div",{class:"s-cart-summary-card-line"},a("span",null,this.optionsTotalLabel),a("b",{innerHTML:this.money(this.cartOptionsTotal)})),this.cartServiceFees.map((t=>a("div",{class:"s-cart-summary-card-line",key:t.key},a("span",{class:"s-cart-summary-card-fee-label"},a("span",null,t.title),this.renderServiceFeeBoundsTip(t)),a("b",{innerHTML:this.money(t.amount)})))),this.cartHasShipping&&a("div",{class:"s-cart-summary-card-line"},a("span",null,this.shippingCostLabel),a("b",{innerHTML:this.money(this.cartShippingCost)})),this.cartTaxAmount>0&&a("div",{class:"s-cart-summary-card-line"},a("span",null,this.vatTaxLabel),a("b",{innerHTML:this.money(this.cartTaxAmount)})),t&&a("div",{class:"s-cart-summary-card-line s-cart-summary-card-line--discount"},a("span",null,this.savedLabel),a("b",null,"− ",a("span",{innerHTML:this.money(this.cartTotalDiscount)}))))),a("div",{class:"s-cart-summary-card-bar"},a("div",{class:"s-cart-summary-card-bar-label"},a("div",{class:"s-cart-summary-card-bar-label-main"},a("span",{class:"s-cart-summary-card-bar-label-text"},this.finalTotalLabel),a("span",{class:"s-cart-summary-card-bar-count"},this.getItemsLabel())),this.cartTaxAmount>0&&a("div",{class:"s-cart-summary-card-bar-label-sub"},this.pricesTaxedLabel)),a("div",{class:"s-cart-summary-card-bar-totals"},a("div",{class:"s-cart-summary-card-bar-totals-row"},t&&a("s",{class:"s-cart-summary-card-bar-original"},salla.helpers.number(this.roundToCurrency(this.cartTotal+this.cartTotalDiscount))),a("b",{class:"s-cart-summary-card-bar-total",innerHTML:this.money(this.cartTotal)}),!this.isDesktop&&a("button",{type:"button",class:"s-cart-summary-card-chevron","aria-label":this.isOpen?this.closeSummaryLabel:this.openSummaryLabel,"aria-expanded":this.isOpen?"true":"false",onClick:this.toggleSheet},a("i",{class:"sicon-keyboard_arrow_up s-cart-summary-card-chevron-icon"}))),(t||r)&&a("div",{class:"s-cart-summary-card-bar-savings-badge"},a("span",{"aria-hidden":"true"},"🎉"),a("span",null,t&&a("span",null,this.discountBadge," ",a("span",{innerHTML:this.money(this.cartTotalDiscount)})),t&&r&&" + ",r&&a("span",null,a("span",{innerHTML:this.money(this.cartCashbackAmount)})," ",this.cashbackLabel))))),a("div",{class:"s-cart-summary-card-action"},a("salla-button",{id:"s-cart-summary-card-submit",width:"wide","loader-position":"center",onClick:this.handleSubmit},this.completeOrderLabel)),this.renderFixedFeeTipBubble())}get host(){return r(this)}};n.style='/*!twlt*/@charset "UTF-8";:host{display:block}.s-cart-summary-card-fee-tip-wrap{display:inline-flex;align-items:center}.s-cart-summary-card-fee-tip{appearance:none;border:0;background:transparent;padding:0;outline:none}.s-cart-summary-card-fee-tip svg{width:100%;height:100%;fill:currentColor}.s-cart-summary-card-fee-tip-bubble{position:fixed;transform:translateX(-50%);display:flex;flex-direction:column;gap:6px;min-width:132px;max-width:min(220px, 100vw - 24px);padding:10px 12px;border-radius:8px;background:var(--color-primary);color:var(--color-primary-reverse);line-height:1.35;white-space:nowrap;z-index:1000;pointer-events:none;box-shadow:0 4px 12px rgba(0, 0, 0, 0.15)}.s-cart-summary-card-fee-tip-bubble::after{content:"";position:absolute;bottom:100%;left:50%;transform:translateX(-50%);border:6px solid transparent;border-bottom-color:var(--color-primary)}.s-cart-summary-card-fee-tip-line{display:flex;align-items:baseline;justify-content:space-between;gap:12px;color:var(--color-primary-reverse)}.s-cart-summary-card-fee-tip-line-label{font-size:11px;font-weight:400;opacity:0.72}.s-cart-summary-card-fee-tip-line-value{font-size:13px;font-weight:700}.fixed{position:fixed}.sticky{position:sticky}.block{display:block}.transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.transition{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.\\!btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.\\!btn:hover{opacity:0.8}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.s-cart-summary-card-sheet-title{margin-bottom:0.5rem;flex:1 1 0%;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-cart-summary-card-line{margin-bottom:0.5rem;display:flex;align-items:center;justify-content:space-between;font-size:0.875rem;line-height:1.25rem}.s-cart-summary-card-line>span{--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-cart-summary-card-line b{font-size:1rem;line-height:1.5rem;font-weight:600;--tw-text-opacity:1;color:rgb(51 51 51 / var(--tw-text-opacity, 1))}.s-cart-summary-card-line--discount b{--tw-text-opacity:1 !important;color:rgb(220 38 38 / var(--tw-text-opacity, 1)) !important}.s-cart-summary-card-line--discount b *{--tw-text-opacity:1 !important;color:rgb(220 38 38 / var(--tw-text-opacity, 1)) !important}.s-cart-summary-card-fee-label{display:inline-flex;align-items:center;gap:0.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-cart-summary-card-fee-tip{display:inline-flex;height:0.875rem;width:0.875rem;cursor:pointer;align-items:center;justify-content:center;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-cart-summary-card-bar-label{display:flex;flex-direction:column;gap:0.125rem}.s-cart-summary-card-bar-label-main{display:flex;align-items:baseline;gap:0.375rem}.s-cart-summary-card-bar-label-text{white-space:nowrap;font-size:1rem;line-height:1.5rem;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-cart-summary-card-bar-count{white-space:nowrap;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.s-cart-summary-card-bar-label-sub{font-size:11px;--tw-text-opacity:1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.s-cart-summary-card-bar-totals{display:flex;flex-direction:column;align-items:flex-end;gap:0.375rem}.s-cart-summary-card-bar-totals-row{display:flex;align-items:center;gap:0.375rem}.s-cart-summary-card-bar-total{font-size:1rem;line-height:1.5rem;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-cart-summary-card-bar-original{font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-cart-summary-card-bar-savings-badge{display:inline-flex;width:max-content;align-items:center;gap:0.25rem;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(239 251 246 / var(--tw-bg-opacity, 1));padding-left:0.5rem;padding-right:0.5rem;padding-top:0.125rem;padding-bottom:0.125rem;font-size:11px;font-weight:600;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.s-cart-summary-card-chevron{display:inline-flex;height:1.5rem;width:1.5rem;cursor:pointer;align-items:center;justify-content:center;border-width:0px;background-color:transparent;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));outline:2px solid transparent;outline-offset:2px}.s-cart-summary-card-chevron-icon{display:inline-flex;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-cart-summary-card{display:block;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}@media (max-width: 1023px){.s-cart-summary-card{position:fixed;inset-inline:0;bottom:0;z-index:1;border-radius:24px 24px 0 0;box-shadow:0 -12px 24px -12px rgba(0, 0, 0, 0.12);transition:box-shadow 0.3s ease;padding-bottom:calc(env(safe-area-inset-bottom) + 0.5rem)}}@media (min-width: 1024px){.s-cart-summary-card{position:relative;border-radius:0.5rem;box-shadow:0 2px 6px rgba(0, 0, 0, 0.05);padding:1.25rem 1.5rem;margin-bottom:1.25rem}}@media (max-width: 1023px){.s-cart-summary-card--open{border-radius:0;box-shadow:none}}.s-cart-summary-card-sheet-wrap{display:grid;grid-template-rows:0fr;transition:grid-template-rows 0.4s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.3s ease}@media (max-width: 1023px){.s-cart-summary-card-sheet-wrap{position:absolute;inset-inline:0;bottom:calc(100% - 1px);background:#fff;border-radius:24px 24px 0 0;overflow:hidden;box-shadow:0 -12px 24px -12px rgba(0, 0, 0, 0)}}@media (min-width: 1024px){.s-cart-summary-card-sheet-wrap{grid-template-rows:1fr}}@media (max-width: 1023px){.s-cart-summary-card-sheet-wrap--open{grid-template-rows:1fr;box-shadow:0 -12px 24px -12px rgba(0, 0, 0, 0.12)}}.s-cart-summary-card-sheet{min-height:0;overflow:hidden}@media (max-width: 1023px){.s-cart-summary-card-sheet-wrap--open .s-cart-summary-card-sheet{overflow-y:auto;max-height:70vh;-webkit-overflow-scrolling:touch;padding:0.75rem 1rem 0}}.s-cart-summary-card-sheet-header{display:flex;align-items:center;justify-content:space-between;gap:0.5rem}@media (max-width: 1023px){.s-cart-summary-card-sheet-header{padding-bottom:0.5rem}}.s-cart-summary-card-bar{display:flex;align-items:flex-start;justify-content:space-between;gap:0.75rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}@media (min-width: 1024px){.s-cart-summary-card-bar{margin-top:1rem}}@media (max-width: 1023px){.s-cart-summary-card-bar{padding:0.875rem 1rem 0.5rem;border-radius:24px 24px 0 0}.s-cart-summary-card--open .s-cart-summary-card-bar{padding-top:0;border-radius:0}}@media (min-width: 1024px){.s-cart-summary-card-action{padding-top:1rem}}@media (max-width: 1023px){.s-cart-summary-card-action{padding:0 1rem 0.75rem}}.s-cart-summary-card--open .s-cart-summary-card-chevron-icon{transform:rotate(180deg)}.s-cart-summary-card-action *:focus{outline:none}';export{n as salla_cart_summary_card}
|