@salla.sa/twilight-components 2.14.543 → 2.14.545
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-uhJt4caG.js → filepond-B5aWlI3l.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-Dy-GRHf0.js → filepond-plugin-file-poster-BYq39KHd.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-BWIBGLW-.js → filepond-plugin-file-validate-size-Bi3TAsJv.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-DEVtMF0l.js → filepond-plugin-file-validate-type-Ck6S5TuZ.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-DSDoJaLw.js → filepond-plugin-image-edit-DbsdnH5j.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-BdZit5hj.js → filepond-plugin-image-exif-orientation-x7TfJR-2.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-Z3_zQyYR.js → filepond-plugin-image-preview-CrU7vIRk.js} +1 -1
- package/dist/cjs/helpers-DHdDjm5V.js +340 -0
- package/dist/cjs/{index-Bw3b6O6G.js → index-DGpOR-TH.js} +14 -14
- package/dist/cjs/{intlTelInput-CXe3TkdL.js → intlTelInput-DKAXRecW.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{mail-CO8cFZH7.js → mail-C9D8MHae.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-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 +156 -401
- 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_9.cjs.entry.js → salla-comment-form_8.cjs.entry.js} +3 -259
- 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 +21 -5
- 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 +14 -73
- package/dist/cjs/salla-rating-modal.cjs.entry.js +7 -22
- 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-GTx-kpDm.js → vanilla-picker-DQDSSf6Q.js} +1 -1
- package/dist/collection/collection-manifest.json +12 -14
- package/dist/collection/components/salla-bullet-delivery/helpers.js +3 -0
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +82 -16
- package/dist/collection/components/salla-comments/interfaces.js +0 -12
- package/dist/collection/components/salla-comments/salla-comment-item.js +1 -1
- package/dist/collection/components/salla-comments/salla-comments.js +5 -38
- package/dist/collection/components/salla-delivery-promise/delivery-promise-api.js +1 -1
- package/dist/collection/components/salla-delivery-promise/delivery-promise-intent.js +9 -0
- package/dist/collection/components/salla-delivery-promise/salla-delivery-promise.js +10 -3
- package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +16 -119
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +10 -69
- package/dist/components/helpers.js +319 -0
- package/dist/components/index.js +2 -2
- package/dist/components/salla-bullet-delivery.js +82 -327
- package/dist/components/salla-comment-item2.js +1 -1
- package/dist/components/salla-comments.js +1 -40
- package/dist/components/salla-delivery-promise.js +20 -4
- package/dist/components/salla-rating-modal-v22.js +12 -73
- package/dist/components/salla-rating-modal.js +591 -1
- package/dist/esm/{filepond-plugin-file-poster-BTU_WzVu.js → filepond-plugin-file-poster-CkWxCmZT.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-c_09APqP.js → filepond-plugin-file-validate-size-DlWS-oUK.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-Dz2Lgh8V.js → filepond-plugin-file-validate-type-mdpFM1TG.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-DK7eXs2p.js → filepond-plugin-image-edit-BqPLKgZU.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-DYBURwn_.js → filepond-plugin-image-exif-orientation-CMqFjPu7.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-4WNiH-ie.js → filepond-plugin-image-preview-DjCwk-CI.js} +1 -1
- package/dist/esm/{filepond-BcXR53L3.js → filepond-wd7_MQSV.js} +1 -1
- package/dist/esm/helpers-BDChq2t4.js +319 -0
- package/dist/esm/{index-BW1au-Nh.js → index-CHZfg_a9.js} +14 -14
- package/dist/esm/{intlTelInput-DvPcVtVG.js → intlTelInput-B5Q8rrU9.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mail-DmgxDvXL.js → mail-DzAIgzdz.js} +2 -2
- 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-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 +83 -328
- 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_9.entry.js → salla-comment-form_8.entry.js} +4 -259
- 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 +21 -5
- 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 +14 -73
- package/dist/esm/salla-rating-modal.entry.js +7 -22
- 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-CDk_knNu.js → vanilla-picker-uNDULydX.js} +1 -1
- package/dist/twilight/{p-df202b1d.entry.js → p-0495bfac.entry.js} +1 -1
- package/dist/twilight/{p-13dbbbdc.entry.js → p-0573a498.entry.js} +1 -1
- package/dist/twilight/{p-b89d8c3c.entry.js → p-06d9e1c5.entry.js} +1 -1
- package/dist/twilight/{p-b1dfc455.entry.js → p-0749cc55.entry.js} +1 -1
- package/dist/twilight/p-0ae39262.entry.js +4 -0
- package/dist/twilight/{p-de83979a.entry.js → p-12836275.entry.js} +1 -1
- package/dist/twilight/p-12f61ae1.entry.js +4 -0
- package/dist/twilight/{p-69f4a089.entry.js → p-1419a93d.entry.js} +1 -1
- package/dist/twilight/{p-baa06c65.entry.js → p-17d49c87.entry.js} +1 -1
- package/dist/twilight/{p-1282e22a.entry.js → p-1ea25389.entry.js} +1 -1
- package/dist/twilight/{p-80c11fae.entry.js → p-2305edcc.entry.js} +1 -1
- package/dist/twilight/{p-10534171.entry.js → p-235d7596.entry.js} +1 -1
- package/dist/twilight/{p-50c0b6fa.entry.js → p-25d9f1b2.entry.js} +1 -1
- package/dist/twilight/{p-16ccbce5.entry.js → p-25f51a7e.entry.js} +1 -1
- package/dist/twilight/{p-3c28560f.entry.js → p-279a1661.entry.js} +1 -1
- package/dist/twilight/{p-ac794ed6.entry.js → p-28248b6b.entry.js} +1 -1
- package/dist/twilight/{p-7afd066a.entry.js → p-2d01a4f5.entry.js} +1 -1
- package/dist/twilight/{p-66c7b9e4.entry.js → p-2d62c947.entry.js} +1 -1
- package/dist/twilight/{p-489d084c.entry.js → p-2db5e829.entry.js} +1 -1
- package/dist/twilight/{p-362792d6.entry.js → p-2de58591.entry.js} +1 -1
- package/dist/twilight/{p-16296dce.entry.js → p-32e3daa3.entry.js} +1 -1
- package/dist/twilight/{p-beb2110d.entry.js → p-345532e5.entry.js} +1 -1
- package/dist/twilight/{p-280e67f0.entry.js → p-346366ba.entry.js} +1 -1
- package/dist/twilight/{p-46399dc8.entry.js → p-35557962.entry.js} +1 -1
- package/dist/twilight/{p-d54acab0.entry.js → p-3672d4f7.entry.js} +1 -1
- package/dist/twilight/{p-315890b5.entry.js → p-37163aef.entry.js} +1 -1
- package/dist/twilight/{p-e184cd72.entry.js → p-391a2ec6.entry.js} +1 -1
- package/dist/twilight/{p-b2b818a5.entry.js → p-3a8be7df.entry.js} +1 -1
- package/dist/twilight/{p-ceb40475.entry.js → p-3f5bc617.entry.js} +1 -1
- package/dist/twilight/{p-cf4efddb.entry.js → p-419499d6.entry.js} +1 -1
- package/dist/twilight/{p-d018fc49.entry.js → p-4ac9a3b6.entry.js} +1 -1
- package/dist/twilight/{p-aa9fb9f5.entry.js → p-5074de7d.entry.js} +1 -1
- package/dist/twilight/{p-65a86613.entry.js → p-51a062cd.entry.js} +1 -1
- package/dist/twilight/p-54e2d320.entry.js +1024 -0
- package/dist/twilight/{p-84679cc1.entry.js → p-5933ba05.entry.js} +1 -1
- package/dist/twilight/{p-4b14e0f8.entry.js → p-5d9a85b0.entry.js} +1 -1
- package/dist/twilight/{p-d7a68f6c.entry.js → p-5ded000f.entry.js} +1 -1
- package/dist/twilight/{p-a3fdec51.entry.js → p-63b01300.entry.js} +1 -1
- package/dist/twilight/{p-677bcf4c.entry.js → p-64efbb2c.entry.js} +1 -1
- package/dist/twilight/{p-feb80402.entry.js → p-67b91397.entry.js} +1 -1
- package/dist/twilight/{p-9b1403fc.entry.js → p-69119c00.entry.js} +1 -1
- package/dist/twilight/{p-6e78ee63.entry.js → p-6c18cc72.entry.js} +1 -1
- package/dist/twilight/{p-1ba8fb02.entry.js → p-6d961d73.entry.js} +1 -1
- package/dist/twilight/{p-64f0c216.entry.js → p-6ff53523.entry.js} +1 -1
- package/dist/twilight/{p-75065cbf.entry.js → p-72ee7071.entry.js} +1 -1
- package/dist/twilight/{p-6d6618f8.entry.js → p-72f54055.entry.js} +1 -1
- package/dist/twilight/{p-3b9dcb0f.entry.js → p-74529abb.entry.js} +1 -1
- package/dist/twilight/{p-664d428e.entry.js → p-766a3291.entry.js} +1 -1
- package/dist/twilight/{p-d3692caf.entry.js → p-788fd019.entry.js} +1 -1
- package/dist/twilight/{p-a15b4245.entry.js → p-82fe9f82.entry.js} +1 -1
- package/dist/twilight/{p-f45f5f91.entry.js → p-832f3a98.entry.js} +1 -1
- package/dist/twilight/{p-89fe5237.entry.js → p-84380d4a.entry.js} +1 -1
- package/dist/twilight/{p-311a905b.entry.js → p-8780a467.entry.js} +1 -1
- package/dist/twilight/{p-7adefcd6.entry.js → p-87e10a68.entry.js} +1 -1
- package/dist/twilight/{p-3cfd4fcd.entry.js → p-88f50d7e.entry.js} +1 -1
- package/dist/twilight/{p-f0a04676.entry.js → p-8fc6e860.entry.js} +1 -1
- package/dist/twilight/{p-cc3a9188.entry.js → p-90e5c3ab.entry.js} +1 -1
- package/dist/twilight/{p-641cc01d.entry.js → p-93aa1b67.entry.js} +1 -1
- package/dist/twilight/{p-a4436d17.entry.js → p-93dabb47.entry.js} +1 -1
- package/dist/twilight/{p-07c013f9.entry.js → p-98108ebe.entry.js} +1 -1
- package/dist/twilight/{p-72960bb3.entry.js → p-989f2adb.entry.js} +1 -1
- package/dist/twilight/{p-4be8900d.entry.js → p-9d224252.entry.js} +1 -1
- package/dist/twilight/p-BDChq2t4.js +4 -0
- package/dist/twilight/{p-D9Y6HNvi.js → p-BPkSO6gd.js} +1 -1
- package/dist/twilight/{p-BUMDIRU5.js → p-BWvO3cE-.js} +1 -1
- package/dist/twilight/{p-BW1au-Nh.js → p-CHZfg_a9.js} +1 -1
- package/dist/twilight/{p-AncUY1nn.js → p-CdgES2Of.js} +1 -1
- package/dist/twilight/{p-DPMPVhgw.js → p-D9VjvNQq.js} +2 -2
- package/dist/twilight/{p-C6nX89oY.js → p-DO7S0QBX.js} +1 -1
- package/dist/twilight/{p-UDPL8zGN.js → p-DtV7npW9.js} +1 -1
- package/dist/twilight/{p-DmgxDvXL.js → p-DzAIgzdz.js} +1 -1
- package/dist/twilight/{p-UIEwOe70.js → p-PCp-0mbL.js} +1 -1
- package/dist/twilight/{p-BjS2Vb6h.js → p-ZinKLSYw.js} +1 -1
- package/dist/twilight/{p-1c82117c.entry.js → p-a0561bd1.entry.js} +1 -1
- package/dist/twilight/{p-1187210a.entry.js → p-a785b49f.entry.js} +1 -1
- package/dist/twilight/{p-13bf1c47.entry.js → p-aa4daadf.entry.js} +1 -1
- package/dist/twilight/p-ab41d26c.entry.js +4 -0
- package/dist/twilight/{p-87cc2e08.entry.js → p-afb03ee5.entry.js} +1 -1
- package/dist/twilight/{p-caa8d5ae.entry.js → p-b279e0bb.entry.js} +1 -1
- package/dist/twilight/{p-bcee5564.entry.js → p-b33392c6.entry.js} +1 -1
- package/dist/twilight/{p-e1eb70d2.entry.js → p-b38c4e39.entry.js} +1 -1
- package/dist/twilight/{p-26f8a482.entry.js → p-bead6e6f.entry.js} +1 -1
- package/dist/twilight/{p-8643930a.entry.js → p-c26043ff.entry.js} +1 -1
- package/dist/twilight/{p-a7a10dbf.entry.js → p-c287e498.entry.js} +1 -1
- package/dist/twilight/{p-87af932a.entry.js → p-c2fe2dbe.entry.js} +1 -1
- package/dist/twilight/{p-6d3a4c41.entry.js → p-c603722c.entry.js} +1 -1
- package/dist/twilight/{p-edebecb3.entry.js → p-c816b198.entry.js} +1 -1
- package/dist/twilight/{p-f3f9d1fb.entry.js → p-c81bce54.entry.js} +1 -1
- package/dist/twilight/{p-40555637.entry.js → p-c9146d50.entry.js} +1 -1
- package/dist/twilight/{p-5335f307.entry.js → p-c92edd6f.entry.js} +1 -1
- package/dist/twilight/{p-821aa95a.entry.js → p-c948a8a8.entry.js} +1 -1
- package/dist/twilight/{p-93c006fc.entry.js → p-d0d3609c.entry.js} +1 -1
- package/dist/twilight/{p-a38dc391.entry.js → p-d9b0fa64.entry.js} +1 -1
- package/dist/twilight/{p-534e7760.entry.js → p-dd823fde.entry.js} +1 -1
- package/dist/twilight/p-e36f62a9.entry.js +4 -0
- package/dist/twilight/{p-beaab93e.entry.js → p-e5a3b689.entry.js} +1 -1
- package/dist/twilight/{p-c7e980aa.entry.js → p-ec281904.entry.js} +1 -1
- package/dist/twilight/{p-68d6fa66.entry.js → p-f07bbbc7.entry.js} +1 -1
- package/dist/twilight/{p-3ad55c42.entry.js → p-f168109d.entry.js} +1 -1
- package/dist/twilight/{p-e8153a9a.entry.js → p-f1d8729d.entry.js} +1 -1
- package/dist/twilight/{p-2a8f1ed4.entry.js → p-f1dfe18b.entry.js} +1 -1
- package/dist/twilight/{p-c23f7b95.entry.js → p-fb1ad954.entry.js} +1 -1
- package/dist/twilight/{p-c214700a.entry.js → p-ffdf5f92.entry.js} +1 -1
- package/dist/twilight/{p-CMWS1gyZ.js → p-ryHWESoh.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-bullet-delivery/helpers.d.ts +1 -0
- package/dist/types/components/salla-bullet-delivery/interfaces.d.ts +14 -4
- package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +2 -0
- package/dist/types/components/salla-comments/interfaces.d.ts +0 -15
- package/dist/types/components/salla-comments/salla-comments.d.ts +2 -5
- package/dist/types/components/salla-delivery-promise/delivery-promise-intent.d.ts +0 -4
- package/dist/types/components/salla-delivery-promise/interfaces.d.ts +2 -1
- package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +3 -16
- package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +2 -10
- package/dist/types/components.d.ts +12 -45
- package/package.json +5 -5
- package/dist/collection/components/salla-verified-review/salla-verified-review.css +0 -162
- package/dist/collection/components/salla-verified-review/salla-verified-review.js +0 -264
- package/dist/components/salla-rating-modal2.js +0 -613
- package/dist/components/salla-verified-review.d.ts +0 -11
- package/dist/components/salla-verified-review.js +0 -325
- package/dist/twilight/p-03d77f90.entry.js +0 -4
- package/dist/twilight/p-4f052df8.entry.js +0 -4
- package/dist/twilight/p-a9674965.entry.js +0 -4
- package/dist/twilight/p-cbe760ce.entry.js +0 -4
- package/dist/twilight/p-e29f28eb.entry.js +0 -1019
- package/dist/types/components/salla-verified-review/salla-verified-review.d.ts +0 -51
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface SallaVerifiedReview extends Components.SallaVerifiedReview, HTMLElement {}
|
|
4
|
-
export const SallaVerifiedReview: {
|
|
5
|
-
prototype: SallaVerifiedReview;
|
|
6
|
-
new (): SallaVerifiedReview;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
5
|
-
import { C as CheckCircle2 } from './check-circle2.js';
|
|
6
|
-
import { d as defineCustomElement$c } from './salla-attachment-view2.js';
|
|
7
|
-
import { d as defineCustomElement$b } from './salla-button2.js';
|
|
8
|
-
import { d as defineCustomElement$a } from './salla-file-upload2.js';
|
|
9
|
-
import { d as defineCustomElement$9 } from './salla-loading2.js';
|
|
10
|
-
import { d as defineCustomElement$8 } from './salla-modal2.js';
|
|
11
|
-
import { d as defineCustomElement$7 } from './salla-placeholder2.js';
|
|
12
|
-
import { d as defineCustomElement$6 } from './salla-rating-modal2.js';
|
|
13
|
-
import { d as defineCustomElement$5 } from './salla-rating-modal-v22.js';
|
|
14
|
-
import { d as defineCustomElement$4 } from './salla-rating-stars2.js';
|
|
15
|
-
import { d as defineCustomElement$3 } from './salla-skeleton2.js';
|
|
16
|
-
import { d as defineCustomElement$2 } from './salla-slider2.js';
|
|
17
|
-
|
|
18
|
-
var Block = `<!-- Generated by IcoMoon.io -->
|
|
19
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
20
|
-
<title>block</title>
|
|
21
|
-
<path d="M27.313 4.687c-6.24-6.239-16.388-6.239-22.628 0-6.239 6.239-6.239 16.389 0 22.628 3.12 3.119 7.216 4.679 11.313 4.679s8.195-1.559 11.313-4.679c6.24-6.239 6.24-16.391 0.001-22.628zM6.572 6.572c2.6-2.6 6.012-3.899 9.428-3.899 2.996 0 5.992 1.001 8.437 3.004l-18.76 18.76c-4.284-5.232-3.987-12.985 0.895-17.865zM25.428 25.428c-4.883 4.879-12.635 5.179-17.867 0.895l18.761-18.76c4.284 5.232 3.987 12.985-0.895 17.865z"></path>
|
|
22
|
-
</svg>
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
const sallaVerifiedReviewCss = "/*!twlt*/salla-verified-review:empty{display:none}.s-verified-review-container{position:relative;display:flex;flex-direction:column;gap:1rem;width:100%;margin-bottom:0.5rem;margin-top:1.25rem;padding:1rem;overflow:hidden;border:1px solid #e5e7eb;border-radius:1rem;background:#fff}@media (min-width: 768px){.s-verified-review-container{flex-direction:row;align-items:center;gap:1.25rem;padding:1.25rem}}.s-verified-review-glow{pointer-events:none;position:absolute;top:-4rem;inset-inline-end:-2.5rem;width:10rem;height:10rem;border-radius:9999px;background:var(--color-primary, #008c56);opacity:0.12;filter:blur(2rem)}.s-verified-review-media{position:relative;z-index:1;flex-shrink:0}.s-verified-review-image{width:72px;height:72px;border-radius:0.75rem;object-fit:cover;background:#f3f4f6}.s-verified-review-content{position:relative;z-index:1;display:flex;flex:1;flex-direction:column;gap:0.375rem;min-width:0}.s-verified-review-meta{display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem;margin-bottom:0.25rem}.s-verified-review-badge{display:inline-flex;align-items:center;gap:0.25rem;padding:0.25rem 0.625rem;border-radius:9999px;background:color-mix(in srgb, var(--color-primary, #008c56) 10%, transparent);color:var(--color-primary, #008c56);font-size:0.75rem;font-weight:500}.s-verified-review-badge-icon{display:inline-flex;align-items:center;justify-content:center;width:0.875rem;height:0.875rem}.s-verified-review-badge-icon svg{width:0.875rem;height:0.875rem;fill:currentColor}.s-verified-review-order{font-size:0.75rem;color:#6b7280}.s-verified-review-title{margin:0;color:#111827;font-size:1rem;font-weight:700;line-height:1.375}@media (min-width: 768px){.s-verified-review-title{font-size:1.125rem}}.s-verified-review-subtitle{margin:0;color:#6b7280;font-size:0.875rem;line-height:1.625}.s-verified-review-loyalty{margin:0.125rem 0 0;color:var(--color-primary, #008c56);font-size:0.875rem;font-weight:600}.s-verified-review-actions{position:relative;z-index:1;flex-shrink:0}@media (min-width: 768px){.s-verified-review-actions{margin-inline-start:auto}}.s-verified-review-cta{width:100%}@media (min-width: 768px){.s-verified-review-cta{width:auto}}.s-verified-review-rate-limit-message{text-align:center;color:#6b7280;font-size:0.875rem;margin-top:-1rem}.s-verified-review-rate-limit-footer{margin-top:1rem}.outline{outline-style:solid}";
|
|
26
|
-
|
|
27
|
-
const SallaVerifiedReview$1 = /*@__PURE__*/ proxyCustomElement(class SallaVerifiedReview extends HTMLElement {
|
|
28
|
-
constructor() {
|
|
29
|
-
super();
|
|
30
|
-
this.__registerHost();
|
|
31
|
-
this.ready = false;
|
|
32
|
-
this.eligible = false;
|
|
33
|
-
this.order = null;
|
|
34
|
-
this.productImage = '';
|
|
35
|
-
this.productImageAlt = '';
|
|
36
|
-
this.loyaltyPoints = 0;
|
|
37
|
-
this.titlePurchasedLabel = '';
|
|
38
|
-
this.titleNotPurchasedLabel = '';
|
|
39
|
-
this.subtitleLabel = '';
|
|
40
|
-
this.badgeLabel = '';
|
|
41
|
-
this.orderMetaLabel = '';
|
|
42
|
-
this.ctaLabel = '';
|
|
43
|
-
this.loyaltyLabel = '';
|
|
44
|
-
this.rateLimitMessage = '';
|
|
45
|
-
this.rateLimited = false;
|
|
46
|
-
this.rateLimitTitleLabel = '';
|
|
47
|
-
this.rateLimitDefaultMessageLabel = '';
|
|
48
|
-
this.rateLimitExitLabel = '';
|
|
49
|
-
this.resolvedProductId = null;
|
|
50
|
-
this.handleRateClick = () => {
|
|
51
|
-
if (salla.config.isGuest()) {
|
|
52
|
-
salla.event.dispatch('login::open');
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (!this.eligible) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (this.rateLimited) {
|
|
59
|
-
this.showRateLimitAlert();
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
// Verified purchases pass their order id; unverified-but-eligible reviews
|
|
63
|
-
// pass `null` so the modal submits the review without an order.
|
|
64
|
-
const orderId = this.order?.id ?? null;
|
|
65
|
-
const modal = this.ensureRatingModal();
|
|
66
|
-
requestAnimationFrame(async () => {
|
|
67
|
-
await modal.setOrder?.(orderId, this.resolvedProductId);
|
|
68
|
-
modal.open?.();
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
async componentWillLoad() {
|
|
73
|
-
try {
|
|
74
|
-
await salla.onReady();
|
|
75
|
-
await salla.lang.onLoaded();
|
|
76
|
-
await this.loadTranslations();
|
|
77
|
-
this.resolvedProductId =
|
|
78
|
-
this.productId || this.host.dataset.productId || salla.config.get('page.id');
|
|
79
|
-
if (!this.resolvedProductId) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
if (salla.config.isGuest()) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
salla.event.on('rating::products-rated', (_response, payload) => {
|
|
86
|
-
if (String(payload?.product_id) === String(this.resolvedProductId)) {
|
|
87
|
-
this.eligible = false;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
await Promise.all([this.loadProductImage(), this.loadEligibility()]);
|
|
91
|
-
this.ready = true;
|
|
92
|
-
}
|
|
93
|
-
catch (e) {
|
|
94
|
-
salla?.logger?.warn?.('salla-verified-review: init failed', e);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
async loadTranslations() {
|
|
98
|
-
const setNestedAsync = (lang, key, value) => {
|
|
99
|
-
return new Promise(resolve => {
|
|
100
|
-
salla.helpers.setNested(salla.lang.messages[lang], key, value);
|
|
101
|
-
resolve(true);
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
await setNestedAsync('ar.trans', 'pages.rating.verified_review.title_purchased', 'جربت هذا المنتج؟');
|
|
105
|
-
await setNestedAsync('en.trans', 'pages.rating.verified_review.title_purchased', 'You tried this product?');
|
|
106
|
-
await setNestedAsync('ar.trans', 'pages.rating.verified_review.title_not_purchased', 'جربت هذا المنتج؟ شارك تجربتك 🎉');
|
|
107
|
-
await setNestedAsync('en.trans', 'pages.rating.verified_review.title_not_purchased', 'Tried this product? Share your experience 🎉');
|
|
108
|
-
await setNestedAsync('ar.trans', 'pages.rating.verified_review.subtitle', 'شارك رأيك وساعد غيرك يختار بثقة.');
|
|
109
|
-
await setNestedAsync('en.trans', 'pages.rating.verified_review.subtitle', 'Share your opinion and help others choose with confidence.');
|
|
110
|
-
await setNestedAsync('ar.trans', 'pages.rating.verified_review.badge', 'عملية شراء موثقة');
|
|
111
|
-
await setNestedAsync('en.trans', 'pages.rating.verified_review.badge', 'Verified purchase');
|
|
112
|
-
await setNestedAsync('ar.trans', 'pages.rating.verified_review.order_meta', 'طلب #:id');
|
|
113
|
-
await setNestedAsync('en.trans', 'pages.rating.verified_review.order_meta', 'Order #:id');
|
|
114
|
-
await setNestedAsync('ar.trans', 'pages.rating.verified_review.cta', 'تقييم المنتج');
|
|
115
|
-
await setNestedAsync('en.trans', 'pages.rating.verified_review.cta', 'Rate product');
|
|
116
|
-
await setNestedAsync('ar.trans', 'pages.rating.verified_review.loyalty_points', 'اكسب +:points نقطة ولاء بكتابة مراجعة 🏆');
|
|
117
|
-
await setNestedAsync('en.trans', 'pages.rating.verified_review.loyalty_points', '🏆 Earn +:points loyalty points by writing a review');
|
|
118
|
-
await setNestedAsync('ar.trans', 'pages.rating.rate_limit_title', 'تم تقييد حسابك');
|
|
119
|
-
await setNestedAsync('en.trans', 'pages.rating.rate_limit_title', 'Your account has been restricted');
|
|
120
|
-
await setNestedAsync('ar.trans', 'pages.rating.rate_limit_message', 'تجاوزت الحد المسموح لتقييم منتجات لم تشتريها بعد.');
|
|
121
|
-
await setNestedAsync('en.trans', 'pages.rating.rate_limit_message', "You've exceeded the allowed limit for rating products you haven't purchased yet.");
|
|
122
|
-
await setNestedAsync('ar.trans', 'pages.rating.rate_limit_exit', 'خروج');
|
|
123
|
-
await setNestedAsync('en.trans', 'pages.rating.rate_limit_exit', 'Exit');
|
|
124
|
-
this.titlePurchasedLabel = salla.lang.getWithDefault('pages.rating.verified_review.title_purchased', 'اشتريت هذا! شارك تجربتك 🎉');
|
|
125
|
-
this.titleNotPurchasedLabel = salla.lang.getWithDefault('pages.rating.verified_review.title_not_purchased', 'جربت هذا المنتج؟ شارك تجربتك 🎉');
|
|
126
|
-
this.subtitleLabel = salla.lang.getWithDefault('pages.rating.verified_review.subtitle', 'ساعد المتسوقين الآخرين بمراجعة هذا المنتج. رأيك يهم.');
|
|
127
|
-
this.badgeLabel = salla.lang.getWithDefault('pages.rating.verified_review.badge', 'عملية شراء موثقة');
|
|
128
|
-
this.orderMetaLabel = salla.lang.getWithDefault('pages.rating.verified_review.order_meta', 'طلب #:id');
|
|
129
|
-
this.ctaLabel = salla.lang.getWithDefault('pages.rating.verified_review.cta', 'قيِّم المنتج');
|
|
130
|
-
this.loyaltyLabel = salla.lang.getWithDefault('pages.rating.verified_review.loyalty_points', 'اكسب +:points نقطة ولاء بكتابة مراجعة 🏆');
|
|
131
|
-
this.rateLimitTitleLabel = salla.lang.getWithDefault('pages.rating.rate_limit_title', 'تم تقييد حسابك');
|
|
132
|
-
this.rateLimitDefaultMessageLabel = salla.lang.getWithDefault('pages.rating.rate_limit_message', 'تجاوزت الحد المسموح لتقييم منتجات لم تشتريها بعد.');
|
|
133
|
-
this.rateLimitExitLabel = salla.lang.getWithDefault('pages.rating.rate_limit_exit', 'خروج');
|
|
134
|
-
}
|
|
135
|
-
async loadProductImage() {
|
|
136
|
-
try {
|
|
137
|
-
const response = await salla.api.withoutNotifier(() => salla.product.api.getDetails(this.resolvedProductId));
|
|
138
|
-
const product = response?.data;
|
|
139
|
-
this.productImage = product?.image?.url || salla.url.cdn('images/s-empty.png');
|
|
140
|
-
this.productImageAlt = product?.image?.alt || product?.name || '';
|
|
141
|
-
}
|
|
142
|
-
catch {
|
|
143
|
-
this.productImage = salla.url.cdn('images/s-empty.png');
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
async fetchEligibility(productId) {
|
|
147
|
-
const response = await salla.api.withoutNotifier(() => salla.rating.api.productEligibility(productId));
|
|
148
|
-
return response?.data;
|
|
149
|
-
}
|
|
150
|
-
async loadEligibility() {
|
|
151
|
-
if (!this.resolvedProductId) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
const eligibility = await this.fetchEligibility(this.resolvedProductId);
|
|
155
|
-
if (!eligibility) {
|
|
156
|
-
this.eligible = false;
|
|
157
|
-
this.order = null;
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
this.eligible = eligibility.eligible;
|
|
161
|
-
if (eligibility.code === 'community_review_daily_limit') {
|
|
162
|
-
this.rateLimitMessage = eligibility.message || this.rateLimitDefaultMessageLabel;
|
|
163
|
-
this.rateLimited = true;
|
|
164
|
-
this.eligible = true;
|
|
165
|
-
}
|
|
166
|
-
this.order =
|
|
167
|
-
this.eligible && eligibility.order_id
|
|
168
|
-
? {
|
|
169
|
-
id: eligibility.order_id,
|
|
170
|
-
reference_id: eligibility.reference_id,
|
|
171
|
-
created_at: eligibility.created_at,
|
|
172
|
-
}
|
|
173
|
-
: null;
|
|
174
|
-
const loyaltyPoints = salla.config.get('store.settings.rating.rating_product_points');
|
|
175
|
-
this.loyaltyPoints = loyaltyPoints ? Number(loyaltyPoints) : 0;
|
|
176
|
-
}
|
|
177
|
-
getOrderMetaText() {
|
|
178
|
-
if (!this.order) {
|
|
179
|
-
return '';
|
|
180
|
-
}
|
|
181
|
-
const orderMetaLabel = this.orderMetaLabel.replace(':id', String(this.order.reference_id || this.order.id));
|
|
182
|
-
const orderCreatedAt = this.order.created_at ? new Date(this.order.created_at) : null;
|
|
183
|
-
return orderMetaLabel + (orderCreatedAt ? ` • ${this.formatOrderDate(orderCreatedAt)}` : '');
|
|
184
|
-
}
|
|
185
|
-
formatOrderDate(date) {
|
|
186
|
-
const month = date.toLocaleDateString(navigator.language, { month: 'short' });
|
|
187
|
-
const day = String(date.getDate()).padStart(2, '0');
|
|
188
|
-
return `${date.getFullYear()} ${month} ${day}`;
|
|
189
|
-
}
|
|
190
|
-
getLoyaltyText() {
|
|
191
|
-
if (!this.loyaltyPoints) {
|
|
192
|
-
return '';
|
|
193
|
-
}
|
|
194
|
-
if (!this.loyaltyLabel) {
|
|
195
|
-
this.loyaltyLabel = salla.lang.getWithDefault('pages.rating.verified_review.loyalty_points', 'اكسب +:points نقطة ولاء بكتابة مراجعة 🏆');
|
|
196
|
-
}
|
|
197
|
-
return this.loyaltyLabel.replace(':points', String(this.loyaltyPoints));
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Shown when the shopper tries to rate a product after the eligibility
|
|
201
|
-
* check reported the community-review daily limit was hit.
|
|
202
|
-
*/
|
|
203
|
-
showRateLimitAlert() {
|
|
204
|
-
requestAnimationFrame(() => {
|
|
205
|
-
this.rateLimitModal?.setTitle?.(this.rateLimitTitleLabel);
|
|
206
|
-
this.rateLimitModal?.open?.();
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
getRateLimitModal() {
|
|
210
|
-
return (h("salla-modal", { ref: modal => (this.rateLimitModal = modal), width: "xs", centered: true }, h("span", { slot: "icon", class: "s-modal-icon s-modal-bg-normal", innerHTML: Block }), h("p", { class: "s-verified-review-rate-limit-message" }, this.rateLimitMessage), h("div", { slot: "footer", class: "s-verified-review-rate-limit-footer" }, h("salla-button", { width: "wide", fill: "outline", color: "primary", onClick: () => this.rateLimitModal?.close?.() }, this.rateLimitExitLabel))));
|
|
211
|
-
}
|
|
212
|
-
ensureRatingModal() {
|
|
213
|
-
let modal = document.querySelector('salla-rating-modal');
|
|
214
|
-
if (!modal) {
|
|
215
|
-
modal = document.createElement('salla-rating-modal');
|
|
216
|
-
document.body.appendChild(modal);
|
|
217
|
-
}
|
|
218
|
-
return modal;
|
|
219
|
-
}
|
|
220
|
-
render() {
|
|
221
|
-
if (salla.config.isGuest() || !this.ready || !this.resolvedProductId) {
|
|
222
|
-
return null;
|
|
223
|
-
}
|
|
224
|
-
if (!this.eligible) {
|
|
225
|
-
return null;
|
|
226
|
-
}
|
|
227
|
-
const title = this.order ? this.titlePurchasedLabel : this.titleNotPurchasedLabel;
|
|
228
|
-
const loyaltyText = this.order ? this.getLoyaltyText() : null;
|
|
229
|
-
const orderMeta = this.getOrderMetaText();
|
|
230
|
-
return (h(Host, null, h("div", { class: "s-verified-review-container" }, h("div", { class: "s-verified-review-glow", "aria-hidden": "true" }), h("div", { class: "s-verified-review-media" }, h("img", { class: "s-verified-review-image", src: this.productImage, alt: this.productImageAlt, width: 72, height: 72, loading: "lazy", decoding: "async" })), h("div", { class: "s-verified-review-content" }, this.order ? (h("div", { class: "s-verified-review-meta" }, h("span", { class: "s-verified-review-badge" }, h("span", { class: "s-verified-review-badge-icon", innerHTML: CheckCircle2 }), this.badgeLabel), orderMeta ? h("span", { class: "s-verified-review-order" }, orderMeta) : null)) : null, h("h3", { class: "s-verified-review-title" }, title), h("p", { class: "s-verified-review-subtitle" }, this.subtitleLabel), loyaltyText ? h("p", { class: "s-verified-review-loyalty" }, loyaltyText) : null), h("div", { class: "s-verified-review-actions" }, h("salla-button", { class: "s-verified-review-cta", fill: "outline", color: "primary", size: "medium", onClick: this.handleRateClick }, this.ctaLabel))), this.getRateLimitModal()));
|
|
231
|
-
}
|
|
232
|
-
get host() { return this; }
|
|
233
|
-
static get style() { return sallaVerifiedReviewCss; }
|
|
234
|
-
}, [0, "salla-verified-review", {
|
|
235
|
-
"productId": [520, "product-id"],
|
|
236
|
-
"ready": [32],
|
|
237
|
-
"eligible": [32],
|
|
238
|
-
"order": [32],
|
|
239
|
-
"productImage": [32],
|
|
240
|
-
"productImageAlt": [32],
|
|
241
|
-
"loyaltyPoints": [32],
|
|
242
|
-
"titlePurchasedLabel": [32],
|
|
243
|
-
"titleNotPurchasedLabel": [32],
|
|
244
|
-
"subtitleLabel": [32],
|
|
245
|
-
"badgeLabel": [32],
|
|
246
|
-
"orderMetaLabel": [32],
|
|
247
|
-
"ctaLabel": [32],
|
|
248
|
-
"loyaltyLabel": [32],
|
|
249
|
-
"rateLimitMessage": [32],
|
|
250
|
-
"rateLimited": [32]
|
|
251
|
-
}]);
|
|
252
|
-
function defineCustomElement$1() {
|
|
253
|
-
if (typeof customElements === "undefined") {
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
const components = ["salla-verified-review", "salla-attachment-view", "salla-button", "salla-file-upload", "salla-loading", "salla-modal", "salla-placeholder", "salla-rating-modal", "salla-rating-modal-v2", "salla-rating-stars", "salla-skeleton", "salla-slider"];
|
|
257
|
-
components.forEach(tagName => { switch (tagName) {
|
|
258
|
-
case "salla-verified-review":
|
|
259
|
-
if (!customElements.get(tagName)) {
|
|
260
|
-
customElements.define(tagName, SallaVerifiedReview$1);
|
|
261
|
-
}
|
|
262
|
-
break;
|
|
263
|
-
case "salla-attachment-view":
|
|
264
|
-
if (!customElements.get(tagName)) {
|
|
265
|
-
defineCustomElement$c();
|
|
266
|
-
}
|
|
267
|
-
break;
|
|
268
|
-
case "salla-button":
|
|
269
|
-
if (!customElements.get(tagName)) {
|
|
270
|
-
defineCustomElement$b();
|
|
271
|
-
}
|
|
272
|
-
break;
|
|
273
|
-
case "salla-file-upload":
|
|
274
|
-
if (!customElements.get(tagName)) {
|
|
275
|
-
defineCustomElement$a();
|
|
276
|
-
}
|
|
277
|
-
break;
|
|
278
|
-
case "salla-loading":
|
|
279
|
-
if (!customElements.get(tagName)) {
|
|
280
|
-
defineCustomElement$9();
|
|
281
|
-
}
|
|
282
|
-
break;
|
|
283
|
-
case "salla-modal":
|
|
284
|
-
if (!customElements.get(tagName)) {
|
|
285
|
-
defineCustomElement$8();
|
|
286
|
-
}
|
|
287
|
-
break;
|
|
288
|
-
case "salla-placeholder":
|
|
289
|
-
if (!customElements.get(tagName)) {
|
|
290
|
-
defineCustomElement$7();
|
|
291
|
-
}
|
|
292
|
-
break;
|
|
293
|
-
case "salla-rating-modal":
|
|
294
|
-
if (!customElements.get(tagName)) {
|
|
295
|
-
defineCustomElement$6();
|
|
296
|
-
}
|
|
297
|
-
break;
|
|
298
|
-
case "salla-rating-modal-v2":
|
|
299
|
-
if (!customElements.get(tagName)) {
|
|
300
|
-
defineCustomElement$5();
|
|
301
|
-
}
|
|
302
|
-
break;
|
|
303
|
-
case "salla-rating-stars":
|
|
304
|
-
if (!customElements.get(tagName)) {
|
|
305
|
-
defineCustomElement$4();
|
|
306
|
-
}
|
|
307
|
-
break;
|
|
308
|
-
case "salla-skeleton":
|
|
309
|
-
if (!customElements.get(tagName)) {
|
|
310
|
-
defineCustomElement$3();
|
|
311
|
-
}
|
|
312
|
-
break;
|
|
313
|
-
case "salla-slider":
|
|
314
|
-
if (!customElements.get(tagName)) {
|
|
315
|
-
defineCustomElement$2();
|
|
316
|
-
}
|
|
317
|
-
break;
|
|
318
|
-
} });
|
|
319
|
-
}
|
|
320
|
-
defineCustomElement$1();
|
|
321
|
-
|
|
322
|
-
const SallaVerifiedReview = SallaVerifiedReview$1;
|
|
323
|
-
const defineCustomElement = defineCustomElement$1;
|
|
324
|
-
|
|
325
|
-
export { SallaVerifiedReview, defineCustomElement };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,h as a,H as i,a as s}from"./p-BW1au-Nh.js";import{a as e}from"./p-CgtvEd63.js";import{C as r}from"./p-BV4kqbdL.js";import{I as o}from"./p-C-tzSDxw.js";import{M as n}from"./p-DmgxDvXL.js";import{S as l}from"./p-lMgMt31Q.js";import{S as d}from"./p-CeFAfcTv.js";import{W as m}from"./p-CgR-T_ZS.js";import{H as g}from"./p-DOBDDG4K.js";const c=class{constructor(a){t(this,a),this.hasError=!1,this.showContactWidget=!0,this.images=[],this.productImages={},this.editItemImages=[],this.contact_body=(t,a,i)=>salla.lang.get("pages.rating.contact_subject",{store:t,id:a,customer:i}),this.editMode=!1,this.defaultMode=!1,this.deleteMode=!1,this.shouldOpenDeleteModal=!1,this.editItem=null,this.loyaltyImageRatingPoints=0,this.enableNewPopUp=!0,this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.allowedImagesTypesLabel=salla.lang.get("common.uploader.allowed_images_types"),this.addImagesLabel=salla.lang.get("pages.rating.add_images"),this.editImagesLabel=salla.lang.get("pages.rating.edit_images"),this.threeImagesMax=salla.lang.get("common.uploader.max_three_images"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.contactUsLabel=salla.lang.get("blocks.footer.social"),this.loyaltyPointsForImagesLabel=salla.lang.get("pages.rating.loyalty_points_for_images",{points:":points"}),this.allowAttachImages=salla.config.get("store.settings.rating.allow_attach_images"),this.allowContactSupport=salla.config.get("store.settings.rating.allow_contact_support"),this.contentRefs=[],this.hiddenInputs=[],this.isOpen=[],this.stepsCount=0,this.currentIndex=0,this.submitted=[],this.MAX_UPLOAD_LIMIT=3,this.onOpen=t=>new Promise((a=>{e({targets:this.contentRefs[t],duration:100,height:this.contentRefs[t].scrollHeight,opacity:[0,1],easing:"easeOutQuart",complete:()=>a()})})),this.onClose=t=>new Promise((a=>{e({targets:this.contentRefs[t],duration:100,height:0,opacity:[1,0],easing:"easeOutQuart",complete:()=>a()})})),this.toggleUploader=async t=>{this.isOpen[t]=!this.isOpen[t],g.toggleElementClassIf(this.contentRefs[t],"is-closed","is-opened",(()=>!this.isOpen[t])),await(this.isOpen[t]?this.onOpen(t):this.onClose(t)),await new Promise((t=>setTimeout(t,101))),this.body&&this.currentTab&&setTimeout((()=>this.body.setAttribute("style",`height:${this.currentTab.offsetHeight+(this.editMode?60:0)}px`)))},salla.onReady((()=>{this.orderId=salla.config.get("page.id")})),salla.lang.onLoaded((()=>{this.contactUsLabel=salla.lang.get("blocks.footer.social");const t=(t,a,i)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],a,i),s(!0)}));(async()=>{await t("ar.trans","common.uploader.drag_and_drop_files","اسحب الملفات وأفلتها هنا"),await t("en.trans","common.uploader.drag_and_drop_files","Drag and drop files here"),await t("ar.trans","common.uploader.allowed_images_types"," .jpg أو jpeg أو png يُسمح بإضافة صور بصيغة"),await t("en.trans","common.uploader.allowed_images_types","Images in jpg, jpeg, or png format are allowed."),await t("ar.trans","pages.rating.add_images","اضافة صور"),await t("en.trans","pages.rating.add_images","Add Images"),await t("ar.trans","pages.rating.edit_images","تعديل الصور"),await t("en.trans","pages.rating.edit_images","Edit Images"),await t("ar.trans","pages.rating.edit_review","تعديل التقييم"),await t("en.trans","pages.rating.edit_review","Edit review"),await t("ar.trans","pages.rating.confirm_deletion","تأكيد حذف التقييم"),await t("en.trans","pages.rating.confirm_deletion","Confirm review deletion"),await t("ar.trans","pages.rating.are_you_sure_you_want_to_delete_review","هل أنت متأكد من حذف تقييمك؟"),await t("en.trans","pages.rating.are_you_sure_you_want_to_delete_review","Are you sure you want to delete your review?"),await t("ar.trans","pages.rating.review_updated_successfully","تم تعديل التقييم بنجاح"),await t("en.trans","pages.rating.review_updated_successfully","The review has been successfully updated."),await t("ar.trans","pages.rating.review_deleted_successfully","تم حذف التقييم بنجاح"),await t("en.trans","pages.rating.review_deleted_successfully","The review has been successfully deleted."),await t("ar.trans","pages.rating.images_count","الصور ( :current من أصل :total )"),await t("en.trans","pages.rating.images_count","Images ( :current of :total )"),await t("ar.trans","pages.rating.loyalty_points_for_images","اكسب :points نقطة ولاء عند إضافة صور لتقييمك!"),await t("en.trans","pages.rating.loyalty_points_for_images","Earn :points loyalty points when adding photos to your review!"),await t("ar.trans","common.uploader.max_three_images",`.أضف ${this.MAX_UPLOAD_LIMIT} صور كحد أقصى`),await t("en.trans","common.uploader.max_three_images",`Add up to ${this.MAX_UPLOAD_LIMIT} images maximum.`),await t("ar.trans","common.elements.confirm_delete","تأكيد الحذف"),await t("en.trans","common.elements.confirm_delete","Confirm deletion"),this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.allowedImagesTypesLabel=salla.lang.get("common.uploader.allowed_images_types"),this.addImagesLabel=salla.lang.get("pages.rating.add_images"),this.threeImagesMax=salla.lang.get("common.uploader.max_three_images"),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.editImagesLabel=salla.lang.get("pages.rating.edit_images"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.loyaltyPointsForImagesLabel=salla.lang.get("pages.rating.loyalty_points_for_images",{points:":points"}),this.contact_body=(t,a,i)=>salla.lang.get("pages.rating.contact_body",{store:t,id:a,customer:i})})()}))}getV2Ref(){return this.v2Ref??this.host.querySelector("salla-rating-modal-v2")}syncNewPopUpFlag(){this.enableNewPopUp=!0}async setOrder(t,a){this.orderId=t,this.productId=a,this.order=void 0,await(this.getV2Ref()?.setOrder(t,a))}async open(){return await salla.onReady(),this.syncNewPopUpFlag(),this.enableNewPopUp?this.getV2Ref()?.open():(this.defaultMode=!0,new Promise((t=>{setTimeout((()=>{this.modal.open().then((()=>this.order||salla.api.withoutNotifier((()=>salla.rating.api.order(this.orderId?this.orderId:salla.config.get("page.id")))).then((t=>this.order=t.data)))).then((()=>this.readyUpLoyaltyPoints())).then((()=>this.modal.setTitle(`${salla.lang.get("pages.rating.rate_order")} <span class="unicode">(#${this.order.id})</span>`))).then((()=>{const t={};if(this.order?.products)for(const a of this.order.products)t[a.product.id]=[];this.productImages=t})).then((()=>this.modal.stopLoading())).then((()=>this.stepsCount=[this.order.testimonials_enabled,this.order.products_enabled,this.order.shipping_enabled].filter((t=>t)).length)).then((()=>setTimeout((()=>this.handleWizard()),100))).catch((a=>{t(!1),this.hasError=!0,this.errorMessage=a.response?.data?.error?.message||a.response?.data,this.modal.stopLoading()})),t(!0)}),50)})))}async openEditModal(t){if(await salla.onReady(),this.syncNewPopUpFlag(),this.enableNewPopUp)return this.getV2Ref()?.openEditModal(t);this.defaultMode=!1,this.editMode=!0,this.editType=t.type,this.editFeedbackId=t.feedback_id;try{await this.fetchEditItem(t.feedback_id),await this.readyUpLoyaltyPoints(),this.editModal.open()}catch(t){this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data}}async fetchEditItem(t){const a=`rating/${t}/show`,i=await salla.api.request(a);this.editItem=i.data,this.allowAttachImages&&"product"==this.editType&&this.editItem.images.length&&(this.editItemImages=this.editItem.images.map((t=>({id:t,url:t}))))}async editReview(){const t={};this.editModal.querySelectorAll("[name]").forEach((a=>{const i=salla.helpers.inputData(a.name,a.value,t);t[i.name]=i.value})),t.images&&(t.images=t.images.split(","));const a=`rating/${this.editFeedbackId}`;await salla.api.request(a,t,"put").then((t=>{this.editModal.close(),salla.notify.success(t.message||this.updatedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async openDeleteModal(t){return await salla.onReady(),this.syncNewPopUpFlag(),this.enableNewPopUp?this.getV2Ref()?.openDeleteModal(t):(this.defaultMode=!1,this.deleteMode=!0,this.deleteFeedbackId=t.feedback_id,this.shouldOpenDeleteModal=!0,new Promise((t=>{setTimeout((()=>{this.deleteModal.open().then((()=>t(!0)))}),50)})))}async deleteReview(){const t=`rating/${this.deleteFeedbackId}`;await salla.api.request(t,null,"delete").then((()=>{this.deleteModal.close(),salla.notify.success(this.deletedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async close(){return this.enableNewPopUp?this.getV2Ref()?.close():this.modal.close()}handleWizard(){this.steps=this.modal.querySelectorAll(".s-rating-modal-step"),this.dots=this.modal.querySelectorAll(".s-rating-modal-step-dot"),this.showActiveStep()}showActiveStep(t=null){this.currentTab=t||this.steps[this.currentIndex],g.toggleClassIf(".s-rating-modal-step-dot","s-rating-modal-bg-gray","s-rating-modal-bg-primary",(t=>t!=this.dots[this.currentIndex])).toggleClassIf(".s-rating-modal-step","s-rating-modal-active","s-rating-modal-hidden",(t=>t==this.currentTab)),0!==this.currentIndex&&(g.toggleElementClassIf(this.currentTab,"s-rating-modal-unactive","s-rating-modal-hidden",(()=>!0)),setTimeout((()=>g.toggleElementClassIf(this.currentTab,"s-rating-modal-active","s-rating-modal-unactive",(()=>!0))),300));const a=this.steps[this.currentIndex+1]?.dataset.type;this.nextBtn?.setText(a?`${salla.lang.get("pages.rating.rate")} ${salla.lang.get(`pages.rating.${a}`)}`:salla.lang.get("pages.rating.send_ratings")),setTimeout((()=>this.body?.setAttribute("style",`height:${this.currentTab?.offsetHeight}px`)))}previousTab(){this.currentIndex>0&&this.currentIndex--,g.toggleElementClassIf(this.backBtn,"s-rating-modal-unvisiable","block",(()=>0==this.currentIndex)),this.showActiveStep()}submit(){this.submittedBefore()||this.validate(),salla.config.canLeave=!1,this.nextBtn.load().then((()=>this.submittedBefore()||this.sendFeedback())).then((()=>this.currentTab.querySelectorAll("[name],.s-rating-modal-btn-star").forEach((t=>t.setAttribute("disabled",""))))).then((()=>this.currentIndex<this.stepsCount&&this.currentIndex++)).then((()=>this.showActiveStep())).then((()=>g.toggleClassIf("#prev-btn","block","s-rating-modal-unvisiable",(()=>!0)))).finally((()=>{this.nextBtn.stop(),salla.config.canLeave=!0,this.currentIndex==this.stepsCount&&(this.showThankYou(),this.showContactWidget=!1)}))}submittedBefore(){return this.submitted.includes(this.currentIndex)}validate(t=null,a=null){if(!t&&"products"===this.currentTab.dataset.type)return void this.currentTab.querySelectorAll(".rating-outer-form").forEach((t=>this.validate(t,"product")));const i=(t=t||this.currentTab).querySelector(".rating_hidden_input").value,s=t.querySelector(".s-rating-modal-validation-msg");if(a=a||t.dataset.type,!i)throw s.innerHTML=salla.lang.get(`pages.rating.rate_${a}_stars`).replace(" (:item)",""),new Error(s.innerHTML);s.innerHTML=""}sendFeedback(){const t={};if(this.currentTab.querySelectorAll("[name]").forEach((a=>{const i=salla.helpers.inputData(a.name,a.value,t);t[i.name]=i.value})),this.allowAttachImages&&t.products)for(let a in t.products)t.products[a].images&&(t.products[a].images=t.products[a].images.split(","));if(0!=Object.keys(t).length)return t.order_id=this.orderId,t.type=this.currentTab.dataset.type,salla.rating.api[this.currentTab.dataset.type](t).then((t=>(this.submitted.push(this.currentIndex),t)))}showThankYou(){let t=10,a=setInterval((()=>{this.thanksTime.innerHTML="00:0"+t--,t>0||(clearInterval(a),this.thanksTime.remove(),this.close().then((()=>window.location.reload())))}),1e3);this.modal.querySelector(".s-rating-modal-footer").classList.add("s-rating-modal-unvisiable"),this.showActiveStep(this.thanksTab)}getFilepondPlaceholder(){return`<div class="s-rating-modal-filepond-placeholder"><span class="s-rating-modal-filepond-placeholder-icon">${o}</span><p class="s-rating-modal-filepond-placeholder-text">${this.dragAndDropFilesLabel}<br>\n <span> ${this.allowedImagesTypesLabel} <br> ${this.threeImagesMax} </span></p></div>`}getCustomerName(){return`${salla.config.get("user.first_name")||salla.storage.get("user.first_name")||""} ${salla.config.get("user.last_name")||salla.storage.get("user.last_name")||""}`}handleSendEmail(){const t=`${this.contactSubjectLabel} #${this.order.id}`,a=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),i=`mailto:${salla.config.get("store.contacts.email")}?subject=${encodeURIComponent(t)}&body=${encodeURIComponent(a)}`;window.open(i,"_blank")}handleSendWhatsApp(){const t=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),a=`https://wa.me/${salla.config.get("store.contacts.whatsapp")}?text=${encodeURIComponent(t)}`;window.open(a,"_blank")}resetData(t){t.detail||(this.modal?.close(),this.editItem=null,this.editItemImages=[],this.hiddenInputs[1]&&(this.hiddenInputs[1].value=""),this.deleteFeedbackId=null,this.editFeedbackId=null,this.shouldOpenDeleteModal=!1,this.editMode=!1,this.deleteMode=!1,this.defaultMode=!1,this.loyaltyImageRatingPoints=0)}async readyUpLoyaltyPoints(){const t=salla.loyalty?.isFeatureEnabled?.();if(!t)return void(this.loyaltyImageRatingPoints=0);const a=salla.config.get("store.settings.rating.rating_product_points")||0,i=salla.config.get("store.settings.rating.rating_product_with_image_points")||0;this.loyaltyImageRatingPoints=Number(i)+Number(a)}loyaltyPointsNote(){if(!this.loyaltyImageRatingPoints||!this.loyaltyPointsForImagesLabel)return null;const t=a("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M10 0C13.6819 0 16.6667 2.98477 16.6667 6.66664C16.6667 9.37047 15.057 11.6984 12.7437 12.7444C11.6978 15.0575 9.3701 16.6666 6.66668 16.6666C2.98477 16.6666 0 13.6819 0 9.99998C0 7.29656 1.60918 4.96894 3.92195 3.92276C4.96827 1.60964 7.29618 0 10 0ZM6.66668 5C3.90524 5 1.66667 7.23856 1.66667 9.99998C1.66667 12.7614 3.90524 15 6.66668 15C9.4281 15 11.6667 12.7614 11.6667 9.99998C11.6667 7.23856 9.4281 5 6.66668 5ZM7.50002 5.83333V6.66664H9.16668V8.33331H5.83333C5.60322 8.33331 5.41667 8.51989 5.41667 8.74998C5.41667 8.95456 5.56407 9.12464 5.75844 9.15998L5.83333 9.16664H7.50002C8.6506 9.16664 9.58335 10.0994 9.58335 11.25C9.58335 12.4006 8.6506 13.3333 7.50002 13.3333V14.1666H5.83333V13.3333H4.16667V11.6666H7.50002C7.7301 11.6666 7.91668 11.4801 7.91668 11.25C7.91668 11.0455 7.76927 10.8753 7.57493 10.8401L7.50002 10.8333H5.83333C4.68274 10.8333 3.75 9.90056 3.75 8.74998C3.75 7.59939 4.68274 6.66664 5.83333 6.66664V5.83333H7.50002ZM10 1.66667C8.51377 1.66667 7.17893 2.31513 6.26313 3.34457C6.39704 3.33736 6.53138 3.33333 6.66668 3.33333C10.3486 3.33333 13.3333 6.3181 13.3333 9.99998C13.3333 10.1356 13.3293 10.2702 13.3213 10.4037C14.3513 9.48814 15 8.15314 15 6.66664C15 3.90524 12.7614 1.66667 10 1.66667Z",fill:"#008C56"}));return a("div",{class:"s-rating-modal-loyalty-points-note-container"},a("span",{class:"s-rating-modal-loyalty-points-note-icon"},t),a("p",{class:"s-rating-modal-loyalty-points-note-text"},this.loyaltyPointsForImagesLabel.replace(":points",String(this.loyaltyImageRatingPoints))))}getDeleteModal(){return a("salla-modal",{ref:t=>this.deleteModal=t,width:"xs",onModalVisibilityChanged:t=>this.resetData(t)},a("div",{class:"s-rating-modal-delete-wrapper",ref:t=>this.body=t},a("h3",null,this.confirmDeletionLabel),a("p",null,this.areYouSureLabel),a("div",{class:"s-rating-modal-delete-actions"},a("salla-button",{loaderPosition:"center",onClick:()=>this.deleteReview()},this.confirmDeleteBtn),a("salla-button",{color:"danger",fill:"outline",onClick:()=>this.deleteModal.close()},this.cancelLabel))))}renderUploadedImagesCount(t){const i=this.editMode?this.editItemImages.length:(this.productImages[t]||[]).length;return a("span",{class:"s-rating-modal-upload-count"},salla.lang.choice("pages.rating.images_count",i,{current:i,total:this.MAX_UPLOAD_LIMIT}))}getEditModal(){return a("salla-modal",{ref:t=>this.editModal=t,width:"md",onModalVisibilityChanged:t=>this.resetData(t)},a("div",{class:"s-rating-modal-edit-wrapper",ref:t=>this.body=t},"store"===this.editType&&this.editItem?a("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"store",ref:t=>this.currentTab=t},a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),a("h2",{class:"s-rating-modal-title"},salla.lang.get("pages.rating.rate_the_store")),a("div",{class:"s-rating-modal-stars-company"},a("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),a("textarea",{name:"content",value:this.editItem.content,class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),a("small",{class:"s-rating-modal-validation-msg"})):null,"shipping"===this.editType&&this.editItem?a("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"shipping",ref:t=>this.currentTab=t},this.editItem.shipping.logo?a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:this.editItem.shipping.logo,class:"s-rating-modal-shipping-logo",alt:this.editItem.shipping.name})):a("span",{class:"s-rating-modal-icon",innerHTML:l}),a("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.editItem.shipping.name}`),a("div",{class:"s-rating-modal-stars-company"},a("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),a("textarea",{name:"content",class:"s-rating-modal-comment",value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),a("small",{class:"s-rating-modal-validation-msg"})):null,"product"==this.editType&&this.editItem?a("section",{class:"s-rating-modal-step","data-type":"products",ref:t=>this.currentTab=t},a("div",{class:"s-rating-modal-product"},this.allowAttachImages&&this.loyaltyPointsNote(),a("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},a("div",{class:"s-rating-modal-product-img-wrap"},a("img",{src:this.editItem.product.image.url,alt:this.editItem.product.name,class:"s-rating-modal-product-img"})),a("div",{class:"s-rating-modal-product-details"},a("div",{class:"s-rating-modal-product-details-main"},a("div",null,a("h3",{class:"s-rating-modal-product-title"}," ",this.editItem.product.name),a("div",{class:"s-rating-modal-stars-product"},a("salla-rating-stars",{withLabel:!0,size:"small",editable:!0,value:this.editItem.stars}))),this.allowAttachImages&&a("salla-button",{class:"s-comments-item-like-btn mt-0",loaderPosition:"center",fill:"outline",size:"small",onClick:()=>this.toggleUploader(1)},a("span",null,this.editItemImages.length?this.editImagesLabel:this.addImagesLabel),a("span",{innerHTML:o}))),a("textarea",{value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_product_rate"),name:"content",class:"s-rating-modal-comment"}),a("small",{class:"s-rating-modal-validation-msg"}))),this.allowAttachImages&&a("div",{class:"s-rating-modal-uploader is-closed",ref:t=>this.contentRefs[1]=t},a("salla-file-upload",{name:"images",allowMultiple:!0,maxFilesCount:this.MAX_UPLOAD_LIMIT,imagePreviewHeight:117,filePosterHeight:117,"instant-upload":!0,type:"feedback",files:JSON.stringify(this.editItemImages),payloadName:"files[]",id:`file-${this.editItem.product.id}`,title:this.editItem.product.name,instantUpload:!0,accept:"image/png, image/jpeg, image/jpg",url:salla.url.api("upload"),onUploaded:t=>{this.editItemImages=[...this.editItemImages,t.detail],this.hiddenInputs[1].value=this.editItemImages.map((t=>t.url)).join()},onRemoved:t=>{const a=t.detail;a&&(this.editItemImages=this.editItemImages.filter((t=>t.id!==a)),this.hiddenInputs[1].value=this.editItemImages.map((t=>t.url)).join())},labelIdle:this.getFilepondPlaceholder()}),a("input",{type:"hidden",name:"images",value:this.editItem.images.join(","),ref:t=>this.hiddenInputs[1]=t}),this.renderUploadedImagesCount(this.editItem.product.id)))):null,a("div",{class:"s-rating-modal-footer s-rating-modal-footer-end"},a("salla-button",{"loader-position":"center",onClick:()=>this.editReview()},this.editReviewLabel))))}render(){return this.enableNewPopUp?a(i,{class:"s-rating-modal"},a("salla-rating-modal-v2",{ref:t=>this.v2Ref=t,orderId:this.orderId,productId:this.productId})):this.deleteMode?a(i,{class:"s-rating-modal"},this.getDeleteModal()):this.editMode?a(i,{class:"s-rating-modal"},this.getEditModal()):this.defaultMode?a(i,{class:"s-rating-modal"},a("salla-modal",{class:"s-rating-modal-wrap",onModalVisibilityChanged:t=>this.resetData(t),isLoading:!0,width:"md",ref:t=>this.modal=t},a("div",{slot:"loading"},a("div",{class:"s-rating-modal-skeleton"},a("salla-skeleton",{type:"circle",height:"80px",width:"80px"}),a("salla-skeleton",{height:"15px",width:"60%"}),a("salla-skeleton",{height:"10px",width:"30%"}),a("div",{class:"s-rating-modal-skeleton-stars"},[...Array(5)].map((t=>a("div",{key:t,innerHTML:d})))),a("salla-skeleton",{height:"100px",width:"100%"}),a("div",{class:"s-rating-modal-skeleton-footer"},a("salla-skeleton",{height:"40px",width:"30%"})))),!this.hasError&&this.order?[a("div",{class:"s-rating-modal-wrapper",ref:t=>this.body=t},this.order?.testimonials_enabled?a("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"store"},a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),a("h2",{class:"s-rating-modal-title"},salla.lang.get("pages.rating.rate_the_store")),a("div",{class:"s-rating-modal-stars-company"},a("salla-rating-stars",{withLabel:!0,size:"large"})),a("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),a("small",{class:"s-rating-modal-validation-msg"})):"",this.order.products_enabled?a("section",{class:"s-rating-modal-step s-rating-modal-hidden","data-type":"products"},this.allowAttachImages&&this.loyaltyPointsNote(),this.order.products.map(((t,i)=>a("div",{class:"s-rating-modal-product",key:i},a("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},a("div",{class:"s-rating-modal-product-img-wrap"},a("img",{src:t.product.thumbnail,alt:t.product.name,class:"s-rating-modal-product-img"})),a("div",{class:"s-rating-modal-product-details"},a("div",{class:"s-rating-modal-product-details-main"},a("div",null,a("h3",{class:"s-rating-modal-product-title"}," ",t.product.name),a("div",{class:"s-rating-modal-stars-product"},a("salla-rating-stars",{withLabel:!0,size:"small",name:`products[${i}][rating]`}))),this.allowAttachImages&&a("salla-button",{class:"s-comments-item-like-btn mt-0",loaderPosition:"center",fill:"outline",size:"small",onClick:()=>this.toggleUploader(i)},a("span",null,this.addImagesLabel),a("span",{innerHTML:o}))),a("input",{type:"hidden",name:`products[${i}][product_id]`,value:t.product.id}),a("textarea",{placeholder:salla.lang.get("pages.rating.write_product_rate"),name:`products[${i}][comment]`,class:"s-rating-modal-comment"}),a("small",{class:"s-rating-modal-validation-msg"}))),this.allowAttachImages&&a("div",{class:"s-rating-modal-uploader is-closed",ref:t=>this.contentRefs[i]=t},a("salla-file-upload",{name:"image",maxFilesCount:this.MAX_UPLOAD_LIMIT,imagePreviewHeight:117,"instant-upload":!0,type:"feedback",payloadName:"files[]",id:`file-${t.product.id}`,title:t.product.name,allowMultiple:!0,instantUpload:!0,accept:"image/png, image/jpeg, image/jpg",url:salla.url.api("upload"),onUploaded:a=>{this.productImages={...this.productImages,[t.product.id]:[...this.productImages[t.product.id]||[],a.detail]},this.hiddenInputs[i].value=this.productImages[t.product.id].map((t=>t.url)).join(",")},onRemoved:a=>{const s=a.detail;s&&this.productImages[t.product.id]&&(this.productImages={...this.productImages,[t.product.id]:this.productImages[t.product.id].filter((t=>t.id!==s))},this.hiddenInputs[i].value=this.productImages[t.product.id].map((t=>t.url)).join(","))},labelIdle:this.getFilepondPlaceholder()}),a("input",{type:"hidden",name:`products[${i}][images]`,value:(this.productImages[t.product.id]||[]).map((t=>t.url)).join(","),ref:t=>this.hiddenInputs[i]=t}),this.renderUploadedImagesCount(t.product.id)))))):"",this.order.shipping_enabled&&this.order.shipping?.company?a("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"shipping"},a("input",{type:"hidden",name:"shipping_company_id",value:this.order.shipping.company.id}),this.order.shipping.company.logo?a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:this.order.shipping.company.logo,class:"s-rating-modal-shipping-logo",alt:this.order.shipping.company.name})):a("span",{class:"s-rating-modal-icon",innerHTML:l}),a("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.order.shipping.company.name}`),a("div",{class:"s-rating-modal-stars-company"},a("salla-rating-stars",{withLabel:!0,size:"large"})),a("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),a("small",{class:"s-rating-modal-validation-msg"})):"",a("div",{class:"s-rating-modal-thanks s-rating-modal-hidden",ref:t=>this.thanksTab=t},a("span",{class:"s-rating-modal-icon",innerHTML:r}),a("h3",{class:"s-rating-modal-thanks-title"},salla.lang.get("pages.rating.thanks")),a("div",{class:"s-rating-modal-thanks-msg",innerHTML:this.order.thanks_message}),a("time",{class:"s-rating-modal-thanks-time",ref:t=>this.thanksTime=t}))),this.allowContactSupport&&this.showContactWidget&&(salla.config.get("store.contacts.whatsapp")||salla.config.get("store.contacts.email"))?a("div",{class:"s-rating-modal-contact"},a("p",null,this.contactUsLabel),a("div",{class:"s-rating-modal-contact-icons"},salla.config.get("store.contacts.whatsapp")&&a("span",{onClick:()=>this.handleSendWhatsApp(),innerHTML:m}),salla.config.get("store.contacts.email")&&a("span",{onClick:()=>this.handleSendEmail(),innerHTML:n}))):"",a("div",{class:"s-rating-modal-footer"},a("button",{ref:t=>this.backBtn=t,onClick:()=>this.previousTab(),class:"s-rating-modal-btn s-rating-modal-unvisiable"},salla.lang.get("common.elements.back")),this.stepsCount>1?a("ul",{class:"s-rating-modal-dots"},[0,1,2].slice(0,this.stepsCount).map((t=>a("li",{key:t,class:"s-rating-modal-bg-gray s-rating-modal-step-dot"})))):"",a("salla-button",{"loader-position":"center",ref:t=>this.nextBtn=t,onClick:()=>this.submit()},salla.lang.get("common.elements.next")))]:a("salla-placeholder",{alignment:"center"}))):void 0}async componentWillLoad(){salla.event.on("rating::open",(t=>{const a=t?.orderId||salla.config.get("page.id");this.setOrder(a,t?.productId).then((()=>this.open()))})),salla.event.on("rating::edit",(t=>this.openEditModal(t))),salla.event.on("rating::delete",(t=>this.openDeleteModal(t))),await salla.onReady(),this.syncNewPopUpFlag()}componentDidLoad(){salla.event.dispatch("rating::ready",this)}get host(){return s(this)}};c.style='/*!twlt*/.s-rating-modal-uploader{overflow:visible}.s-rating-modal-uploader.is-opened{height:auto !important;opacity:1 !important;overflow:visible;pointer-events:auto !important;margin-bottom:1rem}.s-rating-modal-uploader .s-file-upload-gallery{overflow:visible}.s-rating-modal-edit-wrapper,.s-rating-modal-wrapper{transition:height 0.15s ease}.s-rating-modal-product-details{padding-bottom:0.5rem}.s-rating-modal-comment{margin-top:0.35rem}.s-rating-modal-product{margin-bottom:1rem}.s-rating-modal-product-img{position:absolute !important;inset:0;display:block;width:100% !important;max-width:100% !important;height:100% !important;object-fit:cover}.s-rating-modal-product-title{font-size:0.95rem;font-weight:600;line-height:1.5;margin:0}.s-rating-modal-stars-product{margin-top:0.5rem}.s-rating-modal-loyalty-points-note-container{display:flex;align-items:center;gap:0.625rem;width:100%;margin-top:1.5rem;margin-bottom:0.75rem;padding:0.75rem;border-radius:0.5rem;background-color:#E6F4EA}.s-rating-modal-loyalty-points-note-icon{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;color:#1B7F5C}.s-rating-modal-loyalty-points-note-icon svg{width:1.5rem;height:1.5rem;fill:currentColor}.s-rating-modal-loyalty-points-note-text{flex:1;margin:0;font-size:0.875rem;line-height:1.25rem;color:#1f2937}.s-rating-modal-product-details-main{display:flex;align-items:center;margin-bottom:0.5rem;padding-bottom:0;border-bottom:0}.s-rating-modal-product-info-row{display:flex;align-items:center;gap:0.6rem;margin-bottom:0.5rem;padding-bottom:0;border-bottom:0}.s-rating-modal-product-main-review{width:100%;text-align:right}.s-rating-modal-product-rating-rows{display:grid;gap:0.45rem;margin:0.2rem 0 0.7rem}.s-rating-modal-product-rating-row{display:flex;align-items:center;justify-content:space-between;gap:0.75rem;min-height:2rem}.s-rating-modal-product-rating-row salla-rating-stars{flex-shrink:0}.s-rating-modal-product-rating-row .s-rating-stars-wrapper{align-items:center;min-height:1.75rem}.s-rating-modal-product-rating-row .s-rating-stars-label,.s-rating-modal-product-rating-row .s-rating-stars-label-without-tag{min-width:auto;min-height:1.25rem;line-height:1.25rem;font-size:0.8rem;color:#5b6470;white-space:nowrap;text-align:end;transition:opacity 0.15s ease}.s-rating-modal-product-rating-row .s-rating-stars-label--empty,.s-rating-modal-product-rating-row .s-rating-stars-label-without-tag--empty{opacity:0}.s-rating-modal-product-rating-row-main{margin-bottom:0.35rem;padding:0.5rem 0.6rem;border:1px solid #d1d5db;border-radius:0.45rem;background:transparent}.s-rating-modal-product-factor-name{color:#5b6470;font-size:0.9rem;line-height:1.25}.s-rating-modal-product-rating-row-main .s-rating-modal-product-factor-name{font-size:1rem;color:#5b6470}.s-rating-modal-product-factor-required{color:#f87171;margin-inline-start:0.2rem}.s-rating-modal-product-img-wrap{position:relative;width:5rem !important;min-width:5rem !important;max-width:5rem !important;height:3.5rem !important;flex-shrink:0 !important;overflow:hidden;border-radius:0.375rem;background:#f3f4f6}.mt-0{margin-top:0px}.block{display:block}.hidden{display:none}.px-3{padding-left:0.75rem;padding-right:0.75rem}.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)}.s-comments-item-like-btn{margin-top:0.5rem}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-comments-item-like-btn span svg{height:0.75rem;width:0.75rem}.s-rating-modal-wrapper{margin-bottom:1.5rem;transition-property:all;transition-duration:100ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-rating-modal-edit-wrapper{margin-top:0.625rem}.s-rating-modal-footer{position:relative;display:flex;align-items:center;justify-content:space-between}.s-rating-modal-footer salla-button button{padding-left:1rem !important;padding-right:1rem !important;font-size:0.75rem !important}.s-rating-modal-btn{height:2.5rem;padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-rating-modal-btn:hover{color:var(--color-primary-dark)}.s-rating-modal-dots{display:flex;flex-shrink:0;flex-grow:1;justify-content:center}.s-rating-modal-dots>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.375rem * var(--tw-space-x-reverse));margin-left:calc(0.375rem * calc(1 - var(--tw-space-x-reverse)))}.s-rating-modal-dots{text-align:center}.s-rating-modal-dots:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-rating-modal-step-dot{height:0.625rem;width:0.625rem;border-radius:9999px;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-rating-modal-step{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-rating-modal-active{--tw-translate-x:0px;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));opacity:1}.s-rating-modal-unactive{--tw-translate-x:0.75rem;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));opacity:0}.s-rating-modal-hidden{display:none !important}.s-rating-modal-unvisiable{pointer-events:none;opacity:0}.s-rating-modal-step-wrap{position:relative;display:flex;flex-direction:column;align-items:center;padding-bottom:1rem}.s-rating-modal-product-details{position:relative;display:flex;flex:1 1 0%;flex-direction:column;padding-bottom:1rem}.s-rating-modal-product-details-main{display:flex;align-items:flex-start;justify-content:space-between}.s-rating-modal-product-details-main .s-rating-stars-wrapper{margin-bottom:0.375rem;flex-direction:column;align-items:center}@media (min-width: 640px){.s-rating-modal-product-details-main .s-rating-stars-wrapper{margin-bottom:0px;flex-direction:row;gap:0px}}.s-rating-modal-rounded-icon{margin-bottom:1rem;display:flex;height:7rem;width:7rem;align-items:center;justify-content:center;overflow:hidden;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-rating-modal-title{margin-bottom:1rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}.s-rating-modal-store-logo{width:4rem;object-fit:contain}.s-rating-modal-shipping-logo{height:100%;width:100%;object-fit:contain}.s-rating-modal-shipping-icon{font-size:3rem;line-height:1;color:var(--color-primary)}.s-rating-modal-comment{margin-bottom:0.5rem;height:5rem !important;width:100%;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.75rem;font-size:0.875rem;line-height:1.25rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-rating-modal-comment:focus{border-color:var(--color-primary)}.s-rating-modal-comment:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.s-rating-modal-validation-msg{margin-top:-3px;line-height:1rem;--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-rating-modal-product{margin-bottom:1.5rem}.s-rating-modal-product:last-child{margin-bottom:0px}.s-rating-modal-product .rating-outer-form{display:flex}.s-rating-modal-product .rating-outer-form>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}@media (min-width: 640px){.s-rating-modal-product .rating-outer-form>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}}.s-rating-modal-product .rating-outer-form:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-rating-modal-product-img-wrap{height:3.5rem;width:auto;overflow:hidden;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}@media (min-width: 640px){.s-rating-modal-product-img-wrap{width:5rem}}.s-rating-modal-product-img{position:relative;height:100%;width:100%;object-fit:cover;font-size:0px}.s-rating-modal-product-img::before{position:absolute;top:0px;left:0px;height:100%;width:100%;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-rating-modal-product-title{margin-bottom:0.375rem;font-size:0.875rem;font-weight:700;line-height:1.25rem}.s-rating-modal-thanks{padding-left:2rem;padding-right:2rem;text-align:center;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-rating-modal-icon{display:inline-flex;height:5rem;width:5rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));color:var(--color-primary)}.s-rating-modal-icon svg{height:1.75rem;width:1.75rem;fill:var(--color-primary)}.s-rating-modal-thanks-title{margin-top:1rem;font-weight:700}.s-rating-modal-thanks-msg{margin-bottom:1.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-rating-modal-thanks-btn{height:2.5rem;flex:none;display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-rating-modal-thanks-btn:hover{opacity:0.8}.s-rating-modal-thanks-btn{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-rating-modal-thanks-time{margin-top:0.75rem;display:block;height:1.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-rating-modal-stars-company{margin-bottom:1.25rem}.s-rating-modal-stars-company .s-rating-stars-wrapper{flex-direction:column;align-items:center;justify-content:center;gap:0.5rem}.s-rating-modal-stars-product{margin-bottom:0.25rem}.s-rating-modal-upload-count{font-size:0.875rem;line-height:1.25rem;font-weight:500}.s-rating-modal-bg-gray{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-rating-modal-bg-primary{background-color:var(--color-primary)}unicode{unicode-bidi:plaintext}.s-rating-modal-wrap .s-modal-body{position:relative !important}.s-rating-modal-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-rating-modal-skeleton salla-skeleton:nth-child(1){margin-bottom:1.25rem}.s-rating-modal-skeleton salla-skeleton:nth-child(2){margin-bottom:0.75rem}.s-rating-modal-skeleton salla-skeleton:nth-child(3){margin-bottom:1.25rem}.s-rating-modal-skeleton salla-skeleton:nth-child(4){margin-bottom:2rem}.s-rating-modal-skeleton-footer{margin-top:1.5rem;display:flex;width:100%;justify-content:flex-end}.s-rating-modal-skeleton-footer salla-skeleton{margin-bottom:0px !important}.s-rating-modal-skeleton-stars{margin-bottom:0.75rem;display:flex;align-items:center}.s-rating-modal-skeleton-stars>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}.s-rating-modal-skeleton-stars:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-rating-modal-skeleton-stars div svg{width:25px;fill:currentColor;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-rating-modal-uploader{height:0px;opacity:0;transition-property:all;transition-duration:100ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-rating-modal-uploader.is-opened{margin-bottom:1.5rem;overflow:visible}.s-rating-modal-uploader.is-closed{pointer-events:none;z-index:0}.s-rating-modal-uploader .filepond--drop-label{--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-rating-modal-uploader .filepond--file-status .filepond--file-status-main{font-size:11px}.s-rating-modal-uploader .filepond--file-info-main{font-size:11px}.s-rating-modal-uploader li[data-filepond-item-state=\'load-invalid\'] .filepond--file-info{display:none}.s-rating-modal-filepond-placeholder-text{font-size:0.75rem !important;line-height:1rem !important}.s-rating-modal-filepond-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-rating-modal-filepond-placeholder-icon{margin-bottom:0.25rem}.s-rating-modal-filepond-placeholder-icon svg{height:1.5rem;width:1.5rem;fill:#7c8082}.s-rating-modal-contact{margin-bottom:1rem;display:flex;align-items:center;justify-content:space-between;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding:0.5rem}.s-rating-modal-contact p{font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-rating-modal-contact-icons{display:flex;align-items:center;gap:0.5rem}.s-rating-modal-contact-icons span{display:flex;cursor:pointer;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.375rem}.s-rating-modal-contact-icons span svg{height:1rem;width:1rem;fill:var(--color-primary)}.s-rating-modal-footer-end{justify-content:flex-end}.s-rating-modal-delete-wrapper{text-align:center}.s-rating-modal-delete-wrapper h3{margin-top:1.25rem;font-size:1.125rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-rating-modal-delete-wrapper p{margin-top:1.25rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-rating-modal-delete-actions{margin-top:1.25rem;display:flex;align-items:center;gap:0.625rem}.s-rating-modal-delete-actions salla-button{width:100%}.s-rating-modal-delete-actions salla-button button{width:100%}';export{c as salla_rating_modal}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,f as a,h as i,H as s,a as e}from"./p-BW1au-Nh.js";import{S as r}from"./p-CeFAfcTv.js";import{S as o}from"./p-lMgMt31Q.js";import{C as n}from"./p-BV4kqbdL.js";import{H as l}from"./p-DOBDDG4K.js";import{I as d}from"./p-C-tzSDxw.js";import{W as m}from"./p-CgR-T_ZS.js";import{M as h}from"./p-DmgxDvXL.js";import{b as c}from"./p-DrXX8XG8.js";import"./p-CgtvEd63.js";function g(t){const a=t.split(/[?#]/,1)[0];return/\.(mp4|webm|mov|avi|mkv)$/i.test(a)}function p(t){return t.reduce(((t,a)=>a?(g(a)?t.videos.push(a):t.images.push(a),t):t),{images:[],videos:[]})}function u(t){return p(t.map((t=>t?.url||"")).filter(Boolean))}function w(t){return t?Array.isArray(t)?t.filter(Boolean):t.split(",").map((t=>t.trim())).filter(Boolean):[]}function f(t){return t.reduce(((t,a)=>(g(a?.url||"")?t.video+=1:t.image+=1,t)),{image:0,video:0})}function v(t,a){const i=String(a);let s=!1;return t.filter((t=>{const a=null!=t?.id?String(t.id):"",e=String(t?.url??"");return!(a===i||e===i)||!!s||(s=!0,!1)}))}function b(t,a,i){const{images:s,videos:e}=u(i);t&&(t.value=s.join(",")),a&&(a.value=e.join(","))}function y(t,a,i){a||delete t.images,i||delete t.videos}const _=class{constructor(a){t(this,a),this.hasError=!1,this.showContactWidget=!0,this.errorMessage="",this.images=[],this.productImages={},this.editItemImages=[],this.productReviewFactors={},this.editFactorRatings={},this.productMainRatings={},this.productFactorRatings={},this.contact_body=(t,a,i)=>salla.lang.get("pages.rating.contact_subject",{store:t,id:a,customer:i}),this.editMode=!1,this.defaultMode=!1,this.deleteMode=!1,this.shouldOpenDeleteModal=!1,this.editItem=null,this.allowAttachImages=!1,this.allowAttachVideos=!1,this.allowContactSupport=!1,this.uploadCounts={},this.uploadImageCounts={},this.uploadVideoCounts={},this.hasUploadsInProgress=!1,this.loyaltyImageRatingPoints=0,this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.allowedImagesTypesLabel=salla.lang.get("common.uploader.allowed_images_types"),this.threeImagesMax=salla.lang.get("common.uploader.max_three_images"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.contactUsLabel=salla.lang.get("blocks.footer.social"),this.requiredFactorsLabel=salla.lang.get("pages.rating.rate_required_factors"),this.overallProductRatingLabel=salla.lang.get("pages.rating.overall_product_rating"),this.loyaltyPointsForImagesLabel=salla.lang.get("pages.rating.loyalty_points_for_images",{points:":points"}),this.contentRefs=[],this.hiddenInputs=[],this.hiddenVideoInputs=[],this.uploadingByProductId={},this.userFilledFactorKeys={},this.boundRatingRows=new WeakSet,this.stepsCount=0,this.currentIndex=0,this.submitted=[],this.thanksCountdownInterval=null,this.MAX_IMAGE_UPLOAD_LIMIT=10,this.MAX_VIDEO_UPLOAD_LIMIT=5,this.MAX_VIDEO_FILE_SIZE="100MB",this.MAX_VIDEO_DURATION=60,this.MAX_PARALLEL_UPLOADS=10,this.scheduleWizardSetup=!1,salla.lang.onLoaded((()=>{this.contactUsLabel=salla.lang.get("blocks.footer.social");const t=(t,a,i)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],a,i),s(!0)}));(async()=>{await t("ar.trans","common.uploader.drag_and_drop_files","اسحب الملفات وأفلتها هنا"),await t("en.trans","common.uploader.drag_and_drop_files","Drag and drop files here"),await t("ar.trans","common.uploader.allowed_images_types"," .jpg أو jpeg أو png يُسمح بإضافة صور بصيغة"),await t("en.trans","common.uploader.allowed_images_types","Images in jpg, jpeg, or png format are allowed."),await t("ar.trans","pages.rating.add_images","اضافة صور"),await t("en.trans","pages.rating.add_images","Add Images"),await t("ar.trans","pages.rating.edit_images","تعديل الصور"),await t("en.trans","pages.rating.edit_images","Edit Images"),await t("ar.trans","pages.rating.edit_review","تعديل التقييم"),await t("en.trans","pages.rating.edit_review","Edit review"),await t("ar.trans","pages.rating.confirm_deletion","تأكيد حذف التقييم"),await t("en.trans","pages.rating.confirm_deletion","Confirm review deletion"),await t("ar.trans","pages.rating.are_you_sure_you_want_to_delete_review","هل أنت متأكد من حذف تقييمك؟"),await t("en.trans","pages.rating.are_you_sure_you_want_to_delete_review","Are you sure you want to delete your review?"),await t("ar.trans","pages.rating.review_updated_successfully","تم تعديل التقييم بنجاح"),await t("en.trans","pages.rating.review_updated_successfully","The review has been successfully updated."),await t("ar.trans","pages.rating.review_deleted_successfully","تم حذف التقييم بنجاح"),await t("en.trans","pages.rating.review_deleted_successfully","The review has been successfully deleted."),await t("ar.trans","pages.rating.images_count","الصور ( :current من أصل :total )"),await t("en.trans","pages.rating.images_count","Images ( :current of :total )"),await t("ar.trans","pages.rating.media_count","الصور (:imageCurrent/:imageTotal) · الفيديو (:videoCurrent/:videoTotal)"),await t("en.trans","pages.rating.media_count","Images (:imageCurrent/:imageTotal) · Videos (:videoCurrent/:videoTotal)"),await t("ar.trans","common.uploader.allowed_videos_types","يُسمح بفيديوهات mp4 أو mov أو avi أو mkv"),await t("en.trans","common.uploader.allowed_videos_types","Videos in mp4, mov, avi, or mkv format are allowed."),await t("ar.trans","pages.rating.videos_count","الفيديو ( :current من أصل :total )"),await t("en.trans","pages.rating.videos_count","Videos ( :current of :total )"),await t("ar.trans","common.uploader.allowed_media_types","يُسمح بصور jpg أو jpeg أو png وفيديوهات mp4 أو mov أو avi أو mkv"),await t("en.trans","common.uploader.allowed_media_types","Images in jpg, jpeg, or png and videos in mp4, mov, avi, or mkv are allowed."),await t("ar.trans","common.uploader.max_three_images","أضف حتى 10 صور و 5 فيديوهات كحد أقصى"),await t("en.trans","common.uploader.max_three_images","Add up to 10 images and 5 videos maximum."),await t("ar.trans","common.uploader.max_images_count","أضف :count صور كحد أقصى"),await t("en.trans","common.uploader.max_images_count","Add up to :count images maximum."),await t("ar.trans","common.uploader.max_videos_count","أضف :count فيديوهات كحد أقصى"),await t("en.trans","common.uploader.max_videos_count","Add up to :count videos maximum."),await t("ar.trans","common.elements.confirm_delete","تأكيد الحذف"),await t("en.trans","common.elements.confirm_delete","Confirm deletion"),await t("ar.trans","pages.rating.rate_required_factors","يرجى تقييم جميع المعايير لإتمام مراجعتك."),await t("en.trans","pages.rating.rate_required_factors","Please rate all required factors to complete your review."),await t("ar.trans","pages.rating.overall_product_rating","التقييم العام للمنتج"),await t("en.trans","pages.rating.overall_product_rating","Overall product rating"),await t("ar.trans","pages.rating.loyalty_points_for_images","اكسب :points نقطة ولاء عند إضافة صور لتقييمك!"),await t("en.trans","pages.rating.loyalty_points_for_images","Earn :points loyalty points when adding photos to your review!"),this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.allowedImagesTypesLabel=this.getAllowedMediaTypesLabel(),this.threeImagesMax=this.getMaxUploadHintLabel(),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.requiredFactorsLabel=salla.lang.get("pages.rating.rate_required_factors"),this.overallProductRatingLabel=salla.lang.get("pages.rating.overall_product_rating"),this.loyaltyPointsForImagesLabel=salla.lang.get("pages.rating.loyalty_points_for_images",{points:":points"}),this.contact_body=(t,a,i)=>salla.lang.get("pages.rating.contact_body",{store:t,id:a,customer:i})})()}))}syncStoreSettings(){void 0===this.orderId&&(this.orderId=salla.config.get("page.id")),this.allowAttachImages=!!salla.config.get("store.settings.rating.allow_attach_images"),this.allowAttachVideos=!!salla.config.get("store.settings.rating.allow_attach_videos"),this.allowContactSupport=!!salla.config.get("store.settings.rating.allow_contact_support"),this.refreshMediaLabels()}canAttachMedia(){return this.allowAttachImages||this.allowAttachVideos}getMediaUploadAccept(){return c(this.allowAttachImages,this.allowAttachVideos)}refreshMediaLabels(){this.allowedImagesTypesLabel=this.getAllowedMediaTypesLabel(),this.threeImagesMax=this.getMaxUploadHintLabel()}getAllowedMediaTypesLabel(){return this.allowAttachImages&&this.allowAttachVideos?salla.lang.get("common.uploader.allowed_media_types"):this.allowAttachImages?salla.lang.get("common.uploader.allowed_images_types"):this.allowAttachVideos?salla.lang.get("common.uploader.allowed_videos_types"):""}getMaxUploadHintLabel(){return this.allowAttachImages&&this.allowAttachVideos?salla.lang.get("common.uploader.max_three_images"):this.allowAttachImages?salla.lang.get("common.uploader.max_images_count",{count:this.MAX_IMAGE_UPLOAD_LIMIT}):this.allowAttachVideos?salla.lang.get("common.uploader.max_videos_count",{count:this.MAX_VIDEO_UPLOAD_LIMIT}):""}setUploadCount(t,a,i,s){this.uploadCounts={...this.uploadCounts,[t]:a},null!=i&&(this.uploadImageCounts={...this.uploadImageCounts,[t]:i}),null!=s&&(this.uploadVideoCounts={...this.uploadVideoCounts,[t]:s})}setUploaderProcessing(t,a){this.uploadingByProductId={...this.uploadingByProductId,[t]:a},this.hasUploadsInProgress=Object.values(this.uploadingByProductId).some(Boolean)}scheduleUploaderHeightRefresh(){[50,150,350].forEach((t=>{setTimeout((()=>this.updateBodyHeight()),t)}))}handleGalleryCountUpdate(t,a){this.setUploadCount(t,a.count,a.imageCount,a.videoCount),this.setUploaderProcessing(t,!!a.uploading),this.scheduleUploaderHeightRefresh()}isUnverifiedReview(){return null===this.orderId&&!!this.productId}getRatingOrderId(){return this.orderId||salla.config.get("page.id")}getSubmitOrderId(){return this.orderId}isCustomerOrderShape(t){if(!t||"object"!=typeof t)return!1;const a=t;return!!a.rating&&(Array.isArray(a.items)||Array.isArray(a.products)||Array.isArray(a.rating?.product)||Array.isArray(a.rating?.products))}getBootstrapOrder(){const t=salla.config.get("page");if(this.isCustomerOrderShape(t))return t;if(t&&"object"==typeof t){const a=t;if(Array.isArray(a.products))return t;const i=a.order;if(this.isCustomerOrderShape(i))return i}}async loadCustomerOrderForEdit(){const t=this.getBootstrapOrder();if(t?.rating?.product||t?.rating?.products)this.order=t;else try{const t=await salla.api.withoutNotifier((()=>salla.order.api.getDetails(this.getRatingOrderId())));t?.data&&(this.order=t.data)}catch(t){if(!this.order){const t=await salla.api.withoutNotifier((()=>salla.rating.api.order(this.getRatingOrderId())));this.order=t.data}}}getOrderProductRatings(t=this.order){return t?.rating?[...this.normalizeToArray(t.rating.product),...this.normalizeToArray(t.rating.products)]:[]}getMatchedProductRating(t=this.order,a,i){return this.getOrderProductRatings(t).find((t=>Number(t?.id??t?.feedback_id)===Number(i)||Number(t?.product_id??t?.product?.id)===Number(a)))}hasRatingFeedback(t){const a=t?.rating;return null!=a&&""!==a&&Number(a)>0}isTestimonialsEnabled(t=this.order){return!(this.productId||!1===t?.testimonials_enabled||this.hasRatingFeedback(t?.store?.feedback)||!0!==t?.testimonials_enabled&&!t?.allowed_ratings?.testimonials_enabled)}isProductsEnabled(t=this.order){return!1!==t?.products_enabled&&this.getRateableProducts(t).length>0}isShippingEnabled(t=this.order){return!(this.productId||!1===t?.shipping_enabled||this.hasRatingFeedback(t?.shipping?.feedback)||!t?.shipping?.company||!0!==t?.shipping_enabled&&!t?.allowed_ratings?.shipping_enabled)}getOrderProducts(t=this.order){return Array.isArray(t?.products)?t.products.filter((t=>t?.product?.id)):[]}getRateableProducts(t=this.order){return this.getOrderProducts(t).filter((t=>!(this.hasRatingFeedback(t?.feedback)||this.productId&&String(t.product.id)!==String(this.productId))))}getStepsCount(t=this.order){if(!t)return 0;let a=0;return this.isTestimonialsEnabled(t)&&a++,this.isProductsEnabled(t)&&(a+=this.getRateableProducts(t).length),this.isShippingEnabled(t)&&t.shipping?.company&&a++,a}afterOrderLoaded(){this.stepsCount=this.getStepsCount(),this.scheduleWizardSetup=!0,a(this)}async setOrder(t,a){this.orderId=t,this.productId=a,this.order=void 0,this.hasError=!1,this.errorMessage=void 0,this.showContactWidget=!0}async loadUnverifiedProductOrder(){const t=await salla.api.withoutNotifier((()=>salla.product.api.getDetails(this.productId))).catch((()=>null)),a=t?.data;this.order={products:[{feedback:void 0,product:{id:Number(this.productId),name:a?.name||"",thumbnail:a?.image?.url||salla.url.cdn("images/s-empty.png")}}],products_enabled:!0,testimonials_enabled:!1,shipping_enabled:!1,thanks_message:""},this.productReviewFactors=await this.fetchAllProductReviewFactors(this.order)}getModalTitle(){if(this.isUnverifiedReview()){const t=this.getRateableProducts()[0]?.product?.name||"";return`${salla.lang.get("pages.rating.rate")} ${t}`.trim()}return`${salla.lang.get("pages.rating.rate_order")} <span class="unicode">(#${this.order?.id})</span>`}async open(){return await salla.onReady(),this.syncStoreSettings(),this.defaultMode=!0,this.currentIndex=0,this.submitted=[],new Promise((t=>{setTimeout((()=>{this.modal?.open().then((()=>this.order||(this.isUnverifiedReview()?this.loadUnverifiedProductOrder():salla.api.withoutNotifier((()=>salla.rating.api.order(this.getRatingOrderId()))).then((async t=>{this.order=t.data,this.productReviewFactors=await this.fetchAllProductReviewFactors(t.data)}))))).then((()=>this.readyUpLoyaltyPoints())).then((()=>this.modal?.setTitle(this.getModalTitle()))).then((()=>{const t={};for(const a of this.getRateableProducts())t[a.product.id]=[];this.productImages=t,this.uploadCounts=Object.fromEntries(Object.keys(t).map((t=>[Number(t),0])))})).then((()=>this.modal?.stopLoading())).then((()=>this.afterOrderLoaded())).catch((a=>{t(!1),this.hasError=!0,this.errorMessage=a.response?.data?.error?.message||a.response?.data,this.modal?.stopLoading()})),t(!0)}),50)}))}async openEditModal(t){await salla.onReady(),this.syncStoreSettings(),this.defaultMode=!1,this.editMode=!0,this.editType=t.type,this.editFeedbackId=t.feedback_id;try{await this.fetchEditItem(t.feedback_id),await this.readyUpLoyaltyPoints(),"product"===this.editType&&this.editItem?.product?.id&&(await this.loadCustomerOrderForEdit(),await this.ensureProductFactorsLoaded(this.editItem.product.id),this.editFactorRatings={...this.buildEditFactorRatings(this.editItem.product.id)},this.markExistingFactorRatingsAsUserFilled(this.editItem.product.id,this.editFactorRatings)),this.editModal?.open(),"product"===this.editType&&this.canAttachMedia()&&this.scheduleUploaderHeightRefresh()}catch(t){this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data}}async fetchEditItem(t){const a=`rating/${t}/show`,i=await salla.api.request(a);if(this.editItem=i.data,this.canAttachMedia()&&"product"==this.editType){const t=(this.editItem.images||[]).filter(Boolean),a=(this.editItem.videos||[]).filter(Boolean);let i=[...t,...a];if(!a.length&&t.length){const a=p(t);i=[...a.images,...a.videos]}if(i=i.filter((t=>g(t)?this.allowAttachVideos:this.allowAttachImages)),i.length){this.editItemImages=i.map((t=>function(t){return{id:t,url:t}}(t)));const t=f(this.editItemImages);this.setUploadCount(this.editItem.product.id,this.editItemImages.length,t.image,t.video)}}}async editReview(){if(this.hasUploadsInProgress)return;const t=`rating/${this.editFeedbackId}`;let a;if("product"===this.editType){const t=this.editModal?.querySelector('[data-type="products"]')||this.currentTab;if(a=this.buildProductRatingPayload(this.collectFormData(t),t),!a.product_id&&this.editItem?.product?.id&&(a.product_id=String(this.editItem.product.id)),this.canAttachMedia()){const{images:t,videos:i}=u(this.editItemImages);this.allowAttachImages&&(a.images=t),this.allowAttachVideos&&(a.videos=i)}y(a,this.allowAttachImages,this.allowAttachVideos)}else a=this.collectFormData(this.editModal),a.images&&(a.images=w(a.images)),a.videos&&(a.videos=w(a.videos)),y(a,this.allowAttachImages,this.allowAttachVideos);await salla.api.request(t,a,"put").then((t=>{this.editModal?.close(),salla.notify.success(t.message||this.updatedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async openDeleteModal(t){return this.defaultMode=!1,this.deleteMode=!0,this.deleteFeedbackId=t.feedback_id,this.shouldOpenDeleteModal=!0,new Promise((t=>{setTimeout((()=>{this.deleteModal?.open().then((()=>t(!0)))}),50)}))}async deleteReview(){const t=`rating/${this.deleteFeedbackId}`;await salla.api.request(t,null,"delete").then((()=>{this.deleteModal?.close(),salla.notify.success(this.deletedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async close(){return this.modal?.close()}handleWizard(){this.steps=this.modal?.querySelectorAll(".s-rating-modal-step"),this.dots=this.modal?.querySelectorAll(".s-rating-modal-step-dot"),0!==this.stepsCount?this.showActiveStep():this.showThankYou()}refreshWizardRefs(){this.modal&&(this.steps=this.modal.querySelectorAll(".s-rating-modal-step"),this.dots=this.modal.querySelectorAll(".s-rating-modal-step-dot"))}showActiveStep(t=null){if(this.refreshWizardRefs(),this.currentTab=t||this.steps?.[this.currentIndex],!this.currentTab)return;l.toggleClassIf(".s-rating-modal-step-dot","s-rating-modal-bg-gray","s-rating-modal-bg-primary",(t=>t!=this.dots?.[this.currentIndex])).toggleClassIf(".s-rating-modal-step","s-rating-modal-active","s-rating-modal-hidden",(t=>t==this.currentTab)),0!==this.currentIndex&&(l.toggleElementClassIf(this.currentTab,"s-rating-modal-unactive","s-rating-modal-hidden",(()=>!0)),setTimeout((()=>l.toggleElementClassIf(this.currentTab,"s-rating-modal-active","s-rating-modal-unactive",(()=>!0))),300));const a=this.steps?.[this.currentIndex+1]?.dataset.type;this.nextBtn?.setText(a?`${salla.lang.get("pages.rating.rate")} ${salla.lang.get(`pages.rating.${a}`)}`:salla.lang.get("pages.rating.send_ratings")),setTimeout((()=>this.updateBodyHeight()),0),setTimeout((()=>this.updateBodyHeight()),150)}updateBodyHeight(){this.body&&this.currentTab&&(this.body.style.height="products"!==this.currentTab.dataset.type?`${this.currentTab.offsetHeight+(this.editMode?60:0)}px`:"auto")}previousTab(){this.currentIndex>0&&this.currentIndex--,l.toggleElementClassIf(this.backBtn,"s-rating-modal-unvisiable","block",(()=>0==this.currentIndex)),this.showActiveStep()}async submit(){if(!this.hasUploadsInProgress){this.refreshWizardRefs();try{this.submittedBefore()||this.validate(),salla.config.canLeave=!1,await(this.nextBtn?.load()),this.submittedBefore()||await this.sendFeedback(),this.currentTab?.querySelectorAll("[name],.s-rating-modal-btn-star").forEach((t=>t.setAttribute("disabled",""))),this.currentIndex<this.stepsCount&&this.currentIndex++,this.showActiveStep(),l.toggleClassIf("#prev-btn","block","s-rating-modal-unvisiable",(()=>!0)),this.currentIndex===this.stepsCount&&(this.showThankYou(),this.showContactWidget=!1)}finally{this.nextBtn?.stop(),salla.config.canLeave=!0}}}submittedBefore(){return this.submitted.includes(this.currentIndex)}getRatingHiddenInput(t){const a=t,i=a.querySelector?.(".rating_hidden_input");if(i?.name)return i;const s=a.querySelector?.("salla-rating-stars");return s?.shadowRoot?.querySelector(".rating_hidden_input")||null}collectNamedInputs(t){const a=new Set,i=[],s=t=>{t?.name&&!a.has(t)&&(a.add(t),i.push(t))};return t.querySelectorAll("[name]").forEach((t=>{t.closest("salla-file-upload")||s(t)})),t.querySelectorAll("salla-rating-stars").forEach((t=>{s(this.getRatingHiddenInput(t))})),i}normalizeFactorsList(t){return t?Array.isArray(t)?t:"object"==typeof t?Object.values(t).filter((t=>t&&"object"==typeof t)):[]:[]}validate(t=null,a=null){if(!t&&"products"===this.currentTab?.dataset?.type)return void this.currentTab.querySelectorAll(".rating-outer-form").forEach((t=>this.validate(t,"product")));const i=t??this.currentTab;if(!i)return;const s=i.querySelector(".s-rating-modal-product-rating-row-main"),e=this.getRatingHiddenInput(s||i),r=e?.value,o=i.querySelector(".s-rating-modal-validation-msg"),n=a||i.getAttribute("data-type");if(!r)throw o.innerHTML=salla.lang.get(`pages.rating.rate_${n}_stars`).replace(" (:item)",""),new Error(o.innerHTML);if("product"===n&&Array.from(i.querySelectorAll('.s-rating-modal-product-factor-row[data-required="true"]')).some((t=>{const a=this.getRatingHiddenInput(t);return!a?.value})))throw o.innerHTML=this.requiredFactorsLabel,new Error(o.innerHTML);o&&(o.innerHTML="")}collectFormData(t=this.currentTab){if(!t)return{};const a={};return this.collectNamedInputs(t).forEach((t=>{const i=salla.helpers.inputData(t.name,t.value,a);a[i.name]=i.value})),a}buildProductRatingPayload(t,a=this.currentTab){if(!a)return{};if(!t.rating){const i=a.querySelector(".s-rating-modal-product-rating-row-main"),s=this.getRatingHiddenInput(i||a);s?.value&&(t.rating=s.value)}const i=Number(t.product_id);let s=[],e=[];t.images?s=w(t.images):this.editMode&&this.canAttachMedia()&&i?s=u(this.editItemImages).images:this.canAttachMedia()&&i&&(s=u(this.productImages[i]||[]).images),t.videos?e=w(t.videos):this.editMode&&this.canAttachMedia()&&i?e=u(this.editItemImages).videos:this.canAttachMedia()&&i&&(e=u(this.productImages[i]||[]).videos);const r=this.normalizeFactorsList(t.factors).filter((t=>t?.id&&t?.rating)).map((t=>({id:String(t.id),rating:String(t.rating)}))),o={order_id:this.getSubmitOrderId(),product_id:String(t.product_id),rating:String(t.rating),comment:t.comment||t.content||"",factors:r,type:"products"};return this.allowAttachImages&&(o.images=s),this.allowAttachVideos&&(o.videos=e),o}async sendFeedback(){this.refreshWizardRefs();const t=this.currentTab?.dataset?.type;if("products"===t){const t=this.collectFormData(this.currentTab),a=this.buildProductRatingPayload(t,this.currentTab);if(!a.product_id||!a.rating)throw new Error("Missing product rating data");const i=await salla.rating.api.products(a);return this.submitted.push(this.currentIndex),i}const a=this.collectFormData(this.currentTab);if(0===Object.keys(a).length)return;if(a.order_id=this.getSubmitOrderId(),a.type=t,!t)return;const i=await salla.rating.api[t](a);return this.submitted.push(this.currentIndex),i}clearThanksCountdown(){null!==this.thanksCountdownInterval&&(clearInterval(this.thanksCountdownInterval),this.thanksCountdownInterval=null)}showThankYou(){let t=10;this.clearThanksCountdown(),this.thanksCountdownInterval=setInterval((()=>{this.thanksTime&&(this.thanksTime.innerHTML="00:0"+t--,t>0||(this.clearThanksCountdown(),this.thanksTime.remove(),this.close().then((()=>window.location.reload()))))}),1e3),this.modal?.querySelector(".s-rating-modal-footer")?.classList.add("s-rating-modal-unvisiable"),this.showActiveStep(this.thanksTab)}getFilepondPlaceholder(){return`<div class="s-rating-modal-filepond-placeholder"><span class="s-rating-modal-filepond-placeholder-icon">${d}</span><p class="s-rating-modal-filepond-placeholder-text">${this.dragAndDropFilesLabel}<br>\n <span> ${this.allowedImagesTypesLabel} <br> ${this.threeImagesMax} </span></p></div>`}getCustomerName(){return`${salla.config.get("user.first_name")||salla.storage.get("user.first_name")||""} ${salla.config.get("user.last_name")||salla.storage.get("user.last_name")||""}`}async readyUpLoyaltyPoints(){const t=salla.loyalty?.isFeatureEnabled?.();if(!t)return void(this.loyaltyImageRatingPoints=0);const a=salla.config.get("store.settings.rating.rating_product_points")||0,i=salla.config.get("store.settings.rating.rating_product_with_image_points")||0;this.loyaltyImageRatingPoints=Number(i)+Number(a)}loyaltyPointsNote(){if(!this.loyaltyImageRatingPoints||!this.loyaltyPointsForImagesLabel||this.isUnverifiedReview())return null;const t=i("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M10 0C13.6819 0 16.6667 2.98477 16.6667 6.66664C16.6667 9.37047 15.057 11.6984 12.7437 12.7444C11.6978 15.0575 9.3701 16.6666 6.66668 16.6666C2.98477 16.6666 0 13.6819 0 9.99998C0 7.29656 1.60918 4.96894 3.92195 3.92276C4.96827 1.60964 7.29618 0 10 0ZM6.66668 5C3.90524 5 1.66667 7.23856 1.66667 9.99998C1.66667 12.7614 3.90524 15 6.66668 15C9.4281 15 11.6667 12.7614 11.6667 9.99998C11.6667 7.23856 9.4281 5 6.66668 5ZM7.50002 5.83333V6.66664H9.16668V8.33331H5.83333C5.60322 8.33331 5.41667 8.51989 5.41667 8.74998C5.41667 8.95456 5.56407 9.12464 5.75844 9.15998L5.83333 9.16664H7.50002C8.6506 9.16664 9.58335 10.0994 9.58335 11.25C9.58335 12.4006 8.6506 13.3333 7.50002 13.3333V14.1666H5.83333V13.3333H4.16667V11.6666H7.50002C7.7301 11.6666 7.91668 11.4801 7.91668 11.25C7.91668 11.0455 7.76927 10.8753 7.57493 10.8401L7.50002 10.8333H5.83333C4.68274 10.8333 3.75 9.90056 3.75 8.74998C3.75 7.59939 4.68274 6.66664 5.83333 6.66664V5.83333H7.50002ZM10 1.66667C8.51377 1.66667 7.17893 2.31513 6.26313 3.34457C6.39704 3.33736 6.53138 3.33333 6.66668 3.33333C10.3486 3.33333 13.3333 6.3181 13.3333 9.99998C13.3333 10.1356 13.3293 10.2702 13.3213 10.4037C14.3513 9.48814 15 8.15314 15 6.66664C15 3.90524 12.7614 1.66667 10 1.66667Z",fill:"#008C56"}));return i("div",{class:"s-rating-modal-loyalty-points-note-container"},i("span",{class:"s-rating-modal-loyalty-points-note-icon"},t),i("p",{class:"s-rating-modal-loyalty-points-note-text"},this.loyaltyPointsForImagesLabel.replace(":points",String(this.loyaltyImageRatingPoints))))}normalizeReviewFactorsPayload(t){const a=t?.data??t?.factors;return Array.isArray(a)?a.flatMap((t=>{const a=Array.isArray(t?.items)?[...t.items]:null;if(a?.length){a.sort(((t,a)=>(Number(t?.sort)||0)-(Number(a?.sort)||0)));const i=!!t?.is_required;return a.filter((t=>null!=t?.id&&""!==t?.id)).map((t=>({id:t.id,name:t?.name,required:i})))}return null==t?.id||""===t?.id?[]:[{id:t.id,name:t?.name,required:t?.required??t?.is_required??!1}]})):[]}async fetchProductReviewFactors(t){try{const a=await salla.api.request(`review/factors/${t}/form`);return this.normalizeReviewFactorsPayload(a)}catch(t){return[]}}async fetchAllProductReviewFactors(t){const a=this.getRateableProducts(t);if(!a.length)return{};const i=await Promise.all(a.map((async t=>{const a=await this.fetchProductReviewFactors(t.product.id);return[t.product.id,a]})));return Object.fromEntries(i)}async ensureProductFactorsLoaded(t){if(!t||this.productReviewFactors[t])return;const a=await this.fetchProductReviewFactors(t);this.productReviewFactors={...this.productReviewFactors,[t]:a}}getFactorFieldName(t,a,i){return t?`${t}[factors][${a}][${i}]`:`factors[${a}][${i}]`}normalizeToArray(t){return null==t?[]:Array.isArray(t)?t:[t]}isFactorReviewsList(t){return Array.isArray(t)&&t.length>0&&t.every((t=>t&&"object"==typeof t&&(void 0!==t.rating||void 0!==t.stars||void 0!==t.value)))}getFactorReviewsFromRecord(t){if(!t)return[];for(const a of["factor_reviews","review_factors","factors"]){const i=t[a];if(this.isFactorReviewsList(i))return i}return[]}getEditFactorReviewsList(t){const a=[this.order,this.getBootstrapOrder()].filter(Boolean);for(const i of a){const a=this.getMatchedProductRating(i,t,this.editFeedbackId),s=this.getFactorReviewsFromRecord(a);if(s.length)return s}const i=this.getOrderProducts(this.order).find((a=>Number(a.product?.id)===Number(t))),s=[this.editItem?.factor_reviews,this.editItem?.review_factors,this.editItem?.product?.review_factors,this.editItem?.product?.factor_reviews,this.editItem?.factors,i?.factor_reviews,i?.review_factors,i?.feedback?.factor_reviews];for(const t of s)if(Array.isArray(t)&&t.length>0)return t;return[]}getFactorKey(t,a){return null!=t.id&&""!==t.id?`id:${t.id}`:t.name?`name:${t.name.trim()}`:`index:${a}`}getFactorRatingsForProduct(t){return this.editMode?this.editFactorRatings:this.productFactorRatings[t]||{}}setFactorRatingsForProduct(t,a){this.editMode?this.editFactorRatings=a:this.productFactorRatings={...this.productFactorRatings,[t]:a}}markExistingFactorRatingsAsUserFilled(t,a){const i=this.productReviewFactors[t]||[],s=new Set;i.forEach(((t,i)=>{const e=this.getFactorKey(t,i),r=void 0!==t.id?a[String(t.id)]:void 0,o=t.name?a[t.name.trim()]:void 0;void 0===r&&void 0===o&&void 0===a[`__index_${i}`]||s.add(e)})),this.userFilledFactorKeys[t]=s}shouldAutofillFactors(t){return 4===t||5===t}autofillUnfilledFactors(t,a){const i=this.productReviewFactors[t]||[];if(!i.length)return;const s=this.userFilledFactorKeys[t]||new Set,e={...this.getFactorRatingsForProduct(t)},r=this.shouldAutofillFactors(a);let o=!1;i.forEach(((t,i)=>{const n=this.getFactorKey(t,i);if(!s.has(n)){if(r)return void 0!==t.id&&(e[String(t.id)]=a),t.name&&(e[t.name.trim()]=a),e[`__index_${i}`]=a,void(o=!0);void 0!==t.id&&void 0!==e[String(t.id)]&&(delete e[String(t.id)],o=!0),t.name&&void 0!==e[t.name.trim()]&&(delete e[t.name.trim()],o=!0),void 0!==e[`__index_${i}`]&&(delete e[`__index_${i}`],o=!0)}})),o&&this.setFactorRatingsForProduct(t,e)}handleMainRatingChange(t,a){this.editMode?this.editMainRating=a:this.productMainRatings={...this.productMainRatings,[t]:a},this.autofillUnfilledFactors(t,a)}handleFactorRatingChange(t,a,i){this.userFilledFactorKeys[t]||(this.userFilledFactorKeys[t]=new Set),this.userFilledFactorKeys[t].add(a);const s=this.productReviewFactors[t]||[],e=s.findIndex(((t,i)=>this.getFactorKey(t,i)===a));if(e<0)return;const r=s[e],o={...this.getFactorRatingsForProduct(t)};void 0!==r.id&&(o[String(r.id)]=i),r.name&&(o[r.name.trim()]=i),o[`__index_${e}`]=i,this.setFactorRatingsForProduct(t,o)}setupProductRatingAutofill(t,a){t&&!this.boundRatingRows.has(t)&&(this.boundRatingRows.add(t),t.addEventListener("click",(i=>{const s=i.target;if(!s.closest(".s-rating-stars-btn-star"))return;const e=s.closest(".s-rating-modal-product-rating-row-main"),r=s.closest(".s-rating-modal-product-factor-row");requestAnimationFrame((()=>{if(e&&t.contains(e)){const t=Number(this.getRatingHiddenInput(e)?.value);t>0&&this.handleMainRatingChange(a,t)}else if(r&&t.contains(r)){const t=r.getAttribute("data-factor-key"),i=Number(this.getRatingHiddenInput(r)?.value);t&&i>0&&this.handleFactorRatingChange(a,t,i)}}))})))}buildEditFactorRatings(t){return this.getEditFactorReviewsList(t).reduce(((t,a,i)=>{const s=Number(a?.rating??a?.stars??a?.value);if(Number.isNaN(s))return t;const e=a?.id??a?.factor_id;return null!=e&&""!==e&&(t[String(e)]=s),a?.name&&(t[a.name.trim()]=s),t[`__index_${i}`]=s,t}),{})}renderProductStep(t,a){return i("section",{class:"s-rating-modal-step s-rating-modal-hidden","data-type":"products","data-product-id":t.product.id,key:t.product.id},i("div",{class:"s-rating-modal-product"},this.allowAttachImages&&this.loyaltyPointsNote(),i("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},i("div",{class:"s-rating-modal-product-details"},i("div",{class:"s-rating-modal-product-info-row"},i("div",{class:"s-rating-modal-product-img-wrap"},i("img",{src:t.product.thumbnail,alt:t.product.name,class:"s-rating-modal-product-img"})),i("h3",{class:"s-rating-modal-product-title"},t.product.name)),this.renderProductReviewFactors(t.product.id,0,{fieldPrefix:""}),i("input",{type:"hidden",name:"product_id",value:t.product.id}),i("textarea",{placeholder:salla.lang.get("pages.rating.write_product_rate"),name:"comment",class:"s-rating-modal-comment"}),i("small",{class:"s-rating-modal-validation-msg"}))),this.canAttachMedia()&&i("div",{class:"s-rating-modal-uploader is-opened",ref:t=>{t&&(this.contentRefs[a]=t)}},i("salla-file-upload",{name:"image",enableGallery:!0,maxImagesCount:this.allowAttachImages?this.MAX_IMAGE_UPLOAD_LIMIT:void 0,maxVideosCount:this.allowAttachVideos?this.MAX_VIDEO_UPLOAD_LIMIT:void 0,maxVideoFileSize:this.allowAttachVideos?this.MAX_VIDEO_FILE_SIZE:void 0,maxVideoDuration:this.allowAttachVideos?this.MAX_VIDEO_DURATION:void 0,maxParallelUploads:this.MAX_PARALLEL_UPLOADS,imagePreviewHeight:75,filePosterHeight:75,"instant-upload":!0,type:"feedback",payloadName:"files[]",id:`file-${t.product.id}`,title:t.product.name,allowMultiple:!0,instantUpload:!0,accept:this.getMediaUploadAccept(),url:salla.url.api("upload"),onUploaded:i=>{const s=t.product.id,e=[...this.productImages[s]||[],i.detail];this.productImages={...this.productImages,[s]:e};const r=f(e);this.setUploadCount(s,e.length,r.image,r.video),b(this.hiddenInputs[a],this.hiddenVideoInputs[a],e),this.scheduleUploaderHeightRefresh()},onRemoved:i=>{const s=i.detail,e=t.product.id;if(!s||!this.productImages[e])return;const r=v(this.productImages[e],s);this.productImages={...this.productImages,[e]:r};const o=f(r);this.setUploadCount(e,r.length,o.image,o.video),b(this.hiddenInputs[a],this.hiddenVideoInputs[a],r),this.scheduleUploaderHeightRefresh()},labelIdle:this.getFilepondPlaceholder(),onGalleryUpdated:a=>this.handleGalleryCountUpdate(t.product.id,a.detail)}),this.allowAttachImages&&i("input",{type:"hidden",name:"images",value:u(this.productImages[t.product.id]||[]).images.join(","),ref:t=>{t&&(this.hiddenInputs[a]=t)}}),this.allowAttachVideos&&i("input",{type:"hidden",name:"videos",value:u(this.productImages[t.product.id]||[]).videos.join(","),ref:t=>{t&&(this.hiddenVideoInputs[a]=t)}}),this.renderUploadedImagesCount(t.product.id))))}renderProductReviewFactors(t,a,s={}){const e=this.productReviewFactors[t]||[],r=s.fieldPrefix??`products[${a}]`,o=r?`${r}[rating]`:"rating",n={...this.editMode?{}:this.productFactorRatings[t]||{},...s.factorRatings||{}},l=Number(s.mainRating??(this.editMode?this.editMainRating:this.productMainRatings[t])),d=!Number.isNaN(l),m=(t,a)=>{const i=void 0!==t.id?n[String(t.id)]:void 0,s=t.name?n[t.name.trim()]:void 0,e=Number(i??s??n[`__index_${a}`]);return Number.isNaN(e)?void 0:e};return i("div",{class:"s-rating-modal-product-rating-rows",ref:a=>a&&this.setupProductRatingAutofill(a,t)},i("div",{class:"s-rating-modal-product-rating-row s-rating-modal-product-rating-row-main"},i("span",{class:"s-rating-modal-product-factor-name"},this.overallProductRatingLabel,i("span",{class:"s-rating-modal-product-factor-required"},"*")),i("salla-rating-stars",{size:"medium",name:o,key:d?`main-rating-${l}`:"main-rating-empty",value:d?l:void 0,editable:d,withLabel:!0,labelBeforeStars:!0,tag:!1})),e.map(((t,a)=>i("div",{class:"s-rating-modal-product-rating-row s-rating-modal-product-factor-row px-3","data-required":t.required?"true":"false","data-factor-key":this.getFactorKey(t,a)},i("input",{type:"hidden",name:this.getFactorFieldName(r,a,"name"),value:t.name}),!!t.id&&i("input",{type:"hidden",name:this.getFactorFieldName(r,a,"id"),value:String(t.id)}),i("span",{class:"s-rating-modal-product-factor-name"},t.name,t.required?i("span",{class:"s-rating-modal-product-factor-required"},"*"):""),i("salla-rating-stars",{size:"medium",name:this.getFactorFieldName(r,a,"rating"),key:`factor-rating-${t.id??a}-${m(t,a)??0}`,value:m(t,a),editable:s.alwaysEditable||"number"==typeof m(t,a),withLabel:!0,labelBeforeStars:!0,tag:!1})))))}handleSendEmail(){if(!this.order)return;const t=`${this.contactSubjectLabel} #${this.order.id}`,a=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),i=`mailto:${salla.config.get("store.contacts.email")}?subject=${encodeURIComponent(t)}&body=${encodeURIComponent(a)}`;window.open(i,"_blank")}handleSendWhatsApp(){if(!this.order)return;const t=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),a=`https://wa.me/${salla.config.get("store.contacts.whatsapp")}?text=${encodeURIComponent(t)}`;window.open(a,"_blank")}resetData(t){t.detail||(this.clearThanksCountdown(),this.modal?.close(),this.editItem=null,this.editItemImages=[],this.editFactorRatings={},this.productMainRatings={},this.productFactorRatings={},this.editMainRating=void 0,this.userFilledFactorKeys={},this.uploadingByProductId={},this.hasUploadsInProgress=!1,this.hiddenInputs[1]&&(this.hiddenInputs[1].value=""),this.editHiddenVideosInput&&(this.editHiddenVideosInput.value=""),this.body&&(this.body.style.height="",this.body.style.minHeight=""),this.deleteFeedbackId=void 0,this.editFeedbackId=void 0,this.shouldOpenDeleteModal=!1,this.editMode=!1,this.deleteMode=!1,this.defaultMode=!1,this.currentIndex=0,this.submitted=[],this.scheduleWizardSetup=!1,this.loyaltyImageRatingPoints=0)}getDeleteModal(){return i("salla-modal",{ref:t=>{t&&(this.deleteModal=t)},width:"xs",onModalVisibilityChanged:t=>this.resetData(t)},i("div",{class:"s-rating-modal-delete-wrapper",ref:t=>{t&&(this.body=t)}},i("h3",null,this.confirmDeletionLabel),i("p",null,this.areYouSureLabel),i("div",{class:"s-rating-modal-delete-actions"},i("salla-button",{loaderPosition:"center",onClick:()=>this.deleteReview()},this.confirmDeleteBtn),i("salla-button",{color:"danger",fill:"outline",onClick:()=>this.deleteModal?.close()},this.cancelLabel))))}renderUploadedImagesCount(t){const a=f(this.editMode?this.editItemImages:this.productImages[t]||[]),s=this.uploadImageCounts[t]??a.image,e=this.uploadVideoCounts[t]??a.video;return this.allowAttachImages&&this.allowAttachVideos?i("span",{class:"s-rating-modal-upload-count"},salla.lang.get("pages.rating.media_count",{imageCurrent:s,imageTotal:this.MAX_IMAGE_UPLOAD_LIMIT,videoCurrent:e,videoTotal:this.MAX_VIDEO_UPLOAD_LIMIT})):this.allowAttachImages?i("span",{class:"s-rating-modal-upload-count"},salla.lang.choice("pages.rating.images_count",s,{current:s,total:this.MAX_IMAGE_UPLOAD_LIMIT})):this.allowAttachVideos?i("span",{class:"s-rating-modal-upload-count"},salla.lang.choice("pages.rating.videos_count",e,{current:e,total:this.MAX_VIDEO_UPLOAD_LIMIT})):null}getEditModal(){return i("salla-modal",{ref:t=>{t&&(this.editModal=t)},width:"md",onModalVisibilityChanged:t=>this.resetData(t)},i("div",{class:"s-rating-modal-edit-wrapper",ref:t=>{t&&(this.body=t)}},"store"===this.editType&&this.editItem?i("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"store",ref:t=>{t&&(this.currentTab=t)}},i("div",{class:"s-rating-modal-rounded-icon"},i("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),i("h2",{class:"s-rating-modal-title"},salla.lang.get("pages.rating.rate_the_store")),i("div",{class:"s-rating-modal-stars-company"},i("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),i("textarea",{name:"content",value:this.editItem.content,class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),i("small",{class:"s-rating-modal-validation-msg"})):null,"shipping"===this.editType&&this.editItem?i("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"shipping",ref:t=>{t&&(this.currentTab=t)}},this.editItem.shipping.logo?i("div",{class:"s-rating-modal-rounded-icon"},i("img",{src:this.editItem.shipping.logo,class:"s-rating-modal-shipping-logo",alt:this.editItem.shipping.name})):i("span",{class:"s-rating-modal-icon",innerHTML:o}),i("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.editItem.shipping.name}`),i("div",{class:"s-rating-modal-stars-company"},i("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),i("textarea",{name:"content",class:"s-rating-modal-comment",value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),i("small",{class:"s-rating-modal-validation-msg"})):null,"product"==this.editType&&this.editItem?i("section",{class:"s-rating-modal-step","data-type":"products",ref:t=>{t&&(this.currentTab=t)}},i("div",{class:"s-rating-modal-product"},this.allowAttachImages&&this.loyaltyPointsNote(),i("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},i("div",{class:"s-rating-modal-product-details"},i("div",{class:"s-rating-modal-product-info-row"},i("div",{class:"s-rating-modal-product-img-wrap"},i("img",{src:this.editItem.product.image.url,alt:this.editItem.product.name,class:"s-rating-modal-product-img"})),i("h3",{class:"s-rating-modal-product-title"},this.editItem.product.name)),this.renderProductReviewFactors(this.editItem.product.id,0,{fieldPrefix:"",mainRating:this.editMainRating??Number(this.editItem.stars??this.editItem.rating),factorRatings:this.editFactorRatings,alwaysEditable:!0}),i("input",{type:"hidden",name:"product_id",value:this.editItem.product.id}),i("textarea",{value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_product_rate"),name:"comment",class:"s-rating-modal-comment"}),i("small",{class:"s-rating-modal-validation-msg"}))),this.canAttachMedia()&&i("div",{class:"s-rating-modal-uploader is-opened",ref:t=>{t&&(this.contentRefs[1]=t)}},i("salla-file-upload",{name:"images",allowMultiple:!0,enableGallery:!0,maxImagesCount:this.allowAttachImages?this.MAX_IMAGE_UPLOAD_LIMIT:void 0,maxVideosCount:this.allowAttachVideos?this.MAX_VIDEO_UPLOAD_LIMIT:void 0,maxVideoFileSize:this.allowAttachVideos?this.MAX_VIDEO_FILE_SIZE:void 0,maxVideoDuration:this.allowAttachVideos?this.MAX_VIDEO_DURATION:void 0,maxParallelUploads:this.MAX_PARALLEL_UPLOADS,imagePreviewHeight:75,filePosterHeight:75,"instant-upload":!0,type:"feedback",files:JSON.stringify(this.editItemImages),payloadName:"files[]",id:`file-${this.editItem.product.id}`,title:this.editItem.product.name,instantUpload:!0,accept:this.getMediaUploadAccept(),url:salla.url.api("upload"),onUploaded:t=>{this.editItemImages=[...this.editItemImages,t.detail];const a=f(this.editItemImages);this.setUploadCount(this.editItem.product.id,this.editItemImages.length,a.image,a.video),b(this.hiddenInputs[1],this.editHiddenVideosInput,this.editItemImages),this.scheduleUploaderHeightRefresh()},onRemoved:t=>{const a=t.detail;if(!a)return;this.editItemImages=v(this.editItemImages,a);const i=f(this.editItemImages);this.setUploadCount(this.editItem.product.id,this.editItemImages.length,i.image,i.video),b(this.hiddenInputs[1],this.editHiddenVideosInput,this.editItemImages),this.scheduleUploaderHeightRefresh()},labelIdle:this.getFilepondPlaceholder(),onGalleryUpdated:t=>this.handleGalleryCountUpdate(this.editItem.product.id,t.detail)}),this.allowAttachImages&&i("input",{type:"hidden",name:"images",value:u(this.editItemImages).images.join(","),ref:t=>{t&&(this.hiddenInputs[1]=t)}}),this.allowAttachVideos&&i("input",{type:"hidden",name:"videos",value:u(this.editItemImages).videos.join(","),ref:t=>{t&&(this.editHiddenVideosInput=t)}}),this.renderUploadedImagesCount(this.editItem.product.id)))):null,i("div",{class:"s-rating-modal-footer s-rating-modal-footer-end"},i("salla-button",{"loader-position":"center",loading:this.hasUploadsInProgress,disabled:this.hasUploadsInProgress,onClick:()=>this.editReview()},this.editReviewLabel))))}render(){return this.deleteMode?i(s,{class:"s-rating-modal"},this.getDeleteModal()):this.editMode?i(s,{class:"s-rating-modal"},this.getEditModal()):this.defaultMode?i(s,{class:"s-rating-modal"},i("salla-modal",{class:"s-rating-modal-wrap",onModalVisibilityChanged:t=>this.resetData(t),isLoading:!0,width:"md",ref:t=>{t&&(this.modal=t)}},i("div",{slot:"loading"},i("div",{class:"s-rating-modal-skeleton"},i("salla-skeleton",{type:"circle",height:"80px",width:"80px"}),i("salla-skeleton",{height:"15px",width:"60%"}),i("salla-skeleton",{height:"10px",width:"30%"}),i("div",{class:"s-rating-modal-skeleton-stars"},[...Array(5)].map((t=>i("div",{key:t,innerHTML:r})))),i("salla-skeleton",{height:"100px",width:"100%"}),i("div",{class:"s-rating-modal-skeleton-footer"},i("salla-skeleton",{height:"40px",width:"30%"})))),!this.hasError&&this.order?[i("div",{class:"s-rating-modal-wrapper",ref:t=>{t&&(this.body=t)}},this.isTestimonialsEnabled()?i("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"store"},i("div",{class:"s-rating-modal-rounded-icon"},i("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),i("h2",{class:"s-rating-modal-title"},salla.lang.get("pages.rating.rate_the_store")),i("div",{class:"s-rating-modal-stars-company"},i("salla-rating-stars",{withLabel:!0,size:"large"})),i("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),i("small",{class:"s-rating-modal-validation-msg"})):"",this.isProductsEnabled()&&this.getRateableProducts().map(((t,a)=>this.renderProductStep(t,a))),this.isShippingEnabled()&&this.order.shipping?.company?i("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"shipping"},i("input",{type:"hidden",name:"shipping_company_id",value:this.order.shipping.company.id}),this.order.shipping.company.logo?i("div",{class:"s-rating-modal-rounded-icon"},i("img",{src:this.order.shipping.company.logo,class:"s-rating-modal-shipping-logo",alt:this.order.shipping.company.name})):i("span",{class:"s-rating-modal-icon",innerHTML:o}),i("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.order.shipping.company.name}`),i("div",{class:"s-rating-modal-stars-company"},i("salla-rating-stars",{withLabel:!0,size:"large"})),i("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),i("small",{class:"s-rating-modal-validation-msg"})):"",i("div",{class:"s-rating-modal-thanks s-rating-modal-hidden",ref:t=>{t&&(this.thanksTab=t)}},i("span",{class:"s-rating-modal-icon",innerHTML:n}),i("h3",{class:"s-rating-modal-thanks-title"},salla.lang.get("pages.rating.thanks")),i("div",{class:"s-rating-modal-thanks-msg",innerHTML:this.order.thanks_message}),i("time",{class:"s-rating-modal-thanks-time",ref:t=>{t&&(this.thanksTime=t)}}))),this.allowContactSupport&&this.showContactWidget&&(salla.config.get("store.contacts.whatsapp")||salla.config.get("store.contacts.email"))?i("div",{class:"s-rating-modal-contact"},i("p",null,this.contactUsLabel),i("div",{class:"s-rating-modal-contact-icons"},salla.config.get("store.contacts.whatsapp")&&i("span",{onClick:()=>this.handleSendWhatsApp(),innerHTML:m}),salla.config.get("store.contacts.email")&&i("span",{onClick:()=>this.handleSendEmail(),innerHTML:h}))):"",i("div",{class:"s-rating-modal-footer"},i("button",{ref:t=>{t&&(this.backBtn=t)},onClick:()=>this.previousTab(),class:"s-rating-modal-btn s-rating-modal-unvisiable"},salla.lang.get("common.elements.back")),this.stepsCount>1?i("ul",{class:"s-rating-modal-dots"},[...Array(this.stepsCount)].map(((t,a)=>i("li",{key:a,class:"s-rating-modal-bg-gray s-rating-modal-step-dot"})))):"",i("salla-button",{"loader-position":"center",loading:this.hasUploadsInProgress,disabled:this.hasUploadsInProgress,ref:t=>{t&&(this.nextBtn=t)},onClick:()=>this.submit()},salla.lang.get("common.elements.next")))]:i("salla-placeholder",{alignment:"center"}))):void 0}async componentWillLoad(){await salla.onReady(),this.syncStoreSettings()}componentDidRender(){this.scheduleWizardSetup&&this.defaultMode&&this.order&&(this.scheduleWizardSetup=!1,requestAnimationFrame((()=>this.handleWizard())))}disconnectedCallback(){this.clearThanksCountdown()}get host(){return e(this)}};_.style='/*!twlt*/.s-rating-modal-uploader{overflow:visible}.s-rating-modal-uploader.is-opened{height:auto !important;opacity:1 !important;overflow:visible;pointer-events:auto !important;margin-bottom:1rem}.s-rating-modal-uploader .s-file-upload-gallery{overflow:visible}.s-rating-modal-edit-wrapper,.s-rating-modal-wrapper{transition:height 0.15s ease}.s-rating-modal-product-details{padding-bottom:0.5rem}.s-rating-modal-comment{margin-top:0.35rem}.s-rating-modal-product{margin-bottom:1rem}.s-rating-modal-product-img{position:absolute !important;inset:0;display:block;width:100% !important;max-width:100% !important;height:100% !important;object-fit:cover}.s-rating-modal-product-title{font-size:0.95rem;font-weight:600;line-height:1.5;margin:0}.s-rating-modal-stars-product{margin-top:0.5rem}.s-rating-modal-loyalty-points-note-container{display:flex;align-items:center;gap:0.625rem;width:100%;margin-top:1.5rem;margin-bottom:0.75rem;padding:0.75rem;border-radius:0.5rem;background-color:#E6F4EA}.s-rating-modal-loyalty-points-note-icon{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;color:#1B7F5C}.s-rating-modal-loyalty-points-note-icon svg{width:1.5rem;height:1.5rem;fill:currentColor}.s-rating-modal-loyalty-points-note-text{flex:1;margin:0;font-size:0.875rem;line-height:1.25rem;color:#1f2937}.s-rating-modal-product-details-main{display:flex;align-items:center;margin-bottom:0.5rem;padding-bottom:0;border-bottom:0}.s-rating-modal-product-info-row{display:flex;align-items:center;gap:0.6rem;margin-bottom:0.5rem;padding-bottom:0;border-bottom:0}.s-rating-modal-product-main-review{width:100%;text-align:right}.s-rating-modal-product-rating-rows{display:grid;gap:0.45rem;margin:0.2rem 0 0.7rem}.s-rating-modal-product-rating-row{display:flex;align-items:center;justify-content:space-between;gap:0.75rem;min-height:2rem}.s-rating-modal-product-rating-row salla-rating-stars{flex-shrink:0}.s-rating-modal-product-rating-row .s-rating-stars-wrapper{align-items:center;min-height:1.75rem}.s-rating-modal-product-rating-row .s-rating-stars-label,.s-rating-modal-product-rating-row .s-rating-stars-label-without-tag{min-width:auto;min-height:1.25rem;line-height:1.25rem;font-size:0.8rem;color:#5b6470;white-space:nowrap;text-align:end;transition:opacity 0.15s ease}.s-rating-modal-product-rating-row .s-rating-stars-label--empty,.s-rating-modal-product-rating-row .s-rating-stars-label-without-tag--empty{opacity:0}.s-rating-modal-product-rating-row-main{margin-bottom:0.35rem;padding:0.5rem 0.6rem;border:1px solid #d1d5db;border-radius:0.45rem;background:transparent}.s-rating-modal-product-factor-name{color:#5b6470;font-size:0.9rem;line-height:1.25}.s-rating-modal-product-rating-row-main .s-rating-modal-product-factor-name{font-size:1rem;color:#5b6470}.s-rating-modal-product-factor-required{color:#f87171;margin-inline-start:0.2rem}.s-rating-modal-product-img-wrap{position:relative;width:5rem !important;min-width:5rem !important;max-width:5rem !important;height:3.5rem !important;flex-shrink:0 !important;overflow:hidden;border-radius:0.375rem;background:#f3f4f6}.mt-0{margin-top:0px}.block{display:block}.hidden{display:none}.px-3{padding-left:0.75rem;padding-right:0.75rem}.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)}.s-comments-item-like-btn{margin-top:0.5rem}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-comments-item-like-btn span svg{height:0.75rem;width:0.75rem}.s-rating-modal-wrapper{margin-bottom:1.5rem;transition-property:all;transition-duration:100ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-rating-modal-edit-wrapper{margin-top:0.625rem}.s-rating-modal-footer{position:relative;display:flex;align-items:center;justify-content:space-between}.s-rating-modal-footer salla-button button{padding-left:1rem !important;padding-right:1rem !important;font-size:0.75rem !important}.s-rating-modal-btn{height:2.5rem;padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-rating-modal-btn:hover{color:var(--color-primary-dark)}.s-rating-modal-dots{display:flex;flex-shrink:0;flex-grow:1;justify-content:center}.s-rating-modal-dots>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.375rem * var(--tw-space-x-reverse));margin-left:calc(0.375rem * calc(1 - var(--tw-space-x-reverse)))}.s-rating-modal-dots{text-align:center}.s-rating-modal-dots:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-rating-modal-step-dot{height:0.625rem;width:0.625rem;border-radius:9999px;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-rating-modal-step{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-rating-modal-active{--tw-translate-x:0px;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));opacity:1}.s-rating-modal-unactive{--tw-translate-x:0.75rem;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));opacity:0}.s-rating-modal-hidden{display:none !important}.s-rating-modal-unvisiable{pointer-events:none;opacity:0}.s-rating-modal-step-wrap{position:relative;display:flex;flex-direction:column;align-items:center;padding-bottom:1rem}.s-rating-modal-product-details{position:relative;display:flex;flex:1 1 0%;flex-direction:column;padding-bottom:1rem}.s-rating-modal-product-details-main{display:flex;align-items:flex-start;justify-content:space-between}.s-rating-modal-product-details-main .s-rating-stars-wrapper{margin-bottom:0.375rem;flex-direction:column;align-items:center}@media (min-width: 640px){.s-rating-modal-product-details-main .s-rating-stars-wrapper{margin-bottom:0px;flex-direction:row;gap:0px}}.s-rating-modal-rounded-icon{margin-bottom:1rem;display:flex;height:7rem;width:7rem;align-items:center;justify-content:center;overflow:hidden;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-rating-modal-title{margin-bottom:1rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}.s-rating-modal-store-logo{width:4rem;object-fit:contain}.s-rating-modal-shipping-logo{height:100%;width:100%;object-fit:contain}.s-rating-modal-shipping-icon{font-size:3rem;line-height:1;color:var(--color-primary)}.s-rating-modal-comment{margin-bottom:0.5rem;height:5rem !important;width:100%;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.75rem;font-size:0.875rem;line-height:1.25rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-rating-modal-comment:focus{border-color:var(--color-primary)}.s-rating-modal-comment:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.s-rating-modal-validation-msg{margin-top:-3px;line-height:1rem;--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-rating-modal-product{margin-bottom:1.5rem}.s-rating-modal-product:last-child{margin-bottom:0px}.s-rating-modal-product .rating-outer-form{display:flex}.s-rating-modal-product .rating-outer-form>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}@media (min-width: 640px){.s-rating-modal-product .rating-outer-form>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}}.s-rating-modal-product .rating-outer-form:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-rating-modal-product-img-wrap{height:3.5rem;width:auto;overflow:hidden;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}@media (min-width: 640px){.s-rating-modal-product-img-wrap{width:5rem}}.s-rating-modal-product-img{position:relative;height:100%;width:100%;object-fit:cover;font-size:0px}.s-rating-modal-product-img::before{position:absolute;top:0px;left:0px;height:100%;width:100%;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-rating-modal-product-title{margin-bottom:0.375rem;font-size:0.875rem;font-weight:700;line-height:1.25rem}.s-rating-modal-thanks{padding-left:2rem;padding-right:2rem;text-align:center;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-rating-modal-icon{display:inline-flex;height:5rem;width:5rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));color:var(--color-primary)}.s-rating-modal-icon svg{height:1.75rem;width:1.75rem;fill:var(--color-primary)}.s-rating-modal-thanks-title{margin-top:1rem;font-weight:700}.s-rating-modal-thanks-msg{margin-bottom:1.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-rating-modal-thanks-btn{height:2.5rem;flex:none;display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-rating-modal-thanks-btn:hover{opacity:0.8}.s-rating-modal-thanks-btn{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-rating-modal-thanks-time{margin-top:0.75rem;display:block;height:1.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-rating-modal-stars-company{margin-bottom:1.25rem}.s-rating-modal-stars-company .s-rating-stars-wrapper{flex-direction:column;align-items:center;justify-content:center;gap:0.5rem}.s-rating-modal-stars-product{margin-bottom:0.25rem}.s-rating-modal-upload-count{font-size:0.875rem;line-height:1.25rem;font-weight:500}.s-rating-modal-bg-gray{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-rating-modal-bg-primary{background-color:var(--color-primary)}unicode{unicode-bidi:plaintext}.s-rating-modal-wrap .s-modal-body{position:relative !important}.s-rating-modal-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-rating-modal-skeleton salla-skeleton:nth-child(1){margin-bottom:1.25rem}.s-rating-modal-skeleton salla-skeleton:nth-child(2){margin-bottom:0.75rem}.s-rating-modal-skeleton salla-skeleton:nth-child(3){margin-bottom:1.25rem}.s-rating-modal-skeleton salla-skeleton:nth-child(4){margin-bottom:2rem}.s-rating-modal-skeleton-footer{margin-top:1.5rem;display:flex;width:100%;justify-content:flex-end}.s-rating-modal-skeleton-footer salla-skeleton{margin-bottom:0px !important}.s-rating-modal-skeleton-stars{margin-bottom:0.75rem;display:flex;align-items:center}.s-rating-modal-skeleton-stars>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}.s-rating-modal-skeleton-stars:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-rating-modal-skeleton-stars div svg{width:25px;fill:currentColor;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-rating-modal-uploader{height:0px;opacity:0;transition-property:all;transition-duration:100ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-rating-modal-uploader.is-opened{margin-bottom:1.5rem;overflow:visible}.s-rating-modal-uploader.is-closed{pointer-events:none;z-index:0}.s-rating-modal-uploader .filepond--drop-label{--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-rating-modal-uploader .filepond--file-status .filepond--file-status-main{font-size:11px}.s-rating-modal-uploader .filepond--file-info-main{font-size:11px}.s-rating-modal-uploader li[data-filepond-item-state=\'load-invalid\'] .filepond--file-info{display:none}.s-rating-modal-filepond-placeholder-text{font-size:0.75rem !important;line-height:1rem !important}.s-rating-modal-filepond-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-rating-modal-filepond-placeholder-icon{margin-bottom:0.25rem}.s-rating-modal-filepond-placeholder-icon svg{height:1.5rem;width:1.5rem;fill:#7c8082}.s-rating-modal-contact{margin-bottom:1rem;display:flex;align-items:center;justify-content:space-between;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding:0.5rem}.s-rating-modal-contact p{font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-rating-modal-contact-icons{display:flex;align-items:center;gap:0.5rem}.s-rating-modal-contact-icons span{display:flex;cursor:pointer;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.375rem}.s-rating-modal-contact-icons span svg{height:1rem;width:1rem;fill:var(--color-primary)}.s-rating-modal-footer-end{justify-content:flex-end}.s-rating-modal-delete-wrapper{text-align:center}.s-rating-modal-delete-wrapper h3{margin-top:1.25rem;font-size:1.125rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-rating-modal-delete-wrapper p{margin-top:1.25rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-rating-modal-delete-actions{margin-top:1.25rem;display:flex;align-items:center;gap:0.625rem}.s-rating-modal-delete-actions salla-button{width:100%}.s-rating-modal-delete-actions salla-button button{width:100%}';export{_ as salla_rating_modal_v2}
|