@salla.sa/twilight-components 2.14.489 → 2.14.490
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/{filepond-C-1J1qrF.js → filepond-DMNwZGDe.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-B8fUrKqJ.js → filepond-plugin-file-poster-CwJqn9cv.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-BJ4Bw3Ju.js → filepond-plugin-file-validate-size-D8HCq_yt.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-D_Smjf6h.js → filepond-plugin-file-validate-type-DZHIztrf.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-BDZBDL-U.js → filepond-plugin-image-edit-DtW6aab5.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-B68mU2op.js → filepond-plugin-image-exif-orientation-DlHuggE7.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-B2RzZ9r9.js → filepond-plugin-image-preview-rSt0R5Fs.js} +1 -1
- package/dist/cjs/{functions-DdZX56J7.js → functions-Cl4vQLXn.js} +1 -1
- package/dist/cjs/{index-DWea49r_.js → index-CfrGmYJa.js} +17 -5
- package/dist/cjs/{index-B5CW9Xve.js → index-CrTL2nRh.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 +1 -1
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_7.cjs.entry.js +11 -11
- package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +5 -5
- 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 +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +45 -0
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +112 -30
- 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 +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-fulfillment-methods.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 +1 -1
- 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.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
- 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-program.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
- 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_2.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-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.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- 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-options-modal_3.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 +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- 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-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1060 -0
- package/dist/cjs/salla-rating-modal.cjs.entry.js +38 -14
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +127 -0
- package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +6 -6
- package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
- package/dist/cjs/salla-social.cjs.entry.js +2 -2
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +3 -3
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/cjs/shipping-fast-CsqEQE78.js +13 -0
- package/dist/{esm/star-ZT7ehBBk.js → cjs/star-DMzrN05M.js} +4 -2
- package/dist/cjs/{tracked-promise-DNxhV4_1.js → tracked-promise-ClJBjg9o.js} +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-ClijNDRd.js → vanilla-picker-um8NlppX.js} +1 -1
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/salla-comments/salla-comment-factors.js +76 -0
- package/dist/collection/components/salla-comments/salla-comment-item.js +20 -6
- package/dist/collection/components/salla-comments/salla-comments.css +110 -0
- package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +1203 -0
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.css +112 -1
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +33 -2
- package/dist/collection/components/salla-rating-stars/salla-rating-stars.css +34 -1
- package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +117 -16
- package/dist/collection/components/salla-review-factors-tags/helpers.js +86 -0
- package/dist/collection/components/salla-review-factors-tags/interfaces.js +1 -0
- package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.css +41 -0
- package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.js +135 -0
- package/dist/collection/components/salla-reviews/salla-reviews.js +1 -1
- package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
- package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.css +60 -0
- package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.js +12 -2
- package/dist/collection/components/salla-search/salla-search.js +5 -5
- package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.js +4 -4
- package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
- package/dist/collection/components/salla-social/salla-social.js +1 -1
- package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
- package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
- package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
- package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +1 -1
- package/dist/components/index.js +3 -3
- package/dist/components/salla-comment-factors.d.ts +11 -0
- package/dist/components/salla-comment-factors.js +9 -0
- package/dist/components/salla-comment-factors2.js +66 -0
- package/dist/components/salla-comment-item2.js +29 -9
- package/dist/components/salla-comments.js +9 -3
- package/dist/components/salla-rating-modal-v2.d.ts +11 -0
- package/dist/components/salla-rating-modal-v2.js +9 -0
- package/dist/components/salla-rating-modal-v22.js +1149 -0
- package/dist/components/salla-rating-modal.js +49 -19
- package/dist/components/salla-rating-stars2.js +80 -17
- package/dist/components/salla-review-factors-tags.d.ts +11 -0
- package/dist/components/salla-review-factors-tags.js +149 -0
- package/dist/components/salla-reviews-page.js +1 -1
- package/dist/components/salla-reviews-summary2.js +13 -3
- package/dist/components/salla-reviews.js +1 -1
- package/dist/components/salla-search.js +5 -5
- package/dist/components/salla-searchable-dropdown2.js +4 -4
- package/dist/components/salla-skeleton2.js +1 -1
- package/dist/components/salla-social-share2.js +1 -1
- package/dist/components/salla-social.js +1 -1
- package/dist/components/salla-tab-content2.js +1 -1
- package/dist/components/salla-tab-header2.js +1 -1
- package/dist/components/salla-tabs2.js +1 -1
- package/dist/components/salla-tel-input2.js +1 -1
- package/dist/components/salla-tooltip2.js +1 -1
- package/dist/components/salla-user-settings.js +1 -1
- package/dist/components/salla-wishlist-actions.js +1 -1
- package/dist/esm/{filepond-z2hEBvHC.js → filepond-Cg7o_vnN.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-B9sxi6Yz.js → filepond-plugin-file-poster-BJ1q5i_Q.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-HWpVatr_.js → filepond-plugin-file-validate-size-KAp2gG4p.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-SgpUhQB_.js → filepond-plugin-file-validate-type-D6KC6aKt.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-0F90Q6lM.js → filepond-plugin-image-edit-CsviUA8z.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-CXJDp_1v.js → filepond-plugin-image-exif-orientation-DORQxh2z.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-APl1nt4k.js → filepond-plugin-image-preview-DiN_MPtQ.js} +1 -1
- package/dist/esm/{functions-BCdJLPcs.js → functions-ChcWts7Y.js} +1 -1
- package/dist/esm/{index-DNWyGkAx.js → index-DkTbP5UX.js} +17 -5
- package/dist/esm/{index-DhwQVX77.js → index-nv62Rr6s.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 +1 -1
- package/dist/esm/salla-add-product-button_5.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-booking-field_7.entry.js +11 -11
- package/dist/esm/salla-bullet-delivery_2.entry.js +5 -5
- 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 +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +43 -0
- package/dist/esm/salla-comment-form_8.entry.js +112 -30
- 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 +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-fulfillment-methods.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 +1 -1
- 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.entry.js +2 -2
- package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
- package/dist/esm/salla-loyalty-panel.entry.js +3 -3
- 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-program.entry.js +3 -3
- package/dist/esm/salla-loyalty-reward.entry.js +2 -2
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_2.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-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.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- 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-options-modal_3.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- 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-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +1058 -0
- package/dist/esm/salla-rating-modal.entry.js +36 -12
- package/dist/esm/salla-review-factors-tags.entry.js +125 -0
- package/dist/esm/salla-reward-action_4.entry.js +3 -3
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +6 -6
- package/dist/esm/salla-skeleton.entry.js +2 -2
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +2 -2
- package/dist/esm/salla-social.entry.js +2 -2
- package/dist/esm/salla-tab-content_3.entry.js +4 -4
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +2 -2
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +5 -5
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +2 -2
- 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 +2 -2
- package/dist/esm/shipping-fast-lMgMt31Q.js +11 -0
- package/dist/{cjs/star-DGcH7Yso.js → esm/star-CeFAfcTv.js} +2 -4
- package/dist/esm/{tracked-promise-CjtqaGP2.js → tracked-promise-BhGtlRVb.js} +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-DPMDb9SB.js → vanilla-picker-CBI_4fLe.js} +1 -1
- package/dist/twilight/{p-61813e83.entry.js → p-01240db4.entry.js} +1 -1
- package/dist/twilight/{p-90534314.entry.js → p-01cd2407.entry.js} +1 -1
- package/dist/twilight/{p-40407996.entry.js → p-02b365bd.entry.js} +1 -1
- package/dist/twilight/p-03ab9920.entry.js +4 -0
- package/dist/twilight/{p-b5d32897.entry.js → p-03cc6665.entry.js} +1 -1
- package/dist/twilight/{p-f9192741.entry.js → p-0a32b0d6.entry.js} +1 -1
- package/dist/twilight/{p-1aeeb0f0.entry.js → p-0de58301.entry.js} +1 -1
- package/dist/twilight/{p-da66f939.entry.js → p-0e0db003.entry.js} +1 -1
- package/dist/twilight/{p-e9cdcf2f.entry.js → p-0f853d19.entry.js} +1 -1
- package/dist/twilight/{p-991b1e85.entry.js → p-0f859745.entry.js} +1 -1
- package/dist/twilight/{p-26faf85e.entry.js → p-0ff0a5cd.entry.js} +1 -1
- package/dist/twilight/{p-fa5fa155.entry.js → p-111e8bd4.entry.js} +1 -1
- package/dist/twilight/{p-160fc21e.entry.js → p-1182a8df.entry.js} +1 -1
- package/dist/twilight/{p-46cd5ece.entry.js → p-121dc015.entry.js} +1 -1
- package/dist/twilight/{p-1a957d13.entry.js → p-15bc19e7.entry.js} +1 -1
- package/dist/twilight/{p-5171b440.entry.js → p-18dada14.entry.js} +1 -1
- package/dist/twilight/{p-14f8ba23.entry.js → p-1a3e548c.entry.js} +1 -1
- package/dist/twilight/{p-7fb92e0b.entry.js → p-1f43ed62.entry.js} +1 -1
- package/dist/twilight/{p-3e7a3c6e.entry.js → p-2414aef5.entry.js} +1 -1
- package/dist/twilight/{p-3ce46edf.entry.js → p-25bfec19.entry.js} +1 -1
- package/dist/twilight/{p-f14fe365.entry.js → p-26211933.entry.js} +1 -1
- package/dist/twilight/{p-4ab4e5ea.entry.js → p-2656742a.entry.js} +1 -1
- package/dist/twilight/{p-aaf7cbb1.entry.js → p-26594c13.entry.js} +1 -1
- package/dist/twilight/{p-06966ed6.entry.js → p-271b69a0.entry.js} +1 -1
- package/dist/twilight/{p-9fc965a7.entry.js → p-27ae0022.entry.js} +1 -1
- package/dist/twilight/{p-85fc94be.entry.js → p-28318fdf.entry.js} +1 -1
- package/dist/twilight/{p-8fec15f8.entry.js → p-28636b6b.entry.js} +1 -1
- package/dist/twilight/{p-1efc0eed.entry.js → p-2b6f45d9.entry.js} +1 -1
- package/dist/twilight/{p-6852162e.entry.js → p-2bcfed29.entry.js} +1 -1
- package/dist/twilight/{p-082f3913.entry.js → p-2e2d9a86.entry.js} +1 -1
- package/dist/twilight/{p-78f161f2.entry.js → p-31c63840.entry.js} +1 -1
- package/dist/twilight/{p-edc4193f.entry.js → p-38e6442f.entry.js} +1 -1
- package/dist/twilight/p-3956807e.entry.js +4 -0
- package/dist/twilight/{p-6sBYUIya.js → p-495aeIVH.js} +1 -1
- package/dist/twilight/{p-12ccff98.entry.js → p-4b659dd8.entry.js} +1 -1
- package/dist/twilight/{p-43a2f42e.entry.js → p-51be1247.entry.js} +1 -1
- package/dist/twilight/{p-6ab60f90.entry.js → p-556550d6.entry.js} +1 -1
- package/dist/twilight/{p-844c6c1f.entry.js → p-57926552.entry.js} +1 -1
- package/dist/twilight/{p-7a0d2f4d.entry.js → p-583b37a5.entry.js} +1 -1
- package/dist/twilight/{p-c9aa80c3.entry.js → p-5932a5aa.entry.js} +1 -1
- package/dist/twilight/{p-094dcf0c.entry.js → p-5cd89a8e.entry.js} +1 -1
- package/dist/twilight/{p-56365c64.entry.js → p-6c74b5a4.entry.js} +1 -1
- package/dist/twilight/{p-6891f00b.entry.js → p-7092d5e9.entry.js} +1 -1
- package/dist/twilight/{p-b0d5084c.entry.js → p-7331a7d0.entry.js} +1 -1
- package/dist/twilight/{p-de942889.entry.js → p-75b9780f.entry.js} +1 -1
- package/dist/twilight/{p-ed02b506.entry.js → p-75d071f5.entry.js} +1 -1
- package/dist/twilight/{p-5b989746.entry.js → p-78364b26.entry.js} +1 -1
- package/dist/twilight/{p-d3f3eed5.entry.js → p-7869e2b4.entry.js} +1 -1
- package/dist/twilight/{p-24127075.entry.js → p-789ede46.entry.js} +1 -1
- package/dist/twilight/{p-f2e9d83b.entry.js → p-7cb04076.entry.js} +1 -1
- package/dist/twilight/{p-6e7a6f4b.entry.js → p-7fa40598.entry.js} +1 -1
- package/dist/twilight/{p-f8933bd5.entry.js → p-8430e33c.entry.js} +1 -1
- package/dist/twilight/p-8549ed85.entry.js +4 -0
- package/dist/twilight/{p-f6d6dada.entry.js → p-88bc9aff.entry.js} +1 -1
- package/dist/twilight/{p-c4c32432.entry.js → p-8d83987b.entry.js} +1 -1
- package/dist/twilight/{p-9474d525.entry.js → p-956be35f.entry.js} +1 -1
- package/dist/twilight/{p-f2dbde1c.entry.js → p-9c27c468.entry.js} +1 -1
- package/dist/twilight/{p-Ca18LMTl.js → p-B4xPvvKC.js} +1 -1
- package/dist/twilight/{p-C72A7Y44.js → p-Bp81rq7T.js} +1 -1
- package/dist/twilight/{p-ZT7ehBBk.js → p-CeFAfcTv.js} +1 -1
- package/dist/twilight/{p-DJ3ziTwG.js → p-CszkocSp.js} +2 -2
- package/dist/twilight/{p-5wempgCB.js → p-CvcP7d1k.js} +1 -1
- package/dist/twilight/{p-Bw7P5SwX.js → p-D1tp_3zr.js} +1 -1
- package/dist/twilight/{p-BwggHXVj.js → p-D3lg7_WR.js} +1 -1
- package/dist/twilight/{p-DQUSqsnq.js → p-D68AOZPQ.js} +1 -1
- package/dist/twilight/{p-DNWyGkAx.js → p-DkTbP5UX.js} +2 -2
- package/dist/twilight/{p-3c10826c.entry.js → p-a104a885.entry.js} +1 -1
- package/dist/twilight/{p-85c6c44f.entry.js → p-a5310ab5.entry.js} +1 -1
- package/dist/twilight/{p-04a6cb8f.entry.js → p-ab8ffcbf.entry.js} +1 -1
- package/dist/twilight/{p-0a9af711.entry.js → p-acf6a8f0.entry.js} +1 -1
- package/dist/twilight/{p-47dd6817.entry.js → p-ad8111fa.entry.js} +1 -1
- package/dist/twilight/{p-cbc66d20.entry.js → p-af41ebe4.entry.js} +1 -1
- package/dist/twilight/{p-f01c12dc.entry.js → p-b4fc5871.entry.js} +1 -1
- package/dist/twilight/{p-ca028945.entry.js → p-b7916db2.entry.js} +1 -1
- package/dist/twilight/{p-e2da0555.entry.js → p-b87ac43c.entry.js} +1 -1
- package/dist/twilight/{p-338a55c1.entry.js → p-bdca0d7a.entry.js} +1 -1
- package/dist/twilight/{p-6494c6bf.entry.js → p-be44f2e4.entry.js} +1 -1
- package/dist/twilight/{p-5993b7d0.entry.js → p-bf50723d.entry.js} +1 -1
- package/dist/twilight/{p-a965c431.entry.js → p-c0dd76e3.entry.js} +1 -1
- package/dist/twilight/{p-db9dc344.entry.js → p-c3c9b136.entry.js} +1 -1
- package/dist/twilight/{p-d239611f.entry.js → p-c583ab13.entry.js} +1 -1
- package/dist/twilight/p-c71a6e9c.entry.js +4 -0
- package/dist/twilight/{p-ef2d94d3.entry.js → p-c774a729.entry.js} +1 -1
- package/dist/twilight/p-c80b8b30.entry.js +4 -0
- package/dist/twilight/{p-52283d18.entry.js → p-c9dcf28b.entry.js} +1 -1
- package/dist/twilight/{p-C5HojqDY.js → p-cUujZ85s.js} +1 -1
- package/dist/twilight/{p-3f924fc5.entry.js → p-ca1c1c50.entry.js} +2 -2
- package/dist/twilight/{p-9273a620.entry.js → p-cbbfec66.entry.js} +1 -1
- package/dist/twilight/{p-602df9ed.entry.js → p-ce0d56c1.entry.js} +1 -1
- package/dist/twilight/{p-7bbea228.entry.js → p-d0eb0e3d.entry.js} +1 -1
- package/dist/twilight/{p-08641aeb.entry.js → p-d27c3758.entry.js} +1 -1
- package/dist/twilight/p-d617bb3f.entry.js +4 -0
- package/dist/twilight/{p-cee1f87a.entry.js → p-d7633d87.entry.js} +1 -1
- package/dist/twilight/{p-ac7c0ea4.entry.js → p-d981255b.entry.js} +1 -1
- package/dist/twilight/{p-69766916.entry.js → p-d9e7a2a9.entry.js} +1 -1
- package/dist/twilight/{p-02e2f661.entry.js → p-dca909c8.entry.js} +1 -1
- package/dist/twilight/{p-4b17c9a0.entry.js → p-df9267ca.entry.js} +1 -1
- package/dist/twilight/{p-cfc209db.entry.js → p-eba770b4.entry.js} +1 -1
- package/dist/twilight/{p-c84ada78.entry.js → p-ee67787c.entry.js} +1 -1
- package/dist/twilight/{p-0cd023d2.entry.js → p-f303739b.entry.js} +1 -1
- package/dist/twilight/{p-afc451ef.entry.js → p-f834ded2.entry.js} +1 -1
- package/dist/twilight/{p-ab2a5243.entry.js → p-f855ad35.entry.js} +1 -1
- package/dist/twilight/{p-39b8ffcd.entry.js → p-faf369b8.entry.js} +1 -1
- package/dist/twilight/{p-b6cdfd09.entry.js → p-fc26088c.entry.js} +1 -1
- package/dist/twilight/{p-Dp4UckOj.js → p-jgiIvZFz.js} +1 -1
- package/dist/twilight/p-lMgMt31Q.js +4 -0
- package/dist/twilight/{p-CsSICzhL.js → p-qT0_dvbw.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-comments/interfaces.d.ts +6 -0
- package/dist/types/components/salla-comments/salla-comment-factors.d.ts +6 -0
- package/dist/types/components/salla-comments/salla-comment-item.d.ts +3 -0
- package/dist/types/components/salla-comments/salla-comments.d.ts +2 -2
- package/dist/types/components/salla-rating-modal/order-feedback-response.d.ts +32 -0
- package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +151 -0
- package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +5 -1
- package/dist/types/components/salla-rating-stars/salla-rating-stars.d.ts +13 -0
- package/dist/types/components/salla-review-factors-tags/helpers.d.ts +16 -0
- package/dist/types/components/salla-review-factors-tags/interfaces.d.ts +17 -0
- package/dist/types/components/salla-review-factors-tags/salla-review-factors-tags.d.ts +24 -0
- package/dist/types/components/salla-reviews-summary/interfaces.d.ts +5 -0
- package/dist/types/components/salla-reviews-summary/salla-reviews-summary.d.ts +2 -0
- package/dist/types/components.d.ts +114 -2
- package/package.json +5 -5
- package/dist/twilight/p-f12a28f9.entry.js +0 -4
- package/dist/twilight/p-f6205375.entry.js +0 -4
- package/dist/twilight/p-fc676125.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 s,a as i,H as a}from"./p-DNWyGkAx.js";import{S as o}from"./p-D4oPi1Ov.js";import{H as e}from"./p-XnA1YTjA.js";import"./p-CgtvEd63.js";const r=class{constructor(s){t(this,s),this.resolveFn=null,this.rejectFn=null,this.optionsRefs=new Map,this.changeHandler=null,this.submitCallback=null,this.orderOptions=[],this.basePrice=0,this.liveTotal=0,this.isSubmitting=!1,this.sessionId=0,this.paymentMode="default",this.title="",this.subtitle="",this.submitLabel="",this.totalLabel="",this.requiredMessage="",this.handleClose=()=>{this.isSubmitting||(this.rejectFn?.({reason:"dismissed"}),this.resolveFn=null,this.rejectFn=null,this.detachChangeListener(),this.reset())},salla.lang.onLoaded((()=>this.loadTranslations()))}componentWillLoad(){this.loadTranslations()}loadTranslations(){this.title=salla.lang.get("blocks.order_options.title"),this.subtitle=salla.lang.get("blocks.order_options.subtitle"),this.submitLabel=salla.lang.get("blocks.order_options.continue"),this.totalLabel=salla.lang.get("blocks.order_options.total"),this.requiredMessage=salla.lang.get("blocks.order_options.required_message")}async open(t){return this.orderOptions=(Array.isArray(t.orderOptions)?t.orderOptions:[]).map((t=>({...t,details:t.details??[]}))),this.basePrice=Number(t.basePrice)||0,this.liveTotal=this.basePrice+this.seedOptionsPrice(this.orderOptions),this.isSubmitting=!1,this.sessionId++,this.optionsRefs.clear(),this.submitCallback=t.onSubmit??null,this.paymentMode=t.paymentMode??"default",await(this.modal?.open()),this.attachChangeListener(),new Promise(((t,s)=>{this.resolveFn=t,this.rejectFn=s}))}async close(){await(this.modal?.close())}collectOrderOptionsSync(){const t=[];for(const[,s]of this.optionsRefs)s&&s.querySelectorAll('[name^="options["],[name*="[options]["]').forEach((s=>{if(s instanceof HTMLInputElement&&("radio"===s.type||"checkbox"===s.type)&&!s.checked)return;const i=s.name.match(/(?:^|\[)options\]?\[(\d+)\]/);if(!i)return;const a=s.value;if(""===a||null==a)return;const o=Number(a);t.push({id:Number(i[1]),value:Number.isFinite(o)&&a===String(o)?o:a})}));return t}validateSync(){let t=!0;for(const[,s]of this.optionsRefs)s&&s.querySelectorAll("[required]").forEach((s=>{s.disabled||s.closest(".hidden")||"reportValidity"in s&&!s.reportValidity()&&(t=!1)}));return t}seedOptionsPrice(t){let s=0;return t.forEach((t=>{(t.details||[]).forEach((t=>{t.is_selected&&(s+=Number(t.additional_price)||0)}))})),s}attachChangeListener(){this.detachChangeListener(),this.changeHandler=()=>this.recomputeTotal(),salla.event.on("product-options::change",this.changeHandler)}detachChangeListener(){this.changeHandler&&(salla.event.off("product-options::change",this.changeHandler),this.changeHandler=null)}async recomputeTotal(){let t=0;for(const[,s]of this.optionsRefs)s&&(("function"==typeof s.getSelectedOptions?await s.getSelectedOptions():[])||[]).forEach((s=>{t+=Number(s.additional_price)||0}));this.liveTotal=this.basePrice+t}handleSubmit(){if(this.isSubmitting)return;if(!this.validateSync())return void salla.notify?.error?.(this.requiredMessage);this.isSubmitting=!0;const t=this.collectOrderOptionsSync(),s=Math.round(100*this.liveTotal)/100;try{this.submitCallback?.(t,s)}catch(t){salla?.logger?.warn?.("order-options modal onSubmit threw",t)}this.resolveFn?.({orderOptions:t}),this.resolveFn=null,this.rejectFn=null,this.submitCallback=null,this.detachChangeListener(),this.modal?.close().then((()=>this.reset())),this.isSubmitting=!1}reset(){this.orderOptions=[],this.optionsRefs.clear(),this.liveTotal=0}render(){const t=salla.money(Math.round(100*this.liveTotal)/100);return s("salla-modal",{key:"a7b7c31da2f5fd9f5f3ee601052f84e512368cee",ref:t=>this.modal=t,class:"s-order-options-modal-host",width:"md","modal-title":this.title,onModalVisibilityChanged:t=>{t.detail||this.handleClose()}},s("div",{key:"9a44c4dcec6f0e49a65217b1e1e2cd19ccc80c76",class:"s-order-options-modal-body"},s("p",{key:"66c41a32e2130db4dc1aa402a31cfd6d519544b3",class:"s-order-options-modal-subtitle"},this.subtitle),s("div",{key:"fffe868427973b6426b8a2f8f33f48c017dfb7fb",class:"s-order-options-modal-fields"},this.orderOptions.length>0&&s("salla-product-options",{key:this.sessionId,ref:t=>{t&&(this.optionsRefs.set("order-options",t),t.seedSelectedOptions?.())},"product-id":`order-options-${this.orderOptions[0]?.id}`,"unique-key":"order-options",options:JSON.stringify(this.orderOptions),"hide-out-label":"1","no-padding":!0}))),s("div",{key:"36f3a18380f05a8420d4bc32fa643bf596ac16fb",slot:"footer",class:"s-order-options-modal-footer"},"apple-pay"===this.paymentMode?s("div",{class:"s-order-options-modal-apple-pay-wrap"},s("div",{class:"s-order-options-modal-apple-pay-total"},s("span",{class:"s-order-options-modal-apple-pay-label"},this.totalLabel),s("span",{class:"s-order-options-modal-apple-pay-amount",innerHTML:t})),s("apple-pay-button",{locale:salla?.config?.get?.("user.language_code")||"ar",buttonstyle:"black",type:"buy",class:"s-order-options-modal-apple-pay",onClick:()=>this.handleSubmit()})):s("salla-button",{type:"button",color:"primary",fill:"solid",width:"wide",loading:this.isSubmitting,onClick:()=>this.handleSubmit()},s("span",{class:"s-order-options-modal-cta-content"},s("span",{class:"s-order-options-modal-cta-text"},this.submitLabel),s("span",{class:"s-order-options-modal-cta-total",innerHTML:t})))))}get host(){return i(this)}};r.style=".s-order-options-modal-host .s-modal-header-inner,.s-order-options-modal-host .s-modal-header-content,.s-order-options-modal-host .s-modal-title{text-align:start !important}.s-order-options-modal-apple-pay{display:block;width:100%;--apple-pay-button-width:100%;--apple-pay-button-height:44px;--apple-pay-button-border-radius:0.75rem}.s-order-options-modal-apple-pay-wrap{display:flex;flex-direction:column;gap:0.75rem;width:100%}.s-order-options-modal-apple-pay-total{display:flex;align-items:center;justify-content:space-between;gap:0.5rem}.s-order-options-modal-apple-pay-label,.s-order-options-modal-apple-pay-amount{font-size:1.125rem;line-height:1.5rem;font-weight:700;color:#111827}";var l='\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>heart</title>\n<path d="M23.333 2.267c-3.547 0-5.779 1.605-7.333 3.061-1.555-1.456-3.787-3.061-7.333-3.061-5.955 0-8.667 5.045-8.667 9.733 0 8.503 10.147 14.735 15.513 16.841 0.156 0.061 0.321 0.092 0.487 0.092s0.331-0.031 0.487-0.092c5.367-2.107 15.513-8.339 15.513-16.841 0-4.688-2.712-9.733-8.667-9.733zM16 26.161c-5.537-2.309-13.333-7.799-13.333-14.161 0-3.517 1.856-7.067 6-7.067 2.983 0 4.656 1.451 6.384 3.203 0.5 0.508 1.399 0.508 1.899 0 1.728-1.752 3.401-3.203 6.384-3.203 4.144 0 6 3.549 6 7.067 0 6.363-7.796 11.852-13.333 14.161z"></path>\n</svg>\n';const d=class{constructor(s){if(t(this,s),salla.onReady((()=>{this.fitImageHeight=salla.config.get("store.settings.product.fit_type"),salla.wishlist.event.onAdded(((t,s)=>this.toggleFavoriteIcon(!0,s))),salla.wishlist.event.onRemoved(((t,s)=>this.toggleFavoriteIcon(!1,s))),this.placeholder=salla.url.asset(salla.config.get("theme.settings.placeholder"))})),salla.lang.onLoaded((()=>{this.remained=salla.lang.get("pages.products.remained"),this.donationAmount=salla.lang.get("pages.products.donation_amount"),this.startingPrice=salla.lang.get("pages.products.starting_price"),this.addToCart=salla.lang.get("pages.cart.add_to_cart"),this.outOfStock=salla.lang.get("pages.products.out_of_stock")})),this.product)try{this.productData="object"==typeof this.product?this.product:JSON.parse(this.product)}catch(t){salla.log("Bad json passed via product prop")}}initCircleBar(){let t=this.productData.quantity/(this.productData.quantity>100?2*this.productData.quantity:100)*100;this.pie.querySelector(".s-product-card-content-pie-svg-bar").style.strokeDashoffset=100-t}toggleFavoriteIcon(t=!0,s=null){s&&s!==this.productData.id||this.wishlistBtn?.classList.toggle("s-product-card-wishlist-added",t)}isInWishlist(){return salla.storage.get("salla::wishlist",[]).includes(this.productData?.id)}async handleWishlistClick(){const t=this.isInWishlist();this.toggleFavoriteIcon(!t);try{await salla.wishlist.toggle(this.productData.id)}catch{this.toggleFavoriteIcon(t)}}formatDate(t){let s=new Date(t);return`${s.getFullYear()}-${s.getMonth()+1}-${s.getDate()}`}getProductBadge(){return this.productData.promotion_title?s("div",{class:"s-product-card-promotion-title"},this.productData.promotion_title):this.showQuantity&&this.productData?.quantity?s("div",{class:"s-product-card-quantity"},this.remained," ",salla.helpers.number(this.productData?.quantity)):this.showQuantity&&this.productData?.is_out_of_stock?s("div",{class:"s-product-card-out-badge"},this.outOfStock):""}getPriceFormat(t){return t&&0!=t?salla.money(t):salla.config.get("store.settings.product.show_price_as_dash")?"-":""}getProductPrice(){return this.productData.is_on_sale?s("div",{class:"s-product-card-sale-price"},s("h4",{innerHTML:this.getPriceFormat(this.productData.sale_price)}),s("span",{innerHTML:this.getPriceFormat(this.productData?.regular_price)})):this.productData.starting_price?s("div",{class:"s-product-card-starting-price"},s("p",null,this.startingPrice),s("h4",{innerHTML:this.getPriceFormat(this.productData?.starting_price)})):s("h4",{class:"s-product-card-price",innerHTML:this.getPriceFormat(this.productData?.price)})}render(){const t={"s-product-card-entry":!0,"s-product-card-vertical":!this.horizontal&&!this.fullImage&&!this.minimal,"s-product-card-horizontal":this.horizontal&&!this.fullImage&&!this.minimal,"s-product-card-fit-height":this.fitImageHeight&&!this.isSpecial&&!this.fullImage&&!this.minimal,"s-product-card-special":this.isSpecial,"s-product-card-full-image":this.fullImage,"s-product-card-minimal":this.minimal,"s-product-card-compact":this.compact,"s-product-card-donation":this.productData?.donation,"s-product-card-shadow":this.shadowOnHover,"s-product-card-out-of-stock":this.productData?.is_out_of_stock},i=this.productData?.url?{href:this.productData.url,title:`Learn more about ${this.productData?.name}`}:{};return s(a,{key:"0f4b4f64ee342da10905dee73db8a2b4bebdfc9e",id:`product-${this.productData?.id}`,class:t},s("div",{key:"ed5cfb208c6241ca6ccd2c8f2205f76d1f81ca2a",class:this.fullImage?"s-product-card-image-full":"s-product-card-image"},s("a",{key:"865376db3deadd97c23480e9226a50abe9371284",...i},s("img",{key:"ad314a97956853e26b3a3c4ecb9f1d427bf748fb",class:`s-product-card-image-${salla.url.is_placeholder(this.productData?.image?.url)?"contain":this.fitImageHeight?this.fitImageHeight:"cover"} lazy`,src:this.placeholder,alt:this.productData?.image?.alt||this.productData?.name,"data-src":this.productData?.image?.url||this.productData?.thumbnail}),this.fullImage||this.minimal?"":this.getProductBadge()),this.fullImage&&s("a",{key:"eef3edab8f4cc75c385928dcdbd9d29c318b68cc",...i,class:"s-product-card-overlay"}),this.horizontal||this.fullImage?"":s("salla-button",{shape:"icon",fill:"none",color:"light",loading:!1,"aria-label":"Add or remove to wishlist",ref:t=>this.wishlistBtn=t,class:"s-product-card-wishlist-btn animated",onClick:()=>this.handleWishlistClick()},s("span",{innerHTML:l}))),s("div",{key:"208f74738cd81bb68ec63f4fdadedbd9b19e6dad",class:"s-product-card-content"},this.isSpecial&&this.productData?.quantity?s("div",{class:"s-product-card-content-pie",ref:t=>this.pie=t},s("span",null,s("b",null,salla.helpers.number(this.productData?.quantity)),this.remained),s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -1 36 34",class:"s-product-card-content-pie-svg"},s("circle",{cx:"16",cy:"16",r:"15.9155",class:"s-product-card-content-pie-svg-base"}),s("circle",{cx:"16",cy:"16",r:"15.9155",class:"s-product-card-content-pie-svg-bar"}))):"",s("div",{key:"6b00056661ebe29db89377f858bfefda80ed365f",class:{"s-product-card-content-main":!0,"s-product-card-content-extra-padding":this.isSpecial}},s("h3",{key:"a1a7a2d363a009c3254df7728e80f958be76a012",class:"s-product-card-content-title"},s("a",{key:"c3c8a4b862cf6a0b78bafb6f30bd5a04d437257d",...i},this.productData?.name)),this.productData?.subtitle&&!this.minimal?s("p",{class:"s-product-card-content-subtitle"},this.productData?.subtitle):""),!this.productData?.donation||this.minimal||this.fullImage?"":[s("salla-progress-bar",{donation:this.productData?.donation}),s("div",{class:"s-product-card-donation-input"},this.productData?.donation?.can_donate?[s("label",{htmlFor:"donation-amount"},this.donationAmount," ",s("span",null,"*")),s("input",{type:"text",onInput:t=>{salla.helpers.inputDigitsOnly(t.target),this.addBtn.donatingAmount=t.target.value},id:"donation-amount",name:"donating_amount",class:"s-form-control",placeholder:this.donationAmount})]:"")],s("div",{key:"2ab7701aac64f90667627f0a0b3bfc031e30d835",class:{"s-product-card-content-sub":!0,"s-product-card-content-extra-padding":this.isSpecial}},this.getProductPrice(),this.productData?.rating?.stars&&!this.minimal?s("div",{class:"s-product-card-rating"},s("span",{innerHTML:o}),s("span",null,this.productData.rating.stars)):""),this.isSpecial&&this.productData.discount_ends?s("salla-count-down",{date:this.formatDate(this.productData.discount_ends),"end-of-day":!0,boxed:!0,labeled:!0}):"",this.hideAddBtn||this.compact?"":s("div",{class:"s-product-card-content-footer"},s("salla-add-product-button",{fill:"outline",width:"wide",ref:t=>this.addBtn=t,"product-id":this.productData.id,"product-status":this.productData.status,"product-type":this.productData.type},s("slot",{name:"add-to-cart-label"},this.productData.add_to_cart_label)),this.horizontal||this.fullImage?s("salla-button",{shape:"icon",fill:"none",color:"light",loading:!1,ref:t=>this.wishlistBtn=t,"aria-label":"Add or remove to wishlist",class:"s-product-card-wishlist-btn animated",onClick:()=>this.handleWishlistClick(),"data-id":"{{ product.id }}"},s("span",{class:"text-xl",innerHTML:l})):"")),!this.hideAddBtn&&this.compact?s("div",{class:"s-product-card-content-footer"},s("salla-add-product-button",{ref:t=>this.addBtn=t,"product-id":this.productData.id,"product-status":this.productData.status,"product-type":this.productData.type,class:"s-add-product-button-compact"},s("slot",{name:"add-to-cart-label"},this.productData.add_to_cart_label))):"")}componentDidLoad(){document.lazyLoadInstance?.update(this.host.querySelectorAll(".lazy")),this.productData?.quantity&&this.isSpecial&&this.initCircleBar(),!salla.config.isGuest()&&salla.storage.get("salla::wishlist",[]).includes(this.productData?.id)&&this.toggleFavoriteIcon()}static get assetsDirs(){return["assets"]}get host(){return i(this)}};d.style='.s-product-card-image::before{font-family:"sallaicons";content:"\\ec1f" !important}.s-product-card-content-pie-svg circle{transition:stroke-dashoffset 1s linear;-webkit-transition:stroke-dashoffset 1s linear;-moz-transition:stroke-dashoffset 1s linear;-ms-transition:stroke-dashoffset 1s linear;-o-transition:stroke-dashoffset 1s linear;stroke:#E8EDF2;stroke-width:2px;stroke-linecap:round;fill:none}.s-product-card-content-pie-svg-bar{stroke:var(--color-primary) !important;stroke-dasharray:100 100;stroke-dashoffset:100}';const c=class{constructor(s){t(this,s),this.productCardComponent="custom-salla-product-card",this.apiUrl="",this.onWishlistStorageSynced=()=>e.syncWishlistIcons(this.host,`${this.productCardComponent}, salla-product-card`)}componentWillLoad(){return salla.onReady().then((()=>{if(this.includes=e.parseJson(this.includes||this.host.getAttribute("includes")),Array.isArray(this.includes)||(this.includes=null),e.setIncludes(this.includes),this.sourceValueIsValid=!(!this.getSourceValue()&&!this.isSourceWithoutValue()),this.sourceValueIsValid){if(this.hasCustomComponent=!!customElements.get(this.productCardComponent),"json"===this.source)return this.productsData=this.getSourceValue(),void(this.isReady=!0);if("related"!=this.getSource()||salla.config.get("store.settings.product.related_products_enabled"))return salla.api.withoutNotifier((()=>salla.product.api.fetch({source:e.getApiSource(this.getSource()),source_value:this.getSourceValue(),limit:this.limit}))).then((t=>e.injectExtraFieldsToResponse(t))).then((t=>{this.productsData=t.data,this.isReady=!0,t.source=this.getSource(),t.sourceValue=this.getSourceValue(),salla.event.emit("salla-products-slider::products.fetched",t.data)}));this.isReady=!1}else salla.logger.warn(`source-value prop is required for source [${this.getSource()}]`)}))}componentDidRender(){let t=0;const s=setInterval((()=>{this.host.querySelectorAll('[loading="lazy"]')?.forEach((t=>t.removeAttribute("loading"))),t++,t>=10&&clearInterval(s)}),1e3)}connectedCallback(){salla.event.on("wishlist::storage.synced",this.onWishlistStorageSynced)}disconnectedCallback(){salla.event.off("wishlist::storage.synced",this.onWishlistStorageSynced)}async componentDidLoad(){await Salla.hooks.registerComponent("salla-products-slider",this)}onReadyChanged(t){t&&salla.wishlist.api.syncStorageFromServer()}isSourceWithoutValue(){return["offers","latest","sales","top-rated"].includes(this.getSource())}getItemHTML(t){const i="landing-page"===this.getSource();i&&(t.url="");const a=i?void 0:()=>{e.saveProductSource(this.getSource())};if(this.hasCustomComponent&&"custom-salla-product-card"==this.productCardComponent.toLowerCase())return s("div",{class:"s-products-slider-card",onClick:a},s("custom-salla-product-card",{product:t,source:this.getSource(),"source-value":this.getSourceValue()}));if(this.hasCustomComponent){const i=document.createElement(this.productCardComponent);return i.setAttribute("product",JSON.stringify(t)),i.setAttribute("source",this.getSource()),i.setAttribute("source-value",this.getSourceValue()),s("div",{class:"s-products-slider-card",onClick:a,innerHTML:i.outerHTML})}return s("div",{class:"s-products-slider-card",onClick:a},s("salla-product-card",{"show-quantity":i,"hide-add-btn":i,"shadow-on-hover":!0,product:t}))}canRender(){return this.sourceValueIsValid&&this.isReady}getSource(){return e.getProductsSource(this.source)}getSourceValue(){return e.getProductsSourceValue(this.source,this.sourceValue)}render(){if(this.canRender())return s(a,{class:"s-products-slider-wrapper"},s("salla-slider",{class:"s-products-slider-slider",id:this.sliderId||`s-products-slider-${Math.random().toString(36).substr(2,9)}`,...this.sliderProps||{},"auto-play":this.autoplay,type:"carousel","block-title":this.blockTitle,"block-subTitle":this.subTitle,"display-all-url":this.displayAllUrl,sliderConfig:this.sliderConfig?this.sliderConfig:null},s("div",{slot:"items"},this.productsData?.map((t=>this.getItemHTML(t))))))}get host(){return i(this)}static get watchers(){return{isReady:["onReadyChanged"]}}};c.style="";export{r as salla_order_options_modal,d as salla_product_card,c as salla_products_slider}
|
|
4
|
+
import{r as t,h as s,a as i,H as a}from"./p-DkTbP5UX.js";import{S as o}from"./p-D4oPi1Ov.js";import{H as e}from"./p-XnA1YTjA.js";import"./p-CgtvEd63.js";const r=class{constructor(s){t(this,s),this.resolveFn=null,this.rejectFn=null,this.optionsRefs=new Map,this.changeHandler=null,this.submitCallback=null,this.orderOptions=[],this.basePrice=0,this.liveTotal=0,this.isSubmitting=!1,this.sessionId=0,this.paymentMode="default",this.title="",this.subtitle="",this.submitLabel="",this.totalLabel="",this.requiredMessage="",this.handleClose=()=>{this.isSubmitting||(this.rejectFn?.({reason:"dismissed"}),this.resolveFn=null,this.rejectFn=null,this.detachChangeListener(),this.reset())},salla.lang.onLoaded((()=>this.loadTranslations()))}componentWillLoad(){this.loadTranslations()}loadTranslations(){this.title=salla.lang.get("blocks.order_options.title"),this.subtitle=salla.lang.get("blocks.order_options.subtitle"),this.submitLabel=salla.lang.get("blocks.order_options.continue"),this.totalLabel=salla.lang.get("blocks.order_options.total"),this.requiredMessage=salla.lang.get("blocks.order_options.required_message")}async open(t){return this.orderOptions=(Array.isArray(t.orderOptions)?t.orderOptions:[]).map((t=>({...t,details:t.details??[]}))),this.basePrice=Number(t.basePrice)||0,this.liveTotal=this.basePrice+this.seedOptionsPrice(this.orderOptions),this.isSubmitting=!1,this.sessionId++,this.optionsRefs.clear(),this.submitCallback=t.onSubmit??null,this.paymentMode=t.paymentMode??"default",await(this.modal?.open()),this.attachChangeListener(),new Promise(((t,s)=>{this.resolveFn=t,this.rejectFn=s}))}async close(){await(this.modal?.close())}collectOrderOptionsSync(){const t=[];for(const[,s]of this.optionsRefs)s&&s.querySelectorAll('[name^="options["],[name*="[options]["]').forEach((s=>{if(s instanceof HTMLInputElement&&("radio"===s.type||"checkbox"===s.type)&&!s.checked)return;const i=s.name.match(/(?:^|\[)options\]?\[(\d+)\]/);if(!i)return;const a=s.value;if(""===a||null==a)return;const o=Number(a);t.push({id:Number(i[1]),value:Number.isFinite(o)&&a===String(o)?o:a})}));return t}validateSync(){let t=!0;for(const[,s]of this.optionsRefs)s&&s.querySelectorAll("[required]").forEach((s=>{s.disabled||s.closest(".hidden")||"reportValidity"in s&&!s.reportValidity()&&(t=!1)}));return t}seedOptionsPrice(t){let s=0;return t.forEach((t=>{(t.details||[]).forEach((t=>{t.is_selected&&(s+=Number(t.additional_price)||0)}))})),s}attachChangeListener(){this.detachChangeListener(),this.changeHandler=()=>this.recomputeTotal(),salla.event.on("product-options::change",this.changeHandler)}detachChangeListener(){this.changeHandler&&(salla.event.off("product-options::change",this.changeHandler),this.changeHandler=null)}async recomputeTotal(){let t=0;for(const[,s]of this.optionsRefs)s&&(("function"==typeof s.getSelectedOptions?await s.getSelectedOptions():[])||[]).forEach((s=>{t+=Number(s.additional_price)||0}));this.liveTotal=this.basePrice+t}handleSubmit(){if(this.isSubmitting)return;if(!this.validateSync())return void salla.notify?.error?.(this.requiredMessage);this.isSubmitting=!0;const t=this.collectOrderOptionsSync(),s=Math.round(100*this.liveTotal)/100;try{this.submitCallback?.(t,s)}catch(t){salla?.logger?.warn?.("order-options modal onSubmit threw",t)}this.resolveFn?.({orderOptions:t}),this.resolveFn=null,this.rejectFn=null,this.submitCallback=null,this.detachChangeListener(),this.modal?.close().then((()=>this.reset())),this.isSubmitting=!1}reset(){this.orderOptions=[],this.optionsRefs.clear(),this.liveTotal=0}render(){const t=salla.money(Math.round(100*this.liveTotal)/100);return s("salla-modal",{key:"a7b7c31da2f5fd9f5f3ee601052f84e512368cee",ref:t=>this.modal=t,class:"s-order-options-modal-host",width:"md","modal-title":this.title,onModalVisibilityChanged:t=>{t.detail||this.handleClose()}},s("div",{key:"9a44c4dcec6f0e49a65217b1e1e2cd19ccc80c76",class:"s-order-options-modal-body"},s("p",{key:"66c41a32e2130db4dc1aa402a31cfd6d519544b3",class:"s-order-options-modal-subtitle"},this.subtitle),s("div",{key:"fffe868427973b6426b8a2f8f33f48c017dfb7fb",class:"s-order-options-modal-fields"},this.orderOptions.length>0&&s("salla-product-options",{key:this.sessionId,ref:t=>{t&&(this.optionsRefs.set("order-options",t),t.seedSelectedOptions?.())},"product-id":`order-options-${this.orderOptions[0]?.id}`,"unique-key":"order-options",options:JSON.stringify(this.orderOptions),"hide-out-label":"1","no-padding":!0}))),s("div",{key:"36f3a18380f05a8420d4bc32fa643bf596ac16fb",slot:"footer",class:"s-order-options-modal-footer"},"apple-pay"===this.paymentMode?s("div",{class:"s-order-options-modal-apple-pay-wrap"},s("div",{class:"s-order-options-modal-apple-pay-total"},s("span",{class:"s-order-options-modal-apple-pay-label"},this.totalLabel),s("span",{class:"s-order-options-modal-apple-pay-amount",innerHTML:t})),s("apple-pay-button",{locale:salla?.config?.get?.("user.language_code")||"ar",buttonstyle:"black",type:"buy",class:"s-order-options-modal-apple-pay",onClick:()=>this.handleSubmit()})):s("salla-button",{type:"button",color:"primary",fill:"solid",width:"wide",loading:this.isSubmitting,onClick:()=>this.handleSubmit()},s("span",{class:"s-order-options-modal-cta-content"},s("span",{class:"s-order-options-modal-cta-text"},this.submitLabel),s("span",{class:"s-order-options-modal-cta-total",innerHTML:t})))))}get host(){return i(this)}};r.style=".s-order-options-modal-host .s-modal-header-inner,.s-order-options-modal-host .s-modal-header-content,.s-order-options-modal-host .s-modal-title{text-align:start !important}.s-order-options-modal-apple-pay{display:block;width:100%;--apple-pay-button-width:100%;--apple-pay-button-height:44px;--apple-pay-button-border-radius:0.75rem}.s-order-options-modal-apple-pay-wrap{display:flex;flex-direction:column;gap:0.75rem;width:100%}.s-order-options-modal-apple-pay-total{display:flex;align-items:center;justify-content:space-between;gap:0.5rem}.s-order-options-modal-apple-pay-label,.s-order-options-modal-apple-pay-amount{font-size:1.125rem;line-height:1.5rem;font-weight:700;color:#111827}";var l='\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>heart</title>\n<path d="M23.333 2.267c-3.547 0-5.779 1.605-7.333 3.061-1.555-1.456-3.787-3.061-7.333-3.061-5.955 0-8.667 5.045-8.667 9.733 0 8.503 10.147 14.735 15.513 16.841 0.156 0.061 0.321 0.092 0.487 0.092s0.331-0.031 0.487-0.092c5.367-2.107 15.513-8.339 15.513-16.841 0-4.688-2.712-9.733-8.667-9.733zM16 26.161c-5.537-2.309-13.333-7.799-13.333-14.161 0-3.517 1.856-7.067 6-7.067 2.983 0 4.656 1.451 6.384 3.203 0.5 0.508 1.399 0.508 1.899 0 1.728-1.752 3.401-3.203 6.384-3.203 4.144 0 6 3.549 6 7.067 0 6.363-7.796 11.852-13.333 14.161z"></path>\n</svg>\n';const d=class{constructor(s){if(t(this,s),salla.onReady((()=>{this.fitImageHeight=salla.config.get("store.settings.product.fit_type"),salla.wishlist.event.onAdded(((t,s)=>this.toggleFavoriteIcon(!0,s))),salla.wishlist.event.onRemoved(((t,s)=>this.toggleFavoriteIcon(!1,s))),this.placeholder=salla.url.asset(salla.config.get("theme.settings.placeholder"))})),salla.lang.onLoaded((()=>{this.remained=salla.lang.get("pages.products.remained"),this.donationAmount=salla.lang.get("pages.products.donation_amount"),this.startingPrice=salla.lang.get("pages.products.starting_price"),this.addToCart=salla.lang.get("pages.cart.add_to_cart"),this.outOfStock=salla.lang.get("pages.products.out_of_stock")})),this.product)try{this.productData="object"==typeof this.product?this.product:JSON.parse(this.product)}catch(t){salla.log("Bad json passed via product prop")}}initCircleBar(){let t=this.productData.quantity/(this.productData.quantity>100?2*this.productData.quantity:100)*100;this.pie.querySelector(".s-product-card-content-pie-svg-bar").style.strokeDashoffset=100-t}toggleFavoriteIcon(t=!0,s=null){s&&s!==this.productData.id||this.wishlistBtn?.classList.toggle("s-product-card-wishlist-added",t)}isInWishlist(){return salla.storage.get("salla::wishlist",[]).includes(this.productData?.id)}async handleWishlistClick(){const t=this.isInWishlist();this.toggleFavoriteIcon(!t);try{await salla.wishlist.toggle(this.productData.id)}catch{this.toggleFavoriteIcon(t)}}formatDate(t){let s=new Date(t);return`${s.getFullYear()}-${s.getMonth()+1}-${s.getDate()}`}getProductBadge(){return this.productData.promotion_title?s("div",{class:"s-product-card-promotion-title"},this.productData.promotion_title):this.showQuantity&&this.productData?.quantity?s("div",{class:"s-product-card-quantity"},this.remained," ",salla.helpers.number(this.productData?.quantity)):this.showQuantity&&this.productData?.is_out_of_stock?s("div",{class:"s-product-card-out-badge"},this.outOfStock):""}getPriceFormat(t){return t&&0!=t?salla.money(t):salla.config.get("store.settings.product.show_price_as_dash")?"-":""}getProductPrice(){return this.productData.is_on_sale?s("div",{class:"s-product-card-sale-price"},s("h4",{innerHTML:this.getPriceFormat(this.productData.sale_price)}),s("span",{innerHTML:this.getPriceFormat(this.productData?.regular_price)})):this.productData.starting_price?s("div",{class:"s-product-card-starting-price"},s("p",null,this.startingPrice),s("h4",{innerHTML:this.getPriceFormat(this.productData?.starting_price)})):s("h4",{class:"s-product-card-price",innerHTML:this.getPriceFormat(this.productData?.price)})}render(){const t={"s-product-card-entry":!0,"s-product-card-vertical":!this.horizontal&&!this.fullImage&&!this.minimal,"s-product-card-horizontal":this.horizontal&&!this.fullImage&&!this.minimal,"s-product-card-fit-height":this.fitImageHeight&&!this.isSpecial&&!this.fullImage&&!this.minimal,"s-product-card-special":this.isSpecial,"s-product-card-full-image":this.fullImage,"s-product-card-minimal":this.minimal,"s-product-card-compact":this.compact,"s-product-card-donation":this.productData?.donation,"s-product-card-shadow":this.shadowOnHover,"s-product-card-out-of-stock":this.productData?.is_out_of_stock},i=this.productData?.url?{href:this.productData.url,title:`Learn more about ${this.productData?.name}`}:{};return s(a,{key:"0f4b4f64ee342da10905dee73db8a2b4bebdfc9e",id:`product-${this.productData?.id}`,class:t},s("div",{key:"ed5cfb208c6241ca6ccd2c8f2205f76d1f81ca2a",class:this.fullImage?"s-product-card-image-full":"s-product-card-image"},s("a",{key:"865376db3deadd97c23480e9226a50abe9371284",...i},s("img",{key:"ad314a97956853e26b3a3c4ecb9f1d427bf748fb",class:`s-product-card-image-${salla.url.is_placeholder(this.productData?.image?.url)?"contain":this.fitImageHeight?this.fitImageHeight:"cover"} lazy`,src:this.placeholder,alt:this.productData?.image?.alt||this.productData?.name,"data-src":this.productData?.image?.url||this.productData?.thumbnail}),this.fullImage||this.minimal?"":this.getProductBadge()),this.fullImage&&s("a",{key:"eef3edab8f4cc75c385928dcdbd9d29c318b68cc",...i,class:"s-product-card-overlay"}),this.horizontal||this.fullImage?"":s("salla-button",{shape:"icon",fill:"none",color:"light",loading:!1,"aria-label":"Add or remove to wishlist",ref:t=>this.wishlistBtn=t,class:"s-product-card-wishlist-btn animated",onClick:()=>this.handleWishlistClick()},s("span",{innerHTML:l}))),s("div",{key:"208f74738cd81bb68ec63f4fdadedbd9b19e6dad",class:"s-product-card-content"},this.isSpecial&&this.productData?.quantity?s("div",{class:"s-product-card-content-pie",ref:t=>this.pie=t},s("span",null,s("b",null,salla.helpers.number(this.productData?.quantity)),this.remained),s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -1 36 34",class:"s-product-card-content-pie-svg"},s("circle",{cx:"16",cy:"16",r:"15.9155",class:"s-product-card-content-pie-svg-base"}),s("circle",{cx:"16",cy:"16",r:"15.9155",class:"s-product-card-content-pie-svg-bar"}))):"",s("div",{key:"6b00056661ebe29db89377f858bfefda80ed365f",class:{"s-product-card-content-main":!0,"s-product-card-content-extra-padding":this.isSpecial}},s("h3",{key:"a1a7a2d363a009c3254df7728e80f958be76a012",class:"s-product-card-content-title"},s("a",{key:"c3c8a4b862cf6a0b78bafb6f30bd5a04d437257d",...i},this.productData?.name)),this.productData?.subtitle&&!this.minimal?s("p",{class:"s-product-card-content-subtitle"},this.productData?.subtitle):""),!this.productData?.donation||this.minimal||this.fullImage?"":[s("salla-progress-bar",{donation:this.productData?.donation}),s("div",{class:"s-product-card-donation-input"},this.productData?.donation?.can_donate?[s("label",{htmlFor:"donation-amount"},this.donationAmount," ",s("span",null,"*")),s("input",{type:"text",onInput:t=>{salla.helpers.inputDigitsOnly(t.target),this.addBtn.donatingAmount=t.target.value},id:"donation-amount",name:"donating_amount",class:"s-form-control",placeholder:this.donationAmount})]:"")],s("div",{key:"2ab7701aac64f90667627f0a0b3bfc031e30d835",class:{"s-product-card-content-sub":!0,"s-product-card-content-extra-padding":this.isSpecial}},this.getProductPrice(),this.productData?.rating?.stars&&!this.minimal?s("div",{class:"s-product-card-rating"},s("span",{innerHTML:o}),s("span",null,this.productData.rating.stars)):""),this.isSpecial&&this.productData.discount_ends?s("salla-count-down",{date:this.formatDate(this.productData.discount_ends),"end-of-day":!0,boxed:!0,labeled:!0}):"",this.hideAddBtn||this.compact?"":s("div",{class:"s-product-card-content-footer"},s("salla-add-product-button",{fill:"outline",width:"wide",ref:t=>this.addBtn=t,"product-id":this.productData.id,"product-status":this.productData.status,"product-type":this.productData.type},s("slot",{name:"add-to-cart-label"},this.productData.add_to_cart_label)),this.horizontal||this.fullImage?s("salla-button",{shape:"icon",fill:"none",color:"light",loading:!1,ref:t=>this.wishlistBtn=t,"aria-label":"Add or remove to wishlist",class:"s-product-card-wishlist-btn animated",onClick:()=>this.handleWishlistClick(),"data-id":"{{ product.id }}"},s("span",{class:"text-xl",innerHTML:l})):"")),!this.hideAddBtn&&this.compact?s("div",{class:"s-product-card-content-footer"},s("salla-add-product-button",{ref:t=>this.addBtn=t,"product-id":this.productData.id,"product-status":this.productData.status,"product-type":this.productData.type,class:"s-add-product-button-compact"},s("slot",{name:"add-to-cart-label"},this.productData.add_to_cart_label))):"")}componentDidLoad(){document.lazyLoadInstance?.update(this.host.querySelectorAll(".lazy")),this.productData?.quantity&&this.isSpecial&&this.initCircleBar(),!salla.config.isGuest()&&salla.storage.get("salla::wishlist",[]).includes(this.productData?.id)&&this.toggleFavoriteIcon()}static get assetsDirs(){return["assets"]}get host(){return i(this)}};d.style='.s-product-card-image::before{font-family:"sallaicons";content:"\\ec1f" !important}.s-product-card-content-pie-svg circle{transition:stroke-dashoffset 1s linear;-webkit-transition:stroke-dashoffset 1s linear;-moz-transition:stroke-dashoffset 1s linear;-ms-transition:stroke-dashoffset 1s linear;-o-transition:stroke-dashoffset 1s linear;stroke:#E8EDF2;stroke-width:2px;stroke-linecap:round;fill:none}.s-product-card-content-pie-svg-bar{stroke:var(--color-primary) !important;stroke-dasharray:100 100;stroke-dashoffset:100}';const c=class{constructor(s){t(this,s),this.productCardComponent="custom-salla-product-card",this.apiUrl="",this.onWishlistStorageSynced=()=>e.syncWishlistIcons(this.host,`${this.productCardComponent}, salla-product-card`)}componentWillLoad(){return salla.onReady().then((()=>{if(this.includes=e.parseJson(this.includes||this.host.getAttribute("includes")),Array.isArray(this.includes)||(this.includes=null),e.setIncludes(this.includes),this.sourceValueIsValid=!(!this.getSourceValue()&&!this.isSourceWithoutValue()),this.sourceValueIsValid){if(this.hasCustomComponent=!!customElements.get(this.productCardComponent),"json"===this.source)return this.productsData=this.getSourceValue(),void(this.isReady=!0);if("related"!=this.getSource()||salla.config.get("store.settings.product.related_products_enabled"))return salla.api.withoutNotifier((()=>salla.product.api.fetch({source:e.getApiSource(this.getSource()),source_value:this.getSourceValue(),limit:this.limit}))).then((t=>e.injectExtraFieldsToResponse(t))).then((t=>{this.productsData=t.data,this.isReady=!0,t.source=this.getSource(),t.sourceValue=this.getSourceValue(),salla.event.emit("salla-products-slider::products.fetched",t.data)}));this.isReady=!1}else salla.logger.warn(`source-value prop is required for source [${this.getSource()}]`)}))}componentDidRender(){let t=0;const s=setInterval((()=>{this.host.querySelectorAll('[loading="lazy"]')?.forEach((t=>t.removeAttribute("loading"))),t++,t>=10&&clearInterval(s)}),1e3)}connectedCallback(){salla.event.on("wishlist::storage.synced",this.onWishlistStorageSynced)}disconnectedCallback(){salla.event.off("wishlist::storage.synced",this.onWishlistStorageSynced)}async componentDidLoad(){await Salla.hooks.registerComponent("salla-products-slider",this)}onReadyChanged(t){t&&salla.wishlist.api.syncStorageFromServer()}isSourceWithoutValue(){return["offers","latest","sales","top-rated"].includes(this.getSource())}getItemHTML(t){const i="landing-page"===this.getSource();i&&(t.url="");const a=i?void 0:()=>{e.saveProductSource(this.getSource())};if(this.hasCustomComponent&&"custom-salla-product-card"==this.productCardComponent.toLowerCase())return s("div",{class:"s-products-slider-card",onClick:a},s("custom-salla-product-card",{product:t,source:this.getSource(),"source-value":this.getSourceValue()}));if(this.hasCustomComponent){const i=document.createElement(this.productCardComponent);return i.setAttribute("product",JSON.stringify(t)),i.setAttribute("source",this.getSource()),i.setAttribute("source-value",this.getSourceValue()),s("div",{class:"s-products-slider-card",onClick:a,innerHTML:i.outerHTML})}return s("div",{class:"s-products-slider-card",onClick:a},s("salla-product-card",{"show-quantity":i,"hide-add-btn":i,"shadow-on-hover":!0,product:t}))}canRender(){return this.sourceValueIsValid&&this.isReady}getSource(){return e.getProductsSource(this.source)}getSourceValue(){return e.getProductsSourceValue(this.source,this.sourceValue)}render(){if(this.canRender())return s(a,{class:"s-products-slider-wrapper"},s("salla-slider",{class:"s-products-slider-slider",id:this.sliderId||`s-products-slider-${Math.random().toString(36).substr(2,9)}`,...this.sliderProps||{},"auto-play":this.autoplay,type:"carousel","block-title":this.blockTitle,"block-subTitle":this.subTitle,"display-all-url":this.displayAllUrl,sliderConfig:this.sliderConfig?this.sliderConfig:null},s("div",{slot:"items"},this.productsData?.map((t=>this.getItemHTML(t))))))}get host(){return i(this)}static get watchers(){return{isReady:["onReadyChanged"]}}};c.style="";export{r as salla_order_options_modal,d as salla_product_card,c as salla_products_slider}
|
|
@@ -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,a as e}from"./p-DNWyGkAx.js";const a=class{constructor(t){s(this,t),this.menuOpen=!1,this.hasProducts=!1,this.specificMode=!1,this.selectedIds=[],this.loadedProductCount=0,this.isSharing=!1,this.shareUrl="",this.isListSyncPaused=!1,this.translationDefaults={"pages.wishlist.share":{ar:"شارك",en:"Share"},"pages.wishlist.share_all":{ar:"مشاركة القائمة",en:"Share the list"},"pages.wishlist.share_specific":{ar:"مشاركة منتجات محددة",en:"Share specific items"},"pages.wishlist.share_list_title":{ar:"مشاركة قائمة الأمنيات",en:"Share wishlist"},"pages.wishlist.select_all":{ar:"تحديد الكل",en:"Select all"},"common.elements.cancel":{ar:"إلغاء",en:"Cancel"}},this.onSelectionChanged=s=>{this.selectedIds=s?.ids||[],this.shareUrl="",this.socialShare?.close(),this.syncLoadedProductCount()},this.onDocumentClick=s=>{this.menuOpen&&!this.host.contains(s.target)&&(this.menuOpen=!1)},this.onProductsFetched=s=>{"wishlist"===s?.source&&(this.isListSyncPaused=!1,this.syncHasProducts(!!s?.data?.length),this.syncLoadedProductCount())}}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),this.registerTranslationDefaults(),this.loadTranslations(),Salla.event.on("salla-products-list::selection.changed",this.onSelectionChanged),Salla.event.on("salla-products-list::products.fetched",this.onProductsFetched),document.addEventListener("click",this.onDocumentClick)}componentDidLoad(){this.initPageTitleAlignment(),this.productsList=this.host.parentElement?.querySelector("salla-products-list"),this.productsList?(this.syncHasProducts(),this.productsObserver=new MutationObserver((()=>{this.syncHasProducts()})),this.productsObserver.observe(this.productsList,{childList:!0,subtree:!0})):Salla.logger?.warn?.("[salla-wishlist-actions] no sibling salla-products-list found")}disconnectedCallback(){Salla.event.off("salla-products-list::selection.changed",this.onSelectionChanged),Salla.event.off("salla-products-list::products.fetched",this.onProductsFetched),document.removeEventListener("click",this.onDocumentClick),this.productsObserver?.disconnect(),this.pageTitleObserver?.disconnect(),this.pageTitleRetryTimeout&&window.clearTimeout(this.pageTitleRetryTimeout),this.resetPageTitleAlignment()}initPageTitleAlignment(){if(this.syncPageTitleAlignment(),this.pageTitle)return;requestAnimationFrame((()=>this.syncPageTitleAlignment())),this.pageTitleRetryTimeout=window.setTimeout((()=>this.syncPageTitleAlignment()),300);const s=this.host.closest(".main-content")??this.host.parentElement;s&&!this.pageTitle&&(this.pageTitleObserver=new MutationObserver((()=>{this.pageTitle?this.pageTitleObserver?.disconnect():(this.syncPageTitleAlignment(),this.pageTitle&&this.pageTitleObserver?.disconnect())})),this.pageTitleObserver.observe(s,{childList:!0,subtree:!0}))}findPageTitle(){const s=this.host.parentElement;if(s)for(const t of Array.from(s.children)){if(t===this.host)break;if("H1"===t.tagName)return t;const s=t.querySelector("h1");if(s)return s}const t=this.host.closest(".main-content");if(t){const s=t.querySelector("h1");if(s&&!this.host.contains(s))return s}return document.querySelector(".main-content h1, main h1")}syncPageTitleAlignment(){if(this.pageTitle)return;const s=this.findPageTitle();s&&(this.pageTitle=s,s.classList.add(a.pageTitleClass))}resetPageTitleAlignment(){this.pageTitle?.classList.remove(a.pageTitleClass),this.pageTitle=void 0}registerTranslationDefaults(){const s=Object.entries(this.translationDefaults).reduce(((s,[t,i])=>(Salla.lang.get(t)===t&&(s[t]=i),s)),{});Object.keys(s).length&&Salla.lang.addBulk(s)}loadTranslations(){this.shareLabel=Salla.lang.get("pages.wishlist.share"),this.shareAllLabel=Salla.lang.get("pages.wishlist.share_all"),this.shareSpecificLabel=Salla.lang.get("pages.wishlist.share_specific"),this.selectAllLabel=Salla.lang.get("pages.wishlist.select_all"),this.cancelLabel=Salla.lang.get("common.elements.cancel"),this.shareModalTitle=Salla.lang.get("pages.wishlist.share_list_title")}get selectedCount(){return this.selectedIds.length}get isAllSelected(){return this.loadedProductCount>0&&this.selectedCount===this.loadedProductCount}get isPartiallySelected(){return this.selectedCount>0&&this.selectedCount<this.loadedProductCount}async syncLoadedProductCount(){if(!this.productsList)return void(this.loadedProductCount=0);if(this.isListSyncPaused&&this.specificMode)return;const s=await this.productsList.getLoadedProducts();this.loadedProductCount=s.length}syncSelectAllCheckboxState(){this.selectAllCheckbox&&(this.selectAllCheckbox.checked=this.isAllSelected,this.selectAllCheckbox.indeterminate=this.isPartiallySelected)}componentDidRender(){this.syncSelectAllCheckboxState()}pauseListSync(){this.isListSyncPaused=!0,window.setTimeout((()=>{this.isListSyncPaused&&(this.isListSyncPaused=!1,this.syncHasProducts())}),3e3)}async syncHasProducts(s){if(!this.isListSyncPaused||"boolean"==typeof s){if("boolean"==typeof s)this.hasProducts=s;else if(this.productsList){const s=await this.productsList.getLoadedProducts();if(0===s.length&&this.specificMode)return;this.hasProducts=s.length>0,this.loadedProductCount=s.length}else this.hasProducts=!1,this.loadedProductCount=0;this.hasProducts||(this.menuOpen=!1,this.specificMode&&await this.cancelSpecific())}}toggleMenu(){this.hasProducts&&(this.menuOpen=!this.menuOpen)}async toggleSelectAll(){this.productsList&&(this.isAllSelected?await this.productsList.clearSelection():await this.productsList.selectAll())}async shareSpecific(){this.menuOpen=!1,this.specificMode=!0,this.pauseListSync(),this.productsList&&(this.productsList.selectable=!0)}async cancelSpecific(){this.specificMode=!1,this.selectedIds=[],this.pauseListSync(),this.productsList&&(await this.productsList.clearSelection(),this.productsList.selectable=!1)}async shareAll(){this.menuOpen=!1,await this.processShare([],!0)}async shareSelected(){this.selectedCount&&await this.processShare(this.selectedIds,!1)}async processShare(s,t=!1){if((t||s?.length)&&!this.isSharing){this.isSharing=!0;try{const i=await salla.wishlist.share(s,t),e=i?.data?.url||i?.url||"";if(!e||!this.socialShare)return;this.shareUrl=e,this.socialShare.url=e,await this.socialShare.refresh(),await this.socialShare.open()}catch(s){Salla.logger?.warn?.("[salla-wishlist-actions] share failed",s)}finally{this.isSharing=!1}}}render(){return t(i,{key:"6329ecd00f2d08cd0fc485c371e98fe7984502d0"},t("div",{key:"6e24cd1109ae290196337fe3e1e05cfd074966a9",class:"s-wishlist-actions"},t("div",{key:"82c29d5b203368059c7883272c36576b19bdfd2d",class:"s-wishlist-actions-bar flex items-center justify-end gap-3 mb-3"},t("div",{key:"3f85ad6a6e72308b71d506d2fc8687672b00ea7a",class:"s-wishlist-actions-dropdown relative"},t("salla-button",{key:"56c109a338bc9fa06aebdadb041b6587440fa71a",color:"primary",fill:"outline",type:"button",disabled:!this.hasProducts,"aria-haspopup":"true","aria-expanded":this.menuOpen?"true":"false",onClick:()=>this.toggleMenu()},t("div",{key:"f0cf0dc66dd8ce00ac878481bbf21662d1853eba",class:"flex flex-row justify-center items-center gap-2"},t("svg",{key:"3b97ef84df832a0bc1198319cc63b753da915b37",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 32 32",style:{width:"16px",height:"16px"}},t("path",{key:"e8c626812dad32a5fc3165b58ce76a5c39586f09",d:"M26.667 21.333c-1.699 0-3.196 0.812-4.173 2.052l-11.912-5.211c0.044-0.276 0.085-0.553 0.085-0.841 0-0.472-0.081-0.923-0.197-1.359l12.361-6.952c0.971 1.009 2.328 1.644 3.836 1.644 2.941 0 5.333-2.392 5.333-5.333s-2.392-5.333-5.333-5.333-5.333 2.392-5.333 5.333c0 0.472 0.081 0.923 0.197 1.359l-12.361 6.952c-0.971-1.009-2.328-1.644-3.836-1.644-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333c1.699 0 3.196-0.812 4.173-2.052l11.912 5.211c-0.044 0.276-0.085 0.553-0.085 0.841 0 2.941 2.392 5.333 5.333 5.333s5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM26.667 2.667c1.471 0 2.667 1.196 2.667 2.667s-1.196 2.667-2.667 2.667-2.667-1.196-2.667-2.667 1.196-2.667 2.667-2.667zM5.333 20c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667zM26.667 29.333c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"})),this.shareLabel,t("svg",{key:"731093a2d4393fe53d63e96ecc48fcb4c4a360d2",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 32 32",style:{width:"16px",height:"16px"}},t("path",{key:"af87c9481389b4b1e544e0ab2eac43db6c164aac",d:"M26.212 10.996c-0.556-0.484-1.396-0.428-1.881 0.127l-8.331 9.519-8.331-9.52c-0.485-0.555-1.327-0.611-1.881-0.125s-0.609 1.328-0.124 1.881l9.333 10.667c0.253 0.291 0.617 0.456 1.003 0.456s0.749-0.165 1.003-0.456l9.333-10.667c0.485-0.553 0.429-1.396-0.124-1.881z"})))),this.menuOpen&&t("ul",{key:"62ce5ade389fb563d2548fd94939f697dbc03d8a",class:"s-wishlist-actions-menu absolute z-20 mt-1 bg-white rounded-lg shadow overflow-hidden"},t("li",{key:"7cb443687290ce4c7144b71140b68c020bb52dd4"},t("button",{key:"d55410bb2f164d267a9c21af2648fbef3fdc1928",type:"button",class:"s-wishlist-actions-menu-item",onClick:()=>this.shareAll()},this.shareAllLabel)),t("li",{key:"f921f5241b0e7b7ebb228049f84dfe3996081d92"},t("button",{key:"dbc903542086266571c21ada73d54dab62f5a3e2",type:"button",class:"s-wishlist-actions-menu-item",onClick:()=>this.shareSpecific()},this.shareSpecificLabel)))),t("salla-social-share",{key:"0e3aec575c1b4aa4cdd5bb2c61f3cc3e90687f23",class:"s-wishlist-actions-social",ref:s=>this.socialShare=s,url:this.shareUrl,mode:"modal",modalTitle:this.shareModalTitle},t("span",{key:"bafce0670b980b583398b3d1a997020298e35bed",slot:"widget",class:"s-wishlist-actions-social-anchor","aria-hidden":"true"}))),this.specificMode&&t("div",{key:"216cd3409541b0f93b26e2f2bfe256a36d0ff37b",class:"s-wishlist-actions-panel flex items-center justify-between gap-4 flex-wrap p-4 mt-3 mb-3 bg-white rounded-lg"},t("label",{key:"4bf9a1cc508bfc87c229f69a7134bdefae0f9535",class:"s-wishlist-actions-panel-select-all flex items-center gap-2 cursor-pointer"},t("input",{key:"fbc39c6513eec5f4b1f281046b509c642ddce3db",type:"checkbox",class:"s-products-list-select-checkbox s-wishlist-actions-select-all",checked:this.isAllSelected,ref:s=>this.selectAllCheckbox=s,"aria-label":this.selectAllLabel,onChange:()=>this.toggleSelectAll()}),t("span",{key:"02ba3b818ecb802d8976734738c8042163b6cdae",class:"s-wishlist-actions-panel-title text-sm font-bold text-gray-700"},this.shareSpecificLabel," (",this.selectedCount,")")),t("div",{key:"447df46aa76c1ecb165b7680465ff6c6dfcc967d",class:"s-wishlist-actions-panel-buttons flex items-center gap-2"},t("salla-button",{key:"36a6360b83dd07d20ca7763e2f12dc93f169c645",class:"s-wishlist-actions-cancel",color:"light",fill:"outline",type:"button",onClick:()=>this.cancelSpecific()},this.cancelLabel),t("salla-button",{key:"3aa46bcd91bf605f7715fcaa5692e4ca0e8f199e",class:"s-wishlist-actions-share",color:"primary",fill:"outline",type:"button",disabled:!this.selectedCount,loading:this.isSharing,onClick:()=>this.shareSelected()},this.shareLabel)))))}get host(){return e(this)}};a.pageTitleClass="s-wishlist-actions-page-title",a.style=':host{display:block}.s-wishlist-actions-menu{min-width:200px;inset-inline-end:0;inset-inline-start:auto;list-style:none;margin:0;padding:4px 0;box-shadow:0 4px 16px rgba(0, 0, 0, 0.12)}.s-wishlist-actions-menu-item{display:block;width:100%;padding:10px 16px;text-align:start;font-size:0.875rem;color:#374151;background:transparent;cursor:pointer;white-space:nowrap}.s-wishlist-actions-menu-item:hover{background-color:#f3f4f6;color:var(--color-primary)}.s-wishlist-actions-panel{box-shadow:0 1px 3px rgba(0, 0, 0, 0.08)}.s-wishlist-actions-panel-select-all{user-select:none}.s-wishlist-actions-select-all:indeterminate,.s-wishlist-actions-select-all:indeterminate:hover,.s-wishlist-actions-select-all:indeterminate:focus{background-color:var(--color-primary);border-color:var(--color-primary)}.s-wishlist-actions-select-all:indeterminate::after{content:"";position:absolute;top:50%;left:50%;width:10px;height:2px;background:#fff;border:none;transform:translate(-50%, -50%)}.s-wishlist-actions-social-anchor{display:none}h1.s-wishlist-actions-page-title{text-align:start !important}';export{a as salla_wishlist_actions}
|
|
4
|
+
import{r as s,h as t,H as i,a as e}from"./p-DkTbP5UX.js";const a=class{constructor(t){s(this,t),this.menuOpen=!1,this.hasProducts=!1,this.specificMode=!1,this.selectedIds=[],this.loadedProductCount=0,this.isSharing=!1,this.shareUrl="",this.isListSyncPaused=!1,this.translationDefaults={"pages.wishlist.share":{ar:"شارك",en:"Share"},"pages.wishlist.share_all":{ar:"مشاركة القائمة",en:"Share the list"},"pages.wishlist.share_specific":{ar:"مشاركة منتجات محددة",en:"Share specific items"},"pages.wishlist.share_list_title":{ar:"مشاركة قائمة الأمنيات",en:"Share wishlist"},"pages.wishlist.select_all":{ar:"تحديد الكل",en:"Select all"},"common.elements.cancel":{ar:"إلغاء",en:"Cancel"}},this.onSelectionChanged=s=>{this.selectedIds=s?.ids||[],this.shareUrl="",this.socialShare?.close(),this.syncLoadedProductCount()},this.onDocumentClick=s=>{this.menuOpen&&!this.host.contains(s.target)&&(this.menuOpen=!1)},this.onProductsFetched=s=>{"wishlist"===s?.source&&(this.isListSyncPaused=!1,this.syncHasProducts(!!s?.data?.length),this.syncLoadedProductCount())}}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),this.registerTranslationDefaults(),this.loadTranslations(),Salla.event.on("salla-products-list::selection.changed",this.onSelectionChanged),Salla.event.on("salla-products-list::products.fetched",this.onProductsFetched),document.addEventListener("click",this.onDocumentClick)}componentDidLoad(){this.initPageTitleAlignment(),this.productsList=this.host.parentElement?.querySelector("salla-products-list"),this.productsList?(this.syncHasProducts(),this.productsObserver=new MutationObserver((()=>{this.syncHasProducts()})),this.productsObserver.observe(this.productsList,{childList:!0,subtree:!0})):Salla.logger?.warn?.("[salla-wishlist-actions] no sibling salla-products-list found")}disconnectedCallback(){Salla.event.off("salla-products-list::selection.changed",this.onSelectionChanged),Salla.event.off("salla-products-list::products.fetched",this.onProductsFetched),document.removeEventListener("click",this.onDocumentClick),this.productsObserver?.disconnect(),this.pageTitleObserver?.disconnect(),this.pageTitleRetryTimeout&&window.clearTimeout(this.pageTitleRetryTimeout),this.resetPageTitleAlignment()}initPageTitleAlignment(){if(this.syncPageTitleAlignment(),this.pageTitle)return;requestAnimationFrame((()=>this.syncPageTitleAlignment())),this.pageTitleRetryTimeout=window.setTimeout((()=>this.syncPageTitleAlignment()),300);const s=this.host.closest(".main-content")??this.host.parentElement;s&&!this.pageTitle&&(this.pageTitleObserver=new MutationObserver((()=>{this.pageTitle?this.pageTitleObserver?.disconnect():(this.syncPageTitleAlignment(),this.pageTitle&&this.pageTitleObserver?.disconnect())})),this.pageTitleObserver.observe(s,{childList:!0,subtree:!0}))}findPageTitle(){const s=this.host.parentElement;if(s)for(const t of Array.from(s.children)){if(t===this.host)break;if("H1"===t.tagName)return t;const s=t.querySelector("h1");if(s)return s}const t=this.host.closest(".main-content");if(t){const s=t.querySelector("h1");if(s&&!this.host.contains(s))return s}return document.querySelector(".main-content h1, main h1")}syncPageTitleAlignment(){if(this.pageTitle)return;const s=this.findPageTitle();s&&(this.pageTitle=s,s.classList.add(a.pageTitleClass))}resetPageTitleAlignment(){this.pageTitle?.classList.remove(a.pageTitleClass),this.pageTitle=void 0}registerTranslationDefaults(){const s=Object.entries(this.translationDefaults).reduce(((s,[t,i])=>(Salla.lang.get(t)===t&&(s[t]=i),s)),{});Object.keys(s).length&&Salla.lang.addBulk(s)}loadTranslations(){this.shareLabel=Salla.lang.get("pages.wishlist.share"),this.shareAllLabel=Salla.lang.get("pages.wishlist.share_all"),this.shareSpecificLabel=Salla.lang.get("pages.wishlist.share_specific"),this.selectAllLabel=Salla.lang.get("pages.wishlist.select_all"),this.cancelLabel=Salla.lang.get("common.elements.cancel"),this.shareModalTitle=Salla.lang.get("pages.wishlist.share_list_title")}get selectedCount(){return this.selectedIds.length}get isAllSelected(){return this.loadedProductCount>0&&this.selectedCount===this.loadedProductCount}get isPartiallySelected(){return this.selectedCount>0&&this.selectedCount<this.loadedProductCount}async syncLoadedProductCount(){if(!this.productsList)return void(this.loadedProductCount=0);if(this.isListSyncPaused&&this.specificMode)return;const s=await this.productsList.getLoadedProducts();this.loadedProductCount=s.length}syncSelectAllCheckboxState(){this.selectAllCheckbox&&(this.selectAllCheckbox.checked=this.isAllSelected,this.selectAllCheckbox.indeterminate=this.isPartiallySelected)}componentDidRender(){this.syncSelectAllCheckboxState()}pauseListSync(){this.isListSyncPaused=!0,window.setTimeout((()=>{this.isListSyncPaused&&(this.isListSyncPaused=!1,this.syncHasProducts())}),3e3)}async syncHasProducts(s){if(!this.isListSyncPaused||"boolean"==typeof s){if("boolean"==typeof s)this.hasProducts=s;else if(this.productsList){const s=await this.productsList.getLoadedProducts();if(0===s.length&&this.specificMode)return;this.hasProducts=s.length>0,this.loadedProductCount=s.length}else this.hasProducts=!1,this.loadedProductCount=0;this.hasProducts||(this.menuOpen=!1,this.specificMode&&await this.cancelSpecific())}}toggleMenu(){this.hasProducts&&(this.menuOpen=!this.menuOpen)}async toggleSelectAll(){this.productsList&&(this.isAllSelected?await this.productsList.clearSelection():await this.productsList.selectAll())}async shareSpecific(){this.menuOpen=!1,this.specificMode=!0,this.pauseListSync(),this.productsList&&(this.productsList.selectable=!0)}async cancelSpecific(){this.specificMode=!1,this.selectedIds=[],this.pauseListSync(),this.productsList&&(await this.productsList.clearSelection(),this.productsList.selectable=!1)}async shareAll(){this.menuOpen=!1,await this.processShare([],!0)}async shareSelected(){this.selectedCount&&await this.processShare(this.selectedIds,!1)}async processShare(s,t=!1){if((t||s?.length)&&!this.isSharing){this.isSharing=!0;try{const i=await salla.wishlist.share(s,t),e=i?.data?.url||i?.url||"";if(!e||!this.socialShare)return;this.shareUrl=e,this.socialShare.url=e,await this.socialShare.refresh(),await this.socialShare.open()}catch(s){Salla.logger?.warn?.("[salla-wishlist-actions] share failed",s)}finally{this.isSharing=!1}}}render(){return t(i,{key:"944b6422bfba4a6d243866bc9c37d8035a44df5d"},t("div",{key:"4bc2b5c2ff67c4b78b578a434d0b831127ee296e",class:"s-wishlist-actions"},t("div",{key:"89680ee97dfc92640639806f03ff9d5c1e34fe2a",class:"s-wishlist-actions-bar flex items-center justify-end gap-3 mb-3"},t("div",{key:"d4e0df8eb1afaacbae1d19c811b746f861f298c2",class:"s-wishlist-actions-dropdown relative"},t("salla-button",{key:"c8d0932f278391ee8cd8e8c962c807cd4027fbb4",color:"primary",fill:"outline",type:"button",disabled:!this.hasProducts,"aria-haspopup":"true","aria-expanded":this.menuOpen?"true":"false",onClick:()=>this.toggleMenu()},t("div",{key:"b3afc332535ad851c6b4f69bf8857dfc2fe82630",class:"flex flex-row justify-center items-center gap-2"},t("svg",{key:"a71c080825b75616417f3cafca72472e8e51293f",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 32 32",style:{width:"16px",height:"16px"}},t("path",{key:"a1f025824128c9612f28a08d70f32965eac0e24b",d:"M26.667 21.333c-1.699 0-3.196 0.812-4.173 2.052l-11.912-5.211c0.044-0.276 0.085-0.553 0.085-0.841 0-0.472-0.081-0.923-0.197-1.359l12.361-6.952c0.971 1.009 2.328 1.644 3.836 1.644 2.941 0 5.333-2.392 5.333-5.333s-2.392-5.333-5.333-5.333-5.333 2.392-5.333 5.333c0 0.472 0.081 0.923 0.197 1.359l-12.361 6.952c-0.971-1.009-2.328-1.644-3.836-1.644-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333c1.699 0 3.196-0.812 4.173-2.052l11.912 5.211c-0.044 0.276-0.085 0.553-0.085 0.841 0 2.941 2.392 5.333 5.333 5.333s5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM26.667 2.667c1.471 0 2.667 1.196 2.667 2.667s-1.196 2.667-2.667 2.667-2.667-1.196-2.667-2.667 1.196-2.667 2.667-2.667zM5.333 20c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667zM26.667 29.333c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"})),this.shareLabel,t("svg",{key:"9411b9da4d81961bb32a0577b39b429e1c1c965f",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 32 32",style:{width:"16px",height:"16px"}},t("path",{key:"d9a5ae414ddc8b3d73403271b2c36a7562fbf056",d:"M26.212 10.996c-0.556-0.484-1.396-0.428-1.881 0.127l-8.331 9.519-8.331-9.52c-0.485-0.555-1.327-0.611-1.881-0.125s-0.609 1.328-0.124 1.881l9.333 10.667c0.253 0.291 0.617 0.456 1.003 0.456s0.749-0.165 1.003-0.456l9.333-10.667c0.485-0.553 0.429-1.396-0.124-1.881z"})))),this.menuOpen&&t("ul",{key:"827753681d4b785e4881fd2b3b9c0ea9eadc196d",class:"s-wishlist-actions-menu absolute z-20 mt-1 bg-white rounded-lg shadow overflow-hidden"},t("li",{key:"d7db89f5e2d35bf745f4fd452cb253a42abddc92"},t("button",{key:"ed26ea310c9c736721801c5ba3082ee9a5795246",type:"button",class:"s-wishlist-actions-menu-item",onClick:()=>this.shareAll()},this.shareAllLabel)),t("li",{key:"d9dfe8c03c06f0dc2351c97c5fa65afdb21434af"},t("button",{key:"bb6d478be61ebebae69aed968df87f4c674ecea6",type:"button",class:"s-wishlist-actions-menu-item",onClick:()=>this.shareSpecific()},this.shareSpecificLabel)))),t("salla-social-share",{key:"ec9d7848c88d88189aaadd8d142b2d2425d18c77",class:"s-wishlist-actions-social",ref:s=>this.socialShare=s,url:this.shareUrl,mode:"modal",modalTitle:this.shareModalTitle},t("span",{key:"4cc856e9916d823d1eae1f1438ceef27afff61de",slot:"widget",class:"s-wishlist-actions-social-anchor","aria-hidden":"true"}))),this.specificMode&&t("div",{key:"0378d758c20ffb30e43f5c833ea9adc26d62dc56",class:"s-wishlist-actions-panel flex items-center justify-between gap-4 flex-wrap p-4 mt-3 mb-3 bg-white rounded-lg"},t("label",{key:"dbe68424b609667ae57a14e6a7b268e7d3fcb70b",class:"s-wishlist-actions-panel-select-all flex items-center gap-2 cursor-pointer"},t("input",{key:"43933b5d67b6629974d0fdd43731046b83bc8def",type:"checkbox",class:"s-products-list-select-checkbox s-wishlist-actions-select-all",checked:this.isAllSelected,ref:s=>this.selectAllCheckbox=s,"aria-label":this.selectAllLabel,onChange:()=>this.toggleSelectAll()}),t("span",{key:"794e0c0f27cf9a91c351f586bf69be2fd0ebd917",class:"s-wishlist-actions-panel-title text-sm font-bold text-gray-700"},this.shareSpecificLabel," (",this.selectedCount,")")),t("div",{key:"40f84f47845e32eacfb21a1bf937bcd287a869e3",class:"s-wishlist-actions-panel-buttons flex items-center gap-2"},t("salla-button",{key:"42976baa9eb980e26bc93b41d23972c17441aa96",class:"s-wishlist-actions-cancel",color:"light",fill:"outline",type:"button",onClick:()=>this.cancelSpecific()},this.cancelLabel),t("salla-button",{key:"48b182f5d518b7d761f3fe59339755ab78fd1f19",class:"s-wishlist-actions-share",color:"primary",fill:"outline",type:"button",disabled:!this.selectedCount,loading:this.isSharing,onClick:()=>this.shareSelected()},this.shareLabel)))))}get host(){return e(this)}};a.pageTitleClass="s-wishlist-actions-page-title",a.style=':host{display:block}.s-wishlist-actions-menu{min-width:200px;inset-inline-end:0;inset-inline-start:auto;list-style:none;margin:0;padding:4px 0;box-shadow:0 4px 16px rgba(0, 0, 0, 0.12)}.s-wishlist-actions-menu-item{display:block;width:100%;padding:10px 16px;text-align:start;font-size:0.875rem;color:#374151;background:transparent;cursor:pointer;white-space:nowrap}.s-wishlist-actions-menu-item:hover{background-color:#f3f4f6;color:var(--color-primary)}.s-wishlist-actions-panel{box-shadow:0 1px 3px rgba(0, 0, 0, 0.08)}.s-wishlist-actions-panel-select-all{user-select:none}.s-wishlist-actions-select-all:indeterminate,.s-wishlist-actions-select-all:indeterminate:hover,.s-wishlist-actions-select-all:indeterminate:focus{background-color:var(--color-primary);border-color:var(--color-primary)}.s-wishlist-actions-select-all:indeterminate::after{content:"";position:absolute;top:50%;left:50%;width:10px;height:2px;background:#fff;border:none;transform:translate(-50%, -50%)}.s-wishlist-actions-social-anchor{display:none}h1.s-wishlist-actions-page-title{text-align:start !important}';export{a as salla_wishlist_actions}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as t,H as a}from"./p-
|
|
4
|
+
import{r as e,h as t,H as a}from"./p-DkTbP5UX.js";const s=class{constructor(t){e(this,t),this.href=void 0,this.target="_self"}generateClass(){return{"s-list-tile-item":!0,"s-list-tile-item-href":!!this.href}}render(){return t(a,{key:"2b73681383da172ed01bb199b117d2063228e01e"},t("a",{key:"af5913df51093694667751d16b5ec686103791a4",class:this.generateClass(),href:this.href||"#",target:this.target,"aria-label":"List Tile Link"},t("div",{key:"49fdb468a67f0a015762a1539d2333ad694628ec",class:"s-list-tile-item-icon"},t("slot",{key:"97417d4c9bf63e498510549d08dbf5df55050526",name:"icon"})),t("div",{key:"53544687a14f2c992ad17d0194a10fba0ad40631",class:"s-list-tile-item-content"},t("div",{key:"a8803d707ccd88df74d425a004e5c180d0106c50",class:"s-list-tile-item-title"},t("slot",{key:"27b091e8cf03dc9253baf135bdc6a8166eac566c",name:"title"})),t("div",{key:"c2ab48314fe243e6cea9dd7e8f0be4104a0b89e3",class:"s-list-tile-item-subtitle"},t("slot",{key:"31c7e05be4026e990704926f6b29c8b1e570a548",name:"subtitle"}))),t("div",{key:"4fb89eaad3693b3b49e6d4ac72f09dca7c52eeeb",class:"s-list-tile-item-action"},t("slot",{key:"7e587373e0282a22387028aaa6a801b9909f707a",name:"action"}))))}};s.style="";export{s as salla_list_tile}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as t,h as r,H as a}from"./p-DkTbP5UX.js";import{S as s}from"./p-D4oPi1Ov.js";const e=new Map,i=new Map;function o(t){return t?Array.isArray(t)?t:Object.values(t):[]}const c=class{constructor(r){t(this,r),this.factors=[]}async componentWillLoad(){await salla.onReady(),await this.loadFactors()}async loadFactors(){if(this.orderId)try{const t=await async function(t){if(!t)return null;const r=e.get(t);if(r&&Date.now()-r.timestamp<=3e5)return r.data;const a=i.get(t);if(a)return a;const s=(async()=>{try{const r=await salla.api.request(`orders/${t}`,"","get"),a=r?.data??r;return e.set(t,{data:a,timestamp:Date.now()}),a}catch(r){throw e.delete(t),r}finally{i.delete(t)}})();return i.set(t,s),s}(this.orderId);this.factors=function(t,r,a,s){var e;const i=function(t,r,a,s){return t.find((t=>!(!r||Number(t.id??t.feedback_id)!==Number(r))||!(!s||Number(t.order_item_id)!==Number(s))||!(!a||Number(t.product_id??t.product?.id)!==Number(a))))}((e=t?.rating,e?[...o(e.product),...o(e.products)]:[]),r,a,s);return function(t){if(!t)return[];for(const r of["factor_reviews","review_factors","factors"]){const a=t[r];if(Array.isArray(a)&&a.length)return a}return[]}(i)}(t,this.ratingId,this.productId,this.itemId)}catch(t){console.error("[salla-review-factors-tags] failed to load order rating factors",t),this.factors=[]}else this.factors=[]}renderFactorTags(){const t=this.factors||[];return t.length?r("div",{class:"s-review-factors-tags-factors"},t.map((t=>r("div",{class:"s-review-factors-tags-factor-tag"},r("span",{class:"s-review-factors-tags-factor-name"},t.name),r("span",{class:"s-review-factors-tags-factor-star",innerHTML:s}),r("span",{class:"s-review-factors-tags-factor-rating"},t.rating||""))))):null}render(){return r(a,{key:"2645f00c58f3ecbd3b486756dd9977edc9ae66fd",class:"s-review-factors-tags-wrapper"},this.renderFactorTags())}};c.style=":host{display:inline-flex}.s-review-factors-tags-factors{display:flex;flex-wrap:wrap;gap:0.5rem;justify-content:flex-start;margin-bottom:0.6rem}.s-review-factors-tags-factor-tag{display:inline-flex;align-items:center;gap:0.25rem;border-radius:999px;border:1px solid #e8e8e8;background:rgba(255, 255, 255, 0.3);color:#374151;font-size:0.85rem;line-height:1;padding:0.4rem 0.65rem}.s-review-factors-tags-factor-rating{font-weight:600;color:#0f6a7c}.s-review-factors-tags-factor-star{display:inline-flex;width:0.8rem;height:0.8rem;fill:#0f6a7c}.s-review-factors-tags-factor-star svg{width:100%;height:100%}";export{c as salla_review_factors_tags}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{d as e}from"./p-
|
|
4
|
+
import{d as e}from"./p-DkTbP5UX.js";function E(e,E){return E.forEach((function(E){E&&"string"!=typeof E&&!Array.isArray(E)&&Object.keys(E).forEach((function(i){if("default"!==i&&!(i in e)){var _=Object.getOwnPropertyDescriptor(E,i);Object.defineProperty(e,i,_.get?_:{enumerable:!0,get:function(){return E[i]}})}}))})),Object.freeze(e)}var i,_,l={exports:{}},n=i?l.exports:(i=1,l.exports=(_=function(e){var E=e.addFilter,i=e.utils,_=i.Type,l=i.replaceInString,n=i.toNaturalFileSize;return E("ALLOW_HOPPER_ITEM",(function(e,E){var i=E.query;if(!i("GET_ALLOW_FILE_SIZE_VALIDATION"))return!0;var _=i("GET_MAX_FILE_SIZE");if(null!==_&&e.size>_)return!1;var l=i("GET_MIN_FILE_SIZE");return!(null!==l&&e.size<l)})),E("LOAD_FILE",(function(e,E){var i=E.query;return new Promise((function(E,_){if(!i("GET_ALLOW_FILE_SIZE_VALIDATION"))return E(e);var t=i("GET_FILE_VALIDATE_SIZE_FILTER");if(t&&!t(e))return E(e);var I=i("GET_MAX_FILE_SIZE");if(null!==I&&e.size>I)_({status:{main:i("GET_LABEL_MAX_FILE_SIZE_EXCEEDED"),sub:l(i("GET_LABEL_MAX_FILE_SIZE"),{filesize:n(I,".",i("GET_FILE_SIZE_BASE"),i("GET_FILE_SIZE_LABELS",i))})}});else{var L=i("GET_MIN_FILE_SIZE");if(null!==L&&e.size<L)_({status:{main:i("GET_LABEL_MIN_FILE_SIZE_EXCEEDED"),sub:l(i("GET_LABEL_MIN_FILE_SIZE"),{filesize:n(L,".",i("GET_FILE_SIZE_BASE"),i("GET_FILE_SIZE_LABELS",i))})}});else{var a=i("GET_MAX_TOTAL_FILE_SIZE");if(null!==a&&i("GET_ACTIVE_ITEMS").reduce((function(e,E){return e+E.fileSize}),0)>a)return void _({status:{main:i("GET_LABEL_MAX_TOTAL_FILE_SIZE_EXCEEDED"),sub:l(i("GET_LABEL_MAX_TOTAL_FILE_SIZE"),{filesize:n(a,".",i("GET_FILE_SIZE_BASE"),i("GET_FILE_SIZE_LABELS",i))})}});E(e)}}}))})),{options:{allowFileSizeValidation:[!0,_.BOOLEAN],maxFileSize:[null,_.INT],minFileSize:[null,_.INT],maxTotalFileSize:[null,_.INT],fileValidateSizeFilter:[null,_.FUNCTION],labelMinFileSizeExceeded:["File is too small",_.STRING],labelMinFileSize:["Minimum file size is {filesize}",_.STRING],labelMaxFileSizeExceeded:["File is too large",_.STRING],labelMaxFileSize:["Maximum file size is {filesize}",_.STRING],labelMaxTotalFileSizeExceeded:["Maximum total size exceeded",_.STRING],labelMaxTotalFileSize:["Maximum total file size is {filesize}",_.STRING]}}},"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:_})),_)),t=E({__proto__:null,default:e(n)},[n]);
|
|
5
5
|
/*!
|
|
6
6
|
* FilePondPluginFileValidateSize 2.2.8
|
|
7
7
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as a,H as t,a as o}from"./p-
|
|
4
|
+
import{r as s,h as a,H as t,a as o}from"./p-DkTbP5UX.js";const c=class{constructor(a){s(this,a),this.availableCoupons=[],this.cartTotal=0,this.currentCoupon="",this.couponInputValue="",this.couponError="",this.isApplying=!1,this.isHandlingInternalError=!1,this.cartUpdatedHandler=s=>{this.cartTotal=s.sub_total??s.total??0;const a=s.coupon||"";a!==this.currentCoupon&&(this.currentCoupon=a,this.couponInputValue=a),this.couponError=""},this.couponAddedHandler=()=>{},this.couponAdditionFailedHandler=s=>{this.isApplying||this.isHandlingInternalError||this.showCouponError(s?.message||salla.lang.get("pages.cart.coupon_application_error"))},this.couponDeletedHandler=()=>{},this.onKeyUp=s=>{"Enter"===s.key&&this.couponButtonRef?.click(),this.couponError=""},this.onInput=s=>{this.couponInputValue=s.target.value}}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),this.loadCouponsData(),this.loadCartTotal(),this.setupCartEventListeners()}componentDidLoad(){this.setupCouponInputEvents()}setupCartEventListeners(){salla.event.on("cart::updated",this.cartUpdatedHandler),salla.event.on("cart::coupon.added",this.couponAddedHandler),salla.event.on("cart::coupon.addition.failed",this.couponAdditionFailedHandler),salla.event.on("cart::coupon.deleted",this.couponDeletedHandler)}disconnectedCallback(){this.couponInputRef?.removeEventListener("keyup",this.onKeyUp),this.couponInputRef?.removeEventListener("input",this.onInput),salla.event.off("cart::updated",this.cartUpdatedHandler),salla.event.off("cart::coupon.added",this.couponAddedHandler),salla.event.off("cart::coupon.addition.failed",this.couponAdditionFailedHandler),salla.event.off("cart::coupon.deleted",this.couponDeletedHandler)}async selectCoupon(s){const a=this.availableCoupons.find((a=>a.code===s));if(a){if(!this.isEligible(a))throw new Error("Coupon not eligible: minimum cart amount not met");try{await this.applyCoupon(s),this.host.dispatchEvent(new CustomEvent("salla::cart-coupons.coupon.selected",{detail:a,bubbles:!0}))}catch(s){throw s}}return a}async loadCouponsData(){try{const s=await salla.api.request("coupons"),a=s?.data,t=Array.isArray(a)?a:Array.isArray(a?.data)?a.data:[];this.availableCoupons=t}catch(s){console.warn("Failed to load coupons:",s),this.availableCoupons=[]}}loadCartTotal(){const s=salla.storage.get("cart");this.cartTotal=s?.summary?.sub_total??s?.sub_total??0,this.currentCoupon=s?.coupon||"",this.couponInputValue=s?.coupon||""}setupCouponInputEvents(){this.couponInputRef&&this.couponButtonRef&&(this.couponInputRef.addEventListener("keyup",this.onKeyUp),this.couponInputRef.addEventListener("input",this.onInput))}async handleCouponButtonClick(){if(this.isApplying)return;const s=!!this.currentCoupon;if(s||this.couponInputValue.trim()){this.isApplying=!0,this.isHandlingInternalError=!0;try{s?await salla.cart.deleteCoupon():await salla.cart.addCoupon(this.couponInputValue.trim())}catch(s){this.showCouponError(s.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error"))}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}else this.showCouponError(salla.lang.get("pages.cart.enter_coupon_code"))}showCouponError(s){this.couponError=s}handleCouponClick(s){this.applyCoupon(s.code,!1).catch((()=>{}))}async applyCoupon(s,a=!0){if(this.isApplying){if(a)throw new Error("Coupon application already in progress")}else{this.couponInputValue=s,this.couponError="",this.isApplying=!0,this.isHandlingInternalError=!0;try{await salla.cart.addCoupon(s.trim())}catch(s){if(this.showCouponError(s.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error")),a)throw s}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}}formatMainAmount(s){if("percentage"===s.type)return`${salla.helpers.number("object"==typeof s.amount?s.amount.amount:s.amount)}%`;{const t="object"==typeof s.amount?s.amount:{amount:s.amount,currency:s.minimum_amount?.currency||salla.config.get("store.currency.code","SAR")};return a("span",{innerHTML:salla.money(t.amount,t.currency)})}}isEligible(s){return!(s.minimum_amount&&this.cartTotal<parseFloat(s.minimum_amount.amount))}renderCouponCard(s){const t=this.isEligible(s);return a("div",{class:"s-cart-coupons-slide-one-fourth swiper-slide"},a("div",{class:"s-cart-coupons-card "+(!t||this.isApplying?"s-cart-coupons-disabled":""),onClick:()=>t&&!this.isApplying&&this.handleCouponClick(s)},a("div",{class:"s-cart-coupons-top-section"},a("div",{class:"s-cart-coupons-discount-values"},a("div",{class:"s-cart-coupons-main-amount"},this.formatMainAmount(s)),s.free_shipping?a("div",{class:"s-cart-coupons-secondary-info"},"+ ",salla.lang.get("pages.cart.free_shipping")):s.maximum_amount&&a("div",{class:"s-cart-coupons-secondary-info"},salla.lang.get("pages.cart.up_to")," ",a("span",{innerHTML:salla.money(s.maximum_amount.amount,s.maximum_amount.currency)}))),a("div",{class:"s-cart-coupons-code"},s.code)),a("div",{class:"s-cart-coupons-divider"}),a("div",{class:"s-cart-coupons-bottom-section"},a("div",{class:"s-cart-coupons-terms"},null!=s.remaining_days&&a("div",{class:"s-cart-coupons-expiry "+(s.remaining_days<=3?"s-cart-coupons-expiry-warning":"")},0===s.remaining_days?salla.lang.get("pages.cart.expires_today"):`${salla.lang.get("pages.cart.expires_after")} ${s.remaining_days} ${salla.lang.get("pages.cart.day")}`),s.minimum_amount&&parseFloat(s.minimum_amount.amount)>0&&a("div",{class:"s-cart-coupons-minimum"},salla.lang.get("pages.cart.minimum")," ",a("span",{innerHTML:salla.money(s.minimum_amount.amount,s.minimum_amount.currency)}))),a("div",{class:"s-cart-coupons-action"},t?salla.lang.get("pages.cart.save_coupon"):salla.lang.get("pages.cart.coupon_not_compatible")))))}render(){return a(t,{key:"09c964ef1b706cd623f5b99b9606ecf93486e8b5"},a("div",{key:"a3b3313ecbc23821cca29115f1189ca2dfbcbb48",class:"s-cart-coupons-wrapper"},a("div",{key:"27bc855b95d252a4feffc256fdef70b7d83aa4b3",class:"s-cart-coupons-input-section"},a("label",{key:"d17fff32352bc8e0535986519d5e22dda7879754",htmlFor:"coupon-input",class:"s-cart-coupons-coupon-label"},salla.lang.get("pages.cart.have_coupon")),a("div",{key:"4e9acdb76110fffbd6984fa522fa91440d8c3bc6",class:"s-cart-coupons-coupon-input-container"},a("input",{key:"2f0e3ee9a44db390caeeb4e85f40aab825c91182",type:"text",id:"coupon-input",name:"coupon",class:"form-input "+(this.couponError?"s-coupon-input-error":""),placeholder:salla.lang.get("pages.cart.coupon_placeholder"),value:this.couponInputValue,disabled:!!this.currentCoupon||this.isApplying,ref:s=>this.couponInputRef=s,"aria-label":salla.lang.get("pages.cart.apply_coupon")}),a("salla-button",{key:"a7356872f2eaae51bf77207c0fcfd10ea3c25313",ref:s=>this.couponButtonRef=s,class:"s-cart-coupons-coupon-button "+(this.currentCoupon?"s-cart-coupons-coupon-button-remove":"s-cart-coupons-coupon-button-apply"),color:this.currentCoupon?"danger":"primary",loading:this.isApplying,"loader-position":"center",onClick:()=>this.handleCouponButtonClick()},this.currentCoupon?a("i",{class:"sicon-cancel"}):a("span",null,salla.lang.get("pages.cart.save_coupon")))),this.couponError&&a("span",{key:"4d0b025d425e2fbba8f313b92c1e257042c549b0",class:"s-cart-coupons-coupon-error"},this.couponError)),this.availableCoupons&&this.availableCoupons.length>0&&a("salla-slider",{key:"ac6a96179ec2990f8fedfd3cbb63404e7fe60edf",type:"carousel",showControls:!1,class:"s-cart-coupons-slider"},a("div",{key:"7c4f2641aa87a91d55d88d5fc0a375a5d3114a99",slot:"items"},this.availableCoupons.map((s=>this.renderCouponCard(s)))))))}get host(){return o(this)}};c.style="";export{c as salla_cart_coupons}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as a,H as s,a as l}from"./p-
|
|
4
|
+
import{r as t,h as a,H as s,a as l}from"./p-DkTbP5UX.js";const i=class{constructor(a){t(this,a),this.alertDelay=null,this.data=salla.config.get("store.app_install_prompt"),this.open=!1,this.closing=!1}connectedCallback(){salla.onReady((()=>{if(this.data=salla.config.get("store.app_install_prompt"),this.isMobileOrTabletDevice()){if(!this.data)return salla.logger.error("Failed to retrieve salla-app-install-alert config");this.ctaLink=salla.url.get("app"),this.alertDelay=setTimeout((()=>this.open=!0),3e3)}}))}disconnectedCallback(){clearTimeout(this.alertDelay)}isMobileOrTabletDevice(t=1024){if("undefined"==typeof window||"undefined"==typeof navigator||"undefined"==typeof document)return!1;const a=window.matchMedia(`(max-width: ${t}px)`).matches,s=/Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent),l="ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0;return s&&a&&l}closeAlert(){salla.storage.set("app_install_prompt_disabled",!0),this.closing=!0,this.host.addEventListener("animationend",(()=>{this.closing=!1,this.open=!1}),{once:!0})}shouldShowAlert(){return!salla.config.isMobileApp()}render(){return this.data&&this.shouldShowAlert()?a(s,{class:`s-app-install-alert-wrapper ${this.open?"open":""} ${this.closing?"closing":""}`,position:this.data.position},a("div",null,a("img",{src:this.data.icon,width:"58",height:"58",alt:`${salla.config.get("store.name")}`})),a("div",{class:"s-app-install-alert-content"},a("h2",{class:"s-app-install-alert-title"},this.data.title),a("p",{class:"s-app-install-alert-sub-title"},this.data.sub_title," "," ",a("a",{href:this.ctaLink,target:"_blank","aria-label":"download app",class:"s-app-install-alert-cta"},salla.lang.getWithDefault("blocks.footer.download_app_now","حمله الآن")))),a("button",{class:"s-app-install-alert-cancel-button","aria-label":"close alert",onClick:()=>this.closeAlert()},a("i",{class:"sicon-cancel"}))):null}get host(){return l(this)}};i.style=":host{display:block}";export{i as salla_app_install_alert}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,h as s}from"./p-DNWyGkAx.js";import{S as l}from"./p-D4oPi1Ov.js";import{S as t}from"./p-8Tsmrwno.js";const e=class{constructor(s){a(this,s),this.activeTabType="",this.tabsKey=0,this.selectedItem=void 0,this.allowEmail=!0,this.allowMobile=!0,this.requireEmail=!1,salla.event.on("loyalty::open",(()=>this.open())),salla.auth.event.onLoggedIn((()=>{this.is_loggedin=!0})),salla.onReady((()=>{this.is_loggedin=salla.config.isUser()})),salla.lang.onLoaded((()=>{this.guestMessage=salla.lang.get("pages.loyalty_program.guest_message"),this.translationLoaded=!0})),salla.cart.event.onUpdated((a=>{this.prizePoints=a.loyalty.prize?.points,this.prizeTitle=a.loyalty.prize?.title,this.customerPoints=a.loyalty.customer_points||this.customerPoints}))}onTabSelected(a){const s=this.loyaltyProgram?.prizes.find((s=>s.title===a.detail?.name));s&&(this.activeTabType=s.type)}setSelectedPrizeItem(a){this.selectedItem=this.selectedItem&&this.selectedItem?.id==a.id?void 0:a}handleLongText(a){return a.length>150?a.substring(0,150)+"...":a}prizeItem(a){return s("div",{onClick:()=>this.setSelectedPrizeItem(a),class:{"s-loyalty-prize-item-selected":!!this.selectedItem&&this.selectedItem?.id==a.id,"s-loyalty-prize-item":!0}},s("img",{class:"s-loyalty-prize-item-image",src:a.image,alt:a.name}),s("div",{class:"s-loyalty-prize-item-title"},a.name),s("div",{class:"s-loyalty-prize-item-subtitle"},this.handleLongText(a.description)),s("div",{class:"s-loyalty-prize-item-points"},a.cost_points," ",salla.lang.get("pages.loyalty_program.point"),s("div",{class:"s-loyalty-prize-item-check"},s("div",null))))}getConfirmationModal(){return[s("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"},s("div",{slot:"title",class:"s-loyalty-confirmation-title"},salla.lang.get("pages.loyalty_program.exchange_points")),s("div",{slot:"description"},salla.lang.get("pages.loyalty_program.are_you_sure_to_exchange")," ( ",s("strong",null,this.selectedItem?.cost_points)," ",salla.lang.get("pages.loyalty_program.point")," ) ",salla.lang.get("pages.loyalty_program.for")," ( ",s("strong",null,this.selectedItem?.name)," )")),s("div",{class:"s-loyalty-confirmation-actions"},s("salla-button",{fill:"outline",width:"wide",onClick:()=>this.cancelProcess()},salla.lang.get("pages.loyalty_program.cancellation")),s("salla-button",{loading:this.buttonLoading,width:"wide",onClick:()=>this.exchangeLoyaltyPoint()},salla.lang.get("pages.loyalty_program.confirm")))]}getAfterExchangeUI(){return s("slot",{name:"points-applied-widget"},s("salla-list-tile",{class:"s-loyalty-after-exchange"},s("div",{slot:"title",class:"s-loyalty-after-exchange-title"},this.prizeTitle," - ",this.prizePoints," ",salla.lang.get("pages.loyalty_program.point")),s("div",{slot:"action",class:"s-loyalty-after-exchange-action"},s("salla-button",{class:"s-loyalty-after-exchange-reset",shape:"icon",fill:"outline",color:"danger",size:"small",onClick:()=>this.resetExchange()},s("span",{innerHTML:t})))))}async open(){return this.is_loggedin?(this.modal?.open(),await salla.loyalty.getProgram().then((a=>{this.loyaltyProgram=a.data,this.activeTabType=this.loyaltyProgram.prizes[0]?.type||"",this.tabsKey++})).catch((a=>{this.hasError=!0,this.errorMessage=a.response?.data?.error?.message||a.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(a){return a?.response?.data?.error?.message||a?.response?.data?.message||("string"==typeof a?a:null)||salla.lang.get("common.errors.error_occurred")}async openConfirmation(){return await this.modal.close().then((()=>this.confirmationModal?.open())).catch((a=>console.log(a)))}async cancelProcess(){return await this.confirmationModal.close().then((()=>this.selectedItem=null)).catch((a=>console.log(a)))}async exchangeLoyaltyPoint(){this.buttonLoading=!0;const a=this.selectedItem;await salla.loyalty.exchange(a?.id).then((async()=>{"FREE_PRODUCT"==a?.key&&salla.url.is_page("cart")&&window.location.reload(),await this.cancelProcess()})).catch((a=>{salla.notify.error(this.getApiErrorMessage(a))})),this.buttonLoading=!1}render(){return this.prizePoints?this.getAfterExchangeUI():[s("slot",{name:"widget"},this.customerPoints?s("salla-list-tile",{class:"s-loyalty-widget"},s("div",{slot:"icon",class:"s-loyalty-widget-icon",innerHTML:l}),s("div",{slot:"subtitle"},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_total_point_summary",{balance:this.customerPoints}):this.guestMessage,s("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")))):""),s("salla-modal",{noPadding:!0,width:"sm",ref:a=>this.confirmationModal=a},this.getConfirmationModal()),s("salla-modal",{isLoading:!0,"has-skeleton":!0,width:"md",ref:a=>this.modal=a},s("div",{slot:"loading"},s("div",{class:"s-loyalty-skeleton"},s("salla-list-tile",{class:"s-loyalty-header"},s("div",{slot:"icon",class:"s-loyalty-header-icon"},s("salla-skeleton",{type:"circle",height:"6rem",width:"6rem"})),s("div",{slot:"title",class:"s-loyalty-header-title mb-5"},s("salla-skeleton",{height:"15px",width:"50%"})),s("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},s("salla-skeleton",{height:"10px"}),s("salla-skeleton",{height:"10px",width:"75%"}))),s("div",{class:"s-loyalty-skeleton-cards"},[...Array(3)].map((()=>s("div",{class:"s-loyalty-prize-item swiper-slide"},s("salla-skeleton",{height:"9rem"}),s("div",{class:"s-loyalty-prize-item-title"},s("salla-skeleton",{height:"15px",width:"75%"})),s("div",{class:"s-loyalty-prize-item-subtitle"},s("salla-skeleton",{height:"10px",width:"50%"}),s("salla-skeleton",{height:"10px",width:"25%"})),s("div",{class:"s-loyalty-prize-item-points"},s("salla-skeleton",{height:"15px",width:"100px"}),s("div",{class:"s-loyalty-prize-item-check"},s("salla-skeleton",{height:"1rem",width:"1rem",type:"circle"}))))))))),!this.hasError&&this.loyaltyProgram?[s("salla-list-tile",{id:"s-loyalty-header",class:"s-loyalty-header"},s("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>'}),s("div",{slot:"title",class:"s-loyalty-header-title"},this.loyaltyProgram.prize_promotion_title),s("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},this.loyaltyProgram.prize_promotion_description)),s("salla-tabs",{key:this.tabsKey},this.loyaltyProgram.prizes.map((a=>s("salla-tab-header",{slot:"header",name:a.title},s("span",null,a.title)))),this.loyaltyProgram.prizes.map(((a,l)=>s("salla-tab-content",{slot:"content",name:a.title},s("salla-slider",{class:"s-loyalty-slider",loop:!1,"controls-outer":!0,id:"loyalty-popup-slider-"+l,type:"carousel"},s("div",{slot:"items"},a.items.map((a=>this.prizeItem(a))))))))),"FREE_PRODUCT"===this.activeTabType?.toUpperCase()&&(salla.config.get("store.features")||[]).includes("loyalty-system-v2")?s("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")):s("salla-button",{disabled:!this.selectedItem,width:"wide",class:"s-loyalty-program-redeem-btn",onClick:()=>this.openConfirmation()},salla.lang.get("pages.loyalty_program.exchange_points"))]:s("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?s("span",{slot:"description"},this.errorMessage):""))]}};e.style="";export{e as salla_loyalty}
|
|
4
|
+
import{r as a,h as s}from"./p-DkTbP5UX.js";import{S as l}from"./p-D4oPi1Ov.js";import{S as t}from"./p-8Tsmrwno.js";const e=class{constructor(s){a(this,s),this.activeTabType="",this.tabsKey=0,this.selectedItem=void 0,this.allowEmail=!0,this.allowMobile=!0,this.requireEmail=!1,salla.event.on("loyalty::open",(()=>this.open())),salla.auth.event.onLoggedIn((()=>{this.is_loggedin=!0})),salla.onReady((()=>{this.is_loggedin=salla.config.isUser()})),salla.lang.onLoaded((()=>{this.guestMessage=salla.lang.get("pages.loyalty_program.guest_message"),this.translationLoaded=!0})),salla.cart.event.onUpdated((a=>{this.prizePoints=a.loyalty.prize?.points,this.prizeTitle=a.loyalty.prize?.title,this.customerPoints=a.loyalty.customer_points||this.customerPoints}))}onTabSelected(a){const s=this.loyaltyProgram?.prizes.find((s=>s.title===a.detail?.name));s&&(this.activeTabType=s.type)}setSelectedPrizeItem(a){this.selectedItem=this.selectedItem&&this.selectedItem?.id==a.id?void 0:a}handleLongText(a){return a.length>150?a.substring(0,150)+"...":a}prizeItem(a){return s("div",{onClick:()=>this.setSelectedPrizeItem(a),class:{"s-loyalty-prize-item-selected":!!this.selectedItem&&this.selectedItem?.id==a.id,"s-loyalty-prize-item":!0}},s("img",{class:"s-loyalty-prize-item-image",src:a.image,alt:a.name}),s("div",{class:"s-loyalty-prize-item-title"},a.name),s("div",{class:"s-loyalty-prize-item-subtitle"},this.handleLongText(a.description)),s("div",{class:"s-loyalty-prize-item-points"},a.cost_points," ",salla.lang.get("pages.loyalty_program.point"),s("div",{class:"s-loyalty-prize-item-check"},s("div",null))))}getConfirmationModal(){return[s("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"},s("div",{slot:"title",class:"s-loyalty-confirmation-title"},salla.lang.get("pages.loyalty_program.exchange_points")),s("div",{slot:"description"},salla.lang.get("pages.loyalty_program.are_you_sure_to_exchange")," ( ",s("strong",null,this.selectedItem?.cost_points)," ",salla.lang.get("pages.loyalty_program.point")," ) ",salla.lang.get("pages.loyalty_program.for")," ( ",s("strong",null,this.selectedItem?.name)," )")),s("div",{class:"s-loyalty-confirmation-actions"},s("salla-button",{fill:"outline",width:"wide",onClick:()=>this.cancelProcess()},salla.lang.get("pages.loyalty_program.cancellation")),s("salla-button",{loading:this.buttonLoading,width:"wide",onClick:()=>this.exchangeLoyaltyPoint()},salla.lang.get("pages.loyalty_program.confirm")))]}getAfterExchangeUI(){return s("slot",{name:"points-applied-widget"},s("salla-list-tile",{class:"s-loyalty-after-exchange"},s("div",{slot:"title",class:"s-loyalty-after-exchange-title"},this.prizeTitle," - ",this.prizePoints," ",salla.lang.get("pages.loyalty_program.point")),s("div",{slot:"action",class:"s-loyalty-after-exchange-action"},s("salla-button",{class:"s-loyalty-after-exchange-reset",shape:"icon",fill:"outline",color:"danger",size:"small",onClick:()=>this.resetExchange()},s("span",{innerHTML:t})))))}async open(){return this.is_loggedin?(this.modal?.open(),await salla.loyalty.getProgram().then((a=>{this.loyaltyProgram=a.data,this.activeTabType=this.loyaltyProgram.prizes[0]?.type||"",this.tabsKey++})).catch((a=>{this.hasError=!0,this.errorMessage=a.response?.data?.error?.message||a.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(a){return a?.response?.data?.error?.message||a?.response?.data?.message||("string"==typeof a?a:null)||salla.lang.get("common.errors.error_occurred")}async openConfirmation(){return await this.modal.close().then((()=>this.confirmationModal?.open())).catch((a=>console.log(a)))}async cancelProcess(){return await this.confirmationModal.close().then((()=>this.selectedItem=null)).catch((a=>console.log(a)))}async exchangeLoyaltyPoint(){this.buttonLoading=!0;const a=this.selectedItem;await salla.loyalty.exchange(a?.id).then((async()=>{"FREE_PRODUCT"==a?.key&&salla.url.is_page("cart")&&window.location.reload(),await this.cancelProcess()})).catch((a=>{salla.notify.error(this.getApiErrorMessage(a))})),this.buttonLoading=!1}render(){return this.prizePoints?this.getAfterExchangeUI():[s("slot",{name:"widget"},this.customerPoints?s("salla-list-tile",{class:"s-loyalty-widget"},s("div",{slot:"icon",class:"s-loyalty-widget-icon",innerHTML:l}),s("div",{slot:"subtitle"},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_total_point_summary",{balance:this.customerPoints}):this.guestMessage,s("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")))):""),s("salla-modal",{noPadding:!0,width:"sm",ref:a=>this.confirmationModal=a},this.getConfirmationModal()),s("salla-modal",{isLoading:!0,"has-skeleton":!0,width:"md",ref:a=>this.modal=a},s("div",{slot:"loading"},s("div",{class:"s-loyalty-skeleton"},s("salla-list-tile",{class:"s-loyalty-header"},s("div",{slot:"icon",class:"s-loyalty-header-icon"},s("salla-skeleton",{type:"circle",height:"6rem",width:"6rem"})),s("div",{slot:"title",class:"s-loyalty-header-title mb-5"},s("salla-skeleton",{height:"15px",width:"50%"})),s("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},s("salla-skeleton",{height:"10px"}),s("salla-skeleton",{height:"10px",width:"75%"}))),s("div",{class:"s-loyalty-skeleton-cards"},[...Array(3)].map((()=>s("div",{class:"s-loyalty-prize-item swiper-slide"},s("salla-skeleton",{height:"9rem"}),s("div",{class:"s-loyalty-prize-item-title"},s("salla-skeleton",{height:"15px",width:"75%"})),s("div",{class:"s-loyalty-prize-item-subtitle"},s("salla-skeleton",{height:"10px",width:"50%"}),s("salla-skeleton",{height:"10px",width:"25%"})),s("div",{class:"s-loyalty-prize-item-points"},s("salla-skeleton",{height:"15px",width:"100px"}),s("div",{class:"s-loyalty-prize-item-check"},s("salla-skeleton",{height:"1rem",width:"1rem",type:"circle"}))))))))),!this.hasError&&this.loyaltyProgram?[s("salla-list-tile",{id:"s-loyalty-header",class:"s-loyalty-header"},s("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>'}),s("div",{slot:"title",class:"s-loyalty-header-title"},this.loyaltyProgram.prize_promotion_title),s("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},this.loyaltyProgram.prize_promotion_description)),s("salla-tabs",{key:this.tabsKey},this.loyaltyProgram.prizes.map((a=>s("salla-tab-header",{slot:"header",name:a.title},s("span",null,a.title)))),this.loyaltyProgram.prizes.map(((a,l)=>s("salla-tab-content",{slot:"content",name:a.title},s("salla-slider",{class:"s-loyalty-slider",loop:!1,"controls-outer":!0,id:"loyalty-popup-slider-"+l,type:"carousel"},s("div",{slot:"items"},a.items.map((a=>this.prizeItem(a))))))))),"FREE_PRODUCT"===this.activeTabType?.toUpperCase()&&(salla.config.get("store.features")||[]).includes("loyalty-system-v2")?s("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")):s("salla-button",{disabled:!this.selectedItem,width:"wide",class:"s-loyalty-program-redeem-btn",onClick:()=>this.openConfirmation()},salla.lang.get("pages.loyalty_program.exchange_points"))]:s("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?s("span",{slot:"description"},this.errorMessage):""))]}};e.style="";export{e as salla_loyalty}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,a}from"./p-
|
|
4
|
+
import{r as s,h as t,a}from"./p-DkTbP5UX.js";import{a as i}from"./p-CgtvEd63.js";const e=class{constructor(t){s(this,t),this.currentSlug=salla.config.get("page.slug"),salla.onReady((()=>{this.currentSlug=salla.config.get("page.slug")})),this.advSlot=this.host.querySelector('[slot="adv"]')?.innerHTML||'<div class="s-advertisement-content"><span class="s-advertisement-content-main">{iconElem}{urlElem}</span>{closeElem}</div>\n '}isNotVisible(s){return!(salla.config.isDebug()||salla.helpers.isPreview()||!salla.storage.get(`statusAd-${s.id}`))}setCanDisplayFlag(s,t){t||(salla.storage.set(`statusAd-${s.id}`,"dismissed"),i({targets:this.host,opacity:[1,0],duration:300,height:[this.host.clientHeight,0],easing:"easeInOutQuad"}))}render(){if((!Array.isArray(this.advertisements)||this.advertisements.length)&&this.advertisements)return this.advertisements.map((s=>t("div",{class:{"s-hidden":this.isNotVisible(s),"s-advertisement":!0},"data-id":s.id,style:{"background-color":s.colors.bg,color:s.colors.text}},t("div",{id:"adv-slot",innerHTML:this.advSlot.replace("{iconElem}",`<i class="s-advertisement-content-icon ${s.icon}"></i>`).replace("{urlElem}",s.url?`<a href="${s.url}" target="${s.target}">${s.description}</a>`:s.description).replace("{closeElem}",'<button class="s-advertisement-action" aria-label="close-alert"><i class="sicon-cancel"></i></button>').replace("{icon}",s.icon).replace("{url}",s.url).replace("{target}",s.target).replace("{description}",s.description).replace("{bg_color}",s.colors.bg).replace("{text_color}",s.colors.text)}))))}componentWillLoad(){return(async()=>{if(salla.config.isMobileApp())return[];const s=salla.config.isDebug()||salla.helpers.isPreview();await new Promise((s=>salla.onReady(s)));const t=s?null:this.currentSlug,a=await salla.api.advertisement.fetch(t);if(Array.isArray(a.data)){const t=a.data;this.advertisements=s?t:t.filter((s=>!salla.storage.get(`statusAd-${s.id}`)))}else this.advertisements=[];return this.advertisements})()}componentDidRender(){Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements||(setTimeout((()=>{let s=this.host.querySelector(".s-advertisement-action");s&&s.addEventListener("click",(()=>this.setCanDisplayFlag(this.advertisements[0],!1)))})),this.host.querySelectorAll("#adv-slot").forEach((s=>s?.replaceWith(s?.firstChild))),this.host.querySelector('[slot="adv"]')?.remove(),i({targets:this.host,opacity:[0,1],duration:300,height:[0,this.host.clientHeight],easing:"easeInOutQuad"}))}get host(){return a(this)}};e.style=":host{display:block}";export{e as salla_advertisement}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t}from"./p-
|
|
4
|
+
import{r as s,h as t}from"./p-DkTbP5UX.js";import{T as o}from"./p-CJUR4sUM.js";import{i as n}from"./p-DqDX5na4.js";const e=class{constructor(t){s(this,t),this.coupon=null,this.isLoading=!0,this.titlePercentTpl="",this.titleFixedTpl="",this.badgeLabel="",this.minSpendTpl="",this.expiresTpl="",this.shopNowLabel="",this.copyLabel="",this.copiedLabel=""}componentWillLoad(){Salla.onReady().then((()=>Salla.lang.onLoaded())).then((()=>(this.loadTranslations(),this.loadCoupon()))).catch((()=>{this.isLoading=!1}))}loadTranslations(){this.titlePercentTpl=Salla.lang.get("pages.thank_you.next_order_coupon_title_percent")||"",this.titleFixedTpl=Salla.lang.get("pages.thank_you.next_order_coupon_title_fixed")||"",this.badgeLabel=Salla.lang.get("pages.thank_you.next_order_coupon_badge")||"",this.minSpendTpl=Salla.lang.get("pages.thank_you.next_order_coupon_min_spend")||"",this.expiresTpl=Salla.lang.get("pages.thank_you.next_order_coupon_expires")||"",this.shopNowLabel=Salla.lang.get("pages.thank_you.next_order_coupon_shop_now")||"",this.copyLabel=Salla.lang.get("common.elements.copy")||"",this.copiedLabel=Salla.lang.get("pages.thank_you.next_order_coupon_copied")||""}async loadCoupon(){try{const s=await salla.api.request("coupons",{params:{type:"thankyou"}}),t=s?.data,o=Array.isArray(t)?t:Array.isArray(t?.data)?t.data:[];this.coupon=o[0]??null}catch{this.coupon=null}finally{this.isLoading=!1}}async copyCode(){if(this.coupon)try{await navigator.clipboard.writeText(this.coupon.code),salla.notify.success(this.copiedLabel),salla.event.dispatch("salla::next-order-coupon.code.copied",{code:this.coupon.code})}catch{}}isPercentage(){return"P"===this.coupon?.type||"percentage"===this.coupon?.type}formatAmount(){if(!this.coupon)return"";if(this.isPercentage())return`${salla.helpers.number(this.coupon.amount)}%`;const s=this.coupon.amount;return t("span","object"==typeof s&&s.amount?{innerHTML:salla.money(s.amount,s.currency)}:{innerHTML:salla.money(s)})}formatMinSpend(){const s=this.coupon?.minimum_amount;return s&&("object"!=typeof s||s.amount)?"string"==typeof s?s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):salla.money(s.amount,s.currency):""}formatExpiry(){const s=this.coupon?.expiry_date;return s?new Date(s).toLocaleDateString(Salla.lang.locale||"en-GB"):""}renderSkeleton(){return t("div",{class:"s-next-order-coupon-wrapper s-next-order-coupon-skeleton"},t("div",{class:"s-next-order-coupon-inner"},t("div",{class:"s-next-order-coupon-info"},t("salla-skeleton",{type:"normal",width:"48px",height:"48px"}),t("div",{class:"s-next-order-coupon-details"},t("salla-skeleton",{height:"14px",width:"220px"}),t("salla-skeleton",{height:"12px",width:"140px"}))),t("div",{class:"s-next-order-coupon-actions"},t("salla-skeleton",{height:"40px",width:"140px"}),t("salla-skeleton",{height:"40px",width:"100px"}))))}renderTitle(){const s=this.formatAmount(),o=this.isPercentage()?this.titlePercentTpl:this.titleFixedTpl,n=this.isPercentage()?":amount%":":amount",e=o.split(n);return t("p",{class:"s-next-order-coupon-title"},e[0],t("span",{class:"s-next-order-coupon-amount"},s),e[1]||"")}render(){if(this.isLoading)return this.renderSkeleton();if(!this.coupon)return null;const s=this.formatMinSpend(),e=this.formatExpiry();return t("div",{class:"s-next-order-coupon-wrapper"},t("div",{class:"s-next-order-coupon-inner"},t("div",{class:"s-next-order-coupon-info"},t("div",{class:"s-next-order-coupon-icon-wrap"},t("span",{class:"s-next-order-coupon-icon-bg"}),t("span",{class:"s-next-order-coupon-icon",innerHTML:o})),t("div",{class:"s-next-order-coupon-details"},t("div",{class:"s-next-order-coupon-title-row"},this.renderTitle(),t("span",{class:"s-next-order-coupon-badge"},t("span",{class:"s-next-order-coupon-badge-bg"}),t("span",{class:"s-next-order-coupon-badge-text"},this.badgeLabel))),(s||e)&&t("p",{class:"s-next-order-coupon-meta"},s&&t("span",{innerHTML:this.minSpendTpl.replace(":amount",s)}),e&&t("span",null,this.expiresTpl.replace(":date",e))))),t("div",{class:"s-next-order-coupon-actions"},t("div",{class:"s-next-order-coupon-code-box"},t("span",{class:"s-next-order-coupon-code-text"},this.coupon.code),t("salla-button",{shape:"link",class:"s-next-order-coupon-copy-btn",title:this.copyLabel,onClick:()=>this.copyCode()},t("span",{class:"s-next-order-coupon-copy-icon",innerHTML:n}))),t("salla-button",{href:salla.url.get(""),class:"s-next-order-coupon-shop-btn"},this.shopNowLabel))))}};e.style=":host{display:block}";export{e as salla_next_order_coupon}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,c as s,h as e}from"./p-
|
|
4
|
+
import{r as a,c as s,h as e}from"./p-DkTbP5UX.js";import{c as r}from"./p-B4xPvvKC.js";import{S as d}from"./p-CXRKXFgT.js";const t=class{constructor(e){a(this,e),this.rewardModalOpen=s(this,"rewardModalOpen"),this.confirmModalOpen=s(this,"confirmModalOpen"),this.size="md",this.isActionClickable=a=>"free_product"!==a.key?.toLowerCase()||a.is_product_available,this.handleActionArea=()=>{this.rewardModalOpen.emit(this.prize)},this.handleAction=()=>{this.isActionClickable(this.prize)&&(salla.config.isUser()?this.confirmModalOpen.emit(this.prize):r((()=>salla.event.dispatch("login::open"))))}}render(){return e("div",{key:"46da4cdcfee8e04307722a89c94ab7c3d867aec4",class:{"s-loyalty-program-reward-container":!0,"s-loyalty-program-reward-xs":"xs"===this.size}},e("div",{key:"3d4d1b1adada717d2c248e1a2287b80b370accc8",onClick:this.handleActionArea,role:"button"},e("div",{key:"2f699dcc9098adbbdec2ab1522bdb49977440663",class:"s-loyalty-program-reward-img"},e("img",{key:"9fcc993f9f010ebd5663d02849714db897321357",src:this.prize.image,class:"s-loyalty-program-rewards-img",alt:""})),e("div",{key:"d66d0be909c1f1c239a4aeb2152cd6f3850f25d4",class:"s-loyalty-program-reward-content"},e("div",{key:"10968623d1fe8815a547e7b404f58b8401eed98b",class:"s-loyalty-program-reward-points"},e("salla-badge",{key:"d677e3be9ed036091f523b51d06d64635e1426d9",size:"xs"},e("span",{key:"8b67c0112a61c5a9f224f308193dd933db6811df",innerHTML:d}),e("span",{key:"0b53d61ca1b07318a19d00c5948045385be2c877",class:"s-loyalty-program-rewards-points",innerHTML:salla.lang.choice("pages.loyalty_program.points",this.prize.cost_points)}))),e("div",{key:"5c88b91c602ddb8d81bd2537ebe32afaa13dabd7",class:"s-loyalty-program-reward-title"},e("span",{key:"9f070612c7b381cdfc11cb794a29dd3d4fad78e3"},this.group)),e("div",{key:"d2ed88971fb88f4c857970a15b08b87681225ad4",class:"s-loyalty-program-reward-name"},e("div",{key:"0818181909194a5a9d7bd8b0b0f421ee1c33cac9",class:"s-loyalty-program-rewards-name",id:`prize-${this.prize.id}`},this.prize.name)))),e("div",{key:"61a792efce0cb44e5d676a2d10fbf466fdc9926a",class:"p-4"},e("button",{key:"b2f469e2206892914e14e542fc9acf6ccc289f59",onClick:this.handleAction,disabled:!this.isActionClickable(this.prize),class:{"s-loyalty-program-rewards-action-base":!0,"s-loyalty-program-rewards-action-on":this.isActionClickable(this.prize),"s-loyalty-program-rewards-action-off":!this.isActionClickable(this.prize)}},this.isActionClickable(this.prize)?salla.lang.get("pages.loyalty_program.redeem_reward"):salla.lang.get("pages.loyalty_program.out_of_stock"))))}};t.style="";export{t as salla_loyalty_reward}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,H as a,a as i}from"./p-
|
|
4
|
+
import{r as s,h as t,H as a,a as i}from"./p-DkTbP5UX.js";const e=class{constructor(t){s(this,t),this.exclude=[]}componentWillLoad(){return salla.onReady().then((()=>{if("string"==typeof this.exclude)try{this.exclude=JSON.parse(this.exclude)}catch(s){salla.logger.error("salla-payments:: failed to parse the exclude props!",this.exclude),this.exclude=[]}this.paymentSlot=this.host.querySelector('[slot="payment"]')?.innerHTML||'<li class="s-payments-list-item"><img width="100%" height="100%" decoding="async" loading="lazy" src="{image}" alt="{payment}" /></li>',this.sbcSlot=this.host.querySelector('[slot="sbc"]')?.innerHTML||'<li class="s-payments-list-item"><a target="_blank" href="{link}"><img width="100%" height="100%" decoding="async" loading="lazy" src="{image}" class="s-payments-sbc-image" alt="SBC" /></a></li>',this.codSlot=this.host.querySelector('[slot="cod"]')?.innerHTML||'<li class="s-payments-list-item"><img width="100%" height="100%" decoding="async" loading="lazy" src="{image}" alt="COD" /></li>',this.payments=salla.config.get("store.settings.payments")}))}render(){const s=!this.exclude.includes("made-in-ksa")&&salla.config.get("store.settings.made_in_ksa"),i=this.exclude.includes("sbc")?null:salla.config.get("store.settings.certificate.id");return t(a,{key:"dcf34aa7bf20914e9413c39c5429b66067a29ec5",class:"s-payments-list-wrap"},t("ul",{key:"523fef26ce20eedcdbf2701f64f0be3ee04dc62a",class:"s-payments-list"},s&&t("li",{key:"feb443128cf1820f22b076acd10681e5a3b401c8",class:"s-payments-list-item"},t("img",{key:"c82b844706cd47ee4633ea896352611defe21685",width:58,height:58,decoding:"async",loading:"lazy",src:salla.url.cdn("images/made-in-ksa.svg",58,58),alt:"made in KSA certified"})),this.payments.map((s=>t("div","cod"==s?{id:"cod-slot",innerHTML:this.codSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/cod_mini.png",58,58))}:{id:"payment-slot",innerHTML:this.paymentSlot.replace(/\{image\}/g,salla.url.cdn(`images/payment/${s}_mini.png`,58,58)).replace(/\{payment\}/g,s)}))),i&&t("div",{key:"c439bed0cf4cf57c206a44008b4daaaa28559e2f",id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn("images/sbc.png",58,58)).replace(/\{link\}/g,`https://eauthenticate.saudibusiness.gov.sa/certificate-details/${i}`)})))}componentDidRender(){this.host.querySelectorAll("#payment-slot").forEach((s=>s.replaceWith(s.firstChild))),this.host.querySelectorAll("#sbc-slot").forEach((s=>s.replaceWith(s.firstChild))),this.host.querySelectorAll("#cod-slot").forEach((s=>s.replaceWith(s.firstChild))),this.host.querySelector('[slot="payment"]')?.remove(),this.host.querySelector('[slot="sbc"]')?.remove(),this.host.querySelector('[slot="cod"]')?.remove()}get host(){return i(this)}};e.style=":host{display:block}";export{e as salla_payments}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{h as a,r as l}from"./p-
|
|
4
|
+
import{h as a,r as l}from"./p-DkTbP5UX.js";import{n as s,c as t}from"./p-B4xPvvKC.js";import{S as e}from"./p-D4oPi1Ov.js";import{S as i}from"./p-8Tsmrwno.js";import{S as r,a as o}from"./p-Bs6JxDkg.js";import{S as n}from"./p-CZRcMGA9.js";import{S as c}from"./p-D1s2kXqL.js";import{T as p}from"./p-cUujZ85s.js";var d=function(a,l,s,t){var e,i=arguments.length,r=i<3?l:null===t?t=Object.getOwnPropertyDescriptor(l,s):t;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(a,l,s,t);else for(var o=a.length-1;o>=0;o--)(e=a[o])&&(r=(i<3?e(r):i>3?e(l,s,r):e(l,s))||r);return i>3&&r&&Object.defineProperty(l,s,r),r};const h={all:a("span",{class:"s-loyalty-program-rewards-tab-icon",innerHTML:o}),free_shipping:a("span",{class:"s-loyalty-program-rewards-tab-icon",innerHTML:n}),coupon_discount:a("span",{class:"s-loyalty-program-rewards-tab-icon",innerHTML:r}),free_product:a("span",{class:"s-loyalty-program-rewards-tab-icon",innerHTML:c})},y=class{constructor(a){l(this,a),this.currentPrize=null,this.handleExchangeSucceeded=()=>window.location.reload(),this.handleResetSucceeded=()=>window.location.reload()}componentWillLoad(){return salla.onReady().then((()=>salla.lang.onLoaded())).then((()=>{salla.event.on("loyalty::exchange.succeeded",this.handleExchangeSucceeded),salla.event.on("loyalty::exchange-reset.succeeded",this.handleResetSucceeded),salla.config.isGuest()||this.points()})).catch((a=>salla.logger.error(a)))}disconnectedCallback(){salla.event.off("loyalty::exchange.succeeded",this.handleExchangeSucceeded),salla.event.off("loyalty::exchange-reset.succeeded",this.handleResetSucceeded)}render(){const l=this.program.data.prizes,s=this.program.data.prizes_count,r=this.points.data??this.customerPoints??0;return this.prizeTitle&&null!=this.prizePoints&&""!==this.prizePoints?a("div",{class:"s-loyalty-program-panel-exchange-wrapper"},a("salla-list-tile",{class:"s-loyalty-program-after-exchange"},a("div",{slot:"title",class:"s-loyalty-program-after-exchange-title"},this.prizeTitle," - ",this.prizePoints," ",salla.lang.get("pages.loyalty_program.point")),a("div",{slot:"action",class:"s-loyalty-program-after-exchange-action"},a("salla-button",{class:"s-loyalty-program-after-exchange-reset",shape:"icon",fill:"outline",color:"danger",size:"small",onClick:()=>salla.loyalty.reset()},a("span",{innerHTML:i}))))):r&&0!==r?a("div",{class:""},a("div",{class:"s-loyalty-program-panel-exchange-wrapper"},a("salla-list-tile",{class:"s-loyalty-program-panel-widget"},a("div",{slot:"icon",class:"s-loyalty-program-panel-widget-icon",innerHTML:e}),a("div",{slot:"subtitle"},salla.lang.get("pages.loyalty_program.cart_total_point_summary",{balance:r}),a("salla-button",{shape:"link",color:"primary",onClick:()=>{["error","idle"].includes(this.program.status)&&this.program(),this.rewardsModal.open()}},salla.lang.get("pages.loyalty_program.cart_point_exchange_now"))))),a("salla-modal",{id:"loyalty-rewards-modal",isLoading:"pending"===this.program.status,ref:a=>this.rewardsModal=a,class:"s-loyalty-program-rewards-cart s-loyalty-program-modal",width:"lg",noPadding:!0},a("div",{slot:"loading"},a("salla-loading",null)),"success"===this.program.status?a("div",{class:"s-loyalty-program-rewards-container-cart"},a("div",{class:"s-loyalty-program-rewards-cart-header"},a("div",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" width="77" height="77" fill="none" viewBox="0 0 57 57"><rect width="56.3" height="55.9" x=".4" y=".2" fill="#FFF5E5" rx="27.9"/><g clip-path="url(#a)"><path fill="#EE9D0D" d="M16.7 27.5h17.5v12.2a1 1 0 0 1-1 1H17.7a1 1 0 0 1-1-1V27.5Z"/><path fill="#C7830B" d="M34.2 27.8v6l-6.8-6.3H34l.3.3Z"/><path fill="#C7830B" d="M34.2 32.3v1.5l-1.6-1.5h1.6Z"/><path fill="#EA2B2D" d="m29.9 15.8-.3.1a2.4 2.4 0 0 0-1.4 1.5l-.2.8-.4.2a2.4 2.4 0 0 0-1.1 1.4l4.2 3.9L33 21l.2-2.9a2.4 2.4 0 0 0-3.3-2.4ZM41.1 26.3v.2a2.4 2.4 0 0 1-1.5 1.6l-.7.3-.2.3a2.4 2.4 0 0 1-1.3 1.3l-4.2-4 2.4-2.5 2.9-.3a2.4 2.4 0 0 1 2.6 3.1Z"/><path fill="#CB2527" d="M23.7 27.5h3.5v13.1h-3.5V27.5Z"/><path fill="#EA2B2D" d="M16.7 32.3h17.5v3.5H16.7v-3.5Z"/><path fill="#CB2527" d="M34.2 32.3v1.5l-1.6-1.5h1.6Z"/><path fill="#EE9D0D" d="M25.3 18.7 38.6 31a1 1 0 0 1 0 1.4l-2.3 2.4-14.7-13.7 2.3-2.5a1 1 0 0 1 1.4 0Z"/><path fill="#CB2527" d="m30.3 23.4 3.2 3-3 3.2-3.2-3 3-3.2ZM31.8 22.8a.4.4 0 0 1-.3-.1l-.3-.4A5.9 5.9 0 0 1 30 18a.4.4 0 0 1 .9 0 5 5 0 0 0 1 3.7l.3.3a.4.4 0 0 1-.4.7Z"/><path fill="#EA2B2D" d="M30.7 23.7c-1.9.7-3.8 1-5.7.9h-1.1l1.9 1.7-.6 1.9 1.8-.6c1.7-.5 3.2-1.4 4.6-2.5l.3-.2-1.2-1.2Z"/><path fill="#CB2527" d="M37.8 26.4c-1.1 0-2.3-.3-3.2-1l-.4-.2a.4.4 0 0 1 0-.8.4.4 0 0 1 .5 0l.3.3a5 5 0 0 0 3.7.7.4.4 0 1 1 .2 1 6 6 0 0 1-1 0Z"/><path fill="#EA2B2D" d="M33.2 26c-.5 2-.7 3.9-.5 5.8l.1 1.1-1.9-1.8-1.8.7.4-1.8c.4-1.7 1.2-3.3 2.2-4.8l.2-.3 1.3 1.2Z"/><path fill="#6699CE" d="M21.5 17.4a.9.9 0 1 0 0-1.7.9.9 0 0 0 0 1.7Z"/><path fill="#FAA6B2" d="M16.7 27.5a.9.9 0 1 0 0-1.8.9.9 0 0 0 0 1.8Z"/><path fill="#A6DEFF" d="M18.4 17.9a.4.4 0 0 1-.4-.3v-.1a1.4 1.4 0 0 0-1.3-1 .4.4 0 0 1-.2-.8h.2a2.3 2.3 0 0 1 2.1 1.5.4.4 0 0 1-.4.7ZM20.6 25.6h-.2v-.1a1 1 0 0 0-1.1 0 .4.4 0 0 1-.5-.8 1.8 1.8 0 0 1 2 0 .4.4 0 0 1-.2.9Z"/><path fill="#EEB436" d="m17.6 18.6 1.3 1.2 1.8-.4-.7 1.7.9 1.6-1.8-.2-1.2 1.3-.4-1.8-1.7-.7 1.6-.9.2-1.8ZM23 26.6l-.5 1.8 1.2 1.3-1.8.2-1 1.5-.6-1.7-1.8-.4 1.4-1.1-.2-1.9 1.6 1 1.6-.7Z"/><path fill="#F72D2F" d="m33.2 26-2.5-2.3L33 21a4 4 0 0 1 2.6 2.4l-2.4 2.6Z"/></g><defs><clipPath id="a"><path fill="#fff" d="M15.8 15.7h25.4v25H15.8z"/></clipPath></defs></svg>'}),a("div",{class:"s-loyalty-program-panel-content"},a("h1",null,this.program.data.prize_promotion_title),a("p",null,this.program.data.prize_promotion_description))),a("div",{class:{"s-loyalty-program-slider-arrows":!0,"s-loyalty-program-tabs-hider":l.length<2||s<2}},a("salla-tabs",null,l.map((l=>a("salla-tab-header",{slot:"header",name:l.type},h[l.type],a("span",null,l.title)))),l.map((l=>a("salla-tab-content",{slot:"content",name:l.type},a("salla-slider",{id:l.type,type:"default","slider-config":'{"loop":false,"slidesPerView":"auto","freeMode":true,"spaceBetween":12,"breakpoints":{"768":{"slidesPerView":3,"spaceBetween":24,"freeMode":false,"speed":300}}}'},a("div",{slot:"items"},l.items.map((l=>a("salla-reward-card",{prize:l,onAreaClick:()=>{this.currentPrize=l,t((()=>this.detailsModal.open()))},onActionClick:()=>{this.currentPrize=l,t((()=>this.detailsModal.open()))}}))))))))))):""),a("salla-modal",{ref:a=>this.detailsModal=a,class:"s-loyalty-program-modal",width:"md",noPadding:!0},this.currentPrize?a("salla-reward-details",{onActionClick:()=>t((()=>this.exchangeModal.open())),prize:this.currentPrize}):""),a("salla-modal",{ref:a=>this.exchangeModal=a,class:"s-loyalty-program-modal",width:"sm"},this.currentPrize?a("salla-reward-exchange",{prize:this.currentPrize}):"")):null}};d([p((async()=>{const{data:a}=await salla.loyalty.getProgram();return s(a)}),{initialData:{prizes:[],prizes_count:0}})],y.prototype,"program",void 0),d([p((async()=>{const{data:a}=await salla.loyalty.getPoints();return a.points}),{initialData:null})],y.prototype,"points",void 0),y.style="";export{y as salla_loyalty_panel}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as a,H as t,a as n}from"./p-
|
|
4
|
+
import{r as e,h as a,H as t,a as n}from"./p-DkTbP5UX.js";import{S as i}from"./p-8Tsmrwno.js";const r=class{constructor(a){e(this,a)}componentWillLoad(){this.title=salla.config.get("maintenance_details.title"),this.message=salla.config.get("maintenance_details.message");const e="undefined"!=typeof window&&!window.matchMedia("(min-width: 768px)").matches;this.buttonTitle=e?salla.config.get("maintenance_details.button_title"):salla.config.get("maintenance_details.button_full_title")}closeAlert(){salla.storage.set("hide_salla-maintenance-alert_at",Date.now()),this.host.style.display="none"}render(){return a(t,{key:"138946ca54499c6125d04ecbcaea3f578ad463d7",class:"s-maintenance-alert-wrapper"},a("button",{key:"628862a36b7265092a281e464b356e4609ab461c",class:"s-maintenance-alert-close",innerHTML:i,onClick:()=>this.closeAlert()}),a("div",{key:"159a9a144cc2c5094df87b236448f7fd14a46874",class:"s-maintenance-alert-content"},a("div",{key:"fe29a1e35330ea4f17860347b40b4860ec0345bb",class:"s-maintenance-alert-container"},a("div",{key:"7c62e34354d0a63fdadda9b26be6d2470e6dd9b1",class:"s-maintenance-alert-icon"},a("img",{key:"98d19941151c2efcae9c209177646f05ae98e708",src:salla.url.cdn("images/alert.png"),alt:"Alert"})),a("div",{key:"7b3b7ffc5e5171ba1f7f8796487ea5239b47f8e1",class:"s-maintenance-alert-text"},a("h2",{key:"c6ee28d15e5e4c9e31698973d84966127b34e5cc"},this.title),a("p",{key:"5970ed9856c0f201446a342bc4009f12f4d9ee85"},this.message))),a("div",{key:"c8c9cdea353445770a0326091bb2278d21ddbb17"},a("a",{key:"979d8db01492abaa32b67ad50e87aeabd04647f7",class:"s-maintenance-alert-btn",href:salla.config.get("maintenance_details.button_url")},this.buttonTitle))))}componentDidLoad(){let e=salla.storage.get("hide_salla-maintenance-alert_at");e&&(Date.now()-e)/1e3/60<60&&this.closeAlert()}get host(){return n(this)}};r.style=".s-maintenance-alert-wrapper{display:flex;min-height:40px;width:100%;flex-direction:row;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(26, 38, 61, var(--tw-bg-opacity));padding:0.25rem 0.5rem;--tw-text-opacity:1;color:rgba(255, 255, 255, var(--tw-text-opacity))}.s-maintenance-alert-wrapper a{transition:0.35s cubic-bezier(0.2, 1, 0.3, 1)}.s-maintenance-alert-wrapper *{color:inherit}@media (min-width: 640px){.s-maintenance-alert-wrapper{padding-left:2rem;padding-right:2rem}}.s-maintenance-alert-content{margin-top:1rem;margin-bottom:1rem;display:flex;width:100%;align-items:center;justify-content:space-between}@media (min-width: 640px){.s-maintenance-alert-content{padding-left:2rem;padding-right:2rem}}.s-maintenance-alert-container{display:flex;align-items:center}.s-maintenance-alert-icon{margin-right:1.25rem;display:none}@media (min-width: 640px){.s-maintenance-alert-icon{display:block}}.s-maintenance-alert-text h2{margin-bottom:0.5rem;font-size:0.875rem;font-weight:700;line-height:1.4}@media (min-width: 640px){.s-maintenance-alert-text h2{font-size:1.5rem;line-height:2rem}}.s-maintenance-alert-text p{margin:0px;text-align:right;font-size:10px;line-height:1.2}@media (min-width: 640px){.s-maintenance-alert-text p{text-align:center;font-size:0.75rem;line-height:1}}.s-maintenance-alert-btn{position:relative;margin-left:4px;margin-right:4px;display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;border-radius:0.125rem;border-width:1px;--tw-border-opacity:1;border-color:rgba(93, 213, 196, var(--tw-border-opacity));--tw-bg-opacity:1;background-color:rgba(93, 213, 196, var(--tw-bg-opacity));padding:0.5rem;text-align:center;vertical-align:middle;font-size:0.875rem;font-weight:400;line-height:1.4;--tw-text-opacity:1;color:rgba(255, 255, 255, var(--tw-text-opacity))}.s-maintenance-alert-btn:hover{--tw-bg-opacity:1;background-color:rgba(53, 203, 181, var(--tw-bg-opacity))}.s-maintenance-alert-btn *{pointer-events:none}[dir=rtl] .s-maintenance-alert-btn{margin-left:1.25rem;margin-right:0}@media (min-width: 640px){.s-maintenance-alert-btn{padding:0.5rem 1rem}}";export{r as salla_maintenance_alert}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,h as l,H as s,a as n}from"./p-
|
|
4
|
+
import{r as a,h as l,H as s,a as n}from"./p-DkTbP5UX.js";const t=class{constructor(l){a(this,l),this.pointsData=null,this.productId=null}async componentWillLoad(){try{if(await salla.onReady(),await salla.lang.onLoaded(),this.productId=this.host.dataset.productId||salla.config.get("page.id"),!this.productId)return;const a=await salla.api.request(`/loyalty/products/${this.productId}/points`).catch((()=>null));this.pointsData=a?.data||null}catch(a){salla?.logger?.warn?.("salla-loyalty-points-banner: init failed",a)}}render(){return this.productId&&this.pointsData?.points?l(s,null,l("div",{class:"s-loyalty-points-banner-container"},l("div",{class:"s-loyalty-points-banner-icon"},l("span",{class:"s-loyalty-points-banner-inner-icon",innerHTML:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8.76604 2.86201C9.31804 2.61001 9.93304 2.41501 10.611 2.27701C11.289 2.13901 12 2.07001 12.744 2.07001C13.572 2.07001 14.364 2.15401 15.12 2.32201C15.84 2.49001 16.356 2.81401 16.668 3.29401C16.932 3.70201 17.064 4.26001 17.064 4.96801V13.032C17.064 13.416 16.95 13.752 16.722 14.04C16.506 14.304 16.227 14.493 15.885 14.607C15.543 14.721 15.204 14.742 14.868 14.67C14.196 14.514 13.488 14.436 12.744 14.436C12.084 14.436 11.442 14.502 10.818 14.634C10.23 14.754 9.70204 14.922 9.23404 15.138C8.68204 15.39 8.06704 15.585 7.38904 15.723C6.71104 15.861 6.00004 15.93 5.25604 15.93C4.42804 15.93 3.63604 15.846 2.88004 15.678C2.18404 15.522 1.68004 15.21 1.36804 14.742C1.08004 14.322 0.936035 13.752 0.936035 13.032V4.96801C0.936035 4.58401 1.05004 4.24801 1.27804 3.96001C1.49404 3.69601 1.77304 3.50701 2.11504 3.39301C2.45704 3.27901 2.79604 3.25801 3.13204 3.33001C3.80404 3.48601 4.51204 3.56401 5.25604 3.56401C5.91604 3.56401 6.55804 3.49801 7.18204 3.36601C7.77004 3.24601 8.29804 3.07801 8.76604 2.86201ZM11.25 9.00001C11.25 8.59201 11.148 8.21701 10.944 7.87501C10.74 7.53301 10.467 7.26001 10.125 7.05601C9.78304 6.85201 9.40804 6.75001 9.00004 6.75001C8.59204 6.75001 8.21704 6.85201 7.87504 7.05601C7.53304 7.26001 7.26004 7.53301 7.05604 7.87501C6.85204 8.21701 6.75004 8.59201 6.75004 9.00001C6.75004 9.40801 6.85204 9.78301 7.05604 10.125C7.26004 10.467 7.53304 10.74 7.87504 10.944C8.21704 11.148 8.59204 11.25 9.00004 11.25C9.40804 11.25 9.78304 11.148 10.125 10.944C10.467 10.74 10.74 10.467 10.944 10.125C11.148 9.78301 11.25 9.40801 11.25 9.00001ZM14.328 7.79401C14.076 7.75801 13.812 7.73401 13.536 7.72201C13.38 7.71001 13.245 7.75501 13.131 7.85701C13.017 7.95901 12.954 8.08801 12.942 8.24401C12.93 8.40001 12.975 8.53501 13.077 8.64901C13.179 8.76301 13.308 8.82601 13.464 8.83801C13.704 8.85001 13.938 8.87401 14.166 8.91001C14.322 8.93401 14.463 8.90101 14.589 8.81101C14.715 8.72101 14.787 8.59801 14.805 8.44201C14.823 8.28601 14.787 8.14501 14.697 8.01901C14.607 7.89301 14.484 7.81801 14.328 7.79401ZM4.53604 9.16201C4.29604 9.15001 4.06204 9.12601 3.83404 9.09001C3.67804 9.06601 3.53704 9.09901 3.41104 9.18901C3.28504 9.27901 3.21304 9.40201 3.19504 9.55801C3.17704 9.71401 3.21304 9.85501 3.30304 9.98101C3.39304 10.107 3.51604 10.182 3.67204 10.206C3.92404 10.242 4.18804 10.266 4.46404 10.278C4.62004 10.29 4.75504 10.245 4.86904 10.143C4.98304 10.041 5.04604 9.91201 5.05804 9.75601C5.07004 9.60001 5.02504 9.46501 4.92304 9.35101C4.82104 9.23701 4.69204 9.17401 4.53604 9.16201Z" fill="white"/>\n</svg>\n'})),l("p",null,l("span",{class:"s-loyalty-points-banner-label"},salla.lang.get("pages.loyalty_program.earn")," "),l("span",{class:"s-loyalty-points-banner-label"},`+${this.pointsData.points}`," "),l("span",{class:"s-loyalty-points-banner-label"},salla.lang.get("pages.loyalty_program.loyalty_point")," "),l("span",{class:"s-loyalty-points-banner-description"},salla.lang.get("pages.loyalty_program.on_order_total_when_purchase"))))):null}get host(){return n(this)}};t.style="";export{t as salla_loyalty_points_banner}
|