@salla.sa/twilight-components 2.14.393 → 2.14.394
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-D7RVR_w_.js → filepond-C_gLbAbF.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-DTuZK2ot.js → filepond-plugin-file-poster-DXWo2FUU.js} +2 -2
- package/dist/cjs/{filepond-plugin-file-validate-size-DHc6pF_j.js → filepond-plugin-file-validate-size-fBXMP7ez.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-DnkcvJVc.js → filepond-plugin-file-validate-type-DEo7juC7.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-vrZ1s7kw.js → filepond-plugin-image-edit-4j4e1VEp.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-Bn5JSzQK.js → filepond-plugin-image-exif-orientation-DWqiXxv1.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-8qWUFe9n.js → filepond-plugin-image-preview-emT_teia.js} +1 -1
- package/dist/cjs/{index-C5VeFDQ0.js → index-B03mYCWz.js} +547 -780
- package/dist/cjs/{index-CwD81m7i.js → index-Y-2uyQDK.js} +1 -1
- package/dist/cjs/loader.cjs.js +3 -4
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-accordion_6.cjs.entry.js +15 -19
- package/dist/cjs/salla-add-product-button_4.cjs.entry.js +10 -12
- package/dist/cjs/salla-advertisement.cjs.entry.js +3 -3
- package/dist/cjs/salla-alert_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +3 -3
- package/dist/cjs/salla-apps-icons.cjs.entry.js +3 -3
- package/dist/cjs/salla-booking-field_7.cjs.entry.js +23 -25
- package/dist/cjs/salla-bullet-delivery.cjs.entry.js +3 -3
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +3 -3
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +17 -17
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +3 -3
- package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +3 -3
- package/dist/cjs/salla-count-down.cjs.entry.js +3 -3
- package/dist/cjs/salla-custom-fields.cjs.entry.js +3 -3
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +3 -3
- package/dist/cjs/salla-filters.cjs.entry.js +3 -3
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +3 -3
- package/dist/cjs/salla-hook.cjs.entry.js +2 -5
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +3 -3
- package/dist/cjs/salla-installment.cjs.entry.js +3 -3
- package/dist/cjs/salla-list-tile.cjs.entry.js +3 -3
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty.cjs.entry.js +3 -3
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +3 -3
- package/dist/cjs/salla-map.cjs.entry.js +3 -3
- package/dist/cjs/salla-menu.cjs.entry.js +3 -3
- package/dist/cjs/salla-metadata.cjs.entry.js +3 -3
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +6 -8
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +4 -6
- package/dist/cjs/salla-notification-item.cjs.entry.js +3 -3
- package/dist/cjs/salla-notifications.cjs.entry.js +3 -3
- package/dist/cjs/salla-offer-modal.cjs.entry.js +3 -3
- package/dist/cjs/salla-offer.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-details-options.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-details.cjs.entry.js +4 -6
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-edit.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-summary.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +4 -6
- package/dist/cjs/salla-orders.cjs.entry.js +3 -3
- package/dist/cjs/salla-payments.cjs.entry.js +3 -3
- package/dist/cjs/salla-placeholder.cjs.entry.js +3 -3
- package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
- package/dist/cjs/salla-product-card.cjs.entry.js +3 -3
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
- package/dist/cjs/salla-products-list.cjs.entry.js +3 -3
- package/dist/cjs/salla-products-slider.cjs.entry.js +3 -3
- package/dist/cjs/salla-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/salla-quick-order.cjs.entry.js +3 -3
- package/dist/cjs/salla-rating-modal.cjs.entry.js +3 -3
- package/dist/cjs/salla-scopes.cjs.entry.js +3 -3
- package/dist/cjs/salla-search.cjs.entry.js +4 -6
- package/dist/cjs/salla-skeleton.cjs.entry.js +3 -3
- package/dist/cjs/salla-slider.cjs.entry.js +3 -3
- package/dist/cjs/salla-social-share.cjs.entry.js +3 -3
- package/dist/cjs/salla-social.cjs.entry.js +3 -3
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +7 -7
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +3 -3
- package/dist/cjs/salla-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/salla-trust-badges.cjs.entry.js +3 -3
- package/dist/cjs/salla-user-menu.cjs.entry.js +3 -3
- package/dist/cjs/salla-user-profile.cjs.entry.js +3 -3
- package/dist/cjs/salla-user-settings.cjs.entry.js +3 -3
- package/dist/cjs/salla-verify.cjs.entry.js +3 -3
- package/dist/cjs/salla-wallet.cjs.entry.js +3 -3
- package/dist/cjs/twilight.cjs.js +4 -5
- package/dist/cjs/{vanilla-picker-yKERbLpx.js → vanilla-picker-CKZvBtHS.js} +1 -1
- package/dist/collection/collection-manifest.json +2 -3
- package/dist/collection/components/salla-accordion/salla-accordion-head.js +2 -2
- package/dist/collection/components/salla-accordion/salla-accordion.js +4 -4
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +19 -19
- package/dist/collection/components/salla-alert/salla-alert.js +5 -5
- package/dist/collection/components/salla-apps-icons/salla-apps-icons.js +6 -6
- package/dist/collection/components/salla-booking-field/salla-booking-field.js +4 -4
- package/dist/collection/components/salla-bottom-alert/salla-bottom-alert.js +9 -9
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +3 -6
- package/dist/collection/components/salla-button/salla-button.js +11 -11
- package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +1 -2
- package/dist/collection/components/salla-cart-item-offers/salla-cart-item-offers.js +8 -8
- package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +2 -2
- package/dist/collection/components/salla-color-picker/salla-color-picker.js +14 -20
- package/dist/collection/components/salla-comment-form/salla-comment-form.js +6 -6
- package/dist/collection/components/salla-comments/salla-comment-item.js +3 -2
- package/dist/collection/components/salla-comments/salla-comments.js +17 -18
- package/dist/collection/components/salla-contacts/salla-contacts.js +10 -10
- package/dist/collection/components/salla-count-down/salla-count-down.js +34 -34
- package/dist/collection/components/salla-custom-fields/salla-custom-fields.js +7 -9
- package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +65 -69
- package/dist/collection/components/salla-drawer/salla-drawer.js +11 -11
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +84 -85
- package/dist/collection/components/salla-filters/salla-filters.js +2 -2
- package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +5 -4
- package/dist/collection/components/salla-gifting/salla-gifting.js +11 -11
- package/dist/collection/components/salla-hook/salla-hook.js +2 -2
- package/dist/collection/components/salla-infinite-scroll/salla-infinite-scroll.js +6 -6
- package/dist/collection/components/salla-installment/salla-installment.js +5 -5
- package/dist/collection/components/salla-list-tile/salla-list-tile.js +2 -2
- package/dist/collection/components/salla-loading/salla-loading.js +4 -4
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +5 -5
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +14 -14
- package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +3 -4
- package/dist/collection/components/salla-loyalty/salla-loyalty.js +12 -13
- package/dist/collection/components/salla-map/salla-map.js +14 -14
- package/dist/collection/components/salla-menu/salla-menu.js +9 -10
- package/dist/collection/components/salla-metadata/salla-metadata.js +3 -3
- package/dist/collection/components/salla-modal/salla-modal.js +11 -11
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +2 -2
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +2 -4
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +7 -8
- package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +2 -2
- package/dist/collection/components/salla-notifications/salla-notification-item.js +2 -2
- package/dist/collection/components/salla-notifications/salla-notifications.js +3 -3
- package/dist/collection/components/salla-offer/salla-offer.js +1 -1
- package/dist/collection/components/salla-order-details/salla-order-details-multiple-bundle-product.js +5 -5
- package/dist/collection/components/salla-order-details/salla-order-details-options.js +5 -6
- package/dist/collection/components/salla-order-details/salla-order-details.js +3 -4
- package/dist/collection/components/salla-order-edit/salla-order-edit-item.js +4 -4
- package/dist/collection/components/salla-order-edit/salla-order-edit.js +4 -4
- package/dist/collection/components/salla-order-summary/salla-order-summary.js +2 -2
- package/dist/collection/components/salla-order-totals-card/salla-order-totals-card.js +3 -4
- package/dist/collection/components/salla-orders/salla-orders.js +4 -4
- package/dist/collection/components/salla-payments/salla-payments.js +1 -0
- package/dist/collection/components/salla-placeholder/salla-placeholder.js +3 -3
- package/dist/collection/components/salla-price-range/salla-price-range.js +8 -8
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +6 -6
- package/dist/collection/components/salla-product-card/salla-product-card.js +18 -18
- package/dist/collection/components/salla-product-options/salla-product-options.js +13 -15
- package/dist/collection/components/salla-products-list/salla-products-list.js +21 -20
- package/dist/collection/components/salla-products-slider/salla-products-slider.js +23 -22
- package/dist/collection/components/salla-progress-bar/salla-progress-bar.js +20 -21
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +2 -2
- package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +17 -16
- package/dist/collection/components/salla-quick-order/salla-quick-order.js +11 -11
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +2 -2
- package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +8 -8
- package/dist/collection/components/salla-review-card/salla-review-card.js +3 -3
- package/dist/collection/components/salla-reviews/salla-reviews.js +13 -16
- package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.js +2 -2
- package/dist/collection/components/salla-scopes/salla-scopes.js +2 -2
- package/dist/collection/components/salla-search/salla-search.js +6 -6
- package/dist/collection/components/salla-skeleton/salla-skeleton.js +3 -3
- package/dist/collection/components/salla-slider/salla-slider.js +25 -25
- package/dist/collection/components/salla-social-share/salla-social-share.js +3 -3
- package/dist/collection/components/salla-tabs/salla-tab-content.js +2 -2
- package/dist/collection/components/salla-tabs/salla-tab-header.js +5 -5
- package/dist/collection/components/salla-tabs/salla-tabs.js +2 -2
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +8 -9
- package/dist/collection/components/salla-tooltip/salla-tooltip.js +5 -5
- package/dist/collection/components/salla-trust-badges/salla-trust-badges.js +1 -1
- package/dist/collection/components/salla-user-menu/salla-user-menu.js +5 -5
- package/dist/collection/components/salla-user-profile/salla-user-profile.js +1 -1
- package/dist/collection/components/salla-verify/salla-verify.js +4 -4
- package/dist/components/Helper.js +432 -1
- package/dist/components/_commonjsHelpers.js +7 -1
- package/dist/components/anime.es.js +1310 -1
- package/dist/components/arrow-left.js +8 -1
- package/dist/components/axios.js +4240 -2
- package/dist/components/bell-ring.js +8 -1
- package/dist/components/camera.js +8 -1
- package/dist/components/cancel.js +8 -1
- package/dist/components/cart.js +8 -1
- package/dist/components/check-circle2.js +15 -1
- package/dist/components/check.js +8 -1
- package/dist/components/facebook.js +10 -1
- package/dist/components/filepond-plugin-file-poster.js +662 -2
- package/dist/components/filepond-plugin-file-validate-size.js +204 -2
- package/dist/components/filepond-plugin-file-validate-type.js +262 -2
- package/dist/components/filepond-plugin-image-edit.js +487 -2
- package/dist/components/filepond-plugin-image-exif-orientation.js +214 -2
- package/dist/components/filepond-plugin-image-preview.js +2237 -2
- package/dist/components/filepond.js +11286 -2
- package/dist/components/gift.js +8 -1
- package/dist/components/image.js +8 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.js +8220 -1
- package/dist/components/index2.js +1709 -1
- package/dist/components/index3.js +2550 -1
- package/dist/components/interfaces.js +12 -1
- package/dist/components/isObject.js +292 -1
- package/dist/components/keyboard_arrow_down.js +8 -1
- package/dist/components/keyboard_arrow_right.js +15 -1
- package/dist/components/location.js +11 -1
- package/dist/components/mail.js +8 -1
- package/dist/components/minus.js +15 -1
- package/dist/components/salla-accordion-body.js +6 -1
- package/dist/components/salla-accordion-body2.js +30 -1
- package/dist/components/salla-accordion-head.js +6 -1
- package/dist/components/salla-accordion-head2.js +63 -1
- package/dist/components/salla-accordion.js +6 -1
- package/dist/components/salla-accordion2.js +68 -1
- package/dist/components/salla-add-product-button.js +6 -1
- package/dist/components/salla-add-product-button2.js +306 -1
- package/dist/components/salla-advertisement.js +155 -1
- package/dist/components/salla-alert.js +59 -1
- package/dist/components/salla-app-install-alert.js +91 -1
- package/dist/components/salla-apps-icons.js +63 -1
- package/dist/components/salla-booking-field.js +6 -1
- package/dist/components/salla-booking-field2.js +221 -1
- package/dist/components/salla-bottom-alert.js +214 -1
- package/dist/components/salla-breadcrumb.js +226 -1
- package/dist/components/salla-bullet-delivery.js +2114 -1
- package/dist/components/salla-button.js +6 -1
- package/dist/components/salla-button2.js +174 -1
- package/dist/components/salla-cart-coupons.js +284 -1
- package/dist/components/salla-cart-item-offers.js +143 -1
- package/dist/components/salla-cart-summary.js +136 -1
- package/dist/components/salla-color-picker.js +6 -1
- package/dist/components/salla-color-picker2.js +260 -1
- package/dist/components/salla-comment-form.js +6 -1
- package/dist/components/salla-comment-form2.js +64 -1
- package/dist/components/salla-comment-item.js +6 -1
- package/dist/components/salla-comment-item2.js +217 -1
- package/dist/components/salla-comments.js +395 -1
- package/dist/components/salla-conditional-fields.js +6 -1
- package/dist/components/salla-conditional-fields2.js +137 -1
- package/dist/components/salla-conditional-offer.js +194 -1
- package/dist/components/salla-contacts.js +125 -1
- package/dist/components/salla-cookies-bar.js +107 -1
- package/dist/components/salla-count-down.js +6 -1
- package/dist/components/salla-count-down2.js +271 -1
- package/dist/components/salla-custom-fields.js +175 -1
- package/dist/components/salla-datetime-picker.js +6 -1
- package/dist/components/salla-datetime-picker2.js +342 -1
- package/dist/components/salla-delivery-promise.js +263 -1
- package/dist/components/salla-drawer.js +6 -1
- package/dist/components/salla-drawer2.js +214 -1
- package/dist/components/salla-file-upload.js +6 -1
- package/dist/components/salla-file-upload2.js +583 -1
- package/dist/components/salla-filters-widget.js +6 -1
- package/dist/components/salla-filters-widget2.js +245 -1
- package/dist/components/salla-filters.js +253 -1
- package/dist/components/salla-fulfillment-methods.js +61 -1
- package/dist/components/salla-gifting.js +732 -1
- package/dist/components/salla-hook.js +47 -1
- package/dist/components/salla-infinite-scroll.js +112 -1
- package/dist/components/salla-installment.js +306 -1
- package/dist/components/salla-list-tile.js +6 -1
- package/dist/components/salla-list-tile2.js +47 -1
- package/dist/components/salla-loading.js +6 -1
- package/dist/components/salla-loading2.js +51 -1
- package/dist/components/salla-localization-modal.js +296 -1
- package/dist/components/salla-login-modal.js +6 -1
- package/dist/components/salla-login-modal2.js +359 -1
- package/dist/components/salla-loyalty-prize-item.js +39 -1
- package/dist/components/salla-loyalty-program.js +115 -1
- package/dist/components/salla-loyalty.js +304 -1
- package/dist/components/salla-maintenance-alert.js +57 -1
- package/dist/components/salla-map.js +6 -1
- package/dist/components/salla-map2.js +766 -1
- package/dist/components/salla-menu.js +165 -1
- package/dist/components/salla-metadata.js +97 -1
- package/dist/components/salla-modal.js +6 -1
- package/dist/components/salla-modal2.js +215 -1
- package/dist/components/salla-multiple-bundle-product-cart.js +6 -1
- package/dist/components/salla-multiple-bundle-product-cart2.js +151 -1
- package/dist/components/salla-multiple-bundle-product-details.js +6 -1
- package/dist/components/salla-multiple-bundle-product-details2.js +296 -1
- package/dist/components/salla-multiple-bundle-product-options-modal.js +6 -1
- package/dist/components/salla-multiple-bundle-product-options-modal2.js +598 -1
- package/dist/components/salla-multiple-bundle-product-slider.js +6 -1
- package/dist/components/salla-multiple-bundle-product-slider2.js +136 -1
- package/dist/components/salla-multiple-bundle-product.js +207 -1
- package/dist/components/salla-notification-item.js +6 -1
- package/dist/components/salla-notification-item2.js +32 -1
- package/dist/components/salla-notifications.js +190 -1
- package/dist/components/salla-offer-modal.js +328 -1
- package/dist/components/salla-offer.js +478 -1
- package/dist/components/salla-order-details-multiple-bundle-product.js +6 -1
- package/dist/components/salla-order-details-multiple-bundle-product2.js +122 -1
- package/dist/components/salla-order-details-options.js +6 -1
- package/dist/components/salla-order-details-options2.js +140 -1
- package/dist/components/salla-order-details.js +122 -1
- package/dist/components/salla-order-edit-item.js +6 -1
- package/dist/components/salla-order-edit-item2.js +181 -1
- package/dist/components/salla-order-edit.js +288 -1
- package/dist/components/salla-order-summary.js +132 -1
- package/dist/components/salla-order-totals-card.js +87 -1
- package/dist/components/salla-orders.js +271 -1
- package/dist/components/salla-payments.js +76 -1
- package/dist/components/salla-placeholder.js +6 -1
- package/dist/components/salla-placeholder2.js +66 -1
- package/dist/components/salla-price-range.js +6 -1
- package/dist/components/salla-price-range2.js +204 -1
- package/dist/components/salla-product-availability.js +6 -1
- package/dist/components/salla-product-availability2.js +206 -1
- package/dist/components/salla-product-card.js +6 -1
- package/dist/components/salla-product-card2.js +241 -1
- package/dist/components/salla-product-options.js +6 -1
- package/dist/components/salla-product-options2.js +962 -1
- package/dist/components/salla-product-size-guide.js +130 -1
- package/dist/components/salla-products-list.js +6 -1
- package/dist/components/salla-products-list2.js +812 -1
- package/dist/components/salla-products-slider.js +6 -1
- package/dist/components/salla-products-slider2.js +215 -1
- package/dist/components/salla-progress-bar.js +6 -1
- package/dist/components/salla-progress-bar2.js +94 -1
- package/dist/components/salla-quantity-input.js +6 -1
- package/dist/components/salla-quantity-input2.js +127 -1
- package/dist/components/salla-quick-buy.js +6 -1
- package/dist/components/salla-quick-buy2.js +1181 -1
- package/dist/components/salla-quick-order.js +299 -1
- package/dist/components/salla-rating-modal.js +530 -1
- package/dist/components/salla-rating-stars.js +6 -1
- package/dist/components/salla-rating-stars2.js +162 -1
- package/dist/components/salla-review-card.js +6 -1
- package/dist/components/salla-review-card2.js +198 -1
- package/dist/components/salla-reviews-page.js +726 -1
- package/dist/components/salla-reviews-summary.js +6 -1
- package/dist/components/salla-reviews-summary2.js +132 -1
- package/dist/components/salla-reviews.js +143 -1
- package/dist/components/salla-scopes.js +249 -1
- package/dist/components/salla-search.js +213 -1
- package/dist/components/salla-skeleton.js +6 -1
- package/dist/components/salla-skeleton2.js +50 -1
- package/dist/components/salla-slider.js +6 -1
- package/dist/components/salla-slider2.js +10489 -1
- package/dist/components/salla-social-share.js +194 -1
- package/dist/components/salla-social.js +89 -1
- package/dist/components/salla-tab-content.js +6 -1
- package/dist/components/salla-tab-content2.js +55 -1
- package/dist/components/salla-tab-header.js +6 -1
- package/dist/components/salla-tab-header2.js +85 -1
- package/dist/components/salla-tabs.js +6 -1
- package/dist/components/salla-tabs2.js +75 -1
- package/dist/components/salla-tel-input.js +6 -1
- package/dist/components/salla-tel-input2.js +168 -1
- package/dist/components/salla-tiered-offer.js +366 -1
- package/dist/components/salla-tooltip.js +6 -1
- package/dist/components/salla-tooltip2.js +57 -1
- package/dist/components/salla-trust-badges.js +90 -1
- package/dist/components/salla-user-menu.js +344 -1
- package/dist/components/salla-user-profile.js +203 -1
- package/dist/components/salla-user-settings.js +139 -1
- package/dist/components/salla-verify.js +303 -1
- package/dist/components/salla-wallet.js +114 -1
- package/dist/components/search.js +8 -1
- package/dist/components/shopping-bag.js +8 -1
- package/dist/components/special-discount.js +8 -1
- package/dist/components/star.js +8 -1
- package/dist/components/star2.js +8 -1
- package/dist/components/vanilla-picker.js +1034 -2
- package/dist/components/whatsapp2.js +8 -1
- package/dist/esm/{filepond-DlGaLh8N.js → filepond-Be7JObSq.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-BTVFYcQx.js → filepond-plugin-file-poster-DF0NWKCQ.js} +2 -2
- package/dist/esm/{filepond-plugin-file-validate-size-DGryLmWv.js → filepond-plugin-file-validate-size-DJFlJHtE.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-DxKfCD0V.js → filepond-plugin-file-validate-type-DykpLW1Z.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-2W7pu9hn.js → filepond-plugin-image-edit-CyIHxrnW.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-OQu-IvPH.js → filepond-plugin-image-exif-orientation-DbCOAhSu.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-DEW_tSNR.js → filepond-plugin-image-preview-CGRGZcft.js} +1 -1
- package/dist/esm/{index-DYB20YqN.js → index-Cz6cYzxG.js} +547 -780
- package/dist/esm/{index-BDqMkCqE.js → index-_kPnZdm0.js} +1 -1
- package/dist/esm/loader.js +3 -4
- package/dist/esm/salla-accordion-body_2.entry.js +5 -5
- package/dist/esm/salla-accordion_6.entry.js +15 -19
- package/dist/esm/salla-add-product-button_4.entry.js +10 -12
- package/dist/esm/salla-advertisement.entry.js +3 -3
- package/dist/esm/salla-alert_2.entry.js +5 -5
- package/dist/esm/salla-app-install-alert.entry.js +3 -3
- package/dist/esm/salla-apps-icons.entry.js +3 -3
- package/dist/esm/salla-booking-field_7.entry.js +23 -25
- package/dist/esm/salla-bullet-delivery.entry.js +3 -3
- package/dist/esm/salla-cart-coupons.entry.js +3 -3
- package/dist/esm/salla-cart-item-offers_2.entry.js +5 -5
- package/dist/esm/salla-comment-form_8.entry.js +17 -17
- package/dist/esm/salla-conditional-offer.entry.js +3 -3
- package/dist/esm/salla-contacts.entry.js +3 -3
- package/dist/esm/salla-cookies-bar.entry.js +3 -3
- package/dist/esm/salla-count-down.entry.js +3 -3
- package/dist/esm/salla-custom-fields.entry.js +3 -3
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +3 -3
- package/dist/esm/salla-filters.entry.js +3 -3
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +3 -3
- package/dist/esm/salla-hook.entry.js +2 -5
- package/dist/esm/salla-infinite-scroll.entry.js +3 -3
- package/dist/esm/salla-installment.entry.js +3 -3
- package/dist/esm/salla-list-tile.entry.js +3 -3
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +3 -3
- package/dist/esm/salla-loyalty-prize-item.entry.js +3 -3
- package/dist/esm/salla-loyalty-program.entry.js +3 -3
- package/dist/esm/salla-loyalty.entry.js +3 -3
- package/dist/esm/salla-maintenance-alert.entry.js +3 -3
- package/dist/esm/salla-map.entry.js +3 -3
- package/dist/esm/salla-menu.entry.js +3 -3
- package/dist/esm/salla-metadata.entry.js +3 -3
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +5 -5
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +6 -8
- package/dist/esm/salla-multiple-bundle-product.entry.js +4 -6
- package/dist/esm/salla-notification-item.entry.js +3 -3
- package/dist/esm/salla-notifications.entry.js +3 -3
- package/dist/esm/salla-offer-modal.entry.js +3 -3
- package/dist/esm/salla-offer.entry.js +3 -3
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +3 -3
- package/dist/esm/salla-order-details-options.entry.js +3 -3
- package/dist/esm/salla-order-details.entry.js +4 -6
- package/dist/esm/salla-order-edit-item.entry.js +3 -3
- package/dist/esm/salla-order-edit.entry.js +3 -3
- package/dist/esm/salla-order-summary.entry.js +3 -3
- package/dist/esm/salla-order-totals-card.entry.js +4 -6
- package/dist/esm/salla-orders.entry.js +3 -3
- package/dist/esm/salla-payments.entry.js +3 -3
- package/dist/esm/salla-placeholder.entry.js +3 -3
- package/dist/esm/salla-price-range.entry.js +3 -3
- package/dist/esm/salla-product-card.entry.js +3 -3
- package/dist/esm/salla-product-size-guide.entry.js +3 -3
- package/dist/esm/salla-products-list.entry.js +3 -3
- package/dist/esm/salla-products-slider.entry.js +3 -3
- package/dist/esm/salla-progress-bar.entry.js +3 -3
- package/dist/esm/salla-quick-order.entry.js +3 -3
- package/dist/esm/salla-rating-modal.entry.js +3 -3
- package/dist/esm/salla-scopes.entry.js +3 -3
- package/dist/esm/salla-search.entry.js +4 -6
- package/dist/esm/salla-skeleton.entry.js +3 -3
- package/dist/esm/salla-slider.entry.js +3 -3
- package/dist/esm/salla-social-share.entry.js +3 -3
- package/dist/esm/salla-social.entry.js +3 -3
- package/dist/esm/salla-tab-content_3.entry.js +7 -7
- package/dist/esm/salla-tiered-offer.entry.js +3 -3
- package/dist/esm/salla-tooltip.entry.js +3 -3
- package/dist/esm/salla-trust-badges.entry.js +3 -3
- package/dist/esm/salla-user-menu.entry.js +3 -3
- package/dist/esm/salla-user-profile.entry.js +3 -3
- package/dist/esm/salla-user-settings.entry.js +3 -3
- package/dist/esm/salla-verify.entry.js +3 -3
- package/dist/esm/salla-wallet.entry.js +3 -3
- package/dist/esm/twilight.js +4 -5
- package/dist/esm/{vanilla-picker-Dt9vZPZF.js → vanilla-picker-C_YV5LtA.js} +1 -1
- package/dist/twilight/{p-33779828.entry.js → p-0200cddd.entry.js} +1 -1
- package/dist/twilight/p-04dc0b71.entry.js +4 -0
- package/dist/twilight/{p-105b1dab.entry.js → p-0bac200e.entry.js} +1 -1
- package/dist/twilight/{p-ccfe5308.entry.js → p-0ef99df1.entry.js} +1 -1
- package/dist/twilight/{p-647b6d76.entry.js → p-1087f0dd.entry.js} +1 -1
- package/dist/twilight/{p-1875537e.entry.js → p-17dd8b68.entry.js} +1 -1
- package/dist/twilight/{p-aa7c5de0.entry.js → p-25a9bf1b.entry.js} +1 -1
- package/dist/twilight/{p-34b670fc.entry.js → p-2602927d.entry.js} +1 -1
- package/dist/twilight/p-268695ff.entry.js +4 -0
- package/dist/twilight/{p-aaa0c743.entry.js → p-34920aac.entry.js} +1 -1
- package/dist/twilight/{p-817b8ba5.entry.js → p-3656b48d.entry.js} +1 -1
- package/dist/twilight/{p-4932857d.entry.js → p-3857beb4.entry.js} +1 -1
- package/dist/twilight/{p-af3c74f4.entry.js → p-39c601e3.entry.js} +1 -1
- package/dist/twilight/{p-b598c0f7.entry.js → p-3c810881.entry.js} +1 -1
- package/dist/twilight/{p-d371d450.entry.js → p-3cf5c61f.entry.js} +1 -1
- package/dist/twilight/{p-3ccc532d.entry.js → p-413a7236.entry.js} +1 -1
- package/dist/twilight/{p-f176d41d.entry.js → p-42778349.entry.js} +1 -1
- package/dist/twilight/{p-b17d055d.entry.js → p-45e4f6f4.entry.js} +1 -1
- package/dist/twilight/{p-2abaa633.entry.js → p-4680956b.entry.js} +1 -1
- package/dist/twilight/{p-96a20515.entry.js → p-468b999f.entry.js} +1 -1
- package/dist/twilight/{p-df6853b5.entry.js → p-46d1823f.entry.js} +1 -1
- package/dist/twilight/{p-c87951a2.entry.js → p-49db497f.entry.js} +1 -1
- package/dist/twilight/{p-18bb0181.entry.js → p-4b033276.entry.js} +1 -1
- package/dist/twilight/{p-296d2dd0.entry.js → p-4f7bc9c3.entry.js} +1 -1
- package/dist/twilight/{p-4fa4547a.entry.js → p-543ee624.entry.js} +1 -1
- package/dist/twilight/{p-2fe01e44.entry.js → p-5957f774.entry.js} +1 -1
- package/dist/twilight/{p-96e78428.entry.js → p-5a4f0b99.entry.js} +1 -1
- package/dist/twilight/{p-87c0ca91.entry.js → p-5a8c0fd2.entry.js} +1 -1
- package/dist/twilight/{p-e28c0773.entry.js → p-5ab7a295.entry.js} +1 -1
- package/dist/twilight/{p-542d3277.entry.js → p-5e496aaa.entry.js} +1 -1
- package/dist/twilight/{p-c3ffb88a.entry.js → p-5f440956.entry.js} +1 -1
- package/dist/twilight/{p-94dbc1e9.entry.js → p-60fafcd9.entry.js} +1 -1
- package/dist/twilight/{p-1ef2602d.entry.js → p-708f02db.entry.js} +1 -1
- package/dist/twilight/{p-b64f3155.entry.js → p-7829ea8a.entry.js} +1 -1
- package/dist/twilight/{p-7093a427.entry.js → p-7d3e592a.entry.js} +1 -1
- package/dist/twilight/{p-96d03a28.entry.js → p-81876026.entry.js} +1 -1
- package/dist/twilight/{p-d9f5a8cd.entry.js → p-8306ef5e.entry.js} +1 -1
- package/dist/twilight/{p-d4a242f8.entry.js → p-8403cd93.entry.js} +1 -1
- package/dist/twilight/{p-7abddca8.entry.js → p-8474c4f6.entry.js} +1 -1
- package/dist/twilight/p-8552160a.entry.js +4 -0
- package/dist/twilight/p-8c9b0e2a.entry.js +4 -0
- package/dist/twilight/{p-2881bb33.entry.js → p-8f2dfc57.entry.js} +1 -1
- package/dist/twilight/{p-c091e2dc.entry.js → p-94b1a2ae.entry.js} +1 -1
- package/dist/twilight/{p-ede67a08.entry.js → p-95dad1af.entry.js} +1 -1
- package/dist/twilight/{p-eac718cd.entry.js → p-964b7db9.entry.js} +1 -1
- package/dist/twilight/{p-e3b8e0e1.entry.js → p-99735748.entry.js} +1 -1
- package/dist/twilight/{p-X6Yi3bYP.js → p-BZKDQg1s.js} +1 -1
- package/dist/twilight/{p-Cw3UBzjl.js → p-B_sN7OnY.js} +1 -1
- package/dist/twilight/{p-8r0S6BcZ.js → p-Bpi0aG1F.js} +1 -1
- package/dist/twilight/{p-BkClxrC4.js → p-CP8rFQ5n.js} +1 -1
- package/dist/twilight/{p-bNzv71Xl.js → p-CfmIbM8B.js} +1 -1
- package/dist/twilight/{p-bScl0xMh.js → p-CpO1SrBd.js} +1 -1
- package/dist/twilight/p-Cz6cYzxG.js +5 -0
- package/dist/twilight/p-Do4hSOGo.js +9 -0
- package/dist/twilight/{p-Ck4zxCil.js → p-JJmlh-ji.js} +1 -1
- package/dist/twilight/{p-dd2bd5dc.entry.js → p-a4aedcfe.entry.js} +1 -1
- package/dist/twilight/{p-06fa7327.entry.js → p-b0d01f9f.entry.js} +1 -1
- package/dist/twilight/p-b8404cfb.entry.js +4 -0
- package/dist/twilight/{p-108d8c8b.entry.js → p-b8e3e180.entry.js} +1 -1
- package/dist/twilight/{p-ad07f67a.entry.js → p-bd687cd0.entry.js} +1 -1
- package/dist/twilight/{p-44fa7521.entry.js → p-c0037fac.entry.js} +1 -1
- package/dist/twilight/{p-293c6cf3.entry.js → p-c121f8e4.entry.js} +1 -1
- package/dist/twilight/{p-a01f1992.entry.js → p-c29907df.entry.js} +1 -1
- package/dist/twilight/p-c39675ef.entry.js +4 -0
- package/dist/twilight/{p-bff4c7b3.entry.js → p-cb7a985e.entry.js} +1 -1
- package/dist/twilight/p-cbe620c4.entry.js +4 -0
- package/dist/twilight/{p-6f36541a.entry.js → p-d2fd79b4.entry.js} +1 -1
- package/dist/twilight/{p-d337c399.entry.js → p-d6cf0ffd.entry.js} +1 -1
- package/dist/twilight/{p-748df7e6.entry.js → p-d8f60f2f.entry.js} +1 -1
- package/dist/twilight/p-d99610f9.entry.js +4 -0
- package/dist/twilight/{p-e6bbf50d.entry.js → p-dc897bdd.entry.js} +1 -1
- package/dist/twilight/{p-f7999a6d.entry.js → p-dca46236.entry.js} +1 -1
- package/dist/twilight/{p-e94f217b.entry.js → p-e48853c9.entry.js} +1 -1
- package/dist/twilight/{p-09d39785.entry.js → p-e4fdb206.entry.js} +1 -1
- package/dist/twilight/p-ed913ae7.entry.js +4 -0
- package/dist/twilight/p-f067fcd6.entry.js +4 -0
- package/dist/twilight/{p-57ff1f25.entry.js → p-f2cd6975.entry.js} +1 -1
- package/dist/twilight/{p-ad041ab5.entry.js → p-f2ffbfbb.entry.js} +1 -1
- package/dist/twilight/{p-f5d15e71.entry.js → p-f3166e60.entry.js} +1 -1
- package/dist/twilight/{p-59ae82bd.entry.js → p-f8fcc8f4.entry.js} +1 -1
- package/dist/twilight/{p-c1fd45b1.entry.js → p-f9e52fd9.entry.js} +1 -1
- package/dist/twilight/p-fcddbfc3.entry.js +4 -0
- package/dist/twilight/{p-41c733c2.entry.js → p-fe7ac9bb.entry.js} +1 -1
- package/dist/twilight/{p-0add06f9.entry.js → p-ff14dca3.entry.js} +1 -1
- package/dist/twilight/{p-BZnoSB1s.js → p-mlFGjxcj.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components.d.ts +177 -763
- package/dist/types/stencil-public-runtime.d.ts +11 -169
- package/package.json +5 -5
- package/dist/cjs/app-globals-oehrC7QI.js +0 -39
- package/dist/esm/app-globals-BFryt7-C.js +0 -37
- package/dist/twilight/p-1daeed6e.entry.js +0 -4
- package/dist/twilight/p-2ddb3fce.entry.js +0 -4
- package/dist/twilight/p-34968e31.entry.js +0 -4
- package/dist/twilight/p-665189b4.entry.js +0 -4
- package/dist/twilight/p-776c9d33.entry.js +0 -4
- package/dist/twilight/p-7b8313ef.entry.js +0 -4
- package/dist/twilight/p-7bd0ede5.entry.js +0 -4
- package/dist/twilight/p-8e8d9d7d.entry.js +0 -4
- package/dist/twilight/p-D1vqXXNX.js +0 -9
- package/dist/twilight/p-DYB20YqN.js +0 -5
- package/dist/twilight/p-Vl6qpttb.js +0 -4
- package/dist/twilight/p-af60e72a.entry.js +0 -4
- package/dist/twilight/p-e679884a.entry.js +0 -4
- package/dist/twilight/p-efab88c5.entry.js +0 -4
|
@@ -1,4 +1,735 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{transformTag as s,proxyCustomElement as t,HTMLElement as e,h as i}from"@stencil/core/internal/client";import{a}from"./anime.es.js";import{I as l}from"./arrow-left.js";import{C as o}from"./cancel.js";import{d as r}from"./salla-button2.js";import{d as c}from"./salla-datetime-picker2.js";import{d as n}from"./salla-file-upload2.js";import{d as h}from"./salla-list-tile2.js";import{d}from"./salla-loading2.js";import{d as g}from"./salla-modal2.js";import{d as f}from"./salla-placeholder2.js";import{d as m}from"./salla-skeleton2.js";import{d as u}from"./salla-slider2.js";import{d as p}from"./salla-tel-input2.js";var b='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>gift-sharing</title>\n<path d="M5 32h-4c-0.552 0-1-0.448-1-1v0-14c0-0.552 0.448-1 1-1v0h4c0.552 0 1 0.448 1 1v0 14c0 0.552-0.448 1-1 1v0zM2 30h2v-12h-2zM19.32 30h-14.32v-2h14.32c0.693-0.005 1.329-0.242 1.837-0.637l-0.007 0.005 8.45-6.568c0.216-0.16 0.365-0.402 0.399-0.679l0-0.005c0.005-0.036 0.007-0.077 0.007-0.119 0-0.226-0.078-0.434-0.209-0.599l0.002 0.002c-0.16-0.216-0.401-0.364-0.677-0.399l-0.005-0.001c-0.034-0.004-0.073-0.007-0.113-0.007-0.227 0-0.436 0.078-0.601 0.208l0.002-0.002-7.126 5.526c-1.003 0.793-2.285 1.273-3.68 1.274h-6.6v-2h6.6c0.926-0.001 1.777-0.32 2.45-0.852l-0.008 0.006 7.126-5.526c0.492-0.39 1.122-0.625 1.807-0.625 0.135 0 0.268 0.009 0.398 0.027l-0.015-0.002c0.824 0.102 1.534 0.524 2.011 1.137l0.005 0.007c0.39 0.494 0.625 1.127 0.625 1.814 0 0.136-0.009 0.27-0.027 0.402l0.002-0.015c-0.106 0.819-0.529 1.523-1.141 1.995l-0.007 0.005-8.458 6.578c-0.834 0.649-1.894 1.043-3.047 1.050h-0.002zM11 26c-0.552 0-1-0.448-1-1s0.448-1 1-1v0c2.406-0.004 4.415-1.703 4.894-3.967l0.006-0.033h-10.9c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h12c0.552 0 1 0.448 1 1v0c0 3.866-3.134 7-7 7v0zM24 12h-16c-1.105 0-2-0.895-2-2v0-2c0-1.105 0.895-2 2-2v0h16c1.105 0 2 0.895 2 2v0 2c0 1.105-0.895 2-2 2v0zM24 10v0zM8 8v2h16v-2zM23 18c-0.552 0-1-0.448-1-1v0-6c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM9 16c-0.552 0-1-0.448-1-1v0-4c0-0.552 0.448-1 1-1s1 0.448 1 1v0 4c0 0.552-0.448 1-1 1v0zM16 16c-0.552 0-1-0.448-1-1v0-8c0-0.552 0.448-1 1-1s1 0.448 1 1v0 8c0 0.552-0.448 1-1 1v0zM16 8c-0.552-0-1-0.448-1-1 0-0.077 0.009-0.151 0.025-0.223l-0.001 0.007c0.314-1.849 0.963-3.5 1.887-4.961l-0.033 0.055c0.539-0.521 1.274-0.842 2.084-0.842 1.657 0 3 1.343 3 3 0 0.81-0.321 1.545-0.843 2.085l0.001-0.001c-1.405 0.891-3.056 1.541-4.824 1.845l-0.080 0.011c-0.065 0.015-0.139 0.024-0.216 0.024h-0zM19 3c-0.001 0-0.001 0-0.002 0-0.276 0-0.525 0.112-0.706 0.292l0-0c-0.391 0.669-0.703 1.444-0.897 2.264l-0.011 0.058c0.878-0.205 1.653-0.517 2.363-0.93l-0.041 0.022c0.18-0.181 0.292-0.43 0.292-0.706 0-0.551-0.446-0.999-0.998-1h-0zM16 8c-0.077-0-0.151-0.009-0.223-0.025l0.007 0.001c-1.848-0.315-3.499-0.965-4.959-1.888l0.055 0.032c-0.521-0.539-0.842-1.274-0.842-2.084 0-1.657 1.343-3 3-3 0.81 0 1.545 0.321 2.085 0.843l-0.001-0.001c0.891 1.405 1.541 3.056 1.845 4.824l0.011 0.080c0.015 0.066 0.024 0.141 0.024 0.218 0 0.552-0.448 1-1 1-0.001 0-0.001 0-0.002 0h0zM13 3c-0.001 0-0.001 0-0.002 0-0.552 0-1 0.448-1 1 0 0.277 0.112 0.527 0.294 0.708l0 0c0.669 0.391 1.444 0.703 2.264 0.897l0.058 0.011c-0.205-0.878-0.517-1.653-0.93-2.363l0.022 0.041c-0.181-0.181-0.43-0.293-0.706-0.294h-0z"></path>\n</svg>\n';const v=t(class extends e{constructor(s){super(),!1!==s&&this.__registerHost(),this.defaultEvent="gifting:open",this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.currentStep=1,this.showCalendar=!1,this.showGiftText=!1,this.currentLang="",this.parentClass="is-current-step-1",this.errors={},this.gift=void 0,this.selectedGiftTextOption=void 0,this.selectedCountryId=void 0,this.selectedCountryCode=void 0,this.loadingCities=!1,this.loadingRegions=!1,this.regions=[],this.selectedRegionId=void 0,this.isKSA=!1,this.step2Animated=!1,this.showTextArea=!1,this.selectedImage=void 0,this.uploadedImage=void 0,this.selectedText=void 0,this.hasError=!1,this.timeZone=null,this.receiverCountryCode=salla.config.get("store.scope.countries")?.[0]||salla.config.get("store.store_country")||"SA",this.hostId="salla-gifting-"+Math.random().toString(36).slice(2,10),this.formSelector="form.product-form, form.form--product-options",salla.lang.onLoaded((()=>{this.selectImageOrUpload=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.sectionTitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love"),this.sectionSubtitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love_message"),this.sectionBtnText=salla.lang.get("blocks.buy_as_gift.send_as_a_gift"),this.giftDetails=salla.lang.get("blocks.buy_as_gift.gift_details"),this.selectGiftMessage=salla.lang.get("blocks.buy_as_gift.select_gift_message"),this.giftCustomText=salla.lang.get("blocks.buy_as_gift.gift_custom_text"),this.textId=salla.lang.get("blocks.buy_as_gift.text_id"),this.incorrectGiftText=salla.lang.get("blocks.buy_as_gift.incorrect_gift_text"),this.nextStep=salla.lang.get("blocks.buy_as_gift.next_step"),this.senderNameLabel=salla.lang.get("blocks.buy_as_gift.sender_name"),this.receiverNameFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_name"),this.receiverMobileFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_mobile"),this.receiverCountryFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_country"),this.ksa=salla.lang.get("pages.checkout.ksa"),this.selectCity=salla.lang.get("pages.checkout.select_city"),this.selectCountry=salla.lang.get("pages.checkout.select_country"),this.selectCityInfo=salla.lang.get("blocks.buy_as_gift.city_info"),this.receiverCityFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_city"),this.receiverRegionFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_region")||salla.lang.get("pages.checkout.region"),this.selectRegion=salla.lang.get("pages.checkout.select_region"),this.receiverEmailFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_email"),this.emailPlaceholder=salla.lang.get("common.elements.email_placeholder"),this.sendLater=salla.lang.get("blocks.buy_as_gift.send_later"),this.selectSendDateAndTime=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time"),this.canNotEditOrderAfterSelectDate=salla.lang.get("blocks.buy_as_gift.can_not_edit_order_after_select_date"),this.sendGift=salla.lang.get("blocks.buy_as_gift.send_gift"),this.donationRequired=salla.lang.get("pages.products.donation_amount_required"),this.currentLang=salla.lang.locale})),salla.event.on(this.defaultEvent,(()=>{this.open()}))}componentDidLoad(){salla.event.product.onPriceUpdated((()=>{const s=document.querySelector(".s-quantity-input-input");this.quantity=s?.value}))}getFormDataFromForm(){if(!this.formSelector)return null;const s=document.querySelector(this.formSelector);return s?new FormData(s):null}mergeObjectToFormData(s,t,e){for(let i in s){if(!s.hasOwnProperty(i)||null==s[i])continue;const a=e?`${e}[${i}]`:i;"object"!=typeof s[i]||null===s[i]||s[i]instanceof File?t.set(a,s[i]):this.mergeObjectToFormData(s[i],t,a)}return t}async open(){if(salla.config.isGuest())return salla.api.auth.setAfterLoginEvent(this.defaultEvent),void salla.event.dispatch("login::open",{withoutReload:!0});await this.modal.open();const s=this.productId?()=>salla.product.getGiftProductDetails(this.productId):()=>salla.cart.getGiftCartDetails();return await salla.api.withoutNotifier(s).then((s=>{this.gift=s.data,this.senderName=this.gift.sender_name})).catch((s=>{this.hasError=!0,this.errorMessage=s.response?.data?.error?.message||s.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}async setWrapperHeight(s=1,t=250,e=0,i=0){let a=document.querySelector(`#${this.hostId} .gift-step-${s}`);const l=()=>{this.stepsWrapper.style.height=i?i+"px":a.offsetHeight+e+"px"};this.step2Animated&&2===s?requestAnimationFrame(l):setTimeout(l,t)}toggleCalendar(){this.showCalendar=!this.showCalendar,this.setWrapperHeight(2,150,0)}toggleGiftText(s){this.textSelect?.classList.remove("s-form-has-error");let t=s.target.children[s.target.selectedIndex].getAttribute("data-id"),e="custom"==t;this.showGiftText=e,t?(this.selectedGiftTextOption=t,this.selectedText=e?void 0:s.target.value,this.setWrapperHeight(1,150,5)):(this.textArea.value="",this.selectedText=void 0,this.selectedGiftTextOption=void 0,this.setWrapperHeight(1,150,-15))}async goToStep2(){return this.selectedGiftTextOption?"custom"!=this.selectedGiftTextOption||this.selectedText?(this.textSelect.classList.remove("s-form-has-error"),this.customTextArea.classList.remove("s-form-has-error"),this.setWrapperHeight(2,600,0),(new a.timeline).add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,50],delay:a.stagger(70),duration:1200}).add({targets:".gift-step-2",translateX:["-110%",0],opacity:[0,1]},"-=1800").add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[-50,0],delay:a.stagger(70),duration:1200,complete:()=>{this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((s=>{s.classList.remove("opacity-0"),s.removeAttribute("style")})),this.step2Animated=!0}},"-=1200"),this.currentStep=2,void(this.parentClass="is-current-step-"+this.currentStep)):(this.textSelect.classList.remove("s-form-has-error"),void this.customTextArea.classList.add("s-form-has-error")):(this.textSelect.classList.add("s-form-has-error"),void this.customTextArea.classList.remove("s-form-has-error"))}goToStep1(s){s.preventDefault();let t=new a.timeline({autoplay:!1});t.add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,-50],delay:a.stagger(70),duration:1200}).add({targets:".gift-step-1",translateX:["110%",0],opacity:[0,1]},"-=1800").add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[50,0],delay:a.stagger(70),duration:1200,complete:()=>{this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((s=>{s.classList.remove("opacity-0"),s.removeAttribute("style")}))}},"-=1200"),t.play(),this.step2Animated=!1,this.setWrapperHeight(1,600,0),this.currentStep=1,this.parentClass="is-current-step-"+this.currentStep}getFilepondPlaceholder(){return`<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>images</title>\n<path d="M22.667 29.333h-13.333c-3.676 0-6.667-2.991-6.667-6.667v-13.333c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v13.333c0 5.145 4.187 9.333 9.333 9.333h13.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM22.667 5.333c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 10.667c-0.735 0-1.333-0.597-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.599 1.333-1.333 1.333zM25.333 0h-13.333c-3.676 0-6.667 2.991-6.667 6.667v13.333c0 1.055 0.268 2.040 0.707 2.927 0.039 0.099 0.088 0.188 0.151 0.277 1.137 2.053 3.301 3.463 5.809 3.463h13.333c3.676 0 6.667-2.991 6.667-6.667v-13.333c0-3.676-2.991-6.667-6.667-6.667zM12 24c-1.244 0-2.344-0.583-3.077-1.476l5.721-7.047 6.629 8.523zM29.333 20c0 2.205-1.795 4-4 4h-0.68l-8.933-11.485c-0.251-0.32-0.633-0.511-1.039-0.515h-0.015c-0.401 0-0.781 0.181-1.035 0.492l-5.632 6.935v-12.76c0-2.205 1.795-4 4-4h13.333c2.205 0 4 1.795 4 4z"></path>\n</svg>\n</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload?this.selectImageOrUpload:""}</p></div>`}setPreview(s){this.uploader?.classList.add("has-bg");var t=document.querySelector(`#${this.hostId}.filepond-bg`)?document.querySelector(`#${this.hostId} .filepond-bg`):document.createElement("div");t.classList.add("filepond-bg"),t.classList.remove("s-hidden"),t.style.backgroundImage="url('"+s.url+"')",this.uploader?.querySelector(".filepond--root")?.appendChild(t),this.uploadedImage=s.url,this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}removePreview(){this.uploader.classList.remove("has-bg");let s=document.querySelector(`#${this.hostId} .filepond-bg`);s.removeAttribute("style"),s.classList.add("s-hidden"),this.handleRemoveImage()}handleTextAreaChange(s){this.selectedText=s.target.value,this.customTextArea.classList.remove("s-form-has-error")}clearError(s){if(this.errors?.[s]){const{[s]:t,...e}=this.errors;this.errors=e}}handleSenderName(s){this.senderName=s.target.value,this.clearError("sender_name")}handleReceiverName(s){this.receiverName=s.target.value,this.clearError("receiver.name")}handleReceiverCity(s){this.receiverCity=s.target.value,this.clearError("receiver.city_id")}async handleCountryChange(s){const t=Number(s.target.value);this.selectedCountryId=t,this.clearError("receiver.country");const e=this.gift?.countries?.find((s=>s.id==t));if(this.selectedCountryCode=e?.country_code,this.isKSA="SA"===e?.country_code,this.regions=[],this.selectedRegionId=void 0,this.gift={...this.gift,cities:[]},this.receiverCity=void 0,!t||0===this.gift?.countries?.length)return this.selectedCountryCode=void 0,this.isKSA=!1,void this.setWrapperHeight(2,0,0);if(this.isKSA){this.loadingRegions=!0,this.setWrapperHeight(2,0,0);try{const s=await salla.api.request(`shipping/countries/${t}/regions`);s&&s.data&&(this.regions=s.data)}catch(s){console.error("Error fetching regions:",s)}finally{this.loadingRegions=!1,this.setWrapperHeight(2,0,0)}}else{this.loadingCities=!0,this.setWrapperHeight(2,0,0);try{const s=await salla.api.request("shipping/cities?for_branch=0&country_id="+t);s&&s.data&&(this.gift={...this.gift,cities:s.data})}catch(s){console.error("Error fetching cities:",s)}finally{this.loadingCities=!1}}}async handleRegionChange(s){const t=Number(s.target.value);if(this.selectedRegionId=t,this.clearError("receiver.region"),this.gift={...this.gift,cities:[]},this.receiverCity=void 0,t){this.loadingCities=!0;try{const s=await salla.api.request(`shipping/cities?for_branch=0&country_id=${this.selectedCountryId}®ion_id=${t}`);s&&s.data&&(this.gift={...this.gift,cities:s.data})}catch(s){console.error("Error fetching cities:",s)}finally{this.loadingCities=!1,this.setWrapperHeight(2,0,0)}}}handleUploadImage(s){this.uploadedImage=s,this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}handleRemoveImage(){this.uploadedImage="",this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}handlePhoneInputChange(s){let t=s.detail;this.receiverMobile=t.number,this.receiverCountryCode=t.country_code,this.clearError("receiver.mobile")}handleDateTimePicker(s){this.deliveryDate=s.detail}getCalendarClasses(){return{"s-form-group":!0,"anime-item":!0,"s-gifting-calendar":!0,shown:this.showCalendar,hide:!this.showCalendar,"s-form-has-error":!!this.errors&&this.errors.deliver_at}}async submitForm(){const s=document.querySelector("#donating-amount")?.value;if(this.calendarFormGroup.classList.remove("s-form-has-error"),this.errors&&(this.errors={},this.setWrapperHeight(2,150,0)),this.showCalendar&&!this.deliveryDate)return void this.calendarFormGroup.classList.add("s-form-has-error");const t=[{key:"sender_name",value:this.senderName,label:this.senderNameLabel},{key:"receiver.name",value:this.receiverName,label:this.receiverNameFieldLabel},{key:"receiver.mobile",value:this.receiverMobile,label:this.receiverMobileFieldLabel},...this.physicalProducts?[{key:"receiver.country",value:this.selectedCountryId,label:this.receiverCountryFieldLabel},...this.isKSA?[{key:"receiver.region",value:this.selectedRegionId,label:this.receiverRegionFieldLabel}]:[],{key:"receiver.city_id",value:this.receiverCity,label:this.receiverCityFieldLabel}]:[]],e={};if(t.forEach((({key:s,value:t,label:i})=>{t||(e[s]=salla.lang.get("common.errors.field_required",{attribute:i}))})),Object.keys(e).length)return this.errors=e,void this.setWrapperHeight(2,150,0);const i={text:this.selectedText,sender_name:this.senderName,quantity:this.quantity,deliver_at:this.showCalendar?this.deliveryDate:null,image_url:this.uploadedImage??this.selectedImage,donation_amount:s||null,receiver:{name:this.receiverName,mobile_country_code:this.receiverCountryCode,mobile:this.receiverMobile,...this.physicalProducts&&this.selectedCountryCode?{country_code:this.selectedCountryCode}:{},...this.physicalProducts&&this.selectedRegionId?{region_id:this.selectedRegionId}:{},...this.receiverCity&&this.physicalProducts?{city_id:this.receiverCity}:{}},has_apple_pay:salla.helpers.hasApplePay()};let a;this.productId&&this.formSelector&&(a=this.getFormDataFromForm()||new FormData,a=this.mergeObjectToFormData(i,a));const l=this.productId?()=>salla.product.addProductGiftToCart(this.productId,a,!0):()=>salla.cart.addCartGiftToCart(i,!0);return await l().then((()=>this.modal.close())).catch((s=>{s.response&&422==s.response.status?this.errors=s.response.data.error.fields:console.log(s),this.setWrapperHeight(2,150,0)}))}step2ItemClass(s=""){const t="anime-item"+(this.step2Animated?"":" opacity-0");return s?`${s} ${t}`:t}generateClass(){return{"s-gifting-widget":!0,"s-gifting-widget-vertical":!!this.vertical,"s-gifting-widget-horizontal":!this.vertical}}async handleGiftButtonClick(){if(this.productId&&this.formSelector){const s=document.querySelector(this.formSelector);if(!s)return void console.error("SallaGifting:: Form not found in the document!");if(!(s instanceof HTMLFormElement))return void console.error("SallaGifting:: The specified selector does not correspond to a form tag!");if(!s.reportValidity())return console.error("SallaGifting:: Form is not valid!"),void salla.error(salla.lang.get("common.messages.required_fields"))}const s=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);!s||await s.reportValidity()?this.open():salla.error(salla.lang.get("common.messages.required_fields"))}render(){return[i("div",{key:"5d0eec8210f77d166c144704ec78bffcaf1f4ce0"},i("salla-list-tile",{key:"19cc20b4f70bbb8a7d267f60052db77589901962",class:this.generateClass()},i("div",{key:"1c3c52b5ac48e71a6ac26c60494657ac28d16457",slot:"title"},this.vertical?i("span",{innerHTML:b}):"",i("h3",{key:"e3379fb3ed39d1bc63500346058b26b883c3be13"},this.widgetTitle?this.widgetTitle:this.sectionTitle)),i("div",{key:"f6c2a522727546aa27cef725faa8be082da063da",slot:"subtitle"},i("div",{key:"7b58ad967f39fa2cc660369b72e73f8dc49f90dc"},this.widgetSubtitle?this.widgetSubtitle:this.sectionSubtitle)),i("div",{key:"848396dcd6ce6009ebc4cf1a209a055ad1adbf15",slot:"action"},i("salla-button",{key:"2ba69b670f1c958784c6f1dca6b2dd0b93f20859",color:"primary",fill:"outline",width:"wide",class:"s-gifting-widget-action",onClick:()=>this.handleGiftButtonClick()},i("slot",{key:"6ac9ac339e321fc9433465cfd75f299307ee7152",name:"widget-btn-content"},i("div",{key:"c61dd36375886c1ecf87f115e5248dca1af7efc9",class:"s-gifting-widget-action-content"},i("span",{key:"0c8a3630ba6b15889fc4bf3d55a1279cdf713400",innerHTML:b})," ",i("span",{key:"c9299ec752e5393f30a78e1e01d367be9e97ca50"},this.sectionBtnText)))))),i("salla-modal",{key:"9ee17e79f97eee59d25d9627d5b1cd4ada7cadb3",id:this.hostId,isLoading:!0,class:"s-gifting-modal",width:"sm",ref:s=>this.modal=s},i("div",{key:"aba3b6a4d3e903934c9b5e629119c3a3b5bc90ab",slot:"loading"},i("div",{key:"e03613cc85bf4024f63d2e256a2744ec78f7eabf",class:"s-gifting-skeleton"},i("div",{key:"01156691d540ce5ef5723902610a1da27fba3ddb",class:"s-gifting-modal-header"},i("salla-skeleton",{key:"e45b4868e4fa5633aeb22f758f75f5412290b179",type:"circle",height:"5rem",width:"5rem"}),i("h2",{key:"2b427d38dd6e0569e16de84ef46eb2052d23b739",class:"s-gifting-modal-title"},i("div",{key:"c4f9cb6f513e3ebd2e6ad209648a1f70bcafbcb5",class:"s-gifting-modal-badge-wrapper"},i("salla-skeleton",{key:"e684b682a4cca89262128cca13604b7aa9a83cd7",height:"15px",width:"150px"})))),i("div",{key:"2941865d68cd216b4dd82bb8279f6bcbaa062bf3",class:"s-gifting-skeleton-content"},i("salla-skeleton",{key:"7c4f4235a666930ceef3dc0b38809aea5ee5ce5c",height:"10px",width:"150px"}),i("salla-skeleton",{key:"0257f401762a11b0bf3da7db603b4e5f57bd1aae",height:"230px"}),i("salla-skeleton",{key:"cced26b189549fcee4eff3a3fbd943a5735b4c6c",height:"10px",width:"150px"}),i("salla-skeleton",{key:"f5893e5c631564c91bfe42c4102190d43f913947",height:"30px"}),i("salla-skeleton",{key:"64d3738017cf6732b429848c1de4ca16db1adc06",height:"40px"})))),i("slot",{key:"77d5bda8147f7f09d73b97fd7456121626b465a7",name:"header"}),this.hasError?i("salla-placeholder",{alignment:"center"},i("span",{slot:"title"},this.errorMessage||salla.lang.get("common.errors.empty_results")),i("span",{slot:"description"}," ")):[i("div",{class:"s-gifting-modal-header"},i("span",{class:"s-gifting-modal-icon"},i("span",{innerHTML:b})),i("h2",{class:"s-gifting-modal-title"},i("div",{class:"s-gifting-modal-badge-wrapper"},i("div",{class:"s-gifting-modal-badge"},i("span",null,i("span",null,this.currentStep),"/2")),i("span",null,this.giftDetails)))),i("div",{class:"s-gifting-steps-wrapper "+this.parentClass,ref:s=>this.stepsWrapper=s},i("div",{class:"s-gifting-step-one gift-step-1",ref:s=>this.step1Elems=s},i("div",{class:"s-gifting-modal-uploader-title anime-item"},this.selectImageForYourGift),i("div",{class:"s-gifting-modal-uploader anime-item",ref:s=>this.uploader=s},i("span",{class:"s-gifting-remove-preview",onClick:()=>this.removePreview(),innerHTML:o}),this.selectImageOrUpload&&i("salla-file-upload",{"instant-upload":!0,name:"image_url",url:salla.url.api(salla.product.api.getUrl("giftImage")),onUploaded:s=>this.handleUploadImage(s.detail),labelIdle:this.getFilepondPlaceholder(),onRemoved:()=>this.handleRemoveImage()})),i("div",{class:"anime-item"},!this.uploadedImage&&this.gift&&this.gift.gift_images&&this.gift.gift_images.length>0?i("salla-slider",{id:"gifting-slider",loop:!1,"controls-outer":!0,class:"s-gifting-slider",type:"carousel"},i("div",{slot:"items"},this.gift&&this.gift.gift_images?this.gift?.gift_images.map((s=>i("a",{class:"s-gifting-clickable s-gifting-image",onClick:()=>this.setPreview(s)},i("img",{style:{width:"120px"},src:s.url,alt:""+s.id})))):"")):""),i("div",{class:"anime-item"},i("div",{class:"s-form-group s-gifting-selectText",ref:s=>this.textSelect=s},i("select",{id:"gift-text-selection",name:"gift-text-selection",class:"s-form-control s-gifting-select",onChange:s=>this.toggleGiftText(s)},i("option",{"data-id":null,selected:!0},this.selectGiftMessage),this.gift&&this.gift.gift_texts?this.gift?.gift_texts.map((s=>i("option",{"data-id":s.id,value:s.text,key:s.id},s.text))):"",i("option",{"data-id":"custom"},this.giftCustomText))),i("div",{class:this.showGiftText?"s-form-group s-gifting-textarea shown":"s-form-group s-gifting-textarea hide",ref:s=>this.customTextArea=s},i("label",{htmlFor:"gift-custom-text",class:"s-form-label"},this.giftCustomText),i("div",{class:"mt-1"},i("textarea",{onInput:s=>this.handleTextAreaChange(s),rows:4,ref:s=>this.textArea=s,name:"gift-custom-text",id:"gift-custom-text",class:"s-form-control"})))),i("div",{class:"anime-item"},i("salla-button",{color:"primary",width:"wide",onClick:()=>this.goToStep2()},i("span",null,this.nextStep)))),i("div",{class:"s-gifting-step-two gift-step-2",ref:s=>this.step2Elems=s},i("div",{class:this.step2ItemClass(this.errors?.sender_name?"s-form-group s-form-has-error":"s-form-group")},i("label",{htmlFor:"sender_name",class:"s-form-label"},this.senderNameLabel),i("input",{type:"text",class:"s-form-control",name:"sender_name",id:"sender_name",value:this.senderName,onInput:s=>this.handleSenderName(s),placeholder:""}),this.errors&&this.errors.sender_name?i("span",{class:"s-gifting-error"},this.errors.sender_name):""),i("div",{class:this.step2ItemClass(this.errors?.["receiver.name"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{htmlFor:"receiver_name",class:"s-form-label"},this.receiverNameFieldLabel),i("input",{type:"text",class:"s-form-control",name:"receiver_name",id:"receiver_name",value:"",onInput:s=>this.handleReceiverName(s),placeholder:""}),this.errors&&this.errors["receiver.name"]?i("span",{class:"s-gifting-error"},this.errors["receiver.name"]):""),i("div",{class:this.step2ItemClass(this.errors?.["receiver.mobile"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{class:"s-form-label"},this.receiverMobileFieldLabel),i("salla-tel-input",{class:"s-gifting-tel-input",phone:this.receiverMobile,countryCode:this.receiverCountryCode,onPhoneEntered:s=>this.handlePhoneInputChange(s)}),this.errors&&this.errors["receiver.mobile"]?i("span",{class:"s-gifting-error"},this.errors["receiver.mobile"]):""),this.physicalProducts&&i("div",{class:this.step2ItemClass(this.errors?.["receiver.country"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{class:"s-form-label"},this.receiverCountryFieldLabel),i("select",{name:"country",class:"s-form-control",onChange:s=>this.handleCountryChange(s),required:!0},i("option",{value:""},this.selectCountry),this.gift?.countries?.map((s=>i("option",{value:s.id},s.name)))),this.errors&&this.errors["receiver.country"]?i("span",{class:"s-gifting-error"},this.errors["receiver.country"]):""),this.physicalProducts&&this.isKSA&&i("div",{class:this.step2ItemClass(this.errors?.["receiver.region"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{class:"s-form-label"},this.receiverRegionFieldLabel),i("select",{name:"region",class:"s-form-control",onChange:s=>this.handleRegionChange(s),disabled:this.loadingRegions},i("option",{value:"",selected:!0},this.loadingRegions?salla.lang.get("common.elements.loading"):this.selectRegion),this.regions?.map((s=>i("option",{value:s.id},s.name)))),this.errors&&this.errors["receiver.region"]?i("span",{class:"s-gifting-error"},this.errors["receiver.region"]):""),this.physicalProducts&&i("div",{class:this.step2ItemClass(this.errors?.["receiver.city_id"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{class:"s-form-label"},this.receiverCityFieldLabel),i("select",{name:"city","aria-label":salla.lang.get("blocks.buy_as_gift.select_city"),class:"s-form-control",onChange:s=>this.handleReceiverCity(s),disabled:this.loadingCities||this.isKSA&&!this.selectedRegionId},i("option",{value:"",selected:!0},this.loadingCities?salla.lang.get("common.elements.loading"):this.selectCity),this.gift?.cities?.map((s=>i("option",{value:s.id},s.name)))),this.errors&&this.errors["receiver.city_id"]?i("span",{class:"s-gifting-error"},this.errors["receiver.city_id"]):""),this.physicalProducts&&i("div",{class:this.step2ItemClass("s-gifting-info")},i("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>alert</title>\n<path d="M16 13.333c-0.736 0-1.333 0.597-1.333 1.333v8c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-8c0-0.736-0.597-1.333-1.333-1.333zM16 9.327c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM27.313 4.687c-6.237-6.237-16.389-6.239-22.628 0-6.237 6.239-6.237 16.389 0 22.628 3.119 3.119 7.216 4.679 11.313 4.679s8.195-1.559 11.313-4.679c6.24-6.239 6.24-16.391 0.001-22.628zM25.428 25.428c-5.199 5.197-13.657 5.197-18.857 0-5.197-5.199-5.197-13.659 0-18.857 5.199-5.197 13.659-5.197 18.857 0 5.199 5.2 5.199 13.659 0 18.857z"></path>\n</svg>\n'}),i("span",null,this.selectCityInfo)),!this.physicalProducts&&i("div",{class:this.step2ItemClass()},i("label",{class:"s-gifting-schedule s-gifting-clickable",htmlFor:"schedule-"+this.hostId},i("input",{type:"checkbox",name:"schedule",id:"schedule-"+this.hostId,onChange:()=>this.toggleCalendar(),class:"s-checkbox"}),i("span",{class:"s-form-label"}," ",this.sendLater," "))),i("div",{class:this.getCalendarClasses(),ref:s=>this.calendarFormGroup=s},i("label",{class:"s-form-label"},this.selectSendDateAndTime),i("salla-datetime-picker",{value:this.deliveryDate,placeholder:this.selectSendDateAndTime,"enable-time":!0,"date-format":"Y-m-d h:i K",onPicked:s=>this.handleDateTimePicker(s)}),i("span",{class:"s-gifting-calendar-hint"},this.canNotEditOrderAfterSelectDate)),i("div",{class:this.step2ItemClass("s-gifting-step-two-footer")},i("a",{href:"#!",innerHTML:l,onClick:s=>this.goToStep1(s)}),i("salla-button",{onClick:()=>this.submitForm(),color:"primary",width:"wide"},i("span",null,this.sendGift)))))],i("slot",{key:"46da7ff69a3c10b75886a23936f2f9ad8ad0e7bf",name:"footer"})))]}static get style(){return".s-gifting-steps-wrapper{transition:0.2s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url(\"data:image/svg+xml;utf8,<svg version='1.1' fill='gray' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>\");background-size:24px;background-repeat:no-repeat;background-position:99%;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}.s-gifting-widget-vertical .s-list-tile-item [slot=title]{display:flex;align-items:center;gap:1.5rem}.s-gifting-widget-vertical .s-list-tile-item-content{width:100%}"}},[260,"salla-gifting",{productId:[2,"product-id"],widgetTitle:[1,"widget-title"],widgetSubtitle:[1,"widget-subtitle"],physicalProducts:[4,"physical-products"],vertical:[4],formSelector:[1025,"form-selector"],sectionTitle:[32],sectionSubtitle:[32],sectionBtnText:[32],giftDetails:[32],selectImageForYourGift:[32],selectImageOrUpload:[32],selectGiftMessage:[32],giftCustomText:[32],textId:[32],incorrectGiftText:[32],nextStep:[32],senderNameLabel:[32],receiverNameFieldLabel:[32],receiverMobileFieldLabel:[32],receiverCountryFieldLabel:[32],ksa:[32],selectCountry:[32],selectCity:[32],selectCityInfo:[32],receiverCityFieldLabel:[32],receiverRegionFieldLabel:[32],selectRegion:[32],receiverEmailFieldLabel:[32],emailPlaceholder:[32],sendLater:[32],selectSendDateAndTime:[32],canNotEditOrderAfterSelectDate:[32],sendGift:[32],donationRequired:[32],currentStep:[32],showCalendar:[32],showGiftText:[32],currentLang:[32],parentClass:[32],errors:[32],gift:[32],selectedGiftTextOption:[32],selectedCountryId:[32],selectedCountryCode:[32],loadingCities:[32],loadingRegions:[32],regions:[32],selectedRegionId:[32],isKSA:[32],parsedFormData:[32],showTextArea:[32],selectedImage:[32],uploadedImage:[32],selectedText:[32],senderName:[32],errorMessage:[32],hasError:[32],quantity:[32],deliveryDate:[32],timeZone:[32],receiverName:[32],receiverMobile:[32],receiverCountryCode:[32],receiverEmail:[32],hostId:[32],receiverCity:[32],open:[64],close:[64],goToStep2:[64]}]);function y(){"undefined"!=typeof customElements&&["salla-gifting","salla-button","salla-datetime-picker","salla-file-upload","salla-list-tile","salla-loading","salla-modal","salla-placeholder","salla-skeleton","salla-slider","salla-tel-input"].forEach((t=>{switch(t){case"salla-gifting":customElements.get(s(t))||customElements.define(s(t),v);break;case"salla-button":customElements.get(s(t))||r();break;case"salla-datetime-picker":customElements.get(s(t))||c();break;case"salla-file-upload":customElements.get(s(t))||n();break;case"salla-list-tile":customElements.get(s(t))||h();break;case"salla-loading":customElements.get(s(t))||d();break;case"salla-modal":customElements.get(s(t))||g();break;case"salla-placeholder":customElements.get(s(t))||f();break;case"salla-skeleton":customElements.get(s(t))||m();break;case"salla-slider":customElements.get(s(t))||u();break;case"salla-tel-input":customElements.get(s(t))||p()}}))}y();const _=v,k=y;export{_ as SallaGifting,k as defineCustomElement}
|
|
4
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
5
|
+
import { a as anime } from './anime.es.js';
|
|
6
|
+
import { I as IconArrowLeft } from './arrow-left.js';
|
|
7
|
+
import { C as Cancel } from './cancel.js';
|
|
8
|
+
import { d as defineCustomElement$b } from './salla-button2.js';
|
|
9
|
+
import { d as defineCustomElement$a } from './salla-datetime-picker2.js';
|
|
10
|
+
import { d as defineCustomElement$9 } from './salla-file-upload2.js';
|
|
11
|
+
import { d as defineCustomElement$8 } from './salla-list-tile2.js';
|
|
12
|
+
import { d as defineCustomElement$7 } from './salla-loading2.js';
|
|
13
|
+
import { d as defineCustomElement$6 } from './salla-modal2.js';
|
|
14
|
+
import { d as defineCustomElement$5 } from './salla-placeholder2.js';
|
|
15
|
+
import { d as defineCustomElement$4 } from './salla-skeleton2.js';
|
|
16
|
+
import { d as defineCustomElement$3 } from './salla-slider2.js';
|
|
17
|
+
import { d as defineCustomElement$2 } from './salla-tel-input2.js';
|
|
18
|
+
|
|
19
|
+
var Images = `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
20
|
+
<title>images</title>
|
|
21
|
+
<path d="M22.667 29.333h-13.333c-3.676 0-6.667-2.991-6.667-6.667v-13.333c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v13.333c0 5.145 4.187 9.333 9.333 9.333h13.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM22.667 5.333c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 10.667c-0.735 0-1.333-0.597-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.599 1.333-1.333 1.333zM25.333 0h-13.333c-3.676 0-6.667 2.991-6.667 6.667v13.333c0 1.055 0.268 2.040 0.707 2.927 0.039 0.099 0.088 0.188 0.151 0.277 1.137 2.053 3.301 3.463 5.809 3.463h13.333c3.676 0 6.667-2.991 6.667-6.667v-13.333c0-3.676-2.991-6.667-6.667-6.667zM12 24c-1.244 0-2.344-0.583-3.077-1.476l5.721-7.047 6.629 8.523zM29.333 20c0 2.205-1.795 4-4 4h-0.68l-8.933-11.485c-0.251-0.32-0.633-0.511-1.039-0.515h-0.015c-0.401 0-0.781 0.181-1.035 0.492l-5.632 6.935v-12.76c0-2.205 1.795-4 4-4h13.333c2.205 0 4 1.795 4 4z"></path>
|
|
22
|
+
</svg>
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
var GiftSharing = `<!-- Generated by IcoMoon.io -->
|
|
26
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
27
|
+
<title>gift-sharing</title>
|
|
28
|
+
<path d="M5 32h-4c-0.552 0-1-0.448-1-1v0-14c0-0.552 0.448-1 1-1v0h4c0.552 0 1 0.448 1 1v0 14c0 0.552-0.448 1-1 1v0zM2 30h2v-12h-2zM19.32 30h-14.32v-2h14.32c0.693-0.005 1.329-0.242 1.837-0.637l-0.007 0.005 8.45-6.568c0.216-0.16 0.365-0.402 0.399-0.679l0-0.005c0.005-0.036 0.007-0.077 0.007-0.119 0-0.226-0.078-0.434-0.209-0.599l0.002 0.002c-0.16-0.216-0.401-0.364-0.677-0.399l-0.005-0.001c-0.034-0.004-0.073-0.007-0.113-0.007-0.227 0-0.436 0.078-0.601 0.208l0.002-0.002-7.126 5.526c-1.003 0.793-2.285 1.273-3.68 1.274h-6.6v-2h6.6c0.926-0.001 1.777-0.32 2.45-0.852l-0.008 0.006 7.126-5.526c0.492-0.39 1.122-0.625 1.807-0.625 0.135 0 0.268 0.009 0.398 0.027l-0.015-0.002c0.824 0.102 1.534 0.524 2.011 1.137l0.005 0.007c0.39 0.494 0.625 1.127 0.625 1.814 0 0.136-0.009 0.27-0.027 0.402l0.002-0.015c-0.106 0.819-0.529 1.523-1.141 1.995l-0.007 0.005-8.458 6.578c-0.834 0.649-1.894 1.043-3.047 1.050h-0.002zM11 26c-0.552 0-1-0.448-1-1s0.448-1 1-1v0c2.406-0.004 4.415-1.703 4.894-3.967l0.006-0.033h-10.9c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h12c0.552 0 1 0.448 1 1v0c0 3.866-3.134 7-7 7v0zM24 12h-16c-1.105 0-2-0.895-2-2v0-2c0-1.105 0.895-2 2-2v0h16c1.105 0 2 0.895 2 2v0 2c0 1.105-0.895 2-2 2v0zM24 10v0zM8 8v2h16v-2zM23 18c-0.552 0-1-0.448-1-1v0-6c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM9 16c-0.552 0-1-0.448-1-1v0-4c0-0.552 0.448-1 1-1s1 0.448 1 1v0 4c0 0.552-0.448 1-1 1v0zM16 16c-0.552 0-1-0.448-1-1v0-8c0-0.552 0.448-1 1-1s1 0.448 1 1v0 8c0 0.552-0.448 1-1 1v0zM16 8c-0.552-0-1-0.448-1-1 0-0.077 0.009-0.151 0.025-0.223l-0.001 0.007c0.314-1.849 0.963-3.5 1.887-4.961l-0.033 0.055c0.539-0.521 1.274-0.842 2.084-0.842 1.657 0 3 1.343 3 3 0 0.81-0.321 1.545-0.843 2.085l0.001-0.001c-1.405 0.891-3.056 1.541-4.824 1.845l-0.080 0.011c-0.065 0.015-0.139 0.024-0.216 0.024h-0zM19 3c-0.001 0-0.001 0-0.002 0-0.276 0-0.525 0.112-0.706 0.292l0-0c-0.391 0.669-0.703 1.444-0.897 2.264l-0.011 0.058c0.878-0.205 1.653-0.517 2.363-0.93l-0.041 0.022c0.18-0.181 0.292-0.43 0.292-0.706 0-0.551-0.446-0.999-0.998-1h-0zM16 8c-0.077-0-0.151-0.009-0.223-0.025l0.007 0.001c-1.848-0.315-3.499-0.965-4.959-1.888l0.055 0.032c-0.521-0.539-0.842-1.274-0.842-2.084 0-1.657 1.343-3 3-3 0.81 0 1.545 0.321 2.085 0.843l-0.001-0.001c0.891 1.405 1.541 3.056 1.845 4.824l0.011 0.080c0.015 0.066 0.024 0.141 0.024 0.218 0 0.552-0.448 1-1 1-0.001 0-0.001 0-0.002 0h0zM13 3c-0.001 0-0.001 0-0.002 0-0.552 0-1 0.448-1 1 0 0.277 0.112 0.527 0.294 0.708l0 0c0.669 0.391 1.444 0.703 2.264 0.897l0.058 0.011c-0.205-0.878-0.517-1.653-0.93-2.363l0.022 0.041c-0.181-0.181-0.43-0.293-0.706-0.294h-0z"></path>
|
|
29
|
+
</svg>
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
var Alert = `<!-- Generated by IcoMoon.io -->
|
|
33
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
34
|
+
<title>alert</title>
|
|
35
|
+
<path d="M16 13.333c-0.736 0-1.333 0.597-1.333 1.333v8c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-8c0-0.736-0.597-1.333-1.333-1.333zM16 9.327c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM27.313 4.687c-6.237-6.237-16.389-6.239-22.628 0-6.237 6.239-6.237 16.389 0 22.628 3.119 3.119 7.216 4.679 11.313 4.679s8.195-1.559 11.313-4.679c6.24-6.239 6.24-16.391 0.001-22.628zM25.428 25.428c-5.199 5.197-13.657 5.197-18.857 0-5.197-5.199-5.197-13.659 0-18.857 5.199-5.197 13.659-5.197 18.857 0 5.199 5.2 5.199 13.659 0 18.857z"></path>
|
|
36
|
+
</svg>
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
const sallaGiftingCss = ".s-gifting-steps-wrapper{transition:0.2s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url(\"data:image/svg+xml;utf8,<svg version='1.1' fill='gray' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>\");background-size:24px;background-repeat:no-repeat;background-position:99%;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}.s-gifting-widget-vertical .s-list-tile-item [slot=title]{display:flex;align-items:center;gap:1.5rem}.s-gifting-widget-vertical .s-list-tile-item-content{width:100%}";
|
|
40
|
+
|
|
41
|
+
const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting extends HTMLElement {
|
|
42
|
+
constructor() {
|
|
43
|
+
super();
|
|
44
|
+
this.__registerHost();
|
|
45
|
+
this.defaultEvent = "gifting:open";
|
|
46
|
+
this.selectImageForYourGift = salla.lang.get('blocks.buy_as_gift.select_image_or_upload');
|
|
47
|
+
this.currentStep = 1;
|
|
48
|
+
this.showCalendar = false;
|
|
49
|
+
this.showGiftText = false;
|
|
50
|
+
this.currentLang = '';
|
|
51
|
+
this.parentClass = "is-current-step-1";
|
|
52
|
+
this.errors = {};
|
|
53
|
+
this.gift = undefined;
|
|
54
|
+
this.selectedGiftTextOption = undefined;
|
|
55
|
+
this.selectedCountryId = undefined;
|
|
56
|
+
this.selectedCountryCode = undefined;
|
|
57
|
+
this.loadingCities = false;
|
|
58
|
+
this.loadingRegions = false;
|
|
59
|
+
this.regions = [];
|
|
60
|
+
this.selectedRegionId = undefined;
|
|
61
|
+
this.isKSA = false;
|
|
62
|
+
this.step2Animated = false;
|
|
63
|
+
this.showTextArea = false;
|
|
64
|
+
/// Gift Form Data
|
|
65
|
+
this.selectedImage = undefined;
|
|
66
|
+
this.uploadedImage = undefined;
|
|
67
|
+
this.selectedText = undefined;
|
|
68
|
+
this.hasError = false;
|
|
69
|
+
this.timeZone = null;
|
|
70
|
+
this.receiverCountryCode = salla.config.get('store.scope.countries')?.[0] || salla.config.get('store.store_country') || 'SA';
|
|
71
|
+
this.hostId = `salla-gifting-${Math.random().toString(36).slice(2, 10)}`;
|
|
72
|
+
/**
|
|
73
|
+
* The form selector to be used to get the form data
|
|
74
|
+
*/
|
|
75
|
+
this.formSelector = 'form.product-form, form.form--product-options';
|
|
76
|
+
salla.lang.onLoaded(() => {
|
|
77
|
+
this.selectImageOrUpload = salla.lang.get('blocks.buy_as_gift.select_image_or_upload');
|
|
78
|
+
this.selectImageForYourGift = salla.lang.get('blocks.buy_as_gift.select_image_for_your_gift');
|
|
79
|
+
this.sectionTitle = salla.lang.get('blocks.buy_as_gift.gift_the_one_you_love');
|
|
80
|
+
this.sectionSubtitle = salla.lang.get('blocks.buy_as_gift.gift_the_one_you_love_message');
|
|
81
|
+
this.sectionBtnText = salla.lang.get('blocks.buy_as_gift.send_as_a_gift');
|
|
82
|
+
this.giftDetails = salla.lang.get('blocks.buy_as_gift.gift_details');
|
|
83
|
+
this.selectGiftMessage = salla.lang.get('blocks.buy_as_gift.select_gift_message');
|
|
84
|
+
this.giftCustomText = salla.lang.get('blocks.buy_as_gift.gift_custom_text');
|
|
85
|
+
this.textId = salla.lang.get('blocks.buy_as_gift.text_id');
|
|
86
|
+
this.incorrectGiftText = salla.lang.get('blocks.buy_as_gift.incorrect_gift_text');
|
|
87
|
+
this.nextStep = salla.lang.get('blocks.buy_as_gift.next_step');
|
|
88
|
+
this.senderNameLabel = salla.lang.get('blocks.buy_as_gift.sender_name');
|
|
89
|
+
this.receiverNameFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_name');
|
|
90
|
+
this.receiverMobileFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_mobile');
|
|
91
|
+
this.receiverCountryFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_country');
|
|
92
|
+
this.ksa = salla.lang.get('pages.checkout.ksa');
|
|
93
|
+
this.selectCity = salla.lang.get('pages.checkout.select_city');
|
|
94
|
+
this.selectCountry = salla.lang.get('pages.checkout.select_country');
|
|
95
|
+
this.selectCityInfo = salla.lang.get('blocks.buy_as_gift.city_info');
|
|
96
|
+
this.receiverCityFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_city');
|
|
97
|
+
this.receiverRegionFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_region') || salla.lang.get('pages.checkout.region');
|
|
98
|
+
this.selectRegion = salla.lang.get('pages.checkout.select_region');
|
|
99
|
+
this.receiverEmailFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_email');
|
|
100
|
+
this.emailPlaceholder = salla.lang.get('common.elements.email_placeholder');
|
|
101
|
+
this.sendLater = salla.lang.get('blocks.buy_as_gift.send_later');
|
|
102
|
+
this.selectSendDateAndTime = salla.lang.get('blocks.buy_as_gift.select_send_date_and_time');
|
|
103
|
+
this.canNotEditOrderAfterSelectDate = salla.lang.get('blocks.buy_as_gift.can_not_edit_order_after_select_date');
|
|
104
|
+
this.sendGift = salla.lang.get('blocks.buy_as_gift.send_gift');
|
|
105
|
+
this.donationRequired = salla.lang.get('pages.products.donation_amount_required');
|
|
106
|
+
this.currentLang = salla.lang.locale;
|
|
107
|
+
});
|
|
108
|
+
salla.event.on(this.defaultEvent, () => {
|
|
109
|
+
this.open();
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
componentDidLoad() {
|
|
113
|
+
salla.event.product.onPriceUpdated(() => {
|
|
114
|
+
const quantityInput = document.querySelector(`.s-quantity-input-input`);
|
|
115
|
+
// @ts-ignore
|
|
116
|
+
this.quantity = quantityInput?.value;
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
getFormDataFromForm() {
|
|
120
|
+
if (!this.formSelector)
|
|
121
|
+
return null;
|
|
122
|
+
const form = document.querySelector(this.formSelector);
|
|
123
|
+
if (!form)
|
|
124
|
+
return null;
|
|
125
|
+
return new FormData(form);
|
|
126
|
+
}
|
|
127
|
+
mergeObjectToFormData(obj, formData, namespace) {
|
|
128
|
+
for (let property in obj) {
|
|
129
|
+
if (!obj.hasOwnProperty(property) || obj[property] === undefined || obj[property] === null)
|
|
130
|
+
continue;
|
|
131
|
+
const formKey = namespace ? `${namespace}[${property}]` : property;
|
|
132
|
+
if (typeof obj[property] === 'object' && obj[property] !== null && !(obj[property] instanceof File)) {
|
|
133
|
+
this.mergeObjectToFormData(obj[property], formData, formKey);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
formData.set(formKey, obj[property]);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return formData;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Show / Open the gifting modal window
|
|
143
|
+
*/
|
|
144
|
+
async open() {
|
|
145
|
+
if (salla.config.isGuest()) {
|
|
146
|
+
salla.api.auth.setAfterLoginEvent(this.defaultEvent);
|
|
147
|
+
salla.event.dispatch('login::open', { withoutReload: true });
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
await this.modal.open();
|
|
151
|
+
// Determine the appropriate method to call based on the `physicalProducts` flag
|
|
152
|
+
const giftDetailsMethod = this.productId ? () => salla.product.getGiftProductDetails(this.productId) : () => salla.cart.getGiftCartDetails();
|
|
153
|
+
return await salla.api.withoutNotifier(giftDetailsMethod)
|
|
154
|
+
.then((response) => {
|
|
155
|
+
this.gift = response.data;
|
|
156
|
+
this.senderName = this.gift.sender_name;
|
|
157
|
+
})
|
|
158
|
+
.catch(e => {
|
|
159
|
+
this.hasError = true;
|
|
160
|
+
this.errorMessage = e.response?.data?.error?.message || e.response?.data;
|
|
161
|
+
})
|
|
162
|
+
.finally(() => this.modal.stopLoading());
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
*
|
|
166
|
+
* Hide / close the gifting modal window
|
|
167
|
+
*/
|
|
168
|
+
async close() {
|
|
169
|
+
return this.modal.close();
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Update the modal height based on the changes on the inner elements height for a specific step OR just a pass a new fixed height
|
|
173
|
+
*/
|
|
174
|
+
async setWrapperHeight(asStep = 1, delay = 250, additionSpace = 0, newHeight = 0) {
|
|
175
|
+
let currentStep = document.querySelector(`#${this.hostId} .gift-step-${asStep}`);
|
|
176
|
+
const updateHeight = () => {
|
|
177
|
+
let currentStepHeight = currentStep.offsetHeight;
|
|
178
|
+
if (newHeight) {
|
|
179
|
+
this.stepsWrapper.style.height = `${newHeight}px`;
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
this.stepsWrapper.style.height = currentStepHeight + additionSpace + 'px';
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
if (this.step2Animated && asStep === 2) {
|
|
186
|
+
requestAnimationFrame(updateHeight);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
setTimeout(updateHeight, delay);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
toggleCalendar() {
|
|
193
|
+
this.showCalendar = !this.showCalendar;
|
|
194
|
+
this.setWrapperHeight(2, 150, 0);
|
|
195
|
+
}
|
|
196
|
+
toggleGiftText(event) {
|
|
197
|
+
this.textSelect?.classList.remove('s-form-has-error');
|
|
198
|
+
let dataID = event.target.children[event.target.selectedIndex].getAttribute('data-id');
|
|
199
|
+
let customID = dataID == "custom";
|
|
200
|
+
this.showGiftText = customID;
|
|
201
|
+
if (dataID) {
|
|
202
|
+
this.selectedGiftTextOption = dataID;
|
|
203
|
+
customID ? this.selectedText = undefined : this.selectedText = event.target.value;
|
|
204
|
+
this.setWrapperHeight(1, 150, 5);
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
// empty textarea value
|
|
208
|
+
this.textArea.value = '';
|
|
209
|
+
this.selectedText = undefined;
|
|
210
|
+
this.selectedGiftTextOption = undefined;
|
|
211
|
+
this.setWrapperHeight(1, 150, -15);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
*
|
|
216
|
+
* Go to the step 2
|
|
217
|
+
*/
|
|
218
|
+
async goToStep2() {
|
|
219
|
+
if (!this.selectedGiftTextOption) {
|
|
220
|
+
this.textSelect.classList.add('s-form-has-error');
|
|
221
|
+
this.customTextArea.classList.remove('s-form-has-error');
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
else if (this.selectedGiftTextOption == 'custom' && !this.selectedText) {
|
|
225
|
+
this.textSelect.classList.remove('s-form-has-error');
|
|
226
|
+
this.customTextArea.classList.add('s-form-has-error');
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
this.textSelect.classList.remove('s-form-has-error');
|
|
231
|
+
this.customTextArea.classList.remove('s-form-has-error');
|
|
232
|
+
}
|
|
233
|
+
this.setWrapperHeight(2, 600, 0);
|
|
234
|
+
let stepNextAnime = new anime.timeline();
|
|
235
|
+
stepNextAnime.add({
|
|
236
|
+
targets: this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),
|
|
237
|
+
opacity: [1, 0],
|
|
238
|
+
translateX: [0, 50],
|
|
239
|
+
delay: anime.stagger(70),
|
|
240
|
+
// easing: 'easeOutExpo',
|
|
241
|
+
duration: 1200,
|
|
242
|
+
})
|
|
243
|
+
.add({
|
|
244
|
+
targets: '.gift-step-2',
|
|
245
|
+
translateX: ['-110%', 0],
|
|
246
|
+
opacity: [0, 1],
|
|
247
|
+
}, '-=1800')
|
|
248
|
+
.add({
|
|
249
|
+
targets: this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),
|
|
250
|
+
opacity: [0, 1],
|
|
251
|
+
translateX: [-50, 0],
|
|
252
|
+
delay: anime.stagger(70),
|
|
253
|
+
duration: 1200,
|
|
254
|
+
complete: () => {
|
|
255
|
+
this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach(item => {
|
|
256
|
+
item.classList.remove('opacity-0');
|
|
257
|
+
item.removeAttribute('style');
|
|
258
|
+
});
|
|
259
|
+
this.step2Animated = true;
|
|
260
|
+
}
|
|
261
|
+
}, '-=1200');
|
|
262
|
+
this.currentStep = 2;
|
|
263
|
+
this.parentClass = `is-current-step-${this.currentStep}`;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
*
|
|
267
|
+
* Go to the step 1
|
|
268
|
+
*/
|
|
269
|
+
goToStep1(e) {
|
|
270
|
+
e.preventDefault();
|
|
271
|
+
let stepBackAnime = new anime.timeline({
|
|
272
|
+
autoplay: false,
|
|
273
|
+
});
|
|
274
|
+
stepBackAnime.add({
|
|
275
|
+
targets: this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),
|
|
276
|
+
opacity: [1, 0],
|
|
277
|
+
translateX: [0, -50],
|
|
278
|
+
delay: anime.stagger(70),
|
|
279
|
+
// easing: 'easeOutExpo',
|
|
280
|
+
duration: 1200,
|
|
281
|
+
})
|
|
282
|
+
.add({
|
|
283
|
+
targets: '.gift-step-1',
|
|
284
|
+
translateX: ['110%', 0],
|
|
285
|
+
opacity: [0, 1],
|
|
286
|
+
}, '-=1800')
|
|
287
|
+
.add({
|
|
288
|
+
targets: this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),
|
|
289
|
+
opacity: [0, 1],
|
|
290
|
+
translateX: [50, 0],
|
|
291
|
+
delay: anime.stagger(70),
|
|
292
|
+
duration: 1200,
|
|
293
|
+
complete: () => {
|
|
294
|
+
this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach(item => {
|
|
295
|
+
item.classList.remove('opacity-0');
|
|
296
|
+
item.removeAttribute('style');
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}, '-=1200');
|
|
300
|
+
stepBackAnime.play();
|
|
301
|
+
this.step2Animated = false;
|
|
302
|
+
this.setWrapperHeight(1, 600, 0);
|
|
303
|
+
this.currentStep = 1;
|
|
304
|
+
this.parentClass = `is-current-step-${this.currentStep}`;
|
|
305
|
+
}
|
|
306
|
+
getFilepondPlaceholder() {
|
|
307
|
+
return `<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon">${Images}</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload ? this.selectImageOrUpload : ''}</p></div>`;
|
|
308
|
+
}
|
|
309
|
+
setPreview(image) {
|
|
310
|
+
this.uploader?.classList.add('has-bg');
|
|
311
|
+
var bg = document.querySelector(`#${this.hostId}.filepond-bg`) ? document.querySelector(`#${this.hostId} .filepond-bg`) : document.createElement('div');
|
|
312
|
+
bg.classList.add('filepond-bg');
|
|
313
|
+
bg.classList.remove('s-hidden');
|
|
314
|
+
bg.style.backgroundImage = "url('" + image.url + "')";
|
|
315
|
+
this.uploader?.querySelector('.filepond--root')?.appendChild(bg);
|
|
316
|
+
this.uploadedImage = image.url;
|
|
317
|
+
if (!!this.gift && this.gift.gift_images.length) {
|
|
318
|
+
this.setWrapperHeight(1, 150, 0);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
removePreview() {
|
|
322
|
+
this.uploader.classList.remove('has-bg');
|
|
323
|
+
let bg = document.querySelector(`#${this.hostId} .filepond-bg`);
|
|
324
|
+
bg.removeAttribute('style');
|
|
325
|
+
bg.classList.add('s-hidden');
|
|
326
|
+
this.handleRemoveImage();
|
|
327
|
+
}
|
|
328
|
+
handleTextAreaChange(event) {
|
|
329
|
+
this.selectedText = event.target.value;
|
|
330
|
+
this.customTextArea.classList.remove('s-form-has-error');
|
|
331
|
+
}
|
|
332
|
+
clearError(key) {
|
|
333
|
+
if (this.errors?.[key]) {
|
|
334
|
+
const { [key]: _, ...rest } = this.errors;
|
|
335
|
+
this.errors = rest;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
handleSenderName(event) {
|
|
339
|
+
this.senderName = event.target.value;
|
|
340
|
+
this.clearError('sender_name');
|
|
341
|
+
}
|
|
342
|
+
handleReceiverName(event) {
|
|
343
|
+
this.receiverName = event.target.value;
|
|
344
|
+
this.clearError('receiver.name');
|
|
345
|
+
}
|
|
346
|
+
handleReceiverCity(event) {
|
|
347
|
+
this.receiverCity = event.target.value;
|
|
348
|
+
this.clearError('receiver.city_id');
|
|
349
|
+
}
|
|
350
|
+
async handleCountryChange(event) {
|
|
351
|
+
const countryId = Number(event.target.value);
|
|
352
|
+
this.selectedCountryId = countryId;
|
|
353
|
+
this.clearError('receiver.country');
|
|
354
|
+
// Find the selected country and store its country_code
|
|
355
|
+
const selectedCountry = this.gift?.countries?.find(country => country.id == countryId);
|
|
356
|
+
this.selectedCountryCode = selectedCountry?.country_code;
|
|
357
|
+
this.isKSA = selectedCountry?.country_code === 'SA';
|
|
358
|
+
// Reset region and city
|
|
359
|
+
this.regions = [];
|
|
360
|
+
this.selectedRegionId = undefined;
|
|
361
|
+
this.gift = { ...this.gift, cities: [] };
|
|
362
|
+
this.receiverCity = undefined;
|
|
363
|
+
if (!countryId || this.gift?.countries?.length === 0) {
|
|
364
|
+
this.selectedCountryCode = undefined;
|
|
365
|
+
this.isKSA = false;
|
|
366
|
+
this.setWrapperHeight(2, 0, 0);
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
if (this.isKSA) {
|
|
370
|
+
// For KSA, fetch regions first
|
|
371
|
+
this.loadingRegions = true;
|
|
372
|
+
this.setWrapperHeight(2, 0, 0);
|
|
373
|
+
try {
|
|
374
|
+
const response = await salla.api.request(`shipping/countries/${countryId}/regions`);
|
|
375
|
+
if (response && response.data) {
|
|
376
|
+
this.regions = response.data;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
catch (error) {
|
|
380
|
+
console.error('Error fetching regions:', error);
|
|
381
|
+
}
|
|
382
|
+
finally {
|
|
383
|
+
this.loadingRegions = false;
|
|
384
|
+
this.setWrapperHeight(2, 0, 0);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
else {
|
|
388
|
+
// For non-KSA, fetch cities directly
|
|
389
|
+
this.loadingCities = true;
|
|
390
|
+
this.setWrapperHeight(2, 0, 0);
|
|
391
|
+
try {
|
|
392
|
+
const response = await salla.api.request(`shipping/cities?for_branch=0&country_id=${countryId}`);
|
|
393
|
+
if (response && response.data) {
|
|
394
|
+
this.gift = { ...this.gift, cities: response.data };
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
catch (error) {
|
|
398
|
+
console.error('Error fetching cities:', error);
|
|
399
|
+
}
|
|
400
|
+
finally {
|
|
401
|
+
this.loadingCities = false;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
async handleRegionChange(event) {
|
|
406
|
+
const regionId = Number(event.target.value);
|
|
407
|
+
this.selectedRegionId = regionId;
|
|
408
|
+
this.clearError('receiver.region');
|
|
409
|
+
// Reset city when region changes
|
|
410
|
+
this.gift = { ...this.gift, cities: [] };
|
|
411
|
+
this.receiverCity = undefined;
|
|
412
|
+
if (!regionId)
|
|
413
|
+
return;
|
|
414
|
+
this.loadingCities = true;
|
|
415
|
+
try {
|
|
416
|
+
const response = await salla.api.request(`shipping/cities?for_branch=0&country_id=${this.selectedCountryId}®ion_id=${regionId}`);
|
|
417
|
+
if (response && response.data) {
|
|
418
|
+
this.gift = { ...this.gift, cities: response.data };
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
catch (error) {
|
|
422
|
+
console.error('Error fetching cities:', error);
|
|
423
|
+
}
|
|
424
|
+
finally {
|
|
425
|
+
this.loadingCities = false;
|
|
426
|
+
this.setWrapperHeight(2, 0, 0);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
handleUploadImage(img) {
|
|
430
|
+
this.uploadedImage = img;
|
|
431
|
+
if (!!this.gift && this.gift.gift_images.length) {
|
|
432
|
+
this.setWrapperHeight(1, 150, 0);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
handleRemoveImage() {
|
|
436
|
+
this.uploadedImage = '';
|
|
437
|
+
if (!!this.gift && this.gift.gift_images.length) {
|
|
438
|
+
this.setWrapperHeight(1, 150, 0);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
// private handleReceiverEmail(event) {
|
|
442
|
+
// this.receiverEmail = event.target.value;
|
|
443
|
+
// }
|
|
444
|
+
handlePhoneInputChange(event) {
|
|
445
|
+
let phone = event.detail;
|
|
446
|
+
this.receiverMobile = phone.number;
|
|
447
|
+
this.receiverCountryCode = phone.country_code;
|
|
448
|
+
this.clearError('receiver.mobile');
|
|
449
|
+
}
|
|
450
|
+
handleDateTimePicker(event) {
|
|
451
|
+
this.deliveryDate = event.detail;
|
|
452
|
+
}
|
|
453
|
+
getCalendarClasses() {
|
|
454
|
+
return {
|
|
455
|
+
"s-form-group": true,
|
|
456
|
+
"anime-item": true,
|
|
457
|
+
"s-gifting-calendar": true,
|
|
458
|
+
"shown": this.showCalendar,
|
|
459
|
+
"hide": !this.showCalendar,
|
|
460
|
+
"s-form-has-error": !!this.errors && this.errors['deliver_at']
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
async submitForm() {
|
|
464
|
+
// @ts-ignore
|
|
465
|
+
const donatingAmount = (document.querySelector(`#donating-amount`))?.value;
|
|
466
|
+
this.calendarFormGroup.classList.remove('s-form-has-error');
|
|
467
|
+
if (!!this.errors) {
|
|
468
|
+
this.errors = {};
|
|
469
|
+
this.setWrapperHeight(2, 150, 0);
|
|
470
|
+
}
|
|
471
|
+
if (this.showCalendar && !this.deliveryDate) {
|
|
472
|
+
this.calendarFormGroup.classList.add('s-form-has-error');
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
// Validate required fields
|
|
476
|
+
const requiredFields = [
|
|
477
|
+
{ key: 'sender_name', value: this.senderName, label: this.senderNameLabel },
|
|
478
|
+
{ key: 'receiver.name', value: this.receiverName, label: this.receiverNameFieldLabel },
|
|
479
|
+
{ key: 'receiver.mobile', value: this.receiverMobile, label: this.receiverMobileFieldLabel },
|
|
480
|
+
...(this.physicalProducts ? [
|
|
481
|
+
{ key: 'receiver.country', value: this.selectedCountryId, label: this.receiverCountryFieldLabel },
|
|
482
|
+
...(this.isKSA ? [{ key: 'receiver.region', value: this.selectedRegionId, label: this.receiverRegionFieldLabel }] : []),
|
|
483
|
+
{ key: 'receiver.city_id', value: this.receiverCity, label: this.receiverCityFieldLabel },
|
|
484
|
+
] : []),
|
|
485
|
+
];
|
|
486
|
+
const validationErrors = {};
|
|
487
|
+
requiredFields.forEach(({ key, value, label }) => {
|
|
488
|
+
if (!value) {
|
|
489
|
+
validationErrors[key] = salla.lang.get('common.errors.field_required', { attribute: label });
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
if (Object.keys(validationErrors).length) {
|
|
493
|
+
this.errors = validationErrors;
|
|
494
|
+
this.setWrapperHeight(2, 150, 0);
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
const giftPayload = {
|
|
498
|
+
text: this.selectedText,
|
|
499
|
+
sender_name: this.senderName,
|
|
500
|
+
quantity: this.quantity,
|
|
501
|
+
deliver_at: this.showCalendar ? this.deliveryDate : null,
|
|
502
|
+
image_url: this.uploadedImage ?? this.selectedImage,
|
|
503
|
+
donation_amount: donatingAmount ? donatingAmount : null,
|
|
504
|
+
receiver: {
|
|
505
|
+
name: this.receiverName,
|
|
506
|
+
mobile_country_code: this.receiverCountryCode,
|
|
507
|
+
mobile: this.receiverMobile,
|
|
508
|
+
...(this.physicalProducts && this.selectedCountryCode ? { country_code: this.selectedCountryCode } : {}),
|
|
509
|
+
...(this.physicalProducts && this.selectedRegionId ? { region_id: this.selectedRegionId } : {}),
|
|
510
|
+
...(this.receiverCity && this.physicalProducts ? { city_id: this.receiverCity } : {})
|
|
511
|
+
},
|
|
512
|
+
has_apple_pay: salla.helpers.hasApplePay(),
|
|
513
|
+
};
|
|
514
|
+
let formData;
|
|
515
|
+
if (this.productId && this.formSelector) {
|
|
516
|
+
formData = this.getFormDataFromForm() || new FormData();
|
|
517
|
+
formData = this.mergeObjectToFormData(giftPayload, formData);
|
|
518
|
+
}
|
|
519
|
+
const addGiftMethod = this.productId
|
|
520
|
+
? () => salla.product.addProductGiftToCart(this.productId, formData, true)
|
|
521
|
+
: () => salla.cart.addCartGiftToCart(giftPayload, true);
|
|
522
|
+
return await addGiftMethod()
|
|
523
|
+
.then(() => this.modal.close())
|
|
524
|
+
.catch((e) => {
|
|
525
|
+
if (e.response && e.response.status == 422) {
|
|
526
|
+
this.errors = e.response.data.error.fields;
|
|
527
|
+
}
|
|
528
|
+
else {
|
|
529
|
+
console.log(e);
|
|
530
|
+
}
|
|
531
|
+
this.setWrapperHeight(2, 150, 0);
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
step2ItemClass(extra = '') {
|
|
535
|
+
const base = `anime-item${this.step2Animated ? '' : ' opacity-0'}`;
|
|
536
|
+
return extra ? `${extra} ${base}` : base;
|
|
537
|
+
}
|
|
538
|
+
generateClass() {
|
|
539
|
+
return {
|
|
540
|
+
"s-gifting-widget": true,
|
|
541
|
+
"s-gifting-widget-vertical": !!this.vertical,
|
|
542
|
+
"s-gifting-widget-horizontal": !this.vertical
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
async handleGiftButtonClick() {
|
|
546
|
+
if (!!this.productId && this.formSelector) {
|
|
547
|
+
const form = document.querySelector(this.formSelector);
|
|
548
|
+
if (!form) {
|
|
549
|
+
console.error('SallaGifting:: Form not found in the document!');
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
if (!(form instanceof HTMLFormElement)) {
|
|
553
|
+
console.error('SallaGifting:: The specified selector does not correspond to a form tag!');
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
if (!form.reportValidity()) {
|
|
557
|
+
console.error('SallaGifting:: Form is not valid!');
|
|
558
|
+
salla.error(salla.lang.get('common.messages.required_fields'));
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
const optionsElement = document.querySelector(`salla-product-options[product-id="${this.productId}"]`);
|
|
563
|
+
if (optionsElement && !(await optionsElement.reportValidity())) {
|
|
564
|
+
salla.error(salla.lang.get('common.messages.required_fields'));
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
this.open();
|
|
568
|
+
}
|
|
569
|
+
render() {
|
|
570
|
+
return [
|
|
571
|
+
h("div", { key: '5d0eec8210f77d166c144704ec78bffcaf1f4ce0' }, h("salla-list-tile", { key: '19cc20b4f70bbb8a7d267f60052db77589901962', class: this.generateClass() }, h("div", { key: '1c3c52b5ac48e71a6ac26c60494657ac28d16457', slot: "title" }, this.vertical ? h("span", { innerHTML: GiftSharing }) : '', h("h3", { key: 'e3379fb3ed39d1bc63500346058b26b883c3be13' }, !!this.widgetTitle ? this.widgetTitle : this.sectionTitle)), h("div", { key: 'f6c2a522727546aa27cef725faa8be082da063da', slot: "subtitle" }, h("div", { key: '7b58ad967f39fa2cc660369b72e73f8dc49f90dc' }, !!this.widgetSubtitle ? this.widgetSubtitle : this.sectionSubtitle)), h("div", { key: '848396dcd6ce6009ebc4cf1a209a055ad1adbf15', slot: "action" }, h("salla-button", { key: '2ba69b670f1c958784c6f1dca6b2dd0b93f20859', color: "primary", fill: "outline", width: "wide", class: "s-gifting-widget-action", onClick: () => this.handleGiftButtonClick() }, h("slot", { key: '6ac9ac339e321fc9433465cfd75f299307ee7152', name: "widget-btn-content" }, h("div", { key: 'c61dd36375886c1ecf87f115e5248dca1af7efc9', class: "s-gifting-widget-action-content" }, h("span", { key: '0c8a3630ba6b15889fc4bf3d55a1279cdf713400', innerHTML: GiftSharing }), " \u00A0", h("span", { key: 'c9299ec752e5393f30a78e1e01d367be9e97ca50' }, this.sectionBtnText)))))), h("salla-modal", { key: '9ee17e79f97eee59d25d9627d5b1cd4ada7cadb3', id: this.hostId, isLoading: true, class: "s-gifting-modal", width: "sm", ref: modal => this.modal = modal }, h("div", { key: 'aba3b6a4d3e903934c9b5e629119c3a3b5bc90ab', slot: "loading" }, h("div", { key: 'e03613cc85bf4024f63d2e256a2744ec78f7eabf', class: "s-gifting-skeleton" }, h("div", { key: '01156691d540ce5ef5723902610a1da27fba3ddb', class: "s-gifting-modal-header" }, h("salla-skeleton", { key: 'e45b4868e4fa5633aeb22f758f75f5412290b179', type: 'circle', height: '5rem', width: '5rem' }), h("h2", { key: '2b427d38dd6e0569e16de84ef46eb2052d23b739', class: "s-gifting-modal-title" }, h("div", { key: 'c4f9cb6f513e3ebd2e6ad209648a1f70bcafbcb5', class: "s-gifting-modal-badge-wrapper" }, h("salla-skeleton", { key: 'e684b682a4cca89262128cca13604b7aa9a83cd7', height: '15px', width: '150px' })))), h("div", { key: '2941865d68cd216b4dd82bb8279f6bcbaa062bf3', class: "s-gifting-skeleton-content" }, h("salla-skeleton", { key: '7c4f4235a666930ceef3dc0b38809aea5ee5ce5c', height: '10px', width: '150px' }), h("salla-skeleton", { key: '0257f401762a11b0bf3da7db603b4e5f57bd1aae', height: '230px' }), h("salla-skeleton", { key: 'cced26b189549fcee4eff3a3fbd943a5735b4c6c', height: '10px', width: '150px' }), h("salla-skeleton", { key: 'f5893e5c631564c91bfe42c4102190d43f913947', height: '30px' }), h("salla-skeleton", { key: '64d3738017cf6732b429848c1de4ca16db1adc06', height: '40px' })))), h("slot", { key: '77d5bda8147f7f09d73b97fd7456121626b465a7', name: "header" }), !!this.hasError ?
|
|
572
|
+
h("salla-placeholder", { alignment: "center" }, h("span", { slot: "title" }, this.errorMessage || salla.lang.get('common.errors.empty_results')), h("span", { slot: "description" }, " "))
|
|
573
|
+
:
|
|
574
|
+
[
|
|
575
|
+
h("div", { class: "s-gifting-modal-header" }, h("span", { class: "s-gifting-modal-icon" }, h("span", { innerHTML: GiftSharing })), h("h2", { class: "s-gifting-modal-title" }, h("div", { class: "s-gifting-modal-badge-wrapper" }, h("div", { class: "s-gifting-modal-badge" }, h("span", null, h("span", null, this.currentStep), "/2")), h("span", null, this.giftDetails)))),
|
|
576
|
+
h("div", { class: "s-gifting-steps-wrapper " + this.parentClass, ref: el => this.stepsWrapper = el }, h("div", { class: "s-gifting-step-one gift-step-1", ref: el => this.step1Elems = el }, h("div", { class: "s-gifting-modal-uploader-title anime-item" }, this.selectImageForYourGift), h("div", { class: "s-gifting-modal-uploader anime-item", ref: el => this.uploader = el }, h("span", { class: "s-gifting-remove-preview", onClick: () => this.removePreview(), innerHTML: Cancel }), this.selectImageOrUpload && h("salla-file-upload", { "instant-upload": true, name: "image_url", url: salla.url.api(salla.product.api.getUrl('giftImage')), onUploaded: event => this.handleUploadImage(event.detail), labelIdle: this.getFilepondPlaceholder(), onRemoved: () => this.handleRemoveImage() })), h("div", { class: "anime-item" }, !this.uploadedImage && !!this.gift && !!this.gift.gift_images && this.gift.gift_images.length > 0 ?
|
|
577
|
+
h("salla-slider", { id: "gifting-slider", loop: false, "controls-outer": true, class: "s-gifting-slider", type: "carousel" }, h("div", { slot: "items" }, this.gift && this.gift.gift_images ?
|
|
578
|
+
this.gift?.gift_images.map((item) => h("a", { class: "s-gifting-clickable s-gifting-image", onClick: () => this.setPreview(item) }, h("img", { style: { "width": "120px" }, src: item.url, alt: `${item.id}` }))) : ''))
|
|
579
|
+
: ""), h("div", { class: "anime-item" }, h("div", { class: "s-form-group s-gifting-selectText", ref: el => this.textSelect = el }, h("select", { id: "gift-text-selection", name: "gift-text-selection", class: "s-form-control s-gifting-select", onChange: e => this.toggleGiftText(e) }, h("option", { "data-id": null, selected: true }, this.selectGiftMessage), this.gift && this.gift.gift_texts ?
|
|
580
|
+
this.gift?.gift_texts.map((txt) => h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)) : '', h("option", { "data-id": "custom" }, this.giftCustomText))), h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide", ref: (el) => this.customTextArea = el }, h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), h("div", { class: "mt-1" }, h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))), h("div", { class: "anime-item" }, h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() }, h("span", null, this.nextStep)))), h("div", { class: "s-gifting-step-two gift-step-2", ref: el => this.step2Elems = el }, h("div", { class: this.step2ItemClass(this.errors?.['sender_name'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ?
|
|
581
|
+
h("span", { class: "s-gifting-error" }, this.errors['sender_name']) : ''), h("div", { class: this.step2ItemClass(this.errors?.['receiver.name'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ?
|
|
582
|
+
h("span", { class: "s-gifting-error" }, this.errors['receiver.name']) : ''), h("div", { class: this.step2ItemClass(this.errors?.['receiver.mobile'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ?
|
|
583
|
+
h("span", { class: "s-gifting-error" }, this.errors['receiver.mobile']) : ''), this.physicalProducts &&
|
|
584
|
+
h("div", { class: this.step2ItemClass(this.errors?.['receiver.country'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverCountryFieldLabel), h("select", { name: "country", class: "s-form-control", onChange: (event) => this.handleCountryChange(event), required: true }, h("option", { value: "" }, this.selectCountry), this.gift?.countries?.map((country) => (h("option", { value: country.id }, country.name)))), this.errors && this.errors['receiver.country'] ?
|
|
585
|
+
h("span", { class: "s-gifting-error" }, this.errors['receiver.country']) : ''), this.physicalProducts && this.isKSA &&
|
|
586
|
+
h("div", { class: this.step2ItemClass(this.errors?.['receiver.region'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverRegionFieldLabel), h("select", { name: "region", class: "s-form-control", onChange: (event) => this.handleRegionChange(event), disabled: this.loadingRegions }, h("option", { value: "", selected: true }, this.loadingRegions ? salla.lang.get('common.elements.loading') : this.selectRegion), this.regions?.map((region) => (h("option", { value: region.id }, region.name)))), this.errors && this.errors['receiver.region'] ?
|
|
587
|
+
h("span", { class: "s-gifting-error" }, this.errors['receiver.region']) : ''), this.physicalProducts &&
|
|
588
|
+
h("div", { class: this.step2ItemClass(this.errors?.['receiver.city_id'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverCityFieldLabel), h("select", { name: "city", "aria-label": salla.lang.get('blocks.buy_as_gift.select_city'), class: "s-form-control", onChange: (event) => this.handleReceiverCity(event), disabled: this.loadingCities || (this.isKSA && !this.selectedRegionId) }, h("option", { value: "", selected: true }, this.loadingCities ? salla.lang.get('common.elements.loading') : this.selectCity), this.gift?.cities?.map((city) => (h("option", { value: city.id }, city.name)))), this.errors && this.errors['receiver.city_id'] ?
|
|
589
|
+
h("span", { class: "s-gifting-error" }, this.errors['receiver.city_id']) : ''), this.physicalProducts &&
|
|
590
|
+
h("div", { class: this.step2ItemClass('s-gifting-info') }, h("span", { innerHTML: Alert }), h("span", null, this.selectCityInfo)), !this.physicalProducts && h("div", { class: this.step2ItemClass() }, h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: `schedule-${this.hostId}` }, h("input", { type: "checkbox", name: 'schedule', id: `schedule-${this.hostId}`, onChange: () => this.toggleCalendar(), class: "s-checkbox" }), h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), h("div", { class: this.getCalendarClasses(), ref: (el) => this.calendarFormGroup = el }, h("label", { class: "s-form-label" }, this.selectSendDateAndTime), h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), h("div", { class: this.step2ItemClass('s-gifting-step-two-footer') }, h("a", { href: "#!", innerHTML: IconArrowLeft, onClick: (e) => this.goToStep1(e) }), h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, h("span", null, this.sendGift)))))
|
|
591
|
+
], h("slot", { key: '46da7ff69a3c10b75886a23936f2f9ad8ad0e7bf', name: "footer" })))
|
|
592
|
+
];
|
|
593
|
+
}
|
|
594
|
+
static get style() { return sallaGiftingCss; }
|
|
595
|
+
}, [4, "salla-gifting", {
|
|
596
|
+
"productId": [2, "product-id"],
|
|
597
|
+
"widgetTitle": [1, "widget-title"],
|
|
598
|
+
"widgetSubtitle": [1, "widget-subtitle"],
|
|
599
|
+
"physicalProducts": [4, "physical-products"],
|
|
600
|
+
"vertical": [4],
|
|
601
|
+
"formSelector": [1025, "form-selector"],
|
|
602
|
+
"sectionTitle": [32],
|
|
603
|
+
"sectionSubtitle": [32],
|
|
604
|
+
"sectionBtnText": [32],
|
|
605
|
+
"giftDetails": [32],
|
|
606
|
+
"selectImageForYourGift": [32],
|
|
607
|
+
"selectImageOrUpload": [32],
|
|
608
|
+
"selectGiftMessage": [32],
|
|
609
|
+
"giftCustomText": [32],
|
|
610
|
+
"textId": [32],
|
|
611
|
+
"incorrectGiftText": [32],
|
|
612
|
+
"nextStep": [32],
|
|
613
|
+
"senderNameLabel": [32],
|
|
614
|
+
"receiverNameFieldLabel": [32],
|
|
615
|
+
"receiverMobileFieldLabel": [32],
|
|
616
|
+
"receiverCountryFieldLabel": [32],
|
|
617
|
+
"ksa": [32],
|
|
618
|
+
"selectCountry": [32],
|
|
619
|
+
"selectCity": [32],
|
|
620
|
+
"selectCityInfo": [32],
|
|
621
|
+
"receiverCityFieldLabel": [32],
|
|
622
|
+
"receiverRegionFieldLabel": [32],
|
|
623
|
+
"selectRegion": [32],
|
|
624
|
+
"receiverEmailFieldLabel": [32],
|
|
625
|
+
"emailPlaceholder": [32],
|
|
626
|
+
"sendLater": [32],
|
|
627
|
+
"selectSendDateAndTime": [32],
|
|
628
|
+
"canNotEditOrderAfterSelectDate": [32],
|
|
629
|
+
"sendGift": [32],
|
|
630
|
+
"donationRequired": [32],
|
|
631
|
+
"currentStep": [32],
|
|
632
|
+
"showCalendar": [32],
|
|
633
|
+
"showGiftText": [32],
|
|
634
|
+
"currentLang": [32],
|
|
635
|
+
"parentClass": [32],
|
|
636
|
+
"errors": [32],
|
|
637
|
+
"gift": [32],
|
|
638
|
+
"selectedGiftTextOption": [32],
|
|
639
|
+
"selectedCountryId": [32],
|
|
640
|
+
"selectedCountryCode": [32],
|
|
641
|
+
"loadingCities": [32],
|
|
642
|
+
"loadingRegions": [32],
|
|
643
|
+
"regions": [32],
|
|
644
|
+
"selectedRegionId": [32],
|
|
645
|
+
"isKSA": [32],
|
|
646
|
+
"parsedFormData": [32],
|
|
647
|
+
"showTextArea": [32],
|
|
648
|
+
"selectedImage": [32],
|
|
649
|
+
"uploadedImage": [32],
|
|
650
|
+
"selectedText": [32],
|
|
651
|
+
"senderName": [32],
|
|
652
|
+
"errorMessage": [32],
|
|
653
|
+
"hasError": [32],
|
|
654
|
+
"quantity": [32],
|
|
655
|
+
"deliveryDate": [32],
|
|
656
|
+
"timeZone": [32],
|
|
657
|
+
"receiverName": [32],
|
|
658
|
+
"receiverMobile": [32],
|
|
659
|
+
"receiverCountryCode": [32],
|
|
660
|
+
"receiverEmail": [32],
|
|
661
|
+
"hostId": [32],
|
|
662
|
+
"receiverCity": [32],
|
|
663
|
+
"open": [64],
|
|
664
|
+
"close": [64],
|
|
665
|
+
"goToStep2": [64]
|
|
666
|
+
}]);
|
|
667
|
+
function defineCustomElement$1() {
|
|
668
|
+
if (typeof customElements === "undefined") {
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
const components = ["salla-gifting", "salla-button", "salla-datetime-picker", "salla-file-upload", "salla-list-tile", "salla-loading", "salla-modal", "salla-placeholder", "salla-skeleton", "salla-slider", "salla-tel-input"];
|
|
672
|
+
components.forEach(tagName => { switch (tagName) {
|
|
673
|
+
case "salla-gifting":
|
|
674
|
+
if (!customElements.get(tagName)) {
|
|
675
|
+
customElements.define(tagName, SallaGifting$1);
|
|
676
|
+
}
|
|
677
|
+
break;
|
|
678
|
+
case "salla-button":
|
|
679
|
+
if (!customElements.get(tagName)) {
|
|
680
|
+
defineCustomElement$b();
|
|
681
|
+
}
|
|
682
|
+
break;
|
|
683
|
+
case "salla-datetime-picker":
|
|
684
|
+
if (!customElements.get(tagName)) {
|
|
685
|
+
defineCustomElement$a();
|
|
686
|
+
}
|
|
687
|
+
break;
|
|
688
|
+
case "salla-file-upload":
|
|
689
|
+
if (!customElements.get(tagName)) {
|
|
690
|
+
defineCustomElement$9();
|
|
691
|
+
}
|
|
692
|
+
break;
|
|
693
|
+
case "salla-list-tile":
|
|
694
|
+
if (!customElements.get(tagName)) {
|
|
695
|
+
defineCustomElement$8();
|
|
696
|
+
}
|
|
697
|
+
break;
|
|
698
|
+
case "salla-loading":
|
|
699
|
+
if (!customElements.get(tagName)) {
|
|
700
|
+
defineCustomElement$7();
|
|
701
|
+
}
|
|
702
|
+
break;
|
|
703
|
+
case "salla-modal":
|
|
704
|
+
if (!customElements.get(tagName)) {
|
|
705
|
+
defineCustomElement$6();
|
|
706
|
+
}
|
|
707
|
+
break;
|
|
708
|
+
case "salla-placeholder":
|
|
709
|
+
if (!customElements.get(tagName)) {
|
|
710
|
+
defineCustomElement$5();
|
|
711
|
+
}
|
|
712
|
+
break;
|
|
713
|
+
case "salla-skeleton":
|
|
714
|
+
if (!customElements.get(tagName)) {
|
|
715
|
+
defineCustomElement$4();
|
|
716
|
+
}
|
|
717
|
+
break;
|
|
718
|
+
case "salla-slider":
|
|
719
|
+
if (!customElements.get(tagName)) {
|
|
720
|
+
defineCustomElement$3();
|
|
721
|
+
}
|
|
722
|
+
break;
|
|
723
|
+
case "salla-tel-input":
|
|
724
|
+
if (!customElements.get(tagName)) {
|
|
725
|
+
defineCustomElement$2();
|
|
726
|
+
}
|
|
727
|
+
break;
|
|
728
|
+
} });
|
|
729
|
+
}
|
|
730
|
+
defineCustomElement$1();
|
|
731
|
+
|
|
732
|
+
const SallaGifting = SallaGifting$1;
|
|
733
|
+
const defineCustomElement = defineCustomElement$1;
|
|
734
|
+
|
|
735
|
+
export { SallaGifting, defineCustomElement };
|