@salla.sa/twilight-components 2.14.543 → 2.14.545
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-uhJt4caG.js → filepond-B5aWlI3l.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-Dy-GRHf0.js → filepond-plugin-file-poster-BYq39KHd.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-BWIBGLW-.js → filepond-plugin-file-validate-size-Bi3TAsJv.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-DEVtMF0l.js → filepond-plugin-file-validate-type-Ck6S5TuZ.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-DSDoJaLw.js → filepond-plugin-image-edit-DbsdnH5j.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-BdZit5hj.js → filepond-plugin-image-exif-orientation-x7TfJR-2.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-Z3_zQyYR.js → filepond-plugin-image-preview-CrU7vIRk.js} +1 -1
- package/dist/cjs/helpers-DHdDjm5V.js +340 -0
- package/dist/cjs/{index-Bw3b6O6G.js → index-DGpOR-TH.js} +14 -14
- package/dist/cjs/{intlTelInput-CXe3TkdL.js → intlTelInput-DKAXRecW.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{mail-CO8cFZH7.js → mail-C9D8MHae.js} +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +10 -10
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +156 -401
- 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 → salla-comment-form_8.cjs.entry.js} +3 -259
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
- 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 +21 -5
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +3 -3
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +14 -73
- package/dist/cjs/salla-rating-modal.cjs.entry.js +7 -22
- 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.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +4 -4
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +3 -3
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-GTx-kpDm.js → vanilla-picker-DQDSSf6Q.js} +1 -1
- package/dist/collection/collection-manifest.json +12 -14
- package/dist/collection/components/salla-bullet-delivery/helpers.js +3 -0
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +82 -16
- package/dist/collection/components/salla-comments/interfaces.js +0 -12
- package/dist/collection/components/salla-comments/salla-comment-item.js +1 -1
- package/dist/collection/components/salla-comments/salla-comments.js +5 -38
- package/dist/collection/components/salla-delivery-promise/delivery-promise-api.js +1 -1
- package/dist/collection/components/salla-delivery-promise/delivery-promise-intent.js +9 -0
- package/dist/collection/components/salla-delivery-promise/salla-delivery-promise.js +10 -3
- package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +16 -119
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +10 -69
- package/dist/components/helpers.js +319 -0
- package/dist/components/index.js +2 -2
- package/dist/components/salla-bullet-delivery.js +82 -327
- package/dist/components/salla-comment-item2.js +1 -1
- package/dist/components/salla-comments.js +1 -40
- package/dist/components/salla-delivery-promise.js +20 -4
- package/dist/components/salla-rating-modal-v22.js +12 -73
- package/dist/components/salla-rating-modal.js +591 -1
- package/dist/esm/{filepond-plugin-file-poster-BTU_WzVu.js → filepond-plugin-file-poster-CkWxCmZT.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-c_09APqP.js → filepond-plugin-file-validate-size-DlWS-oUK.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-Dz2Lgh8V.js → filepond-plugin-file-validate-type-mdpFM1TG.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-DK7eXs2p.js → filepond-plugin-image-edit-BqPLKgZU.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-DYBURwn_.js → filepond-plugin-image-exif-orientation-CMqFjPu7.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-4WNiH-ie.js → filepond-plugin-image-preview-DjCwk-CI.js} +1 -1
- package/dist/esm/{filepond-BcXR53L3.js → filepond-wd7_MQSV.js} +1 -1
- package/dist/esm/helpers-BDChq2t4.js +319 -0
- package/dist/esm/{index-BW1au-Nh.js → index-CHZfg_a9.js} +14 -14
- package/dist/esm/{intlTelInput-DvPcVtVG.js → intlTelInput-B5Q8rrU9.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mail-DmgxDvXL.js → mail-DzAIgzdz.js} +2 -2
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +1 -1
- package/dist/esm/salla-add-product-button_5.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-attachment-view_9.entry.js +10 -10
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_2.entry.js +83 -328
- 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 → salla-comment-form_8.entry.js} +4 -259
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +3 -3
- 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 +21 -5
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +1 -1
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner_10.entry.js +3 -3
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_2.entry.js +1 -1
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item_2.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-branch.entry.js +1 -1
- package/dist/esm/salla-order-cancel.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/salla-order-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-order-shipments.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-products-slider.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +3 -3
- package/dist/esm/salla-rating-modal-v2.entry.js +14 -73
- package/dist/esm/salla-rating-modal.entry.js +7 -22
- 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.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +4 -4
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +3 -3
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-CDk_knNu.js → vanilla-picker-uNDULydX.js} +1 -1
- package/dist/twilight/{p-df202b1d.entry.js → p-0495bfac.entry.js} +1 -1
- package/dist/twilight/{p-13dbbbdc.entry.js → p-0573a498.entry.js} +1 -1
- package/dist/twilight/{p-b89d8c3c.entry.js → p-06d9e1c5.entry.js} +1 -1
- package/dist/twilight/{p-b1dfc455.entry.js → p-0749cc55.entry.js} +1 -1
- package/dist/twilight/p-0ae39262.entry.js +4 -0
- package/dist/twilight/{p-de83979a.entry.js → p-12836275.entry.js} +1 -1
- package/dist/twilight/p-12f61ae1.entry.js +4 -0
- package/dist/twilight/{p-69f4a089.entry.js → p-1419a93d.entry.js} +1 -1
- package/dist/twilight/{p-baa06c65.entry.js → p-17d49c87.entry.js} +1 -1
- package/dist/twilight/{p-1282e22a.entry.js → p-1ea25389.entry.js} +1 -1
- package/dist/twilight/{p-80c11fae.entry.js → p-2305edcc.entry.js} +1 -1
- package/dist/twilight/{p-10534171.entry.js → p-235d7596.entry.js} +1 -1
- package/dist/twilight/{p-50c0b6fa.entry.js → p-25d9f1b2.entry.js} +1 -1
- package/dist/twilight/{p-16ccbce5.entry.js → p-25f51a7e.entry.js} +1 -1
- package/dist/twilight/{p-3c28560f.entry.js → p-279a1661.entry.js} +1 -1
- package/dist/twilight/{p-ac794ed6.entry.js → p-28248b6b.entry.js} +1 -1
- package/dist/twilight/{p-7afd066a.entry.js → p-2d01a4f5.entry.js} +1 -1
- package/dist/twilight/{p-66c7b9e4.entry.js → p-2d62c947.entry.js} +1 -1
- package/dist/twilight/{p-489d084c.entry.js → p-2db5e829.entry.js} +1 -1
- package/dist/twilight/{p-362792d6.entry.js → p-2de58591.entry.js} +1 -1
- package/dist/twilight/{p-16296dce.entry.js → p-32e3daa3.entry.js} +1 -1
- package/dist/twilight/{p-beb2110d.entry.js → p-345532e5.entry.js} +1 -1
- package/dist/twilight/{p-280e67f0.entry.js → p-346366ba.entry.js} +1 -1
- package/dist/twilight/{p-46399dc8.entry.js → p-35557962.entry.js} +1 -1
- package/dist/twilight/{p-d54acab0.entry.js → p-3672d4f7.entry.js} +1 -1
- package/dist/twilight/{p-315890b5.entry.js → p-37163aef.entry.js} +1 -1
- package/dist/twilight/{p-e184cd72.entry.js → p-391a2ec6.entry.js} +1 -1
- package/dist/twilight/{p-b2b818a5.entry.js → p-3a8be7df.entry.js} +1 -1
- package/dist/twilight/{p-ceb40475.entry.js → p-3f5bc617.entry.js} +1 -1
- package/dist/twilight/{p-cf4efddb.entry.js → p-419499d6.entry.js} +1 -1
- package/dist/twilight/{p-d018fc49.entry.js → p-4ac9a3b6.entry.js} +1 -1
- package/dist/twilight/{p-aa9fb9f5.entry.js → p-5074de7d.entry.js} +1 -1
- package/dist/twilight/{p-65a86613.entry.js → p-51a062cd.entry.js} +1 -1
- package/dist/twilight/p-54e2d320.entry.js +1024 -0
- package/dist/twilight/{p-84679cc1.entry.js → p-5933ba05.entry.js} +1 -1
- package/dist/twilight/{p-4b14e0f8.entry.js → p-5d9a85b0.entry.js} +1 -1
- package/dist/twilight/{p-d7a68f6c.entry.js → p-5ded000f.entry.js} +1 -1
- package/dist/twilight/{p-a3fdec51.entry.js → p-63b01300.entry.js} +1 -1
- package/dist/twilight/{p-677bcf4c.entry.js → p-64efbb2c.entry.js} +1 -1
- package/dist/twilight/{p-feb80402.entry.js → p-67b91397.entry.js} +1 -1
- package/dist/twilight/{p-9b1403fc.entry.js → p-69119c00.entry.js} +1 -1
- package/dist/twilight/{p-6e78ee63.entry.js → p-6c18cc72.entry.js} +1 -1
- package/dist/twilight/{p-1ba8fb02.entry.js → p-6d961d73.entry.js} +1 -1
- package/dist/twilight/{p-64f0c216.entry.js → p-6ff53523.entry.js} +1 -1
- package/dist/twilight/{p-75065cbf.entry.js → p-72ee7071.entry.js} +1 -1
- package/dist/twilight/{p-6d6618f8.entry.js → p-72f54055.entry.js} +1 -1
- package/dist/twilight/{p-3b9dcb0f.entry.js → p-74529abb.entry.js} +1 -1
- package/dist/twilight/{p-664d428e.entry.js → p-766a3291.entry.js} +1 -1
- package/dist/twilight/{p-d3692caf.entry.js → p-788fd019.entry.js} +1 -1
- package/dist/twilight/{p-a15b4245.entry.js → p-82fe9f82.entry.js} +1 -1
- package/dist/twilight/{p-f45f5f91.entry.js → p-832f3a98.entry.js} +1 -1
- package/dist/twilight/{p-89fe5237.entry.js → p-84380d4a.entry.js} +1 -1
- package/dist/twilight/{p-311a905b.entry.js → p-8780a467.entry.js} +1 -1
- package/dist/twilight/{p-7adefcd6.entry.js → p-87e10a68.entry.js} +1 -1
- package/dist/twilight/{p-3cfd4fcd.entry.js → p-88f50d7e.entry.js} +1 -1
- package/dist/twilight/{p-f0a04676.entry.js → p-8fc6e860.entry.js} +1 -1
- package/dist/twilight/{p-cc3a9188.entry.js → p-90e5c3ab.entry.js} +1 -1
- package/dist/twilight/{p-641cc01d.entry.js → p-93aa1b67.entry.js} +1 -1
- package/dist/twilight/{p-a4436d17.entry.js → p-93dabb47.entry.js} +1 -1
- package/dist/twilight/{p-07c013f9.entry.js → p-98108ebe.entry.js} +1 -1
- package/dist/twilight/{p-72960bb3.entry.js → p-989f2adb.entry.js} +1 -1
- package/dist/twilight/{p-4be8900d.entry.js → p-9d224252.entry.js} +1 -1
- package/dist/twilight/p-BDChq2t4.js +4 -0
- package/dist/twilight/{p-D9Y6HNvi.js → p-BPkSO6gd.js} +1 -1
- package/dist/twilight/{p-BUMDIRU5.js → p-BWvO3cE-.js} +1 -1
- package/dist/twilight/{p-BW1au-Nh.js → p-CHZfg_a9.js} +1 -1
- package/dist/twilight/{p-AncUY1nn.js → p-CdgES2Of.js} +1 -1
- package/dist/twilight/{p-DPMPVhgw.js → p-D9VjvNQq.js} +2 -2
- package/dist/twilight/{p-C6nX89oY.js → p-DO7S0QBX.js} +1 -1
- package/dist/twilight/{p-UDPL8zGN.js → p-DtV7npW9.js} +1 -1
- package/dist/twilight/{p-DmgxDvXL.js → p-DzAIgzdz.js} +1 -1
- package/dist/twilight/{p-UIEwOe70.js → p-PCp-0mbL.js} +1 -1
- package/dist/twilight/{p-BjS2Vb6h.js → p-ZinKLSYw.js} +1 -1
- package/dist/twilight/{p-1c82117c.entry.js → p-a0561bd1.entry.js} +1 -1
- package/dist/twilight/{p-1187210a.entry.js → p-a785b49f.entry.js} +1 -1
- package/dist/twilight/{p-13bf1c47.entry.js → p-aa4daadf.entry.js} +1 -1
- package/dist/twilight/p-ab41d26c.entry.js +4 -0
- package/dist/twilight/{p-87cc2e08.entry.js → p-afb03ee5.entry.js} +1 -1
- package/dist/twilight/{p-caa8d5ae.entry.js → p-b279e0bb.entry.js} +1 -1
- package/dist/twilight/{p-bcee5564.entry.js → p-b33392c6.entry.js} +1 -1
- package/dist/twilight/{p-e1eb70d2.entry.js → p-b38c4e39.entry.js} +1 -1
- package/dist/twilight/{p-26f8a482.entry.js → p-bead6e6f.entry.js} +1 -1
- package/dist/twilight/{p-8643930a.entry.js → p-c26043ff.entry.js} +1 -1
- package/dist/twilight/{p-a7a10dbf.entry.js → p-c287e498.entry.js} +1 -1
- package/dist/twilight/{p-87af932a.entry.js → p-c2fe2dbe.entry.js} +1 -1
- package/dist/twilight/{p-6d3a4c41.entry.js → p-c603722c.entry.js} +1 -1
- package/dist/twilight/{p-edebecb3.entry.js → p-c816b198.entry.js} +1 -1
- package/dist/twilight/{p-f3f9d1fb.entry.js → p-c81bce54.entry.js} +1 -1
- package/dist/twilight/{p-40555637.entry.js → p-c9146d50.entry.js} +1 -1
- package/dist/twilight/{p-5335f307.entry.js → p-c92edd6f.entry.js} +1 -1
- package/dist/twilight/{p-821aa95a.entry.js → p-c948a8a8.entry.js} +1 -1
- package/dist/twilight/{p-93c006fc.entry.js → p-d0d3609c.entry.js} +1 -1
- package/dist/twilight/{p-a38dc391.entry.js → p-d9b0fa64.entry.js} +1 -1
- package/dist/twilight/{p-534e7760.entry.js → p-dd823fde.entry.js} +1 -1
- package/dist/twilight/p-e36f62a9.entry.js +4 -0
- package/dist/twilight/{p-beaab93e.entry.js → p-e5a3b689.entry.js} +1 -1
- package/dist/twilight/{p-c7e980aa.entry.js → p-ec281904.entry.js} +1 -1
- package/dist/twilight/{p-68d6fa66.entry.js → p-f07bbbc7.entry.js} +1 -1
- package/dist/twilight/{p-3ad55c42.entry.js → p-f168109d.entry.js} +1 -1
- package/dist/twilight/{p-e8153a9a.entry.js → p-f1d8729d.entry.js} +1 -1
- package/dist/twilight/{p-2a8f1ed4.entry.js → p-f1dfe18b.entry.js} +1 -1
- package/dist/twilight/{p-c23f7b95.entry.js → p-fb1ad954.entry.js} +1 -1
- package/dist/twilight/{p-c214700a.entry.js → p-ffdf5f92.entry.js} +1 -1
- package/dist/twilight/{p-CMWS1gyZ.js → p-ryHWESoh.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-bullet-delivery/helpers.d.ts +1 -0
- package/dist/types/components/salla-bullet-delivery/interfaces.d.ts +14 -4
- package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +2 -0
- package/dist/types/components/salla-comments/interfaces.d.ts +0 -15
- package/dist/types/components/salla-comments/salla-comments.d.ts +2 -5
- package/dist/types/components/salla-delivery-promise/delivery-promise-intent.d.ts +0 -4
- package/dist/types/components/salla-delivery-promise/interfaces.d.ts +2 -1
- package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +3 -16
- package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +2 -10
- package/dist/types/components.d.ts +12 -45
- package/package.json +5 -5
- package/dist/collection/components/salla-verified-review/salla-verified-review.css +0 -162
- package/dist/collection/components/salla-verified-review/salla-verified-review.js +0 -264
- package/dist/components/salla-rating-modal2.js +0 -613
- package/dist/components/salla-verified-review.d.ts +0 -11
- package/dist/components/salla-verified-review.js +0 -325
- package/dist/twilight/p-03d77f90.entry.js +0 -4
- package/dist/twilight/p-4f052df8.entry.js +0 -4
- package/dist/twilight/p-a9674965.entry.js +0 -4
- package/dist/twilight/p-cbe760ce.entry.js +0 -4
- package/dist/twilight/p-e29f28eb.entry.js +0 -1019
- package/dist/types/components/salla-verified-review/salla-verified-review.d.ts +0 -51
|
@@ -1,1019 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,c as e,h as i,H as s,a as r}from"./p-BW1au-Nh.js";import{L as o}from"./p-BO5AoBAP.js";import{S as a}from"./p-BscTeWDc.js";const n="BulletDeliveryAPI",l=t=>{const e=null==t?Number.NaN:Number(t);return!Number.isNaN(e)&&0!==e};async function h(t,e,i){try{return await t()}catch(t){return console.error(`${n}: ${i}`,t),e}}const d=new Map;function c(t){const e=d.get(t);return!e||Date.now()-e.timestamp>3e5?(d.delete(t),null):e.data}function u(t,e){d.set(t,{data:e,timestamp:Date.now()})}const p=t=>"SA"===String(t).toUpperCase(),b={async getCountries(t=!1,e){const i=e?.trim()?null:"countries_"+(t?1:0);if(i){const t=c(i);if(t)return t}const s=await h((async()=>{const i={for_branch:t?1:0};return t&&(i.for_allocation=1),e?.trim()&&(i.query=e.trim()),((await salla.api.request("shipping/countries",{params:i}))?.data??[]).map((t=>({id:t.id,code:t.code,name:t.name,has_regions:p(t.code)})))}),[],"Error getting countries");return i&&s.length>0&&u(i,s),s},async getRegions(t,e){if(!l(t))return console.warn(`${n}: getRegions called without valid country_id`),[];const i=e?.trim()?null:`regions_${t}`;if(i){const t=c(i);if(t)return t}const s=await h((async()=>{const i={};return e?.trim()&&(i.query=e.trim()),((await salla.api.request(`shipping/countries/${t}/regions`,{params:i}))?.data??[]).map((e=>({id:e.id,name:e.name,code:e.code,country_id:Number(t)})))}),[],"Error fetching regions");return i&&s.length>0&&u(i,s),s},async getCities(t,e,i){if(!l(t))return console.warn(`${n}: getCities called without valid country_id`),[];const s=i?.trim()?null:`cities_${t}_${e||"all"}`;if(s){const t=c(s);if(t)return t}const r=await h((async()=>{const s={for_branch:0,country_id:t};return e&&(s.region_id=e),i?.trim()&&(s.query=i.trim()),((await salla.api.request("shipping/cities",{params:s}))?.data??[]).map((e=>({id:e.id,name:e.name,country_id:t,...null!=e.region_id&&{region_id:e.region_id}})))}),[],"Error fetching cities");return s&&r.length>0&&u(s,r),r},getDistricts:async(t,e)=>l(t)?h((async()=>{const i={for_branch:0,city_id:t};e?.trim()&&(i.query=e.trim());const s=(await salla.api.request("shipping/districts",{params:i}))?.data;return(Array.isArray(s)?s:Array.isArray(s?.districts)?s.districts:[]).map((e=>({id:e.id,name:e.name,name_en:e.name_en,city_id:t})))}),[],"Error fetching districts"):(console.warn(`${n}: getDistricts called without valid city_id`),[]),getSavedAddresses:async()=>h((async()=>{const t=(await salla.api.request("address"))?.data;return Array.isArray(t)?t:[]}),[],"Error fetching user addresses"),async getBranches({query:t,lat:e,lng:i,country_id:s,per_page:r=20}={}){const o=t?.trim()?.length>=2||e||i||!s?null:`branches_${s}`;if(o){const t=c(o);if(t)return t}const a=await h((async()=>{const o={per_page:r};t?.trim().length>=2&&(o.query=t),e&&(o.lat=e),i&&(o.lng=i),s&&(o.country_id=s);const a=await salla.api.request("branches",{params:o});return Array.isArray(a?.data)?a.data:[]}),[],"Error fetching branches");return o&&a.length>0&&u(o,a),a},saveAddressLocation:async t=>h((async()=>{const e=await salla.api.request("address/location",{...t,for_allocation:!0},"post"),i=e?.data??e;return{success:!0,address:"object"==typeof i&&null!=i&&"id"in i?i:void 0}}),{success:!1},"Error saving address/location"),setDeliveryScope:async t=>h((async()=>(await salla.api.withoutNotifier((()=>salla.scope.change({id:t}))),salla.storage.set("scope",{...salla.storage.get("scope")||{},id:t}),!0)),!1,"Error setting delivery scope"),async allocateScope(t){const e=t=>t?.error?.message??t?.message??"Failed to allocate scope";try{const e=await salla.api.withoutNotifier((()=>salla.api.request("scopes/allocation",t,"post")));return{success:!0,data:e?.data??e}}catch(t){console.error(`${n}: Error allocating scope`,t);const i=t;return{success:!1,error:null!=i?.response?.data?e(i.response.data):i?.message??"Unknown error"}}},getAddressToken:async()=>h((async()=>{const t=await salla.api.request("address/autocomplete-token");return t?.data?.token??null}),null,"Error fetching address autocomplete token")};function m(){d.clear()}const g=t=>t*(Math.PI/180);function f(t,e,i,s){const r=g(i-t),o=g(s-e),a=Math.sin(r/2)**2+Math.cos(g(t))*Math.cos(g(i))*Math.sin(o/2)**2;return 12742*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}const v=(t,e,i)=>{if("branch"===t.type){const e=t.branch_details?.city??t.branch_details?.name;return e?`${i} ${e}`.trim():""}if("address"===t.type&&t.address_details){const i=[t.address_details.district?.name,t.address_details.city?.name,t.address_details.country?.name].filter(Boolean).join("، ")||t.address_details.short_address||"";return i?`${e} ${i}`.trim():""}return""},y=t=>null!=t?Number(t):void 0,w=t=>y(t?.address_details?.country?.id),x=t=>t?.country_code??t?.address_details?.country?.code??"",k=t=>y(t?.address_details?.region?.id),S=t=>y(t?.address_details?.city?.id),C=t=>y(t?.address_details?.district?.id),_=t=>t?.branch_details?.id,A=t=>t?.branch_details?.latitude,z=t=>t?.branch_details?.longitude,$=t=>{if(!t||"address"!==t.type||t.address_id)return!1;const e=w(t),i=S(t),s=C(t),r=x(t),o=null!=s&&0!==Number(s),a=Boolean(t.address_details?.district?.name?.trim()),n=!p(r)||o||a;return!!(e&&i&&n)},M=(t,e,i)=>!t||!p(t)||null!=e&&0!==Number(e)&&null!=i&&("number"==typeof i?0!==i:String(i).trim().length>0),L={[GeolocationPositionError.PERMISSION_DENIED]:"Location permission denied",[GeolocationPositionError.POSITION_UNAVAILABLE]:"Location unavailable",[GeolocationPositionError.TIMEOUT]:"Location timeout"},E=globalThis,I=E.ShadowRoot&&(void 0===E.ShadyCSS||E.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,P=Symbol(),T=new WeakMap;let B=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==P)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(I&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=T.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&T.set(e,t))}return t}toString(){return this.cssText}};const N=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new B(i,t,P)},D=I?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new B("string"==typeof t?t:t+"",void 0,P))(e)})(t):t
|
|
5
|
-
/**
|
|
6
|
-
* @license
|
|
7
|
-
* Copyright 2017 Google LLC
|
|
8
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/,{is:j,defineProperty:O,getOwnPropertyDescriptor:U,getOwnPropertyNames:F,getOwnPropertySymbols:R,getPrototypeOf:q}=Object,Z=globalThis,G=Z.trustedTypes,V=G?G.emptyScript:"",H=Z.reactiveElementPolyfillSupport,K={toAttribute(t,e){switch(e){case Boolean:t=t?V:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},W=(t,e)=>!j(t,e),Y={attribute:!0,type:String,converter:K,reflect:!1,useDefault:!1,hasChanged:W};Symbol.metadata??=Symbol("metadata"),Z.litPropertyMetadata??=new WeakMap;let J=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);void 0!==s&&O(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:r}=U(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const o=s?.call(this);r?.call(this,e),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;const t=q(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){const t=this.properties,e=[...F(t),...R(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(D(t))}else void 0!==t&&e.push(D(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(I)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),s=E.litNonce;void 0!==s&&e.setAttribute("nonce",s),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:K).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,s=i._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=i.getPropertyOptions(s),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:K;this._$Em=s;const o=r.fromAttribute(e,t.type);this[s]=o??this._$Ej?.get(s)??o,this._$Em=null}}requestUpdate(t,e,i,s=!1,r){if(void 0!==t){const o=this.constructor;if(!1===s&&(r=this[t]),i??=o.getPropertyOptions(t),!((i.hasChanged??W)(r,e)||i.useDefault&&i.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:r},o){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==r||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};J.elementStyles=[],J.shadowRootOptions={mode:"open"},J.elementProperties=new Map,J.finalized=new Map,H?.({ReactiveElement:J}),(Z.reactiveElementVersions??=[]).push("2.1.2");
|
|
10
|
-
/**
|
|
11
|
-
* @license
|
|
12
|
-
* Copyright 2017 Google LLC
|
|
13
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
14
|
-
*/
|
|
15
|
-
const Q=globalThis,X=Q.trustedTypes,tt=X?X.createPolicy("lit-html",{createHTML:t=>t}):void 0,et="$lit$",it=`lit$${Math.random().toFixed(9).slice(2)}$`,st="?"+it,rt=`<${st}>`,ot=document,at=()=>ot.createComment(""),nt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,lt=Array.isArray,ht="[ \t\n\f\r]",dt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ct=/-->/g,ut=/>/g,pt=RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),bt=/'/g,mt=/"/g,gt=/^(?:script|style|textarea|title)$/i,ft=(t,...e)=>({_$litType$:1,strings:t,values:e}),vt=Symbol.for("lit-noChange"),yt=Symbol.for("lit-nothing"),wt=new WeakMap,xt=ot.createTreeWalker(ot,129);function kt(t,e){if(!lt(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==tt?tt.createHTML(e):e}const St=(t,e)=>{const i=t.length-1,s=[];let r,o=2===e?"<svg>":3===e?"<math>":"",a=dt;for(let e=0;e<i;e++){const i=t[e];let n,l,h=-1,d=0;for(;d<i.length&&(a.lastIndex=d,l=a.exec(i),null!==l);)d=a.lastIndex,a===dt?"!--"===l[1]?a=ct:void 0!==l[1]?a=ut:void 0!==l[2]?(gt.test(l[2])&&(r=RegExp("</"+l[2],"g")),a=pt):void 0!==l[3]&&(a=pt):a===pt?">"===l[0]?(a=r??dt,h=-1):void 0===l[1]?h=-2:(h=a.lastIndex-l[2].length,n=l[1],a=void 0===l[3]?pt:'"'===l[3]?mt:bt):a===mt||a===bt?a=pt:a===ct||a===ut?a=dt:(a=pt,r=void 0);const c=a===pt&&t[e+1].startsWith("/>")?" ":"";o+=a===dt?i+rt:h>=0?(s.push(n),i.slice(0,h)+et+i.slice(h)+it+c):i+it+(-2===h?e:c)}return[kt(t,o+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]};let Ct=class t{constructor({strings:e,_$litType$:i},s){let r;this.parts=[];let o=0,a=0;const n=e.length-1,l=this.parts,[h,d]=St(e,i);if(this.el=t.createElement(h,s),xt.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=xt.nextNode())&&l.length<n;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(et)){const e=d[a++],i=r.getAttribute(t).split(it),s=/([.?@])?(.*)/.exec(e);l.push({type:1,index:o,name:s[2],strings:i,ctor:"."===s[1]?Mt:"?"===s[1]?Lt:"@"===s[1]?Et:$t}),r.removeAttribute(t)}else t.startsWith(it)&&(l.push({type:6,index:o}),r.removeAttribute(t));if(gt.test(r.tagName)){const t=r.textContent.split(it),e=t.length-1;if(e>0){r.textContent=X?X.emptyScript:"";for(let i=0;i<e;i++)r.append(t[i],at()),xt.nextNode(),l.push({type:2,index:++o});r.append(t[e],at())}}}else if(8===r.nodeType)if(r.data===st)l.push({type:2,index:o});else{let t=-1;for(;-1!==(t=r.data.indexOf(it,t+1));)l.push({type:7,index:o}),t+=it.length-1}o++}}static createElement(t,e){const i=ot.createElement("template");return i.innerHTML=t,i}};function _t(t,e,i=t,s){if(e===vt)return e;let r=void 0!==s?i._$Co?.[s]:i._$Cl;const o=nt(e)?void 0:e._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),void 0===o?r=void 0:(r=new o(t),r._$AT(t,i,s)),void 0!==s?(i._$Co??=[])[s]=r:i._$Cl=r),void 0!==r&&(e=_t(t,r._$AS(t,e.values),r,s)),e}let At=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=(t?.creationScope??ot).importNode(e,!0);xt.currentNode=s;let r=xt.nextNode(),o=0,a=0,n=i[0];for(;void 0!==n;){if(o===n.index){let e;2===n.type?e=new zt(r,r.nextSibling,this,t):1===n.type?e=new n.ctor(r,n.name,n.strings,this,t):6===n.type&&(e=new It(r,this,t)),this._$AV.push(e),n=i[++a]}o!==n?.index&&(r=xt.nextNode(),o++)}return xt.currentNode=ot,s}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},zt=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=yt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=_t(this,t,e),nt(t)?t===yt||null==t||""===t?(this._$AH!==yt&&this._$AR(),this._$AH=yt):t!==this._$AH&&t!==vt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>lt(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==yt&&nt(this._$AH)?this._$AA.nextSibling.data=t:this.T(ot.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=Ct.createElement(kt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new At(s,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=wt.get(t.strings);return void 0===e&&wt.set(t.strings,e=new Ct(t)),e}k(e){lt(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,r=0;for(const o of e)r===i.length?i.push(s=new t(this.O(at()),this.O(at()),this,this.options)):s=i[r],s._$AI(o),r++;r<i.length&&(this._$AR(s&&s._$AB.nextSibling,r),i.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}},$t=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,r){this.type=1,this._$AH=yt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=yt}_$AI(t,e=this,i,s){const r=this.strings;let o=!1;if(void 0===r)t=_t(this,t,e,0),o=!nt(t)||t!==this._$AH&&t!==vt,o&&(this._$AH=t);else{const s=t;let a,n;for(t=r[0],a=0;a<r.length-1;a++)n=_t(this,s[i+a],e,a),n===vt&&(n=this._$AH[a]),o||=!nt(n)||n!==this._$AH[a],n===yt?t=yt:t!==yt&&(t+=(n??"")+r[a+1]),this._$AH[a]=n}o&&!s&&this.j(t)}j(t){t===yt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Mt=class extends $t{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===yt?void 0:t}},Lt=class extends $t{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==yt)}},Et=class extends $t{constructor(t,e,i,s,r){super(t,e,i,s,r),this.type=5}_$AI(t,e=this){if((t=_t(this,t,e,0)??yt)===vt)return;const i=this._$AH,s=t===yt&&i!==yt||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==yt&&(i===yt||s);s&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},It=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){_t(this,t)}};const Pt=Q.litHtmlPolyfillSupport;Pt?.(Ct,zt),(Q.litHtmlVersions??=[]).push("3.3.2");const Tt=globalThis;
|
|
16
|
-
/**
|
|
17
|
-
* @license
|
|
18
|
-
* Copyright 2017 Google LLC
|
|
19
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
20
|
-
*/class Bt extends J{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const s=i?.renderBefore??e;let r=s._$litPart$;if(void 0===r){const t=i?.renderBefore??null;s._$litPart$=r=new zt(e.insertBefore(at(),t),t,void 0,i??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return vt}}Bt._$litElement$=!0,Bt.finalized=!0,Tt.litElementHydrateSupport?.({LitElement:Bt});const Nt=Tt.litElementPolyfillSupport;Nt?.({LitElement:Bt}),(Tt.litElementVersions??=[]).push("4.2.2");const Dt=globalThis,jt=Dt.ShadowRoot&&(void 0===Dt.ShadyCSS||Dt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ot=Symbol(),Ut=new WeakMap;let Ft=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Ot)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(jt&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=Ut.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Ut.set(e,t))}return t}toString(){return this.cssText}};const Rt=jt?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new Ft("string"==typeof t?t:t+"",void 0,Ot))(e)})(t):t,{is:qt,defineProperty:Zt,getOwnPropertyDescriptor:Gt,getOwnPropertyNames:Vt,getOwnPropertySymbols:Ht,getPrototypeOf:Kt}=Object,Wt=globalThis,Yt=Wt.trustedTypes,Jt=Yt?Yt.emptyScript:"",Qt=Wt.reactiveElementPolyfillSupport,Xt={toAttribute(t,e){switch(e){case Boolean:t=t?Jt:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch{i=null}}return i}},te=(t,e)=>!qt(t,e),ee={attribute:!0,type:String,converter:Xt,reflect:!1,useDefault:!1,hasChanged:te};Symbol.metadata??=Symbol("metadata"),Wt.litPropertyMetadata??=new WeakMap;let ie=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=ee){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=this.getPropertyDescriptor(t,Symbol(),e);void 0!==i&&Zt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,i){const{get:s,set:r}=Gt(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const o=s?.call(this);r?.call(this,e),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ee}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;const t=Kt(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){const t=this.properties,e=[...Vt(t),...Ht(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(Rt(t))}else void 0!==t&&e.push(Rt(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(jt)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),s=Dt.litNonce;void 0!==s&&e.setAttribute("nonce",s),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:Xt).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,s=i._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=i.getPropertyOptions(s),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:Xt;this._$Em=s;const o=r.fromAttribute(e,t.type);this[s]=o??this._$Ej?.get(s)??o,this._$Em=null}}requestUpdate(t,e,i,s=!1,r){if(void 0!==t){const o=this.constructor;if(!1===s&&(r=this[t]),i??=o.getPropertyOptions(t),!((i.hasChanged??te)(r,e)||i.useDefault&&i.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:r},o){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==r||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};ie.elementStyles=[],ie.shadowRootOptions={mode:"open"},ie.elementProperties=new Map,ie.finalized=new Map,Qt?.({ReactiveElement:ie}),(Wt.reactiveElementVersions??=[]).push("2.1.2");const se=globalThis,re=se.trustedTypes,oe=re?re.createPolicy("lit-html",{createHTML:t=>t}):void 0,ae="$lit$",ne=`lit$${Math.random().toFixed(9).slice(2)}$`,le="?"+ne,he=`<${le}>`,de=document,ce=()=>de.createComment(""),ue=t=>null===t||"object"!=typeof t&&"function"!=typeof t,pe=Array.isArray,be="[ \t\n\f\r]",me=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ge=/-->/g,fe=/>/g,ve=RegExp(`>|${be}(?:([^\\s"'>=/]+)(${be}*=${be}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),ye=/'/g,we=/"/g,xe=/^(?:script|style|textarea|title)$/i,ke=(t,...e)=>({_$litType$:1,strings:t,values:e}),Se=Symbol.for("lit-noChange"),Ce=Symbol.for("lit-nothing"),_e=new WeakMap,Ae=de.createTreeWalker(de,129);function ze(t,e){if(!pe(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==oe?oe.createHTML(e):e}class $e{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,o=0;const a=t.length-1,n=this.parts,[l,h]=((t,e)=>{const i=t.length-1,s=[];let r,o=2===e?"<svg>":3===e?"<math>":"",a=me;for(let e=0;e<i;e++){const i=t[e];let n,l,h=-1,d=0;for(;d<i.length&&(a.lastIndex=d,l=a.exec(i),null!==l);)d=a.lastIndex,a===me?"!--"===l[1]?a=ge:void 0!==l[1]?a=fe:void 0!==l[2]?(xe.test(l[2])&&(r=RegExp("</"+l[2],"g")),a=ve):void 0!==l[3]&&(a=ve):a===ve?">"===l[0]?(a=r??me,h=-1):void 0===l[1]?h=-2:(h=a.lastIndex-l[2].length,n=l[1],a=void 0===l[3]?ve:'"'===l[3]?we:ye):a===we||a===ye?a=ve:a===ge||a===fe?a=me:(a=ve,r=void 0);const c=a===ve&&t[e+1].startsWith("/>")?" ":"";o+=a===me?i+he:h>=0?(s.push(n),i.slice(0,h)+ae+i.slice(h)+ne+c):i+ne+(-2===h?e:c)}return[ze(t,o+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]})(t,e);if(this.el=$e.createElement(l,i),Ae.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=Ae.nextNode())&&n.length<a;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(ae)){const e=h[o++],i=s.getAttribute(t).split(ne),a=/([.?@])?(.*)/.exec(e);n.push({type:1,index:r,name:a[2],strings:i,ctor:"."===a[1]?Pe:"?"===a[1]?Te:"@"===a[1]?Be:Ie}),s.removeAttribute(t)}else t.startsWith(ne)&&(n.push({type:6,index:r}),s.removeAttribute(t));if(xe.test(s.tagName)){const t=s.textContent.split(ne),e=t.length-1;if(e>0){s.textContent=re?re.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],ce()),Ae.nextNode(),n.push({type:2,index:++r});s.append(t[e],ce())}}}else if(8===s.nodeType)if(s.data===le)n.push({type:2,index:r});else{let t=-1;for(;-1!==(t=s.data.indexOf(ne,t+1));)n.push({type:7,index:r}),t+=ne.length-1}r++}}static createElement(t,e){const i=de.createElement("template");return i.innerHTML=t,i}}function Me(t,e,i=t,s){if(e===Se)return e;let r=void 0!==s?i._$Co?.[s]:i._$Cl;const o=ue(e)?void 0:e._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),void 0===o?r=void 0:(r=new o(t),r._$AT(t,i,s)),void 0!==s?(i._$Co??=[])[s]=r:i._$Cl=r),void 0!==r&&(e=Me(t,r._$AS(t,e.values),r,s)),e}class Le{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=(t?.creationScope??de).importNode(e,!0);Ae.currentNode=s;let r=Ae.nextNode(),o=0,a=0,n=i[0];for(;void 0!==n;){if(o===n.index){let e;2===n.type?e=new Ee(r,r.nextSibling,this,t):1===n.type?e=new n.ctor(r,n.name,n.strings,this,t):6===n.type&&(e=new Ne(r,this,t)),this._$AV.push(e),n=i[++a]}o!==n?.index&&(r=Ae.nextNode(),o++)}return Ae.currentNode=de,s}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}let Ee=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=Ce,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Me(this,t,e),ue(t)?t===Ce||null==t||""===t?(this._$AH!==Ce&&this._$AR(),this._$AH=Ce):t!==this._$AH&&t!==Se&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>pe(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==Ce&&ue(this._$AH)?this._$AA.nextSibling.data=t:this.T(de.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=$e.createElement(ze(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new Le(s,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=_e.get(t.strings);return void 0===e&&_e.set(t.strings,e=new $e(t)),e}k(e){pe(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,r=0;for(const o of e)r===i.length?i.push(s=new t(this.O(ce()),this.O(ce()),this,this.options)):s=i[r],s._$AI(o),r++;r<i.length&&(this._$AR(s&&s._$AB.nextSibling,r),i.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}},Ie=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,r){this.type=1,this._$AH=Ce,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Ce}_$AI(t,e=this,i,s){const r=this.strings;let o=!1;if(void 0===r)t=Me(this,t,e,0),o=!ue(t)||t!==this._$AH&&t!==Se,o&&(this._$AH=t);else{const s=t;let a,n;for(t=r[0],a=0;a<r.length-1;a++)n=Me(this,s[i+a],e,a),n===Se&&(n=this._$AH[a]),o||=!ue(n)||n!==this._$AH[a],n===Ce?t=Ce:t!==Ce&&(t+=(n??"")+r[a+1]),this._$AH[a]=n}o&&!s&&this.j(t)}j(t){t===Ce?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}};class Pe extends Ie{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Ce?void 0:t}}class Te extends Ie{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==Ce)}}class Be extends Ie{constructor(t,e,i,s,r){super(t,e,i,s,r),this.type=5}_$AI(t,e=this){if((t=Me(this,t,e,0)??Ce)===Se)return;const i=this._$AH,s=t===Ce&&i!==Ce||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==Ce&&(i===Ce||s);s&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Ne{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Me(this,t)}}const De=se.litHtmlPolyfillSupport;De?.($e,Ee),(se.litHtmlVersions??=[]).push("3.3.2");const je=globalThis;let Oe=class extends ie{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const s=i?.renderBefore??e;let r=s._$litPart$;if(void 0===r){const t=i?.renderBefore??null;s._$litPart$=r=new Ee(e.insertBefore(ce(),t),t,void 0,i??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Se}};Oe._$litElement$=!0,Oe.finalized=!0,je.litElementHydrateSupport?.({LitElement:Oe});const Ue=je.litElementPolyfillSupport;Ue?.({LitElement:Oe}),(je.litElementVersions??=[]).push("4.2.2");const Fe={attribute:!0,type:String,converter:Xt,reflect:!1,hasChanged:te},Re=(t=Fe,e,i)=>{const{kind:s,metadata:r}=i;let o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),"setter"===s&&((t=Object.create(t)).wrapped=!0),o.set(i.name,t),"accessor"===s){const{name:s}=i;return{set(i){const r=e.get.call(this);e.set.call(this,i),this.requestUpdate(s,r,t,!0,i)},init(e){return void 0!==e&&this.C(s,void 0,t,e),e}}}if("setter"===s){const{name:s}=i;return function(i){const r=this[s];e.call(this,i),this.requestUpdate(s,r,t,!0,i)}}throw Error("Unsupported decorator location: "+s)};function qe(t){return(e,i)=>"object"==typeof i?Re(t,e,i):((t,e,i)=>{const s=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),s?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}function Ze(t){return qe({...t,state:!0,attribute:!1})}const Ge=t=>(...e)=>({_$litDirective$:t,values:e});class Ve{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const He=Ge(class extends Ve{constructor(t){if(super(t),1!==t.type||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const i=t.element.classList;for(const t of this.st)t in e||(i.remove(t),this.st.delete(t));for(const t in e){const s=!!e[t];s===this.st.has(t)||this.nt?.has(t)||(s?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return Se}}),Ke={},We=Ge(class extends Ve{constructor(t){if(super(t),3!==t.type&&1!==t.type&&4!==t.type)throw Error("The `live` directive is not allowed on child or event bindings");if(!(t=>void 0===t.strings)(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===Se||e===Ce)return e;const i=t.element,s=t.name;if(3===t.type){if(e===i[s])return Se}else if(4===t.type){if(!!e===i.hasAttribute(s))return Se}else if(1===t.type&&i.getAttribute(s)===e+"")return Se;return((t,e=Ke)=>{t._$AH=e})(t),e}}),Ye=["AE","AR","AT","AU","BE","BG","BR","CA","CH","CL","CO","CZ","DE","DK","EE","ES","FI","FR","GB","GR","HK","HR","HU","ID","IE","IL","IN","IT","JP","KR","LT","LU","LV","MX","MY","NL","NO","NZ","PE","PH","PL","PT","RO","SE","SG","SI","SK","TH","TR","TW","US","VN","ZA"];function Je(t,e){let i=null;return t.address_components?i=function(t){if(!t)return null;const e=t.find((t=>t.types?.includes("country")));return e?e.short_name:null}(t.address_components):e&&1===e.length&&(i=e[0].toUpperCase()),i?{isSupported:Ye.includes(i),countryCode:i}:{isSupported:null,countryCode:null}}const Qe={en:{placeholder:"Search for an address...",noResults:"No address found for this search. Try different keywords.",errorFetchPredictions:"Unable to search for addresses. Please try again.",errorFetchDetails:"Unable to load address details. Please try again.",errorNetwork:"Network error. Please check your connection and try again.",validationRequired:"This field is required",validationPattern:"Invalid format",validationSaudiFormat:"Please enter a valid Saudi national address (format: AAAA1234)"},ar:{placeholder:"ابحث عن عنوان...",noResults:"لم يتم العثور على عنوان لهذا البحث. جرب كلمات مختلفة.",errorFetchPredictions:"تعذر البحث عن العناوين. يرجى المحاولة مرة أخرى.",errorFetchDetails:"تعذر تحميل تفاصيل العنوان. يرجى المحاولة مرة أخرى.",errorNetwork:"خطأ في الشبكة. يرجى التحقق من اتصالك والمحاولة مرة أخرى.",validationRequired:"هذا الحقل مطلوب",validationPattern:"صيغة غير صحيحة",validationSaudiFormat:"الرجاء إدخال عنوان وطني صحيح (الصيغة: AAAA1234)"},es:{placeholder:"Buscar una dirección...",noResults:"No se encontró ninguna dirección para esta búsqueda. Intenta con diferentes palabras.",errorFetchPredictions:"No se pueden buscar direcciones. Por favor, inténtelo de nuevo.",errorFetchDetails:"No se pueden cargar los detalles de la dirección. Por favor, inténtelo de nuevo.",errorNetwork:"Error de red. Verifique su conexión e inténtelo de nuevo.",validationRequired:"Este campo es obligatorio",validationPattern:"Formato inválido",validationSaudiFormat:"Por favor ingrese una dirección nacional saudí válida (formato: AAAA1234)"},fr:{placeholder:"Rechercher une adresse...",noResults:"Aucune adresse trouvée pour cette recherche. Essayez différents mots-clés.",errorFetchPredictions:"Impossible de rechercher des adresses. Veuillez réessayer.",errorFetchDetails:"Impossible de charger les détails de l'adresse. Veuillez réessayer.",errorNetwork:"Erreur réseau. Vérifiez votre connexion et réessayez.",validationRequired:"Ce champ est obligatoire",validationPattern:"Format invalide",validationSaudiFormat:"Veuillez saisir une adresse nationale saoudienne valide (format: AAAA1234)"},de:{placeholder:"Nach einer Adresse suchen...",noResults:"Keine Adresse für diese Suche gefunden. Versuchen Sie es mit anderen Stichwörtern.",errorFetchPredictions:"Adressen können nicht gesucht werden. Bitte versuchen Sie es erneut.",errorFetchDetails:"Adressdetails können nicht geladen werden. Bitte versuchen Sie es erneut.",errorNetwork:"Netzwerkfehler. Bitte überprüfen Sie Ihre Verbindung und versuchen Sie es erneut.",validationRequired:"Dieses Feld ist erforderlich",validationPattern:"Ungültiges Format",validationSaudiFormat:"Bitte geben Sie eine gültige saudi-arabische nationale Adresse ein (Format: AAAA1234)"},it:{placeholder:"Cerca un indirizzo...",noResults:"Nessun indirizzo trovato per questa ricerca. Prova con parole chiave diverse.",errorFetchPredictions:"Impossibile cercare indirizzi. Riprova.",errorFetchDetails:"Impossibile caricare i dettagli dell'indirizzo. Riprova.",errorNetwork:"Errore di rete. Controlla la connessione e riprova.",validationRequired:"Questo campo è obbligatorio",validationPattern:"Formato non valido",validationSaudiFormat:"Inserisci un indirizzo nazionale saudita valido (formato: AAAA1234)"},pt:{placeholder:"Pesquisar um endereço...",noResults:"Nenhum endereço encontrado para esta pesquisa. Tente palavras-chave diferentes.",errorFetchPredictions:"Não é possível pesquisar endereços. Por favor, tente novamente.",errorFetchDetails:"Não é possível carregar os detalhes do endereço. Por favor, tente novamente.",errorNetwork:"Erro de rede. Verifique sua conexão e tente novamente.",validationRequired:"Este campo é obrigatório",validationPattern:"Formato inválido",validationSaudiFormat:"Por favor, insira um endereço nacional saudita válido (formato: AAAA1234)"},ru:{placeholder:"Поиск адреса...",noResults:"Адрес для этого поиска не найден. Попробуйте другие ключевые слова.",errorFetchPredictions:"Невозможно выполнить поиск адресов. Пожалуйста, попробуйте еще раз.",errorFetchDetails:"Невозможно загрузить детали адреса. Пожалуйста, попробуйте еще раз.",errorNetwork:"Ошибка сети. Проверьте соединение и попробуйте еще раз.",validationRequired:"Это поле обязательно",validationPattern:"Неверный формат",validationSaudiFormat:"Пожалуйста, введите действительный национальный адрес Саудовской Аравии (формат: AAAA1234)"},ja:{placeholder:"住所を検索...",noResults:"この検索では住所が見つかりませんでした。別のキーワードをお試しください。",errorFetchPredictions:"住所を検索できません。もう一度お試しください。",errorFetchDetails:"住所の詳細を読み込めません。もう一度お試しください。",errorNetwork:"ネットワークエラー。接続を確認してもう一度お試しください。",validationRequired:"この項目は必須です",validationPattern:"無効な形式",validationSaudiFormat:"有効なサウジアラビアの国内住所を入力してください(形式:AAAA1234)"},zh:{placeholder:"搜索地址...",noResults:"未找到此搜索的地址。请尝试不同的关键词。",errorFetchPredictions:"无法搜索地址。请重试。",errorFetchDetails:"无法加载地址详情。请重试。",errorNetwork:"网络错误。请检查您的连接并重试。",validationRequired:"此字段为必填项",validationPattern:"格式无效",validationSaudiFormat:"请输入有效的沙特国家地址(格式:AAAA1234)"},ko:{placeholder:"주소 검색...",noResults:"이 검색에 대한 주소를 찾을 수 없습니다. 다른 키워드를 시도해보세요.",errorFetchPredictions:"주소를 검색할 수 없습니다. 다시 시도해주세요.",errorFetchDetails:"주소 세부정보를 불러올 수 없습니다. 다시 시도해주세요.",errorNetwork:"네트워크 오류입니다. 연결을 확인하고 다시 시도해주세요.",validationRequired:"이 필드는 필수입니다",validationPattern:"유효하지 않은 형식",validationSaudiFormat:"유효한 사우디 국가 주소를 입력하세요 (형식: AAAA1234)"},hi:{placeholder:"पता खोजें...",noResults:"इस खोज के लिए कोई पता नहीं मिला। विभिन्न कीवर्ड आज़माएं।",errorFetchPredictions:"पते खोजने में असमर्थ। कृपया पुनः प्रयास करें।",errorFetchDetails:"पते का विवरण लोड करने में असमर्थ। कृपया पुनः प्रयास करें।",errorNetwork:"नेटवर्क त्रुटि। कृपया अपना कनेक्शन जांचें और पुनः प्रयास करें।",validationRequired:"यह फ़ील्ड आवश्यक है",validationPattern:"अमान्य प्रारूप",validationSaudiFormat:"कृपया एक मान्य सऊदी राष्ट्रीय पता दर्ज करें (प्रारूप: AAAA1234)"},tr:{placeholder:"Adres ara...",noResults:"Bu arama için adres bulunamadı. Farklı anahtar kelimeler deneyin.",errorFetchPredictions:"Adresler aranamıyor. Lütfen tekrar deneyin.",errorFetchDetails:"Adres detayları yüklenemiyor. Lütfen tekrar deneyin.",errorNetwork:"Ağ hatası. Lütfen bağlantınızı kontrol edin ve tekrar deneyin.",validationRequired:"Bu alan zorunludur",validationPattern:"Geçersiz format",validationSaudiFormat:"Lütfen geçerli bir Suudi ulusal adresi girin (format: AAAA1234)"}};function Xe(t="en"){return Qe[t]||Qe.en}var ti=Object.defineProperty,ei=Object.getOwnPropertyDescriptor,ii=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?ei(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&ti(e,i,o),o};let si=class extends Oe{constructor(){super(),this.proxyUrl="https://api.salla.dev",this.authToken=null,this.placeholder="",this.defaultPlace="",this.label=null,this.className="",this.language="en",this.dir="auto",this.mode="search",this.name="",this.required=!1,this.pattern=null,this.tooltip=null,this.selectedId=null,this.errors=[],this.disabled=!1,this._value="",this._country=null,this.locationBias=null,this.locationRestriction=null,this.types=null,this._fields=["formatted_address","geometry"],this.strictBounds=!1,this.useSessionToken=!0,this.resolve=!1,this.onValidateAddress=null,this.debounceDelay=300,this.minChars=3,this.predictions=[],this.isOpen=!1,this.isLoading=!1,this.error=null,this.activeIndex=-1,this.inputValue="",this.sessionToken=null,this.validationError=null,this.touched=!1,this.showNationalAddressIcon=!1,this.abortController=null,this._internals=this.attachInternals()}set value(t){const e=this._value;this._value=t||"",this.requestUpdate("value",e)}get value(){return this._value}set country(t){this._country=null==t?null:Array.isArray(t)?t.filter((t=>t&&t.trim())).map((t=>t.trim())):t.split(",").map((t=>t.trim())).filter((t=>t))}get country(){return this._country}set fieldsStr(t){this._fields=t?t.split(",").map((t=>t.trim())).filter((t=>t)):["formatted_address","geometry"]}get fieldsStr(){return this._fields.join(",")}set fields(t){this._fields=t&&t.length>0?t:["formatted_address","geometry"]}get fields(){return this._fields}connectedCallback(){super.connectedCallback(),this.createNewSession(),this.initializeDebounce()}disconnectedCallback(){super.disconnectedCallback(),this.terminateSession(),this.cancelPendingRequest()}initializeDebounce(){this.debouncedFetch=function(t,e){let i=null;return function(...s){i&&clearTimeout(i),i=setTimeout((()=>{t.apply(this,s)}),e)}}(this.fetchPredictions.bind(this),this.debounceDelay)}firstUpdated(){const t=this.value||this.defaultPlace||"";t&&(this.inputValue=t,this.isSaudiFormMode()&&this.isShortAddressFormat(t)&&(this.showNationalAddressIcon=!0))}$nextTick(t){Promise.resolve().then(t)}isShortAddressFormat(t){return/^[a-zA-Z]{4}\d{4}$/.test(t?.trim())}updated(t){if(t.has("value")){const t=this.value||"";t!==this.inputValue&&(this.inputValue=t,this.showNationalAddressIcon=!!(this.isSaudiFormMode()&&t&&this.isShortAddressFormat(t)))}t.has("defaultPlace")&&!this.value&&this.defaultPlace!==this.inputValue&&(this.inputValue=this.defaultPlace||"",this.showNationalAddressIcon=!!(this.isSaudiFormMode()&&this.defaultPlace&&this.isShortAddressFormat(this.defaultPlace))),t.has("selectedId")&&this.selectedId&&this.selectedId!==this.inputValue&&this.isSaudiFormMode()&&this.isShortAddressFormat(this.selectedId)&&(this.inputValue=this.selectedId||"",this.showNationalAddressIcon=!0,this._internals.setFormValue(this.selectedId||"")),t.has("debounceDelay")&&this.initializeDebounce()}createNewSession(){this.useSessionToken&&(this.sessionToken=typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})))}terminateSession(){this.sessionToken=null}cancelPendingRequest(){this.abortController&&(this.abortController.abort(),this.abortController=null)}isSaudiFormMode(){return"form"===this.mode&&null!==this.country&&1===this.country.length&&"sa"===this.country[0].toLowerCase()}getWhatsAppLink(){return`https://wa.me/966112898888?text=${encodeURIComponent("العنوان الوطني")}`}renderWhatsAppIcon(){return ke`
|
|
21
|
-
<svg class="whatsapp-icon" viewBox="0 0 24 24" fill="currentColor" part="whatsapp-icon">
|
|
22
|
-
<path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/>
|
|
23
|
-
</svg>
|
|
24
|
-
`}getSaudiHelpTextContent(){return{helpText:"ar"===this.language?"لا تعرف العنوان الوطني؟":"Don't know your national address?",linkText:"ar"===this.language?"احصل على العنوان الوطني عبر الواتساب":"Get your national address via WhatsApp"}}renderSaudiFriendlyError(){let t,e;this.inputValue&&this.inputValue.trim().length>0?(t="العنوان الوطني المختصر غير صحيح (الصيغة: AAAA1234). يمكنك الحصول عليه بسهولة",e="The short national address format is incorrect (format: AAAA1234). You can easily get it"):(t="العنوان الوطني المختصر مطلوب. يمكنك الحصول عليه بسهولة",e="The short national address is required. You can easily get it");const i="ar"===this.language?"عبر الواتساب (اضغط هنا)":"via WhatsApp (click here)",s="ar"===this.language?"أو ابحث أعلاه":"or search above";return ke`
|
|
25
|
-
<span>
|
|
26
|
-
${"ar"===this.language?t:e}
|
|
27
|
-
<a
|
|
28
|
-
href="${this.getWhatsAppLink()}"
|
|
29
|
-
target="_blank"
|
|
30
|
-
rel="noopener noreferrer"
|
|
31
|
-
class="whatsapp-link-inline"
|
|
32
|
-
part="whatsapp-link"
|
|
33
|
-
>
|
|
34
|
-
${this.renderWhatsAppIcon()}
|
|
35
|
-
${i}
|
|
36
|
-
</a>
|
|
37
|
-
${s}
|
|
38
|
-
</span>
|
|
39
|
-
`}renderSaudiHelpText(){if(!this.isSaudiFormMode()||this.validationError||this.errors&&this.errors.length>0)return"";const t="ar"===this.language?"عبر الواتساب (اضغط هنا)":"via WhatsApp (click here)",e="ar"===this.language?"أو ابحث أعلاه":"or search above";return ke`
|
|
40
|
-
<div class="help-text" part="help-text">
|
|
41
|
-
<span>
|
|
42
|
-
${"ar"===this.language?"لا تعرف العنوان الوطني؟ احصل عليه بسهولة":"Don't know your national address? Get it easily"}
|
|
43
|
-
<a
|
|
44
|
-
href="${this.getWhatsAppLink()}"
|
|
45
|
-
target="_blank"
|
|
46
|
-
rel="noopener noreferrer"
|
|
47
|
-
class="whatsapp-link-inline"
|
|
48
|
-
part="whatsapp-link"
|
|
49
|
-
>
|
|
50
|
-
${this.renderWhatsAppIcon()}
|
|
51
|
-
${t}
|
|
52
|
-
</a>
|
|
53
|
-
${e}
|
|
54
|
-
</span>
|
|
55
|
-
</div>
|
|
56
|
-
`}async fetchPredictions(t){if(!t.trim())return this.predictions=[],this.isOpen=!1,void(this.isLoading=!1);if(t.trim().length<this.minChars)return this.predictions=[],this.isOpen=!1,void(this.isLoading=!1);this.cancelPendingRequest(),this.abortController=new AbortController;const e=this.abortController.signal;this.isLoading=!0,this.error=null;try{const i={input:t,language:this.language};this.sessionToken&&(i.sessiontoken=this.sessionToken),this.country&&this.country.length>0&&(i.country=this.country.join(",")),this.types&&this.types.length>0&&(i.types=this.types.join("|")),this.locationBias&&this.locationBias.radius&&this.locationBias.center&&(i.location=`${this.locationBias.center.lat},${this.locationBias.center.lng}`,i.radius=this.locationBias.radius.toString()),this.strictBounds&&(i.strictbounds="true");const s=new URLSearchParams(i),r=`${this.proxyUrl||""}/store/v1/checkout/address/autocomplete/query?${s.toString()}`,o={};this.authToken&&(o.Authorization=`Bearer ${this.authToken}`);const a=await fetch(r,{signal:e,headers:o});if(!a.ok)throw new Error(`HTTP ${a.status}: ${a.statusText}`);const n=await a.json();n.success&&Array.isArray(n.data)?(this.error=null,n.data.length>0?(this.predictions=n.data.map((t=>({place_id:t.id,description:t.description||t.formatted_address,formatted_address:t.formatted_address,short_address:t.short_address,structured_formatting:{main_text:t.formatted_address||t.description,main_text_matched_substrings:[],secondary_text:t.description||""},types:t.types||[],geometry:t.geometry,address_components:t.address_components}))),this.isOpen=!0,this.activeIndex=-1):(this.predictions=[],this.isOpen=!0)):(this.predictions=[],this.isOpen=!0)}catch(t){if(t instanceof Error&&"AbortError"===t.name)return;this.predictions=[],this.isOpen=!0}finally{this.isLoading=!1,this.abortController=null}}async fetchPlaceDetails(t){this.isLoading=!0,this.error=null;try{const e={place_id:t,language:this.language};this.fields&&this.fields.length>0&&(e.fields=this.fields.join(",")),this.sessionToken&&(e.sessiontoken=this.sessionToken),this.country&&this.country.length>0&&(e.country=this.country.join(",")),this.resolve&&(e.resolve="true");const i=new URLSearchParams(e),s=`${this.proxyUrl||""}/store/v1/checkout/address/autocomplete/details?${i.toString()}`,r={};this.authToken&&(r.Authorization=`Bearer ${this.authToken}`);const o=await fetch(s,{headers:r});if(!o.ok)throw new Error(`HTTP ${o.status}: ${o.statusText}`);const a=await o.json();return!a.success||a.message?(this.error=a.message||"Failed to fetch place details",null):a.success&&a.data&&a.data.id?{place_id:a.data.id,...a.data,components:a.data.address_components?.reduce(((t,e)=>(e.types?.forEach((i=>{t[i]||(t[i]=[]),t[i].push({long_name:e.long_name,short_name:e.short_name})})),t)),{})}:null}catch(t){console.error("Error fetching place details:",t);const e=Xe(this.language);return this.error=t instanceof Error?t.message:e.errorFetchDetails,null}finally{this.isLoading=!1}}async validateAddress(t){try{if(!t||!t.formatted_address)return console.error("Cannot validate address - place or formatted_address is missing"),null;if(!this.onValidateAddress||"function"!=typeof this.onValidateAddress)return console.error("onValidateAddress callback is required for address validation"),null;const e=Je(t,this.country),i=await this.onValidateAddress({place:t,sessionToken:this.sessionToken,validationSupport:e});return this.terminateSession(),i}catch(t){return console.error("Error validating address:",t),this.terminateSession(),null}}getValidationSupport(t){return Je(t,this.country)}checkValidity(){return this.validate()}reportValidity(){this.touched=!0;const t=this.validate();return t||this.dispatchEvent(new CustomEvent("invalid",{detail:{error:this.validationError},bubbles:!0,composed:!0})),t}reset(){this.inputValue="",this.selectedId=null,this.validationError=null,this.errors=[],this.touched=!1,this.predictions=[],this.isOpen=!1,this.error=null,this.showNationalAddressIcon=!1,"form"===this.mode&&(this._internals.setFormValue(null),this._internals.setValidity({}))}formResetCallback(){this.reset()}formStateRestoreCallback(t){t&&"form"===this.mode&&(this.selectedId=t)}validate(){if("form"!==this.mode)return!0;const t=Xe(this.language),e=this.inputValue||"";return this.required&&!e.trim()?(this.validationError=t.validationRequired,this._internals.setValidity({valueMissing:!0},this.validationError,this.inputElement),!1):this.isSaudiFormMode()&&e.trim()&&!this.isShortAddressFormat(e)?(this.validationError=t.validationSaudiFormat,this._internals.setValidity({patternMismatch:!0},this.validationError,this.inputElement),!1):this.pattern&&e.trim()&&!new RegExp(this.pattern).test(e)?(this.validationError=t.validationPattern,this._internals.setValidity({patternMismatch:!0},this.validationError,this.inputElement),!1):(this.validationError=null,this._internals.setValidity({}),!0)}normalizeNumerals(t){if(!t)return t;const e={"٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","०":"0","१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","০":"0","১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9"};return t.split("").map((t=>e[t]??t)).join("")}handleInput(t){if(this.disabled)return;const e=t.target,i=e.selectionStart??0,s=this.inputValue,r=e.value,o=this.normalizeNumerals(r);o!==r&&(e.value=o,requestAnimationFrame((()=>{e.setSelectionRange(i,i)}))),this.inputValue=o,this.touched=!0,this.showNationalAddressIcon&&(this.showNationalAddressIcon=!1),"form"===this.mode&&(this.validationError&&(this.validationError=null),this.selectedId=null,this._internals.setFormValue(this.inputValue||null),this.validate()),this.errors&&this.errors.length>0&&(this.errors=[]),this.inputValue.trim().length>=this.minChars&&(this.isLoading=!0),this.debouncedFetch(this.inputValue),this._value=this.inputValue,this.requestUpdate("value",s),this.dispatchEvent(new CustomEvent("input",{detail:{value:this.inputValue},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{data:this.inputValue,bubbles:!0,composed:!0}))}async handleSelect(t){if(this.disabled)return;this.isSaudiFormMode()&&t.place_id&&this.isShortAddressFormat(t.place_id)?(this.inputValue=t.place_id,this.showNationalAddressIcon=!0):(this.inputValue=t.formatted_address,this.showNationalAddressIcon=!1),this.isOpen=!1,this.predictions=[],this.touched=!0;let e=null;if(e="form"===this.mode?await this.fetchPlaceDetails(t.place_id):t.geometry?.location?{place_id:t.place_id,formatted_address:t.formatted_address||t.description,geometry:t.geometry,types:t.types,address_components:t.address_components}:await this.fetchPlaceDetails(t.place_id),e){this.isSaudiFormMode()&&e.place_id&&this.isShortAddressFormat(e.place_id)?(this.inputValue=e.place_id,this.showNationalAddressIcon=!0):(e.formatted_address&&(this.inputValue=e.formatted_address),this.showNationalAddressIcon=!1),"form"===this.mode&&(this.selectedId=e.place_id,this._internals.setFormValue(this.inputValue),this.validate()),this._value=this.inputValue,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.inputValue},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}));const t=this.getValidationSupport(e);this.dispatchEvent(new CustomEvent("place-select",{detail:{place:e,validationSupport:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("place-changed",{detail:{place:e,validationSupport:t},bubbles:!0,composed:!0}))}}handleKeyDown(t){if(!this.disabled&&this.isOpen&&0!==this.predictions.length)switch(t.key){case"ArrowDown":t.preventDefault(),this.activeIndex=Math.min(this.activeIndex+1,this.predictions.length-1);break;case"ArrowUp":t.preventDefault(),this.activeIndex=Math.max(this.activeIndex-1,-1);break;case"Enter":t.preventDefault(),this.activeIndex>=0&&this.activeIndex<this.predictions.length&&this.handleSelect(this.predictions[this.activeIndex]);break;case"Escape":t.preventDefault(),this.isOpen=!1,this.activeIndex=-1}}handleBlur(){setTimeout((()=>{this.isOpen=!1,this.activeIndex=-1,"form"===this.mode&&this.touched&&this.validate(),this.dispatchEvent(new Event("blur",{bubbles:!0,composed:!0}))}),200)}handleFocus(){this.disabled||this.predictions.length>0&&(this.isOpen=!0)}renderLocationIcon(){return ke`
|
|
57
|
-
<svg class="location-icon" fill="currentColor" viewBox="0 0 20 20">
|
|
58
|
-
<path fill-rule="evenodd" d="M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z" clip-rule="evenodd" />
|
|
59
|
-
</svg>
|
|
60
|
-
`}renderTooltip(){return this.tooltip?ke`
|
|
61
|
-
<span class="tooltip-toggle" part="tooltip-toggle">
|
|
62
|
-
<svg class="tooltip-icon" part="tooltip-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
63
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
64
|
-
</svg>
|
|
65
|
-
<span class="tooltip-content" part="tooltip-content">${this.tooltip}</span>
|
|
66
|
-
</span>
|
|
67
|
-
`:""}renderPrediction(t,e){const i={"dropdown-item":!0,active:e===this.activeIndex};let s=t.structured_formatting.main_text;return t.short_address&&s.includes(t.short_address)&&(s=s.replace(t.short_address,"").trim(),s=s.replace(/\s*,\s*,\s*/g,", ").replace(/^\s*,\s*|\s*,\s*$/g,"").trim()),ke`
|
|
68
|
-
<div
|
|
69
|
-
class=${He(i)}
|
|
70
|
-
part="dropdown-item ${e===this.activeIndex?"dropdown-item-active":""}"
|
|
71
|
-
@click=${()=>this.handleSelect(t)}
|
|
72
|
-
role="option"
|
|
73
|
-
aria-selected=${e===this.activeIndex}
|
|
74
|
-
>
|
|
75
|
-
${this.renderLocationIcon()}
|
|
76
|
-
<div class="place-info" part="place-info">
|
|
77
|
-
<div class="main-text" part="main-text">
|
|
78
|
-
${t.short_address?ke`
|
|
79
|
-
<span class="national-address-badge" part="national-address-badge">
|
|
80
|
-
<img
|
|
81
|
-
src="https://cdn.salla.network/images/shipping/png/national-address-icon-small-min.png"
|
|
82
|
-
alt="national address icon"
|
|
83
|
-
class="national-address-icon"
|
|
84
|
-
/>
|
|
85
|
-
<span class="national-address-text">${t.short_address}</span>
|
|
86
|
-
<span class="national-address-separator">-</span>
|
|
87
|
-
</span>
|
|
88
|
-
`:""}
|
|
89
|
-
${s}
|
|
90
|
-
</div>
|
|
91
|
-
${t.structured_formatting.secondary_text?ke`
|
|
92
|
-
<div class="secondary-text" part="secondary-text">
|
|
93
|
-
${t.structured_formatting.secondary_text}
|
|
94
|
-
</div>
|
|
95
|
-
`:""}
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
`}render(){const t={dropdown:!0,open:this.isOpen},e={"is-invalid":!("form"!==this.mode||!this.validationError)||this.errors&&this.errors.length>0,"with-national-icon":this.showNationalAddressIcon},i={required:"form"===this.mode&&this.required},s=Xe(this.language),r="auto"===this.dir?function(t){return["ar"].includes(t)}(this.language)?"rtl":"ltr":this.dir,o=this.placeholder||s.placeholder,a=this.name||"salla-address-search";return ke`
|
|
99
|
-
<div class="wrapper ${this.className}" part="wrapper" dir="${r}">
|
|
100
|
-
<div class="input-container" part="input-container">
|
|
101
|
-
${this.label?ke`
|
|
102
|
-
<label part="label" class=${He(i)}>
|
|
103
|
-
<span class="label-content">
|
|
104
|
-
<span>${this.label}</span>
|
|
105
|
-
${this.renderTooltip()}
|
|
106
|
-
</span>
|
|
107
|
-
</label>
|
|
108
|
-
`:""}
|
|
109
|
-
<div class="input-wrapper">
|
|
110
|
-
<input
|
|
111
|
-
part="input"
|
|
112
|
-
class=${He(e)}
|
|
113
|
-
type="text"
|
|
114
|
-
name="${a}"
|
|
115
|
-
.value=${We(this.inputValue)}
|
|
116
|
-
placeholder=${o}
|
|
117
|
-
?disabled=${this.disabled}
|
|
118
|
-
@input=${this.handleInput}
|
|
119
|
-
@keydown=${this.handleKeyDown}
|
|
120
|
-
@blur=${this.handleBlur}
|
|
121
|
-
@focus=${this.handleFocus}
|
|
122
|
-
role="combobox"
|
|
123
|
-
aria-expanded=${this.isOpen}
|
|
124
|
-
aria-autocomplete="list"
|
|
125
|
-
aria-controls="predictions-list"
|
|
126
|
-
aria-invalid=${"form"===this.mode&&this.validationError||this.errors&&this.errors.length>0?"true":"false"}
|
|
127
|
-
aria-required=${"form"===this.mode&&this.required?"true":"false"}
|
|
128
|
-
autocomplete="off"
|
|
129
|
-
autocorrect="off"
|
|
130
|
-
autocapitalize="off"
|
|
131
|
-
spellcheck="false"
|
|
132
|
-
/>
|
|
133
|
-
${this.isLoading?ke`<div class="loading-spinner" part="spinner"></div>`:""}
|
|
134
|
-
|
|
135
|
-
<div
|
|
136
|
-
id="predictions-list"
|
|
137
|
-
class=${He(t)}
|
|
138
|
-
part="dropdown"
|
|
139
|
-
role="listbox"
|
|
140
|
-
>
|
|
141
|
-
${this.predictions.length>0?this.predictions.map(((t,e)=>this.renderPrediction(t,e))):this.inputValue&&!this.isLoading?ke`<div class="no-results" part="no-results">${s.noResults}</div>`:""}
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
${"form"===this.mode&&this.validationError?ke`
|
|
145
|
-
<div class="validation-error" part="validation-error">
|
|
146
|
-
${this.isSaudiFormMode()?this.renderSaudiFriendlyError():ke`<span>${this.validationError}</span>`}
|
|
147
|
-
</div>
|
|
148
|
-
`:""}
|
|
149
|
-
${this.errors&&this.errors.length>0?ke`
|
|
150
|
-
<div class="validation-error" part="validation-error">${this.errors[0]}</div>
|
|
151
|
-
`:""}
|
|
152
|
-
${this.error?ke`<div class="error-message" part="error">${this.error}</div>`:""}
|
|
153
|
-
${this.renderSaudiHelpText()}
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
`}};si.formAssociated=!0,si.styles=((t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new Ft(i,t,Ot)})`
|
|
157
|
-
:host {
|
|
158
|
-
display: block;
|
|
159
|
-
position: relative;
|
|
160
|
-
font-family: var(--salla-autocomplete-font-family, system-ui, -apple-system, sans-serif);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.wrapper {
|
|
164
|
-
position: relative;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.input-container {
|
|
168
|
-
display: flex;
|
|
169
|
-
flex-direction: column;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.input-wrapper {
|
|
173
|
-
position: relative;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
label {
|
|
177
|
-
display: block;
|
|
178
|
-
margin-bottom: var(--salla-autocomplete-label-margin, 0.5rem);
|
|
179
|
-
font-size: var(--salla-autocomplete-label-font-size, 0.875rem);
|
|
180
|
-
font-weight: var(--salla-autocomplete-label-font-weight, 500);
|
|
181
|
-
color: var(--salla-autocomplete-label-color, #374151);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
label.required::after {
|
|
185
|
-
content: ' *';
|
|
186
|
-
color: var(--salla-autocomplete-required-color, #dc2626);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.label-content {
|
|
190
|
-
display: inline-flex;
|
|
191
|
-
align-items: center;
|
|
192
|
-
gap: 0.5rem;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.tooltip-toggle {
|
|
196
|
-
position: relative;
|
|
197
|
-
display: inline-flex;
|
|
198
|
-
align-items: center;
|
|
199
|
-
cursor: help;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.tooltip-icon {
|
|
203
|
-
width: 1rem;
|
|
204
|
-
height: 1rem;
|
|
205
|
-
color: var(--salla-autocomplete-tooltip-icon-color, #6b7280);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.tooltip-content {
|
|
209
|
-
display: none;
|
|
210
|
-
position: absolute;
|
|
211
|
-
bottom: 125%;
|
|
212
|
-
left: 50%;
|
|
213
|
-
transform: translateX(-50%);
|
|
214
|
-
background: var(--salla-autocomplete-tooltip-bg, #1f2937);
|
|
215
|
-
color: var(--salla-autocomplete-tooltip-color, white);
|
|
216
|
-
padding: 0.5rem 0.75rem;
|
|
217
|
-
border-radius: 0.375rem;
|
|
218
|
-
font-size: 0.75rem;
|
|
219
|
-
line-height: 1.4;
|
|
220
|
-
white-space: nowrap;
|
|
221
|
-
z-index: 1000;
|
|
222
|
-
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.tooltip-content::after {
|
|
226
|
-
content: '';
|
|
227
|
-
position: absolute;
|
|
228
|
-
top: 100%;
|
|
229
|
-
left: 50%;
|
|
230
|
-
transform: translateX(-50%);
|
|
231
|
-
border: 5px solid transparent;
|
|
232
|
-
border-top-color: var(--salla-autocomplete-tooltip-bg, #1f2937);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.tooltip-toggle:hover .tooltip-content,
|
|
236
|
-
.tooltip-toggle:focus .tooltip-content {
|
|
237
|
-
display: block;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
input {
|
|
241
|
-
width: 100%;
|
|
242
|
-
padding-block: 0.75rem;
|
|
243
|
-
padding-inline-start: var(--salla-autocomplete-input-padding-start, 0.875rem);
|
|
244
|
-
padding-inline-end: var(--salla-autocomplete-input-padding-end, 2.75rem);
|
|
245
|
-
font-family: var(--salla-autocomplete-font-family, system-ui, -apple-system, sans-serif);
|
|
246
|
-
font-size: var(--salla-autocomplete-input-font-size, 1rem);
|
|
247
|
-
line-height: var(--salla-autocomplete-input-line-height, 1.5);
|
|
248
|
-
border: var(--salla-autocomplete-input-border, 1px solid #d1d5db);
|
|
249
|
-
border-radius: var(--salla-autocomplete-input-border-radius, 0.5rem);
|
|
250
|
-
background: var(--salla-autocomplete-input-background, white);
|
|
251
|
-
color: var(--salla-autocomplete-input-color, #111827);
|
|
252
|
-
outline: none;
|
|
253
|
-
transition: all 0.2s;
|
|
254
|
-
box-sizing: border-box;
|
|
255
|
-
height: var(--salla-autocomplete-input-height, auto);
|
|
256
|
-
min-height: var(--salla-autocomplete-input-height, 44px);
|
|
257
|
-
-webkit-appearance: none;
|
|
258
|
-
appearance: none;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
input.with-national-icon {
|
|
262
|
-
padding-inline-start: var(--salla-autocomplete-input-padding-start-icon, 2rem);
|
|
263
|
-
background-image: url('https://cdn.salla.network/images/shipping/png/national-address-icon-small-min.png');
|
|
264
|
-
background-repeat: no-repeat;
|
|
265
|
-
background-position: 0.75rem center;
|
|
266
|
-
background-size: 16px;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
input.with-national-icon[dir="rtl"],
|
|
270
|
-
:host([dir="rtl"]) input.with-national-icon {
|
|
271
|
-
padding-inline-start: var(--salla-autocomplete-input-padding-start, 0.875rem);
|
|
272
|
-
padding-inline-end: var(--salla-autocomplete-input-padding-end-icon, 2.75rem);
|
|
273
|
-
background-position: calc(100% - 0.75rem) center;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
@media (max-width: 640px) {
|
|
277
|
-
input {
|
|
278
|
-
font-size: var(--salla-autocomplete-input-font-size-mobile, 16px);
|
|
279
|
-
padding-block: 0.75rem;
|
|
280
|
-
padding-inline-start: var(--salla-autocomplete-input-padding-start-mobile, 0.875rem);
|
|
281
|
-
padding-inline-end: var(--salla-autocomplete-input-padding-end-mobile, 2.75rem);
|
|
282
|
-
min-height: 44px;
|
|
283
|
-
touch-action: manipulation;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
input.with-national-icon {
|
|
287
|
-
padding-inline-start: var(--salla-autocomplete-input-padding-start-icon-mobile, 2rem);
|
|
288
|
-
background-position: 0.875rem center;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
input.with-national-icon[dir="rtl"],
|
|
292
|
-
:host([dir="rtl"]) input.with-national-icon {
|
|
293
|
-
padding-inline-start: var(--salla-autocomplete-input-padding-start-mobile, 0.875rem);
|
|
294
|
-
padding-inline-end: var(--salla-autocomplete-input-padding-end-icon-mobile, 2.75rem);
|
|
295
|
-
background-position: calc(100% - 0.875rem) center;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
input:focus {
|
|
300
|
-
border-color: var(--salla-autocomplete-input-focus-border-color, #3b82f6);
|
|
301
|
-
box-shadow: var(--salla-autocomplete-input-focus-shadow, 0 0 0 3px rgba(59, 130, 246, 0.1));
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
input:disabled {
|
|
305
|
-
background-color: var(--salla-autocomplete-input-disabled-bg, #f3f4f6);
|
|
306
|
-
cursor: not-allowed;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
input.is-invalid {
|
|
310
|
-
border-color: var(--salla-autocomplete-input-error-border-color, #dc2626);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
input.is-invalid:focus {
|
|
314
|
-
border-color: var(--salla-autocomplete-input-error-border-color, #dc2626);
|
|
315
|
-
box-shadow: var(--salla-autocomplete-input-error-shadow, 0 0 0 3px rgba(220, 38, 38, 0.1));
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
input::placeholder {
|
|
319
|
-
color: var(--salla-autocomplete-input-placeholder-color, #9ca3af);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
.validation-error {
|
|
323
|
-
display: flex;
|
|
324
|
-
flex-wrap: wrap;
|
|
325
|
-
align-items: center;
|
|
326
|
-
gap: 0.5rem;
|
|
327
|
-
margin-top: 0.375rem;
|
|
328
|
-
font-size: var(--salla-autocomplete-error-font-size, 0.875rem);
|
|
329
|
-
color: var(--salla-autocomplete-error-color, #dc2626);
|
|
330
|
-
line-height: 1.5;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
.validation-error > span {
|
|
334
|
-
line-height: 1.5;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
.whatsapp-link-inline {
|
|
338
|
-
color: var(--salla-autocomplete-whatsapp-brand-color, #25D366);
|
|
339
|
-
white-space: nowrap;
|
|
340
|
-
line-height: inherit;
|
|
341
|
-
display: inline-flex;
|
|
342
|
-
align-items: center;
|
|
343
|
-
vertical-align: middle;
|
|
344
|
-
text-decoration: underline;
|
|
345
|
-
cursor: pointer;
|
|
346
|
-
transition: all 0.2s ease;
|
|
347
|
-
gap: 0.25rem;
|
|
348
|
-
margin-inline: 0.25rem;
|
|
349
|
-
font-weight: 500;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.whatsapp-link-inline:hover {
|
|
353
|
-
color: var(--salla-autocomplete-whatsapp-brand-hover, #1da851);
|
|
354
|
-
opacity: 0.9;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
.whatsapp-link-inline:active {
|
|
358
|
-
transform: scale(0.98);
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
.whatsapp-link-inline .whatsapp-icon {
|
|
362
|
-
color: var(--salla-autocomplete-whatsapp-brand-color, #25D366);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
.help-text {
|
|
366
|
-
display: block;
|
|
367
|
-
margin-top: 0.5rem;
|
|
368
|
-
font-size: var(--salla-autocomplete-help-font-size, 0.875rem);
|
|
369
|
-
color: var(--salla-autocomplete-help-color, #6b7280);
|
|
370
|
-
line-height: 1.5;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
.help-text span {
|
|
374
|
-
line-height: 1.5;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
.whatsapp-icon {
|
|
378
|
-
width: 1rem;
|
|
379
|
-
height: 1rem;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
.loading-spinner {
|
|
383
|
-
position: absolute;
|
|
384
|
-
inset-inline-end: 0.875rem;
|
|
385
|
-
top: 50%;
|
|
386
|
-
transform: translateY(-50%);
|
|
387
|
-
width: var(--salla-autocomplete-spinner-size, 1.25rem);
|
|
388
|
-
height: var(--salla-autocomplete-spinner-size, 1.25rem);
|
|
389
|
-
border: 2px solid var(--salla-autocomplete-spinner-border-color, #e5e7eb);
|
|
390
|
-
border-top-color: var(--salla-autocomplete-spinner-color, #3b82f6);
|
|
391
|
-
border-radius: 50%;
|
|
392
|
-
animation: spin 0.6s linear infinite;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
@media (max-width: 640px) {
|
|
396
|
-
.loading-spinner {
|
|
397
|
-
width: var(--salla-autocomplete-spinner-size-mobile, 1.375rem);
|
|
398
|
-
height: var(--salla-autocomplete-spinner-size-mobile, 1.375rem);
|
|
399
|
-
inset-inline-end: 1rem;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
@keyframes spin {
|
|
404
|
-
to { transform: translateY(-50%) rotate(360deg); }
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/* Custom scrollbar styling */
|
|
408
|
-
.dropdown::-webkit-scrollbar {
|
|
409
|
-
width: 6px;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
.dropdown::-webkit-scrollbar-track {
|
|
413
|
-
background: #f1f1f1;
|
|
414
|
-
border-radius: 3px;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
.dropdown::-webkit-scrollbar-thumb {
|
|
418
|
-
background: #c1c1c1;
|
|
419
|
-
border-radius: 3px;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
.dropdown::-webkit-scrollbar-thumb:hover {
|
|
423
|
-
background: #a8a8a8;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
.dropdown {
|
|
427
|
-
position: absolute;
|
|
428
|
-
top: 100%;
|
|
429
|
-
left: 0;
|
|
430
|
-
right: 0;
|
|
431
|
-
margin-top: var(--salla-autocomplete-dropdown-margin-top, 0.375rem);
|
|
432
|
-
background: var(--salla-autocomplete-dropdown-background, white);
|
|
433
|
-
border: var(--salla-autocomplete-dropdown-border, 1px solid #e5e7eb);
|
|
434
|
-
border-radius: var(--salla-autocomplete-dropdown-border-radius, 0.5rem);
|
|
435
|
-
box-shadow: var(--salla-autocomplete-dropdown-shadow, 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1));
|
|
436
|
-
max-height: var(--salla-autocomplete-dropdown-max-height, 240px);
|
|
437
|
-
overflow-y: auto;
|
|
438
|
-
overflow-x: hidden;
|
|
439
|
-
z-index: var(--salla-autocomplete-dropdown-z-index, 100);
|
|
440
|
-
display: none;
|
|
441
|
-
-webkit-overflow-scrolling: touch;
|
|
442
|
-
overscroll-behavior: contain;
|
|
443
|
-
scroll-behavior: smooth;
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
@media (max-width: 640px) {
|
|
447
|
-
.dropdown {
|
|
448
|
-
max-height: var(--salla-autocomplete-dropdown-max-height-mobile, 25vh);
|
|
449
|
-
border-radius: var(--salla-autocomplete-dropdown-border-radius-mobile, 0.5rem);
|
|
450
|
-
margin-top: var(--salla-autocomplete-dropdown-margin-top-mobile, 0.25rem);
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
@media (max-width: 640px) and (max-height: 667px) {
|
|
455
|
-
/* Smaller phones (iPhone SE, iPhone 8, etc.) */
|
|
456
|
-
.dropdown {
|
|
457
|
-
max-height: var(--salla-autocomplete-dropdown-max-height-small, 22vh);
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
@media (max-width: 640px) and (min-height: 668px) and (max-height: 896px) {
|
|
462
|
-
/* Standard phones (iPhone 12, iPhone 13, etc.) */
|
|
463
|
-
.dropdown {
|
|
464
|
-
max-height: var(--salla-autocomplete-dropdown-max-height-standard, 28vh);
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
@media (max-width: 640px) and (min-height: 897px) {
|
|
469
|
-
/* Larger phones (iPhone 14 Pro Max, etc.) */
|
|
470
|
-
.dropdown {
|
|
471
|
-
max-height: var(--salla-autocomplete-dropdown-max-height-large, 30vh);
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
.dropdown.open {
|
|
476
|
-
display: block;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
.dropdown-item {
|
|
480
|
-
display: flex;
|
|
481
|
-
align-items: flex-start;
|
|
482
|
-
padding: var(--salla-autocomplete-item-padding, 0.625rem 0.75rem);
|
|
483
|
-
cursor: pointer;
|
|
484
|
-
transition: background-color 0.15s;
|
|
485
|
-
border-bottom: 1px solid var(--salla-autocomplete-item-border-color, #e5e7eb);
|
|
486
|
-
min-height: 35px;
|
|
487
|
-
-webkit-tap-highlight-color: transparent;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
@media (max-width: 640px) {
|
|
491
|
-
.dropdown-item {
|
|
492
|
-
padding: var(--salla-autocomplete-item-padding-mobile, 0.75rem 0.875rem);
|
|
493
|
-
min-height: 35px;
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
.dropdown-item:last-child {
|
|
498
|
-
border-bottom: none;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
.dropdown-item:hover,
|
|
502
|
-
.dropdown-item.selected {
|
|
503
|
-
background-color: var(--salla-autocomplete-item-hover-bg, #f9fafb);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
.dropdown-item.active {
|
|
507
|
-
background-color: var(--salla-autocomplete-item-active-bg, #eff6ff);
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
@media (hover: none) and (pointer: coarse) {
|
|
511
|
-
.dropdown-item:hover {
|
|
512
|
-
background-color: transparent;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
.dropdown-item:active {
|
|
516
|
-
background-color: var(--salla-autocomplete-item-active-bg, #eff6ff);
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
.location-icon {
|
|
521
|
-
display: none;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
.place-info {
|
|
525
|
-
flex: 1;
|
|
526
|
-
min-width: 0;
|
|
527
|
-
display: flex;
|
|
528
|
-
flex-direction: column;
|
|
529
|
-
gap: 0.25rem;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
.main-text {
|
|
533
|
-
font-size: var(--salla-autocomplete-main-text-font-size, 0.875rem);
|
|
534
|
-
font-weight: var(--salla-autocomplete-main-text-font-weight, 600);
|
|
535
|
-
color: var(--salla-autocomplete-main-text-color, #111827);
|
|
536
|
-
line-height: 1.4;
|
|
537
|
-
word-wrap: break-word;
|
|
538
|
-
overflow-wrap: break-word;
|
|
539
|
-
hyphens: auto;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
@media (max-width: 640px) {
|
|
543
|
-
.main-text {
|
|
544
|
-
font-size: var(--salla-autocomplete-main-text-font-size-mobile, 0.9375rem);
|
|
545
|
-
line-height: 1.3;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
.main-text .highlight {
|
|
550
|
-
font-weight: var(--salla-autocomplete-highlight-font-weight, 700);
|
|
551
|
-
color: var(--salla-autocomplete-highlight-color, inherit);
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
.national-address-badge {
|
|
555
|
-
display: inline-flex;
|
|
556
|
-
align-items: center;
|
|
557
|
-
font-size: 0.8125rem;
|
|
558
|
-
line-height: 1;
|
|
559
|
-
vertical-align: middle;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
.national-address-icon {
|
|
563
|
-
width: 11px;
|
|
564
|
-
height: auto;
|
|
565
|
-
flex-shrink: 0;
|
|
566
|
-
display: inline-block;
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
.national-address-text {
|
|
570
|
-
padding-inline-start: 3px;
|
|
571
|
-
-webkit-text-fill-color: transparent;
|
|
572
|
-
background-clip: text;
|
|
573
|
-
-webkit-background-clip: text;
|
|
574
|
-
background-image: linear-gradient(135deg, #0052cc, #00b8d9 50%, #36b37e);
|
|
575
|
-
font-weight: 600;
|
|
576
|
-
display: inline-block;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
.national-address-separator {
|
|
580
|
-
padding-inline: 4px;
|
|
581
|
-
color: #6b7280;
|
|
582
|
-
display: inline-block;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
.secondary-text {
|
|
586
|
-
font-size: var(--salla-autocomplete-secondary-text-font-size, 0.75rem);
|
|
587
|
-
color: var(--salla-autocomplete-secondary-text-color, #6b7280);
|
|
588
|
-
line-height: 1.4;
|
|
589
|
-
word-wrap: break-word;
|
|
590
|
-
overflow-wrap: break-word;
|
|
591
|
-
hyphens: auto;
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
@media (max-width: 640px) {
|
|
595
|
-
.secondary-text {
|
|
596
|
-
font-size: var(--salla-autocomplete-secondary-text-font-size-mobile, 0.8125rem);
|
|
597
|
-
line-height: 1.3;
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
.error-message {
|
|
602
|
-
margin-top: 0.5rem;
|
|
603
|
-
font-size: var(--salla-autocomplete-error-font-size, 0.875rem);
|
|
604
|
-
color: var(--salla-autocomplete-error-color, #dc2626);
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
.no-results {
|
|
608
|
-
padding: 1rem;
|
|
609
|
-
text-align: start;
|
|
610
|
-
color: var(--salla-autocomplete-no-results-color, #6b7280);
|
|
611
|
-
font-size: var(--salla-autocomplete-no-results-font-size, 0.875rem);
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
.no-results.error-state {
|
|
615
|
-
color: var(--salla-autocomplete-error-color, #dc2626);
|
|
616
|
-
background-color: var(--salla-autocomplete-error-bg, #fef2f2);
|
|
617
|
-
border-radius: 0.375rem;
|
|
618
|
-
margin: 0.5rem;
|
|
619
|
-
padding: 0.875rem;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
@media (max-width: 640px) {
|
|
623
|
-
.no-results {
|
|
624
|
-
padding: 0.875rem;
|
|
625
|
-
font-size: var(--salla-autocomplete-no-results-font-size-mobile, 0.8125rem);
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
.no-results.error-state {
|
|
629
|
-
margin: 0.375rem;
|
|
630
|
-
padding: 0.75rem;
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
`,ii([qe({type:String})],si.prototype,"proxyUrl",2),ii([qe({type:String})],si.prototype,"authToken",2),ii([qe({type:String})],si.prototype,"placeholder",2),ii([qe({type:String})],si.prototype,"defaultPlace",2),ii([qe({type:String})],si.prototype,"label",2),ii([qe({type:String})],si.prototype,"className",2),ii([qe({type:String})],si.prototype,"language",2),ii([qe({type:String})],si.prototype,"dir",2),ii([qe({type:String})],si.prototype,"mode",2),ii([qe({type:String})],si.prototype,"name",2),ii([qe({type:Boolean})],si.prototype,"required",2),ii([qe({type:String})],si.prototype,"pattern",2),ii([qe({type:String})],si.prototype,"tooltip",2),ii([qe({type:String})],si.prototype,"selectedId",2),ii([qe({type:Array})],si.prototype,"errors",2),ii([qe({type:Boolean})],si.prototype,"disabled",2),ii([qe({type:String})],si.prototype,"value",1),ii([qe({type:String})],si.prototype,"country",1),ii([qe({type:Object})],si.prototype,"locationBias",2),ii([qe({type:Object})],si.prototype,"locationRestriction",2),ii([qe({type:Array})],si.prototype,"types",2),ii([qe({type:String})],si.prototype,"fieldsStr",1),ii([qe({type:Array})],si.prototype,"fields",1),ii([qe({type:Boolean})],si.prototype,"strictBounds",2),ii([qe({type:Boolean})],si.prototype,"useSessionToken",2),ii([qe({type:Boolean})],si.prototype,"resolve",2),ii([qe({type:Function})],si.prototype,"onValidateAddress",2),ii([qe({type:Number})],si.prototype,"debounceDelay",2),ii([qe({type:Number})],si.prototype,"minChars",2),ii([Ze()],si.prototype,"predictions",2),ii([Ze()],si.prototype,"isOpen",2),ii([Ze()],si.prototype,"isLoading",2),ii([Ze()],si.prototype,"error",2),ii([Ze()],si.prototype,"activeIndex",2),ii([Ze()],si.prototype,"inputValue",2),ii([Ze()],si.prototype,"sessionToken",2),ii([Ze()],si.prototype,"validationError",2),ii([Ze()],si.prototype,"touched",2),ii([Ze()],si.prototype,"showNationalAddressIcon",2),ii([(t,e)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i))(t,e,{get(){return(t=>t.renderRoot?.querySelector("input")??null)(this)}})],si.prototype,"inputElement",2),si=ii([(t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)})("salla-address-autocomplete")],si);let ri=!1;const oi=new Map,ai=new Promise(((t,e)=>{typeof window>"u"?t():(window.googleMapsInitCallback=t,window.gm_authFailure=()=>{e(new Error("Google Maps authentication failed"))})})),ni=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)},li=globalThis,hi=li.ShadowRoot&&(void 0===li.ShadyCSS||li.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,di=Symbol(),ci=new WeakMap;let ui=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==di)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(hi&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=ci.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&ci.set(e,t))}return t}toString(){return this.cssText}};const pi=hi?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new ui("string"==typeof t?t:t+"",void 0,di))(e)})(t):t,{is:bi,defineProperty:mi,getOwnPropertyDescriptor:gi,getOwnPropertyNames:fi,getOwnPropertySymbols:vi,getPrototypeOf:yi}=Object,wi=globalThis,xi=wi.trustedTypes,ki=xi?xi.emptyScript:"",Si=wi.reactiveElementPolyfillSupport,Ci={toAttribute(t,e){switch(e){case Boolean:t=t?ki:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch{i=null}}return i}},_i=(t,e)=>!bi(t,e),Ai={attribute:!0,type:String,converter:Ci,reflect:!1,useDefault:!1,hasChanged:_i};Symbol.metadata??=Symbol("metadata"),wi.litPropertyMetadata??=new WeakMap;class zi extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Ai){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=this.getPropertyDescriptor(t,Symbol(),e);void 0!==i&&mi(this.prototype,t,i)}}static getPropertyDescriptor(t,e,i){const{get:s,set:r}=gi(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const o=s?.call(this);r?.call(this,e),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Ai}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;const t=yi(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){const t=this.properties,e=[...fi(t),...vi(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(pi(t))}else void 0!==t&&e.push(pi(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(hi)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),s=li.litNonce;void 0!==s&&e.setAttribute("nonce",s),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:Ci).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,s=i._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=i.getPropertyOptions(s),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:Ci;this._$Em=s;const o=r.fromAttribute(e,t.type);this[s]=o??this._$Ej?.get(s)??o,this._$Em=null}}requestUpdate(t,e,i,s=!1,r){if(void 0!==t){const o=this.constructor;if(!1===s&&(r=this[t]),i??=o.getPropertyOptions(t),!((i.hasChanged??_i)(r,e)||i.useDefault&&i.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:r},o){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==r||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}}zi.elementStyles=[],zi.shadowRootOptions={mode:"open"},zi.elementProperties=new Map,zi.finalized=new Map,Si?.({ReactiveElement:zi}),(wi.reactiveElementVersions??=[]).push("2.1.2");const $i={attribute:!0,type:String,converter:Ci,reflect:!1,hasChanged:_i},Mi=(t=$i,e,i)=>{const{kind:s,metadata:r}=i;let o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),"setter"===s&&((t=Object.create(t)).wrapped=!0),o.set(i.name,t),"accessor"===s){const{name:s}=i;return{set(i){const r=e.get.call(this);e.set.call(this,i),this.requestUpdate(s,r,t,!0,i)},init(e){return void 0!==e&&this.C(s,void 0,t,e),e}}}if("setter"===s){const{name:s}=i;return function(i){const r=this[s];e.call(this,i),this.requestUpdate(s,r,t,!0,i)}}throw Error("Unsupported decorator location: "+s)};function Li(t){return(e,i)=>"object"==typeof i?Mi(t,e,i):((t,e,i)=>{const s=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),s?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}function Ei(t){return Li({...t,state:!0,attribute:!1})}function Ii(t){return(e,i)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i))(e,i,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}function Pi(t,e,i){const s=[];return e.forEach((e=>{if(!(t&&google&&google.maps&&google.maps.event))return;const r=google.maps.event.addListener(t,e,(t=>{i(e,t)}));s.push((()=>{r&&google.maps.event.removeListener(r)}))})),s}function Ti(t){t.forEach((t=>t())),t.length=0}function Bi(t,e,i){if(!t)return;const s=`set${e.charAt(0).toUpperCase()}${e.slice(1)}`;"function"==typeof t[s]?t[s](i):e in t&&(t[e]=i)}const Ni={en:{buttonLabel:"Use my current location",errorTitle:"Unable to Access Location",closeButton:"Continue",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"Location access was denied. Please enable location services in your browser settings.",positionUnavailable:"Your location is currently unavailable. Please check your device settings.",timeout:"Location request timed out. Please try again.",generalError:"Unable to get your location. Please try entering your address manually.",clickToSelectLocation:"You can also choose your location by clicking on the map"},ar:{buttonLabel:"استخدم موقعي الحالي",errorTitle:"تعذر الوصول إلى الموقع",closeButton:"متابعة",loading:"جار الحصول على موقعك...",loadingInstructions:"يرجى السماح بالوصول إلى الموقع في المتصفح للمتابعة",timerMessage:"ستختفي هذه الرسالة تلقائياً بعد 7 ثوانٍ أو انقر متابعة",permissionDenied:"تم رفض الوصول إلى الموقع. يرجى تفعيل خدمات الموقع في إعدادات المتصفح.",positionUnavailable:"موقعك غير متاح حالياً. يرجى التحقق من إعدادات جهازك.",timeout:"انتهت مهلة طلب الموقع. يرجى المحاولة مرة أخرى.",generalError:"تعذر الحصول على موقعك. يرجى إدخال عنوانك يدوياً.",clickToSelectLocation:"يمكنك أيضاً اختيار موقعك بالنقر على الخريطة"},es:{buttonLabel:"Usar mi ubicación actual",errorTitle:"Error de ubicación",closeButton:"Cerrar",loading:"Obteniendo tu ubicación...",loadingInstructions:"Permite el acceso a la ubicación en tu navegador para continuar",timerMessage:"Este mensaje se ocultará automáticamente en 7 segundos o haz clic en Cerrar",permissionDenied:"Se denegó el acceso a la ubicación. Habilita los servicios de ubicación en la configuración de tu navegador.",positionUnavailable:"Tu ubicación no está disponible actualmente. Verifica la configuración de tu dispositivo.",timeout:"La solicitud de ubicación expiró. Inténtalo de nuevo.",generalError:"No se pudo obtener tu ubicación. Intenta ingresar tu dirección manualmente.",clickToSelectLocation:"Haz clic en el mapa para seleccionar una ubicación"},fr:{buttonLabel:"Utiliser ma position actuelle",errorTitle:"Erreur de localisation",closeButton:"Continuer",loading:"Obtention de votre position...",loadingInstructions:"Veuillez autoriser l'accès à la localisation dans votre navigateur pour continuer",timerMessage:"Ce message se masquera automatiquement dans 7 secondes ou cliquez sur Continuer",permissionDenied:"L'accès à la localisation a été refusé. Veuillez activer les services de localisation dans les paramètres de votre navigateur.",positionUnavailable:"Votre position n'est pas disponible actuellement. Veuillez vérifier les paramètres de votre appareil.",timeout:"La demande de localisation a expiré. Veuillez réessayer.",generalError:"Impossible d'obtenir votre position. Veuillez entrer votre adresse manuellement.",clickToSelectLocation:"Vous pouvez également choisir votre position en cliquant sur la carte"},de:{buttonLabel:"Meinen aktuellen Standort verwenden",errorTitle:"Standortfehler",closeButton:"Schließen",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"Der Zugriff auf den Standort wurde verweigert. Bitte aktivieren Sie die Standortdienste in Ihren Browsereinstellungen.",positionUnavailable:"Ihr Standort ist derzeit nicht verfügbar. Bitte überprüfen Sie Ihre Geräteeinstellungen.",timeout:"Standortanfrage ist abgelaufen. Bitte versuchen Sie es erneut.",generalError:"Ihr Standort konnte nicht abgerufen werden. Bitte geben Sie Ihre Adresse manuell ein.",clickToSelectLocation:"Klicken Sie auf die Karte, um einen Standort auszuwählen"},zh:{buttonLabel:"使用我的当前位置",errorTitle:"位置错误",closeButton:"关闭",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"位置访问被拒绝。请在浏览器设置中启用位置服务。",positionUnavailable:"您的位置当前不可用。请检查您的设备设置。",timeout:"位置请求超时。请重试。",generalError:"无法获取您的位置。请尝试手动输入地址。",clickToSelectLocation:"点击地图选择位置"},ja:{buttonLabel:"現在地を使用",errorTitle:"位置情報エラー",closeButton:"閉じる",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"位置情報へのアクセスが拒否されました。ブラウザの設定で位置情報サービスを有効にしてください。",positionUnavailable:"現在位置が利用できません。デバイスの設定を確認してください。",timeout:"位置情報リクエストがタイムアウトしました。もう一度お試しください。",generalError:"位置情報を取得できませんでした。住所を手動で入力してください。",clickToSelectLocation:"地図をクリックして場所を選択"},pt:{buttonLabel:"Usar minha localização atual",errorTitle:"Erro de localização",closeButton:"Fechar",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"O acesso à localização foi negado. Ative os serviços de localização nas configurações do navegador.",positionUnavailable:"Sua localização não está disponível no momento. Verifique as configurações do dispositivo.",timeout:"A solicitação de localização expirou. Tente novamente.",generalError:"Não foi possível obter sua localização. Tente inserir seu endereço manualmente.",clickToSelectLocation:"Clique no mapa para selecionar um local"},ru:{buttonLabel:"Использовать мое текущее местоположение",errorTitle:"Ошибка местоположения",closeButton:"Закрыть",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"Доступ к местоположению был запрещен. Включите службы определения местоположения в настройках браузера.",positionUnavailable:"Ваше местоположение в настоящее время недоступно. Проверьте настройки устройства.",timeout:"Время ожидания запроса местоположения истекло. Попробуйте еще раз.",generalError:"Не удалось получить ваше местоположение. Попробуйте ввести адрес вручную.",clickToSelectLocation:"Нажмите на карту, чтобы выбрать местоположение"},it:{buttonLabel:"Usa la mia posizione attuale",errorTitle:"Errore di posizione",closeButton:"Chiudi",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"L'accesso alla posizione è stato negato. Abilita i servizi di localizzazione nelle impostazioni del browser.",positionUnavailable:"La tua posizione non è attualmente disponibile. Controlla le impostazioni del dispositivo.",timeout:"La richiesta di posizione è scaduta. Riprova.",generalError:"Impossibile ottenere la tua posizione. Prova a inserire manualmente il tuo indirizzo.",clickToSelectLocation:"Fai clic sulla mappa per selezionare una posizione"},nl:{buttonLabel:"Gebruik mijn huidige locatie",errorTitle:"Locatiefout",closeButton:"Sluiten",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"Toegang tot locatie is geweigerd. Schakel locatieservices in in uw browserinstellingen.",positionUnavailable:"Uw locatie is momenteel niet beschikbaar. Controleer uw apparaatinstellingen.",timeout:"Locatieverzoek is verlopen. Probeer het opnieuw.",generalError:"Kan uw locatie niet ophalen. Probeer uw adres handmatig in te voeren.",clickToSelectLocation:"Klik op de kaart om een locatie te selecteren"},tr:{buttonLabel:"Mevcut konumumu kullan",errorTitle:"Konum Hatası",closeButton:"Kapat",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"Konum erişimi reddedildi. Lütfen tarayıcı ayarlarınızda konum hizmetlerini etkinleştirin.",positionUnavailable:"Konumunuz şu anda kullanılamıyor. Lütfen cihaz ayarlarınızı kontrol edin.",timeout:"Konum isteği zaman aşımına uğradı. Lütfen tekrar deneyin.",generalError:"Konumunuz alınamadı. Lütfen adresinizi manuel olarak girmeyi deneyin.",clickToSelectLocation:"Bir konum seçmek için haritaya tıklayın"},ko:{buttonLabel:"현재 위치 사용",errorTitle:"위치 오류",closeButton:"닫기",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"위치 액세스가 거부되었습니다. 브라우저 설정에서 위치 서비스를 활성화하십시오.",positionUnavailable:"현재 위치를 사용할 수 없습니다. 기기 설정을 확인하십시오.",timeout:"위치 요청 시간이 초과되었습니다. 다시 시도하십시오.",generalError:"위치를 가져올 수 없습니다. 수동으로 주소를 입력해 보십시오.",clickToSelectLocation:"지도를 클릭하여 위치를 선택하십시오"},hi:{buttonLabel:"मेरा वर्तमान स्थान उपयोग करें",errorTitle:"स्थान त्रुटि",closeButton:"बंद करें",loading:"Getting your location...",loadingInstructions:"Please allow location access in your browser to continue",timerMessage:"This message will auto-hide in 7 seconds or click Continue",permissionDenied:"स्थान पहुंच अस्वीकार कर दी गई थी। कृपया अपनी ब्राउज़र सेटिंग में स्थान सेवाएं सक्षम करें।",positionUnavailable:"आपका स्थान वर्तमान में उपलब्ध नहीं है। कृपया अपनी डिवाइस सेटिंग्स जांचें।",timeout:"स्थान अनुरोध समय समाप्त हो गया। कृपया पुनः प्रयास करें।",generalError:"आपका स्थान प्राप्त करने में असमर्थ। कृपया अपना पता मैन्युअल रूप से दर्ज करने का प्रयास करें।",clickToSelectLocation:"स्थान चुनने के लिए मानचित्र पर क्लिक करें"}},Di=new Set(["ar","he","fa","ur"]);function ji(t="en"){return Ni[t]||Ni.en}function Oi(t){return Di.has(t)}var Ui=Object.defineProperty,Fi=Object.getOwnPropertyDescriptor,Ri=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Fi(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Ui(e,i,o),o};let qi=class extends Bt{constructor(){super(...arguments),this.zoom=15,this.mapTypeId="roadmap",this.heading=0,this.tilt=0,this.gestureHandling="cooperative",this.minZoom=2,this.maxZoom=19,this.disableDefaultUI=!1,this.mapTypeControl=!1,this.streetViewControl=!1,this.rotateControl=!1,this.fullscreenControl=!1,this.enableGeolocation=!1,this.showLocationMarker=!0,this.geolocationOptions={maximumAge:6e4,timeout:1e4,enableHighAccuracy:!0},this.locationMarkerBackground="#4285F4",this.locationMarkerBorderColor="#1967D2",this.locationMarkerGlyphColor="#FFFFFF",this.locationMarkerScale=1.3,this.locationCircleOptions={},this.language="en",this.options={},this.enableAutocomplete=!1,this.autocompleteProxyUrl="https://api.salla.dev",this.autocompleteStrictBounds=!1,this.autocompleteResolve=!1,this.autocompleteDebounceDelay=300,this.autocompleteMinChars=3,this.geolocationLoading=!1,this.geolocationError=null,this.showLoadingOverlay=!1,this.buttonState="normal",this.eventListeners=[],this.autocompleteListenerAttached=!1}async connectedCallback(){super.connectedCallback(),Oi(this.language)&&(document.dir="rtl")}async firstUpdated(){await ai,this.createMap()}clearAutocompleteInput(){if(!this.autocompleteElement)return;const t=this.autocompleteElement.shadowRoot?.querySelector("input");t&&(t.value="",this.autocompleteElement.inputValue="",this.autocompleteElement.value="")}setupAutocompleteListener(){!this.enableAutocomplete||!this.autocompleteElement||this.autocompleteListenerAttached||(this.autocompleteElement.addEventListener("place-select",(t=>{const{place:e}=t.detail;if(e?.geometry?.location){const{lat:t,lng:i}=e.geometry.location;this.setLocation(t,i,50,!0),this.dispatchMapEvent("location_changed",{position:{lat:t,lng:i},accuracy:50,source:"autocomplete",place:{placeId:e.place_id,formattedAddress:e.formatted_address,addressComponents:e.address_components,name:e.name,types:e.types}}),this.dispatchMapEvent("autocomplete_place_selected",{place:e})}})),this.autocompleteListenerAttached=!0)}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}updated(t){super.updated(t),this.enableAutocomplete&&!this.autocompleteListenerAttached&&setTimeout((()=>this.setupAutocompleteListener()),0),this.map&&(t.has("center")&&this.center&&Bi(this.map,"center",this.center),t.has("zoom")&&void 0!==this.zoom&&Bi(this.map,"zoom",this.zoom),t.has("minZoom")&&void 0!==this.minZoom&&this.map&&this.map.setOptions({minZoom:this.minZoom}),t.has("maxZoom")&&void 0!==this.maxZoom&&this.map&&this.map.setOptions({maxZoom:this.maxZoom}),t.has("mapTypeId")&&this.mapTypeId&&Bi(this.map,"mapTypeId",this.mapTypeId),t.has("heading")&&void 0!==this.heading&&Bi(this.map,"heading",this.heading),t.has("tilt")&&void 0!==this.tilt&&Bi(this.map,"tilt",this.tilt),t.has("locationMarkerPosition")&&this.locationMarkerPosition&&this.showLocationMarker&&this.setLocation(this.locationMarkerPosition.lat,this.locationMarkerPosition.lng,this.locationMarkerPosition.accuracy))}createMap(){if(!this.mapElement)return;const t={center:this.center,zoom:this.zoom,mapId:this.mapId,mapTypeId:this.mapTypeId,heading:this.heading,tilt:this.tilt,gestureHandling:this.gestureHandling,minZoom:this.minZoom,maxZoom:this.maxZoom,disableDefaultUI:this.disableDefaultUI,zoomControl:this.zoomControl,mapTypeControl:this.mapTypeControl,scaleControl:this.scaleControl,streetViewControl:this.streetViewControl,rotateControl:this.rotateControl,fullscreenControl:this.fullscreenControl,disableDoubleClickZoom:!0,keyboardShortcuts:!1,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_BOTTOM},...this.options};this.map=new google.maps.Map(this.mapElement,t);const e=google.maps.event.addListener(this.map,"click",(t=>{if(t.latLng&&this.showLocationMarker){const e=t.latLng.lat(),i=t.latLng.lng();this.setLocation(e,i,50,!1),this.clearAutocompleteInput(),this.dispatchMapEvent("location_changed",{position:{lat:e,lng:i},accuracy:50,source:"map-click"})}}));this.eventListeners=Pi(this.map,["click","dblclick","drag","dragend","dragstart","idle","mousemove","mouseout","mouseover","resize","rightclick","tilesloaded"],((t,e)=>{this.dispatchMapEvent(t,e)})),this.eventListeners.push((()=>{e&&google.maps.event.removeListener(e)})),["center","zoom","bounds","mapTypeId"].forEach((t=>{const e=`${t}_changed`,i=google.maps.event.addListener(this.map,e,(()=>{const i=`get${t.charAt(0).toUpperCase()}${t.slice(1)}`;if("function"==typeof this.map[i]){const t=this.map[i]();this.dispatchMapEvent(e,t)}}));this.eventListeners.push((()=>{i&&google.maps.event.removeListener(i)}))})),this.dispatchEvent(new CustomEvent("gmap-ready",{detail:{map:this.map},bubbles:!0,composed:!0})),this.locationMarkerPosition&&this.showLocationMarker&&this.setLocation(this.locationMarkerPosition.lat,this.locationMarkerPosition.lng,this.locationMarkerPosition.accuracy)}dispatchMapEvent(t,e){let i=t;(t.includes("_changed")||t.startsWith("geolocation_")||t.startsWith("location_"))&&(i=`gmap-${t.replace(/_/g,"-")}`),this.dispatchEvent(new CustomEvent(i,{detail:e,bubbles:!0,composed:!0}))}cleanup(){Ti(this.eventListeners),this.locationMarker&&(this.locationMarker.map=null,this.locationMarker=void 0),this.locationCircle&&(this.locationCircle.setMap(null),this.locationCircle=void 0),this.map=void 0}panBy(t,e){this.map?.panBy(t,e)}panTo(t){this.map?.panTo(t)}panToBounds(t){this.map?.panToBounds(t)}fitBounds(t){this.map?.fitBounds(t)}resize(){this.map&&google.maps.event.trigger(this.map,"resize")}resizePreserveCenter(){if(!this.map)return;const t=this.map.getCenter();google.maps.event.trigger(this.map,"resize"),t&&this.map.setCenter(t)}setLocation(t,e,i=50,s=!0){if(!this.map)return void console.warn("GMapMap: Cannot set location before map is initialized");const r={lat:t,lng:e};s&&this.map.panTo(r),this.showLocationMarker&&this.addLocationMarker(r,i),this.dispatchMapEvent("location_changed",{position:r,accuracy:i,source:"programmatic"})}async getCurrentLocation(t=!1){if(!navigator.geolocation)throw this.dispatchMapEvent("geolocation_error",{code:"NOT_SUPPORTED",message:"Geolocation is not supported by this browser"}),t||this.showGeolocationError(this.getTranslation("generalError")),new Error("NOT_SUPPORTED");this.geolocationLoading=!0,this.buttonState="loading",this.dispatchMapEvent("geolocation_loading",{message:"Getting your location..."});const e=t?null:setTimeout((()=>{this.geolocationLoading&&(this.showLoadingOverlay=!0)}),150);return new Promise(((i,s)=>{navigator.geolocation.getCurrentPosition((t=>{const s={lat:t.coords.latitude,lng:t.coords.longitude};if(e&&clearTimeout(e),this.geolocationLoading=!1,this.showLoadingOverlay=!1,this.buttonState="success",setTimeout((()=>{this.buttonState="normal"}),2e3),this.map){this.map.panTo(s);const e=t.coords.accuracy;let i=15;i=e>1e3?12:e>500?13:e>100?14:16,this.map.setZoom(i),this.showLocationMarker&&this.addLocationMarker(s,e),this.clearAutocompleteInput()}this.dispatchMapEvent("geolocation_success",{position:s,accuracy:t.coords.accuracy,altitude:t.coords.altitude,altitudeAccuracy:t.coords.altitudeAccuracy,heading:t.coords.heading,speed:t.coords.speed,timestamp:t.timestamp}),this.dispatchMapEvent("location_changed",{position:s,accuracy:t.coords.accuracy,source:"geolocation"}),i(s)}),(i=>{e&&clearTimeout(e),this.geolocationLoading=!1,this.showLoadingOverlay=!1,this.buttonState="error",setTimeout((()=>{this.buttonState="normal"}),2e3);let r="GENERAL_ERROR",o=this.getTranslation("generalError");i.code===i.PERMISSION_DENIED?(r="PERMISSION_DENIED",o=this.getTranslation("permissionDenied")):i.code===i.POSITION_UNAVAILABLE?(r="POSITION_UNAVAILABLE",o=this.getTranslation("positionUnavailable")):i.code===i.TIMEOUT&&(r="TIMEOUT",o=this.getTranslation("timeout")),this.dispatchMapEvent("geolocation_error",{code:r,message:o,error:i}),t||this.showGeolocationError(o),s(i)}),this.geolocationOptions)}))}handleGeolocationClick(){this.geolocationError=null,this.getCurrentLocation()}async addLocationMarker(t,e){if(this.map){if(this.locationMarker&&(this.locationMarker.map=null,this.locationMarker=void 0),this.locationCircle&&(this.locationCircle.setMap(null),this.locationCircle=void 0),!this.mapId)return void console.warn("GMapMap: mapId is required for location marker. Please set the mapId property on <gmap-map>. Get a Map ID from: https://console.cloud.google.com/google/maps-apis/studio/maps");try{const{AdvancedMarkerElement:e,PinElement:i}=await google.maps.importLibrary("marker"),s=new i({background:this.locationMarkerBackground,borderColor:this.locationMarkerBorderColor,glyphColor:this.locationMarkerGlyphColor,scale:this.locationMarkerScale});this.locationMarker=new e({map:this.map,position:t,title:"Your Location (Drag to adjust)",content:s.element,gmpDraggable:!0}),this.locationMarker.addListener("dragend",(()=>{if(this.locationMarker&&this.locationCircle){const t=this.locationMarker.position,e=t.toJSON?t.toJSON():{lat:t.lat(),lng:t.lng()};this.locationCircle.setCenter(e);const i=this.locationCircle.getRadius();this.clearAutocompleteInput(),this.dispatchMapEvent("location_marker_dragend",{position:e,accuracy:i}),this.dispatchMapEvent("location_changed",{position:e,accuracy:i,source:"marker-drag"})}}))}catch(t){console.error("Error creating AdvancedMarkerElement:",t)}this.locationCircle=new google.maps.Circle({map:this.map,center:t,radius:e,fillColor:"#4285F4",fillOpacity:.15,strokeColor:"#4285F4",strokeOpacity:.4,strokeWeight:1,clickable:!1,...this.locationCircleOptions})}}showGeolocationError(t){this.geolocationError=t,setTimeout((()=>{this.geolocationError=null}),7e3)}getTranslation(t){const e={loading:this.geolocationLoadingTitle,loadingInstructions:this.geolocationLoadingInstructions,errorTitle:this.geolocationErrorTitle,closeButton:this.geolocationErrorButtonText,timerMessage:this.geolocationErrorTimerMessage,clickToSelectLocation:this.geolocationClickToSelectMessage,generalError:this.geolocationGeneralErrorMessage,permissionDenied:this.geolocationPermissionDeniedMessage,positionUnavailable:this.geolocationPositionUnavailableMessage,timeout:this.geolocationTimeoutMessage}[t];if(null!=e&&""!==e)return e;const i=ji(this.language);return i[t]||i.generalError}get buttonLabel(){return void 0!==this.geolocationButtonLabel?this.geolocationButtonLabel:ji(this.language).buttonLabel||""}getButtonIconColor(){switch(this.buttonState){case"loading":return"#999";case"success":return"#4285F4";case"error":return"#EA4335";default:return"#666"}}getMap(){return this.map}render(){const t=Oi(this.language)?"rtl":"ltr";return ft`
|
|
634
|
-
<div class="map-page-wrapper">
|
|
635
|
-
${this.enableAutocomplete?ft`
|
|
636
|
-
<div class="auto-complete-map-wrapper">
|
|
637
|
-
<div class="auto-complete-map-box" dir="${t}">
|
|
638
|
-
<salla-address-autocomplete
|
|
639
|
-
.proxyUrl=${this.autocompleteProxyUrl}
|
|
640
|
-
.authToken=${this.autocompleteAuthToken||null}
|
|
641
|
-
.placeholder=${this.autocompletePlaceholder||""}
|
|
642
|
-
.label=${this.autocompleteLabel||null}
|
|
643
|
-
.language=${this.language}
|
|
644
|
-
.country=${this.autocompleteCountry||null}
|
|
645
|
-
.locationBias=${this.autocompleteLocationBias||null}
|
|
646
|
-
.locationRestriction=${this.autocompleteLocationRestriction||null}
|
|
647
|
-
.types=${this.autocompleteTypes?this.autocompleteTypes.split(",").map((t=>t.trim())):null}
|
|
648
|
-
.fieldsStr=${this.autocompleteFields||null}
|
|
649
|
-
.strictBounds=${this.autocompleteStrictBounds}
|
|
650
|
-
.resolve=${this.autocompleteResolve}
|
|
651
|
-
.debounceDelay=${this.autocompleteDebounceDelay}
|
|
652
|
-
.minChars=${this.autocompleteMinChars}
|
|
653
|
-
></salla-address-autocomplete>
|
|
654
|
-
${this.autocompleteHint?ft`<span class="hint-wrapper">${this.autocompleteHint}</span>`:""}
|
|
655
|
-
</div>
|
|
656
|
-
</div>
|
|
657
|
-
`:""}
|
|
658
|
-
|
|
659
|
-
<div class="map-container">
|
|
660
|
-
<div class="map"></div>
|
|
661
|
-
<slot></slot>
|
|
662
|
-
|
|
663
|
-
${this.enableGeolocation?ft`
|
|
664
|
-
<div class="controls-overlay">
|
|
665
|
-
<button
|
|
666
|
-
class="geolocation-button ${this.buttonLabel&&this.buttonLabel.trim()?"has-label":""}"
|
|
667
|
-
@click=${this.handleGeolocationClick}
|
|
668
|
-
title="Show your location"
|
|
669
|
-
?disabled=${this.geolocationLoading}
|
|
670
|
-
>
|
|
671
|
-
<svg width="18" height="18" viewBox="0 0 24 24" fill="${this.getButtonIconColor()}">
|
|
672
|
-
<path
|
|
673
|
-
d="M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3A8.994 8.994 0 0 0 13 3.06V1h-2v2.06A8.994 8.994 0 0 0 3.06 11H1v2h2.06A8.994 8.994 0 0 0 11 20.94V23h2v-2.06A8.994 8.994 0 0 0 20.94 13H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"
|
|
674
|
-
/>
|
|
675
|
-
</svg>
|
|
676
|
-
${this.buttonLabel&&this.buttonLabel.trim()?ft`<span class="label">${this.buttonLabel}</span>`:""}
|
|
677
|
-
</button>
|
|
678
|
-
</div>
|
|
679
|
-
`:""}
|
|
680
|
-
|
|
681
|
-
${this.showLoadingOverlay&&!this.geolocationError?ft`
|
|
682
|
-
<div class="loading-overlay">
|
|
683
|
-
<div class="spinner"></div>
|
|
684
|
-
<div class="title">
|
|
685
|
-
${this.getTranslation("loading")}
|
|
686
|
-
</div>
|
|
687
|
-
<div class="instructions">
|
|
688
|
-
${this.getTranslation("loadingInstructions")}
|
|
689
|
-
</div>
|
|
690
|
-
</div>
|
|
691
|
-
`:""}
|
|
692
|
-
|
|
693
|
-
${this.geolocationError&&!this.showLoadingOverlay?ft`
|
|
694
|
-
<div class="error-overlay">
|
|
695
|
-
<div class="error-icon">
|
|
696
|
-
<svg width="40" height="40" viewBox="0 0 24 24" fill="none">
|
|
697
|
-
<circle cx="12" cy="12" r="10" stroke="#ef4444" stroke-width="2" fill="none"/>
|
|
698
|
-
<path d="M12 8v4M12 16h.01" stroke="#ef4444" stroke-width="2" stroke-linecap="round"/>
|
|
699
|
-
</svg>
|
|
700
|
-
</div>
|
|
701
|
-
<div class="error-title">
|
|
702
|
-
${this.getTranslation("errorTitle")}
|
|
703
|
-
</div>
|
|
704
|
-
<div class="error-message">${this.geolocationError}</div>
|
|
705
|
-
<div class="map-hint">
|
|
706
|
-
${this.getTranslation("clickToSelectLocation")}
|
|
707
|
-
</div>
|
|
708
|
-
<div class="timer-message">
|
|
709
|
-
${this.getTranslation("timerMessage")}
|
|
710
|
-
</div>
|
|
711
|
-
<button @click=${()=>this.geolocationError=null}>
|
|
712
|
-
${this.getTranslation("closeButton")}
|
|
713
|
-
</button>
|
|
714
|
-
</div>
|
|
715
|
-
`:""}
|
|
716
|
-
</div>
|
|
717
|
-
</div>
|
|
718
|
-
`}};qi.styles=N`
|
|
719
|
-
:host {
|
|
720
|
-
display: block;
|
|
721
|
-
position: relative;
|
|
722
|
-
width: 100%;
|
|
723
|
-
height: 400px;
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
@media (max-width: 640px) {
|
|
727
|
-
:host {
|
|
728
|
-
height: 65vh;
|
|
729
|
-
min-height: 300px;
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
@media (max-width: 640px) and (min-height: 700px) {
|
|
734
|
-
:host {
|
|
735
|
-
height: 65vh;
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
.map-container {
|
|
740
|
-
width: 100%;
|
|
741
|
-
height: 100%;
|
|
742
|
-
position: relative;
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
.map {
|
|
746
|
-
width: 100%;
|
|
747
|
-
height: 100%;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
.controls-overlay {
|
|
751
|
-
position: absolute;
|
|
752
|
-
top: 0;
|
|
753
|
-
left: 0;
|
|
754
|
-
right: 0;
|
|
755
|
-
bottom: 0;
|
|
756
|
-
pointer-events: none;
|
|
757
|
-
z-index: 40;
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
.controls-overlay > * {
|
|
761
|
-
pointer-events: auto;
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
.geolocation-button {
|
|
765
|
-
position: absolute;
|
|
766
|
-
bottom: 23px;
|
|
767
|
-
left: 10px;
|
|
768
|
-
right: auto;
|
|
769
|
-
background: #fff;
|
|
770
|
-
border: none;
|
|
771
|
-
border-radius: 2px;
|
|
772
|
-
box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;
|
|
773
|
-
cursor: pointer;
|
|
774
|
-
padding: 10px;
|
|
775
|
-
height: 40px;
|
|
776
|
-
display: flex;
|
|
777
|
-
align-items: center;
|
|
778
|
-
justify-content: center;
|
|
779
|
-
gap: 8px;
|
|
780
|
-
outline: none;
|
|
781
|
-
color: rgb(86, 86, 86);
|
|
782
|
-
font-family: var(--gmap-font-family, Roboto, Arial, sans-serif);
|
|
783
|
-
font-size: 14px;
|
|
784
|
-
white-space: nowrap;
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
@media (max-width: 640px) {
|
|
788
|
-
.geolocation-button {
|
|
789
|
-
bottom: 23px;
|
|
790
|
-
left: 10px;
|
|
791
|
-
right: auto;
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
.geolocation-button .label {
|
|
795
|
-
display: none;
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
.geolocation-button {
|
|
799
|
-
width: 40px !important;
|
|
800
|
-
padding: 10px !important;
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
.geolocation-button.has-label {
|
|
805
|
-
width: auto;
|
|
806
|
-
padding: 8px 12px;
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
.geolocation-button:not(.has-label) {
|
|
810
|
-
width: 40px;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
.geolocation-button:hover:not(:disabled) {
|
|
814
|
-
background: #ebebeb;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
.geolocation-button:disabled {
|
|
818
|
-
cursor: wait;
|
|
819
|
-
opacity: 0.6;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
.geolocation-button svg {
|
|
823
|
-
flex-shrink: 0;
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
.geolocation-button .label {
|
|
827
|
-
font-weight: 500;
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
.loading-overlay {
|
|
831
|
-
position: absolute;
|
|
832
|
-
top: 0;
|
|
833
|
-
left: 0;
|
|
834
|
-
right: 0;
|
|
835
|
-
bottom: 0;
|
|
836
|
-
background: rgba(0, 0, 0, 0.7);
|
|
837
|
-
z-index: 200;
|
|
838
|
-
display: flex;
|
|
839
|
-
flex-direction: column;
|
|
840
|
-
align-items: center;
|
|
841
|
-
justify-content: center;
|
|
842
|
-
gap: 16px;
|
|
843
|
-
padding: 16px;
|
|
844
|
-
font-family: var(--gmap-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
.loading-overlay .spinner {
|
|
848
|
-
width: 48px;
|
|
849
|
-
height: 48px;
|
|
850
|
-
border: 4px solid rgba(255, 255, 255, 0.3);
|
|
851
|
-
border-top-color: #ffffff;
|
|
852
|
-
border-radius: 50%;
|
|
853
|
-
animation: spin 1s linear infinite;
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
@keyframes spin {
|
|
857
|
-
to { transform: rotate(360deg); }
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
.loading-overlay .title {
|
|
861
|
-
font-size: 18px;
|
|
862
|
-
font-weight: 600;
|
|
863
|
-
color: #ffffff;
|
|
864
|
-
margin: 0;
|
|
865
|
-
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
.loading-overlay .instructions {
|
|
869
|
-
font-size: 14px;
|
|
870
|
-
color: #ffffff;
|
|
871
|
-
line-height: 1.5;
|
|
872
|
-
margin: 0;
|
|
873
|
-
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
|
874
|
-
text-align: center;
|
|
875
|
-
max-width: 90%;
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
.error-overlay {
|
|
879
|
-
position: absolute;
|
|
880
|
-
top: 0;
|
|
881
|
-
left: 0;
|
|
882
|
-
right: 0;
|
|
883
|
-
bottom: 0;
|
|
884
|
-
background: rgba(0, 0, 0, 0.7);
|
|
885
|
-
z-index: 200;
|
|
886
|
-
display: flex;
|
|
887
|
-
flex-direction: column;
|
|
888
|
-
align-items: center;
|
|
889
|
-
justify-content: center;
|
|
890
|
-
gap: 12px;
|
|
891
|
-
padding: 16px;
|
|
892
|
-
font-family: var(--gmap-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
.error-overlay .error-icon svg {
|
|
896
|
-
display: block;
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
.error-overlay .error-title {
|
|
900
|
-
font-size: 17px;
|
|
901
|
-
font-weight: 600;
|
|
902
|
-
color: #ef4444;
|
|
903
|
-
margin: 0;
|
|
904
|
-
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
.error-overlay .error-message {
|
|
908
|
-
font-size: 14px;
|
|
909
|
-
color: #ffffff;
|
|
910
|
-
line-height: 1.4;
|
|
911
|
-
margin: 0;
|
|
912
|
-
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
|
913
|
-
text-align: center;
|
|
914
|
-
max-width: 90%;
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
.error-overlay .map-hint {
|
|
918
|
-
font-size: 12px;
|
|
919
|
-
color: #d4d4d4;
|
|
920
|
-
line-height: 1.4;
|
|
921
|
-
margin: 0;
|
|
922
|
-
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
|
923
|
-
text-align: center;
|
|
924
|
-
font-style: italic;
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
.error-overlay .timer-message {
|
|
928
|
-
font-size: 12px;
|
|
929
|
-
color: #d4d4d4;
|
|
930
|
-
margin: 0;
|
|
931
|
-
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
.error-overlay button {
|
|
935
|
-
margin-top: 4px;
|
|
936
|
-
padding: 8px 24px;
|
|
937
|
-
background: #ffffff;
|
|
938
|
-
color: #18181b;
|
|
939
|
-
border: none;
|
|
940
|
-
border-radius: 8px;
|
|
941
|
-
font-size: 14px;
|
|
942
|
-
font-weight: 600;
|
|
943
|
-
cursor: pointer;
|
|
944
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
.error-overlay button:hover {
|
|
948
|
-
background: #f4f4f5;
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
.map-page-wrapper {
|
|
952
|
-
position: relative;
|
|
953
|
-
width: 100%;
|
|
954
|
-
height: 100%;
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
.auto-complete-map-wrapper {
|
|
958
|
-
position: absolute;
|
|
959
|
-
z-index: 50;
|
|
960
|
-
padding: 1rem;
|
|
961
|
-
width: 100%;
|
|
962
|
-
top: 0;
|
|
963
|
-
left: 0;
|
|
964
|
-
right: 0;
|
|
965
|
-
pointer-events: none;
|
|
966
|
-
box-sizing: border-box;
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
@media (max-width: 640px) {
|
|
970
|
-
.auto-complete-map-wrapper {
|
|
971
|
-
padding: 0.75rem 0.5rem;
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
.auto-complete-map-wrapper > * {
|
|
976
|
-
pointer-events: auto;
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
.auto-complete-map-box {
|
|
980
|
-
width: 100%;
|
|
981
|
-
display: flex;
|
|
982
|
-
flex-direction: column;
|
|
983
|
-
padding: 1rem;
|
|
984
|
-
background-color: #ffffffb2;
|
|
985
|
-
border-radius: 8px;
|
|
986
|
-
backdrop-filter: blur(4px);
|
|
987
|
-
box-sizing: border-box;
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
@media (max-width: 640px) {
|
|
991
|
-
.auto-complete-map-box {
|
|
992
|
-
padding: 0.75rem;
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
.auto-complete-map-box .hint-wrapper {
|
|
997
|
-
font-size: 12px;
|
|
998
|
-
color: #666666;
|
|
999
|
-
margin-top: 0.5rem;
|
|
1000
|
-
text-align: start;
|
|
1001
|
-
direction: inherit;
|
|
1002
|
-
}
|
|
1003
|
-
`,Ri([Li({type:Object})],qi.prototype,"center",2),Ri([Li({type:Number})],qi.prototype,"zoom",2),Ri([Li({type:String,attribute:"map-id"})],qi.prototype,"mapId",2),Ri([Li({type:String,attribute:"map-type-id"})],qi.prototype,"mapTypeId",2),Ri([Li({type:Number})],qi.prototype,"heading",2),Ri([Li({type:Number})],qi.prototype,"tilt",2),Ri([Li({type:Object})],qi.prototype,"bounds",2),Ri([Li({type:String})],qi.prototype,"gestureHandling",2),Ri([Li({type:Number})],qi.prototype,"minZoom",2),Ri([Li({type:Number})],qi.prototype,"maxZoom",2),Ri([Li({type:Boolean})],qi.prototype,"disableDefaultUI",2),Ri([Li({type:Boolean})],qi.prototype,"zoomControl",2),Ri([Li({type:Boolean})],qi.prototype,"mapTypeControl",2),Ri([Li({type:Boolean})],qi.prototype,"scaleControl",2),Ri([Li({type:Boolean})],qi.prototype,"streetViewControl",2),Ri([Li({type:Boolean})],qi.prototype,"rotateControl",2),Ri([Li({type:Boolean})],qi.prototype,"fullscreenControl",2),Ri([Li({type:Boolean,attribute:"enable-geolocation"})],qi.prototype,"enableGeolocation",2),Ri([Li({type:Boolean,attribute:"show-location-marker"})],qi.prototype,"showLocationMarker",2),Ri([Li({type:Object})],qi.prototype,"geolocationOptions",2),Ri([Li({type:Object,attribute:"location-marker-position"})],qi.prototype,"locationMarkerPosition",2),Ri([Li({type:String,attribute:"location-marker-background"})],qi.prototype,"locationMarkerBackground",2),Ri([Li({type:String,attribute:"location-marker-border-color"})],qi.prototype,"locationMarkerBorderColor",2),Ri([Li({type:String,attribute:"location-marker-glyph-color"})],qi.prototype,"locationMarkerGlyphColor",2),Ri([Li({type:Number,attribute:"location-marker-scale"})],qi.prototype,"locationMarkerScale",2),Ri([Li({type:Object,attribute:"location-circle-options"})],qi.prototype,"locationCircleOptions",2),Ri([Li({type:String})],qi.prototype,"language",2),Ri([Li({type:Object})],qi.prototype,"options",2),Ri([Li({type:String,attribute:"geolocation-button-label"})],qi.prototype,"geolocationButtonLabel",2),Ri([Li({type:String,attribute:"geolocation-loading-title"})],qi.prototype,"geolocationLoadingTitle",2),Ri([Li({type:String,attribute:"geolocation-loading-instructions"})],qi.prototype,"geolocationLoadingInstructions",2),Ri([Li({type:String,attribute:"geolocation-error-title"})],qi.prototype,"geolocationErrorTitle",2),Ri([Li({type:String,attribute:"geolocation-error-button-text"})],qi.prototype,"geolocationErrorButtonText",2),Ri([Li({type:String,attribute:"geolocation-error-timer-message"})],qi.prototype,"geolocationErrorTimerMessage",2),Ri([Li({type:String,attribute:"geolocation-click-to-select-message"})],qi.prototype,"geolocationClickToSelectMessage",2),Ri([Li({type:String,attribute:"geolocation-permission-denied-message"})],qi.prototype,"geolocationPermissionDeniedMessage",2),Ri([Li({type:String,attribute:"geolocation-position-unavailable-message"})],qi.prototype,"geolocationPositionUnavailableMessage",2),Ri([Li({type:String,attribute:"geolocation-timeout-message"})],qi.prototype,"geolocationTimeoutMessage",2),Ri([Li({type:String,attribute:"geolocation-general-error-message"})],qi.prototype,"geolocationGeneralErrorMessage",2),Ri([Li({type:Boolean,attribute:"enable-autocomplete"})],qi.prototype,"enableAutocomplete",2),Ri([Li({type:String,attribute:"autocomplete-hint"})],qi.prototype,"autocompleteHint",2),Ri([Li({type:String,attribute:"autocomplete-proxy-url"})],qi.prototype,"autocompleteProxyUrl",2),Ri([Li({type:String,attribute:"autocomplete-auth-token"})],qi.prototype,"autocompleteAuthToken",2),Ri([Li({type:String,attribute:"autocomplete-placeholder"})],qi.prototype,"autocompletePlaceholder",2),Ri([Li({type:String,attribute:"autocomplete-label"})],qi.prototype,"autocompleteLabel",2),Ri([Li({type:String,attribute:"autocomplete-country"})],qi.prototype,"autocompleteCountry",2),Ri([Li({type:Object,attribute:"autocomplete-location-bias"})],qi.prototype,"autocompleteLocationBias",2),Ri([Li({type:Object,attribute:"autocomplete-location-restriction"})],qi.prototype,"autocompleteLocationRestriction",2),Ri([Li({type:String,attribute:"autocomplete-types"})],qi.prototype,"autocompleteTypes",2),Ri([Li({type:String,attribute:"autocomplete-fields"})],qi.prototype,"autocompleteFields",2),Ri([Li({type:Boolean,attribute:"autocomplete-strict-bounds"})],qi.prototype,"autocompleteStrictBounds",2),Ri([Li({type:Boolean,attribute:"autocomplete-resolve"})],qi.prototype,"autocompleteResolve",2),Ri([Li({type:Number,attribute:"autocomplete-debounce-delay"})],qi.prototype,"autocompleteDebounceDelay",2),Ri([Li({type:Number,attribute:"autocomplete-min-chars"})],qi.prototype,"autocompleteMinChars",2),Ri([Ii(".map")],qi.prototype,"mapElement",2),Ri([Ii("salla-address-autocomplete")],qi.prototype,"autocompleteElement",2),Ri([Ei()],qi.prototype,"geolocationLoading",2),Ri([Ei()],qi.prototype,"geolocationError",2),Ri([Ei()],qi.prototype,"showLoadingOverlay",2),Ri([Ei()],qi.prototype,"buttonState",2),qi=Ri([ni("gmap-map")],qi);var Zi=Object.defineProperty,Gi=Object.getOwnPropertyDescriptor,Vi=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Gi(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Zi(e,i,o),o};let Hi=class extends Bt{constructor(){super(...arguments),this.title="",this.gmpDraggable=!1,this.gmpClickable=!0,this.scale=1,this.draggable=!1,this.clickable=!0,this.eventListeners=[]}async connectedCallback(){super.connectedCallback(),await this.initMarker()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}async updated(t){super.updated(t),this.marker&&(t.has("position")&&this.position&&(this.marker.position=this.normalizePosition(this.position)),t.has("title")&&this.title&&(this.marker.title=this.title),t.has("gmpDraggable")&&(this.marker.gmpDraggable=this.gmpDraggable||this.draggable),t.has("gmpClickable")&&(this.marker.gmpClickable=!1!==this.gmpClickable&&!1!==this.clickable),t.has("zIndex")&&void 0!==this.zIndex&&(this.marker.zIndex=this.zIndex),(t.has("content")||t.has("background")||t.has("borderColor")||t.has("glyphColor")||t.has("scale")||t.has("icon")||t.has("label"))&&this.updateMarkerContent())}async initMarker(){this.addEventListener("gmap-ready",(t=>{this.map=t.detail.map,this.createMarker()}));const t=this.closest("gmap-map");t?.getMap&&(this.map=t.getMap(),this.map&&await this.createMarker())}async createMarker(){if(!this.map)return void console.error("GMapMarker: No map found. Make sure the marker is inside a <gmap-map> element.");if(!this.map.get?.("mapId"))return void console.error('GMapMarker: AdvancedMarkerElement requires a mapId to be set on the map. Add mapId to your map. Example: mapId="YOUR_MAP_ID". Get a Map ID from: https://console.cloud.google.com/google/maps-apis/studio/maps');this.markerLibrary=await async function(t){if(oi.has(t))return oi.get(t);if(await ai,typeof google<"u"&&google.maps&&google.maps.importLibrary){const e=await google.maps.importLibrary(t);return oi.set(t,e),e}return google.maps[t]||google.maps}("marker");const{AdvancedMarkerElement:t,PinElement:e}=this.markerLibrary,i=this.gmpDraggable||this.draggable,s=!1!==this.gmpClickable&&!1!==this.clickable,r={map:this.map,position:this.normalizePosition(this.position),title:this.title,gmpDraggable:i,gmpClickable:s};if(void 0!==this.zIndex&&(r.zIndex=this.zIndex),this.content)if("string"==typeof this.content){const t=document.createElement("div");t.innerHTML=this.content,r.content=t}else r.content=this.content;else if(this.icon){const t=document.createElement("img");t.src=this.icon,t.style.width="32px",t.style.height="32px",r.content=t}else{const t={scale:this.scale||1};this.background&&(t.background=this.background),this.borderColor&&(t.borderColor=this.borderColor),this.glyphColor&&(t.glyphColor=this.glyphColor),this.label&&"string"==typeof this.label&&(t.glyph=this.label),this.pinElement=new e(t),this.pinElement?.element&&(r.content=this.pinElement.element)}this.marker=new t(r),this.eventListeners=Pi(this.marker,["click","drag","dragstart","dragend","gmp-click"],((t,e)=>{if("dragend"===t&&this.marker&&this.marker.position){const t=this.marker.position,e=t.toJSON?t.toJSON():{lat:t.lat(),lng:t.lng()};this.dispatchEvent(new CustomEvent("dragend",{detail:{latLng:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("gmap-position-changed",{detail:e,bubbles:!0,composed:!0}))}else this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))})),this.dispatchEvent(new CustomEvent("gmap-marker-ready",{detail:{marker:this.marker},bubbles:!0,composed:!0}))}updateMarkerContent(){if(!this.marker||!this.markerLibrary)return;const{PinElement:t}=this.markerLibrary;if(this.content)if("string"==typeof this.content){const t=document.createElement("div");t.innerHTML=this.content,this.marker.content=t}else this.marker.content=this.content;else if(this.icon){const t=document.createElement("img");t.src=this.icon,t.style.width="32px",t.style.height="32px",this.marker.content=t}else{const e={scale:this.scale||1};this.background&&(e.background=this.background),this.borderColor&&(e.borderColor=this.borderColor),this.glyphColor&&(e.glyphColor=this.glyphColor),this.label&&"string"==typeof this.label&&(e.glyph=this.label),this.pinElement=new t(e),this.pinElement?.element&&(this.marker.content=this.pinElement.element)}}normalizePosition(t){return t?{lat:"number"==typeof t.lat?t.lat:parseFloat(t.lat),lng:"number"==typeof t.lng?t.lng:parseFloat(t.lng)}:{lat:0,lng:0}}cleanup(){Ti(this.eventListeners),this.marker&&(this.marker.map=null,this.marker=void 0)}getMarker(){return this.marker}render(){return ft`<slot></slot>`}};Vi([Li({type:Object})],Hi.prototype,"position",2),Vi([Li({type:String})],Hi.prototype,"title",2),Vi([Li({type:Boolean})],Hi.prototype,"gmpDraggable",2),Vi([Li({type:Boolean})],Hi.prototype,"gmpClickable",2),Vi([Li({type:Number})],Hi.prototype,"zIndex",2),Vi([Li({type:Object})],Hi.prototype,"content",2),Vi([Li({type:String})],Hi.prototype,"background",2),Vi([Li({type:String})],Hi.prototype,"borderColor",2),Vi([Li({type:String})],Hi.prototype,"glyphColor",2),Vi([Li({type:Number})],Hi.prototype,"scale",2),Vi([Li({type:Boolean})],Hi.prototype,"draggable",2),Vi([Li({type:Boolean})],Hi.prototype,"clickable",2),Vi([Li({type:String})],Hi.prototype,"icon",2),Vi([Li({type:String})],Hi.prototype,"label",2),Vi([Ei()],Hi.prototype,"marker",2),Vi([Ei()],Hi.prototype,"map",2),Hi=Vi([ni("gmap-marker")],Hi);var Ki=Object.defineProperty,Wi=Object.getOwnPropertyDescriptor,Yi=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Wi(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Ki(e,i,o),o};let Ji=class extends Bt{constructor(){super(...arguments),this.opened=!0,this.options={},this.eventListeners=[]}async connectedCallback(){super.connectedCallback(),await this.initInfoWindow()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}updated(t){super.updated(t),this.infoWindow&&(t.has("opened")&&(this.opened?this.open():this.close()),t.has("position")&&this.position&&!this.marker&&this.infoWindow.setPosition(this.position),t.has("zIndex")&&void 0!==this.zIndex&&this.infoWindow.setZIndex(this.zIndex))}async initInfoWindow(){const t=this.closest("gmap-marker");if(t)this.addEventListener("gmap-marker-ready",(t=>{this.marker=t.detail.marker,this.createInfoWindow()})),t.getMarker&&(this.marker=t.getMarker(),this.marker&&await this.createInfoWindow());else{const t=this.closest("gmap-map");t&&(this.addEventListener("gmap-ready",(t=>{this.map=t.detail.map,this.createInfoWindow()})),t.getMap&&(this.map=t.getMap(),this.map&&await this.createInfoWindow()))}}async createInfoWindow(){const t=document.createElement("div");t.style.cssText="min-width: 200px;";const e={content:t,...this.options};void 0!==this.zIndex&&(e.zIndex=this.zIndex),this.position&&!this.marker&&(e.position=this.position),this.infoWindow=new google.maps.InfoWindow(e),this.observeSlotContent(t),this.eventListeners=Pi(this.infoWindow,["closeclick","domready","content_changed"],(t=>{"closeclick"===t&&(this.opened=!1),this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0}))})),this.opened&&this.open()}observeSlotContent(t){this.renderSlotContent(t);const e=this.shadowRoot?.querySelector("slot");e&&e.addEventListener("slotchange",(()=>{this.renderSlotContent(t)})),this.contentObserver=new MutationObserver((()=>{this.renderSlotContent(t)})),this.contentObserver.observe(this,{childList:!0,subtree:!0,characterData:!0})}renderSlotContent(t){const e=this.shadowRoot?.querySelector("slot");if(e){const i=e.assignedNodes({flatten:!0});t.innerHTML="",i.forEach((e=>{(e.nodeType===Node.ELEMENT_NODE||e.nodeType===Node.TEXT_NODE&&e.textContent?.trim())&&t.appendChild(e.cloneNode(!0))}))}}open(){this.infoWindow&&(this.marker?this.infoWindow.open({anchor:this.marker,map:this.map}):this.map&&this.infoWindow.open(this.map))}close(){this.infoWindow?.close()}cleanup(){Ti(this.eventListeners),this.contentObserver&&(this.contentObserver.disconnect(),this.contentObserver=void 0),this.infoWindow&&(this.infoWindow.close(),this.infoWindow=void 0)}getInfoWindow(){return this.infoWindow}render(){return ft`<slot></slot>`}};Ji.styles=N`
|
|
1004
|
-
:host {
|
|
1005
|
-
display: contents;
|
|
1006
|
-
}
|
|
1007
|
-
`,Yi([Li({type:Boolean})],Ji.prototype,"opened",2),Yi([Li({type:Object})],Ji.prototype,"position",2),Yi([Li({type:Number})],Ji.prototype,"zIndex",2),Yi([Li({type:Object})],Ji.prototype,"options",2),Yi([Ei()],Ji.prototype,"infoWindow",2),Yi([Ei()],Ji.prototype,"map",2),Yi([Ei()],Ji.prototype,"marker",2),Ji=Yi([ni("gmap-info-window")],Ji);var Qi=Object.defineProperty,Xi=Object.getOwnPropertyDescriptor,ts=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Xi(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Qi(e,i,o),o};let es=class extends Bt{constructor(){super(...arguments),this.path=[],this.editable=!1,this.draggable=!1,this.options={},this.eventListeners=[]}async connectedCallback(){super.connectedCallback(),await this.initPolyline()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}updated(t){super.updated(t),this.polyline&&(t.has("path")&&this.path&&this.polyline.setPath(this.path),t.has("editable")&&this.polyline.setEditable(this.editable),t.has("draggable")&&this.polyline.setDraggable(this.draggable),t.has("options")&&this.polyline.setOptions(this.options))}async initPolyline(){const t=this.closest("gmap-map");t&&(this.addEventListener("gmap-ready",(t=>{this.map=t.detail.map,this.createPolyline()})),t.getMap&&(this.map=t.getMap(),this.map&&await this.createPolyline()))}async createPolyline(){if(!this.map)return;const t={map:this.map,path:this.path,editable:this.editable,draggable:this.draggable,...this.options};this.polyline=new google.maps.Polyline(t),this.eventListeners=Pi(this.polyline,["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"],((t,e)=>{this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}));const e=google.maps.event.addListener(this.polyline.getPath(),"set_at",(()=>{this.emitPathChanged()})),i=google.maps.event.addListener(this.polyline.getPath(),"insert_at",(()=>{this.emitPathChanged()})),s=google.maps.event.addListener(this.polyline.getPath(),"remove_at",(()=>{this.emitPathChanged()}));this.eventListeners.push((()=>google.maps.event.removeListener(e)),(()=>google.maps.event.removeListener(i)),(()=>google.maps.event.removeListener(s)))}emitPathChanged(){if(!this.polyline)return;const t=this.polyline.getPath().getArray().map((t=>({lat:t.lat(),lng:t.lng()})));this.dispatchEvent(new CustomEvent("gmap-path-changed",{detail:t,bubbles:!0,composed:!0}))}cleanup(){Ti(this.eventListeners),this.polyline&&(this.polyline.setMap(null),this.polyline=void 0)}getPolyline(){return this.polyline}render(){return ft``}};ts([Li({type:Array})],es.prototype,"path",2),ts([Li({type:Boolean})],es.prototype,"editable",2),ts([Li({type:Boolean})],es.prototype,"draggable",2),ts([Li({type:Object})],es.prototype,"options",2),ts([Ei()],es.prototype,"polyline",2),ts([Ei()],es.prototype,"map",2),es=ts([ni("gmap-polyline")],es);var is=Object.defineProperty,ss=Object.getOwnPropertyDescriptor,rs=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?ss(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&is(e,i,o),o};let os=class extends Bt{constructor(){super(...arguments),this.editable=!1,this.draggable=!1,this.options={},this.eventListeners=[]}async connectedCallback(){super.connectedCallback(),await this.initPolygon()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}updated(t){super.updated(t),this.polygon&&(t.has("path")&&this.path&&this.polygon.setPath(this.path),t.has("paths")&&this.paths&&this.polygon.setPaths(this.paths),t.has("editable")&&this.polygon.setEditable(this.editable),t.has("draggable")&&this.polygon.setDraggable(this.draggable),t.has("options")&&this.polygon.setOptions(this.options))}async initPolygon(){const t=this.closest("gmap-map");t&&(this.addEventListener("gmap-ready",(t=>{this.map=t.detail.map,this.createPolygon()})),t.getMap&&(this.map=t.getMap(),this.map&&await this.createPolygon()))}async createPolygon(){if(!this.map)return;const t={map:this.map,editable:this.editable,draggable:this.draggable,...this.options};this.paths?t.paths=this.paths:this.path&&(t.paths=this.path),this.polygon=new google.maps.Polygon(t),this.eventListeners=Pi(this.polygon,["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"],((t,e)=>{this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))})),this.paths?this.bindPathsChanges():this.bindPathChanges()}bindPathChanges(){if(!this.polygon)return;const t=this.polygon.getPath(),e=google.maps.event.addListener(t,"set_at",(()=>{this.emitPathChanged()})),i=google.maps.event.addListener(t,"insert_at",(()=>{this.emitPathChanged()})),s=google.maps.event.addListener(t,"remove_at",(()=>{this.emitPathChanged()}));this.eventListeners.push((()=>google.maps.event.removeListener(e)),(()=>google.maps.event.removeListener(i)),(()=>google.maps.event.removeListener(s)))}bindPathsChanges(){this.polygon&&this.polygon.getPaths().forEach((t=>{const e=google.maps.event.addListener(t,"set_at",(()=>{this.emitPathsChanged()})),i=google.maps.event.addListener(t,"insert_at",(()=>{this.emitPathsChanged()})),s=google.maps.event.addListener(t,"remove_at",(()=>{this.emitPathsChanged()}));this.eventListeners.push((()=>google.maps.event.removeListener(e)),(()=>google.maps.event.removeListener(i)),(()=>google.maps.event.removeListener(s)))}))}emitPathChanged(){if(!this.polygon)return;const t=this.polygon.getPath().getArray().map((t=>({lat:t.lat(),lng:t.lng()})));this.dispatchEvent(new CustomEvent("gmap-path-changed",{detail:t,bubbles:!0,composed:!0}))}emitPathsChanged(){if(!this.polygon)return;const t=this.polygon.getPaths().getArray().map((t=>t.getArray().map((t=>({lat:t.lat(),lng:t.lng()})))));this.dispatchEvent(new CustomEvent("gmap-paths-changed",{detail:t,bubbles:!0,composed:!0}))}cleanup(){Ti(this.eventListeners),this.polygon&&(this.polygon.setMap(null),this.polygon=void 0)}getPolygon(){return this.polygon}render(){return ft``}};rs([Li({type:Array})],os.prototype,"path",2),rs([Li({type:Array})],os.prototype,"paths",2),rs([Li({type:Boolean})],os.prototype,"editable",2),rs([Li({type:Boolean})],os.prototype,"draggable",2),rs([Li({type:Object})],os.prototype,"options",2),rs([Ei()],os.prototype,"polygon",2),rs([Ei()],os.prototype,"map",2),os=rs([ni("gmap-polygon")],os);var as=Object.defineProperty,ns=Object.getOwnPropertyDescriptor,ls=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?ns(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&as(e,i,o),o};let hs=class extends Bt{constructor(){super(...arguments),this.radius=1e3,this.editable=!1,this.draggable=!1,this.options={},this.eventListeners=[]}async connectedCallback(){super.connectedCallback(),await this.initCircle()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}updated(t){super.updated(t),this.circle&&(t.has("center")&&this.center&&this.circle.setCenter(this.center),t.has("radius")&&void 0!==this.radius&&this.circle.setRadius(this.radius),t.has("editable")&&this.circle.setEditable(this.editable),t.has("draggable")&&this.circle.setDraggable(this.draggable),t.has("options")&&this.circle.setOptions(this.options))}async initCircle(){const t=this.closest("gmap-map");t&&(this.addEventListener("gmap-ready",(t=>{this.map=t.detail.map,this.createCircle()})),t.getMap&&(this.map=t.getMap(),this.map&&await this.createCircle()))}async createCircle(){if(!this.map)return;const t={map:this.map,center:this.center,radius:this.radius,editable:this.editable,draggable:this.draggable,...this.options};this.circle=new google.maps.Circle(t),this.eventListeners=Pi(this.circle,["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick","center_changed","radius_changed","bounds_changed"],((t,e)=>{if("center_changed"===t){const e=this.circle.getCenter(),i=e?{lat:e.lat(),lng:e.lng()}:null;this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))}else if("radius_changed"===t){const e=this.circle.getRadius();this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}else this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}))}cleanup(){Ti(this.eventListeners),this.circle&&(this.circle.setMap(null),this.circle=void 0)}getCircle(){return this.circle}render(){return ft``}};ls([Li({type:Object})],hs.prototype,"center",2),ls([Li({type:Number})],hs.prototype,"radius",2),ls([Li({type:Boolean})],hs.prototype,"editable",2),ls([Li({type:Boolean})],hs.prototype,"draggable",2),ls([Li({type:Object})],hs.prototype,"options",2),ls([Ei()],hs.prototype,"circle",2),ls([Ei()],hs.prototype,"map",2),hs=ls([ni("gmap-circle")],hs);var ds=Object.defineProperty,cs=Object.getOwnPropertyDescriptor,us=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?cs(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&ds(e,i,o),o};let ps=class extends Bt{constructor(){super(...arguments),this.editable=!1,this.draggable=!1,this.options={},this.eventListeners=[]}async connectedCallback(){super.connectedCallback(),await this.initRectangle()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}updated(t){super.updated(t),this.rectangle&&(t.has("bounds")&&this.bounds&&this.rectangle.setBounds(this.bounds),t.has("editable")&&this.rectangle.setEditable(this.editable),t.has("draggable")&&this.rectangle.setDraggable(this.draggable),t.has("options")&&this.rectangle.setOptions(this.options))}async initRectangle(){const t=this.closest("gmap-map");t&&(this.addEventListener("gmap-ready",(t=>{this.map=t.detail.map,this.createRectangle()})),t.getMap&&(this.map=t.getMap(),this.map&&await this.createRectangle()))}async createRectangle(){if(!this.map)return;const t={map:this.map,bounds:this.bounds,editable:this.editable,draggable:this.draggable,...this.options};this.rectangle=new google.maps.Rectangle(t),this.eventListeners=Pi(this.rectangle,["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick","bounds_changed"],((t,e)=>{if("bounds_changed"===t){const e=this.rectangle.getBounds();if(e){const i={north:e.getNorthEast().lat(),south:e.getSouthWest().lat(),east:e.getNorthEast().lng(),west:e.getSouthWest().lng()};this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))}}else this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}))}cleanup(){Ti(this.eventListeners),this.rectangle&&(this.rectangle.setMap(null),this.rectangle=void 0)}getRectangle(){return this.rectangle}render(){return ft``}};us([Li({type:Object})],ps.prototype,"bounds",2),us([Li({type:Boolean})],ps.prototype,"editable",2),us([Li({type:Boolean})],ps.prototype,"draggable",2),us([Li({type:Object})],ps.prototype,"options",2),us([Ei()],ps.prototype,"rectangle",2),us([Ei()],ps.prototype,"map",2),ps=us([ni("gmap-rectangle")],ps);var bs=Object.defineProperty,ms=Object.getOwnPropertyDescriptor,gs=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?ms(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&bs(e,i,o),o};let fs=class extends Bt{constructor(){super(...arguments),this.gridSize=60,this.markers=[]}async connectedCallback(){super.connectedCallback(),await this.initCluster()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}async initCluster(){const t=this.closest("gmap-map");t&&(this.addEventListener("gmap-ready",(t=>{this.map=t.detail.map,this.createCluster()})),t.getMap&&(this.map=t.getMap(),this.map&&await this.createCluster())),this.addEventListener("gmap-marker-ready",(t=>{this.addMarker(t.detail.marker)}))}async createCluster(){if(this.map)try{const t=await import("./p-BkPzCq-C.js").catch((()=>null));if(!t)return void console.error("GMapCluster: @googlemaps/markerclusterer not found. Install with: npm install @googlemaps/markerclusterer");const{MarkerClusterer:e}=t,i={map:this.map,markers:this.markers};this.gridSize&&(i.gridSize=this.gridSize),void 0!==this.maxZoom&&(i.maxZoom=this.maxZoom),this.styles&&(i.styles=this.styles),this.calculator&&(i.calculator=this.calculator),this.markerClusterer=new e(i)}catch(t){console.error("GMapCluster: Error creating cluster:",t)}}addMarker(t){this.markers.includes(t)||(this.markers.push(t),this.markerClusterer&&this.markerClusterer.addMarker(t))}cleanup(){this.markerClusterer&&(this.markerClusterer.clearMarkers(),this.markerClusterer=void 0),this.markers=[]}getClusterer(){return this.markerClusterer}render(){return ft`<slot></slot>`}};gs([Li({type:Number})],fs.prototype,"gridSize",2),gs([Li({type:Number})],fs.prototype,"maxZoom",2),gs([Li({type:Array})],fs.prototype,"styles",2),gs([Li({type:Function})],fs.prototype,"calculator",2),gs([Ei()],fs.prototype,"map",2),gs([Ei()],fs.prototype,"markerClusterer",2),gs([Ei()],fs.prototype,"markers",2),fs=gs([ni("gmap-cluster")],fs);var vs=Object.defineProperty,ys=Object.getOwnPropertyDescriptor,ws=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?ys(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&vs(e,i,o),o};let xs=class extends Bt{constructor(){super(...arguments),this.zoom=0,this.visible=!0,this.motionTracking=!0,this.options={},this.eventListeners=[]}async connectedCallback(){super.connectedCallback()}async firstUpdated(){await ai,this.createPanorama()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}updated(t){super.updated(t),this.panorama&&(t.has("position")&&this.position&&this.panorama.setPosition(this.position),t.has("pano")&&this.pano&&this.panorama.setPano(this.pano),t.has("zoom")&&void 0!==this.zoom&&this.panorama.setZoom(this.zoom),t.has("pov")&&this.pov&&this.panorama.setPov(this.pov),t.has("visible")&&this.panorama.setVisible(this.visible),t.has("motionTracking")&&this.panorama.setMotionTracking(this.motionTracking))}createPanorama(){if(!this.panoramaElement)return;const t={position:this.position,pano:this.pano,zoom:this.zoom,pov:this.pov,visible:this.visible,motionTracking:this.motionTracking,...this.options};this.panorama=new google.maps.StreetViewPanorama(this.panoramaElement,t),this.eventListeners=Pi(this.panorama,["closeclick","status_changed"],((t,e)=>{this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}))}cleanup(){Ti(this.eventListeners),this.panorama=void 0}resize(){this.panorama&&google.maps.event.trigger(this.panorama,"resize")}getPanorama(){return this.panorama}render(){return ft`<div class="panorama"></div>`}};xs.styles=N`
|
|
1008
|
-
:host {
|
|
1009
|
-
display: block;
|
|
1010
|
-
position: relative;
|
|
1011
|
-
width: 100%;
|
|
1012
|
-
height: 400px;
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
.panorama {
|
|
1016
|
-
width: 100%;
|
|
1017
|
-
height: 100%;
|
|
1018
|
-
}
|
|
1019
|
-
`,ws([Li({type:Object})],xs.prototype,"position",2),ws([Li({type:String})],xs.prototype,"pano",2),ws([Li({type:Number})],xs.prototype,"zoom",2),ws([Li({type:Object})],xs.prototype,"pov",2),ws([Li({type:Boolean})],xs.prototype,"visible",2),ws([Li({type:Boolean})],xs.prototype,"motionTracking",2),ws([Li({type:Object})],xs.prototype,"options",2),ws([Ii(".panorama")],xs.prototype,"panoramaElement",2),ws([Ei()],xs.prototype,"panorama",2),xs=ws([ni("gmap-street-view-panorama")],xs);var ks='<svg width="15" height="14" viewBox="0 0 15 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n 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"\n stroke="currentcolor" stroke-linecap="round" />\n <path\n 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"\n stroke="currentcolor" stroke-linecap="round" />\n <path\n 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"\n stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" />\n</svg>\n ';const Ss={lat:24.7756042,lng:46.7360729},Cs="salla-bullet-delivery-override-ip";function _s(t,e){localStorage.getItem("salla-bullet-delivery-debug")&&(void 0!==e?console.log(t,e):console.log(t))}const As=class{constructor(i){t(this,i),this.bulletDeliveryConfirmed=e(this,"bulletDeliveryConfirmed"),this.bulletDeliveryClosed=e(this,"bulletDeliveryClosed"),this.addressCreated=e(this,"addressCreated"),this.headerContextUpdate=e(this,"headerContextUpdate"),this.confirming=!1,this.pendingCartSubmitResolver=null,this.pendingCartSubmitPromise=null,this.cartSubmitConfirmationPending=!1,this.branchSearchDebounceTimer=null,this.countrySearchTimer=null,this.regionSearchTimer=null,this.citySearchTimer=null,this.districtSearchTimer=null,this.citySearchCounter=0,this.componentReady=!1,this.pendingOpen=!1,this.tabChanging=!1,this.intentStorageKey="bullet_delivery_intent",this.sessionShownKey="bullet_delivery_shown",this.incompleteIntentPromptKey="bullet_delivery_incomplete_intent_prompted",this.cartItemAddedEvent="cart::item.added",this.cartItemAddedHandler=null,this.cartSubmittingHandler=null,this.useCartEventApi=!1,this.authLoggedInHandler=null,this.authLoggedOutHandler=null,this.loginClosedHandler=null,this.hasExplicitPreselectedIdsForOpen=!1,this.bulletDeliveryOpenHandler=t=>{this.preselectedAddressId=t?.preselected_address_id,this.preselectedBranchId=t?.preselected_branch_id,this.hasExplicitPreselectedIdsForOpen=null!=t?.preselected_address_id||null!=t?.preselected_branch_id,this.open()},this.closeHandler=null,this.bulletDeliveryMobileSelectHandler=null,this.savedAddressesLoaded=!1,this.gmapRef=null,this.autoGeolocationTriggered=!1,this.geocodeRequestId=0,this.activeTab="address",this.isLoggedIn=!1,this.viewMode="main",this.countries=[],this.regions=[],this.cities=[],this.districts=[],this.loadingRegions=!1,this.selectedCountry=null,this.selectedRegion=null,this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.savedAddresses=[],this.selectedSavedAddress=null,this.selectedSessionAddress=!1,this.branches=[],this.filteredBranches=[],this.selectedBranch=null,this.branchSearchQuery="",this.loadingCountries=!1,this.loadingCities=!1,this.loadingDistricts=!1,this.loadingBranches=!1,this.loadingNearestBranch=!1,this.locationError="",this.savingAddress=!1,this.loadingSavedAddresses=!1,this.showCartWillBeClearedBanner=!1,this.countrySearchQuery="",this.regionSearchQuery="",this.citySearchQuery="",this.districtSearchQuery="",this.searchingCountries=!1,this.searchingRegions=!1,this.searchingCities=!1,this.searchingDistricts=!1,this.displayedCountries=[],this.displayedRegions=[],this.displayedCities=[],this.displayedDistricts=[],this.allocationOutOfCoverageMessage=null,this.mapLocationData=null,this.addressToken=null,this.loadingToken=!1,this.mapReady=!1,this.mapStep="map",this.addressDescription="",this.reverseGeocoding=!1,this.newAddressForm={...As.INITIAL_ADDRESS_FORM},this.handleCountrySearch=t=>{this.countrySearchQuery=t},this.handleRegionSearch=t=>{this.regionSearchQuery=t},this.handleCitySearch=t=>{if(this.citySearchQuery=t,this.citySearchTimer&&clearTimeout(this.citySearchTimer),!t.trim())return this.displayedCities=this.cities,void(this.searchingCities=!1);if(t.trim().length<As.DROPDOWN_SEARCH_MIN_CHARS)return;const e=++this.citySearchCounter;this.citySearchTimer=setTimeout((async()=>{this.searchingCities=!0;try{const i=p(this.selectedCountry?.code??"")?this.selectedRegion?.id:void 0,s=await b.getCities(this.selectedCountry?.id,i,t);e===this.citySearchCounter&&(this.displayedCities=s)}catch{e===this.citySearchCounter&&(this.displayedCities=this.cities)}finally{e===this.citySearchCounter&&(this.searchingCities=!1)}}),As.DROPDOWN_SEARCH_DEBOUNCE_MS)},this.handleDistrictSearch=t=>{this.districtSearchQuery=t},this.handleCountryDropdownClosed=()=>{this.countrySearchQuery="",this.displayedCountries=this.countries,this.searchingCountries=!1},this.handleRegionDropdownClosed=()=>{this.regionSearchQuery="",this.displayedRegions=this.regions,this.searchingRegions=!1},this.handleCityDropdownClosed=()=>{this.citySearchQuery="",this.citySearchTimer&&(clearTimeout(this.citySearchTimer),this.citySearchTimer=null),++this.citySearchCounter,this.displayedCities=this.cities,this.searchingCities=!1},this.handleDistrictDropdownClosed=()=>{this.districtSearchQuery="",this.displayedDistricts=this.districts,this.searchingDistricts=!1},this.handleMapLocationChanged=t=>{const e=t.detail;if(!e?.position?.lat||!e?.position?.lng)return;const{lat:i,lng:s}=e.position;this.mapLocationData={lat:i,lng:s,shortAddress:e.place?.placeId??e.place?.place_id??void 0,formattedAddress:e.place?.formattedAddress??e.place?.formatted_address??void 0},this.updateLocationBias(),setTimeout((()=>{const t=this.gmapRef?.locationMarker;t&&(t.gmpDraggable=!1)}),100),this.mapLocationData.formattedAddress?this.invalidatePendingGeocode():this.reverseGeocodeLocation(i,s)},this.handleMapReady=()=>{if(this.mapReady=!0,this.gmapRef&&"function"==typeof this.gmapRef.resize&&this.gmapRef.resize(),this.updateLocationBias(),!this.autoGeolocationTriggered&&!this.hasMapLocation()&&this.gmapRef){const t=this.gmapRef.getCurrentLocation;if("function"==typeof t){this.autoGeolocationTriggered=!0;try{const e=t.call(this.gmapRef,!0);e&&"function"==typeof e.catch&&e.catch((t=>_s("Auto geolocation failed",t)))}catch(t){_s("Auto geolocation threw",t)}}}},this.handleSubmitAddAddress=async t=>{if(t.preventDefault(),this.savingAddress)return;const e=this.hasMapLocation();if((e||this.selectedCountry&&this.selectedCity)&&(e||M(this.selectedCountry?.code,this.selectedRegion?.id,this.selectedDistrict?.id??(this.districtName?.trim()||null)))){this.savingAddress=!0;try{const t=this.buildAddressLocationPayload(),{success:e,address:i}=await b.saveAddressLocation(t);if(e){await this.loadSavedAddresses();const t=i??this.savedAddresses[0]??null;t?.is_in_coverage&&(this.selectedSessionAddress=!1,this.selectedSavedAddress=t),this.addressCreated.emit({address:t}),this.viewMode="main",this.districtName="",this.mapLocationData=null,this.invalidatePendingGeocode(),this.mapStep="map",this.addressDescription=""}else this.isLoggedIn?Salla.notify?.error(Salla.lang.get("common.errors.error_occurred")):(Salla.notify?.error(Salla.lang.get("pages.checkout.login_to_use_saved_addresses")),this.handleLogin())}catch(t){console.error("SallaBulletDelivery: Error saving address",t),this.isLoggedIn?Salla.notify?.error(Salla.lang.get("common.errors.error_occurred")):(Salla.notify?.error(Salla.lang.get("pages.checkout.login_to_use_saved_addresses")),this.handleLogin())}finally{this.savingAddress=!1}}},this.handleCountrySelected=t=>{const e=this.countries.find((e=>String(e.id)===String(t.id)))||t;this.countrySearchQuery="",this.displayedCountries=this.countries,this.applyCountryChange(e||null)},this.handleRegionSelected=t=>{const e=this.regions.find((e=>String(e.id)===String(t.id)))||t;this.selectedRegion=e||null,this.regionSearchQuery="",this.displayedRegions=this.regions,this.updateNewAddressForm({region_id:e?.id,city_id:void 0,district_id:void 0,city:void 0,district:void 0}),e&&this.selectedCountry&&this.loadCities(this.selectedCountry.id,e.id)},this.handleCitySelected=t=>{const e=p(this.selectedCountry?.code??""),i=this.cities.find((e=>String(e.id)===String(t.id)))||t;this.selectedCity=i||null,this.selectedDistrict=null,this.districtName="",this.citySearchQuery="",this.displayedCities=this.cities,i&&(this.updateNewAddressForm({city:i,district:void 0}),e&&this.loadDistricts(i.id))},this.handleDistrictSelected=t=>{const e=this.districts.find((e=>String(e.id)===String(t.id)))||t;this.selectedDistrict=e||null,this.districtName="",this.districtSearchQuery="",this.displayedDistricts=this.districts,e&&this.updateNewAddressForm({district:e})}}get supportsPickup(){return Boolean(Salla.config.get("store.shipping.support_pickup"))||Boolean(Salla.config.get("store.support_pickup"))}get openingType(){return Salla.config.get("store.settings.bullet_delivery.settings.type")}get isRequired(){return!!Salla.config.get("store.settings.bullet_delivery.settings.is_required")}get isSupportsDelivery(){return!!Salla.config.get("store.settings.bullet_delivery.supports_delivery")}get isEnabled(){return!!Salla.config.get("store.features")?.includes("bullet-delivery-v2")&&!0===Salla.config.get("store.settings.bullet_delivery.enabled")}get isMobileApp(){return Salla.config.isMobileApp()}async open(){if(this.isEnabled)if(this.isMobileApp)Salla.event.dispatch("salla::bullet-delivery.open-sheet");else if(this.componentReady&&this.modal){this.resetState(),this.modal.open(),Salla.event.dispatch("salla::bullet-delivery.modal.opened");try{this.isLoggedIn=!this.isGuestUser();const t=this.cleanStaleGuestAddressIdIfNeeded(this.getStoredIntent());this.applyPreselectedIdsFromIntent(t);const e=!this.isLoggedIn&&"address"===t?.type&&null!=w(t)&&null!=S(t);if(this.activeTab=this.supportsPickup&&!this.isSupportsDelivery?"branch":this.supportsPickup&&t?.type&&("address"===t.type||"branch"===t.type)?t.type:"address",this.fetchAddressToken(),this.isLoggedIn&&"address"===this.activeTab&&(this.loadingSavedAddresses=!0),await Promise.all([this.loadCountries(e),this.isLoggedIn&&"address"===this.activeTab?this.loadSavedAddresses().then((()=>{this.savedAddressesLoaded=!0})).finally((()=>{this.loadingSavedAddresses=!1})):Promise.resolve()]),this.isLoggedIn&&this.preselectedAddressId){const t=this.savedAddresses.find((t=>t.id===this.preselectedAddressId));t&&(this.selectedSessionAddress=!1,this.selectedSavedAddress=t)}if("branch"===this.activeTab){const e=A(t),i=z(t);if(null!=e&&null!=i?await this.loadBranchesWithLocation(e,i):await this.loadBranches(),this.preselectedBranchId){const t=this.branches.find((t=>t.id===this.preselectedBranchId));t&&(this.selectedBranch=t)}}await this.prefillFromSessionStorage()}catch(t){console.error("SallaBulletDelivery: Error loading data",t)}finally{this.overrideScopeSwitchUI()}}else this.pendingOpen=!0}async close(){if(!this.shouldForceNonClosable()||this.confirming)return this.cartSubmitConfirmationPending&&!this.confirming&&this.resolvePendingCartSubmit(),this.bulletDeliveryClosed.emit(),this.modal?.close()}resetState(){this.viewMode="main",this.mapLocationData=null,this.invalidatePendingGeocode(),this.autoGeolocationTriggered=!1,this.selectedCountry=null,this.selectedRegion=null,this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.selectedSavedAddress=null,this.selectedSessionAddress=!1,this.selectedBranch=null,this.branchSearchQuery="",this.regions=[],this.cities=[],this.districts=[],this.branches=[],this.filteredBranches=[],this.newAddressForm={...As.INITIAL_ADDRESS_FORM},this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null,this.locationError="",this.savedAddressesLoaded=!1,this.loadingSavedAddresses=!1,this.loadingCountries=!1,this.resetSearchState()}getIntentStorage(){const t=Boolean(Salla.config.get("store.settings.bullet_delivery.settings.remember_last_session"));return Salla.storage[t?"store":"session"]}getShownStorage(){return Salla.storage.session}getStoredIntent(){return this.getIntentStorage().get(this.intentStorageKey)}isGuestUser(){return"guest"===String(Salla.config.get("user.type")??"guest")}cleanStaleGuestAddressIdIfNeeded(t){if(!this.isGuestUser()||"address"!==t?.type||!t.address_id)return t;const e={...t,address_id:void 0};return this.setStoredIntent(e),e}applyPreselectedIdsFromIntent(t){this.hasExplicitPreselectedIdsForOpen?this.hasExplicitPreselectedIdsForOpen=!1:(this.preselectedAddressId=void 0,this.preselectedBranchId=void 0,this.isGuestUser()?"branch"===t?.type&&t.branch_id&&(this.preselectedBranchId=t.branch_id):"address"===t?.type&&t.address_id?this.preselectedAddressId=t.address_id:"branch"===t?.type&&t.branch_id&&(this.preselectedBranchId=t.branch_id))}hasIncompleteUserAddressIntent(){if(this.isGuestUser())return!1;const t=this.getStoredIntent();return!(!t||"address"!==t.type||t.address_id||!t.address_details)&&$(t)}isIntentMethodSupported(t){return"branch"===t.type?this.supportsPickup:"address"===t.type&&this.isSupportsDelivery}hasCompleteIntentForLoggedInUser(){if(this.isGuestUser())return!1;const t=this.getStoredIntent();return!!(t&&this.isIntentMethodSupported(t)&&("address"===t.type?t.address_id:"branch"===t.type&&t.branch_id))}shouldForceNonClosable(){return!this.isGuestUser()&&!!Salla.url.is_page("cart")&&!this.hasCompleteIntentForLoggedInUser()}shouldPromptIncompleteIntentThisSession(){const t=this.getShownStorage();return this.hasIncompleteUserAddressIntent()&&!0!==t.get(this.incompleteIntentPromptKey)}markIncompleteIntentPrompted(){this.getShownStorage().set(this.incompleteIntentPromptKey,!0)}setStoredIntent(t){this.getIntentStorage().set(this.intentStorageKey,t),this.overrideScopeSwitchUI()}clearBulletDeliveryStoredData(){Salla.storage.session.remove(this.intentStorageKey),Salla.storage.store.remove(this.intentStorageKey),Salla.storage.session.remove(this.sessionShownKey),Salla.storage.session.remove(this.incompleteIntentPromptKey),this.overrideScopeSwitchUI()}async prefillAddressFromStoredIntent(){const t=this.getStoredIntent();if(!t||"address"!==t.type||null==S(t))return;const e=w(t);if(!e)return;const i=this.countries.find((t=>String(t.id)===String(e)));if(!i)return;this.selectedCountry=i,this.updateNewAddressForm({country_id:Number(i.id)});const s=p(i.code),r=S(t),o=k(t),a=C(t),n=t.address_details?.district?.name,[l,h,d]=await Promise.all([s?b.getRegions(i.id):Promise.resolve([]),b.getCities(i.id,s&&null!=o?o:void 0),null!=r?b.getDistricts(Number(r)):Promise.resolve([])]);if(s&&(this.regions=l,this.displayedRegions=this.regions),this.cities=h,this.displayedCities=this.cities,this.districts=d,this.displayedDistricts=this.districts,this.loadingCities=!1,this.loadingRegions=!1,this.loadingDistricts=!1,s&&null!=o){const t=this.regions.find((t=>String(t.id)===String(o)));t&&(this.selectedRegion=t,this.updateNewAddressForm({region_id:t.id}))}if(null!=r&&this.cities.length>0){const t=this.cities.find((t=>String(t.id)===String(r)));t&&(this.selectedCity=t,this.updateNewAddressForm({city_id:t.id,city:t}))}if(this.districts.length>0){const t=this.findPrefillDistrict(a,n);t&&(this.updateNewAddressForm({district_id:t.id,district:t}),this.selectedDistrict=t)}!this.selectedDistrict&&n&&(this.districtName=n)}updateNewAddressForm(t){this.newAddressForm={...this.newAddressForm,...t}}hasBeenShownThisSession(){return!0===this.getShownStorage().get(this.sessionShownKey)}markShownThisSession(){this.getShownStorage().set(this.sessionShownKey,!0)}getIPLocationConfig(){const t="store.shipping.delivery_location",e={countryId:Salla.config.get(`${t}.country_id`),regionId:Salla.config.get(`${t}.region_id`),cityId:Salla.config.get(`${t}.city_id`),districtId:Salla.config.get(`${t}.district_id`)};return localStorage.getItem(Cs)?JSON.parse(localStorage.getItem(Cs)):e}async loadCountries(t=!1){this.loadingCountries=!0;const e="branch"===this.activeTab;try{this.countries=await b.getCountries(e),this.displayedCountries=this.countries;const{countryId:i,regionId:s,cityId:r,districtId:o}=this.getIPLocationConfig();_s("getIPLocationConfig",this.getIPLocationConfig());const a=i&&this.countries.length>0?this.countries.find((t=>String(t.id)===String(i))):null;a&&(this.selectedCountry=a,this.updateNewAddressForm({country_id:Number(this.selectedCountry.id)}),!t)&&(null!=s||null!=r||null!=o?await this.prefillFromIPLocation(a,{regionId:s,cityId:r,districtId:o}):p(this.selectedCountry.code)?await this.loadRegions(this.selectedCountry.id):await this.loadCities(this.selectedCountry.id))}finally{this.loadingCountries=!1}}async prefillFromIPLocation(t,e){const i=p(t.code),{regionId:s,cityId:r,districtId:o}=e,[a,n,l]=await Promise.all([i?b.getRegions(t.id):Promise.resolve([]),b.getCities(t.id,i&&null!=s?s:void 0),null!=r?b.getDistricts(Number(r)):Promise.resolve([])]);if(i&&(this.regions=a,this.displayedRegions=this.regions),this.cities=n,this.displayedCities=this.cities,this.districts=l,this.displayedDistricts=this.districts,this.loadingRegions=!1,this.loadingCities=!1,this.loadingDistricts=!1,i&&null!=s){const t=this.regions.find((t=>String(t.id)===String(s)));t&&(this.selectedRegion=t,this.updateNewAddressForm({region_id:t.id}))}if(null!=r&&this.cities.length>0){const t=this.cities.find((t=>String(t.id)===String(r)));t&&(this.selectedCity=t,this.updateNewAddressForm({city_id:t.id,city:t}))}if(null!=o&&this.districts.length>0){const t=this.findPrefillDistrict(o);t&&(this.selectedDistrict=t,this.updateNewAddressForm({district_id:t.id,district:t}))}}async loadCities(t,e){this.loadingCities=!0,this.cities=[],this.displayedCities=[],this.districts=[],this.displayedDistricts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="";try{this.cities=await b.getCities(t,e),this.displayedCities=this.cities}finally{this.loadingCities=!1}}async loadDistricts(t){this.loadingDistricts=!0,this.districts=[],this.displayedDistricts=[],this.selectedDistrict=null,this.districtName="";try{this.districts=await b.getDistricts(t),this.displayedDistricts=this.districts}finally{this.loadingDistricts=!1}}findPrefillDistrict(t,e){if(0===this.districts.length)return;if(null!=t){const e=this.districts.find((e=>String(e.id)===String(t)));if(e)return e}const i=e?.trim().toLowerCase();return i?this.districts.find((t=>{const e=t.name?.trim().toLowerCase(),s=t.name_en?.trim().toLowerCase();return e===i||s===i})):void 0}async loadBranches(){this.loadingBranches=!0;try{this.branches=await b.getBranches({country_id:this.selectedCountry?.id}),this.filterBranches()}finally{this.loadingBranches=!1}}filterBranches(){this.filteredBranches=((t,e)=>{if(!e)return t;const i=e.toLowerCase();return t.filter((t=>t.name.toLowerCase().includes(i)||t.city?.name?.toLowerCase().includes(i)))})(this.branches,this.branchSearchQuery)}async prefillFromSessionStorage(){try{const t=this.getStoredIntent();if(!t)return;if("address"!==this.activeTab||"address"!==t.type||this.isLoggedIn||await this.prefillAddressFromStoredIntent(),"branch"===this.activeTab&&"branch"===t.type){const e=w(t);if(null!=e){const i=this.countries.find((t=>String(t.id)===String(e)));if(i){this.selectedCountry=i,this.updateNewAddressForm({country_id:Number(i.id)});const e=_(t);if(null!=e&&this.branches.length>0){const t=this.branches.find((t=>t.id===e));t&&(this.selectedBranch=t)}}}}}catch(t){console.error("[BulletDelivery] Error prefilling from session storage:",t)}}async loadSavedAddresses(){const t=this.selectedSavedAddress?.id;this.savedAddresses=await b.getSavedAddresses();const e=this.getStoredIntent();if($(e))return this.selectedSessionAddress=!0,void(this.selectedSavedAddress=null);if(null!=t){const e=this.savedAddresses.find((e=>e.id===t&&!1!==e.is_in_coverage));if(e)return this.selectedSessionAddress=!1,void(this.selectedSavedAddress=e)}const i=this.savedAddresses.find((t=>t.is_default&&!1!==t.is_in_coverage));if(i)this.selectedSavedAddress=i;else{const t=this.savedAddresses.find((t=>!1!==t.is_in_coverage));t&&(this.selectedSavedAddress=t)}}applyCountryChange(t){this.selectedCountry=t,this.selectedRegion=null,this.regions=[],this.displayedRegions=[],this.cities=[],this.displayedCities=[],this.districts=[],this.displayedDistricts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.allocationOutOfCoverageMessage=null,this.regionSearchQuery="",this.citySearchQuery="",this.districtSearchQuery="",this.searchingRegions=!1,this.searchingCities=!1,this.searchingDistricts=!1,this.clearSearchTimers(),this.selectedCountry&&(this.updateNewAddressForm({country_id:Number(this.selectedCountry.id),region_id:void 0,city_id:void 0,district_id:void 0,city:void 0,district:void 0}),"branch"===this.activeTab?this.loadBranches():p(this.selectedCountry.code)?this.loadRegions(this.selectedCountry.id):this.loadCities(this.selectedCountry.id))}async loadRegions(t){this.loadingRegions=!0,this.regions=[],this.displayedRegions=[],this.selectedRegion=null,this.cities=[],this.displayedCities=[],this.districts=[],this.displayedDistricts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="";try{this.regions=await b.getRegions(t),this.displayedRegions=this.regions}finally{this.loadingRegions=!1}}emitHeaderContextUpdate(t,e,i){let s="";"address"===t.type?e?s=e.district?.name&&e.city?.name?`${e.district.name}، ${e.city.name}`:e.city?.name??"":this.selectedCity?s=this.selectedDistrict?`${this.selectedDistrict.name}، ${this.selectedCity.name}`:this.selectedCity.name:t.address_details&&(s=[t.address_details.district?.name,t.address_details.city.name,t.address_details.country.name].filter(Boolean).join("، ")||t.address_details.short_address||""):i?s=i.name:t.branch_details&&(s=t.branch_details.city??t.branch_details.name);const r="address"===t.type?Salla.lang.get("mobile_app.strings.delivery"):Salla.lang.get("mobile_app.strings.pickup");this.headerContextUpdate.emit({type:t.type,display_text:s?`${r}: ${s}`:"",country_code:t.country_code,city:this.selectedCity?.name??t.address_details?.city?.name,district:this.selectedDistrict?.name??t.address_details?.district?.name,branch_name:i?.name??t.branch_details?.name})}handleBranchSearch(t){const e=t.target.value;if(this.branchSearchQuery=e,this.branchSearchDebounceTimer&&clearTimeout(this.branchSearchDebounceTimer),!e?.trim())return this.branchSearchQuery="",void this.loadBranches();this.branchSearchDebounceTimer=setTimeout((async()=>{if(!(e.trim().length<2)){this.loadingBranches=!0;try{this.branches=await b.getBranches({country_id:this.selectedCountry?.id,query:e}),this.filterBranches()}finally{this.loadingBranches=!1}}}),1e3)}clearSearchTimers(){[this.countrySearchTimer,this.regionSearchTimer,this.citySearchTimer,this.districtSearchTimer].forEach((t=>{t&&clearTimeout(t)})),this.countrySearchTimer=this.regionSearchTimer=this.citySearchTimer=this.districtSearchTimer=null}resetSearchState(){this.countrySearchQuery="",this.regionSearchQuery="",this.citySearchQuery="",this.districtSearchQuery="",this.searchingCountries=!1,this.searchingRegions=!1,this.searchingCities=!1,this.searchingDistricts=!1,this.displayedCountries=[],this.displayedRegions=[],this.displayedCities=[],this.displayedDistricts=[],this.clearSearchTimers()}async loadBranchesWithLocation(t,e){this.loadingBranches=!0;try{if(this.branches=await b.getBranches({country_id:this.selectedCountry?.id,lat:t,lng:e}),this.filterBranches(),!this.selectedCountry&&this.branches.length>0){const t=this.branches[0];if(t.country){const e=this.countries.find((e=>e.id===t.country.id));e&&(this.selectedCountry=e,this.updateNewAddressForm({country_id:Number(e.id)}))}}}finally{this.loadingBranches=!1}}async handleFindNearestBranch(){if(navigator.geolocation){this.loadingNearestBranch=!0,this.locationError="";try{const t=await new Promise(((t,e)=>{navigator.geolocation.getCurrentPosition(t,e,{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})})),{latitude:e,longitude:i}=t.coords;await this.loadBranchesWithLocation(e,i);const s=function(t,e,i){let s=null,r=Number.POSITIVE_INFINITY;for(const o of t){const t=null!=o.location?.lat?Number(o.location.lat):Number.NaN,a=null!=o.location?.lng?Number(o.location.lng):Number.NaN;if(Number.isNaN(t)||Number.isNaN(a)||!1===o.is_open)continue;const n=f(e,i,t,a);n<r&&(r=n,s=o)}return s}(this.branches,e,i);s&&(this.selectedBranch=s,this.branchSearchQuery="",this.filterBranches())}catch(t){const e=t;this.locationError=L["number"==typeof e?.code?e.code:-1]??"An error occurred while detecting location"}finally{this.loadingNearestBranch=!1}}else this.locationError=Salla.lang.get("pages.checkout.current_location_not_supported")}handleBranchSelect(t){this.selectedBranch=t}handleSavedAddressSelect(t){!1!==t.is_in_coverage?(this.selectedSavedAddress=t,this.selectedSessionAddress=!1):Salla.notify?.error(Salla.lang.get("pages.checkout.shipping_not_available"))}handleSessionAddressSelect(){this.selectedSessionAddress=!0,this.selectedSavedAddress=null}async handleAddNewAddress(){this.viewMode="add-address",this.mapLocationData=null,this.invalidatePendingGeocode(),this.autoGeolocationTriggered=!1,this.fetchAddressToken();const t=this.getStoredIntent(),e=w(t);if(e&&this.countries.length>0){const t=this.countries.find((t=>t.id===e));t&&(this.selectedCountry=t,this.updateNewAddressForm({country_id:Number(t.id)}),p(t.code)?await this.loadRegions(t.id):await this.loadCities(t.id))}}handleBackToAddressList(){this.viewMode="main",this.mapLocationData=null,this.invalidatePendingGeocode(),this.mapStep="map",this.addressDescription="",this.autoGeolocationTriggered=!1}async fetchAddressToken(){if(!this.addressToken&&!this.loadingToken){this.loadingToken=!0;try{const t=salla.config.get("store.settings.keys.maps");t&&function(t,e){if(typeof document>"u")return Promise.resolve();if(ri)return ai;let i;ri=!0,i={...t},Array.isArray(i.libraries)&&(i.libraries=i.libraries),!e&&!i.v&&(e="quarterly"),i.loading||(i.loading="async"),i.callback="googleMapsInitCallback";let s=`https://maps.googleapis.com/maps/api/js?${Object.keys(i).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(i[t])}`)).join("&")}`;e&&(s+=`&v=${e}`);const r=document.createElement("script");return r.src=s,r.async=!0,r.defer=!0,r.onerror=t=>{console.error("Failed to load Google Maps script:",t)},document.body.appendChild(r),ai}({key:t,libraries:["marker","places"],language:salla.config.get("user.language_code")||"ar"}).catch((t=>_s("Failed to load Google Maps SDK",t))),this.addressToken=await b.getAddressToken()}catch{_s("SallaBulletDelivery: Failed to fetch address token")}finally{this.loadingToken=!1}}}invalidatePendingGeocode(){this.reverseGeocoding=!1,this.geocodeRequestId++}applyCoordsFallback(t,e){this.mapLocationData={...this.mapLocationData,formattedAddress:this.mapLocationData?.formattedAddress??`${t.toFixed(6)}, ${e.toFixed(6)}`}}reverseGeocodeLocation(t,e){const i=window.google?.maps?.Geocoder;if(!i)return this.geocodeRequestId++,void this.applyCoordsFallback(t,e);this.reverseGeocoding=!0;const s=++this.geocodeRequestId;(new i).geocode({location:{lat:t,lng:e}},((i,r)=>{s===this.geocodeRequestId&&(this.reverseGeocoding=!1,r===window.google.maps.GeocoderStatus.OK&&i?.[0]?this.mapLocationData={...this.mapLocationData,formattedAddress:i[0].formatted_address,shortAddress:this.mapLocationData?.shortAddress??i[0].place_id}:(_s("Reverse geocoding failed for map location",r),this.applyCoordsFallback(t,e)))}))}updateLocationBias(){if(!this.gmapRef)return;const t=this.hasMapLocation()?{lat:this.mapLocationData.lat,lng:this.mapLocationData.lng}:this.mapInitialCenter;this.gmapRef.autocompleteLocationBias={center:t,radius:5e5}}hasMapLocation(){return null!=this.mapLocationData?.lat&&null!=this.mapLocationData?.lng}canConfirmMapLocation(){return this.hasMapLocation()&&!this.reverseGeocoding&&!!this.mapLocationData?.formattedAddress}get isMapSettingEnabled(){return Salla.config.get("store.settings.bullet_delivery.settings.map_enabled")}get isMapModeAvailable(){return this.isMapSettingEnabled&&!!salla.config.get("store.settings.keys.maps")&&!!this.addressToken}get mapInitialCenter(){const t=salla.config.get("user.default_geo_location"),e=this.toCoordinate(t?.lat),i=this.toCoordinate(t?.lng);return null!=e&&null!=i&&e>=-90&&e<=90&&i>=-180&&i<=180?{lat:e,lng:i}:Ss}toCoordinate(t){if("string"==typeof t&&""===t.trim())return null;if(null==t)return null;const e=Number(t);return Number.isFinite(e)?e:null}buildAddressLocationPayload(){if(this.isMapModeAvailable&&this.hasMapLocation())return{lat:this.mapLocationData.lat,lng:this.mapLocationData.lng,...this.mapLocationData.shortAddress&&{short_address:this.mapLocationData.shortAddress},...this.addressDescription?.trim()&&{description:this.addressDescription.trim()}};const t=this.selectedDistrict?.name??this.districtName?.trim()??"";return function(t){const{countryId:e,countryCode:i,regionId:s,cityId:r,districtId:o,description:a="",lat:n,lng:l,shortAddress:h}=t,d=a||"";return{country_id:Number(e)||void 0,region_id:null!=s?Number(s):void 0,city_id:null!=r?Number(r):void 0,district_id:null!=o?Number(o):void 0,description:d,...i&&p(i)&&{local:d},...null!=n&&null!=l&&{lat:n,lng:l},...h&&{short_address:h}}}({countryId:this.selectedCountry?.id??0,countryCode:this.selectedCountry?.code,regionId:this.selectedRegion?.id,cityId:this.selectedCity?.id,districtId:this.selectedDistrict?.id,description:t,lat:this.mapLocationData?.lat,lng:this.mapLocationData?.lng,shortAddress:this.mapLocationData?.shortAddress})}async handleTabChange(t){if(!this.tabChanging){this.tabChanging=!0;try{this.activeTab=t,"add-address"===this.viewMode&&(this.viewMode="main",this.invalidatePendingGeocode()),this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null,this.resetSearchState();const e="branch"===t;this.countries=await b.getCountries(e),this.displayedCountries=this.countries;const i=this.selectedCountry?.id;if(null!=i&&(this.selectedCountry=this.countries.find((t=>t.id===i))||null),!this.selectedCountry){const{countryId:t}=this.getIPLocationConfig();t&&this.countries.length>0&&(this.selectedCountry=this.countries.find((e=>String(e.id)===String(t)))||null),this.selectedCountry||1!==this.countries.length||(this.selectedCountry=this.countries[0])}if(this.selectedCountry)if("branch"===t){const t=this.getStoredIntent(),e=A(t),i=z(t);null!=e&&null!=i?await this.loadBranchesWithLocation(e,i):await this.loadBranches();const s=_(t);if(null!=s&&this.branches.length>0){const t=this.branches.find((t=>t.id===s));t&&(this.selectedBranch=t)}}else if("address"===t){if(this.isLoggedIn&&!this.savedAddressesLoaded){this.loadingSavedAddresses=!0;try{await this.loadSavedAddresses(),this.savedAddressesLoaded=!0}finally{this.loadingSavedAddresses=!1}}if(!this.isLoggedIn){const t=this.getStoredIntent();t&&S(t)&&await this.prefillAddressFromStoredIntent()}}}finally{this.tabChanging=!1}}}isConfirmDisabled(){return"branch"===this.activeTab?!this.selectedBranch:!("address"!==this.activeTab||this.isLoggedIn&&this.selectedSessionAddress||(this.isLoggedIn&&this.selectedSavedAddress?!1!==this.selectedSavedAddress.is_in_coverage:this.selectedCountry&&this.selectedCity&&M(this.selectedCountry?.code,this.selectedRegion?.id,this.selectedDistrict?.id??(this.districtName?.trim()||null))))}handleLogin(){Salla.auth.setCanRedirect(!1),Salla.event.dispatch("salla::bullet-delivery.modal.close.requested"),Salla.event.dispatch("login::open",Salla.url.is_page("cart")?{withoutReload:!0,source:"cart-submit"}:{withoutReload:!0,source:"bullet-delivery"})}resolvePendingCartSubmit(){if(!this.pendingCartSubmitResolver)return;const t=this.pendingCartSubmitResolver;this.pendingCartSubmitResolver=null,this.pendingCartSubmitPromise=null,this.cartSubmitConfirmationPending=!1,t()}buildIntentAddress(){if("address"!==this.activeTab||!this.selectedCountry||!this.selectedCity)return;const t={id:this.selectedCountry.id,name:this.selectedCountry.name,code:this.selectedCountry.code},e={id:this.selectedCity.id,name:this.selectedCity.name},i=this.selectedRegion?{id:this.selectedRegion.id,name:this.selectedRegion.name,code:this.selectedRegion.code}:void 0,s=this.selectedDistrict?{id:this.selectedDistrict.id,name:this.selectedDistrict.name}:this.districtName?{id:0,name:this.districtName}:void 0,r=this.selectedSavedAddress?.short_address;return{country:t,region:i,city:e,district:s,short_address:r}}buildIntentAddressFromSaved(t){return{country:{id:t.country?.id??t.country_id??0,name:t.country?.name??"",code:t.country?.code},region:t.region?{id:t.region.id,name:t.region.name,code:t.region.code}:void 0,city:{id:t.city?.id??t.city_id??0,name:t.city?.name??""},district:t.district?{id:t.district.id,name:t.district.name}:void 0,short_address:t.short_address}}buildIntentBranch(){if("branch"!==this.activeTab||!this.selectedBranch)return;const t=this.selectedBranch,e=null!=t.location?.lat?Number(t.location.lat):void 0,i=null!=t.location?.lng?Number(t.location.lng):void 0;return{id:t.id,name:t.name,city:t.city?.name,latitude:e,longitude:i}}buildAllocationConfirmedAddressData(t){return"address"!==this.activeTab?null:{saved_address:t??this.selectedSavedAddress??void 0,country:this.selectedCountry??void 0,region:this.selectedRegion??void 0,city:this.selectedCity??void 0,district:this.selectedDistrict??void 0,district_name:this.districtName?.trim()||void 0,short_address:t?.short_address??this.selectedSavedAddress?.short_address,form_data:{...this.newAddressForm}}}buildAllocationConfirmedAddressFromIntent(t){if("address"!==t.type)return null;const e=t.address_details,i=Number(t.country_id)||0;return{country:e?.country?{id:e.country.id,name:e.country.name,code:e.country.code??t.country_code??""}:void 0,region:e?.region?{id:Number(e.region.id),name:e.region.name,country_id:i,code:e.region.code??void 0}:void 0,city:e?.city?{id:Number(e.city.id),name:e.city.name,country_id:i}:void 0,district:e?.district?{id:Number(e.district.id),name:e.district.name,city_id:Number(e.city?.id)||0}:void 0,short_address:e?.short_address}}buildBranchFromIntent(t){if("branch"!==t.type||!t.branch_details)return null;const e=t.branch_details,i={id:e.id,name:e.name};return e.city&&(i.city={id:0,name:e.city}),null!=e.latitude&&null!=e.longitude&&(i.location={lat:String(e.latitude),lng:String(e.longitude)}),i}buildAllocationRequestFromIntent(t){if("branch"===t.type)return{type:"branch",branch_id:null!=t.branch_id?String(t.branch_id):""};if(null!=t.address_id)return{type:"address",address_id:String(t.address_id)};const e=t.address_details,i={type:"address",country_id:null!=t.country_id?String(t.country_id):"",city_id:null!=e?.city?.id?String(e.city.id):""};return null!=e?.region?.id&&(i.region_id=String(e.region.id)),null!=e?.district?.id&&(i.district_id=String(e.district.id)),i}applyMobileBulletDeliverySelection(t){if(!t||"address"!==t.type&&"branch"!==t.type)return void console.warn("SallaBulletDelivery: ignoring invalid mobile select payload",t);const e=t.allocation_headers??{},i=e["s-scope-allocation-type"]??t.type,s=e["s-scope-allocation-id"];i&&Salla.api.setHeader("s-scope-allocation-type",i),s&&Salla.api.setHeader("s-scope-allocation-id",String(s));const r=Salla.config.get("store.scope",Salla.storage.get("scope"))||{};Salla.storage.set("scope",{...r,allocation_type:i,allocation_id:s?String(s):void 0}),this.markShownThisSession();const o={...t,allocation_headers:{"s-scope-allocation-type":i,"s-scope-allocation-id":s?String(s):void 0}};this.setStoredIntent(o),m();const a=this.buildBranchFromIntent(o),n={...o,address:this.buildAllocationConfirmedAddressFromIntent(o),branch:a,allocation_request:this.buildAllocationRequestFromIntent(o),allocation_response:null};Salla.event.dispatch("salla::bullet-delivery.allocation.confirmed",n),this.bulletDeliveryConfirmed.emit({...o,branch:a??void 0}),this.emitHeaderContextUpdate(o,void 0,a??void 0),setTimeout((()=>window.location.reload()),100)}extractMobileSelectPayload(t){return t&&"object"==typeof t?"payload"in t&&t.payload?t.payload:t:null}async handleConfirm(){if(this.isConfirmDisabled()||this.confirming)return;this.allocationOutOfCoverageMessage=null,this.confirming=!0,this.confirmBtn?.load();let t=!1;try{const e={type:this.activeTab,country_id:Number(this.selectedCountry?.id)||0,country_code:this.selectedCountry?.code||""};let i,s,r;if("address"===this.activeTab)if(this.isLoggedIn&&this.selectedSessionAddress){const t=await this.saveSessionAddressToProfile();if(!t)return Salla.notify?.error(Salla.lang.get("common.errors.error_occurred")),void this.confirmBtn?.stop();e.address_id=t.id,i=t,this.selectedSessionAddress=!1,this.selectedSavedAddress=t,e.address_details=this.buildIntentAddressFromSaved(t)}else this.isLoggedIn&&this.selectedSavedAddress?(e.address_id=this.selectedSavedAddress.id,i=this.selectedSavedAddress,e.address_details=this.buildIntentAddressFromSaved(this.selectedSavedAddress)):e.address_details=this.buildIntentAddress();else e.branch_details=this.buildIntentBranch(),e.branch_id=this.selectedBranch?.id,s=this.selectedBranch||void 0;"address"===this.activeTab?this.isLoggedIn&&i?r={type:"address",address_id:String(i.id)}:(r={type:"address",country_id:String(this.selectedCountry?.id||0),city_id:String(this.selectedCity?.id||"")},p(this.selectedCountry?.code??"")&&(this.selectedRegion?.id&&(r.region_id=String(this.selectedRegion.id)),r.district_id=String(this.selectedDistrict?.id||""))):r={type:"branch",branch_id:String(this.selectedBranch?.id||"")};const o=await b.allocateScope(r);if(!o.success){console.error("BulletDelivery: Scope allocation failed",o.error);const t=o.error||("address"===this.activeTab?Salla.lang.get("pages.checkout.address_out_of_coverage"):Salla.lang.get("pages.checkout.failed_to_set_pickup"));return this.allocationOutOfCoverageMessage=t,this.confirmBtn?.stop(),void(this.confirming=!1)}let a;if(o.data){const t=o.data;a=t.id;const i=t?.allocation?.type,s=t?.allocation?.branch_id;i&&Salla.api.setHeader("s-scope-allocation-type",i),s&&Salla.api.setHeader("s-scope-allocation-id",String(s));const r=Salla.config.get("store.scope",Salla.storage.get("scope"))||{};Salla.storage.set("scope",{...r,id:a,allocation_type:i,allocation_id:s?String(s):void 0}),e.allocation_headers={"s-scope-allocation-type":i,"s-scope-allocation-id":s?String(s):void 0}}this.markShownThisSession(),this.setStoredIntent(e),a&&(await b.setDeliveryScope(a),m());const n={...e,address:this.buildAllocationConfirmedAddressData(i),branch:s??null,allocation_request:r,allocation_response:o.data??null};Salla.event.dispatch("salla::bullet-delivery.allocation.confirmed",n),this.bulletDeliveryConfirmed.emit({...e,address:i,branch:s}),this.emitHeaderContextUpdate(e,i,s),t=!0,setTimeout((()=>{if(this.confirmBtn?.stop(),this.close(),this.confirming=!1,this.cartSubmitConfirmationPending)this.resolvePendingCartSubmit();else if(a){const t=Salla.storage.get("scope")||{};let e=Salla.helpers.addParamToUrl("scope",a);t.allocation_id&&(e=Salla.helpers.addParamToUrl("allocation_id",t.allocation_id,e)),t.allocation_type&&(e=Salla.helpers.addParamToUrl("allocation_type",t.allocation_type,e)),window.location.replace(e)}else window.location.reload()}),500)}finally{t||(this.confirming=!1)}}getCartViewConfig(t){if(!t||!Salla.url.is_page("cart"))return null;if(!this.isIntentMethodSupported(t))return null;const e="address"===t.type;return{title:"branch"===t.type?Salla.lang.get("pages.checkout.pickup_option"):Salla.lang.get("pages.checkout.delivery_option"),subtitle:v(t,Salla.lang.get("common.elements.to"),""),buttonText:Salla.lang.get("common.elements.edit"),isAddress:e,intent:t}}createCartViewElement(){const t=this.getStoredIntent(),e=this.getCartViewConfig(t);if(!e)return null;const{title:i,subtitle:s,buttonText:r,intent:a}=e,n="branch"===a.type?{preselected_branch_id:_(a)}:{preselected_address_id:a.address_id},l=document.createElement("span");l.className="s-bullet-delivery-cart-view-icon s-bullet-delivery-tab-icon",l.setAttribute("aria-hidden","true"),l.innerHTML=o;const h=document.createElement("span");h.className="s-bullet-delivery-cart-view-title",h.textContent=i;const d=document.createElement("span");d.className="s-bullet-delivery-cart-view-subtitle",d.textContent=s;const c=document.createElement("div");c.className="s-bullet-delivery-cart-view-text",c.append(h,d);const u=document.createElement("div");u.className="s-bullet-delivery-cart-view-info",u.append(l,c);const p=document.createElement("salla-button");p.className="s-bullet-delivery-cart-view-button",p.setAttribute("fill","outline"),p.setAttribute("color","primary"),p.textContent=r,p.addEventListener("click",(()=>Salla.event.emit("salla::bullet-delivery.modal.open.requested",n)));const b=document.createElement("div");return b.className="s-bullet-delivery-cart-view",b.append(u,p),b}renderTabs(){return this.supportsPickup?i("div",{class:"s-bullet-delivery-tabs"},this.isSupportsDelivery&&i("button",{type:"button",class:{"s-bullet-delivery-tab":!0,"s-bullet-delivery-tab--active":"address"===this.activeTab},onClick:()=>this.handleTabChange("address")},i("span",{class:"s-bullet-delivery-tab-icon",innerHTML:o,"aria-hidden":"true"}),i("span",null,Salla.lang.get("mobile_app.strings.delivery"))),i("button",{type:"button",class:{"s-bullet-delivery-tab":!0,"s-bullet-delivery-tab--active":"branch"===this.activeTab},onClick:()=>this.handleTabChange("branch")},i("span",{class:"s-bullet-delivery-tab-icon",innerHTML:ks,"aria-hidden":"true"}),i("span",null,Salla.lang.get("mobile_app.strings.pickup")))):null}renderAlert(t){return i("div",{class:"s-bullet-delivery-allocation-out-of-coverage",role:"alert"},i("span",{class:"s-bullet-delivery-allocation-out-of-coverage-icon","aria-hidden":"true"},i("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true"},i("title",null,"Information"),i("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor","stroke-width":"1.5",fill:"currentColor"}),i("text",{x:"10",y:"14","text-anchor":"middle",fill:"white","font-size":"12","font-weight":"bold"},"i"))),i("span",{class:"s-bullet-delivery-allocation-out-of-coverage-text"},t))}renderAllocationOutOfCoverageAlert(){const t=this.allocationOutOfCoverageMessage||Salla.lang.get("pages.checkout.shipping_not_available");return this.renderAlert(t)}renderCountrySelect(){return i("div",{class:"s-bullet-delivery-field"},i("salla-searchable-dropdown",{label:Salla.lang.get("blocks.buy_as_gift.receiver_country"),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:!0,inputId:"bullet-delivery-country",searchQuery:this.countrySearchQuery,clientSearch:!0,onItemSelected:t=>this.handleCountrySelected(t.detail),onSearchInput:t=>this.handleCountrySearch(t.detail),onDropdownClosed:()=>this.handleCountryDropdownClosed()}))}renderRegionSelect(){return p(this.selectedCountry?.code??"")&&this.selectedCountry?i("div",{class:"s-bullet-delivery-field"},i("salla-searchable-dropdown",{label:Salla.lang.get("pages.checkout.region_field"),placeholder:Salla.lang.get("pages.checkout.select_region"),items:this.displayedRegions,selectedItem:this.selectedRegion,loading:this.loadingRegions,searching:this.searchingRegions,disabled:this.loadingRegions||0===this.regions.length,required:!0,inputId:"bullet-delivery-region",searchQuery:this.regionSearchQuery,clientSearch:!0,onItemSelected:t=>this.handleRegionSelected(t.detail),onSearchInput:t=>this.handleRegionSearch(t.detail),onDropdownClosed:()=>this.handleRegionDropdownClosed()})):null}renderCityDistrictSelects(){const t=p(this.selectedCountry?.code??""),e=t,s=e&&this.selectedCity&&!this.loadingDistricts&&0===this.districts.length,r=!this.selectedCountry||t&&!this.selectedRegion||this.loadingCities||0===this.cities.length,o=!this.selectedCountry||t&&!this.selectedRegion||!this.selectedCity||this.loadingDistricts;return i("div",{class:"s-bullet-delivery-field-row"},i("div",{class:"s-bullet-delivery-field"},i("salla-searchable-dropdown",{label:Salla.lang.get("blocks.buy_as_gift.receiver_city"),placeholder:Salla.lang.get("pages.checkout.select_city"),items:this.displayedCities,selectedItem:this.selectedCity,loading:this.loadingCities,searching:this.searchingCities,disabled:r,required:!0,inputId:"bullet-delivery-city",searchQuery:this.citySearchQuery,onItemSelected:t=>this.handleCitySelected(t.detail),onSearchInput:t=>this.handleCitySearch(t.detail),onDropdownClosed:()=>this.handleCityDropdownClosed(),dropUp:!0})),e&&i("div",{class:"s-bullet-delivery-field"},s?i("div",null,i("label",{class:"s-bullet-delivery-label",htmlFor:"bullet-delivery-district"},Salla.lang.get("pages.checkout.district_field"),i("span",{class:"text-red-500"}," *")),i("input",{id:"bullet-delivery-district",type:"text",class:"form-input",placeholder:Salla.lang.get("pages.checkout.select_district"),value:this.districtName,disabled:o,onInput:t=>{this.districtName=t.target.value,this.updateNewAddressForm({district:void 0})}})):i("salla-searchable-dropdown",{label:Salla.lang.get("pages.checkout.district_field"),placeholder:Salla.lang.get("pages.checkout.select_district"),items:this.displayedDistricts,selectedItem:this.selectedDistrict,loading:this.loadingDistricts,searching:this.searchingDistricts,disabled:o||0===this.districts.length,required:!0,inputId:"bullet-delivery-district",searchQuery:this.districtSearchQuery,clientSearch:!0,onItemSelected:t=>this.handleDistrictSelected(t.detail),onSearchInput:t=>this.handleDistrictSearch(t.detail),onDropdownClosed:()=>this.handleDistrictDropdownClosed(),dropUp:!0})))}renderSavedAddressesEmptyState(){return i("div",{class:"s-bullet-delivery-saved-addresses-empty"},i("div",{class:"s-bullet-delivery-saved-addresses-empty-icon","aria-hidden":"true"},i("svg",{width:"28",height:"28",viewBox:"0 0 28 29",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("title",null,"No Saved Adresses"),i("path",{d:"M20.16 0C21.4613 0 22.6773 0.341333 23.808 1.024C24.9387 1.70667 25.8347 2.61333 26.496 3.744C27.1787 4.91733 27.52 6.18667 27.52 7.552C27.52 9.45067 26.8267 11.232 25.44 12.896C24.4587 14.0907 23.0827 15.2427 21.312 16.352H21.28C20.9387 16.5653 20.5653 16.672 20.16 16.672C19.7547 16.672 19.3813 16.5653 19.04 16.352H19.008C17.2373 15.2213 15.8613 14.0693 14.88 12.896C13.4933 11.232 12.8 9.45067 12.8 7.552C12.8 6.18667 13.1413 4.91733 13.824 3.744C14.4853 2.61333 15.3813 1.70667 16.512 1.024C17.6427 0.341333 18.8587 0 20.16 0ZM11.488 1.984C9.67467 2.368 8.04267 3.14667 6.592 4.32C5.14133 5.49333 4.01067 6.92267 3.2 8.608C2.34667 10.3573 1.92 12.224 1.92 14.208C1.92 14.72 1.952 15.2427 2.016 15.776L2.08 15.744C2.57067 15.488 2.94933 15.3067 3.216 15.2C3.48267 15.0933 3.73867 15.0933 3.984 15.2C4.22933 15.3067 4.4 15.488 4.496 15.744C4.592 16 4.58667 16.256 4.48 16.512C4.37333 16.768 4.19733 16.9493 3.952 17.056C3.70667 17.1627 3.36 17.3227 2.912 17.536L2.656 17.664C2.57067 17.7067 2.48533 17.7387 2.4 17.76C2.89067 19.4667 3.70133 20.9973 4.832 22.352C5.96267 23.7067 7.296 24.7573 8.832 25.504C10.432 26.272 12.1173 26.656 13.888 26.656C15.4667 26.656 16.9813 26.3467 18.432 25.728C19.8187 25.1307 21.0667 24.288 22.176 23.2C21.92 23.0507 21.7653 22.8373 21.712 22.56C21.6587 22.2827 21.7013 22.0267 21.84 21.792C21.9787 21.5573 22.176 21.408 22.432 21.344C22.8373 21.2587 23.2 21.12 23.52 20.928C23.6907 20.8427 23.8613 20.8 24.032 20.8C24.8 19.5413 25.3333 18.176 25.632 16.704C25.6747 16.4267 25.808 16.2133 26.032 16.064C26.256 15.9147 26.496 15.8667 26.752 15.92C27.008 15.9733 27.2107 16.1173 27.36 16.352C27.5093 16.5867 27.552 16.832 27.488 17.088C27.0613 19.2853 26.1973 21.264 24.896 23.024C23.5947 24.784 22.0053 26.1547 20.128 27.136C18.1653 28.16 16.0853 28.672 13.888 28.672C11.3707 28.672 9.03467 28.0107 6.88 26.688C4.78933 25.408 3.12533 23.68 1.888 21.504C0.629333 19.264 0 16.832 0 14.208C0 11.904 0.490667 9.73867 1.472 7.712C2.41067 5.74933 3.728 4.09067 5.424 2.736C7.12 1.38133 9.01333 0.48 11.104 0.032C11.36 -0.032 11.6 0.0106667 11.824 0.16C12.048 0.309333 12.1867 0.522667 12.24 0.8C12.2933 1.07733 12.2453 1.328 12.096 1.552C11.9467 1.776 11.744 1.92 11.488 1.984ZM14.72 7.552C14.72 8.96 15.2533 10.304 16.32 11.584C17.1733 12.5867 18.3893 13.6 19.968 14.624C20.032 14.6453 20.096 14.656 20.16 14.656C20.224 14.656 20.288 14.6453 20.352 14.624C21.9307 13.6213 23.1467 12.608 24 11.584C25.0667 10.304 25.6 8.96 25.6 7.552C25.6 6.57067 25.3547 5.65333 24.864 4.8C24.3733 3.94667 23.7067 3.26933 22.864 2.768C22.0213 2.26667 21.12 2.016 20.16 2.016C19.2 2.016 18.2987 2.26667 17.456 2.768C16.6133 3.26933 15.9467 3.94667 15.456 4.8C14.9653 5.65333 14.72 6.57067 14.72 7.552ZM17.28 7.68C17.28 6.848 17.5627 6.13867 18.128 5.552C18.6933 4.96533 19.3707 4.672 20.16 4.672C20.9493 4.672 21.6267 4.96533 22.192 5.552C22.7573 6.13867 23.04 6.848 23.04 7.68C23.04 8.512 22.7573 9.216 22.192 9.792C21.6267 10.368 20.9493 10.656 20.16 10.656C19.3707 10.656 18.6933 10.368 18.128 9.792C17.5627 9.216 17.28 8.512 17.28 7.68ZM6.752 14.688C7.62667 14.7733 8.53333 15.0293 9.472 15.456C9.70667 15.5627 9.87733 15.744 9.984 16C10.0907 16.256 10.0907 16.512 9.984 16.768C9.87733 17.024 9.70133 17.2 9.456 17.296C9.21067 17.392 8.97067 17.3867 8.736 17.28C7.94667 16.9387 7.22133 16.736 6.56 16.672C6.28267 16.6293 6.064 16.5013 5.904 16.288C5.744 16.0747 5.68 15.8293 5.712 15.552C5.744 15.2747 5.86133 15.0507 6.064 14.88C6.26667 14.7093 6.496 14.6453 6.752 14.688ZM17.6 20.544C18.304 20.864 18.976 21.0987 19.616 21.248C19.872 21.312 20.0693 21.4613 20.208 21.696C20.3467 21.9307 20.3893 22.1813 20.336 22.448C20.2827 22.7147 20.144 22.9227 19.92 23.072C19.696 23.2213 19.4453 23.264 19.168 23.2C18.4213 23.0293 17.632 22.752 16.8 22.368C16.5653 22.2613 16.4 22.08 16.304 21.824C16.208 21.568 16.2133 21.312 16.32 21.056C16.4267 20.8 16.6027 20.624 16.848 20.528C17.0933 20.432 17.344 20.4373 17.6 20.544ZM12.832 17.44C13.0027 17.568 13.248 17.7493 13.568 17.984L14.496 18.688C14.7093 18.8587 14.8373 19.0773 14.88 19.344C14.9227 19.6107 14.8693 19.856 14.72 20.08C14.5707 20.304 14.368 20.4427 14.112 20.496C13.856 20.5493 13.6107 20.5013 13.376 20.352L11.744 19.072C11.5307 18.9227 11.4027 18.7093 11.36 18.432C11.3173 18.1547 11.3707 17.904 11.52 17.68C11.6693 17.456 11.872 17.3227 12.128 17.28C12.384 17.2373 12.6187 17.2907 12.832 17.44ZM20.16 8.672C20.416 8.672 20.64 8.576 20.832 8.384C21.024 8.192 21.12 7.95733 21.12 7.68C21.12 7.40267 21.024 7.16267 20.832 6.96C20.64 6.75733 20.416 6.656 20.16 6.656C19.904 6.656 19.68 6.75733 19.488 6.96C19.296 7.16267 19.2 7.40267 19.2 7.68C19.2 7.95733 19.296 8.192 19.488 8.384C19.68 8.576 19.904 8.672 20.16 8.672Z",fill:"#666666"}))),i("p",{class:"s-bullet-delivery-saved-addresses-empty-title"},Salla.lang.get("pages.checkout.no_saved_addresses")),i("p",{class:"s-bullet-delivery-saved-addresses-empty-desc"},Salla.lang.get("pages.checkout.add_address_simplify_shipping")),i("salla-button",{onClick:()=>this.handleAddNewAddress(),onKeyUp:()=>this.handleAddNewAddress()},Salla.lang.get("pages.checkout.add_new_address")))}async saveSessionAddressToProfile(){const t=this.getStoredIntent(),e=w(t),i=S(t),s=C(t);if(!t||"address"!==t.type||!e||!i)return null;const r=x(t);if(p(r)&&!s)return null;const o=p(r),a=t.address_details?.district?.name??"",n={country_id:e,region_id:k(t),city_id:i,district_id:s,description:a};o&&(n.local=a);try{const{success:t,address:e}=await b.saveAddressLocation(n);if(!t)return null;const i=e??null;return i&&this.addressCreated.emit({address:i}),i}catch(t){return console.error("SallaBulletDelivery: Error saving session address",t),null}}renderSavedAddresses(){if(!this.isLoggedIn)return null;if(this.loadingSavedAddresses)return i("div",{class:"s-bullet-delivery-addresses-list s-scrollbar"},[1,2,3].map((t=>i("div",{key:t,class:"s-bullet-delivery-address-item s-bullet-delivery-address-item--skeleton"},i("salla-skeleton",{class:"s-bullet-delivery-skel-radio",height:"18px",width:"18px"}),i("salla-skeleton",{class:"s-bullet-delivery-skel-map",height:"36px",width:"36px"}),i("div",{class:"s-bullet-delivery-address-content"},i("div",{class:"s-bullet-delivery-address-lines"},i("salla-skeleton",{height:"18px",width:"72%"}),i("salla-skeleton",{height:"16px",width:"56%"})))))));const t=this.getStoredIntent(),e=$(t),s=e&&t?.address_details&&[t.address_details.city?.name,t.address_details.country?.name].filter(Boolean).join("، ")||"",r=e&&t?.address_details?(t.address_details.district?.name??"").trim():"";return 0!==this.savedAddresses.length||e?i("div",{class:"s-bullet-delivery-addresses-list s-scrollbar"},e&&this.renderAddressRow({key:"session-address",line1:s,line2:r,selected:this.selectedSessionAddress,onClick:()=>this.handleSessionAddressSelect()}),this.savedAddresses.map((t=>{const e=[t.building_number,t.street].filter(Boolean).join("، ")||t.formatted?.address_one||t.short_address||"",i=[t.district?.name,t.city?.name,t.country?.name].filter(Boolean).join("، "),s=(t.formatted?.address_two||i)??"",r=!1!==t.is_in_coverage;return this.renderAddressRow({key:String(t.id),line1:e,line2:s,selected:this.selectedSavedAddress?.id===t.id,disabled:!r,onClick:()=>r&&this.handleSavedAddressSelect(t)})}))):this.renderSavedAddressesEmptyState()}renderAddressRow(t){const{key:e,line1:s,line2:r,selected:o,disabled:a=!1,onClick:n}=t;return i("button",{key:e,class:{"s-bullet-delivery-address-item":!0,"s-bullet-delivery-address-item--selected":o,"s-bullet-delivery-address-item--disabled":a},type:"button",onClick:a?void 0:n,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),a||n())}},i("input",{type:"radio",name:"saved_address",class:"s-bullet-delivery-radio",checked:o,disabled:a}),i("span",{class:"s-bullet-delivery-address-map-icon",innerHTML:'<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g filter="url(#filter0_d_24181_220540)">\n <mask id="mask0_24181_220540" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="1" y="0" width="33" height="32">\n <rect x="1.90958" y="0.576577" width="30.8468" height="30.8468" rx="9.22523" fill="#D9D9D9" stroke="white" stroke-width="1.15315"/>\n </mask>\n <g mask="url(#mask0_24181_220540)">\n <rect x="1.90958" y="0.576577" width="30.8468" height="30.8468" rx="9.22523" fill="#E8E8E8" stroke="white" stroke-width="1.15315"/>\n <path d="M17.9096 6.77445L28.7204 5.33301H32.4681L32.7564 11.8195V23.6393L10.4141 23.9276V10.8105L17.9096 6.77445Z" fill="#97E7C8"/>\n <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"/>\n <rect x="2.34202" y="1.00901" width="29.982" height="29.982" rx="8.79279" stroke="white" stroke-width="2.01802"/>\n </g>\n <g clip-path="url(#clip0_24181_220540)">\n <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"/>\n </g>\n </g>\n <defs>\n <filter id="filter0_d_24181_220540" x="-0.000325561" y="0" width="34.6667" height="34.6667" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n <feFlood flood-opacity="0" result="BackgroundImageFix"/>\n <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"/>\n <feOffset dy="1.33333"/>\n <feGaussianBlur stdDeviation="0.666667"/>\n <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"/>\n <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_24181_220540"/>\n <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_24181_220540" result="shape"/>\n </filter>\n <clipPath id="clip0_24181_220540">\n <rect width="12.1081" height="12.1081" fill="white" transform="translate(11.1338 8.07227)"/>\n </clipPath>\n </defs>\n </svg>\n ',"aria-hidden":"true"}),i("div",{class:"s-bullet-delivery-address-content"},i("div",{class:"s-bullet-delivery-address-lines"},i("span",{class:"s-bullet-delivery-address-line1"},s),i("span",{class:"s-bullet-delivery-address-line2"},r))))}renderMapSection(){const t=p(this.selectedCountry?.code??""),e=this.mapLocationData,s=null!=e?.lat&&null!=e?.lng,r=s?{lat:e.lat,lng:e.lng}:this.mapInitialCenter;return i("div",{class:"s-bullet-delivery-map-container"},i("gmap-map",{ref:t=>this.gmapRef=t,center:r,zoom:16,"min-zoom":4,"max-zoom":21,"map-id":"DEMO_MAP_ID","enable-autocomplete":!0,"enable-geolocation":!0,"show-location-marker":!0,"location-marker-position":s?{lat:e.lat,lng:e.lng,accuracy:50}:{...r,accuracy:50},language:Salla.lang.getLocale?.()??document.documentElement.lang??"ar","geolocation-button-label":Salla.lang.get("pages.checkout.current_location"),"autocomplete-placeholder":Salla.lang.get("pages.checkout.search_for_address"),"autocomplete-hint":t?Salla.lang.get("pages.checkout.short_address_format_validation"):void 0,"autocomplete-country":this.selectedCountry?.code?.toLowerCase(),"autocomplete-resolve":!1,"autocomplete-auth-token":this.addressToken,"location-marker-background":"#4285F4","location-marker-border-color":"#1967D2","location-marker-glyph-color":"#FFFFFF","location-marker-scale":1.3,"onGmap-location-changed":this.handleMapLocationChanged,"onGmap-ready":this.handleMapReady}))}renderAddressConfirmation(){const t=this.mapLocationData?.formattedAddress??"",e=this.mapLocationData?.shortAddress;return i("div",{class:"s-bullet-delivery-address-confirm"},i("div",{class:"s-bullet-delivery-address-confirm-card"},i("div",{class:"s-bullet-delivery-address-confirm-details"},i("span",{class:"s-bullet-delivery-address-confirm-label"},Salla.lang.get("pages.checkout.selected_address")),i("p",{class:"s-bullet-delivery-address-confirm-text"},t),e&&i("span",{class:"s-bullet-delivery-address-confirm-tag"},e,i("span",{class:"s-bullet-delivery-address-confirm-tag-icon",innerHTML:'<svg width="13" height="15" viewBox="0 0 8.97576 11.7781" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6.2453 8.52122L5.8322 8.24311L5.86126 8.20024L6.27435 8.47694L6.2453 8.52122ZM6.42386 8.25126L6.00758 7.97882C5.96896 8.03798 5.92999 8.0975 5.88995 8.15737L6.30376 8.43372C6.34414 8.37136 6.38489 8.31184 6.42386 8.25126ZM6.63572 7.92213L6.21518 7.65677L6.11244 7.81797L6.5305 8.08723L6.63572 7.92213ZM6.43484 9.81081L5.92538 9.45547C5.32487 10.316 4.76617 11.0388 4.48664 11.3927L4.97413 11.7781C5.25827 11.4182 5.82512 10.6831 6.43484 9.81081ZM3.55487 10.1647C3.44257 10.0113 3.33097 9.85652 3.22327 9.70417L2.717 10.0638C2.82611 10.2179 2.93913 10.3745 3.0525 10.5307L3.55487 10.1647ZM3.11734 9.55006L2.99688 9.37823L2.48707 9.73216L2.60965 9.90753L3.11734 9.55006ZM6.58577 9.59257L6.07206 9.24113L5.95266 9.41402L6.46248 9.76865C6.50499 9.71091 6.54538 9.65174 6.58577 9.59151V9.59257ZM2.96535 9.33607C2.46191 8.60767 2.02898 7.92319 1.68072 7.30887L1.14044 7.61461C1.49933 8.24736 1.94182 8.9453 2.4566 9.68929L2.96535 9.33607ZM7.01161 8.95416L6.49152 8.6144C6.39055 8.7678 6.28533 8.92652 6.17763 9.08453L6.69134 9.43386C6.80329 9.27018 6.911 9.11146 7.01374 8.95486L7.01161 8.95416ZM8.97363 4.48559C8.97434 3.96621 8.88471 3.45073 8.70898 2.96217L8.12442 3.17262C8.27605 3.5935 8.35364 4.03777 8.35293 4.48559C8.35293 4.99505 8.11733 5.71955 7.65216 6.63927L8.2059 6.91916C8.72599 5.89847 8.97576 5.10204 8.97576 4.4863L8.97363 4.48559ZM0.749309 5.26111C0.699001 5.09389 0.661447 4.92313 0.637001 4.75059L0.0216118 4.83208C0.0488916 5.03579 0.0921143 5.23738 0.150217 5.43436L0.749309 5.26111ZM0.621058 4.58443V4.39737L0 4.3832V4.48594C0 4.51995 5.62238e-07 4.5738 0.00389767 4.6188L0.621058 4.58443ZM1.3275 2.25361L0.820874 1.89472C0.314958 2.60824 0.0297605 3.45427 0.000709258 4.32864L0.621058 4.35061C0.645858 3.59705 0.89173 2.86793 1.3275 2.25361ZM8.69233 2.91151C8.66612 2.84065 8.63706 2.76944 8.60766 2.70106L8.03797 2.94835C8.06348 3.00752 8.08792 3.06846 8.11131 3.12939L8.69233 2.91151ZM8.52227 2.51684C8.43264 2.33367 8.33025 2.15689 8.21653 1.98754L7.70282 2.33367C7.80095 2.47928 7.88846 2.63163 7.96534 2.78964L8.52227 2.51684ZM6.33848 0.397516C5.7571 0.13393 5.12577 -0.00140612 4.48735 1.10152e-05C4.25494 1.10152e-05 4.02288 0.0177252 3.79331 0.0531534L3.88825 0.664646C4.08665 0.634178 4.28682 0.618943 4.48735 0.618589C5.0372 0.617526 5.58137 0.73444 6.08197 0.961535L6.33848 0.397516ZM3.47906 0.752862L3.31644 0.150581C3.11946 0.203369 2.92602 0.269974 2.73825 0.349688L2.97987 0.921501C3.14214 0.853125 3.30865 0.796084 3.47835 0.750382L3.47906 0.752862ZM3.84184 0.673858L3.7391 0.061657C3.6647 0.0737026 3.58959 0.0885822 3.51519 0.104525L3.64876 0.710702C3.71182 0.694051 3.77666 0.681651 3.84078 0.671023L3.84184 0.673858ZM4.68149 10.6292C4.68149 10.6253 5.02975 10.2041 5.49138 9.58159L5.08998 9.28293C4.8434 9.6156 4.63083 9.8884 4.4877 10.0705C4.2436 9.76121 3.79791 9.18302 3.32069 8.49819L2.91043 8.78481C3.63494 9.82286 4.28824 10.6218 4.29462 10.6296L4.48735 10.8659L4.68149 10.6292ZM5.57039 9.47318L5.16757 9.17629L5.10344 9.26097L5.50556 9.55821C5.52752 9.52739 5.54843 9.50117 5.56968 9.47212L5.57039 9.47318ZM6.01997 8.85035L5.60759 8.56445C5.48359 8.74123 5.35463 8.92156 5.22213 9.10154L5.62566 9.39772C5.75993 9.21278 5.89137 9.02927 6.0175 8.85L6.01997 8.85035ZM8.12194 4.47708C8.12229 3.76958 7.91539 3.07731 7.52639 2.48601L7.10833 2.76023C7.44419 3.2704 7.62311 3.86807 7.62204 4.47886C7.62204 5.12436 7.14872 6.20669 6.25309 7.60788L6.67434 7.87714C7.63196 6.37108 8.11875 5.2271 8.11875 4.47567L8.12194 4.47708ZM2.68015 7.53667C2.55863 7.34394 2.44314 7.15653 2.33791 6.97584L1.9064 7.22951C2.01481 7.41444 2.13314 7.60788 2.25785 7.8077L2.68015 7.53667ZM2.29009 6.89436L2.23801 6.80366L1.80365 7.05237L1.8568 7.14554L2.29009 6.89436ZM2.22596 6.78205C1.65627 5.78155 1.35513 4.98371 1.35513 4.47567C1.35513 4.17453 1.39835 3.87516 1.48338 3.58642L1.00368 3.44541C0.905193 3.77915 0.854885 4.12528 0.855239 4.47319C0.855239 5.07618 1.16984 5.93567 1.79161 7.02757L2.22596 6.78205ZM7.50867 2.46263C7.48812 2.43181 7.46616 2.39851 7.44455 2.36946L7.03535 2.65465C7.05413 2.68087 7.07326 2.7078 7.09133 2.73508L7.50867 2.46263ZM2.36732 2.17389L2.02579 1.8026C1.85148 1.9638 1.69312 2.14201 1.55389 2.33438L1.95777 2.62985C2.07893 2.46369 2.21604 2.30994 2.36767 2.1707L2.36732 2.17389ZM7.38396 2.28726C7.24012 2.09772 7.07786 1.9227 6.90037 1.76434L6.5677 2.13811C6.7211 2.27415 6.86104 2.42472 6.98504 2.58769L7.38396 2.28726ZM2.50726 2.04848L2.19124 1.66302C2.16183 1.68675 2.13278 1.7112 2.10373 1.73635L2.43286 2.11402C2.45731 2.08993 2.48246 2.06867 2.50726 2.04848ZM4.48664 1.34203C4.8884 1.34133 5.28626 1.41856 5.65861 1.56878L5.84602 1.10431C4.62658 0.613984 3.23744 0.819114 2.21214 1.6414L2.52568 2.03112C3.08084 1.58295 3.77311 1.34026 4.48664 1.3431V1.34203ZM4.72649 9.03245C4.86927 8.82839 5.00708 8.62609 5.13817 8.43053C5.67207 7.64862 6.15567 6.83342 6.58506 5.98987C7.08141 4.98406 7.12463 4.54723 7.12853 4.47035V4.45618C7.12853 2.99689 5.94558 1.81394 4.48628 1.81394C3.02699 1.81394 1.84404 2.99689 1.84404 4.45618V4.47035C1.84404 4.54759 1.89081 4.98406 2.3868 5.98987C2.8169 6.83342 3.3005 7.64862 3.83476 8.43053C3.96336 8.62326 4.10401 8.82874 4.24643 9.03245L4.48522 9.3754L4.72649 9.03245ZM3.0316 3.00362C3.83547 2.19975 5.13887 2.20011 5.94274 3.00398C6.32537 3.3866 6.54183 3.90456 6.54538 4.44555C6.53971 4.49374 6.48125 4.87707 6.06178 5.73018C5.64373 6.55177 5.17289 7.34571 4.6528 8.10671C4.59895 8.18749 4.54368 8.26933 4.48699 8.35223C4.43102 8.26933 4.37504 8.18784 4.32119 8.10671C3.80146 7.34536 3.33061 6.55177 2.91221 5.73018C2.48636 4.86644 2.43357 4.48346 2.42932 4.44555C2.43109 3.90421 2.64791 3.38589 3.0316 3.00362Z" fill="url(#paint0_linear_0_471)"/>\n<defs>\n<linearGradient id="paint0_linear_0_471" x1="-0.000253536" y1="5.88509" x2="8.97608" y2="5.88509" gradientUnits="userSpaceOnUse">\n<stop offset="0.2" stop-color="#4498B6"/>\n<stop offset="0.49" stop-color="#273265"/>\n<stop offset="1" stop-color="#C93732"/>\n</linearGradient>\n</defs>\n</svg>\n'}))),i("button",{type:"button",class:"s-bullet-delivery-address-confirm-edit",onClick:()=>{this.mapStep="map"}},Salla.lang.get("common.elements.edit"))),i("div",{class:"s-bullet-delivery-address-confirm-description"},i("label",{class:"s-bullet-delivery-address-confirm-description-label"},Salla.lang.get("pages.checkout.address_description"),i("span",{class:"s-bullet-delivery-address-confirm-description-optional"},Salla.lang.get("common.elements.optional"))),i("input",{type:"text",class:"s-bullet-delivery-address-confirm-description-input form-input",placeholder:Salla.lang.get("pages.checkout.address_description_placeholder"),value:this.addressDescription,onInput:t=>{this.addressDescription=t.target.value}})))}renderGuestDeliveryForm(){if(this.isMapModeAvailable)return"confirm"===this.mapStep&&this.hasMapLocation()?this.renderAddressConfirmation():this.renderMapSection();const t=p(this.selectedCountry?.code??"");return[this.renderCountrySelect(),t?this.renderRegionSelect():null,this.renderCityDistrictSelects()]}renderDeliveryTab(){return i("div",{class:{"s-bullet-delivery-content":!0,"s-bullet-delivery-content--active":"address"===this.activeTab,"s-hidden":"address"!==this.activeTab}},this.isLoggedIn?this.renderSavedAddresses():this.renderGuestDeliveryContent())}renderGuestDeliveryContent(){if(!this.isMapModeAvailable)return this.renderGuestDeliveryForm();const t=this.hasMapLocation(),e="confirm"===this.mapStep&&t,s=this.canConfirmMapLocation(),r=e?this.savingAddress?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address"):Salla.lang.get("pages.checkout.confirm_location");return i("form",{onSubmit:t=>{t.preventDefault(),e||!s?this.handleSubmitAddAddress(t):this.mapStep="confirm"}},this.renderGuestDeliveryForm(),i("div",{class:"s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single",style:{padding:"24px"}},i("salla-button",{type:"submit",loading:this.savingAddress,disabled:e?this.savingAddress:!s,width:"wide"},r),!this.isLoggedIn&&i("button",{type:"button",class:"s-bullet-delivery-login-prompt",onClick:()=>this.handleLogin()},Salla.lang.get("pages.checkout.login_to_use_saved_addresses"))))}renderBranchSearch(){return i("div",{class:"s-bullet-delivery-branch-search"},i("div",{class:"s-bullet-delivery-search-row"},i("div",{class:"s-bullet-delivery-search s-bullet-delivery-branch-search-wrap"},i("span",{class:"s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon",innerHTML:a,"aria-hidden":"true"}),i("input",{type:"text",class:"s-bullet-delivery-branch-search-input form-input",placeholder:Salla.lang.get("pages.checkout.search_for_city_or_branch"),value:this.branchSearchQuery,onInput:t=>this.handleBranchSearch(t),autocomplete:"off"})),i("button",{type:"button",class:{"s-bullet-delivery-location-btn":!0,"s-bullet-delivery-location-btn--full":!0,"s-bullet-delivery-location-btn--loading":this.loadingNearestBranch},onClick:()=>this.handleFindNearestBranch(),disabled:this.loadingNearestBranch},this.loadingNearestBranch?i("span",{class:"s-bullet-delivery-location-icon","aria-hidden":"true"},i("salla-skeleton",{height:"18px",width:"18px"})):i("span",{class:"s-bullet-delivery-location-icon",innerHTML:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n 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"\n stroke="#555555" stroke-width="1.3" />\n <path d="M14.65 7.65039H13.3167" stroke="#555555" stroke-width="1.3" stroke-linecap="round"\n stroke-linejoin="round" />\n <path d="M1.98336 7.65039L0.650024 7.65039" stroke="#555555" stroke-width="1.3"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M7.65002 0.650065L7.65002 1.9834" stroke="#555555" stroke-width="1.3"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M7.65002 13.3171L7.65002 14.6504" stroke="#555555" stroke-width="1.3"\n stroke-linecap="round" stroke-linejoin="round" />\n <path\n 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"\n stroke="#555555" stroke-width="1.3" />\n</svg>\n ',"aria-hidden":"true"}),i("span",null,Salla.lang.get("pages.checkout.nearest_to_my_location")))),this.locationError&&"branch"===this.activeTab&&i("span",{class:"s-bullet-delivery-error"},this.locationError))}renderBranchList(){return this.loadingBranches?i("div",{class:"s-bullet-delivery-branches-wrap"},i("div",{class:"s-bullet-delivery-branches-loading"},[1,2,3,4].map((t=>i("div",{key:t,class:"s-bullet-delivery-branch-skeleton"},i("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-radio",type:"circle",height:"16px",width:"16px"}),i("div",{class:"s-bullet-delivery-branch-skeleton-icon"},i("salla-skeleton",{height:"34px",width:"34px"})),i("div",{class:"s-bullet-delivery-branch-skeleton-content"},i("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-title",height:"12px",width:"124px"})),i("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-time",height:"12px",width:"88px"}),i("div",{class:"s-bullet-delivery-branch-skeleton-map"},i("salla-skeleton",{height:"32px",width:"32px"}))))))):0===this.filteredBranches.length?i("salla-placeholder",{alignment:"center",class:"s-bullet-delivery-placeholder"},i("span",{slot:"title"},Salla.lang.get("pages.checkout.no_pickup_branches_found"))):i("div",{class:"s-bullet-delivery-branches-wrap"},i("ul",{class:"s-bullet-delivery-branches-list s-scrollbar"},this.filteredBranches.map((t=>{const e=(t=>{if(!t)return!1;const e=t.pickup_readiness?.selectable;return"boolean"==typeof e?e:!1!==t.is_open})(t),s=t?.pickup_readiness;return i("li",{key:t.id,class:{"s-bullet-delivery-branch-item":!0,"s-bullet-delivery-branch-item--selected":this.selectedBranch?.id===t.id,"s-bullet-delivery-branch-item--disabled":!e},tabIndex:e?0:-1,role:"option","aria-disabled":!e,onClick:()=>e&&this.handleBranchSelect(t),onKeyDown:i=>{"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),e&&this.handleBranchSelect(t))}},i("input",{type:"radio",name:"branch",class:"s-bullet-delivery-radio",checked:this.selectedBranch?.id===t.id,disabled:!e}),i("span",{class:"s-bullet-delivery-branch-icon","aria-hidden":"true"},i("span",{innerHTML:ks})),i("div",{class:"flex flex-col gap-[2px]"},i("div",{class:"flex items-center gap-1"},i("p",{class:"s-bullet-delivery-branch-name text-start"},t.name),s?.label&&i("p",{class:"branch-status-badge"+(s.color?` ${s.color}`:"")},s.label)),t.preparation_time?i("span",{class:"s-bullet-delivery-branch-prep text-start"},i("i",{class:"sicon-clock"})," ",i("span",{class:"first-letter-cap"},t.preparation_time)):null,s?.detail_line&&i("span",{class:"s-bullet-delivery-branch-time text-start"},i("i",{class:"sicon-store"})," ",s.detail_line)),i("div",{style:{width:"full",maxWidth:"50px",marginInlineStart:"auto"}},null!=t.location?.lat&&null!=t.location?.lng&&i("a",{href:`https://www.google.com/maps?q=${t.location.lat},${t.location.lng}`,target:"_blank",rel:"noopener noreferrer",class:"s-bullet-delivery-branch-map-link",title:Salla.lang.get("common.elements.open_in_google_maps"),onClick:t=>t.stopPropagation()},i("span",{class:"s-bullet-delivery-branch-map-link-icon",innerHTML:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M7.94798 3.19336C11.1309 2.1083 12.7223 1.56578 13.5783 2.42174C14.4342 3.27771 13.8917 4.86914 12.8066 8.05201L12.0678 10.2195C11.2344 12.6639 10.8178 13.8861 10.131 13.9872C9.94631 14.0144 9.75517 13.9981 9.57248 13.9394C8.89297 13.7212 8.53377 12.4326 7.81538 9.8553C7.65604 9.28364 7.57637 8.99781 7.39494 8.7795C7.34228 8.71614 7.28386 8.65772 7.2205 8.60506C7.00219 8.42363 6.71636 8.34396 6.1447 8.18462C3.56741 7.46623 2.27876 7.10703 2.0606 6.42752C2.00195 6.24483 1.98558 6.05369 2.01277 5.86903C2.11392 5.18221 3.33613 4.76556 5.78054 3.93225L7.94798 3.19336Z"\n stroke="#555555" stroke-width="1.2" />\n</svg>\n '.replace(/mask0_25437_34440/g,`mask0_branch_${t.id}`),"aria-hidden":"true"}),i("span",{class:"sr-only"},Salla.lang.get("common.elements.open_in_google_maps")))))}))))}renderPickupTab(){return i("div",{class:{"s-bullet-delivery-content":!0,"s-bullet-delivery-content--active":"branch"===this.activeTab,"s-hidden":"branch"!==this.activeTab}},this.renderCountrySelect(),this.renderBranchSearch(),this.renderBranchList())}renderAddAddressForm(){Salla.lang.get("pages.checkout.add_new_address");const t=this.isMapModeAvailable,e=p(this.selectedCountry?.code??""),s=this.hasMapLocation();let r,o;if(t)"map"===this.mapStep?(r=this.canConfirmMapLocation(),o=Salla.lang.get("pages.checkout.confirm_location")):(r=s,o=this.savingAddress?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address"));else{const t=this.selectedCountry&&this.selectedCity&&(!e||this.selectedRegion)&&(!e||!!this.selectedDistrict||!!(this.districtName&&this.districtName.trim().length>0));r=s||t,o=this.savingAddress?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address")}return this.savedAddresses.length>0||$(this.getStoredIntent()),i("div",{class:"s-bullet-delivery-add-address"},i("form",{class:"s-bullet-delivery-add-address-form",onSubmit:e=>{e.preventDefault(),t&&"map"===this.mapStep&&r?this.mapStep="confirm":this.handleSubmitAddAddress(e)}},this.renderGuestDeliveryForm(),i("div",{class:"s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single"},i("salla-button",{type:"submit",loading:this.savingAddress,disabled:!r||this.savingAddress,class:"s-bullet-delivery-add-address-submit"},o))))}renderFooter(){if("address"===this.activeTab&&!this.isLoggedIn&&this.isMapModeAvailable)return null;const t="address"===this.activeTab&&this.isLoggedIn;return i("div",{class:"s-bullet-delivery-footer"},i("salla-button",{ref:t=>{this.confirmBtn=t},disabled:this.isConfirmDisabled(),onClick:()=>this.handleConfirm(),"loader-position":"center",width:"wide"},"branch"===this.activeTab?Salla.lang.get("pages.checkout.confirm_receipt_from_the_branch"):Salla.lang.get("pages.checkout.confirm_address")),t&&i("salla-button",{onClick:()=>this.handleAddNewAddress(),width:"wide",shape:"link"},Salla.lang.get("pages.checkout.add_new_address")),!this.isLoggedIn&&i("salla-button",{shape:"link",onClick:this.handleLogin},Salla.lang.get("pages.checkout.login_to_use_saved_addresses")))}renderMainView(){const t=this.isLoggedIn&&"address"===this.activeTab&&0===this.savedAddresses.length&&!$(this.getStoredIntent()),e="branch"===this.activeTab&&this.supportsPickup?this.renderPickupTab():this.renderDeliveryTab();return i("div",null,this.showCartWillBeClearedBanner&&this.renderAlert(Salla.lang.get("blocks.scope.empty_cart_warning")),this.allocationOutOfCoverageMessage&&this.renderAllocationOutOfCoverageAlert(),e,!t&&this.renderFooter())}handleAfterAddToCart(){if("after_add_to_cart"!==this.openingType)return;const t=this.shouldPromptIncompleteIntentThisSession();this.hasBeenShownThisSession()&&!t||this.modal?.hasAttribute?.("visible")||(t&&this.markIncompleteIntentPrompted(),this.open())}overrideScopeSwitchUI(){const t=this.getStoredIntent(),e=document.querySelector('[onclick*="scopes"]');if(!e)return;if(!t||"address"!==t.type&&"branch"!==t.type)return e.style.display="none",void(e.onclick=()=>this.open());const i=(t,e)=>t&&t.length>e?`${t.slice(0,e)}...`:t??"",s="branch"===t.type?`${Salla.lang.get("mobile_app.strings.pickup")} ${Salla.lang.get("common.elements.from")} ${i(t.branch_details?.name,20)}`:`${Salla.lang.get("mobile_app.strings.delivery")} ${Salla.lang.get("common.elements.to")} ${i(t.address_details?.city?.name,10)}`;e.style.display="inline-flex",e.onclick=()=>this.open();const r=e.querySelector('span:not([class*="sicon"]):not([class*="icon"])');if(r)r.textContent=s;else{const t=Array.from(e.childNodes).find((t=>t.nodeType===Node.TEXT_NODE&&t.textContent?.trim()));t&&(t.textContent=` ${s}`)}}async componentWillLoad(){await Salla.onReady();try{this.overrideScopeSwitchUI(),this.cartSubmittingHandler=async()=>{this.isEnabled&&(this.pendingCartSubmitPromise?await this.pendingCartSubmitPromise:this.hasCompleteIntentForLoggedInUser()||(this.cartSubmitConfirmationPending=!0,this.pendingCartSubmitPromise=new Promise((t=>{if(this.pendingCartSubmitResolver=t,this.isGuestUser())return Salla.auth.setCanRedirect(!1),void Salla.event.dispatch("login::open",{withoutReload:!0,source:"cart-submit"});this.open()})),await this.pendingCartSubmitPromise))},Salla.cart.event.onSubmitting(this.cartSubmittingHandler)}catch(t){console.warn("SallaBulletDelivery: overrideScopeSwitchUI failed",t)}Salla.event.on("salla::bullet-delivery.modal.open.requested",this.bulletDeliveryOpenHandler),this.closeHandler=this.close.bind(this),Salla.event.on("salla::bullet-delivery.modal.close.requested",this.closeHandler),this.isRTL=Salla.config.get("theme.is_rtl"),this.authLoggedInHandler=()=>{if(this.cartSubmitConfirmationPending)return Salla.event.dispatch("login::close"),this.hasCompleteIntentForLoggedInUser()?void this.resolvePendingCartSubmit():void(this.modal?.hasAttribute?.("visible")||this.open());this.hasIncompleteUserAddressIntent()&&(this.modal?.hasAttribute?.("visible")||this.open())},Salla.event.on("auth::logged.in",this.authLoggedInHandler),this.authLoggedOutHandler=()=>{this.clearBulletDeliveryStoredData()},Salla.event.on("auth::logged.out",this.authLoggedOutHandler),this.loginClosedHandler=()=>{this.cartSubmitConfirmationPending&&this.isGuestUser()&&(this.hasCompleteIntentForLoggedInUser()||this.resolvePendingCartSubmit())},Salla.event.on("salla-login::closed",this.loginClosedHandler),this.cartItemAddedHandler=()=>this.handleAfterAddToCart(),"function"==typeof Salla.cart?.event?.onItemAdded?(this.useCartEventApi=!0,Salla.cart.event.onItemAdded(this.cartItemAddedHandler)):Salla.event.on(this.cartItemAddedEvent,this.cartItemAddedHandler)}render(){return this.isMobileApp||!this.isEnabled?null:i(s,{class:"s-bullet-delivery"},i("salla-modal",{ref:t=>{this.modal=t},isClosable:!this.isRequired&&!this.shouldForceNonClosable(),class:"s-bullet-delivery-modal",width:"sm"},i("div",{class:"s-bullet-delivery-inner"},i("div",{class:"s-bullet-delivery-header"},i("h2",{class:"s-bullet-delivery-title"},"address"===this.activeTab?Salla.lang.get("blocks.home.add_address_for_order_delivery"):Salla.lang.get("blocks.home.choose_branch_for_order_pickup")),i("p",{class:"s-bullet-delivery-subtitle"},"address"===this.activeTab?Salla.lang.get("blocks.home.products_available_for_delivery_shown_while_shopping"):Salla.lang.get("blocks.home.choose_branch_for_order_pickup_description"))),this.renderTabs(),"main"===this.viewMode&&this.renderMainView(),"add-address"===this.viewMode&&this.renderAddAddressForm())))}componentDidLoad(){if(this.componentReady=!0,this.isMobileApp)return this.isEnabled&&!this.hasBeenShownThisSession()&&Salla.event.dispatch("salla::bullet-delivery.open-sheet"),this.bulletDeliveryMobileSelectHandler=t=>{const e=this.extractMobileSelectPayload(t);e?this.applyMobileBulletDeliverySelection(e):console.warn("SallaBulletDelivery: received empty mobile select payload",t)},void Salla.event.on("salla::bullet-delivery.select",this.bulletDeliveryMobileSelectHandler);if(this.pendingOpen)return this.pendingOpen=!1,void this.open();switch(this.openingType){case"first_visit":this.hasBeenShownThisSession()?this.shouldPromptIncompleteIntentThisSession()&&(this.markIncompleteIntentPrompted(),this.open()):this.open();break;case"on_cart_click":Salla.url.is_page("cart")&&(!0===this.getShownStorage().get(this.sessionShownKey)?this.shouldPromptIncompleteIntentThisSession()&&(this.markIncompleteIntentPrompted(),this.open()):this.open())}const t=this.createCartViewElement();t&&"function"==typeof salla?.hooks?.mount&&Salla.hooks.mount("cart:items.start",t).catch((()=>{}))}disconnectedCallback(){this.componentReady=!1,Salla.event.off("salla::bullet-delivery.modal.open.requested",this.bulletDeliveryOpenHandler),this.closeHandler&&(Salla.event.off("salla::bullet-delivery.modal.close.requested",this.closeHandler),this.closeHandler=null),this.cartItemAddedHandler&&(this.useCartEventApi&&"function"==typeof Salla.cart?.event?.offItemAdded?Salla.cart.event.offItemAdded(this.cartItemAddedHandler):Salla.event.off(this.cartItemAddedEvent,this.cartItemAddedHandler),this.cartItemAddedHandler=null),this.cartSubmittingHandler&&("function"==typeof Salla.cart?.event?.offSubmitting?Salla.cart.event.offSubmitting(this.cartSubmittingHandler):Salla.event.off("cart::submitting",this.cartSubmittingHandler),this.cartSubmittingHandler=null),this.authLoggedInHandler&&(Salla.event.off("auth::logged.in",this.authLoggedInHandler),this.authLoggedInHandler=null),this.authLoggedOutHandler&&(Salla.event.off("auth::logged.out",this.authLoggedOutHandler),this.authLoggedOutHandler=null),this.loginClosedHandler&&(Salla.event.off("salla-login::closed",this.loginClosedHandler),this.loginClosedHandler=null),this.bulletDeliveryMobileSelectHandler&&(Salla.event.off("salla::bullet-delivery.select",this.bulletDeliveryMobileSelectHandler),this.bulletDeliveryMobileSelectHandler=null)}};As.INITIAL_ADDRESS_FORM={country_id:0,is_default:!1,city_id:void 0,district_id:void 0,street:void 0,building_number:void 0,additional_number:void 0,postal_code:void 0,description:void 0},As.DROPDOWN_SEARCH_DEBOUNCE_MS=400,As.DROPDOWN_SEARCH_MIN_CHARS=2,As.style='/*!twlt*/@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)}}.s-bullet-delivery .s-bullet-delivery-modal .s-modal-body:has(.s-searchable-dropdown--open){overflow:visible !important}.first-letter-cap::first-letter{text-transform:uppercase}.s-bullet-delivery-map-container{width:100%;height:450px;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;padding:0 24px}.s-bullet-delivery-address-confirm-card{display:flex;align-items:flex-start;gap:12px}.s-bullet-delivery-address-confirm-edit{border:1px solid #eee;border-radius:8px;padding:6px 12px;font-size:12px;font-weight:500;line-height:1;color:#333;background:white;cursor:pointer;white-space:nowrap;height:32px;flex-shrink:0;align-self:center;display:inline-flex;align-items:center;justify-content:center}.s-bullet-delivery-address-confirm-details{display:flex;flex-direction:column;align-items:flex-start;gap:4px;flex:1;min-width:0}.s-bullet-delivery-address-confirm-label{font-size:12px;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-tag{display:inline-flex;align-items:center;gap:4px;border:1px solid #eee;border-radius:140px;padding:4px 8px;font-size:12px;color:#333;margin-top:4px}.s-bullet-delivery-address-confirm-tag-icon{width:9px;display:inline-flex;flex-shrink:0}.s-bullet-delivery-address-confirm-tag-icon svg{width:100%;height:100%}.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}.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}.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}.gap-\\[2px\\]{gap:2px}.text-start{text-align:start}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.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)}.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}}.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-allocation-out-of-coverage-icon svg{height:1.25rem;width:1.25rem}.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{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{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:1.5rem;width:1.5rem;fill:currentColor}.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}';const zs=class{constructor(i){t(this,i),this.itemSelected=e(this,"itemSelected"),this.searchInput=e(this,"searchInput"),this.dropdownOpened=e(this,"dropdownOpened"),this.dropdownClosed=e(this,"dropdownClosed"),this.placeholder="",this.items=[],this.selectedItem=null,this.loading=!1,this.searching=!1,this.disabled=!1,this.required=!1,this.noResultsText="",this.inputId="",this.searchQuery="",this.clientSearch=!1,this.dropUp=!1,this.searchable=!0,this.keepParentScroll=!1,this.isOpen=!1,this.focusedIndex=-1,this.clientSearchQuery="",this.scrollableAncestor=null,this.handleTriggerClick=()=>{this.isOpen?this.close():this.open()},this.handleTriggerKeyDown=t=>{this.isOpen?this.navigateItems(t):"Enter"===t.key||" "===t.key||"ArrowDown"===t.key?(t.preventDefault(),this.open()):"Escape"===t.key&&this.close()},this.handleSearchInputChange=t=>{const e=t.target.value;this.clientSearch&&(this.clientSearchQuery=e),this.searchInput.emit(e),this.focusedIndex=-1},this.handleSearchKeyDown=t=>{this.navigateItems(t)}}connectedCallback(){this.boundHandleClickOutside=this.handleClickOutside.bind(this),document.addEventListener("mousedown",this.boundHandleClickOutside)}disconnectedCallback(){document.removeEventListener("mousedown",this.boundHandleClickOutside),this.scrollableAncestor&&(this.scrollableAncestor.style.overflow="",this.scrollableAncestor=null)}onItemsChange(){this.focusedIndex=-1}normalizeArabic(t){return t.replace(/[أإآا]/g,"ا")}get filteredItems(){if(!this.clientSearch||!this.clientSearchQuery.trim())return this.items;const t=this.normalizeArabic(this.clientSearchQuery.trim().toLowerCase());return this.items.filter((e=>{const i=this.normalizeArabic(e.name.toLowerCase()),s=e.name_en?e.name_en.toLowerCase():"";return i.includes(t)||s.includes(t)}))}getDisplayName(t){const e=salla?.config?.get("user.language_code");return e&&"ar"!==e&&t.name_en?.trim()?t.name_en.trim():t.name}handleClickOutside(t){this.isOpen&&(this.host.contains(t.target)||this.close())}findScrollableAncestor(){let t=this.host.parentElement;for(;t;){const e=getComputedStyle(t),i=e.overflowY;if("auto"===i||"scroll"===i||"hidden"===i||"clip"===e.overflow)return t;t=t.parentElement}return null}open(){this.disabled||this.loading||(this.isOpen=!0,this.focusedIndex=-1,this.keepParentScroll||(this.scrollableAncestor=this.findScrollableAncestor(),this.scrollableAncestor&&(this.scrollableAncestor.style.overflow="visible")),this.dropdownOpened.emit(),requestAnimationFrame((()=>this.searchInputRef?.focus())))}close(){this.isOpen&&(this.isOpen=!1,this.focusedIndex=-1,this.clientSearchQuery="",this.scrollableAncestor&&(this.scrollableAncestor.style.overflow="",this.scrollableAncestor=null),this.dropdownClosed.emit())}navigateItems(t){const e=this.filteredItems,i=e.length;switch(t.key){case"ArrowDown":t.preventDefault(),this.focusedIndex=i>0?(this.focusedIndex+1)%i:-1,this.scrollFocusedIntoView();break;case"ArrowUp":t.preventDefault(),this.focusedIndex=i>0?(this.focusedIndex-1+i)%i:-1,this.scrollFocusedIntoView();break;case"Enter":t.preventDefault(),this.focusedIndex>=0&&this.focusedIndex<i&&this.selectItem(e[this.focusedIndex]);break;case"Escape":t.preventDefault(),this.close()}}scrollFocusedIntoView(){this.focusedIndex<0||requestAnimationFrame((()=>{const t=this.panelRef?.querySelector(".s-searchable-dropdown-list"),e=t?.children[this.focusedIndex];e?.scrollIntoView({block:"nearest"})}))}selectItem(t){this.itemSelected.emit(t),this.close()}render(){const t=null!=this.selectedItem,e=`${this.inputId}-listbox`;return i(s,{key:"813e07447e4b3c51180345a38e82ffe135b6aec0",class:"s-searchable-dropdown"},i("div",{key:"34eb275b53d173015a68bd2eeb93f1621eae47d1",class:{"s-searchable-dropdown":!0,"s-searchable-dropdown--open":this.isOpen}},this.label&&i("label",{key:"3659b3ca3a882ea94656c37d2862cf2ebd0a6690",class:"s-searchable-dropdown-label",htmlFor:this.inputId},this.label,this.required&&i("span",{key:"9bbce65147d41fad44282ad04c0707b34ee12526",class:"s-searchable-dropdown-required"}," *")),i("div",{key:"177b983bf879eae9a4d191226c480cbb3abe21c1",class:{"s-searchable-dropdown-trigger":!0,"s-searchable-dropdown-trigger--disabled":this.disabled||this.loading,"s-searchable-dropdown-trigger--open":this.isOpen},role:"combobox","aria-expanded":this.isOpen?"true":"false","aria-haspopup":"listbox","aria-controls":e,"aria-disabled":this.disabled||this.loading?"true":"false",tabIndex:this.disabled||this.loading?-1:0,onClick:this.handleTriggerClick,onKeyDown:this.handleTriggerKeyDown},t?i("span",{class:"s-searchable-dropdown-trigger-text"},this.getDisplayName(this.selectedItem)):i("span",{class:"s-searchable-dropdown-trigger-placeholder"},this.placeholder),i("i",{key:"7887cee514ce9220a5974816700e7519c201183b",class:{"sicon-keyboard_arrow_down":!0,"s-searchable-dropdown-trigger-icon":!0,"s-searchable-dropdown-trigger-icon--open":this.isOpen},"aria-hidden":"true"})),this.isOpen&&i("div",{key:"cbca93a72a5ec382903844c60f8fef8e77d46d92",class:{"s-searchable-dropdown-panel":!0,"s-searchable-dropdown-panel--up":this.dropUp},ref:t=>this.panelRef=t},this.searchable&&i("div",{key:"06f901a77c0ac9e2bfcfaa2823df51370163925c",class:"s-searchable-dropdown-search-wrap"},i("i",{key:"5bc57c4e8022f53d1c7b64cde61fdc386c94bd65",class:"sicon-search s-searchable-dropdown-search-icon","aria-hidden":"true"}),i("input",{key:"b6a3db42d1785326c4be15c58f3d37c34d221f9e",ref:t=>this.searchInputRef=t,id:this.inputId,type:"text",class:"s-searchable-dropdown-search-input",placeholder:this.placeholder,value:this.clientSearch?this.clientSearchQuery:this.searchQuery,onInput:this.handleSearchInputChange,onKeyDown:this.handleSearchKeyDown,autocomplete:"off","aria-autocomplete":"list","aria-expanded":this.isOpen?"true":"false","aria-controls":e})),i("div",{key:"aac10f08cd4ed51829f254990d11c103861f0984",id:e,class:"s-searchable-dropdown-list s-scrollbar",role:"listbox"},this.renderListContent()))))}renderListContent(){if(this.searching||this.loading)return i("div",{class:"s-searchable-dropdown-loading"},i("svg",{class:"s-searchable-dropdown-spinner",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round",opacity:"0.25"}),i("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round"})));const t=this.filteredItems;return 0===t.length?i("div",{class:"s-searchable-dropdown-empty"},this.noResultsText||salla?.lang?.get("common.elements.no_options")||"No results found"):t.map(((t,e)=>{const s=this.selectedItem?.id===t.id;return i("button",{key:t.id,type:"button",role:"option",class:{"s-searchable-dropdown-item":!0,"s-searchable-dropdown-item--selected":s,"s-searchable-dropdown-item--focused":this.focusedIndex===e&&!s},"aria-selected":s?"true":"false",onClick:()=>this.selectItem(t)},i("span",{class:{"s-searchable-dropdown-item-name":!0,"s-searchable-dropdown-item-name--selected":s}},this.getDisplayName(t)),s&&i("i",{class:"sicon-check s-searchable-dropdown-item-check","aria-hidden":"true"}))}))}get host(){return r(this)}static get watchers(){return{items:["onItemsChange"]}}};zs.style="/*!twlt*/.s-searchable-dropdown{position:relative}.s-searchable-dropdown--open{z-index:9999}.s-searchable-dropdown-label{display:block;font-size:14px;font-weight:500;color:var(--color-text-primary, #374151);margin-bottom:8px}.s-searchable-dropdown-required{color:var(--color-danger, #ef4444)}.s-searchable-dropdown-trigger{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:40px;padding:8px 12px;font-size:14px;text-align:start;background:var(--color-surface, #fff);border:1px solid var(--color-border, #e5e7eb);border-radius:6px;cursor:pointer;transition:border-color 0.15s ease, box-shadow 0.15s ease}.s-searchable-dropdown-trigger:hover:not(.s-searchable-dropdown-trigger--disabled){border-color:var(--color-border-hover, #d1d5db)}.s-searchable-dropdown-trigger:focus{outline:none;border-color:var(--color-primary, #00897b);box-shadow:0 0 0 1px var(--color-primary, #00897b)}.s-searchable-dropdown-trigger--disabled{opacity:0.5;cursor:not-allowed;background:var(--color-surface-disabled, #f9fafb)}.s-searchable-dropdown-trigger--open{border-color:var(--color-primary, #00897b);box-shadow:0 0 0 1px var(--color-primary, #00897b)}.s-searchable-dropdown-trigger-text{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-primary, #111827)}.s-searchable-dropdown-trigger-placeholder{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-secondary, #9ca3af)}.s-searchable-dropdown-trigger-icon{flex-shrink:0;color:var(--color-text-secondary, #9ca3af);font-size:18px;transition:transform 0.2s ease;margin-inline-start:8px}.s-searchable-dropdown-trigger-icon--open{transform:rotate(180deg)}.s-searchable-dropdown-panel{position:absolute;z-index:9999;width:100%;margin-top:4px;background:var(--color-surface, #fff);border:1px solid var(--color-border, #e5e7eb);border-radius:8px;box-shadow:0 8px 24px rgba(0, 0, 0, 0.12);overflow:hidden;animation:s-searchable-dropdown-in 0.15s ease}.s-searchable-dropdown-panel--up{bottom:60%}@keyframes s-searchable-dropdown-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.s-searchable-dropdown-search-wrap{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid var(--color-border, #f3f4f6)}.s-searchable-dropdown-search-icon{flex-shrink:0;color:var(--color-text-secondary, #9ca3af);font-size:16px}.s-searchable-dropdown-search-input{flex:1;min-width:0;border:none;outline:none;background:transparent;font-size:14px;color:var(--color-text-primary, #111827);box-shadow:none}.s-searchable-dropdown-search-input::placeholder{color:var(--color-text-secondary, #9ca3af)}.s-searchable-dropdown-search-input:focus{outline:none;box-shadow:none;border:none}.s-searchable-dropdown-list{max-height:min(40vh, 220px);overflow-y:auto;scrollbar-width:thin}.s-searchable-dropdown-item{display:flex;align-items:center;justify-content:space-between;width:100%;padding:10px 16px;margin:0;gap:8px;font:inherit;font-size:14px;text-align:inherit;color:var(--color-text-primary, #111827);background:transparent;border:none;border-bottom:1px solid var(--color-border-light, #f9fafb);cursor:pointer;transition:background 0.15s ease}.s-searchable-dropdown-item:last-child{border-bottom:none}.s-searchable-dropdown-item:hover{background:var(--color-hover, #f9fafb)}.s-searchable-dropdown-item--selected{background:color-mix(in srgb, var(--color-primary, #00897b) 8%, transparent)}.s-searchable-dropdown-item--focused{background:color-mix(in srgb, var(--color-primary, #165b54) 12%, transparent)}.s-searchable-dropdown-item-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.s-searchable-dropdown-item-name--selected{color:var(--color-primary, #00897b);font-weight:500}.s-searchable-dropdown-item-check{flex-shrink:0;color:var(--color-primary, #00897b);font-size:14px;margin-inline-start:8px}.s-searchable-dropdown-empty{display:flex;align-items:center;justify-content:center;padding:24px 16px;font-size:14px;color:var(--color-text-secondary, #9ca3af)}.s-searchable-dropdown-loading{display:flex;align-items:center;justify-content:center;padding:24px 16px;color:var(--color-text-secondary, #9ca3af)}.s-searchable-dropdown-spinner{width:20px;height:20px;animation:s-searchable-dropdown-spin 0.8s linear infinite}@keyframes s-searchable-dropdown-spin{to{transform:rotate(360deg)}}.visible{visibility:visible}.block{display:block}.hidden{display:none}.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)}.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)}.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:has(.s-searchable-dropdown--open){overflow:visible !important}.s-searchable-dropdown{position:relative}.s-searchable-dropdown--open{z-index:9999}.s-searchable-dropdown-label{margin-bottom:0.5rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:500;color:var(--color-text-primary,#374151)}.s-searchable-dropdown-required{color:var(--color-danger,#ef4444)}.s-searchable-dropdown-trigger{display:flex;min-height:40px;width:100%;cursor:pointer;align-items:center;justify-content:space-between;border-radius:0.375rem;border-width:1px;border-color:var(--color-border,#e5e7eb);background-color:var(--color-surface,#fff);padding-left:0.75rem;padding-right:0.75rem;padding-top:0.5rem;padding-bottom:0.5rem;text-align:start;font-size:0.875rem;line-height:1.25rem;transition-property:border-color,box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-searchable-dropdown-trigger:hover{border-color:var(--color-border-hover,#d1d5db)}.s-searchable-dropdown-trigger:focus{border-color:var(--color-primary);--tw-shadow:0 0 0 1px var(--color-primary,#00897b);--tw-shadow-colored:0 0 0 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:2px solid transparent;outline-offset:2px}.s-searchable-dropdown-trigger--disabled{cursor:not-allowed;background-color:var(--color-surface-disabled,#f9fafb);opacity:0.5}.s-searchable-dropdown-trigger--open{border-color:var(--color-primary) !important;--tw-shadow:0 0 0 1px var(--color-primary,#00897b);--tw-shadow-colored:0 0 0 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)}.s-searchable-dropdown-trigger-text{flex:1 1 0%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-primary,#111827)}.s-searchable-dropdown-trigger-placeholder{flex:1 1 0%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-trigger-icon{margin-inline-start:0.5rem;flex-shrink:0;font-size:1.125rem;line-height:1.75rem;color:var(--color-text-secondary,#9ca3af);transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-searchable-dropdown-trigger-icon--open{--tw-rotate:180deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-searchable-dropdown-panel{position:absolute;z-index:9999;margin-top:0.25rem;width:100%;overflow:hidden;border-radius:0.5rem;border-width:1px;border-color:var(--color-border,#e5e7eb);background-color:var(--color-surface,#fff);--tw-shadow:0 8px 24px rgba(0,0,0,0.12);--tw-shadow-colored:0 8px 24px 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-searchable-dropdown-panel--up{bottom:60%}.s-searchable-dropdown-search-wrap{display:flex;align-items:center;gap:0.5rem;border-bottom-width:1px;border-bottom-color:var(--color-border,#f3f4f6);padding-left:0.75rem;padding-right:0.75rem;padding-top:0.5rem;padding-bottom:0.5rem}.s-searchable-dropdown-search-icon{flex-shrink:0;font-size:1rem;line-height:1.5rem;color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-search-input{min-width:0px;flex:1 1 0%;border-width:0px;background-color:transparent;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-primary,#111827);--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);outline:2px solid transparent;outline-offset:2px}.s-searchable-dropdown-search-input::placeholder{color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-search-input:focus{border-width:0px;--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);outline:2px solid transparent;outline-offset:2px;--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(0px + 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)}.s-searchable-dropdown-list{max-height:min(40vh, 220px);overflow-y:auto;scrollbar-width:thin}.s-searchable-dropdown-item{margin:0px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:space-between;gap:0.5rem;border-width:0px;border-bottom-width:1px;border-bottom-color:var(--color-border-light,#f9fafb);background-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.625rem;padding-bottom:0.625rem;font-family:inherit;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-primary,#111827);transition-property:background;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;text-align:inherit}.s-searchable-dropdown-item:last-child{border-bottom-width:0px}.s-searchable-dropdown-item--selected{background-color:color-mix(in srgb,var(--color-primary,#00897b) 8%,transparent)}.s-searchable-dropdown-item-name{flex:1 1 0%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.s-searchable-dropdown-item-name--selected{font-weight:500;color:var(--color-primary)}.s-searchable-dropdown-item-check{margin-inline-start:0.5rem;flex-shrink:0;font-size:0.875rem;line-height:1.25rem;color:var(--color-primary)}.s-searchable-dropdown-empty{display:flex;align-items:center;justify-content:center;padding-left:1rem;padding-right:1rem;padding-top:1.5rem;padding-bottom:1.5rem;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-loading{display:flex;align-items:center;justify-content:center;padding-left:1rem;padding-right:1rem;padding-top:1.5rem;padding-bottom:1.5rem;color:var(--color-text-secondary,#9ca3af)}.s-searchable-dropdown-spinner{height:1.25rem;width:1.25rem}@keyframes spin{to{transform:rotate(360deg)}}.s-searchable-dropdown-spinner{animation:spin 0.8s linear infinite}";export{As as salla_bullet_delivery,zs as salla_searchable_dropdown}
|