@salla.sa/twilight-components 2.14.370 → 2.14.372
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{filepond-DNoOQ518.js → filepond-D6hNdSue.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-CX52qbRW.js → filepond-plugin-file-poster-DOSqy8V3.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-Dxk9m3Lt.js → filepond-plugin-file-validate-size-l4VLpkoL.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-DQMxc1IT.js → filepond-plugin-file-validate-type-KYY5p5gt.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-BLW3ytTq.js → filepond-plugin-image-edit-BzaiZ8lY.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-BgndLkUA.js → filepond-plugin-image-exif-orientation-Dp_AVLHw.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-z85khFfc.js → filepond-plugin-image-preview-Cu_XtCoc.js} +1 -1
- package/dist/cjs/{index-BNCWtQwH.js → index-BmCJSRO7.js} +1 -1
- package/dist/cjs/{index-Uv2p8S16.js → index-D2SICJqL.js} +6 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/location-DIyESLuI.js +16 -0
- package/dist/cjs/salla-accordion-body_3.cjs.entry.js +5 -11
- package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
- package/dist/cjs/salla-add-product-button_4.cjs.entry.js +3 -3
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_7.cjs.entry.js +17 -17
- package/dist/cjs/salla-bullet-delivery.cjs.entry.js +1980 -0
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +17 -5
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +8 -8
- 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 +12 -7
- package/dist/cjs/salla-count-down_2.cjs.entry.js +7 -7
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +3 -3
- package/dist/cjs/salla-filters.cjs.entry.js +2 -2
- package/dist/cjs/salla-gifting.cjs.entry.js +3 -3
- package/dist/cjs/salla-hook.cjs.entry.js +2 -2
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +2 -2
- package/dist/cjs/salla-localization-modal.cjs.entry.js +2 -2
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +2 -2
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +4 -4
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +6 -6
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +2 -2
- package/dist/cjs/salla-notification-item.cjs.entry.js +2 -2
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +2 -2
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +2 -2
- package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +3 -3
- package/dist/cjs/salla-placeholder.cjs.entry.js +2 -2
- package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +2 -2
- package/dist/cjs/salla-search.cjs.entry.js +4 -4
- package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
- package/dist/cjs/salla-social.cjs.entry.js +2 -2
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-CnB9AyA4.js → vanilla-picker-W3JKfO-o.js} +1 -1
- package/dist/collection/assets/svg/get-directions.svg +6 -0
- package/dist/collection/assets/svg/gps.svg +17 -0
- package/dist/collection/assets/svg/location.svg +8 -4
- package/dist/collection/assets/svg/marker.svg +28 -0
- package/dist/collection/assets/svg/mini-google-map.svg +33 -0
- package/dist/collection/assets/svg/mini-map.svg +31 -0
- package/dist/collection/assets/svg/store3.svg +12 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/salla-bullet-delivery/api-service.js +135 -0
- package/dist/collection/components/salla-bullet-delivery/helpers.js +125 -0
- package/dist/collection/components/salla-bullet-delivery/interfaces.js +1 -0
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.css +23 -0
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +1827 -0
- package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +16 -4
- package/dist/collection/components/salla-color-picker/salla-color-picker.js +1 -1
- package/dist/collection/components/salla-comment-form/salla-comment-form.js +1 -1
- package/dist/collection/components/salla-comments/salla-comment-item.js +3 -3
- package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.js +1 -1
- package/dist/collection/components/salla-cookies-bar/salla-cookies-bar.js +16 -69
- package/dist/collection/components/salla-count-down/salla-count-down.js +1 -1
- package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +1 -1
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +2 -2
- package/dist/collection/components/salla-filters/salla-filters.js +1 -1
- package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +2 -2
- package/dist/collection/components/salla-gifting/salla-gifting.js +2 -2
- package/dist/collection/components/salla-hook/salla-hook.js +1 -1
- package/dist/collection/components/salla-list-tile/salla-list-tile.js +1 -1
- package/dist/collection/components/salla-loading/salla-loading.js +1 -1
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +1 -1
- package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +1 -1
- package/dist/collection/components/salla-loyalty-program/salla-loyalty-program.js +1 -1
- package/dist/collection/components/salla-maintenance-alert/salla-maintenance-alert.js +1 -1
- package/dist/collection/components/salla-map/salla-map.js +3 -3
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +1 -1
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +4 -4
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +1 -1
- package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +1 -1
- package/dist/collection/components/salla-notifications/salla-notification-item.js +1 -1
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +1 -1
- package/dist/collection/components/salla-order-details/salla-order-details.js +1 -1
- package/dist/collection/components/salla-order-summary/salla-order-summary.js +1 -1
- package/dist/collection/components/salla-payments/salla-payments.js +2 -2
- package/dist/collection/components/salla-placeholder/salla-placeholder.js +1 -1
- package/dist/collection/components/salla-price-range/salla-price-range.js +2 -2
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +1 -1
- package/dist/collection/components/salla-product-card/salla-product-card.js +5 -5
- package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +1 -1
- package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +1 -1
- package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
- package/dist/collection/components/salla-reviews/salla-reviews.js +1 -1
- package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
- package/dist/collection/components/salla-scopes/salla-scopes.js +1 -1
- package/dist/collection/components/salla-search/salla-search.js +3 -3
- package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
- package/dist/collection/components/salla-social/salla-social.js +1 -1
- package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
- package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
- package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/location.js +14 -0
- package/dist/components/salla-bullet-delivery.d.ts +11 -0
- package/dist/components/salla-bullet-delivery.js +2060 -0
- package/dist/components/salla-cart-summary.js +16 -4
- package/dist/components/salla-color-picker2.js +1 -1
- package/dist/components/salla-comment-form2.js +1 -1
- package/dist/components/salla-comment-item2.js +3 -3
- package/dist/components/salla-conditional-fields2.js +1 -1
- package/dist/components/salla-cookies-bar.js +15 -9
- package/dist/components/salla-count-down2.js +1 -1
- package/dist/components/salla-datetime-picker2.js +1 -1
- package/dist/components/salla-file-upload2.js +2 -2
- package/dist/components/salla-filters-widget2.js +2 -2
- package/dist/components/salla-filters.js +1 -1
- package/dist/components/salla-gifting.js +2 -2
- package/dist/components/salla-hook.js +1 -1
- package/dist/components/salla-list-tile2.js +1 -1
- package/dist/components/salla-loading2.js +1 -1
- package/dist/components/salla-localization-modal.js +1 -1
- package/dist/components/salla-loyalty-prize-item.js +1 -1
- package/dist/components/salla-loyalty-program.js +1 -1
- package/dist/components/salla-maintenance-alert.js +1 -1
- package/dist/components/salla-map2.js +4 -10
- package/dist/components/salla-multiple-bundle-product-cart2.js +1 -1
- package/dist/components/salla-multiple-bundle-product-details2.js +2 -2
- package/dist/components/salla-multiple-bundle-product-options-modal2.js +4 -4
- package/dist/components/salla-multiple-bundle-product-slider2.js +1 -1
- package/dist/components/salla-multiple-bundle-product.js +1 -1
- package/dist/components/salla-notification-item2.js +1 -1
- package/dist/components/salla-offer-modal.js +1 -1
- package/dist/components/salla-order-details.js +1 -1
- package/dist/components/salla-order-summary.js +1 -1
- package/dist/components/salla-payments.js +2 -2
- package/dist/components/salla-placeholder2.js +1 -1
- package/dist/components/salla-price-range2.js +2 -2
- package/dist/components/salla-product-availability2.js +1 -1
- package/dist/components/salla-product-card2.js +5 -5
- package/dist/components/salla-product-size-guide.js +2 -2
- package/dist/components/salla-quantity-input.js +1 -1
- package/dist/components/salla-quick-buy2.js +1 -1
- package/dist/components/salla-review-card2.js +1 -1
- package/dist/components/salla-reviews-page.js +1 -1
- package/dist/components/salla-reviews.js +1 -1
- package/dist/components/salla-scopes.js +1 -1
- package/dist/components/salla-search.js +3 -3
- package/dist/components/salla-skeleton2.js +1 -1
- package/dist/components/salla-social-share.js +1 -1
- package/dist/components/salla-social.js +1 -1
- package/dist/components/salla-tab-content2.js +1 -1
- package/dist/components/salla-tab-header2.js +1 -1
- package/dist/components/salla-tabs2.js +1 -1
- package/dist/components/salla-tel-input2.js +1 -1
- package/dist/components/salla-tooltip2.js +1 -1
- package/dist/components/salla-user-settings.js +1 -1
- package/dist/esm/{filepond-BhRqbCAg.js → filepond-CVt8gG7K.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-Czu5ACER.js → filepond-plugin-file-poster-ByDhiu8k.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-BZbSUj1B.js → filepond-plugin-file-validate-size-C46KRc5n.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-DKYfoXoT.js → filepond-plugin-file-validate-type-7wK_W1ju.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-WuB5nx6B.js → filepond-plugin-image-edit-BbFosret.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-noX6t0j9.js → filepond-plugin-image-exif-orientation-DXsWsxNp.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-Czg9NDfH.js → filepond-plugin-image-preview-BZoHvyw-.js} +1 -1
- package/dist/esm/{index-De4u_OiV.js → index-SkTHIgsP.js} +6 -2
- package/dist/esm/{index-Dtrxto6J.js → index-x1gUeQbQ.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/location-BO5AoBAP.js +14 -0
- package/dist/esm/salla-accordion-body_3.entry.js +5 -11
- package/dist/esm/salla-accordion_6.entry.js +2 -2
- package/dist/esm/salla-add-product-button_4.entry.js +3 -3
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-booking-field_7.entry.js +17 -17
- package/dist/esm/salla-bullet-delivery.entry.js +1978 -0
- package/dist/esm/salla-cart-item-offers_2.entry.js +17 -5
- package/dist/esm/salla-comment-form_8.entry.js +8 -8
- 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 +12 -7
- package/dist/esm/salla-count-down_2.entry.js +7 -7
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +3 -3
- package/dist/esm/salla-filters.entry.js +2 -2
- package/dist/esm/salla-gifting.entry.js +3 -3
- package/dist/esm/salla-hook.entry.js +2 -2
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +2 -2
- package/dist/esm/salla-localization-modal.entry.js +2 -2
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +2 -2
- package/dist/esm/salla-loyalty-program.entry.js +2 -2
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +2 -2
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +4 -4
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +6 -6
- package/dist/esm/salla-multiple-bundle-product.entry.js +2 -2
- package/dist/esm/salla-notification-item.entry.js +2 -2
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +2 -2
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +2 -2
- package/dist/esm/salla-order-summary.entry.js +2 -2
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +3 -3
- package/dist/esm/salla-placeholder.entry.js +2 -2
- package/dist/esm/salla-price-range.entry.js +3 -3
- package/dist/esm/salla-product-size-guide.entry.js +3 -3
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-products-slider.entry.js +1 -1
- package/dist/esm/salla-progress-bar.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +2 -2
- package/dist/esm/salla-search.entry.js +4 -4
- package/dist/esm/salla-skeleton.entry.js +2 -2
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +2 -2
- package/dist/esm/salla-social.entry.js +2 -2
- package/dist/esm/salla-tab-content_3.entry.js +4 -4
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +2 -2
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +2 -2
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-rbpgRFmW.js → vanilla-picker-CBzZiD3g.js} +1 -1
- package/dist/twilight/{p-40ff5179.entry.js → p-001b7ef6.entry.js} +1 -1
- package/dist/twilight/{p-eaa6e008.entry.js → p-07fdc902.entry.js} +1 -1
- package/dist/twilight/{p-d0c47c31.entry.js → p-0ad3a828.entry.js} +1 -1
- package/dist/twilight/{p-09feb665.entry.js → p-0b53d638.entry.js} +1 -1
- package/dist/twilight/{p-8006c4fb.entry.js → p-13b496e7.entry.js} +1 -1
- package/dist/twilight/{p-7f3f771a.entry.js → p-18e52d0e.entry.js} +1 -1
- package/dist/twilight/{p-c3706c8f.entry.js → p-1e8fbd9f.entry.js} +1 -1
- package/dist/twilight/{p-dfadafad.entry.js → p-236372e3.entry.js} +1 -1
- package/dist/twilight/{p-5654e5ee.entry.js → p-27e70f37.entry.js} +1 -1
- package/dist/twilight/{p-884cb4c5.entry.js → p-2820ce1d.entry.js} +1 -1
- package/dist/twilight/{p-6ff50966.entry.js → p-2ab48cac.entry.js} +1 -1
- package/dist/twilight/{p-295915a0.entry.js → p-2f692fcf.entry.js} +1 -1
- package/dist/twilight/{p-69c58d83.entry.js → p-301c2f68.entry.js} +1 -1
- package/dist/twilight/{p-bac83103.entry.js → p-3243737f.entry.js} +1 -1
- package/dist/twilight/{p-8edd8051.entry.js → p-35024791.entry.js} +1 -1
- package/dist/twilight/{p-11408fba.entry.js → p-3bf9141e.entry.js} +1 -1
- package/dist/twilight/{p-5744d83c.entry.js → p-3eaa8925.entry.js} +1 -1
- package/dist/twilight/{p-67840827.entry.js → p-3fe97989.entry.js} +1 -1
- package/dist/twilight/{p-55447584.entry.js → p-409f7136.entry.js} +1 -1
- package/dist/twilight/{p-5e1573ea.entry.js → p-463e4f76.entry.js} +1 -1
- package/dist/twilight/{p-f86cd123.entry.js → p-4cf58a9c.entry.js} +1 -1
- package/dist/twilight/{p-b5dc631b.entry.js → p-4fa45c6a.entry.js} +1 -1
- package/dist/twilight/p-504b5014.entry.js +4 -0
- package/dist/twilight/{p-4a76e050.entry.js → p-511ca10b.entry.js} +1 -1
- package/dist/twilight/{p-0dd6679c.entry.js → p-51de8331.entry.js} +1 -1
- package/dist/twilight/{p-d3680fb2.entry.js → p-53b2e08f.entry.js} +1 -1
- package/dist/twilight/{p-ab3aa0c4.entry.js → p-53cc3cef.entry.js} +1 -1
- package/dist/twilight/{p-bcc2be67.entry.js → p-5905a86a.entry.js} +1 -1
- package/dist/twilight/{p-db533685.entry.js → p-59db4c52.entry.js} +1 -1
- package/dist/twilight/{p-a2b26070.entry.js → p-5b9bc272.entry.js} +1 -1
- package/dist/twilight/{p-f63ba8ce.entry.js → p-5bf0ced8.entry.js} +1 -1
- package/dist/twilight/{p-Db-E_0Rj.js → p-5dujJcuF.js} +1 -1
- package/dist/twilight/{p-55789c14.entry.js → p-6036b492.entry.js} +1 -1
- package/dist/twilight/p-6837da63.entry.js +4 -0
- package/dist/twilight/{p-7f999201.entry.js → p-75769c80.entry.js} +1 -1
- package/dist/twilight/p-7d72642b.entry.js +4 -0
- package/dist/twilight/p-861be114.entry.js +4 -0
- package/dist/twilight/p-86982850.entry.js +4 -0
- package/dist/twilight/p-8b505e2a.entry.js +4 -0
- package/dist/twilight/{p-a63d0e39.entry.js → p-8e97544e.entry.js} +1 -1
- package/dist/twilight/{p-8eaf241e.entry.js → p-94f73964.entry.js} +1 -1
- package/dist/twilight/{p-d6536ce3.entry.js → p-9d497735.entry.js} +1 -1
- package/dist/twilight/{p-6a0df26c.entry.js → p-9ebe9909.entry.js} +1 -1
- package/dist/twilight/{p-Btrb7IoM.js → p-BF4uw95J.js} +1 -1
- package/dist/twilight/p-BO5AoBAP.js +4 -0
- package/dist/twilight/{p-Wi2aT09S.js → p-BgZuVAWD.js} +1 -1
- package/dist/twilight/{p-B-3IShme.js → p-Cp0TiBtU.js} +1 -1
- package/dist/twilight/{p-B9mALQjv.js → p-DICe9yRT.js} +1 -1
- package/dist/twilight/{p-BcUTU-HF.js → p-DPmKuJIj.js} +2 -2
- package/dist/twilight/{p-CbQiaV8S.js → p-D_zRqCzR.js} +1 -1
- package/dist/twilight/{p-BFLhXraR.js → p-DcBxzAOm.js} +2 -2
- package/dist/twilight/{p-C4_JENkr.js → p-Dr5NxBjb.js} +1 -1
- package/dist/twilight/{p-De4u_OiV.js → p-SkTHIgsP.js} +1 -1
- package/dist/twilight/p-a473108d.entry.js +4 -0
- package/dist/twilight/{p-0d942f6b.entry.js → p-a9e61f29.entry.js} +1 -1
- package/dist/twilight/p-acc5aba0.entry.js +4 -0
- package/dist/twilight/{p-0743ad3f.entry.js → p-afb92112.entry.js} +1 -1
- package/dist/twilight/{p-0f8d378c.entry.js → p-b3fad8c9.entry.js} +1 -1
- package/dist/twilight/{p-3190dbfb.entry.js → p-b8b9c8c0.entry.js} +1 -1
- package/dist/twilight/{p-810d7f34.entry.js → p-bc174ca1.entry.js} +1 -1
- package/dist/twilight/{p-b7047136.entry.js → p-bdb38d1b.entry.js} +1 -1
- package/dist/twilight/{p-b1aaa74b.entry.js → p-c1bdca57.entry.js} +1 -1
- package/dist/twilight/{p-a1588d0d.entry.js → p-c9179f5b.entry.js} +1 -1
- package/dist/twilight/{p-948e44b1.entry.js → p-d100ac0c.entry.js} +1 -1
- package/dist/twilight/{p-fba6d1c9.entry.js → p-d45adf75.entry.js} +1 -1
- package/dist/twilight/{p-edec367c.entry.js → p-d5c633e3.entry.js} +1 -1
- package/dist/twilight/{p-0361337c.entry.js → p-d95a2fee.entry.js} +1 -1
- package/dist/twilight/{p-ad9f616f.entry.js → p-d969b269.entry.js} +1 -1
- package/dist/twilight/{p-f894c79f.entry.js → p-db479d0a.entry.js} +1 -1
- package/dist/twilight/{p-77bd2500.entry.js → p-e100b798.entry.js} +1 -1
- package/dist/twilight/{p-72941677.entry.js → p-e1222500.entry.js} +1 -1
- package/dist/twilight/{p-cc9f3079.entry.js → p-e452b815.entry.js} +1 -1
- package/dist/twilight/{p-665ea882.entry.js → p-e5758e7c.entry.js} +1 -1
- package/dist/twilight/p-e975235b.entry.js +4 -0
- package/dist/twilight/{p-96d0ca21.entry.js → p-ebb88e7b.entry.js} +1 -1
- package/dist/twilight/{p-e7a71145.entry.js → p-ec8e267b.entry.js} +1 -1
- package/dist/twilight/{p-619fdc7f.entry.js → p-f0ad1125.entry.js} +1 -1
- package/dist/twilight/{p-4bdf1e1b.entry.js → p-f64f5502.entry.js} +1 -1
- package/dist/twilight/{p-16cdf1aa.entry.js → p-f89add85.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-bullet-delivery/api-service.d.ts +61 -0
- package/dist/types/components/salla-bullet-delivery/helpers.d.ts +39 -0
- package/dist/types/components/salla-bullet-delivery/interfaces.d.ts +297 -0
- package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +202 -0
- package/dist/types/components/salla-cart-summary/salla-cart-summary.d.ts +2 -1
- package/dist/types/components/salla-cookies-bar/salla-cookies-bar.d.ts +5 -9
- package/dist/types/components.d.ts +57 -26
- package/package.json +5 -5
- package/dist/twilight/p-4970483c.entry.js +0 -4
- package/dist/twilight/p-4e52bc62.entry.js +0 -4
- package/dist/twilight/p-61619fec.entry.js +0 -4
- package/dist/twilight/p-a90a0bb7.entry.js +0 -4
- package/dist/twilight/p-b9dfbb9f.entry.js +0 -4
- package/dist/twilight/p-c8aa07fd.entry.js +0 -4
- package/dist/twilight/p-fae39494.entry.js +0 -4
- package/dist/twilight/p-fde5d559.entry.js +0 -4
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g filter="url(#filter0_d_24181_220540)">
|
|
3
|
+
<mask id="mask0_24181_220540" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="1" y="0" width="33" height="32">
|
|
4
|
+
<rect x="1.90958" y="0.576577" width="30.8468" height="30.8468" rx="9.22523" fill="#D9D9D9" stroke="white" stroke-width="1.15315"/>
|
|
5
|
+
</mask>
|
|
6
|
+
<g mask="url(#mask0_24181_220540)">
|
|
7
|
+
<rect x="1.90958" y="0.576577" width="30.8468" height="30.8468" rx="9.22523" fill="#E8E8E8" stroke="white" stroke-width="1.15315"/>
|
|
8
|
+
<path d="M17.9096 6.77445L28.7204 5.33301H32.4681L32.7564 11.8195V23.6393L10.4141 23.9276V10.8105L17.9096 6.77445Z" fill="#97E7C8"/>
|
|
9
|
+
<path d="M-2.70303 10.6664H10.2699M41.6934 5.47722C38.378 5.47722 34.7744 5.47722 27.8555 5.47722C20.9366 5.47722 18.4862 6.63037 15.4591 8.64839C12.4321 10.6664 10.2699 10.6664 10.2699 10.6664M10.2699 34.4502V23.6394M10.2699 10.6664V23.6394M-6.16249 23.6394H10.2699M10.2699 23.6394H21.0807M38.8105 23.6394H21.0807M21.0807 23.6394V34.4502" stroke="white" stroke-width="2.30631"/>
|
|
10
|
+
<rect x="2.34202" y="1.00901" width="29.982" height="29.982" rx="8.79279" stroke="white" stroke-width="2.01802"/>
|
|
11
|
+
</g>
|
|
12
|
+
<g clip-path="url(#clip0_24181_220540)">
|
|
13
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.069 19.8621C19.4995 18.6902 22.171 16.0948 22.171 13.0548C22.171 11.7333 21.6461 10.466 20.7117 9.5316C19.7773 8.5972 18.51 8.07227 17.1885 8.07227C15.8671 8.07227 14.5998 8.5972 13.6654 9.5316C12.731 10.466 12.2061 11.7333 12.2061 13.0548C12.2061 16.0948 14.8776 18.6902 16.3081 19.8621C16.5553 20.0679 16.8669 20.1806 17.1885 20.1806C17.5102 20.1806 17.8218 20.0679 18.069 19.8621ZM17.1885 14.1618C17.517 14.1618 17.838 14.0644 18.1111 13.8819C18.3842 13.6995 18.597 13.4401 18.7227 13.1367C18.8484 12.8333 18.8812 12.4994 18.8172 12.1773C18.7531 11.8552 18.595 11.5593 18.3627 11.3271C18.1305 11.0948 17.8346 10.9367 17.5125 10.8726C17.1904 10.8085 16.8565 10.8414 16.5531 10.9671C16.2497 11.0928 15.9903 11.3056 15.8079 11.5787C15.6254 11.8518 15.528 12.1728 15.528 12.5012C15.528 12.9416 15.703 13.364 16.0144 13.6754C16.3258 13.9868 16.7481 14.1618 17.1885 14.1618Z" fill="#55575D"/>
|
|
14
|
+
</g>
|
|
15
|
+
</g>
|
|
16
|
+
<defs>
|
|
17
|
+
<filter id="filter0_d_24181_220540" x="-0.000325561" y="0" width="34.6667" height="34.6667" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
18
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
19
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
20
|
+
<feOffset dy="1.33333"/>
|
|
21
|
+
<feGaussianBlur stdDeviation="0.666667"/>
|
|
22
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0"/>
|
|
23
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_24181_220540"/>
|
|
24
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_24181_220540" result="shape"/>
|
|
25
|
+
</filter>
|
|
26
|
+
<clipPath id="clip0_24181_220540">
|
|
27
|
+
<rect width="12.1081" height="12.1081" fill="white" transform="translate(11.1338 8.07227)"/>
|
|
28
|
+
</clipPath>
|
|
29
|
+
</defs>
|
|
30
|
+
</svg>
|
|
31
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg width="15" height="14" viewBox="0 0 15 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path
|
|
3
|
+
d="M1.14453 5.83032L1.14453 9.16486C1.14453 11.0511 1.14453 11.9943 1.73032 12.5803C2.3161 13.1663 3.25891 13.1663 5.14453 13.1663L9.14453 13.1663C11.0301 13.1663 11.9729 13.1663 12.5587 12.5803C13.1445 11.9943 13.1445 11.0511 13.1445 9.16486V5.83032"
|
|
4
|
+
stroke="currentcolor" stroke-linecap="round" />
|
|
5
|
+
<path
|
|
6
|
+
d="M9.14453 10.1619C8.68846 10.5667 7.9624 10.8285 7.14453 10.8285C6.32666 10.8285 5.60059 10.5667 5.14453 10.1619"
|
|
7
|
+
stroke="currentcolor" stroke-linecap="round" />
|
|
8
|
+
<path
|
|
9
|
+
d="M5.90256 4.44533C5.71455 5.12426 5.03086 6.29542 3.73185 6.46516C2.58488 6.61502 1.71497 6.11437 1.49277 5.90504C1.24779 5.7353 0.689441 5.19216 0.552703 4.85269C0.415966 4.51322 0.575492 3.77771 0.689441 3.47785L1.14495 2.15892C1.25615 1.82765 1.51646 1.04411 1.78334 0.779094C2.05022 0.514073 2.59054 0.502543 2.81294 0.502543L7.48329 0.502543C8.68543 0.519525 11.3139 0.491824 11.8335 0.502545C12.3532 0.513266 12.6654 0.948828 12.7565 1.13553C13.5318 3.01341 13.8333 4.08889 13.8333 4.54717C13.7321 5.03605 13.3133 5.95787 11.8335 6.36332C10.2956 6.7847 9.42363 5.96509 9.15007 5.65043M5.27015 5.65044C5.48665 5.91635 6.16578 6.45158 7.15029 6.46516C8.1348 6.47873 8.98485 5.79188 9.28681 5.44676C9.37227 5.34492 9.55687 5.04279 9.7483 4.44533"
|
|
10
|
+
stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" />
|
|
11
|
+
</svg>
|
|
12
|
+
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"components/salla-booking-field/salla-booking-field.js",
|
|
13
13
|
"components/salla-bottom-alert/salla-bottom-alert.js",
|
|
14
14
|
"components/salla-breadcrumb/salla-breadcrumb.js",
|
|
15
|
+
"components/salla-bullet-delivery/salla-bullet-delivery.js",
|
|
15
16
|
"components/salla-button/salla-button.js",
|
|
16
17
|
"components/salla-cart-item-offers/salla-cart-item-offers.js",
|
|
17
18
|
"components/salla-cart-summary/salla-cart-summary.js",
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* API Service for salla-bullet-delivery component
|
|
6
|
+
* Uses Salla's shipping API and scope API for delivery location management
|
|
7
|
+
*/
|
|
8
|
+
const API_LOG_PREFIX = 'BulletDeliveryAPI';
|
|
9
|
+
const validId = (id) => {
|
|
10
|
+
const n = id == null ? Number.NaN : Number(id);
|
|
11
|
+
return !Number.isNaN(n) && n !== 0;
|
|
12
|
+
};
|
|
13
|
+
async function withApiErrorHandling(fn, fallback, logLabel) {
|
|
14
|
+
try {
|
|
15
|
+
return await fn();
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
console.error(`${API_LOG_PREFIX}: ${logLabel}`, error);
|
|
19
|
+
return fallback;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** Uses country code from API (e.g. 'SA'). */
|
|
23
|
+
export const isSaudiArabia = (countryCode) => String(countryCode).toUpperCase() === 'SA';
|
|
24
|
+
/**
|
|
25
|
+
* Fast Delivery API Service
|
|
26
|
+
* Uses Salla's shipping API and scopes API. Branch and address data are used as returned by the API (no mapping).
|
|
27
|
+
*/
|
|
28
|
+
export const bulletDeliveryAPI = {
|
|
29
|
+
/**
|
|
30
|
+
* Get available countries from Salla shipping API
|
|
31
|
+
* @param forBranch - when true, use for_branch=1 (e.g. for pickup/branches tab)
|
|
32
|
+
*/
|
|
33
|
+
async getCountries(forBranch = false) {
|
|
34
|
+
return withApiErrorHandling(async () => {
|
|
35
|
+
const data = (await salla.api.request("shipping/countries", { params: { for_branch: forBranch ? 1 : 0 } }))?.data ?? [];
|
|
36
|
+
return data.map((c) => ({ id: c.id, code: c.code, name: c.name, has_regions: isSaudiArabia(c.code) }));
|
|
37
|
+
}, [], 'Error getting countries');
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* Get regions for a country from Salla shipping API
|
|
41
|
+
* Endpoint: GET /shipping/countries/<COUNTRY_ID>/region
|
|
42
|
+
*/
|
|
43
|
+
async getRegions(countryId) {
|
|
44
|
+
if (!validId(countryId)) {
|
|
45
|
+
console.warn(`${API_LOG_PREFIX}: getRegions called without valid country_id`);
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
return withApiErrorHandling(async () => {
|
|
49
|
+
const data = (await salla.api.request(`shipping/countries/${countryId}/regions`))?.data ?? [];
|
|
50
|
+
return data.map((r) => ({ id: r.id, name: r.name, code: r.code, country_id: Number(countryId) }));
|
|
51
|
+
}, [], 'Error fetching regions');
|
|
52
|
+
},
|
|
53
|
+
/**
|
|
54
|
+
* Get cities from Salla shipping API
|
|
55
|
+
* @param regionId - Optional; when provided (e.g. for SA), cities are filtered by region
|
|
56
|
+
*/
|
|
57
|
+
async getCities(countryId, regionId) {
|
|
58
|
+
if (!validId(countryId)) {
|
|
59
|
+
console.warn(`${API_LOG_PREFIX}: getCities called without valid country_id`);
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
return withApiErrorHandling(async () => {
|
|
63
|
+
const params = { for_branch: 0, country_id: countryId };
|
|
64
|
+
if (regionId)
|
|
65
|
+
params.region_id = regionId;
|
|
66
|
+
const data = (await salla.api.request("shipping/cities", { params }))?.data ?? [];
|
|
67
|
+
return data.map((c) => ({ id: c.id, name: c.name, country_id: countryId, ...(c.region_id != null && { region_id: c.region_id }) }));
|
|
68
|
+
}, [], 'Error fetching cities');
|
|
69
|
+
},
|
|
70
|
+
/**
|
|
71
|
+
* Get districts from Salla shipping API
|
|
72
|
+
*/
|
|
73
|
+
async getDistricts(cityId) {
|
|
74
|
+
if (!validId(cityId)) {
|
|
75
|
+
console.warn(`${API_LOG_PREFIX}: getDistricts called without valid city_id`);
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
return withApiErrorHandling(async () => {
|
|
79
|
+
const raw = (await salla.api.request("shipping/districts", { params: { for_branch: 0, city_id: cityId } }))?.data;
|
|
80
|
+
const list = Array.isArray(raw) ? raw : (Array.isArray(raw?.districts) ? raw.districts : []);
|
|
81
|
+
return list.map((d) => ({ id: d.id, name: d.name, name_en: d.name_en, city_id: cityId }));
|
|
82
|
+
}, [], 'Error fetching districts');
|
|
83
|
+
},
|
|
84
|
+
async getSavedAddresses() {
|
|
85
|
+
return withApiErrorHandling(async () => {
|
|
86
|
+
const data = (await salla.api.request("address"))?.data;
|
|
87
|
+
return Array.isArray(data) ? data : [];
|
|
88
|
+
}, [], 'Error fetching user addresses');
|
|
89
|
+
},
|
|
90
|
+
async getBranches({ query, lat, lng, country_id, per_page = 20 } = {}) {
|
|
91
|
+
return withApiErrorHandling(async () => {
|
|
92
|
+
const params = { per_page };
|
|
93
|
+
if (query?.trim().length >= 2)
|
|
94
|
+
params.query = query;
|
|
95
|
+
if (lat)
|
|
96
|
+
params.lat = lat;
|
|
97
|
+
if (lng)
|
|
98
|
+
params.lng = lng;
|
|
99
|
+
if (country_id)
|
|
100
|
+
params.country_id = country_id;
|
|
101
|
+
const res = await salla.api.request("branches", { params });
|
|
102
|
+
return (Array.isArray(res?.data) ? res.data : []);
|
|
103
|
+
}, [], 'Error fetching branches');
|
|
104
|
+
},
|
|
105
|
+
async saveAddressLocation(payload) {
|
|
106
|
+
return withApiErrorHandling(async () => {
|
|
107
|
+
const res = await salla.api.request('address/location', { ...payload, for_allocation: true }, 'post');
|
|
108
|
+
const data = res?.data ?? res;
|
|
109
|
+
const address = typeof data === 'object' && data != null && 'id' in data ? data : undefined;
|
|
110
|
+
return { success: true, address };
|
|
111
|
+
}, { success: false }, 'Error saving address/location');
|
|
112
|
+
},
|
|
113
|
+
async setDeliveryScope(scopeId) {
|
|
114
|
+
return withApiErrorHandling(async () => {
|
|
115
|
+
await salla.scope.change({ id: scopeId });
|
|
116
|
+
salla.storage.set("scope", { ...(salla.storage.get("scope") || {}), id: scopeId });
|
|
117
|
+
return true;
|
|
118
|
+
}, false, 'Error setting delivery scope');
|
|
119
|
+
},
|
|
120
|
+
async allocateScope(payload) {
|
|
121
|
+
const errMsg = (d) => d?.error?.message ?? d?.message ?? 'Failed to allocate scope';
|
|
122
|
+
try {
|
|
123
|
+
const response = await salla.api.request("scopes/allocation", payload, 'post');
|
|
124
|
+
// SDK resolves with { data } and throws on non-2xx; any resolved value is success
|
|
125
|
+
const data = response?.data ?? response;
|
|
126
|
+
return { success: true, data: data };
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
console.error(`${API_LOG_PREFIX}: Error allocating scope`, error);
|
|
130
|
+
const err = error;
|
|
131
|
+
return { success: false, error: err?.response?.data != null ? errMsg(err.response.data) : (err?.message ?? 'Unknown error') };
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
export default bulletDeliveryAPI;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Helper functions for salla-bullet-delivery component
|
|
6
|
+
*/
|
|
7
|
+
import { isSaudiArabia } from "./api-service";
|
|
8
|
+
const EARTH_RADIUS_KM = 6371;
|
|
9
|
+
const deg2rad = (deg) => deg * (Math.PI / 180);
|
|
10
|
+
/** Haversine distance in km */
|
|
11
|
+
function calculateDistance(lat1, lon1, lat2, lon2) {
|
|
12
|
+
const dLat = deg2rad(lat2 - lat1);
|
|
13
|
+
const dLon = deg2rad(lon2 - lon1);
|
|
14
|
+
const a = Math.sin(dLat / 2) ** 2 +
|
|
15
|
+
Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(dLon / 2) ** 2;
|
|
16
|
+
return EARTH_RADIUS_KM * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
17
|
+
}
|
|
18
|
+
/** First working-hours slot from API branch.working_hours[].times[]. */
|
|
19
|
+
export const getBranchFirstSlot = (workingHours) => workingHours?.[0]?.times?.[0] ?? null;
|
|
20
|
+
/** Nearest available branch by distance; single pass O(n). */
|
|
21
|
+
export function findNearestBranch(branches, userLat, userLon) {
|
|
22
|
+
let nearest = null;
|
|
23
|
+
let minD = Number.POSITIVE_INFINITY;
|
|
24
|
+
for (const b of branches) {
|
|
25
|
+
const lat = b.location?.lat != null ? Number(b.location.lat) : Number.NaN;
|
|
26
|
+
const lng = b.location?.lng != null ? Number(b.location.lng) : Number.NaN;
|
|
27
|
+
if (Number.isNaN(lat) || Number.isNaN(lng) || b.is_open === false)
|
|
28
|
+
continue;
|
|
29
|
+
const d = calculateDistance(userLat, userLon, lat, lng);
|
|
30
|
+
if (d < minD) {
|
|
31
|
+
minD = d;
|
|
32
|
+
nearest = b;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return nearest;
|
|
36
|
+
}
|
|
37
|
+
/** 24h time string → locale 12h (e.g. "23:55" → "11:55 PM"). */
|
|
38
|
+
export function formatTimeTo12h(time24, locale) {
|
|
39
|
+
const [h, m] = String(time24).trim().split(':').map(Number);
|
|
40
|
+
return Number.isNaN(h) || Number.isNaN(m)
|
|
41
|
+
? time24
|
|
42
|
+
: new Date(2000, 0, 1, h, m).toLocaleTimeString(locale, { hour: 'numeric', minute: '2-digit', hour12: true });
|
|
43
|
+
}
|
|
44
|
+
/** Working hours display: "until X" when from is 00:00, else "from - to" in 12h. */
|
|
45
|
+
export function formatWorkingHoursDisplay(from, to, locale, untilLabel) {
|
|
46
|
+
const f = String(from).trim();
|
|
47
|
+
const t = String(to).trim();
|
|
48
|
+
return !f || !t ? '' : f === '00:00' ? `${untilLabel} ${formatTimeTo12h(t, locale)}` : `${formatTimeTo12h(f, locale)} - ${formatTimeTo12h(t, locale)}`;
|
|
49
|
+
}
|
|
50
|
+
export const filterBranches = (branches, searchQuery) => {
|
|
51
|
+
if (!searchQuery)
|
|
52
|
+
return branches;
|
|
53
|
+
const q = searchQuery.toLowerCase();
|
|
54
|
+
return branches.filter((b) => b.name.toLowerCase().includes(q) || b.city?.name?.toLowerCase().includes(q));
|
|
55
|
+
};
|
|
56
|
+
/** Match saved address to guest intent by city/district (and optional street). */
|
|
57
|
+
export function findMatchingAddress(guestIntent, userAddresses) {
|
|
58
|
+
const cityId = getIntentCityId(guestIntent);
|
|
59
|
+
const districtId = getIntentDistrictId(guestIntent);
|
|
60
|
+
return userAddresses.find((addr) => {
|
|
61
|
+
const addrCity = addr.city?.id ?? addr.city_id;
|
|
62
|
+
const addrDistrict = addr.district?.id ?? addr.district_id;
|
|
63
|
+
if (cityId == null || addrCity !== cityId)
|
|
64
|
+
return false;
|
|
65
|
+
if (districtId != null) {
|
|
66
|
+
if (addrDistrict !== districtId)
|
|
67
|
+
return false;
|
|
68
|
+
if (guestIntent.street && addr.street)
|
|
69
|
+
return guestIntent.street.toLowerCase() === addr.street.toLowerCase();
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
}) ?? null;
|
|
74
|
+
}
|
|
75
|
+
export const getIntentSubtitle = (intent, toAddress, fromBranch) => {
|
|
76
|
+
if (intent.type === 'branch') {
|
|
77
|
+
const loc = intent.branch_details?.city ?? intent.branch_details?.name;
|
|
78
|
+
return loc ? `${fromBranch} ${loc}`.trim() : '';
|
|
79
|
+
}
|
|
80
|
+
if (intent.type === 'address' && intent.address_details) {
|
|
81
|
+
const addr = [intent.address_details.district?.name, intent.address_details.city?.name, intent.address_details.country?.name].filter(Boolean).join('، ') || intent.address_details.short_address || '';
|
|
82
|
+
return addr ? `${toAddress} ${addr}`.trim() : '';
|
|
83
|
+
}
|
|
84
|
+
return '';
|
|
85
|
+
};
|
|
86
|
+
const idFrom = (val) => (val != null ? Number(val) : undefined);
|
|
87
|
+
export const getIntentCountryId = (i) => idFrom(i?.address_details?.country?.id);
|
|
88
|
+
export const getIntentCountryCode = (i) => i?.country_code ?? i?.address_details?.country?.code ?? '';
|
|
89
|
+
export const getIntentRegionId = (i) => idFrom(i?.address_details?.region?.id);
|
|
90
|
+
export const getIntentCityId = (i) => idFrom(i?.address_details?.city?.id);
|
|
91
|
+
export const getIntentDistrictId = (i) => idFrom(i?.address_details?.district?.id);
|
|
92
|
+
export const getIntentBranchId = (i) => i?.branch_details?.id;
|
|
93
|
+
/** Intent coordinates (branch tab only; address flow no longer uses coordinates). */
|
|
94
|
+
export const getIntentLatitude = (i) => i?.branch_details?.latitude;
|
|
95
|
+
export const getIntentLongitude = (i) => i?.branch_details?.longitude;
|
|
96
|
+
export const hasSessionAddressIntent = (intent) => {
|
|
97
|
+
if (!intent || intent.type !== 'address' || intent.address_id)
|
|
98
|
+
return false;
|
|
99
|
+
const c = getIntentCountryId(intent);
|
|
100
|
+
const city = getIntentCityId(intent);
|
|
101
|
+
const d = getIntentDistrictId(intent);
|
|
102
|
+
const code = getIntentCountryCode(intent);
|
|
103
|
+
return !!(c && city && (!isSaudiArabia(code) || d));
|
|
104
|
+
};
|
|
105
|
+
export const requireRegionAndDistrictForSA = (countryCode, regionId, districtIdOrName) => !countryCode || !isSaudiArabia(countryCode)
|
|
106
|
+
? true
|
|
107
|
+
: (regionId != null && Number(regionId) !== 0) && (districtIdOrName != null && (typeof districtIdOrName === 'number' ? districtIdOrName !== 0 : String(districtIdOrName).trim().length > 0));
|
|
108
|
+
export function buildAddressLocationPayloadFromSelection(options) {
|
|
109
|
+
const { countryId, countryCode, regionId, cityId, districtId, description = '' } = options;
|
|
110
|
+
const desc = description || '';
|
|
111
|
+
return {
|
|
112
|
+
country_id: Number(countryId) || undefined,
|
|
113
|
+
region_id: regionId != null ? Number(regionId) : undefined,
|
|
114
|
+
city_id: cityId != null ? Number(cityId) : undefined,
|
|
115
|
+
district_id: districtId != null ? Number(districtId) : undefined,
|
|
116
|
+
description: desc,
|
|
117
|
+
...(countryCode && isSaudiArabia(countryCode) && { local: desc }),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const GEO_ERROR_MESSAGES = {
|
|
121
|
+
[GeolocationPositionError.PERMISSION_DENIED]: 'Location permission denied',
|
|
122
|
+
[GeolocationPositionError.POSITION_UNAVAILABLE]: 'Location unavailable',
|
|
123
|
+
[GeolocationPositionError.TIMEOUT]: 'Location timeout',
|
|
124
|
+
};
|
|
125
|
+
export const getGeolocationErrorMessage = (errorCode) => GEO_ERROR_MESSAGES[errorCode] ?? 'An error occurred while detecting location';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@supports (interpolate-size: allow-keywords) and (block-size: calc-size(auto, size)) {
|
|
2
|
+
.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body, .s-bullet-delivery-inner {
|
|
3
|
+
@apply [interpolate-size:allow-keywords];
|
|
4
|
+
}
|
|
5
|
+
.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body {
|
|
6
|
+
@apply [overflow:clip] [transition:block-size_500ms_ease];
|
|
7
|
+
}
|
|
8
|
+
.s-bullet-delivery-inner {
|
|
9
|
+
@apply [overflow:clip] [transition:block-size_500ms_ease];
|
|
10
|
+
block-size: calc-size(auto, size);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@keyframes s-bullet-delivery-fade-in {
|
|
15
|
+
from {
|
|
16
|
+
opacity: 0;
|
|
17
|
+
transform: translateY(6px);
|
|
18
|
+
}
|
|
19
|
+
to {
|
|
20
|
+
opacity: 1;
|
|
21
|
+
transform: translateY(0);
|
|
22
|
+
}
|
|
23
|
+
}
|