@salla.sa/twilight-components 2.14.546 → 2.14.548
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-CbpPZZga.js → filepond-CGA4aTUA.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-BmWPw2D9.js → filepond-plugin-file-poster-DyVz7vP9.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-De7XZguT.js → filepond-plugin-file-validate-size-CgzYDBcU.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-BHdxCuXU.js → filepond-plugin-file-validate-type-Dx2CbMZ9.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-DJZbgt5_.js → filepond-plugin-image-edit-D3aTsFmD.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-BtLJO8iG.js → filepond-plugin-image-exif-orientation-BW3usWts.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-BRUyTRh3.js → filepond-plugin-image-preview-Bb7_UNPY.js} +1 -1
- package/dist/cjs/{index-EoqYCrI-.js → index-BssNhL-x.js} +30 -26
- package/dist/cjs/{intlTelInput-CxKIlDCD.js → intlTelInput-B7QYiZ0d.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{mail-C9D8MHae.js → mail-CO8cFZH7.js} +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +12 -5
- 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-attachment-view_9.cjs.entry.js +10 -10
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
- package/dist/cjs/{salla-comment-form_8.cjs.entry.js → salla-comment-form_9.cjs.entry.js} +264 -4
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
- 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_10.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_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_2.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_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +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-products-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +3 -3
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +208 -103
- package/dist/cjs/salla-rating-modal.cjs.entry.js +23 -8
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +4 -4
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +3 -3
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-ClshNzKX.js → vanilla-picker-H1di5S1s.js} +1 -1
- package/dist/collection/collection-manifest.json +14 -12
- package/dist/collection/components/salla-comments/interfaces.js +12 -0
- package/dist/collection/components/salla-comments/salla-comment-item.js +1 -1
- package/dist/collection/components/salla-comments/salla-comments.js +42 -5
- package/dist/collection/components/salla-modal/salla-modal.css +11 -0
- package/dist/collection/components/salla-modal/salla-modal.js +33 -6
- package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +253 -104
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.css +34 -21
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +69 -10
- package/dist/collection/components/salla-rating-stars/salla-rating-stars.css +5 -0
- package/dist/collection/components/salla-verified-review/salla-verified-review.css +162 -0
- package/dist/collection/components/salla-verified-review/salla-verified-review.js +264 -0
- package/dist/components/index.js +18 -14
- package/dist/components/salla-comment-item2.js +1 -1
- package/dist/components/salla-comments.js +44 -1
- package/dist/components/salla-modal2.js +12 -4
- package/dist/components/salla-rating-modal-v22.js +208 -101
- package/dist/components/salla-rating-modal.js +1 -591
- package/dist/components/salla-rating-modal2.js +613 -0
- package/dist/components/salla-rating-stars2.js +1 -1
- package/dist/components/salla-verified-review.d.ts +11 -0
- package/dist/components/salla-verified-review.js +325 -0
- package/dist/esm/{filepond-CF5m44bJ.js → filepond-CXmbiROU.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-CcB1Ah8E.js → filepond-plugin-file-poster-DrmkMK37.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-BwVhV38u.js → filepond-plugin-file-validate-size-fRXLDtKY.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-GBCLCzPk.js → filepond-plugin-file-validate-type-9x4CtZKy.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-CrBe3Dh3.js → filepond-plugin-image-edit-BTjvSjn9.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-C2Cj5Jrc.js → filepond-plugin-image-exif-orientation-CnSOx2Lm.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-YVKQw3-Q.js → filepond-plugin-image-preview-Cy0Nd8Xr.js} +1 -1
- package/dist/esm/{index-FwRU05yW.js → index-B64o_70M.js} +30 -26
- package/dist/esm/{intlTelInput-B1_kbUW3.js → intlTelInput-FF2eKbuC.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mail-DzAIgzdz.js → mail-DmgxDvXL.js} +2 -2
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +12 -5
- 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-attachment-view_9.entry.js +10 -10
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-cart-summary-card.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +1 -1
- package/dist/esm/{salla-comment-form_8.entry.js → salla-comment-form_9.entry.js} +264 -5
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +3 -3
- 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_10.entry.js +3 -3
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_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_2.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_2.entry.js +1 -1
- package/dist/esm/salla-order-shipments.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +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-products-slider.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +3 -3
- package/dist/esm/salla-rating-modal-v2.entry.js +208 -103
- package/dist/esm/salla-rating-modal.entry.js +23 -8
- package/dist/esm/salla-review-factors-tags.entry.js +1 -1
- package/dist/esm/salla-review-order-item.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +4 -4
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +3 -3
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-oTEQUNmA.js → vanilla-picker-DMNociUd.js} +1 -1
- package/dist/twilight/{p-74bee051.entry.js → p-003648b5.entry.js} +1 -1
- package/dist/twilight/{p-52f4642b.entry.js → p-04cc5898.entry.js} +1 -1
- package/dist/twilight/{p-BcYofOgx.js → p-0MyCcOKI.js} +1 -1
- package/dist/twilight/{p-71ff2062.entry.js → p-0c7bdda5.entry.js} +1 -1
- package/dist/twilight/{p-b389fa5c.entry.js → p-0dfd760b.entry.js} +1 -1
- package/dist/twilight/{p-904ca909.entry.js → p-13978ff2.entry.js} +1 -1
- package/dist/twilight/{p-d11f2263.entry.js → p-1485dedd.entry.js} +1 -1
- package/dist/twilight/{p-c4be5709.entry.js → p-1628c63c.entry.js} +1 -1
- package/dist/twilight/{p-a7346ee5.entry.js → p-177e9071.entry.js} +1 -1
- package/dist/twilight/{p-e7819b7b.entry.js → p-19b03612.entry.js} +1 -1
- package/dist/twilight/{p-df48abfb.entry.js → p-1ad71324.entry.js} +1 -1
- package/dist/twilight/{p-2dd4ddc7.entry.js → p-1ce848ab.entry.js} +1 -1
- package/dist/twilight/{p-3250ee03.entry.js → p-1edbb249.entry.js} +1 -1
- package/dist/twilight/{p-ceceeaed.entry.js → p-233b9115.entry.js} +1 -1
- package/dist/twilight/{p-a3897cf4.entry.js → p-26c750c8.entry.js} +1 -1
- package/dist/twilight/p-2ddabee9.entry.js +4 -0
- package/dist/twilight/{p-b95b3bf0.entry.js → p-2f64c3b3.entry.js} +1 -1
- package/dist/twilight/{p-682f00d1.entry.js → p-309f771b.entry.js} +1 -1
- package/dist/twilight/{p-5df95bdb.entry.js → p-37b73a97.entry.js} +1 -1
- package/dist/twilight/{p-f55eb61c.entry.js → p-3b7cbf05.entry.js} +1 -1
- package/dist/twilight/{p-1286f679.entry.js → p-3eb853f9.entry.js} +1 -1
- package/dist/twilight/{p-5cfc9f8c.entry.js → p-3f460184.entry.js} +1 -1
- package/dist/twilight/{p-e71c064e.entry.js → p-40d4ccbb.entry.js} +1 -1
- package/dist/twilight/{p-34f38efd.entry.js → p-440687a4.entry.js} +1 -1
- package/dist/twilight/{p-d8313f41.entry.js → p-441ee14a.entry.js} +1 -1
- package/dist/twilight/{p-06335f34.entry.js → p-49c7dc56.entry.js} +1 -1
- package/dist/twilight/{p-e7a672b4.entry.js → p-522fb030.entry.js} +1 -1
- package/dist/twilight/{p-b9634ee2.entry.js → p-52607d64.entry.js} +1 -1
- package/dist/twilight/{p-49117243.entry.js → p-5273dbb2.entry.js} +1 -1
- package/dist/twilight/{p-981da139.entry.js → p-55cbacd7.entry.js} +1 -1
- package/dist/twilight/{p-b0730cef.entry.js → p-569ad58b.entry.js} +1 -1
- package/dist/twilight/{p-ad30742f.entry.js → p-56e553e4.entry.js} +1 -1
- package/dist/twilight/p-5ab11313.entry.js +4 -0
- package/dist/twilight/{p-c078fb93.entry.js → p-5c9e4502.entry.js} +1 -1
- package/dist/twilight/{p-13fc84ad.entry.js → p-5f860460.entry.js} +1 -1
- package/dist/twilight/{p-7fafe29c.entry.js → p-5f9b8ada.entry.js} +1 -1
- package/dist/twilight/{p-f7b8430f.entry.js → p-602e632c.entry.js} +1 -1
- package/dist/twilight/{p-d550f1f9.entry.js → p-63a2ee05.entry.js} +1 -1
- package/dist/twilight/{p-26ae2623.entry.js → p-63acbca7.entry.js} +1 -1
- package/dist/twilight/{p-158e1872.entry.js → p-63cebaef.entry.js} +1 -1
- package/dist/twilight/{p-51add824.entry.js → p-6451e759.entry.js} +1 -1
- package/dist/twilight/{p-767d37bb.entry.js → p-647832d9.entry.js} +1 -1
- package/dist/twilight/{p-d76abd6d.entry.js → p-660a552a.entry.js} +1 -1
- package/dist/twilight/{p-6081d494.entry.js → p-66ece3d6.entry.js} +1 -1
- package/dist/twilight/{p-92175855.entry.js → p-6cd863b9.entry.js} +1 -1
- package/dist/twilight/{p-ada73e68.entry.js → p-74a1a32f.entry.js} +1 -1
- package/dist/twilight/{p-1a7b7e21.entry.js → p-74c7cc02.entry.js} +1 -1
- package/dist/twilight/{p-53184934.entry.js → p-77fa0f9f.entry.js} +1 -1
- package/dist/twilight/{p-d295757a.entry.js → p-7c2a0a8b.entry.js} +1 -1
- package/dist/twilight/{p-662a5816.entry.js → p-7ce5c2cd.entry.js} +1 -1
- package/dist/twilight/{p-dfdf96be.entry.js → p-7eca6506.entry.js} +1 -1
- package/dist/twilight/{p-b7ae6c1c.entry.js → p-840dd411.entry.js} +1 -1
- package/dist/twilight/{p-eeb89f05.entry.js → p-87227eb2.entry.js} +1 -1
- package/dist/twilight/{p-79e3d1dd.entry.js → p-897b8824.entry.js} +1 -1
- package/dist/twilight/{p-bc98ccad.entry.js → p-8e293878.entry.js} +1 -1
- package/dist/twilight/{p-87ba263e.entry.js → p-8e631629.entry.js} +1 -1
- package/dist/twilight/{p-b98fb8ae.entry.js → p-923a35da.entry.js} +1 -1
- package/dist/twilight/{p-c3208f6d.entry.js → p-971b8ff5.entry.js} +1 -1
- package/dist/twilight/p-991fa4ad.entry.js +4 -0
- package/dist/twilight/{p-cac60dea.entry.js → p-9a617c41.entry.js} +1 -1
- package/dist/twilight/{p-298b9d8a.entry.js → p-9ae25175.entry.js} +1 -1
- package/dist/twilight/{p-682dc578.entry.js → p-9dbf3ff4.entry.js} +1 -1
- package/dist/twilight/p-B64o_70M.js +5 -0
- package/dist/twilight/{p-DyxHX342.js → p-BK166pHQ.js} +1 -1
- package/dist/twilight/{p-j-4Intu2.js → p-BcGXp0zm.js} +1 -1
- package/dist/twilight/{p-B9dZFOmF.js → p-Bh11vKua.js} +1 -1
- package/dist/twilight/{p-qzPm0si4.js → p-DBnECOny.js} +2 -2
- package/dist/twilight/{p-BxHJHdpj.js → p-DWqu98fW.js} +1 -1
- package/dist/twilight/{p-DzAIgzdz.js → p-DmgxDvXL.js} +1 -1
- package/dist/twilight/{p-CiKg2aqy.js → p-DrJZdc5M.js} +1 -1
- package/dist/twilight/{p-CCPvqpeZ.js → p-GwasjFLA.js} +1 -1
- package/dist/twilight/{p-BLBFg-He.js → p-UxfFm_QX.js} +1 -1
- package/dist/twilight/{p-df069a34.entry.js → p-a0e8ca67.entry.js} +1 -1
- package/dist/twilight/{p-176b9746.entry.js → p-a5199e7d.entry.js} +1 -1
- package/dist/twilight/{p-61953ae7.entry.js → p-a7fccb9c.entry.js} +1 -1
- package/dist/twilight/{p-ae8cbf4f.entry.js → p-a867beee.entry.js} +1 -1
- package/dist/twilight/{p-65be2237.entry.js → p-ace041b9.entry.js} +1 -1
- package/dist/twilight/{p-f6493289.entry.js → p-b0500232.entry.js} +1 -1
- package/dist/twilight/{p-3446e76a.entry.js → p-b0a87a8d.entry.js} +1 -1
- package/dist/twilight/{p-55aa8c39.entry.js → p-b16264a3.entry.js} +1 -1
- package/dist/twilight/{p-718a5f9b.entry.js → p-b17c6f84.entry.js} +1 -1
- package/dist/twilight/{p-75de4995.entry.js → p-b4d47e7c.entry.js} +1 -1
- package/dist/twilight/{p-f63aecb0.entry.js → p-b4f2f280.entry.js} +1 -1
- package/dist/twilight/{p-179625fd.entry.js → p-b4fda5f4.entry.js} +1 -1
- package/dist/twilight/{p-f15f6265.entry.js → p-b8cd26a7.entry.js} +1 -1
- package/dist/twilight/{p-736e9843.entry.js → p-ba32a9d2.entry.js} +1 -1
- package/dist/twilight/{p-61ae00d6.entry.js → p-be916b5f.entry.js} +1 -1
- package/dist/twilight/{p-e2df9129.entry.js → p-c26f1183.entry.js} +1 -1
- package/dist/twilight/{p-7df2c1d5.entry.js → p-c5d1b2e4.entry.js} +1 -1
- package/dist/twilight/{p-bcf3d118.entry.js → p-c8dae54b.entry.js} +1 -1
- package/dist/twilight/{p-0fc9be21.entry.js → p-c9b1ad01.entry.js} +1 -1
- package/dist/twilight/{p-72dba918.entry.js → p-cacf3c75.entry.js} +1 -1
- package/dist/twilight/{p-2862c6bb.entry.js → p-cb02e6db.entry.js} +1 -1
- package/dist/twilight/{p-a32bad0b.entry.js → p-d0847af9.entry.js} +1 -1
- package/dist/twilight/{p-01e01e63.entry.js → p-d7e4f0f8.entry.js} +1 -1
- package/dist/twilight/{p-c2980ef7.entry.js → p-db4dc7cc.entry.js} +1 -1
- package/dist/twilight/{p-a91c674c.entry.js → p-e0f3e985.entry.js} +1 -1
- package/dist/twilight/{p-2dfd3810.entry.js → p-e354292f.entry.js} +1 -1
- package/dist/twilight/{p-110bd105.entry.js → p-e4db462b.entry.js} +1 -1
- package/dist/twilight/{p-2f6ba6f1.entry.js → p-e826d3aa.entry.js} +1 -1
- package/dist/twilight/{p-cb737c93.entry.js → p-f12f8db3.entry.js} +1 -1
- package/dist/twilight/{p-e73bab6b.entry.js → p-f99550d8.entry.js} +1 -1
- package/dist/twilight/{p-46d047ac.entry.js → p-fa0467a7.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-comments/interfaces.d.ts +15 -0
- package/dist/types/components/salla-comments/salla-comments.d.ts +5 -2
- package/dist/types/components/salla-modal/salla-modal.d.ts +7 -2
- package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +20 -5
- package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +10 -2
- package/dist/types/components/salla-verified-review/salla-verified-review.d.ts +51 -0
- package/dist/types/components.d.ts +59 -16
- package/package.json +5 -5
- package/dist/twilight/p-96826106.entry.js +0 -4
- package/dist/twilight/p-FwRU05yW.js +0 -5
- package/dist/twilight/p-cc8209fc.entry.js +0 -4
- package/dist/twilight/p-dcf9417c.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 i,H as e}from"./p-FwRU05yW.js";var r,n;!function(t){t.PERCENTAGE="percentage",t.FIXED="fixed",t.FREE_PRODUCT="free_product"}(r||(r={})),function(t){t.PRODUCT_COUNT="products_count",t.PRODUCT_PURCHASE="order_amount"}(n||(n={}));const o=class{constructor(i){t(this,i),this.offer=null,this.products={},this.isLoading=!1,this.canRender=!0}componentWillLoad(){salla.onReady().then((()=>{if(!salla.config.get("store.features")?.includes("conditional-offer")||""!==salla.storage.get("cart")&&!salla.storage.get("cart")?.summary?.count)throw new Error("feature or cart object does not existed")})).then((()=>salla.api.cart.offers())).then((({data:t})=>{if(this.offer=t.find((t=>"conditional"===t.type)),this.offer)return this.isLoading=!0,this.offer.details.discounts.unshift({value:0,min_spend:0}),this.updateInitialOfferValue();this.canRender=!1})).then((()=>{if(this.offer)return this.getProducts()})).then((()=>{this.offer&&salla.event.on("cart::updated",(t=>this.updateOfferValues(t)))})).catch((t=>{this.canRender=!1,salla.logger.warn("salla-conditional-offer:: ",t)})).finally((()=>{this.isLoading=!1}))}getProducts(){const t=this.offer.details.discounts.filter((({type:t})=>t===r.FREE_PRODUCT)).map((({value:t})=>t)).filter(Boolean);if(t.length>0)return salla.product.fetch({source:"selected",source_value:t}).then((t=>{const i=t?.data;if(i&&Array.isArray(i)){const t={...this.products};i.forEach((({id:i,url:e,image:r,name:n,price:o})=>{i&&n&&r?.url&&e&&void 0!==o&&(t[i]={url:e,image:r,name:n,price:o})})),this.products=t}}))}updateInitialOfferValue(){return salla.api.cart.details().then((({data:{cart:t}})=>this.updateOfferValues(t)))}updateOfferValues({items:t,sub_total:i}){const e=this.offer.details.based_on===n.PRODUCT_COUNT?t?.reduce(((t,{quantity:i})=>t+i),0)??0:i;return this.offer={...this.offer,details:{...this.offer?.details,current_value:e}},this.offer}renderTooltip(t){const e=t.value,r=this.products[e];return r?i("salla-tooltip",{class:"absolute left-0 -top-2",targetId:`avatar-product-${e}`,theme:"dark"},i("div",{class:"flex gap-3 text-start"},r?.image?.url&&i("img",{src:r.image.url,alt:r?.image?.alt||r.name||"",class:"w-12 h-12 object-cover rounded-lg flex-shrink-0",loading:"lazy",decoding:"async"}),i("div",{class:"flex-1"},i("div",{class:"leading-tight mb-1"},r.name),i("div",{class:"text-xs text-gray-300",innerHTML:salla.money(r.price)})))):(salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`),null)}getCheckpointContent(t){if(t.type===r.PERCENTAGE)return`${t.value}%`;if(t.type===r.FIXED)return i("span",{innerHTML:salla.money(t.value)});if(t.type!==r.FREE_PRODUCT)return salla.logger.error(`salla-conditional-offer:: unexpected type (${t.type})!`),"";const e=this.products[t.value];return e?i("a",{class:"s-conditional-offer-product-link",href:e.url},i("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:e?.image?.alt||"",src:e?.image?.url})):(salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`),"")}getOfferType(t){const i=this.offer.details?.based_on;if(i===n.PRODUCT_COUNT)try{return salla.lang.choice("blocks.header.products_count",t.min_spend)}catch(i){return salla.logger.warn("salla-conditional-offer:: invalid products_count interval",i),`${t.min_spend}`}return i===n.PRODUCT_PURCHASE?salla.money(t.min_spend):(salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${i}`),`${t.min_spend}`)}clamp(t,i,e){return Math.max(i,Math.min(t,e))}mapValueRanges(t,i,e,r,n){const o=(t-i)*(n-r)/(e-i)+r;return o===Number.POSITIVE_INFINITY?100:o===Number.NEGATIVE_INFINITY?0:this.clamp(o,0,100)}getCheckPointView(t,e){const n=this.offer.details.discounts.findIndex((({min_spend:i})=>i===t.min_spend)),o=this.mapValueRanges(this.offer.details.current_value,this.offer.details.discounts[n-1]?.min_spend??0,t.min_spend,0,100),a=t.min_spend<=this.offer.details.current_value;return i("div",{class:"s-conditional-offer-checkpoint-container"},e>0?[i("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},i("div",{class:"s-conditional-offer-progress-line-inactive"}),i("div",{class:"s-conditional-offer-progress-line-active",style:{width:`${o}%`}})),i("div",{key:"checkpoint",class:"s-conditional-offer-checkpoint "+(a?"s-conditional-offer-active-checkpoint":"")},i("div",{class:"s-conditional-offer-item-avatar-content "+(a?"active":""),id:t.type===r.FREE_PRODUCT?`avatar-product-${t.value}`:`avatar-${t.value??e}`},this.products&&this.getCheckpointContent(t)),this.products&&t.type===r.FREE_PRODUCT&&this.renderTooltip(t),i("div",{class:"s-conditional-offer-checkpoint-label "+(a?"active":""),innerHTML:this.getOfferType(t)}))]:i("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":!0,"first-checkpoint":0===e,active:a,hidden:0===e,"sm:block":0===e},innerHTML:this.getOfferType(t)}))}getLoadingSkeletonView(){return i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-skeleton-inner-container"},i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"30%"})),i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"35%"})),i("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((()=>[i("salla-skeleton",{key:"checkpoint-line",height:"8px"}),i("div",{key:"checkpoint"},i("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))])))))}render(){return this.canRender?this.isLoading?this.getLoadingSkeletonView():this.offer?i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-title-wrapper"},i("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?i("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",i("i",{class:"sicon-information"})):null),i("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map(((t,e)=>i("div",{class:{"flex-1":e>0},key:t.min_spend},this.getCheckPointView(t,e)))))):null:null}};o.style='/*!twlt*/:host{display:block}.fixed{position:fixed}.absolute{position:absolute}.-top-2{top:-0.5rem}.left-0{left:0px}.mb-1{margin-bottom:0.25rem}.block{display:block}.flex{display:flex}.hidden{display:none}.h-12{height:3rem}.w-12{width:3rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.gap-3{gap:0.75rem}.rounded-lg{border-radius:0.5rem}.object-cover{object-fit:cover}.text-start{text-align:start}.text-xs{font-size:0.75rem;line-height:1rem}.leading-tight{line-height:1.25}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-conditional-offer-container{position:relative;display:inline-flex;width:100%;flex-direction:column;align-items:center;justify-content:flex-start;gap:1.25rem;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1.25rem;padding-right:1.25rem;padding-top:1rem;padding-bottom:4rem}@media (min-width: 768px){.s-conditional-offer-container{padding-left:2.5rem;padding-right:2.5rem;padding-top:2rem;padding-bottom:2rem}}.s-conditional-offer-title-wrapper{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;align-self:stretch}.s-conditional-offer-title{text-align:center;font-size:1.25rem;line-height:1.75rem;font-weight:700;color:var(--color-primary-dark)}.s-conditional-offer-subtitle{display:inline-flex;align-items:center;justify-content:center;gap:0.25rem;align-self:stretch;text-align:center;font-size:0.75rem;line-height:1rem;font-weight:400;--tw-text-opacity:1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.s-conditional-offer-subtitle i{position:relative}.s-conditional-offer-progress-line{height:1px;align-self:stretch;background-color:var(--color-primary)}.s-conditional-offer-checkpoint-border{display:flex;height:60px;min-width:60px;flex-direction:column;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-conditional-offer-checkpoint-border-colored{border-color:var(--color-primary);color:var(--color-primary-dark)}.s-conditional-offer-product-link{display:grid;aspect-ratio:1 / 1;height:58px;place-content:center;overflow:hidden;border-radius:9999px}.s-conditional-offer-checkpoint-image-content{height:58px;width:58px;object-fit:cover}.s-conditional-offer-progress-container{position:relative;margin-bottom:2rem;display:flex;height:8rem;width:100%;flex-wrap:wrap;align-items:center;justify-content:center}@media (min-width: 768px){.s-conditional-offer-progress-container{height:4rem}}.s-conditional-offer-item-avatar-content{text-align:center;font-size:0.875rem;font-weight:700;line-height:1.25rem}.s-conditional-offer-item-avatar-content.active{color:var(--color-primary-dark);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}.s-conditional-offer-checkpoint{position:relative;display:flex;height:60px;width:60px;flex-shrink:0;flex-direction:column;align-items:center;justify-content:center;border-radius:9999px;border-width:1px}.s-conditional-offer-progress-line-container{display:grid;width:100%;overflow:hidden;grid-template-areas:\'progress-line\'}.s-conditional-offer-progress-line-inactive{height:1.5px;width:100%;--tw-bg-opacity:1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1));transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1);grid-area:progress-line}.s-conditional-offer-progress-line-active{height:1.5px;width:0%;background-color:var(--color-primary);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1);grid-area:progress-line}.s-conditional-offer-checkpoint-label{position:absolute;top:100%;left:50%;width:max-content;--tw-translate-x:-50%;--tw-translate-y:20%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}.s-conditional-offer-checkpoint-label.active{color:var(--color-primary-dark);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}.s-conditional-offer-checkpoint-label.first-checkpoint{--tw-translate-y:132%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-conditional-offer-checkpoint-label.first-checkpoint:where([dir="ltr"],[dir="ltr"] *){--tw-translate-x:0%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-conditional-offer-checkpoint-label.first-checkpoint:where([dir="rtl"],[dir="rtl"] *){--tw-translate-x:-100%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-conditional-offer-checkpoint-container{position:relative;display:flex;align-items:center}.s-conditional-offer-active-checkpoint{display:flex;justify-content:center;border-color:var(--color-primary);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}.s-conditional-offer-skeleton-inner-container{margin-bottom:2rem;width:100%}@media (min-width: 768px){.s-conditional-offer-skeleton-inner-container{margin-bottom:0px}}.s-conditional-offer-skeleton-title{margin-bottom:1rem;display:flex;justify-content:center}.s-conditional-offer-skeleton-subtitle{margin-bottom:1.5rem;display:flex;justify-content:center}.s-conditional-offer-skeleton-checkpoints-wrapper{display:flex;align-items:center}@media (min-width: 640px){.sm\\:block{display:block}}';export{o as salla_conditional_offer}
|
|
4
|
+
import{r as t,h as i,H as e}from"./p-B64o_70M.js";var r,n;!function(t){t.PERCENTAGE="percentage",t.FIXED="fixed",t.FREE_PRODUCT="free_product"}(r||(r={})),function(t){t.PRODUCT_COUNT="products_count",t.PRODUCT_PURCHASE="order_amount"}(n||(n={}));const o=class{constructor(i){t(this,i),this.offer=null,this.products={},this.isLoading=!1,this.canRender=!0}componentWillLoad(){salla.onReady().then((()=>{if(!salla.config.get("store.features")?.includes("conditional-offer")||""!==salla.storage.get("cart")&&!salla.storage.get("cart")?.summary?.count)throw new Error("feature or cart object does not existed")})).then((()=>salla.api.cart.offers())).then((({data:t})=>{if(this.offer=t.find((t=>"conditional"===t.type)),this.offer)return this.isLoading=!0,this.offer.details.discounts.unshift({value:0,min_spend:0}),this.updateInitialOfferValue();this.canRender=!1})).then((()=>{if(this.offer)return this.getProducts()})).then((()=>{this.offer&&salla.event.on("cart::updated",(t=>this.updateOfferValues(t)))})).catch((t=>{this.canRender=!1,salla.logger.warn("salla-conditional-offer:: ",t)})).finally((()=>{this.isLoading=!1}))}getProducts(){const t=this.offer.details.discounts.filter((({type:t})=>t===r.FREE_PRODUCT)).map((({value:t})=>t)).filter(Boolean);if(t.length>0)return salla.product.fetch({source:"selected",source_value:t}).then((t=>{const i=t?.data;if(i&&Array.isArray(i)){const t={...this.products};i.forEach((({id:i,url:e,image:r,name:n,price:o})=>{i&&n&&r?.url&&e&&void 0!==o&&(t[i]={url:e,image:r,name:n,price:o})})),this.products=t}}))}updateInitialOfferValue(){return salla.api.cart.details().then((({data:{cart:t}})=>this.updateOfferValues(t)))}updateOfferValues({items:t,sub_total:i}){const e=this.offer.details.based_on===n.PRODUCT_COUNT?t?.reduce(((t,{quantity:i})=>t+i),0)??0:i;return this.offer={...this.offer,details:{...this.offer?.details,current_value:e}},this.offer}renderTooltip(t){const e=t.value,r=this.products[e];return r?i("salla-tooltip",{class:"absolute left-0 -top-2",targetId:`avatar-product-${e}`,theme:"dark"},i("div",{class:"flex gap-3 text-start"},r?.image?.url&&i("img",{src:r.image.url,alt:r?.image?.alt||r.name||"",class:"w-12 h-12 object-cover rounded-lg flex-shrink-0",loading:"lazy",decoding:"async"}),i("div",{class:"flex-1"},i("div",{class:"leading-tight mb-1"},r.name),i("div",{class:"text-xs text-gray-300",innerHTML:salla.money(r.price)})))):(salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`),null)}getCheckpointContent(t){if(t.type===r.PERCENTAGE)return`${t.value}%`;if(t.type===r.FIXED)return i("span",{innerHTML:salla.money(t.value)});if(t.type!==r.FREE_PRODUCT)return salla.logger.error(`salla-conditional-offer:: unexpected type (${t.type})!`),"";const e=this.products[t.value];return e?i("a",{class:"s-conditional-offer-product-link",href:e.url},i("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:e?.image?.alt||"",src:e?.image?.url})):(salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`),"")}getOfferType(t){const i=this.offer.details?.based_on;if(i===n.PRODUCT_COUNT)try{return salla.lang.choice("blocks.header.products_count",t.min_spend)}catch(i){return salla.logger.warn("salla-conditional-offer:: invalid products_count interval",i),`${t.min_spend}`}return i===n.PRODUCT_PURCHASE?salla.money(t.min_spend):(salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${i}`),`${t.min_spend}`)}clamp(t,i,e){return Math.max(i,Math.min(t,e))}mapValueRanges(t,i,e,r,n){const o=(t-i)*(n-r)/(e-i)+r;return o===Number.POSITIVE_INFINITY?100:o===Number.NEGATIVE_INFINITY?0:this.clamp(o,0,100)}getCheckPointView(t,e){const n=this.offer.details.discounts.findIndex((({min_spend:i})=>i===t.min_spend)),o=this.mapValueRanges(this.offer.details.current_value,this.offer.details.discounts[n-1]?.min_spend??0,t.min_spend,0,100),a=t.min_spend<=this.offer.details.current_value;return i("div",{class:"s-conditional-offer-checkpoint-container"},e>0?[i("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},i("div",{class:"s-conditional-offer-progress-line-inactive"}),i("div",{class:"s-conditional-offer-progress-line-active",style:{width:`${o}%`}})),i("div",{key:"checkpoint",class:"s-conditional-offer-checkpoint "+(a?"s-conditional-offer-active-checkpoint":"")},i("div",{class:"s-conditional-offer-item-avatar-content "+(a?"active":""),id:t.type===r.FREE_PRODUCT?`avatar-product-${t.value}`:`avatar-${t.value??e}`},this.products&&this.getCheckpointContent(t)),this.products&&t.type===r.FREE_PRODUCT&&this.renderTooltip(t),i("div",{class:"s-conditional-offer-checkpoint-label "+(a?"active":""),innerHTML:this.getOfferType(t)}))]:i("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":!0,"first-checkpoint":0===e,active:a,hidden:0===e,"sm:block":0===e},innerHTML:this.getOfferType(t)}))}getLoadingSkeletonView(){return i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-skeleton-inner-container"},i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"30%"})),i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"35%"})),i("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((()=>[i("salla-skeleton",{key:"checkpoint-line",height:"8px"}),i("div",{key:"checkpoint"},i("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))])))))}render(){return this.canRender?this.isLoading?this.getLoadingSkeletonView():this.offer?i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-title-wrapper"},i("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?i("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",i("i",{class:"sicon-information"})):null),i("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map(((t,e)=>i("div",{class:{"flex-1":e>0},key:t.min_spend},this.getCheckPointView(t,e)))))):null:null}};o.style='/*!twlt*/:host{display:block}.fixed{position:fixed}.absolute{position:absolute}.-top-2{top:-0.5rem}.left-0{left:0px}.mb-1{margin-bottom:0.25rem}.block{display:block}.flex{display:flex}.hidden{display:none}.h-12{height:3rem}.w-12{width:3rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.gap-3{gap:0.75rem}.rounded-lg{border-radius:0.5rem}.object-cover{object-fit:cover}.text-start{text-align:start}.text-xs{font-size:0.75rem;line-height:1rem}.leading-tight{line-height:1.25}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-conditional-offer-container{position:relative;display:inline-flex;width:100%;flex-direction:column;align-items:center;justify-content:flex-start;gap:1.25rem;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1.25rem;padding-right:1.25rem;padding-top:1rem;padding-bottom:4rem}@media (min-width: 768px){.s-conditional-offer-container{padding-left:2.5rem;padding-right:2.5rem;padding-top:2rem;padding-bottom:2rem}}.s-conditional-offer-title-wrapper{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;align-self:stretch}.s-conditional-offer-title{text-align:center;font-size:1.25rem;line-height:1.75rem;font-weight:700;color:var(--color-primary-dark)}.s-conditional-offer-subtitle{display:inline-flex;align-items:center;justify-content:center;gap:0.25rem;align-self:stretch;text-align:center;font-size:0.75rem;line-height:1rem;font-weight:400;--tw-text-opacity:1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.s-conditional-offer-subtitle i{position:relative}.s-conditional-offer-progress-line{height:1px;align-self:stretch;background-color:var(--color-primary)}.s-conditional-offer-checkpoint-border{display:flex;height:60px;min-width:60px;flex-direction:column;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-conditional-offer-checkpoint-border-colored{border-color:var(--color-primary);color:var(--color-primary-dark)}.s-conditional-offer-product-link{display:grid;aspect-ratio:1 / 1;height:58px;place-content:center;overflow:hidden;border-radius:9999px}.s-conditional-offer-checkpoint-image-content{height:58px;width:58px;object-fit:cover}.s-conditional-offer-progress-container{position:relative;margin-bottom:2rem;display:flex;height:8rem;width:100%;flex-wrap:wrap;align-items:center;justify-content:center}@media (min-width: 768px){.s-conditional-offer-progress-container{height:4rem}}.s-conditional-offer-item-avatar-content{text-align:center;font-size:0.875rem;font-weight:700;line-height:1.25rem}.s-conditional-offer-item-avatar-content.active{color:var(--color-primary-dark);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}.s-conditional-offer-checkpoint{position:relative;display:flex;height:60px;width:60px;flex-shrink:0;flex-direction:column;align-items:center;justify-content:center;border-radius:9999px;border-width:1px}.s-conditional-offer-progress-line-container{display:grid;width:100%;overflow:hidden;grid-template-areas:\'progress-line\'}.s-conditional-offer-progress-line-inactive{height:1.5px;width:100%;--tw-bg-opacity:1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1));transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1);grid-area:progress-line}.s-conditional-offer-progress-line-active{height:1.5px;width:0%;background-color:var(--color-primary);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1);grid-area:progress-line}.s-conditional-offer-checkpoint-label{position:absolute;top:100%;left:50%;width:max-content;--tw-translate-x:-50%;--tw-translate-y:20%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}.s-conditional-offer-checkpoint-label.active{color:var(--color-primary-dark);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}.s-conditional-offer-checkpoint-label.first-checkpoint{--tw-translate-y:132%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-conditional-offer-checkpoint-label.first-checkpoint:where([dir="ltr"],[dir="ltr"] *){--tw-translate-x:0%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-conditional-offer-checkpoint-label.first-checkpoint:where([dir="rtl"],[dir="rtl"] *){--tw-translate-x:-100%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-conditional-offer-checkpoint-container{position:relative;display:flex;align-items:center}.s-conditional-offer-active-checkpoint{display:flex;justify-content:center;border-color:var(--color-primary);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}.s-conditional-offer-skeleton-inner-container{margin-bottom:2rem;width:100%}@media (min-width: 768px){.s-conditional-offer-skeleton-inner-container{margin-bottom:0px}}.s-conditional-offer-skeleton-title{margin-bottom:1rem;display:flex;justify-content:center}.s-conditional-offer-skeleton-subtitle{margin-bottom:1.5rem;display:flex;justify-content:center}.s-conditional-offer-skeleton-checkpoints-wrapper{display:flex;align-items:center}@media (min-width: 640px){.sm\\:block{display:block}}';export{o as salla_conditional_offer}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as e,H as t,a as i}from"./p-FwRU05yW.js";import{C as o}from"./p-BsLF_HK7.js";const a=class{constructor(e){s(this,e),this.isVisible=!0,this.step="consent",this.isMobile=!1,this.mobileBreakpoint=768,this.mobileQueryHandler=s=>this.isMobile=s.matches,this.openRequestedHandler=()=>this.open(),this.authLoggedInHandler=()=>this.syncConsentAfterLogin(),this.authLoggedOutHandler=()=>this.clearLocalConsent(),this.necessaryCookieKey="necessary_cookies",this.performanceCookieKey="performance_cookies",this.functionalCookieKey="functional_cookies",this.advertisingCookieKey="advertising_cookies",this.consentCookieDays=365,this.trackingCookiesByCategory={performance_cookies:["_ga","_ga_*","_gid","_gat","_gat_gtag_*","_hjSessionUser_*","_hjSession_*","_hjIncludedInSessionSample_*","_hjAbsoluteSessionInProgress","_hjFirstSeen","_clck","_clsk","MUID","MR","ANONCHK","_ym_uid","_ym_d","_ym_isad"],advertising_cookies:["_gcl_au","_gcl_aw","_gcl_dc","IDE","test_cookie","1P_JAR","NID","_fbp","_fbc","fr","_ttp","_scid","sc_at","personalization_id","guest_id","muc_ads","_pin_unauth","_pinterest_ct_ua","li_sugr","bcookie","lidc","UserMatchHistory","AnalyticsSyncHistory"],functional_cookies:["intercom-id-*","intercom-session-*","__zlcmid","crisp-client%2Fsession%2F*","YSC","VISITOR_INFO1_LIVE","PREF"]},this.performanceEnabled=!1,this.functionsEnabled=!1,this.adsEnabled=!1}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),this.loadTranslations(),Salla.event.on("salla-cookies-bar::open",this.openRequestedHandler),Salla.event.on("auth::logged.in",this.authLoggedInHandler),Salla.event.on("auth::logged.out",this.authLoggedOutHandler),this.unregisterAfterFetchMenuItemsHook=Salla.hooks.registerHook("salla-menu","afterFetchMenuItems",(s=>this.appendCookiesSettingsLink(s))),this.hydrateToggleState(),Salla.storage.get("cookies-consent")&&(this.isVisible=!1),this.enforceCurrentConsent()}isArabicLocale(){return(Salla.lang.getLocale?.()??document.documentElement.lang??"ar").toLowerCase().startsWith("ar")}translate(s,e,t){const i=Salla.lang.get(s);return i&&i!==s?i:this.isArabicLocale()?e:t}loadTranslations(){this.titleLabel=this.translate("common.cookies.settings_title","تخصيص إعدادات ملفات تعريف الارتباط","Customize Cookie Preferences Settings"),this.saveLabel=this.translate("common.cookies.save","حفظ الخيارات","Save Options"),this.messageLabel=Salla.lang.get("common.cookies.message"),this.linkLabel=Salla.lang.get("common.cookies.link"),this.acceptLabel=this.translate("common.cookies.accept","قبول","Accept"),this.acceptAllLabel=this.translate("common.cookies.accept_all","قبول الكل","Accept All"),this.customizeLabel=this.translate("common.cookies.customize","تخصيص","Customize"),this.essentialTitleLabel=this.translate("common.cookies.categories.essential.title","ملفات تعريف الارتباط الضرورية","Essential Cookies"),this.essentialDescriptionLabel=this.translate("common.cookies.categories.essential.description","ضروريه لتشغيل الوظائف الأساسية للموقع الإلكتروني.","Required for the website's basic functions."),this.essentialBadgeLabel=this.translate("common.cookies.categories.essential.badge","إجباري","Required"),this.performanceTitleLabel=this.translate("common.cookies.categories.performance.title","ملفات تعريف الارتباط الخاصة بالأداء","Performance Cookies"),this.performanceDescriptionLabel=this.translate("common.cookies.categories.performance.description","تساعدنا في تحليل كيفية استخدامك للموقع وتحسين أدائه.","Help us analyze site usage and improve performance."),this.functionsTitleLabel=this.translate("common.cookies.categories.functions.title","ملفات تعريف الارتباط الوظيفية","Functional Cookies"),this.functionsDescriptionLabel=this.translate("common.cookies.categories.functions.description","تُتيح لك تجربة مخصصة وتفعيل ميزات متقدمة داخل الموقع.","Enable enhanced functionality and personalization."),this.adsTitleLabel=this.translate("common.cookies.categories.ads.title","ملفات تعريف الارتباط الإعلانية","Advertising Cookies"),this.adsDescriptionLabel=this.translate("common.cookies.categories.ads.description","تُستخدم لعرض محتوى تسويقي مخصص يناسب اهتماماتك.","Allow personalized content.")}componentDidLoad(){this.mobileQuery=window.matchMedia(`(max-width: ${this.mobileBreakpoint-1}px)`),this.isMobile=this.mobileQuery.matches,this.mobileQuery.addEventListener("change",this.mobileQueryHandler)}disconnectedCallback(){this.mobileQuery?.removeEventListener("change",this.mobileQueryHandler),Salla.event.off("salla-cookies-bar::open",this.openRequestedHandler),Salla.event.off("auth::logged.in",this.authLoggedInHandler),Salla.event.off("auth::logged.out",this.authLoggedOutHandler),this.unregisterAfterFetchMenuItemsHook?.(),this.unregisterAfterFetchMenuItemsHook=void 0}allCategoryKeys(){return[this.necessaryCookieKey,this.performanceCookieKey,this.functionalCookieKey,this.advertisingCookieKey]}writeLocalConsentCookies(s){for(const e of this.allCategoryKeys())Salla.cookie.set(e,String(e===this.necessaryCookieKey||s.includes(e)),this.consentCookieDays)}applyConsent(s){this.writeLocalConsentCookies(s),this.sweepDisabledCategoryCookies(s),Salla.config.isGuest()||Salla.api.request("account/data-privacy",{points:s},"post").catch((()=>{}))}currentConsentPoints(){return Salla.storage.get("cookies-consent")?this.allCategoryKeys().filter((s=>s===this.necessaryCookieKey||"true"===Salla.cookie.get(s))):null}enforceCurrentConsent(){const s=this.currentConsentPoints();s&&this.sweepDisabledCategoryCookies(s)}hydrateToggleState(){const s=this.currentConsentPoints();s&&(this.performanceEnabled=s.includes(this.performanceCookieKey),this.functionsEnabled=s.includes(this.functionalCookieKey),this.adsEnabled=s.includes(this.advertisingCookieKey))}clearLocalConsent(){for(const s of this.allCategoryKeys())Salla.cookie.remove(s);Salla.storage.remove("cookies-consent"),this.isVisible=!0}syncConsentAfterLogin(){const s=this.currentConsentPoints();s&&Salla.api.request("account/data-privacy",{points:s},"post").catch((()=>{}))}cookieNameMatchesPattern(s,e){return e.endsWith("*")?s.startsWith(e.slice(0,-1)):s===e}sweepDisabledCategoryCookies(s){const e=Object.keys(this.trackingCookiesByCategory).filter((e=>!s.includes(e)));if(!e.length)return;const t=e.flatMap((s=>this.trackingCookiesByCategory[s]));document.cookie.split(";").map((s=>s.split("=")[0].trim())).filter((s=>t.some((e=>this.cookieNameMatchesPattern(s,e))))).forEach((s=>Salla.cookie.remove(s)))}dismiss(s){this.isVisible=!1,Salla.event.emit(`salla-cookies-bar::${s}`),Salla.storage.set("cookies-consent",s)}savePreferences(){const s=[this.necessaryCookieKey];this.performanceEnabled&&s.push(this.performanceCookieKey),this.functionsEnabled&&s.push(this.functionalCookieKey),this.adsEnabled&&s.push(this.advertisingCookieKey),this.applyConsent(s),this.dismiss("accepted")}async accept(){return this.applyConsent(this.allCategoryKeys()),this.dismiss("accepted"),this.host}async reject(){return this.applyConsent([this.necessaryCookieKey]),this.dismiss("rejected"),this.host}async open(){return this.hydrateToggleState(),this.step="consent",this.isVisible=!0,this.host}openPreferences(){this.hydrateToggleState(),this.step="preferences"}isRtl(){return Salla.config.get("theme.is_rtl",!0)}appendCookiesSettingsLink(s){const e=Salla.config.get("store.features")?.includes("website-cookies");if(!e||!s?.withCookiePreferences||"footer"!==s?.source)return;const t="#cookies-settings",i=s?.menus.some((s=>s?.url===t));i||(s.menus=[...s.menus,{id:"cookies-settings",order:null,title:Salla.lang.get("common.cookies.settings"),url:t,target:"_self",is_by_form_builder:!1,children:[],image:null,callback:()=>Salla.event.emit("salla-cookies-bar::open")}])}renderToggle(s,t,i,o){return e("label",{class:{"s-toggle":!0,"s-toggle--disabled":t}},e("input",{class:"s-toggle-input",type:"checkbox",checked:s,disabled:t,"aria-label":i,onChange:()=>o?.()}),e("div",{class:"s-toggle-switcher"}))}renderCategory(s,t,i,o){return e("div",{class:"s-cookies-bar-category"},e("div",{class:"s-cookies-bar-category-content"},e("div",{class:"s-cookies-bar-category-title-row"},e("span",{class:"s-cookies-bar-category-title"},s),o&&e("span",{class:"s-cookies-bar-badge"},o)),e("p",{class:"s-cookies-bar-category-description m-0"},t)),i)}renderMessage(){return e("p",{class:"s-cookies-bar-message m-0"},this.messageLabel,Salla.config.get("policy_url")&&e("a",{href:Salla.config.get("policy_url"),target:"_blank",class:"s-cookies-bar-link text-primary ms-1"}," ",this.linkLabel))}renderConsentStep(){return e("div",{class:"s-cookies-bar-consent"},this.renderMessage(),e("div",{class:"s-cookies-bar-consent-actions"},e("salla-button",{class:"s-cookies-bar-btn--customize",color:"primary",fill:"outline",type:"button",size:this.isMobile?"small":"medium",onClick:()=>this.openPreferences()},this.customizeLabel),e("salla-button",{class:"s-cookies-bar-btn--accept",color:"primary",fill:"solid",type:"button",size:this.isMobile?"small":"medium",onClick:()=>this.accept()},this.acceptAllLabel)))}renderPreferencesStep(){return e("div",null,e("div",{class:"s-cookies-bar-header"},e("h3",{class:"s-cookies-bar-title m-0"},this.titleLabel),e("button",{type:"button",class:"s-cookies-bar-close","aria-label":this.titleLabel,onClick:()=>this.reject()},e("span",{innerHTML:o}))),e("div",{class:"s-cookies-bar-categories"},this.renderCategory(this.essentialTitleLabel,this.essentialDescriptionLabel,this.renderToggle(!0,!0,this.essentialTitleLabel),this.essentialBadgeLabel),this.renderCategory(this.performanceTitleLabel,this.performanceDescriptionLabel,this.renderToggle(this.performanceEnabled,!1,this.performanceTitleLabel,(()=>this.performanceEnabled=!this.performanceEnabled))),this.renderCategory(this.functionsTitleLabel,this.functionsDescriptionLabel,this.renderToggle(this.functionsEnabled,!1,this.functionsTitleLabel,(()=>this.functionsEnabled=!this.functionsEnabled))),this.renderCategory(this.adsTitleLabel,this.adsDescriptionLabel,this.renderToggle(this.adsEnabled,!1,this.adsTitleLabel,(()=>this.adsEnabled=!this.adsEnabled)))),e("div",{class:"s-cookies-bar-footer"},this.renderMessage(),e("salla-button",{class:"s-cookies-bar-btn--save",color:"primary",fill:"solid",type:"button",size:this.isMobile?"small":"medium",onClick:()=>this.savePreferences()},this.saveLabel)))}render(){return this.isVisible?e(t,null,e("div",{dir:this.isRtl()?"rtl":"ltr",class:"s-cookies-bar"},"consent"===this.step?this.renderConsentStep():this.renderPreferencesStep())):e(t,null)}get host(){return i(this)}};a.style='/*!twlt*/:host{display:block;overflow:visible}.s-cookies-bar{position:fixed;bottom:1rem;left:50%;transform:translateX(-50%);z-index:100;background-color:#fff;border-radius:1rem;padding:1.25rem;width:calc(100% - 2rem);max-width:48rem;box-shadow:0 10px 30px -5px rgba(0, 0, 0, 0.2)}.s-cookies-bar-consent{display:flex;flex-direction:row;align-items:center;gap:1rem;flex-wrap:wrap}@media (max-width: 640px){.s-cookies-bar-consent{flex-direction:column;align-items:end}}.s-cookies-bar-consent-actions{display:flex;align-items:center;gap:0.75rem;flex-shrink:0}.s-cookies-bar-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1.25rem}.s-cookies-bar-title{font-size:1rem;font-weight:bold;color:#1f2937}.s-cookies-bar-close{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;border:none;background:transparent;cursor:pointer;flex-shrink:0}.s-cookies-bar-close svg{width:1.125rem;height:1.125rem;fill:currentColor}.s-cookies-bar-close:hover{color:#4b5563}.s-cookies-bar-categories{display:flex;flex-direction:column;gap:1rem}.s-cookies-bar-category{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.s-cookies-bar-category .s-toggle{flex-shrink:0}.s-cookies-bar-category .s-toggle--disabled{cursor:not-allowed}.s-cookies-bar-category-title-row{display:flex;align-items:center;gap:0.5rem}.s-cookies-bar-category-title{font-size:0.875rem;font-weight:500;color:#1f2937}.s-cookies-bar-category-description{font-size:0.75rem;color:#9ca3af;margin-top:0.25rem}.s-cookies-bar-badge{display:inline-flex;align-items:center;padding:0.0625rem 0.5rem;border-radius:9999px;background-color:#f3f4f6;color:#6b7280;font-size:0.6875rem;font-weight:500;white-space:nowrap}.s-cookies-bar-footer{display:flex;align-items:center;gap:0.75rem;margin-top:1.25rem;padding-top:1.25rem;border-top:1px solid #e5e7eb}.s-cookies-bar-message{flex:1;font-size:0.75rem;line-height:1.625;font-weight:700}.s-cookies-bar-btn--save{flex-shrink:0}.visible{visibility:visible}.invisible{visibility:hidden}.m-0{margin:0px}.ms-1{margin-inline-start:0.25rem}.resize{resize:both}.text-primary{color:var(--color-primary)}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.toggle-checkbox .s-toggle-input{position:absolute;visibility:hidden}.toggle-checkbox .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.toggle-checkbox .s-toggle-switcher:before,.toggle-checkbox .s-toggle-switcher:after{content:""}.toggle-checkbox .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.toggle-checkbox .s-toggle-input:checked+div{background:#30D158}.toggle-checkbox .s-toggle-input:checked+div:before{left:18px}.s-toggle{cursor:pointer;display:inline-block}.s-toggle .s-toggle-input{position:absolute;visibility:hidden}.s-toggle .s-toggle-label{margin-left:5px;position:relative;top:2px}.s-toggle .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.s-toggle .s-toggle-switcher:before,.s-toggle .s-toggle-switcher:after{content:""}.s-toggle .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.s-toggle .s-toggle-input:checked+div{background:#30D158}.s-toggle .s-toggle-input:checked+div:before{left:18px}';export{a as salla_cookies_bar}
|
|
4
|
+
import{r as s,h as e,H as t,a as i}from"./p-B64o_70M.js";import{C as o}from"./p-BsLF_HK7.js";const a=class{constructor(e){s(this,e),this.isVisible=!0,this.step="consent",this.isMobile=!1,this.mobileBreakpoint=768,this.mobileQueryHandler=s=>this.isMobile=s.matches,this.openRequestedHandler=()=>this.open(),this.authLoggedInHandler=()=>this.syncConsentAfterLogin(),this.authLoggedOutHandler=()=>this.clearLocalConsent(),this.necessaryCookieKey="necessary_cookies",this.performanceCookieKey="performance_cookies",this.functionalCookieKey="functional_cookies",this.advertisingCookieKey="advertising_cookies",this.consentCookieDays=365,this.trackingCookiesByCategory={performance_cookies:["_ga","_ga_*","_gid","_gat","_gat_gtag_*","_hjSessionUser_*","_hjSession_*","_hjIncludedInSessionSample_*","_hjAbsoluteSessionInProgress","_hjFirstSeen","_clck","_clsk","MUID","MR","ANONCHK","_ym_uid","_ym_d","_ym_isad"],advertising_cookies:["_gcl_au","_gcl_aw","_gcl_dc","IDE","test_cookie","1P_JAR","NID","_fbp","_fbc","fr","_ttp","_scid","sc_at","personalization_id","guest_id","muc_ads","_pin_unauth","_pinterest_ct_ua","li_sugr","bcookie","lidc","UserMatchHistory","AnalyticsSyncHistory"],functional_cookies:["intercom-id-*","intercom-session-*","__zlcmid","crisp-client%2Fsession%2F*","YSC","VISITOR_INFO1_LIVE","PREF"]},this.performanceEnabled=!1,this.functionsEnabled=!1,this.adsEnabled=!1}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),this.loadTranslations(),Salla.event.on("salla-cookies-bar::open",this.openRequestedHandler),Salla.event.on("auth::logged.in",this.authLoggedInHandler),Salla.event.on("auth::logged.out",this.authLoggedOutHandler),this.unregisterAfterFetchMenuItemsHook=Salla.hooks.registerHook("salla-menu","afterFetchMenuItems",(s=>this.appendCookiesSettingsLink(s))),this.hydrateToggleState(),Salla.storage.get("cookies-consent")&&(this.isVisible=!1),this.enforceCurrentConsent()}isArabicLocale(){return(Salla.lang.getLocale?.()??document.documentElement.lang??"ar").toLowerCase().startsWith("ar")}translate(s,e,t){const i=Salla.lang.get(s);return i&&i!==s?i:this.isArabicLocale()?e:t}loadTranslations(){this.titleLabel=this.translate("common.cookies.settings_title","تخصيص إعدادات ملفات تعريف الارتباط","Customize Cookie Preferences Settings"),this.saveLabel=this.translate("common.cookies.save","حفظ الخيارات","Save Options"),this.messageLabel=Salla.lang.get("common.cookies.message"),this.linkLabel=Salla.lang.get("common.cookies.link"),this.acceptLabel=this.translate("common.cookies.accept","قبول","Accept"),this.acceptAllLabel=this.translate("common.cookies.accept_all","قبول الكل","Accept All"),this.customizeLabel=this.translate("common.cookies.customize","تخصيص","Customize"),this.essentialTitleLabel=this.translate("common.cookies.categories.essential.title","ملفات تعريف الارتباط الضرورية","Essential Cookies"),this.essentialDescriptionLabel=this.translate("common.cookies.categories.essential.description","ضروريه لتشغيل الوظائف الأساسية للموقع الإلكتروني.","Required for the website's basic functions."),this.essentialBadgeLabel=this.translate("common.cookies.categories.essential.badge","إجباري","Required"),this.performanceTitleLabel=this.translate("common.cookies.categories.performance.title","ملفات تعريف الارتباط الخاصة بالأداء","Performance Cookies"),this.performanceDescriptionLabel=this.translate("common.cookies.categories.performance.description","تساعدنا في تحليل كيفية استخدامك للموقع وتحسين أدائه.","Help us analyze site usage and improve performance."),this.functionsTitleLabel=this.translate("common.cookies.categories.functions.title","ملفات تعريف الارتباط الوظيفية","Functional Cookies"),this.functionsDescriptionLabel=this.translate("common.cookies.categories.functions.description","تُتيح لك تجربة مخصصة وتفعيل ميزات متقدمة داخل الموقع.","Enable enhanced functionality and personalization."),this.adsTitleLabel=this.translate("common.cookies.categories.ads.title","ملفات تعريف الارتباط الإعلانية","Advertising Cookies"),this.adsDescriptionLabel=this.translate("common.cookies.categories.ads.description","تُستخدم لعرض محتوى تسويقي مخصص يناسب اهتماماتك.","Allow personalized content.")}componentDidLoad(){this.mobileQuery=window.matchMedia(`(max-width: ${this.mobileBreakpoint-1}px)`),this.isMobile=this.mobileQuery.matches,this.mobileQuery.addEventListener("change",this.mobileQueryHandler)}disconnectedCallback(){this.mobileQuery?.removeEventListener("change",this.mobileQueryHandler),Salla.event.off("salla-cookies-bar::open",this.openRequestedHandler),Salla.event.off("auth::logged.in",this.authLoggedInHandler),Salla.event.off("auth::logged.out",this.authLoggedOutHandler),this.unregisterAfterFetchMenuItemsHook?.(),this.unregisterAfterFetchMenuItemsHook=void 0}allCategoryKeys(){return[this.necessaryCookieKey,this.performanceCookieKey,this.functionalCookieKey,this.advertisingCookieKey]}writeLocalConsentCookies(s){for(const e of this.allCategoryKeys())Salla.cookie.set(e,String(e===this.necessaryCookieKey||s.includes(e)),this.consentCookieDays)}applyConsent(s){this.writeLocalConsentCookies(s),this.sweepDisabledCategoryCookies(s),Salla.config.isGuest()||Salla.api.request("account/data-privacy",{points:s},"post").catch((()=>{}))}currentConsentPoints(){return Salla.storage.get("cookies-consent")?this.allCategoryKeys().filter((s=>s===this.necessaryCookieKey||"true"===Salla.cookie.get(s))):null}enforceCurrentConsent(){const s=this.currentConsentPoints();s&&this.sweepDisabledCategoryCookies(s)}hydrateToggleState(){const s=this.currentConsentPoints();s&&(this.performanceEnabled=s.includes(this.performanceCookieKey),this.functionsEnabled=s.includes(this.functionalCookieKey),this.adsEnabled=s.includes(this.advertisingCookieKey))}clearLocalConsent(){for(const s of this.allCategoryKeys())Salla.cookie.remove(s);Salla.storage.remove("cookies-consent"),this.isVisible=!0}syncConsentAfterLogin(){const s=this.currentConsentPoints();s&&Salla.api.request("account/data-privacy",{points:s},"post").catch((()=>{}))}cookieNameMatchesPattern(s,e){return e.endsWith("*")?s.startsWith(e.slice(0,-1)):s===e}sweepDisabledCategoryCookies(s){const e=Object.keys(this.trackingCookiesByCategory).filter((e=>!s.includes(e)));if(!e.length)return;const t=e.flatMap((s=>this.trackingCookiesByCategory[s]));document.cookie.split(";").map((s=>s.split("=")[0].trim())).filter((s=>t.some((e=>this.cookieNameMatchesPattern(s,e))))).forEach((s=>Salla.cookie.remove(s)))}dismiss(s){this.isVisible=!1,Salla.event.emit(`salla-cookies-bar::${s}`),Salla.storage.set("cookies-consent",s)}savePreferences(){const s=[this.necessaryCookieKey];this.performanceEnabled&&s.push(this.performanceCookieKey),this.functionsEnabled&&s.push(this.functionalCookieKey),this.adsEnabled&&s.push(this.advertisingCookieKey),this.applyConsent(s),this.dismiss("accepted")}async accept(){return this.applyConsent(this.allCategoryKeys()),this.dismiss("accepted"),this.host}async reject(){return this.applyConsent([this.necessaryCookieKey]),this.dismiss("rejected"),this.host}async open(){return this.hydrateToggleState(),this.step="consent",this.isVisible=!0,this.host}openPreferences(){this.hydrateToggleState(),this.step="preferences"}isRtl(){return Salla.config.get("theme.is_rtl",!0)}appendCookiesSettingsLink(s){const e=Salla.config.get("store.features")?.includes("website-cookies");if(!e||!s?.withCookiePreferences||"footer"!==s?.source)return;const t="#cookies-settings",i=s?.menus.some((s=>s?.url===t));i||(s.menus=[...s.menus,{id:"cookies-settings",order:null,title:Salla.lang.get("common.cookies.settings"),url:t,target:"_self",is_by_form_builder:!1,children:[],image:null,callback:()=>Salla.event.emit("salla-cookies-bar::open")}])}renderToggle(s,t,i,o){return e("label",{class:{"s-toggle":!0,"s-toggle--disabled":t}},e("input",{class:"s-toggle-input",type:"checkbox",checked:s,disabled:t,"aria-label":i,onChange:()=>o?.()}),e("div",{class:"s-toggle-switcher"}))}renderCategory(s,t,i,o){return e("div",{class:"s-cookies-bar-category"},e("div",{class:"s-cookies-bar-category-content"},e("div",{class:"s-cookies-bar-category-title-row"},e("span",{class:"s-cookies-bar-category-title"},s),o&&e("span",{class:"s-cookies-bar-badge"},o)),e("p",{class:"s-cookies-bar-category-description m-0"},t)),i)}renderMessage(){return e("p",{class:"s-cookies-bar-message m-0"},this.messageLabel,Salla.config.get("policy_url")&&e("a",{href:Salla.config.get("policy_url"),target:"_blank",class:"s-cookies-bar-link text-primary ms-1"}," ",this.linkLabel))}renderConsentStep(){return e("div",{class:"s-cookies-bar-consent"},this.renderMessage(),e("div",{class:"s-cookies-bar-consent-actions"},e("salla-button",{class:"s-cookies-bar-btn--customize",color:"primary",fill:"outline",type:"button",size:this.isMobile?"small":"medium",onClick:()=>this.openPreferences()},this.customizeLabel),e("salla-button",{class:"s-cookies-bar-btn--accept",color:"primary",fill:"solid",type:"button",size:this.isMobile?"small":"medium",onClick:()=>this.accept()},this.acceptAllLabel)))}renderPreferencesStep(){return e("div",null,e("div",{class:"s-cookies-bar-header"},e("h3",{class:"s-cookies-bar-title m-0"},this.titleLabel),e("button",{type:"button",class:"s-cookies-bar-close","aria-label":this.titleLabel,onClick:()=>this.reject()},e("span",{innerHTML:o}))),e("div",{class:"s-cookies-bar-categories"},this.renderCategory(this.essentialTitleLabel,this.essentialDescriptionLabel,this.renderToggle(!0,!0,this.essentialTitleLabel),this.essentialBadgeLabel),this.renderCategory(this.performanceTitleLabel,this.performanceDescriptionLabel,this.renderToggle(this.performanceEnabled,!1,this.performanceTitleLabel,(()=>this.performanceEnabled=!this.performanceEnabled))),this.renderCategory(this.functionsTitleLabel,this.functionsDescriptionLabel,this.renderToggle(this.functionsEnabled,!1,this.functionsTitleLabel,(()=>this.functionsEnabled=!this.functionsEnabled))),this.renderCategory(this.adsTitleLabel,this.adsDescriptionLabel,this.renderToggle(this.adsEnabled,!1,this.adsTitleLabel,(()=>this.adsEnabled=!this.adsEnabled)))),e("div",{class:"s-cookies-bar-footer"},this.renderMessage(),e("salla-button",{class:"s-cookies-bar-btn--save",color:"primary",fill:"solid",type:"button",size:this.isMobile?"small":"medium",onClick:()=>this.savePreferences()},this.saveLabel)))}render(){return this.isVisible?e(t,null,e("div",{dir:this.isRtl()?"rtl":"ltr",class:"s-cookies-bar"},"consent"===this.step?this.renderConsentStep():this.renderPreferencesStep())):e(t,null)}get host(){return i(this)}};a.style='/*!twlt*/:host{display:block;overflow:visible}.s-cookies-bar{position:fixed;bottom:1rem;left:50%;transform:translateX(-50%);z-index:100;background-color:#fff;border-radius:1rem;padding:1.25rem;width:calc(100% - 2rem);max-width:48rem;box-shadow:0 10px 30px -5px rgba(0, 0, 0, 0.2)}.s-cookies-bar-consent{display:flex;flex-direction:row;align-items:center;gap:1rem;flex-wrap:wrap}@media (max-width: 640px){.s-cookies-bar-consent{flex-direction:column;align-items:end}}.s-cookies-bar-consent-actions{display:flex;align-items:center;gap:0.75rem;flex-shrink:0}.s-cookies-bar-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1.25rem}.s-cookies-bar-title{font-size:1rem;font-weight:bold;color:#1f2937}.s-cookies-bar-close{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;border:none;background:transparent;cursor:pointer;flex-shrink:0}.s-cookies-bar-close svg{width:1.125rem;height:1.125rem;fill:currentColor}.s-cookies-bar-close:hover{color:#4b5563}.s-cookies-bar-categories{display:flex;flex-direction:column;gap:1rem}.s-cookies-bar-category{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.s-cookies-bar-category .s-toggle{flex-shrink:0}.s-cookies-bar-category .s-toggle--disabled{cursor:not-allowed}.s-cookies-bar-category-title-row{display:flex;align-items:center;gap:0.5rem}.s-cookies-bar-category-title{font-size:0.875rem;font-weight:500;color:#1f2937}.s-cookies-bar-category-description{font-size:0.75rem;color:#9ca3af;margin-top:0.25rem}.s-cookies-bar-badge{display:inline-flex;align-items:center;padding:0.0625rem 0.5rem;border-radius:9999px;background-color:#f3f4f6;color:#6b7280;font-size:0.6875rem;font-weight:500;white-space:nowrap}.s-cookies-bar-footer{display:flex;align-items:center;gap:0.75rem;margin-top:1.25rem;padding-top:1.25rem;border-top:1px solid #e5e7eb}.s-cookies-bar-message{flex:1;font-size:0.75rem;line-height:1.625;font-weight:700}.s-cookies-bar-btn--save{flex-shrink:0}.visible{visibility:visible}.invisible{visibility:hidden}.m-0{margin:0px}.ms-1{margin-inline-start:0.25rem}.resize{resize:both}.text-primary{color:var(--color-primary)}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.toggle-checkbox .s-toggle-input{position:absolute;visibility:hidden}.toggle-checkbox .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.toggle-checkbox .s-toggle-switcher:before,.toggle-checkbox .s-toggle-switcher:after{content:""}.toggle-checkbox .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.toggle-checkbox .s-toggle-input:checked+div{background:#30D158}.toggle-checkbox .s-toggle-input:checked+div:before{left:18px}.s-toggle{cursor:pointer;display:inline-block}.s-toggle .s-toggle-input{position:absolute;visibility:hidden}.s-toggle .s-toggle-label{margin-left:5px;position:relative;top:2px}.s-toggle .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.s-toggle .s-toggle-switcher:before,.s-toggle .s-toggle-switcher:after{content:""}.s-toggle .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.s-toggle .s-toggle-input:checked+div{background:#30D158}.s-toggle .s-toggle-input:checked+div:before{left:18px}';export{a as salla_cookies_bar}
|