@salla.sa/twilight-components 3.0.17 → 3.0.19
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/{Helper-DSYelC4c.js → Helper-DqKJCL8G.js} +1 -1
- package/dist/cjs/{filepond-l9D0Yv7b.js → filepond-Byu0lc8z.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-8SrbLptI.js → filepond-plugin-file-poster-qwx7lYZ-.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-DGD6oJy0.js → filepond-plugin-file-validate-size-C-n0P4TT.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-BIvrhp3w.js → filepond-plugin-file-validate-type-C8VOOXdT.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-4xKikdXG.js → filepond-plugin-image-edit-B9KG763Y.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-C3BvwxQh.js → filepond-plugin-image-exif-orientation-Czt4pYzU.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-CBq_GY0V.js → filepond-plugin-image-preview-BFm1Zl0o.js} +1 -1
- package/dist/cjs/free-shipping-timer-6QBe5BNS.js +156 -0
- package/dist/cjs/helpers-NV7wgP50.js +602 -0
- package/dist/cjs/{index-BAwxpXnB.js → index-CFW798jX.js} +2 -2
- package/dist/cjs/{intlTelInput-xw-HaAEN.js → intlTelInput-CLa2B89b.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +46 -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 +2 -2
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
- 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 +590 -134
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_9.cjs.entry.js +2 -2
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +2 -2
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +2 -2
- package/dist/cjs/salla-filters.cjs.entry.js +2 -2
- package/dist/cjs/salla-free-shipping-banner.cjs.entry.js +95 -9
- package/dist/cjs/salla-free-shipping-tag.cjs.entry.js +18 -5
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +13 -6
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +7 -2
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-items.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-payment.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-rewards.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +2 -2
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +13 -5
- package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +7 -4
- package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +2 -2
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-thank-you-header.cjs.entry.js +1 -1
- package/dist/cjs/salla-thank-you-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-summary.cjs.entry.js +2 -2
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-Cm_uNdps.js → vanilla-picker-Vx_7G7bs.js} +1 -1
- package/dist/collection/components/salla-bullet-delivery/api-service.js +156 -25
- package/dist/collection/components/salla-bullet-delivery/helpers.js +143 -15
- package/dist/collection/components/salla-bullet-delivery/icons.js +17 -0
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.css +490 -52
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +489 -106
- package/dist/collection/components/salla-bullet-delivery/selector-tracker.js +106 -0
- package/dist/collection/components/salla-free-shipping-banner/salla-free-shipping-banner.css +18 -4
- package/dist/collection/components/salla-free-shipping-banner/salla-free-shipping-banner.js +94 -11
- package/dist/collection/components/salla-free-shipping-tag/salla-free-shipping-tag.css +6 -0
- package/dist/collection/components/salla-free-shipping-tag/salla-free-shipping-tag.js +18 -2
- package/dist/collection/components/salla-gifting/salla-gifting.css +16 -1
- package/dist/collection/components/salla-gifting/salla-gifting.js +11 -4
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +6 -1
- package/dist/collection/components/salla-products-list/salla-products-list.js +11 -3
- package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +44 -1
- package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +5 -2
- package/dist/collection/shared/free-shipping-timer.js +130 -0
- package/dist/components/free-shipping-timer.js +150 -0
- package/dist/components/helpers.js +299 -40
- package/dist/components/index.js +2 -2
- package/dist/components/salla-bullet-delivery.js +595 -133
- package/dist/components/salla-free-shipping-banner.js +95 -8
- package/dist/components/salla-free-shipping-tag.js +17 -3
- package/dist/components/salla-gifting.js +12 -5
- package/dist/components/salla-login-modal2.js +6 -1
- package/dist/components/salla-products-list2.js +11 -3
- package/dist/components/salla-quick-buy2.js +44 -1
- package/dist/components/salla-rating-modal-v22.js +5 -2
- package/dist/docs.json +25 -5
- package/dist/esm/{Helper-POCi7J93.js → Helper-I0CAizv1.js} +1 -1
- package/dist/esm/{filepond-Ct76xW02.js → filepond-DTUYXV0J.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-C1OkzGRs.js → filepond-plugin-file-poster-DydZjneT.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-gdd-69cO.js → filepond-plugin-file-validate-size-nbsCU2t9.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-BaZ2QTzl.js → filepond-plugin-file-validate-type-Cl5B_DIy.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-CsoNvf0i.js → filepond-plugin-image-edit-bzskFyFR.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-BHDSe3nH.js → filepond-plugin-image-exif-orientation-MBDuxLaX.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-CD_S17z3.js → filepond-plugin-image-preview-N6wzEryW.js} +1 -1
- package/dist/esm/free-shipping-timer-CnTwkF6y.js +150 -0
- package/dist/esm/helpers-Cnh7Qptl.js +568 -0
- package/dist/esm/{index-DmGAR42j.js → index-C9zdeQFI.js} +2 -2
- package/dist/esm/{intlTelInput-D76Q4XFx.js → intlTelInput-B5L9nYtO.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +2 -2
- package/dist/esm/salla-add-product-button_5.entry.js +46 -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 +2 -2
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-attachment-view_9.entry.js +11 -11
- 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 +590 -134
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-cart-summary-card.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +1 -1
- package/dist/esm/salla-comment-form_9.entry.js +2 -2
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +2 -2
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +2 -2
- package/dist/esm/salla-filters.entry.js +2 -2
- package/dist/esm/salla-free-shipping-banner.entry.js +94 -8
- package/dist/esm/salla-free-shipping-tag.entry.js +17 -4
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gift-card-redeem_2.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +13 -6
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +2 -2
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +7 -2
- package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_3.entry.js +1 -1
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item_2.entry.js +2 -2
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-branch.entry.js +1 -1
- package/dist/esm/salla-order-cancel.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/salla-order-items.entry.js +1 -1
- package/dist/esm/salla-order-options-modal.entry.js +1 -1
- package/dist/esm/salla-order-payment.entry.js +1 -1
- package/dist/esm/salla-order-rewards.entry.js +1 -1
- package/dist/esm/salla-order-shipments.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +2 -2
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-card.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +13 -5
- package/dist/esm/salla-products-slider.entry.js +2 -2
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +7 -4
- package/dist/esm/salla-rating-modal.entry.js +2 -2
- package/dist/esm/salla-review-factors-tags.entry.js +1 -1
- package/dist/esm/salla-review-order-item.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search-product-card.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +2 -2
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +1 -1
- package/dist/esm/salla-thank-you-header.entry.js +1 -1
- package/dist/esm/salla-thank-you-page.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/salla-wishlist-summary.entry.js +2 -2
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-BlIXJyvJ.js → vanilla-picker-CAeu4f87.js} +1 -1
- package/dist/twilight/{p-84d725d4.entry.js → p-01d5cd61.entry.js} +1 -1
- package/dist/twilight/{p-60f4357f.entry.js → p-0213fde4.entry.js} +1 -1
- package/dist/twilight/{p-8f0af317.entry.js → p-036fbfc0.entry.js} +1 -1
- package/dist/twilight/{p-90d4129f.entry.js → p-0add41ce.entry.js} +1 -1
- package/dist/twilight/{p-fed66bcb.entry.js → p-0b0d4942.entry.js} +1 -1
- package/dist/twilight/{p-86ca22d5.entry.js → p-17bcbf9b.entry.js} +1 -1
- package/dist/twilight/{p-b66df976.entry.js → p-1867f7d4.entry.js} +1 -1
- package/dist/twilight/p-194ff38c.entry.js +4 -0
- package/dist/twilight/{p-4057b692.entry.js → p-20f9c62f.entry.js} +1 -1
- package/dist/twilight/{p-783c6346.entry.js → p-252748d9.entry.js} +1 -1
- package/dist/twilight/{p-3d5e862c.entry.js → p-290ce0bc.entry.js} +1 -1
- package/dist/twilight/{p-d68625f7.entry.js → p-2b930157.entry.js} +1 -1
- package/dist/twilight/{p-184ea04c.entry.js → p-2e4e15c5.entry.js} +1 -1
- package/dist/twilight/p-2e6537a3.entry.js +4 -0
- package/dist/twilight/{p-2a3e2404.entry.js → p-30d64bd1.entry.js} +1 -1
- package/dist/twilight/{p-5d4fadd2.entry.js → p-32495dd2.entry.js} +1 -1
- package/dist/twilight/{p-cd7029fc.entry.js → p-32d9da31.entry.js} +1 -1
- package/dist/twilight/{p-7e854633.entry.js → p-32f100f8.entry.js} +1 -1
- package/dist/twilight/{p-dc3ff1f0.entry.js → p-386b3dcd.entry.js} +1 -1
- package/dist/twilight/{p-e8090773.entry.js → p-3a4e86d1.entry.js} +1 -1
- package/dist/twilight/{p-a0a57259.entry.js → p-3b766a79.entry.js} +1 -1
- package/dist/twilight/{p-a5d2ad5e.entry.js → p-3b7a45ec.entry.js} +1 -1
- package/dist/twilight/{p-33ff7967.entry.js → p-3bb0e184.entry.js} +1 -1
- package/dist/twilight/{p-8b39a9f7.entry.js → p-3cc6ca6c.entry.js} +1 -1
- package/dist/twilight/{p-0a794d6f.entry.js → p-4070f808.entry.js} +1 -1
- package/dist/twilight/{p-d2c1457e.entry.js → p-412fb721.entry.js} +1 -1
- package/dist/twilight/{p-fce39869.entry.js → p-427c13b6.entry.js} +1 -1
- package/dist/twilight/{p-49195cb6.entry.js → p-45e0a5d0.entry.js} +1 -1
- package/dist/twilight/{p-cd866be6.entry.js → p-4d615f9f.entry.js} +1 -1
- package/dist/twilight/{p-4f794057.entry.js → p-4d7fc363.entry.js} +1 -1
- package/dist/twilight/{p-9eb92980.entry.js → p-5009f654.entry.js} +1 -1
- package/dist/twilight/{p-f4411a04.entry.js → p-50853b76.entry.js} +1 -1
- package/dist/twilight/{p-b9695308.entry.js → p-550ad1a6.entry.js} +1 -1
- package/dist/twilight/{p-4839d408.entry.js → p-575014c4.entry.js} +1 -1
- package/dist/twilight/{p-f10b887a.entry.js → p-5aee5e44.entry.js} +1 -1
- package/dist/twilight/{p-622bfb21.entry.js → p-619c709c.entry.js} +1 -1
- package/dist/twilight/{p-74f206cf.entry.js → p-6d572fe0.entry.js} +1 -1
- package/dist/twilight/{p-26fec98c.entry.js → p-6f84c662.entry.js} +1 -1
- package/dist/twilight/{p-4a1aa85f.entry.js → p-703b9253.entry.js} +1 -1
- package/dist/twilight/{p-509ad773.entry.js → p-73dea22d.entry.js} +1 -1
- package/dist/twilight/{p-6c7cae8a.entry.js → p-74285af9.entry.js} +1 -1
- package/dist/twilight/{p-31260fae.entry.js → p-777d28f6.entry.js} +1 -1
- package/dist/twilight/{p-4702959a.entry.js → p-7db6ccfe.entry.js} +1 -1
- package/dist/twilight/{p-e89a1905.entry.js → p-7db8d545.entry.js} +1 -1
- package/dist/twilight/{p-0c6a024f.entry.js → p-7fa4d0b6.entry.js} +1 -1
- package/dist/twilight/{p-2e8f95d0.entry.js → p-825c5b73.entry.js} +1 -1
- package/dist/twilight/{p-e5545546.entry.js → p-8262e669.entry.js} +1 -1
- package/dist/twilight/{p-bab5d057.entry.js → p-86d55a6b.entry.js} +1 -1
- package/dist/twilight/{p-0225f396.entry.js → p-8712f7c7.entry.js} +1 -1
- package/dist/twilight/{p-a53e2c74.entry.js → p-8948b58c.entry.js} +1 -1
- package/dist/twilight/{p-37b68ef3.entry.js → p-8b8cf457.entry.js} +1 -1
- package/dist/twilight/{p-8e8e40bc.entry.js → p-8c2992e7.entry.js} +1 -1
- package/dist/twilight/{p-eb160c2e.entry.js → p-8c548259.entry.js} +1 -1
- package/dist/twilight/{p-5d775867.entry.js → p-8eb3fd92.entry.js} +1 -1
- package/dist/twilight/p-908716fb.entry.js +4 -0
- package/dist/twilight/{p-62ba0971.entry.js → p-90a59027.entry.js} +1 -1
- package/dist/twilight/{p-ae9c0abe.entry.js → p-9683535f.entry.js} +1 -1
- package/dist/twilight/{p-89cff0c8.entry.js → p-982e9124.entry.js} +1 -1
- package/dist/twilight/{p-a17784e6.entry.js → p-995b898f.entry.js} +1 -1
- package/dist/twilight/{p-3a3d4cb7.entry.js → p-99cb3dba.entry.js} +1 -1
- package/dist/twilight/{p-6757344a.entry.js → p-9a0218a6.entry.js} +1 -1
- package/dist/twilight/{p-7d337f25.entry.js → p-9cf31ff4.entry.js} +1 -1
- package/dist/twilight/{p-d495cce0.entry.js → p-9d1a5007.entry.js} +1 -1
- package/dist/twilight/{p-57b93850.entry.js → p-9e429047.entry.js} +1 -1
- package/dist/twilight/{p-40083f25.entry.js → p-9e542951.entry.js} +1 -1
- package/dist/twilight/{p-Dhq3oJAe.js → p-BcT9tEVW.js} +1 -1
- package/dist/twilight/{p-Dza6OBFg.js → p-Bgu5gtOF.js} +1 -1
- package/dist/twilight/p-C9zdeQFI.js +5 -0
- package/dist/twilight/{p-BbZqYBfp.js → p-CSGj1pY-.js} +1 -1
- package/dist/twilight/{p-Nyk6-1lq.js → p-CWWgpQ8Q.js} +1 -1
- package/dist/twilight/{p-BwzmoZpm.js → p-Cfz9xit3.js} +1 -1
- package/dist/twilight/{p-iCJI7qYe.js → p-CmYSalnM.js} +1 -1
- package/dist/twilight/p-CnTwkF6y.js +4 -0
- package/dist/twilight/p-Cnh7Qptl.js +4 -0
- package/dist/twilight/{p-DVWVl151.js → p-Dav_R_d2.js} +1 -1
- package/dist/twilight/{p-B7rn1taO.js → p-JGEddAgs.js} +1 -1
- package/dist/twilight/{p-CAc7tX2K.js → p-RflSBQNB.js} +1 -1
- package/dist/twilight/{p-De2wEjqS.js → p-Xgbueas7.js} +1 -1
- package/dist/twilight/{p-64d49f5d.entry.js → p-a070cce0.entry.js} +1 -1
- package/dist/twilight/p-a0bfedad.entry.js +4 -0
- package/dist/twilight/{p-bf29daf3.entry.js → p-a22d9931.entry.js} +1 -1
- package/dist/twilight/{p-2153c6fd.entry.js → p-a3959219.entry.js} +1 -1
- package/dist/twilight/p-a3ca61af.entry.js +4 -0
- package/dist/twilight/{p-0e1248c4.entry.js → p-a55b5c44.entry.js} +1 -1
- package/dist/twilight/{p-24423a8d.entry.js → p-a5fc8358.entry.js} +1 -1
- package/dist/twilight/{p-66f6d722.entry.js → p-aabcd09f.entry.js} +1 -1
- package/dist/twilight/{p-4c801f91.entry.js → p-ad00021e.entry.js} +1 -1
- package/dist/twilight/{p-fae2a8d0.entry.js → p-ade9a68c.entry.js} +1 -1
- package/dist/twilight/{p-83ccad19.entry.js → p-b5e0065a.entry.js} +1 -1
- package/dist/twilight/{p-2a8d6e7e.entry.js → p-bbb09d92.entry.js} +1 -1
- package/dist/twilight/{p-f034968b.entry.js → p-c2df20f8.entry.js} +1 -1
- package/dist/twilight/{p-b38c38fe.entry.js → p-c4274188.entry.js} +1 -1
- package/dist/twilight/{p-d63ce284.entry.js → p-c5e2c781.entry.js} +1 -1
- package/dist/twilight/{p-07450aed.entry.js → p-c64b2b22.entry.js} +1 -1
- package/dist/twilight/{p-14752d03.entry.js → p-c92cc92f.entry.js} +1 -1
- package/dist/twilight/{p-d6c5bf2a.entry.js → p-cb54adac.entry.js} +1 -1
- package/dist/twilight/{p-7750bace.entry.js → p-ce1e45a3.entry.js} +1 -1
- package/dist/twilight/{p-e4d90663.entry.js → p-d0acd7ff.entry.js} +1 -1
- package/dist/twilight/{p-f9b9af72.entry.js → p-d0f903ac.entry.js} +1 -1
- package/dist/twilight/{p-7df4ee74.entry.js → p-d57b49ff.entry.js} +1 -1
- package/dist/twilight/p-db3efb27.entry.js +4 -0
- package/dist/twilight/{p-e81c4521.entry.js → p-db73d0bf.entry.js} +1 -1
- package/dist/twilight/{p-bfb70998.entry.js → p-e20d5e75.entry.js} +1 -1
- package/dist/twilight/{p-1982520c.entry.js → p-e223beca.entry.js} +1 -1
- package/dist/twilight/{p-20939237.entry.js → p-e37da59f.entry.js} +1 -1
- package/dist/twilight/p-e3991836.entry.js +4 -0
- package/dist/twilight/{p-fe413496.entry.js → p-e455709f.entry.js} +1 -1
- package/dist/twilight/{p-cc2c52bb.entry.js → p-e921b2d1.entry.js} +1 -1
- package/dist/twilight/{p-acd48ae7.entry.js → p-ec356e5a.entry.js} +1 -1
- package/dist/twilight/{p-7a985c8c.entry.js → p-eeefc285.entry.js} +1 -1
- package/dist/twilight/{p-120b4694.entry.js → p-f3b12754.entry.js} +1 -1
- package/dist/twilight/{p-c3c99d9e.entry.js → p-f6279a13.entry.js} +1 -1
- package/dist/twilight/{p-b819de23.entry.js → p-f83efc62.entry.js} +1 -1
- package/dist/twilight/{p-8b43035f.entry.js → p-fa622715.entry.js} +1 -1
- package/dist/twilight/{p-b87ea253.entry.js → p-faf00404.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-bullet-delivery/api-service.d.ts +23 -7
- package/dist/types/components/salla-bullet-delivery/helpers.d.ts +61 -6
- package/dist/types/components/salla-bullet-delivery/icons.d.ts +14 -0
- package/dist/types/components/salla-bullet-delivery/interfaces.d.ts +36 -1
- package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +82 -3
- package/dist/types/components/salla-bullet-delivery/selector-tracker.d.ts +30 -0
- package/dist/types/components/salla-free-shipping-banner/salla-free-shipping-banner.d.ts +19 -5
- package/dist/types/components/salla-free-shipping-tag/salla-free-shipping-tag.d.ts +6 -1
- package/dist/types/components/salla-gifting/salla-gifting.d.ts +1 -0
- package/dist/types/components/salla-quick-buy/salla-quick-buy.d.ts +6 -0
- package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +1 -0
- package/dist/types/components.d.ts +11 -25
- package/dist/types/shared/free-shipping-timer.d.ts +36 -0
- package/package.json +5 -5
- package/dist/cjs/free-shipping-DkIKD6ch.js +0 -31
- package/dist/cjs/helpers-8bMfm_mm.js +0 -329
- package/dist/components/free-shipping.js +0 -29
- package/dist/esm/free-shipping-Brg4wsgg.js +0 -29
- package/dist/esm/helpers-DqzaeXrL.js +0 -309
- package/dist/twilight/p-12a8aed8.entry.js +0 -4
- package/dist/twilight/p-4f443e36.entry.js +0 -4
- package/dist/twilight/p-5b81a3d9.entry.js +0 -4
- package/dist/twilight/p-93f26336.entry.js +0 -4
- package/dist/twilight/p-Brg4wsgg.js +0 -4
- package/dist/twilight/p-DmGAR42j.js +0 -5
- package/dist/twilight/p-DqzaeXrL.js +0 -4
- package/dist/twilight/p-c7c868b4.entry.js +0 -4
- package/dist/twilight/p-d5a2ba68.entry.js +0 -4
- package/dist/twilight/p-f8ff074f.entry.js +0 -4
|
@@ -3,11 +3,115 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
7
|
-
var helpers = require('./helpers-
|
|
6
|
+
var index = require('./index-CFW798jX.js');
|
|
7
|
+
var helpers = require('./helpers-NV7wgP50.js');
|
|
8
8
|
var location = require('./location-DIyESLuI.js');
|
|
9
9
|
var search = require('./search-c7Aa7lM9.js');
|
|
10
10
|
|
|
11
|
+
const SESSION_STORAGE_NAME = "sc_selector_session";
|
|
12
|
+
const TRACKING_TIMEOUT_MS = 5000;
|
|
13
|
+
const CLOSE_REASONS = {
|
|
14
|
+
closeButtonClick: "close_button",
|
|
15
|
+
backdropClick: "backdrop",
|
|
16
|
+
};
|
|
17
|
+
const toCloseReason = (reason) => CLOSE_REASONS[reason ?? ""] ?? "escape";
|
|
18
|
+
const uuid = () => typeof crypto.randomUUID === "function"
|
|
19
|
+
? crypto.randomUUID()
|
|
20
|
+
: "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (Number(c) ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (Number(c) / 4)))).toString(16));
|
|
21
|
+
const allocatedBranchIds = (intent) => {
|
|
22
|
+
const value = intent?.allocation_headers?.["s-scope-allocation-id"] ?? intent?.branch_id;
|
|
23
|
+
const ids = String(value ?? "")
|
|
24
|
+
.split(",")
|
|
25
|
+
.map(Number)
|
|
26
|
+
.filter((id) => Number.isSafeInteger(id) && id > 0);
|
|
27
|
+
return [...new Set(ids)].sort((a, b) => a - b);
|
|
28
|
+
};
|
|
29
|
+
const sameIds = (a, b) => a.length === b.length && a.every((id) => b.includes(id));
|
|
30
|
+
class SelectorTracker {
|
|
31
|
+
constructor() {
|
|
32
|
+
this.impressionId = null;
|
|
33
|
+
this.visibleAt = 0;
|
|
34
|
+
}
|
|
35
|
+
viewed(context) {
|
|
36
|
+
this.guarded(() => {
|
|
37
|
+
this.impressionId = uuid();
|
|
38
|
+
this.visibleAt = Date.now();
|
|
39
|
+
this.send("Branch Selector Viewed", { ...context });
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
dismissed(context, reason, hadAcceptedSelection) {
|
|
43
|
+
this.guarded(() => this.send("Branch Selector Dismissed", {
|
|
44
|
+
...context,
|
|
45
|
+
close_reason: reason,
|
|
46
|
+
had_accepted_selection: hadAcceptedSelection,
|
|
47
|
+
elapsed_ms: this.visibleAt ? Date.now() - this.visibleAt : 0,
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
result(context, result) {
|
|
51
|
+
this.guarded(() => {
|
|
52
|
+
const session = this.session();
|
|
53
|
+
const seq = session.seq + 1;
|
|
54
|
+
const accepted = result.outcome === "accepted";
|
|
55
|
+
const firstAccepted = session.first_accepted_branch_ids ?? (accepted ? result.new_branch_ids : null);
|
|
56
|
+
// A draft or a failed attempt replaces the stored intent, so the last accepted branches live here.
|
|
57
|
+
const previous = session.last_accepted_branch_ids ?? result.previous_branch_ids;
|
|
58
|
+
this.save({
|
|
59
|
+
...session,
|
|
60
|
+
seq,
|
|
61
|
+
first_accepted_branch_ids: firstAccepted,
|
|
62
|
+
last_accepted_branch_ids: accepted ? result.new_branch_ids : previous,
|
|
63
|
+
});
|
|
64
|
+
this.send("Branch Selector Completed", {
|
|
65
|
+
...context,
|
|
66
|
+
...result,
|
|
67
|
+
previous_branch_ids: previous,
|
|
68
|
+
selection_attempt_id: uuid(),
|
|
69
|
+
selection_seq: seq,
|
|
70
|
+
first_accepted_branch_ids: firstAccepted,
|
|
71
|
+
changed: accepted && previous.length > 0 && !sameIds(previous, result.new_branch_ids),
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
guarded(track) {
|
|
76
|
+
try {
|
|
77
|
+
track();
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
// Tracking must never break the selector.
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
send(event, properties) {
|
|
84
|
+
const body = {
|
|
85
|
+
event,
|
|
86
|
+
session_id: this.session().id,
|
|
87
|
+
impression_id: this.impressionId,
|
|
88
|
+
...properties,
|
|
89
|
+
};
|
|
90
|
+
// Use the configured transport without the SDK's shared notification suppression.
|
|
91
|
+
// Tracking failures stay silent while concurrent customer requests keep their alerts.
|
|
92
|
+
// keepalive lets the request outlive the reload that follows a confirmed selection.
|
|
93
|
+
Promise.resolve(salla.api.axios.post("selector-events", body, {
|
|
94
|
+
timeout: TRACKING_TIMEOUT_MS,
|
|
95
|
+
adapter: ["fetch", "xhr"],
|
|
96
|
+
fetchOptions: { keepalive: true },
|
|
97
|
+
})).catch(() => undefined);
|
|
98
|
+
}
|
|
99
|
+
session() {
|
|
100
|
+
const stored = Salla.storage.session.get(this.storageName());
|
|
101
|
+
if (stored?.id)
|
|
102
|
+
return stored;
|
|
103
|
+
const fresh = { id: uuid(), seq: 0, first_accepted_branch_ids: null };
|
|
104
|
+
this.save(fresh);
|
|
105
|
+
return fresh;
|
|
106
|
+
}
|
|
107
|
+
storageName() {
|
|
108
|
+
return `${SESSION_STORAGE_NAME}:${Salla.config.get("store.id")}`;
|
|
109
|
+
}
|
|
110
|
+
save(session) {
|
|
111
|
+
Salla.storage.session.set(this.storageName(), session);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
11
115
|
var LocationIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 172 172" width="172" height="172">
|
|
12
116
|
<!-- White rounded background -->
|
|
13
117
|
<rect width="172" height="172" rx="64" fill="#FFFFFF"/>
|
|
@@ -172,24 +276,6 @@ var GetDirections = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none"
|
|
|
172
276
|
</svg>
|
|
173
277
|
`;
|
|
174
278
|
|
|
175
|
-
var GPS = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
176
|
-
<path
|
|
177
|
-
d="M13.3258 7.65006C13.3258 10.7797 10.7888 13.3167 7.65916 13.3167C4.52955 13.3167 1.99249 10.7797 1.99249 7.65006C1.99249 4.52045 4.52955 1.9834 7.65916 1.9834C10.7888 1.9834 13.3258 4.52045 13.3258 7.65006Z"
|
|
178
|
-
stroke="#555555" stroke-width="1.3" />
|
|
179
|
-
<path d="M14.65 7.65039H13.3167" stroke="#555555" stroke-width="1.3" stroke-linecap="round"
|
|
180
|
-
stroke-linejoin="round" />
|
|
181
|
-
<path d="M1.98336 7.65039L0.650024 7.65039" stroke="#555555" stroke-width="1.3"
|
|
182
|
-
stroke-linecap="round" stroke-linejoin="round" />
|
|
183
|
-
<path d="M7.65002 0.650065L7.65002 1.9834" stroke="#555555" stroke-width="1.3"
|
|
184
|
-
stroke-linecap="round" stroke-linejoin="round" />
|
|
185
|
-
<path d="M7.65002 13.3171L7.65002 14.6504" stroke="#555555" stroke-width="1.3"
|
|
186
|
-
stroke-linecap="round" stroke-linejoin="round" />
|
|
187
|
-
<path
|
|
188
|
-
d="M9.64999 7.65039C9.64999 8.75496 8.75456 9.65039 7.64999 9.65039C6.54542 9.65039 5.64999 8.75496 5.64999 7.65039C5.64999 6.54582 6.54542 5.65039 7.64999 5.65039C8.75456 5.65039 9.64999 6.54582 9.64999 7.65039Z"
|
|
189
|
-
stroke="#555555" stroke-width="1.3" />
|
|
190
|
-
</svg>
|
|
191
|
-
`;
|
|
192
|
-
|
|
193
279
|
var MiniMap = `<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
194
280
|
<rect x="1.90958" y="0.576577" width="30.8468" height="30.8468" rx="9.22523" style="fill:#E8E8E8" stroke="white" stroke-width="1.15315"/>
|
|
195
281
|
<path d="M17.9096 6.77445L28.7204 5.33301H32.4681L32.7564 11.8195V23.6393L10.4141 23.9276V10.8105L17.9096 6.77445Z" style="fill:#97E7C8"/>
|
|
@@ -199,23 +285,36 @@ var MiniMap = `<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns
|
|
|
199
285
|
</svg>
|
|
200
286
|
`;
|
|
201
287
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
288
|
+
/**
|
|
289
|
+
* Inline icons shared with the checkout pickup picker (Checkout-Module INV-1414), kept byte-identical
|
|
290
|
+
* so both surfaces render the same glyphs.
|
|
291
|
+
*/
|
|
292
|
+
/** Checkout `LightningIcon.vue` — the "save delivery fees" pickup-tab badge. */
|
|
293
|
+
const LightningIcon = `<svg width="7" height="10" viewBox="0 0 7 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.41015 0.036C5.73815 0.084 5.96415 0.222 6.08815 0.45C6.21215 0.678 6.21415 0.952 6.09415 1.272C6.03815 1.432 5.89415 1.72 5.66215 2.136L5.13415 3.108C5.03015 3.308 4.96215 3.44 4.93015 3.504C4.91415 3.544 4.90215 3.576 4.89415 3.6C4.89415 3.656 4.91815 3.7 4.96615 3.732C4.99015 3.74 5.02615 3.748 5.07415 3.756H5.51815C5.79815 3.756 5.99015 3.76 6.09415 3.768C6.30215 3.784 6.45815 3.832 6.56215 3.912C6.70615 4.008 6.81215 4.138 6.88015 4.302C6.94815 4.466 6.97015 4.636 6.94615 4.812C6.93015 4.948 6.85815 5.1 6.73015 5.268C6.66615 5.356 6.53815 5.508 6.34615 5.724L3.65815 8.82C3.35415 9.172 3.14815 9.398 3.04015 9.498C2.93215 9.598 2.83415 9.664 2.74615 9.696C2.58615 9.768 2.43415 9.766 2.29015 9.69C2.14615 9.614 2.05415 9.488 2.01415 9.312C1.99815 9.208 1.99615 9.08 2.00815 8.928C2.02015 8.776 2.07415 8.472 2.17015 8.016L2.50615 6.432C2.57815 6.104 2.61815 5.888 2.62615 5.784C2.63415 5.728 2.62215 5.686 2.59015 5.658C2.55815 5.63 2.52615 5.612 2.49415 5.604C2.39815 5.588 2.18615 5.58 1.85815 5.58H1.60615C1.19815 5.58 0.918154 5.568 0.766154 5.544C0.462154 5.504 0.246154 5.38 0.118154 5.172C-0.00984615 4.964 -0.0338462 4.704 0.0461538 4.392C0.0861538 4.24 0.190154 3.968 0.358154 3.576L1.25815 1.464C1.41015 1.112 1.51815 0.872 1.58215 0.744C1.71015 0.512 1.85815 0.34 2.02615 0.228C2.19415 0.116 2.40215 0.048 2.65015 0.024C2.79415 0.008 3.05415 0 3.43015 0H4.47415C4.93815 0 5.25015 0.012 5.41015 0.036Z" fill="white"/></svg>`;
|
|
294
|
+
/** Pickup-instructions line on the branch card (design-provided). */
|
|
295
|
+
const NotesIcon = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.58709 4.67775L11.769 5.52554M7.90501 7.20895L9.49598 7.63284M7.98415 11.9777L8.62054 12.1472C10.4205 12.6268 11.3205 12.8666 12.0295 12.4595C12.7385 12.0525 12.9797 11.1576 13.462 9.36777L14.1441 6.83657C14.6264 5.04674 14.8675 4.15183 14.4582 3.44681C14.0488 2.7418 13.1488 2.50201 11.3489 2.02242L10.7125 1.85287C8.91249 1.37328 8.0125 1.13349 7.30349 1.54053C6.59447 1.94757 6.35332 2.84249 5.87102 4.63231L5.18894 7.16351C4.70664 8.95334 4.46549 9.84825 4.87484 10.5533C5.28419 11.2583 6.18418 11.4981 7.98415 11.9777Z" stroke="#555555" stroke-width="1.125" stroke-linecap="round"/><path d="M8.00016 13.964L7.36527 14.1369C5.56952 14.6259 4.67164 14.8704 3.96429 14.4554C3.25694 14.0404 3.01636 13.1279 2.53519 11.303L1.85471 8.72211C1.37354 6.89717 1.13295 5.98471 1.54134 5.26586C1.89461 4.64404 2.66683 4.66668 3.66683 4.66661" stroke="#555555" stroke-width="1.125" stroke-linecap="round"/></svg>`;
|
|
296
|
+
/** Pickup-availability (preparation time) line on the branch card (design-provided). */
|
|
297
|
+
const PickupAvailabilityIcon = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="8.00016" cy="8.00004" r="6.66667" stroke="#555555" stroke-width="1.125"/><path d="M8 5.33337V8.00004L9.33333 9.33337" stroke="#555555" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round"/></svg>`;
|
|
298
|
+
/** Working-hours (open/closed status) line on the branch card (design-provided). */
|
|
299
|
+
const WorkingHoursIcon = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.00014 14.6667C4.31824 14.6667 1.3335 11.6819 1.3335 8.00004C1.3335 4.31814 4.31826 1.33337 8.00016 1.33337C10.9853 1.33337 13.484 3.2953 14.3335 6.00004H12.6668" stroke="#666666" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round"/><path d="M8 5.33337V8.00004L9.33333 9.33337" stroke="#666666" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.6367 8.66667C14.6565 8.44724 14.6667 8.22486 14.6667 8M10 14.6667C10.2277 14.5917 10.4502 14.5043 10.6667 14.4052M13.8604 11.3333C13.989 11.0856 14.1036 10.8288 14.2034 10.5641M12.1283 13.4862C12.358 13.2961 12.5754 13.0905 12.7792 12.871" stroke="#666666" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round"/></svg>`;
|
|
300
|
+
/** Location (country, city, district) line on the branch card (design-provided). */
|
|
301
|
+
const BranchLocationIcon = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="8.00016" cy="4.66667" r="2.66667" stroke="#555555" stroke-width="1.125"/><path d="M8 7.33337L8 12" stroke="#555555" stroke-width="1.125" stroke-linecap="round"/><path d="M11.3332 12.6666C11.3332 13.403 9.84079 14 7.99984 14C6.15889 14 4.6665 13.403 4.6665 12.6666" stroke="#555555" stroke-width="1.125" stroke-linecap="round"/></svg>`;
|
|
214
302
|
|
|
215
|
-
const sallaBulletDeliveryCss = "/*!twlt*/@charset \"UTF-8\";@supports (interpolate-size: allow-keywords) and (block-size: calc-size(auto, size)){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body,.s-bullet-delivery-inner{interpolate-size:allow-keywords}.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body{overflow:clip;transition:block-size 500ms ease}.s-bullet-delivery-inner{overflow:clip;transition:block-size 500ms ease;block-size:calc-size(auto, size)}}@media screen and (min-width: 640px){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body:has(.s-searchable-dropdown--open){overflow:visible !important}}.s-bullet-delivery-form-actions.s-bullet-delivery-form-actions--single{padding-bottom:0;flex-direction:column;gap:0}.s-bullet-delivery-addresses-list.s-scrollbar::-webkit-scrollbar-track,.s-bullet-delivery-branches-list.s-scrollbar::-webkit-scrollbar-track{background-color:transparent}.s-bullet-delivery-back-to-list-link{display:inline-flex;align-items:center;justify-content:center;gap:2px;width:100%;margin-top:12px;background:none;border:none;color:var(--color-primary, #004956);font-size:14px;font-weight:500;cursor:pointer;padding:0}.s-bullet-delivery-back-to-list-link i{font-size:12px}.first-letter-cap::first-letter{text-transform:uppercase}.s-bullet-delivery-location-permission-btn{display:flex;align-items:center;gap:10px;width:100%;padding:12px;border:none;border-radius:8px;background:#fdf2f2;cursor:pointer;text-align:start}.s-bullet-delivery-location-permission-icon{display:inline-flex;flex-shrink:0;width:34px;height:34px}.s-bullet-delivery-location-permission-icon svg{width:100%;height:100%}.s-bullet-delivery-location-permission-text{flex:1;min-width:0;font-size:12px;line-height:18px;color:#444}.s-bullet-delivery-location-permission-arrow{flex-shrink:0;font-size:16px;color:#666}.s-bullet-delivery-location-distance-warning{display:flex;align-items:center;gap:10px;width:100%;padding:12px;border-radius:8px;background:#fff8e1;animation:s-bullet-delivery-fade-in 200ms ease}.s-bullet-delivery-location-distance-warning-icon{display:inline-flex;flex-shrink:0;width:34px;height:34px}.s-bullet-delivery-location-distance-warning-icon svg{width:100%;height:100%}.s-bullet-delivery-location-distance-warning-text{flex:1;min-width:0;font-size:12px;line-height:18px;color:#444}.s-bullet-delivery-map-container{width:100%;height:320px;border-radius:8px;overflow:hidden;margin-bottom:12px}.s-bullet-delivery-map-container gmap-map{display:block;width:100%;height:100%}.s-bullet-delivery-address-confirm{display:flex;flex-direction:column;gap:20px;animation:s-bullet-delivery-fade-in 200ms ease}.s-bullet-delivery-address-confirm-card{display:flex;align-items:center;gap:12px;border:1px solid #eee;border-radius:6px;padding:12px}.s-bullet-delivery-address-map-icon{overflow:hidden;border-radius:9px}.s-bullet-delivery-address-confirm-details{display:flex;flex-direction:column;align-items:flex-start;flex:1;min-width:0}.s-bullet-delivery-address-confirm-label{font-size:12px;line-height:16px;color:#666}.s-bullet-delivery-address-confirm-text{font-size:14px;font-weight:700;color:#333;margin:0;word-break:break-word}.s-bullet-delivery-address-confirm-description{display:flex;flex-direction:column;gap:8px}.s-bullet-delivery-address-confirm-description-label{font-size:14px;font-weight:500;color:#444}.s-bullet-delivery-address-confirm-description-optional{font-weight:400;color:#999;margin-inline-start:4px}.s-bullet-delivery-address-confirm-description-input{width:100%;border:1px solid #eee;border-radius:8px;padding:10px 12px;font-size:14px;margin-bottom:16px}.s-bullet-delivery-login-prompt{display:block;width:100%;text-align:center;background:none;border:none;color:var(--color-primary, #004956);font-size:14px;font-weight:500;cursor:pointer;padding:12px 0}@keyframes s-bullet-delivery-fade-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.branch-status-badge{display:inline-flex;align-items:center;justify-content:center;padding:2px 6px;max-height:20px;border-radius:20px;font-size:9px;font-weight:500;border:1px solid transparent;white-space:nowrap}.branch-status-badge.green{color:#43a047;background:#e8f5e9;border-color:#43a047}.branch-status-badge.blue{color:#1e88e5;background:#e3f2fd;border-color:#1e88e5}.branch-status-badge.red{color:#e53935;background:#fdf2f2;border-color:#e53935}.branch-status-badge.yellow{color:#f9a825;background:#fff8e1;border-color:#f9a825}.branch-status-badge.gray{color:#757575;background:#f5f5f5;border-color:#757575}.branch-status-badge.brown{color:#6d4c41;background:#efebe9;border-color:#6d4c41}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.visible{visibility:visible}.static{position:static}.mb-1{margin-bottom:0.25rem}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.gap-1{gap:0.25rem}.text-start{text-align:start}.\\!text-blue-600{--tw-text-opacity:1 !important;color:rgb(37 99 235 / var(--tw-text-opacity, 1)) !important}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-hidden{display:none}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.\\!btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.\\!btn:hover{opacity:0.8}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.spinner-loader.reverse{border-right-color:#9f7171 !important;background-color:#f98181}.s-hidden{display:none}.s-scrollbar::-webkit-scrollbar{width:5px}.s-scrollbar::-webkit-scrollbar-track{background-color:#eee}.s-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body{padding:0px}@media (min-width: 768px){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body{max-height:70dvh;overflow-y:auto}}@media (min-width: 640px){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body:has(.s-searchable-dropdown--open){overflow:visible !important}}.s-bullet-delivery-inner{min-block-size:0}.s-bullet-delivery-header{margin-bottom:1.5rem;text-align:start}.s-bullet-delivery-title{display:block;font-size:1.25rem;line-height:1.75rem;font-weight:700;color:var(--color-primary-dark)}.s-bullet-delivery-subtitle{margin-top:0.25rem;display:block;font-size:0.875rem;line-height:1.25rem;color:var(--color-primary-dark)}.s-bullet-delivery-tabs{margin-bottom:1.5rem;display:flex;gap:0.5rem}.s-bullet-delivery-tab{display:flex;flex:1 1 0%;cursor:pointer;align-items:center;gap:1rem;border-radius:0.5rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.75rem;padding-right:0.75rem;font-size:0.875rem;line-height:1.25rem;font-weight:500;color:var(--color-primary-dark);transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-bullet-delivery-tab:hover{background-color:color-mix(in srgb,var(--color-primary) 5%,transparent)}.s-bullet-delivery-tab--active{border-color:var(--color-primary-dark)}.s-bullet-delivery-tab svg{height:0.875rem;width:0.875rem;color:var(--color-primary-dark)}.s-bullet-delivery-tab-icon{display:flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:0.75rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-allocation-out-of-coverage{margin-bottom:1rem;display:flex;width:100%;align-items:center;gap:0.5rem;--tw-bg-opacity:1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1));padding-top:0.75rem;padding-bottom:0.75rem;padding-left:1rem;padding-right:1rem;text-align:end;--tw-text-opacity:1;color:rgb(127 29 29 / var(--tw-text-opacity, 1))}.s-bullet-delivery-allocation-out-of-coverage:where([dir=\"ltr\"],[dir=\"ltr\"] *){border-left-width:4px;border-left-color:rgb(239 68 68 / 0.5)}.s-bullet-delivery-allocation-out-of-coverage:where([dir=\"rtl\"],[dir=\"rtl\"] *){border-right-width:4px;border-right-color:rgb(239 68 68 / 0.5)}.s-bullet-delivery-allocation-out-of-coverage-text{font-size:0.875rem;line-height:1.25rem;line-height:1.4}.s-bullet-delivery-allocation-out-of-coverage-icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;--tw-text-opacity:1;color:rgb(127 29 29 / var(--tw-text-opacity, 1))}.s-bullet-delivery-content{margin-bottom:1.5rem;display:grid;gap:1rem}.s-bullet-delivery-content--active{animation:s-bullet-delivery-fade-in 220ms ease-out}.s-bullet-delivery-label{margin-bottom:0.5rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-bullet-delivery-error{margin-top:0.25rem;display:block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-bullet-delivery-footer{display:grid;gap:0.75rem;text-align:center}.s-bullet-delivery-placeholder{margin-top:1rem;margin-bottom:1rem}.s-bullet-delivery-placeholder.s-placeholder-wrapper{margin-top:1rem !important;margin-bottom:1rem !important}.s-bullet-delivery-label-content{display:inline-flex;align-items:center;gap:0.5rem}.s-bullet-delivery-select-loader{display:inline-flex;align-items:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-bullet-delivery-search-row{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:0.5rem;padding-left:1px;padding-right:1px}.s-bullet-delivery-search-row .s-bullet-delivery-search{min-width:0px;flex:1 1 0%}.s-bullet-delivery-search-row .s-bullet-delivery-location-btn{width:auto;flex-shrink:0}.s-bullet-delivery-field-row{margin-bottom:1rem;display:flex;gap:1rem}.s-bullet-delivery-field-row .s-bullet-delivery-field{margin-bottom:0px;flex:1 1 0%}.s-bullet-delivery-saved-addresses-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.s-bullet-delivery-saved-addresses-empty-icon{margin-bottom:0.75rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-bullet-delivery-saved-addresses-empty-icon svg{height:2rem;width:2rem}.s-bullet-delivery-saved-addresses-empty-title{margin-bottom:0.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-bullet-delivery-saved-addresses-empty-desc{margin-bottom:1.5rem;max-width:24rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-addresses-list{position:relative;display:flex;max-height:260px;flex-direction:column;overflow-y:auto;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 768px){.s-bullet-delivery-addresses-list{max-height:220px}}.s-bullet-delivery-address-item{display:flex;cursor:pointer;flex-direction:row;align-items:center;gap:0.75rem;border-bottom-width:1px;--tw-border-opacity:1;border-bottom-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.875rem;padding-bottom:0.875rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-address-item:not(.s-bullet-delivery-address-item--disabled):hover{background-color:rgb(249 250 251 / 0.5)}.s-bullet-delivery-address-item--selected{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-address-item--disabled{cursor:not-allowed;opacity:0.6}.s-bullet-delivery-address-item--skeleton{display:flex;cursor:default;align-items:center;gap:0.75rem;border-radius:0.75rem;border-width:1px;border-bottom-width:0px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:1rem}.s-bullet-delivery-address-item--skeleton .s-bullet-delivery-address-lines{gap:0.5rem}.s-bullet-delivery-address-content{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;justify-content:center;text-align:start}.s-bullet-delivery-address-lines{display:flex;flex-direction:column;gap:0.125rem}.s-bullet-delivery-address-line1{display:block;font-size:1rem;line-height:1.5rem;font-weight:400;line-height:1.375;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-bullet-delivery-address-line2{display:block;font-size:0.875rem;line-height:1.25rem;line-height:1.375;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-bullet-delivery-address-map-icon{display:grid;height:2.5rem;width:2.5rem;place-content:center}.s-bullet-delivery-address-map-icon svg{height:100%;width:100%}.s-bullet-delivery-skel-radio{flex-shrink:0;border-radius:9999px}.s-bullet-delivery-skel-map{flex-shrink:0;border-radius:0.75rem}.s-bullet-delivery-search{position:relative;flex:1 1 0%}.s-bullet-delivery-search-icon{pointer-events:none;position:absolute;top:0px;bottom:0px;left:0px;display:flex;align-items:center;padding-left:0.75rem}.s-bullet-delivery-search-icon:where([dir=\"rtl\"],[dir=\"rtl\"] *){left:auto;right:0px;padding-left:0px;padding-right:0.75rem}.s-bullet-delivery-search-icon svg{height:0.875rem;width:0.875rem;stroke:var(--color-primary)}.s-bullet-delivery-branch-search-wrap{display:flex;min-height:40px;min-width:0px;flex:1 1 0%;flex-direction:row;align-items:stretch;overflow:hidden;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-bullet-delivery-branch-search-wrap:focus-within{border-color:var(--color-primary-dark);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-color:var(--color-primary-dark)}.s-bullet-delivery-branch-search-icon{pointer-events:none;position:static;display:flex;flex-shrink:0;align-items:center;justify-content:center;padding-inline-start:0.5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-search-icon svg{height:1.25rem;width:1.25rem}.s-bullet-delivery-branch-search-input{min-height:40px;min-width:0px;flex:1 1 0%;border-radius:0px;border-style:none;background-color:transparent;padding-top:0.5rem;padding-bottom:0.5rem;padding-inline-end:0.75rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1));--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-bullet-delivery-branch-search-input::placeholder{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-search-input:focus{outline:2px solid transparent;outline-offset:2px;border:none;box-shadow:none;--tw-ring-shadow:none}.s-bullet-delivery-location-btn{display:flex;flex-shrink:0;cursor:pointer;align-items:center;justify-content:center;gap:0.5rem;border-radius:0.5rem;border-width:1px;padding-left:1rem;padding-right:1rem;padding-top:0.5rem;padding-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-location-btn:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-location-btn:disabled{cursor:not-allowed;opacity:0.5}.s-bullet-delivery-location-btn--full{min-height:40px}.s-bullet-delivery-location-btn--loading{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-location-icon{height:0.875rem;width:0.875rem;flex-shrink:0}.s-bullet-delivery-location-icon svg{height:100%;width:100%}.s-bullet-delivery-branches-wrap{overflow:hidden}.s-bullet-delivery-branches-list{position:relative;max-height:min(260px, 32svh);overflow-y:auto;border-radius:0.5rem;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}@media (min-width: 768px){.s-bullet-delivery-branches-list{max-height:220px}}.s-bullet-delivery-branches-loading{overflow:hidden;border-radius:0.5rem;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-branch-info{display:flex;max-width:6.25rem;flex-direction:column;gap:0.125rem}.s-bullet-delivery-branch-name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow-wrap:break-word;font-size:0.875rem;line-height:1.25rem;font-weight:500;line-height:1.375;--tw-text-opacity:1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-prep{text-align:start;font-size:0.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-time{font-size:0.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-time:where([dir=\"ltr\"],[dir=\"ltr\"] *){text-align:end}.s-bullet-delivery-branch-time:where([dir=\"rtl\"],[dir=\"rtl\"] *){text-align:start}.s-bullet-delivery-branch-map-link{display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:0.5rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));text-decoration-line:none;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-branch-map-link:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-branch-item>.s-bullet-delivery-branch-map-link{position:relative;z-index:10;pointer-events:auto}.s-bullet-delivery-branch-map-link-icon{display:flex;height:0.875rem;width:0.875rem;align-items:center;justify-content:center}.s-bullet-delivery-branch-map-link-icon svg{height:100%;width:100%}.s-bullet-delivery-branch-skeleton-title{max-width:100%}.s-bullet-delivery-branch-skeleton-time{justify-self:end}.s-bullet-delivery-branch-item{display:grid;min-width:0px;cursor:pointer;align-items:center;gap:0.5rem;border-bottom-width:1px;--tw-border-opacity:1;border-bottom-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;text-align:end;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;grid-template-columns:auto auto auto 1fr auto}.s-bullet-delivery-branch-item:last-child{border-bottom-width:0px}.s-bullet-delivery-branch-item:hover:not(.s-bullet-delivery-branch-item--disabled){--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-branch-item--selected{background-color:color-mix(in srgb,var(--color-primary) 5%,transparent)}.s-bullet-delivery-branch-item--disabled{cursor:not-allowed;opacity:0.5}.s-bullet-delivery-branch-icon{display:grid;place-content:center;border-radius:0.75rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));stroke:var(--color-primary-dark);padding:0.625rem;color:var(--color-primary-dark)}.s-bullet-delivery-branch-icon span{display:block;height:0.875rem;width:0.875rem}.s-bullet-delivery-branch-icon span svg{height:100%;width:100%}.s-bullet-delivery-branch-skeleton{display:grid;min-width:0px;align-items:center;gap:0.5rem;border-bottom-width:1px;--tw-border-opacity:1;border-bottom-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;grid-template-columns:auto auto auto 1fr auto}.s-bullet-delivery-branch-skeleton:last-child{border-bottom-width:0px}.s-bullet-delivery-branch-skeleton-radio{flex-shrink:0}.s-bullet-delivery-branch-skeleton-icon{flex-shrink:0;border-radius:0.75rem}.s-bullet-delivery-branch-skeleton-icon salla-skeleton{display:block}.s-bullet-delivery-branch-skeleton-map{flex-shrink:0;border-radius:0.75rem}.s-bullet-delivery-branch-skeleton-map salla-skeleton{display:block}.s-bullet-delivery-branch-skeleton-content{display:flex;min-width:0px;flex-direction:column;gap:0.5rem;overflow:hidden}.s-bullet-delivery-branch-skeleton-content salla-skeleton{min-width:0px;max-width:100%}.s-bullet-delivery-radio{margin-top:2px;height:1rem;width:1rem;flex-shrink:0;cursor:pointer;appearance:none;border-radius:9999px;border-width:2px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-radio:checked{border-color:var(--color-primary-dark);background:radial-gradient(circle,#fff 0,#fff 22%,var(--color-primary) 22%)}.s-bullet-delivery-radio:focus{outline:2px solid transparent;outline-offset:2px}.s-bullet-delivery-radio:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-color:var(--color-primary-dark);--tw-ring-offset-width:2px}.s-bullet-delivery-skeleton{box-sizing:border-box;min-width:0px;max-width:100%;overflow:hidden;padding:1.25rem}.s-bullet-delivery-skeleton salla-skeleton{min-width:0px;max-width:100%}.s-bullet-delivery-skeleton-header{margin-bottom:1.5rem;display:flex;min-width:0px;max-width:100%;flex-direction:column;align-items:flex-start;gap:0.75rem}.s-bullet-delivery-skeleton-title{display:block;max-width:100%}.s-bullet-delivery-skeleton-subtitle{display:block;max-width:100%}.s-bullet-delivery-skeleton-tabs{margin-bottom:1.5rem;display:grid;min-width:0px;max-width:100%;grid-template-columns:repeat(2, minmax(0, 1fr));gap:0.5rem}.s-bullet-delivery-skeleton-tabs--single{grid-template-columns:repeat(1, minmax(0, 1fr))}.s-bullet-delivery-skeleton-tab{display:flex;align-items:center;gap:1rem;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-bullet-delivery-skeleton-tab-icon{display:block;max-width:100%}.s-bullet-delivery-skeleton-tab-label{display:block;max-width:100%}.s-bullet-delivery-skeleton-field-label{display:block;max-width:100%}.s-bullet-delivery-skeleton-field-control{display:block;max-width:100%}.s-bullet-delivery-skeleton-content{margin-bottom:1.5rem;display:grid;min-width:0px;max-width:100%;gap:1rem}.s-bullet-delivery-skeleton-field{display:flex;min-width:0px;max-width:100%;flex-direction:column;align-items:flex-start;gap:0.5rem}.s-bullet-delivery-skeleton-footer{min-width:0px;max-width:100%}.s-bullet-delivery-add-address-header{margin-bottom:1.5rem;display:flex;align-items:center;justify-content:space-between;gap:0.75rem}.s-bullet-delivery-add-address-title{display:flex;width:100%;flex:1 1 0%;cursor:pointer;align-items:center;border-style:none;background-color:transparent;padding:0px;text-align:start;font-size:1.125rem;line-height:1.75rem;font-weight:700;color:var(--color-primary)}.s-bullet-delivery-add-address svg{height:2.5rem;width:2.5rem;fill:currentColor}.s-bullet-delivery-allocation-out-of-coverage-icon svg{height:1.25rem;width:1.25rem}.s-bullet-delivery-add-address-form{display:grid;gap:1rem}.s-bullet-delivery-add-address-submit{width:100%}.s-bullet-delivery-form-actions{display:flex;gap:0.75rem;border-top-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding-top:1rem}.s-bullet-delivery-form-actions salla-button{flex:1 1 0%}.s-bullet-delivery-form-actions--single{border-top-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-top:1.25rem}.s-bullet-delivery-form-actions--single salla-button{width:100%;flex:1 1 0%}.s-bullet-delivery-market-warning-overlay{position:fixed;inset:0px;z-index:60;display:flex;align-items:center;justify-content:center;background-color:rgb(0 0 0 / 0.5)}.s-bullet-delivery-market-warning{margin-left:1rem;margin-right:1rem;width:100%;max-width:24rem;border-radius:0.75rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1.5rem;--tw-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-bullet-delivery-market-warning-title{margin-bottom:0.75rem;font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-bullet-delivery-market-warning-message{margin-bottom:1.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-bullet-delivery-market-warning-actions{display:flex;gap:0.75rem}.s-bullet-delivery-market-warning-actions salla-button{flex:1 1 0%}.s-bullet-delivery-cart-view{margin-bottom:1rem;display:flex;align-items:center;justify-content:space-between;gap:1rem;border-radius:0.75rem;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1rem}.s-bullet-delivery-cart-view-info{display:flex;min-width:0px;flex:1 1 0%;align-items:center;gap:0.75rem}.s-bullet-delivery-cart-view-text{display:flex;flex-direction:column;text-align:start}.s-bullet-delivery-cart-view-title{font-size:1rem;line-height:1.5rem;font-weight:600;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-bullet-delivery-cart-view-subtitle{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));margin-block-start:0.125rem}.s-bullet-delivery-cart-view-icon{display:flex;height:3.5rem;width:3.5rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:1rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));color:var(--color-primary-dark)}.s-bullet-delivery-cart-view-icon svg{height:1.25rem;width:1.25rem;stroke:currentColor}.s-bullet-delivery-cart-view-button{flex-shrink:0;align-self:center}.s-bullet-delivery-location-permission-btn{display:flex;width:100%;cursor:pointer;align-items:center;gap:0.625rem;border-radius:0.5rem;border-width:0px;padding:0.75rem;text-align:start;background:#fdf2f2}.s-bullet-delivery-location-permission-icon{display:inline-flex;height:34px;width:34px;flex-shrink:0}.s-bullet-delivery-location-permission-icon svg{height:100%;width:100%}.s-bullet-delivery-location-permission-text{min-width:0px;flex:1 1 0%;font-size:0.75rem;line-height:1rem;line-height:18px;--tw-text-opacity:1;color:rgb(68 68 68 / var(--tw-text-opacity, 1))}.s-bullet-delivery-location-permission-arrow{flex-shrink:0;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(102 102 102 / var(--tw-text-opacity, 1))}.s-bullet-delivery-location-distance-warning{display:flex;width:100%;animation:s-bullet-delivery-fade-in 200ms ease;align-items:center;gap:0.625rem;border-radius:0.5rem;padding:0.75rem;background:#fff8e1}.s-bullet-delivery-location-distance-warning-icon{display:inline-flex;height:34px;width:34px;flex-shrink:0}.s-bullet-delivery-location-distance-warning-icon svg{height:100%;width:100%}.s-bullet-delivery-location-distance-warning-text{min-width:0px;flex:1 1 0%;font-size:0.75rem;line-height:1rem;line-height:18px;--tw-text-opacity:1;color:rgb(68 68 68 / var(--tw-text-opacity, 1))}";
|
|
303
|
+
const sallaBulletDeliveryCss = "/*!twlt*/@charset \"UTF-8\";@supports (interpolate-size: allow-keywords) and (block-size: calc-size(auto, size)){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body,.s-bullet-delivery-inner{interpolate-size:allow-keywords}.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body{overflow:clip;transition:block-size 500ms ease}.s-bullet-delivery-inner{overflow:clip;transition:block-size 500ms ease;block-size:calc-size(auto, size)}}@media screen and (min-width: 640px){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body:has(.s-searchable-dropdown--open){overflow:visible !important}}.s-bullet-delivery-form-actions.s-bullet-delivery-form-actions--single{padding-bottom:0;flex-direction:column;gap:0}.s-bullet-delivery-addresses-list.s-scrollbar::-webkit-scrollbar-track,.s-bullet-delivery-branches-list.s-scrollbar::-webkit-scrollbar-track{background-color:transparent}.s-bullet-delivery-back-to-list-link{display:inline-flex;align-items:center;justify-content:center;gap:2px;width:100%;margin-top:12px;background:none;border:none;color:var(--color-primary, #004956);font-size:14px;font-weight:500;cursor:pointer;padding:0}.s-bullet-delivery-back-to-list-link i{font-size:12px}.s-bullet-delivery-location-permission-btn{display:flex;align-items:center;gap:10px;width:100%;padding:12px;border:none;border-radius:8px;background:#fdf2f2;cursor:pointer;text-align:start}.s-bullet-delivery-location-permission-icon{display:inline-flex;flex-shrink:0;width:34px;height:34px}.s-bullet-delivery-location-permission-icon svg{width:100%;height:100%}.s-bullet-delivery-location-permission-text{flex:1;min-width:0;font-size:12px;line-height:18px;color:#444}.s-bullet-delivery-location-permission-arrow{flex-shrink:0;font-size:16px;color:#666}.s-bullet-delivery-location-distance-warning{display:flex;align-items:center;gap:10px;width:100%;padding:12px;border-radius:8px;background:#fff8e1;animation:s-bullet-delivery-fade-in 200ms ease}.s-bullet-delivery-location-distance-warning-icon{display:inline-flex;flex-shrink:0;width:34px;height:34px}.s-bullet-delivery-location-distance-warning-icon svg{width:100%;height:100%}.s-bullet-delivery-location-distance-warning-text{flex:1;min-width:0;font-size:12px;line-height:18px;color:#444}.s-bullet-delivery-map-container{width:100%;height:320px;border-radius:8px;overflow:hidden;margin-bottom:12px}.s-bullet-delivery-map-container gmap-map{display:block;width:100%;height:100%}.s-bullet-delivery-address-confirm{display:flex;flex-direction:column;gap:20px;animation:s-bullet-delivery-fade-in 200ms ease}.s-bullet-delivery-address-confirm-card{display:flex;align-items:center;gap:12px;border:1px solid #eee;border-radius:6px;padding:12px}.s-bullet-delivery-address-map-icon{overflow:hidden;border-radius:9px}.s-bullet-delivery-address-confirm-details{display:flex;flex-direction:column;align-items:flex-start;flex:1;min-width:0}.s-bullet-delivery-address-confirm-label{font-size:12px;line-height:16px;color:#666}.s-bullet-delivery-address-confirm-text{font-size:14px;font-weight:700;color:#333;margin:0;word-break:break-word}.s-bullet-delivery-address-confirm-description{display:flex;flex-direction:column;gap:8px}.s-bullet-delivery-address-confirm-description-label{font-size:14px;font-weight:500;color:#444}.s-bullet-delivery-address-confirm-description-optional{font-weight:400;color:#999;margin-inline-start:4px}.s-bullet-delivery-address-confirm-description-input{width:100%;border:1px solid #eee;border-radius:8px;padding:10px 12px;font-size:14px;margin-bottom:16px}.s-bullet-delivery-login-prompt{display:block;width:100%;text-align:center;background:none;border:none;color:var(--color-primary, #004956);font-size:14px;font-weight:500;cursor:pointer;padding:12px 0}@keyframes s-bullet-delivery-fade-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (min-width: 640px){.s-bullet-delivery-modal .s-modal-sm{width:90vw !important;max-width:776px !important}}.s-bullet-delivery-modal .s-bullet-delivery-tabs{gap:4px;padding:4px;border-radius:12px;background:#f5f5f5}.s-bullet-delivery-modal .s-bullet-delivery-tab{justify-content:center;gap:8px;min-height:40px;border:0;border-radius:8px;background:transparent;color:#666;font-size:14px}.s-bullet-delivery-modal .s-bullet-delivery-tab:hover{background:transparent;color:var(--color-text, #333)}.s-bullet-delivery-modal .s-bullet-delivery-tab--active,.s-bullet-delivery-modal .s-bullet-delivery-tab--active:hover{background:#fff;color:#1a1a1a;font-weight:600;box-shadow:0 1px 2px rgba(0, 0, 0, 0.06)}.s-bullet-delivery-modal .s-bullet-delivery-tab-badge{display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;padding:4px 8px;border-radius:8px;font-size:11px;font-weight:600;line-height:120%;white-space:nowrap;color:#fff;background:#5196f3}.s-bullet-delivery-modal .s-bullet-delivery-discount-badge{display:inline-flex;align-items:center;flex:0 0 auto;padding:4px 8px;border-radius:6px;font-size:12px;font-weight:600;line-height:120%;white-space:nowrap;color:#fff;background:#e5484d}.s-bullet-delivery-modal .s-bullet-delivery-tab-badge-icon{display:inline-flex}.s-bullet-delivery-modal .s-bullet-delivery-tab-badge-icon svg{width:7px;height:10px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:12px;background:#fafafa}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-field{margin:0}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters-row{display:flex;gap:12px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters-row>.s-bullet-delivery-field{flex:1;min-width:0}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters{}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-branch-search-wrap{min-height:40px;border-color:#ddd;border-radius:8px;background:#fff}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-branch-search-input{font-size:14px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-btn{height:40px;min-height:40px;padding:0 14px;gap:4px;border:1px solid var(--color-primary);border-radius:8px;background:#fff;color:#1a1a1a;font-size:14px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-btn:hover{background:#fff}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-icon{display:inline-flex}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-icon svg{width:16px;height:16px}.s-bullet-delivery-modal .s-bullet-delivery-branches-list{display:flex;flex-direction:column;gap:16px;max-height:min(400px, 45svh);border:0;border-radius:0;background:transparent}.s-bullet-delivery-modal .s-bullet-delivery-branch-item{display:grid;grid-template-columns:auto minmax(0, 1fr) auto;align-items:start;column-gap:12px;row-gap:2px;padding:16px;border:1px solid #eee;border-radius:12px;background:#fff;text-align:start;transition:border-color 0.2s}.s-bullet-delivery-modal .s-bullet-delivery-branch-item:last-child{border-bottom:1px solid #eee}.s-bullet-delivery-modal .s-bullet-delivery-branch-item:hover:not(.s-bullet-delivery-branch-item--disabled){background:#fff}.s-bullet-delivery-modal .s-bullet-delivery-branch-item--selected,.s-bullet-delivery-modal .s-bullet-delivery-branch-item--selected:last-child{border-color:var(--color-primary);background:#fff}.s-bullet-delivery-modal .s-bullet-delivery-branch-item--disabled{opacity:0.5}.s-bullet-delivery-modal .s-bullet-delivery-branch-radio{grid-column:1;grid-row:1;align-self:center;width:20px;height:20px;margin-top:0;pointer-events:none}.s-bullet-delivery-modal .s-bullet-delivery-branch-body{display:contents}.s-bullet-delivery-modal .s-bullet-delivery-branch-body>*{grid-column:2/-1;min-width:0}.s-bullet-delivery-modal .s-bullet-delivery-branch-body>.s-bullet-delivery-branch-name{grid-column:2;grid-row:1;align-self:center}.s-bullet-delivery-modal .s-bullet-delivery-branch-body>.s-bullet-delivery-branch-location{grid-column:2}.s-bullet-delivery-modal .s-bullet-delivery-branch-name{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0;font-size:14px;font-weight:700;line-height:120%;color:#1a1a1a}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta{display:inline-flex;align-items:center;gap:4px;font-size:13px;color:#6c757d}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta i{font-size:12px}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-status--open{color:#43a047;font-weight:500}.s-bullet-delivery-modal .s-bullet-delivery-pickup-status--closed,.s-bullet-delivery-modal .s-bullet-delivery-pickup-status--busy{color:#e53935;font-weight:500}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-toggle{display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;margin:-6px;padding:0;border:0;background:none;color:inherit;line-height:1;cursor:pointer}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-toggle i{transition:transform 0.2s ease}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-toggle i.is-expanded{transform:rotate(180deg)}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule{display:flex;flex-direction:column;margin-top:4px;border-radius:8px;overflow:hidden}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-day{display:flex;align-items:center;justify-content:space-between;gap:4px;padding:2px 12px;background:#f8f9fa;font-size:12px;font-weight:500}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-days{color:#6c757d}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule-times{color:#1a1a1a}.s-bullet-delivery-modal .s-bullet-delivery-branch-instructions{align-items:flex-start;line-height:1.5;white-space:pre-line}.s-bullet-delivery-modal .s-bullet-delivery-branch-instructions .s-bullet-delivery-branch-meta-icon{margin-top:2px}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta-value{color:#1a1a1a;font-weight:500}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta-icon{display:inline-flex;flex-shrink:0}.s-bullet-delivery-modal .s-bullet-delivery-branch-meta-icon svg{width:16px;height:16px}.s-bullet-delivery-modal .s-bullet-delivery-branch-actions{grid-column:3;grid-row:1/span 2;display:flex;align-items:center;gap:8px}.s-bullet-delivery-modal .s-bullet-delivery-branch-action{display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:1px solid var(--color-border, #eee);border-radius:8px;background:transparent;color:var(--color-text, #333);text-decoration:none;cursor:pointer;transition:all 0.2s}.s-bullet-delivery-modal .s-bullet-delivery-branch-action i{font-size:16px}.s-bullet-delivery-modal .s-bullet-delivery-branch-action:hover{border-color:var(--color-primary);color:var(--color-primary);background:var(--color-primary-tt, transparent)}.s-bullet-delivery-modal .s-bullet-delivery-branch-action .s-bullet-delivery-branch-map-link-icon,.s-bullet-delivery-modal .s-bullet-delivery-branch-action .s-bullet-delivery-branch-map-link-icon svg{width:16px;height:16px}.s-bullet-delivery-modal .s-bullet-delivery-branch-action .s-bullet-delivery-branch-map-link-icon path{stroke:currentColor}.s-bullet-delivery-modal .s-bullet-delivery-branch-item .s-bullet-delivery-branch-action,.s-bullet-delivery-modal .s-bullet-delivery-branch-item .s-bullet-delivery-branch-schedule-toggle{pointer-events:auto}.s-bullet-delivery-modal .s-bullet-delivery-branch-pills{display:contents}.s-bullet-delivery-modal .s-bullet-delivery-branch-divider{display:none}@media (max-width: 480px){.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters{flex-direction:row;flex-wrap:wrap;gap:12px 8px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-branch-search,.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-search-row,.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-pickup-filters-row{display:contents}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-field{flex:1 1 calc(50% - 4px);min-width:0;order:1}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-branch-search-wrap{flex:1 1 0;min-width:0;order:2}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-btn{flex:0 0 auto;order:3;padding:0 10px;white-space:nowrap}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-error{flex-basis:100%;order:4}}@media (max-width: 480px) and (max-width: 400px){.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-btn{padding:0 12px}.s-bullet-delivery-modal .s-bullet-delivery-pickup-filters .s-bullet-delivery-location-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}}@media (max-width: 480px){.s-bullet-delivery-modal .s-bullet-delivery-branch-meta-row{display:contents}.s-bullet-delivery-modal .s-bullet-delivery-branch-pills,.s-bullet-delivery-modal .s-bullet-delivery-branch-divider,.s-bullet-delivery-modal .s-bullet-delivery-branch-open-status{grid-column:2/-1;min-width:0}.s-bullet-delivery-modal .s-bullet-delivery-branch-pills{display:flex;flex-wrap:wrap;gap:8px;order:1;margin-top:6px}.s-bullet-delivery-modal .s-bullet-delivery-branch-divider{order:2}.s-bullet-delivery-modal .s-bullet-delivery-branch-instructions{order:3}.s-bullet-delivery-modal .s-bullet-delivery-branch-open-status{order:4}.s-bullet-delivery-modal .s-bullet-delivery-branch-schedule{order:5}.s-bullet-delivery-modal .s-bullet-delivery-branch-location .s-bullet-delivery-branch-meta-icon{display:none}.s-bullet-delivery-modal .s-bullet-delivery-branch-pill{padding:4px 10px;border:1px solid var(--color-border, #eee);border-radius:999px;font-size:12px;line-height:1.4}.s-bullet-delivery-modal .s-bullet-delivery-branch-pill .s-bullet-delivery-branch-meta-label{display:none}.s-bullet-delivery-modal .s-bullet-delivery-branch-pill .s-bullet-delivery-branch-meta-value{color:inherit;font-weight:400}.s-bullet-delivery-modal .s-bullet-delivery-branch-divider{display:block;width:100%;height:0;margin:10px 0;border:0;border-top:1px solid #e0e0e0;opacity:1}.s-bullet-delivery-modal .s-bullet-delivery-branch-action,.s-bullet-delivery-modal .s-bullet-delivery-branch-action:hover{border-color:transparent}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.inline{display:inline}.inline-flex{display:inline-flex}.shrink{flex-shrink:1}.resize{resize:both}.\\!text-blue-600{--tw-text-opacity:1 !important;color:rgb(37 99 235 / var(--tw-text-opacity, 1)) !important}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-hidden{display:none}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.\\!btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.\\!btn:hover{opacity:0.8}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.spinner-loader.reverse{border-right-color:#9f7171 !important;background-color:#f98181}.s-hidden{display:none}.s-scrollbar::-webkit-scrollbar{width:5px}.s-scrollbar::-webkit-scrollbar-track{background-color:#eee}.s-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body{padding:0px}@media (min-width: 768px){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body{max-height:70dvh;overflow-y:auto}}@media (min-width: 640px){.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body:has(.s-searchable-dropdown--open){overflow:visible !important}}.s-bullet-delivery-inner{min-block-size:0}.s-bullet-delivery-header{margin-bottom:1.5rem;text-align:start}.s-bullet-delivery-title{display:block;font-size:1.25rem;line-height:1.75rem;font-weight:700;color:var(--color-primary-dark)}.s-bullet-delivery-subtitle{margin-top:0.25rem;display:block;font-size:0.875rem;line-height:1.25rem;color:var(--color-primary-dark)}.s-bullet-delivery-tabs{margin-bottom:1.5rem;display:flex;gap:0.5rem}.s-bullet-delivery-tab{display:flex;flex:1 1 0%;cursor:pointer;align-items:center;gap:1rem;border-radius:0.5rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.75rem;padding-right:0.75rem;font-size:0.875rem;line-height:1.25rem;font-weight:500;color:var(--color-primary-dark);transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-bullet-delivery-tab:hover{background-color:color-mix(in srgb,var(--color-primary) 5%,transparent)}.s-bullet-delivery-tab--active{border-color:var(--color-primary-dark)}.s-bullet-delivery-tab svg{height:0.875rem;width:0.875rem;color:var(--color-primary-dark)}.s-bullet-delivery-tab-icon{display:flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:0.75rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-allocation-out-of-coverage{margin-bottom:1rem;display:flex;width:100%;align-items:center;gap:0.5rem;--tw-bg-opacity:1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1));padding-top:0.75rem;padding-bottom:0.75rem;padding-left:1rem;padding-right:1rem;text-align:end;--tw-text-opacity:1;color:rgb(127 29 29 / var(--tw-text-opacity, 1))}.s-bullet-delivery-allocation-out-of-coverage:where([dir=\"ltr\"],[dir=\"ltr\"] *){border-left-width:4px;border-left-color:rgb(239 68 68 / 0.5)}.s-bullet-delivery-allocation-out-of-coverage:where([dir=\"rtl\"],[dir=\"rtl\"] *){border-right-width:4px;border-right-color:rgb(239 68 68 / 0.5)}.s-bullet-delivery-allocation-out-of-coverage-text{font-size:0.875rem;line-height:1.25rem;line-height:1.4}.s-bullet-delivery-allocation-out-of-coverage-icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;--tw-text-opacity:1;color:rgb(127 29 29 / var(--tw-text-opacity, 1))}.s-bullet-delivery-content{margin-bottom:1.5rem;display:grid;gap:1rem}.s-bullet-delivery-content--active{animation:s-bullet-delivery-fade-in 220ms ease-out}.s-bullet-delivery-label{margin-bottom:0.5rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-bullet-delivery-error{margin-top:0.25rem;display:block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-bullet-delivery-footer{display:grid;gap:0.75rem;text-align:center}.s-bullet-delivery-placeholder{margin-top:1rem;margin-bottom:1rem}.s-bullet-delivery-placeholder.s-placeholder-wrapper{margin-top:1rem !important;margin-bottom:1rem !important}.s-bullet-delivery-label-content{display:inline-flex;align-items:center;gap:0.5rem}.s-bullet-delivery-select-loader{display:inline-flex;align-items:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-bullet-delivery-search-row{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:0.5rem;padding-left:1px;padding-right:1px}.s-bullet-delivery-search-row .s-bullet-delivery-search{min-width:0px;flex:1 1 0%}.s-bullet-delivery-search-row .s-bullet-delivery-location-btn{width:auto;flex-shrink:0}.s-bullet-delivery-field-row{margin-bottom:1rem;display:flex;gap:1rem}.s-bullet-delivery-field-row .s-bullet-delivery-field{margin-bottom:0px;flex:1 1 0%}.s-bullet-delivery-saved-addresses-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.s-bullet-delivery-saved-addresses-empty-icon{margin-bottom:0.75rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-bullet-delivery-saved-addresses-empty-icon svg{height:2rem;width:2rem}.s-bullet-delivery-saved-addresses-empty-title{margin-bottom:0.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-bullet-delivery-saved-addresses-empty-desc{margin-bottom:1.5rem;max-width:24rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-addresses-list{position:relative;display:flex;max-height:260px;flex-direction:column;overflow-y:auto;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 768px){.s-bullet-delivery-addresses-list{max-height:220px}}.s-bullet-delivery-address-item{display:flex;cursor:pointer;flex-direction:row;align-items:center;gap:0.75rem;border-bottom-width:1px;--tw-border-opacity:1;border-bottom-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.875rem;padding-bottom:0.875rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-address-item:not(.s-bullet-delivery-address-item--disabled):hover{background-color:rgb(249 250 251 / 0.5)}.s-bullet-delivery-address-item--selected{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-address-item--disabled{cursor:not-allowed;opacity:0.6}.s-bullet-delivery-address-item--skeleton{display:flex;cursor:default;align-items:center;gap:0.75rem;border-radius:0.75rem;border-width:1px;border-bottom-width:0px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:1rem}.s-bullet-delivery-address-item--skeleton .s-bullet-delivery-address-lines{gap:0.5rem}.s-bullet-delivery-address-content{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;justify-content:center;text-align:start}.s-bullet-delivery-address-lines{display:flex;flex-direction:column;gap:0.125rem}.s-bullet-delivery-address-line1{display:block;font-size:1rem;line-height:1.5rem;font-weight:400;line-height:1.375;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-bullet-delivery-address-line2{display:block;font-size:0.875rem;line-height:1.25rem;line-height:1.375;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-bullet-delivery-address-map-icon{display:grid;height:2.5rem;width:2.5rem;place-content:center}.s-bullet-delivery-address-map-icon svg{height:100%;width:100%}.s-bullet-delivery-skel-radio{flex-shrink:0;border-radius:9999px}.s-bullet-delivery-skel-map{flex-shrink:0;border-radius:0.75rem}.s-bullet-delivery-search{position:relative;flex:1 1 0%}.s-bullet-delivery-search-icon{pointer-events:none;position:absolute;top:0px;bottom:0px;left:0px;display:flex;align-items:center;padding-left:0.75rem}.s-bullet-delivery-search-icon:where([dir=\"rtl\"],[dir=\"rtl\"] *){left:auto;right:0px;padding-left:0px;padding-right:0.75rem}.s-bullet-delivery-search-icon svg{height:0.875rem;width:0.875rem;stroke:var(--color-primary)}.s-bullet-delivery-branch-search-wrap{display:flex;min-height:40px;min-width:0px;flex:1 1 0%;flex-direction:row;align-items:stretch;overflow:hidden;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-bullet-delivery-branch-search-wrap:focus-within{border-color:var(--color-primary-dark);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-color:var(--color-primary-dark)}.s-bullet-delivery-branch-search-icon{pointer-events:none;position:static;display:flex;flex-shrink:0;align-items:center;justify-content:center;padding-inline-start:0.5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-search-icon svg{height:1.25rem;width:1.25rem}.s-bullet-delivery-branch-search-input{min-height:40px;min-width:0px;flex:1 1 0%;border-radius:0px;border-style:none;background-color:transparent;padding-top:0.5rem;padding-bottom:0.5rem;padding-inline-end:0.75rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1));--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-bullet-delivery-branch-search-input::placeholder{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-search-input:focus{outline:2px solid transparent;outline-offset:2px;border:none;box-shadow:none;--tw-ring-shadow:none}.s-bullet-delivery-location-btn{display:flex;flex-shrink:0;cursor:pointer;align-items:center;justify-content:center;gap:0.5rem;border-radius:0.5rem;border-width:1px;padding-left:1rem;padding-right:1rem;padding-top:0.5rem;padding-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-location-btn:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-location-btn:disabled{cursor:not-allowed;opacity:0.5}.s-bullet-delivery-location-btn--full{min-height:40px}.s-bullet-delivery-location-btn--loading{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-location-icon{height:0.875rem;width:0.875rem;flex-shrink:0}.s-bullet-delivery-location-icon svg{height:100%;width:100%}.s-bullet-delivery-branches-wrap{overflow:hidden}.s-bullet-delivery-branches-list{position:relative;max-height:min(260px, 32svh);overflow-y:auto;border-radius:0.5rem;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}@media (min-width: 768px){.s-bullet-delivery-branches-list{max-height:220px}}.s-bullet-delivery-branches-loading{overflow:hidden;border-radius:0.5rem;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-branch-info{display:flex;max-width:6.25rem;flex-direction:column;gap:0.125rem}.s-bullet-delivery-branch-name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow-wrap:break-word;font-size:0.875rem;line-height:1.25rem;font-weight:500;line-height:1.375;--tw-text-opacity:1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-prep{text-align:start;font-size:0.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-time{font-size:0.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-bullet-delivery-branch-time:where([dir=\"ltr\"],[dir=\"ltr\"] *){text-align:end}.s-bullet-delivery-branch-time:where([dir=\"rtl\"],[dir=\"rtl\"] *){text-align:start}.s-bullet-delivery-branch-map-link{display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:0.5rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));text-decoration-line:none;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-branch-map-link:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-branch-item>.s-bullet-delivery-branch-map-link{position:relative;z-index:10;pointer-events:auto}.s-bullet-delivery-branch-map-link-icon{display:flex;height:0.875rem;width:0.875rem;align-items:center;justify-content:center}.s-bullet-delivery-branch-map-link-icon svg{height:100%;width:100%}.s-bullet-delivery-branch-skeleton-title{max-width:100%}.s-bullet-delivery-branch-skeleton-time{justify-self:end}.s-bullet-delivery-branch-item{display:grid;min-width:0px;cursor:pointer;align-items:center;gap:0.5rem;border-bottom-width:1px;--tw-border-opacity:1;border-bottom-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;text-align:end;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;grid-template-columns:auto auto auto 1fr auto}.s-bullet-delivery-branch-item:last-child{border-bottom-width:0px}.s-bullet-delivery-branch-item:hover:not(.s-bullet-delivery-branch-item--disabled){--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-bullet-delivery-branch-item--selected{background-color:color-mix(in srgb,var(--color-primary) 5%,transparent)}.s-bullet-delivery-branch-item--disabled{cursor:not-allowed;opacity:0.5}.s-bullet-delivery-branch-icon{display:grid;place-content:center;border-radius:0.75rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));stroke:var(--color-primary-dark);padding:0.625rem;color:var(--color-primary-dark)}.s-bullet-delivery-branch-icon span{display:block;height:0.875rem;width:0.875rem}.s-bullet-delivery-branch-icon span svg{height:100%;width:100%}.s-bullet-delivery-branch-skeleton{display:grid;min-width:0px;align-items:center;gap:0.5rem;border-bottom-width:1px;--tw-border-opacity:1;border-bottom-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;grid-template-columns:auto auto auto 1fr auto}.s-bullet-delivery-branch-skeleton:last-child{border-bottom-width:0px}.s-bullet-delivery-branch-skeleton-radio{flex-shrink:0}.s-bullet-delivery-branch-skeleton-icon{flex-shrink:0;border-radius:0.75rem}.s-bullet-delivery-branch-skeleton-icon salla-skeleton{display:block}.s-bullet-delivery-branch-skeleton-map{flex-shrink:0;border-radius:0.75rem}.s-bullet-delivery-branch-skeleton-map salla-skeleton{display:block}.s-bullet-delivery-branch-skeleton-content{display:flex;min-width:0px;flex-direction:column;gap:0.5rem;overflow:hidden}.s-bullet-delivery-branch-skeleton-content salla-skeleton{min-width:0px;max-width:100%}.s-bullet-delivery-radio{margin-top:2px;height:1rem;width:1rem;flex-shrink:0;cursor:pointer;appearance:none;border-radius:9999px;border-width:2px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-bullet-delivery-radio:checked{border-color:var(--color-primary-dark);background:radial-gradient(circle,#fff 0,#fff 22%,var(--color-primary) 22%)}.s-bullet-delivery-radio:focus{outline:2px solid transparent;outline-offset:2px}.s-bullet-delivery-radio:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-color:var(--color-primary-dark);--tw-ring-offset-width:2px}.s-bullet-delivery-skeleton{box-sizing:border-box;min-width:0px;max-width:100%;overflow:hidden;padding:1.25rem}.s-bullet-delivery-skeleton salla-skeleton{min-width:0px;max-width:100%}.s-bullet-delivery-skeleton-header{margin-bottom:1.5rem;display:flex;min-width:0px;max-width:100%;flex-direction:column;align-items:flex-start;gap:0.75rem}.s-bullet-delivery-skeleton-title{display:block;max-width:100%}.s-bullet-delivery-skeleton-subtitle{display:block;max-width:100%}.s-bullet-delivery-skeleton-tabs{margin-bottom:1.5rem;display:grid;min-width:0px;max-width:100%;grid-template-columns:repeat(2, minmax(0, 1fr));gap:0.5rem}.s-bullet-delivery-skeleton-tabs--single{grid-template-columns:repeat(1, minmax(0, 1fr))}.s-bullet-delivery-skeleton-tab{display:flex;align-items:center;gap:1rem;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-bullet-delivery-skeleton-tab-icon{display:block;max-width:100%}.s-bullet-delivery-skeleton-tab-label{display:block;max-width:100%}.s-bullet-delivery-skeleton-field-label{display:block;max-width:100%}.s-bullet-delivery-skeleton-field-control{display:block;max-width:100%}.s-bullet-delivery-skeleton-content{margin-bottom:1.5rem;display:grid;min-width:0px;max-width:100%;gap:1rem}.s-bullet-delivery-skeleton-field{display:flex;min-width:0px;max-width:100%;flex-direction:column;align-items:flex-start;gap:0.5rem}.s-bullet-delivery-skeleton-footer{min-width:0px;max-width:100%}.s-bullet-delivery-add-address-header{margin-bottom:1.5rem;display:flex;align-items:center;justify-content:space-between;gap:0.75rem}.s-bullet-delivery-add-address-title{display:flex;width:100%;flex:1 1 0%;cursor:pointer;align-items:center;border-style:none;background-color:transparent;padding:0px;text-align:start;font-size:1.125rem;line-height:1.75rem;font-weight:700;color:var(--color-primary)}.s-bullet-delivery-add-address svg{height:2.5rem;width:2.5rem;fill:currentColor}.s-bullet-delivery-allocation-out-of-coverage-icon svg{height:1.25rem;width:1.25rem}.s-bullet-delivery-add-address-form{display:grid;gap:1rem}.s-bullet-delivery-add-address-submit{width:100%}.s-bullet-delivery-form-actions{display:flex;gap:0.75rem;border-top-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding-top:1rem}.s-bullet-delivery-form-actions salla-button{flex:1 1 0%}.s-bullet-delivery-form-actions--single{border-top-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-top:1.25rem}.s-bullet-delivery-form-actions--single salla-button{width:100%;flex:1 1 0%}.s-bullet-delivery-market-warning-overlay{position:fixed;inset:0px;z-index:60;display:flex;align-items:center;justify-content:center;background-color:rgb(0 0 0 / 0.5)}.s-bullet-delivery-market-warning{margin-left:1rem;margin-right:1rem;width:100%;max-width:24rem;border-radius:0.75rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1.5rem;--tw-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-bullet-delivery-market-warning-title{margin-bottom:0.75rem;font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-bullet-delivery-market-warning-message{margin-bottom:1.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-bullet-delivery-market-warning-actions{display:flex;gap:0.75rem}.s-bullet-delivery-market-warning-actions salla-button{flex:1 1 0%}.s-bullet-delivery-cart-view{margin-bottom:1rem;display:flex;align-items:center;justify-content:space-between;gap:1rem;border-radius:0.75rem;border-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1rem}.s-bullet-delivery-cart-view-info{display:flex;min-width:0px;flex:1 1 0%;align-items:center;gap:0.75rem}.s-bullet-delivery-cart-view-text{display:flex;flex-direction:column;text-align:start}.s-bullet-delivery-cart-view-title{font-size:1rem;line-height:1.5rem;font-weight:600;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-bullet-delivery-cart-view-subtitle{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));margin-block-start:0.125rem}.s-bullet-delivery-cart-view-icon{display:flex;height:3.5rem;width:3.5rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:1rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));color:var(--color-primary-dark)}.s-bullet-delivery-cart-view-icon svg{height:1.25rem;width:1.25rem;stroke:currentColor}.s-bullet-delivery-cart-view-button{flex-shrink:0;align-self:center}.s-bullet-delivery-location-permission-btn{display:flex;width:100%;cursor:pointer;align-items:center;gap:0.625rem;border-radius:0.5rem;border-width:0px;padding:0.75rem;text-align:start;background:#fdf2f2}.s-bullet-delivery-location-permission-icon{display:inline-flex;height:34px;width:34px;flex-shrink:0}.s-bullet-delivery-location-permission-icon svg{height:100%;width:100%}.s-bullet-delivery-location-permission-text{min-width:0px;flex:1 1 0%;font-size:0.75rem;line-height:1rem;line-height:18px;--tw-text-opacity:1;color:rgb(68 68 68 / var(--tw-text-opacity, 1))}.s-bullet-delivery-location-permission-arrow{flex-shrink:0;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(102 102 102 / var(--tw-text-opacity, 1))}.s-bullet-delivery-location-distance-warning{display:flex;width:100%;animation:s-bullet-delivery-fade-in 200ms ease;align-items:center;gap:0.625rem;border-radius:0.5rem;padding:0.75rem;background:#fff8e1}.s-bullet-delivery-location-distance-warning-icon{display:inline-flex;height:34px;width:34px;flex-shrink:0}.s-bullet-delivery-location-distance-warning-icon svg{height:100%;width:100%}.s-bullet-delivery-location-distance-warning-text{min-width:0px;flex:1 1 0%;font-size:0.75rem;line-height:1rem;line-height:18px;--tw-text-opacity:1;color:rgb(68 68 68 / var(--tw-text-opacity, 1))}";
|
|
216
304
|
|
|
217
305
|
const BRANCH_SEARCH_DEBOUNCE_MS = 1000;
|
|
306
|
+
/** Shorter queries are filtered locally; the branches API ignores them. */
|
|
307
|
+
const BRANCH_SEARCH_MIN_LENGTH = 2;
|
|
218
308
|
const GEOLOCATION_TIMEOUT = 10000;
|
|
309
|
+
/** GeolocationPositionError.PERMISSION_DENIED — inlined; the class is absent on the server. */
|
|
310
|
+
const GEO_PERMISSION_DENIED = 1;
|
|
311
|
+
/** Silent read for branch distances: a short wait, and a recent cached fix is good enough. */
|
|
312
|
+
const SILENT_GEOLOCATION_TIMEOUT = 5000;
|
|
313
|
+
const SILENT_GEOLOCATION_MAX_AGE = 10 * 60 * 1000;
|
|
314
|
+
/** Longest the branch list waits for that read; a later fix still serves the next list request. */
|
|
315
|
+
const BRANCH_LIST_LOCATION_WAIT = 1500;
|
|
316
|
+
/** Matches the `per_page` default of `bulletDeliveryAPI.getBranches`. */
|
|
317
|
+
const BRANCH_PAGE_SIZE = 20;
|
|
219
318
|
/** Final fallback center used only if `user.default_geo_location` is absent (Riyadh — matches checkout map-page). */
|
|
220
319
|
const DEFAULT_MAP_CENTER = { lat: 24.7756042, lng: 46.7360729 };
|
|
221
320
|
const DEBUG_KEY = 'salla-bullet-delivery-debug';
|
|
@@ -235,6 +334,8 @@ const SallaBulletDelivery = class {
|
|
|
235
334
|
this.pendingCartSubmitResolver = null;
|
|
236
335
|
this.pendingCartSubmitPromise = null;
|
|
237
336
|
this.cartSubmitConfirmationPending = false;
|
|
337
|
+
/** Query the current branch list was searched with server-side; its results are not re-filtered locally. */
|
|
338
|
+
this.branchesServerQuery = '';
|
|
238
339
|
this.branchSearchDebounceTimer = null;
|
|
239
340
|
this.countrySearchTimer = null;
|
|
240
341
|
this.regionSearchTimer = null;
|
|
@@ -266,6 +367,13 @@ const SallaBulletDelivery = class {
|
|
|
266
367
|
this.open();
|
|
267
368
|
};
|
|
268
369
|
this.closeHandler = null;
|
|
370
|
+
this.selectorTracker = new SelectorTracker();
|
|
371
|
+
this.openTrigger = "customer_requested";
|
|
372
|
+
this.pendingDismissReason = null;
|
|
373
|
+
this.modalCloseHandler = (detail) => {
|
|
374
|
+
this.pendingDismissReason = toCloseReason(detail?.reason);
|
|
375
|
+
queueMicrotask(() => (this.pendingDismissReason = null));
|
|
376
|
+
};
|
|
269
377
|
this.bulletDeliveryMobileSelectHandler = null;
|
|
270
378
|
/** True after saved addresses have been loaded (lazy: only when address tab is shown). */
|
|
271
379
|
this.savedAddressesLoaded = false;
|
|
@@ -275,6 +383,8 @@ const SallaBulletDelivery = class {
|
|
|
275
383
|
/** Identifies the latest reverse-geocode call so a resolved-but-superseded callback (same
|
|
276
384
|
* coordinates re-picked, or the map left) can be told apart from the current one. */
|
|
277
385
|
this.geocodeRequestId = 0;
|
|
386
|
+
/** Identifies the latest pickup-offer fetch so one from an earlier modal open is dropped. */
|
|
387
|
+
this.pickupDiscountRequestId = 0;
|
|
278
388
|
// Core state
|
|
279
389
|
this.activeTab = "address";
|
|
280
390
|
this.isLoggedIn = false;
|
|
@@ -297,9 +407,27 @@ const SallaBulletDelivery = class {
|
|
|
297
407
|
this.selectedSessionAddress = false;
|
|
298
408
|
// Pickup state
|
|
299
409
|
this.branches = [];
|
|
410
|
+
/** Pickup offer range across the store's branches (INV-1416); null shows the default tab badge. */
|
|
411
|
+
this.pickupDiscountRange = null;
|
|
412
|
+
/** False until the offer lookup settles, so the tab never flashes the default badge before an offer. */
|
|
413
|
+
this.pickupDiscountResolved = false;
|
|
300
414
|
this.filteredBranches = [];
|
|
301
415
|
this.selectedBranch = null;
|
|
302
416
|
this.branchSearchQuery = "";
|
|
417
|
+
/** Cities that have branches in the selected country (from the unfiltered branch list). */
|
|
418
|
+
this.branchCities = [];
|
|
419
|
+
this.selectedBranchCity = null;
|
|
420
|
+
this.branchCitySearchQuery = '';
|
|
421
|
+
/** Branch whose weekly hours are expanded behind the chevron (one at a time). */
|
|
422
|
+
this.expandedScheduleBranchId = null;
|
|
423
|
+
/** Shopper's device location for branch distances (see getGrantedDeviceLocation). */
|
|
424
|
+
this.shopperLocation = null;
|
|
425
|
+
this.shopperLocationRequestId = 0;
|
|
426
|
+
this.nearestBranchRequestId = 0;
|
|
427
|
+
/** Bumped per branch-list request; overlapping city/search loads only apply the latest one. */
|
|
428
|
+
this.branchesRequestId = 0;
|
|
429
|
+
/** Shared country rows and city options expire with the API cache. */
|
|
430
|
+
this.allBranchCities = null;
|
|
303
431
|
// Loading states
|
|
304
432
|
this.loadingCountries = false;
|
|
305
433
|
this.loadingCities = false;
|
|
@@ -418,6 +546,13 @@ const SallaBulletDelivery = class {
|
|
|
418
546
|
this.displayedDistricts = this.districts;
|
|
419
547
|
this.searchingDistricts = false;
|
|
420
548
|
};
|
|
549
|
+
this.handleBranchCitySelected = (item) => {
|
|
550
|
+
this.selectedBranchCity = item && item.id !== -1
|
|
551
|
+
? (this.branchCities.find((c) => String(c.id) === String(item.id)) ?? item)
|
|
552
|
+
: null;
|
|
553
|
+
this.selectedBranch = null;
|
|
554
|
+
void this.loadBranches();
|
|
555
|
+
};
|
|
421
556
|
this.handleMapLocationChanged = (event) => {
|
|
422
557
|
const detail = event.detail;
|
|
423
558
|
if (!detail?.position?.lat || !detail?.position?.lng)
|
|
@@ -532,6 +667,7 @@ const SallaBulletDelivery = class {
|
|
|
532
667
|
const details = this.buildIntentAddress();
|
|
533
668
|
if (!details)
|
|
534
669
|
return;
|
|
670
|
+
const previousIntent = this.getStoredIntent();
|
|
535
671
|
this.setStoredIntent({
|
|
536
672
|
type: "address",
|
|
537
673
|
country_id: Number(this.selectedCountry?.id) || 0,
|
|
@@ -540,7 +676,7 @@ const SallaBulletDelivery = class {
|
|
|
540
676
|
});
|
|
541
677
|
this.selectedSavedAddress = null;
|
|
542
678
|
this.selectedSessionAddress = true;
|
|
543
|
-
await this.handleConfirm();
|
|
679
|
+
await this.handleConfirm(previousIntent);
|
|
544
680
|
};
|
|
545
681
|
this.handleCountrySelected = (item) => {
|
|
546
682
|
const country = this.countries.find(c => String(c.id) === String(item.id)) || item;
|
|
@@ -625,9 +761,10 @@ const SallaBulletDelivery = class {
|
|
|
625
761
|
* successful auto-confirm never flashes the saved-addresses list; the caller is
|
|
626
762
|
* responsible for revealing the modal itself if it still needs the customer's input.
|
|
627
763
|
*/
|
|
628
|
-
async open(silent = false) {
|
|
764
|
+
async open(silent = false, trigger = "customer_requested") {
|
|
629
765
|
if (!this.isEnabled)
|
|
630
766
|
return; // feature disabled — never open
|
|
767
|
+
this.openTrigger = trigger;
|
|
631
768
|
// If mobile app, open the sheet
|
|
632
769
|
if (this.isMobileApp) {
|
|
633
770
|
Salla.event.dispatch('salla::bullet-delivery.open-sheet');
|
|
@@ -640,6 +777,7 @@ const SallaBulletDelivery = class {
|
|
|
640
777
|
}
|
|
641
778
|
// Reset state before opening
|
|
642
779
|
this.resetState();
|
|
780
|
+
void this.loadPickupDiscountRange();
|
|
643
781
|
if (!silent) {
|
|
644
782
|
// Open modal immediately — fields render right away with inline loading
|
|
645
783
|
this.modal.open();
|
|
@@ -691,20 +829,18 @@ const SallaBulletDelivery = class {
|
|
|
691
829
|
}
|
|
692
830
|
}
|
|
693
831
|
// Load branches only when branch tab is active (lazy tab data)
|
|
694
|
-
// Use lat/lng from session storage if available for more accurate results
|
|
695
832
|
if (this.activeTab === "branch") {
|
|
696
|
-
const
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
else {
|
|
702
|
-
await this.loadBranches();
|
|
703
|
-
}
|
|
833
|
+
const loading = this.loadBranches();
|
|
834
|
+
const request = this.branchesRequestId;
|
|
835
|
+
await loading;
|
|
836
|
+
if (request !== this.branchesRequestId || this.activeTab !== 'branch' || this.branchSearchQuery.trim())
|
|
837
|
+
return;
|
|
704
838
|
// Auto-select preselected branch if provided
|
|
705
839
|
if (this.preselectedBranchId) {
|
|
706
|
-
this.preselectBranch(this.preselectedBranchId);
|
|
840
|
+
await this.preselectBranch(this.preselectedBranchId);
|
|
707
841
|
}
|
|
842
|
+
if (request !== this.branchesRequestId || this.activeTab !== 'branch' || this.branchSearchQuery.trim())
|
|
843
|
+
return;
|
|
708
844
|
}
|
|
709
845
|
// Prefill form data from session storage
|
|
710
846
|
await this.prefillFromSessionStorage();
|
|
@@ -729,7 +865,45 @@ const SallaBulletDelivery = class {
|
|
|
729
865
|
this.bulletDeliveryClosed.emit();
|
|
730
866
|
return this.modal?.close();
|
|
731
867
|
}
|
|
868
|
+
selectorContext() {
|
|
869
|
+
return {
|
|
870
|
+
configured_required: this.isRequired,
|
|
871
|
+
effective_nonclosable: this.isRequired || this.shouldForceNonClosable(),
|
|
872
|
+
trigger_configured: this.openingType ?? null,
|
|
873
|
+
trigger_actual: this.openTrigger,
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
handleModalVisibility(visible) {
|
|
877
|
+
if (visible) {
|
|
878
|
+
this.selectorTracker.viewed(this.selectorContext());
|
|
879
|
+
return;
|
|
880
|
+
}
|
|
881
|
+
if (!this.pendingDismissReason)
|
|
882
|
+
return;
|
|
883
|
+
this.selectorTracker.dismissed(this.selectorContext(), this.pendingDismissReason, !!this.getStoredIntent()?.scope_allocated);
|
|
884
|
+
this.pendingDismissReason = null;
|
|
885
|
+
}
|
|
886
|
+
trackSelectorResult(outcome, previousIntent, newBranchIds, scopeId) {
|
|
887
|
+
this.selectorTracker.result(this.selectorContext(), {
|
|
888
|
+
outcome,
|
|
889
|
+
fulfilment_method: this.activeTab === "branch" ? "pickup" : "delivery",
|
|
890
|
+
previous_branch_ids: previousIntent?.scope_allocated ? allocatedBranchIds(previousIntent) : [],
|
|
891
|
+
new_branch_ids: newBranchIds,
|
|
892
|
+
scope_id: scopeId ?? null,
|
|
893
|
+
});
|
|
894
|
+
}
|
|
732
895
|
resetState() {
|
|
896
|
+
helpers.clearBranchCache();
|
|
897
|
+
this.allBranchCities = null;
|
|
898
|
+
this.pickupDiscountRequestId++;
|
|
899
|
+
if (this.branchSearchDebounceTimer)
|
|
900
|
+
clearTimeout(this.branchSearchDebounceTimer);
|
|
901
|
+
++this.branchesRequestId;
|
|
902
|
+
this.loadingBranches = false;
|
|
903
|
+
++this.shopperLocationRequestId;
|
|
904
|
+
++this.nearestBranchRequestId;
|
|
905
|
+
this.loadingNearestBranch = false;
|
|
906
|
+
this.shopperLocation = null;
|
|
733
907
|
this.viewMode = "main";
|
|
734
908
|
this.mapLocationData = null;
|
|
735
909
|
this.mapCountryCode = null;
|
|
@@ -746,11 +920,16 @@ const SallaBulletDelivery = class {
|
|
|
746
920
|
this.selectedSessionAddress = false;
|
|
747
921
|
this.selectedBranch = null;
|
|
748
922
|
this.branchSearchQuery = "";
|
|
923
|
+
this.branchCities = [];
|
|
924
|
+
this.selectedBranchCity = null;
|
|
925
|
+
this.expandedScheduleBranchId = null;
|
|
749
926
|
this.regions = [];
|
|
750
927
|
this.cities = [];
|
|
751
928
|
this.districts = [];
|
|
752
929
|
this.branches = [];
|
|
753
930
|
this.filteredBranches = [];
|
|
931
|
+
this.pickupDiscountRange = null;
|
|
932
|
+
this.pickupDiscountResolved = false;
|
|
754
933
|
this.newAddressForm = { ...SallaBulletDelivery.INITIAL_ADDRESS_FORM };
|
|
755
934
|
this.showCartWillBeClearedBanner = false;
|
|
756
935
|
this.allocationOutOfCoverageMessage = null;
|
|
@@ -868,7 +1047,7 @@ const SallaBulletDelivery = class {
|
|
|
868
1047
|
if (!wasVisible) {
|
|
869
1048
|
// Load silently — a successful auto-confirm should never flash the
|
|
870
1049
|
// saved-addresses list; only reveal the modal below if it can't finish on its own.
|
|
871
|
-
await this.open(true);
|
|
1050
|
+
await this.open(true, "after_login");
|
|
872
1051
|
}
|
|
873
1052
|
// open() -> loadSavedAddresses() already sets selectedSessionAddress when a
|
|
874
1053
|
// session intent exists; bail if that didn't happen (e.g. address_id already set).
|
|
@@ -1154,16 +1333,63 @@ const SallaBulletDelivery = class {
|
|
|
1154
1333
|
});
|
|
1155
1334
|
}
|
|
1156
1335
|
async loadBranches() {
|
|
1336
|
+
const request = ++this.branchesRequestId;
|
|
1337
|
+
// A city change keeps the active search, so the server filters before picking the first page.
|
|
1338
|
+
const query = this.branchSearchQuery.trim();
|
|
1157
1339
|
this.loadingBranches = true;
|
|
1158
1340
|
try {
|
|
1159
|
-
|
|
1341
|
+
const branches = await helpers.bulletDeliveryAPI.getBranches({
|
|
1160
1342
|
country_id: this.selectedCountry?.id,
|
|
1161
|
-
|
|
1343
|
+
city_id: this.selectedBranchCity?.id,
|
|
1344
|
+
query,
|
|
1345
|
+
...(await this.getListLocation()),
|
|
1346
|
+
});
|
|
1347
|
+
if (request !== this.branchesRequestId)
|
|
1348
|
+
return;
|
|
1349
|
+
this.branchesServerQuery = query.length >= BRANCH_SEARCH_MIN_LENGTH ? query : '';
|
|
1350
|
+
this.applyLoadedBranches(branches);
|
|
1351
|
+
// Search results hold only the matching branches, which would shrink the city options.
|
|
1352
|
+
if (query.length < BRANCH_SEARCH_MIN_LENGTH)
|
|
1353
|
+
void this.refreshBranchCities();
|
|
1162
1354
|
}
|
|
1163
1355
|
finally {
|
|
1164
|
-
this.
|
|
1356
|
+
if (request === this.branchesRequestId)
|
|
1357
|
+
this.loadingBranches = false;
|
|
1165
1358
|
}
|
|
1166
1359
|
}
|
|
1360
|
+
/** Reuse the country's city collection while keeping visible choices usable during loading. */
|
|
1361
|
+
refreshBranchCities() {
|
|
1362
|
+
if (!this.selectedBranchCity)
|
|
1363
|
+
this.branchCities = helpers.getBranchCities(this.branches);
|
|
1364
|
+
const countryId = this.selectedCountry?.id;
|
|
1365
|
+
if (!this.allBranchCities || this.allBranchCities.countryId !== countryId || Date.now() - this.allBranchCities.timestamp > helpers.CACHE_TTL) {
|
|
1366
|
+
const branches = helpers.bulletDeliveryAPI.getAllBranches(countryId, BRANCH_PAGE_SIZE);
|
|
1367
|
+
this.allBranchCities = {
|
|
1368
|
+
countryId,
|
|
1369
|
+
timestamp: Date.now(),
|
|
1370
|
+
branches,
|
|
1371
|
+
cities: branches.then((all) => helpers.getBranchCities(all)),
|
|
1372
|
+
};
|
|
1373
|
+
}
|
|
1374
|
+
const pending = this.allBranchCities;
|
|
1375
|
+
return pending.cities.then((cities) => {
|
|
1376
|
+
if (this.allBranchCities !== pending || this.selectedCountry?.id !== countryId)
|
|
1377
|
+
return;
|
|
1378
|
+
if (!cities.length) {
|
|
1379
|
+
this.allBranchCities = null;
|
|
1380
|
+
return;
|
|
1381
|
+
}
|
|
1382
|
+
this.branchCities = cities;
|
|
1383
|
+
}).catch((error) => {
|
|
1384
|
+
if (this.allBranchCities === pending) {
|
|
1385
|
+
this.allBranchCities = null;
|
|
1386
|
+
if (this.selectedCountry?.id === countryId && Array.isArray(error?.branches)) {
|
|
1387
|
+
this.branchCities = helpers.getBranchCities([...this.branches, ...error.branches]);
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
console.error('[BulletDelivery] Error fetching branch cities', error);
|
|
1391
|
+
});
|
|
1392
|
+
}
|
|
1167
1393
|
/**
|
|
1168
1394
|
* Store a freshly fetched branch list and reconcile the current selection with it.
|
|
1169
1395
|
* `selectedBranch` is a snapshot from selection time: when the refreshed list carries the
|
|
@@ -1180,8 +1406,33 @@ const SallaBulletDelivery = class {
|
|
|
1180
1406
|
}
|
|
1181
1407
|
this.filterBranches();
|
|
1182
1408
|
}
|
|
1409
|
+
/** Shares a fresh branch collection with the picker on each modal open. */
|
|
1410
|
+
async loadPickupDiscountRange() {
|
|
1411
|
+
if (!this.supportsPickup)
|
|
1412
|
+
return;
|
|
1413
|
+
const requestId = ++this.pickupDiscountRequestId;
|
|
1414
|
+
const { branches, complete } = await helpers.bulletDeliveryAPI.getBranchCollection(undefined, 60, { requireComplete: true });
|
|
1415
|
+
if (requestId !== this.pickupDiscountRequestId)
|
|
1416
|
+
return;
|
|
1417
|
+
this.pickupDiscountRange = complete ? helpers.getBranchDiscountRange(branches) : null;
|
|
1418
|
+
this.pickupDiscountResolved = true;
|
|
1419
|
+
}
|
|
1420
|
+
/**
|
|
1421
|
+
* ar: "خصم 25%" / "خصم 5 – 25%" / "خصم 10 ر.س"; en: "25% discount" / "5 – 25% discount" / "10 SAR discount".
|
|
1422
|
+
* Money may carry the riyal-symbol SVG, so it renders as HTML.
|
|
1423
|
+
*/
|
|
1424
|
+
getPickupDiscountLabel(type, min, max = min) {
|
|
1425
|
+
const format = (amount) => type === 'percentage' ? String(Math.round(amount * 100) / 100) : salla.money(amount);
|
|
1426
|
+
const value = min === max ? format(min) : `${format(min)} – ${format(max)}`;
|
|
1427
|
+
const amount = type === 'percentage' ? `${value}%` : `${value} `;
|
|
1428
|
+
const fallback = this.isArabic ? `خصم ${amount}` : ` ${amount} discount`;
|
|
1429
|
+
return Salla.lang.getWithDefault('pages.checkout.pickup_discount', fallback, { amount });
|
|
1430
|
+
}
|
|
1183
1431
|
filterBranches() {
|
|
1184
|
-
|
|
1432
|
+
const query = this.branchSearchQuery.trim();
|
|
1433
|
+
this.filteredBranches = query && query === this.branchesServerQuery
|
|
1434
|
+
? this.branches
|
|
1435
|
+
: helpers.filterBranches(this.branches, query);
|
|
1185
1436
|
}
|
|
1186
1437
|
/**
|
|
1187
1438
|
* Prefill form fields from session storage
|
|
@@ -1206,7 +1457,7 @@ const SallaBulletDelivery = class {
|
|
|
1206
1457
|
if (country) {
|
|
1207
1458
|
this.selectedCountry = country;
|
|
1208
1459
|
this.updateNewAddressForm({ country_id: Number(country.id) });
|
|
1209
|
-
this.preselectBranch(helpers.getIntentBranchId(intent));
|
|
1460
|
+
await this.preselectBranch(helpers.getIntentBranchId(intent));
|
|
1210
1461
|
}
|
|
1211
1462
|
}
|
|
1212
1463
|
}
|
|
@@ -1245,7 +1496,16 @@ const SallaBulletDelivery = class {
|
|
|
1245
1496
|
}
|
|
1246
1497
|
}
|
|
1247
1498
|
applyCountryChange(newCountry) {
|
|
1499
|
+
++this.branchesRequestId;
|
|
1500
|
+
this.allBranchCities = null;
|
|
1501
|
+
this.loadingBranches = false;
|
|
1502
|
+
this.branches = [];
|
|
1503
|
+
this.filteredBranches = [];
|
|
1248
1504
|
this.selectedCountry = newCountry;
|
|
1505
|
+
this.selectedBranchCity = null;
|
|
1506
|
+
this.branchCities = [];
|
|
1507
|
+
this.branchCitySearchQuery = '';
|
|
1508
|
+
this.selectedBranch = null;
|
|
1249
1509
|
this.selectedRegion = null;
|
|
1250
1510
|
this.regions = [];
|
|
1251
1511
|
this.displayedRegions = [];
|
|
@@ -1365,19 +1625,11 @@ const SallaBulletDelivery = class {
|
|
|
1365
1625
|
void this.loadBranches();
|
|
1366
1626
|
return;
|
|
1367
1627
|
}
|
|
1368
|
-
this.branchSearchDebounceTimer = setTimeout(
|
|
1369
|
-
|
|
1628
|
+
this.branchSearchDebounceTimer = setTimeout(() => {
|
|
1629
|
+
// Below the minimum, only reload when the list still holds an earlier server search.
|
|
1630
|
+
if (query.trim().length < BRANCH_SEARCH_MIN_LENGTH && !this.branchesServerQuery)
|
|
1370
1631
|
return;
|
|
1371
|
-
this.
|
|
1372
|
-
try {
|
|
1373
|
-
this.applyLoadedBranches(await helpers.bulletDeliveryAPI.getBranches({
|
|
1374
|
-
country_id: this.selectedCountry?.id,
|
|
1375
|
-
query,
|
|
1376
|
-
}));
|
|
1377
|
-
}
|
|
1378
|
-
finally {
|
|
1379
|
-
this.loadingBranches = false;
|
|
1380
|
-
}
|
|
1632
|
+
void this.loadBranches();
|
|
1381
1633
|
}, BRANCH_SEARCH_DEBOUNCE_MS);
|
|
1382
1634
|
}
|
|
1383
1635
|
clearSearchTimers() {
|
|
@@ -1404,13 +1656,23 @@ const SallaBulletDelivery = class {
|
|
|
1404
1656
|
this.clearSearchTimers();
|
|
1405
1657
|
}
|
|
1406
1658
|
async loadBranchesWithLocation(lat, lng) {
|
|
1659
|
+
// Later list loads (city change, search) keep measuring from the device location.
|
|
1660
|
+
++this.shopperLocationRequestId;
|
|
1661
|
+
this.shopperLocation = { lat, lng };
|
|
1662
|
+
const request = ++this.branchesRequestId;
|
|
1407
1663
|
this.loadingBranches = true;
|
|
1408
1664
|
try {
|
|
1409
|
-
|
|
1665
|
+
const branches = await helpers.bulletDeliveryAPI.getBranches({
|
|
1410
1666
|
country_id: this.selectedCountry?.id,
|
|
1667
|
+
city_id: this.selectedBranchCity?.id,
|
|
1411
1668
|
lat,
|
|
1412
1669
|
lng,
|
|
1413
|
-
})
|
|
1670
|
+
});
|
|
1671
|
+
if (request !== this.branchesRequestId)
|
|
1672
|
+
return false;
|
|
1673
|
+
this.branchesServerQuery = '';
|
|
1674
|
+
this.applyLoadedBranches(branches);
|
|
1675
|
+
void this.refreshBranchCities();
|
|
1414
1676
|
// Auto-select country from first branch if no country is selected
|
|
1415
1677
|
if (!this.selectedCountry && this.branches.length > 0) {
|
|
1416
1678
|
const firstBranch = this.branches[0];
|
|
@@ -1424,9 +1686,11 @@ const SallaBulletDelivery = class {
|
|
|
1424
1686
|
}
|
|
1425
1687
|
}
|
|
1426
1688
|
}
|
|
1689
|
+
return true;
|
|
1427
1690
|
}
|
|
1428
1691
|
finally {
|
|
1429
|
-
this.
|
|
1692
|
+
if (request === this.branchesRequestId)
|
|
1693
|
+
this.loadingBranches = false;
|
|
1430
1694
|
}
|
|
1431
1695
|
}
|
|
1432
1696
|
/** Locate nearest branch using device geolocation (branches tab only). */
|
|
@@ -1435,6 +1699,7 @@ const SallaBulletDelivery = class {
|
|
|
1435
1699
|
this.locationError = Salla.lang.get("pages.checkout.current_location_not_supported");
|
|
1436
1700
|
return;
|
|
1437
1701
|
}
|
|
1702
|
+
const request = ++this.nearestBranchRequestId;
|
|
1438
1703
|
this.loadingNearestBranch = true;
|
|
1439
1704
|
this.locationError = "";
|
|
1440
1705
|
try {
|
|
@@ -1446,7 +1711,12 @@ const SallaBulletDelivery = class {
|
|
|
1446
1711
|
});
|
|
1447
1712
|
});
|
|
1448
1713
|
const { latitude, longitude } = position.coords;
|
|
1449
|
-
|
|
1714
|
+
if (request !== this.nearestBranchRequestId)
|
|
1715
|
+
return;
|
|
1716
|
+
if (!await this.loadBranchesWithLocation(latitude, longitude))
|
|
1717
|
+
return;
|
|
1718
|
+
if (request !== this.nearestBranchRequestId)
|
|
1719
|
+
return;
|
|
1450
1720
|
const nearestBranch = helpers.findNearestBranch(this.branches, latitude, longitude);
|
|
1451
1721
|
if (nearestBranch) {
|
|
1452
1722
|
this.selectedBranch = nearestBranch;
|
|
@@ -1455,26 +1725,56 @@ const SallaBulletDelivery = class {
|
|
|
1455
1725
|
}
|
|
1456
1726
|
}
|
|
1457
1727
|
catch (error) {
|
|
1728
|
+
if (request !== this.nearestBranchRequestId)
|
|
1729
|
+
return;
|
|
1458
1730
|
const geoError = error;
|
|
1459
1731
|
const code = typeof geoError?.code === "number" ? geoError.code : -1;
|
|
1460
|
-
this.locationError =
|
|
1732
|
+
this.locationError = this.geolocationErrorMessage(code);
|
|
1461
1733
|
}
|
|
1462
1734
|
finally {
|
|
1463
|
-
this.
|
|
1735
|
+
if (request === this.nearestBranchRequestId)
|
|
1736
|
+
this.loadingNearestBranch = false;
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
geolocationErrorMessage(code) {
|
|
1740
|
+
if (code === GEO_PERMISSION_DENIED) {
|
|
1741
|
+
return Salla.lang.getWithDefault("pages.checkout.allow_location_permission_blocked_hint", this.isArabic
|
|
1742
|
+
? "مشاركة الموقع محجوبة لهذا المتجر في متصفحك. افتح إعدادات الموقع في المتصفح، اسمح بالوصول إلى الموقع، ثم أعد المحاولة."
|
|
1743
|
+
: "Location sharing is blocked for this store in your browser. Open your browser's location settings, allow location access, then try again.");
|
|
1464
1744
|
}
|
|
1745
|
+
return Salla.lang.getWithDefault("pages.checkout.pickup_location_unavailable", this.isArabic ? "تعذَّر تحديد موقعك. حاول مرة أخرى." : "We couldn't detect your location. Try again.");
|
|
1465
1746
|
}
|
|
1466
1747
|
handleBranchSelect(branch) {
|
|
1467
1748
|
this.selectedBranch = branch;
|
|
1468
1749
|
this.allocationOutOfCoverageMessage = null;
|
|
1469
1750
|
}
|
|
1751
|
+
toggleBranchSchedule(branchId) {
|
|
1752
|
+
this.expandedScheduleBranchId = this.expandedScheduleBranchId === branchId ? null : branchId;
|
|
1753
|
+
}
|
|
1470
1754
|
/**
|
|
1471
1755
|
* Restore a remembered / event-provided branch — but only one the list renders as selectable,
|
|
1472
1756
|
* so a branch that has closed since it was remembered is never silently preselected (INV-1407).
|
|
1473
1757
|
*/
|
|
1474
|
-
preselectBranch(branchId) {
|
|
1475
|
-
if (branchId == null)
|
|
1758
|
+
async preselectBranch(branchId) {
|
|
1759
|
+
if (branchId == null || this.selectedBranch)
|
|
1476
1760
|
return;
|
|
1477
|
-
|
|
1761
|
+
let branch = this.branches.find((b) => b.id === branchId);
|
|
1762
|
+
if (!branch && this.allBranchCities) {
|
|
1763
|
+
const pending = this.allBranchCities;
|
|
1764
|
+
const request = this.branchesRequestId;
|
|
1765
|
+
try {
|
|
1766
|
+
branch = (await pending.branches).find((b) => b.id === branchId);
|
|
1767
|
+
}
|
|
1768
|
+
catch {
|
|
1769
|
+
return;
|
|
1770
|
+
}
|
|
1771
|
+
if (request !== this.branchesRequestId || this.activeTab !== 'branch' || this.allBranchCities !== pending || pending.countryId !== this.selectedCountry?.id || this.selectedBranch || this.branchSearchQuery.trim())
|
|
1772
|
+
return;
|
|
1773
|
+
if (this.selectedBranchCity && String(branch?.city?.id) !== String(this.selectedBranchCity.id))
|
|
1774
|
+
return;
|
|
1775
|
+
if (branch && helpers.isBranchSelectable(branch))
|
|
1776
|
+
this.applyLoadedBranches([...this.branches, branch]);
|
|
1777
|
+
}
|
|
1478
1778
|
if (branch && helpers.isBranchSelectable(branch)) {
|
|
1479
1779
|
this.selectedBranch = branch;
|
|
1480
1780
|
}
|
|
@@ -1735,6 +2035,48 @@ const SallaBulletDelivery = class {
|
|
|
1735
2035
|
}
|
|
1736
2036
|
/** Center shown before geolocation resolves — the customer's IP-based default (falls back to Riyadh). */
|
|
1737
2037
|
get mapInitialCenter() {
|
|
2038
|
+
return this.defaultGeoLocation ?? DEFAULT_MAP_CENTER;
|
|
2039
|
+
}
|
|
2040
|
+
/** Device location for a branch list request, waiting at most BRANCH_LIST_LOCATION_WAIT. */
|
|
2041
|
+
getListLocation() {
|
|
2042
|
+
const location = this.getGrantedDeviceLocation();
|
|
2043
|
+
if (this.shopperLocation || !navigator.geolocation || !navigator.permissions?.query)
|
|
2044
|
+
return location;
|
|
2045
|
+
return Promise.race([location, new Promise((resolve) => setTimeout(() => resolve({}), BRANCH_LIST_LOCATION_WAIT))]);
|
|
2046
|
+
}
|
|
2047
|
+
/**
|
|
2048
|
+
* Where branch distances (`distance_km`) are measured from: the shopper's real device location
|
|
2049
|
+
* only. It comes from "nearest to my location", or is read silently when location permission was
|
|
2050
|
+
* already granted (never prompting). Empty otherwise: `user.default_geo_location` and the Riyadh
|
|
2051
|
+
* map fallback are not where the shopper is, so they would show wrong distances.
|
|
2052
|
+
*/
|
|
2053
|
+
async getGrantedDeviceLocation() {
|
|
2054
|
+
if (this.shopperLocation)
|
|
2055
|
+
return this.shopperLocation;
|
|
2056
|
+
if (!navigator.geolocation || !navigator.permissions?.query)
|
|
2057
|
+
return {};
|
|
2058
|
+
const request = ++this.shopperLocationRequestId;
|
|
2059
|
+
try {
|
|
2060
|
+
const permission = await navigator.permissions.query({ name: 'geolocation' });
|
|
2061
|
+
if (request !== this.shopperLocationRequestId)
|
|
2062
|
+
return this.shopperLocation ?? {};
|
|
2063
|
+
if (permission.state !== 'granted')
|
|
2064
|
+
return {};
|
|
2065
|
+
const position = await new Promise((resolve, reject) => navigator.geolocation.getCurrentPosition(resolve, reject, {
|
|
2066
|
+
timeout: SILENT_GEOLOCATION_TIMEOUT,
|
|
2067
|
+
maximumAge: SILENT_GEOLOCATION_MAX_AGE,
|
|
2068
|
+
}));
|
|
2069
|
+
if (request !== this.shopperLocationRequestId)
|
|
2070
|
+
return this.shopperLocation ?? {};
|
|
2071
|
+
this.shopperLocation = { lat: position.coords.latitude, lng: position.coords.longitude };
|
|
2072
|
+
return this.shopperLocation;
|
|
2073
|
+
}
|
|
2074
|
+
catch {
|
|
2075
|
+
return {};
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2078
|
+
/** The customer's IP-based `user.default_geo_location`, or null when it is missing or invalid. */
|
|
2079
|
+
get defaultGeoLocation() {
|
|
1738
2080
|
const geo = salla.config.get('user.default_geo_location');
|
|
1739
2081
|
// Coerce defensively: config may arrive as strings, blank/whitespace, NaN, or out-of-range
|
|
1740
2082
|
// values. Reject blanks before coercion (Number('') === 0) and validate lat/lng ranges so we
|
|
@@ -1743,7 +2085,7 @@ const SallaBulletDelivery = class {
|
|
|
1743
2085
|
const lng = this.toCoordinate(geo?.lng);
|
|
1744
2086
|
const isValid = lat != null && lng != null &&
|
|
1745
2087
|
lat >= -90 && lat <= 90 && lng >= -180 && lng <= 180;
|
|
1746
|
-
return isValid ? { lat, lng } :
|
|
2088
|
+
return isValid ? { lat, lng } : null;
|
|
1747
2089
|
}
|
|
1748
2090
|
/** Parse a config coordinate to a finite number, treating blank/whitespace strings as missing. */
|
|
1749
2091
|
toCoordinate(value) {
|
|
@@ -1757,6 +2099,8 @@ const SallaBulletDelivery = class {
|
|
|
1757
2099
|
async handleTabChange(tab) {
|
|
1758
2100
|
if (this.tabChanging)
|
|
1759
2101
|
return;
|
|
2102
|
+
++this.branchesRequestId;
|
|
2103
|
+
this.loadingBranches = false;
|
|
1760
2104
|
this.tabChanging = true;
|
|
1761
2105
|
try {
|
|
1762
2106
|
this.activeTab = tab;
|
|
@@ -1788,24 +2132,25 @@ const SallaBulletDelivery = class {
|
|
|
1788
2132
|
this.selectedCountry = this.countries[0];
|
|
1789
2133
|
}
|
|
1790
2134
|
}
|
|
2135
|
+
if (String(previousCountryId ?? '') !== String(this.selectedCountry?.id ?? '')) {
|
|
2136
|
+
this.allBranchCities = null;
|
|
2137
|
+
this.selectedBranchCity = null;
|
|
2138
|
+
this.branchCities = [];
|
|
2139
|
+
this.branchCitySearchQuery = '';
|
|
2140
|
+
this.selectedBranch = null;
|
|
2141
|
+
this.branches = [];
|
|
2142
|
+
this.filteredBranches = [];
|
|
2143
|
+
}
|
|
1791
2144
|
if (tab === "address" && this.needsMap)
|
|
1792
2145
|
this.fetchAddressToken();
|
|
1793
2146
|
// Load appropriate data when switching tabs if country is selected
|
|
1794
2147
|
if (this.selectedCountry) {
|
|
1795
2148
|
if (tab === "branch") {
|
|
1796
2149
|
// Load branches when switching to branch tab
|
|
1797
|
-
// Check session storage for lat/lng to get nearby branches
|
|
1798
2150
|
const savedIntent = this.getStoredIntent();
|
|
1799
|
-
|
|
1800
|
-
const intentLng = helpers.getIntentLongitude(savedIntent);
|
|
1801
|
-
if (intentLat != null && intentLng != null) {
|
|
1802
|
-
await this.loadBranchesWithLocation(intentLat, intentLng);
|
|
1803
|
-
}
|
|
1804
|
-
else {
|
|
1805
|
-
await this.loadBranches();
|
|
1806
|
-
}
|
|
2151
|
+
await this.loadBranches();
|
|
1807
2152
|
// Preselect branch from session storage if available
|
|
1808
|
-
this.preselectBranch(helpers.getIntentBranchId(savedIntent));
|
|
2153
|
+
void this.preselectBranch(helpers.getIntentBranchId(savedIntent));
|
|
1809
2154
|
}
|
|
1810
2155
|
else if (tab === "address") {
|
|
1811
2156
|
// Lazy-load saved addresses when switching to address tab (if not loaded yet).
|
|
@@ -1931,7 +2276,7 @@ const SallaBulletDelivery = class {
|
|
|
1931
2276
|
if (await this.tryAutoConfirmAfterLogin())
|
|
1932
2277
|
return;
|
|
1933
2278
|
if (!this.modal?.hasAttribute?.("visible") || !this.isLoggedIn) {
|
|
1934
|
-
this.open();
|
|
2279
|
+
this.open(false, "after_login");
|
|
1935
2280
|
}
|
|
1936
2281
|
}
|
|
1937
2282
|
buildIntentAddress() {
|
|
@@ -2210,13 +2555,14 @@ const SallaBulletDelivery = class {
|
|
|
2210
2555
|
}
|
|
2211
2556
|
return raw;
|
|
2212
2557
|
}
|
|
2213
|
-
async handleConfirm() {
|
|
2558
|
+
async handleConfirm(intentBeforeDraft) {
|
|
2214
2559
|
if (this.isConfirmDisabled() || this.confirming)
|
|
2215
2560
|
return;
|
|
2216
2561
|
this.allocationOutOfCoverageMessage = null;
|
|
2217
2562
|
this.confirming = true;
|
|
2218
2563
|
this.confirmBtn?.load();
|
|
2219
2564
|
let scheduledRedirect = false;
|
|
2565
|
+
const previousIntent = intentBeforeDraft === undefined ? this.getStoredIntent() : intentBeforeDraft;
|
|
2220
2566
|
try {
|
|
2221
2567
|
// A guest map pin uses the pin's own country; the IP/selected country may differ from it.
|
|
2222
2568
|
const country = this.activeTab === "address" && this.isGuestMapPick
|
|
@@ -2234,6 +2580,7 @@ const SallaBulletDelivery = class {
|
|
|
2234
2580
|
const savedAddress = await this.saveSessionAddressToProfile();
|
|
2235
2581
|
if (!savedAddress) {
|
|
2236
2582
|
Salla.notify?.error(Salla.lang.get("common.errors.error_occurred"));
|
|
2583
|
+
this.trackSelectorResult("failed", previousIntent, []);
|
|
2237
2584
|
this.confirmBtn?.stop();
|
|
2238
2585
|
return;
|
|
2239
2586
|
}
|
|
@@ -2307,9 +2654,17 @@ const SallaBulletDelivery = class {
|
|
|
2307
2654
|
(this.activeTab === "address"
|
|
2308
2655
|
? Salla.lang.get("pages.checkout.address_out_of_coverage")
|
|
2309
2656
|
: Salla.lang.get("pages.checkout.failed_to_set_pickup"));
|
|
2310
|
-
this.allocationOutOfCoverageMessage = `${errorMessage}.`;
|
|
2657
|
+
this.allocationOutOfCoverageMessage = /[.!؟?]$/.test(errorMessage.trim()) ? errorMessage : `${errorMessage}.`;
|
|
2658
|
+
this.trackSelectorResult("failed", previousIntent, []);
|
|
2311
2659
|
this.confirmBtn?.stop();
|
|
2312
2660
|
this.confirming = false;
|
|
2661
|
+
// A rejected branch may have turned busy or closed: drop it (the reload may hide it) and
|
|
2662
|
+
// reload so the list shows its current state.
|
|
2663
|
+
if (this.activeTab === "branch") {
|
|
2664
|
+
this.selectedBranch = null;
|
|
2665
|
+
helpers.clearApiCache();
|
|
2666
|
+
void this.loadBranches();
|
|
2667
|
+
}
|
|
2313
2668
|
return;
|
|
2314
2669
|
}
|
|
2315
2670
|
// Process successful allocation response
|
|
@@ -2344,6 +2699,7 @@ const SallaBulletDelivery = class {
|
|
|
2344
2699
|
const scopeApplied = await helpers.bulletDeliveryAPI.setDeliveryScope(allocatedScopeId);
|
|
2345
2700
|
if (!scopeApplied) {
|
|
2346
2701
|
this.allocationOutOfCoverageMessage = `${Salla.lang.get("common.errors.error_occurred")}.`;
|
|
2702
|
+
this.trackSelectorResult("failed", previousIntent, [], allocatedScopeId);
|
|
2347
2703
|
this.confirmBtn?.stop();
|
|
2348
2704
|
this.confirming = false;
|
|
2349
2705
|
return;
|
|
@@ -2363,6 +2719,7 @@ const SallaBulletDelivery = class {
|
|
|
2363
2719
|
// After allocation success: persist latest intent so switch UI can always reflect
|
|
2364
2720
|
// the selected address/branch once confirmed.
|
|
2365
2721
|
this.setStoredIntent({ ...result, scope_allocated: true });
|
|
2722
|
+
this.trackSelectorResult("accepted", previousIntent, allocatedBranchIds(result), allocatedScopeId);
|
|
2366
2723
|
const allocationConfirmedPayload = {
|
|
2367
2724
|
...result,
|
|
2368
2725
|
address: this.buildAllocationConfirmedAddressData(selectedAddress),
|
|
@@ -2473,6 +2830,19 @@ const SallaBulletDelivery = class {
|
|
|
2473
2830
|
wrapper.append(info, btn);
|
|
2474
2831
|
return wrapper;
|
|
2475
2832
|
}
|
|
2833
|
+
/**
|
|
2834
|
+
* A branch pickup offer (INV-1416) replaces the default "save delivery fees" badge; only one shows,
|
|
2835
|
+
* and neither until the offer lookup settles.
|
|
2836
|
+
*/
|
|
2837
|
+
renderPickupTabBadge() {
|
|
2838
|
+
if (!this.pickupDiscountResolved)
|
|
2839
|
+
return null;
|
|
2840
|
+
const range = this.pickupDiscountRange;
|
|
2841
|
+
if (range) {
|
|
2842
|
+
return (index.h("span", { class: "s-bullet-delivery-tab-badge s-bullet-delivery-discount-badge", dir: this.isArabic ? 'rtl' : 'ltr', innerHTML: this.getPickupDiscountLabel(range.type, range.min, range.max) }));
|
|
2843
|
+
}
|
|
2844
|
+
return (index.h("span", { class: "s-bullet-delivery-tab-badge" }, index.h("span", { class: "s-bullet-delivery-tab-badge-icon", innerHTML: LightningIcon, "aria-hidden": "true" }), Salla.lang.getWithDefault("pages.checkout.save_delivery_fees", "وفّر رسوم التوصيل")));
|
|
2845
|
+
}
|
|
2476
2846
|
renderTabs() {
|
|
2477
2847
|
// Show tabs only when pickup is supported; otherwise delivery-only view with no tabs.
|
|
2478
2848
|
// The pickup tab is gated by this same `supportsPickup` check, while the delivery
|
|
@@ -2482,10 +2852,10 @@ const SallaBulletDelivery = class {
|
|
|
2482
2852
|
return (index.h("div", { class: "s-bullet-delivery-tabs" }, this.isSupportsDelivery && (index.h("button", { type: "button", class: {
|
|
2483
2853
|
"s-bullet-delivery-tab": true,
|
|
2484
2854
|
"s-bullet-delivery-tab--active": this.activeTab === "address",
|
|
2485
|
-
}, onClick: () => this.handleTabChange("address") }, index.h("span",
|
|
2855
|
+
}, onClick: () => this.handleTabChange("address") }, index.h("span", null, Salla.lang.get("mobile_app.strings.delivery")))), index.h("button", { type: "button", class: {
|
|
2486
2856
|
"s-bullet-delivery-tab": true,
|
|
2487
2857
|
"s-bullet-delivery-tab--active": this.activeTab === "branch",
|
|
2488
|
-
}, onClick: () => this.handleTabChange("branch") }, index.h("span",
|
|
2858
|
+
}, onClick: () => this.handleTabChange("branch") }, index.h("span", null, Salla.lang.get("mobile_app.strings.pickup")), this.renderPickupTabBadge())));
|
|
2489
2859
|
}
|
|
2490
2860
|
renderAlert(message) {
|
|
2491
2861
|
return (index.h("div", { class: "s-bullet-delivery-allocation-out-of-coverage", role: "alert" }, index.h("span", { class: "s-bullet-delivery-allocation-out-of-coverage-icon", "aria-hidden": "true" }, index.h("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true" }, index.h("title", null, "Information"), index.h("circle", { cx: "10", cy: "10", r: "9", stroke: "currentColor", "stroke-width": "1.5", fill: "currentColor" }), index.h("text", { x: "10", y: "14", "text-anchor": "middle", fill: "white", "font-size": "12", "font-weight": "bold" }, "i"))), index.h("span", { class: "s-bullet-delivery-allocation-out-of-coverage-text", style: { textAlign: this.isRTL ? 'right' : 'left' } }, message)));
|
|
@@ -2509,8 +2879,9 @@ const SallaBulletDelivery = class {
|
|
|
2509
2879
|
}
|
|
2510
2880
|
return this.renderAlert(`${message} ${Salla.lang.getWithDefault('pages.cart.choose_another_address', 'Choose another address')}`);
|
|
2511
2881
|
}
|
|
2512
|
-
|
|
2513
|
-
|
|
2882
|
+
/** `showLabel` is off in the pickup filter panel, where the selects sit label-less side by side. */
|
|
2883
|
+
renderCountrySelect(showLabel = true) {
|
|
2884
|
+
return (index.h("div", { class: "s-bullet-delivery-field" }, index.h("salla-searchable-dropdown", { label: showLabel ? Salla.lang.get("blocks.buy_as_gift.receiver_country") : undefined, placeholder: Salla.lang.get("pages.checkout.select_country"), items: this.displayedCountries, selectedItem: this.selectedCountry, loading: this.loadingCountries, searching: this.searchingCountries, disabled: this.countries.length <= 1, required: true, inputId: "bullet-delivery-country", searchQuery: this.countrySearchQuery, clientSearch: true, onItemSelected: (e) => this.handleCountrySelected(e.detail), onSearchInput: (e) => this.handleCountrySearch(e.detail), onDropdownClosed: () => this.handleCountryDropdownClosed() })));
|
|
2514
2885
|
}
|
|
2515
2886
|
/** Region select (SA only): shown when SA is selected; city and district disabled until region selected. */
|
|
2516
2887
|
renderRegionSelect() {
|
|
@@ -2755,66 +3126,146 @@ const SallaBulletDelivery = class {
|
|
|
2755
3126
|
return (index.h("form", { onSubmit: handleSubmit }, this.renderGuestDeliveryForm(), index.h("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single", style: { padding: '24px' } }, index.h("salla-button", { type: "submit", loading: this.confirming, disabled: !canSubmit || this.confirming, width: "wide" }, submitLabel), !this.isLoggedIn && (index.h("button", { type: "button", class: "s-bullet-delivery-login-prompt", onClick: () => this.handleLogin() }, Salla.lang.get('pages.checkout.login_to_use_saved_addresses'))))));
|
|
2756
3127
|
}
|
|
2757
3128
|
renderBranchSearch() {
|
|
2758
|
-
return (index.h("div", { class: "s-bullet-delivery-branch-search" }, index.h("div", { class: "s-bullet-delivery-search-row" }, index.h("div", { class: "s-bullet-delivery-search s-bullet-delivery-branch-search-wrap" }, index.h("span", { class: "s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon", innerHTML: search.Search, "aria-hidden": "true" }), index.h("input", { type: "text", class: "s-bullet-delivery-branch-search-input form-input", placeholder: Salla.lang.
|
|
3129
|
+
return (index.h("div", { class: "s-bullet-delivery-branch-search" }, index.h("div", { class: "s-bullet-delivery-search-row" }, index.h("div", { class: "s-bullet-delivery-search s-bullet-delivery-branch-search-wrap" }, index.h("span", { class: "s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon", innerHTML: search.Search, "aria-hidden": "true" }), index.h("input", { type: "text", class: "s-bullet-delivery-branch-search-input form-input", placeholder: Salla.lang.getWithDefault("pages.checkout.search_for_country_city_or_branch", this.isArabic ? "ابحث عن دولة أو مدينة أو فرع" : "Search for a country, city or branch"), value: this.branchSearchQuery, onInput: (e) => this.handleBranchSearch(e), autocomplete: "off" })), index.h("button", { type: "button", class: {
|
|
2759
3130
|
"s-bullet-delivery-location-btn": true,
|
|
2760
3131
|
"s-bullet-delivery-location-btn--full": true,
|
|
2761
3132
|
"s-bullet-delivery-location-btn--loading": this.loadingNearestBranch,
|
|
2762
|
-
}, onClick: () => this.handleFindNearestBranch(), disabled: this.loadingNearestBranch }, this.loadingNearestBranch ? (index.h("span", { class: "s-bullet-delivery-location-icon", "aria-hidden": "true" }, index.h("salla-skeleton", { height: "
|
|
2763
|
-
}
|
|
2764
|
-
/** Renders a branch's `preparation_time_range` as a localized "from - to <unit>" label. */
|
|
2765
|
-
getPreparationTimeLabel(range) {
|
|
2766
|
-
if (!range)
|
|
2767
|
-
return null;
|
|
2768
|
-
const unitKeys = {
|
|
2769
|
-
hour: 'pages.checkout.preparation_time_hours',
|
|
2770
|
-
minute: 'pages.checkout.preparation_time_minutes',
|
|
2771
|
-
day: 'pages.checkout.preparation_time_days',
|
|
2772
|
-
};
|
|
2773
|
-
const key = unitKeys[range.from.unit];
|
|
2774
|
-
if (!key)
|
|
2775
|
-
return null;
|
|
2776
|
-
return Salla.lang
|
|
2777
|
-
.getWithDefault(key, 'من {from} إلى {to} دقائق')
|
|
2778
|
-
?.replace('{from}', String(range.from.value))
|
|
2779
|
-
?.replace('{to}', String(range.to.value));
|
|
3133
|
+
}, onClick: () => this.handleFindNearestBranch(), disabled: this.loadingNearestBranch, "aria-label": Salla.lang.get("pages.checkout.nearest_to_my_location") }, this.loadingNearestBranch ? (index.h("span", { class: "s-bullet-delivery-location-icon", "aria-hidden": "true" }, index.h("salla-skeleton", { height: "16px", width: "16px" }))) : (index.h("span", { class: "s-bullet-delivery-location-icon", innerHTML: location.Location, "aria-hidden": "true" })), index.h("span", { class: "s-bullet-delivery-location-label" }, Salla.lang.get("pages.checkout.nearest_to_my_location")))), this.locationError && this.activeTab === "branch" && (index.h("span", { class: "s-bullet-delivery-error" }, this.locationError))));
|
|
2780
3134
|
}
|
|
2781
3135
|
renderBranchList() {
|
|
2782
3136
|
if (this.loadingBranches) {
|
|
2783
3137
|
return (index.h("div", { class: "s-bullet-delivery-branches-wrap" }, index.h("div", { class: "s-bullet-delivery-branches-loading" }, [1, 2, 3, 4].map((v) => (index.h("div", { key: v, class: "s-bullet-delivery-branch-skeleton" }, index.h("salla-skeleton", { class: "s-bullet-delivery-branch-skeleton-radio", type: "circle", height: "16px", width: "16px" }), index.h("div", { class: "s-bullet-delivery-branch-skeleton-icon" }, index.h("salla-skeleton", { height: "34px", width: "34px" })), index.h("div", { class: "s-bullet-delivery-branch-skeleton-content" }, index.h("salla-skeleton", { class: "s-bullet-delivery-branch-skeleton-title", height: "12px", width: "124px" })), index.h("salla-skeleton", { class: "s-bullet-delivery-branch-skeleton-time", height: "12px", width: "88px" }), index.h("div", { class: "s-bullet-delivery-branch-skeleton-map" }, index.h("salla-skeleton", { height: "32px", width: "32px" }))))))));
|
|
2784
3138
|
}
|
|
2785
|
-
|
|
3139
|
+
const branches = this.filteredBranches.filter(helpers.isBranchVisible);
|
|
3140
|
+
if (branches.length === 0) {
|
|
2786
3141
|
return (index.h("salla-placeholder", { alignment: "center", class: "s-bullet-delivery-placeholder" }, index.h("span", { slot: "title" }, Salla.lang.get("pages.checkout.no_pickup_branches_found"))));
|
|
2787
3142
|
}
|
|
2788
|
-
return (index.h("div", { class: "s-bullet-delivery-branches-wrap" }, index.h("ul", { class: "s-bullet-delivery-branches-list s-scrollbar" },
|
|
3143
|
+
return (index.h("div", { class: "s-bullet-delivery-branches-wrap" }, index.h("ul", { class: "s-bullet-delivery-branches-list s-scrollbar", role: "listbox" }, branches.map(branch => {
|
|
2789
3144
|
const selectable = helpers.isBranchSelectable(branch);
|
|
2790
|
-
const
|
|
3145
|
+
const isSelected = this.selectedBranch?.id === branch.id;
|
|
2791
3146
|
const locationText = [branch.country?.name, branch.city?.name, branch.district?.name]
|
|
2792
3147
|
.filter(Boolean)
|
|
2793
|
-
.join('
|
|
2794
|
-
const
|
|
3148
|
+
.join('، ');
|
|
3149
|
+
const distance = helpers.formatBranchDistance(branch.distance_km);
|
|
3150
|
+
// Closed but taking orders: the opening-time readiness replaces the range.
|
|
3151
|
+
const readinessLabel = helpers.getBranchReadinessLabel(branch) ?? this.getReadyTodayLabel(branch);
|
|
3152
|
+
const preparationLabel = readinessLabel ? null : this.getPreparationShortLabel(branch.preparation_time_range);
|
|
3153
|
+
const scheduleGroups = helpers.groupBranchSchedule(helpers.getBranchWeekSchedule(branch));
|
|
3154
|
+
// An always-open branch has no hours worth listing, so it gets no working-hours dropdown.
|
|
3155
|
+
const hasSchedule = scheduleGroups.length > 0 && !helpers.isBranchAlwaysOpen(branch);
|
|
3156
|
+
const scheduleOpen = hasSchedule && this.expandedScheduleBranchId === branch.id;
|
|
3157
|
+
const phoneHref = helpers.getBranchPhoneHref(branch);
|
|
3158
|
+
const whatsappHref = helpers.getBranchWhatsappHref(branch);
|
|
3159
|
+
const directionsHref = helpers.getBranchDirectionsHref(branch);
|
|
3160
|
+
const discount = helpers.getBranchDiscount(branch);
|
|
2795
3161
|
return (index.h("li", { key: branch.id, class: {
|
|
2796
3162
|
's-bullet-delivery-branch-item': true,
|
|
2797
|
-
's-bullet-delivery-branch-item--selected':
|
|
3163
|
+
's-bullet-delivery-branch-item--selected': isSelected,
|
|
2798
3164
|
's-bullet-delivery-branch-item--disabled': !selectable,
|
|
2799
|
-
}, tabIndex: selectable ? 0 : -1, role: "option", "aria-disabled": !selectable, onClick: () => selectable && this.handleBranchSelect(branch), onKeyDown: e => {
|
|
3165
|
+
}, tabIndex: selectable ? 0 : -1, role: "option", "aria-selected": isSelected, "aria-disabled": !selectable, onClick: () => selectable && this.handleBranchSelect(branch), onKeyDown: e => {
|
|
3166
|
+
if (e.target !== e.currentTarget)
|
|
3167
|
+
return;
|
|
2800
3168
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
2801
3169
|
e.preventDefault();
|
|
2802
3170
|
if (selectable)
|
|
2803
3171
|
this.handleBranchSelect(branch);
|
|
2804
3172
|
}
|
|
2805
|
-
} }, index.h("input", { type: "radio", name: "branch", class: "s-bullet-delivery-radio", checked:
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
3173
|
+
} }, index.h("input", { type: "radio", name: "branch", class: "s-bullet-delivery-radio s-bullet-delivery-branch-radio", checked: isSelected, disabled: !selectable, tabIndex: -1 }), index.h("div", { class: "s-bullet-delivery-branch-body" }, index.h("p", { class: "s-bullet-delivery-branch-name" }, index.h("span", null, branch.name), discount ? (index.h("span", { class: "s-bullet-delivery-discount-badge", dir: this.isArabic ? 'rtl' : 'ltr', innerHTML: this.getPickupDiscountLabel(discount.type, discount.amount) })) : null), locationText ? (index.h("span", { class: "s-bullet-delivery-branch-meta s-bullet-delivery-branch-location" }, index.h("span", { class: "s-bullet-delivery-branch-meta-icon", innerHTML: BranchLocationIcon, "aria-hidden": "true" }), index.h("span", null, locationText))) : null, isSelected && branch.pickup_instructions ? (index.h("span", { class: "s-bullet-delivery-branch-meta s-bullet-delivery-branch-instructions" }, index.h("span", { class: "s-bullet-delivery-branch-meta-icon", innerHTML: NotesIcon, "aria-hidden": "true" }), index.h("span", null, branch.pickup_instructions))) : null, index.h("div", { class: "s-bullet-delivery-branch-meta-row" }, distance || readinessLabel || preparationLabel ? (index.h("div", { class: "s-bullet-delivery-branch-pills" }, distance ? (index.h("span", { class: "s-bullet-delivery-branch-meta s-bullet-delivery-branch-pill s-bullet-delivery-branch-distance" }, index.h("i", { class: "sicon-location" }), index.h("span", null, this.renderDistanceLabel(distance)))) : null, readinessLabel ? (index.h("span", { class: "s-bullet-delivery-branch-meta s-bullet-delivery-branch-pill s-bullet-delivery-branch-prep" }, index.h("span", { class: "s-bullet-delivery-branch-meta-icon", innerHTML: PickupAvailabilityIcon, "aria-hidden": "true" }), index.h("span", { class: "s-bullet-delivery-branch-meta-value" }, readinessLabel))) : preparationLabel ? (index.h("span", { class: "s-bullet-delivery-branch-meta s-bullet-delivery-branch-pill s-bullet-delivery-branch-prep" }, index.h("span", { class: "s-bullet-delivery-branch-meta-icon", innerHTML: PickupAvailabilityIcon, "aria-hidden": "true" }), index.h("span", null, index.h("span", { class: "s-bullet-delivery-branch-meta-label" }, Salla.lang.getWithDefault('pages.checkout.pickup_branch_ready_in', 'Pickup available after:'), ' '), index.h("span", { class: "s-bullet-delivery-branch-meta-value" }, preparationLabel)))) : null)) : null, index.h("hr", { class: "s-bullet-delivery-branch-divider" }), this.renderBranchOpenStatus(branch, hasSchedule, scheduleOpen)), scheduleOpen && (index.h("div", { class: "s-bullet-delivery-branch-schedule" }, scheduleGroups.map((group, index$1) => (index.h("div", { key: index$1, class: "s-bullet-delivery-branch-schedule-day" }, index.h("span", { class: "s-bullet-delivery-branch-schedule-days" }, group.days.length > 1
|
|
3174
|
+
? `${group.days[0]} - ${group.days[group.days.length - 1]}`
|
|
3175
|
+
: group.days[0]), index.h("span", { class: "s-bullet-delivery-branch-schedule-times" }, group.times
|
|
3176
|
+
.map(t => `${this.formatClock(t.start)} - ${this.formatClock(t.end)}`)
|
|
3177
|
+
.join(this.isArabic ? '، ' : ', ')))))))), index.h("div", { class: "s-bullet-delivery-branch-actions" }, phoneHref && (index.h("a", { href: phoneHref, class: "s-bullet-delivery-branch-action", title: Salla.lang.getWithDefault('pages.checkout.branch_call', 'اتصال'), onClick: e => e.stopPropagation() }, index.h("i", { class: "sicon-phone" }))), whatsappHref && (index.h("a", { href: whatsappHref, target: "_blank", rel: "noopener noreferrer", class: "s-bullet-delivery-branch-action", title: Salla.lang.getWithDefault('pages.checkout.branch_whatsapp', 'واتساب'), onClick: e => e.stopPropagation() }, index.h("i", { class: "sicon-whatsapp2" }))), directionsHref && (index.h("a", { href: directionsHref, target: "_blank", rel: "noopener noreferrer", class: "s-bullet-delivery-branch-action s-bullet-delivery-branch-map-link", title: Salla.lang.get('common.elements.open_in_google_maps'), onClick: e => e.stopPropagation() }, index.h("span", { class: "s-bullet-delivery-branch-map-link-icon", innerHTML: GetDirections.replace(/mask0_25437_34440/g, `mask0_branch_${branch.id}`), "aria-hidden": "true" }), index.h("span", { class: "sr-only" }, Salla.lang.get('common.elements.open_in_google_maps')))))));
|
|
2810
3178
|
}))));
|
|
2811
3179
|
}
|
|
3180
|
+
/** "يبعد عنك: ~" stays muted; the distance and its unit read as the value, as in checkout. */
|
|
3181
|
+
renderDistanceLabel(distance) {
|
|
3182
|
+
const template = Salla.lang.getWithDefault('pages.checkout.branch_distance_from_you', 'يبعد عنك: ~ {distance} كم');
|
|
3183
|
+
const index$1 = template.indexOf('{distance}');
|
|
3184
|
+
if (index$1 === -1)
|
|
3185
|
+
return template;
|
|
3186
|
+
return [
|
|
3187
|
+
index.h("span", { class: "s-bullet-delivery-branch-meta-label" }, template.slice(0, index$1)),
|
|
3188
|
+
index.h("span", { class: "s-bullet-delivery-branch-meta-value" }, template.slice(index$1).replace('{distance}', distance)),
|
|
3189
|
+
];
|
|
3190
|
+
}
|
|
3191
|
+
get isArabic() {
|
|
3192
|
+
return (Salla.lang.getLocale?.() ?? document.documentElement.lang) === 'ar';
|
|
3193
|
+
}
|
|
3194
|
+
formatClock(time) {
|
|
3195
|
+
return helpers.formatBranchClockTime(time, this.isArabic ? 'ar' : 'en');
|
|
3196
|
+
}
|
|
3197
|
+
/** "جاهز اليوم 10:00 ص" for a branch that is closed now and opens later today. */
|
|
3198
|
+
getReadyTodayLabel(branch) {
|
|
3199
|
+
const time = helpers.getBranchReadyTodayTime(branch);
|
|
3200
|
+
return time
|
|
3201
|
+
? `${Salla.lang.getWithDefault('pages.checkout.pickup_branch_ready_today_at', 'جاهز اليوم')} ${this.formatClock(time)}`
|
|
3202
|
+
: null;
|
|
3203
|
+
}
|
|
3204
|
+
/** "15-30 د" — compact preparation range for the card's meta row. */
|
|
3205
|
+
getPreparationShortLabel(range) {
|
|
3206
|
+
if (!range?.from || !range?.to)
|
|
3207
|
+
return null;
|
|
3208
|
+
const unitKeys = {
|
|
3209
|
+
minute: ['pages.checkout.preparation_time_minute_short', 'د'],
|
|
3210
|
+
hour: ['pages.checkout.preparation_time_hour_short', 'س'],
|
|
3211
|
+
day: ['pages.checkout.preparation_time_day_short', 'يوم'],
|
|
3212
|
+
};
|
|
3213
|
+
const unit = (u) => (unitKeys[u] ? Salla.lang.getWithDefault(unitKeys[u][0], unitKeys[u][1]) : null);
|
|
3214
|
+
const fromUnit = unit(range.from.unit);
|
|
3215
|
+
const toUnit = unit(range.to.unit);
|
|
3216
|
+
if (!fromUnit || !toUnit)
|
|
3217
|
+
return null;
|
|
3218
|
+
return range.from.unit === range.to.unit
|
|
3219
|
+
? `${range.from.value}-${range.to.value} ${toUnit}`
|
|
3220
|
+
: `${range.from.value} ${fromUnit} - ${range.to.value} ${toUnit}`;
|
|
3221
|
+
}
|
|
3222
|
+
/**
|
|
3223
|
+
* Busy, always-open, or the backend's `open_status_line` ("مفتوح - يغلق عند 11:00 م"), which reads
|
|
3224
|
+
* the hours on the branch's clock. Without that line, `is_open` gives a bare open/closed label.
|
|
3225
|
+
*/
|
|
3226
|
+
renderBranchOpenStatus(branch, hasSchedule, scheduleOpen) {
|
|
3227
|
+
const toggle = hasSchedule && (index.h("button", { type: "button", class: "s-bullet-delivery-branch-schedule-toggle", "aria-expanded": scheduleOpen ? 'true' : 'false', "aria-label": Salla.lang.getWithDefault('pages.checkout.pickup_show_weekly_hours', 'عرض ساعات العمل الأسبوعية'), onClick: e => {
|
|
3228
|
+
e.stopPropagation();
|
|
3229
|
+
this.toggleBranchSchedule(branch.id);
|
|
3230
|
+
} }, index.h("i", { class: { 'sicon-keyboard_arrow_down': true, 'is-expanded': scheduleOpen } })));
|
|
3231
|
+
if (helpers.isBranchBusy(branch)) {
|
|
3232
|
+
return (index.h("span", { class: "s-bullet-delivery-branch-meta s-bullet-delivery-branch-open-status" }, index.h("span", { class: "s-bullet-delivery-branch-meta-icon", innerHTML: WorkingHoursIcon, "aria-hidden": "true" }), index.h("span", { class: "s-bullet-delivery-pickup-status--busy" }, Salla.lang.getWithDefault('pages.checkout.pickup_branch_busy', 'مشغول، لا يستقبل طلبات')), toggle));
|
|
3233
|
+
}
|
|
3234
|
+
const alwaysOpen = helpers.isBranchAlwaysOpen(branch);
|
|
3235
|
+
const line = branch.pickup_readiness?.open_status_line;
|
|
3236
|
+
if (!alwaysOpen && line) {
|
|
3237
|
+
return (index.h("span", { class: "s-bullet-delivery-branch-meta s-bullet-delivery-branch-open-status" }, index.h("span", { class: "s-bullet-delivery-branch-meta-icon", innerHTML: WorkingHoursIcon, "aria-hidden": "true" }), index.h("span", null, line), toggle));
|
|
3238
|
+
}
|
|
3239
|
+
if (!alwaysOpen && !hasSchedule)
|
|
3240
|
+
return null;
|
|
3241
|
+
if (!alwaysOpen && typeof branch.is_open !== 'boolean') {
|
|
3242
|
+
return index.h("span", { class: "s-bullet-delivery-branch-meta s-bullet-delivery-branch-open-status" }, toggle);
|
|
3243
|
+
}
|
|
3244
|
+
const isOpen = alwaysOpen || branch.is_open;
|
|
3245
|
+
const label = alwaysOpen
|
|
3246
|
+
? Salla.lang.getWithDefault('pages.checkout.pickup_branch_always_open', 'مفتوح دائمًا 24/7')
|
|
3247
|
+
: isOpen
|
|
3248
|
+
? Salla.lang.getWithDefault('pages.checkout.pickup_branch_open', 'مفتوح')
|
|
3249
|
+
: Salla.lang.getWithDefault('pages.checkout.pickup_branch_closed', 'مغلق');
|
|
3250
|
+
return (index.h("span", { class: "s-bullet-delivery-branch-meta s-bullet-delivery-branch-open-status" }, index.h("span", { class: "s-bullet-delivery-branch-meta-icon", innerHTML: WorkingHoursIcon, "aria-hidden": "true" }), index.h("span", { class: isOpen ? 's-bullet-delivery-pickup-status--open' : 's-bullet-delivery-pickup-status--closed' }, label), toggle));
|
|
3251
|
+
}
|
|
2812
3252
|
renderPickupTab() {
|
|
2813
3253
|
return (index.h("div", { class: {
|
|
2814
3254
|
"s-bullet-delivery-content": true,
|
|
2815
3255
|
"s-bullet-delivery-content--active": this.activeTab === "branch",
|
|
2816
3256
|
"s-hidden": this.activeTab !== "branch",
|
|
2817
|
-
} }, this.renderCountrySelect(), this.renderBranchSearch(), this.renderBranchList()));
|
|
3257
|
+
} }, index.h("div", { class: "s-bullet-delivery-pickup-filters" }, index.h("div", { class: "s-bullet-delivery-pickup-filters-row" }, this.renderCountrySelect(false), this.renderBranchCitySelect()), this.renderBranchSearch()), this.renderBranchList()));
|
|
3258
|
+
}
|
|
3259
|
+
/** City filter for the pickup list; options come from the branches themselves, so none is empty. */
|
|
3260
|
+
renderBranchCitySelect() {
|
|
3261
|
+
return (index.h("div", { class: "s-bullet-delivery-field" }, index.h("salla-searchable-dropdown", { placeholder: Salla.lang.get("pages.checkout.select_city"), items: [{ id: -1, name: Salla.lang.getWithDefault('pages.checkout.all_cities', this.isArabic ? 'كل المدن' : 'All cities') }, ...this.branchCities], selectedItem: this.selectedBranchCity, loading: this.loadingBranches && this.branchCities.length === 0, disabled: this.branchCities.length === 0 && !this.selectedBranchCity, inputId: "bullet-delivery-branch-city", searchQuery: this.branchCitySearchQuery, clientSearch: true, onItemSelected: (e) => {
|
|
3262
|
+
this.branchCitySearchQuery = '';
|
|
3263
|
+
this.handleBranchCitySelected(e.detail);
|
|
3264
|
+
}, onSearchInput: (e) => {
|
|
3265
|
+
this.branchCitySearchQuery = e.detail;
|
|
3266
|
+
}, onDropdownClosed: () => {
|
|
3267
|
+
this.branchCitySearchQuery = '';
|
|
3268
|
+
} })));
|
|
2818
3269
|
}
|
|
2819
3270
|
/** Add-address form: map + confirm card in one screen, or dropdown fallback. */
|
|
2820
3271
|
renderAddAddressForm() {
|
|
@@ -2856,7 +3307,7 @@ const SallaBulletDelivery = class {
|
|
|
2856
3307
|
return (index.h("div", { class: "s-bullet-delivery-footer" }, index.h("salla-button", { ref: (btn) => {
|
|
2857
3308
|
this.confirmBtn = btn;
|
|
2858
3309
|
}, disabled: this.isConfirmDisabled(), onClick: () => this.handleConfirm(), "loader-position": "center", width: "wide" }, this.activeTab === "branch"
|
|
2859
|
-
? Salla.lang.
|
|
3310
|
+
? Salla.lang.getWithDefault("pages.checkout.confirm_receipt_from_the_branch", "تأكيد الإستلام من الفرع")
|
|
2860
3311
|
: Salla.lang.get("pages.checkout.confirm_address")), showAddAddressInFooter && (index.h("salla-button", { onClick: () => this.handleAddNewAddress(), width: "wide", shape: "link" }, Salla.lang.get("pages.checkout.add_new_address"))), !this.isLoggedIn && (index.h("salla-button", { shape: "link", onClick: () => this.handleLogin() }, Salla.lang.get("pages.checkout.login_to_use_saved_addresses")))));
|
|
2861
3312
|
}
|
|
2862
3313
|
renderMainView() {
|
|
@@ -2882,7 +3333,7 @@ const SallaBulletDelivery = class {
|
|
|
2882
3333
|
if (canOpenForIncompleteIntent) {
|
|
2883
3334
|
this.markIncompleteIntentPrompted();
|
|
2884
3335
|
}
|
|
2885
|
-
this.open();
|
|
3336
|
+
this.open(false, canOpenForIncompleteIntent ? "incomplete_intent" : "after_add_to_cart");
|
|
2886
3337
|
}
|
|
2887
3338
|
overrideScopeSwitchUI() {
|
|
2888
3339
|
const intent = this.getStoredIntent();
|
|
@@ -2935,7 +3386,7 @@ const SallaBulletDelivery = class {
|
|
|
2935
3386
|
// silently awaiting with nothing visible.
|
|
2936
3387
|
if (!this.isGuestUser()) {
|
|
2937
3388
|
if (!this.modal?.hasAttribute?.("visible")) {
|
|
2938
|
-
this.open();
|
|
3389
|
+
this.open(false, "checkout_gate");
|
|
2939
3390
|
}
|
|
2940
3391
|
await this.pendingCartSubmitPromise;
|
|
2941
3392
|
return;
|
|
@@ -2964,7 +3415,7 @@ const SallaBulletDelivery = class {
|
|
|
2964
3415
|
this.openGuestLogin();
|
|
2965
3416
|
return;
|
|
2966
3417
|
}
|
|
2967
|
-
this.open();
|
|
3418
|
+
this.open(false, "checkout_gate");
|
|
2968
3419
|
});
|
|
2969
3420
|
await this.pendingCartSubmitPromise;
|
|
2970
3421
|
};
|
|
@@ -2980,6 +3431,7 @@ const SallaBulletDelivery = class {
|
|
|
2980
3431
|
Salla.event.on("salla::bullet-delivery.modal.open.requested", this.bulletDeliveryOpenHandler);
|
|
2981
3432
|
this.closeHandler = this.close.bind(this);
|
|
2982
3433
|
Salla.event.on("salla::bullet-delivery.modal.close.requested", this.closeHandler);
|
|
3434
|
+
Salla.event.on("modal::close", this.modalCloseHandler);
|
|
2983
3435
|
this.isRTL = Salla.config.get("theme.is_rtl");
|
|
2984
3436
|
// Reading the permission never prompts, so it's safe to watch from here — the map view then
|
|
2985
3437
|
// renders the notice (or not) on its first paint instead of a frame later.
|
|
@@ -3004,7 +3456,7 @@ const SallaBulletDelivery = class {
|
|
|
3004
3456
|
return;
|
|
3005
3457
|
if (this.modal?.hasAttribute?.("visible"))
|
|
3006
3458
|
return;
|
|
3007
|
-
this.open();
|
|
3459
|
+
this.open(false, "after_login");
|
|
3008
3460
|
};
|
|
3009
3461
|
Salla.event.on("auth::logged.in", this.authLoggedInHandler);
|
|
3010
3462
|
this.authLoggedOutHandler = () => {
|
|
@@ -3036,9 +3488,12 @@ const SallaBulletDelivery = class {
|
|
|
3036
3488
|
return null; // no-op when disabled
|
|
3037
3489
|
return (index.h(index.Host, { class: "s-bullet-delivery" }, index.h("salla-modal", { ref: modal => {
|
|
3038
3490
|
this.modal = modal;
|
|
3039
|
-
}, isClosable: !this.isRequired && !this.shouldForceNonClosable(),
|
|
3491
|
+
}, isClosable: !this.isRequired && !this.shouldForceNonClosable(), onModalVisibilityChanged: (event) => {
|
|
3492
|
+
if (event.target === this.modal)
|
|
3493
|
+
this.handleModalVisibility(Boolean(event.detail));
|
|
3494
|
+
}, class: "s-bullet-delivery-modal", width: "sm", "data-testid": "salla-bullet-delivery-modal" }, index.h("div", { class: "s-bullet-delivery-inner" }, index.h("div", { class: "s-bullet-delivery-header" }, index.h("h2", { class: "s-bullet-delivery-title" }, this.activeTab === 'address'
|
|
3040
3495
|
? Salla.lang.get('blocks.home.add_address_for_order_delivery')
|
|
3041
|
-
: Salla.lang.
|
|
3496
|
+
: Salla.lang.getWithDefault('blocks.home.choose_pickup_branch_title', this.isArabic ? 'اختر فرع استلام طلبك' : 'Choose your pickup branch')), index.h("p", { class: "s-bullet-delivery-subtitle" }, this.activeTab === 'address'
|
|
3042
3497
|
? Salla.lang.get('blocks.home.products_available_for_delivery_shown_while_shopping')
|
|
3043
3498
|
: Salla.lang.get('blocks.home.choose_branch_for_order_pickup_description'))), this.renderTabs(), this.viewMode === 'main' && this.renderMainView(), this.viewMode === 'add-address' && this.renderAddAddressForm()))));
|
|
3044
3499
|
}
|
|
@@ -3072,7 +3527,7 @@ const SallaBulletDelivery = class {
|
|
|
3072
3527
|
// Handle pending open request (if event was emitted before component was ready)
|
|
3073
3528
|
if (this.pendingOpen) {
|
|
3074
3529
|
this.pendingOpen = false;
|
|
3075
|
-
this.open();
|
|
3530
|
+
this.open(false, this.openTrigger);
|
|
3076
3531
|
return;
|
|
3077
3532
|
}
|
|
3078
3533
|
// Strategy-based auto-open logic
|
|
@@ -3080,11 +3535,11 @@ const SallaBulletDelivery = class {
|
|
|
3080
3535
|
case "first_visit":
|
|
3081
3536
|
// Open once per session when component mounts (per-session behaviour)
|
|
3082
3537
|
if (!this.hasBeenShownThisSession()) {
|
|
3083
|
-
this.open();
|
|
3538
|
+
this.open(false, "first_visit");
|
|
3084
3539
|
}
|
|
3085
3540
|
else if (this.shouldPromptIncompleteIntentThisSession()) {
|
|
3086
3541
|
this.markIncompleteIntentPrompted();
|
|
3087
|
-
this.open();
|
|
3542
|
+
this.open(false, "incomplete_intent");
|
|
3088
3543
|
}
|
|
3089
3544
|
break;
|
|
3090
3545
|
case "on_cart_click":
|
|
@@ -3092,11 +3547,11 @@ const SallaBulletDelivery = class {
|
|
|
3092
3547
|
if (Salla.url.is_page("cart")) {
|
|
3093
3548
|
const shown = this.getShownStorage().get(this.sessionShownKey) === true;
|
|
3094
3549
|
if (!shown) {
|
|
3095
|
-
this.open();
|
|
3550
|
+
this.open(false, "on_cart_click");
|
|
3096
3551
|
}
|
|
3097
3552
|
else if (this.shouldPromptIncompleteIntentThisSession()) {
|
|
3098
3553
|
this.markIncompleteIntentPrompted();
|
|
3099
|
-
this.open();
|
|
3554
|
+
this.open(false, "incomplete_intent");
|
|
3100
3555
|
}
|
|
3101
3556
|
}
|
|
3102
3557
|
break;
|
|
@@ -3116,6 +3571,7 @@ const SallaBulletDelivery = class {
|
|
|
3116
3571
|
this.stopWatchingLocationPermission = null;
|
|
3117
3572
|
}
|
|
3118
3573
|
Salla.event.off("salla::bullet-delivery.modal.open.requested", this.bulletDeliveryOpenHandler);
|
|
3574
|
+
Salla.event.off("modal::close", this.modalCloseHandler);
|
|
3119
3575
|
if (this.closeHandler) {
|
|
3120
3576
|
Salla.event.off("salla::bullet-delivery.modal.close.requested", this.closeHandler);
|
|
3121
3577
|
this.closeHandler = null;
|