@salla.sa/twilight-components 2.14.576 → 2.14.577
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-pMiRtx1x.js → filepond-iflxa4A5.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-DxsZ8Mch.js → filepond-plugin-file-poster-NZ84xlKh.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-B6fa4wXz.js → filepond-plugin-file-validate-size-m8Z_JlZX.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-BEggFpci.js → filepond-plugin-file-validate-type-BfF6LYAT.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-BDwSySal.js → filepond-plugin-image-edit-DfRJ3iRj.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-HE8n94tY.js → filepond-plugin-image-exif-orientation-BZxYZai-.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-C-CaMrlm.js → filepond-plugin-image-preview-BQ7HvH2d.js} +1 -1
- package/dist/cjs/{helpers-Dm4BirHO.js → helpers-DBynEhOO.js} +0 -15
- package/dist/cjs/{index-B3IyDlYG.js → index-CSe-ijAV.js} +2 -2
- package/dist/cjs/{intlTelInput-CeiHZwpn.js → intlTelInput-DHfYz8vv.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +3 -3
- package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +3 -3
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-applied-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +17 -17
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +179 -187
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +160 -7
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_9.cjs.entry.js +4 -4
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +2 -2
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +2 -2
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +3 -3
- package/dist/cjs/salla-filters.cjs.entry.js +2 -2
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gift-card-redeem.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +3 -3
- package/dist/cjs/salla-hook.cjs.entry.js +2 -2
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +2 -2
- package/dist/cjs/salla-localization-modal.cjs.entry.js +2 -2
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +15 -15
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +2 -2
- package/dist/cjs/salla-map_3.cjs.entry.js +4 -4
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +4 -4
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +6 -6
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +2 -2
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-offer-modal.cjs.entry.js +2 -2
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +2 -2
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +2 -2
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +3 -3
- package/dist/cjs/salla-placeholder.cjs.entry.js +2 -2
- package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +2 -2
- package/dist/cjs/salla-product-card.cjs.entry.js +6 -6
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +2 -2
- package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search-product-card.cjs.entry.js +3 -3
- package/dist/cjs/salla-search.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
- package/dist/cjs/salla-social.cjs.entry.js +2 -2
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +2 -2
- package/dist/cjs/salla-wishlist-summary.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-DBIBI2Jr.js → vanilla-picker-Brk9Mb54.js} +1 -1
- package/dist/collection/assets/svg/mini-map.svg +6 -30
- package/dist/collection/components/salla-accordion/salla-accordion-head.js +2 -2
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.css +241 -238
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +175 -146
- package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.css +154 -92
- package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +160 -5
- package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +1 -1
- package/dist/collection/components/salla-color-picker/salla-color-picker.js +1 -1
- package/dist/collection/components/salla-comment-form/salla-comment-form.js +1 -1
- package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.js +1 -1
- package/dist/collection/components/salla-count-down/salla-count-down.js +1 -1
- package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +1 -1
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +2 -2
- package/dist/collection/components/salla-filters/salla-filters.js +1 -1
- package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +2 -2
- package/dist/collection/components/salla-gifting/salla-gifting.js +2 -2
- package/dist/collection/components/salla-hook/salla-hook.js +1 -1
- package/dist/collection/components/salla-list-tile/salla-list-tile.js +1 -1
- package/dist/collection/components/salla-loading/salla-loading.js +1 -1
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +1 -1
- package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +1 -1
- package/dist/collection/components/salla-loyalty-points-history/salla-loyalty-points-history.js +1 -1
- package/dist/collection/components/salla-loyalty-program/salla-loyalty-exchange-product-card.js +2 -2
- package/dist/collection/components/salla-loyalty-program/salla-loyalty-hero.js +3 -3
- package/dist/collection/components/salla-loyalty-program/salla-loyalty-point.js +4 -4
- package/dist/collection/components/salla-loyalty-program/salla-loyalty-reward.js +2 -2
- package/dist/collection/components/salla-loyalty-program/salla-reward-card.js +1 -1
- package/dist/collection/components/salla-loyalty-program/salla-reward-details.js +3 -3
- package/dist/collection/components/salla-loyalty-program/salla-reward-exchange.js +1 -1
- package/dist/collection/components/salla-maintenance-alert/salla-maintenance-alert.js +1 -1
- package/dist/collection/components/salla-map/salla-map.js +3 -3
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +1 -1
- 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 +4 -4
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +1 -1
- package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +1 -1
- package/dist/collection/components/salla-notifications/salla-notification-item.js +1 -1
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +1 -1
- package/dist/collection/components/salla-order-details/salla-order-details.js +1 -1
- package/dist/collection/components/salla-order-edit/salla-order-edit-product-card.js +1 -1
- package/dist/collection/components/salla-order-summary/salla-order-summary.js +1 -1
- package/dist/collection/components/salla-payments/salla-payments.js +2 -2
- package/dist/collection/components/salla-placeholder/salla-placeholder.js +1 -1
- package/dist/collection/components/salla-price-range/salla-price-range.js +2 -2
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +1 -1
- package/dist/collection/components/salla-product-card/salla-product-card.js +5 -5
- package/dist/collection/components/salla-product-card-embed/salla-product-card-embed.js +1 -1
- package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +1 -1
- package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +1 -1
- package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
- package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.js +1 -1
- package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
- package/dist/collection/components/salla-search-product-card/salla-search-product-card.js +2 -2
- package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.js +4 -4
- package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
- package/dist/collection/components/salla-social/salla-social.js +1 -1
- package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
- package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
- package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
- package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +1 -1
- package/dist/components/helpers.js +1 -15
- package/dist/components/index.js +2 -2
- package/dist/components/salla-accordion-head2.js +2 -2
- package/dist/components/salla-bullet-delivery.js +175 -184
- package/dist/components/salla-cart-coupons.js +161 -6
- package/dist/components/salla-cart-summary.js +1 -1
- package/dist/components/salla-color-picker2.js +1 -1
- package/dist/components/salla-comment-form2.js +1 -1
- package/dist/components/salla-conditional-fields2.js +1 -1
- package/dist/components/salla-count-down2.js +1 -1
- package/dist/components/salla-datetime-picker2.js +1 -1
- package/dist/components/salla-delivery-promise.js +1 -1
- package/dist/components/salla-file-upload2.js +2 -2
- package/dist/components/salla-filters-widget2.js +2 -2
- package/dist/components/salla-filters.js +1 -1
- package/dist/components/salla-gifting.js +2 -2
- package/dist/components/salla-hook.js +1 -1
- package/dist/components/salla-list-tile2.js +1 -1
- package/dist/components/salla-loading2.js +1 -1
- package/dist/components/salla-localization-modal.js +1 -1
- package/dist/components/salla-loyalty-exchange-product-card2.js +2 -2
- package/dist/components/salla-loyalty-hero2.js +3 -3
- package/dist/components/salla-loyalty-point2.js +4 -4
- package/dist/components/salla-loyalty-points-history.js +1 -1
- package/dist/components/salla-loyalty-prize-item.js +1 -1
- package/dist/components/salla-loyalty-reward.js +2 -2
- package/dist/components/salla-maintenance-alert.js +1 -1
- package/dist/components/salla-map2.js +3 -3
- package/dist/components/salla-multiple-bundle-product-cart2.js +1 -1
- package/dist/components/salla-multiple-bundle-product-details2.js +2 -2
- package/dist/components/salla-multiple-bundle-product-options-modal2.js +4 -4
- package/dist/components/salla-multiple-bundle-product-slider2.js +1 -1
- package/dist/components/salla-multiple-bundle-product.js +1 -1
- package/dist/components/salla-notification-item2.js +1 -1
- package/dist/components/salla-offer-modal.js +1 -1
- package/dist/components/salla-order-details.js +1 -1
- package/dist/components/salla-order-edit-product-card.js +1 -1
- package/dist/components/salla-order-summary.js +1 -1
- package/dist/components/salla-payments.js +2 -2
- package/dist/components/salla-placeholder2.js +1 -1
- package/dist/components/salla-price-range2.js +2 -2
- package/dist/components/salla-product-availability2.js +1 -1
- package/dist/components/salla-product-card-embed.js +1 -1
- package/dist/components/salla-product-card2.js +5 -5
- package/dist/components/salla-product-size-guide.js +2 -2
- package/dist/components/salla-quantity-input2.js +1 -1
- package/dist/components/salla-quick-buy2.js +1 -1
- package/dist/components/salla-review-card2.js +1 -1
- package/dist/components/salla-review-factors-tags2.js +1 -1
- package/dist/components/salla-reviews-page.js +1 -1
- package/dist/components/salla-reward-card2.js +1 -1
- package/dist/components/salla-reward-details2.js +3 -3
- package/dist/components/salla-reward-exchange2.js +1 -1
- package/dist/components/salla-search-product-card2.js +2 -2
- package/dist/components/salla-searchable-dropdown2.js +4 -4
- package/dist/components/salla-skeleton2.js +1 -1
- package/dist/components/salla-social-share2.js +1 -1
- package/dist/components/salla-social.js +1 -1
- package/dist/components/salla-tab-content2.js +1 -1
- package/dist/components/salla-tab-header2.js +1 -1
- package/dist/components/salla-tabs2.js +1 -1
- package/dist/components/salla-tel-input2.js +1 -1
- package/dist/components/salla-tooltip2.js +1 -1
- package/dist/components/salla-user-settings.js +1 -1
- package/dist/components/salla-wishlist-actions.js +1 -1
- package/dist/esm/{filepond-C6VyLUVF.js → filepond-Qm94dFPs.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-BfFqi2TO.js → filepond-plugin-file-poster-CHpnwHYe.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-BBqb56CB.js → filepond-plugin-file-validate-size-BwHBxxMg.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-O67G3mL2.js → filepond-plugin-file-validate-type-BD-yTEPO.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-CGZyNJxN.js → filepond-plugin-image-edit-DKc0Yw10.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-DA7fGQP3.js → filepond-plugin-image-exif-orientation-CepmNFGF.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-BijvA1XW.js → filepond-plugin-image-preview-FhnzagMd.js} +1 -1
- package/dist/esm/{helpers-CV6uPJEJ.js → helpers-BJxBnTgv.js} +1 -15
- package/dist/esm/{index-VyEjj_Gx.js → index-BAXTlrSC.js} +2 -2
- package/dist/esm/{intlTelInput-DE-bT5KJ.js → intlTelInput-BJlOPJYY.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +3 -3
- package/dist/esm/salla-accordion_6.entry.js +2 -2
- package/dist/esm/salla-add-product-button_5.entry.js +3 -3
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-applied-filters.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-attachment-view_9.entry.js +17 -17
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_3.entry.js +179 -187
- package/dist/esm/salla-cart-coupons.entry.js +160 -7
- package/dist/esm/salla-cart-item-offers_2.entry.js +2 -2
- package/dist/esm/salla-cart-summary-card.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +1 -1
- package/dist/esm/salla-comment-form_9.entry.js +4 -4
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +2 -2
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +2 -2
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +3 -3
- package/dist/esm/salla-filters.entry.js +2 -2
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gift-card-redeem.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +3 -3
- package/dist/esm/salla-hook.entry.js +2 -2
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +2 -2
- package/dist/esm/salla-localization-modal.entry.js +2 -2
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner_10.entry.js +15 -15
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +3 -3
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +2 -2
- package/dist/esm/salla-loyalty-prize-item.entry.js +2 -2
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +2 -2
- package/dist/esm/salla-map_3.entry.js +4 -4
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +4 -4
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +6 -6
- package/dist/esm/salla-multiple-bundle-product.entry.js +2 -2
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item_2.entry.js +2 -2
- package/dist/esm/salla-offer-modal.entry.js +2 -2
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-branch.entry.js +1 -1
- package/dist/esm/salla-order-cancel.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +2 -2
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +2 -2
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/salla-order-options-modal.entry.js +1 -1
- package/dist/esm/salla-order-shipments.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +2 -2
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +3 -3
- package/dist/esm/salla-placeholder.entry.js +2 -2
- package/dist/esm/salla-price-range.entry.js +3 -3
- package/dist/esm/salla-product-card-embed.entry.js +2 -2
- package/dist/esm/salla-product-card.entry.js +6 -6
- package/dist/esm/salla-product-size-guide.entry.js +3 -3
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-products-slider.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-review-factors-tags.entry.js +2 -2
- package/dist/esm/salla-review-order-item.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search-product-card.entry.js +3 -3
- package/dist/esm/salla-search.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +2 -2
- package/dist/esm/salla-social-share.entry.js +2 -2
- package/dist/esm/salla-social.entry.js +2 -2
- package/dist/esm/salla-tab-content_3.entry.js +4 -4
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +2 -2
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +2 -2
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +2 -2
- package/dist/esm/salla-wishlist-summary.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-BVwvMAEs.js → vanilla-picker-C_cY41gl.js} +1 -1
- package/dist/twilight/{p-f7063e39.entry.js → p-00a727c3.entry.js} +1 -1
- package/dist/twilight/{p-0987a1bf.entry.js → p-0227316e.entry.js} +1 -1
- package/dist/twilight/{p-4bcf0187.entry.js → p-03c959bb.entry.js} +1 -1
- package/dist/twilight/{p-e2d0eb4c.entry.js → p-072ee78f.entry.js} +1 -1
- package/dist/twilight/{p-f291fd6b.entry.js → p-073e1363.entry.js} +1 -1
- package/dist/twilight/{p-cbaa45a4.entry.js → p-0806da7e.entry.js} +1 -1
- package/dist/twilight/{p-c6e6daf9.entry.js → p-08cedab0.entry.js} +1 -1
- package/dist/twilight/{p-f7f35e00.entry.js → p-0bcca7f8.entry.js} +1 -1
- package/dist/twilight/{p-565f021e.entry.js → p-10a68a21.entry.js} +1 -1
- package/dist/twilight/{p-d4466357.entry.js → p-13abf9ca.entry.js} +1 -1
- package/dist/twilight/{p-a4ba6008.entry.js → p-13c35685.entry.js} +1 -1
- package/dist/twilight/{p-63a287b4.entry.js → p-162fa48e.entry.js} +1 -1
- package/dist/twilight/{p-38f82c85.entry.js → p-1762fd86.entry.js} +1 -1
- package/dist/twilight/{p-a2bf4487.entry.js → p-18c41e9a.entry.js} +1 -1
- package/dist/twilight/{p-76843521.entry.js → p-1fbb0b22.entry.js} +1 -1
- package/dist/twilight/{p-d0445027.entry.js → p-1fd6a10e.entry.js} +1 -1
- package/dist/twilight/p-28cdaf6b.entry.js +4 -0
- package/dist/twilight/{p-15fd28e8.entry.js → p-292a0b4a.entry.js} +1 -1
- package/dist/twilight/{p-9eebb417.entry.js → p-2ba4956f.entry.js} +1 -1
- package/dist/twilight/{p-faa90387.entry.js → p-2c543420.entry.js} +1 -1
- package/dist/twilight/{p-d59a53f5.entry.js → p-2e3a56de.entry.js} +1 -1
- package/dist/twilight/p-2e4064eb.entry.js +4 -0
- package/dist/twilight/{p-4abd6abc.entry.js → p-3153f560.entry.js} +1 -1
- package/dist/twilight/{p-55469fd9.entry.js → p-3a3815a2.entry.js} +1 -1
- package/dist/twilight/{p-63af5354.entry.js → p-3cef6be2.entry.js} +1 -1
- package/dist/twilight/{p-bc1251f6.entry.js → p-3dd612a6.entry.js} +1 -1
- package/dist/twilight/{p-95494a3d.entry.js → p-411c1ab0.entry.js} +1 -1
- package/dist/twilight/p-423d852d.entry.js +4 -0
- package/dist/twilight/{p-d5d8230d.entry.js → p-44a6598e.entry.js} +1 -1
- package/dist/twilight/{p-f889b4d2.entry.js → p-51d83216.entry.js} +1 -1
- package/dist/twilight/{p-354f6595.entry.js → p-51fb8841.entry.js} +1 -1
- package/dist/twilight/{p-82186e1c.entry.js → p-56609a91.entry.js} +1 -1
- package/dist/twilight/{p-f265b4ea.entry.js → p-58c1bf51.entry.js} +1 -1
- package/dist/twilight/{p-10da5fab.entry.js → p-59a7ca2e.entry.js} +1 -1
- package/dist/twilight/{p-c032ca19.entry.js → p-5a77257c.entry.js} +1 -1
- package/dist/twilight/{p-c1f9932b.entry.js → p-5c4e2ed3.entry.js} +1 -1
- package/dist/twilight/{p-2438d7e1.entry.js → p-5f464161.entry.js} +1 -1
- package/dist/twilight/{p-58398f44.entry.js → p-637670fa.entry.js} +1 -1
- package/dist/twilight/{p-80cf8042.entry.js → p-6605f258.entry.js} +1 -1
- package/dist/twilight/{p-ca7cd467.entry.js → p-665bc308.entry.js} +1 -1
- package/dist/twilight/{p-55afe19f.entry.js → p-6bfe12d5.entry.js} +1 -1
- package/dist/twilight/{p-b06b0973.entry.js → p-6de608eb.entry.js} +1 -1
- package/dist/twilight/{p-a291f319.entry.js → p-6f9bc285.entry.js} +1 -1
- package/dist/twilight/{p-85d5c0b6.entry.js → p-70451662.entry.js} +1 -1
- package/dist/twilight/{p-9417b38b.entry.js → p-7b0cf8a1.entry.js} +1 -1
- package/dist/twilight/{p-b35956cc.entry.js → p-7d08dcfb.entry.js} +1 -1
- package/dist/twilight/{p-ec378cee.entry.js → p-7d37b650.entry.js} +1 -1
- package/dist/twilight/{p-7d4c9e95.entry.js → p-7f3e110c.entry.js} +1 -1
- package/dist/twilight/{p-ceae3b17.entry.js → p-80302c52.entry.js} +1 -1
- package/dist/twilight/{p-47ddfc87.entry.js → p-806083b4.entry.js} +1 -1
- package/dist/twilight/{p-bb2c9ac9.entry.js → p-84cff600.entry.js} +1 -1
- package/dist/twilight/{p-66be47ec.entry.js → p-884104a3.entry.js} +1 -1
- package/dist/twilight/{p-140bf9e1.entry.js → p-898ce93b.entry.js} +1 -1
- package/dist/twilight/{p-90033ecc.entry.js → p-8a865d37.entry.js} +1 -1
- package/dist/twilight/{p-08bcc8c6.entry.js → p-8c750736.entry.js} +1 -1
- package/dist/twilight/{p-6c4d3288.entry.js → p-8fc2eb01.entry.js} +1 -1
- package/dist/twilight/{p-02df3435.entry.js → p-97fee81d.entry.js} +1 -1
- package/dist/twilight/{p-c95f4657.entry.js → p-9920bbad.entry.js} +1 -1
- package/dist/twilight/{p-237ee8db.entry.js → p-99b9bf66.entry.js} +1 -1
- package/dist/twilight/{p-dcba291c.entry.js → p-9b4a0dd3.entry.js} +1 -1
- package/dist/twilight/{p-b7e14e40.entry.js → p-9e054110.entry.js} +1 -1
- package/dist/twilight/{p-VyEjj_Gx.js → p-BAXTlrSC.js} +1 -1
- package/dist/twilight/p-BJxBnTgv.js +4 -0
- package/dist/twilight/{p-MofCSty6.js → p-BWpg3MwW.js} +1 -1
- package/dist/twilight/{p-CVE_4GIW.js → p-C6WaobtY.js} +1 -1
- package/dist/twilight/p-CvebbG3m.js +9 -0
- package/dist/twilight/{p-k8NfWBBa.js → p-D5lNzFgl.js} +1 -1
- package/dist/twilight/{p-Dht_HSXg.js → p-DGzNHmGp.js} +2 -2
- package/dist/twilight/{p-XWoqFS1d.js → p-DnrvXyI6.js} +1 -1
- package/dist/twilight/{p-BqBflUu5.js → p-DpI1J-G1.js} +1 -1
- package/dist/twilight/{p-DtngMbK9.js → p-SguJQlDo.js} +1 -1
- package/dist/twilight/{p-BZQPZ7Vk.js → p-_f6GlygH.js} +1 -1
- package/dist/twilight/{p-22efe055.entry.js → p-a2d07dba.entry.js} +1 -1
- package/dist/twilight/{p-a5dc1d5e.entry.js → p-a73a785d.entry.js} +1 -1
- package/dist/twilight/{p-b930b2ba.entry.js → p-a79c04a2.entry.js} +1 -1
- package/dist/twilight/{p-9df6ef40.entry.js → p-a9fcdac5.entry.js} +1 -1
- package/dist/twilight/{p-a185519a.entry.js → p-ab3ad37f.entry.js} +1 -1
- package/dist/twilight/{p-12bcfd57.entry.js → p-abc3e5d5.entry.js} +1 -1
- package/dist/twilight/{p-e6803d06.entry.js → p-b356f3f6.entry.js} +1 -1
- package/dist/twilight/{p-c593919c.entry.js → p-b55fb51b.entry.js} +1 -1
- package/dist/twilight/{p-1b2ce7bb.entry.js → p-bb35af04.entry.js} +1 -1
- package/dist/twilight/{p-f12fc91c.entry.js → p-bf845ea7.entry.js} +1 -1
- package/dist/twilight/{p-19c39465.entry.js → p-c2e871ae.entry.js} +1 -1
- package/dist/twilight/{p-9a0ad6b4.entry.js → p-c38fb150.entry.js} +1 -1
- package/dist/twilight/{p-b9e85434.entry.js → p-c63ff8ef.entry.js} +1 -1
- package/dist/twilight/{p-724be00d.entry.js → p-c90600b1.entry.js} +1 -1
- package/dist/twilight/{p-b3a36e11.entry.js → p-cc1b3318.entry.js} +1 -1
- package/dist/twilight/{p-a990b069.entry.js → p-ce1d3ad9.entry.js} +1 -1
- package/dist/twilight/{p-9f485845.entry.js → p-ce80fb8f.entry.js} +1 -1
- package/dist/twilight/{p-88918b1b.entry.js → p-d3556d1f.entry.js} +1 -1
- package/dist/twilight/{p-85a81ddd.entry.js → p-d3cf9f8a.entry.js} +1 -1
- package/dist/twilight/{p-f1d0d4da.entry.js → p-dd18ac5c.entry.js} +1 -1
- package/dist/twilight/p-dda4d231.entry.js +4 -0
- package/dist/twilight/{p-7ef406e5.entry.js → p-e0d834a7.entry.js} +1 -1
- package/dist/twilight/{p-09ab0b69.entry.js → p-e4ff7a77.entry.js} +1 -1
- package/dist/twilight/{p-2d43aaae.entry.js → p-e66856c5.entry.js} +1 -1
- package/dist/twilight/{p-bb83242c.entry.js → p-e7c4d4cc.entry.js} +1 -1
- package/dist/twilight/{p-70577d8b.entry.js → p-e944f02a.entry.js} +1 -1
- package/dist/twilight/{p-915965eb.entry.js → p-e95fd91e.entry.js} +1 -1
- package/dist/twilight/{p-6d46f977.entry.js → p-ea7846fd.entry.js} +1 -1
- package/dist/twilight/{p-29bc507d.entry.js → p-f0ca37fc.entry.js} +1 -1
- package/dist/twilight/{p-2aa87b3c.entry.js → p-f2e13d28.entry.js} +1 -1
- package/dist/twilight/{p-370939c2.entry.js → p-f514b9f5.entry.js} +1 -1
- package/dist/twilight/p-fa6f2b27.entry.js +4 -0
- package/dist/twilight/{p-a8f4fa9e.entry.js → p-faadae59.entry.js} +1 -1
- package/dist/twilight/{p-7f38bccf.entry.js → p-fc500047.entry.js} +1 -1
- package/dist/twilight/p-fdc97278.entry.js +4 -0
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-bullet-delivery/interfaces.d.ts +6 -0
- package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +25 -12
- package/dist/types/components/salla-cart-coupons/interfaces.d.ts +20 -0
- package/dist/types/components/salla-cart-coupons/salla-cart-coupons.d.ts +49 -1
- package/dist/types/components.d.ts +2 -2
- package/package.json +5 -5
- package/dist/twilight/p-26105855.entry.js +0 -4
- package/dist/twilight/p-4198d092.entry.js +0 -4
- package/dist/twilight/p-BB5KMFvk.js +0 -9
- package/dist/twilight/p-CV6uPJEJ.js +0 -4
- package/dist/twilight/p-c63be3cf.entry.js +0 -4
- package/dist/twilight/p-d6c4c0f7.entry.js +0 -4
- package/dist/twilight/p-f059fb37.entry.js +0 -4
- package/dist/twilight/p-fe8cb1d6.entry.js +0 -4
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { h, Host, } from "@stencil/core";
|
|
5
5
|
import { bulletDeliveryAPI, clearApiCache, isSaudiArabia } from "./api-service";
|
|
6
|
-
import {
|
|
6
|
+
import { filterBranches, findNearestBranch, getGeolocationErrorMessage, getIntentBranchId, getIntentCityId, getIntentCountryCode, getIntentCountryId, getIntentDistrictId, getIntentLatitude, getIntentLongitude, getIntentRegionId, getIntentSubtitle, hasSessionAddressIntent, isMapOriginIntent, isBranchSelectable, requireRegionAndDistrictForSA, } from "./helpers";
|
|
7
7
|
const BRANCH_SEARCH_DEBOUNCE_MS = 1000;
|
|
8
8
|
const GEOLOCATION_TIMEOUT = 10000;
|
|
9
9
|
/** Final fallback center used only if `user.default_geo_location` is absent (Riyadh — matches checkout map-page). */
|
|
10
10
|
const DEFAULT_MAP_CENTER = { lat: 24.7756042, lng: 46.7360729 };
|
|
11
11
|
import GetDirections from "../../assets/svg/get-directions.svg";
|
|
12
12
|
import GPS from "../../assets/svg/gps.svg";
|
|
13
|
-
import LocationTag from "../../assets/svg/location-tag.svg";
|
|
14
13
|
import Location from "../../assets/svg/location.svg";
|
|
15
14
|
import MiniMap from "../../assets/svg/mini-map.svg";
|
|
16
15
|
import Search from "../../assets/svg/search.svg";
|
|
@@ -27,7 +26,6 @@ function log(message, data) {
|
|
|
27
26
|
*/
|
|
28
27
|
export class SallaBulletDelivery {
|
|
29
28
|
constructor() {
|
|
30
|
-
this.confirming = false;
|
|
31
29
|
this.pendingCartSubmitResolver = null;
|
|
32
30
|
this.pendingCartSubmitPromise = null;
|
|
33
31
|
this.cartSubmitConfirmationPending = false;
|
|
@@ -48,6 +46,8 @@ export class SallaBulletDelivery {
|
|
|
48
46
|
this.cartSubmittingHandler = null;
|
|
49
47
|
this.useCartEventApi = false;
|
|
50
48
|
this.authLoggedInHandler = null;
|
|
49
|
+
/** Re-entrancy latch for tryAutoConfirmAfterLogin(); a flaky/duplicate auth::logged.in must not double-save. */
|
|
50
|
+
this.autoConfirmAfterLoginInFlight = false;
|
|
51
51
|
this.authLoggedOutHandler = null;
|
|
52
52
|
this.loginOpenHandler = null;
|
|
53
53
|
this.hasExplicitPreselectedIdsForOpen = false;
|
|
@@ -101,7 +101,6 @@ export class SallaBulletDelivery {
|
|
|
101
101
|
this.loadingBranches = false;
|
|
102
102
|
this.loadingNearestBranch = false;
|
|
103
103
|
this.locationError = "";
|
|
104
|
-
this.savingAddress = false;
|
|
105
104
|
this.loadingSavedAddresses = false;
|
|
106
105
|
this.showCartWillBeClearedBanner = false;
|
|
107
106
|
// Searchable dropdown state
|
|
@@ -124,10 +123,10 @@ export class SallaBulletDelivery {
|
|
|
124
123
|
this.addressToken = null;
|
|
125
124
|
this.loadingToken = false;
|
|
126
125
|
this.mapReady = false;
|
|
127
|
-
this.mapStep = 'map';
|
|
128
126
|
this.addressDescription = '';
|
|
129
127
|
/** True while reverse-geocoding a map-click/geolocation pick (no place from the map component itself). */
|
|
130
128
|
this.reverseGeocoding = false;
|
|
129
|
+
this.confirming = false;
|
|
131
130
|
this.newAddressForm = {
|
|
132
131
|
...SallaBulletDelivery.INITIAL_ADDRESS_FORM,
|
|
133
132
|
};
|
|
@@ -256,62 +255,35 @@ export class SallaBulletDelivery {
|
|
|
256
255
|
}
|
|
257
256
|
}
|
|
258
257
|
};
|
|
258
|
+
// ─── End Map methods ───
|
|
259
259
|
/**
|
|
260
|
-
* Submit add-address form:
|
|
260
|
+
* Submit add-address form: stage the picked address/dropdowns as the session intent,
|
|
261
|
+
* then delegate to handleConfirm() for the single save→allocate→close path (avoids
|
|
262
|
+
* a second, independently-maintained "save an address" implementation — see SHPD-9907).
|
|
261
263
|
*/
|
|
262
|
-
this.
|
|
264
|
+
this.handleSubmitNewAddress = async (e) => {
|
|
263
265
|
e.preventDefault();
|
|
264
|
-
if (this.
|
|
266
|
+
if (this.confirming)
|
|
265
267
|
return;
|
|
266
|
-
const hasMap = this.
|
|
268
|
+
const hasMap = this.canConfirmMapLocation();
|
|
267
269
|
const hasDropdowns = this.selectedCountry && this.selectedCity;
|
|
268
270
|
if (!hasMap && !hasDropdowns)
|
|
269
271
|
return;
|
|
270
272
|
if (!hasMap &&
|
|
271
273
|
!requireRegionAndDistrictForSA(this.selectedCountry?.code, this.selectedRegion?.id, this.selectedDistrict?.id ?? (this.districtName?.trim() || null)))
|
|
272
274
|
return;
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
this.viewMode = "main";
|
|
286
|
-
this.districtName = "";
|
|
287
|
-
this.mapLocationData = null;
|
|
288
|
-
this.invalidatePendingGeocode();
|
|
289
|
-
this.mapStep = 'map';
|
|
290
|
-
this.addressDescription = '';
|
|
291
|
-
}
|
|
292
|
-
else {
|
|
293
|
-
if (!this.isLoggedIn) {
|
|
294
|
-
Salla.notify?.error(Salla.lang.get('pages.checkout.login_to_use_saved_addresses'));
|
|
295
|
-
this.handleLogin();
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
298
|
-
Salla.notify?.error(Salla.lang.get("common.errors.error_occurred"));
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
catch (error) {
|
|
303
|
-
console.error("SallaBulletDelivery: Error saving address", error);
|
|
304
|
-
if (!this.isLoggedIn) {
|
|
305
|
-
Salla.notify?.error(Salla.lang.get('pages.checkout.login_to_use_saved_addresses'));
|
|
306
|
-
this.handleLogin();
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
Salla.notify?.error(Salla.lang.get("common.errors.error_occurred"));
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
finally {
|
|
313
|
-
this.savingAddress = false;
|
|
314
|
-
}
|
|
275
|
+
const details = this.buildIntentAddress();
|
|
276
|
+
if (!details)
|
|
277
|
+
return;
|
|
278
|
+
this.setStoredIntent({
|
|
279
|
+
type: "address",
|
|
280
|
+
country_id: Number(this.selectedCountry?.id) || 0,
|
|
281
|
+
country_code: this.selectedCountry?.code || "",
|
|
282
|
+
address_details: details,
|
|
283
|
+
});
|
|
284
|
+
this.selectedSavedAddress = null;
|
|
285
|
+
this.selectedSessionAddress = true;
|
|
286
|
+
await this.handleConfirm();
|
|
315
287
|
};
|
|
316
288
|
this.handleCountrySelected = (item) => {
|
|
317
289
|
const country = this.countries.find(c => String(c.id) === String(item.id)) || item;
|
|
@@ -391,9 +363,12 @@ export class SallaBulletDelivery {
|
|
|
391
363
|
return Salla.config.isMobileApp();
|
|
392
364
|
}
|
|
393
365
|
/**
|
|
394
|
-
* Opens the bullet delivery modal
|
|
366
|
+
* Opens the bullet delivery modal. Pass `silent: true` to run the same state/data
|
|
367
|
+
* loading below without showing the modal — used by tryAutoConfirmAfterLogin() so a
|
|
368
|
+
* successful auto-confirm never flashes the saved-addresses list; the caller is
|
|
369
|
+
* responsible for revealing the modal itself if it still needs the customer's input.
|
|
395
370
|
*/
|
|
396
|
-
async open() {
|
|
371
|
+
async open(silent = false) {
|
|
397
372
|
if (!this.isEnabled)
|
|
398
373
|
return; // feature disabled — never open
|
|
399
374
|
// If mobile app, open the sheet
|
|
@@ -408,9 +383,11 @@ export class SallaBulletDelivery {
|
|
|
408
383
|
}
|
|
409
384
|
// Reset state before opening
|
|
410
385
|
this.resetState();
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
386
|
+
if (!silent) {
|
|
387
|
+
// Open modal immediately — fields render right away with inline loading
|
|
388
|
+
this.modal.open();
|
|
389
|
+
Salla.event.dispatch("salla::bullet-delivery.modal.opened");
|
|
390
|
+
}
|
|
414
391
|
try {
|
|
415
392
|
this.isLoggedIn = !this.isGuestUser();
|
|
416
393
|
const savedIntent = this.cleanStaleGuestAddressIdIfNeeded(this.getStoredIntent());
|
|
@@ -502,6 +479,7 @@ export class SallaBulletDelivery {
|
|
|
502
479
|
this.mapLocationData = null;
|
|
503
480
|
this.invalidatePendingGeocode();
|
|
504
481
|
this.autoGeolocationTriggered = false;
|
|
482
|
+
this.addressDescription = "";
|
|
505
483
|
this.selectedCountry = null;
|
|
506
484
|
this.selectedRegion = null;
|
|
507
485
|
this.selectedCity = null;
|
|
@@ -600,12 +578,65 @@ export class SallaBulletDelivery {
|
|
|
600
578
|
return false;
|
|
601
579
|
if (!this.isIntentMethodSupported(intent))
|
|
602
580
|
return false;
|
|
581
|
+
// address_id/branch_id alone isn't enough — saveSessionAddressToProfile() persists
|
|
582
|
+
// address_id as soon as the address is *saved*, before allocation even runs, so a
|
|
583
|
+
// later allocation failure must not make this look complete. scope_allocated is only
|
|
584
|
+
// ever explicitly false (that saved-not-allocated state) or true; undefined means a
|
|
585
|
+
// legacy intent persisted before this field existed (or one written elsewhere without
|
|
586
|
+
// an outcome yet) — treat that the same as before rather than incorrectly re-prompting
|
|
587
|
+
// returning customers who already had a valid, complete intent.
|
|
588
|
+
if (intent.scope_allocated === false)
|
|
589
|
+
return false;
|
|
603
590
|
if (intent.type === "address")
|
|
604
591
|
return !!intent.address_id;
|
|
605
592
|
if (intent.type === "branch")
|
|
606
593
|
return !!intent.branch_id;
|
|
607
594
|
return false;
|
|
608
595
|
}
|
|
596
|
+
/**
|
|
597
|
+
* Auto-save + allocate a guest's pre-login address pick the moment auth::logged.in
|
|
598
|
+
* fires, instead of reopening the modal and waiting for another "Confirm" click
|
|
599
|
+
* (SHPD-9907). Guarded by hasIncompleteUserAddressIntent(), which only turns false
|
|
600
|
+
* once the intent gains an address_id — a durable guard even across a duplicate
|
|
601
|
+
* event, unlike `confirming` alone which resets after the redirect timeout.
|
|
602
|
+
*/
|
|
603
|
+
async tryAutoConfirmAfterLogin() {
|
|
604
|
+
if (this.confirming || this.autoConfirmAfterLoginInFlight)
|
|
605
|
+
return false;
|
|
606
|
+
if (!this.hasIncompleteUserAddressIntent())
|
|
607
|
+
return false;
|
|
608
|
+
this.autoConfirmAfterLoginInFlight = true;
|
|
609
|
+
const wasVisible = !!this.modal?.hasAttribute?.("visible");
|
|
610
|
+
try {
|
|
611
|
+
if (!wasVisible) {
|
|
612
|
+
// Load silently — a successful auto-confirm should never flash the
|
|
613
|
+
// saved-addresses list; only reveal the modal below if it can't finish on its own.
|
|
614
|
+
await this.open(true);
|
|
615
|
+
}
|
|
616
|
+
// open() -> loadSavedAddresses() already sets selectedSessionAddress when a
|
|
617
|
+
// session intent exists; bail if that didn't happen (e.g. address_id already set).
|
|
618
|
+
if (!this.selectedSessionAddress) {
|
|
619
|
+
if (!wasVisible)
|
|
620
|
+
this.modal?.open();
|
|
621
|
+
return false;
|
|
622
|
+
}
|
|
623
|
+
await this.handleConfirm();
|
|
624
|
+
// Checking hasCompleteIntentForLoggedInUser() (rather than just
|
|
625
|
+
// allocationOutOfCoverageMessage) also catches a *save* failure — handleConfirm()
|
|
626
|
+
// returns early on that before ever setting an allocation message, which used to
|
|
627
|
+
// make this report success even though nothing was actually confirmed.
|
|
628
|
+
if (!wasVisible && !this.hasCompleteIntentForLoggedInUser()) {
|
|
629
|
+
// Save or allocation failed — surface the modal so the customer can see why
|
|
630
|
+
// and retry or pick a different address.
|
|
631
|
+
this.modal?.open();
|
|
632
|
+
return false;
|
|
633
|
+
}
|
|
634
|
+
return true;
|
|
635
|
+
}
|
|
636
|
+
finally {
|
|
637
|
+
this.autoConfirmAfterLoginInFlight = false;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
609
640
|
/**
|
|
610
641
|
* Authenticated users on the cart page must select/confirm an address before
|
|
611
642
|
* they can dismiss the modal.
|
|
@@ -1217,10 +1248,13 @@ export class SallaBulletDelivery {
|
|
|
1217
1248
|
this.viewMode = "main";
|
|
1218
1249
|
this.mapLocationData = null;
|
|
1219
1250
|
this.invalidatePendingGeocode();
|
|
1220
|
-
this.mapStep = 'map';
|
|
1221
1251
|
this.addressDescription = '';
|
|
1222
1252
|
this.autoGeolocationTriggered = false;
|
|
1223
1253
|
}
|
|
1254
|
+
/** Whether there's a saved-addresses list (or a pending session intent) to go back to from the add-address view. */
|
|
1255
|
+
hasAddressesToGoBack() {
|
|
1256
|
+
return this.savedAddresses.length > 0 || hasSessionAddressIntent(this.getStoredIntent());
|
|
1257
|
+
}
|
|
1224
1258
|
// ─── Map methods ───
|
|
1225
1259
|
async fetchAddressToken() {
|
|
1226
1260
|
if (this.addressToken || this.loadingToken)
|
|
@@ -1319,9 +1353,13 @@ export class SallaBulletDelivery {
|
|
|
1319
1353
|
get isMapModeAvailable() {
|
|
1320
1354
|
return this.isMapSettingEnabled && !!salla.config.get('store.settings.keys.maps') && !!this.addressToken;
|
|
1321
1355
|
}
|
|
1356
|
+
/** In map mode and a pin has already been dropped (as opposed to still using the dropdowns), regardless of login state. */
|
|
1357
|
+
get isMapPick() {
|
|
1358
|
+
return this.isMapModeAvailable && this.hasMapLocation();
|
|
1359
|
+
}
|
|
1322
1360
|
/** Guest is in map mode and has already dropped a pin (as opposed to still using the dropdowns). */
|
|
1323
1361
|
get isGuestMapPick() {
|
|
1324
|
-
return !this.isLoggedIn && this.
|
|
1362
|
+
return !this.isLoggedIn && this.isMapPick;
|
|
1325
1363
|
}
|
|
1326
1364
|
/** Center shown before geolocation resolves — the customer's IP-based default (falls back to Riyadh). */
|
|
1327
1365
|
get mapInitialCenter() {
|
|
@@ -1344,32 +1382,6 @@ export class SallaBulletDelivery {
|
|
|
1344
1382
|
const num = Number(value);
|
|
1345
1383
|
return Number.isFinite(num) ? num : null;
|
|
1346
1384
|
}
|
|
1347
|
-
// ─── End Map methods ───
|
|
1348
|
-
/**
|
|
1349
|
-
* Build address/location payload from guest-form state (same fields as add-address).
|
|
1350
|
-
*/
|
|
1351
|
-
buildAddressLocationPayload() {
|
|
1352
|
-
if (this.isMapModeAvailable && this.hasMapLocation()) {
|
|
1353
|
-
return {
|
|
1354
|
-
lat: this.mapLocationData.lat,
|
|
1355
|
-
lng: this.mapLocationData.lng,
|
|
1356
|
-
...(this.mapLocationData.shortAddress && { short_address: this.mapLocationData.shortAddress }),
|
|
1357
|
-
...(this.addressDescription?.trim() && { description: this.addressDescription.trim() }),
|
|
1358
|
-
};
|
|
1359
|
-
}
|
|
1360
|
-
const districtName = this.selectedDistrict?.name ?? this.districtName?.trim() ?? "";
|
|
1361
|
-
return buildAddressLocationPayloadFromSelection({
|
|
1362
|
-
countryId: this.selectedCountry?.id ?? 0,
|
|
1363
|
-
countryCode: this.selectedCountry?.code,
|
|
1364
|
-
regionId: this.selectedRegion?.id,
|
|
1365
|
-
cityId: this.selectedCity?.id,
|
|
1366
|
-
districtId: this.selectedDistrict?.id,
|
|
1367
|
-
description: districtName,
|
|
1368
|
-
lat: this.mapLocationData?.lat,
|
|
1369
|
-
lng: this.mapLocationData?.lng,
|
|
1370
|
-
shortAddress: this.mapLocationData?.shortAddress,
|
|
1371
|
-
});
|
|
1372
|
-
}
|
|
1373
1385
|
async handleTabChange(tab) {
|
|
1374
1386
|
if (this.tabChanging)
|
|
1375
1387
|
return;
|
|
@@ -1531,7 +1543,7 @@ export class SallaBulletDelivery {
|
|
|
1531
1543
|
* when already open AND already correctly reflecting the logged-in state, so a duplicate
|
|
1532
1544
|
* auth::logged.in firing can't reset in-progress form input or cause a visible re-render flicker.
|
|
1533
1545
|
*/
|
|
1534
|
-
handlePendingSubmitAfterLogin() {
|
|
1546
|
+
async handlePendingSubmitAfterLogin() {
|
|
1535
1547
|
// auth::logged.in can fire prematurely (e.g. a silent cross-store login attempt,
|
|
1536
1548
|
// packages/twilight/src/api/cart.js's tryCrossStoreLogin, whose profile sync can complete
|
|
1537
1549
|
// without actually flipping the session to logged-in) while Salla.config still reports a
|
|
@@ -1545,6 +1557,10 @@ export class SallaBulletDelivery {
|
|
|
1545
1557
|
this.resolvePendingCartSubmit();
|
|
1546
1558
|
return;
|
|
1547
1559
|
}
|
|
1560
|
+
// handleConfirm()'s own close() resolves the pending cart-submit gate, so
|
|
1561
|
+
// just return on success rather than resolving it a second time here.
|
|
1562
|
+
if (await this.tryAutoConfirmAfterLogin())
|
|
1563
|
+
return;
|
|
1548
1564
|
if (!this.modal?.hasAttribute?.("visible") || !this.isLoggedIn) {
|
|
1549
1565
|
this.open();
|
|
1550
1566
|
}
|
|
@@ -1552,7 +1568,7 @@ export class SallaBulletDelivery {
|
|
|
1552
1568
|
buildIntentAddress() {
|
|
1553
1569
|
if (this.activeTab !== "address")
|
|
1554
1570
|
return undefined;
|
|
1555
|
-
if (this.
|
|
1571
|
+
if (this.isMapPick && this.mapLocationData) {
|
|
1556
1572
|
const { lat, lng, formattedAddress, shortAddress } = this.mapLocationData;
|
|
1557
1573
|
return {
|
|
1558
1574
|
country: this.selectedCountry
|
|
@@ -1943,6 +1959,20 @@ export class SallaBulletDelivery {
|
|
|
1943
1959
|
? String(allocationBranchId)
|
|
1944
1960
|
: undefined,
|
|
1945
1961
|
});
|
|
1962
|
+
// Applying the allocated scope to this session must succeed before treating the
|
|
1963
|
+
// confirmation as done — allocateScope() only creates the allocation server-side;
|
|
1964
|
+
// setDeliveryScope() is what makes *this* session use it. Ignoring its result let
|
|
1965
|
+
// checkout proceed (and scope_allocated get persisted) even when it failed.
|
|
1966
|
+
if (allocatedScopeId) {
|
|
1967
|
+
const scopeApplied = await bulletDeliveryAPI.setDeliveryScope(allocatedScopeId);
|
|
1968
|
+
if (!scopeApplied) {
|
|
1969
|
+
this.allocationOutOfCoverageMessage = `${Salla.lang.get("common.errors.error_occurred")}.`;
|
|
1970
|
+
this.confirmBtn?.stop();
|
|
1971
|
+
this.confirming = false;
|
|
1972
|
+
return;
|
|
1973
|
+
}
|
|
1974
|
+
clearApiCache();
|
|
1975
|
+
}
|
|
1946
1976
|
// Store headers in result object for persistence after page reload
|
|
1947
1977
|
result.allocation_headers = {
|
|
1948
1978
|
"s-scope-allocation-type": allocationType,
|
|
@@ -1955,11 +1985,7 @@ export class SallaBulletDelivery {
|
|
|
1955
1985
|
this.markShownThisSession();
|
|
1956
1986
|
// After allocation success: persist latest intent so switch UI can always reflect
|
|
1957
1987
|
// the selected address/branch once confirmed.
|
|
1958
|
-
this.setStoredIntent(result);
|
|
1959
|
-
if (allocatedScopeId) {
|
|
1960
|
-
await bulletDeliveryAPI.setDeliveryScope(allocatedScopeId);
|
|
1961
|
-
clearApiCache();
|
|
1962
|
-
}
|
|
1988
|
+
this.setStoredIntent({ ...result, scope_allocated: true });
|
|
1963
1989
|
const allocationConfirmedPayload = {
|
|
1964
1990
|
...result,
|
|
1965
1991
|
address: this.buildAllocationConfirmedAddressData(selectedAddress),
|
|
@@ -2157,8 +2183,10 @@ export class SallaBulletDelivery {
|
|
|
2157
2183
|
const { success, address } = await bulletDeliveryAPI.saveAddressLocation(payload);
|
|
2158
2184
|
if (!success || !address)
|
|
2159
2185
|
return null;
|
|
2160
|
-
// Persist address_id immediately to avoid duplicate creation on retry
|
|
2161
|
-
|
|
2186
|
+
// Persist address_id immediately to avoid duplicate creation on retry — but keep
|
|
2187
|
+
// scope_allocated false: the address is saved, not yet allocated, so a later
|
|
2188
|
+
// allocation failure must not make hasCompleteIntentForLoggedInUser() think it is.
|
|
2189
|
+
this.setStoredIntent({ ...intent, address_id: address.id, scope_allocated: false });
|
|
2162
2190
|
this.addressCreated.emit({ address });
|
|
2163
2191
|
return address;
|
|
2164
2192
|
}
|
|
@@ -2193,6 +2221,10 @@ export class SallaBulletDelivery {
|
|
|
2193
2221
|
return null;
|
|
2194
2222
|
const savedAddress = address ?? null;
|
|
2195
2223
|
if (savedAddress) {
|
|
2224
|
+
// Persist address_id immediately to avoid duplicate creation on retry — but keep
|
|
2225
|
+
// scope_allocated false: the address is saved, not yet allocated, so a later
|
|
2226
|
+
// allocation failure must not make hasCompleteIntentForLoggedInUser() think it is.
|
|
2227
|
+
this.setStoredIntent({ ...intent, address_id: savedAddress.id, scope_allocated: false });
|
|
2196
2228
|
this.addressCreated.emit({ address: savedAddress });
|
|
2197
2229
|
}
|
|
2198
2230
|
return savedAddress;
|
|
@@ -2281,14 +2313,14 @@ export class SallaBulletDelivery {
|
|
|
2281
2313
|
}
|
|
2282
2314
|
renderAddressConfirmation() {
|
|
2283
2315
|
const address = this.mapLocationData?.formattedAddress ?? '';
|
|
2284
|
-
|
|
2285
|
-
return (h("div", { class: "s-bullet-delivery-address-confirm" }, h("div", { class: "s-bullet-delivery-address-confirm-card" }, h("div", { class: "s-bullet-delivery-address-confirm-details" }, h("span", { class: "s-bullet-delivery-address-confirm-label" }, Salla.lang.get('pages.checkout.selected_address')), h("p", { class: "s-bullet-delivery-address-confirm-text" }, address), shortCode && (h("span", { class: "s-bullet-delivery-address-confirm-tag" }, shortCode, h("span", { class: "s-bullet-delivery-address-confirm-tag-icon", innerHTML: LocationTag })))), h("button", { type: "button", class: "s-bullet-delivery-address-confirm-edit", onClick: () => { this.mapStep = 'map'; } }, Salla.lang.get('common.elements.edit'))), h("div", { class: "s-bullet-delivery-address-confirm-description" }, h("label", { class: "s-bullet-delivery-address-confirm-description-label" }, Salla.lang.get('pages.checkout.address_description'), h("span", { class: "s-bullet-delivery-address-confirm-description-optional" }, Salla.lang.get('common.elements.optional'))), h("input", { type: "text", class: "s-bullet-delivery-address-confirm-description-input form-input", placeholder: Salla.lang.get('pages.checkout.address_description_placeholder'), value: this.addressDescription, onInput: (e) => { this.addressDescription = e.target.value; } }))));
|
|
2316
|
+
return (h("div", { class: "s-bullet-delivery-address-confirm" }, h("div", { class: "s-bullet-delivery-address-confirm-card" }, h("span", { class: "s-bullet-delivery-address-map-icon", innerHTML: MiniMap, "aria-hidden": "true" }), h("div", { class: "s-bullet-delivery-address-confirm-details" }, h("span", { class: "s-bullet-delivery-address-confirm-label" }, Salla.lang.get('pages.checkout.selected_address')), h("p", { class: "s-bullet-delivery-address-confirm-text" }, address))), h("div", { class: "s-bullet-delivery-address-confirm-description" }, h("label", { class: "s-bullet-delivery-address-confirm-description-label" }, Salla.lang.get('pages.checkout.address_description'), h("span", { class: "s-bullet-delivery-address-confirm-description-optional" }, Salla.lang.get('common.elements.optional'))), h("input", { type: "text", class: "s-bullet-delivery-address-confirm-description-input form-input", placeholder: Salla.lang.get('pages.checkout.address_description_placeholder'), value: this.addressDescription, onInput: (e) => { this.addressDescription = e.target.value; } }))));
|
|
2286
2317
|
}
|
|
2287
2318
|
renderGuestDeliveryForm() {
|
|
2288
2319
|
if (this.isMapModeAvailable) {
|
|
2289
|
-
return
|
|
2290
|
-
|
|
2291
|
-
|
|
2320
|
+
return [
|
|
2321
|
+
this.renderMapSection(),
|
|
2322
|
+
this.hasMapLocation() ? this.renderAddressConfirmation() : null,
|
|
2323
|
+
];
|
|
2292
2324
|
}
|
|
2293
2325
|
const isSA = isSaudiArabia(this.selectedCountry?.code ?? '');
|
|
2294
2326
|
return [
|
|
@@ -2310,23 +2342,15 @@ export class SallaBulletDelivery {
|
|
|
2310
2342
|
if (!this.isMapModeAvailable) {
|
|
2311
2343
|
return this.renderGuestDeliveryForm();
|
|
2312
2344
|
}
|
|
2313
|
-
const
|
|
2314
|
-
const
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
? (this.confirming
|
|
2318
|
-
? Salla.lang.get("pages.checkout.loading")
|
|
2319
|
-
: Salla.lang.get("pages.checkout.confirm_address"))
|
|
2320
|
-
: Salla.lang.get('pages.checkout.confirm_location');
|
|
2345
|
+
const canSubmit = this.canConfirmMapLocation();
|
|
2346
|
+
const submitLabel = this.confirming
|
|
2347
|
+
? Salla.lang.get("pages.checkout.loading")
|
|
2348
|
+
: Salla.lang.get("pages.checkout.confirm_address");
|
|
2321
2349
|
const handleSubmit = (e) => {
|
|
2322
2350
|
e.preventDefault();
|
|
2323
|
-
if (!isConfirmStep && canAdvanceToConfirm) {
|
|
2324
|
-
this.mapStep = 'confirm';
|
|
2325
|
-
return;
|
|
2326
|
-
}
|
|
2327
2351
|
this.handleConfirm();
|
|
2328
2352
|
};
|
|
2329
|
-
return (h("form", { onSubmit: handleSubmit }, this.renderGuestDeliveryForm(), h("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single", style: { padding: '24px' } }, h("salla-button", { type: "submit", loading: this.confirming, disabled:
|
|
2353
|
+
return (h("form", { onSubmit: handleSubmit }, this.renderGuestDeliveryForm(), h("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single", style: { padding: '24px' } }, h("salla-button", { type: "submit", loading: this.confirming, disabled: !canSubmit || this.confirming, width: "wide" }, submitLabel), !this.isLoggedIn && (h("button", { type: "button", class: "s-bullet-delivery-login-prompt", onClick: () => this.handleLogin() }, Salla.lang.get('pages.checkout.login_to_use_saved_addresses'))))));
|
|
2330
2354
|
}
|
|
2331
2355
|
renderBranchSearch() {
|
|
2332
2356
|
return (h("div", { class: "s-bullet-delivery-branch-search" }, h("div", { class: "s-bullet-delivery-search-row" }, h("div", { class: "s-bullet-delivery-search s-bullet-delivery-branch-search-wrap" }, h("span", { class: "s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon", innerHTML: Search, "aria-hidden": "true" }), h("input", { type: "text", class: "s-bullet-delivery-branch-search-input form-input", placeholder: Salla.lang.get("pages.checkout.search_for_city_or_branch"), value: this.branchSearchQuery, onInput: (e) => this.handleBranchSearch(e), autocomplete: "off" })), h("button", { type: "button", class: {
|
|
@@ -2390,25 +2414,18 @@ export class SallaBulletDelivery {
|
|
|
2390
2414
|
"s-hidden": this.activeTab !== "branch",
|
|
2391
2415
|
} }, this.renderCountrySelect(), this.renderBranchSearch(), this.renderBranchList()));
|
|
2392
2416
|
}
|
|
2393
|
-
/** Add-address form: map
|
|
2417
|
+
/** Add-address form: map + confirm card in one screen, or dropdown fallback. */
|
|
2394
2418
|
renderAddAddressForm() {
|
|
2395
|
-
const title = Salla.lang.get("pages.checkout.add_new_address");
|
|
2396
2419
|
const mapMode = this.isMapModeAvailable;
|
|
2397
2420
|
const isSA = isSaudiArabia(this.selectedCountry?.code ?? '');
|
|
2398
2421
|
const hasMapLoc = this.hasMapLocation();
|
|
2399
2422
|
let canSubmit;
|
|
2400
2423
|
let submitLabel;
|
|
2401
2424
|
if (mapMode) {
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
else {
|
|
2407
|
-
canSubmit = hasMapLoc;
|
|
2408
|
-
submitLabel = this.savingAddress
|
|
2409
|
-
? Salla.lang.get("pages.checkout.loading")
|
|
2410
|
-
: Salla.lang.get("pages.checkout.confirm_address");
|
|
2411
|
-
}
|
|
2425
|
+
canSubmit = this.canConfirmMapLocation();
|
|
2426
|
+
submitLabel = this.confirming
|
|
2427
|
+
? Salla.lang.get("pages.checkout.loading")
|
|
2428
|
+
: Salla.lang.get("pages.checkout.confirm_address");
|
|
2412
2429
|
}
|
|
2413
2430
|
else {
|
|
2414
2431
|
const canSubmitDropdowns = this.selectedCountry &&
|
|
@@ -2418,20 +2435,16 @@ export class SallaBulletDelivery {
|
|
|
2418
2435
|
!!this.selectedDistrict ||
|
|
2419
2436
|
!!(this.districtName && this.districtName.trim().length > 0));
|
|
2420
2437
|
canSubmit = hasMapLoc || canSubmitDropdowns;
|
|
2421
|
-
submitLabel = this.
|
|
2438
|
+
submitLabel = this.confirming
|
|
2422
2439
|
? Salla.lang.get("pages.checkout.loading")
|
|
2423
2440
|
: Salla.lang.get("pages.checkout.confirm_address");
|
|
2424
2441
|
}
|
|
2425
|
-
const hasAddressesToGoBack = this.savedAddresses.length > 0 || hasSessionAddressIntent(this.getStoredIntent());
|
|
2426
2442
|
const handleFormSubmit = (e) => {
|
|
2427
2443
|
e.preventDefault();
|
|
2428
|
-
|
|
2429
|
-
this.mapStep = 'confirm';
|
|
2430
|
-
return;
|
|
2431
|
-
}
|
|
2432
|
-
this.handleSubmitAddAddress(e);
|
|
2444
|
+
this.handleSubmitNewAddress(e);
|
|
2433
2445
|
};
|
|
2434
|
-
return (h("div", { class: "s-bullet-delivery-add-address" },
|
|
2446
|
+
return (h("div", { class: "s-bullet-delivery-add-address" }, this.allocationOutOfCoverageMessage &&
|
|
2447
|
+
this.renderAllocationOutOfCoverageAlert(), h("form", { class: "s-bullet-delivery-add-address-form", onSubmit: handleFormSubmit }, this.renderGuestDeliveryForm(), h("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single" }, h("salla-button", { type: "submit", loading: this.confirming, disabled: !canSubmit || this.confirming, class: "s-bullet-delivery-add-address-submit" }, submitLabel), this.hasAddressesToGoBack() && (h("salla-button", { shape: "link", class: "s-bullet-delivery-back-to-list-link", onClick: () => this.handleBackToAddressList() }, Salla.lang.getWithDefault('pages.checkout.saved_addresses', 'العناوين المحفوظة'), h("i", { class: "sicon-arrow-left" })))))));
|
|
2435
2448
|
}
|
|
2436
2449
|
renderFooter() {
|
|
2437
2450
|
if (this.activeTab === "address" && !this.isLoggedIn && this.isMapModeAvailable) {
|
|
@@ -2516,15 +2529,26 @@ export class SallaBulletDelivery {
|
|
|
2516
2529
|
if (!this.isEnabled)
|
|
2517
2530
|
return;
|
|
2518
2531
|
if (this.pendingCartSubmitPromise) {
|
|
2519
|
-
// A prior attempt is still pending
|
|
2520
|
-
//
|
|
2521
|
-
if (this.isGuestUser()) {
|
|
2522
|
-
this.
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
this.
|
|
2532
|
+
// A prior attempt is still pending. For a logged-in user, re-prompt instead of
|
|
2533
|
+
// silently awaiting with nothing visible.
|
|
2534
|
+
if (!this.isGuestUser()) {
|
|
2535
|
+
if (!this.modal?.hasAttribute?.("visible")) {
|
|
2536
|
+
this.open();
|
|
2537
|
+
}
|
|
2538
|
+
await this.pendingCartSubmitPromise;
|
|
2539
|
+
return;
|
|
2526
2540
|
}
|
|
2527
|
-
|
|
2541
|
+
// Guest: login was already shown once for this attempt — reopening it here (the
|
|
2542
|
+
// old behavior) fought whatever the guest just chose (e.g. "Continue as Guest")
|
|
2543
|
+
// and froze the page. Reset the gate so the *next* checkout click starts a clean
|
|
2544
|
+
// cycle (reopening login again, repeating until the guest actually logs in and
|
|
2545
|
+
// allocates) — but never resolve *this* invocation: returning here would resolve
|
|
2546
|
+
// salla.cart.event.submitting() (built on emitAsync, which awaits every listener),
|
|
2547
|
+
// letting cart.js's status() continue straight through to the checkout redirect.
|
|
2548
|
+
this.pendingCartSubmitResolver = null;
|
|
2549
|
+
this.pendingCartSubmitPromise = null;
|
|
2550
|
+
this.cartSubmitConfirmationPending = false;
|
|
2551
|
+
await new Promise(() => { });
|
|
2528
2552
|
return;
|
|
2529
2553
|
}
|
|
2530
2554
|
// Logged-in users with a complete intent can continue checkout without re-prompting.
|
|
@@ -2555,14 +2579,16 @@ export class SallaBulletDelivery {
|
|
|
2555
2579
|
this.closeHandler = this.close.bind(this);
|
|
2556
2580
|
Salla.event.on("salla::bullet-delivery.modal.close.requested", this.closeHandler);
|
|
2557
2581
|
this.isRTL = Salla.config.get("theme.is_rtl");
|
|
2558
|
-
this.authLoggedInHandler = () => {
|
|
2582
|
+
this.authLoggedInHandler = async () => {
|
|
2559
2583
|
if (this.cartSubmitConfirmationPending) {
|
|
2560
|
-
this.handlePendingSubmitAfterLogin();
|
|
2584
|
+
await this.handlePendingSubmitAfterLogin();
|
|
2561
2585
|
return;
|
|
2562
2586
|
}
|
|
2563
2587
|
// Always prompt after login when intent is incomplete, regardless of prior prompted flags.
|
|
2564
2588
|
if (!this.hasIncompleteUserAddressIntent())
|
|
2565
2589
|
return;
|
|
2590
|
+
if (await this.tryAutoConfirmAfterLogin())
|
|
2591
|
+
return;
|
|
2566
2592
|
if (this.modal?.hasAttribute?.("visible"))
|
|
2567
2593
|
return;
|
|
2568
2594
|
this.open();
|
|
@@ -2762,7 +2788,6 @@ export class SallaBulletDelivery {
|
|
|
2762
2788
|
"loadingBranches": {},
|
|
2763
2789
|
"loadingNearestBranch": {},
|
|
2764
2790
|
"locationError": {},
|
|
2765
|
-
"savingAddress": {},
|
|
2766
2791
|
"loadingSavedAddresses": {},
|
|
2767
2792
|
"showCartWillBeClearedBanner": {},
|
|
2768
2793
|
"countrySearchQuery": {},
|
|
@@ -2782,9 +2807,9 @@ export class SallaBulletDelivery {
|
|
|
2782
2807
|
"addressToken": {},
|
|
2783
2808
|
"loadingToken": {},
|
|
2784
2809
|
"mapReady": {},
|
|
2785
|
-
"mapStep": {},
|
|
2786
2810
|
"addressDescription": {},
|
|
2787
2811
|
"reverseGeocoding": {},
|
|
2812
|
+
"confirming": {},
|
|
2788
2813
|
"newAddressForm": {}
|
|
2789
2814
|
};
|
|
2790
2815
|
}
|
|
@@ -2873,8 +2898,12 @@ export class SallaBulletDelivery {
|
|
|
2873
2898
|
return {
|
|
2874
2899
|
"open": {
|
|
2875
2900
|
"complexType": {
|
|
2876
|
-
"signature": "() => Promise<void>",
|
|
2877
|
-
"parameters": [
|
|
2901
|
+
"signature": "(silent?: boolean) => Promise<void>",
|
|
2902
|
+
"parameters": [{
|
|
2903
|
+
"name": "silent",
|
|
2904
|
+
"type": "boolean",
|
|
2905
|
+
"docs": ""
|
|
2906
|
+
}],
|
|
2878
2907
|
"references": {
|
|
2879
2908
|
"Promise": {
|
|
2880
2909
|
"location": "global",
|
|
@@ -2884,7 +2913,7 @@ export class SallaBulletDelivery {
|
|
|
2884
2913
|
"return": "Promise<void>"
|
|
2885
2914
|
},
|
|
2886
2915
|
"docs": {
|
|
2887
|
-
"text": "Opens the bullet delivery modal",
|
|
2916
|
+
"text": "Opens the bullet delivery modal. Pass `silent: true` to run the same state/data\nloading below without showing the modal \u2014 used by tryAutoConfirmAfterLogin() so a\nsuccessful auto-confirm never flashes the saved-addresses list; the caller is\nresponsible for revealing the modal itself if it still needs the customer's input.",
|
|
2888
2917
|
"tags": []
|
|
2889
2918
|
}
|
|
2890
2919
|
},
|