@salla.sa/twilight-components 2.14.539 → 2.14.541
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-CIpOpiw6.js → filepond-CNdvfaMJ.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-CPV_SZrj.js → filepond-plugin-file-poster-Di_D3w89.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-C_XGylG1.js → filepond-plugin-file-validate-size-BiRa98qd.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-CmVS48lk.js → filepond-plugin-file-validate-type-Bolv-kyJ.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-KfqhH5F9.js → filepond-plugin-image-edit-AN6huMV9.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-BfRIDxO-.js → filepond-plugin-image-exif-orientation-Bwa8QtGo.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-DlvO4sHZ.js → filepond-plugin-image-preview-CaVYLAvG.js} +1 -1
- package/dist/cjs/helpers-ClOJIAG8.js +89 -0
- package/dist/cjs/{index-CMDyFi6Q.js → index-DX2EKTCE.js} +18 -14
- package/dist/cjs/{intlTelInput-BK34b4sR.js → intlTelInput-DnwdGAiP.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/{salla-booking-field_7.cjs.entry.js → salla-attachment-view_9.cjs.entry.js} +1003 -40
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +2 -2
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +14 -5
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +303 -26
- package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_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 +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +420 -84
- package/dist/cjs/salla-rating-modal.cjs.entry.js +3 -5
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +4 -83
- package/dist/cjs/salla-review-order-item.cjs.entry.js +125 -0
- 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 +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-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 +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/upload-limits-C3RarAPN.js +136 -0
- package/dist/cjs/{vanilla-picker-DYTpjTDj.js → vanilla-picker-BUFYPi-_.js} +1 -1
- package/dist/collection/collection-manifest.json +16 -11
- package/dist/collection/components/salla-attachment-view/salla-attachment-view.css +164 -0
- package/dist/collection/components/salla-attachment-view/salla-attachment-view.js +250 -0
- package/dist/collection/components/salla-attachments/salla-attachments.css +69 -0
- package/dist/collection/components/salla-attachments/salla-attachments.js +375 -0
- package/dist/collection/components/salla-comments/salla-comment-item.js +13 -3
- package/dist/collection/components/salla-comments/salla-comments.css +7 -0
- package/dist/collection/components/salla-cookies-bar/salla-cookies-bar.css +206 -56
- package/dist/collection/components/salla-cookies-bar/salla-cookies-bar.js +322 -30
- package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +1 -1
- package/dist/collection/components/salla-file-upload/salla-file-upload.css +149 -0
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +784 -42
- package/dist/collection/components/salla-file-upload/upload-limits.js +127 -0
- package/dist/collection/components/salla-products-slider/salla-products-slider.js +1 -1
- package/dist/collection/components/salla-rating-modal/rating-modal-media.js +85 -0
- package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +348 -85
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.css +17 -7
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +1 -3
- package/dist/collection/components/salla-review-factors-tags/helpers.js +8 -7
- package/dist/collection/components/salla-review-order-item/interfaces.js +1 -0
- package/dist/collection/components/salla-review-order-item/salla-review-order-item.js +154 -0
- package/dist/components/index.js +2 -2
- package/dist/components/salla-add-product-button2.js +40 -28
- package/dist/components/salla-attachment-view.d.ts +11 -0
- package/dist/components/salla-attachment-view.js +9 -0
- package/dist/components/salla-attachment-view2.js +323 -0
- package/dist/components/salla-attachments.d.ts +11 -0
- package/dist/components/salla-attachments.js +9 -0
- package/dist/components/salla-attachments2.js +232 -0
- package/dist/components/salla-basket-gap.js +46 -34
- package/dist/components/salla-breadcrumb.js +1 -1
- package/dist/components/salla-comment-factors2.js +1 -1
- package/dist/components/salla-comment-item2.js +26 -4
- package/dist/components/salla-comments.js +14 -2
- package/dist/components/salla-cookies-bar.js +319 -27
- package/dist/components/salla-custom-fields.js +28 -4
- package/dist/components/salla-file-upload2.js +703 -31
- package/dist/components/salla-gifting.js +7 -1
- package/dist/components/salla-loyalty-exchange-product-card2.js +46 -34
- package/dist/components/salla-loyalty-panel.js +8 -2
- package/dist/components/salla-loyalty-program.js +8 -2
- package/dist/components/salla-multiple-bundle-product-cart2.js +40 -28
- package/dist/components/salla-multiple-bundle-product-details2.js +12 -6
- package/dist/components/salla-multiple-bundle-product-options-modal2.js +7 -1
- package/dist/components/salla-multiple-bundle-product-slider2.js +1 -1
- package/dist/components/salla-multiple-bundle-product.js +12 -6
- package/dist/components/salla-offer-modal.js +8 -2
- package/dist/components/salla-order-edit-item2.js +36 -24
- package/dist/components/salla-order-edit.js +42 -30
- package/dist/components/salla-order-options-modal2.js +34 -22
- package/dist/components/salla-product-card2.js +44 -32
- package/dist/components/salla-product-options2.js +32 -20
- package/dist/components/salla-products-slider2.js +8 -2
- package/dist/components/salla-quick-buy2.js +36 -24
- package/dist/components/salla-rating-modal-v22.js +449 -97
- package/dist/components/salla-rating-modal.js +30 -20
- package/dist/components/salla-review-factors-tags2.js +9 -8
- package/dist/components/salla-review-order-item.d.ts +11 -0
- package/dist/components/salla-review-order-item.js +196 -0
- package/dist/components/salla-reward-details2.js +8 -2
- package/dist/components/salla-slider2.js +1 -1
- package/dist/esm/{filepond-DMUE9Fyj.js → filepond-CKsbRWmS.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-DBZQTm7s.js → filepond-plugin-file-poster-B_gYCESq.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-CrKxdsNW.js → filepond-plugin-file-validate-size-Bep6fNi3.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-DvEJrucY.js → filepond-plugin-file-validate-type-r3uRmGIr.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-C6ptCg9o.js → filepond-plugin-image-edit-BJcOlOFL.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-IcgeTieF.js → filepond-plugin-image-exif-orientation-DJoDaRwQ.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-CDMh74os.js → filepond-plugin-image-preview-BsuTLPS0.js} +1 -1
- package/dist/esm/helpers-DqXpn47Z.js +85 -0
- package/dist/esm/{index-CjQzkU95.js → index-BVqCTDsV.js} +18 -14
- package/dist/esm/{intlTelInput-Dsx2z7pR.js → intlTelInput-CD2FA0nI.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +1 -1
- package/dist/esm/salla-add-product-button_5.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/{salla-booking-field_7.entry.js → salla-attachment-view_9.entry.js} +1002 -41
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-cart-summary-card.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +2 -2
- package/dist/esm/salla-comment-form_8.entry.js +14 -5
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +303 -26
- package/dist/esm/salla-count-down.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +1 -1
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_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 +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +420 -84
- package/dist/esm/salla-rating-modal.entry.js +3 -5
- package/dist/esm/salla-review-factors-tags.entry.js +2 -81
- package/dist/esm/salla-review-order-item.entry.js +123 -0
- 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 +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +1 -1
- package/dist/esm/salla-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 +1 -1
- 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/upload-limits-DrXX8XG8.js +121 -0
- package/dist/esm/{vanilla-picker-oYjMgYry.js → vanilla-picker-Ba_za9Iy.js} +1 -1
- package/dist/twilight/{p-49e6fe86.entry.js → p-003499a8.entry.js} +1 -1
- package/dist/twilight/{p-58184ae2.entry.js → p-0974f6c6.entry.js} +1 -1
- package/dist/twilight/{p-3052178c.entry.js → p-0a9093f1.entry.js} +1 -1
- package/dist/twilight/{p-cb179aba.entry.js → p-0ce2c41f.entry.js} +1 -1
- package/dist/twilight/{p-bbe79568.entry.js → p-0ea8365b.entry.js} +1 -1
- package/dist/twilight/p-1174e53e.entry.js +4 -0
- package/dist/twilight/{p-fe7990b7.entry.js → p-11ef8b82.entry.js} +1 -1
- package/dist/twilight/{p-dd5800dd.entry.js → p-13244c52.entry.js} +1 -1
- package/dist/twilight/{p-187a502c.entry.js → p-14689252.entry.js} +1 -1
- package/dist/twilight/{p-48db7b95.entry.js → p-17940d8a.entry.js} +1 -1
- package/dist/twilight/{p-a802826b.entry.js → p-1974f6da.entry.js} +1 -1
- package/dist/twilight/{p-250d7ab2.entry.js → p-1a191989.entry.js} +1 -1
- package/dist/twilight/{p-1d2804ac.entry.js → p-1ec6e0fe.entry.js} +1 -1
- package/dist/twilight/{p-5bbf829e.entry.js → p-1fcebaad.entry.js} +1 -1
- package/dist/twilight/{p-51a860bc.entry.js → p-2b0cf190.entry.js} +1 -1
- package/dist/twilight/{p-68c8772a.entry.js → p-333ea76b.entry.js} +1 -1
- package/dist/twilight/{p-8ef3693b.entry.js → p-337cc9f6.entry.js} +1 -1
- package/dist/twilight/{p-f7298462.entry.js → p-34d5c7bf.entry.js} +1 -1
- package/dist/twilight/{p-b1812d5c.entry.js → p-36abc50f.entry.js} +1 -1
- package/dist/twilight/{p-a1494e64.entry.js → p-37d9f762.entry.js} +1 -1
- package/dist/twilight/{p-5e9fb02d.entry.js → p-3961522a.entry.js} +1 -1
- package/dist/twilight/{p-1754903f.entry.js → p-39d9e02f.entry.js} +1 -1
- package/dist/twilight/{p-152c657e.entry.js → p-3a4bb8de.entry.js} +1 -1
- package/dist/twilight/{p-7c74dc6e.entry.js → p-409f95a8.entry.js} +1 -1
- package/dist/twilight/{p-3bc64439.entry.js → p-42952fac.entry.js} +1 -1
- package/dist/twilight/{p-0a1271e1.entry.js → p-436dfe93.entry.js} +1 -1
- package/dist/twilight/{p-44cfb2c2.entry.js → p-50c90e0a.entry.js} +1 -1
- package/dist/twilight/{p-31c36417.entry.js → p-5115117b.entry.js} +1 -1
- package/dist/twilight/{p-1fb46b43.entry.js → p-56647774.entry.js} +1 -1
- package/dist/twilight/{p-e020f1c3.entry.js → p-598cadf4.entry.js} +1 -1
- package/dist/twilight/{p-331679d8.entry.js → p-635265d1.entry.js} +1 -1
- package/dist/twilight/{p-1470e96a.entry.js → p-659e2280.entry.js} +1 -1
- package/dist/twilight/p-6a3487de.entry.js +4 -0
- package/dist/twilight/{p-1c31cec0.entry.js → p-6d07d195.entry.js} +1 -1
- package/dist/twilight/{p-91b4a1a0.entry.js → p-6ee096e8.entry.js} +1 -1
- package/dist/twilight/{p-37413a02.entry.js → p-723aeda4.entry.js} +1 -1
- package/dist/twilight/{p-ae536a61.entry.js → p-743b79ae.entry.js} +1 -1
- package/dist/twilight/{p-b193c991.entry.js → p-75e692d1.entry.js} +1 -1
- package/dist/twilight/{p-9c7fcbb0.entry.js → p-79444897.entry.js} +1 -1
- package/dist/twilight/{p-6ed4c9bb.entry.js → p-7b23dec7.entry.js} +1 -1
- package/dist/twilight/p-7bb24ad6.entry.js +4 -0
- package/dist/twilight/{p-c254b6fa.entry.js → p-7d9288b0.entry.js} +1 -1
- package/dist/twilight/{p-82c12191.entry.js → p-85f95a58.entry.js} +1 -1
- package/dist/twilight/{p-67e88dc4.entry.js → p-86a1f616.entry.js} +1 -1
- package/dist/twilight/{p-80ff5572.entry.js → p-87115499.entry.js} +1 -1
- package/dist/twilight/{p-cc2b960c.entry.js → p-878c2be2.entry.js} +1 -1
- package/dist/twilight/{p-b69e98a8.entry.js → p-89e9a91f.entry.js} +1 -1
- package/dist/twilight/{p-2e112687.entry.js → p-90ee37c7.entry.js} +1 -1
- package/dist/twilight/{p-aeb76c46.entry.js → p-96584590.entry.js} +1 -1
- package/dist/twilight/{p-1dd1fef0.entry.js → p-96a57e9c.entry.js} +1 -1
- package/dist/twilight/{p-1c369bcf.entry.js → p-978e4164.entry.js} +1 -1
- package/dist/twilight/{p-4058b619.entry.js → p-97fc57c1.entry.js} +1 -1
- package/dist/twilight/p-98b1ff35.entry.js +4 -0
- package/dist/twilight/{p-5d01f25c.entry.js → p-9d18525b.entry.js} +1 -1
- package/dist/twilight/{p-CmQyEOxJ.js → p-B83s3cRn.js} +2 -2
- package/dist/twilight/{p-CjQzkU95.js → p-BVqCTDsV.js} +1 -1
- package/dist/twilight/{p-BtymczNp.js → p-CP29f7RQ.js} +1 -1
- package/dist/twilight/{p-C6w35AiQ.js → p-CS-t4QAX.js} +1 -1
- package/dist/twilight/{p-BiyhYWus.js → p-Cluq3aDa.js} +1 -1
- package/dist/twilight/{p-DfJdKB52.js → p-D-zqM6k8.js} +1 -1
- package/dist/twilight/{p-CGDRqU6i.js → p-DJmqmO68.js} +1 -1
- package/dist/twilight/{p-D2uiOzVz.js → p-DgwK96eP.js} +1 -1
- package/dist/twilight/p-DqXpn47Z.js +4 -0
- package/dist/twilight/p-DrXX8XG8.js +4 -0
- package/dist/twilight/{p-C1wu6qA1.js → p-DzW3U8TR.js} +1 -1
- package/dist/twilight/{p-B9VKgTTF.js → p-JKh0XFIn.js} +1 -1
- package/dist/twilight/{p-699bea26.entry.js → p-a347e701.entry.js} +1 -1
- package/dist/twilight/{p-9fa351ab.entry.js → p-a5d08af6.entry.js} +1 -1
- package/dist/twilight/{p-8230c543.entry.js → p-a774f6f0.entry.js} +7 -7
- package/dist/twilight/p-afaa0fbe.entry.js +4 -0
- package/dist/twilight/p-b389b1d3.entry.js +4 -0
- package/dist/twilight/{p-298ff716.entry.js → p-b6d5ae9b.entry.js} +1 -1
- package/dist/twilight/{p-b0e86201.entry.js → p-b862c670.entry.js} +1 -1
- package/dist/twilight/{p-2e43ddf0.entry.js → p-bab59319.entry.js} +1 -1
- package/dist/twilight/{p-437fe6f1.entry.js → p-bf4c2184.entry.js} +1 -1
- package/dist/twilight/{p-7f73ff43.entry.js → p-c19cf93c.entry.js} +1 -1
- package/dist/twilight/{p-3f26f1c5.entry.js → p-c34f8c08.entry.js} +1 -1
- package/dist/twilight/{p-116e7555.entry.js → p-c47ecca7.entry.js} +1 -1
- package/dist/twilight/{p-84f35767.entry.js → p-c48f5c6b.entry.js} +1 -1
- package/dist/twilight/{p-40217fcc.entry.js → p-c53c2f59.entry.js} +1 -1
- package/dist/twilight/{p-1151ebd7.entry.js → p-cd805a38.entry.js} +1 -1
- package/dist/twilight/{p-4868c03c.entry.js → p-cdd8ed7f.entry.js} +1 -1
- package/dist/twilight/{p-9b6db6a7.entry.js → p-ced4b7ac.entry.js} +1 -1
- package/dist/twilight/{p-a3f00389.entry.js → p-cf3365e2.entry.js} +1 -1
- package/dist/twilight/p-d78998b7.entry.js +4 -0
- package/dist/twilight/{p-665bca88.entry.js → p-daea3207.entry.js} +1 -1
- package/dist/twilight/{p-664f0936.entry.js → p-dff6d623.entry.js} +1 -1
- package/dist/twilight/p-e04221de.entry.js +4 -0
- package/dist/twilight/{p-db02986a.entry.js → p-e2934193.entry.js} +1 -1
- package/dist/twilight/{p-14c72ffd.entry.js → p-e3dab961.entry.js} +1 -1
- package/dist/twilight/{p-bf183f3a.entry.js → p-e41e5fc7.entry.js} +1 -1
- package/dist/twilight/{p-5b03dca8.entry.js → p-e4c9cef4.entry.js} +1 -1
- package/dist/twilight/{p-27a0a4cc.entry.js → p-eaf9d536.entry.js} +1 -1
- package/dist/twilight/{p-a669483e.entry.js → p-ee2b16d7.entry.js} +1 -1
- package/dist/twilight/{p-fa28a89f.entry.js → p-ee3ddc23.entry.js} +1 -1
- package/dist/twilight/{p-54d0db9a.entry.js → p-f0a14b18.entry.js} +1 -1
- package/dist/twilight/{p-8fa84b87.entry.js → p-f195a63d.entry.js} +1 -1
- package/dist/twilight/{p-997c4966.entry.js → p-f2c688d6.entry.js} +1 -1
- package/dist/twilight/{p-2c6c0844.entry.js → p-f4ac8cae.entry.js} +1 -1
- package/dist/twilight/{p-2babb4bd.entry.js → p-f58d14ed.entry.js} +1 -1
- package/dist/twilight/{p-3bdba697.entry.js → p-f82cee0c.entry.js} +1 -1
- package/dist/twilight/{p-8ae7bf96.entry.js → p-fa17989b.entry.js} +1 -1
- package/dist/twilight/{p-b3fe5e44.entry.js → p-fbc075fe.entry.js} +1 -1
- package/dist/twilight/{p-3b6b3c54.entry.js → p-fc5d5473.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-attachment-view/salla-attachment-view.d.ts +47 -0
- package/dist/types/components/salla-attachments/salla-attachments.d.ts +73 -0
- package/dist/types/components/salla-comments/interfaces.d.ts +1 -0
- package/dist/types/components/salla-comments/salla-comment-item.d.ts +3 -1
- package/dist/types/components/salla-cookies-bar/salla-cookies-bar.d.ts +117 -12
- package/dist/types/components/salla-file-upload/salla-file-upload.d.ts +127 -4
- package/dist/types/components/salla-file-upload/upload-limits.d.ts +49 -0
- package/dist/types/components/salla-rating-modal/rating-modal-media.d.ts +38 -0
- package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +30 -7
- package/dist/types/components/salla-review-factors-tags/helpers.d.ts +1 -1
- package/dist/types/components/salla-review-factors-tags/interfaces.d.ts +7 -0
- package/dist/types/components/salla-review-order-item/interfaces.d.ts +30 -0
- package/dist/types/components/salla-review-order-item/salla-review-order-item.d.ts +30 -0
- package/dist/types/components.d.ts +286 -11
- package/package.json +6 -6
- package/dist/twilight/p-236f371d.entry.js +0 -4
- package/dist/twilight/p-3c22551b.entry.js +0 -4
- package/dist/twilight/p-8bce41c8.entry.js +0 -4
- package/dist/twilight/p-e701a3dc.entry.js +0 -4
- package/dist/twilight/p-f1eebeda.entry.js +0 -4
- package/dist/twilight/p-f4bdf19e.entry.js +0 -4
- package/dist/twilight/p-faaf4423.entry.js +0 -4
- package/dist/components/{keyboard_arrow_right.js → keyboard_arrow_left.js} +6 -6
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-DX2EKTCE.js');
|
|
7
7
|
var star = require('./star-DMzrN05M.js');
|
|
8
8
|
var shippingFast = require('./shipping-fast-CsqEQE78.js');
|
|
9
9
|
var checkCircle2 = require('./check-circle2-BDvlT4_n.js');
|
|
@@ -11,15 +11,100 @@ var Helper = require('./Helper-6RI07gZo.js');
|
|
|
11
11
|
var image = require('./image-BoZ6Hums.js');
|
|
12
12
|
var whatsapp2 = require('./whatsapp2-BdMd5Gx1.js');
|
|
13
13
|
var mail = require('./mail-C9D8MHae.js');
|
|
14
|
+
var uploadLimits = require('./upload-limits-C3RarAPN.js');
|
|
14
15
|
require('./anime.es-BqW8JHZi.js');
|
|
15
16
|
|
|
16
|
-
const sallaRatingModalCss = "/*!twlt*/.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}.s-rating-modal-uploader.is-opened{height:auto !important;opacity:1 !important;overflow:visible !important;pointer-events:auto !important;margin-bottom:1rem}.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}.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%}";
|
|
17
|
+
const MAX_IMAGE_UPLOAD_LIMIT = 10;
|
|
18
|
+
const MAX_VIDEO_UPLOAD_LIMIT = 5;
|
|
19
|
+
const MAX_VIDEO_FILE_SIZE = '100MB';
|
|
20
|
+
const MAX_VIDEO_DURATION = 60;
|
|
21
|
+
const MAX_PARALLEL_UPLOADS = 10;
|
|
22
|
+
function isVideoUrl(url) {
|
|
23
|
+
const pathname = url.split(/[?#]/, 1)[0];
|
|
24
|
+
return /\.(mp4|webm|mov|avi|mkv)$/i.test(pathname);
|
|
25
|
+
}
|
|
26
|
+
function splitMediaUrls(urls) {
|
|
27
|
+
return urls.reduce((acc, url) => {
|
|
28
|
+
if (!url)
|
|
29
|
+
return acc;
|
|
30
|
+
if (isVideoUrl(url)) {
|
|
31
|
+
acc.videos.push(url);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
acc.images.push(url);
|
|
35
|
+
}
|
|
36
|
+
return acc;
|
|
37
|
+
}, { images: [], videos: [] });
|
|
38
|
+
}
|
|
39
|
+
function getMediaUrlsByType(items) {
|
|
40
|
+
return splitMediaUrls(items.map(item => item?.url || '').filter(Boolean));
|
|
41
|
+
}
|
|
42
|
+
function parseMediaField(value) {
|
|
43
|
+
if (!value)
|
|
44
|
+
return [];
|
|
45
|
+
if (Array.isArray(value))
|
|
46
|
+
return value.filter(Boolean);
|
|
47
|
+
return value
|
|
48
|
+
.split(',')
|
|
49
|
+
.map(url => url.trim())
|
|
50
|
+
.filter(Boolean);
|
|
51
|
+
}
|
|
52
|
+
function countMediaByType(items) {
|
|
53
|
+
return items.reduce((counts, item) => {
|
|
54
|
+
const url = item?.url || '';
|
|
55
|
+
if (isVideoUrl(url)) {
|
|
56
|
+
counts.video += 1;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
counts.image += 1;
|
|
60
|
+
}
|
|
61
|
+
return counts;
|
|
62
|
+
}, { image: 0, video: 0 });
|
|
63
|
+
}
|
|
64
|
+
function createPreloadedMediaItem(url) {
|
|
65
|
+
return { id: url, url };
|
|
66
|
+
}
|
|
67
|
+
function removeUploadedImage(images, removedId) {
|
|
68
|
+
const normalizedId = String(removedId);
|
|
69
|
+
let removed = false;
|
|
70
|
+
return images.filter(image => {
|
|
71
|
+
const imageId = image?.id !== undefined && image?.id !== null ? String(image.id) : '';
|
|
72
|
+
const imageUrl = String(image?.url ?? '');
|
|
73
|
+
const matches = imageId === normalizedId || imageUrl === normalizedId;
|
|
74
|
+
if (matches) {
|
|
75
|
+
if (removed) {
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
removed = true;
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
return true;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function syncHiddenMediaInputs(imagesInput, videosInput, items) {
|
|
85
|
+
const { images, videos } = getMediaUrlsByType(items);
|
|
86
|
+
if (imagesInput)
|
|
87
|
+
imagesInput.value = images.join(',');
|
|
88
|
+
if (videosInput)
|
|
89
|
+
videosInput.value = videos.join(',');
|
|
90
|
+
}
|
|
91
|
+
function normalizeSubmittedMedia(data, allowAttachImages, allowAttachVideos) {
|
|
92
|
+
if (!allowAttachImages) {
|
|
93
|
+
delete data.images;
|
|
94
|
+
}
|
|
95
|
+
if (!allowAttachVideos) {
|
|
96
|
+
delete data.videos;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const sallaRatingModalCss = "/*!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%}";
|
|
17
101
|
|
|
18
102
|
const SallaRatingModalV2 = class {
|
|
19
103
|
constructor(hostRef) {
|
|
20
104
|
index.registerInstance(this, hostRef);
|
|
21
105
|
this.hasError = false;
|
|
22
106
|
this.showContactWidget = true;
|
|
107
|
+
this.errorMessage = '';
|
|
23
108
|
this.images = [];
|
|
24
109
|
this.productImages = {};
|
|
25
110
|
this.editItemImages = [];
|
|
@@ -34,7 +119,12 @@ const SallaRatingModalV2 = class {
|
|
|
34
119
|
this.shouldOpenDeleteModal = false;
|
|
35
120
|
this.editItem = null;
|
|
36
121
|
this.allowAttachImages = false;
|
|
122
|
+
this.allowAttachVideos = false;
|
|
37
123
|
this.allowContactSupport = false;
|
|
124
|
+
this.uploadCounts = {};
|
|
125
|
+
this.uploadImageCounts = {};
|
|
126
|
+
this.uploadVideoCounts = {};
|
|
127
|
+
this.hasUploadsInProgress = false;
|
|
38
128
|
this.loyaltyImageRatingPoints = 0;
|
|
39
129
|
this.dragAndDropFilesLabel = salla.lang.get('common.uploader.drag_and_drop_files');
|
|
40
130
|
this.contactSubjectLabel = salla.lang.get('pages.rating.contact_subject');
|
|
@@ -55,13 +145,19 @@ const SallaRatingModalV2 = class {
|
|
|
55
145
|
});
|
|
56
146
|
this.contentRefs = [];
|
|
57
147
|
this.hiddenInputs = [];
|
|
148
|
+
this.hiddenVideoInputs = [];
|
|
149
|
+
this.uploadingByProductId = {};
|
|
58
150
|
this.userFilledFactorKeys = {};
|
|
59
151
|
this.boundRatingRows = new WeakSet();
|
|
60
152
|
this.stepsCount = 0;
|
|
61
153
|
this.currentIndex = 0;
|
|
62
154
|
this.submitted = [];
|
|
63
|
-
this.MAX_UPLOAD_LIMIT = 3;
|
|
64
155
|
this.thanksCountdownInterval = null;
|
|
156
|
+
this.MAX_IMAGE_UPLOAD_LIMIT = MAX_IMAGE_UPLOAD_LIMIT;
|
|
157
|
+
this.MAX_VIDEO_UPLOAD_LIMIT = MAX_VIDEO_UPLOAD_LIMIT;
|
|
158
|
+
this.MAX_VIDEO_FILE_SIZE = MAX_VIDEO_FILE_SIZE;
|
|
159
|
+
this.MAX_VIDEO_DURATION = MAX_VIDEO_DURATION;
|
|
160
|
+
this.MAX_PARALLEL_UPLOADS = MAX_PARALLEL_UPLOADS;
|
|
65
161
|
this.scheduleWizardSetup = false;
|
|
66
162
|
salla.lang.onLoaded(() => {
|
|
67
163
|
this.contactUsLabel = salla.lang.get('blocks.footer.social');
|
|
@@ -92,8 +188,20 @@ const SallaRatingModalV2 = class {
|
|
|
92
188
|
await setNestedAsync('en.trans', 'pages.rating.review_deleted_successfully', 'The review has been successfully deleted.');
|
|
93
189
|
await setNestedAsync('ar.trans', 'pages.rating.images_count', 'الصور ( :current من أصل :total )');
|
|
94
190
|
await setNestedAsync('en.trans', 'pages.rating.images_count', 'Images ( :current of :total )');
|
|
95
|
-
await setNestedAsync('ar.trans', '
|
|
96
|
-
await setNestedAsync('en.trans', '
|
|
191
|
+
await setNestedAsync('ar.trans', 'pages.rating.media_count', 'الصور (:imageCurrent/:imageTotal) · الفيديو (:videoCurrent/:videoTotal)');
|
|
192
|
+
await setNestedAsync('en.trans', 'pages.rating.media_count', 'Images (:imageCurrent/:imageTotal) · Videos (:videoCurrent/:videoTotal)');
|
|
193
|
+
await setNestedAsync('ar.trans', 'common.uploader.allowed_videos_types', 'يُسمح بفيديوهات mp4 أو mov أو avi أو mkv');
|
|
194
|
+
await setNestedAsync('en.trans', 'common.uploader.allowed_videos_types', 'Videos in mp4, mov, avi, or mkv format are allowed.');
|
|
195
|
+
await setNestedAsync('ar.trans', 'pages.rating.videos_count', 'الفيديو ( :current من أصل :total )');
|
|
196
|
+
await setNestedAsync('en.trans', 'pages.rating.videos_count', 'Videos ( :current of :total )');
|
|
197
|
+
await setNestedAsync('ar.trans', 'common.uploader.allowed_media_types', 'يُسمح بصور jpg أو jpeg أو png وفيديوهات mp4 أو mov أو avi أو mkv');
|
|
198
|
+
await setNestedAsync('en.trans', 'common.uploader.allowed_media_types', 'Images in jpg, jpeg, or png and videos in mp4, mov, avi, or mkv are allowed.');
|
|
199
|
+
await setNestedAsync('ar.trans', 'common.uploader.max_three_images', `أضف حتى ${MAX_IMAGE_UPLOAD_LIMIT} صور و ${MAX_VIDEO_UPLOAD_LIMIT} فيديوهات كحد أقصى`);
|
|
200
|
+
await setNestedAsync('en.trans', 'common.uploader.max_three_images', `Add up to ${MAX_IMAGE_UPLOAD_LIMIT} images and ${MAX_VIDEO_UPLOAD_LIMIT} videos maximum.`);
|
|
201
|
+
await setNestedAsync('ar.trans', 'common.uploader.max_images_count', 'أضف :count صور كحد أقصى');
|
|
202
|
+
await setNestedAsync('en.trans', 'common.uploader.max_images_count', 'Add up to :count images maximum.');
|
|
203
|
+
await setNestedAsync('ar.trans', 'common.uploader.max_videos_count', 'أضف :count فيديوهات كحد أقصى');
|
|
204
|
+
await setNestedAsync('en.trans', 'common.uploader.max_videos_count', 'Add up to :count videos maximum.');
|
|
97
205
|
await setNestedAsync('ar.trans', 'common.elements.confirm_delete', 'تأكيد الحذف');
|
|
98
206
|
await setNestedAsync('en.trans', 'common.elements.confirm_delete', 'Confirm deletion');
|
|
99
207
|
await setNestedAsync('ar.trans', 'pages.rating.rate_required_factors', 'يرجى تقييم جميع المعايير لإتمام مراجعتك.');
|
|
@@ -103,8 +211,8 @@ const SallaRatingModalV2 = class {
|
|
|
103
211
|
await setNestedAsync('ar.trans', 'pages.rating.loyalty_points_for_images', 'اكسب :points نقطة ولاء عند إضافة صور لتقييمك!');
|
|
104
212
|
await setNestedAsync('en.trans', 'pages.rating.loyalty_points_for_images', 'Earn :points loyalty points when adding photos to your review!');
|
|
105
213
|
this.dragAndDropFilesLabel = salla.lang.get('common.uploader.drag_and_drop_files');
|
|
106
|
-
this.allowedImagesTypesLabel =
|
|
107
|
-
this.threeImagesMax =
|
|
214
|
+
this.allowedImagesTypesLabel = this.getAllowedMediaTypesLabel();
|
|
215
|
+
this.threeImagesMax = this.getMaxUploadHintLabel();
|
|
108
216
|
this.contactSubjectLabel = salla.lang.get('pages.rating.contact_subject');
|
|
109
217
|
this.editReviewLabel = salla.lang.get('pages.rating.edit_review');
|
|
110
218
|
this.areYouSureLabel = salla.lang.get('pages.rating.are_you_sure_you_want_to_delete_review');
|
|
@@ -131,7 +239,70 @@ const SallaRatingModalV2 = class {
|
|
|
131
239
|
this.orderId = salla.config.get('page.id');
|
|
132
240
|
}
|
|
133
241
|
this.allowAttachImages = !!salla.config.get('store.settings.rating.allow_attach_images');
|
|
242
|
+
this.allowAttachVideos = !!salla.config.get('store.settings.rating.allow_attach_videos');
|
|
134
243
|
this.allowContactSupport = !!salla.config.get('store.settings.rating.allow_contact_support');
|
|
244
|
+
this.refreshMediaLabels();
|
|
245
|
+
}
|
|
246
|
+
canAttachMedia() {
|
|
247
|
+
return this.allowAttachImages || this.allowAttachVideos;
|
|
248
|
+
}
|
|
249
|
+
getMediaUploadAccept() {
|
|
250
|
+
return uploadLimits.buildMediaUploadAccept(this.allowAttachImages, this.allowAttachVideos);
|
|
251
|
+
}
|
|
252
|
+
refreshMediaLabels() {
|
|
253
|
+
this.allowedImagesTypesLabel = this.getAllowedMediaTypesLabel();
|
|
254
|
+
this.threeImagesMax = this.getMaxUploadHintLabel();
|
|
255
|
+
}
|
|
256
|
+
getAllowedMediaTypesLabel() {
|
|
257
|
+
if (this.allowAttachImages && this.allowAttachVideos) {
|
|
258
|
+
return salla.lang.get('common.uploader.allowed_media_types');
|
|
259
|
+
}
|
|
260
|
+
if (this.allowAttachImages) {
|
|
261
|
+
return salla.lang.get('common.uploader.allowed_images_types');
|
|
262
|
+
}
|
|
263
|
+
if (this.allowAttachVideos) {
|
|
264
|
+
return salla.lang.get('common.uploader.allowed_videos_types');
|
|
265
|
+
}
|
|
266
|
+
return '';
|
|
267
|
+
}
|
|
268
|
+
getMaxUploadHintLabel() {
|
|
269
|
+
if (this.allowAttachImages && this.allowAttachVideos) {
|
|
270
|
+
return salla.lang.get('common.uploader.max_three_images');
|
|
271
|
+
}
|
|
272
|
+
if (this.allowAttachImages) {
|
|
273
|
+
return salla.lang.get('common.uploader.max_images_count', {
|
|
274
|
+
count: this.MAX_IMAGE_UPLOAD_LIMIT,
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
if (this.allowAttachVideos) {
|
|
278
|
+
return salla.lang.get('common.uploader.max_videos_count', {
|
|
279
|
+
count: this.MAX_VIDEO_UPLOAD_LIMIT,
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
return '';
|
|
283
|
+
}
|
|
284
|
+
setUploadCount(productId, count, imageCount, videoCount) {
|
|
285
|
+
this.uploadCounts = { ...this.uploadCounts, [productId]: count };
|
|
286
|
+
if (imageCount != null) {
|
|
287
|
+
this.uploadImageCounts = { ...this.uploadImageCounts, [productId]: imageCount };
|
|
288
|
+
}
|
|
289
|
+
if (videoCount != null) {
|
|
290
|
+
this.uploadVideoCounts = { ...this.uploadVideoCounts, [productId]: videoCount };
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
setUploaderProcessing(productId, uploading) {
|
|
294
|
+
this.uploadingByProductId = { ...this.uploadingByProductId, [productId]: uploading };
|
|
295
|
+
this.hasUploadsInProgress = Object.values(this.uploadingByProductId).some(Boolean);
|
|
296
|
+
}
|
|
297
|
+
scheduleUploaderHeightRefresh() {
|
|
298
|
+
[50, 150, 350].forEach(delay => {
|
|
299
|
+
setTimeout(() => this.updateBodyHeight(), delay);
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
handleGalleryCountUpdate(productId, detail) {
|
|
303
|
+
this.setUploadCount(productId, detail.count, detail.imageCount, detail.videoCount);
|
|
304
|
+
this.setUploaderProcessing(productId, !!detail.uploading);
|
|
305
|
+
this.scheduleUploaderHeightRefresh();
|
|
135
306
|
}
|
|
136
307
|
/** Encrypted order id from page config / prop — used to fetch order details. */
|
|
137
308
|
getRatingOrderId() {
|
|
@@ -277,7 +448,7 @@ const SallaRatingModalV2 = class {
|
|
|
277
448
|
return new Promise(resolve => {
|
|
278
449
|
setTimeout(() => {
|
|
279
450
|
this.modal
|
|
280
|
-
|
|
451
|
+
?.open()
|
|
281
452
|
.then(() => this.order ||
|
|
282
453
|
salla.api
|
|
283
454
|
.withoutNotifier(() => salla.rating.api.order(this.getRatingOrderId()))
|
|
@@ -286,7 +457,7 @@ const SallaRatingModalV2 = class {
|
|
|
286
457
|
this.productReviewFactors = await this.fetchAllProductReviewFactors(res.data);
|
|
287
458
|
}))
|
|
288
459
|
.then(() => this.readyUpLoyaltyPoints())
|
|
289
|
-
.then(() => this.modal
|
|
460
|
+
.then(() => this.modal?.setTitle(`${salla.lang.get('pages.rating.rate_order')} <span class="unicode">(#${this.order.id})</span>`))
|
|
290
461
|
.then(() => {
|
|
291
462
|
// Initialize productImages for all products
|
|
292
463
|
const initialImages = {};
|
|
@@ -294,14 +465,15 @@ const SallaRatingModalV2 = class {
|
|
|
294
465
|
initialImages[item.product.id] = [];
|
|
295
466
|
}
|
|
296
467
|
this.productImages = initialImages;
|
|
468
|
+
this.uploadCounts = Object.fromEntries(Object.keys(initialImages).map(productId => [Number(productId), 0]));
|
|
297
469
|
})
|
|
298
|
-
.then(() => this.modal
|
|
470
|
+
.then(() => this.modal?.stopLoading())
|
|
299
471
|
.then(() => this.afterOrderLoaded())
|
|
300
|
-
.catch(e => {
|
|
472
|
+
.catch((e) => {
|
|
301
473
|
resolve(false);
|
|
302
474
|
this.hasError = true;
|
|
303
475
|
this.errorMessage = e.response?.data?.error?.message || e.response?.data;
|
|
304
|
-
this.modal
|
|
476
|
+
this.modal?.stopLoading();
|
|
305
477
|
});
|
|
306
478
|
resolve(true);
|
|
307
479
|
}, 50);
|
|
@@ -323,7 +495,10 @@ const SallaRatingModalV2 = class {
|
|
|
323
495
|
this.editFactorRatings = { ...this.buildEditFactorRatings(this.editItem.product.id) };
|
|
324
496
|
this.markExistingFactorRatingsAsUserFilled(this.editItem.product.id, this.editFactorRatings);
|
|
325
497
|
}
|
|
326
|
-
this.editModal
|
|
498
|
+
this.editModal?.open();
|
|
499
|
+
if (this.editType === 'product' && this.canAttachMedia()) {
|
|
500
|
+
this.scheduleUploaderHeightRefresh();
|
|
501
|
+
}
|
|
327
502
|
}
|
|
328
503
|
catch (e) {
|
|
329
504
|
this.hasError = true;
|
|
@@ -334,28 +509,56 @@ const SallaRatingModalV2 = class {
|
|
|
334
509
|
const endpoint = `rating/${feedbackId}/show`;
|
|
335
510
|
const response = await salla.api.request(endpoint);
|
|
336
511
|
this.editItem = response.data;
|
|
337
|
-
if (this.
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
512
|
+
if (this.canAttachMedia() && this.editType == 'product') {
|
|
513
|
+
const imageUrls = (this.editItem.images || []).filter(Boolean);
|
|
514
|
+
const videoUrls = (this.editItem.videos || []).filter(Boolean);
|
|
515
|
+
let mediaUrls = [...imageUrls, ...videoUrls];
|
|
516
|
+
if (!videoUrls.length && imageUrls.length) {
|
|
517
|
+
const split = splitMediaUrls(imageUrls);
|
|
518
|
+
mediaUrls = [...split.images, ...split.videos];
|
|
519
|
+
}
|
|
520
|
+
mediaUrls = mediaUrls.filter(url => isVideoUrl(url) ? this.allowAttachVideos : this.allowAttachImages);
|
|
521
|
+
if (mediaUrls.length) {
|
|
522
|
+
this.editItemImages = mediaUrls.map(url => createPreloadedMediaItem(url));
|
|
523
|
+
const mediaCounts = countMediaByType(this.editItemImages);
|
|
524
|
+
this.setUploadCount(this.editItem.product.id, this.editItemImages.length, mediaCounts.image, mediaCounts.video);
|
|
525
|
+
}
|
|
341
526
|
}
|
|
342
527
|
}
|
|
343
528
|
async editReview() {
|
|
529
|
+
if (this.hasUploadsInProgress)
|
|
530
|
+
return;
|
|
344
531
|
const endpoint = `rating/${this.editFeedbackId}`;
|
|
345
532
|
let data;
|
|
346
533
|
if (this.editType === 'product') {
|
|
347
|
-
const container = this.editModal
|
|
534
|
+
const container = this.editModal?.querySelector('[data-type="products"]') || this.currentTab;
|
|
348
535
|
data = this.buildProductRatingPayload(this.collectFormData(container), container);
|
|
349
536
|
if (!data.product_id && this.editItem?.product?.id) {
|
|
350
537
|
data.product_id = String(this.editItem.product.id);
|
|
351
538
|
}
|
|
539
|
+
if (this.canAttachMedia()) {
|
|
540
|
+
const { images, videos } = getMediaUrlsByType(this.editItemImages);
|
|
541
|
+
if (this.allowAttachImages) {
|
|
542
|
+
data.images = images;
|
|
543
|
+
}
|
|
544
|
+
if (this.allowAttachVideos) {
|
|
545
|
+
data.videos = videos;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
normalizeSubmittedMedia(data, this.allowAttachImages, this.allowAttachVideos);
|
|
352
549
|
}
|
|
353
550
|
else {
|
|
354
551
|
data = this.collectFormData(this.editModal);
|
|
355
|
-
|
|
552
|
+
if (data.images) {
|
|
553
|
+
data.images = parseMediaField(data.images);
|
|
554
|
+
}
|
|
555
|
+
if (data.videos) {
|
|
556
|
+
data.videos = parseMediaField(data.videos);
|
|
557
|
+
}
|
|
558
|
+
normalizeSubmittedMedia(data, this.allowAttachImages, this.allowAttachVideos);
|
|
356
559
|
}
|
|
357
|
-
await salla.api.request(endpoint, data, 'put').then(res => {
|
|
358
|
-
this.editModal
|
|
560
|
+
await salla.api.request(endpoint, data, 'put').then((res) => {
|
|
561
|
+
this.editModal?.close();
|
|
359
562
|
salla.notify.success(res.message || this.updatedSuccessfullyLabel);
|
|
360
563
|
setTimeout(() => {
|
|
361
564
|
window.location.reload();
|
|
@@ -369,14 +572,14 @@ const SallaRatingModalV2 = class {
|
|
|
369
572
|
this.shouldOpenDeleteModal = true;
|
|
370
573
|
return new Promise(resolve => {
|
|
371
574
|
setTimeout(() => {
|
|
372
|
-
this.deleteModal
|
|
575
|
+
this.deleteModal?.open().then(() => resolve(true));
|
|
373
576
|
}, 50);
|
|
374
577
|
});
|
|
375
578
|
}
|
|
376
579
|
async deleteReview() {
|
|
377
580
|
const endpoint = `rating/${this.deleteFeedbackId}`;
|
|
378
581
|
await salla.api.request(endpoint, null, 'delete').then(() => {
|
|
379
|
-
this.deleteModal
|
|
582
|
+
this.deleteModal?.close();
|
|
380
583
|
salla.notify.success(this.deletedSuccessfullyLabel);
|
|
381
584
|
setTimeout(() => {
|
|
382
585
|
window.location.reload();
|
|
@@ -387,12 +590,12 @@ const SallaRatingModalV2 = class {
|
|
|
387
590
|
* Show the rating modal
|
|
388
591
|
*/
|
|
389
592
|
async close() {
|
|
390
|
-
return this.modal
|
|
593
|
+
return this.modal?.close();
|
|
391
594
|
}
|
|
392
595
|
// handle wizard
|
|
393
596
|
handleWizard() {
|
|
394
|
-
this.steps = this.modal
|
|
395
|
-
this.dots = this.modal
|
|
597
|
+
this.steps = this.modal?.querySelectorAll('.s-rating-modal-step');
|
|
598
|
+
this.dots = this.modal?.querySelectorAll('.s-rating-modal-step-dot');
|
|
396
599
|
if (this.stepsCount === 0) {
|
|
397
600
|
this.showThankYou();
|
|
398
601
|
return;
|
|
@@ -408,18 +611,18 @@ const SallaRatingModalV2 = class {
|
|
|
408
611
|
}
|
|
409
612
|
showActiveStep(current = null) {
|
|
410
613
|
this.refreshWizardRefs();
|
|
411
|
-
this.currentTab = current || this.steps[this.currentIndex];
|
|
614
|
+
this.currentTab = current || this.steps?.[this.currentIndex];
|
|
412
615
|
if (!this.currentTab) {
|
|
413
616
|
return;
|
|
414
617
|
}
|
|
415
|
-
Helper.Helper.toggleClassIf('.s-rating-modal-step-dot', 's-rating-modal-bg-gray', 's-rating-modal-bg-primary', dot => dot != this.dots[this.currentIndex]).toggleClassIf('.s-rating-modal-step', 's-rating-modal-active', 's-rating-modal-hidden', tab => tab == this.currentTab);
|
|
618
|
+
Helper.Helper.toggleClassIf('.s-rating-modal-step-dot', 's-rating-modal-bg-gray', 's-rating-modal-bg-primary', (dot) => dot != this.dots?.[this.currentIndex]).toggleClassIf('.s-rating-modal-step', 's-rating-modal-active', 's-rating-modal-hidden', (tab) => tab == this.currentTab);
|
|
416
619
|
if (this.currentIndex !== 0) {
|
|
417
620
|
// the animation
|
|
418
621
|
Helper.Helper.toggleElementClassIf(this.currentTab, 's-rating-modal-unactive', 's-rating-modal-hidden', () => true);
|
|
419
622
|
setTimeout(() => Helper.Helper.toggleElementClassIf(this.currentTab, 's-rating-modal-active', 's-rating-modal-unactive', () => true), 300);
|
|
420
623
|
}
|
|
421
624
|
// Btn text
|
|
422
|
-
const nextType = this.steps[this.currentIndex + 1]?.dataset.type;
|
|
625
|
+
const nextType = this.steps?.[this.currentIndex + 1]?.dataset.type;
|
|
423
626
|
this.nextBtn?.setText(nextType
|
|
424
627
|
? `${salla.lang.get('pages.rating.rate')} ${salla.lang.get(`pages.rating.${nextType}`)}`
|
|
425
628
|
: salla.lang.get('pages.rating.send_ratings'));
|
|
@@ -444,13 +647,15 @@ const SallaRatingModalV2 = class {
|
|
|
444
647
|
this.showActiveStep();
|
|
445
648
|
}
|
|
446
649
|
async submit() {
|
|
650
|
+
if (this.hasUploadsInProgress)
|
|
651
|
+
return;
|
|
447
652
|
this.refreshWizardRefs();
|
|
448
653
|
try {
|
|
449
654
|
if (!this.submittedBefore()) {
|
|
450
655
|
this.validate();
|
|
451
656
|
}
|
|
452
657
|
salla.config.canLeave = false;
|
|
453
|
-
await this.nextBtn
|
|
658
|
+
await this.nextBtn?.load();
|
|
454
659
|
if (!this.submittedBefore()) {
|
|
455
660
|
await this.sendFeedback();
|
|
456
661
|
}
|
|
@@ -468,7 +673,7 @@ const SallaRatingModalV2 = class {
|
|
|
468
673
|
}
|
|
469
674
|
}
|
|
470
675
|
finally {
|
|
471
|
-
this.nextBtn
|
|
676
|
+
this.nextBtn?.stop();
|
|
472
677
|
salla.config.canLeave = true;
|
|
473
678
|
}
|
|
474
679
|
}
|
|
@@ -496,6 +701,9 @@ const SallaRatingModalV2 = class {
|
|
|
496
701
|
inputs.push(input);
|
|
497
702
|
};
|
|
498
703
|
container.querySelectorAll('[name]').forEach((input) => {
|
|
704
|
+
if (input.closest('salla-file-upload')) {
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
499
707
|
addInput(input);
|
|
500
708
|
});
|
|
501
709
|
container.querySelectorAll('salla-rating-stars').forEach((stars) => {
|
|
@@ -516,25 +724,28 @@ const SallaRatingModalV2 = class {
|
|
|
516
724
|
return [];
|
|
517
725
|
}
|
|
518
726
|
validate(rating = null, type = null) {
|
|
519
|
-
if (!rating && this.currentTab
|
|
727
|
+
if (!rating && this.currentTab?.dataset?.type === 'products') {
|
|
520
728
|
const ratingForms = this.currentTab.querySelectorAll('.rating-outer-form');
|
|
521
|
-
ratingForms.forEach(ratingForm => this.validate(ratingForm, 'product'));
|
|
729
|
+
ratingForms.forEach((ratingForm) => this.validate(ratingForm, 'product'));
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
const resolvedRating = rating ?? this.currentTab;
|
|
733
|
+
if (!resolvedRating) {
|
|
522
734
|
return;
|
|
523
735
|
}
|
|
524
|
-
|
|
525
|
-
const
|
|
526
|
-
const mainRatingInput = this.getRatingHiddenInput(mainRatingRow || rating);
|
|
736
|
+
const mainRatingRow = resolvedRating.querySelector('.s-rating-modal-product-rating-row-main');
|
|
737
|
+
const mainRatingInput = this.getRatingHiddenInput(mainRatingRow || resolvedRating);
|
|
527
738
|
const stars = mainRatingInput?.value;
|
|
528
|
-
const validationMessage =
|
|
529
|
-
|
|
739
|
+
const validationMessage = resolvedRating.querySelector('.s-rating-modal-validation-msg');
|
|
740
|
+
const resolvedType = type || resolvedRating.getAttribute('data-type');
|
|
530
741
|
if (!stars) {
|
|
531
742
|
validationMessage.innerHTML = salla.lang
|
|
532
|
-
.get(`pages.rating.rate_${
|
|
743
|
+
.get(`pages.rating.rate_${resolvedType}_stars`)
|
|
533
744
|
.replace(' (:item)', '');
|
|
534
745
|
throw new Error(validationMessage.innerHTML);
|
|
535
746
|
}
|
|
536
|
-
if (
|
|
537
|
-
const requiredFactorRows = Array.from(
|
|
747
|
+
if (resolvedType === 'product') {
|
|
748
|
+
const requiredFactorRows = Array.from(resolvedRating.querySelectorAll('.s-rating-modal-product-factor-row[data-required="true"]'));
|
|
538
749
|
const hasMissingRequiredFactor = requiredFactorRows.some((row) => {
|
|
539
750
|
const factorStarsInput = this.getRatingHiddenInput(row);
|
|
540
751
|
return !factorStarsInput?.value;
|
|
@@ -544,9 +755,13 @@ const SallaRatingModalV2 = class {
|
|
|
544
755
|
throw new Error(validationMessage.innerHTML);
|
|
545
756
|
}
|
|
546
757
|
}
|
|
547
|
-
validationMessage
|
|
758
|
+
if (validationMessage) {
|
|
759
|
+
validationMessage.innerHTML = '';
|
|
760
|
+
}
|
|
548
761
|
}
|
|
549
762
|
collectFormData(container = this.currentTab) {
|
|
763
|
+
if (!container)
|
|
764
|
+
return {};
|
|
550
765
|
const data = {};
|
|
551
766
|
this.collectNamedInputs(container).forEach((input) => {
|
|
552
767
|
const inputData = salla.helpers.inputData(input.name, input.value, data);
|
|
@@ -555,6 +770,8 @@ const SallaRatingModalV2 = class {
|
|
|
555
770
|
return data;
|
|
556
771
|
}
|
|
557
772
|
buildProductRatingPayload(data, container = this.currentTab) {
|
|
773
|
+
if (!container)
|
|
774
|
+
return {};
|
|
558
775
|
if (!data.rating) {
|
|
559
776
|
const mainRatingRow = container.querySelector('.s-rating-modal-product-rating-row-main');
|
|
560
777
|
const mainRatingInput = this.getRatingHiddenInput(mainRatingRow || container);
|
|
@@ -564,15 +781,24 @@ const SallaRatingModalV2 = class {
|
|
|
564
781
|
}
|
|
565
782
|
const productId = Number(data.product_id);
|
|
566
783
|
let images = [];
|
|
784
|
+
let videos = [];
|
|
567
785
|
if (data.images) {
|
|
568
|
-
images =
|
|
569
|
-
|
|
786
|
+
images = parseMediaField(data.images);
|
|
787
|
+
}
|
|
788
|
+
else if (this.editMode && this.canAttachMedia() && productId) {
|
|
789
|
+
images = getMediaUrlsByType(this.editItemImages).images;
|
|
790
|
+
}
|
|
791
|
+
else if (this.canAttachMedia() && productId) {
|
|
792
|
+
images = getMediaUrlsByType(this.productImages[productId] || []).images;
|
|
570
793
|
}
|
|
571
|
-
|
|
572
|
-
|
|
794
|
+
if (data.videos) {
|
|
795
|
+
videos = parseMediaField(data.videos);
|
|
573
796
|
}
|
|
574
|
-
else if (this.
|
|
575
|
-
|
|
797
|
+
else if (this.editMode && this.canAttachMedia() && productId) {
|
|
798
|
+
videos = getMediaUrlsByType(this.editItemImages).videos;
|
|
799
|
+
}
|
|
800
|
+
else if (this.canAttachMedia() && productId) {
|
|
801
|
+
videos = getMediaUrlsByType(this.productImages[productId] || []).videos;
|
|
576
802
|
}
|
|
577
803
|
const factors = this.normalizeFactorsList(data.factors)
|
|
578
804
|
.filter(factor => factor?.id && factor?.rating)
|
|
@@ -580,15 +806,21 @@ const SallaRatingModalV2 = class {
|
|
|
580
806
|
id: String(factor.id),
|
|
581
807
|
rating: String(factor.rating),
|
|
582
808
|
}));
|
|
583
|
-
|
|
809
|
+
const payload = {
|
|
584
810
|
order_id: this.getSubmitOrderId(),
|
|
585
811
|
product_id: String(data.product_id),
|
|
586
812
|
rating: String(data.rating),
|
|
587
813
|
comment: data.comment || data.content || '',
|
|
588
|
-
images,
|
|
589
814
|
factors,
|
|
590
815
|
type: 'products',
|
|
591
816
|
};
|
|
817
|
+
if (this.allowAttachImages) {
|
|
818
|
+
payload.images = images;
|
|
819
|
+
}
|
|
820
|
+
if (this.allowAttachVideos) {
|
|
821
|
+
payload.videos = videos;
|
|
822
|
+
}
|
|
823
|
+
return payload;
|
|
592
824
|
}
|
|
593
825
|
async sendFeedback() {
|
|
594
826
|
this.refreshWizardRefs();
|
|
@@ -609,6 +841,9 @@ const SallaRatingModalV2 = class {
|
|
|
609
841
|
}
|
|
610
842
|
data.order_id = this.getSubmitOrderId();
|
|
611
843
|
data.type = stepType;
|
|
844
|
+
if (!stepType) {
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
612
847
|
const res = await salla.rating.api[stepType](data);
|
|
613
848
|
this.submitted.push(this.currentIndex);
|
|
614
849
|
return res;
|
|
@@ -623,6 +858,8 @@ const SallaRatingModalV2 = class {
|
|
|
623
858
|
let seconds = 10;
|
|
624
859
|
this.clearThanksCountdown();
|
|
625
860
|
this.thanksCountdownInterval = setInterval(() => {
|
|
861
|
+
if (!this.thanksTime)
|
|
862
|
+
return;
|
|
626
863
|
this.thanksTime.innerHTML = `00:0${seconds--}`;
|
|
627
864
|
if (seconds > 0) {
|
|
628
865
|
return;
|
|
@@ -631,7 +868,7 @@ const SallaRatingModalV2 = class {
|
|
|
631
868
|
this.thanksTime.remove();
|
|
632
869
|
this.close().then(() => window.location.reload());
|
|
633
870
|
}, 1000);
|
|
634
|
-
this.modal
|
|
871
|
+
this.modal?.querySelector('.s-rating-modal-footer')?.classList.add('s-rating-modal-unvisiable');
|
|
635
872
|
this.showActiveStep(this.thanksTab);
|
|
636
873
|
}
|
|
637
874
|
getFilepondPlaceholder() {
|
|
@@ -939,26 +1176,41 @@ const SallaRatingModalV2 = class {
|
|
|
939
1176
|
}, {});
|
|
940
1177
|
}
|
|
941
1178
|
renderProductStep(item, index$1) {
|
|
942
|
-
return (index.h("section", { class: "s-rating-modal-step s-rating-modal-hidden", "data-type": "products", "data-product-id": item.product.id, key: item.product.id }, index.h("div", { class: "s-rating-modal-product" }, this.allowAttachImages && this.loyaltyPointsNote(), index.h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, index.h("div", { class: "s-rating-modal-product-details" }, index.h("div", { class: "s-rating-modal-product-info-row" }, index.h("div", { class: "s-rating-modal-product-img-wrap" }, index.h("img", { src: item.product.thumbnail, alt: item.product.name, class: "s-rating-modal-product-img" })), index.h("h3", { class: "s-rating-modal-product-title" }, item.product.name)), this.renderProductReviewFactors(item.product.id, 0, { fieldPrefix: '' }), index.h("input", { type: "hidden", name: "product_id", value: item.product.id }), index.h("textarea", { placeholder: salla.lang.get('pages.rating.write_product_rate'), name: "comment", class: "s-rating-modal-comment" }), index.h("small", { class: "s-rating-modal-validation-msg" }))), this.
|
|
1179
|
+
return (index.h("section", { class: "s-rating-modal-step s-rating-modal-hidden", "data-type": "products", "data-product-id": item.product.id, key: item.product.id }, index.h("div", { class: "s-rating-modal-product" }, this.allowAttachImages && this.loyaltyPointsNote(), index.h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, index.h("div", { class: "s-rating-modal-product-details" }, index.h("div", { class: "s-rating-modal-product-info-row" }, index.h("div", { class: "s-rating-modal-product-img-wrap" }, index.h("img", { src: item.product.thumbnail, alt: item.product.name, class: "s-rating-modal-product-img" })), index.h("h3", { class: "s-rating-modal-product-title" }, item.product.name)), this.renderProductReviewFactors(item.product.id, 0, { fieldPrefix: '' }), index.h("input", { type: "hidden", name: "product_id", value: item.product.id }), index.h("textarea", { placeholder: salla.lang.get('pages.rating.write_product_rate'), name: "comment", class: "s-rating-modal-comment" }), index.h("small", { class: "s-rating-modal-validation-msg" }))), this.canAttachMedia() && (index.h("div", { class: "s-rating-modal-uploader is-opened", ref: el => {
|
|
1180
|
+
if (el)
|
|
1181
|
+
this.contentRefs[index$1] = el;
|
|
1182
|
+
} }, index.h("salla-file-upload", { name: "image", enableGallery: true, maxImagesCount: this.allowAttachImages ? this.MAX_IMAGE_UPLOAD_LIMIT : undefined, maxVideosCount: this.allowAttachVideos ? this.MAX_VIDEO_UPLOAD_LIMIT : undefined, maxVideoFileSize: this.allowAttachVideos ? this.MAX_VIDEO_FILE_SIZE : undefined, maxVideoDuration: this.allowAttachVideos ? this.MAX_VIDEO_DURATION : undefined, maxParallelUploads: this.MAX_PARALLEL_UPLOADS, imagePreviewHeight: 75, filePosterHeight: 75, "instant-upload": true, type: "feedback", payloadName: "files[]", id: `file-${item.product.id}`, title: item.product.name, allowMultiple: true, instantUpload: true, accept: this.getMediaUploadAccept(), url: salla.url.api('upload'), onUploaded: e => {
|
|
1183
|
+
const productId = item.product.id;
|
|
1184
|
+
const nextImages = [...(this.productImages[productId] || []), e.detail];
|
|
943
1185
|
this.productImages = {
|
|
944
1186
|
...this.productImages,
|
|
945
|
-
[
|
|
1187
|
+
[productId]: nextImages,
|
|
946
1188
|
};
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
1189
|
+
const mediaCounts = countMediaByType(nextImages);
|
|
1190
|
+
this.setUploadCount(productId, nextImages.length, mediaCounts.image, mediaCounts.video);
|
|
1191
|
+
syncHiddenMediaInputs(this.hiddenInputs[index$1], this.hiddenVideoInputs[index$1], nextImages);
|
|
1192
|
+
this.scheduleUploaderHeightRefresh();
|
|
950
1193
|
}, onRemoved: e => {
|
|
951
1194
|
const removedId = e.detail;
|
|
952
|
-
|
|
1195
|
+
const productId = item.product.id;
|
|
1196
|
+
if (!removedId || !this.productImages[productId])
|
|
953
1197
|
return;
|
|
1198
|
+
const nextImages = removeUploadedImage(this.productImages[productId], removedId);
|
|
954
1199
|
this.productImages = {
|
|
955
1200
|
...this.productImages,
|
|
956
|
-
[
|
|
1201
|
+
[productId]: nextImages,
|
|
957
1202
|
};
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
1203
|
+
const mediaCounts = countMediaByType(nextImages);
|
|
1204
|
+
this.setUploadCount(productId, nextImages.length, mediaCounts.image, mediaCounts.video);
|
|
1205
|
+
syncHiddenMediaInputs(this.hiddenInputs[index$1], this.hiddenVideoInputs[index$1], nextImages);
|
|
1206
|
+
this.scheduleUploaderHeightRefresh();
|
|
1207
|
+
}, labelIdle: this.getFilepondPlaceholder(), onGalleryUpdated: e => this.handleGalleryCountUpdate(item.product.id, e.detail) }), this.allowAttachImages && (index.h("input", { type: "hidden", name: "images", value: getMediaUrlsByType(this.productImages[item.product.id] || []).images.join(','), ref: el => {
|
|
1208
|
+
if (el)
|
|
1209
|
+
this.hiddenInputs[index$1] = el;
|
|
1210
|
+
} })), this.allowAttachVideos && (index.h("input", { type: "hidden", name: "videos", value: getMediaUrlsByType(this.productImages[item.product.id] || []).videos.join(','), ref: el => {
|
|
1211
|
+
if (el)
|
|
1212
|
+
this.hiddenVideoInputs[index$1] = el;
|
|
1213
|
+
} })), this.renderUploadedImagesCount(item.product.id))))));
|
|
962
1214
|
}
|
|
963
1215
|
renderProductReviewFactors(productId, index$1, options = {}) {
|
|
964
1216
|
const factors = this.productReviewFactors[productId] || [];
|
|
@@ -978,16 +1230,22 @@ const SallaRatingModalV2 = class {
|
|
|
978
1230
|
const normalized = Number(byId ?? byName ?? byIndex);
|
|
979
1231
|
return Number.isNaN(normalized) ? undefined : normalized;
|
|
980
1232
|
};
|
|
981
|
-
return (index.h("div", { class: "s-rating-modal-product-rating-rows", ref: el => this.setupProductRatingAutofill(el, productId) }, index.h("div", { class: "s-rating-modal-product-rating-row s-rating-modal-product-rating-row-main" }, index.h("span", { class: "s-rating-modal-product-factor-name" }, this.overallProductRatingLabel, index.h("span", { class: "s-rating-modal-product-factor-required" }, "*")), index.h("salla-rating-stars", { size: "medium", name: mainRatingName, key: hasMainRating ? `main-rating-${normalizedMainRating}` : 'main-rating-empty', value: hasMainRating ? normalizedMainRating : undefined, editable: hasMainRating, withLabel: true, labelBeforeStars: true, tag: false })), factors.map((factor, factorIndex) => (index.h("div", { class: "s-rating-modal-product-rating-row s-rating-modal-product-factor-row px-3", "data-required": factor.required ? 'true' : 'false', "data-factor-key": this.getFactorKey(factor, factorIndex) }, index.h("input", { type: "hidden", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'name'), value: factor.name }), !!factor.id && (index.h("input", { type: "hidden", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'id'), value: String(factor.id) })), index.h("span", { class: "s-rating-modal-product-factor-name" }, factor.name, factor.required ? index.h("span", { class: "s-rating-modal-product-factor-required" }, "*") : ''), index.h("salla-rating-stars", { size: "medium", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'rating'), key: `factor-rating-${factor.id ?? factorIndex}-${getPrefilledFactorRating(factor, factorIndex) ?? 0}`, value: getPrefilledFactorRating(factor, factorIndex), editable: options.alwaysEditable ||
|
|
1233
|
+
return (index.h("div", { class: "s-rating-modal-product-rating-rows", ref: el => el && this.setupProductRatingAutofill(el, productId) }, index.h("div", { class: "s-rating-modal-product-rating-row s-rating-modal-product-rating-row-main" }, index.h("span", { class: "s-rating-modal-product-factor-name" }, this.overallProductRatingLabel, index.h("span", { class: "s-rating-modal-product-factor-required" }, "*")), index.h("salla-rating-stars", { size: "medium", name: mainRatingName, key: hasMainRating ? `main-rating-${normalizedMainRating}` : 'main-rating-empty', value: hasMainRating ? normalizedMainRating : undefined, editable: hasMainRating, withLabel: true, labelBeforeStars: true, tag: false })), factors.map((factor, factorIndex) => (index.h("div", { class: "s-rating-modal-product-rating-row s-rating-modal-product-factor-row px-3", "data-required": factor.required ? 'true' : 'false', "data-factor-key": this.getFactorKey(factor, factorIndex) }, index.h("input", { type: "hidden", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'name'), value: factor.name }), !!factor.id && (index.h("input", { type: "hidden", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'id'), value: String(factor.id) })), index.h("span", { class: "s-rating-modal-product-factor-name" }, factor.name, factor.required ? index.h("span", { class: "s-rating-modal-product-factor-required" }, "*") : ''), index.h("salla-rating-stars", { size: "medium", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'rating'), key: `factor-rating-${factor.id ?? factorIndex}-${getPrefilledFactorRating(factor, factorIndex) ?? 0}`, value: getPrefilledFactorRating(factor, factorIndex), editable: options.alwaysEditable ||
|
|
982
1234
|
typeof getPrefilledFactorRating(factor, factorIndex) === 'number', withLabel: true, labelBeforeStars: true, tag: false }))))));
|
|
983
1235
|
}
|
|
984
1236
|
handleSendEmail() {
|
|
1237
|
+
if (!this.order) {
|
|
1238
|
+
return;
|
|
1239
|
+
}
|
|
985
1240
|
const subject = `${this.contactSubjectLabel} #${this.order.id}`;
|
|
986
1241
|
const body = this.contact_body(salla.config.get('store.name'), this.order.id, this.getCustomerName());
|
|
987
1242
|
const mailtoLink = `mailto:${salla.config.get('store.contacts.email')}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;
|
|
988
1243
|
window.open(mailtoLink, '_blank');
|
|
989
1244
|
}
|
|
990
1245
|
handleSendWhatsApp() {
|
|
1246
|
+
if (!this.order) {
|
|
1247
|
+
return;
|
|
1248
|
+
}
|
|
991
1249
|
const body = this.contact_body(salla.config.get('store.name'), this.order.id, this.getCustomerName());
|
|
992
1250
|
const whatsappLink = `https://wa.me/${salla.config.get('store.contacts.whatsapp')}?text=${encodeURIComponent(body)}`;
|
|
993
1251
|
window.open(whatsappLink, '_blank');
|
|
@@ -1005,9 +1263,16 @@ const SallaRatingModalV2 = class {
|
|
|
1005
1263
|
this.productFactorRatings = {};
|
|
1006
1264
|
this.editMainRating = undefined;
|
|
1007
1265
|
this.userFilledFactorKeys = {};
|
|
1266
|
+
this.uploadingByProductId = {};
|
|
1267
|
+
this.hasUploadsInProgress = false;
|
|
1008
1268
|
this.hiddenInputs[1] && (this.hiddenInputs[1].value = '');
|
|
1009
|
-
this.
|
|
1010
|
-
this.
|
|
1269
|
+
this.editHiddenVideosInput && (this.editHiddenVideosInput.value = '');
|
|
1270
|
+
if (this.body) {
|
|
1271
|
+
this.body.style.height = '';
|
|
1272
|
+
this.body.style.minHeight = '';
|
|
1273
|
+
}
|
|
1274
|
+
this.deleteFeedbackId = undefined;
|
|
1275
|
+
this.editFeedbackId = undefined;
|
|
1011
1276
|
this.shouldOpenDeleteModal = false;
|
|
1012
1277
|
this.editMode = false;
|
|
1013
1278
|
this.deleteMode = false;
|
|
@@ -1018,37 +1283,90 @@ const SallaRatingModalV2 = class {
|
|
|
1018
1283
|
this.loyaltyImageRatingPoints = 0;
|
|
1019
1284
|
}
|
|
1020
1285
|
getDeleteModal() {
|
|
1021
|
-
return (index.h("salla-modal", { ref: modal =>
|
|
1286
|
+
return (index.h("salla-modal", { ref: modal => {
|
|
1287
|
+
if (modal)
|
|
1288
|
+
this.deleteModal = modal;
|
|
1289
|
+
}, width: "xs", onModalVisibilityChanged: isOpen => this.resetData(isOpen) }, index.h("div", { class: "s-rating-modal-delete-wrapper", ref: el => {
|
|
1290
|
+
if (el)
|
|
1291
|
+
this.body = el;
|
|
1292
|
+
} }, index.h("h3", null, this.confirmDeletionLabel), index.h("p", null, this.areYouSureLabel), index.h("div", { class: "s-rating-modal-delete-actions" }, index.h("salla-button", { loaderPosition: "center", onClick: () => this.deleteReview() }, this.confirmDeleteBtn), index.h("salla-button", { color: "danger", fill: "outline", onClick: () => this.deleteModal?.close() }, this.cancelLabel)))));
|
|
1022
1293
|
}
|
|
1023
1294
|
renderUploadedImagesCount(productId) {
|
|
1024
|
-
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1295
|
+
const items = this.editMode ? this.editItemImages : this.productImages[productId] || [];
|
|
1296
|
+
const mediaCounts = countMediaByType(items);
|
|
1297
|
+
const imageCount = this.uploadImageCounts[productId] ?? mediaCounts.image;
|
|
1298
|
+
const videoCount = this.uploadVideoCounts[productId] ?? mediaCounts.video;
|
|
1299
|
+
if (this.allowAttachImages && this.allowAttachVideos) {
|
|
1300
|
+
return (index.h("span", { class: "s-rating-modal-upload-count" }, salla.lang.get('pages.rating.media_count', {
|
|
1301
|
+
imageCurrent: imageCount,
|
|
1302
|
+
imageTotal: this.MAX_IMAGE_UPLOAD_LIMIT,
|
|
1303
|
+
videoCurrent: videoCount,
|
|
1304
|
+
videoTotal: this.MAX_VIDEO_UPLOAD_LIMIT,
|
|
1305
|
+
})));
|
|
1306
|
+
}
|
|
1307
|
+
if (this.allowAttachImages) {
|
|
1308
|
+
return (index.h("span", { class: "s-rating-modal-upload-count" }, salla.lang.choice('pages.rating.images_count', imageCount, {
|
|
1309
|
+
current: imageCount,
|
|
1310
|
+
total: this.MAX_IMAGE_UPLOAD_LIMIT,
|
|
1311
|
+
})));
|
|
1312
|
+
}
|
|
1313
|
+
if (this.allowAttachVideos) {
|
|
1314
|
+
return (index.h("span", { class: "s-rating-modal-upload-count" }, salla.lang.choice('pages.rating.videos_count', videoCount, {
|
|
1315
|
+
current: videoCount,
|
|
1316
|
+
total: this.MAX_VIDEO_UPLOAD_LIMIT,
|
|
1317
|
+
})));
|
|
1318
|
+
}
|
|
1319
|
+
return null;
|
|
1032
1320
|
}
|
|
1033
1321
|
getEditModal() {
|
|
1034
|
-
return (index.h("salla-modal", { ref: modal =>
|
|
1322
|
+
return (index.h("salla-modal", { ref: modal => {
|
|
1323
|
+
if (modal)
|
|
1324
|
+
this.editModal = modal;
|
|
1325
|
+
}, width: "md", onModalVisibilityChanged: isOpen => this.resetData(isOpen) }, index.h("div", { class: "s-rating-modal-edit-wrapper", ref: el => {
|
|
1326
|
+
if (el)
|
|
1327
|
+
this.body = el;
|
|
1328
|
+
} }, this.editType === 'store' && this.editItem ? (index.h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step", "data-type": "store", ref: currentTab => {
|
|
1329
|
+
if (currentTab)
|
|
1330
|
+
this.currentTab = currentTab;
|
|
1331
|
+
} }, index.h("div", { class: "s-rating-modal-rounded-icon" }, index.h("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" })), index.h("h2", { class: "s-rating-modal-title" }, salla.lang.get('pages.rating.rate_the_store')), index.h("div", { class: "s-rating-modal-stars-company" }, index.h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), index.h("textarea", { name: "content", value: this.editItem.content, class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), index.h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType === 'shipping' && this.editItem ? (index.h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step", "data-type": "shipping", ref: currentTab => {
|
|
1332
|
+
if (currentTab)
|
|
1333
|
+
this.currentTab = currentTab;
|
|
1334
|
+
} }, this.editItem.shipping.logo ? (index.h("div", { class: "s-rating-modal-rounded-icon" }, index.h("img", { src: this.editItem.shipping.logo, class: "s-rating-modal-shipping-logo", alt: this.editItem.shipping.name }))) : (index.h("span", { class: "s-rating-modal-icon", innerHTML: shippingFast.ShippingFast })), index.h("div", { class: "s-rating-modal-title" }, ' ', `${salla.lang.get('pages.rating.rate_shipping')} ${this.editItem.shipping.name}`), index.h("div", { class: "s-rating-modal-stars-company" }, index.h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), index.h("textarea", { name: "content", class: "s-rating-modal-comment", value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), index.h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType == 'product' && this.editItem ? (index.h("section", { class: "s-rating-modal-step", "data-type": "products", ref: currentTab => {
|
|
1335
|
+
if (currentTab)
|
|
1336
|
+
this.currentTab = currentTab;
|
|
1337
|
+
} }, index.h("div", { class: "s-rating-modal-product" }, this.allowAttachImages && this.loyaltyPointsNote(), index.h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, index.h("div", { class: "s-rating-modal-product-details" }, index.h("div", { class: "s-rating-modal-product-info-row" }, index.h("div", { class: "s-rating-modal-product-img-wrap" }, index.h("img", { src: this.editItem.product.image.url, alt: this.editItem.product.name, class: "s-rating-modal-product-img" })), index.h("h3", { class: "s-rating-modal-product-title" }, this.editItem.product.name)), this.renderProductReviewFactors(this.editItem.product.id, 0, {
|
|
1035
1338
|
fieldPrefix: '',
|
|
1036
1339
|
mainRating: this.editMainRating ?? Number(this.editItem.stars ?? this.editItem.rating),
|
|
1037
1340
|
factorRatings: this.editFactorRatings,
|
|
1038
1341
|
alwaysEditable: true,
|
|
1039
|
-
}), index.h("input", { type: "hidden", name: "product_id", value: this.editItem.product.id }), index.h("textarea", { value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_product_rate'), name: "comment", class: "s-rating-modal-comment" }), index.h("small", { class: "s-rating-modal-validation-msg" }))), this.
|
|
1342
|
+
}), index.h("input", { type: "hidden", name: "product_id", value: this.editItem.product.id }), index.h("textarea", { value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_product_rate'), name: "comment", class: "s-rating-modal-comment" }), index.h("small", { class: "s-rating-modal-validation-msg" }))), this.canAttachMedia() && (index.h("div", { class: "s-rating-modal-uploader is-opened", ref: el => {
|
|
1343
|
+
if (el)
|
|
1344
|
+
this.contentRefs[1] = el;
|
|
1345
|
+
} }, index.h("salla-file-upload", { name: "images", allowMultiple: true, enableGallery: true, maxImagesCount: this.allowAttachImages ? this.MAX_IMAGE_UPLOAD_LIMIT : undefined, maxVideosCount: this.allowAttachVideos ? this.MAX_VIDEO_UPLOAD_LIMIT : undefined, maxVideoFileSize: this.allowAttachVideos ? this.MAX_VIDEO_FILE_SIZE : undefined, maxVideoDuration: this.allowAttachVideos ? this.MAX_VIDEO_DURATION : undefined, maxParallelUploads: this.MAX_PARALLEL_UPLOADS, imagePreviewHeight: 75, filePosterHeight: 75, "instant-upload": true, type: "feedback", files: JSON.stringify(this.editItemImages), payloadName: "files[]", id: `file-${this.editItem.product.id}`, title: this.editItem.product.name, instantUpload: true, accept: this.getMediaUploadAccept(), url: salla.url.api('upload'), onUploaded: e => {
|
|
1040
1346
|
this.editItemImages = [
|
|
1041
1347
|
...this.editItemImages,
|
|
1042
1348
|
e.detail,
|
|
1043
1349
|
];
|
|
1044
|
-
|
|
1350
|
+
const mediaCounts = countMediaByType(this.editItemImages);
|
|
1351
|
+
this.setUploadCount(this.editItem.product.id, this.editItemImages.length, mediaCounts.image, mediaCounts.video);
|
|
1352
|
+
syncHiddenMediaInputs(this.hiddenInputs[1], this.editHiddenVideosInput, this.editItemImages);
|
|
1353
|
+
this.scheduleUploaderHeightRefresh();
|
|
1045
1354
|
}, onRemoved: e => {
|
|
1046
1355
|
const removedId = e.detail;
|
|
1047
1356
|
if (!removedId)
|
|
1048
1357
|
return;
|
|
1049
|
-
this.editItemImages = this.editItemImages
|
|
1050
|
-
|
|
1051
|
-
|
|
1358
|
+
this.editItemImages = removeUploadedImage(this.editItemImages, removedId);
|
|
1359
|
+
const mediaCounts = countMediaByType(this.editItemImages);
|
|
1360
|
+
this.setUploadCount(this.editItem.product.id, this.editItemImages.length, mediaCounts.image, mediaCounts.video);
|
|
1361
|
+
syncHiddenMediaInputs(this.hiddenInputs[1], this.editHiddenVideosInput, this.editItemImages);
|
|
1362
|
+
this.scheduleUploaderHeightRefresh();
|
|
1363
|
+
}, labelIdle: this.getFilepondPlaceholder(), onGalleryUpdated: e => this.handleGalleryCountUpdate(this.editItem.product.id, e.detail) }), this.allowAttachImages && (index.h("input", { type: "hidden", name: "images", value: getMediaUrlsByType(this.editItemImages).images.join(','), ref: el => {
|
|
1364
|
+
if (el)
|
|
1365
|
+
this.hiddenInputs[1] = el;
|
|
1366
|
+
} })), this.allowAttachVideos && (index.h("input", { type: "hidden", name: "videos", value: getMediaUrlsByType(this.editItemImages).videos.join(','), ref: el => {
|
|
1367
|
+
if (el)
|
|
1368
|
+
this.editHiddenVideosInput = el;
|
|
1369
|
+
} })), this.renderUploadedImagesCount(this.editItem.product.id)))))) : null, index.h("div", { class: "s-rating-modal-footer s-rating-modal-footer-end" }, index.h("salla-button", { "loader-position": "center", loading: this.hasUploadsInProgress, disabled: this.hasUploadsInProgress, onClick: () => this.editReview() }, this.editReviewLabel)))));
|
|
1052
1370
|
}
|
|
1053
1371
|
render() {
|
|
1054
1372
|
if (this.deleteMode) {
|
|
@@ -1058,14 +1376,32 @@ const SallaRatingModalV2 = class {
|
|
|
1058
1376
|
return index.h(index.Host, { class: "s-rating-modal" }, this.getEditModal());
|
|
1059
1377
|
}
|
|
1060
1378
|
if (this.defaultMode) {
|
|
1061
|
-
return (index.h(index.Host, { class: "s-rating-modal" }, index.h("salla-modal", { class: "s-rating-modal-wrap", onModalVisibilityChanged: isOpen => this.resetData(isOpen), isLoading: true, width: "md", ref: modal =>
|
|
1062
|
-
|
|
1063
|
-
|
|
1379
|
+
return (index.h(index.Host, { class: "s-rating-modal" }, index.h("salla-modal", { class: "s-rating-modal-wrap", onModalVisibilityChanged: isOpen => this.resetData(isOpen), isLoading: true, width: "md", ref: modal => {
|
|
1380
|
+
if (modal)
|
|
1381
|
+
this.modal = modal;
|
|
1382
|
+
} }, index.h("div", { slot: "loading" }, index.h("div", { class: "s-rating-modal-skeleton" }, index.h("salla-skeleton", { type: "circle", height: "80px", width: "80px" }), index.h("salla-skeleton", { height: "15px", width: "60%" }), index.h("salla-skeleton", { height: "10px", width: "30%" }), index.h("div", { class: "s-rating-modal-skeleton-stars" }, [...Array(5)].map(v => (index.h("div", { key: v, innerHTML: star.Star })))), index.h("salla-skeleton", { height: "100px", width: "100%" }), index.h("div", { class: "s-rating-modal-skeleton-footer" }, index.h("salla-skeleton", { height: "40px", width: "30%" })))), !this.hasError && this.order ? ([
|
|
1383
|
+
index.h("div", { class: "s-rating-modal-wrapper", ref: el => {
|
|
1384
|
+
if (el)
|
|
1385
|
+
this.body = el;
|
|
1386
|
+
} }, this.isTestimonialsEnabled() ? (index.h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "store" }, index.h("div", { class: "s-rating-modal-rounded-icon" }, index.h("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" })), index.h("h2", { class: "s-rating-modal-title" }, salla.lang.get('pages.rating.rate_the_store')), index.h("div", { class: "s-rating-modal-stars-company" }, index.h("salla-rating-stars", { withLabel: true, size: "large" })), index.h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), index.h("small", { class: "s-rating-modal-validation-msg" }))) : (''), this.isProductsEnabled() &&
|
|
1387
|
+
this.getRateableProducts().map((item, index) => this.renderProductStep(item, index)), this.isShippingEnabled() && this.order.shipping?.company ? (index.h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "shipping" }, index.h("input", { type: "hidden", name: "shipping_company_id", value: this.order.shipping.company.id }), this.order.shipping.company.logo ? (index.h("div", { class: "s-rating-modal-rounded-icon" }, index.h("img", { src: this.order.shipping.company.logo, class: "s-rating-modal-shipping-logo", alt: this.order.shipping.company.name }))) : (index.h("span", { class: "s-rating-modal-icon", innerHTML: shippingFast.ShippingFast })), index.h("div", { class: "s-rating-modal-title" }, ' ', `${salla.lang.get('pages.rating.rate_shipping')} ${this.order.shipping.company.name}`), index.h("div", { class: "s-rating-modal-stars-company" }, index.h("salla-rating-stars", { withLabel: true, size: "large" })), index.h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), index.h("small", { class: "s-rating-modal-validation-msg" }))) : (''), index.h("div", { class: "s-rating-modal-thanks s-rating-modal-hidden", ref: el => {
|
|
1388
|
+
if (el)
|
|
1389
|
+
this.thanksTab = el;
|
|
1390
|
+
} }, index.h("span", { class: "s-rating-modal-icon", innerHTML: checkCircle2.CheckCircle2 }), index.h("h3", { class: "s-rating-modal-thanks-title" }, salla.lang.get('pages.rating.thanks')), index.h("div", { class: "s-rating-modal-thanks-msg", innerHTML: this.order.thanks_message }), index.h("time", { class: "s-rating-modal-thanks-time", ref: el => {
|
|
1391
|
+
if (el)
|
|
1392
|
+
this.thanksTime = el;
|
|
1393
|
+
} }))),
|
|
1064
1394
|
this.allowContactSupport &&
|
|
1065
1395
|
this.showContactWidget &&
|
|
1066
1396
|
(salla.config.get('store.contacts.whatsapp') ||
|
|
1067
1397
|
salla.config.get('store.contacts.email')) ? (index.h("div", { class: "s-rating-modal-contact" }, index.h("p", null, this.contactUsLabel), index.h("div", { class: "s-rating-modal-contact-icons" }, salla.config.get('store.contacts.whatsapp') && (index.h("span", { onClick: () => this.handleSendWhatsApp(), innerHTML: whatsapp2.WhatsappIcon })), salla.config.get('store.contacts.email') && (index.h("span", { onClick: () => this.handleSendEmail(), innerHTML: mail.email }))))) : (''),
|
|
1068
|
-
index.h("div", { class: "s-rating-modal-footer" }, index.h("button", { ref: el =>
|
|
1398
|
+
index.h("div", { class: "s-rating-modal-footer" }, index.h("button", { ref: el => {
|
|
1399
|
+
if (el)
|
|
1400
|
+
this.backBtn = el;
|
|
1401
|
+
}, onClick: () => this.previousTab(), class: "s-rating-modal-btn s-rating-modal-unvisiable" }, salla.lang.get('common.elements.back')), this.stepsCount > 1 ? (index.h("ul", { class: "s-rating-modal-dots" }, [...Array(this.stepsCount)].map((_, v) => (index.h("li", { key: v, class: "s-rating-modal-bg-gray s-rating-modal-step-dot" }))))) : (''), index.h("salla-button", { "loader-position": "center", loading: this.hasUploadsInProgress, disabled: this.hasUploadsInProgress, ref: el => {
|
|
1402
|
+
if (el)
|
|
1403
|
+
this.nextBtn = el;
|
|
1404
|
+
}, onClick: () => this.submit() }, salla.lang.get('common.elements.next'))),
|
|
1069
1405
|
]) : (index.h("salla-placeholder", { alignment: "center" })))));
|
|
1070
1406
|
}
|
|
1071
1407
|
}
|