@salla.sa/twilight-components 2.14.540 → 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-U8F_iDbp.js → filepond-CNdvfaMJ.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-CAJAmCHU.js → filepond-plugin-file-poster-Di_D3w89.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-Dxgl8Gdz.js → filepond-plugin-file-validate-size-BiRa98qd.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-BPhw8zXs.js → filepond-plugin-file-validate-type-Bolv-kyJ.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-DNKfSuCy.js → filepond-plugin-image-edit-AN6huMV9.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-NCmUtKOd.js → filepond-plugin-image-exif-orientation-Bwa8QtGo.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-jRCd9jSG.js → filepond-plugin-image-preview-CaVYLAvG.js} +1 -1
- package/dist/cjs/helpers-ClOJIAG8.js +89 -0
- package/dist/cjs/{index-F_FURF-0.js → index-DX2EKTCE.js} +18 -14
- package/dist/cjs/{intlTelInput-yt9noy9U.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 +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +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-DXgSpklI.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-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-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-Bxzb6RRZ.js → filepond-CKsbRWmS.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-CZfrjnEX.js → filepond-plugin-file-poster-B_gYCESq.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-Dqa69lX7.js → filepond-plugin-file-validate-size-Bep6fNi3.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-C_76nxDb.js → filepond-plugin-file-validate-type-r3uRmGIr.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-BvzVMeMY.js → filepond-plugin-image-edit-BJcOlOFL.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-Br4ANTi7.js → filepond-plugin-image-exif-orientation-DJoDaRwQ.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-e54xZ08P.js → filepond-plugin-image-preview-BsuTLPS0.js} +1 -1
- package/dist/esm/helpers-DqXpn47Z.js +85 -0
- package/dist/esm/{index-5UtJVEzd.js → index-BVqCTDsV.js} +18 -14
- package/dist/esm/{intlTelInput-BQXch__5.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 +1 -1
- package/dist/esm/salla-count-down.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +1 -1
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner_10.entry.js +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-lLULIehu.js → vanilla-picker-Ba_za9Iy.js} +1 -1
- package/dist/twilight/{p-1c66fdb3.entry.js → p-003499a8.entry.js} +1 -1
- package/dist/twilight/{p-0bc1c246.entry.js → p-0974f6c6.entry.js} +1 -1
- package/dist/twilight/{p-1578cbe5.entry.js → p-0a9093f1.entry.js} +1 -1
- package/dist/twilight/{p-ad54610c.entry.js → p-0ce2c41f.entry.js} +1 -1
- package/dist/twilight/{p-acd1a9d8.entry.js → p-0ea8365b.entry.js} +1 -1
- package/dist/twilight/p-1174e53e.entry.js +4 -0
- package/dist/twilight/{p-d8a69feb.entry.js → p-11ef8b82.entry.js} +1 -1
- package/dist/twilight/{p-5cbbf472.entry.js → p-13244c52.entry.js} +1 -1
- package/dist/twilight/{p-9af31040.entry.js → p-14689252.entry.js} +1 -1
- package/dist/twilight/{p-397acd73.entry.js → p-17940d8a.entry.js} +1 -1
- package/dist/twilight/{p-40a0baa7.entry.js → p-1974f6da.entry.js} +1 -1
- package/dist/twilight/{p-02e821a0.entry.js → p-1a191989.entry.js} +1 -1
- package/dist/twilight/{p-900ee42a.entry.js → p-1ec6e0fe.entry.js} +1 -1
- package/dist/twilight/{p-3af52c82.entry.js → p-1fcebaad.entry.js} +1 -1
- package/dist/twilight/{p-6c4cef7a.entry.js → p-2b0cf190.entry.js} +1 -1
- package/dist/twilight/{p-7e9d67f2.entry.js → p-333ea76b.entry.js} +1 -1
- package/dist/twilight/{p-d6b6f984.entry.js → p-337cc9f6.entry.js} +1 -1
- package/dist/twilight/{p-71731e63.entry.js → p-34d5c7bf.entry.js} +1 -1
- package/dist/twilight/{p-49c2e935.entry.js → p-36abc50f.entry.js} +1 -1
- package/dist/twilight/{p-e6007706.entry.js → p-37d9f762.entry.js} +1 -1
- package/dist/twilight/{p-891009e2.entry.js → p-3961522a.entry.js} +1 -1
- package/dist/twilight/{p-b5c90151.entry.js → p-39d9e02f.entry.js} +1 -1
- package/dist/twilight/{p-088c1ab3.entry.js → p-3a4bb8de.entry.js} +1 -1
- package/dist/twilight/{p-538a1642.entry.js → p-409f95a8.entry.js} +1 -1
- package/dist/twilight/{p-fb2c863d.entry.js → p-42952fac.entry.js} +1 -1
- package/dist/twilight/{p-913d4965.entry.js → p-436dfe93.entry.js} +1 -1
- package/dist/twilight/{p-ed9899c0.entry.js → p-50c90e0a.entry.js} +1 -1
- package/dist/twilight/{p-ce941081.entry.js → p-5115117b.entry.js} +1 -1
- package/dist/twilight/{p-693d012f.entry.js → p-56647774.entry.js} +1 -1
- package/dist/twilight/{p-18d7763b.entry.js → p-598cadf4.entry.js} +1 -1
- package/dist/twilight/{p-66313db6.entry.js → p-635265d1.entry.js} +1 -1
- package/dist/twilight/{p-95224232.entry.js → p-659e2280.entry.js} +1 -1
- package/dist/twilight/{p-6757a647.entry.js → p-6a3487de.entry.js} +1 -1
- package/dist/twilight/{p-582247b3.entry.js → p-6d07d195.entry.js} +1 -1
- package/dist/twilight/{p-8dab94d8.entry.js → p-6ee096e8.entry.js} +1 -1
- package/dist/twilight/{p-c138132c.entry.js → p-723aeda4.entry.js} +1 -1
- package/dist/twilight/{p-c8c36233.entry.js → p-743b79ae.entry.js} +1 -1
- package/dist/twilight/{p-5f1b8510.entry.js → p-75e692d1.entry.js} +1 -1
- package/dist/twilight/{p-0895958b.entry.js → p-79444897.entry.js} +1 -1
- package/dist/twilight/{p-4e2e4e92.entry.js → p-7b23dec7.entry.js} +1 -1
- package/dist/twilight/p-7bb24ad6.entry.js +4 -0
- package/dist/twilight/{p-4c34e1fd.entry.js → p-7d9288b0.entry.js} +1 -1
- package/dist/twilight/{p-0ecbe43b.entry.js → p-85f95a58.entry.js} +1 -1
- package/dist/twilight/{p-2a9a4e12.entry.js → p-86a1f616.entry.js} +1 -1
- package/dist/twilight/{p-1bc7ab28.entry.js → p-87115499.entry.js} +1 -1
- package/dist/twilight/{p-497cc3a6.entry.js → p-878c2be2.entry.js} +1 -1
- package/dist/twilight/{p-524aabd2.entry.js → p-89e9a91f.entry.js} +1 -1
- package/dist/twilight/{p-f3771ebc.entry.js → p-90ee37c7.entry.js} +1 -1
- package/dist/twilight/{p-e4cb5ee8.entry.js → p-96584590.entry.js} +1 -1
- package/dist/twilight/{p-3136d942.entry.js → p-96a57e9c.entry.js} +1 -1
- package/dist/twilight/{p-7a17138f.entry.js → p-978e4164.entry.js} +1 -1
- package/dist/twilight/{p-b9b32feb.entry.js → p-97fc57c1.entry.js} +1 -1
- package/dist/twilight/p-98b1ff35.entry.js +4 -0
- package/dist/twilight/{p-5a26fb06.entry.js → p-9d18525b.entry.js} +1 -1
- package/dist/twilight/p-B83s3cRn.js +9 -0
- package/dist/twilight/{p-5UtJVEzd.js → p-BVqCTDsV.js} +1 -1
- package/dist/twilight/{p-5njrWPq2.js → p-CP29f7RQ.js} +2 -2
- package/dist/twilight/{p-CXv4fDWa.js → p-CS-t4QAX.js} +1 -1
- package/dist/twilight/{p-1YJa6YaH.js → p-Cluq3aDa.js} +1 -1
- package/dist/twilight/{p-yEKxvrPt.js → p-D-zqM6k8.js} +1 -1
- package/dist/twilight/{p-Dke2dnYe.js → p-DJmqmO68.js} +1 -1
- package/dist/twilight/{p-CkJpLPBM.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-Cf5WZwC9.js → p-DzW3U8TR.js} +1 -1
- package/dist/twilight/{p-Dso9PQdO.js → p-JKh0XFIn.js} +1 -1
- package/dist/twilight/{p-64ee420e.entry.js → p-a347e701.entry.js} +1 -1
- package/dist/twilight/{p-271a2d55.entry.js → p-a5d08af6.entry.js} +1 -1
- package/dist/twilight/{p-fbb156e8.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-3b0032e4.entry.js → p-b6d5ae9b.entry.js} +1 -1
- package/dist/twilight/{p-2d62c356.entry.js → p-b862c670.entry.js} +1 -1
- package/dist/twilight/{p-4e71dacc.entry.js → p-bab59319.entry.js} +1 -1
- package/dist/twilight/{p-16c09de9.entry.js → p-bf4c2184.entry.js} +1 -1
- package/dist/twilight/{p-b9477568.entry.js → p-c19cf93c.entry.js} +1 -1
- package/dist/twilight/{p-b16c1eac.entry.js → p-c34f8c08.entry.js} +1 -1
- package/dist/twilight/{p-d4e1a8f7.entry.js → p-c47ecca7.entry.js} +1 -1
- package/dist/twilight/{p-46d2375b.entry.js → p-c48f5c6b.entry.js} +1 -1
- package/dist/twilight/{p-1c049149.entry.js → p-c53c2f59.entry.js} +1 -1
- package/dist/twilight/{p-f5747d3c.entry.js → p-cd805a38.entry.js} +1 -1
- package/dist/twilight/{p-ac9a54cc.entry.js → p-cdd8ed7f.entry.js} +1 -1
- package/dist/twilight/{p-02df1c31.entry.js → p-ced4b7ac.entry.js} +1 -1
- package/dist/twilight/{p-21e9a475.entry.js → p-cf3365e2.entry.js} +1 -1
- package/dist/twilight/p-d78998b7.entry.js +4 -0
- package/dist/twilight/{p-bb7bc52f.entry.js → p-daea3207.entry.js} +1 -1
- package/dist/twilight/{p-6e766b2a.entry.js → p-dff6d623.entry.js} +1 -1
- package/dist/twilight/p-e04221de.entry.js +4 -0
- package/dist/twilight/{p-66448f0f.entry.js → p-e2934193.entry.js} +1 -1
- package/dist/twilight/{p-a9e276fa.entry.js → p-e3dab961.entry.js} +1 -1
- package/dist/twilight/{p-73607393.entry.js → p-e41e5fc7.entry.js} +1 -1
- package/dist/twilight/{p-fe222cbe.entry.js → p-e4c9cef4.entry.js} +1 -1
- package/dist/twilight/{p-a5afb821.entry.js → p-eaf9d536.entry.js} +1 -1
- package/dist/twilight/{p-c05513ae.entry.js → p-ee2b16d7.entry.js} +1 -1
- package/dist/twilight/{p-c224fa3a.entry.js → p-ee3ddc23.entry.js} +1 -1
- package/dist/twilight/{p-963d34af.entry.js → p-f0a14b18.entry.js} +1 -1
- package/dist/twilight/{p-4cff8533.entry.js → p-f195a63d.entry.js} +1 -1
- package/dist/twilight/{p-200a9c11.entry.js → p-f2c688d6.entry.js} +1 -1
- package/dist/twilight/{p-b7f1bad9.entry.js → p-f4ac8cae.entry.js} +1 -1
- package/dist/twilight/{p-1ee008c3.entry.js → p-f58d14ed.entry.js} +1 -1
- package/dist/twilight/{p-d505caaf.entry.js → p-f82cee0c.entry.js} +1 -1
- package/dist/twilight/{p-b639f062.entry.js → p-fa17989b.entry.js} +1 -1
- package/dist/twilight/{p-575b3b4c.entry.js → p-fbc075fe.entry.js} +1 -1
- package/dist/twilight/{p-f27472f4.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-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 +282 -7
- package/package.json +5 -5
- package/dist/twilight/p-3024f859.entry.js +0 -4
- package/dist/twilight/p-3b821dc9.entry.js +0 -4
- package/dist/twilight/p-4dabd999.entry.js +0 -4
- package/dist/twilight/p-WDLGvEaR.js +0 -9
- package/dist/twilight/p-aaa37ca1.entry.js +0 -4
- package/dist/twilight/p-dcf53c45.entry.js +0 -4
- package/dist/twilight/p-f17fa83f.entry.js +0 -4
- package/dist/components/{keyboard_arrow_right.js → keyboard_arrow_left.js} +6 -6
package/dist/cjs/{salla-booking-field_7.cjs.entry.js → salla-attachment-view_9.cjs.entry.js}
RENAMED
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-DX2EKTCE.js');
|
|
7
|
+
var uploadLimits = require('./upload-limits-C3RarAPN.js');
|
|
7
8
|
var calendar = require('./calendar-D-PUoCDH.js');
|
|
8
9
|
var keyboard_arrow_down = require('./keyboard_arrow_down-DHJ3FFZq.js');
|
|
10
|
+
var cancel = require('./cancel-De6vslRA.js');
|
|
9
11
|
var minus = require('./minus-CCryh1qf.js');
|
|
10
12
|
var Helper = require('./Helper-6RI07gZo.js');
|
|
11
13
|
require('./anime.es-BqW8JHZi.js');
|
|
@@ -28,6 +30,333 @@ function _interopNamespace(e) {
|
|
|
28
30
|
return Object.freeze(n);
|
|
29
31
|
}
|
|
30
32
|
|
|
33
|
+
var PlayIcon = `<!-- Generated by IcoMoon.io -->
|
|
34
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
35
|
+
<title>play-circle</title>
|
|
36
|
+
<path d="M22.84 13.833l-7.756-5.331c-0.884-0.607-2.021-0.671-2.977-0.169-0.888 0.469-1.44 1.363-1.44 2.336v10.661c0 0.972 0.552 1.868 1.441 2.336 0.425 0.224 0.889 0.335 1.351 0.335 0.571 0 1.137-0.169 1.625-0.505l7.756-5.331c0.727-0.499 1.16-1.308 1.16-2.165s-0.433-1.667-1.16-2.167zM13.573 21.299c-0.093 0.065-0.196 0.025-0.229 0.027-0.007 0-0.011 0.001-0.011 0.007v-10.627c0.040-0.028 0.141-0.069 0.24-0.003l7.756 5.267zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>
|
|
37
|
+
</svg>
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
const sallaAttachmentViewCss = "/*!twlt*/.s-attachment-view-modal-host .s-modal-header{display:flex;flex-direction:row;align-items:center;position:relative;min-height:2.75rem}.s-attachment-view-modal-host .s-modal-close{top:50%;transform:translateY(-50%)}.s-attachment-view-modal-host .s-modal-header-inner{display:flex !important;align-items:center;justify-content:center;width:100%;margin-bottom:0;text-align:start;padding-inline:2.75rem}@media (min-width: 768px){.s-attachment-view-modal-host .s-modal-header-inner{justify-content:flex-start;padding:0 1.5rem !important;margin-top:0.5rem}}.s-attachment-view-modal-host .s-modal-header-content,.s-attachment-view-modal-host .s-modal-title{text-align:center !important}@media (min-width: 768px){.s-attachment-view-modal-host .s-modal-header-content,.s-attachment-view-modal-host .s-modal-title{text-align:start !important}}.s-attachment-view-modal-host .s-modal-title{margin-bottom:0}@media (min-width: 768px){.s-attachment-view-modal-host .s-modal-title{margin-bottom:0.5rem}}.s-attachment-view-modal{--s-attachment-view-thumb-size:2.5rem;--s-attachment-view-thumb-gap:10px;width:100%;padding:0.75rem}.s-attachment-view-modal .s-slider-block__title-nav button{background:#fff;box-shadow:0 1px 3px rgba(0, 0, 0, 0.12)}.s-attachment-view-gallery{width:100%}.s-attachment-view-thumbs{display:flex;gap:var(--s-attachment-view-thumb-gap);margin-top:0.75rem;padding-bottom:0.25rem;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}.s-attachment-view-thumb-btn{flex:0 0 auto;padding:0;border:none;background:transparent;cursor:pointer;border-radius:0.25rem;transition:opacity 0.2s ease}.s-attachment-view-thumb-btn:not(.is-active){opacity:0.75}.s-attachment-view-thumb-btn:hover{opacity:1}.s-attachment-view-thumb-btn.is-active .s-attachment-view-thumb{box-shadow:0 0 0 2px var(--color-primary, #004d5a)}.s-attachment-view-slider .s-slider-container .swiper-slide{display:flex;align-items:center;justify-content:center}.s-attachment-view-slider .s-slider-container .s-attachment-view-slide{display:flex;align-items:center;justify-content:center;width:100%}.s-attachment-view-slider .s-slider-container img{width:100%;max-width:100%;height:min(50vh, 320px);object-fit:contain;margin-inline:auto}.s-attachment-view-slider video.s-attachment-view-video{display:block;width:100%;max-width:100%;height:min(50vh, 320px);object-fit:contain;margin-inline:auto;background-color:#000}.s-attachment-view-thumb{width:var(--s-attachment-view-thumb-size);height:var(--s-attachment-view-thumb-size);overflow:hidden;border-radius:0.25rem}.s-attachment-view-thumb img,.s-attachment-view-thumb video{display:block;width:100%;height:100%;object-fit:cover}.s-attachment-view-thumb.is-video{position:relative}.s-attachment-view-thumb-play{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background-color:rgba(0, 0, 0, 0.25);pointer-events:none}.s-attachment-view-thumb-play svg{width:0.875rem;height:0.875rem;fill:#fff;opacity:0.95}.block{display:block}.inline{display:inline}.s-scrollbar::-webkit-scrollbar{width:5px}.s-scrollbar::-webkit-scrollbar-track{background-color:#eee}.s-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}";
|
|
41
|
+
|
|
42
|
+
const SallaAttachmentView = class {
|
|
43
|
+
constructor(hostRef) {
|
|
44
|
+
index.registerInstance(this, hostRef);
|
|
45
|
+
/**
|
|
46
|
+
* Attachments to display. Accepts an array of `{ id, url, mimeType? }` or a
|
|
47
|
+
* JSON string of the same shape (for consumers outside of JSX/Stencil).
|
|
48
|
+
*/
|
|
49
|
+
this.attachments = [];
|
|
50
|
+
this.isOpen = false;
|
|
51
|
+
this.activeIndex = 0;
|
|
52
|
+
this.handleKeyDown = (event) => {
|
|
53
|
+
if (!this.isOpen)
|
|
54
|
+
return;
|
|
55
|
+
if (event.key === 'Escape') {
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
this.close();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const items = this.getAttachments();
|
|
61
|
+
if (items.length <= 1)
|
|
62
|
+
return;
|
|
63
|
+
const isRtl = document.documentElement.dir === 'rtl';
|
|
64
|
+
const goPrevious = () => this.goToSlide(this.activeIndex - 1);
|
|
65
|
+
const goNext = () => this.goToSlide(this.activeIndex + 1);
|
|
66
|
+
if (event.key === 'ArrowLeft') {
|
|
67
|
+
event.preventDefault();
|
|
68
|
+
(isRtl ? goNext : goPrevious)();
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (event.key === 'ArrowRight') {
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
(isRtl ? goPrevious : goNext)();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
this.handleModalVisibilityChanged = (open) => {
|
|
77
|
+
this.isOpen = open;
|
|
78
|
+
if (open) {
|
|
79
|
+
window.addEventListener('keydown', this.handleKeyDown);
|
|
80
|
+
this.scrollActiveThumbIntoView();
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
window.removeEventListener('keydown', this.handleKeyDown);
|
|
84
|
+
this.pauseVideos();
|
|
85
|
+
};
|
|
86
|
+
this.handleSlideChange = (event) => {
|
|
87
|
+
const swiper = event.detail;
|
|
88
|
+
if (swiper?.activeIndex == null) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
this.activeIndex = swiper.activeIndex;
|
|
92
|
+
this.pauseVideos();
|
|
93
|
+
this.scrollActiveThumbIntoView();
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
componentWillLoad() {
|
|
97
|
+
Salla.lang.onLoaded(() => {
|
|
98
|
+
Salla.lang.addBulk({
|
|
99
|
+
'blocks.comments.customer_feedback': { ar: 'مراجعة العميل', en: 'Customer feedback' },
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Open the viewer at the given attachment index.
|
|
105
|
+
* @param index - Index of the attachment to show first (defaults to 0).
|
|
106
|
+
*/
|
|
107
|
+
async open(index = 0) {
|
|
108
|
+
const items = this.getAttachments();
|
|
109
|
+
if (!items.length)
|
|
110
|
+
return;
|
|
111
|
+
this.activeIndex = Math.min(Math.max(index, 0), items.length - 1);
|
|
112
|
+
this.isOpen = true;
|
|
113
|
+
await this.modal?.open();
|
|
114
|
+
this.scrollActiveThumbIntoView();
|
|
115
|
+
}
|
|
116
|
+
/** Close the viewer. */
|
|
117
|
+
async close() {
|
|
118
|
+
this.modal?.close();
|
|
119
|
+
}
|
|
120
|
+
disconnectedCallback() {
|
|
121
|
+
window.removeEventListener('keydown', this.handleKeyDown);
|
|
122
|
+
}
|
|
123
|
+
getAttachments() {
|
|
124
|
+
if (typeof this.attachments !== 'string') {
|
|
125
|
+
return Array.isArray(this.attachments) ? this.attachments : [];
|
|
126
|
+
}
|
|
127
|
+
try {
|
|
128
|
+
const parsed = JSON.parse(this.attachments);
|
|
129
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
return [];
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
isVideo(file) {
|
|
136
|
+
return uploadLimits.isVideoMimeType(file.mimeType, file.url);
|
|
137
|
+
}
|
|
138
|
+
pauseVideos() {
|
|
139
|
+
this.host.querySelectorAll('video.s-attachment-view-video').forEach(element => {
|
|
140
|
+
const video = element;
|
|
141
|
+
video.pause();
|
|
142
|
+
video.currentTime = 0;
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
goToSlide(index) {
|
|
146
|
+
const items = this.getAttachments();
|
|
147
|
+
const nextIndex = Math.min(Math.max(index, 0), items.length - 1);
|
|
148
|
+
if (nextIndex === this.activeIndex) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
this.activeIndex = nextIndex;
|
|
152
|
+
this.sliderEl?.slideTo(nextIndex);
|
|
153
|
+
this.pauseVideos();
|
|
154
|
+
this.scrollActiveThumbIntoView();
|
|
155
|
+
}
|
|
156
|
+
scrollActiveThumbIntoView() {
|
|
157
|
+
requestAnimationFrame(() => {
|
|
158
|
+
const activeThumb = this.thumbsScroller?.querySelector('.is-active');
|
|
159
|
+
activeThumb?.scrollIntoView({ inline: 'nearest', block: 'nearest', behavior: 'smooth' });
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
renderSlide(file) {
|
|
163
|
+
if (this.isVideo(file)) {
|
|
164
|
+
return (index.h("video", { class: "s-attachment-view-video", src: file.url, controls: true, playsInline: true, preload: "metadata" }));
|
|
165
|
+
}
|
|
166
|
+
return index.h("img", { src: file.url, alt: "" });
|
|
167
|
+
}
|
|
168
|
+
renderThumb(file) {
|
|
169
|
+
if (this.isVideo(file)) {
|
|
170
|
+
return (index.h("div", { class: "s-attachment-view-thumb is-video" }, index.h("video", { src: file.url, muted: true, playsInline: true, preload: "metadata" }), index.h("span", { class: "s-attachment-view-thumb-play", innerHTML: PlayIcon })));
|
|
171
|
+
}
|
|
172
|
+
return (index.h("div", { class: "s-attachment-view-thumb" }, index.h("img", { src: file.url, alt: "" })));
|
|
173
|
+
}
|
|
174
|
+
render() {
|
|
175
|
+
const items = this.getAttachments();
|
|
176
|
+
if (!items.length)
|
|
177
|
+
return null;
|
|
178
|
+
const itemsKey = items.map(file => file.id).join('-');
|
|
179
|
+
return (index.h(index.Host, null, index.h("salla-modal", { ref: el => (this.modal = el), class: "s-attachment-view-modal-host", width: "md", noPadding: true, onModalVisibilityChanged: event => this.handleModalVisibilityChanged(!!event.detail) }, index.h("div", { class: "s-attachment-view-modal" }, this.isOpen && (index.h("div", { class: "s-attachment-view-gallery" }, index.h("salla-slider", { ref: el => (this.sliderEl = el), class: "s-attachment-view-slider", key: `attachment-${itemsKey}`, id: `${this.host.id || 'attachment-view'}-preview`, autoHeight: true, showControls: items.length > 1, sliderConfig: JSON.stringify({ initialSlide: this.activeIndex }), onSlideChange: event => this.handleSlideChange(event) }, index.h("div", { slot: "items" }, items.map(file => (index.h("div", { class: "s-attachment-view-slide", key: file.id }, this.renderSlide(file)))))), items.length > 1 && (index.h("div", { class: "s-attachment-view-thumbs s-scrollbar", ref: el => (this.thumbsScroller = el) }, items.map((file, index$1) => (index.h("button", { type: "button", class: {
|
|
180
|
+
's-attachment-view-thumb-btn': true,
|
|
181
|
+
'is-active': this.activeIndex === index$1,
|
|
182
|
+
}, key: file.id, "aria-label": `${index$1 + 1}`, "aria-current": this.activeIndex === index$1 ? 'true' : undefined, onClick: () => this.goToSlide(index$1) }, this.renderThumb(file))))))))))));
|
|
183
|
+
}
|
|
184
|
+
get host() { return index.getElement(this); }
|
|
185
|
+
};
|
|
186
|
+
SallaAttachmentView.style = sallaAttachmentViewCss;
|
|
187
|
+
|
|
188
|
+
const sallaAttachmentsCss = "/*!twlt*/:host{display:block}.s-attachments{display:flex;max-width:100%;overflow-x:auto;flex-wrap:nowrap;gap:0.5rem}.s-attachments-image-thumb,.s-attachments-video-thumb{position:relative;width:65px;height:65px;flex-shrink:0;border-radius:0.375rem;overflow:hidden}.s-attachments.is-clickable .s-attachments-image-thumb,.s-attachments.is-clickable .s-attachments-video-thumb{cursor:pointer}.s-attachments-image-thumb img,.s-attachments-video-thumb video{display:block;width:100%;height:100%;object-fit:cover}.s-attachments-more-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background-color:rgba(0, 0, 0, 0.55);color:#fff;font-size:1rem;font-weight:700;pointer-events:none}.s-attachments-video-thumb-play{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background-color:rgba(0, 0, 0, 0.25);pointer-events:none}.s-attachments-video-thumb-play svg{width:1.5rem;height:1.5rem;fill:#fff;opacity:0.95}.visible{visibility:visible}.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)}";
|
|
189
|
+
|
|
190
|
+
const SallaAttachments = class {
|
|
191
|
+
constructor(hostRef) {
|
|
192
|
+
index.registerInstance(this, hostRef);
|
|
193
|
+
/**
|
|
194
|
+
* Attachments to display. Accepts an array of `{ id, url, mimeType? }` or a
|
|
195
|
+
* JSON string of the same shape.
|
|
196
|
+
*/
|
|
197
|
+
this.attachments = [];
|
|
198
|
+
/**
|
|
199
|
+
* Image URLs to display. Accepts a string array or a JSON string.
|
|
200
|
+
*/
|
|
201
|
+
this.images = [];
|
|
202
|
+
/**
|
|
203
|
+
* Video URLs to display. Accepts a string array or a JSON string.
|
|
204
|
+
*/
|
|
205
|
+
this.videos = [];
|
|
206
|
+
/**
|
|
207
|
+
* Rating-like object with `images` / `videos` URL arrays. Used when
|
|
208
|
+
* `images`/`videos` are empty, and as a fallback when resolving
|
|
209
|
+
* `productRatings`.
|
|
210
|
+
*/
|
|
211
|
+
this.rating = null;
|
|
212
|
+
/**
|
|
213
|
+
* Product ratings list. When set with `productId`, the matching rating's
|
|
214
|
+
* media is preferred over `rating`.
|
|
215
|
+
*/
|
|
216
|
+
this.productRatings = [];
|
|
217
|
+
/**
|
|
218
|
+
* Product id used to match an entry in `productRatings`.
|
|
219
|
+
*/
|
|
220
|
+
this.productId = null;
|
|
221
|
+
/**
|
|
222
|
+
* Maximum number of thumbnails to show before displaying a "+N" overlay on
|
|
223
|
+
* the last visible item.
|
|
224
|
+
*/
|
|
225
|
+
this.maxVisible = 4;
|
|
226
|
+
/**
|
|
227
|
+
* When true, clicking a thumbnail opens the attachment lightbox.
|
|
228
|
+
*/
|
|
229
|
+
this.clickable = false;
|
|
230
|
+
}
|
|
231
|
+
parseJson(value, fallback) {
|
|
232
|
+
if (typeof value !== 'string') {
|
|
233
|
+
return (value ?? fallback);
|
|
234
|
+
}
|
|
235
|
+
try {
|
|
236
|
+
return JSON.parse(value);
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
return fallback;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
parseStringList(value) {
|
|
243
|
+
const parsed = this.parseJson(value, []);
|
|
244
|
+
return Array.isArray(parsed) ? parsed.filter(url => typeof url === 'string' && url) : [];
|
|
245
|
+
}
|
|
246
|
+
parseMediaSource(value) {
|
|
247
|
+
if (!value)
|
|
248
|
+
return null;
|
|
249
|
+
const parsed = this.parseJson(value, null);
|
|
250
|
+
return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : null;
|
|
251
|
+
}
|
|
252
|
+
parseMediaSourceList(value) {
|
|
253
|
+
const parsed = this.parseJson(value, []);
|
|
254
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
255
|
+
}
|
|
256
|
+
resolveMediaSource() {
|
|
257
|
+
const images = this.parseStringList(this.images);
|
|
258
|
+
const videos = this.parseStringList(this.videos);
|
|
259
|
+
if (images.length || videos.length) {
|
|
260
|
+
return { images, videos };
|
|
261
|
+
}
|
|
262
|
+
const rating = this.parseMediaSource(this.rating);
|
|
263
|
+
const productRatings = this.parseMediaSourceList(this.productRatings);
|
|
264
|
+
const productId = this.productId == null || this.productId === ''
|
|
265
|
+
? null
|
|
266
|
+
: String(this.productId);
|
|
267
|
+
if (productId && productRatings.length) {
|
|
268
|
+
const matched = productRatings.find(entry => entry?.product?.id != null && String(entry.product.id) === productId);
|
|
269
|
+
if (matched)
|
|
270
|
+
return matched;
|
|
271
|
+
}
|
|
272
|
+
return rating || { images: [], videos: [] };
|
|
273
|
+
}
|
|
274
|
+
mediaToAttachments(source) {
|
|
275
|
+
const images = (source.images || []).map(url => ({ type: 'image', url }));
|
|
276
|
+
const videos = (source.videos || []).map(url => ({ type: 'video', url }));
|
|
277
|
+
return [...images, ...videos];
|
|
278
|
+
}
|
|
279
|
+
getAttachments() {
|
|
280
|
+
let items = [];
|
|
281
|
+
if (typeof this.attachments === 'string') {
|
|
282
|
+
try {
|
|
283
|
+
const parsed = JSON.parse(this.attachments);
|
|
284
|
+
items = Array.isArray(parsed) ? parsed : [];
|
|
285
|
+
}
|
|
286
|
+
catch {
|
|
287
|
+
items = [];
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
else if (Array.isArray(this.attachments)) {
|
|
291
|
+
items = this.attachments;
|
|
292
|
+
}
|
|
293
|
+
if (!items.length) {
|
|
294
|
+
items = this.mediaToAttachments(this.resolveMediaSource());
|
|
295
|
+
}
|
|
296
|
+
return items
|
|
297
|
+
.map((attachment, index) => this.normalizeAttachment(attachment, index))
|
|
298
|
+
.filter(attachment => this.isRenderableAttachment(attachment));
|
|
299
|
+
}
|
|
300
|
+
normalizeAttachment(attachment, index) {
|
|
301
|
+
const mimeType = attachment.mimeType || this.resolveMimeType(attachment.type, attachment.url);
|
|
302
|
+
return {
|
|
303
|
+
id: attachment.id || `attachment-${index}`,
|
|
304
|
+
url: attachment.url,
|
|
305
|
+
mimeType,
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
resolveMimeType(type, url) {
|
|
309
|
+
if (type === 'image')
|
|
310
|
+
return 'image/jpeg';
|
|
311
|
+
if (type === 'video')
|
|
312
|
+
return 'video/mp4';
|
|
313
|
+
if (type?.includes('/'))
|
|
314
|
+
return type;
|
|
315
|
+
if (url && /\.(png|jpe?g|gif|webp|heic|heif)$/i.test(url))
|
|
316
|
+
return 'image/jpeg';
|
|
317
|
+
if (url && /\.(mp4|webm|mov|avi|mkv)$/i.test(url))
|
|
318
|
+
return 'video/mp4';
|
|
319
|
+
return type;
|
|
320
|
+
}
|
|
321
|
+
isRenderableAttachment(attachment) {
|
|
322
|
+
return uploadLimits.isImageMimeType(attachment.mimeType, attachment.url)
|
|
323
|
+
|| uploadLimits.isVideoMimeType(attachment.mimeType, attachment.url);
|
|
324
|
+
}
|
|
325
|
+
isVideo(attachment) {
|
|
326
|
+
return uploadLimits.isVideoMimeType(attachment.mimeType, attachment.url);
|
|
327
|
+
}
|
|
328
|
+
openAt(index) {
|
|
329
|
+
if (!this.clickable)
|
|
330
|
+
return;
|
|
331
|
+
this.attachmentView?.open(index);
|
|
332
|
+
}
|
|
333
|
+
render() {
|
|
334
|
+
const items = this.getAttachments();
|
|
335
|
+
if (!items.length)
|
|
336
|
+
return null;
|
|
337
|
+
const visible = items.slice(0, this.maxVisible);
|
|
338
|
+
const remaining = items.length - this.maxVisible;
|
|
339
|
+
return (index.h(index.Host, null, index.h("div", { class: {
|
|
340
|
+
's-attachments': true,
|
|
341
|
+
'is-clickable': this.clickable,
|
|
342
|
+
} }, visible.map((attachment, index$1) => {
|
|
343
|
+
const isLastVisible = index$1 === this.maxVisible - 1;
|
|
344
|
+
const showMoreOverlay = isLastVisible && remaining > 0;
|
|
345
|
+
const thumbProps = this.clickable
|
|
346
|
+
? { onClick: () => this.openAt(index$1) }
|
|
347
|
+
: {};
|
|
348
|
+
return this.isVideo(attachment)
|
|
349
|
+
? index.h("div", { key: attachment.id, class: "s-attachments-video-thumb", ...thumbProps }, index.h("video", { src: attachment.url, muted: true, playsInline: true, preload: "metadata" }), showMoreOverlay
|
|
350
|
+
? index.h("span", { class: "s-attachments-more-overlay" }, "+", remaining)
|
|
351
|
+
: index.h("span", { class: "s-attachments-video-thumb-play", innerHTML: PlayIcon }))
|
|
352
|
+
: index.h("div", { key: attachment.id, class: "s-attachments-image-thumb", ...thumbProps }, index.h("img", { src: attachment.url, alt: "" }), showMoreOverlay
|
|
353
|
+
? index.h("span", { class: "s-attachments-more-overlay" }, "+", remaining)
|
|
354
|
+
: null);
|
|
355
|
+
}), this.clickable && (index.h("salla-attachment-view", { ref: el => (this.attachmentView = el), attachments: items })))));
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
SallaAttachments.style = sallaAttachmentsCss;
|
|
359
|
+
|
|
31
360
|
var BookingTime = `<!-- Generated by IcoMoon.io -->
|
|
32
361
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
33
362
|
<title>calendar-time</title>
|
|
@@ -378,7 +707,7 @@ const SallaColorPicker = class {
|
|
|
378
707
|
}
|
|
379
708
|
}
|
|
380
709
|
initColorPicker() {
|
|
381
|
-
this.pickerReady = Promise.resolve().then(function () { return require('./vanilla-picker-
|
|
710
|
+
this.pickerReady = Promise.resolve().then(function () { return require('./vanilla-picker-BUFYPi-_.js'); }).then(function (n) { return n.vanillaPicker; }).then(mod => {
|
|
382
711
|
const Picker = mod.default;
|
|
383
712
|
const picker = new Picker({
|
|
384
713
|
parent: this.host,
|
|
@@ -826,8 +1155,9 @@ const SallaDatetimePicker = class {
|
|
|
826
1155
|
};
|
|
827
1156
|
SallaDatetimePicker.style = sallaDatetimePickerCss;
|
|
828
1157
|
|
|
829
|
-
const sallaFileUploadCss = "/*!twlt*//*!\n * FilePond 4.32.12\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */\n\n/* eslint-disable */\n.filepond--assistant{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--browser.filepond--browser{position:absolute;margin:0;padding:0;left:1em;top:1.75em;width:calc(100% - 2em);opacity:0;font-size:0}.filepond--data{position:absolute;width:0;height:0;padding:0;margin:0;border:none;visibility:hidden;pointer-events:none;contain:strict}.filepond--drip{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;opacity:.1;pointer-events:none;border-radius:.5em;background:rgba(0,0,0,.01)}.filepond--drip-blob{-webkit-transform-origin:center center;transform-origin:center center;width:8em;height:8em;margin-left:-4em;margin-top:-4em;background:#292625;border-radius:50%}.filepond--drip-blob,.filepond--drop-label{position:absolute;top:0;left:0;will-change:transform,opacity}.filepond--drop-label{right:0;margin:0;color:#4f4f4f;display:flex;justify-content:center;align-items:center;height:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--drop-label.filepond--drop-label label{display:block;margin:0;padding:.5em}.filepond--drop-label label{cursor:default;font-size:.875em;font-weight:400;text-align:center;line-height:1.5}.filepond--label-action{text-decoration:underline;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto;-webkit-text-decoration-color:#a7a4a4;text-decoration-color:#a7a4a4;cursor:pointer}.filepond--root[data-disabled] .filepond--drop-label label{opacity:.5}.filepond--file-action-button.filepond--file-action-button{font-size:1em;width:1.625em;height:1.625em;font-family:inherit;line-height:inherit;margin:0;padding:0;border:none;outline:none;will-change:transform,opacity}.filepond--file-action-button.filepond--file-action-button span{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file-action-button.filepond--file-action-button svg{width:100%;height:100%}.filepond--file-action-button.filepond--file-action-button:after{position:absolute;left:-.75em;right:-.75em;top:-.75em;bottom:-.75em;content:\"\"}.filepond--file-action-button{cursor:auto;color:#fff;border-radius:50%;background-color:rgba(0,0,0,.5);background-image:none;box-shadow:0 0 0 0 hsla(0,0%,100%,0);transition:box-shadow .25s ease-in}.filepond--file-action-button:focus,.filepond--file-action-button:hover{box-shadow:0 0 0 .125em hsla(0,0%,100%,.9)}.filepond--file-action-button[disabled]{color:hsla(0,0%,100%,.5);background-color:rgba(0,0,0,.25)}.filepond--file-action-button[hidden]{display:none}.filepond--action-edit-item.filepond--action-edit-item{width:2em;height:2em;padding:.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*=center]{margin-left:-.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*=bottom]{margin-bottom:-.1875em}.filepond--action-edit-item-alt{border:none;line-height:inherit;background:transparent;font-family:inherit;color:inherit;outline:none;padding:0;margin:0 0 0 .25em;pointer-events:all;position:absolute}.filepond--action-edit-item-alt svg{width:1.3125em;height:1.3125em}.filepond--action-edit-item-alt span{font-size:0;opacity:0}.filepond--file-info{position:static;display:flex;flex-direction:column;align-items:flex-start;flex:1;margin:0 .5em 0 0;min-width:0;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-info *{margin:0}.filepond--file-info .filepond--file-info-main{font-size:.75em;line-height:1.2;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}.filepond--file-info .filepond--file-info-sub{font-size:.625em;opacity:.5;transition:opacity .25s ease-in-out;white-space:nowrap}.filepond--file-info .filepond--file-info-sub:empty{display:none}.filepond--file-status{position:static;display:flex;flex-direction:column;align-items:flex-end;flex-grow:0;flex-shrink:0;margin:0;min-width:2.25em;text-align:right;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-status *{margin:0;white-space:nowrap}.filepond--file-status .filepond--file-status-main{font-size:.75em;line-height:1.2}.filepond--file-status .filepond--file-status-sub{font-size:.625em;opacity:.5;transition:opacity .25s ease-in-out}.filepond--file-wrapper.filepond--file-wrapper{border:none;margin:0;padding:0;min-width:0;height:100%}.filepond--file-wrapper.filepond--file-wrapper>legend{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file{position:static;display:flex;height:100%;align-items:flex-start;padding:.5625em;color:#fff;border-radius:.5em}.filepond--file .filepond--file-status{margin-left:auto;margin-right:2.25em}.filepond--file .filepond--processing-complete-indicator{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:3}.filepond--file .filepond--file-action-button,.filepond--file .filepond--processing-complete-indicator,.filepond--file .filepond--progress-indicator{position:absolute}.filepond--file [data-align*=left]{left:.5625em}.filepond--file [data-align*=right]{right:.5625em}.filepond--file [data-align*=center]{left:calc(50% - .8125em)}.filepond--file [data-align*=bottom]{bottom:1.125em}.filepond--file [data-align=center]{top:calc(50% - .8125em)}.filepond--file .filepond--progress-indicator{margin-top:.1875em}.filepond--file .filepond--progress-indicator[data-align*=right]{margin-right:.1875em}.filepond--file .filepond--progress-indicator[data-align*=left]{margin-left:.1875em}[data-filepond-item-state*=error] .filepond--file-info,[data-filepond-item-state*=invalid] .filepond--file-info,[data-filepond-item-state=cancelled] .filepond--file-info{margin-right:2.25em}[data-filepond-item-state~=processing] .filepond--file-status-sub{opacity:0}[data-filepond-item-state~=processing] .filepond--action-abort-item-processing~.filepond--file-status .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-error] .filepond--file-status-sub{opacity:0}[data-filepond-item-state=processing-error] .filepond--action-retry-item-processing~.filepond--file-status .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing svg{-webkit-animation:fall .5s linear .125s both;animation:fall .5s linear .125s both}[data-filepond-item-state=processing-complete] .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-complete] .filepond--file-info-sub,[data-filepond-item-state=processing-complete] .filepond--processing-complete-indicator:not([style*=hidden])~.filepond--file-status .filepond--file-status-sub{opacity:0}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing~.filepond--file-info .filepond--file-info-sub{opacity:.5}[data-filepond-item-state*=error] .filepond--file-wrapper,[data-filepond-item-state*=error] .filepond--panel,[data-filepond-item-state*=invalid] .filepond--file-wrapper,[data-filepond-item-state*=invalid] .filepond--panel{-webkit-animation:shake .65s linear both;animation:shake .65s linear both}[data-filepond-item-state*=busy] .filepond--progress-indicator svg{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes shake{10%,90%{-webkit-transform:translateX(-.0625em);transform:translateX(-.0625em)}20%,80%{-webkit-transform:translateX(.125em);transform:translateX(.125em)}30%,50%,70%{-webkit-transform:translateX(-.25em);transform:translateX(-.25em)}40%,60%{-webkit-transform:translateX(.25em);transform:translateX(.25em)}}@keyframes shake{10%,90%{-webkit-transform:translateX(-.0625em);transform:translateX(-.0625em)}20%,80%{-webkit-transform:translateX(.125em);transform:translateX(.125em)}30%,50%,70%{-webkit-transform:translateX(-.25em);transform:translateX(-.25em)}40%,60%{-webkit-transform:translateX(.25em);transform:translateX(.25em)}}@-webkit-keyframes fall{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}70%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}to{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes fall{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}70%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}to{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.filepond--hopper[data-hopper-state=drag-over]>*{pointer-events:none}.filepond--hopper[data-hopper-state=drag-over]:after{content:\"\";position:absolute;left:0;top:0;right:0;bottom:0;z-index:100}.filepond--progress-indicator{z-index:103}.filepond--file-action-button{z-index:102}.filepond--file-status{z-index:101}.filepond--file-info{z-index:100}.filepond--item{position:absolute;top:0;left:0;right:0;z-index:1;padding:0;margin:.25em;will-change:transform,opacity;touch-action:auto}.filepond--item>.filepond--panel{z-index:-1}.filepond--item>.filepond--panel .filepond--panel-bottom{box-shadow:0 .0625em .125em -.0625em rgba(0,0,0,.25)}.filepond--item>.filepond--file-wrapper,.filepond--item>.filepond--panel{transition:opacity .15s ease-out}.filepond--item[data-drag-state]{cursor:-webkit-grab;cursor:grab}.filepond--item[data-drag-state]>.filepond--panel{transition:box-shadow .125s ease-in-out;box-shadow:0 0 0 transparent}.filepond--item[data-drag-state=drag]{cursor:-webkit-grabbing;cursor:grabbing}.filepond--item[data-drag-state=drag]>.filepond--panel{box-shadow:0 .125em .3125em rgba(0,0,0,.325)}.filepond--item[data-drag-state]:not([data-drag-state=idle]){z-index:2}.filepond--item-panel{background-color:#64605e}[data-filepond-item-state=processing-complete] .filepond--item-panel{background-color:#369763}[data-filepond-item-state*=error] .filepond--item-panel,[data-filepond-item-state*=invalid] .filepond--item-panel{background-color:#c44e47}.filepond--item-panel{border-radius:.5em;transition:background-color .25s}.filepond--list-scroller{position:absolute;top:0;left:0;right:0;margin:0;will-change:transform}.filepond--list-scroller[data-state=overflow] .filepond--list{bottom:0;right:0}.filepond--list-scroller[data-state=overflow]{overflow-y:scroll;overflow-x:hidden;-webkit-overflow-scrolling:touch;-webkit-mask:linear-gradient(180deg,#000 calc(100% - .5em),transparent);mask:linear-gradient(180deg,#000 calc(100% - .5em),transparent)}.filepond--list-scroller::-webkit-scrollbar{background:transparent}.filepond--list-scroller::-webkit-scrollbar:vertical{width:1em}.filepond--list-scroller::-webkit-scrollbar:horizontal{height:0}.filepond--list-scroller::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.3);border-radius:99999px;border:.3125em solid transparent;background-clip:content-box}.filepond--list.filepond--list{position:absolute;top:0;margin:0;padding:0;list-style-type:none;will-change:transform}.filepond--list{left:.75em;right:.75em}.filepond--root[data-style-panel-layout~=integrated]{width:100%;height:100%;max-width:none;margin:0}.filepond--root[data-style-panel-layout~=circle] .filepond--panel-root,.filepond--root[data-style-panel-layout~=integrated] .filepond--panel-root{border-radius:0}.filepond--root[data-style-panel-layout~=circle] .filepond--panel-root>*,.filepond--root[data-style-panel-layout~=integrated] .filepond--panel-root>*{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--drop-label,.filepond--root[data-style-panel-layout~=integrated] .filepond--drop-label{bottom:0;height:auto;display:flex;justify-content:center;align-items:center;z-index:7}.filepond--root[data-style-panel-layout~=circle] .filepond--item-panel,.filepond--root[data-style-panel-layout~=integrated] .filepond--item-panel{display:none}.filepond--root[data-style-panel-layout~=compact] .filepond--list-scroller,.filepond--root[data-style-panel-layout~=integrated] .filepond--list-scroller{overflow:hidden;height:100%;margin-top:0;margin-bottom:0}.filepond--root[data-style-panel-layout~=compact] .filepond--list,.filepond--root[data-style-panel-layout~=integrated] .filepond--list{left:0;right:0;height:100%}.filepond--root[data-style-panel-layout~=compact] .filepond--item,.filepond--root[data-style-panel-layout~=integrated] .filepond--item{margin:0}.filepond--root[data-style-panel-layout~=compact] .filepond--file-wrapper,.filepond--root[data-style-panel-layout~=integrated] .filepond--file-wrapper{height:100%}.filepond--root[data-style-panel-layout~=compact] .filepond--drop-label,.filepond--root[data-style-panel-layout~=integrated] .filepond--drop-label{z-index:7}.filepond--root[data-style-panel-layout~=circle]{border-radius:99999rem;overflow:hidden}.filepond--root[data-style-panel-layout~=circle]>.filepond--panel{border-radius:inherit}.filepond--root[data-style-panel-layout~=circle]>.filepond--panel>*{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--file-info,.filepond--root[data-style-panel-layout~=circle] .filepond--file-status{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--action-edit-item{opacity:1!important;visibility:visible!important}@media not all and (min-resolution:0.001dpcm){@supports (-webkit-appearance:none) and (stroke-color:transparent){.filepond--root[data-style-panel-layout~=circle]{will-change:transform}}}.filepond--panel-root{border-radius:.5em;background-color:#f1f0ef}.filepond--panel{position:absolute;left:0;top:0;right:0;margin:0;height:100%!important;pointer-events:none}.filepond-panel:not([data-scalable=false]){height:auto!important}.filepond--panel[data-scalable=false]>div{display:none}.filepond--panel[data-scalable=true]{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;background-color:transparent!important;border:none!important}.filepond--panel-bottom,.filepond--panel-center,.filepond--panel-top{position:absolute;left:0;top:0;right:0;margin:0;padding:0}.filepond--panel-bottom,.filepond--panel-top{height:.5em}.filepond--panel-top{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important;border-bottom:none!important}.filepond--panel-top:after{content:\"\";position:absolute;height:2px;left:0;right:0;bottom:-1px;background-color:inherit}.filepond--panel-bottom,.filepond--panel-center{will-change:transform;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:translate3d(0,.5em,0);transform:translate3d(0,.5em,0)}.filepond--panel-bottom{border-top-left-radius:0!important;border-top-right-radius:0!important;border-top:none!important}.filepond--panel-bottom:before{content:\"\";position:absolute;height:2px;left:0;right:0;top:-1px;background-color:inherit}.filepond--panel-center{height:100px!important;border-top:none!important;border-bottom:none!important;border-radius:0!important}.filepond--panel-center:not([style]){visibility:hidden}.filepond--progress-indicator{position:static;width:1.25em;height:1.25em;color:#fff;margin:0;pointer-events:none;will-change:transform,opacity}.filepond--progress-indicator svg{width:100%;height:100%;vertical-align:top;transform-box:fill-box}.filepond--progress-indicator path{fill:none;stroke:currentColor}.filepond--list-scroller{z-index:6}.filepond--drop-label{z-index:5}.filepond--drip{z-index:3}.filepond--root>.filepond--panel{z-index:2}.filepond--browser{z-index:1}.filepond--root{box-sizing:border-box;position:relative;margin-bottom:1em;font-size:1rem;line-height:normal;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-weight:450;text-align:left;text-rendering:optimizeLegibility;direction:ltr;contain:layout style size}.filepond--root *{box-sizing:inherit;line-height:inherit}.filepond--root :not(text){font-size:inherit}.filepond--root[data-disabled]{pointer-events:none}.filepond--root[data-disabled] .filepond--list-scroller{pointer-events:all}.filepond--root[data-disabled] .filepond--list{pointer-events:none}.filepond--root .filepond--drop-label{min-height:4.75em}.filepond--root .filepond--list-scroller{margin-top:1em;margin-bottom:1em}.filepond--root .filepond--credits{position:absolute;right:0;opacity:.4;line-height:.85;font-size:11px;color:inherit;text-decoration:none;z-index:3;bottom:-14px}.filepond--root .filepond--credits[style]{top:0;bottom:auto;margin-top:14px}\n/*!\n * FilePondPluginImagePreview 4.6.12\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */\n\n/* eslint-disable */\n.filepond--image-preview-markup {\n position: absolute;\n left: 0;\n top: 0;\n}\n.filepond--image-preview-wrapper {\n z-index: 2;\n}\n.filepond--image-preview-overlay {\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n min-height: 5rem;\n max-height: 7rem;\n margin: 0;\n opacity: 0;\n z-index: 2;\n pointer-events: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.filepond--image-preview-overlay svg {\n width: 100%;\n height: auto;\n color: inherit;\n max-height: inherit;\n}\n.filepond--image-preview-overlay-idle {\n mix-blend-mode: multiply;\n color: rgba(40, 40, 40, 0.85);\n}\n.filepond--image-preview-overlay-success {\n mix-blend-mode: normal;\n color: rgba(54, 151, 99, 1);\n}\n.filepond--image-preview-overlay-failure {\n mix-blend-mode: normal;\n color: rgba(196, 78, 71, 1);\n}\n/* disable for Safari as mix-blend-mode causes the overflow:hidden of the parent container to not work */\n@supports (-webkit-marquee-repetition: infinite) and\n ((-o-object-fit: fill) or (object-fit: fill)) {\n .filepond--image-preview-overlay-idle {\n mix-blend-mode: normal;\n }\n}\n.filepond--image-preview-wrapper {\n /* no interaction */\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n\n /* have preview fill up all available space */\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n height: 100%;\n margin: 0;\n\n /* radius is .05em less to prevent the panel background color from shining through */\n border-radius: 0.45em;\n overflow: hidden;\n\n /* this seems to prevent Chrome from redrawing this layer constantly */\n background: rgba(0, 0, 0, 0.01);\n}\n.filepond--image-preview {\n position: absolute;\n left: 0;\n top: 0;\n z-index: 1;\n display: flex; /* this aligns the graphic vertically if the panel is higher than the image */\n align-items: center;\n height: 100%;\n width: 100%;\n pointer-events: none;\n background: #222;\n\n /* will be animated */\n will-change: transform, opacity;\n}\n.filepond--image-clip {\n position: relative;\n overflow: hidden;\n margin: 0 auto;\n\n /* transparency indicator (currently only supports grid or basic color) */\n}\n.filepond--image-clip[data-transparency-indicator='grid'] img,\n.filepond--image-clip[data-transparency-indicator='grid'] canvas {\n background-color: #fff;\n background-image: url(\"data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg' fill='%23eee'%3E%3Cpath d='M0 0 H50 V50 H0'/%3E%3Cpath d='M50 50 H100 V100 H50'/%3E%3C/svg%3E\");\n background-size: 1.25em 1.25em;\n}\n.filepond--image-bitmap,\n.filepond--image-vector {\n position: absolute;\n left: 0;\n top: 0;\n will-change: transform;\n}\n.filepond--root[data-style-panel-layout~='integrated']\n .filepond--image-preview-wrapper {\n border-radius: 0;\n}\n.filepond--root[data-style-panel-layout~='integrated']\n .filepond--image-preview {\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.filepond--root[data-style-panel-layout~='circle']\n .filepond--image-preview-wrapper {\n border-radius: 99999rem;\n}\n.filepond--root[data-style-panel-layout~='circle']\n .filepond--image-preview-overlay {\n top: auto;\n bottom: 0;\n -webkit-transform: scaleY(-1);\n transform: scaleY(-1);\n}\n.filepond--root[data-style-panel-layout~='circle']\n .filepond--file\n .filepond--file-action-button[data-align*='bottom']:not([data-align*='center']) {\n margin-bottom: 0.325em;\n}\n.filepond--root[data-style-panel-layout~='circle']\n .filepond--file\n [data-align*='left'] {\n left: calc(50% - 3em);\n}\n.filepond--root[data-style-panel-layout~='circle']\n .filepond--file\n [data-align*='right'] {\n right: calc(50% - 3em);\n}\n.filepond--root[data-style-panel-layout~='circle']\n .filepond--progress-indicator[data-align*='bottom'][data-align*='left'],\n.filepond--root[data-style-panel-layout~='circle']\n .filepond--progress-indicator[data-align*='bottom'][data-align*='right'] {\n margin-bottom: calc(0.325em + 0.1875em);\n}\n.filepond--root[data-style-panel-layout~='circle']\n .filepond--progress-indicator[data-align*='bottom'][data-align*='center'] {\n margin-top: 0;\n margin-bottom: 0.1875em;\n margin-left: 0.1875em;\n}\n\n/*!\n * FilePondPluginImageEdit 1.6.3\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */\n\n/* eslint-disable */\n.filepond--action-edit-item.filepond--action-edit-item {\n width: 2em;\n height: 2em;\n padding: 0.1875em;\n}\n\n.filepond--action-edit-item.filepond--action-edit-item[data-align*='center'] {\n margin-left: -0.1875em;\n}\n\n.filepond--action-edit-item.filepond--action-edit-item[data-align*='bottom'] {\n margin-bottom: -0.1875em;\n}\n\n.filepond--action-edit-item-alt {\n border: none;\n line-height: inherit;\n background: transparent;\n font-family: inherit;\n color: inherit;\n outline: none;\n padding: 0;\n margin: 0 0 0 0.25em;\n pointer-events: all;\n position: absolute;\n}\n\n.filepond--action-edit-item-alt svg {\n width: 1.3125em;\n height: 1.3125em;\n}\n\n.filepond--action-edit-item-alt span {\n font-size: 0;\n opacity: 0;\n}\n.filepond--root[data-style-panel-layout~='circle'] .filepond--action-edit-item {\n opacity: 1 !important;\n visibility: visible !important;\n}\n\n.s-file-upload-wrapper .filepond--file-info-main {\n -webkit-line-clamp: 1;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n}\n.fixed{\n position: fixed;\n}\n.grid{\n display: grid;\n}\n.hidden{\n display: none;\n}\n.transform{\n 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));\n}\n.resize{\n resize: both;\n}\n.filter{\n 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);\n}\n.s-hidden{\n display: none;\n}\n.s-file-upload-wrapper .filepond--drop-label{\n height: 100%;\n cursor: pointer;\n border-radius: var(--s-radius, 0.25rem);\n border-width: 1px;\n border-style: dashed;\n --tw-border-opacity: 1;\n border-color: rgb(229 231 235 / var(--tw-border-opacity, 1));\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n --tw-text-opacity: 1;\n color: rgb(55 65 81 / var(--tw-text-opacity, 1));\n}\n.s-file-upload-wrapper .filepond--drop-label label{\n margin-top: 0.75rem;\n margin-bottom: 0.75rem;\n font-family: var(--font-main), -apple-system, BlinkMacSystemFont;\n}\n.s-file-upload-wrapper .filepond--label-action{\n text-decoration-color: #6b7280;\n}\n.s-file-upload-wrapper .filepond--panel-root{\n border-radius: var(--s-radius, 0.25rem);\n --tw-bg-opacity: 1 !important;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1)) !important;\n}\n.s-file-upload-profile-image .filepond--panel-root{\n border-radius: 9999px !important;\n}\n.s-file-upload:not(.s-file-upload-multiple) .s-file-upload-wrapper .filepond--list-scroller{\n overflow-y: inherit !important;\n overflow: inherit !important;\n margin: 0 !important;\n cursor: pointer !important;\n}\n.filepond--root{\n min-height: 120px !important;\n font-family: inherit !important;\n}\n.s-file-upload-wrapper .filepond--item-panel{\n --tw-bg-opacity: 1;\n background-color: rgb(55 65 81 / var(--tw-bg-opacity, 1));\n}\n.s-file-upload-wrapper .filepond--drip-blob{\n --tw-bg-opacity: 1;\n background-color: rgb(75 85 99 / var(--tw-bg-opacity, 1));\n}\n.s-file-upload-wrapper .filepond--list{\n left: 0px;\n width: 100%;\n}\n.s-file-upload-wrapper .filepond--file-poster-wrapper{\n position: absolute;\n left: 0px;\n top: 0px;\n right: 0px;\n margin: 0px;\n display: flex;\n height: 100%;\n width: 100%;\n user-select: none;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n border-radius: 0.45em;\n background-color: #00000003;\n}\n.s-file-upload-wrapper .filepond--file-poster{\n position: absolute;\n display: flex;\n height: 100%;\n align-items: center;\n justify-content: center;\n}\n.s-file-upload-wrapper .filepond--file-poster-overlay{\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n}\n.s-file-upload-wrapper .filepond--item{\n margin: 0px;\n}\n.s-file-upload-wrapper .filepond--file-info{\n margin: 0px;\n}\n.s-file-upload-wrapper .filepond--file-info-main{\n width: 85px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: normal;\n font-size: 0.75em;\n line-height: 1.2;\n}\n.s-file-upload-wrapper .filepond--file-status{\n width: 55%;\n}\n.s-file-upload-wrapper .filepond--file-status:where([dir=\"rtl\"], [dir=\"rtl\"] *){\n margin-right: 35px;\n}\n@media (min-width: 768px){\n .s-file-upload-wrapper .filepond--file-status:where([dir=\"rtl\"], [dir=\"rtl\"] *){\n margin-right: 2.25em;\n }\n}\n.s-file-upload-wrapper .filepond--file-status .filepond--file-status-sub{\n width: 275px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.s-file-upload-profile-image .filepond--root{\n height: 80px;\n min-height: 80px !important;\n width: 80px;\n border-radius: 9999px !important;\n}\n.s-file-upload-profile-image .filepond--drop-label{\n z-index: 7;\n min-height: 70px !important;\n border-radius: 9999px !important;\n border-style: none;\n}\n.s-file-upload-profile-image .filepond--drop-label label{\n cursor: pointer;\n padding-top: 20px;\n padding-bottom: 20px;\n padding-left: 6px;\n padding-right: 6px;\n font-size: 0.8rem;\n margin-top: 0.75rem;\n margin-bottom: 0.75rem;\n font-family: var(--font-main), -apple-system, BlinkMacSystemFont;\n}\n.s-file-upload-profile-image .filepond--file{\n padding: 0px;\n}\n.s-file-upload-profile-image .filepond--file .filepond--action-remove-item{\n top: auto !important;\n bottom: -4px;\n left: 50%;\n transform: translateX(-50%) translateY(25%) !important;\n background-color: rgba(255,68,58,.7);\n cursor: pointer;\n width: 20px;\n height: 20px;\n transition: 0.3s;\n}\n.s-file-upload-profile-image .filepond--file .filepond--action-remove-item:hover{\n background-color: #FF443A;\n}\n.s-file-upload-profile-image .filepond--file .filepond--file-action-button{\n top: 28px;\n right: 28px;\n}\n.s-file-upload-profile-image .filepond--file .filepond--progress-indicator,.s-file-upload-profile-image .filepond--file .filepond--load-indicator,.s-file-upload-profile-image .filepond--file .filepond--processing-complete-indicator{\n top: 48% !important;\n right: 50%;\n left: auto;\n transform: translateX(50%) translateY(-50%);\n}\n.s-file-upload-profile-image .filepond--item-panel{\n background-color: transparent !important;\n}\n.s-file-upload-.s-file-upload-profile-image .filepond--item-panel .filepond--panel-top,.s-file-upload-profile-image .filepond--item-panel .filepond--panel-center,.s-file-upload-profile-image .filepond--item-panel .filepond--panel-bottom{\n display: none;\n}\n.s-file-upload-profile-image .filepond--file-poster-overlay{\n display: none;\n}\n.s-file-upload-profile-image .filepond--item{\n margin: 0px !important;\n height: 5rem !important;\n}\n.s-file-upload-profile-image .filepond--file-poster{\n height: 100%;\n width: 100%;\n}\n.s-file-upload-profile-image .filepond--file-status{\n display: none;\n}\n.s-file-upload-profile-image .filepond--image-preview-overlay-success{\n top: auto;\n bottom: 0px;\n --tw-scale-y: -1;\n 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));\n}\n.s-file-upload-profile-image .filepond--image-preview-wrapper{\n border-radius: 9999px;\n}\n.s-file-upload-profile-image .filepond--file-info{\n display: none;\n}\n.s-file-upload-profile-image .filepond--list{\n left: 0px;\n right: 0px;\n height: 100%;\n}\n.s-file-upload-profile-image .filepond--file-poster img{\n height: 100%;\n width: 100%;\n border-radius: 9999px;\n object-fit: cover;\n}\n.s-file-upload-profile-image .filepond--file-poster-wrapper{\n overflow: hidden;\n border-radius: 9999px;\n}\n.s-file-upload-profile-image .s-file-upload-has-error .filepond--file-status{\n position: absolute;\n bottom: -62%;\n left: -190%;\n display: flex !important;\n height: auto;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n font-size: 1rem;\n line-height: 1.5rem;\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity, 1));\n}\n.s-file-upload-multiple .filepond--root{\n max-height: 120px;\n}\n.s-file-upload-multiple .filepond--list-scroller{\n top: 0px;\n margin-top: 0px;\n margin-bottom: 0px;\n height: 100%;\n overflow-y: scroll;\n}\n.s-file-upload-multiple .filepond--drop-label:not(.s-hidden) + .filepond--list-scroller{\n display: none;\n}\n.s-file-upload-multiple .filepond--item{\n @media(min-width: 767px){\n width: calc(33.33% - .5em);\n margin-left: .3em !important;\n }\n @media(max-width: 767px){\n margin-bottom: .3em;\n }\n}\n.s-file-upload-hint{\n margin-top: -15px;\n font-size: 0.875rem;\n line-height: 1.25rem;\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / var(--tw-text-opacity, 1));\n}\n.s-product-options-image-input .s-file-upload-wrapper{\n min-height: 120px;\n}\n";
|
|
1158
|
+
const sallaFileUploadCss = "/*!twlt*//*!\n * FilePond 4.32.12\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */\n\n/* eslint-disable */\n.filepond--assistant{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--browser.filepond--browser{position:absolute;margin:0;padding:0;left:1em;top:1.75em;width:calc(100% - 2em);opacity:0;font-size:0}.filepond--data{position:absolute;width:0;height:0;padding:0;margin:0;border:none;visibility:hidden;pointer-events:none;contain:strict}.filepond--drip{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;opacity:.1;pointer-events:none;border-radius:.5em;background:rgba(0,0,0,.01)}.filepond--drip-blob{-webkit-transform-origin:center center;transform-origin:center center;width:8em;height:8em;margin-left:-4em;margin-top:-4em;background:#292625;border-radius:50%}.filepond--drip-blob,.filepond--drop-label{position:absolute;top:0;left:0;will-change:transform,opacity}.filepond--drop-label{right:0;margin:0;color:#4f4f4f;display:flex;justify-content:center;align-items:center;height:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--drop-label.filepond--drop-label label{display:block;margin:0;padding:.5em}.filepond--drop-label label{cursor:default;font-size:.875em;font-weight:400;text-align:center;line-height:1.5}.filepond--label-action{text-decoration:underline;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto;-webkit-text-decoration-color:#a7a4a4;text-decoration-color:#a7a4a4;cursor:pointer}.filepond--root[data-disabled] .filepond--drop-label label{opacity:.5}.filepond--file-action-button.filepond--file-action-button{font-size:1em;width:1.625em;height:1.625em;font-family:inherit;line-height:inherit;margin:0;padding:0;border:none;outline:none;will-change:transform,opacity}.filepond--file-action-button.filepond--file-action-button span{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file-action-button.filepond--file-action-button svg{width:100%;height:100%}.filepond--file-action-button.filepond--file-action-button:after{position:absolute;left:-.75em;right:-.75em;top:-.75em;bottom:-.75em;content:\"\"}.filepond--file-action-button{cursor:auto;color:#fff;border-radius:50%;background-color:rgba(0,0,0,.5);background-image:none;box-shadow:0 0 0 0 hsla(0,0%,100%,0);transition:box-shadow .25s ease-in}.filepond--file-action-button:focus,.filepond--file-action-button:hover{box-shadow:0 0 0 .125em hsla(0,0%,100%,.9)}.filepond--file-action-button[disabled]{color:hsla(0,0%,100%,.5);background-color:rgba(0,0,0,.25)}.filepond--file-action-button[hidden]{display:none}.filepond--action-edit-item.filepond--action-edit-item{width:2em;height:2em;padding:.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*=center]{margin-left:-.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*=bottom]{margin-bottom:-.1875em}.filepond--action-edit-item-alt{border:none;line-height:inherit;background:transparent;font-family:inherit;color:inherit;outline:none;padding:0;margin:0 0 0 .25em;pointer-events:all;position:absolute}.filepond--action-edit-item-alt svg{width:1.3125em;height:1.3125em}.filepond--action-edit-item-alt span{font-size:0;opacity:0}.filepond--file-info{position:static;display:flex;flex-direction:column;align-items:flex-start;flex:1;margin:0 .5em 0 0;min-width:0;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-info *{margin:0}.filepond--file-info .filepond--file-info-main{font-size:.75em;line-height:1.2;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}.filepond--file-info .filepond--file-info-sub{font-size:.625em;opacity:.5;transition:opacity .25s ease-in-out;white-space:nowrap}.filepond--file-info .filepond--file-info-sub:empty{display:none}.filepond--file-status{position:static;display:flex;flex-direction:column;align-items:flex-end;flex-grow:0;flex-shrink:0;margin:0;min-width:2.25em;text-align:right;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-status *{margin:0;white-space:nowrap}.filepond--file-status .filepond--file-status-main{font-size:.75em;line-height:1.2}.filepond--file-status .filepond--file-status-sub{font-size:.625em;opacity:.5;transition:opacity .25s ease-in-out}.filepond--file-wrapper.filepond--file-wrapper{border:none;margin:0;padding:0;min-width:0;height:100%}.filepond--file-wrapper.filepond--file-wrapper>legend{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file{position:static;display:flex;height:100%;align-items:flex-start;padding:.5625em;color:#fff;border-radius:.5em}.filepond--file .filepond--file-status{margin-left:auto;margin-right:2.25em}.filepond--file .filepond--processing-complete-indicator{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:3}.filepond--file .filepond--file-action-button,.filepond--file .filepond--processing-complete-indicator,.filepond--file .filepond--progress-indicator{position:absolute}.filepond--file [data-align*=left]{left:.5625em}.filepond--file [data-align*=right]{right:.5625em}.filepond--file [data-align*=center]{left:calc(50% - .8125em)}.filepond--file [data-align*=bottom]{bottom:1.125em}.filepond--file [data-align=center]{top:calc(50% - .8125em)}.filepond--file .filepond--progress-indicator{margin-top:.1875em}.filepond--file .filepond--progress-indicator[data-align*=right]{margin-right:.1875em}.filepond--file .filepond--progress-indicator[data-align*=left]{margin-left:.1875em}[data-filepond-item-state*=error] .filepond--file-info,[data-filepond-item-state*=invalid] .filepond--file-info,[data-filepond-item-state=cancelled] .filepond--file-info{margin-right:2.25em}[data-filepond-item-state~=processing] .filepond--file-status-sub{opacity:0}[data-filepond-item-state~=processing] .filepond--action-abort-item-processing~.filepond--file-status .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-error] .filepond--file-status-sub{opacity:0}[data-filepond-item-state=processing-error] .filepond--action-retry-item-processing~.filepond--file-status .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing svg{-webkit-animation:fall .5s linear .125s both;animation:fall .5s linear .125s both}[data-filepond-item-state=processing-complete] .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-complete] .filepond--file-info-sub,[data-filepond-item-state=processing-complete] .filepond--processing-complete-indicator:not([style*=hidden])~.filepond--file-status .filepond--file-status-sub{opacity:0}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing~.filepond--file-info .filepond--file-info-sub{opacity:.5}[data-filepond-item-state*=error] .filepond--file-wrapper,[data-filepond-item-state*=error] .filepond--panel,[data-filepond-item-state*=invalid] .filepond--file-wrapper,[data-filepond-item-state*=invalid] .filepond--panel{-webkit-animation:shake .65s linear both;animation:shake .65s linear both}[data-filepond-item-state*=busy] .filepond--progress-indicator svg{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes shake{10%,90%{-webkit-transform:translateX(-.0625em);transform:translateX(-.0625em)}20%,80%{-webkit-transform:translateX(.125em);transform:translateX(.125em)}30%,50%,70%{-webkit-transform:translateX(-.25em);transform:translateX(-.25em)}40%,60%{-webkit-transform:translateX(.25em);transform:translateX(.25em)}}@keyframes shake{10%,90%{-webkit-transform:translateX(-.0625em);transform:translateX(-.0625em)}20%,80%{-webkit-transform:translateX(.125em);transform:translateX(.125em)}30%,50%,70%{-webkit-transform:translateX(-.25em);transform:translateX(-.25em)}40%,60%{-webkit-transform:translateX(.25em);transform:translateX(.25em)}}@-webkit-keyframes fall{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}70%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}to{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes fall{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}70%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}to{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.filepond--hopper[data-hopper-state=drag-over]>*{pointer-events:none}.filepond--hopper[data-hopper-state=drag-over]:after{content:\"\";position:absolute;left:0;top:0;right:0;bottom:0;z-index:100}.filepond--progress-indicator{z-index:103}.filepond--file-action-button{z-index:102}.filepond--file-status{z-index:101}.filepond--file-info{z-index:100}.filepond--item{position:absolute;top:0;left:0;right:0;z-index:1;padding:0;margin:.25em;will-change:transform,opacity;touch-action:auto}.filepond--item>.filepond--panel{z-index:-1}.filepond--item>.filepond--panel .filepond--panel-bottom{box-shadow:0 .0625em .125em -.0625em rgba(0,0,0,.25)}.filepond--item>.filepond--file-wrapper,.filepond--item>.filepond--panel{transition:opacity .15s ease-out}.filepond--item[data-drag-state]{cursor:-webkit-grab;cursor:grab}.filepond--item[data-drag-state]>.filepond--panel{transition:box-shadow .125s ease-in-out;box-shadow:0 0 0 transparent}.filepond--item[data-drag-state=drag]{cursor:-webkit-grabbing;cursor:grabbing}.filepond--item[data-drag-state=drag]>.filepond--panel{box-shadow:0 .125em .3125em rgba(0,0,0,.325)}.filepond--item[data-drag-state]:not([data-drag-state=idle]){z-index:2}.filepond--item-panel{background-color:#64605e}[data-filepond-item-state=processing-complete] .filepond--item-panel{background-color:#369763}[data-filepond-item-state*=error] .filepond--item-panel,[data-filepond-item-state*=invalid] .filepond--item-panel{background-color:#c44e47}.filepond--item-panel{border-radius:.5em;transition:background-color .25s}.filepond--list-scroller{position:absolute;top:0;left:0;right:0;margin:0;will-change:transform}.filepond--list-scroller[data-state=overflow] .filepond--list{bottom:0;right:0}.filepond--list-scroller[data-state=overflow]{overflow-y:scroll;overflow-x:hidden;-webkit-overflow-scrolling:touch;-webkit-mask:linear-gradient(180deg,#000 calc(100% - .5em),transparent);mask:linear-gradient(180deg,#000 calc(100% - .5em),transparent)}.filepond--list-scroller::-webkit-scrollbar{background:transparent}.filepond--list-scroller::-webkit-scrollbar:vertical{width:1em}.filepond--list-scroller::-webkit-scrollbar:horizontal{height:0}.filepond--list-scroller::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.3);border-radius:99999px;border:.3125em solid transparent;background-clip:content-box}.filepond--list.filepond--list{position:absolute;top:0;margin:0;padding:0;list-style-type:none;will-change:transform}.filepond--list{left:.75em;right:.75em}.filepond--root[data-style-panel-layout~=integrated]{width:100%;height:100%;max-width:none;margin:0}.filepond--root[data-style-panel-layout~=circle] .filepond--panel-root,.filepond--root[data-style-panel-layout~=integrated] .filepond--panel-root{border-radius:0}.filepond--root[data-style-panel-layout~=circle] .filepond--panel-root>*,.filepond--root[data-style-panel-layout~=integrated] .filepond--panel-root>*{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--drop-label,.filepond--root[data-style-panel-layout~=integrated] .filepond--drop-label{bottom:0;height:auto;display:flex;justify-content:center;align-items:center;z-index:7}.filepond--root[data-style-panel-layout~=circle] .filepond--item-panel,.filepond--root[data-style-panel-layout~=integrated] .filepond--item-panel{display:none}.filepond--root[data-style-panel-layout~=compact] .filepond--list-scroller,.filepond--root[data-style-panel-layout~=integrated] .filepond--list-scroller{overflow:hidden;height:100%;margin-top:0;margin-bottom:0}.filepond--root[data-style-panel-layout~=compact] .filepond--list,.filepond--root[data-style-panel-layout~=integrated] .filepond--list{left:0;right:0;height:100%}.filepond--root[data-style-panel-layout~=compact] .filepond--item,.filepond--root[data-style-panel-layout~=integrated] .filepond--item{margin:0}.filepond--root[data-style-panel-layout~=compact] .filepond--file-wrapper,.filepond--root[data-style-panel-layout~=integrated] .filepond--file-wrapper{height:100%}.filepond--root[data-style-panel-layout~=compact] .filepond--drop-label,.filepond--root[data-style-panel-layout~=integrated] .filepond--drop-label{z-index:7}.filepond--root[data-style-panel-layout~=circle]{border-radius:99999rem;overflow:hidden}.filepond--root[data-style-panel-layout~=circle]>.filepond--panel{border-radius:inherit}.filepond--root[data-style-panel-layout~=circle]>.filepond--panel>*{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--file-info,.filepond--root[data-style-panel-layout~=circle] .filepond--file-status{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--action-edit-item{opacity:1!important;visibility:visible!important}@media not all and (min-resolution:0.001dpcm){@supports (-webkit-appearance:none) and (stroke-color:transparent){.filepond--root[data-style-panel-layout~=circle]{will-change:transform}}}.filepond--panel-root{border-radius:.5em;background-color:#f1f0ef}.filepond--panel{position:absolute;left:0;top:0;right:0;margin:0;height:100%!important;pointer-events:none}.filepond-panel:not([data-scalable=false]){height:auto!important}.filepond--panel[data-scalable=false]>div{display:none}.filepond--panel[data-scalable=true]{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;background-color:transparent!important;border:none!important}.filepond--panel-bottom,.filepond--panel-center,.filepond--panel-top{position:absolute;left:0;top:0;right:0;margin:0;padding:0}.filepond--panel-bottom,.filepond--panel-top{height:.5em}.filepond--panel-top{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important;border-bottom:none!important}.filepond--panel-top:after{content:\"\";position:absolute;height:2px;left:0;right:0;bottom:-1px;background-color:inherit}.filepond--panel-bottom,.filepond--panel-center{will-change:transform;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:translate3d(0,.5em,0);transform:translate3d(0,.5em,0)}.filepond--panel-bottom{border-top-left-radius:0!important;border-top-right-radius:0!important;border-top:none!important}.filepond--panel-bottom:before{content:\"\";position:absolute;height:2px;left:0;right:0;top:-1px;background-color:inherit}.filepond--panel-center{height:100px!important;border-top:none!important;border-bottom:none!important;border-radius:0!important}.filepond--panel-center:not([style]){visibility:hidden}.filepond--progress-indicator{position:static;width:1.25em;height:1.25em;color:#fff;margin:0;pointer-events:none;will-change:transform,opacity}.filepond--progress-indicator svg{width:100%;height:100%;vertical-align:top;transform-box:fill-box}.filepond--progress-indicator path{fill:none;stroke:currentColor}.filepond--list-scroller{z-index:6}.filepond--drop-label{z-index:5}.filepond--drip{z-index:3}.filepond--root>.filepond--panel{z-index:2}.filepond--browser{z-index:1}.filepond--root{box-sizing:border-box;position:relative;margin-bottom:1em;font-size:1rem;line-height:normal;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-weight:450;text-align:left;text-rendering:optimizeLegibility;direction:ltr;contain:layout style size}.filepond--root *{box-sizing:inherit;line-height:inherit}.filepond--root :not(text){font-size:inherit}.filepond--root[data-disabled]{pointer-events:none}.filepond--root[data-disabled] .filepond--list-scroller{pointer-events:all}.filepond--root[data-disabled] .filepond--list{pointer-events:none}.filepond--root .filepond--drop-label{min-height:4.75em}.filepond--root .filepond--list-scroller{margin-top:1em;margin-bottom:1em}.filepond--root .filepond--credits{position:absolute;right:0;opacity:.4;line-height:.85;font-size:11px;color:inherit;text-decoration:none;z-index:3;bottom:-14px}.filepond--root .filepond--credits[style]{top:0;bottom:auto;margin-top:14px}\n/*!\n * FilePondPluginImagePreview 4.6.12\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */\n\n/* eslint-disable */\n.filepond--image-preview-markup {\n position: absolute;\n left: 0;\n top: 0;\n}\n.filepond--image-preview-wrapper {\n z-index: 2;\n}\n.filepond--image-preview-overlay {\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n min-height: 5rem;\n max-height: 7rem;\n margin: 0;\n opacity: 0;\n z-index: 2;\n pointer-events: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.filepond--image-preview-overlay svg {\n width: 100%;\n height: auto;\n color: inherit;\n max-height: inherit;\n}\n.filepond--image-preview-overlay-idle {\n mix-blend-mode: multiply;\n color: rgba(40, 40, 40, 0.85);\n}\n.filepond--image-preview-overlay-success {\n mix-blend-mode: normal;\n color: rgba(54, 151, 99, 1);\n}\n.filepond--image-preview-overlay-failure {\n mix-blend-mode: normal;\n color: rgba(196, 78, 71, 1);\n}\n/* disable for Safari as mix-blend-mode causes the overflow:hidden of the parent container to not work */\n@supports (-webkit-marquee-repetition: infinite) and\n ((-o-object-fit: fill) or (object-fit: fill)) {\n .filepond--image-preview-overlay-idle {\n mix-blend-mode: normal;\n }\n}\n.filepond--image-preview-wrapper {\n /* no interaction */\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n\n /* have preview fill up all available space */\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n height: 100%;\n margin: 0;\n\n /* radius is .05em less to prevent the panel background color from shining through */\n border-radius: 0.45em;\n overflow: hidden;\n\n /* this seems to prevent Chrome from redrawing this layer constantly */\n background: rgba(0, 0, 0, 0.01);\n}\n.filepond--image-preview {\n position: absolute;\n left: 0;\n top: 0;\n z-index: 1;\n display: flex; /* this aligns the graphic vertically if the panel is higher than the image */\n align-items: center;\n height: 100%;\n width: 100%;\n pointer-events: none;\n background: #222;\n\n /* will be animated */\n will-change: transform, opacity;\n}\n.filepond--image-clip {\n position: relative;\n overflow: hidden;\n margin: 0 auto;\n\n /* transparency indicator (currently only supports grid or basic color) */\n}\n.filepond--image-clip[data-transparency-indicator='grid'] img,\n.filepond--image-clip[data-transparency-indicator='grid'] canvas {\n background-color: #fff;\n background-image: url(\"data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg' fill='%23eee'%3E%3Cpath d='M0 0 H50 V50 H0'/%3E%3Cpath d='M50 50 H100 V100 H50'/%3E%3C/svg%3E\");\n background-size: 1.25em 1.25em;\n}\n.filepond--image-bitmap,\n.filepond--image-vector {\n position: absolute;\n left: 0;\n top: 0;\n will-change: transform;\n}\n.filepond--root[data-style-panel-layout~='integrated']\n .filepond--image-preview-wrapper {\n border-radius: 0;\n}\n.filepond--root[data-style-panel-layout~='integrated']\n .filepond--image-preview {\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.filepond--root[data-style-panel-layout~='circle']\n .filepond--image-preview-wrapper {\n border-radius: 99999rem;\n}\n.filepond--root[data-style-panel-layout~='circle']\n .filepond--image-preview-overlay {\n top: auto;\n bottom: 0;\n -webkit-transform: scaleY(-1);\n transform: scaleY(-1);\n}\n.filepond--root[data-style-panel-layout~='circle']\n .filepond--file\n .filepond--file-action-button[data-align*='bottom']:not([data-align*='center']) {\n margin-bottom: 0.325em;\n}\n.filepond--root[data-style-panel-layout~='circle']\n .filepond--file\n [data-align*='left'] {\n left: calc(50% - 3em);\n}\n.filepond--root[data-style-panel-layout~='circle']\n .filepond--file\n [data-align*='right'] {\n right: calc(50% - 3em);\n}\n.filepond--root[data-style-panel-layout~='circle']\n .filepond--progress-indicator[data-align*='bottom'][data-align*='left'],\n.filepond--root[data-style-panel-layout~='circle']\n .filepond--progress-indicator[data-align*='bottom'][data-align*='right'] {\n margin-bottom: calc(0.325em + 0.1875em);\n}\n.filepond--root[data-style-panel-layout~='circle']\n .filepond--progress-indicator[data-align*='bottom'][data-align*='center'] {\n margin-top: 0;\n margin-bottom: 0.1875em;\n margin-left: 0.1875em;\n}\n\n/*!\n * FilePondPluginImageEdit 1.6.3\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */\n\n/* eslint-disable */\n.filepond--action-edit-item.filepond--action-edit-item {\n width: 2em;\n height: 2em;\n padding: 0.1875em;\n}\n\n.filepond--action-edit-item.filepond--action-edit-item[data-align*='center'] {\n margin-left: -0.1875em;\n}\n\n.filepond--action-edit-item.filepond--action-edit-item[data-align*='bottom'] {\n margin-bottom: -0.1875em;\n}\n\n.filepond--action-edit-item-alt {\n border: none;\n line-height: inherit;\n background: transparent;\n font-family: inherit;\n color: inherit;\n outline: none;\n padding: 0;\n margin: 0 0 0 0.25em;\n pointer-events: all;\n position: absolute;\n}\n\n.filepond--action-edit-item-alt svg {\n width: 1.3125em;\n height: 1.3125em;\n}\n\n.filepond--action-edit-item-alt span {\n font-size: 0;\n opacity: 0;\n}\n.filepond--root[data-style-panel-layout~='circle'] .filepond--action-edit-item {\n opacity: 1 !important;\n visibility: visible !important;\n}\n\n.s-file-upload-wrapper .filepond--file-info-main {\n -webkit-line-clamp: 1;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n}\n.s-file-upload-has-gallery.s-file-upload-multiple .filepond--list-scroller {\n display: none !important;\n}\n.s-file-upload-has-gallery.s-file-upload-multiple .filepond--drop-label:not(.s-hidden) {\n cursor: pointer;\n}\n.s-file-upload-has-gallery.s-file-upload-multiple.s-file-upload-at-max .filepond--root {\n min-height: 120px;\n}\n.s-file-upload-has-gallery.s-file-upload-multiple .filepond--drop-label.s-file-upload-drop-label-disabled {\n visibility: visible !important;\n opacity: 0.55 !important;\n transform: none !important;\n height: auto !important;\n min-height: 4.75em !important;\n pointer-events: none !important;\n cursor: not-allowed;\n}\n.s-file-upload-has-gallery.s-file-upload-multiple .filepond--drop-label.s-file-upload-drop-label-disabled label {\n opacity: 1 !important;\n}\n.s-file-upload-wrapper .filepond--root[data-disabled] .filepond--drop-label label {\n opacity: 0.55;\n}\n.s-file-upload-gallery {\n --s-file-upload-preview-size: 75px;\n --s-file-upload-remove-size: 18px;\n --s-file-upload-remove-icon-size: 10px;\n --s-file-upload-gallery-gap: 12px;\n position: relative;\n margin-top: 0.5rem;\n padding-top: calc(var(--s-file-upload-remove-size) / 2);\n padding-inline-end: calc(var(--s-file-upload-remove-size) / 2);\n overflow: visible;\n}\n.s-file-upload-gallery-track {\n display: flex;\n gap: var(--s-file-upload-gallery-gap);\n width: 100%;\n min-height: var(--s-file-upload-preview-size);\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: thin;\n padding-bottom: 0.25rem;\n}\n.s-file-upload-gallery-item {\n position: relative;\n display: block;\n width: var(--s-file-upload-preview-size);\n height: var(--s-file-upload-preview-size);\n flex-shrink: 0;\n overflow: visible;\n}\n.s-file-upload-gallery-thumb {\n width: var(--s-file-upload-preview-size);\n height: var(--s-file-upload-preview-size);\n aspect-ratio: 1/1;\n border-radius: 0.375rem;\n overflow: hidden;\n background-color: #f3f4f6;\n cursor: pointer;\n position: relative;\n border: 1px solid #e5e7eb;\n box-sizing: border-box;\n}\n.s-file-upload-gallery-thumb.is-processing {\n opacity: 0.7;\n}\n.s-file-upload-gallery-thumb img {\n display: block;\n width: 100%;\n height: 100%;\n aspect-ratio: 1/1;\n object-fit: cover;\n}\n.s-file-upload-gallery-thumb video.s-file-upload-gallery-video-thumb {\n display: block;\n width: 100%;\n height: 100%;\n aspect-ratio: 1/1;\n object-fit: cover;\n pointer-events: none;\n}\n.s-file-upload-gallery-remove {\n position: absolute;\n top: 0;\n inset-inline-end: 0;\n inset-inline-start: auto;\n z-index: 5;\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--s-file-upload-remove-size);\n height: var(--s-file-upload-remove-size);\n padding: 0;\n line-height: 1;\n border-radius: 9999px;\n background-color: #fff;\n border: 1px solid #9ca3af;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);\n cursor: pointer;\n}\n.s-file-upload-gallery-remove:hover {\n background-color: #f9fafb;\n}\n.s-file-upload-gallery-remove svg {\n display: block;\n width: var(--s-file-upload-remove-icon-size);\n height: var(--s-file-upload-remove-icon-size);\n fill: #1f2937;\n pointer-events: none;\n}\n.s-file-upload-gallery-video-icon {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: rgba(0, 0, 0, 0.2);\n pointer-events: none;\n}\n.s-file-upload-gallery-video-icon svg {\n width: calc(var(--s-file-upload-preview-size) * 0.28);\n height: calc(var(--s-file-upload-preview-size) * 0.28);\n max-width: 2rem;\n max-height: 2rem;\n fill: #fff;\n opacity: 0.9;\n}\n.visible{\n visibility: visible;\n}\n.fixed{\n position: fixed;\n}\n.grid{\n display: grid;\n}\n.hidden{\n display: none;\n}\n.transform{\n 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));\n}\n.resize{\n resize: both;\n}\n.ps-2{\n padding-inline-start: 0.5rem;\n}\n.filter{\n 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);\n}\n.s-hidden{\n display: none;\n}\n.s-scrollbar::-webkit-scrollbar{\n width: 5px;\n}\n.s-scrollbar::-webkit-scrollbar-track{\n background-color: #eee;\n}\n.s-scrollbar::-webkit-scrollbar-thumb{\n background-color: var(--color-primary);\n border-radius: 10px;\n -webkit-border-radius: 10px;\n -moz-border-radius: 10px;\n -ms-border-radius: 10px;\n -o-border-radius: 10px;\n}\n.s-file-upload-wrapper .filepond--drop-label{\n height: 100%;\n cursor: pointer;\n border-radius: var(--s-radius, 0.25rem);\n border-width: 1px;\n border-style: dashed;\n --tw-border-opacity: 1;\n border-color: rgb(229 231 235 / var(--tw-border-opacity, 1));\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n --tw-text-opacity: 1;\n color: rgb(55 65 81 / var(--tw-text-opacity, 1));\n}\n.s-file-upload-wrapper .filepond--drop-label label{\n margin-top: 0.75rem;\n margin-bottom: 0.75rem;\n font-family: var(--font-main), -apple-system, BlinkMacSystemFont;\n}\n.s-file-upload-wrapper .filepond--label-action{\n text-decoration-color: #6b7280;\n}\n.s-file-upload-wrapper .filepond--panel-root{\n border-radius: var(--s-radius, 0.25rem);\n --tw-bg-opacity: 1 !important;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1)) !important;\n}\n.s-file-upload-profile-image .filepond--panel-root{\n border-radius: 9999px !important;\n}\n.s-file-upload:not(.s-file-upload-multiple) .s-file-upload-wrapper .filepond--list-scroller{\n overflow-y: inherit !important;\n overflow: inherit !important;\n margin: 0 !important;\n cursor: pointer !important;\n}\n.filepond--root{\n min-height: 120px !important;\n font-family: inherit !important;\n}\n.s-file-upload-wrapper .filepond--item-panel{\n --tw-bg-opacity: 1;\n background-color: rgb(55 65 81 / var(--tw-bg-opacity, 1));\n}\n.s-file-upload-wrapper .filepond--drip-blob{\n --tw-bg-opacity: 1;\n background-color: rgb(75 85 99 / var(--tw-bg-opacity, 1));\n}\n.s-file-upload-wrapper .filepond--list{\n left: 0px;\n width: 100%;\n}\n.s-file-upload-wrapper .filepond--file-poster-wrapper{\n position: absolute;\n left: 0px;\n top: 0px;\n right: 0px;\n margin: 0px;\n display: flex;\n height: 100%;\n width: 100%;\n user-select: none;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n border-radius: 0.45em;\n background-color: #00000003;\n}\n.s-file-upload-wrapper .filepond--file-poster{\n position: absolute;\n display: flex;\n height: 100%;\n align-items: center;\n justify-content: center;\n}\n.s-file-upload-wrapper .filepond--file-poster-overlay{\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n}\n.s-file-upload-wrapper .filepond--item{\n margin: 0px;\n}\n.s-file-upload-wrapper .filepond--file-info{\n margin: 0px;\n}\n.s-file-upload-wrapper .filepond--file-info-main{\n width: 85px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: normal;\n font-size: 0.75em;\n line-height: 1.2;\n}\n.s-file-upload-wrapper .filepond--file-status{\n width: 55%;\n}\n.s-file-upload-wrapper .filepond--file-status:where([dir=\"rtl\"], [dir=\"rtl\"] *){\n margin-right: 35px;\n}\n@media (min-width: 768px){\n .s-file-upload-wrapper .filepond--file-status:where([dir=\"rtl\"], [dir=\"rtl\"] *){\n margin-right: 2.25em;\n }\n}\n.s-file-upload-wrapper .filepond--file-status .filepond--file-status-sub{\n width: 275px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.s-file-upload-profile-image .filepond--root{\n height: 80px;\n min-height: 80px !important;\n width: 80px;\n border-radius: 9999px !important;\n}\n.s-file-upload-profile-image .filepond--drop-label{\n z-index: 7;\n min-height: 70px !important;\n border-radius: 9999px !important;\n border-style: none;\n}\n.s-file-upload-profile-image .filepond--drop-label label{\n cursor: pointer;\n padding-top: 20px;\n padding-bottom: 20px;\n padding-left: 6px;\n padding-right: 6px;\n font-size: 0.8rem;\n margin-top: 0.75rem;\n margin-bottom: 0.75rem;\n font-family: var(--font-main), -apple-system, BlinkMacSystemFont;\n}\n.s-file-upload-profile-image .filepond--file{\n padding: 0px;\n}\n.s-file-upload-profile-image .filepond--file .filepond--action-remove-item{\n top: auto !important;\n bottom: -4px;\n left: 50%;\n transform: translateX(-50%) translateY(25%) !important;\n background-color: rgba(255,68,58,.7);\n cursor: pointer;\n width: 20px;\n height: 20px;\n transition: 0.3s;\n}\n.s-file-upload-profile-image .filepond--file .filepond--action-remove-item:hover{\n background-color: #FF443A;\n}\n.s-file-upload-profile-image .filepond--file .filepond--file-action-button{\n top: 28px;\n right: 28px;\n}\n.s-file-upload-profile-image .filepond--file .filepond--progress-indicator,.s-file-upload-profile-image .filepond--file .filepond--load-indicator,.s-file-upload-profile-image .filepond--file .filepond--processing-complete-indicator{\n top: 48% !important;\n right: 50%;\n left: auto;\n transform: translateX(50%) translateY(-50%);\n}\n.s-file-upload-profile-image .filepond--item-panel{\n background-color: transparent !important;\n}\n.s-file-upload-.s-file-upload-profile-image .filepond--item-panel .filepond--panel-top,.s-file-upload-profile-image .filepond--item-panel .filepond--panel-center,.s-file-upload-profile-image .filepond--item-panel .filepond--panel-bottom{\n display: none;\n}\n.s-file-upload-profile-image .filepond--file-poster-overlay{\n display: none;\n}\n.s-file-upload-profile-image .filepond--item{\n margin: 0px !important;\n height: 5rem !important;\n}\n.s-file-upload-profile-image .filepond--file-poster{\n height: 100%;\n width: 100%;\n}\n.s-file-upload-profile-image .filepond--file-status{\n display: none;\n}\n.s-file-upload-profile-image .filepond--image-preview-overlay-success{\n top: auto;\n bottom: 0px;\n --tw-scale-y: -1;\n 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));\n}\n.s-file-upload-profile-image .filepond--image-preview-wrapper{\n border-radius: 9999px;\n}\n.s-file-upload-profile-image .filepond--file-info{\n display: none;\n}\n.s-file-upload-profile-image .filepond--list{\n left: 0px;\n right: 0px;\n height: 100%;\n}\n.s-file-upload-profile-image .filepond--file-poster img{\n height: 100%;\n width: 100%;\n border-radius: 9999px;\n object-fit: cover;\n}\n.s-file-upload-profile-image .filepond--file-poster-wrapper{\n overflow: hidden;\n border-radius: 9999px;\n}\n.s-file-upload-profile-image .s-file-upload-has-error .filepond--file-status{\n position: absolute;\n bottom: -62%;\n left: -190%;\n display: flex !important;\n height: auto;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n font-size: 1rem;\n line-height: 1.5rem;\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity, 1));\n}\n.s-file-upload-multiple .filepond--root{\n max-height: 120px;\n}\n.s-file-upload-multiple .filepond--list-scroller{\n top: 0px;\n margin-top: 0px;\n margin-bottom: 0px;\n height: 100%;\n overflow-y: scroll;\n}\n.s-file-upload-multiple .filepond--drop-label:not(.s-hidden) + .filepond--list-scroller{\n display: none;\n}\n.s-file-upload-multiple .filepond--item{\n @media(min-width: 767px){\n width: calc(33.33% - .5em);\n margin-left: .3em !important;\n }\n @media(max-width: 767px){\n margin-bottom: .3em;\n }\n}\n.s-file-upload-hint{\n margin-top: -15px;\n font-size: 0.875rem;\n line-height: 1.25rem;\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / var(--tw-text-opacity, 1));\n}\n.s-product-options-image-input .s-file-upload-wrapper{\n min-height: 120px;\n}\n";
|
|
830
1159
|
|
|
1160
|
+
const VIDEO_METADATA_TIMEOUT_MS = 10000;
|
|
831
1161
|
const SallaFileUpload = class {
|
|
832
1162
|
/**
|
|
833
1163
|
* Lazy load FilePond and all plugins
|
|
@@ -838,13 +1168,13 @@ const SallaFileUpload = class {
|
|
|
838
1168
|
return;
|
|
839
1169
|
try {
|
|
840
1170
|
const [FilePondModule, FilePondPluginFileValidateSize, FilePondPluginImageExifOrientation, FilePondPluginImagePreview, FilePondPluginImageEdit, FilePondPluginFileValidateType, FilePondPluginFilePoster] = await Promise.all([
|
|
841
|
-
Promise.resolve().then(function () { return require('./filepond-
|
|
842
|
-
Promise.resolve().then(function () { return require('./filepond-plugin-file-validate-size-
|
|
843
|
-
Promise.resolve().then(function () { return require('./filepond-plugin-image-exif-orientation-
|
|
844
|
-
Promise.resolve().then(function () { return require('./filepond-plugin-image-preview-
|
|
845
|
-
Promise.resolve().then(function () { return require('./filepond-plugin-image-edit-
|
|
846
|
-
Promise.resolve().then(function () { return require('./filepond-plugin-file-validate-type-
|
|
847
|
-
Promise.resolve().then(function () { return require('./filepond-plugin-file-poster-
|
|
1171
|
+
Promise.resolve().then(function () { return require('./filepond-CNdvfaMJ.js'); }).then(function (n) { return n.filepond; }),
|
|
1172
|
+
Promise.resolve().then(function () { return require('./filepond-plugin-file-validate-size-BiRa98qd.js'); }).then(function (n) { return n.filepondPluginFileValidateSize; }),
|
|
1173
|
+
Promise.resolve().then(function () { return require('./filepond-plugin-image-exif-orientation-Bwa8QtGo.js'); }).then(function (n) { return n.filepondPluginImageExifOrientation; }),
|
|
1174
|
+
Promise.resolve().then(function () { return require('./filepond-plugin-image-preview-CaVYLAvG.js'); }).then(function (n) { return n.filepondPluginImagePreview; }),
|
|
1175
|
+
Promise.resolve().then(function () { return require('./filepond-plugin-image-edit-AN6huMV9.js'); }).then(function (n) { return n.filepondPluginImageEdit; }),
|
|
1176
|
+
Promise.resolve().then(function () { return require('./filepond-plugin-file-validate-type-Bolv-kyJ.js'); }).then(function (n) { return n.filepondPluginFileValidateType; }),
|
|
1177
|
+
Promise.resolve().then(function () { return require('./filepond-plugin-file-poster-Di_D3w89.js'); }).then(function (n) { return n.filepondPluginFilePoster; })
|
|
848
1178
|
]);
|
|
849
1179
|
this.FilePond = FilePondModule;
|
|
850
1180
|
// Register plugins
|
|
@@ -863,12 +1193,32 @@ const SallaFileUpload = class {
|
|
|
863
1193
|
this.invalidInput = index.createEvent(this, "invalidInput");
|
|
864
1194
|
this.uploaded = index.createEvent(this, "uploaded");
|
|
865
1195
|
this.removed = index.createEvent(this, "removed");
|
|
1196
|
+
this.galleryUpdated = index.createEvent(this, "galleryUpdated");
|
|
866
1197
|
this.filePondLoaded = false;
|
|
867
1198
|
this.max_images_count = (count) => salla.lang.get('common.uploader.max_images_count', { count });
|
|
1199
|
+
this.max_videos_count = (count) => salla.lang.get('common.uploader.max_videos_count', { count });
|
|
868
1200
|
this.max_count_hint = (count) => salla.lang.get('common.uploader.max_count_hint', { count });
|
|
1201
|
+
this.video_too_large = (size) => salla.lang.get('common.uploader.video_too_large', { size });
|
|
1202
|
+
this.video_too_long = (duration) => salla.lang.get('common.uploader.video_too_long', { duration });
|
|
869
1203
|
this.uploadedFiles = [];
|
|
870
1204
|
this.isListScrollerListenerAdded = false;
|
|
871
1205
|
this.showMaxCountHint = false;
|
|
1206
|
+
this.previewFiles = [];
|
|
1207
|
+
this.maxFilesNotified = false;
|
|
1208
|
+
this.validationRejectedFileIds = new Set();
|
|
1209
|
+
this.previewFilesSyncRaf = null;
|
|
1210
|
+
/**
|
|
1211
|
+
* Transient reservations for files currently passing add-validation, keyed by
|
|
1212
|
+
* FilePond file id. FilePond runs beforeAddFile async and only inserts a file
|
|
1213
|
+
* into `getFiles()` after validation resolves, so a batch of parallel picks
|
|
1214
|
+
* would race if we counted the pond alone. We reserve a slot here synchronously
|
|
1215
|
+
* for the in-flight window and always release it in `onaddfile` (once the file
|
|
1216
|
+
* is committed to the pond and counted from there). Because committed files are
|
|
1217
|
+
* always counted from `getFiles()` — never from this map — it cannot drift and
|
|
1218
|
+
* "stick" the uploader at its limit across delete/re-upload cycles.
|
|
1219
|
+
*/
|
|
1220
|
+
this.inFlightFiles = new Map();
|
|
1221
|
+
this.previewObjectUrls = new Map();
|
|
872
1222
|
/**
|
|
873
1223
|
* Set the component to be profile image uploader with a preview and a circular shape
|
|
874
1224
|
*/
|
|
@@ -897,6 +1247,10 @@ const SallaFileUpload = class {
|
|
|
897
1247
|
* Enable or disable file browser
|
|
898
1248
|
*/
|
|
899
1249
|
this.allowBrowse = true;
|
|
1250
|
+
/**
|
|
1251
|
+
* Enable the custom gallery preview instead of FilePond thumbnails.
|
|
1252
|
+
*/
|
|
1253
|
+
this.enableGallery = false;
|
|
900
1254
|
/**
|
|
901
1255
|
* Allow drop to replace a file, only works when allowMultiple is false
|
|
902
1256
|
*/
|
|
@@ -914,7 +1268,8 @@ const SallaFileUpload = class {
|
|
|
914
1268
|
*/
|
|
915
1269
|
this.allowImagePreview = true;
|
|
916
1270
|
/**
|
|
917
|
-
* Fixed image preview height, overrides min and max preview height
|
|
1271
|
+
* Fixed image preview height, overrides min and max preview height.
|
|
1272
|
+
* Also sets the gallery thumbnail size when using the swiper preview (default: 75px).
|
|
918
1273
|
*/
|
|
919
1274
|
this.imagePreviewHeight = null;
|
|
920
1275
|
/**
|
|
@@ -982,8 +1337,9 @@ const SallaFileUpload = class {
|
|
|
982
1337
|
*/
|
|
983
1338
|
this.iconUndo = '<svg>...</svg>';
|
|
984
1339
|
this.openFileBrowser = () => {
|
|
985
|
-
this.filepond
|
|
1340
|
+
this.filepond?.browse();
|
|
986
1341
|
};
|
|
1342
|
+
this.usesGalleryPreview = () => this.enableGallery;
|
|
987
1343
|
//if cartItemIdIsPassed, we need to set the url
|
|
988
1344
|
if (!this.url && this.cartItemId) {
|
|
989
1345
|
this.url = salla.cart.getUploadImageEndpoint();
|
|
@@ -1023,13 +1379,22 @@ const SallaFileUpload = class {
|
|
|
1023
1379
|
});
|
|
1024
1380
|
};
|
|
1025
1381
|
const setTranslations = async () => {
|
|
1026
|
-
await setNestedAsync('ar.trans', 'common.uploader.max_images_count', '
|
|
1382
|
+
await setNestedAsync('ar.trans', 'common.uploader.max_images_count', 'أضف :count صور كحد أقصى');
|
|
1027
1383
|
await setNestedAsync('en.trans', 'common.uploader.max_images_count', 'Add up to :count images maximum.');
|
|
1028
1384
|
await setNestedAsync('ar.trans', 'common.uploader.max_count_hint', 'يمكنك رفع حتى :count صور');
|
|
1029
1385
|
await setNestedAsync('en.trans', 'common.uploader.max_count_hint', 'You can upload up to :count images.');
|
|
1386
|
+
await setNestedAsync('ar.trans', 'common.uploader.max_videos_count', 'أضف :count فيديوهات كحد أقصى');
|
|
1387
|
+
await setNestedAsync('en.trans', 'common.uploader.max_videos_count', 'Add up to :count videos maximum.');
|
|
1388
|
+
await setNestedAsync('ar.trans', 'common.uploader.video_too_large', 'حجم الفيديو يتجاوز الحد المسموح (:size)');
|
|
1389
|
+
await setNestedAsync('en.trans', 'common.uploader.video_too_large', 'Video size exceeds the allowed limit (:size)');
|
|
1390
|
+
await setNestedAsync('ar.trans', 'common.uploader.video_too_long', 'مدة الفيديو تتجاوز الحد المسموح (:duration)');
|
|
1391
|
+
await setNestedAsync('en.trans', 'common.uploader.video_too_long', 'Video duration exceeds the allowed limit (:duration)');
|
|
1030
1392
|
};
|
|
1031
1393
|
this.max_count_hint = (count) => salla.lang.get('common.uploader.max_count_hint', { count });
|
|
1032
1394
|
this.max_images_count = (count) => salla.lang.get('common.uploader.max_images_count', { count });
|
|
1395
|
+
this.max_videos_count = (count) => salla.lang.get('common.uploader.max_videos_count', { count });
|
|
1396
|
+
this.video_too_large = (size) => salla.lang.get('common.uploader.video_too_large', { size });
|
|
1397
|
+
this.video_too_long = (duration) => salla.lang.get('common.uploader.video_too_long', { duration });
|
|
1033
1398
|
setTranslations();
|
|
1034
1399
|
});
|
|
1035
1400
|
}
|
|
@@ -1051,13 +1416,23 @@ const SallaFileUpload = class {
|
|
|
1051
1416
|
}
|
|
1052
1417
|
uploadedHandler() {
|
|
1053
1418
|
let fileInput = this.getFormDataFileInput();
|
|
1419
|
+
const hiddenValue = this.getHiddenInputValue();
|
|
1054
1420
|
fileInput.type = 'hidden';
|
|
1055
|
-
fileInput.value =
|
|
1056
|
-
this.hiddenInput.value =
|
|
1421
|
+
fileInput.value = hiddenValue;
|
|
1422
|
+
this.hiddenInput.value = hiddenValue;
|
|
1057
1423
|
fileInput.dispatchEvent(new window.Event('change', { bubbles: true }));
|
|
1058
1424
|
return this.uploaded.emit(this.value);
|
|
1059
1425
|
}
|
|
1060
|
-
|
|
1426
|
+
emitRemovedFile(deletedFile) {
|
|
1427
|
+
const removedId = deletedFile.getMetadata('id') ||
|
|
1428
|
+
deletedFile.getMetadata('url') ||
|
|
1429
|
+
deletedFile.serverId ||
|
|
1430
|
+
deletedFile.id;
|
|
1431
|
+
return this.removed.emit(removedId);
|
|
1432
|
+
}
|
|
1433
|
+
removedHandler(deletedFile, options = {}) {
|
|
1434
|
+
this.releaseAcceptedFile(deletedFile.id);
|
|
1435
|
+
this.releasePreviewObjectUrl(deletedFile.id);
|
|
1061
1436
|
let fileInput = this.getFormDataFileInput();
|
|
1062
1437
|
fileInput.type = 'hidden';
|
|
1063
1438
|
fileInput.value = '';
|
|
@@ -1068,10 +1443,13 @@ const SallaFileUpload = class {
|
|
|
1068
1443
|
if (this.height) {
|
|
1069
1444
|
setTimeout(() => this.host.querySelector('.filepond--root').style.height = this.height, 1000);
|
|
1070
1445
|
}
|
|
1071
|
-
this.
|
|
1446
|
+
if (!this.usesGalleryPreview()) {
|
|
1447
|
+
this.hiddenInput.value = '';
|
|
1448
|
+
}
|
|
1072
1449
|
fileInput.dispatchEvent(new window.Event('change', { bubbles: true }));
|
|
1073
|
-
|
|
1074
|
-
|
|
1450
|
+
if (!options.skipEmit) {
|
|
1451
|
+
this.emitRemovedFile(deletedFile);
|
|
1452
|
+
}
|
|
1075
1453
|
}
|
|
1076
1454
|
/**
|
|
1077
1455
|
* Method to set option for filepond
|
|
@@ -1079,6 +1457,12 @@ const SallaFileUpload = class {
|
|
|
1079
1457
|
async setOption(key, value) {
|
|
1080
1458
|
this.filepond[key] = value;
|
|
1081
1459
|
}
|
|
1460
|
+
generateUploadFileId() {
|
|
1461
|
+
if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {
|
|
1462
|
+
return `${this.host.id}-${crypto.randomUUID()}`;
|
|
1463
|
+
}
|
|
1464
|
+
return `${this.host.id}-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
|
|
1465
|
+
}
|
|
1082
1466
|
getLabel() {
|
|
1083
1467
|
if (this.labelIdle) {
|
|
1084
1468
|
//some times we are passing label before translations is loaded, so here we will make sure that all translations are translated
|
|
@@ -1101,6 +1485,514 @@ const SallaFileUpload = class {
|
|
|
1101
1485
|
getFormDataFileInput() {
|
|
1102
1486
|
return this.host.querySelector('.filepond--data input');
|
|
1103
1487
|
}
|
|
1488
|
+
isValidPreviewUrl(url) {
|
|
1489
|
+
return typeof url === 'string' && (url.startsWith('http') ||
|
|
1490
|
+
url.startsWith('blob:') ||
|
|
1491
|
+
url.startsWith('data:') ||
|
|
1492
|
+
url.startsWith('/'));
|
|
1493
|
+
}
|
|
1494
|
+
getHiddenInputValue() {
|
|
1495
|
+
if (this.usesGalleryPreview()) {
|
|
1496
|
+
return this.previewFiles.map(file => file.url).join(',');
|
|
1497
|
+
}
|
|
1498
|
+
if (typeof this.value === 'object' && this.value?.url) {
|
|
1499
|
+
return this.value.url;
|
|
1500
|
+
}
|
|
1501
|
+
return this.value || '';
|
|
1502
|
+
}
|
|
1503
|
+
usesSplitCountLimits() {
|
|
1504
|
+
return uploadLimits.usesSplitCountLimits(this.maxImagesCount, this.maxVideosCount);
|
|
1505
|
+
}
|
|
1506
|
+
hasImageLimit() {
|
|
1507
|
+
return this.maxImagesCount != null;
|
|
1508
|
+
}
|
|
1509
|
+
hasVideoLimit() {
|
|
1510
|
+
return this.maxVideosCount != null;
|
|
1511
|
+
}
|
|
1512
|
+
getMaxImagesCount() {
|
|
1513
|
+
return uploadLimits.getMaxImagesCount(this.maxImagesCount);
|
|
1514
|
+
}
|
|
1515
|
+
getMaxVideosCount() {
|
|
1516
|
+
return uploadLimits.getMaxVideosCount(this.maxVideosCount);
|
|
1517
|
+
}
|
|
1518
|
+
getTotalMaxFiles() {
|
|
1519
|
+
return uploadLimits.getTotalMaxFiles(this.maxFilesCount, this.maxImagesCount, this.maxVideosCount);
|
|
1520
|
+
}
|
|
1521
|
+
getImageMaxFileSizeString() {
|
|
1522
|
+
const storeSize = salla.config.get('store.settings.upload_size');
|
|
1523
|
+
if (storeSize)
|
|
1524
|
+
return `${storeSize}KB`;
|
|
1525
|
+
return this.maxFileSize;
|
|
1526
|
+
}
|
|
1527
|
+
getImageMaxFileSizeBytes() {
|
|
1528
|
+
const size = this.getImageMaxFileSizeString();
|
|
1529
|
+
return size ? uploadLimits.parseSizeToBytes(size) : null;
|
|
1530
|
+
}
|
|
1531
|
+
getVideoMaxFileSizeBytes() {
|
|
1532
|
+
if (this.maxVideoFileSize)
|
|
1533
|
+
return uploadLimits.parseSizeToBytes(this.maxVideoFileSize);
|
|
1534
|
+
return this.getImageMaxFileSizeBytes();
|
|
1535
|
+
}
|
|
1536
|
+
getFilePondMaxFileSizeValue() {
|
|
1537
|
+
return uploadLimits.getFilePondMaxFileSize(this.maxFileSize, salla.config.get('store.settings.upload_size'), this.maxVideoFileSize);
|
|
1538
|
+
}
|
|
1539
|
+
getFileMimeType(file) {
|
|
1540
|
+
if (file instanceof File) {
|
|
1541
|
+
return file.type;
|
|
1542
|
+
}
|
|
1543
|
+
return file.mimeType;
|
|
1544
|
+
}
|
|
1545
|
+
getFileUrlOrName(file) {
|
|
1546
|
+
if (file instanceof File) {
|
|
1547
|
+
return file.name;
|
|
1548
|
+
}
|
|
1549
|
+
return file.url;
|
|
1550
|
+
}
|
|
1551
|
+
isVideoFile(file) {
|
|
1552
|
+
return uploadLimits.isVideoMimeType(this.getFileMimeType(file), this.getFileUrlOrName(file));
|
|
1553
|
+
}
|
|
1554
|
+
getPondItemNameOrUrl(item) {
|
|
1555
|
+
const file = item.file;
|
|
1556
|
+
// Pre-loaded (local) files may not have a populated File object yet, so fall
|
|
1557
|
+
// back to metadata url/name for reliable type detection.
|
|
1558
|
+
return (file?.name ||
|
|
1559
|
+
item.getMetadata?.('url') ||
|
|
1560
|
+
item.getMetadata?.('name') ||
|
|
1561
|
+
item.getMetadata?.('poster'));
|
|
1562
|
+
}
|
|
1563
|
+
isVideoFileFromPond(item) {
|
|
1564
|
+
const file = item.file;
|
|
1565
|
+
return uploadLimits.isVideoMimeType(file?.type || item.fileType, this.getPondItemNameOrUrl(item));
|
|
1566
|
+
}
|
|
1567
|
+
isImageFileFromPond(item) {
|
|
1568
|
+
const file = item.file;
|
|
1569
|
+
return uploadLimits.isImageMimeType(file?.type || item.fileType, this.getPondItemNameOrUrl(item));
|
|
1570
|
+
}
|
|
1571
|
+
getFileTypeCategory(item) {
|
|
1572
|
+
if (this.isVideoFileFromPond(item))
|
|
1573
|
+
return 'video';
|
|
1574
|
+
if (this.isImageFileFromPond(item))
|
|
1575
|
+
return 'image';
|
|
1576
|
+
return 'other';
|
|
1577
|
+
}
|
|
1578
|
+
/**
|
|
1579
|
+
* Effective count for a type = files committed to the pond + still-in-flight
|
|
1580
|
+
* reservations that are not yet in the pond. Committed files come straight from
|
|
1581
|
+
* `getFiles()` (the source of truth), so this self-heals after deletes and can
|
|
1582
|
+
* never leave the uploader stuck at its limit.
|
|
1583
|
+
*/
|
|
1584
|
+
countAcceptedByType(type, excludeId) {
|
|
1585
|
+
const pondItems = this.getCountableGalleryItems();
|
|
1586
|
+
const pondIds = new Set(pondItems.map(item => item.id));
|
|
1587
|
+
let count = pondItems.filter(item => item.id !== excludeId && this.getFileTypeCategory(item) === type).length;
|
|
1588
|
+
this.inFlightFiles.forEach((value, id) => {
|
|
1589
|
+
if (value === type && id !== excludeId && !pondIds.has(id))
|
|
1590
|
+
count += 1;
|
|
1591
|
+
});
|
|
1592
|
+
return count;
|
|
1593
|
+
}
|
|
1594
|
+
/** Effective total across all types (committed pond files + in-flight reservations). */
|
|
1595
|
+
countAcceptedTotal(excludeId) {
|
|
1596
|
+
const pondItems = this.getCountableGalleryItems().filter(item => item.id !== excludeId);
|
|
1597
|
+
const pondIds = new Set(pondItems.map(item => item.id));
|
|
1598
|
+
let count = pondItems.length;
|
|
1599
|
+
this.inFlightFiles.forEach((_value, id) => {
|
|
1600
|
+
if (id !== excludeId && !pondIds.has(id))
|
|
1601
|
+
count += 1;
|
|
1602
|
+
});
|
|
1603
|
+
return count;
|
|
1604
|
+
}
|
|
1605
|
+
reserveAcceptedFile(id, type) {
|
|
1606
|
+
this.inFlightFiles.set(id, type);
|
|
1607
|
+
}
|
|
1608
|
+
releaseAcceptedFile(id) {
|
|
1609
|
+
this.inFlightFiles.delete(id);
|
|
1610
|
+
}
|
|
1611
|
+
getVideoDuration(file) {
|
|
1612
|
+
return new Promise((resolve, reject) => {
|
|
1613
|
+
const video = document.createElement('video');
|
|
1614
|
+
video.preload = 'metadata';
|
|
1615
|
+
const url = URL.createObjectURL(file);
|
|
1616
|
+
let settled = false;
|
|
1617
|
+
const cleanup = () => {
|
|
1618
|
+
clearTimeout(timeoutId);
|
|
1619
|
+
video.onloadedmetadata = null;
|
|
1620
|
+
video.onerror = null;
|
|
1621
|
+
video.removeAttribute('src');
|
|
1622
|
+
video.load();
|
|
1623
|
+
URL.revokeObjectURL(url);
|
|
1624
|
+
};
|
|
1625
|
+
const finish = (duration, error) => {
|
|
1626
|
+
if (settled) {
|
|
1627
|
+
return;
|
|
1628
|
+
}
|
|
1629
|
+
settled = true;
|
|
1630
|
+
cleanup();
|
|
1631
|
+
if (error) {
|
|
1632
|
+
reject(error);
|
|
1633
|
+
return;
|
|
1634
|
+
}
|
|
1635
|
+
resolve(duration ?? 0);
|
|
1636
|
+
};
|
|
1637
|
+
const timeoutId = window.setTimeout(() => {
|
|
1638
|
+
finish(undefined, new Error('Timed out loading video metadata'));
|
|
1639
|
+
}, VIDEO_METADATA_TIMEOUT_MS);
|
|
1640
|
+
video.onloadedmetadata = () => {
|
|
1641
|
+
finish(video.duration);
|
|
1642
|
+
};
|
|
1643
|
+
video.onerror = () => {
|
|
1644
|
+
finish(undefined, new Error('Failed to load video metadata'));
|
|
1645
|
+
};
|
|
1646
|
+
video.src = url;
|
|
1647
|
+
});
|
|
1648
|
+
}
|
|
1649
|
+
notifyMaxImagesLimit() {
|
|
1650
|
+
if (this.maxFilesNotified)
|
|
1651
|
+
return;
|
|
1652
|
+
this.maxFilesNotified = true;
|
|
1653
|
+
salla.notify.error(this.max_images_count(this.getMaxImagesCount()));
|
|
1654
|
+
setTimeout(() => {
|
|
1655
|
+
this.maxFilesNotified = false;
|
|
1656
|
+
}, 500);
|
|
1657
|
+
}
|
|
1658
|
+
notifyMaxVideosLimit() {
|
|
1659
|
+
if (this.maxFilesNotified)
|
|
1660
|
+
return;
|
|
1661
|
+
this.maxFilesNotified = true;
|
|
1662
|
+
salla.notify.error(this.max_videos_count(this.getMaxVideosCount()));
|
|
1663
|
+
setTimeout(() => {
|
|
1664
|
+
this.maxFilesNotified = false;
|
|
1665
|
+
}, 500);
|
|
1666
|
+
}
|
|
1667
|
+
notifyMaxFilesLimit() {
|
|
1668
|
+
if (this.maxFilesNotified)
|
|
1669
|
+
return;
|
|
1670
|
+
this.maxFilesNotified = true;
|
|
1671
|
+
if (this.usesSplitCountLimits() && this.hasImageLimit()) {
|
|
1672
|
+
salla.notify.error(this.max_images_count(this.getMaxImagesCount()));
|
|
1673
|
+
}
|
|
1674
|
+
else {
|
|
1675
|
+
salla.notify.error(this.max_images_count(this.maxFilesCount));
|
|
1676
|
+
}
|
|
1677
|
+
setTimeout(() => {
|
|
1678
|
+
this.maxFilesNotified = false;
|
|
1679
|
+
}, 500);
|
|
1680
|
+
}
|
|
1681
|
+
markValidationRejected(fileId) {
|
|
1682
|
+
this.validationRejectedFileIds.add(fileId);
|
|
1683
|
+
window.setTimeout(() => this.validationRejectedFileIds.delete(fileId), 1000);
|
|
1684
|
+
}
|
|
1685
|
+
getUploadErrorMessageForFile(error, file) {
|
|
1686
|
+
const fileType = file ? this.getFileTypeCategory(file) : 'other';
|
|
1687
|
+
const maxVideoBytes = this.getVideoMaxFileSizeBytes();
|
|
1688
|
+
return uploadLimits.getUploadErrorMessage(error, {
|
|
1689
|
+
isVideo: fileType === 'video',
|
|
1690
|
+
maxVideoFileSizeLabel: this.maxVideoFileSize,
|
|
1691
|
+
maxVideoBytes: maxVideoBytes,
|
|
1692
|
+
tooLargeLabel: salla.lang.get('common.uploader.too_large'),
|
|
1693
|
+
invalidTypeLabel: salla.lang.get('common.uploader.invalid_type'),
|
|
1694
|
+
genericErrorLabel: salla.lang.get('common.errors.error_occurred'),
|
|
1695
|
+
videoTooLarge: (size) => this.video_too_large(size || uploadLimits.formatBytesAsSize(maxVideoBytes || 0)),
|
|
1696
|
+
});
|
|
1697
|
+
}
|
|
1698
|
+
notifyUploadError(error, file) {
|
|
1699
|
+
salla.notify?.error?.(this.getUploadErrorMessageForFile(error, file));
|
|
1700
|
+
}
|
|
1701
|
+
removeFailedFile(file) {
|
|
1702
|
+
if (!this.filepond?.getFiles().some(pondFile => pondFile.id === file.id)) {
|
|
1703
|
+
return;
|
|
1704
|
+
}
|
|
1705
|
+
this.filepond.removeFile(file.id, { revert: false });
|
|
1706
|
+
}
|
|
1707
|
+
async validateBeforeAddFile(item) {
|
|
1708
|
+
const file = item.file instanceof Blob ? item.file : undefined;
|
|
1709
|
+
const fileType = this.getFileTypeCategory(item);
|
|
1710
|
+
if (this.usesSplitCountLimits()) {
|
|
1711
|
+
if (fileType === 'other') {
|
|
1712
|
+
salla.notify.error(salla.lang.get('common.uploader.invalid_type'));
|
|
1713
|
+
this.markValidationRejected(item.id);
|
|
1714
|
+
return false;
|
|
1715
|
+
}
|
|
1716
|
+
if (fileType === 'image' && !this.hasImageLimit()) {
|
|
1717
|
+
salla.notify.error(salla.lang.get('common.uploader.invalid_type'));
|
|
1718
|
+
this.markValidationRejected(item.id);
|
|
1719
|
+
return false;
|
|
1720
|
+
}
|
|
1721
|
+
if (fileType === 'video' && !this.hasVideoLimit()) {
|
|
1722
|
+
salla.notify.error(salla.lang.get('common.uploader.invalid_type'));
|
|
1723
|
+
this.markValidationRejected(item.id);
|
|
1724
|
+
return false;
|
|
1725
|
+
}
|
|
1726
|
+
const maxForType = fileType === 'video' ? this.getMaxVideosCount() : this.getMaxImagesCount();
|
|
1727
|
+
if (this.countAcceptedByType(fileType, item.id) >= maxForType) {
|
|
1728
|
+
if (fileType === 'video') {
|
|
1729
|
+
this.notifyMaxVideosLimit();
|
|
1730
|
+
}
|
|
1731
|
+
else {
|
|
1732
|
+
this.notifyMaxImagesLimit();
|
|
1733
|
+
}
|
|
1734
|
+
this.markValidationRejected(item.id);
|
|
1735
|
+
return false;
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
else {
|
|
1739
|
+
if (this.countAcceptedTotal(item.id) >= this.maxFilesCount) {
|
|
1740
|
+
this.notifyMaxFilesLimit();
|
|
1741
|
+
this.markValidationRejected(item.id);
|
|
1742
|
+
return false;
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
// Reserve the slot synchronously so parallel batch adds can't exceed the limit.
|
|
1746
|
+
this.reserveAcceptedFile(item.id, fileType);
|
|
1747
|
+
// Pre-loaded local files (edit mode) may not have a Blob yet; metadata is enough.
|
|
1748
|
+
if (!file) {
|
|
1749
|
+
return true;
|
|
1750
|
+
}
|
|
1751
|
+
if (fileType === 'video') {
|
|
1752
|
+
const maxSize = this.getVideoMaxFileSizeBytes();
|
|
1753
|
+
if (maxSize && file.size > maxSize) {
|
|
1754
|
+
salla.notify.error(this.video_too_large(this.maxVideoFileSize || uploadLimits.formatBytesAsSize(maxSize)));
|
|
1755
|
+
this.releaseAcceptedFile(item.id);
|
|
1756
|
+
this.markValidationRejected(item.id);
|
|
1757
|
+
return false;
|
|
1758
|
+
}
|
|
1759
|
+
if (this.maxVideoDuration) {
|
|
1760
|
+
try {
|
|
1761
|
+
const duration = await this.getVideoDuration(file);
|
|
1762
|
+
if (duration > this.maxVideoDuration) {
|
|
1763
|
+
salla.notify.error(this.video_too_long(uploadLimits.formatDuration(this.maxVideoDuration)));
|
|
1764
|
+
this.releaseAcceptedFile(item.id);
|
|
1765
|
+
this.markValidationRejected(item.id);
|
|
1766
|
+
return false;
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
catch {
|
|
1770
|
+
salla.notify.error(salla.lang.get('common.uploader.failed_to_load'));
|
|
1771
|
+
this.releaseAcceptedFile(item.id);
|
|
1772
|
+
this.markValidationRejected(item.id);
|
|
1773
|
+
return false;
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
else if (fileType === 'image') {
|
|
1778
|
+
const maxSize = this.getImageMaxFileSizeBytes();
|
|
1779
|
+
if (maxSize && file.size > maxSize) {
|
|
1780
|
+
salla.notify.error(salla.lang.get('common.uploader.too_large'));
|
|
1781
|
+
this.releaseAcceptedFile(item.id);
|
|
1782
|
+
this.markValidationRejected(item.id);
|
|
1783
|
+
return false;
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
else if (this.usesSplitCountLimits()) {
|
|
1787
|
+
salla.notify.error(salla.lang.get('common.uploader.invalid_type'));
|
|
1788
|
+
this.releaseAcceptedFile(item.id);
|
|
1789
|
+
this.markValidationRejected(item.id);
|
|
1790
|
+
return false;
|
|
1791
|
+
}
|
|
1792
|
+
return true;
|
|
1793
|
+
}
|
|
1794
|
+
renderGalleryThumb(file) {
|
|
1795
|
+
if (this.isVideoFile(file)) {
|
|
1796
|
+
return [
|
|
1797
|
+
index.h("video", { class: "s-file-upload-gallery-video-thumb", src: file.url, muted: true, playsInline: true, preload: "metadata" }),
|
|
1798
|
+
index.h("span", { class: "s-file-upload-gallery-video-icon", innerHTML: PlayIcon }),
|
|
1799
|
+
];
|
|
1800
|
+
}
|
|
1801
|
+
return index.h("img", { src: file.url, alt: "", loading: "lazy" });
|
|
1802
|
+
}
|
|
1803
|
+
releasePreviewObjectUrl(fileId) {
|
|
1804
|
+
const url = this.previewObjectUrls.get(fileId);
|
|
1805
|
+
if (!url)
|
|
1806
|
+
return;
|
|
1807
|
+
URL.revokeObjectURL(url);
|
|
1808
|
+
this.previewObjectUrls.delete(fileId);
|
|
1809
|
+
}
|
|
1810
|
+
prunePreviewObjectUrls(activeFileIds) {
|
|
1811
|
+
[...this.previewObjectUrls.keys()].forEach(id => {
|
|
1812
|
+
if (!activeFileIds.has(id)) {
|
|
1813
|
+
this.releasePreviewObjectUrl(id);
|
|
1814
|
+
}
|
|
1815
|
+
});
|
|
1816
|
+
}
|
|
1817
|
+
revokeAllPreviewObjectUrls() {
|
|
1818
|
+
[...this.previewObjectUrls.keys()].forEach(id => this.releasePreviewObjectUrl(id));
|
|
1819
|
+
}
|
|
1820
|
+
getFilePreviewUrl(item) {
|
|
1821
|
+
const fromMeta = item.getMetadata('url') || item.getMetadata('poster');
|
|
1822
|
+
if (this.isValidPreviewUrl(fromMeta)) {
|
|
1823
|
+
this.releasePreviewObjectUrl(item.id);
|
|
1824
|
+
return fromMeta;
|
|
1825
|
+
}
|
|
1826
|
+
const uploaded = this.uploadedFiles.find(file => file.id === item.serverId || file.id === item.getMetadata('id'));
|
|
1827
|
+
if (uploaded?.url) {
|
|
1828
|
+
this.releasePreviewObjectUrl(item.id);
|
|
1829
|
+
return uploaded.url;
|
|
1830
|
+
}
|
|
1831
|
+
const file = item.file;
|
|
1832
|
+
if (file instanceof Blob) {
|
|
1833
|
+
const existing = this.previewObjectUrls.get(item.id);
|
|
1834
|
+
if (existing)
|
|
1835
|
+
return existing;
|
|
1836
|
+
const url = URL.createObjectURL(file);
|
|
1837
|
+
this.previewObjectUrls.set(item.id, url);
|
|
1838
|
+
return url;
|
|
1839
|
+
}
|
|
1840
|
+
return '';
|
|
1841
|
+
}
|
|
1842
|
+
isFileUploading(item) {
|
|
1843
|
+
return item.status === 3 || item.status === 7 || item.status === 9;
|
|
1844
|
+
}
|
|
1845
|
+
getPreviewGalleryItems() {
|
|
1846
|
+
return (this.filepond?.getFiles() || []).filter(item => uploadLimits.shouldCountGalleryFile(item.status));
|
|
1847
|
+
}
|
|
1848
|
+
getCountableGalleryItems() {
|
|
1849
|
+
return (this.filepond?.getFiles() || []).filter(item => uploadLimits.shouldCountGalleryLimit(item.status));
|
|
1850
|
+
}
|
|
1851
|
+
schedulePreviewFilesSync() {
|
|
1852
|
+
if (!this.usesGalleryPreview())
|
|
1853
|
+
return;
|
|
1854
|
+
if (this.previewFilesSyncRaf != null) {
|
|
1855
|
+
cancelAnimationFrame(this.previewFilesSyncRaf);
|
|
1856
|
+
}
|
|
1857
|
+
this.previewFilesSyncRaf = requestAnimationFrame(() => {
|
|
1858
|
+
this.previewFilesSyncRaf = requestAnimationFrame(() => {
|
|
1859
|
+
this.previewFilesSyncRaf = null;
|
|
1860
|
+
this.syncPreviewFiles();
|
|
1861
|
+
});
|
|
1862
|
+
});
|
|
1863
|
+
}
|
|
1864
|
+
mapItemsToPreviewFiles(items) {
|
|
1865
|
+
return items.map(item => ({
|
|
1866
|
+
id: String(item.getMetadata('id') || item.serverId || item.id),
|
|
1867
|
+
url: this.getFilePreviewUrl(item),
|
|
1868
|
+
mimeType: item.file?.type || item.fileType,
|
|
1869
|
+
processing: this.isFileUploading(item),
|
|
1870
|
+
})).filter(file => file.url);
|
|
1871
|
+
}
|
|
1872
|
+
emitGalleryCounts(items) {
|
|
1873
|
+
// Derive display counts from the settled pond items. This runs deferred
|
|
1874
|
+
// (schedulePreviewFilesSync), so batch-rejected/over-limit files are already
|
|
1875
|
+
// gone and the numbers always match what is actually on screen. Admission is
|
|
1876
|
+
// guarded synchronously by the in-flight reservations in validateBeforeAddFile,
|
|
1877
|
+
// so the pond never exceeds the configured limits — counting it here always
|
|
1878
|
+
// reflects the real state (e.g. after deletes) instead of a stale number.
|
|
1879
|
+
let imageCount = 0;
|
|
1880
|
+
let videoCount = 0;
|
|
1881
|
+
items.forEach(item => {
|
|
1882
|
+
const type = this.getFileTypeCategory(item);
|
|
1883
|
+
if (type === 'video')
|
|
1884
|
+
videoCount += 1;
|
|
1885
|
+
else if (type === 'image')
|
|
1886
|
+
imageCount += 1;
|
|
1887
|
+
});
|
|
1888
|
+
let count = items.length;
|
|
1889
|
+
if (this.hasImageLimit()) {
|
|
1890
|
+
imageCount = Math.min(imageCount, this.getMaxImagesCount());
|
|
1891
|
+
}
|
|
1892
|
+
if (this.hasVideoLimit()) {
|
|
1893
|
+
videoCount = Math.min(videoCount, this.getMaxVideosCount());
|
|
1894
|
+
}
|
|
1895
|
+
if (this.usesSplitCountLimits()) {
|
|
1896
|
+
count = Math.min(count, this.getTotalMaxFiles());
|
|
1897
|
+
}
|
|
1898
|
+
const uploading = items.some(item => this.isFileUploading(item));
|
|
1899
|
+
this.galleryUpdated.emit({
|
|
1900
|
+
count,
|
|
1901
|
+
imageCount,
|
|
1902
|
+
videoCount,
|
|
1903
|
+
uploading,
|
|
1904
|
+
});
|
|
1905
|
+
}
|
|
1906
|
+
syncPreviewFiles() {
|
|
1907
|
+
if (!this.usesGalleryPreview())
|
|
1908
|
+
return;
|
|
1909
|
+
const previewItems = this.getPreviewGalleryItems();
|
|
1910
|
+
this.previewFiles = this.mapItemsToPreviewFiles(previewItems);
|
|
1911
|
+
this.prunePreviewObjectUrls(new Set(previewItems.map(item => item.id)));
|
|
1912
|
+
this.emitGalleryCounts(this.getCountableGalleryItems());
|
|
1913
|
+
if (this.hiddenInput) {
|
|
1914
|
+
this.hiddenInput.value = this.getHiddenInputValue();
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
enforceDropLabelVisibility(fileCount) {
|
|
1918
|
+
if (!this.usesGalleryPreview())
|
|
1919
|
+
return;
|
|
1920
|
+
const dropLabel = this.host.querySelector('.filepond--drop-label');
|
|
1921
|
+
if (!dropLabel)
|
|
1922
|
+
return;
|
|
1923
|
+
const imageCount = this.countAcceptedByType('image');
|
|
1924
|
+
const videoCount = this.countAcceptedByType('video');
|
|
1925
|
+
let isMaxReached = false;
|
|
1926
|
+
if (this.usesSplitCountLimits()) {
|
|
1927
|
+
const imagesBlocked = this.hasImageLimit() && imageCount >= this.getMaxImagesCount();
|
|
1928
|
+
const videosBlocked = this.hasVideoLimit() && videoCount >= this.getMaxVideosCount();
|
|
1929
|
+
if (this.hasImageLimit() && this.hasVideoLimit()) {
|
|
1930
|
+
isMaxReached = imagesBlocked && videosBlocked;
|
|
1931
|
+
}
|
|
1932
|
+
else if (this.hasImageLimit()) {
|
|
1933
|
+
isMaxReached = imagesBlocked;
|
|
1934
|
+
}
|
|
1935
|
+
else if (this.hasVideoLimit()) {
|
|
1936
|
+
isMaxReached = videosBlocked;
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
else {
|
|
1940
|
+
isMaxReached = (fileCount ?? this.countAcceptedTotal()) >= this.maxFilesCount;
|
|
1941
|
+
}
|
|
1942
|
+
this.host.classList.toggle('s-file-upload-at-max', isMaxReached);
|
|
1943
|
+
dropLabel.classList.toggle('s-file-upload-drop-label-disabled', isMaxReached);
|
|
1944
|
+
dropLabel.classList.remove('s-hidden');
|
|
1945
|
+
if (isMaxReached) {
|
|
1946
|
+
dropLabel.style.setProperty('opacity', '0.55', 'important');
|
|
1947
|
+
dropLabel.style.setProperty('visibility', 'visible', 'important');
|
|
1948
|
+
dropLabel.style.setProperty('transform', 'none', 'important');
|
|
1949
|
+
dropLabel.style.setProperty('height', 'auto', 'important');
|
|
1950
|
+
dropLabel.style.setProperty('min-height', '4.75em', 'important');
|
|
1951
|
+
return;
|
|
1952
|
+
}
|
|
1953
|
+
['opacity', 'visibility', 'transform', 'height', 'min-height'].forEach(prop => {
|
|
1954
|
+
dropLabel.style.removeProperty(prop);
|
|
1955
|
+
});
|
|
1956
|
+
}
|
|
1957
|
+
scheduleDropLabelVisibilityEnforcement(fileCount) {
|
|
1958
|
+
this.enforceDropLabelVisibility(fileCount);
|
|
1959
|
+
requestAnimationFrame(() => this.enforceDropLabelVisibility(fileCount));
|
|
1960
|
+
setTimeout(() => this.enforceDropLabelVisibility(fileCount), 200);
|
|
1961
|
+
}
|
|
1962
|
+
removePreviewFile(event, fileId) {
|
|
1963
|
+
event.stopPropagation();
|
|
1964
|
+
const pondFile = this.filepond?.getFiles().find(file => String(file.getMetadata('id')) === String(fileId) || file.id === fileId);
|
|
1965
|
+
if (pondFile) {
|
|
1966
|
+
this.filepond.removeFile(pondFile.id);
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
openPreview(index) {
|
|
1970
|
+
const file = this.previewFiles[index];
|
|
1971
|
+
if (!file || file.processing)
|
|
1972
|
+
return;
|
|
1973
|
+
this.attachmentView?.open(index);
|
|
1974
|
+
}
|
|
1975
|
+
getGalleryThumbSize() {
|
|
1976
|
+
return this.imagePreviewHeight || 75;
|
|
1977
|
+
}
|
|
1978
|
+
getGalleryStyles() {
|
|
1979
|
+
const size = this.getGalleryThumbSize();
|
|
1980
|
+
return {
|
|
1981
|
+
'--s-file-upload-preview-size': `${size}px`,
|
|
1982
|
+
'--s-file-upload-remove-size': `${Math.max(18, Math.round(size * 0.24))}px`,
|
|
1983
|
+
'--s-file-upload-remove-icon-size': `${Math.max(10, Math.round(size * 0.13))}px`,
|
|
1984
|
+
};
|
|
1985
|
+
}
|
|
1986
|
+
renderPreviewGallery() {
|
|
1987
|
+
if (!this.usesGalleryPreview() || !this.previewFiles.length)
|
|
1988
|
+
return null;
|
|
1989
|
+
const galleryThumbSize = this.getGalleryThumbSize();
|
|
1990
|
+
return (index.h("div", { class: "s-file-upload-gallery", style: this.getGalleryStyles() }, index.h("div", { class: "s-file-upload-gallery-track s-scrollbar ps-2" }, this.previewFiles.map((file, index$1) => (index.h("div", { class: "s-file-upload-gallery-item", key: file.id }, this.allowRemove && (index.h("button", { type: "button", class: "s-file-upload-gallery-remove", "aria-label": salla.lang.get('common.elements.remove'), onClick: (event) => this.removePreviewFile(event, file.id) }, index.h("span", { innerHTML: cancel.Cancel }))), index.h("div", { class: {
|
|
1991
|
+
's-file-upload-gallery-thumb': true,
|
|
1992
|
+
'is-processing': file.processing,
|
|
1993
|
+
'is-video': this.isVideoFile(file),
|
|
1994
|
+
}, onClick: () => this.openPreview(index$1) }, this.renderGalleryThumb(file), file.processing && index.h("salla-loading", { size: Math.max(16, Math.round(galleryThumbSize * 0.22)) })))))), this.previewFiles.length > 0 && (index.h("salla-attachment-view", { ref: el => (this.attachmentView = el), attachments: this.previewFiles }))));
|
|
1995
|
+
}
|
|
1104
1996
|
getFiles() {
|
|
1105
1997
|
if (!this.value && !this.files) {
|
|
1106
1998
|
return [];
|
|
@@ -1137,12 +2029,20 @@ const SallaFileUpload = class {
|
|
|
1137
2029
|
this.host.innerHTML = '';
|
|
1138
2030
|
}
|
|
1139
2031
|
}
|
|
2032
|
+
disconnectedCallback() {
|
|
2033
|
+
if (this.previewFilesSyncRaf != null) {
|
|
2034
|
+
cancelAnimationFrame(this.previewFilesSyncRaf);
|
|
2035
|
+
this.previewFilesSyncRaf = null;
|
|
2036
|
+
}
|
|
2037
|
+
this.revokeAllPreviewObjectUrls();
|
|
2038
|
+
}
|
|
1140
2039
|
render() {
|
|
1141
|
-
return (index.h(index.Host, { key: '
|
|
2040
|
+
return (index.h(index.Host, { key: '9c9bb99746270f2511bd86344a135d05f9b3cf29', class: {
|
|
1142
2041
|
"s-file-upload": true,
|
|
1143
2042
|
"s-file-upload-profile-image": this.profileImage,
|
|
1144
2043
|
"s-file-upload-multiple": this.allowMultiple,
|
|
1145
|
-
|
|
2044
|
+
"s-file-upload-has-gallery": this.usesGalleryPreview(),
|
|
2045
|
+
} }, index.h("input", { key: 'd033124b1829ee4b9f0c4d44041a525e73769b77', type: "file", name: this.name, ref: ele => this.fileUploader = ele, required: this.required, class: "s-file-upload-wrapper s-file-upload-input", accept: this.accept }), this.allowMultiple && this.showMaxCountHint ? index.h("div", { class: "s-file-upload-hint s-hidden" }, this.max_count_hint(this.getTotalMaxFiles())) : '', index.h("input", { key: '95608637f6b52dabbad4a7374d329549cb6d3862', class: "s-hidden", name: 'hidden-' + this.name, required: this.required, value: this.getHiddenInputValue(), ref: input => this.hiddenInput = input }), this.renderPreviewGallery()));
|
|
1146
2046
|
}
|
|
1147
2047
|
async componentDidLoad() {
|
|
1148
2048
|
await Salla.onReady();
|
|
@@ -1151,6 +2051,7 @@ const SallaFileUpload = class {
|
|
|
1151
2051
|
this.value = Salla.config.get('user.avatar');
|
|
1152
2052
|
}
|
|
1153
2053
|
let files = this.getFiles();
|
|
2054
|
+
const filePondMaxFileSize = this.getFilePondMaxFileSizeValue();
|
|
1154
2055
|
this.filepond = this.FilePond.create(this.fileUploader, {
|
|
1155
2056
|
name: this.payloadName || this.name,
|
|
1156
2057
|
//@ts-ignore
|
|
@@ -1167,10 +2068,13 @@ const SallaFileUpload = class {
|
|
|
1167
2068
|
allowReorder: this.allowReorder,
|
|
1168
2069
|
storeAsFile: this.storeAsFile,
|
|
1169
2070
|
forceRevert: this.forceRevert,
|
|
1170
|
-
maxFiles
|
|
2071
|
+
// FilePond hides the drop label (opacity 0 + height 0) when maxFiles is reached.
|
|
2072
|
+
// In gallery mode we enforce the limit ourselves so labels stay visible, dimmed at max.
|
|
2073
|
+
maxFiles: this.usesGalleryPreview() ? null : this.getTotalMaxFiles(),
|
|
2074
|
+
beforeAddFile: (item) => this.validateBeforeAddFile(item),
|
|
1171
2075
|
imagePreviewHeight: this.imagePreviewHeight,
|
|
1172
2076
|
filePosterHeight: this.filePosterHeight,
|
|
1173
|
-
allowImagePreview: this.allowImagePreview,
|
|
2077
|
+
allowImagePreview: this.usesGalleryPreview() ? false : this.allowImagePreview,
|
|
1174
2078
|
maxParallelUploads: this.maxParallelUploads,
|
|
1175
2079
|
checkValidity: this.checkValidity,
|
|
1176
2080
|
itemInsertLocation: this.itemInsertLocation,
|
|
@@ -1180,36 +2084,80 @@ const SallaFileUpload = class {
|
|
|
1180
2084
|
dropOnElement: this.dropOnElement,
|
|
1181
2085
|
dropValidation: this.dropValidation,
|
|
1182
2086
|
ignoredFiles: this.ignoredFiles,
|
|
1183
|
-
onaddfile: (error, file) =>
|
|
2087
|
+
onaddfile: (error, file) => {
|
|
2088
|
+
// The file is now committed to the pond (or errored out), so it is
|
|
2089
|
+
// counted from getFiles() from here on — drop the in-flight reservation
|
|
2090
|
+
// either way to keep the map transient and drift-free.
|
|
2091
|
+
this.releaseAcceptedFile(file.id);
|
|
2092
|
+
if (error) {
|
|
2093
|
+
if (!this.validationRejectedFileIds.has(file.id)) {
|
|
2094
|
+
this.notifyUploadError(error, file);
|
|
2095
|
+
}
|
|
2096
|
+
this.validationRejectedFileIds.delete(file.id);
|
|
2097
|
+
}
|
|
2098
|
+
this.addedHandler(error, file);
|
|
2099
|
+
if (this.usesGalleryPreview()) {
|
|
2100
|
+
this.schedulePreviewFilesSync();
|
|
2101
|
+
}
|
|
2102
|
+
},
|
|
1184
2103
|
onwarning: (error, _file, _status) => {
|
|
1185
2104
|
if (error.body === "Max files") {
|
|
1186
|
-
|
|
2105
|
+
this.notifyMaxFilesLimit();
|
|
1187
2106
|
}
|
|
1188
2107
|
},
|
|
1189
2108
|
onprocessfile: (error, file) => {
|
|
2109
|
+
if (error) {
|
|
2110
|
+
this.notifyUploadError(error, file);
|
|
2111
|
+
this.removeFailedFile(file);
|
|
2112
|
+
if (this.usesGalleryPreview()) {
|
|
2113
|
+
this.schedulePreviewFilesSync();
|
|
2114
|
+
}
|
|
2115
|
+
return;
|
|
2116
|
+
}
|
|
2117
|
+
let syncedGallery = false;
|
|
1190
2118
|
if (this.allowMultiple && !error) {
|
|
1191
2119
|
// Find the uploaded file data using the serverId returned from onload
|
|
1192
2120
|
const serverId = file.serverId;
|
|
1193
2121
|
const uploadedFile = this.uploadedFiles.find(f => f.id === serverId);
|
|
1194
2122
|
if (uploadedFile) {
|
|
1195
|
-
// Set metadata on the file
|
|
1196
2123
|
file.setMetadata('id', uploadedFile.id, true);
|
|
1197
2124
|
file.setMetadata('url', uploadedFile.url, true);
|
|
1198
2125
|
this.value = {
|
|
1199
2126
|
id: uploadedFile.id,
|
|
1200
2127
|
url: uploadedFile.url
|
|
1201
2128
|
};
|
|
2129
|
+
if (this.usesGalleryPreview()) {
|
|
2130
|
+
this.syncPreviewFiles();
|
|
2131
|
+
syncedGallery = true;
|
|
2132
|
+
}
|
|
1202
2133
|
this.uploadedHandler();
|
|
1203
2134
|
}
|
|
1204
2135
|
}
|
|
2136
|
+
if (this.usesGalleryPreview() && !syncedGallery) {
|
|
2137
|
+
this.schedulePreviewFilesSync();
|
|
2138
|
+
}
|
|
2139
|
+
},
|
|
2140
|
+
onremovefile: (_error, file) => {
|
|
2141
|
+
if (this.usesGalleryPreview()) {
|
|
2142
|
+
if (file) {
|
|
2143
|
+
this.emitRemovedFile(file);
|
|
2144
|
+
}
|
|
2145
|
+
this.schedulePreviewFilesSync();
|
|
2146
|
+
}
|
|
1205
2147
|
},
|
|
1206
2148
|
onupdatefiles: (fileItems) => {
|
|
1207
2149
|
const dropLabel = this.host.querySelector('.filepond--drop-label');
|
|
1208
2150
|
const listScroller = this.host.querySelector('.filepond--list-scroller');
|
|
2151
|
+
if (this.usesGalleryPreview()) {
|
|
2152
|
+
listScroller?.classList.add('s-hidden');
|
|
2153
|
+
this.scheduleDropLabelVisibilityEnforcement();
|
|
2154
|
+
this.schedulePreviewFilesSync();
|
|
2155
|
+
return;
|
|
2156
|
+
}
|
|
1209
2157
|
if (this.allowMultiple) {
|
|
1210
2158
|
if (fileItems.length > 0) {
|
|
1211
2159
|
dropLabel.classList.add('s-hidden');
|
|
1212
|
-
if (!this.isListScrollerListenerAdded && fileItems.length < this.
|
|
2160
|
+
if (!this.isListScrollerListenerAdded && fileItems.length < this.getTotalMaxFiles()) {
|
|
1213
2161
|
this.showMaxCountHint = true;
|
|
1214
2162
|
listScroller.addEventListener('click', this.openFileBrowser);
|
|
1215
2163
|
this.isListScrollerListenerAdded = true;
|
|
@@ -1222,8 +2170,7 @@ const SallaFileUpload = class {
|
|
|
1222
2170
|
this.isListScrollerListenerAdded = false;
|
|
1223
2171
|
}
|
|
1224
2172
|
}
|
|
1225
|
-
|
|
1226
|
-
if (fileItems.length === this.maxFilesCount && this.isListScrollerListenerAdded) {
|
|
2173
|
+
if (fileItems.length === this.getTotalMaxFiles() && this.isListScrollerListenerAdded) {
|
|
1227
2174
|
listScroller.removeEventListener('click', this.openFileBrowser);
|
|
1228
2175
|
this.isListScrollerListenerAdded = false;
|
|
1229
2176
|
this.showMaxCountHint = false;
|
|
@@ -1239,21 +2186,28 @@ const SallaFileUpload = class {
|
|
|
1239
2186
|
onload: (response) => {
|
|
1240
2187
|
let responseData = JSON.parse(response).data;
|
|
1241
2188
|
if ((this.instantUpload || this.allowMultiple) && Array.isArray(responseData) && responseData.length > 0) {
|
|
1242
|
-
const
|
|
1243
|
-
const fileUrl =
|
|
2189
|
+
const item = responseData[0];
|
|
2190
|
+
const fileUrl = typeof item === 'object' && item !== null ? item.filePath || item.url : item;
|
|
2191
|
+
const fileId = this.generateUploadFileId();
|
|
1244
2192
|
// Store the upload result to be picked up by onprocessfile
|
|
1245
|
-
this.uploadedFiles
|
|
1246
|
-
|
|
1247
|
-
url: fileUrl
|
|
1248
|
-
|
|
2193
|
+
this.uploadedFiles = [
|
|
2194
|
+
...this.uploadedFiles,
|
|
2195
|
+
{ id: fileId, url: fileUrl }
|
|
2196
|
+
];
|
|
1249
2197
|
// Return the serverId that FilePond will use to identify this file
|
|
1250
2198
|
// We'll use the fileId as the serverId
|
|
1251
2199
|
return fileId;
|
|
1252
2200
|
}
|
|
1253
2201
|
else {
|
|
1254
|
-
|
|
2202
|
+
const fileUrl = typeof responseData === 'object' && responseData !== null
|
|
2203
|
+
? responseData.filePath || responseData.url
|
|
2204
|
+
: responseData;
|
|
2205
|
+
const fileId = typeof responseData === 'object' && responseData !== null && responseData.id
|
|
2206
|
+
? responseData.id
|
|
2207
|
+
: this.generateUploadFileId();
|
|
2208
|
+
this.value = { id: fileId, url: fileUrl };
|
|
1255
2209
|
this.uploadedHandler();
|
|
1256
|
-
return
|
|
2210
|
+
return fileUrl;
|
|
1257
2211
|
}
|
|
1258
2212
|
},
|
|
1259
2213
|
headers: salla.api.getHeaders(),
|
|
@@ -1318,12 +2272,19 @@ const SallaFileUpload = class {
|
|
|
1318
2272
|
fileValidateTypeLabelExpectedTypes: '{allButLastType}, {lastType}',
|
|
1319
2273
|
labelMaxFileSizeExceeded: salla.lang.get('common.uploader.too_large'),
|
|
1320
2274
|
labelMaxFileSize: '{filesize}',
|
|
1321
|
-
maxFileSize:
|
|
2275
|
+
...(filePondMaxFileSize ? { maxFileSize: filePondMaxFileSize } : {}),
|
|
1322
2276
|
beforeRemoveFile: (deletedFile) => new Promise((resolve) => {
|
|
1323
|
-
this.removedHandler(deletedFile);
|
|
2277
|
+
this.removedHandler(deletedFile, { skipEmit: this.usesGalleryPreview() });
|
|
1324
2278
|
resolve(true);
|
|
1325
2279
|
}),
|
|
1326
2280
|
});
|
|
2281
|
+
this.syncPreviewFiles();
|
|
2282
|
+
if (this.usesGalleryPreview()) {
|
|
2283
|
+
this.filepond.on('updatefiles', () => {
|
|
2284
|
+
this.scheduleDropLabelVisibilityEnforcement();
|
|
2285
|
+
});
|
|
2286
|
+
this.scheduleDropLabelVisibilityEnforcement();
|
|
2287
|
+
}
|
|
1327
2288
|
this.hiddenInput.addEventListener('invalid', e => {
|
|
1328
2289
|
this.invalidInput.emit(e);
|
|
1329
2290
|
});
|
|
@@ -1445,7 +2406,7 @@ const SallaTelInput = class {
|
|
|
1445
2406
|
if (this.TelInput)
|
|
1446
2407
|
return;
|
|
1447
2408
|
try {
|
|
1448
|
-
const telInputModule = await Promise.resolve().then(function () { return require('./intlTelInput-
|
|
2409
|
+
const telInputModule = await Promise.resolve().then(function () { return require('./intlTelInput-DnwdGAiP.js'); }).then(function (n) { return n.intlTelInput; });
|
|
1449
2410
|
this.TelInput = telInputModule.default;
|
|
1450
2411
|
}
|
|
1451
2412
|
catch (error) {
|
|
@@ -1584,6 +2545,8 @@ const SallaTelInput = class {
|
|
|
1584
2545
|
};
|
|
1585
2546
|
SallaTelInput.style = sallaTelInputCss;
|
|
1586
2547
|
|
|
2548
|
+
exports.salla_attachment_view = SallaAttachmentView;
|
|
2549
|
+
exports.salla_attachments = SallaAttachments;
|
|
1587
2550
|
exports.salla_booking_field = SallaBookingField;
|
|
1588
2551
|
exports.salla_color_picker = SallaColorPicker;
|
|
1589
2552
|
exports.salla_conditional_fields = SallaConditionalFields;
|