@salla.sa/twilight-components 2.14.573 → 2.14.575

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.
Files changed (389) hide show
  1. package/dist/cjs/{Helper-N5wrs9vm.js → Helper-8U7zlpC3.js} +171 -117
  2. package/dist/cjs/{filepond-B2iMbV1F.js → filepond-NMq4bM2q.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-poster-rXYiM_Ob.js → filepond-plugin-file-poster-TEelNjjG.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-size-BF5dedmz.js → filepond-plugin-file-validate-size-DRVxzFUc.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-type-DJHYRny2.js → filepond-plugin-file-validate-type-75J1mHEB.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-edit-BgtH5f4u.js → filepond-plugin-image-edit-CvC-CZjk.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-C9JH8EBn.js → filepond-plugin-image-exif-orientation-D7mJeHKx.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-CpSCiqfj.js → filepond-plugin-image-preview-QxURSuZ4.js} +1 -1
  9. package/dist/cjs/heart-ClVn_Co8.js +13 -0
  10. package/dist/cjs/{index-DpXwHFVO.js → index-Bt8A6pnr.js} +14 -10
  11. package/dist/cjs/index-CIbBkRPw.js +4413 -0
  12. package/dist/cjs/{intlTelInput-CdZOfaWd.js → intlTelInput-Dq8y3YHO.js} +1 -1
  13. package/dist/cjs/loader.cjs.js +2 -2
  14. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
  16. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +2 -2
  17. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-applied-filters.cjs.entry.js +2 -2
  21. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
  23. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +9 -4403
  26. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +2 -2
  28. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-comment-form_9.cjs.entry.js +2 -2
  32. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-filters-widget.cjs.entry.js +2 -2
  40. package/dist/cjs/salla-filters.cjs.entry.js +2 -2
  41. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-gift-card-redeem.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
  46. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
  65. package/dist/cjs/salla-offer-modal.cjs.entry.js +30 -4
  66. package/dist/cjs/salla-offer.cjs.entry.js +116 -24
  67. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-orders.cjs.entry.js +2 -2
  80. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-product-card.cjs.entry.js +5 -11
  85. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-products-list.cjs.entry.js +2 -2
  87. package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
  88. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +5 -6
  90. package/dist/cjs/salla-rating-modal.cjs.entry.js +5 -6
  91. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-user-menu.cjs.entry.js +3 -3
  104. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  105. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  106. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  107. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  108. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  109. package/dist/cjs/salla-wishlist-summary.cjs.entry.js +48 -0
  110. package/dist/cjs/{shipping-fast-CsqEQE78.js → star-tn5w5Um0.js} +8 -0
  111. package/dist/cjs/translate-BeU1QX_r.js +20 -0
  112. package/dist/cjs/twilight.cjs.js +2 -2
  113. package/dist/cjs/{vanilla-picker-BT9OjZCy.js → vanilla-picker-BkJyQVMl.js} +1 -1
  114. package/dist/collection/Helpers/Helper.js +171 -117
  115. package/dist/collection/Helpers/translate.js +16 -0
  116. package/dist/collection/collection-manifest.json +2 -1
  117. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +8 -4
  118. package/dist/collection/components/salla-cart-summary/salla-cart-summary.css +1 -1
  119. package/dist/collection/components/salla-offer/salla-offer.css +86 -0
  120. package/dist/collection/components/salla-offer/salla-offer.js +119 -22
  121. package/dist/collection/components/salla-offer-modal/salla-offer-modal.css +32 -0
  122. package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +28 -2
  123. package/dist/collection/components/salla-user-menu/salla-user-menu.js +1 -1
  124. package/dist/collection/components/salla-wishlist-summary/salla-wishlist-summary.css +62 -0
  125. package/dist/collection/components/salla-wishlist-summary/salla-wishlist-summary.js +65 -0
  126. package/dist/components/Helper.js +171 -117
  127. package/dist/components/heart.js +11 -0
  128. package/dist/components/index.js +2 -2
  129. package/dist/components/index2.js +4322 -2471
  130. package/dist/components/index3.js +2553 -0
  131. package/dist/components/salla-bullet-delivery.js +44 -4438
  132. package/dist/components/salla-cart-summary.js +1 -1
  133. package/dist/components/salla-datetime-picker2.js +1 -1
  134. package/dist/components/salla-offer-modal.js +29 -3
  135. package/dist/components/salla-offer.js +120 -23
  136. package/dist/components/salla-product-card2.js +4 -10
  137. package/dist/components/salla-rating-modal-v2.js +1 -1
  138. package/dist/components/salla-rating-modal-v22.js +9 -3
  139. package/dist/components/salla-rating-modal2.js +2 -3
  140. package/dist/components/salla-user-menu.js +2 -2
  141. package/dist/components/salla-wishlist-summary.d.ts +11 -0
  142. package/dist/components/salla-wishlist-summary.js +67 -0
  143. package/dist/components/translate.js +18 -0
  144. package/dist/esm/{Helper-Cql-WbqR.js → Helper-ivBHT_nn.js} +171 -117
  145. package/dist/esm/{filepond-BsuscqtG.js → filepond-kmpJTY5p.js} +1 -1
  146. package/dist/esm/{filepond-plugin-file-poster-DZ4ckjsP.js → filepond-plugin-file-poster-8M0TsTUo.js} +1 -1
  147. package/dist/esm/{filepond-plugin-file-validate-size-BV6807xx.js → filepond-plugin-file-validate-size-CPVDzrMj.js} +1 -1
  148. package/dist/esm/{filepond-plugin-file-validate-type-cWCM2RqT.js → filepond-plugin-file-validate-type-D0qUdWNB.js} +1 -1
  149. package/dist/esm/{filepond-plugin-image-edit-aQvaKLxK.js → filepond-plugin-image-edit-K8nFORG9.js} +1 -1
  150. package/dist/esm/{filepond-plugin-image-exif-orientation-FgW7hBXK.js → filepond-plugin-image-exif-orientation-BSvnwKAw.js} +1 -1
  151. package/dist/esm/{filepond-plugin-image-preview-DxogdDqd.js → filepond-plugin-image-preview-hArDoD8N.js} +1 -1
  152. package/dist/esm/heart-00vBRoH3.js +11 -0
  153. package/dist/esm/{index-DSEA3vdh.js → index-a6lSRQK4.js} +14 -10
  154. package/dist/esm/index-wXSgmenB.js +4404 -0
  155. package/dist/esm/{intlTelInput-BLEGv9EO.js → intlTelInput-CC5xRRkd.js} +1 -1
  156. package/dist/esm/loader.js +3 -3
  157. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  158. package/dist/esm/salla-accordion_6.entry.js +2 -2
  159. package/dist/esm/salla-add-product-button_5.entry.js +2 -2
  160. package/dist/esm/salla-advertisement.entry.js +1 -1
  161. package/dist/esm/salla-alert_2.entry.js +1 -1
  162. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  163. package/dist/esm/salla-applied-filters.entry.js +2 -2
  164. package/dist/esm/salla-apps-icons.entry.js +1 -1
  165. package/dist/esm/salla-attachment-view_9.entry.js +11 -11
  166. package/dist/esm/salla-badge.entry.js +1 -1
  167. package/dist/esm/salla-basket-gap.entry.js +1 -1
  168. package/dist/esm/salla-bullet-delivery_3.entry.js +53 -4447
  169. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  170. package/dist/esm/salla-cart-item-offers_2.entry.js +2 -2
  171. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  172. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  173. package/dist/esm/salla-comment-factors.entry.js +1 -1
  174. package/dist/esm/salla-comment-form_9.entry.js +2 -2
  175. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  176. package/dist/esm/salla-contacts.entry.js +1 -1
  177. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  178. package/dist/esm/salla-count-down.entry.js +1 -1
  179. package/dist/esm/salla-custom-fields.entry.js +1 -1
  180. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  181. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  182. package/dist/esm/salla-filters-widget.entry.js +2 -2
  183. package/dist/esm/salla-filters.entry.js +2 -2
  184. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  185. package/dist/esm/salla-gift-card-redeem.entry.js +1 -1
  186. package/dist/esm/salla-gifting.entry.js +1 -1
  187. package/dist/esm/salla-hook.entry.js +1 -1
  188. package/dist/esm/salla-infinite-scroll.entry.js +2 -2
  189. package/dist/esm/salla-installment.entry.js +1 -1
  190. package/dist/esm/salla-list-tile.entry.js +1 -1
  191. package/dist/esm/salla-localization-modal.entry.js +1 -1
  192. package/dist/esm/salla-login-modal.entry.js +1 -1
  193. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  194. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  195. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  196. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  197. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  198. package/dist/esm/salla-loyalty.entry.js +1 -1
  199. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  200. package/dist/esm/salla-map_3.entry.js +1 -1
  201. package/dist/esm/salla-menu.entry.js +1 -1
  202. package/dist/esm/salla-metadata.entry.js +1 -1
  203. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  204. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  205. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  206. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  207. package/dist/esm/salla-notification-item_2.entry.js +2 -2
  208. package/dist/esm/salla-offer-modal.entry.js +30 -4
  209. package/dist/esm/salla-offer.entry.js +116 -24
  210. package/dist/esm/salla-order-branch.entry.js +1 -1
  211. package/dist/esm/salla-order-cancel.entry.js +1 -1
  212. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  213. package/dist/esm/salla-order-details-options.entry.js +1 -1
  214. package/dist/esm/salla-order-details.entry.js +1 -1
  215. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  216. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  217. package/dist/esm/salla-order-edit.entry.js +1 -1
  218. package/dist/esm/salla-order-options-modal.entry.js +1 -1
  219. package/dist/esm/salla-order-shipments.entry.js +1 -1
  220. package/dist/esm/salla-order-summary.entry.js +1 -1
  221. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  222. package/dist/esm/salla-orders.entry.js +2 -2
  223. package/dist/esm/salla-payments.entry.js +1 -1
  224. package/dist/esm/salla-placeholder.entry.js +1 -1
  225. package/dist/esm/salla-price-range.entry.js +1 -1
  226. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  227. package/dist/esm/salla-product-card.entry.js +2 -8
  228. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  229. package/dist/esm/salla-products-list.entry.js +2 -2
  230. package/dist/esm/salla-products-slider.entry.js +2 -2
  231. package/dist/esm/salla-quick-order.entry.js +1 -1
  232. package/dist/esm/salla-rating-modal-v2.entry.js +3 -4
  233. package/dist/esm/salla-rating-modal.entry.js +3 -4
  234. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  235. package/dist/esm/salla-review-order-item.entry.js +1 -1
  236. package/dist/esm/salla-scopes.entry.js +1 -1
  237. package/dist/esm/salla-search-product-card.entry.js +1 -1
  238. package/dist/esm/salla-search.entry.js +1 -1
  239. package/dist/esm/salla-skeleton.entry.js +1 -1
  240. package/dist/esm/salla-social-share.entry.js +1 -1
  241. package/dist/esm/salla-social.entry.js +1 -1
  242. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  243. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  244. package/dist/esm/salla-tooltip.entry.js +1 -1
  245. package/dist/esm/salla-trust-badges.entry.js +1 -1
  246. package/dist/esm/salla-user-menu.entry.js +5 -5
  247. package/dist/esm/salla-user-profile.entry.js +1 -1
  248. package/dist/esm/salla-user-settings.entry.js +1 -1
  249. package/dist/esm/salla-verify.entry.js +1 -1
  250. package/dist/esm/salla-wallet.entry.js +1 -1
  251. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  252. package/dist/esm/salla-wishlist-summary.entry.js +46 -0
  253. package/dist/esm/{shipping-fast-lMgMt31Q.js → star-cq6TcfoH.js} +8 -1
  254. package/dist/esm/translate-CrSV-tno.js +18 -0
  255. package/dist/esm/twilight.js +3 -3
  256. package/dist/esm/{vanilla-picker-BpgJFvog.js → vanilla-picker-CDhGfTst.js} +1 -1
  257. package/dist/twilight/{p-901a961f.entry.js → p-004584f5.entry.js} +1 -1
  258. package/dist/twilight/{p-77dc1637.entry.js → p-00e68964.entry.js} +1 -1
  259. package/dist/twilight/p-00vBRoH3.js +4 -0
  260. package/dist/twilight/{p-4a3701ca.entry.js → p-01cae03e.entry.js} +1 -1
  261. package/dist/twilight/{p-db53fade.entry.js → p-0a38d353.entry.js} +1 -1
  262. package/dist/twilight/{p-7e0698c6.entry.js → p-0f1981ee.entry.js} +1 -1
  263. package/dist/twilight/p-0f9bfeeb.entry.js +4 -0
  264. package/dist/twilight/{p-82455313.entry.js → p-109472c5.entry.js} +1 -1
  265. package/dist/twilight/{p-2304f0a4.entry.js → p-10968d1c.entry.js} +1 -1
  266. package/dist/twilight/{p-ec341307.entry.js → p-127f0000.entry.js} +1 -1
  267. package/dist/twilight/{p-f173ada5.entry.js → p-12ab7c1a.entry.js} +1 -1
  268. package/dist/twilight/{p-4a447633.entry.js → p-21e6b2e7.entry.js} +1 -1
  269. package/dist/twilight/{p-c15d08ae.entry.js → p-24bd13b8.entry.js} +1 -1
  270. package/dist/twilight/{p-663aa63b.entry.js → p-2541db96.entry.js} +1 -1
  271. package/dist/twilight/{p-dd3aacf3.entry.js → p-254e6e0c.entry.js} +1 -1
  272. package/dist/twilight/{p-5d0fd545.entry.js → p-2591eead.entry.js} +1 -1
  273. package/dist/twilight/{p-3c5e2710.entry.js → p-25a4633f.entry.js} +1 -1
  274. package/dist/twilight/{p-9fe36a97.entry.js → p-28875055.entry.js} +1 -1
  275. package/dist/twilight/{p-6fb16543.entry.js → p-2af75479.entry.js} +1 -1
  276. package/dist/twilight/{p-bbb72d38.entry.js → p-2af98444.entry.js} +1 -1
  277. package/dist/twilight/{p-5d97cf2d.entry.js → p-2bf8f0ed.entry.js} +1 -1
  278. package/dist/twilight/{p-6a605835.entry.js → p-2c480419.entry.js} +1 -1
  279. package/dist/twilight/{p-4557e342.entry.js → p-312e8678.entry.js} +1 -1
  280. package/dist/twilight/{p-e5bb52fb.entry.js → p-3357d33a.entry.js} +1 -1
  281. package/dist/twilight/p-338f727b.entry.js +4 -0
  282. package/dist/twilight/{p-06419603.entry.js → p-34d33337.entry.js} +1 -1
  283. package/dist/twilight/{p-d9be4036.entry.js → p-3500065c.entry.js} +1 -1
  284. package/dist/twilight/{p-3eb55e32.entry.js → p-3a113599.entry.js} +1 -1
  285. package/dist/twilight/{p-ad930532.entry.js → p-3bd153c1.entry.js} +1 -1
  286. package/dist/twilight/{p-d654b4b0.entry.js → p-3ff2b8b6.entry.js} +1 -1
  287. package/dist/twilight/{p-a89fb313.entry.js → p-426acd77.entry.js} +1 -1
  288. package/dist/twilight/{p-6cdc7f8a.entry.js → p-44b8d453.entry.js} +1 -1
  289. package/dist/twilight/{p-6cc3e44d.entry.js → p-45b97699.entry.js} +1 -1
  290. package/dist/twilight/{p-3040407e.entry.js → p-4a60be6d.entry.js} +1 -1
  291. package/dist/twilight/{p-e0b085e4.entry.js → p-4bf58226.entry.js} +1 -1
  292. package/dist/twilight/{p-8ae70528.entry.js → p-50816838.entry.js} +1 -1
  293. package/dist/twilight/{p-51434773.entry.js → p-5134aae8.entry.js} +1 -1
  294. package/dist/twilight/{p-69e8750f.entry.js → p-540138a1.entry.js} +1 -1
  295. package/dist/twilight/{p-1f1dda08.entry.js → p-55e0745e.entry.js} +1 -1
  296. package/dist/twilight/{p-0764c46b.entry.js → p-583a63e5.entry.js} +1 -1
  297. package/dist/twilight/{p-0b514a47.entry.js → p-5b1a0560.entry.js} +1 -1
  298. package/dist/twilight/{p-78ee03f8.entry.js → p-5d72b7d7.entry.js} +1 -1
  299. package/dist/twilight/{p-aadeb35a.entry.js → p-5ddd9aa0.entry.js} +1 -1
  300. package/dist/twilight/{p-f306bfe3.entry.js → p-5fe0908b.entry.js} +1 -1
  301. package/dist/twilight/{p-5b949ccc.entry.js → p-6051a92c.entry.js} +1 -1
  302. package/dist/twilight/p-63a315e1.entry.js +4 -0
  303. package/dist/twilight/{p-47b1aa89.entry.js → p-6958e848.entry.js} +1 -1
  304. package/dist/twilight/{p-3b3a1c87.entry.js → p-69594ced.entry.js} +1 -1
  305. package/dist/twilight/{p-75652fd4.entry.js → p-6a7eacbd.entry.js} +1 -1
  306. package/dist/twilight/{p-d1c973ce.entry.js → p-6f371a84.entry.js} +1 -1
  307. package/dist/twilight/{p-3c665085.entry.js → p-6f741b21.entry.js} +1 -1
  308. package/dist/twilight/p-71ecb477.entry.js +4 -0
  309. package/dist/twilight/{p-360b6388.entry.js → p-742f2c15.entry.js} +1 -1
  310. package/dist/twilight/{p-fac05e8f.entry.js → p-7a19ef45.entry.js} +1 -1
  311. package/dist/twilight/{p-09e126b0.entry.js → p-7b373051.entry.js} +1 -1
  312. package/dist/twilight/{p-6e43f8a7.entry.js → p-7cc8b82b.entry.js} +1 -1
  313. package/dist/twilight/{p-8f2b2e42.entry.js → p-7f69cf5d.entry.js} +1 -1
  314. package/dist/twilight/{p-901217bc.entry.js → p-7f861ac0.entry.js} +1 -1
  315. package/dist/twilight/{p-855a9db7.entry.js → p-81c88f97.entry.js} +1 -1
  316. package/dist/twilight/{p-6be347e5.entry.js → p-8271e127.entry.js} +1 -1
  317. package/dist/twilight/{p-62a44e65.entry.js → p-84599aa5.entry.js} +1 -1
  318. package/dist/twilight/{p-fc6adc90.entry.js → p-86ad5af2.entry.js} +1 -1
  319. package/dist/twilight/p-8d30dbac.entry.js +4 -0
  320. package/dist/twilight/{p-4944d10a.entry.js → p-96cac80e.entry.js} +1 -1
  321. package/dist/twilight/{p-84ec7be7.entry.js → p-977e3e76.entry.js} +1 -1
  322. package/dist/twilight/{p-89ed6dbc.entry.js → p-9b04ed7f.entry.js} +1 -1
  323. package/dist/twilight/{p-7afeb088.entry.js → p-9e53d7a6.entry.js} +1 -1
  324. package/dist/twilight/{p-BF2su8FM.js → p-BG1dHHdm.js} +1 -1
  325. package/dist/twilight/{p-B3sbQMcp.js → p-BokV7EHy.js} +1 -1
  326. package/dist/twilight/{p-Bt0GXtZG.js → p-CSuif4Xw.js} +1 -1
  327. package/dist/twilight/p-CbVZf-Q4.js +4 -0
  328. package/dist/twilight/{p-BZt79QeE.js → p-CfhebjBE.js} +1 -1
  329. package/dist/twilight/p-CrSV-tno.js +4 -0
  330. package/dist/twilight/p-DI6PJLEJ.js +1024 -0
  331. package/dist/twilight/{p-Bj6lP8RV.js → p-DNjWzZsK.js} +1 -1
  332. package/dist/twilight/{p-WgGO2Pjy.js → p-DOF2UkI4.js} +1 -1
  333. package/dist/twilight/{p-VBuS91fQ.js → p-DWPp9ZjN.js} +1 -1
  334. package/dist/twilight/{p-DDcSXlpO.js → p-DZHubgN5.js} +1 -1
  335. package/dist/twilight/{p-1063f3d1.entry.js → p-a0d39b81.entry.js} +1 -1
  336. package/dist/twilight/{p-68aecf40.entry.js → p-a177b13f.entry.js} +1 -1
  337. package/dist/twilight/{p-5c863789.entry.js → p-a391b31d.entry.js} +1 -1
  338. package/dist/twilight/{p-bb2170ac.entry.js → p-a47b910f.entry.js} +1 -1
  339. package/dist/twilight/{p-DSEA3vdh.js → p-a6lSRQK4.js} +2 -2
  340. package/dist/twilight/{p-f919f0b5.entry.js → p-aee0c658.entry.js} +1 -1
  341. package/dist/twilight/{p-54c36ba4.entry.js → p-af99726d.entry.js} +1 -1
  342. package/dist/twilight/{p-e90a201a.entry.js → p-b0c86557.entry.js} +1 -1
  343. package/dist/twilight/{p-1acd987a.entry.js → p-b7624eb6.entry.js} +1 -1
  344. package/dist/twilight/{p-b3063b70.entry.js → p-bc54fc8b.entry.js} +1 -1
  345. package/dist/twilight/{p-e5c07741.entry.js → p-c500e5fe.entry.js} +1 -1
  346. package/dist/twilight/{p-b414760b.entry.js → p-c9779211.entry.js} +1 -1
  347. package/dist/twilight/{p-2c07e8ac.entry.js → p-c9ba30cd.entry.js} +1 -1
  348. package/dist/twilight/{p-5d41dc4e.entry.js → p-cbcbc9f8.entry.js} +1 -1
  349. package/dist/twilight/{p-2733e78f.entry.js → p-cc15290b.entry.js} +1 -1
  350. package/dist/twilight/{p-lMgMt31Q.js → p-cq6TcfoH.js} +1 -1
  351. package/dist/twilight/{p-77323c2a.entry.js → p-d0fce326.entry.js} +1 -1
  352. package/dist/twilight/{p-e676c627.entry.js → p-d1a0bd97.entry.js} +1 -1
  353. package/dist/twilight/{p-457a256d.entry.js → p-d56cb23a.entry.js} +1 -1
  354. package/dist/twilight/{p-66561f9e.entry.js → p-d6803c56.entry.js} +1 -1
  355. package/dist/twilight/{p-bc0f3f06.entry.js → p-d7e5b860.entry.js} +1 -1
  356. package/dist/twilight/{p-276171ac.entry.js → p-dc86737c.entry.js} +1 -1
  357. package/dist/twilight/{p-61580839.entry.js → p-e0b5a06d.entry.js} +1 -1
  358. package/dist/twilight/{p-b1c21e5c.entry.js → p-e155a1a6.entry.js} +1 -1
  359. package/dist/twilight/{p-5329003d.entry.js → p-e9d73e7d.entry.js} +1 -1
  360. package/dist/twilight/p-ea1c06ab.entry.js +4 -0
  361. package/dist/twilight/p-eb11b8be.entry.js +4 -0
  362. package/dist/twilight/{p-909ae4c5.entry.js → p-ebd9a6c2.entry.js} +1 -1
  363. package/dist/twilight/p-ef037207.entry.js +4 -0
  364. package/dist/twilight/{p-c419a909.entry.js → p-f1a3cf9e.entry.js} +1 -1
  365. package/dist/twilight/{p-b6ece925.entry.js → p-f2f6f502.entry.js} +1 -1
  366. package/dist/twilight/{p-6904ad04.entry.js → p-fc13e706.entry.js} +1 -1
  367. package/dist/twilight/{p-DdScDjtA.js → p-wx2L9ZB0.js} +1 -1
  368. package/dist/twilight/twilight.esm.js +1 -1
  369. package/dist/types/Helpers/Helper.d.ts +14 -12
  370. package/dist/types/Helpers/translate.d.ts +10 -0
  371. package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +0 -1
  372. package/dist/types/components/salla-offer/salla-offer.d.ts +42 -1
  373. package/dist/types/components/salla-offer-modal/offer-schema.d.ts +12 -0
  374. package/dist/types/components/salla-offer-modal/salla-offer-modal.d.ts +7 -0
  375. package/dist/types/components/salla-wishlist-summary/salla-wishlist-summary.d.ts +18 -0
  376. package/dist/types/components.d.ts +45 -0
  377. package/package.json +5 -5
  378. package/dist/cjs/star-DMzrN05M.js +0 -13
  379. package/dist/components/star.js +0 -11
  380. package/dist/esm/star-CeFAfcTv.js +0 -11
  381. package/dist/twilight/p-010fa509.entry.js +0 -4
  382. package/dist/twilight/p-035b561c.entry.js +0 -4
  383. package/dist/twilight/p-5a86a794.entry.js +0 -4
  384. package/dist/twilight/p-8ed45c28.entry.js +0 -4
  385. package/dist/twilight/p-CUSw0W26.js +0 -4
  386. package/dist/twilight/p-CeFAfcTv.js +0 -4
  387. package/dist/twilight/p-b98ae2c1.entry.js +0 -4
  388. package/dist/twilight/p-e91bba7e.entry.js +0 -1024
  389. package/dist/twilight/p-f10fca84.entry.js +0 -4
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { proxyCustomElement, HTMLElement as HTMLElement$1, createEvent, h as h$4, Host } from '@stencil/core/internal/client';
4
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
5
5
  import { i as isSaudiArabia, b as bulletDeliveryAPI, r as requireRegionAndDistrictForSA, g as getIntentLatitude, a as getIntentLongitude, h as hasSessionAddressIntent, c as getIntentCityId, d as getIntentCountryId, e as getIntentRegionId, f as getIntentDistrictId, j as filterBranches, k as findNearestBranch, l as getGeolocationErrorMessage, m as buildAddressLocationPayloadFromSelection, n as clearApiCache, o as getIntentSubtitle, p as getIntentBranchId, q as isMapOriginIntent, s as isBranchSelectable, t as getIntentCountryCode } from './helpers.js';
6
6
  import { S as SILocation } from './location.js';
7
7
  import { S as Search } from './search.js';
@@ -12,4406 +12,6 @@ import { d as defineCustomElement$4 } from './salla-placeholder2.js';
12
12
  import { d as defineCustomElement$3 } from './salla-searchable-dropdown2.js';
13
13
  import { d as defineCustomElement$2 } from './salla-skeleton2.js';
14
14
 
15
- /**
16
- * @license
17
- * Copyright 2019 Google LLC
18
- * SPDX-License-Identifier: BSD-3-Clause
19
- */
20
- const t$1=globalThis,e$2=t$1.ShadowRoot&&(void 0===t$1.ShadyCSS||t$1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$3=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$2&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$3.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$3.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new n$3("string"==typeof t?t:t+"",void 0,s$2),i$3=(t,...e)=>{const o=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(true===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.")})(s)+t[o+1],t[0]);return new n$3(o,t,s$2)},S$3=(s,o)=>{if(e$2)s.adoptedStyleSheets=o.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of o){const o=document.createElement("style"),n=t$1.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$3=e$2?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
21
-
22
- /**
23
- * @license
24
- * Copyright 2017 Google LLC
25
- * SPDX-License-Identifier: BSD-3-Clause
26
- */const{is:i$2,defineProperty:e$1,getOwnPropertyDescriptor:h$3,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$2,getPrototypeOf:n$2}=Object,a$1=globalThis,c$2=a$1.trustedTypes,l$2=c$2?c$2.emptyScript:"",p$2=a$1.reactiveElementPolyfillSupport,d$3=(t,s)=>t,u$2={toAttribute(t,s){switch(s){case Boolean:t=t?l$2:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){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}},f$3=(t,s)=>!i$2(t,s),b$3={attribute:true,type:String,converter:u$2,reflect:false,useDefault:false,hasChanged:f$3};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;let y$1 = class y 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,s=b$3){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$1(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$3(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b$3}static _$Ei(){if(this.hasOwnProperty(d$3("elementProperties")))return;const t=n$2(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$3("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$3("properties"))){const t=this.properties,s=[...r$1(t),...o$2(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$3(s));}else void 0!==s&&i.push(c$3(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,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,s=this.constructor.elementProperties;for(const i of s.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 S$3(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach(t=>t.hostConnected?.());}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.());}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$2).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$2;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i,e=false,h){if(void 0!==t){const r=this.constructor;if(false===e&&(h=this[t]),i??=r.getPropertyOptions(t),!((i.hasChanged??f$3)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;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,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM();}updated(t){}firstUpdated(t){}};y$1.elementStyles=[],y$1.shadowRootOptions={mode:"open"},y$1[d$3("elementProperties")]=new Map,y$1[d$3("finalized")]=new Map,p$2?.({ReactiveElement:y$1}),(a$1.reactiveElementVersions??=[]).push("2.1.2");
27
-
28
- /**
29
- * @license
30
- * Copyright 2017 Google LLC
31
- * SPDX-License-Identifier: BSD-3-Clause
32
- */
33
- const t=globalThis,i$1=t=>t,s$1=t.trustedTypes,e=s$1?s$1.createPolicy("lit-html",{createHTML:t=>t}):void 0,h$2="$lit$",o$1=`lit$${Math.random().toFixed(9).slice(2)}$`,n$1="?"+o$1,r=`<${n$1}>`,l$1=document,c$1=()=>l$1.createComment(""),a=t=>null===t||"object"!=typeof t&&"function"!=typeof t,u$1=Array.isArray,d$2=t=>u$1(t)||"function"==typeof t?.[Symbol.iterator],f$2="[ \t\n\f\r]",v$2=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_$2=/-->/g,m=/>/g,p$1=RegExp(`>|${f$2}(?:([^\\s"'>=/]+)(${f$2}*=${f$2}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g$1=/'/g,$$1=/"/g,y=/^(?:script|style|textarea|title)$/i,x$2=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),b$2=x$2(1),E$1=Symbol.for("lit-noChange"),A$2=Symbol.for("lit-nothing"),C$2=new WeakMap,P$2=l$1.createTreeWalker(l$1,129);function V$2(t,i){if(!u$1(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==e?e.createHTML(i):i}const N$1=(t,i)=>{const s=t.length-1,e=[];let n,l=2===i?"<svg>":3===i?"<math>":"",c=v$2;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,f=0;for(;f<s.length&&(c.lastIndex=f,u=c.exec(s),null!==u);)f=c.lastIndex,c===v$2?"!--"===u[1]?c=_$2:void 0!==u[1]?c=m:void 0!==u[2]?(y.test(u[2])&&(n=RegExp("</"+u[2],"g")),c=p$1):void 0!==u[3]&&(c=p$1):c===p$1?">"===u[0]?(c=n??v$2,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?p$1:'"'===u[3]?$$1:g$1):c===$$1||c===g$1?c=p$1:c===_$2||c===m?c=v$2:(c=p$1,n=void 0);const x=c===p$1&&t[i+1].startsWith("/>")?" ":"";l+=c===v$2?s+r:d>=0?(e.push(a),s.slice(0,d)+h$2+s.slice(d)+o$1+x):s+o$1+(-2===d?i:x);}return [V$2(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),e]};let S$2 = class S{constructor({strings:t,_$litType$:i},e){let r;this.parts=[];let l=0,a=0;const u=t.length-1,d=this.parts,[f,v]=N$1(t,i);if(this.el=S.createElement(f,e),P$2.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=P$2.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(h$2)){const i=v[a++],s=r.getAttribute(t).split(o$1),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:l,name:e[2],strings:s,ctor:"."===e[1]?I$2:"?"===e[1]?L$2:"@"===e[1]?z$2:H$1}),r.removeAttribute(t);}else t.startsWith(o$1)&&(d.push({type:6,index:l}),r.removeAttribute(t));if(y.test(r.tagName)){const t=r.textContent.split(o$1),i=t.length-1;if(i>0){r.textContent=s$1?s$1.emptyScript:"";for(let s=0;s<i;s++)r.append(t[s],c$1()),P$2.nextNode(),d.push({type:2,index:++l});r.append(t[i],c$1());}}}else if(8===r.nodeType)if(r.data===n$1)d.push({type:2,index:l});else {let t=-1;for(;-1!==(t=r.data.indexOf(o$1,t+1));)d.push({type:7,index:l}),t+=o$1.length-1;}l++;}}static createElement(t,i){const s=l$1.createElement("template");return s.innerHTML=t,s}};function M$2(t,i,s=t,e){if(i===E$1)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=a(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=M$2(t,h._$AS(t,i.values),h,e)),i}let R$2 = class R{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??l$1).importNode(i,true);P$2.currentNode=e;let h=P$2.nextNode(),o=0,n=0,r=s[0];for(;void 0!==r;){if(o===r.index){let i;2===r.type?i=new k$2(h,h.nextSibling,this,t):1===r.type?i=new r.ctor(h,r.name,r.strings,this,t):6===r.type&&(i=new Z$2(h,this,t)),this._$AV.push(i),r=s[++n];}o!==r?.index&&(h=P$2.nextNode(),o++);}return P$2.currentNode=l$1,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}};let k$2 = class k{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=A$2,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=M$2(this,t,i),a(t)?t===A$2||null==t||""===t?(this._$AH!==A$2&&this._$AR(),this._$AH=A$2):t!==this._$AH&&t!==E$1&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):d$2(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!==A$2&&a(this._$AH)?this._$AA.nextSibling.data=t:this.T(l$1.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=S$2.createElement(V$2(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new R$2(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=C$2.get(t.strings);return void 0===i&&C$2.set(t.strings,i=new S$2(t)),i}k(t){u$1(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new k(this.O(c$1()),this.O(c$1()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(false,true,s);t!==this._$AB;){const s=i$1(t).nextSibling;i$1(t).remove(),t=s;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}};let H$1 = class H{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=A$2,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=A$2;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=M$2(this,t,i,0),o=!a(t)||t!==this._$AH&&t!==E$1,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=M$2(this,e[s+n],i,n),r===E$1&&(r=this._$AH[n]),o||=!a(r)||r!==this._$AH[n],r===A$2?t=A$2:t!==A$2&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===A$2?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}};let I$2 = class I extends H$1{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===A$2?void 0:t;}};let L$2 = class L extends H$1{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==A$2);}};let z$2 = class z extends H$1{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=M$2(this,t,i,0)??A$2)===E$1)return;const s=this._$AH,e=t===A$2&&s!==A$2||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==A$2&&(s===A$2||e);e&&this.element.removeEventListener(this.name,this,s),h&&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);}};let Z$2 = class Z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){M$2(this,t);}};const B$2=t.litHtmlPolyfillSupport;B$2?.(S$2,k$2),(t.litHtmlVersions??=[]).push("3.3.2");const D$2=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new k$2(i.insertBefore(c$1(),t),t,void 0,s??{});}return h._$AI(t),h};
34
-
35
- /**
36
- * @license
37
- * Copyright 2017 Google LLC
38
- * SPDX-License-Identifier: BSD-3-Clause
39
- */const s=globalThis;class i extends y$1{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 r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=D$2(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return E$1}}i._$litElement$=true,i["finalized"]=true,s.litElementHydrateSupport?.({LitElement:i});const o=s.litElementPolyfillSupport;o?.({LitElement:i});(s.litElementVersions??=[]).push("4.2.2");
40
-
41
- const O$1 = globalThis, H = O$1.ShadowRoot && (O$1.ShadyCSS === void 0 || O$1.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, j$1 = /* @__PURE__ */ Symbol(), Z$1 = /* @__PURE__ */ new WeakMap();
42
- let de = class {
43
- constructor(e, i, r) {
44
- if (this._$cssResult$ = true, r !== j$1) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
45
- this.cssText = e, this.t = i;
46
- }
47
- get styleSheet() {
48
- let e = this.o;
49
- const i = this.t;
50
- if (H && e === void 0) {
51
- const r = i !== void 0 && i.length === 1;
52
- r && (e = Z$1.get(i)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), r && Z$1.set(i, e));
53
- }
54
- return e;
55
- }
56
- toString() {
57
- return this.cssText;
58
- }
59
- };
60
- const ge = (t) => new de(typeof t == "string" ? t : t + "", void 0, j$1), ve = (t, ...e) => {
61
- const i = t.length === 1 ? t[0] : e.reduce((r, s, o) => r + ((a) => {
62
- if (a._$cssResult$ === true) return a.cssText;
63
- if (typeof a == "number") return a;
64
- throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
65
- })(s) + t[o + 1], t[0]);
66
- return new de(i, t, j$1);
67
- }, be = (t, e) => {
68
- if (H) t.adoptedStyleSheets = e.map((i) => i instanceof CSSStyleSheet ? i : i.styleSheet);
69
- else for (const i of e) {
70
- const r = document.createElement("style"), s = O$1.litNonce;
71
- s !== void 0 && r.setAttribute("nonce", s), r.textContent = i.cssText, t.appendChild(r);
72
- }
73
- }, J$1 = H ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
74
- let i = "";
75
- for (const r of e.cssRules) i += r.cssText;
76
- return ge(i);
77
- })(t) : t;
78
- const { is: ye, defineProperty: $e, getOwnPropertyDescriptor: Ae, getOwnPropertyNames: we, getOwnPropertySymbols: _e, getPrototypeOf: xe } = Object, M$1 = globalThis, X$1 = M$1.trustedTypes, Se = X$1 ? X$1.emptyScript : "", Ee = M$1.reactiveElementPolyfillSupport, T$1 = (t, e) => t, V$1 = { toAttribute(t, e) {
79
- switch (e) {
80
- case Boolean:
81
- t = t ? Se : null;
82
- break;
83
- case Object:
84
- case Array:
85
- t = t == null ? t : JSON.stringify(t);
86
- }
87
- return t;
88
- }, fromAttribute(t, e) {
89
- let i = t;
90
- switch (e) {
91
- case Boolean:
92
- i = t !== null;
93
- break;
94
- case Number:
95
- i = t === null ? null : Number(t);
96
- break;
97
- case Object:
98
- case Array:
99
- try {
100
- i = JSON.parse(t);
101
- } catch {
102
- i = null;
103
- }
104
- }
105
- return i;
106
- } }, W$1 = (t, e) => !ye(t, e), Q$1 = { attribute: true, type: String, converter: V$1, reflect: false, useDefault: false, hasChanged: W$1 };
107
- Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), M$1.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
108
- let E = class extends HTMLElement {
109
- static addInitializer(e) {
110
- this._$Ei(), (this.l ??= []).push(e);
111
- }
112
- static get observedAttributes() {
113
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
114
- }
115
- static createProperty(e, i = Q$1) {
116
- if (i.state && (i.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(e) && ((i = Object.create(i)).wrapped = true), this.elementProperties.set(e, i), !i.noAccessor) {
117
- const r = /* @__PURE__ */ Symbol(), s = this.getPropertyDescriptor(e, r, i);
118
- s !== void 0 && $e(this.prototype, e, s);
119
- }
120
- }
121
- static getPropertyDescriptor(e, i, r) {
122
- const { get: s, set: o } = Ae(this.prototype, e) ?? { get() {
123
- return this[i];
124
- }, set(a) {
125
- this[i] = a;
126
- } };
127
- return { get: s, set(a) {
128
- const n = s?.call(this);
129
- o?.call(this, a), this.requestUpdate(e, n, r);
130
- }, configurable: true, enumerable: true };
131
- }
132
- static getPropertyOptions(e) {
133
- return this.elementProperties.get(e) ?? Q$1;
134
- }
135
- static _$Ei() {
136
- if (this.hasOwnProperty(T$1("elementProperties"))) return;
137
- const e = xe(this);
138
- e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
139
- }
140
- static finalize() {
141
- if (this.hasOwnProperty(T$1("finalized"))) return;
142
- if (this.finalized = true, this._$Ei(), this.hasOwnProperty(T$1("properties"))) {
143
- const i = this.properties, r = [...we(i), ..._e(i)];
144
- for (const s of r) this.createProperty(s, i[s]);
145
- }
146
- const e = this[Symbol.metadata];
147
- if (e !== null) {
148
- const i = litPropertyMetadata.get(e);
149
- if (i !== void 0) for (const [r, s] of i) this.elementProperties.set(r, s);
150
- }
151
- this._$Eh = /* @__PURE__ */ new Map();
152
- for (const [i, r] of this.elementProperties) {
153
- const s = this._$Eu(i, r);
154
- s !== void 0 && this._$Eh.set(s, i);
155
- }
156
- this.elementStyles = this.finalizeStyles(this.styles);
157
- }
158
- static finalizeStyles(e) {
159
- const i = [];
160
- if (Array.isArray(e)) {
161
- const r = new Set(e.flat(1 / 0).reverse());
162
- for (const s of r) i.unshift(J$1(s));
163
- } else e !== void 0 && i.push(J$1(e));
164
- return i;
165
- }
166
- static _$Eu(e, i) {
167
- const r = i.attribute;
168
- return r === false ? void 0 : typeof r == "string" ? r : typeof e == "string" ? e.toLowerCase() : void 0;
169
- }
170
- constructor() {
171
- super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
172
- }
173
- _$Ev() {
174
- this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((e) => e(this));
175
- }
176
- addController(e) {
177
- (this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
178
- }
179
- removeController(e) {
180
- this._$EO?.delete(e);
181
- }
182
- _$E_() {
183
- const e = /* @__PURE__ */ new Map(), i = this.constructor.elementProperties;
184
- for (const r of i.keys()) this.hasOwnProperty(r) && (e.set(r, this[r]), delete this[r]);
185
- e.size > 0 && (this._$Ep = e);
186
- }
187
- createRenderRoot() {
188
- const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
189
- return be(e, this.constructor.elementStyles), e;
190
- }
191
- connectedCallback() {
192
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((e) => e.hostConnected?.());
193
- }
194
- enableUpdating(e) {
195
- }
196
- disconnectedCallback() {
197
- this._$EO?.forEach((e) => e.hostDisconnected?.());
198
- }
199
- attributeChangedCallback(e, i, r) {
200
- this._$AK(e, r);
201
- }
202
- _$ET(e, i) {
203
- const r = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, r);
204
- if (s !== void 0 && r.reflect === true) {
205
- const o = (r.converter?.toAttribute !== void 0 ? r.converter : V$1).toAttribute(i, r.type);
206
- this._$Em = e, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
207
- }
208
- }
209
- _$AK(e, i) {
210
- const r = this.constructor, s = r._$Eh.get(e);
211
- if (s !== void 0 && this._$Em !== s) {
212
- const o = r.getPropertyOptions(s), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : V$1;
213
- this._$Em = s;
214
- const n = a.fromAttribute(i, o.type);
215
- this[s] = n ?? this._$Ej?.get(s) ?? n, this._$Em = null;
216
- }
217
- }
218
- requestUpdate(e, i, r, s = false, o) {
219
- if (e !== void 0) {
220
- const a = this.constructor;
221
- if (s === false && (o = this[e]), r ??= a.getPropertyOptions(e), !((r.hasChanged ?? W$1)(o, i) || r.useDefault && r.reflect && o === this._$Ej?.get(e) && !this.hasAttribute(a._$Eu(e, r)))) return;
222
- this.C(e, i, r);
223
- }
224
- this.isUpdatePending === false && (this._$ES = this._$EP());
225
- }
226
- C(e, i, { useDefault: r, reflect: s, wrapped: o }, a) {
227
- r && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, a ?? i ?? this[e]), o !== true || a !== void 0) || (this._$AL.has(e) || (this.hasUpdated || r || (i = void 0), this._$AL.set(e, i)), s === true && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
228
- }
229
- async _$EP() {
230
- this.isUpdatePending = true;
231
- try {
232
- await this._$ES;
233
- } catch (i) {
234
- Promise.reject(i);
235
- }
236
- const e = this.scheduleUpdate();
237
- return e != null && await e, !this.isUpdatePending;
238
- }
239
- scheduleUpdate() {
240
- return this.performUpdate();
241
- }
242
- performUpdate() {
243
- if (!this.isUpdatePending) return;
244
- if (!this.hasUpdated) {
245
- if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
246
- for (const [s, o] of this._$Ep) this[s] = o;
247
- this._$Ep = void 0;
248
- }
249
- const r = this.constructor.elementProperties;
250
- if (r.size > 0) for (const [s, o] of r) {
251
- const { wrapped: a } = o, n = this[s];
252
- a !== true || this._$AL.has(s) || n === void 0 || this.C(s, void 0, o, n);
253
- }
254
- }
255
- let e = false;
256
- const i = this._$AL;
257
- try {
258
- e = this.shouldUpdate(i), e ? (this.willUpdate(i), this._$EO?.forEach((r) => r.hostUpdate?.()), this.update(i)) : this._$EM();
259
- } catch (r) {
260
- throw e = false, this._$EM(), r;
261
- }
262
- e && this._$AE(i);
263
- }
264
- willUpdate(e) {
265
- }
266
- _$AE(e) {
267
- this._$EO?.forEach((i) => i.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(e)), this.updated(e);
268
- }
269
- _$EM() {
270
- this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
271
- }
272
- get updateComplete() {
273
- return this.getUpdateComplete();
274
- }
275
- getUpdateComplete() {
276
- return this._$ES;
277
- }
278
- shouldUpdate(e) {
279
- return true;
280
- }
281
- update(e) {
282
- this._$Eq &&= this._$Eq.forEach((i) => this._$ET(i, this[i])), this._$EM();
283
- }
284
- updated(e) {
285
- }
286
- firstUpdated(e) {
287
- }
288
- };
289
- E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[T$1("elementProperties")] = /* @__PURE__ */ new Map(), E[T$1("finalized")] = /* @__PURE__ */ new Map(), Ee?.({ ReactiveElement: E }), (M$1.reactiveElementVersions ??= []).push("2.1.2");
290
- const K$1 = globalThis, ee$1 = (t) => t, D$1 = K$1.trustedTypes, te = D$1 ? D$1.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, he = "$lit$", A$1 = `lit$${Math.random().toFixed(9).slice(2)}$`, ce = "?" + A$1, ke = `<${ce}>`, S$1 = document, R$1 = () => S$1.createComment(""), I$1 = (t) => t === null || typeof t != "object" && typeof t != "function", Y$1 = Array.isArray, Pe = (t) => Y$1(t) || typeof t?.[Symbol.iterator] == "function", L$1 = `[
291
- \f\r]`, P$1 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ie = /-->/g, re = />/g, w$1 = RegExp(`>|${L$1}(?:([^\\s"'>=/]+)(${L$1}*=${L$1}*(?:[^
292
- \f\r"'\`<>=]|("|')|))|$)`, "g"), se = /'/g, oe = /"/g, pe = /^(?:script|style|textarea|title)$/i, Te = (t) => (e, ...i) => ({ _$litType$: t, strings: e, values: i }), g = Te(1), v$1 = /* @__PURE__ */ Symbol.for("lit-noChange"), f$1 = /* @__PURE__ */ Symbol.for("lit-nothing"), ae = /* @__PURE__ */ new WeakMap(), x$1 = S$1.createTreeWalker(S$1, 129);
293
- function ue(t, e) {
294
- if (!Y$1(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
295
- return te !== void 0 ? te.createHTML(e) : e;
296
- }
297
- const Ce = (t, e) => {
298
- const i = t.length - 1, r = [];
299
- let s, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", a = P$1;
300
- for (let n = 0; n < i; n++) {
301
- const l = t[n];
302
- let m, c, u = -1, y = 0;
303
- for (; y < l.length && (a.lastIndex = y, c = a.exec(l), c !== null); ) y = a.lastIndex, a === P$1 ? c[1] === "!--" ? a = ie : c[1] !== void 0 ? a = re : c[2] !== void 0 ? (pe.test(c[2]) && (s = RegExp("</" + c[2], "g")), a = w$1) : c[3] !== void 0 && (a = w$1) : a === w$1 ? c[0] === ">" ? (a = s ?? P$1, u = -1) : c[1] === void 0 ? u = -2 : (u = a.lastIndex - c[2].length, m = c[1], a = c[3] === void 0 ? w$1 : c[3] === '"' ? oe : se) : a === oe || a === se ? a = w$1 : a === ie || a === re ? a = P$1 : (a = w$1, s = void 0);
304
- const $ = a === w$1 && t[n + 1].startsWith("/>") ? " " : "";
305
- o += a === P$1 ? l + ke : u >= 0 ? (r.push(m), l.slice(0, u) + he + l.slice(u) + A$1 + $) : l + A$1 + (u === -2 ? n : $);
306
- }
307
- return [ue(t, o + (t[i] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), r];
308
- };
309
- class N {
310
- constructor({ strings: e, _$litType$: i }, r) {
311
- let s;
312
- this.parts = [];
313
- let o = 0, a = 0;
314
- const n = e.length - 1, l = this.parts, [m, c] = Ce(e, i);
315
- if (this.el = N.createElement(m, r), x$1.currentNode = this.el.content, i === 2 || i === 3) {
316
- const u = this.el.content.firstChild;
317
- u.replaceWith(...u.childNodes);
318
- }
319
- for (; (s = x$1.nextNode()) !== null && l.length < n; ) {
320
- if (s.nodeType === 1) {
321
- if (s.hasAttributes()) for (const u of s.getAttributeNames()) if (u.endsWith(he)) {
322
- const y = c[a++], $ = s.getAttribute(u).split(A$1), F = /([.?@])?(.*)/.exec(y);
323
- l.push({ type: 1, index: o, name: F[2], strings: $, ctor: F[1] === "." ? Ie : F[1] === "?" ? Ne : F[1] === "@" ? ze : B$1 }), s.removeAttribute(u);
324
- } else u.startsWith(A$1) && (l.push({ type: 6, index: o }), s.removeAttribute(u));
325
- if (pe.test(s.tagName)) {
326
- const u = s.textContent.split(A$1), y = u.length - 1;
327
- if (y > 0) {
328
- s.textContent = D$1 ? D$1.emptyScript : "";
329
- for (let $ = 0; $ < y; $++) s.append(u[$], R$1()), x$1.nextNode(), l.push({ type: 2, index: ++o });
330
- s.append(u[y], R$1());
331
- }
332
- }
333
- } else if (s.nodeType === 8) if (s.data === ce) l.push({ type: 2, index: o });
334
- else {
335
- let u = -1;
336
- for (; (u = s.data.indexOf(A$1, u + 1)) !== -1; ) l.push({ type: 7, index: o }), u += A$1.length - 1;
337
- }
338
- o++;
339
- }
340
- }
341
- static createElement(e, i) {
342
- const r = S$1.createElement("template");
343
- return r.innerHTML = e, r;
344
- }
345
- }
346
- function k$1(t, e, i = t, r) {
347
- if (e === v$1) return e;
348
- let s = r !== void 0 ? i._$Co?.[r] : i._$Cl;
349
- const o = I$1(e) ? void 0 : e._$litDirective$;
350
- return s?.constructor !== o && (s?._$AO?.(false), o === void 0 ? s = void 0 : (s = new o(t), s._$AT(t, i, r)), r !== void 0 ? (i._$Co ??= [])[r] = s : i._$Cl = s), s !== void 0 && (e = k$1(t, s._$AS(t, e.values), s, r)), e;
351
- }
352
- class Re {
353
- constructor(e, i) {
354
- this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = i;
355
- }
356
- get parentNode() {
357
- return this._$AM.parentNode;
358
- }
359
- get _$AU() {
360
- return this._$AM._$AU;
361
- }
362
- u(e) {
363
- const { el: { content: i }, parts: r } = this._$AD, s = (e?.creationScope ?? S$1).importNode(i, true);
364
- x$1.currentNode = s;
365
- let o = x$1.nextNode(), a = 0, n = 0, l = r[0];
366
- for (; l !== void 0; ) {
367
- if (a === l.index) {
368
- let m;
369
- l.type === 2 ? m = new z$1(o, o.nextSibling, this, e) : l.type === 1 ? m = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (m = new Fe(o, this, e)), this._$AV.push(m), l = r[++n];
370
- }
371
- a !== l?.index && (o = x$1.nextNode(), a++);
372
- }
373
- return x$1.currentNode = S$1, s;
374
- }
375
- p(e) {
376
- let i = 0;
377
- for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(e, r, i), i += r.strings.length - 2) : r._$AI(e[i])), i++;
378
- }
379
- }
380
- let z$1 = class z {
381
- get _$AU() {
382
- return this._$AM?._$AU ?? this._$Cv;
383
- }
384
- constructor(e, i, r, s) {
385
- this.type = 2, this._$AH = f$1, this._$AN = void 0, this._$AA = e, this._$AB = i, this._$AM = r, this.options = s, this._$Cv = s?.isConnected ?? true;
386
- }
387
- get parentNode() {
388
- let e = this._$AA.parentNode;
389
- const i = this._$AM;
390
- return i !== void 0 && e?.nodeType === 11 && (e = i.parentNode), e;
391
- }
392
- get startNode() {
393
- return this._$AA;
394
- }
395
- get endNode() {
396
- return this._$AB;
397
- }
398
- _$AI(e, i = this) {
399
- e = k$1(this, e, i), I$1(e) ? e === f$1 || e == null || e === "" ? (this._$AH !== f$1 && this._$AR(), this._$AH = f$1) : e !== this._$AH && e !== v$1 && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Pe(e) ? this.k(e) : this._(e);
400
- }
401
- O(e) {
402
- return this._$AA.parentNode.insertBefore(e, this._$AB);
403
- }
404
- T(e) {
405
- this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
406
- }
407
- _(e) {
408
- this._$AH !== f$1 && I$1(this._$AH) ? this._$AA.nextSibling.data = e : this.T(S$1.createTextNode(e)), this._$AH = e;
409
- }
410
- $(e) {
411
- const { values: i, _$litType$: r } = e, s = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = N.createElement(ue(r.h, r.h[0]), this.options)), r);
412
- if (this._$AH?._$AD === s) this._$AH.p(i);
413
- else {
414
- const o = new Re(s, this), a = o.u(this.options);
415
- o.p(i), this.T(a), this._$AH = o;
416
- }
417
- }
418
- _$AC(e) {
419
- let i = ae.get(e.strings);
420
- return i === void 0 && ae.set(e.strings, i = new N(e)), i;
421
- }
422
- k(e) {
423
- Y$1(this._$AH) || (this._$AH = [], this._$AR());
424
- const i = this._$AH;
425
- let r, s = 0;
426
- for (const o of e) s === i.length ? i.push(r = new z(this.O(R$1()), this.O(R$1()), this, this.options)) : r = i[s], r._$AI(o), s++;
427
- s < i.length && (this._$AR(r && r._$AB.nextSibling, s), i.length = s);
428
- }
429
- _$AR(e = this._$AA.nextSibling, i) {
430
- for (this._$AP?.(false, true, i); e !== this._$AB; ) {
431
- const r = ee$1(e).nextSibling;
432
- ee$1(e).remove(), e = r;
433
- }
434
- }
435
- setConnected(e) {
436
- this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
437
- }
438
- };
439
- let B$1 = class B {
440
- get tagName() {
441
- return this.element.tagName;
442
- }
443
- get _$AU() {
444
- return this._$AM._$AU;
445
- }
446
- constructor(e, i, r, s, o) {
447
- this.type = 1, this._$AH = f$1, this._$AN = void 0, this.element = e, this.name = i, this._$AM = s, this.options = o, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = f$1;
448
- }
449
- _$AI(e, i = this, r, s) {
450
- const o = this.strings;
451
- let a = false;
452
- if (o === void 0) e = k$1(this, e, i, 0), a = !I$1(e) || e !== this._$AH && e !== v$1, a && (this._$AH = e);
453
- else {
454
- const n = e;
455
- let l, m;
456
- for (e = o[0], l = 0; l < o.length - 1; l++) m = k$1(this, n[r + l], i, l), m === v$1 && (m = this._$AH[l]), a ||= !I$1(m) || m !== this._$AH[l], m === f$1 ? e = f$1 : e !== f$1 && (e += (m ?? "") + o[l + 1]), this._$AH[l] = m;
457
- }
458
- a && !s && this.j(e);
459
- }
460
- j(e) {
461
- e === f$1 ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
462
- }
463
- };
464
- class Ie extends B$1 {
465
- constructor() {
466
- super(...arguments), this.type = 3;
467
- }
468
- j(e) {
469
- this.element[this.name] = e === f$1 ? void 0 : e;
470
- }
471
- }
472
- class Ne extends B$1 {
473
- constructor() {
474
- super(...arguments), this.type = 4;
475
- }
476
- j(e) {
477
- this.element.toggleAttribute(this.name, !!e && e !== f$1);
478
- }
479
- }
480
- class ze extends B$1 {
481
- constructor(e, i, r, s, o) {
482
- super(e, i, r, s, o), this.type = 5;
483
- }
484
- _$AI(e, i = this) {
485
- if ((e = k$1(this, e, i, 0) ?? f$1) === v$1) return;
486
- const r = this._$AH, s = e === f$1 && r !== f$1 || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, o = e !== f$1 && (r === f$1 || s);
487
- s && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
488
- }
489
- handleEvent(e) {
490
- typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
491
- }
492
- }
493
- class Fe {
494
- constructor(e, i, r) {
495
- this.element = e, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = r;
496
- }
497
- get _$AU() {
498
- return this._$AM._$AU;
499
- }
500
- _$AI(e) {
501
- k$1(this, e);
502
- }
503
- }
504
- const Ue = K$1.litHtmlPolyfillSupport;
505
- Ue?.(N, z$1), (K$1.litHtmlVersions ??= []).push("3.3.2");
506
- const Oe = (t, e, i) => {
507
- const r = i?.renderBefore ?? e;
508
- let s = r._$litPart$;
509
- if (s === void 0) {
510
- const o = i?.renderBefore ?? null;
511
- r._$litPart$ = s = new z$1(e.insertBefore(R$1(), o), o, void 0, i ?? {});
512
- }
513
- return s._$AI(t), s;
514
- };
515
- const G$1 = globalThis;
516
- let C$1 = class C extends E {
517
- constructor() {
518
- super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
519
- }
520
- createRenderRoot() {
521
- const e = super.createRenderRoot();
522
- return this.renderOptions.renderBefore ??= e.firstChild, e;
523
- }
524
- update(e) {
525
- const i = this.render();
526
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Oe(i, this.renderRoot, this.renderOptions);
527
- }
528
- connectedCallback() {
529
- super.connectedCallback(), this._$Do?.setConnected(true);
530
- }
531
- disconnectedCallback() {
532
- super.disconnectedCallback(), this._$Do?.setConnected(false);
533
- }
534
- render() {
535
- return v$1;
536
- }
537
- };
538
- C$1._$litElement$ = true, C$1.finalized = true, G$1.litElementHydrateSupport?.({ LitElement: C$1 });
539
- const Ve = G$1.litElementPolyfillSupport;
540
- Ve?.({ LitElement: C$1 });
541
- (G$1.litElementVersions ??= []).push("4.2.2");
542
- const De = (t) => (e, i) => {
543
- i !== void 0 ? i.addInitializer(() => {
544
- customElements.define(t, e);
545
- }) : customElements.define(t, e);
546
- };
547
- const Me = { attribute: true, type: String, converter: V$1, reflect: false, hasChanged: W$1 }, Be = (t = Me, e, i) => {
548
- const { kind: r, metadata: s } = i;
549
- let o = globalThis.litPropertyMetadata.get(s);
550
- if (o === void 0 && globalThis.litPropertyMetadata.set(s, o = /* @__PURE__ */ new Map()), r === "setter" && ((t = Object.create(t)).wrapped = true), o.set(i.name, t), r === "accessor") {
551
- const { name: a } = i;
552
- return { set(n) {
553
- const l = e.get.call(this);
554
- e.set.call(this, n), this.requestUpdate(a, l, t, true, n);
555
- }, init(n) {
556
- return n !== void 0 && this.C(a, void 0, t, n), n;
557
- } };
558
- }
559
- if (r === "setter") {
560
- const { name: a } = i;
561
- return function(n) {
562
- const l = this[a];
563
- e.call(this, n), this.requestUpdate(a, l, t, true, n);
564
- };
565
- }
566
- throw Error("Unsupported decorator location: " + r);
567
- };
568
- function p(t) {
569
- return (e, i) => typeof i == "object" ? Be(t, e, i) : ((r, s, o) => {
570
- const a = s.hasOwnProperty(o);
571
- return s.constructor.createProperty(o, r), a ? Object.getOwnPropertyDescriptor(s, o) : void 0;
572
- })(t, e, i);
573
- }
574
- function b$1(t) {
575
- return p({ ...t, state: true, attribute: false });
576
- }
577
- const Le = (t, e, i) => (i.configurable = true, i.enumerable = true, Reflect.decorate && typeof e != "object" && Object.defineProperty(t, e, i), i);
578
- function qe(t, e) {
579
- return (i, r, s) => {
580
- const o = (a) => a.renderRoot?.querySelector(t) ?? null;
581
- return Le(i, r, { get() {
582
- return o(this);
583
- } });
584
- };
585
- }
586
- const _$1 = { ATTRIBUTE: 1, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4 }, me = (t) => (...e) => ({ _$litDirective$: t, values: e });
587
- class fe {
588
- constructor(e) {
589
- }
590
- get _$AU() {
591
- return this._$AM._$AU;
592
- }
593
- _$AT(e, i, r) {
594
- this._$Ct = e, this._$AM = i, this._$Ci = r;
595
- }
596
- _$AS(e, i) {
597
- return this.update(e, i);
598
- }
599
- update(e, i) {
600
- return this.render(...i);
601
- }
602
- }
603
- const U$1 = me(class extends fe {
604
- constructor(t) {
605
- if (super(t), t.type !== _$1.ATTRIBUTE || t.name !== "class" || t.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
606
- }
607
- render(t) {
608
- return " " + Object.keys(t).filter((e) => t[e]).join(" ") + " ";
609
- }
610
- update(t, [e]) {
611
- if (this.st === void 0) {
612
- this.st = /* @__PURE__ */ new Set(), t.strings !== void 0 && (this.nt = new Set(t.strings.join(" ").split(/\s/).filter((r) => r !== "")));
613
- for (const r in e) e[r] && !this.nt?.has(r) && this.st.add(r);
614
- return this.render(e);
615
- }
616
- const i = t.element.classList;
617
- for (const r of this.st) r in e || (i.remove(r), this.st.delete(r));
618
- for (const r in e) {
619
- const s = !!e[r];
620
- s === this.st.has(r) || this.nt?.has(r) || (s ? (i.add(r), this.st.add(r)) : (i.remove(r), this.st.delete(r)));
621
- }
622
- return v$1;
623
- }
624
- });
625
- const He = (t) => t.strings === void 0, je = {}, We = (t, e = je) => t._$AH = e;
626
- const Ke = me(class extends fe {
627
- constructor(t) {
628
- if (super(t), t.type !== _$1.PROPERTY && t.type !== _$1.ATTRIBUTE && t.type !== _$1.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
629
- if (!He(t)) throw Error("`live` bindings can only contain a single expression");
630
- }
631
- render(t) {
632
- return t;
633
- }
634
- update(t, [e]) {
635
- if (e === v$1 || e === f$1) return e;
636
- const i = t.element, r = t.name;
637
- if (t.type === _$1.PROPERTY) {
638
- if (e === i[r]) return v$1;
639
- } else if (t.type === _$1.BOOLEAN_ATTRIBUTE) {
640
- if (!!e === i.hasAttribute(r)) return v$1;
641
- } else if (t.type === _$1.ATTRIBUTE && i.getAttribute(r) === e + "") return v$1;
642
- return We(t), e;
643
- }
644
- }), Ye = [
645
- "AE",
646
- "AR",
647
- "AT",
648
- "AU",
649
- "BE",
650
- "BG",
651
- "BR",
652
- "CA",
653
- "CH",
654
- "CL",
655
- "CO",
656
- "CZ",
657
- "DE",
658
- "DK",
659
- "EE",
660
- "ES",
661
- "FI",
662
- "FR",
663
- "GB",
664
- "GR",
665
- "HK",
666
- "HR",
667
- "HU",
668
- "ID",
669
- "IE",
670
- "IL",
671
- "IN",
672
- "IT",
673
- "JP",
674
- "KR",
675
- "LT",
676
- "LU",
677
- "LV",
678
- "MX",
679
- "MY",
680
- "NL",
681
- "NO",
682
- "NZ",
683
- "PE",
684
- "PH",
685
- "PL",
686
- "PT",
687
- "RO",
688
- "SE",
689
- "SG",
690
- "SI",
691
- "SK",
692
- "TH",
693
- "TR",
694
- "TW",
695
- "US",
696
- "VN",
697
- "ZA"
698
- ];
699
- function Ge(t, e) {
700
- let i = null;
701
- return function(...r) {
702
- i && clearTimeout(i), i = setTimeout(() => {
703
- t.apply(this, r);
704
- }, e);
705
- };
706
- }
707
- function Ze() {
708
- return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
709
- const e = Math.random() * 16 | 0;
710
- return (t === "x" ? e : e & 3 | 8).toString(16);
711
- });
712
- }
713
- function Je(t) {
714
- if (!t) return null;
715
- const e = t.find(
716
- (i) => i.types?.includes("country")
717
- );
718
- return e ? e.short_name : null;
719
- }
720
- function ne(t, e) {
721
- let i = null;
722
- return t.address_components ? i = Je(t.address_components) : e && e.length === 1 && (i = e[0].toUpperCase()), i ? {
723
- isSupported: Ye.includes(i),
724
- countryCode: i
725
- } : {
726
- isSupported: null,
727
- countryCode: null
728
- };
729
- }
730
- const le = {
731
- en: {
732
- placeholder: "Search for an address...",
733
- noResults: "No address found for this search. Try different keywords.",
734
- errorFetchPredictions: "Unable to search for addresses. Please try again.",
735
- errorFetchDetails: "Unable to load address details. Please try again.",
736
- errorNetwork: "Network error. Please check your connection and try again.",
737
- validationRequired: "This field is required",
738
- validationPattern: "Invalid format",
739
- validationSaudiFormat: "Please enter a valid Saudi national address (format: AAAA1234)"
740
- },
741
- ar: {
742
- placeholder: "ابحث عن عنوان...",
743
- noResults: "لم يتم العثور على عنوان لهذا البحث. جرب كلمات مختلفة.",
744
- errorFetchPredictions: "تعذر البحث عن العناوين. يرجى المحاولة مرة أخرى.",
745
- errorFetchDetails: "تعذر تحميل تفاصيل العنوان. يرجى المحاولة مرة أخرى.",
746
- errorNetwork: "خطأ في الشبكة. يرجى التحقق من اتصالك والمحاولة مرة أخرى.",
747
- validationRequired: "هذا الحقل مطلوب",
748
- validationPattern: "صيغة غير صحيحة",
749
- validationSaudiFormat: "الرجاء إدخال عنوان وطني صحيح (الصيغة: AAAA1234)"
750
- },
751
- es: {
752
- placeholder: "Buscar una dirección...",
753
- noResults: "No se encontró ninguna dirección para esta búsqueda. Intenta con diferentes palabras.",
754
- errorFetchPredictions: "No se pueden buscar direcciones. Por favor, inténtelo de nuevo.",
755
- errorFetchDetails: "No se pueden cargar los detalles de la dirección. Por favor, inténtelo de nuevo.",
756
- errorNetwork: "Error de red. Verifique su conexión e inténtelo de nuevo.",
757
- validationRequired: "Este campo es obligatorio",
758
- validationPattern: "Formato inválido",
759
- validationSaudiFormat: "Por favor ingrese una dirección nacional saudí válida (formato: AAAA1234)"
760
- },
761
- fr: {
762
- placeholder: "Rechercher une adresse...",
763
- noResults: "Aucune adresse trouvée pour cette recherche. Essayez différents mots-clés.",
764
- errorFetchPredictions: "Impossible de rechercher des adresses. Veuillez réessayer.",
765
- errorFetchDetails: "Impossible de charger les détails de l'adresse. Veuillez réessayer.",
766
- errorNetwork: "Erreur réseau. Vérifiez votre connexion et réessayez.",
767
- validationRequired: "Ce champ est obligatoire",
768
- validationPattern: "Format invalide",
769
- validationSaudiFormat: "Veuillez saisir une adresse nationale saoudienne valide (format: AAAA1234)"
770
- },
771
- de: {
772
- placeholder: "Nach einer Adresse suchen...",
773
- noResults: "Keine Adresse für diese Suche gefunden. Versuchen Sie es mit anderen Stichwörtern.",
774
- errorFetchPredictions: "Adressen können nicht gesucht werden. Bitte versuchen Sie es erneut.",
775
- errorFetchDetails: "Adressdetails können nicht geladen werden. Bitte versuchen Sie es erneut.",
776
- errorNetwork: "Netzwerkfehler. Bitte überprüfen Sie Ihre Verbindung und versuchen Sie es erneut.",
777
- validationRequired: "Dieses Feld ist erforderlich",
778
- validationPattern: "Ungültiges Format",
779
- validationSaudiFormat: "Bitte geben Sie eine gültige saudi-arabische nationale Adresse ein (Format: AAAA1234)"
780
- },
781
- it: {
782
- placeholder: "Cerca un indirizzo...",
783
- noResults: "Nessun indirizzo trovato per questa ricerca. Prova con parole chiave diverse.",
784
- errorFetchPredictions: "Impossibile cercare indirizzi. Riprova.",
785
- errorFetchDetails: "Impossibile caricare i dettagli dell'indirizzo. Riprova.",
786
- errorNetwork: "Errore di rete. Controlla la connessione e riprova.",
787
- validationRequired: "Questo campo è obbligatorio",
788
- validationPattern: "Formato non valido",
789
- validationSaudiFormat: "Inserisci un indirizzo nazionale saudita valido (formato: AAAA1234)"
790
- },
791
- pt: {
792
- placeholder: "Pesquisar um endereço...",
793
- noResults: "Nenhum endereço encontrado para esta pesquisa. Tente palavras-chave diferentes.",
794
- errorFetchPredictions: "Não é possível pesquisar endereços. Por favor, tente novamente.",
795
- errorFetchDetails: "Não é possível carregar os detalhes do endereço. Por favor, tente novamente.",
796
- errorNetwork: "Erro de rede. Verifique sua conexão e tente novamente.",
797
- validationRequired: "Este campo é obrigatório",
798
- validationPattern: "Formato inválido",
799
- validationSaudiFormat: "Por favor, insira um endereço nacional saudita válido (formato: AAAA1234)"
800
- },
801
- ru: {
802
- placeholder: "Поиск адреса...",
803
- noResults: "Адрес для этого поиска не найден. Попробуйте другие ключевые слова.",
804
- errorFetchPredictions: "Невозможно выполнить поиск адресов. Пожалуйста, попробуйте еще раз.",
805
- errorFetchDetails: "Невозможно загрузить детали адреса. Пожалуйста, попробуйте еще раз.",
806
- errorNetwork: "Ошибка сети. Проверьте соединение и попробуйте еще раз.",
807
- validationRequired: "Это поле обязательно",
808
- validationPattern: "Неверный формат",
809
- validationSaudiFormat: "Пожалуйста, введите действительный национальный адрес Саудовской Аравии (формат: AAAA1234)"
810
- },
811
- ja: {
812
- placeholder: "住所を検索...",
813
- noResults: "この検索では住所が見つかりませんでした。別のキーワードをお試しください。",
814
- errorFetchPredictions: "住所を検索できません。もう一度お試しください。",
815
- errorFetchDetails: "住所の詳細を読み込めません。もう一度お試しください。",
816
- errorNetwork: "ネットワークエラー。接続を確認してもう一度お試しください。",
817
- validationRequired: "この項目は必須です",
818
- validationPattern: "無効な形式",
819
- validationSaudiFormat: "有効なサウジアラビアの国内住所を入力してください(形式:AAAA1234)"
820
- },
821
- zh: {
822
- placeholder: "搜索地址...",
823
- noResults: "未找到此搜索的地址。请尝试不同的关键词。",
824
- errorFetchPredictions: "无法搜索地址。请重试。",
825
- errorFetchDetails: "无法加载地址详情。请重试。",
826
- errorNetwork: "网络错误。请检查您的连接并重试。",
827
- validationRequired: "此字段为必填项",
828
- validationPattern: "格式无效",
829
- validationSaudiFormat: "请输入有效的沙特国家地址(格式:AAAA1234)"
830
- },
831
- ko: {
832
- placeholder: "주소 검색...",
833
- noResults: "이 검색에 대한 주소를 찾을 수 없습니다. 다른 키워드를 시도해보세요.",
834
- errorFetchPredictions: "주소를 검색할 수 없습니다. 다시 시도해주세요.",
835
- errorFetchDetails: "주소 세부정보를 불러올 수 없습니다. 다시 시도해주세요.",
836
- errorNetwork: "네트워크 오류입니다. 연결을 확인하고 다시 시도해주세요.",
837
- validationRequired: "이 필드는 필수입니다",
838
- validationPattern: "유효하지 않은 형식",
839
- validationSaudiFormat: "유효한 사우디 국가 주소를 입력하세요 (형식: AAAA1234)"
840
- },
841
- hi: {
842
- placeholder: "पता खोजें...",
843
- noResults: "इस खोज के लिए कोई पता नहीं मिला। विभिन्न कीवर्ड आज़माएं।",
844
- errorFetchPredictions: "पते खोजने में असमर्थ। कृपया पुनः प्रयास करें।",
845
- errorFetchDetails: "पते का विवरण लोड करने में असमर्थ। कृपया पुनः प्रयास करें।",
846
- errorNetwork: "नेटवर्क त्रुटि। कृपया अपना कनेक्शन जांचें और पुनः प्रयास करें।",
847
- validationRequired: "यह फ़ील्ड आवश्यक है",
848
- validationPattern: "अमान्य प्रारूप",
849
- validationSaudiFormat: "कृपया एक मान्य सऊदी राष्ट्रीय पता दर्ज करें (प्रारूप: AAAA1234)"
850
- },
851
- tr: {
852
- placeholder: "Adres ara...",
853
- noResults: "Bu arama için adres bulunamadı. Farklı anahtar kelimeler deneyin.",
854
- errorFetchPredictions: "Adresler aranamıyor. Lütfen tekrar deneyin.",
855
- errorFetchDetails: "Adres detayları yüklenemiyor. Lütfen tekrar deneyin.",
856
- errorNetwork: "Ağ hatası. Lütfen bağlantınızı kontrol edin ve tekrar deneyin.",
857
- validationRequired: "Bu alan zorunludur",
858
- validationPattern: "Geçersiz format",
859
- validationSaudiFormat: "Lütfen geçerli bir Suudi ulusal adresi girin (format: AAAA1234)"
860
- }
861
- };
862
- function q$1(t = "en") {
863
- return le[t] || le.en;
864
- }
865
- function Xe(t) {
866
- return ["ar"].includes(t);
867
- }
868
- var Qe = Object.defineProperty, et$1 = Object.getOwnPropertyDescriptor, h$1 = (t, e, i, r) => {
869
- for (var s = r > 1 ? void 0 : r ? et$1(e, i) : e, o = t.length - 1, a; o >= 0; o--)
870
- (a = t[o]) && (s = (r ? a(e, i, s) : a(s)) || s);
871
- return r && s && Qe(e, i, s), s;
872
- };
873
- let d$1 = class d extends C$1 {
874
- constructor() {
875
- 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 = false, this.pattern = null, this.tooltip = null, this.selectedId = null, this.errors = [], this.disabled = false, this._value = "", this._country = null, this.locationBias = null, this.locationRestriction = null, this.types = null, this._fields = ["formatted_address", "geometry"], this.strictBounds = false, this.useSessionToken = true, this.resolve = false, this.onValidateAddress = null, this.debounceDelay = 300, this.minChars = 3, this.predictions = [], this.isOpen = false, this.isLoading = false, this.error = null, this.activeIndex = -1, this.inputValue = "", this.sessionToken = null, this.validationError = null, this.touched = false, this.showNationalAddressIcon = false, this.abortController = null, this._internals = this.attachInternals();
876
- }
877
- set value(t) {
878
- const e = this._value;
879
- this._value = t || "", this.requestUpdate("value", e);
880
- }
881
- get value() {
882
- return this._value;
883
- }
884
- set country(t) {
885
- t == null ? this._country = null : Array.isArray(t) ? this._country = t.filter((e) => e && e.trim()).map((e) => e.trim()) : this._country = t.split(",").map((e) => e.trim()).filter((e) => e);
886
- }
887
- get country() {
888
- return this._country;
889
- }
890
- set fieldsStr(t) {
891
- this._fields = t ? t.split(",").map((e) => e.trim()).filter((e) => e) : ["formatted_address", "geometry"];
892
- }
893
- get fieldsStr() {
894
- return this._fields.join(",");
895
- }
896
- set fields(t) {
897
- this._fields = t && t.length > 0 ? t : ["formatted_address", "geometry"];
898
- }
899
- get fields() {
900
- return this._fields;
901
- }
902
- connectedCallback() {
903
- super.connectedCallback(), this.createNewSession(), this.initializeDebounce();
904
- }
905
- disconnectedCallback() {
906
- super.disconnectedCallback(), this.terminateSession(), this.cancelPendingRequest();
907
- }
908
- initializeDebounce() {
909
- this.debouncedFetch = Ge(this.fetchPredictions.bind(this), this.debounceDelay);
910
- }
911
- firstUpdated() {
912
- const t = this.value || this.defaultPlace || "";
913
- t && (this.inputValue = t, this.isSaudiFormMode() && this.isShortAddressFormat(t) && (this.showNationalAddressIcon = true));
914
- }
915
- $nextTick(t) {
916
- Promise.resolve().then(t);
917
- }
918
- isShortAddressFormat(t) {
919
- return /^[a-zA-Z]{4}\d{4}$/.test(t?.trim());
920
- }
921
- updated(t) {
922
- if (t.has("value")) {
923
- const e = this.value || "";
924
- e !== this.inputValue && (this.inputValue = e, this.isSaudiFormMode() && e && this.isShortAddressFormat(e) ? this.showNationalAddressIcon = true : this.showNationalAddressIcon = false);
925
- }
926
- t.has("defaultPlace") && !this.value && this.defaultPlace !== this.inputValue && (this.inputValue = this.defaultPlace || "", this.isSaudiFormMode() && this.defaultPlace && this.isShortAddressFormat(this.defaultPlace) ? this.showNationalAddressIcon = true : this.showNationalAddressIcon = false), t.has("selectedId") && this.selectedId && this.selectedId !== this.inputValue && this.isSaudiFormMode() && this.isShortAddressFormat(this.selectedId) && (this.inputValue = this.selectedId || "", this.showNationalAddressIcon = true, this._internals.setFormValue(this.selectedId || "")), t.has("debounceDelay") && this.initializeDebounce();
927
- }
928
- createNewSession() {
929
- this.useSessionToken && (this.sessionToken = Ze());
930
- }
931
- terminateSession() {
932
- this.sessionToken = null;
933
- }
934
- cancelPendingRequest() {
935
- this.abortController && (this.abortController.abort(), this.abortController = null);
936
- }
937
- isSaudiFormMode() {
938
- return this.mode === "form" && this.country !== null && this.country.length === 1 && this.country[0].toLowerCase() === "sa";
939
- }
940
- getWhatsAppLink() {
941
- const t = "966112898888", e = encodeURIComponent("العنوان الوطني");
942
- return `https://wa.me/${t}?text=${e}`;
943
- }
944
- renderWhatsAppIcon() {
945
- return g`
946
- <svg class="whatsapp-icon" viewBox="0 0 24 24" fill="currentColor" part="whatsapp-icon">
947
- <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"/>
948
- </svg>
949
- `;
950
- }
951
- getSaudiHelpTextContent() {
952
- return {
953
- helpText: this.language === "ar" ? "لا تعرف العنوان الوطني؟" : "Don't know your national address?",
954
- linkText: this.language === "ar" ? "احصل على العنوان الوطني عبر الواتساب" : "Get your national address via WhatsApp"
955
- };
956
- }
957
- renderSaudiFriendlyError() {
958
- const t = this.inputValue && this.inputValue.trim().length > 0;
959
- let e, i;
960
- t ? (e = "العنوان الوطني المختصر غير صحيح (الصيغة: AAAA1234). يمكنك الحصول عليه بسهولة", i = "The short national address format is incorrect (format: AAAA1234). You can easily get it") : (e = "العنوان الوطني المختصر مطلوب. يمكنك الحصول عليه بسهولة", i = "The short national address is required. You can easily get it");
961
- const r = "عبر الواتساب (اضغط هنا)", s = "via WhatsApp (click here)", o = "أو ابحث أعلاه", a = "or search above", n = this.language === "ar" ? e : i, l = this.language === "ar" ? r : s, m = this.language === "ar" ? o : a;
962
- return g`
963
- <span>
964
- ${n}
965
- <a
966
- href="${this.getWhatsAppLink()}"
967
- target="_blank"
968
- rel="noopener noreferrer"
969
- class="whatsapp-link-inline"
970
- part="whatsapp-link"
971
- >
972
- ${this.renderWhatsAppIcon()}
973
- ${l}
974
- </a>
975
- ${m}
976
- </span>
977
- `;
978
- }
979
- renderSaudiHelpText() {
980
- if (!this.isSaudiFormMode() || this.validationError || this.errors && this.errors.length > 0)
981
- return "";
982
- const t = "لا تعرف العنوان الوطني؟ احصل عليه بسهولة", e = "Don't know your national address? Get it easily", i = "عبر الواتساب (اضغط هنا)", r = "via WhatsApp (click here)", s = "أو ابحث أعلاه", o = "or search above", a = this.language === "ar" ? t : e, n = this.language === "ar" ? i : r, l = this.language === "ar" ? s : o;
983
- return g`
984
- <div class="help-text" part="help-text">
985
- <span>
986
- ${a}
987
- <a
988
- href="${this.getWhatsAppLink()}"
989
- target="_blank"
990
- rel="noopener noreferrer"
991
- class="whatsapp-link-inline"
992
- part="whatsapp-link"
993
- >
994
- ${this.renderWhatsAppIcon()}
995
- ${n}
996
- </a>
997
- ${l}
998
- </span>
999
- </div>
1000
- `;
1001
- }
1002
- async fetchPredictions(t) {
1003
- if (!t.trim()) {
1004
- this.predictions = [], this.isOpen = false, this.isLoading = false;
1005
- return;
1006
- }
1007
- if (t.trim().length < this.minChars) {
1008
- this.predictions = [], this.isOpen = false, this.isLoading = false;
1009
- return;
1010
- }
1011
- this.cancelPendingRequest(), this.abortController = new AbortController();
1012
- const e = this.abortController.signal;
1013
- this.isLoading = true, this.error = null;
1014
- try {
1015
- const i = { input: t, language: this.language };
1016
- 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");
1017
- const r = new URLSearchParams(i), o = `${this.proxyUrl || ""}/store/v1/checkout/address/autocomplete/query?${r.toString()}`, a = {};
1018
- this.authToken && (a.Authorization = `Bearer ${this.authToken}`);
1019
- const n = await fetch(o, { signal: e, headers: a });
1020
- if (!n.ok)
1021
- throw new Error(`HTTP ${n.status}: ${n.statusText}`);
1022
- const l = await n.json();
1023
- l.success && Array.isArray(l.data) ? (this.error = null, l.data.length > 0 ? (this.predictions = l.data.map((c) => ({
1024
- place_id: c.id,
1025
- description: c.description || c.formatted_address,
1026
- formatted_address: c.formatted_address,
1027
- short_address: c.short_address,
1028
- structured_formatting: {
1029
- main_text: c.formatted_address || c.description,
1030
- main_text_matched_substrings: [],
1031
- secondary_text: c.description || ""
1032
- },
1033
- types: c.types || [],
1034
- geometry: c.geometry,
1035
- address_components: c.address_components
1036
- })), this.isOpen = true, this.activeIndex = -1) : (this.predictions = [], this.isOpen = true)) : (this.predictions = [], this.isOpen = true);
1037
- } catch (i) {
1038
- if (i instanceof Error && i.name === "AbortError")
1039
- return;
1040
- this.predictions = [], this.isOpen = true;
1041
- } finally {
1042
- this.isLoading = false, this.abortController = null;
1043
- }
1044
- }
1045
- async fetchPlaceDetails(t) {
1046
- this.isLoading = true, this.error = null;
1047
- try {
1048
- const e = { place_id: t, language: this.language };
1049
- 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");
1050
- const i = new URLSearchParams(e), s = `${this.proxyUrl || ""}/store/v1/checkout/address/autocomplete/details?${i.toString()}`, o = {};
1051
- this.authToken && (o.Authorization = `Bearer ${this.authToken}`);
1052
- const a = await fetch(s, { headers: o });
1053
- if (!a.ok)
1054
- throw new Error(`HTTP ${a.status}: ${a.statusText}`);
1055
- const n = await a.json();
1056
- return !n.success || n.message ? (this.error = n.message || "Failed to fetch place details", null) : n.success && n.data && n.data.id ? {
1057
- place_id: n.data.id,
1058
- ...n.data,
1059
- components: n.data.address_components?.reduce((m, c) => (c.types?.forEach((u) => {
1060
- m[u] || (m[u] = []), m[u].push({
1061
- long_name: c.long_name,
1062
- short_name: c.short_name
1063
- });
1064
- }), m), {})
1065
- } : null;
1066
- } catch (e) {
1067
- console.error("Error fetching place details:", e);
1068
- const i = q$1(this.language);
1069
- return this.error = e instanceof Error ? e.message : i.errorFetchDetails, null;
1070
- } finally {
1071
- this.isLoading = false;
1072
- }
1073
- }
1074
- /**
1075
- * Validates the selected address using the provided callback
1076
- * @param place - The place details to validate
1077
- * @returns Promise resolving to validation result
1078
- */
1079
- async validateAddress(t) {
1080
- try {
1081
- if (!t || !t.formatted_address)
1082
- return console.error("Cannot validate address - place or formatted_address is missing"), null;
1083
- if (!this.onValidateAddress || typeof this.onValidateAddress != "function")
1084
- return console.error("onValidateAddress callback is required for address validation"), null;
1085
- const e = ne(t, this.country), i = await this.onValidateAddress({
1086
- place: t,
1087
- sessionToken: this.sessionToken,
1088
- validationSupport: e
1089
- });
1090
- return this.terminateSession(), i;
1091
- } catch (e) {
1092
- return console.error("Error validating address:", e), this.terminateSession(), null;
1093
- }
1094
- }
1095
- /**
1096
- * Gets validation support information for a place
1097
- * @param place - The place details to check
1098
- * @returns ValidationSupport object indicating what validation is supported
1099
- */
1100
- getValidationSupport(t) {
1101
- return ne(t, this.country);
1102
- }
1103
- checkValidity() {
1104
- return this.validate();
1105
- }
1106
- reportValidity() {
1107
- this.touched = true;
1108
- const t = this.validate();
1109
- return t || this.dispatchEvent(new CustomEvent("invalid", {
1110
- detail: { error: this.validationError },
1111
- bubbles: true,
1112
- composed: true
1113
- })), t;
1114
- }
1115
- /**
1116
- * Resets the component to its initial state
1117
- */
1118
- reset() {
1119
- this.inputValue = "", this.selectedId = null, this.validationError = null, this.errors = [], this.touched = false, this.predictions = [], this.isOpen = false, this.error = null, this.showNationalAddressIcon = false, this.mode === "form" && (this._internals.setFormValue(null), this._internals.setValidity({}));
1120
- }
1121
- // Form lifecycle callbacks
1122
- formResetCallback() {
1123
- this.reset();
1124
- }
1125
- formStateRestoreCallback(t) {
1126
- t && this.mode === "form" && (this.selectedId = t);
1127
- }
1128
- validate() {
1129
- if (this.mode !== "form")
1130
- return true;
1131
- const t = q$1(this.language), e = this.inputValue || "";
1132
- return this.required && !e.trim() ? (this.validationError = t.validationRequired, this._internals.setValidity(
1133
- { valueMissing: true },
1134
- this.validationError,
1135
- this.inputElement
1136
- ), false) : this.isSaudiFormMode() && e.trim() && !this.isShortAddressFormat(e) ? (this.validationError = t.validationSaudiFormat, this._internals.setValidity(
1137
- { patternMismatch: true },
1138
- this.validationError,
1139
- this.inputElement
1140
- ), false) : this.pattern && e.trim() && !new RegExp(this.pattern).test(e) ? (this.validationError = t.validationPattern, this._internals.setValidity(
1141
- { patternMismatch: true },
1142
- this.validationError,
1143
- this.inputElement
1144
- ), false) : (this.validationError = null, this._internals.setValidity({}), true);
1145
- }
1146
- /**
1147
- * Normalize numerals from various scripts to Arabic numerals (0-9).
1148
- * Handles Arabic-Indic, Devanagari (Hindi), Persian, and Bengali numerals.
1149
- * Works consistently across all browsers and operating systems.
1150
- */
1151
- normalizeNumerals(t) {
1152
- if (!t) return t;
1153
- const e = {
1154
- // Arabic-Indic numerals (used in Arab countries): ٠١٢٣٤٥٦٧٨٩
1155
- "٠": "0",
1156
- "١": "1",
1157
- "٢": "2",
1158
- "٣": "3",
1159
- "٤": "4",
1160
- "٥": "5",
1161
- "٦": "6",
1162
- "٧": "7",
1163
- "٨": "8",
1164
- "٩": "9",
1165
- // Devanagari (Hindi) numerals (used in India, Nepal): ०१२३४५६७८९
1166
- "०": "0",
1167
- "१": "1",
1168
- "२": "2",
1169
- "३": "3",
1170
- "४": "4",
1171
- "५": "5",
1172
- "६": "6",
1173
- "७": "7",
1174
- "८": "8",
1175
- "९": "9",
1176
- // Persian/Dari numerals (used in Iran, Afghanistan): ۰۱۲۳۴۵۶۷۸۹
1177
- "۰": "0",
1178
- "۱": "1",
1179
- "۲": "2",
1180
- "۳": "3",
1181
- "۴": "4",
1182
- "۵": "5",
1183
- "۶": "6",
1184
- "۷": "7",
1185
- "۸": "8",
1186
- "۹": "9",
1187
- // Bengali numerals (used in Bangladesh, India): ০১২৩৪৫৬৭৮৯
1188
- "০": "0",
1189
- "১": "1",
1190
- "২": "2",
1191
- "৩": "3",
1192
- "৪": "4",
1193
- "৫": "5",
1194
- "৬": "6",
1195
- "৭": "7",
1196
- "৮": "8",
1197
- "৯": "9"
1198
- };
1199
- return t.split("").map((i) => e[i] ?? i).join("");
1200
- }
1201
- handleInput(t) {
1202
- if (this.disabled) return;
1203
- const e = t.target, i = e.selectionStart ?? 0, r = this.inputValue, s = e.value, o = this.normalizeNumerals(s);
1204
- o !== s && (e.value = o, requestAnimationFrame(() => {
1205
- e.setSelectionRange(i, i);
1206
- })), this.inputValue = o, this.touched = true, this.showNationalAddressIcon && (this.showNationalAddressIcon = false), this.mode === "form" && (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 = true), this.debouncedFetch(this.inputValue), this._value = this.inputValue, this.requestUpdate("value", r), this.dispatchEvent(new CustomEvent("input", {
1207
- detail: { value: this.inputValue },
1208
- bubbles: true,
1209
- composed: true
1210
- })), this.dispatchEvent(new Event("change", {
1211
- bubbles: true,
1212
- composed: true
1213
- })), this.dispatchEvent(new InputEvent("input", {
1214
- data: this.inputValue,
1215
- bubbles: true,
1216
- composed: true
1217
- }));
1218
- }
1219
- async handleSelect(t) {
1220
- if (this.disabled) return;
1221
- this.isSaudiFormMode() && t.place_id && this.isShortAddressFormat(t.place_id) ? (this.inputValue = t.place_id, this.showNationalAddressIcon = true) : (this.inputValue = t.formatted_address, this.showNationalAddressIcon = false), this.isOpen = false, this.predictions = [], this.touched = true;
1222
- let e = null;
1223
- if (this.mode === "form" ? e = await this.fetchPlaceDetails(t.place_id) : t.geometry?.location ? e = {
1224
- place_id: t.place_id,
1225
- formatted_address: t.formatted_address || t.description,
1226
- geometry: t.geometry,
1227
- types: t.types,
1228
- address_components: t.address_components
1229
- } : e = await this.fetchPlaceDetails(t.place_id), e) {
1230
- this.isSaudiFormMode() && e.place_id && this.isShortAddressFormat(e.place_id) ? (this.inputValue = e.place_id, this.showNationalAddressIcon = true) : (e.formatted_address && (this.inputValue = e.formatted_address), this.showNationalAddressIcon = false), this.mode === "form" && (this.selectedId = e.place_id, this._internals.setFormValue(this.inputValue), this.validate()), this._value = this.inputValue, this.dispatchEvent(new CustomEvent("input", {
1231
- detail: { value: this.inputValue },
1232
- bubbles: true,
1233
- composed: true
1234
- })), this.dispatchEvent(new Event("change", {
1235
- bubbles: true,
1236
- composed: true
1237
- }));
1238
- const i = this.getValidationSupport(e);
1239
- this.dispatchEvent(new CustomEvent("place-select", {
1240
- detail: { place: e, validationSupport: i },
1241
- bubbles: true,
1242
- composed: true
1243
- })), this.dispatchEvent(new CustomEvent("place-changed", {
1244
- detail: { place: e, validationSupport: i },
1245
- bubbles: true,
1246
- composed: true
1247
- }));
1248
- }
1249
- }
1250
- handleKeyDown(t) {
1251
- if (!this.disabled && !(!this.isOpen || this.predictions.length === 0))
1252
- switch (t.key) {
1253
- case "ArrowDown":
1254
- t.preventDefault(), this.activeIndex = Math.min(this.activeIndex + 1, this.predictions.length - 1);
1255
- break;
1256
- case "ArrowUp":
1257
- t.preventDefault(), this.activeIndex = Math.max(this.activeIndex - 1, -1);
1258
- break;
1259
- case "Enter":
1260
- t.preventDefault(), this.activeIndex >= 0 && this.activeIndex < this.predictions.length && this.handleSelect(this.predictions[this.activeIndex]);
1261
- break;
1262
- case "Escape":
1263
- t.preventDefault(), this.isOpen = false, this.activeIndex = -1;
1264
- break;
1265
- }
1266
- }
1267
- handleBlur() {
1268
- setTimeout(() => {
1269
- this.isOpen = false, this.activeIndex = -1, this.mode === "form" && this.touched && this.validate(), this.dispatchEvent(new Event("blur", {
1270
- bubbles: true,
1271
- composed: true
1272
- }));
1273
- }, 200);
1274
- }
1275
- handleFocus() {
1276
- this.disabled || this.predictions.length > 0 && (this.isOpen = true);
1277
- }
1278
- renderLocationIcon() {
1279
- return g`
1280
- <svg class="location-icon" fill="currentColor" viewBox="0 0 20 20">
1281
- <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" />
1282
- </svg>
1283
- `;
1284
- }
1285
- renderTooltip() {
1286
- return this.tooltip ? g`
1287
- <span class="tooltip-toggle" part="tooltip-toggle">
1288
- <svg class="tooltip-icon" part="tooltip-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
1289
- <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" />
1290
- </svg>
1291
- <span class="tooltip-content" part="tooltip-content">${this.tooltip}</span>
1292
- </span>
1293
- ` : "";
1294
- }
1295
- renderPrediction(t, e) {
1296
- const i = {
1297
- "dropdown-item": true,
1298
- active: e === this.activeIndex
1299
- };
1300
- let r = t.structured_formatting.main_text;
1301
- return t.short_address && r.includes(t.short_address) && (r = r.replace(t.short_address, "").trim(), r = r.replace(/\s*,\s*,\s*/g, ", ").replace(/^\s*,\s*|\s*,\s*$/g, "").trim()), g`
1302
- <div
1303
- class=${U$1(i)}
1304
- part="dropdown-item ${e === this.activeIndex ? "dropdown-item-active" : ""}"
1305
- @click=${() => this.handleSelect(t)}
1306
- role="option"
1307
- aria-selected=${e === this.activeIndex}
1308
- >
1309
- ${this.renderLocationIcon()}
1310
- <div class="place-info" part="place-info">
1311
- <div class="main-text" part="main-text">
1312
- ${t.short_address ? g`
1313
- <span class="national-address-badge" part="national-address-badge">
1314
- <img
1315
- src="https://cdn.salla.network/images/shipping/png/national-address-icon-small-min.png"
1316
- alt="national address icon"
1317
- class="national-address-icon"
1318
- />
1319
- <span class="national-address-text">${t.short_address}</span>
1320
- <span class="national-address-separator">-</span>
1321
- </span>
1322
- ` : ""}
1323
- ${r}
1324
- </div>
1325
- ${t.structured_formatting.secondary_text ? g`
1326
- <div class="secondary-text" part="secondary-text">
1327
- ${t.structured_formatting.secondary_text}
1328
- </div>
1329
- ` : ""}
1330
- </div>
1331
- </div>
1332
- `;
1333
- }
1334
- render() {
1335
- const t = {
1336
- dropdown: true,
1337
- open: this.isOpen
1338
- }, e = {
1339
- "is-invalid": !!(this.mode === "form" && this.validationError) || this.errors && this.errors.length > 0,
1340
- "with-national-icon": this.showNationalAddressIcon
1341
- }, i = {
1342
- required: this.mode === "form" && this.required
1343
- }, r = q$1(this.language), s = this.dir === "auto" ? Xe(this.language) ? "rtl" : "ltr" : this.dir, o = this.placeholder || r.placeholder, a = this.name || "salla-address-search";
1344
- return g`
1345
- <div class="wrapper ${this.className}" part="wrapper" dir="${s}">
1346
- <div class="input-container" part="input-container">
1347
- ${this.label ? g`
1348
- <label part="label" class=${U$1(i)}>
1349
- <span class="label-content">
1350
- <span>${this.label}</span>
1351
- ${this.renderTooltip()}
1352
- </span>
1353
- </label>
1354
- ` : ""}
1355
- <div class="input-wrapper">
1356
- <input
1357
- part="input"
1358
- class=${U$1(e)}
1359
- type="text"
1360
- name="${a}"
1361
- .value=${Ke(this.inputValue)}
1362
- placeholder=${o}
1363
- ?disabled=${this.disabled}
1364
- @input=${this.handleInput}
1365
- @keydown=${this.handleKeyDown}
1366
- @blur=${this.handleBlur}
1367
- @focus=${this.handleFocus}
1368
- role="combobox"
1369
- aria-expanded=${this.isOpen}
1370
- aria-autocomplete="list"
1371
- aria-controls="predictions-list"
1372
- aria-invalid=${this.mode === "form" && this.validationError || this.errors && this.errors.length > 0 ? "true" : "false"}
1373
- aria-required=${this.mode === "form" && this.required ? "true" : "false"}
1374
- autocomplete="off"
1375
- autocorrect="off"
1376
- autocapitalize="off"
1377
- spellcheck="false"
1378
- />
1379
- ${this.isLoading ? g`<div class="loading-spinner" part="spinner"></div>` : ""}
1380
-
1381
- <div
1382
- id="predictions-list"
1383
- class=${U$1(t)}
1384
- part="dropdown"
1385
- role="listbox"
1386
- >
1387
- ${this.predictions.length > 0 ? this.predictions.map((n, l) => this.renderPrediction(n, l)) : this.inputValue && !this.isLoading ? g`<div class="no-results" part="no-results">${r.noResults}</div>` : ""}
1388
- </div>
1389
- </div>
1390
- ${this.mode === "form" && this.validationError ? g`
1391
- <div class="validation-error" part="validation-error">
1392
- ${this.isSaudiFormMode() ? this.renderSaudiFriendlyError() : g`<span>${this.validationError}</span>`}
1393
- </div>
1394
- ` : ""}
1395
- ${this.errors && this.errors.length > 0 ? g`
1396
- <div class="validation-error" part="validation-error">${this.errors[0]}</div>
1397
- ` : ""}
1398
- ${this.error ? g`<div class="error-message" part="error">${this.error}</div>` : ""}
1399
- ${this.renderSaudiHelpText()}
1400
- </div>
1401
- </div>
1402
- `;
1403
- }
1404
- };
1405
- d$1.formAssociated = true;
1406
- d$1.styles = ve`
1407
- :host {
1408
- display: block;
1409
- position: relative;
1410
- font-family: var(--salla-autocomplete-font-family, system-ui, -apple-system, sans-serif);
1411
- }
1412
-
1413
- .wrapper {
1414
- position: relative;
1415
- }
1416
-
1417
- .input-container {
1418
- display: flex;
1419
- flex-direction: column;
1420
- }
1421
-
1422
- .input-wrapper {
1423
- position: relative;
1424
- }
1425
-
1426
- label {
1427
- display: block;
1428
- margin-bottom: var(--salla-autocomplete-label-margin, 0.5rem);
1429
- font-size: var(--salla-autocomplete-label-font-size, 0.875rem);
1430
- font-weight: var(--salla-autocomplete-label-font-weight, 500);
1431
- color: var(--salla-autocomplete-label-color, #374151);
1432
- }
1433
-
1434
- label.required::after {
1435
- content: ' *';
1436
- color: var(--salla-autocomplete-required-color, #dc2626);
1437
- }
1438
-
1439
- .label-content {
1440
- display: inline-flex;
1441
- align-items: center;
1442
- gap: 0.5rem;
1443
- }
1444
-
1445
- .tooltip-toggle {
1446
- position: relative;
1447
- display: inline-flex;
1448
- align-items: center;
1449
- cursor: help;
1450
- }
1451
-
1452
- .tooltip-icon {
1453
- width: 1rem;
1454
- height: 1rem;
1455
- color: var(--salla-autocomplete-tooltip-icon-color, #6b7280);
1456
- }
1457
-
1458
- .tooltip-content {
1459
- display: none;
1460
- position: absolute;
1461
- bottom: 125%;
1462
- left: 50%;
1463
- transform: translateX(-50%);
1464
- background: var(--salla-autocomplete-tooltip-bg, #1f2937);
1465
- color: var(--salla-autocomplete-tooltip-color, white);
1466
- padding: 0.5rem 0.75rem;
1467
- border-radius: 0.375rem;
1468
- font-size: 0.75rem;
1469
- line-height: 1.4;
1470
- white-space: nowrap;
1471
- z-index: 1000;
1472
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
1473
- }
1474
-
1475
- .tooltip-content::after {
1476
- content: '';
1477
- position: absolute;
1478
- top: 100%;
1479
- left: 50%;
1480
- transform: translateX(-50%);
1481
- border: 5px solid transparent;
1482
- border-top-color: var(--salla-autocomplete-tooltip-bg, #1f2937);
1483
- }
1484
-
1485
- .tooltip-toggle:hover .tooltip-content,
1486
- .tooltip-toggle:focus .tooltip-content {
1487
- display: block;
1488
- }
1489
-
1490
- input {
1491
- width: 100%;
1492
- padding-block: 0.75rem;
1493
- padding-inline-start: var(--salla-autocomplete-input-padding-start, 0.875rem);
1494
- padding-inline-end: var(--salla-autocomplete-input-padding-end, 2.75rem);
1495
- font-family: var(--salla-autocomplete-font-family, system-ui, -apple-system, sans-serif);
1496
- font-size: var(--salla-autocomplete-input-font-size, 1rem);
1497
- line-height: var(--salla-autocomplete-input-line-height, 1.5);
1498
- border: var(--salla-autocomplete-input-border, 1px solid #d1d5db);
1499
- border-radius: var(--salla-autocomplete-input-border-radius, 0.5rem);
1500
- background: var(--salla-autocomplete-input-background, white);
1501
- color: var(--salla-autocomplete-input-color, #111827);
1502
- outline: none;
1503
- transition: all 0.2s;
1504
- box-sizing: border-box;
1505
- height: var(--salla-autocomplete-input-height, auto);
1506
- min-height: var(--salla-autocomplete-input-height, 44px);
1507
- -webkit-appearance: none;
1508
- appearance: none;
1509
- }
1510
-
1511
- input.with-national-icon {
1512
- padding-inline-start: var(--salla-autocomplete-input-padding-start-icon, 2rem);
1513
- background-image: url('https://cdn.salla.network/images/shipping/png/national-address-icon-small-min.png');
1514
- background-repeat: no-repeat;
1515
- background-position: 0.75rem center;
1516
- background-size: 16px;
1517
- }
1518
-
1519
- input.with-national-icon[dir="rtl"],
1520
- :host([dir="rtl"]) input.with-national-icon {
1521
- padding-inline-start: var(--salla-autocomplete-input-padding-start, 0.875rem);
1522
- padding-inline-end: var(--salla-autocomplete-input-padding-end-icon, 2.75rem);
1523
- background-position: calc(100% - 0.75rem) center;
1524
- }
1525
-
1526
- @media (max-width: 640px) {
1527
- input {
1528
- font-size: var(--salla-autocomplete-input-font-size-mobile, 16px);
1529
- padding-block: 0.75rem;
1530
- padding-inline-start: var(--salla-autocomplete-input-padding-start-mobile, 0.875rem);
1531
- padding-inline-end: var(--salla-autocomplete-input-padding-end-mobile, 2.75rem);
1532
- min-height: 44px;
1533
- touch-action: manipulation;
1534
- }
1535
-
1536
- input.with-national-icon {
1537
- padding-inline-start: var(--salla-autocomplete-input-padding-start-icon-mobile, 2rem);
1538
- background-position: 0.875rem center;
1539
- }
1540
-
1541
- input.with-national-icon[dir="rtl"],
1542
- :host([dir="rtl"]) input.with-national-icon {
1543
- padding-inline-start: var(--salla-autocomplete-input-padding-start-mobile, 0.875rem);
1544
- padding-inline-end: var(--salla-autocomplete-input-padding-end-icon-mobile, 2.75rem);
1545
- background-position: calc(100% - 0.875rem) center;
1546
- }
1547
- }
1548
-
1549
- input:focus {
1550
- border-color: var(--salla-autocomplete-input-focus-border-color, #3b82f6);
1551
- box-shadow: var(--salla-autocomplete-input-focus-shadow, 0 0 0 3px rgba(59, 130, 246, 0.1));
1552
- }
1553
-
1554
- input:disabled {
1555
- background-color: var(--salla-autocomplete-input-disabled-bg, #f3f4f6);
1556
- cursor: not-allowed;
1557
- }
1558
-
1559
- input.is-invalid {
1560
- border-color: var(--salla-autocomplete-input-error-border-color, #dc2626);
1561
- }
1562
-
1563
- input.is-invalid:focus {
1564
- border-color: var(--salla-autocomplete-input-error-border-color, #dc2626);
1565
- box-shadow: var(--salla-autocomplete-input-error-shadow, 0 0 0 3px rgba(220, 38, 38, 0.1));
1566
- }
1567
-
1568
- input::placeholder {
1569
- color: var(--salla-autocomplete-input-placeholder-color, #9ca3af);
1570
- }
1571
-
1572
- .validation-error {
1573
- display: flex;
1574
- flex-wrap: wrap;
1575
- align-items: center;
1576
- gap: 0.5rem;
1577
- margin-top: 0.375rem;
1578
- font-size: var(--salla-autocomplete-error-font-size, 0.875rem);
1579
- color: var(--salla-autocomplete-error-color, #dc2626);
1580
- line-height: 1.5;
1581
- }
1582
-
1583
- .validation-error > span {
1584
- line-height: 1.5;
1585
- }
1586
-
1587
- .whatsapp-link-inline {
1588
- color: var(--salla-autocomplete-whatsapp-brand-color, #25D366);
1589
- white-space: nowrap;
1590
- line-height: inherit;
1591
- display: inline-flex;
1592
- align-items: center;
1593
- vertical-align: middle;
1594
- text-decoration: underline;
1595
- cursor: pointer;
1596
- transition: all 0.2s ease;
1597
- gap: 0.25rem;
1598
- margin-inline: 0.25rem;
1599
- font-weight: 500;
1600
- }
1601
-
1602
- .whatsapp-link-inline:hover {
1603
- color: var(--salla-autocomplete-whatsapp-brand-hover, #1da851);
1604
- opacity: 0.9;
1605
- }
1606
-
1607
- .whatsapp-link-inline:active {
1608
- transform: scale(0.98);
1609
- }
1610
-
1611
- .whatsapp-link-inline .whatsapp-icon {
1612
- color: var(--salla-autocomplete-whatsapp-brand-color, #25D366);
1613
- }
1614
-
1615
- .help-text {
1616
- display: block;
1617
- margin-top: 0.5rem;
1618
- font-size: var(--salla-autocomplete-help-font-size, 0.875rem);
1619
- color: var(--salla-autocomplete-help-color, #6b7280);
1620
- line-height: 1.5;
1621
- }
1622
-
1623
- .help-text span {
1624
- line-height: 1.5;
1625
- }
1626
-
1627
- .whatsapp-icon {
1628
- width: 1rem;
1629
- height: 1rem;
1630
- }
1631
-
1632
- .loading-spinner {
1633
- position: absolute;
1634
- inset-inline-end: 0.875rem;
1635
- top: 50%;
1636
- transform: translateY(-50%);
1637
- width: var(--salla-autocomplete-spinner-size, 1.25rem);
1638
- height: var(--salla-autocomplete-spinner-size, 1.25rem);
1639
- border: 2px solid var(--salla-autocomplete-spinner-border-color, #e5e7eb);
1640
- border-top-color: var(--salla-autocomplete-spinner-color, #3b82f6);
1641
- border-radius: 50%;
1642
- animation: spin 0.6s linear infinite;
1643
- }
1644
-
1645
- @media (max-width: 640px) {
1646
- .loading-spinner {
1647
- width: var(--salla-autocomplete-spinner-size-mobile, 1.375rem);
1648
- height: var(--salla-autocomplete-spinner-size-mobile, 1.375rem);
1649
- inset-inline-end: 1rem;
1650
- }
1651
- }
1652
-
1653
- @keyframes spin {
1654
- to { transform: translateY(-50%) rotate(360deg); }
1655
- }
1656
-
1657
- /* Custom scrollbar styling */
1658
- .dropdown::-webkit-scrollbar {
1659
- width: 6px;
1660
- }
1661
-
1662
- .dropdown::-webkit-scrollbar-track {
1663
- background: #f1f1f1;
1664
- border-radius: 3px;
1665
- }
1666
-
1667
- .dropdown::-webkit-scrollbar-thumb {
1668
- background: #c1c1c1;
1669
- border-radius: 3px;
1670
- }
1671
-
1672
- .dropdown::-webkit-scrollbar-thumb:hover {
1673
- background: #a8a8a8;
1674
- }
1675
-
1676
- .dropdown {
1677
- position: absolute;
1678
- top: 100%;
1679
- left: 0;
1680
- right: 0;
1681
- margin-top: var(--salla-autocomplete-dropdown-margin-top, 0.375rem);
1682
- background: var(--salla-autocomplete-dropdown-background, white);
1683
- border: var(--salla-autocomplete-dropdown-border, 1px solid #e5e7eb);
1684
- border-radius: var(--salla-autocomplete-dropdown-border-radius, 0.5rem);
1685
- 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));
1686
- max-height: var(--salla-autocomplete-dropdown-max-height, 240px);
1687
- overflow-y: auto;
1688
- overflow-x: hidden;
1689
- z-index: var(--salla-autocomplete-dropdown-z-index, 100);
1690
- display: none;
1691
- -webkit-overflow-scrolling: touch;
1692
- overscroll-behavior: contain;
1693
- scroll-behavior: smooth;
1694
- }
1695
-
1696
- @media (max-width: 640px) {
1697
- .dropdown {
1698
- max-height: var(--salla-autocomplete-dropdown-max-height-mobile, 25vh);
1699
- border-radius: var(--salla-autocomplete-dropdown-border-radius-mobile, 0.5rem);
1700
- margin-top: var(--salla-autocomplete-dropdown-margin-top-mobile, 0.25rem);
1701
- }
1702
- }
1703
-
1704
- @media (max-width: 640px) and (max-height: 667px) {
1705
- /* Smaller phones (iPhone SE, iPhone 8, etc.) */
1706
- .dropdown {
1707
- max-height: var(--salla-autocomplete-dropdown-max-height-small, 22vh);
1708
- }
1709
- }
1710
-
1711
- @media (max-width: 640px) and (min-height: 668px) and (max-height: 896px) {
1712
- /* Standard phones (iPhone 12, iPhone 13, etc.) */
1713
- .dropdown {
1714
- max-height: var(--salla-autocomplete-dropdown-max-height-standard, 28vh);
1715
- }
1716
- }
1717
-
1718
- @media (max-width: 640px) and (min-height: 897px) {
1719
- /* Larger phones (iPhone 14 Pro Max, etc.) */
1720
- .dropdown {
1721
- max-height: var(--salla-autocomplete-dropdown-max-height-large, 30vh);
1722
- }
1723
- }
1724
-
1725
- .dropdown.open {
1726
- display: block;
1727
- }
1728
-
1729
- .dropdown-item {
1730
- display: flex;
1731
- align-items: flex-start;
1732
- padding: var(--salla-autocomplete-item-padding, 0.625rem 0.75rem);
1733
- cursor: pointer;
1734
- transition: background-color 0.15s;
1735
- border-bottom: 1px solid var(--salla-autocomplete-item-border-color, #e5e7eb);
1736
- min-height: 35px;
1737
- -webkit-tap-highlight-color: transparent;
1738
- }
1739
-
1740
- @media (max-width: 640px) {
1741
- .dropdown-item {
1742
- padding: var(--salla-autocomplete-item-padding-mobile, 0.75rem 0.875rem);
1743
- min-height: 35px;
1744
- }
1745
- }
1746
-
1747
- .dropdown-item:last-child {
1748
- border-bottom: none;
1749
- }
1750
-
1751
- .dropdown-item:hover,
1752
- .dropdown-item.selected {
1753
- background-color: var(--salla-autocomplete-item-hover-bg, #f9fafb);
1754
- }
1755
-
1756
- .dropdown-item.active {
1757
- background-color: var(--salla-autocomplete-item-active-bg, #eff6ff);
1758
- }
1759
-
1760
- @media (hover: none) and (pointer: coarse) {
1761
- .dropdown-item:hover {
1762
- background-color: transparent;
1763
- }
1764
-
1765
- .dropdown-item:active {
1766
- background-color: var(--salla-autocomplete-item-active-bg, #eff6ff);
1767
- }
1768
- }
1769
-
1770
- .location-icon {
1771
- display: none;
1772
- }
1773
-
1774
- .place-info {
1775
- flex: 1;
1776
- min-width: 0;
1777
- display: flex;
1778
- flex-direction: column;
1779
- gap: 0.25rem;
1780
- }
1781
-
1782
- .main-text {
1783
- font-size: var(--salla-autocomplete-main-text-font-size, 0.875rem);
1784
- font-weight: var(--salla-autocomplete-main-text-font-weight, 600);
1785
- color: var(--salla-autocomplete-main-text-color, #111827);
1786
- line-height: 1.4;
1787
- word-wrap: break-word;
1788
- overflow-wrap: break-word;
1789
- hyphens: auto;
1790
- }
1791
-
1792
- @media (max-width: 640px) {
1793
- .main-text {
1794
- font-size: var(--salla-autocomplete-main-text-font-size-mobile, 0.9375rem);
1795
- line-height: 1.3;
1796
- }
1797
- }
1798
-
1799
- .main-text .highlight {
1800
- font-weight: var(--salla-autocomplete-highlight-font-weight, 700);
1801
- color: var(--salla-autocomplete-highlight-color, inherit);
1802
- }
1803
-
1804
- .national-address-badge {
1805
- display: inline-flex;
1806
- align-items: center;
1807
- font-size: 0.8125rem;
1808
- line-height: 1;
1809
- vertical-align: middle;
1810
- }
1811
-
1812
- .national-address-icon {
1813
- width: 11px;
1814
- height: auto;
1815
- flex-shrink: 0;
1816
- display: inline-block;
1817
- }
1818
-
1819
- .national-address-text {
1820
- padding-inline-start: 3px;
1821
- -webkit-text-fill-color: transparent;
1822
- background-clip: text;
1823
- -webkit-background-clip: text;
1824
- background-image: linear-gradient(135deg, #0052cc, #00b8d9 50%, #36b37e);
1825
- font-weight: 600;
1826
- display: inline-block;
1827
- }
1828
-
1829
- .national-address-separator {
1830
- padding-inline: 4px;
1831
- color: #6b7280;
1832
- display: inline-block;
1833
- }
1834
-
1835
- .secondary-text {
1836
- font-size: var(--salla-autocomplete-secondary-text-font-size, 0.75rem);
1837
- color: var(--salla-autocomplete-secondary-text-color, #6b7280);
1838
- line-height: 1.4;
1839
- word-wrap: break-word;
1840
- overflow-wrap: break-word;
1841
- hyphens: auto;
1842
- }
1843
-
1844
- @media (max-width: 640px) {
1845
- .secondary-text {
1846
- font-size: var(--salla-autocomplete-secondary-text-font-size-mobile, 0.8125rem);
1847
- line-height: 1.3;
1848
- }
1849
- }
1850
-
1851
- .error-message {
1852
- margin-top: 0.5rem;
1853
- font-size: var(--salla-autocomplete-error-font-size, 0.875rem);
1854
- color: var(--salla-autocomplete-error-color, #dc2626);
1855
- }
1856
-
1857
- .no-results {
1858
- padding: 1rem;
1859
- text-align: start;
1860
- color: var(--salla-autocomplete-no-results-color, #6b7280);
1861
- font-size: var(--salla-autocomplete-no-results-font-size, 0.875rem);
1862
- }
1863
-
1864
- .no-results.error-state {
1865
- color: var(--salla-autocomplete-error-color, #dc2626);
1866
- background-color: var(--salla-autocomplete-error-bg, #fef2f2);
1867
- border-radius: 0.375rem;
1868
- margin: 0.5rem;
1869
- padding: 0.875rem;
1870
- }
1871
-
1872
- @media (max-width: 640px) {
1873
- .no-results {
1874
- padding: 0.875rem;
1875
- font-size: var(--salla-autocomplete-no-results-font-size-mobile, 0.8125rem);
1876
- }
1877
-
1878
- .no-results.error-state {
1879
- margin: 0.375rem;
1880
- padding: 0.75rem;
1881
- }
1882
- }
1883
- `;
1884
- h$1([
1885
- p({ type: String })
1886
- ], d$1.prototype, "proxyUrl", 2);
1887
- h$1([
1888
- p({ type: String })
1889
- ], d$1.prototype, "authToken", 2);
1890
- h$1([
1891
- p({ type: String })
1892
- ], d$1.prototype, "placeholder", 2);
1893
- h$1([
1894
- p({ type: String })
1895
- ], d$1.prototype, "defaultPlace", 2);
1896
- h$1([
1897
- p({ type: String })
1898
- ], d$1.prototype, "label", 2);
1899
- h$1([
1900
- p({ type: String })
1901
- ], d$1.prototype, "className", 2);
1902
- h$1([
1903
- p({ type: String })
1904
- ], d$1.prototype, "language", 2);
1905
- h$1([
1906
- p({ type: String })
1907
- ], d$1.prototype, "dir", 2);
1908
- h$1([
1909
- p({ type: String })
1910
- ], d$1.prototype, "mode", 2);
1911
- h$1([
1912
- p({ type: String })
1913
- ], d$1.prototype, "name", 2);
1914
- h$1([
1915
- p({ type: Boolean })
1916
- ], d$1.prototype, "required", 2);
1917
- h$1([
1918
- p({ type: String })
1919
- ], d$1.prototype, "pattern", 2);
1920
- h$1([
1921
- p({ type: String })
1922
- ], d$1.prototype, "tooltip", 2);
1923
- h$1([
1924
- p({ type: String })
1925
- ], d$1.prototype, "selectedId", 2);
1926
- h$1([
1927
- p({ type: Array })
1928
- ], d$1.prototype, "errors", 2);
1929
- h$1([
1930
- p({ type: Boolean })
1931
- ], d$1.prototype, "disabled", 2);
1932
- h$1([
1933
- p({ type: String })
1934
- ], d$1.prototype, "value", 1);
1935
- h$1([
1936
- p({ type: String })
1937
- ], d$1.prototype, "country", 1);
1938
- h$1([
1939
- p({ type: Object })
1940
- ], d$1.prototype, "locationBias", 2);
1941
- h$1([
1942
- p({ type: Object })
1943
- ], d$1.prototype, "locationRestriction", 2);
1944
- h$1([
1945
- p({ type: Array })
1946
- ], d$1.prototype, "types", 2);
1947
- h$1([
1948
- p({ type: String })
1949
- ], d$1.prototype, "fieldsStr", 1);
1950
- h$1([
1951
- p({ type: Array })
1952
- ], d$1.prototype, "fields", 1);
1953
- h$1([
1954
- p({ type: Boolean })
1955
- ], d$1.prototype, "strictBounds", 2);
1956
- h$1([
1957
- p({ type: Boolean })
1958
- ], d$1.prototype, "useSessionToken", 2);
1959
- h$1([
1960
- p({ type: Boolean })
1961
- ], d$1.prototype, "resolve", 2);
1962
- h$1([
1963
- p({ type: Function })
1964
- ], d$1.prototype, "onValidateAddress", 2);
1965
- h$1([
1966
- p({ type: Number })
1967
- ], d$1.prototype, "debounceDelay", 2);
1968
- h$1([
1969
- p({ type: Number })
1970
- ], d$1.prototype, "minChars", 2);
1971
- h$1([
1972
- b$1()
1973
- ], d$1.prototype, "predictions", 2);
1974
- h$1([
1975
- b$1()
1976
- ], d$1.prototype, "isOpen", 2);
1977
- h$1([
1978
- b$1()
1979
- ], d$1.prototype, "isLoading", 2);
1980
- h$1([
1981
- b$1()
1982
- ], d$1.prototype, "error", 2);
1983
- h$1([
1984
- b$1()
1985
- ], d$1.prototype, "activeIndex", 2);
1986
- h$1([
1987
- b$1()
1988
- ], d$1.prototype, "inputValue", 2);
1989
- h$1([
1990
- b$1()
1991
- ], d$1.prototype, "sessionToken", 2);
1992
- h$1([
1993
- b$1()
1994
- ], d$1.prototype, "validationError", 2);
1995
- h$1([
1996
- b$1()
1997
- ], d$1.prototype, "touched", 2);
1998
- h$1([
1999
- b$1()
2000
- ], d$1.prototype, "showNationalAddressIcon", 2);
2001
- h$1([
2002
- qe("input")
2003
- ], d$1.prototype, "inputElement", 2);
2004
- d$1 = h$1([
2005
- De("salla-address-autocomplete")
2006
- ], d$1);
2007
-
2008
- let K = false;
2009
- const W = /* @__PURE__ */ new Map();
2010
- const D = new Promise((t, e) => {
2011
- if (typeof window > "u") {
2012
- t();
2013
- return;
2014
- }
2015
- window.googleMapsInitCallback = t, window.gm_authFailure = () => {
2016
- e(new Error("Google Maps authentication failed"));
2017
- };
2018
- });
2019
- async function st(t) {
2020
- if (W.has(t))
2021
- return W.get(t);
2022
- if (await D, typeof google < "u" && google.maps && google.maps.importLibrary) {
2023
- const e = await google.maps.importLibrary(t);
2024
- return W.set(t, e), e;
2025
- }
2026
- return google.maps[t] || google.maps;
2027
- }
2028
- function ee(t, e, o) {
2029
- if (typeof document > "u")
2030
- return Promise.resolve();
2031
- if (K)
2032
- return D;
2033
- K = true;
2034
- let i;
2035
- if (typeof t == "string")
2036
- i = { key: t };
2037
- else if (typeof t == "object")
2038
- i = { ...t };
2039
- else
2040
- throw new Error("API key should be a string or an object");
2041
- Array.isArray(i.libraries) && (i.libraries = i.libraries), !e && !i.v && (e = "quarterly"), i.loading || (i.loading = "async"), i.callback = "googleMapsInitCallback";
2042
- let a = `https://maps.googleapis.com/maps/api/js?${Object.keys(i).map((p) => `${encodeURIComponent(p)}=${encodeURIComponent(i[p])}`).join("&")}`;
2043
- e && (a += `&v=${e}`);
2044
- const r = document.createElement("script");
2045
- return r.src = a, r.async = true, r.defer = true, r.onerror = (p) => {
2046
- console.error("Failed to load Google Maps script:", p);
2047
- }, document.body.appendChild(r), D;
2048
- }
2049
- const L = (t) => (e, o) => {
2050
- o !== void 0 ? o.addInitializer(() => {
2051
- customElements.define(t, e);
2052
- }) : customElements.define(t, e);
2053
- };
2054
- const j = globalThis, q = j.ShadowRoot && (j.ShadyCSS === void 0 || j.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, it = /* @__PURE__ */ Symbol(), J = /* @__PURE__ */ new WeakMap();
2055
- let at = class {
2056
- constructor(e, o, i) {
2057
- if (this._$cssResult$ = true, i !== it) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
2058
- this.cssText = e, this.t = o;
2059
- }
2060
- get styleSheet() {
2061
- let e = this.o;
2062
- const o = this.t;
2063
- if (q && e === void 0) {
2064
- const i = o !== void 0 && o.length === 1;
2065
- i && (e = J.get(o)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && J.set(o, e));
2066
- }
2067
- return e;
2068
- }
2069
- toString() {
2070
- return this.cssText;
2071
- }
2072
- };
2073
- const nt = (t) => new at(typeof t == "string" ? t : t + "", void 0, it), rt = (t, e) => {
2074
- if (q) t.adoptedStyleSheets = e.map((o) => o instanceof CSSStyleSheet ? o : o.styleSheet);
2075
- else for (const o of e) {
2076
- const i = document.createElement("style"), s = j.litNonce;
2077
- s !== void 0 && i.setAttribute("nonce", s), i.textContent = o.cssText, t.appendChild(i);
2078
- }
2079
- }, Y = q ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
2080
- let o = "";
2081
- for (const i of e.cssRules) o += i.cssText;
2082
- return nt(o);
2083
- })(t) : t;
2084
- const { is: lt, defineProperty: ct, getOwnPropertyDescriptor: pt, getOwnPropertyNames: ht, getOwnPropertySymbols: ut, getPrototypeOf: dt } = Object, G = globalThis, X = G.trustedTypes, mt = X ? X.emptyScript : "", gt = G.reactiveElementPolyfillSupport, U = (t, e) => t, R = { toAttribute(t, e) {
2085
- switch (e) {
2086
- case Boolean:
2087
- t = t ? mt : null;
2088
- break;
2089
- case Object:
2090
- case Array:
2091
- t = t == null ? t : JSON.stringify(t);
2092
- }
2093
- return t;
2094
- }, fromAttribute(t, e) {
2095
- let o = t;
2096
- switch (e) {
2097
- case Boolean:
2098
- o = t !== null;
2099
- break;
2100
- case Number:
2101
- o = t === null ? null : Number(t);
2102
- break;
2103
- case Object:
2104
- case Array:
2105
- try {
2106
- o = JSON.parse(t);
2107
- } catch {
2108
- o = null;
2109
- }
2110
- }
2111
- return o;
2112
- } }, V = (t, e) => !lt(t, e), Q = { attribute: true, type: String, converter: R, reflect: false, useDefault: false, hasChanged: V };
2113
- Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), G.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
2114
- class A extends HTMLElement {
2115
- static addInitializer(e) {
2116
- this._$Ei(), (this.l ??= []).push(e);
2117
- }
2118
- static get observedAttributes() {
2119
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
2120
- }
2121
- static createProperty(e, o = Q) {
2122
- if (o.state && (o.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(e) && ((o = Object.create(o)).wrapped = true), this.elementProperties.set(e, o), !o.noAccessor) {
2123
- const i = /* @__PURE__ */ Symbol(), s = this.getPropertyDescriptor(e, i, o);
2124
- s !== void 0 && ct(this.prototype, e, s);
2125
- }
2126
- }
2127
- static getPropertyDescriptor(e, o, i) {
2128
- const { get: s, set: a } = pt(this.prototype, e) ?? { get() {
2129
- return this[o];
2130
- }, set(r) {
2131
- this[o] = r;
2132
- } };
2133
- return { get: s, set(r) {
2134
- const p = s?.call(this);
2135
- a?.call(this, r), this.requestUpdate(e, p, i);
2136
- }, configurable: true, enumerable: true };
2137
- }
2138
- static getPropertyOptions(e) {
2139
- return this.elementProperties.get(e) ?? Q;
2140
- }
2141
- static _$Ei() {
2142
- if (this.hasOwnProperty(U("elementProperties"))) return;
2143
- const e = dt(this);
2144
- e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
2145
- }
2146
- static finalize() {
2147
- if (this.hasOwnProperty(U("finalized"))) return;
2148
- if (this.finalized = true, this._$Ei(), this.hasOwnProperty(U("properties"))) {
2149
- const o = this.properties, i = [...ht(o), ...ut(o)];
2150
- for (const s of i) this.createProperty(s, o[s]);
2151
- }
2152
- const e = this[Symbol.metadata];
2153
- if (e !== null) {
2154
- const o = litPropertyMetadata.get(e);
2155
- if (o !== void 0) for (const [i, s] of o) this.elementProperties.set(i, s);
2156
- }
2157
- this._$Eh = /* @__PURE__ */ new Map();
2158
- for (const [o, i] of this.elementProperties) {
2159
- const s = this._$Eu(o, i);
2160
- s !== void 0 && this._$Eh.set(s, o);
2161
- }
2162
- this.elementStyles = this.finalizeStyles(this.styles);
2163
- }
2164
- static finalizeStyles(e) {
2165
- const o = [];
2166
- if (Array.isArray(e)) {
2167
- const i = new Set(e.flat(1 / 0).reverse());
2168
- for (const s of i) o.unshift(Y(s));
2169
- } else e !== void 0 && o.push(Y(e));
2170
- return o;
2171
- }
2172
- static _$Eu(e, o) {
2173
- const i = o.attribute;
2174
- return i === false ? void 0 : typeof i == "string" ? i : typeof e == "string" ? e.toLowerCase() : void 0;
2175
- }
2176
- constructor() {
2177
- super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
2178
- }
2179
- _$Ev() {
2180
- this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((e) => e(this));
2181
- }
2182
- addController(e) {
2183
- (this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
2184
- }
2185
- removeController(e) {
2186
- this._$EO?.delete(e);
2187
- }
2188
- _$E_() {
2189
- const e = /* @__PURE__ */ new Map(), o = this.constructor.elementProperties;
2190
- for (const i of o.keys()) this.hasOwnProperty(i) && (e.set(i, this[i]), delete this[i]);
2191
- e.size > 0 && (this._$Ep = e);
2192
- }
2193
- createRenderRoot() {
2194
- const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
2195
- return rt(e, this.constructor.elementStyles), e;
2196
- }
2197
- connectedCallback() {
2198
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((e) => e.hostConnected?.());
2199
- }
2200
- enableUpdating(e) {
2201
- }
2202
- disconnectedCallback() {
2203
- this._$EO?.forEach((e) => e.hostDisconnected?.());
2204
- }
2205
- attributeChangedCallback(e, o, i) {
2206
- this._$AK(e, i);
2207
- }
2208
- _$ET(e, o) {
2209
- const i = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, i);
2210
- if (s !== void 0 && i.reflect === true) {
2211
- const a = (i.converter?.toAttribute !== void 0 ? i.converter : R).toAttribute(o, i.type);
2212
- this._$Em = e, a == null ? this.removeAttribute(s) : this.setAttribute(s, a), this._$Em = null;
2213
- }
2214
- }
2215
- _$AK(e, o) {
2216
- const i = this.constructor, s = i._$Eh.get(e);
2217
- if (s !== void 0 && this._$Em !== s) {
2218
- const a = i.getPropertyOptions(s), r = typeof a.converter == "function" ? { fromAttribute: a.converter } : a.converter?.fromAttribute !== void 0 ? a.converter : R;
2219
- this._$Em = s;
2220
- const p = r.fromAttribute(o, a.type);
2221
- this[s] = p ?? this._$Ej?.get(s) ?? p, this._$Em = null;
2222
- }
2223
- }
2224
- requestUpdate(e, o, i, s = false, a) {
2225
- if (e !== void 0) {
2226
- const r = this.constructor;
2227
- if (s === false && (a = this[e]), i ??= r.getPropertyOptions(e), !((i.hasChanged ?? V)(a, o) || i.useDefault && i.reflect && a === this._$Ej?.get(e) && !this.hasAttribute(r._$Eu(e, i)))) return;
2228
- this.C(e, o, i);
2229
- }
2230
- this.isUpdatePending === false && (this._$ES = this._$EP());
2231
- }
2232
- C(e, o, { useDefault: i, reflect: s, wrapped: a }, r) {
2233
- i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, r ?? o ?? this[e]), a !== true || r !== void 0) || (this._$AL.has(e) || (this.hasUpdated || i || (o = void 0), this._$AL.set(e, o)), s === true && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
2234
- }
2235
- async _$EP() {
2236
- this.isUpdatePending = true;
2237
- try {
2238
- await this._$ES;
2239
- } catch (o) {
2240
- Promise.reject(o);
2241
- }
2242
- const e = this.scheduleUpdate();
2243
- return e != null && await e, !this.isUpdatePending;
2244
- }
2245
- scheduleUpdate() {
2246
- return this.performUpdate();
2247
- }
2248
- performUpdate() {
2249
- if (!this.isUpdatePending) return;
2250
- if (!this.hasUpdated) {
2251
- if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
2252
- for (const [s, a] of this._$Ep) this[s] = a;
2253
- this._$Ep = void 0;
2254
- }
2255
- const i = this.constructor.elementProperties;
2256
- if (i.size > 0) for (const [s, a] of i) {
2257
- const { wrapped: r } = a, p = this[s];
2258
- r !== true || this._$AL.has(s) || p === void 0 || this.C(s, void 0, a, p);
2259
- }
2260
- }
2261
- let e = false;
2262
- const o = this._$AL;
2263
- try {
2264
- e = this.shouldUpdate(o), e ? (this.willUpdate(o), this._$EO?.forEach((i) => i.hostUpdate?.()), this.update(o)) : this._$EM();
2265
- } catch (i) {
2266
- throw e = false, this._$EM(), i;
2267
- }
2268
- e && this._$AE(o);
2269
- }
2270
- willUpdate(e) {
2271
- }
2272
- _$AE(e) {
2273
- this._$EO?.forEach((o) => o.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(e)), this.updated(e);
2274
- }
2275
- _$EM() {
2276
- this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
2277
- }
2278
- get updateComplete() {
2279
- return this.getUpdateComplete();
2280
- }
2281
- getUpdateComplete() {
2282
- return this._$ES;
2283
- }
2284
- shouldUpdate(e) {
2285
- return true;
2286
- }
2287
- update(e) {
2288
- this._$Eq &&= this._$Eq.forEach((o) => this._$ET(o, this[o])), this._$EM();
2289
- }
2290
- updated(e) {
2291
- }
2292
- firstUpdated(e) {
2293
- }
2294
- }
2295
- A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, A[U("elementProperties")] = /* @__PURE__ */ new Map(), A[U("finalized")] = /* @__PURE__ */ new Map(), gt?.({ ReactiveElement: A }), (G.reactiveElementVersions ??= []).push("2.1.2");
2296
- const bt = { attribute: true, type: String, converter: R, reflect: false, hasChanged: V }, yt = (t = bt, e, o) => {
2297
- const { kind: i, metadata: s } = o;
2298
- let a = globalThis.litPropertyMetadata.get(s);
2299
- if (a === void 0 && globalThis.litPropertyMetadata.set(s, a = /* @__PURE__ */ new Map()), i === "setter" && ((t = Object.create(t)).wrapped = true), a.set(o.name, t), i === "accessor") {
2300
- const { name: r } = o;
2301
- return { set(p) {
2302
- const m = e.get.call(this);
2303
- e.set.call(this, p), this.requestUpdate(r, m, t, true, p);
2304
- }, init(p) {
2305
- return p !== void 0 && this.C(r, void 0, t, p), p;
2306
- } };
2307
- }
2308
- if (i === "setter") {
2309
- const { name: r } = o;
2310
- return function(p) {
2311
- const m = this[r];
2312
- e.call(this, p), this.requestUpdate(r, m, t, true, p);
2313
- };
2314
- }
2315
- throw Error("Unsupported decorator location: " + i);
2316
- };
2317
- function n(t) {
2318
- return (e, o) => typeof o == "object" ? yt(t, e, o) : ((i, s, a) => {
2319
- const r = s.hasOwnProperty(a);
2320
- return s.constructor.createProperty(a, i), r ? Object.getOwnPropertyDescriptor(s, a) : void 0;
2321
- })(t, e, o);
2322
- }
2323
- function h(t) {
2324
- return n({ ...t, state: true, attribute: false });
2325
- }
2326
- const ft = (t, e, o) => (o.configurable = true, o.enumerable = true, Reflect.decorate && typeof e != "object" && Object.defineProperty(t, e, o), o);
2327
- function F(t, e) {
2328
- return (o, i, s) => {
2329
- const a = (r) => r.renderRoot?.querySelector(t) ?? null;
2330
- return ft(o, i, { get() {
2331
- return a(this);
2332
- } });
2333
- };
2334
- }
2335
- function _(t, e, o) {
2336
- const i = [];
2337
- return e.forEach((s) => {
2338
- if (!t || !google || !google.maps || !google.maps.event) return;
2339
- const a = google.maps.event.addListener(t, s, (r) => {
2340
- o(s, r);
2341
- });
2342
- i.push(() => {
2343
- a && google.maps.event.removeListener(a);
2344
- });
2345
- }), i;
2346
- }
2347
- function x(t) {
2348
- t.forEach((e) => e()), t.length = 0;
2349
- }
2350
- function B(t, e, o) {
2351
- if (!t) return;
2352
- const i = `set${e.charAt(0).toUpperCase()}${e.slice(1)}`;
2353
- typeof t[i] == "function" ? t[i](o) : e in t && (t[e] = o);
2354
- }
2355
- const vt = {
2356
- buttonLabel: "Use my current location",
2357
- errorTitle: "Unable to Access Location",
2358
- closeButton: "Continue",
2359
- loading: "Getting your location...",
2360
- loadingInstructions: "Please allow location access in your browser to continue",
2361
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2362
- permissionDenied: "Location access was denied. Please enable location services in your browser settings.",
2363
- positionUnavailable: "Your location is currently unavailable. Please check your device settings.",
2364
- timeout: "Location request timed out. Please try again.",
2365
- generalError: "Unable to get your location. Please try entering your address manually.",
2366
- clickToSelectLocation: "You can also choose your location by clicking on the map"
2367
- }, wt = {
2368
- buttonLabel: "استخدم موقعي الحالي",
2369
- errorTitle: "تعذر الوصول إلى الموقع",
2370
- closeButton: "متابعة",
2371
- loading: "جار الحصول على موقعك...",
2372
- loadingInstructions: "يرجى السماح بالوصول إلى الموقع في المتصفح للمتابعة",
2373
- timerMessage: "ستختفي هذه الرسالة تلقائياً بعد 7 ثوانٍ أو انقر متابعة",
2374
- permissionDenied: "تم رفض الوصول إلى الموقع. يرجى تفعيل خدمات الموقع في إعدادات المتصفح.",
2375
- positionUnavailable: "موقعك غير متاح حالياً. يرجى التحقق من إعدادات جهازك.",
2376
- timeout: "انتهت مهلة طلب الموقع. يرجى المحاولة مرة أخرى.",
2377
- generalError: "تعذر الحصول على موقعك. يرجى إدخال عنوانك يدوياً.",
2378
- clickToSelectLocation: "يمكنك أيضاً اختيار موقعك بالنقر على الخريطة"
2379
- }, kt = {
2380
- buttonLabel: "Usar mi ubicación actual",
2381
- errorTitle: "Error de ubicación",
2382
- closeButton: "Cerrar",
2383
- loading: "Obteniendo tu ubicación...",
2384
- loadingInstructions: "Permite el acceso a la ubicación en tu navegador para continuar",
2385
- timerMessage: "Este mensaje se ocultará automáticamente en 7 segundos o haz clic en Cerrar",
2386
- permissionDenied: "Se denegó el acceso a la ubicación. Habilita los servicios de ubicación en la configuración de tu navegador.",
2387
- positionUnavailable: "Tu ubicación no está disponible actualmente. Verifica la configuración de tu dispositivo.",
2388
- timeout: "La solicitud de ubicación expiró. Inténtalo de nuevo.",
2389
- generalError: "No se pudo obtener tu ubicación. Intenta ingresar tu dirección manualmente.",
2390
- clickToSelectLocation: "Haz clic en el mapa para seleccionar una ubicación"
2391
- }, Ct = {
2392
- buttonLabel: "Utiliser ma position actuelle",
2393
- errorTitle: "Erreur de localisation",
2394
- closeButton: "Continuer",
2395
- loading: "Obtention de votre position...",
2396
- loadingInstructions: "Veuillez autoriser l'accès à la localisation dans votre navigateur pour continuer",
2397
- timerMessage: "Ce message se masquera automatiquement dans 7 secondes ou cliquez sur Continuer",
2398
- permissionDenied: "L'accès à la localisation a été refusé. Veuillez activer les services de localisation dans les paramètres de votre navigateur.",
2399
- positionUnavailable: "Votre position n'est pas disponible actuellement. Veuillez vérifier les paramètres de votre appareil.",
2400
- timeout: "La demande de localisation a expiré. Veuillez réessayer.",
2401
- generalError: "Impossible d'obtenir votre position. Veuillez entrer votre adresse manuellement.",
2402
- clickToSelectLocation: "Vous pouvez également choisir votre position en cliquant sur la carte"
2403
- }, Et = {
2404
- buttonLabel: "Meinen aktuellen Standort verwenden",
2405
- errorTitle: "Standortfehler",
2406
- closeButton: "Schließen",
2407
- loading: "Getting your location...",
2408
- loadingInstructions: "Please allow location access in your browser to continue",
2409
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2410
- permissionDenied: "Der Zugriff auf den Standort wurde verweigert. Bitte aktivieren Sie die Standortdienste in Ihren Browsereinstellungen.",
2411
- positionUnavailable: "Ihr Standort ist derzeit nicht verfügbar. Bitte überprüfen Sie Ihre Geräteeinstellungen.",
2412
- timeout: "Standortanfrage ist abgelaufen. Bitte versuchen Sie es erneut.",
2413
- generalError: "Ihr Standort konnte nicht abgerufen werden. Bitte geben Sie Ihre Adresse manuell ein.",
2414
- clickToSelectLocation: "Klicken Sie auf die Karte, um einen Standort auszuwählen"
2415
- }, Lt = {
2416
- buttonLabel: "使用我的当前位置",
2417
- errorTitle: "位置错误",
2418
- closeButton: "关闭",
2419
- loading: "Getting your location...",
2420
- loadingInstructions: "Please allow location access in your browser to continue",
2421
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2422
- permissionDenied: "位置访问被拒绝。请在浏览器设置中启用位置服务。",
2423
- positionUnavailable: "您的位置当前不可用。请检查您的设备设置。",
2424
- timeout: "位置请求超时。请重试。",
2425
- generalError: "无法获取您的位置。请尝试手动输入地址。",
2426
- clickToSelectLocation: "点击地图选择位置"
2427
- }, Mt = {
2428
- buttonLabel: "現在地を使用",
2429
- errorTitle: "位置情報エラー",
2430
- closeButton: "閉じる",
2431
- loading: "Getting your location...",
2432
- loadingInstructions: "Please allow location access in your browser to continue",
2433
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2434
- permissionDenied: "位置情報へのアクセスが拒否されました。ブラウザの設定で位置情報サービスを有効にしてください。",
2435
- positionUnavailable: "現在位置が利用できません。デバイスの設定を確認してください。",
2436
- timeout: "位置情報リクエストがタイムアウトしました。もう一度お試しください。",
2437
- generalError: "位置情報を取得できませんでした。住所を手動で入力してください。",
2438
- clickToSelectLocation: "地図をクリックして場所を選択"
2439
- }, St = {
2440
- buttonLabel: "Usar minha localização atual",
2441
- errorTitle: "Erro de localização",
2442
- closeButton: "Fechar",
2443
- loading: "Getting your location...",
2444
- loadingInstructions: "Please allow location access in your browser to continue",
2445
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2446
- permissionDenied: "O acesso à localização foi negado. Ative os serviços de localização nas configurações do navegador.",
2447
- positionUnavailable: "Sua localização não está disponível no momento. Verifique as configurações do dispositivo.",
2448
- timeout: "A solicitação de localização expirou. Tente novamente.",
2449
- generalError: "Não foi possível obter sua localização. Tente inserir seu endereço manualmente.",
2450
- clickToSelectLocation: "Clique no mapa para selecionar um local"
2451
- }, _t = {
2452
- buttonLabel: "Использовать мое текущее местоположение",
2453
- errorTitle: "Ошибка местоположения",
2454
- closeButton: "Закрыть",
2455
- loading: "Getting your location...",
2456
- loadingInstructions: "Please allow location access in your browser to continue",
2457
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2458
- permissionDenied: "Доступ к местоположению был запрещен. Включите службы определения местоположения в настройках браузера.",
2459
- positionUnavailable: "Ваше местоположение в настоящее время недоступно. Проверьте настройки устройства.",
2460
- timeout: "Время ожидания запроса местоположения истекло. Попробуйте еще раз.",
2461
- generalError: "Не удалось получить ваше местоположение. Попробуйте ввести адрес вручную.",
2462
- clickToSelectLocation: "Нажмите на карту, чтобы выбрать местоположение"
2463
- }, xt = {
2464
- buttonLabel: "Usa la mia posizione attuale",
2465
- errorTitle: "Errore di posizione",
2466
- closeButton: "Chiudi",
2467
- loading: "Getting your location...",
2468
- loadingInstructions: "Please allow location access in your browser to continue",
2469
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2470
- permissionDenied: "L'accesso alla posizione è stato negato. Abilita i servizi di localizzazione nelle impostazioni del browser.",
2471
- positionUnavailable: "La tua posizione non è attualmente disponibile. Controlla le impostazioni del dispositivo.",
2472
- timeout: "La richiesta di posizione è scaduta. Riprova.",
2473
- generalError: "Impossibile ottenere la tua posizione. Prova a inserire manualmente il tuo indirizzo.",
2474
- clickToSelectLocation: "Fai clic sulla mappa per selezionare una posizione"
2475
- }, Pt = {
2476
- buttonLabel: "Gebruik mijn huidige locatie",
2477
- errorTitle: "Locatiefout",
2478
- closeButton: "Sluiten",
2479
- loading: "Getting your location...",
2480
- loadingInstructions: "Please allow location access in your browser to continue",
2481
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2482
- permissionDenied: "Toegang tot locatie is geweigerd. Schakel locatieservices in in uw browserinstellingen.",
2483
- positionUnavailable: "Uw locatie is momenteel niet beschikbaar. Controleer uw apparaatinstellingen.",
2484
- timeout: "Locatieverzoek is verlopen. Probeer het opnieuw.",
2485
- generalError: "Kan uw locatie niet ophalen. Probeer uw adres handmatig in te voeren.",
2486
- clickToSelectLocation: "Klik op de kaart om een locatie te selecteren"
2487
- }, Ot = {
2488
- buttonLabel: "Mevcut konumumu kullan",
2489
- errorTitle: "Konum Hatası",
2490
- closeButton: "Kapat",
2491
- loading: "Getting your location...",
2492
- loadingInstructions: "Please allow location access in your browser to continue",
2493
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2494
- permissionDenied: "Konum erişimi reddedildi. Lütfen tarayıcı ayarlarınızda konum hizmetlerini etkinleştirin.",
2495
- positionUnavailable: "Konumunuz şu anda kullanılamıyor. Lütfen cihaz ayarlarınızı kontrol edin.",
2496
- timeout: "Konum isteği zaman aşımına uğradı. Lütfen tekrar deneyin.",
2497
- generalError: "Konumunuz alınamadı. Lütfen adresinizi manuel olarak girmeyi deneyin.",
2498
- clickToSelectLocation: "Bir konum seçmek için haritaya tıklayın"
2499
- }, $t = {
2500
- buttonLabel: "현재 위치 사용",
2501
- errorTitle: "위치 오류",
2502
- closeButton: "닫기",
2503
- loading: "Getting your location...",
2504
- loadingInstructions: "Please allow location access in your browser to continue",
2505
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2506
- permissionDenied: "위치 액세스가 거부되었습니다. 브라우저 설정에서 위치 서비스를 활성화하십시오.",
2507
- positionUnavailable: "현재 위치를 사용할 수 없습니다. 기기 설정을 확인하십시오.",
2508
- timeout: "위치 요청 시간이 초과되었습니다. 다시 시도하십시오.",
2509
- generalError: "위치를 가져올 수 없습니다. 수동으로 주소를 입력해 보십시오.",
2510
- clickToSelectLocation: "지도를 클릭하여 위치를 선택하십시오"
2511
- }, Tt = {
2512
- buttonLabel: "मेरा वर्तमान स्थान उपयोग करें",
2513
- errorTitle: "स्थान त्रुटि",
2514
- closeButton: "बंद करें",
2515
- loading: "Getting your location...",
2516
- loadingInstructions: "Please allow location access in your browser to continue",
2517
- timerMessage: "This message will auto-hide in 7 seconds or click Continue",
2518
- permissionDenied: "स्थान पहुंच अस्वीकार कर दी गई थी। कृपया अपनी ब्राउज़र सेटिंग में स्थान सेवाएं सक्षम करें।",
2519
- positionUnavailable: "आपका स्थान वर्तमान में उपलब्ध नहीं है। कृपया अपनी डिवाइस सेटिंग्स जांचें।",
2520
- timeout: "स्थान अनुरोध समय समाप्त हो गया। कृपया पुनः प्रयास करें।",
2521
- generalError: "आपका स्थान प्राप्त करने में असमर्थ। कृपया अपना पता मैन्युअल रूप से दर्ज करने का प्रयास करें।",
2522
- clickToSelectLocation: "स्थान चुनने के लिए मानचित्र पर क्लिक करें"
2523
- }, Z = {
2524
- en: vt,
2525
- ar: wt,
2526
- es: kt,
2527
- fr: Ct,
2528
- de: Et,
2529
- zh: Lt,
2530
- ja: Mt,
2531
- pt: St,
2532
- ru: _t,
2533
- it: xt,
2534
- nl: Pt,
2535
- tr: Ot,
2536
- ko: $t,
2537
- hi: Tt
2538
- }, zt = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur"]);
2539
- function tt(t = "en") {
2540
- return Z[t] || Z.en;
2541
- }
2542
- function et(t) {
2543
- return zt.has(t);
2544
- }
2545
- var It = Object.defineProperty, At = Object.getOwnPropertyDescriptor, c = (t, e, o, i) => {
2546
- for (var s = i > 1 ? void 0 : i ? At(e, o) : e, a = t.length - 1, r; a >= 0; a--)
2547
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
2548
- return i && s && It(e, o, s), s;
2549
- };
2550
- let l = class extends i {
2551
- constructor() {
2552
- 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 = false, this.mapTypeControl = false, this.streetViewControl = false, this.rotateControl = false, this.fullscreenControl = false, this.enableGeolocation = false, this.showLocationMarker = true, this.geolocationOptions = {
2553
- maximumAge: 6e4,
2554
- timeout: 1e4,
2555
- enableHighAccuracy: true
2556
- }, this.locationMarkerBackground = "#4285F4", this.locationMarkerBorderColor = "#1967D2", this.locationMarkerGlyphColor = "#FFFFFF", this.locationMarkerScale = 1.3, this.locationCircleOptions = {}, this.language = "en", this.options = {}, this.enableAutocomplete = false, this.autocompleteProxyUrl = "https://api.salla.dev", this.autocompleteStrictBounds = false, this.autocompleteResolve = false, this.autocompleteDebounceDelay = 300, this.autocompleteMinChars = 3, this.geolocationLoading = false, this.geolocationError = null, this.showLoadingOverlay = false, this.buttonState = "normal", this.eventListeners = [], this.autocompleteListenerAttached = false;
2557
- }
2558
- async connectedCallback() {
2559
- super.connectedCallback(), et(this.language) && (document.dir = "rtl");
2560
- }
2561
- async firstUpdated() {
2562
- await D, this.createMap();
2563
- }
2564
- clearAutocompleteInput() {
2565
- if (!this.autocompleteElement) return;
2566
- const t = this.autocompleteElement.shadowRoot?.querySelector("input");
2567
- t && (t.value = "", this.autocompleteElement.inputValue = "", this.autocompleteElement.value = "");
2568
- }
2569
- setupAutocompleteListener() {
2570
- !this.enableAutocomplete || !this.autocompleteElement || this.autocompleteListenerAttached || (this.autocompleteElement.addEventListener("place-select", ((t) => {
2571
- const { place: e } = t.detail;
2572
- if (e?.geometry?.location) {
2573
- const { lat: o, lng: i } = e.geometry.location;
2574
- this.setLocation(o, i, 50, true), this.dispatchMapEvent("location_changed", {
2575
- position: { lat: o, lng: i },
2576
- accuracy: 50,
2577
- source: "autocomplete",
2578
- place: {
2579
- placeId: e.place_id,
2580
- formattedAddress: e.formatted_address,
2581
- addressComponents: e.address_components,
2582
- name: e.name,
2583
- types: e.types
2584
- }
2585
- }), this.dispatchMapEvent("autocomplete_place_selected", {
2586
- place: e
2587
- });
2588
- }
2589
- })), this.autocompleteListenerAttached = true);
2590
- }
2591
- disconnectedCallback() {
2592
- super.disconnectedCallback(), this.cleanup();
2593
- }
2594
- updated(t) {
2595
- super.updated(t), this.enableAutocomplete && !this.autocompleteListenerAttached && setTimeout(() => this.setupAutocompleteListener(), 0), this.map && (t.has("center") && this.center && B(this.map, "center", this.center), t.has("zoom") && this.zoom !== void 0 && B(this.map, "zoom", this.zoom), t.has("minZoom") && this.minZoom !== void 0 && this.map && this.map.setOptions({ minZoom: this.minZoom }), t.has("maxZoom") && this.maxZoom !== void 0 && this.map && this.map.setOptions({ maxZoom: this.maxZoom }), t.has("mapTypeId") && this.mapTypeId && B(this.map, "mapTypeId", this.mapTypeId), t.has("heading") && this.heading !== void 0 && B(this.map, "heading", this.heading), t.has("tilt") && this.tilt !== void 0 && B(this.map, "tilt", this.tilt), t.has("locationMarkerPosition") && this.locationMarkerPosition && this.showLocationMarker && this.setLocation(
2596
- this.locationMarkerPosition.lat,
2597
- this.locationMarkerPosition.lng,
2598
- this.locationMarkerPosition.accuracy
2599
- ));
2600
- }
2601
- createMap() {
2602
- if (!this.mapElement) return;
2603
- const t = {
2604
- center: this.center,
2605
- zoom: this.zoom,
2606
- mapId: this.mapId,
2607
- mapTypeId: this.mapTypeId,
2608
- heading: this.heading,
2609
- tilt: this.tilt,
2610
- gestureHandling: this.gestureHandling,
2611
- minZoom: this.minZoom,
2612
- maxZoom: this.maxZoom,
2613
- disableDefaultUI: this.disableDefaultUI,
2614
- zoomControl: this.zoomControl,
2615
- mapTypeControl: this.mapTypeControl,
2616
- scaleControl: this.scaleControl,
2617
- streetViewControl: this.streetViewControl,
2618
- rotateControl: this.rotateControl,
2619
- fullscreenControl: this.fullscreenControl,
2620
- disableDoubleClickZoom: true,
2621
- keyboardShortcuts: false,
2622
- zoomControlOptions: {
2623
- position: google.maps.ControlPosition.RIGHT_BOTTOM
2624
- },
2625
- ...this.options
2626
- };
2627
- this.map = new google.maps.Map(this.mapElement, t);
2628
- const e = google.maps.event.addListener(this.map, "click", (s) => {
2629
- if (s.latLng && this.showLocationMarker) {
2630
- const a = s.latLng.lat(), r = s.latLng.lng();
2631
- this.setLocation(a, r, 50, false), this.clearAutocompleteInput(), this.dispatchMapEvent("location_changed", {
2632
- position: { lat: a, lng: r },
2633
- accuracy: 50,
2634
- source: "map-click"
2635
- });
2636
- }
2637
- }), o = [
2638
- "click",
2639
- "dblclick",
2640
- "drag",
2641
- "dragend",
2642
- "dragstart",
2643
- "idle",
2644
- "mousemove",
2645
- "mouseout",
2646
- "mouseover",
2647
- "resize",
2648
- "rightclick",
2649
- "tilesloaded"
2650
- ];
2651
- this.eventListeners = _(this.map, o, (s, a) => {
2652
- this.dispatchMapEvent(s, a);
2653
- }), this.eventListeners.push(() => {
2654
- e && google.maps.event.removeListener(e);
2655
- }), ["center", "zoom", "bounds", "mapTypeId"].forEach((s) => {
2656
- const a = `${s}_changed`, r = google.maps.event.addListener(this.map, a, () => {
2657
- const p = `get${s.charAt(0).toUpperCase()}${s.slice(1)}`;
2658
- if (typeof this.map[p] == "function") {
2659
- const m = this.map[p]();
2660
- this.dispatchMapEvent(a, m);
2661
- }
2662
- });
2663
- this.eventListeners.push(() => {
2664
- r && google.maps.event.removeListener(r);
2665
- });
2666
- }), this.dispatchEvent(
2667
- new CustomEvent("gmap-ready", {
2668
- detail: { map: this.map },
2669
- bubbles: true,
2670
- composed: true
2671
- })
2672
- ), this.locationMarkerPosition && this.showLocationMarker && this.setLocation(
2673
- this.locationMarkerPosition.lat,
2674
- this.locationMarkerPosition.lng,
2675
- this.locationMarkerPosition.accuracy
2676
- );
2677
- }
2678
- dispatchMapEvent(t, e) {
2679
- let o = t;
2680
- t.includes("_changed") ? o = `gmap-${t.replace(/_/g, "-")}` : (t.startsWith("geolocation_") || t.startsWith("location_")) && (o = `gmap-${t.replace(/_/g, "-")}`), this.dispatchEvent(
2681
- new CustomEvent(o, {
2682
- detail: e,
2683
- bubbles: true,
2684
- composed: true
2685
- })
2686
- );
2687
- }
2688
- cleanup() {
2689
- x(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;
2690
- }
2691
- // Public API methods
2692
- panBy(t, e) {
2693
- this.map?.panBy(t, e);
2694
- }
2695
- panTo(t) {
2696
- this.map?.panTo(t);
2697
- }
2698
- panToBounds(t) {
2699
- this.map?.panToBounds(t);
2700
- }
2701
- fitBounds(t) {
2702
- this.map?.fitBounds(t);
2703
- }
2704
- resize() {
2705
- this.map && google.maps.event.trigger(this.map, "resize");
2706
- }
2707
- resizePreserveCenter() {
2708
- if (!this.map) return;
2709
- const t = this.map.getCenter();
2710
- google.maps.event.trigger(this.map, "resize"), t && this.map.setCenter(t);
2711
- }
2712
- /**
2713
- * Programmatically set the location marker position
2714
- * @param lat Latitude
2715
- * @param lng Longitude
2716
- * @param accuracy Optional accuracy in meters (default: 50)
2717
- * @param panTo Optional, pan map to location (default: true)
2718
- */
2719
- setLocation(t, e, o = 50, i = true) {
2720
- if (!this.map) {
2721
- console.warn("GMapMap: Cannot set location before map is initialized");
2722
- return;
2723
- }
2724
- const s = { lat: t, lng: e };
2725
- i && this.map.panTo(s), this.showLocationMarker && this.addLocationMarker(s, o), this.dispatchMapEvent("location_changed", {
2726
- position: s,
2727
- accuracy: o,
2728
- source: "programmatic"
2729
- });
2730
- }
2731
- async getCurrentLocation(t = false) {
2732
- if (!navigator.geolocation) {
2733
- const i = {
2734
- code: "NOT_SUPPORTED",
2735
- message: "Geolocation is not supported by this browser"
2736
- };
2737
- throw this.dispatchMapEvent("geolocation_error", i), t || this.showGeolocationError(this.getTranslation("generalError")), new Error("NOT_SUPPORTED");
2738
- }
2739
- this.geolocationLoading = true, this.buttonState = "loading", this.dispatchMapEvent("geolocation_loading", { message: "Getting your location..." });
2740
- const o = t ? null : setTimeout(() => {
2741
- this.geolocationLoading && (this.showLoadingOverlay = true);
2742
- }, 150);
2743
- return new Promise((i, s) => {
2744
- navigator.geolocation.getCurrentPosition(
2745
- (a) => {
2746
- const r = {
2747
- lat: a.coords.latitude,
2748
- lng: a.coords.longitude
2749
- };
2750
- if (o && clearTimeout(o), this.geolocationLoading = false, this.showLoadingOverlay = false, this.buttonState = "success", setTimeout(() => {
2751
- this.buttonState = "normal";
2752
- }, 2e3), this.map) {
2753
- this.map.panTo(r);
2754
- const m = a.coords.accuracy;
2755
- let y = 15;
2756
- m > 1e3 ? y = 12 : m > 500 ? y = 13 : m > 100 ? y = 14 : y = 16, this.map.setZoom(y), this.showLocationMarker && this.addLocationMarker(r, m), this.clearAutocompleteInput();
2757
- }
2758
- const p = {
2759
- position: r,
2760
- accuracy: a.coords.accuracy,
2761
- altitude: a.coords.altitude,
2762
- altitudeAccuracy: a.coords.altitudeAccuracy,
2763
- heading: a.coords.heading,
2764
- speed: a.coords.speed,
2765
- timestamp: a.timestamp
2766
- };
2767
- this.dispatchMapEvent("geolocation_success", p), this.dispatchMapEvent("location_changed", {
2768
- position: r,
2769
- accuracy: a.coords.accuracy,
2770
- source: "geolocation"
2771
- }), i(r);
2772
- },
2773
- (a) => {
2774
- o && clearTimeout(o), this.geolocationLoading = false, this.showLoadingOverlay = false, this.buttonState = "error", setTimeout(() => {
2775
- this.buttonState = "normal";
2776
- }, 2e3);
2777
- let r = "GENERAL_ERROR", p = this.getTranslation("generalError");
2778
- a.code === a.PERMISSION_DENIED ? (r = "PERMISSION_DENIED", p = this.getTranslation("permissionDenied")) : a.code === a.POSITION_UNAVAILABLE ? (r = "POSITION_UNAVAILABLE", p = this.getTranslation("positionUnavailable")) : a.code === a.TIMEOUT && (r = "TIMEOUT", p = this.getTranslation("timeout"));
2779
- const m = {
2780
- code: r,
2781
- message: p,
2782
- error: a
2783
- };
2784
- this.dispatchMapEvent("geolocation_error", m), t || this.showGeolocationError(p), s(a);
2785
- },
2786
- this.geolocationOptions
2787
- );
2788
- });
2789
- }
2790
- handleGeolocationClick() {
2791
- this.geolocationError = null, this.getCurrentLocation();
2792
- }
2793
- async addLocationMarker(t, e) {
2794
- if (this.map) {
2795
- if (this.locationMarker && (this.locationMarker.map = null, this.locationMarker = void 0), this.locationCircle && (this.locationCircle.setMap(null), this.locationCircle = void 0), !this.mapId) {
2796
- console.warn(
2797
- "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"
2798
- );
2799
- return;
2800
- }
2801
- try {
2802
- const { AdvancedMarkerElement: o, PinElement: i } = await google.maps.importLibrary("marker"), s = new i({
2803
- background: this.locationMarkerBackground,
2804
- borderColor: this.locationMarkerBorderColor,
2805
- glyphColor: this.locationMarkerGlyphColor,
2806
- scale: this.locationMarkerScale
2807
- });
2808
- this.locationMarker = new o({
2809
- map: this.map,
2810
- position: t,
2811
- title: "Your Location (Drag to adjust)",
2812
- content: s.element,
2813
- gmpDraggable: true
2814
- }), this.locationMarker.addListener("dragend", () => {
2815
- if (this.locationMarker && this.locationCircle) {
2816
- const a = this.locationMarker.position, r = a.toJSON ? a.toJSON() : { lat: a.lat(), lng: a.lng() };
2817
- this.locationCircle.setCenter(r);
2818
- const p = this.locationCircle.getRadius();
2819
- this.clearAutocompleteInput(), this.dispatchMapEvent("location_marker_dragend", {
2820
- position: r,
2821
- accuracy: p
2822
- }), this.dispatchMapEvent("location_changed", {
2823
- position: r,
2824
- accuracy: p,
2825
- source: "marker-drag"
2826
- });
2827
- }
2828
- });
2829
- } catch (o) {
2830
- console.error("Error creating AdvancedMarkerElement:", o);
2831
- }
2832
- this.locationCircle = new google.maps.Circle({
2833
- map: this.map,
2834
- center: t,
2835
- radius: e,
2836
- fillColor: "#4285F4",
2837
- fillOpacity: 0.15,
2838
- strokeColor: "#4285F4",
2839
- strokeOpacity: 0.4,
2840
- strokeWeight: 1,
2841
- clickable: false,
2842
- ...this.locationCircleOptions
2843
- // Allow customization
2844
- });
2845
- }
2846
- }
2847
- showGeolocationError(t) {
2848
- this.geolocationError = t, setTimeout(() => {
2849
- this.geolocationError = null;
2850
- }, 7e3);
2851
- }
2852
- getTranslation(t) {
2853
- const o = {
2854
- loading: this.geolocationLoadingTitle,
2855
- loadingInstructions: this.geolocationLoadingInstructions,
2856
- errorTitle: this.geolocationErrorTitle,
2857
- closeButton: this.geolocationErrorButtonText,
2858
- timerMessage: this.geolocationErrorTimerMessage,
2859
- clickToSelectLocation: this.geolocationClickToSelectMessage,
2860
- generalError: this.geolocationGeneralErrorMessage,
2861
- permissionDenied: this.geolocationPermissionDeniedMessage,
2862
- positionUnavailable: this.geolocationPositionUnavailableMessage,
2863
- timeout: this.geolocationTimeoutMessage
2864
- }[t];
2865
- if (o != null && o !== "")
2866
- return o;
2867
- const i = tt(this.language);
2868
- return i[t] || i.generalError;
2869
- }
2870
- get buttonLabel() {
2871
- return this.geolocationButtonLabel !== void 0 ? this.geolocationButtonLabel : tt(this.language).buttonLabel || "";
2872
- }
2873
- getButtonIconColor() {
2874
- switch (this.buttonState) {
2875
- case "loading":
2876
- return "#999";
2877
- // Gray while loading
2878
- case "success":
2879
- return "#4285F4";
2880
- // Blue on success
2881
- case "error":
2882
- return "#EA4335";
2883
- default:
2884
- return "#666";
2885
- }
2886
- }
2887
- getMap() {
2888
- return this.map;
2889
- }
2890
- render() {
2891
- const t = et(this.language) ? "rtl" : "ltr";
2892
- return b$2`
2893
- <div class="map-page-wrapper">
2894
- ${this.enableAutocomplete ? b$2`
2895
- <div class="auto-complete-map-wrapper">
2896
- <div class="auto-complete-map-box" dir="${t}">
2897
- <salla-address-autocomplete
2898
- .proxyUrl=${this.autocompleteProxyUrl}
2899
- .authToken=${this.autocompleteAuthToken || null}
2900
- .placeholder=${this.autocompletePlaceholder || ""}
2901
- .label=${this.autocompleteLabel || null}
2902
- .language=${this.language}
2903
- .country=${this.autocompleteCountry || null}
2904
- .locationBias=${this.autocompleteLocationBias || null}
2905
- .locationRestriction=${this.autocompleteLocationRestriction || null}
2906
- .types=${this.autocompleteTypes ? this.autocompleteTypes.split(",").map((e) => e.trim()) : null}
2907
- .fieldsStr=${this.autocompleteFields || null}
2908
- .strictBounds=${this.autocompleteStrictBounds}
2909
- .resolve=${this.autocompleteResolve}
2910
- .debounceDelay=${this.autocompleteDebounceDelay}
2911
- .minChars=${this.autocompleteMinChars}
2912
- ></salla-address-autocomplete>
2913
- ${this.autocompleteHint ? b$2`<span class="hint-wrapper">${this.autocompleteHint}</span>` : ""}
2914
- </div>
2915
- </div>
2916
- ` : ""}
2917
-
2918
- <div class="map-container">
2919
- <div class="map"></div>
2920
- <slot></slot>
2921
-
2922
- ${this.enableGeolocation ? b$2`
2923
- <div class="controls-overlay">
2924
- <button
2925
- class="geolocation-button ${this.buttonLabel && this.buttonLabel.trim() ? "has-label" : ""}"
2926
- @click=${this.handleGeolocationClick}
2927
- title="Show your location"
2928
- ?disabled=${this.geolocationLoading}
2929
- >
2930
- <svg width="18" height="18" viewBox="0 0 24 24" fill="${this.getButtonIconColor()}">
2931
- <path
2932
- 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"
2933
- />
2934
- </svg>
2935
- ${this.buttonLabel && this.buttonLabel.trim() ? b$2`<span class="label">${this.buttonLabel}</span>` : ""}
2936
- </button>
2937
- </div>
2938
- ` : ""}
2939
-
2940
- ${this.showLoadingOverlay && !this.geolocationError ? b$2`
2941
- <div class="loading-overlay">
2942
- <div class="spinner"></div>
2943
- <div class="title">
2944
- ${this.getTranslation("loading")}
2945
- </div>
2946
- <div class="instructions">
2947
- ${this.getTranslation("loadingInstructions")}
2948
- </div>
2949
- </div>
2950
- ` : ""}
2951
-
2952
- ${this.geolocationError && !this.showLoadingOverlay ? b$2`
2953
- <div class="error-overlay">
2954
- <div class="error-icon">
2955
- <svg width="40" height="40" viewBox="0 0 24 24" fill="none">
2956
- <circle cx="12" cy="12" r="10" stroke="#ef4444" stroke-width="2" fill="none"/>
2957
- <path d="M12 8v4M12 16h.01" stroke="#ef4444" stroke-width="2" stroke-linecap="round"/>
2958
- </svg>
2959
- </div>
2960
- <div class="error-title">
2961
- ${this.getTranslation("errorTitle")}
2962
- </div>
2963
- <div class="error-message">${this.geolocationError}</div>
2964
- <div class="map-hint">
2965
- ${this.getTranslation("clickToSelectLocation")}
2966
- </div>
2967
- <div class="timer-message">
2968
- ${this.getTranslation("timerMessage")}
2969
- </div>
2970
- <button @click=${() => this.geolocationError = null}>
2971
- ${this.getTranslation("closeButton")}
2972
- </button>
2973
- </div>
2974
- ` : ""}
2975
- </div>
2976
- </div>
2977
- `;
2978
- }
2979
- };
2980
- l.styles = i$3`
2981
- :host {
2982
- display: block;
2983
- position: relative;
2984
- width: 100%;
2985
- height: 400px;
2986
- }
2987
-
2988
- @media (max-width: 640px) {
2989
- :host {
2990
- height: 65vh;
2991
- min-height: 300px;
2992
- }
2993
- }
2994
-
2995
- @media (max-width: 640px) and (min-height: 700px) {
2996
- :host {
2997
- height: 65vh;
2998
- }
2999
- }
3000
-
3001
- .map-container {
3002
- width: 100%;
3003
- height: 100%;
3004
- position: relative;
3005
- }
3006
-
3007
- .map {
3008
- width: 100%;
3009
- height: 100%;
3010
- }
3011
-
3012
- .controls-overlay {
3013
- position: absolute;
3014
- top: 0;
3015
- left: 0;
3016
- right: 0;
3017
- bottom: 0;
3018
- pointer-events: none;
3019
- z-index: 40;
3020
- }
3021
-
3022
- .controls-overlay > * {
3023
- pointer-events: auto;
3024
- }
3025
-
3026
- .geolocation-button {
3027
- position: absolute;
3028
- bottom: 23px;
3029
- left: 10px;
3030
- right: auto;
3031
- background: #fff;
3032
- border: none;
3033
- border-radius: 2px;
3034
- box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;
3035
- cursor: pointer;
3036
- padding: 10px;
3037
- height: 40px;
3038
- display: flex;
3039
- align-items: center;
3040
- justify-content: center;
3041
- gap: 8px;
3042
- outline: none;
3043
- color: rgb(86, 86, 86);
3044
- font-family: var(--gmap-font-family, Roboto, Arial, sans-serif);
3045
- font-size: 14px;
3046
- white-space: nowrap;
3047
- }
3048
-
3049
- @media (max-width: 640px) {
3050
- .geolocation-button {
3051
- bottom: 23px;
3052
- left: 10px;
3053
- right: auto;
3054
- }
3055
-
3056
- .geolocation-button .label {
3057
- display: none;
3058
- }
3059
-
3060
- .geolocation-button {
3061
- width: 40px !important;
3062
- padding: 10px !important;
3063
- }
3064
- }
3065
-
3066
- .geolocation-button.has-label {
3067
- width: auto;
3068
- padding: 8px 12px;
3069
- }
3070
-
3071
- .geolocation-button:not(.has-label) {
3072
- width: 40px;
3073
- }
3074
-
3075
- .geolocation-button:hover:not(:disabled) {
3076
- background: #ebebeb;
3077
- }
3078
-
3079
- .geolocation-button:disabled {
3080
- cursor: wait;
3081
- opacity: 0.6;
3082
- }
3083
-
3084
- .geolocation-button svg {
3085
- flex-shrink: 0;
3086
- }
3087
-
3088
- .geolocation-button .label {
3089
- font-weight: 500;
3090
- }
3091
-
3092
- .loading-overlay {
3093
- position: absolute;
3094
- top: 0;
3095
- left: 0;
3096
- right: 0;
3097
- bottom: 0;
3098
- background: rgba(0, 0, 0, 0.7);
3099
- z-index: 200;
3100
- display: flex;
3101
- flex-direction: column;
3102
- align-items: center;
3103
- justify-content: center;
3104
- gap: 16px;
3105
- padding: 16px;
3106
- font-family: var(--gmap-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
3107
- }
3108
-
3109
- .loading-overlay .spinner {
3110
- width: 48px;
3111
- height: 48px;
3112
- border: 4px solid rgba(255, 255, 255, 0.3);
3113
- border-top-color: #ffffff;
3114
- border-radius: 50%;
3115
- animation: spin 1s linear infinite;
3116
- }
3117
-
3118
- @keyframes spin {
3119
- to { transform: rotate(360deg); }
3120
- }
3121
-
3122
- .loading-overlay .title {
3123
- font-size: 18px;
3124
- font-weight: 600;
3125
- color: #ffffff;
3126
- margin: 0;
3127
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3128
- }
3129
-
3130
- .loading-overlay .instructions {
3131
- font-size: 14px;
3132
- color: #ffffff;
3133
- line-height: 1.5;
3134
- margin: 0;
3135
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3136
- text-align: center;
3137
- max-width: 90%;
3138
- }
3139
-
3140
- .error-overlay {
3141
- position: absolute;
3142
- top: 0;
3143
- left: 0;
3144
- right: 0;
3145
- bottom: 0;
3146
- background: rgba(0, 0, 0, 0.7);
3147
- z-index: 200;
3148
- display: flex;
3149
- flex-direction: column;
3150
- align-items: center;
3151
- justify-content: center;
3152
- gap: 12px;
3153
- padding: 16px;
3154
- font-family: var(--gmap-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
3155
- }
3156
-
3157
- .error-overlay .error-icon svg {
3158
- display: block;
3159
- }
3160
-
3161
- .error-overlay .error-title {
3162
- font-size: 17px;
3163
- font-weight: 600;
3164
- color: #ef4444;
3165
- margin: 0;
3166
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3167
- }
3168
-
3169
- .error-overlay .error-message {
3170
- font-size: 14px;
3171
- color: #ffffff;
3172
- line-height: 1.4;
3173
- margin: 0;
3174
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3175
- text-align: center;
3176
- max-width: 90%;
3177
- }
3178
-
3179
- .error-overlay .map-hint {
3180
- font-size: 12px;
3181
- color: #d4d4d4;
3182
- line-height: 1.4;
3183
- margin: 0;
3184
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3185
- text-align: center;
3186
- font-style: italic;
3187
- }
3188
-
3189
- .error-overlay .timer-message {
3190
- font-size: 12px;
3191
- color: #d4d4d4;
3192
- margin: 0;
3193
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
3194
- }
3195
-
3196
- .error-overlay button {
3197
- margin-top: 4px;
3198
- padding: 8px 24px;
3199
- background: #ffffff;
3200
- color: #18181b;
3201
- border: none;
3202
- border-radius: 8px;
3203
- font-size: 14px;
3204
- font-weight: 600;
3205
- cursor: pointer;
3206
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
3207
- }
3208
-
3209
- .error-overlay button:hover {
3210
- background: #f4f4f5;
3211
- }
3212
-
3213
- .map-page-wrapper {
3214
- position: relative;
3215
- width: 100%;
3216
- height: 100%;
3217
- }
3218
-
3219
- .auto-complete-map-wrapper {
3220
- position: absolute;
3221
- z-index: 50;
3222
- padding: 1rem;
3223
- width: 100%;
3224
- top: 0;
3225
- left: 0;
3226
- right: 0;
3227
- pointer-events: none;
3228
- box-sizing: border-box;
3229
- }
3230
-
3231
- @media (max-width: 640px) {
3232
- .auto-complete-map-wrapper {
3233
- padding: 0.75rem 0.5rem;
3234
- }
3235
- }
3236
-
3237
- .auto-complete-map-wrapper > * {
3238
- pointer-events: auto;
3239
- }
3240
-
3241
- .auto-complete-map-box {
3242
- width: 100%;
3243
- display: flex;
3244
- flex-direction: column;
3245
- padding: 1rem;
3246
- background-color: #ffffffb2;
3247
- border-radius: 8px;
3248
- backdrop-filter: blur(4px);
3249
- box-sizing: border-box;
3250
- }
3251
-
3252
- @media (max-width: 640px) {
3253
- .auto-complete-map-box {
3254
- padding: 0.75rem;
3255
- }
3256
- }
3257
-
3258
- .auto-complete-map-box .hint-wrapper {
3259
- font-size: 12px;
3260
- color: #666666;
3261
- margin-top: 0.5rem;
3262
- text-align: start;
3263
- direction: inherit;
3264
- }
3265
- `;
3266
- c([
3267
- n({ type: Object })
3268
- ], l.prototype, "center", 2);
3269
- c([
3270
- n({ type: Number })
3271
- ], l.prototype, "zoom", 2);
3272
- c([
3273
- n({ type: String, attribute: "map-id" })
3274
- ], l.prototype, "mapId", 2);
3275
- c([
3276
- n({ type: String, attribute: "map-type-id" })
3277
- ], l.prototype, "mapTypeId", 2);
3278
- c([
3279
- n({ type: Number })
3280
- ], l.prototype, "heading", 2);
3281
- c([
3282
- n({ type: Number })
3283
- ], l.prototype, "tilt", 2);
3284
- c([
3285
- n({ type: Object })
3286
- ], l.prototype, "bounds", 2);
3287
- c([
3288
- n({ type: String })
3289
- ], l.prototype, "gestureHandling", 2);
3290
- c([
3291
- n({ type: Number })
3292
- ], l.prototype, "minZoom", 2);
3293
- c([
3294
- n({ type: Number })
3295
- ], l.prototype, "maxZoom", 2);
3296
- c([
3297
- n({ type: Boolean })
3298
- ], l.prototype, "disableDefaultUI", 2);
3299
- c([
3300
- n({ type: Boolean })
3301
- ], l.prototype, "zoomControl", 2);
3302
- c([
3303
- n({ type: Boolean })
3304
- ], l.prototype, "mapTypeControl", 2);
3305
- c([
3306
- n({ type: Boolean })
3307
- ], l.prototype, "scaleControl", 2);
3308
- c([
3309
- n({ type: Boolean })
3310
- ], l.prototype, "streetViewControl", 2);
3311
- c([
3312
- n({ type: Boolean })
3313
- ], l.prototype, "rotateControl", 2);
3314
- c([
3315
- n({ type: Boolean })
3316
- ], l.prototype, "fullscreenControl", 2);
3317
- c([
3318
- n({ type: Boolean, attribute: "enable-geolocation" })
3319
- ], l.prototype, "enableGeolocation", 2);
3320
- c([
3321
- n({ type: Boolean, attribute: "show-location-marker" })
3322
- ], l.prototype, "showLocationMarker", 2);
3323
- c([
3324
- n({ type: Object })
3325
- ], l.prototype, "geolocationOptions", 2);
3326
- c([
3327
- n({ type: Object, attribute: "location-marker-position" })
3328
- ], l.prototype, "locationMarkerPosition", 2);
3329
- c([
3330
- n({ type: String, attribute: "location-marker-background" })
3331
- ], l.prototype, "locationMarkerBackground", 2);
3332
- c([
3333
- n({ type: String, attribute: "location-marker-border-color" })
3334
- ], l.prototype, "locationMarkerBorderColor", 2);
3335
- c([
3336
- n({ type: String, attribute: "location-marker-glyph-color" })
3337
- ], l.prototype, "locationMarkerGlyphColor", 2);
3338
- c([
3339
- n({ type: Number, attribute: "location-marker-scale" })
3340
- ], l.prototype, "locationMarkerScale", 2);
3341
- c([
3342
- n({ type: Object, attribute: "location-circle-options" })
3343
- ], l.prototype, "locationCircleOptions", 2);
3344
- c([
3345
- n({ type: String })
3346
- ], l.prototype, "language", 2);
3347
- c([
3348
- n({ type: Object })
3349
- ], l.prototype, "options", 2);
3350
- c([
3351
- n({ type: String, attribute: "geolocation-button-label" })
3352
- ], l.prototype, "geolocationButtonLabel", 2);
3353
- c([
3354
- n({ type: String, attribute: "geolocation-loading-title" })
3355
- ], l.prototype, "geolocationLoadingTitle", 2);
3356
- c([
3357
- n({ type: String, attribute: "geolocation-loading-instructions" })
3358
- ], l.prototype, "geolocationLoadingInstructions", 2);
3359
- c([
3360
- n({ type: String, attribute: "geolocation-error-title" })
3361
- ], l.prototype, "geolocationErrorTitle", 2);
3362
- c([
3363
- n({ type: String, attribute: "geolocation-error-button-text" })
3364
- ], l.prototype, "geolocationErrorButtonText", 2);
3365
- c([
3366
- n({ type: String, attribute: "geolocation-error-timer-message" })
3367
- ], l.prototype, "geolocationErrorTimerMessage", 2);
3368
- c([
3369
- n({ type: String, attribute: "geolocation-click-to-select-message" })
3370
- ], l.prototype, "geolocationClickToSelectMessage", 2);
3371
- c([
3372
- n({ type: String, attribute: "geolocation-permission-denied-message" })
3373
- ], l.prototype, "geolocationPermissionDeniedMessage", 2);
3374
- c([
3375
- n({ type: String, attribute: "geolocation-position-unavailable-message" })
3376
- ], l.prototype, "geolocationPositionUnavailableMessage", 2);
3377
- c([
3378
- n({ type: String, attribute: "geolocation-timeout-message" })
3379
- ], l.prototype, "geolocationTimeoutMessage", 2);
3380
- c([
3381
- n({ type: String, attribute: "geolocation-general-error-message" })
3382
- ], l.prototype, "geolocationGeneralErrorMessage", 2);
3383
- c([
3384
- n({ type: Boolean, attribute: "enable-autocomplete" })
3385
- ], l.prototype, "enableAutocomplete", 2);
3386
- c([
3387
- n({ type: String, attribute: "autocomplete-hint" })
3388
- ], l.prototype, "autocompleteHint", 2);
3389
- c([
3390
- n({ type: String, attribute: "autocomplete-proxy-url" })
3391
- ], l.prototype, "autocompleteProxyUrl", 2);
3392
- c([
3393
- n({ type: String, attribute: "autocomplete-auth-token" })
3394
- ], l.prototype, "autocompleteAuthToken", 2);
3395
- c([
3396
- n({ type: String, attribute: "autocomplete-placeholder" })
3397
- ], l.prototype, "autocompletePlaceholder", 2);
3398
- c([
3399
- n({ type: String, attribute: "autocomplete-label" })
3400
- ], l.prototype, "autocompleteLabel", 2);
3401
- c([
3402
- n({ type: String, attribute: "autocomplete-country" })
3403
- ], l.prototype, "autocompleteCountry", 2);
3404
- c([
3405
- n({ type: Object, attribute: "autocomplete-location-bias" })
3406
- ], l.prototype, "autocompleteLocationBias", 2);
3407
- c([
3408
- n({ type: Object, attribute: "autocomplete-location-restriction" })
3409
- ], l.prototype, "autocompleteLocationRestriction", 2);
3410
- c([
3411
- n({ type: String, attribute: "autocomplete-types" })
3412
- ], l.prototype, "autocompleteTypes", 2);
3413
- c([
3414
- n({ type: String, attribute: "autocomplete-fields" })
3415
- ], l.prototype, "autocompleteFields", 2);
3416
- c([
3417
- n({ type: Boolean, attribute: "autocomplete-strict-bounds" })
3418
- ], l.prototype, "autocompleteStrictBounds", 2);
3419
- c([
3420
- n({ type: Boolean, attribute: "autocomplete-resolve" })
3421
- ], l.prototype, "autocompleteResolve", 2);
3422
- c([
3423
- n({ type: Number, attribute: "autocomplete-debounce-delay" })
3424
- ], l.prototype, "autocompleteDebounceDelay", 2);
3425
- c([
3426
- n({ type: Number, attribute: "autocomplete-min-chars" })
3427
- ], l.prototype, "autocompleteMinChars", 2);
3428
- c([
3429
- F(".map")
3430
- ], l.prototype, "mapElement", 2);
3431
- c([
3432
- F("salla-address-autocomplete")
3433
- ], l.prototype, "autocompleteElement", 2);
3434
- c([
3435
- h()
3436
- ], l.prototype, "geolocationLoading", 2);
3437
- c([
3438
- h()
3439
- ], l.prototype, "geolocationError", 2);
3440
- c([
3441
- h()
3442
- ], l.prototype, "showLoadingOverlay", 2);
3443
- c([
3444
- h()
3445
- ], l.prototype, "buttonState", 2);
3446
- l = c([
3447
- L("gmap-map")
3448
- ], l);
3449
- var Bt = Object.defineProperty, Ut = Object.getOwnPropertyDescriptor, d = (t, e, o, i) => {
3450
- for (var s = i > 1 ? void 0 : i ? Ut(e, o) : e, a = t.length - 1, r; a >= 0; a--)
3451
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
3452
- return i && s && Bt(e, o, s), s;
3453
- };
3454
- let u = class extends i {
3455
- constructor() {
3456
- super(...arguments), this.title = "", this.gmpDraggable = false, this.gmpClickable = true, this.scale = 1, this.draggable = false, this.clickable = true, this.eventListeners = [];
3457
- }
3458
- async connectedCallback() {
3459
- super.connectedCallback(), await this.initMarker();
3460
- }
3461
- disconnectedCallback() {
3462
- super.disconnectedCallback(), this.cleanup();
3463
- }
3464
- async updated(t) {
3465
- 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 = this.gmpClickable !== false && this.clickable !== false), t.has("zIndex") && this.zIndex !== void 0 && (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());
3466
- }
3467
- async initMarker() {
3468
- this.addEventListener("gmap-ready", ((e) => {
3469
- this.map = e.detail.map, this.createMarker();
3470
- }));
3471
- const t = this.closest("gmap-map");
3472
- t?.getMap && (this.map = t.getMap(), this.map && await this.createMarker());
3473
- }
3474
- async createMarker() {
3475
- if (!this.map) {
3476
- console.error("GMapMarker: No map found. Make sure the marker is inside a <gmap-map> element.");
3477
- return;
3478
- }
3479
- if (!this.map.get?.("mapId")) {
3480
- console.error(
3481
- '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'
3482
- );
3483
- return;
3484
- }
3485
- this.markerLibrary = await st("marker");
3486
- const { AdvancedMarkerElement: e, PinElement: o } = this.markerLibrary, i = this.gmpDraggable || this.draggable, s = this.gmpClickable !== false && this.clickable !== false, a = {
3487
- map: this.map,
3488
- position: this.normalizePosition(this.position),
3489
- title: this.title,
3490
- gmpDraggable: i,
3491
- gmpClickable: s
3492
- };
3493
- if (this.zIndex !== void 0 && (a.zIndex = this.zIndex), this.content)
3494
- if (typeof this.content == "string") {
3495
- const p = document.createElement("div");
3496
- p.innerHTML = this.content, a.content = p;
3497
- } else
3498
- a.content = this.content;
3499
- else if (this.icon) {
3500
- const p = document.createElement("img");
3501
- p.src = this.icon, p.style.width = "32px", p.style.height = "32px", a.content = p;
3502
- } else {
3503
- const p = {
3504
- scale: this.scale || 1
3505
- };
3506
- this.background && (p.background = this.background), this.borderColor && (p.borderColor = this.borderColor), this.glyphColor && (p.glyphColor = this.glyphColor), this.label && typeof this.label == "string" && (p.glyph = this.label), this.pinElement = new o(p), this.pinElement?.element && (a.content = this.pinElement.element);
3507
- }
3508
- this.marker = new e(a);
3509
- const r = ["click", "drag", "dragstart", "dragend", "gmp-click"];
3510
- this.eventListeners = _(this.marker, r, (p, m) => {
3511
- if (p === "dragend" && this.marker && this.marker.position) {
3512
- const y = this.marker.position, H = y.toJSON ? y.toJSON() : { lat: y.lat(), lng: y.lng() };
3513
- this.dispatchEvent(
3514
- new CustomEvent("dragend", {
3515
- detail: { latLng: H },
3516
- bubbles: true,
3517
- composed: true
3518
- })
3519
- ), this.dispatchEvent(
3520
- new CustomEvent("gmap-position-changed", {
3521
- detail: H,
3522
- bubbles: true,
3523
- composed: true
3524
- })
3525
- );
3526
- } else
3527
- this.dispatchEvent(
3528
- new CustomEvent(p, {
3529
- detail: m,
3530
- bubbles: true,
3531
- composed: true
3532
- })
3533
- );
3534
- }), this.dispatchEvent(
3535
- new CustomEvent("gmap-marker-ready", {
3536
- detail: { marker: this.marker },
3537
- bubbles: true,
3538
- composed: true
3539
- })
3540
- );
3541
- }
3542
- updateMarkerContent() {
3543
- if (!this.marker || !this.markerLibrary) return;
3544
- const { PinElement: t } = this.markerLibrary;
3545
- if (this.content)
3546
- if (typeof this.content == "string") {
3547
- const e = document.createElement("div");
3548
- e.innerHTML = this.content, this.marker.content = e;
3549
- } else
3550
- this.marker.content = this.content;
3551
- else if (this.icon) {
3552
- const e = document.createElement("img");
3553
- e.src = this.icon, e.style.width = "32px", e.style.height = "32px", this.marker.content = e;
3554
- } else {
3555
- const e = {
3556
- scale: this.scale || 1
3557
- };
3558
- this.background && (e.background = this.background), this.borderColor && (e.borderColor = this.borderColor), this.glyphColor && (e.glyphColor = this.glyphColor), this.label && typeof this.label == "string" && (e.glyph = this.label), this.pinElement = new t(e), this.pinElement?.element && (this.marker.content = this.pinElement.element);
3559
- }
3560
- }
3561
- normalizePosition(t) {
3562
- return t ? {
3563
- lat: typeof t.lat == "number" ? t.lat : parseFloat(t.lat),
3564
- lng: typeof t.lng == "number" ? t.lng : parseFloat(t.lng)
3565
- } : { lat: 0, lng: 0 };
3566
- }
3567
- cleanup() {
3568
- x(this.eventListeners), this.marker && (this.marker.map = null, this.marker = void 0);
3569
- }
3570
- getMarker() {
3571
- return this.marker;
3572
- }
3573
- render() {
3574
- return b$2`<slot></slot>`;
3575
- }
3576
- };
3577
- d([
3578
- n({ type: Object })
3579
- ], u.prototype, "position", 2);
3580
- d([
3581
- n({ type: String })
3582
- ], u.prototype, "title", 2);
3583
- d([
3584
- n({ type: Boolean })
3585
- ], u.prototype, "gmpDraggable", 2);
3586
- d([
3587
- n({ type: Boolean })
3588
- ], u.prototype, "gmpClickable", 2);
3589
- d([
3590
- n({ type: Number })
3591
- ], u.prototype, "zIndex", 2);
3592
- d([
3593
- n({ type: Object })
3594
- ], u.prototype, "content", 2);
3595
- d([
3596
- n({ type: String })
3597
- ], u.prototype, "background", 2);
3598
- d([
3599
- n({ type: String })
3600
- ], u.prototype, "borderColor", 2);
3601
- d([
3602
- n({ type: String })
3603
- ], u.prototype, "glyphColor", 2);
3604
- d([
3605
- n({ type: Number })
3606
- ], u.prototype, "scale", 2);
3607
- d([
3608
- n({ type: Boolean })
3609
- ], u.prototype, "draggable", 2);
3610
- d([
3611
- n({ type: Boolean })
3612
- ], u.prototype, "clickable", 2);
3613
- d([
3614
- n({ type: String })
3615
- ], u.prototype, "icon", 2);
3616
- d([
3617
- n({ type: String })
3618
- ], u.prototype, "label", 2);
3619
- d([
3620
- h()
3621
- ], u.prototype, "marker", 2);
3622
- d([
3623
- h()
3624
- ], u.prototype, "map", 2);
3625
- u = d([
3626
- L("gmap-marker")
3627
- ], u);
3628
- var Dt = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, P = (t, e, o, i) => {
3629
- for (var s = i > 1 ? void 0 : i ? jt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
3630
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
3631
- return i && s && Dt(e, o, s), s;
3632
- };
3633
- let f = class extends i {
3634
- constructor() {
3635
- super(...arguments), this.opened = true, this.options = {}, this.eventListeners = [];
3636
- }
3637
- async connectedCallback() {
3638
- super.connectedCallback(), await this.initInfoWindow();
3639
- }
3640
- disconnectedCallback() {
3641
- super.disconnectedCallback(), this.cleanup();
3642
- }
3643
- updated(t) {
3644
- 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") && this.zIndex !== void 0 && this.infoWindow.setZIndex(this.zIndex));
3645
- }
3646
- async initInfoWindow() {
3647
- const t = this.closest("gmap-marker");
3648
- if (t)
3649
- this.addEventListener("gmap-marker-ready", ((e) => {
3650
- this.marker = e.detail.marker, this.createInfoWindow();
3651
- })), t.getMarker && (this.marker = t.getMarker(), this.marker && await this.createInfoWindow());
3652
- else {
3653
- const e = this.closest("gmap-map");
3654
- e && (this.addEventListener("gmap-ready", ((o) => {
3655
- this.map = o.detail.map, this.createInfoWindow();
3656
- })), e.getMap && (this.map = e.getMap(), this.map && await this.createInfoWindow()));
3657
- }
3658
- }
3659
- async createInfoWindow() {
3660
- const t = document.createElement("div");
3661
- t.style.cssText = "min-width: 200px;";
3662
- const e = {
3663
- content: t,
3664
- ...this.options
3665
- };
3666
- this.zIndex !== void 0 && (e.zIndex = this.zIndex), this.position && !this.marker && (e.position = this.position), this.infoWindow = new google.maps.InfoWindow(e), this.observeSlotContent(t);
3667
- const o = ["closeclick", "domready", "content_changed"];
3668
- this.eventListeners = _(this.infoWindow, o, (i) => {
3669
- i === "closeclick" && (this.opened = false), this.dispatchEvent(
3670
- new CustomEvent(i, {
3671
- bubbles: true,
3672
- composed: true
3673
- })
3674
- );
3675
- }), this.opened && this.open();
3676
- }
3677
- observeSlotContent(t) {
3678
- this.renderSlotContent(t);
3679
- const e = this.shadowRoot?.querySelector("slot");
3680
- e && e.addEventListener("slotchange", () => {
3681
- this.renderSlotContent(t);
3682
- }), this.contentObserver = new MutationObserver(() => {
3683
- this.renderSlotContent(t);
3684
- }), this.contentObserver.observe(this, {
3685
- childList: true,
3686
- subtree: true,
3687
- characterData: true
3688
- });
3689
- }
3690
- renderSlotContent(t) {
3691
- const e = this.shadowRoot?.querySelector("slot");
3692
- if (e) {
3693
- const o = e.assignedNodes({ flatten: true });
3694
- t.innerHTML = "", o.forEach((i) => {
3695
- (i.nodeType === Node.ELEMENT_NODE || i.nodeType === Node.TEXT_NODE && i.textContent?.trim()) && t.appendChild(i.cloneNode(true));
3696
- });
3697
- }
3698
- }
3699
- open() {
3700
- this.infoWindow && (this.marker ? this.infoWindow.open({
3701
- anchor: this.marker,
3702
- map: this.map
3703
- }) : this.map && this.infoWindow.open(this.map));
3704
- }
3705
- close() {
3706
- this.infoWindow?.close();
3707
- }
3708
- cleanup() {
3709
- x(this.eventListeners), this.contentObserver && (this.contentObserver.disconnect(), this.contentObserver = void 0), this.infoWindow && (this.infoWindow.close(), this.infoWindow = void 0);
3710
- }
3711
- getInfoWindow() {
3712
- return this.infoWindow;
3713
- }
3714
- render() {
3715
- return b$2`<slot></slot>`;
3716
- }
3717
- };
3718
- f.styles = i$3`
3719
- :host {
3720
- display: contents;
3721
- }
3722
- `;
3723
- P([
3724
- n({ type: Boolean })
3725
- ], f.prototype, "opened", 2);
3726
- P([
3727
- n({ type: Object })
3728
- ], f.prototype, "position", 2);
3729
- P([
3730
- n({ type: Number })
3731
- ], f.prototype, "zIndex", 2);
3732
- P([
3733
- n({ type: Object })
3734
- ], f.prototype, "options", 2);
3735
- P([
3736
- h()
3737
- ], f.prototype, "infoWindow", 2);
3738
- P([
3739
- h()
3740
- ], f.prototype, "map", 2);
3741
- P([
3742
- h()
3743
- ], f.prototype, "marker", 2);
3744
- f = P([
3745
- L("gmap-info-window")
3746
- ], f);
3747
- var Rt = Object.defineProperty, Gt = Object.getOwnPropertyDescriptor, z = (t, e, o, i) => {
3748
- for (var s = i > 1 ? void 0 : i ? Gt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
3749
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
3750
- return i && s && Rt(e, o, s), s;
3751
- };
3752
- let M = class extends i {
3753
- constructor() {
3754
- super(...arguments), this.path = [], this.editable = false, this.draggable = false, this.options = {}, this.eventListeners = [];
3755
- }
3756
- async connectedCallback() {
3757
- super.connectedCallback(), await this.initPolyline();
3758
- }
3759
- disconnectedCallback() {
3760
- super.disconnectedCallback(), this.cleanup();
3761
- }
3762
- updated(t) {
3763
- 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));
3764
- }
3765
- async initPolyline() {
3766
- const t = this.closest("gmap-map");
3767
- t && (this.addEventListener("gmap-ready", ((e) => {
3768
- this.map = e.detail.map, this.createPolyline();
3769
- })), t.getMap && (this.map = t.getMap(), this.map && await this.createPolyline()));
3770
- }
3771
- async createPolyline() {
3772
- if (!this.map) return;
3773
- const t = {
3774
- map: this.map,
3775
- path: this.path,
3776
- editable: this.editable,
3777
- draggable: this.draggable,
3778
- ...this.options
3779
- };
3780
- this.polyline = new google.maps.Polyline(t);
3781
- const e = [
3782
- "click",
3783
- "dblclick",
3784
- "drag",
3785
- "dragend",
3786
- "dragstart",
3787
- "mousedown",
3788
- "mousemove",
3789
- "mouseout",
3790
- "mouseover",
3791
- "mouseup",
3792
- "rightclick"
3793
- ];
3794
- this.eventListeners = _(this.polyline, e, (a, r) => {
3795
- this.dispatchEvent(
3796
- new CustomEvent(a, {
3797
- detail: r,
3798
- bubbles: true,
3799
- composed: true
3800
- })
3801
- );
3802
- });
3803
- const o = google.maps.event.addListener(this.polyline.getPath(), "set_at", () => {
3804
- this.emitPathChanged();
3805
- }), i = google.maps.event.addListener(this.polyline.getPath(), "insert_at", () => {
3806
- this.emitPathChanged();
3807
- }), s = google.maps.event.addListener(this.polyline.getPath(), "remove_at", () => {
3808
- this.emitPathChanged();
3809
- });
3810
- this.eventListeners.push(
3811
- () => google.maps.event.removeListener(o),
3812
- () => google.maps.event.removeListener(i),
3813
- () => google.maps.event.removeListener(s)
3814
- );
3815
- }
3816
- emitPathChanged() {
3817
- if (!this.polyline) return;
3818
- const t = this.polyline.getPath().getArray().map((e) => ({
3819
- lat: e.lat(),
3820
- lng: e.lng()
3821
- }));
3822
- this.dispatchEvent(
3823
- new CustomEvent("gmap-path-changed", {
3824
- detail: t,
3825
- bubbles: true,
3826
- composed: true
3827
- })
3828
- );
3829
- }
3830
- cleanup() {
3831
- x(this.eventListeners), this.polyline && (this.polyline.setMap(null), this.polyline = void 0);
3832
- }
3833
- getPolyline() {
3834
- return this.polyline;
3835
- }
3836
- render() {
3837
- return b$2``;
3838
- }
3839
- };
3840
- z([
3841
- n({ type: Array })
3842
- ], M.prototype, "path", 2);
3843
- z([
3844
- n({ type: Boolean })
3845
- ], M.prototype, "editable", 2);
3846
- z([
3847
- n({ type: Boolean })
3848
- ], M.prototype, "draggable", 2);
3849
- z([
3850
- n({ type: Object })
3851
- ], M.prototype, "options", 2);
3852
- z([
3853
- h()
3854
- ], M.prototype, "polyline", 2);
3855
- z([
3856
- h()
3857
- ], M.prototype, "map", 2);
3858
- M = z([
3859
- L("gmap-polyline")
3860
- ], M);
3861
- var Wt = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, O = (t, e, o, i) => {
3862
- for (var s = i > 1 ? void 0 : i ? Zt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
3863
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
3864
- return i && s && Wt(e, o, s), s;
3865
- };
3866
- let w = class extends i {
3867
- constructor() {
3868
- super(...arguments), this.editable = false, this.draggable = false, this.options = {}, this.eventListeners = [];
3869
- }
3870
- async connectedCallback() {
3871
- super.connectedCallback(), await this.initPolygon();
3872
- }
3873
- disconnectedCallback() {
3874
- super.disconnectedCallback(), this.cleanup();
3875
- }
3876
- updated(t) {
3877
- 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));
3878
- }
3879
- async initPolygon() {
3880
- const t = this.closest("gmap-map");
3881
- t && (this.addEventListener("gmap-ready", ((e) => {
3882
- this.map = e.detail.map, this.createPolygon();
3883
- })), t.getMap && (this.map = t.getMap(), this.map && await this.createPolygon()));
3884
- }
3885
- async createPolygon() {
3886
- if (!this.map) return;
3887
- const t = {
3888
- map: this.map,
3889
- editable: this.editable,
3890
- draggable: this.draggable,
3891
- ...this.options
3892
- };
3893
- this.paths ? t.paths = this.paths : this.path && (t.paths = this.path), this.polygon = new google.maps.Polygon(t);
3894
- const e = [
3895
- "click",
3896
- "dblclick",
3897
- "drag",
3898
- "dragend",
3899
- "dragstart",
3900
- "mousedown",
3901
- "mousemove",
3902
- "mouseout",
3903
- "mouseover",
3904
- "mouseup",
3905
- "rightclick"
3906
- ];
3907
- this.eventListeners = _(this.polygon, e, (o, i) => {
3908
- this.dispatchEvent(
3909
- new CustomEvent(o, {
3910
- detail: i,
3911
- bubbles: true,
3912
- composed: true
3913
- })
3914
- );
3915
- }), this.paths ? this.bindPathsChanges() : this.bindPathChanges();
3916
- }
3917
- bindPathChanges() {
3918
- if (!this.polygon) return;
3919
- const t = this.polygon.getPath(), e = google.maps.event.addListener(t, "set_at", () => {
3920
- this.emitPathChanged();
3921
- }), o = google.maps.event.addListener(t, "insert_at", () => {
3922
- this.emitPathChanged();
3923
- }), i = google.maps.event.addListener(t, "remove_at", () => {
3924
- this.emitPathChanged();
3925
- });
3926
- this.eventListeners.push(
3927
- () => google.maps.event.removeListener(e),
3928
- () => google.maps.event.removeListener(o),
3929
- () => google.maps.event.removeListener(i)
3930
- );
3931
- }
3932
- bindPathsChanges() {
3933
- if (!this.polygon) return;
3934
- this.polygon.getPaths().forEach((e, o) => {
3935
- const i = google.maps.event.addListener(e, "set_at", () => {
3936
- this.emitPathsChanged();
3937
- }), s = google.maps.event.addListener(e, "insert_at", () => {
3938
- this.emitPathsChanged();
3939
- }), a = google.maps.event.addListener(e, "remove_at", () => {
3940
- this.emitPathsChanged();
3941
- });
3942
- this.eventListeners.push(
3943
- () => google.maps.event.removeListener(i),
3944
- () => google.maps.event.removeListener(s),
3945
- () => google.maps.event.removeListener(a)
3946
- );
3947
- });
3948
- }
3949
- emitPathChanged() {
3950
- if (!this.polygon) return;
3951
- const t = this.polygon.getPath().getArray().map((e) => ({
3952
- lat: e.lat(),
3953
- lng: e.lng()
3954
- }));
3955
- this.dispatchEvent(
3956
- new CustomEvent("gmap-path-changed", {
3957
- detail: t,
3958
- bubbles: true,
3959
- composed: true
3960
- })
3961
- );
3962
- }
3963
- emitPathsChanged() {
3964
- if (!this.polygon) return;
3965
- const t = this.polygon.getPaths().getArray().map(
3966
- (e) => e.getArray().map((o) => ({
3967
- lat: o.lat(),
3968
- lng: o.lng()
3969
- }))
3970
- );
3971
- this.dispatchEvent(
3972
- new CustomEvent("gmap-paths-changed", {
3973
- detail: t,
3974
- bubbles: true,
3975
- composed: true
3976
- })
3977
- );
3978
- }
3979
- cleanup() {
3980
- x(this.eventListeners), this.polygon && (this.polygon.setMap(null), this.polygon = void 0);
3981
- }
3982
- getPolygon() {
3983
- return this.polygon;
3984
- }
3985
- render() {
3986
- return b$2``;
3987
- }
3988
- };
3989
- O([
3990
- n({ type: Array })
3991
- ], w.prototype, "path", 2);
3992
- O([
3993
- n({ type: Array })
3994
- ], w.prototype, "paths", 2);
3995
- O([
3996
- n({ type: Boolean })
3997
- ], w.prototype, "editable", 2);
3998
- O([
3999
- n({ type: Boolean })
4000
- ], w.prototype, "draggable", 2);
4001
- O([
4002
- n({ type: Object })
4003
- ], w.prototype, "options", 2);
4004
- O([
4005
- h()
4006
- ], w.prototype, "polygon", 2);
4007
- O([
4008
- h()
4009
- ], w.prototype, "map", 2);
4010
- w = O([
4011
- L("gmap-polygon")
4012
- ], w);
4013
- var Nt = Object.defineProperty, qt = Object.getOwnPropertyDescriptor, $ = (t, e, o, i) => {
4014
- for (var s = i > 1 ? void 0 : i ? qt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
4015
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
4016
- return i && s && Nt(e, o, s), s;
4017
- };
4018
- let k = class extends i {
4019
- constructor() {
4020
- super(...arguments), this.radius = 1e3, this.editable = false, this.draggable = false, this.options = {}, this.eventListeners = [];
4021
- }
4022
- async connectedCallback() {
4023
- super.connectedCallback(), await this.initCircle();
4024
- }
4025
- disconnectedCallback() {
4026
- super.disconnectedCallback(), this.cleanup();
4027
- }
4028
- updated(t) {
4029
- super.updated(t), this.circle && (t.has("center") && this.center && this.circle.setCenter(this.center), t.has("radius") && this.radius !== void 0 && 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));
4030
- }
4031
- async initCircle() {
4032
- const t = this.closest("gmap-map");
4033
- t && (this.addEventListener("gmap-ready", ((e) => {
4034
- this.map = e.detail.map, this.createCircle();
4035
- })), t.getMap && (this.map = t.getMap(), this.map && await this.createCircle()));
4036
- }
4037
- async createCircle() {
4038
- if (!this.map) return;
4039
- const t = {
4040
- map: this.map,
4041
- center: this.center,
4042
- radius: this.radius,
4043
- editable: this.editable,
4044
- draggable: this.draggable,
4045
- ...this.options
4046
- };
4047
- this.circle = new google.maps.Circle(t);
4048
- const e = [
4049
- "click",
4050
- "dblclick",
4051
- "drag",
4052
- "dragend",
4053
- "dragstart",
4054
- "mousedown",
4055
- "mousemove",
4056
- "mouseout",
4057
- "mouseover",
4058
- "mouseup",
4059
- "rightclick",
4060
- "center_changed",
4061
- "radius_changed",
4062
- "bounds_changed"
4063
- ];
4064
- this.eventListeners = _(this.circle, e, (o, i) => {
4065
- if (o === "center_changed") {
4066
- const s = this.circle.getCenter(), a = s ? { lat: s.lat(), lng: s.lng() } : null;
4067
- this.dispatchEvent(
4068
- new CustomEvent(o, {
4069
- detail: a,
4070
- bubbles: true,
4071
- composed: true
4072
- })
4073
- );
4074
- } else if (o === "radius_changed") {
4075
- const s = this.circle.getRadius();
4076
- this.dispatchEvent(
4077
- new CustomEvent(o, {
4078
- detail: s,
4079
- bubbles: true,
4080
- composed: true
4081
- })
4082
- );
4083
- } else
4084
- this.dispatchEvent(
4085
- new CustomEvent(o, {
4086
- detail: i,
4087
- bubbles: true,
4088
- composed: true
4089
- })
4090
- );
4091
- });
4092
- }
4093
- cleanup() {
4094
- x(this.eventListeners), this.circle && (this.circle.setMap(null), this.circle = void 0);
4095
- }
4096
- getCircle() {
4097
- return this.circle;
4098
- }
4099
- render() {
4100
- return b$2``;
4101
- }
4102
- };
4103
- $([
4104
- n({ type: Object })
4105
- ], k.prototype, "center", 2);
4106
- $([
4107
- n({ type: Number })
4108
- ], k.prototype, "radius", 2);
4109
- $([
4110
- n({ type: Boolean })
4111
- ], k.prototype, "editable", 2);
4112
- $([
4113
- n({ type: Boolean })
4114
- ], k.prototype, "draggable", 2);
4115
- $([
4116
- n({ type: Object })
4117
- ], k.prototype, "options", 2);
4118
- $([
4119
- h()
4120
- ], k.prototype, "circle", 2);
4121
- $([
4122
- h()
4123
- ], k.prototype, "map", 2);
4124
- k = $([
4125
- L("gmap-circle")
4126
- ], k);
4127
- var Vt = Object.defineProperty, Ft = Object.getOwnPropertyDescriptor, I = (t, e, o, i) => {
4128
- for (var s = i > 1 ? void 0 : i ? Ft(e, o) : e, a = t.length - 1, r; a >= 0; a--)
4129
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
4130
- return i && s && Vt(e, o, s), s;
4131
- };
4132
- let S = class extends i {
4133
- constructor() {
4134
- super(...arguments), this.editable = false, this.draggable = false, this.options = {}, this.eventListeners = [];
4135
- }
4136
- async connectedCallback() {
4137
- super.connectedCallback(), await this.initRectangle();
4138
- }
4139
- disconnectedCallback() {
4140
- super.disconnectedCallback(), this.cleanup();
4141
- }
4142
- updated(t) {
4143
- 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));
4144
- }
4145
- async initRectangle() {
4146
- const t = this.closest("gmap-map");
4147
- t && (this.addEventListener("gmap-ready", ((e) => {
4148
- this.map = e.detail.map, this.createRectangle();
4149
- })), t.getMap && (this.map = t.getMap(), this.map && await this.createRectangle()));
4150
- }
4151
- async createRectangle() {
4152
- if (!this.map) return;
4153
- const t = {
4154
- map: this.map,
4155
- bounds: this.bounds,
4156
- editable: this.editable,
4157
- draggable: this.draggable,
4158
- ...this.options
4159
- };
4160
- this.rectangle = new google.maps.Rectangle(t);
4161
- const e = [
4162
- "click",
4163
- "dblclick",
4164
- "drag",
4165
- "dragend",
4166
- "dragstart",
4167
- "mousedown",
4168
- "mousemove",
4169
- "mouseout",
4170
- "mouseover",
4171
- "mouseup",
4172
- "rightclick",
4173
- "bounds_changed"
4174
- ];
4175
- this.eventListeners = _(this.rectangle, e, (o, i) => {
4176
- if (o === "bounds_changed") {
4177
- const s = this.rectangle.getBounds();
4178
- if (s) {
4179
- const a = {
4180
- north: s.getNorthEast().lat(),
4181
- south: s.getSouthWest().lat(),
4182
- east: s.getNorthEast().lng(),
4183
- west: s.getSouthWest().lng()
4184
- };
4185
- this.dispatchEvent(
4186
- new CustomEvent(o, {
4187
- detail: a,
4188
- bubbles: true,
4189
- composed: true
4190
- })
4191
- );
4192
- }
4193
- } else
4194
- this.dispatchEvent(
4195
- new CustomEvent(o, {
4196
- detail: i,
4197
- bubbles: true,
4198
- composed: true
4199
- })
4200
- );
4201
- });
4202
- }
4203
- cleanup() {
4204
- x(this.eventListeners), this.rectangle && (this.rectangle.setMap(null), this.rectangle = void 0);
4205
- }
4206
- getRectangle() {
4207
- return this.rectangle;
4208
- }
4209
- render() {
4210
- return b$2``;
4211
- }
4212
- };
4213
- I([
4214
- n({ type: Object })
4215
- ], S.prototype, "bounds", 2);
4216
- I([
4217
- n({ type: Boolean })
4218
- ], S.prototype, "editable", 2);
4219
- I([
4220
- n({ type: Boolean })
4221
- ], S.prototype, "draggable", 2);
4222
- I([
4223
- n({ type: Object })
4224
- ], S.prototype, "options", 2);
4225
- I([
4226
- h()
4227
- ], S.prototype, "rectangle", 2);
4228
- I([
4229
- h()
4230
- ], S.prototype, "map", 2);
4231
- S = I([
4232
- L("gmap-rectangle")
4233
- ], S);
4234
- var Ht = Object.defineProperty, Kt = Object.getOwnPropertyDescriptor, T = (t, e, o, i) => {
4235
- for (var s = i > 1 ? void 0 : i ? Kt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
4236
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
4237
- return i && s && Ht(e, o, s), s;
4238
- };
4239
- let C = class extends i {
4240
- constructor() {
4241
- super(...arguments), this.gridSize = 60, this.markers = [];
4242
- }
4243
- async connectedCallback() {
4244
- super.connectedCallback(), await this.initCluster();
4245
- }
4246
- disconnectedCallback() {
4247
- super.disconnectedCallback(), this.cleanup();
4248
- }
4249
- async initCluster() {
4250
- const t = this.closest("gmap-map");
4251
- t && (this.addEventListener("gmap-ready", ((e) => {
4252
- this.map = e.detail.map, this.createCluster();
4253
- })), t.getMap && (this.map = t.getMap(), this.map && await this.createCluster())), this.addEventListener("gmap-marker-ready", ((e) => {
4254
- const o = e.detail.marker;
4255
- this.addMarker(o);
4256
- }));
4257
- }
4258
- async createCluster() {
4259
- if (this.map)
4260
- try {
4261
- const t = await import('./index.esm.js').catch(() => null);
4262
- if (!t) {
4263
- console.error(
4264
- "GMapCluster: @googlemaps/markerclusterer not found. Install with: npm install @googlemaps/markerclusterer"
4265
- );
4266
- return;
4267
- }
4268
- const { MarkerClusterer: e } = t, o = {
4269
- map: this.map,
4270
- markers: this.markers
4271
- };
4272
- this.gridSize && (o.gridSize = this.gridSize), this.maxZoom !== void 0 && (o.maxZoom = this.maxZoom), this.styles && (o.styles = this.styles), this.calculator && (o.calculator = this.calculator), this.markerClusterer = new e(o);
4273
- } catch (t) {
4274
- console.error("GMapCluster: Error creating cluster:", t);
4275
- }
4276
- }
4277
- addMarker(t) {
4278
- this.markers.includes(t) || (this.markers.push(t), this.markerClusterer && this.markerClusterer.addMarker(t));
4279
- }
4280
- cleanup() {
4281
- this.markerClusterer && (this.markerClusterer.clearMarkers(), this.markerClusterer = void 0), this.markers = [];
4282
- }
4283
- getClusterer() {
4284
- return this.markerClusterer;
4285
- }
4286
- render() {
4287
- return b$2`<slot></slot>`;
4288
- }
4289
- };
4290
- T([
4291
- n({ type: Number })
4292
- ], C.prototype, "gridSize", 2);
4293
- T([
4294
- n({ type: Number })
4295
- ], C.prototype, "maxZoom", 2);
4296
- T([
4297
- n({ type: Array })
4298
- ], C.prototype, "styles", 2);
4299
- T([
4300
- n({ type: Function })
4301
- ], C.prototype, "calculator", 2);
4302
- T([
4303
- h()
4304
- ], C.prototype, "map", 2);
4305
- T([
4306
- h()
4307
- ], C.prototype, "markerClusterer", 2);
4308
- T([
4309
- h()
4310
- ], C.prototype, "markers", 2);
4311
- C = T([
4312
- L("gmap-cluster")
4313
- ], C);
4314
- var Jt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, v = (t, e, o, i) => {
4315
- for (var s = i > 1 ? void 0 : i ? Yt(e, o) : e, a = t.length - 1, r; a >= 0; a--)
4316
- (r = t[a]) && (s = (i ? r(e, o, s) : r(s)) || s);
4317
- return i && s && Jt(e, o, s), s;
4318
- };
4319
- let b = class extends i {
4320
- constructor() {
4321
- super(...arguments), this.zoom = 0, this.visible = true, this.motionTracking = true, this.options = {}, this.eventListeners = [];
4322
- }
4323
- async connectedCallback() {
4324
- super.connectedCallback();
4325
- }
4326
- async firstUpdated() {
4327
- await D, this.createPanorama();
4328
- }
4329
- disconnectedCallback() {
4330
- super.disconnectedCallback(), this.cleanup();
4331
- }
4332
- updated(t) {
4333
- 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") && this.zoom !== void 0 && 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));
4334
- }
4335
- createPanorama() {
4336
- if (!this.panoramaElement) return;
4337
- const t = {
4338
- position: this.position,
4339
- pano: this.pano,
4340
- zoom: this.zoom,
4341
- pov: this.pov,
4342
- visible: this.visible,
4343
- motionTracking: this.motionTracking,
4344
- ...this.options
4345
- };
4346
- this.panorama = new google.maps.StreetViewPanorama(this.panoramaElement, t);
4347
- const e = ["closeclick", "status_changed"];
4348
- this.eventListeners = _(this.panorama, e, (o, i) => {
4349
- this.dispatchEvent(
4350
- new CustomEvent(o, {
4351
- detail: i,
4352
- bubbles: true,
4353
- composed: true
4354
- })
4355
- );
4356
- });
4357
- }
4358
- cleanup() {
4359
- x(this.eventListeners), this.panorama = void 0;
4360
- }
4361
- resize() {
4362
- this.panorama && google.maps.event.trigger(this.panorama, "resize");
4363
- }
4364
- getPanorama() {
4365
- return this.panorama;
4366
- }
4367
- render() {
4368
- return b$2`<div class="panorama"></div>`;
4369
- }
4370
- };
4371
- b.styles = i$3`
4372
- :host {
4373
- display: block;
4374
- position: relative;
4375
- width: 100%;
4376
- height: 400px;
4377
- }
4378
-
4379
- .panorama {
4380
- width: 100%;
4381
- height: 100%;
4382
- }
4383
- `;
4384
- v([
4385
- n({ type: Object })
4386
- ], b.prototype, "position", 2);
4387
- v([
4388
- n({ type: String })
4389
- ], b.prototype, "pano", 2);
4390
- v([
4391
- n({ type: Number })
4392
- ], b.prototype, "zoom", 2);
4393
- v([
4394
- n({ type: Object })
4395
- ], b.prototype, "pov", 2);
4396
- v([
4397
- n({ type: Boolean })
4398
- ], b.prototype, "visible", 2);
4399
- v([
4400
- n({ type: Boolean })
4401
- ], b.prototype, "motionTracking", 2);
4402
- v([
4403
- n({ type: Object })
4404
- ], b.prototype, "options", 2);
4405
- v([
4406
- F(".panorama")
4407
- ], b.prototype, "panoramaElement", 2);
4408
- v([
4409
- h()
4410
- ], b.prototype, "panorama", 2);
4411
- b = v([
4412
- L("gmap-street-view-panorama")
4413
- ], b);
4414
-
4415
15
  var GetDirections = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
4416
16
  <path
4417
17
  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"
@@ -4507,7 +107,7 @@ function log(message, data) {
4507
107
  data !== undefined ? console.log(message, data) : console.log(message);
4508
108
  }
4509
109
  }
4510
- const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBulletDelivery extends HTMLElement$1 {
110
+ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBulletDelivery extends HTMLElement {
4511
111
  constructor() {
4512
112
  super();
4513
113
  this.__registerHost();
@@ -5717,11 +1317,17 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
5717
1317
  try {
5718
1318
  const mapsKey = salla.config.get('store.settings.keys.maps');
5719
1319
  if (mapsKey) {
5720
- ee({
1320
+ const bootMaps = () => import('./index2.js')
1321
+ .then(({ load }) => load({
5721
1322
  key: mapsKey,
5722
1323
  libraries: ['marker', 'places'],
5723
1324
  language: salla.config.get('user.language_code') || 'ar',
5724
- }).catch(err => log('Failed to load Google Maps SDK', err));
1325
+ }))
1326
+ .catch(err => log('Failed to load Google Maps SDK', err));
1327
+ if (document.readyState === 'complete')
1328
+ bootMaps();
1329
+ else
1330
+ window.addEventListener('load', bootMaps, { once: true });
5725
1331
  }
5726
1332
  this.addressToken = await bulletDeliveryAPI.getAddressToken();
5727
1333
  }
@@ -6558,16 +2164,16 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
6558
2164
  // tab is shown only when bullet delivery supports delivery (`isSupportsDelivery`).
6559
2165
  if (!this.supportsPickup)
6560
2166
  return null;
6561
- return (h$4("div", { class: "s-bullet-delivery-tabs" }, this.isSupportsDelivery && (h$4("button", { type: "button", class: {
2167
+ return (h("div", { class: "s-bullet-delivery-tabs" }, this.isSupportsDelivery && (h("button", { type: "button", class: {
6562
2168
  "s-bullet-delivery-tab": true,
6563
2169
  "s-bullet-delivery-tab--active": this.activeTab === "address",
6564
- }, onClick: () => this.handleTabChange("address") }, h$4("span", { class: "s-bullet-delivery-tab-icon", innerHTML: SILocation, "aria-hidden": "true" }), h$4("span", null, Salla.lang.get("mobile_app.strings.delivery")))), h$4("button", { type: "button", class: {
2170
+ }, onClick: () => this.handleTabChange("address") }, h("span", { class: "s-bullet-delivery-tab-icon", innerHTML: SILocation, "aria-hidden": "true" }), h("span", null, Salla.lang.get("mobile_app.strings.delivery")))), h("button", { type: "button", class: {
6565
2171
  "s-bullet-delivery-tab": true,
6566
2172
  "s-bullet-delivery-tab--active": this.activeTab === "branch",
6567
- }, onClick: () => this.handleTabChange("branch") }, h$4("span", { class: "s-bullet-delivery-tab-icon", innerHTML: Store, "aria-hidden": "true" }), h$4("span", null, Salla.lang.get("mobile_app.strings.pickup")))));
2173
+ }, onClick: () => this.handleTabChange("branch") }, h("span", { class: "s-bullet-delivery-tab-icon", innerHTML: Store, "aria-hidden": "true" }), h("span", null, Salla.lang.get("mobile_app.strings.pickup")))));
6568
2174
  }
6569
2175
  renderAlert(message) {
6570
- return (h$4("div", { class: "s-bullet-delivery-allocation-out-of-coverage", role: "alert" }, h$4("span", { class: "s-bullet-delivery-allocation-out-of-coverage-icon", "aria-hidden": "true" }, h$4("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true" }, h$4("title", null, "Information"), h$4("circle", { cx: "10", cy: "10", r: "9", stroke: "currentColor", "stroke-width": "1.5", fill: "currentColor" }), h$4("text", { x: "10", y: "14", "text-anchor": "middle", fill: "white", "font-size": "12", "font-weight": "bold" }, "i"))), h$4("span", { class: "s-bullet-delivery-allocation-out-of-coverage-text", style: { textAlign: this.isRTL ? 'right' : 'left' } }, message)));
2176
+ return (h("div", { class: "s-bullet-delivery-allocation-out-of-coverage", role: "alert" }, h("span", { class: "s-bullet-delivery-allocation-out-of-coverage-icon", "aria-hidden": "true" }, h("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true" }, h("title", null, "Information"), h("circle", { cx: "10", cy: "10", r: "9", stroke: "currentColor", "stroke-width": "1.5", fill: "currentColor" }), h("text", { x: "10", y: "14", "text-anchor": "middle", fill: "white", "font-size": "12", "font-weight": "bold" }, "i"))), h("span", { class: "s-bullet-delivery-allocation-out-of-coverage-text", style: { textAlign: this.isRTL ? 'right' : 'left' } }, message)));
6571
2177
  }
6572
2178
  renderAllocationOutOfCoverageAlert() {
6573
2179
  const message = this.allocationOutOfCoverageMessage ||
@@ -6583,20 +2189,20 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
6583
2189
  if (this.supportsPickup) {
6584
2190
  return this.renderAlert([
6585
2191
  `${message} ${Salla.lang.getWithDefault('pages.cart.choose_another_address_pickup', 'Choose another address or')} `,
6586
- h$4("button", { type: "button", class: "underline !text-blue-600", onClick: () => this.handleTabChange('branch') }, Salla.lang.getWithDefault('pages.cart.branch_pickup', 'pick up from a branch')),
2192
+ h("button", { type: "button", class: "underline !text-blue-600", onClick: () => this.handleTabChange('branch') }, Salla.lang.getWithDefault('pages.cart.branch_pickup', 'pick up from a branch')),
6587
2193
  ]);
6588
2194
  }
6589
2195
  return this.renderAlert(`${message} ${Salla.lang.getWithDefault('pages.cart.choose_another_address', 'Choose another address')}`);
6590
2196
  }
6591
2197
  renderCountrySelect() {
6592
- return (h$4("div", { class: "s-bullet-delivery-field" }, h$4("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: true, inputId: "bullet-delivery-country", searchQuery: this.countrySearchQuery, clientSearch: true, onItemSelected: (e) => this.handleCountrySelected(e.detail), onSearchInput: (e) => this.handleCountrySearch(e.detail), onDropdownClosed: () => this.handleCountryDropdownClosed() })));
2198
+ return (h("div", { class: "s-bullet-delivery-field" }, h("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: true, inputId: "bullet-delivery-country", searchQuery: this.countrySearchQuery, clientSearch: true, onItemSelected: (e) => this.handleCountrySelected(e.detail), onSearchInput: (e) => this.handleCountrySearch(e.detail), onDropdownClosed: () => this.handleCountryDropdownClosed() })));
6593
2199
  }
6594
2200
  /** Region select (SA only): shown when SA is selected; city and district disabled until region selected. */
6595
2201
  renderRegionSelect() {
6596
2202
  const isSA = isSaudiArabia(this.selectedCountry?.code ?? '');
6597
2203
  if (!isSA || !this.selectedCountry)
6598
2204
  return null;
6599
- return (h$4("div", { class: "s-bullet-delivery-field" }, h$4("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 || this.regions.length === 0, required: true, inputId: "bullet-delivery-region", searchQuery: this.regionSearchQuery, clientSearch: true, onItemSelected: (e) => this.handleRegionSelected(e.detail), onSearchInput: (e) => this.handleRegionSearch(e.detail), onDropdownClosed: () => this.handleRegionDropdownClosed() })));
2205
+ return (h("div", { class: "s-bullet-delivery-field" }, h("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 || this.regions.length === 0, required: true, inputId: "bullet-delivery-region", searchQuery: this.regionSearchQuery, clientSearch: true, onItemSelected: (e) => this.handleRegionSelected(e.detail), onSearchInput: (e) => this.handleRegionSearch(e.detail), onDropdownClosed: () => this.handleRegionDropdownClosed() })));
6600
2206
  }
6601
2207
  renderCityDistrictSelects() {
6602
2208
  const isSA = isSaudiArabia(this.selectedCountry?.code ?? '');
@@ -6613,14 +2219,14 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
6613
2219
  (isSA && !this.selectedRegion) ||
6614
2220
  !this.selectedCity ||
6615
2221
  this.loadingDistricts;
6616
- return (h$4("div", { class: "s-bullet-delivery-field-row" }, h$4("div", { class: "s-bullet-delivery-field" }, h$4("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: cityDisabled, required: true, inputId: "bullet-delivery-city", searchQuery: this.citySearchQuery, onItemSelected: (e) => this.handleCitySelected(e.detail), onSearchInput: (e) => this.handleCitySearch(e.detail), onDropdownClosed: () => this.handleCityDropdownClosed(), dropUp: true })), showDistrict && (h$4("div", { class: "s-bullet-delivery-field" }, showDistrictInput ? (h$4("div", null, h$4("label", { class: "s-bullet-delivery-label", htmlFor: "bullet-delivery-district" }, Salla.lang.get("pages.checkout.district_field"), h$4("span", { class: "text-red-500" }, " *")), h$4("input", { id: "bullet-delivery-district", type: "text", class: "form-input", placeholder: Salla.lang.get("pages.checkout.select_district"), value: this.districtName, disabled: districtDisabled, onInput: (e) => {
2222
+ return (h("div", { class: "s-bullet-delivery-field-row" }, h("div", { class: "s-bullet-delivery-field" }, h("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: cityDisabled, required: true, inputId: "bullet-delivery-city", searchQuery: this.citySearchQuery, onItemSelected: (e) => this.handleCitySelected(e.detail), onSearchInput: (e) => this.handleCitySearch(e.detail), onDropdownClosed: () => this.handleCityDropdownClosed(), dropUp: true })), showDistrict && (h("div", { class: "s-bullet-delivery-field" }, showDistrictInput ? (h("div", null, h("label", { class: "s-bullet-delivery-label", htmlFor: "bullet-delivery-district" }, Salla.lang.get("pages.checkout.district_field"), h("span", { class: "text-red-500" }, " *")), h("input", { id: "bullet-delivery-district", type: "text", class: "form-input", placeholder: Salla.lang.get("pages.checkout.select_district"), value: this.districtName, disabled: districtDisabled, onInput: (e) => {
6617
2223
  const input = e.target;
6618
2224
  this.districtName = input.value;
6619
2225
  this.updateNewAddressForm({ district: undefined });
6620
- } }))) : (h$4("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: districtDisabled || this.districts.length === 0, required: true, inputId: "bullet-delivery-district", searchQuery: this.districtSearchQuery, clientSearch: true, onItemSelected: (e) => this.handleDistrictSelected(e.detail), onSearchInput: (e) => this.handleDistrictSearch(e.detail), onDropdownClosed: () => this.handleDistrictDropdownClosed(), dropUp: true }))))));
2226
+ } }))) : (h("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: districtDisabled || this.districts.length === 0, required: true, inputId: "bullet-delivery-district", searchQuery: this.districtSearchQuery, clientSearch: true, onItemSelected: (e) => this.handleDistrictSelected(e.detail), onSearchInput: (e) => this.handleDistrictSearch(e.detail), onDropdownClosed: () => this.handleDistrictDropdownClosed(), dropUp: true }))))));
6621
2227
  }
6622
2228
  renderSavedAddressesEmptyState() {
6623
- return (h$4("div", { class: "s-bullet-delivery-saved-addresses-empty" }, h$4("div", { class: "s-bullet-delivery-saved-addresses-empty-icon", "aria-hidden": "true" }, h$4("svg", { width: "28", height: "28", viewBox: "0 0 28 29", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h$4("title", null, "No Saved Adresses"), h$4("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" }))), h$4("p", { class: "s-bullet-delivery-saved-addresses-empty-title" }, Salla.lang.get("pages.checkout.no_saved_addresses")), h$4("p", { class: "s-bullet-delivery-saved-addresses-empty-desc" }, Salla.lang.get("pages.checkout.add_address_simplify_shipping")), h$4("salla-button", { onClick: () => this.handleAddNewAddress(), onKeyUp: () => this.handleAddNewAddress() }, Salla.lang.get("pages.checkout.add_new_address"))));
2229
+ return (h("div", { class: "s-bullet-delivery-saved-addresses-empty" }, h("div", { class: "s-bullet-delivery-saved-addresses-empty-icon", "aria-hidden": "true" }, h("svg", { width: "28", height: "28", viewBox: "0 0 28 29", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("title", null, "No Saved Adresses"), h("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" }))), h("p", { class: "s-bullet-delivery-saved-addresses-empty-title" }, Salla.lang.get("pages.checkout.no_saved_addresses")), h("p", { class: "s-bullet-delivery-saved-addresses-empty-desc" }, Salla.lang.get("pages.checkout.add_address_simplify_shipping")), h("salla-button", { onClick: () => this.handleAddNewAddress(), onKeyUp: () => this.handleAddNewAddress() }, Salla.lang.get("pages.checkout.add_new_address"))));
6624
2230
  }
6625
2231
  /**
6626
2232
  * Save session address (guest intent) to user profile. Returns the newly saved address or null.
@@ -6688,7 +2294,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
6688
2294
  if (!this.isLoggedIn)
6689
2295
  return null;
6690
2296
  if (this.loadingSavedAddresses) {
6691
- return (h$4("div", { class: "s-bullet-delivery-addresses-list s-scrollbar" }, [1, 2, 3].map((v) => (h$4("div", { key: v, class: "s-bullet-delivery-address-item s-bullet-delivery-address-item--skeleton" }, h$4("salla-skeleton", { class: "s-bullet-delivery-skel-radio", height: "18px", width: "18px" }), h$4("salla-skeleton", { class: "s-bullet-delivery-skel-map", height: "36px", width: "36px" }), h$4("div", { class: "s-bullet-delivery-address-content" }, h$4("div", { class: "s-bullet-delivery-address-lines" }, h$4("salla-skeleton", { height: "18px", width: "72%" }), h$4("salla-skeleton", { height: "16px", width: "56%" }))))))));
2297
+ return (h("div", { class: "s-bullet-delivery-addresses-list s-scrollbar" }, [1, 2, 3].map((v) => (h("div", { key: v, class: "s-bullet-delivery-address-item s-bullet-delivery-address-item--skeleton" }, h("salla-skeleton", { class: "s-bullet-delivery-skel-radio", height: "18px", width: "18px" }), h("salla-skeleton", { class: "s-bullet-delivery-skel-map", height: "36px", width: "36px" }), h("div", { class: "s-bullet-delivery-address-content" }, h("div", { class: "s-bullet-delivery-address-lines" }, h("salla-skeleton", { height: "18px", width: "72%" }), h("salla-skeleton", { height: "16px", width: "56%" }))))))));
6692
2298
  }
6693
2299
  const intent = this.getStoredIntent();
6694
2300
  const hasSessionAddress = hasSessionAddressIntent(intent);
@@ -6706,7 +2312,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
6706
2312
  if (this.savedAddresses.length === 0 && !hasSessionAddress) {
6707
2313
  return this.renderSavedAddressesEmptyState();
6708
2314
  }
6709
- return (h$4("div", { class: "s-bullet-delivery-addresses-list s-scrollbar" }, hasSessionAddress &&
2315
+ return (h("div", { class: "s-bullet-delivery-addresses-list s-scrollbar" }, hasSessionAddress &&
6710
2316
  this.renderAddressRow({
6711
2317
  key: "session-address",
6712
2318
  line1: sessionLine1,
@@ -6739,7 +2345,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
6739
2345
  }
6740
2346
  renderAddressRow(options) {
6741
2347
  const { key, line1, line2, selected, disabled = false, onClick } = options;
6742
- return (h$4("button", { key: key, class: {
2348
+ return (h("button", { key: key, class: {
6743
2349
  "s-bullet-delivery-address-item": true,
6744
2350
  "s-bullet-delivery-address-item--selected": selected,
6745
2351
  "s-bullet-delivery-address-item--disabled": disabled,
@@ -6749,7 +2355,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
6749
2355
  if (!disabled)
6750
2356
  onClick();
6751
2357
  }
6752
- } }, h$4("input", { type: "radio", name: "saved_address", class: "s-bullet-delivery-radio", checked: selected, disabled: disabled }), h$4("span", { class: "s-bullet-delivery-address-map-icon", innerHTML: MiniMap, "aria-hidden": "true" }), h$4("div", { class: "s-bullet-delivery-address-content" }, h$4("div", { class: "s-bullet-delivery-address-lines" }, h$4("span", { class: "s-bullet-delivery-address-line1", style: { textAlign: this.isRTL ? 'right' : 'left' } }, line1), h$4("span", { class: "s-bullet-delivery-address-line2", style: { textAlign: this.isRTL ? 'right' : 'left' } }, line2)))));
2358
+ } }, h("input", { type: "radio", name: "saved_address", class: "s-bullet-delivery-radio", checked: selected, disabled: disabled }), h("span", { class: "s-bullet-delivery-address-map-icon", innerHTML: MiniMap, "aria-hidden": "true" }), h("div", { class: "s-bullet-delivery-address-content" }, h("div", { class: "s-bullet-delivery-address-lines" }, h("span", { class: "s-bullet-delivery-address-line1", style: { textAlign: this.isRTL ? 'right' : 'left' } }, line1), h("span", { class: "s-bullet-delivery-address-line2", style: { textAlign: this.isRTL ? 'right' : 'left' } }, line2)))));
6753
2359
  }
6754
2360
  renderMapSection() {
6755
2361
  const isSA = isSaudiArabia(this.selectedCountry?.code ?? '');
@@ -6759,12 +2365,12 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
6759
2365
  // map never opens "empty": before a selection the marker sits on the IP/Riyadh default and is
6760
2366
  // dragged/replaced once auto-geolocation or the user picks a real position.
6761
2367
  const center = hasLoc ? { lat: loc.lat, lng: loc.lng } : this.mapInitialCenter;
6762
- return (h$4("div", { class: "s-bullet-delivery-map-container" }, h$4("gmap-map", { ref: (el) => (this.gmapRef = el), center: center, zoom: 16, "min-zoom": 4, "max-zoom": 21, "map-id": "DEMO_MAP_ID", "enable-autocomplete": true, "enable-geolocation": true, "show-location-marker": true, "location-marker-position": hasLoc ? { lat: loc.lat, lng: loc.lng, accuracy: 50 } : { ...center, 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": isSA ? Salla.lang.get('pages.checkout.short_address_format_validation') : undefined, "autocomplete-country": this.selectedCountry?.code?.toLowerCase(), "autocomplete-resolve": false, "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 })));
2368
+ return (h("div", { class: "s-bullet-delivery-map-container" }, h("gmap-map", { ref: (el) => (this.gmapRef = el), center: center, zoom: 16, "min-zoom": 4, "max-zoom": 21, "map-id": "DEMO_MAP_ID", "enable-autocomplete": true, "enable-geolocation": true, "show-location-marker": true, "location-marker-position": hasLoc ? { lat: loc.lat, lng: loc.lng, accuracy: 50 } : { ...center, 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": isSA ? Salla.lang.get('pages.checkout.short_address_format_validation') : undefined, "autocomplete-country": this.selectedCountry?.code?.toLowerCase(), "autocomplete-resolve": false, "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 })));
6763
2369
  }
6764
2370
  renderAddressConfirmation() {
6765
2371
  const address = this.mapLocationData?.formattedAddress ?? '';
6766
2372
  const shortCode = this.mapLocationData?.shortAddress;
6767
- return (h$4("div", { class: "s-bullet-delivery-address-confirm" }, h$4("div", { class: "s-bullet-delivery-address-confirm-card" }, h$4("div", { class: "s-bullet-delivery-address-confirm-details" }, h$4("span", { class: "s-bullet-delivery-address-confirm-label" }, Salla.lang.get('pages.checkout.selected_address')), h$4("p", { class: "s-bullet-delivery-address-confirm-text" }, address), shortCode && (h$4("span", { class: "s-bullet-delivery-address-confirm-tag" }, shortCode, h$4("span", { class: "s-bullet-delivery-address-confirm-tag-icon", innerHTML: LocationTag })))), h$4("button", { type: "button", class: "s-bullet-delivery-address-confirm-edit", onClick: () => { this.mapStep = 'map'; } }, Salla.lang.get('common.elements.edit'))), h$4("div", { class: "s-bullet-delivery-address-confirm-description" }, h$4("label", { class: "s-bullet-delivery-address-confirm-description-label" }, Salla.lang.get('pages.checkout.address_description'), h$4("span", { class: "s-bullet-delivery-address-confirm-description-optional" }, Salla.lang.get('common.elements.optional'))), h$4("input", { type: "text", class: "s-bullet-delivery-address-confirm-description-input form-input", placeholder: Salla.lang.get('pages.checkout.address_description_placeholder'), value: this.addressDescription, onInput: (e) => { this.addressDescription = e.target.value; } }))));
2373
+ return (h("div", { class: "s-bullet-delivery-address-confirm" }, h("div", { class: "s-bullet-delivery-address-confirm-card" }, h("div", { class: "s-bullet-delivery-address-confirm-details" }, h("span", { class: "s-bullet-delivery-address-confirm-label" }, Salla.lang.get('pages.checkout.selected_address')), h("p", { class: "s-bullet-delivery-address-confirm-text" }, address), shortCode && (h("span", { class: "s-bullet-delivery-address-confirm-tag" }, shortCode, h("span", { class: "s-bullet-delivery-address-confirm-tag-icon", innerHTML: LocationTag })))), h("button", { type: "button", class: "s-bullet-delivery-address-confirm-edit", onClick: () => { this.mapStep = 'map'; } }, Salla.lang.get('common.elements.edit'))), h("div", { class: "s-bullet-delivery-address-confirm-description" }, h("label", { class: "s-bullet-delivery-address-confirm-description-label" }, Salla.lang.get('pages.checkout.address_description'), h("span", { class: "s-bullet-delivery-address-confirm-description-optional" }, Salla.lang.get('common.elements.optional'))), h("input", { type: "text", class: "s-bullet-delivery-address-confirm-description-input form-input", placeholder: Salla.lang.get('pages.checkout.address_description_placeholder'), value: this.addressDescription, onInput: (e) => { this.addressDescription = e.target.value; } }))));
6768
2374
  }
6769
2375
  renderGuestDeliveryForm() {
6770
2376
  if (this.isMapModeAvailable) {
@@ -6780,7 +2386,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
6780
2386
  ];
6781
2387
  }
6782
2388
  renderDeliveryTab() {
6783
- return (h$4("div", { class: {
2389
+ return (h("div", { class: {
6784
2390
  "s-bullet-delivery-content": true,
6785
2391
  "s-bullet-delivery-content--active": this.activeTab === "address",
6786
2392
  "s-hidden": this.activeTab !== "address",
@@ -6808,14 +2414,14 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
6808
2414
  }
6809
2415
  this.handleConfirm();
6810
2416
  };
6811
- return (h$4("form", { onSubmit: handleSubmit }, this.renderGuestDeliveryForm(), h$4("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single", style: { padding: '24px' } }, h$4("salla-button", { type: "submit", loading: this.confirming, disabled: isConfirmStep ? this.confirming : !canAdvanceToConfirm, width: "wide" }, submitLabel), !this.isLoggedIn && (h$4("button", { type: "button", class: "s-bullet-delivery-login-prompt", onClick: () => this.handleLogin() }, Salla.lang.get('pages.checkout.login_to_use_saved_addresses'))))));
2417
+ return (h("form", { onSubmit: handleSubmit }, this.renderGuestDeliveryForm(), h("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single", style: { padding: '24px' } }, h("salla-button", { type: "submit", loading: this.confirming, disabled: isConfirmStep ? this.confirming : !canAdvanceToConfirm, width: "wide" }, submitLabel), !this.isLoggedIn && (h("button", { type: "button", class: "s-bullet-delivery-login-prompt", onClick: () => this.handleLogin() }, Salla.lang.get('pages.checkout.login_to_use_saved_addresses'))))));
6812
2418
  }
6813
2419
  renderBranchSearch() {
6814
- return (h$4("div", { class: "s-bullet-delivery-branch-search" }, h$4("div", { class: "s-bullet-delivery-search-row" }, h$4("div", { class: "s-bullet-delivery-search s-bullet-delivery-branch-search-wrap" }, h$4("span", { class: "s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon", innerHTML: Search, "aria-hidden": "true" }), h$4("input", { type: "text", class: "s-bullet-delivery-branch-search-input form-input", placeholder: Salla.lang.get("pages.checkout.search_for_city_or_branch"), value: this.branchSearchQuery, onInput: (e) => this.handleBranchSearch(e), autocomplete: "off" })), h$4("button", { type: "button", class: {
2420
+ return (h("div", { class: "s-bullet-delivery-branch-search" }, h("div", { class: "s-bullet-delivery-search-row" }, h("div", { class: "s-bullet-delivery-search s-bullet-delivery-branch-search-wrap" }, h("span", { class: "s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon", innerHTML: Search, "aria-hidden": "true" }), h("input", { type: "text", class: "s-bullet-delivery-branch-search-input form-input", placeholder: Salla.lang.get("pages.checkout.search_for_city_or_branch"), value: this.branchSearchQuery, onInput: (e) => this.handleBranchSearch(e), autocomplete: "off" })), h("button", { type: "button", class: {
6815
2421
  "s-bullet-delivery-location-btn": true,
6816
2422
  "s-bullet-delivery-location-btn--full": true,
6817
2423
  "s-bullet-delivery-location-btn--loading": this.loadingNearestBranch,
6818
- }, onClick: () => this.handleFindNearestBranch(), disabled: this.loadingNearestBranch }, this.loadingNearestBranch ? (h$4("span", { class: "s-bullet-delivery-location-icon", "aria-hidden": "true" }, h$4("salla-skeleton", { height: "18px", width: "18px" }))) : (h$4("span", { class: "s-bullet-delivery-location-icon", innerHTML: GPS, "aria-hidden": "true" })), h$4("span", null, Salla.lang.get("pages.checkout.nearest_to_my_location")))), this.locationError && this.activeTab === "branch" && (h$4("span", { class: "s-bullet-delivery-error" }, this.locationError))));
2424
+ }, onClick: () => this.handleFindNearestBranch(), disabled: this.loadingNearestBranch }, this.loadingNearestBranch ? (h("span", { class: "s-bullet-delivery-location-icon", "aria-hidden": "true" }, h("salla-skeleton", { height: "18px", width: "18px" }))) : (h("span", { class: "s-bullet-delivery-location-icon", innerHTML: GPS, "aria-hidden": "true" })), h("span", null, Salla.lang.get("pages.checkout.nearest_to_my_location")))), this.locationError && this.activeTab === "branch" && (h("span", { class: "s-bullet-delivery-error" }, this.locationError))));
6819
2425
  }
6820
2426
  /** Renders a branch's `preparation_time_range` as a localized "from - to <unit>" label. */
6821
2427
  getPreparationTimeLabel(range) {
@@ -6836,19 +2442,19 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
6836
2442
  }
6837
2443
  renderBranchList() {
6838
2444
  if (this.loadingBranches) {
6839
- return (h$4("div", { class: "s-bullet-delivery-branches-wrap" }, h$4("div", { class: "s-bullet-delivery-branches-loading" }, [1, 2, 3, 4].map((v) => (h$4("div", { key: v, class: "s-bullet-delivery-branch-skeleton" }, h$4("salla-skeleton", { class: "s-bullet-delivery-branch-skeleton-radio", type: "circle", height: "16px", width: "16px" }), h$4("div", { class: "s-bullet-delivery-branch-skeleton-icon" }, h$4("salla-skeleton", { height: "34px", width: "34px" })), h$4("div", { class: "s-bullet-delivery-branch-skeleton-content" }, h$4("salla-skeleton", { class: "s-bullet-delivery-branch-skeleton-title", height: "12px", width: "124px" })), h$4("salla-skeleton", { class: "s-bullet-delivery-branch-skeleton-time", height: "12px", width: "88px" }), h$4("div", { class: "s-bullet-delivery-branch-skeleton-map" }, h$4("salla-skeleton", { height: "32px", width: "32px" }))))))));
2445
+ return (h("div", { class: "s-bullet-delivery-branches-wrap" }, h("div", { class: "s-bullet-delivery-branches-loading" }, [1, 2, 3, 4].map((v) => (h("div", { key: v, class: "s-bullet-delivery-branch-skeleton" }, h("salla-skeleton", { class: "s-bullet-delivery-branch-skeleton-radio", type: "circle", height: "16px", width: "16px" }), h("div", { class: "s-bullet-delivery-branch-skeleton-icon" }, h("salla-skeleton", { height: "34px", width: "34px" })), h("div", { class: "s-bullet-delivery-branch-skeleton-content" }, h("salla-skeleton", { class: "s-bullet-delivery-branch-skeleton-title", height: "12px", width: "124px" })), h("salla-skeleton", { class: "s-bullet-delivery-branch-skeleton-time", height: "12px", width: "88px" }), h("div", { class: "s-bullet-delivery-branch-skeleton-map" }, h("salla-skeleton", { height: "32px", width: "32px" }))))))));
6840
2446
  }
6841
2447
  if (this.filteredBranches.length === 0) {
6842
- return (h$4("salla-placeholder", { alignment: "center", class: "s-bullet-delivery-placeholder" }, h$4("span", { slot: "title" }, Salla.lang.get("pages.checkout.no_pickup_branches_found"))));
2448
+ return (h("salla-placeholder", { alignment: "center", class: "s-bullet-delivery-placeholder" }, h("span", { slot: "title" }, Salla.lang.get("pages.checkout.no_pickup_branches_found"))));
6843
2449
  }
6844
- return (h$4("div", { class: "s-bullet-delivery-branches-wrap" }, h$4("ul", { class: "s-bullet-delivery-branches-list s-scrollbar" }, this.filteredBranches.map(branch => {
2450
+ return (h("div", { class: "s-bullet-delivery-branches-wrap" }, h("ul", { class: "s-bullet-delivery-branches-list s-scrollbar" }, this.filteredBranches.map(branch => {
6845
2451
  const selectable = isBranchSelectable(branch);
6846
2452
  const readiness = branch?.pickup_readiness;
6847
2453
  const locationText = [branch.country?.name, branch.city?.name, branch.district?.name]
6848
2454
  .filter(Boolean)
6849
2455
  .join(', ');
6850
2456
  const preparationTimeLabel = this.getPreparationTimeLabel(branch.preparation_time_range);
6851
- return (h$4("li", { key: branch.id, class: {
2457
+ return (h("li", { key: branch.id, class: {
6852
2458
  's-bullet-delivery-branch-item': true,
6853
2459
  's-bullet-delivery-branch-item--selected': this.selectedBranch?.id === branch.id,
6854
2460
  's-bullet-delivery-branch-item--disabled': !selectable,
@@ -6858,15 +2464,15 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
6858
2464
  if (selectable)
6859
2465
  this.handleBranchSelect(branch);
6860
2466
  }
6861
- } }, h$4("input", { type: "radio", name: "branch", class: "s-bullet-delivery-radio", checked: this.selectedBranch?.id === branch.id, disabled: !selectable }), h$4("span", { class: "s-bullet-delivery-branch-icon", "aria-hidden": "true" }, h$4("span", { innerHTML: Store })), h$4("div", { class: "flex flex-col" }, h$4("div", { class: "flex items-center gap-1 mb-1" }, h$4("p", { class: "s-bullet-delivery-branch-name text-start" }, branch.name), readiness?.label && (h$4("p", { class: `branch-status-badge${readiness.color ? ` ${readiness.color}` : ''}` }, readiness.label))), locationText ? (h$4("span", { class: "s-bullet-delivery-branch-prep", style: { fontSize: '0.8rem', lineHeight: '1.1rem', textAlign: this.isRTL ? 'right' : 'left' } }, h$4("i", { class: "sicon-location" }), "\u00A0", h$4("span", { class: "first-letter-cap" }, locationText))) : null, preparationTimeLabel ? (h$4("span", { class: "s-bullet-delivery-branch-prep", style: { fontSize: '0.8rem', lineHeight: '1.1rem', textAlign: this.isRTL ? 'right' : 'left' } }, h$4("i", { class: "sicon-clock" }), "\u00A0", h$4("span", { class: "first-letter-cap" }, Salla.lang.get('pages.checkout.pickup_duration'), ": ", preparationTimeLabel))) : null, readiness?.detail_line && (h$4("span", { class: "s-bullet-delivery-branch-prep", style: { fontSize: '0.8rem', lineHeight: '1.1rem', textAlign: this.isRTL ? 'right' : 'left' } }, h$4("i", { class: "sicon-store" }), "\u00A0", readiness.detail_line))), h$4("div", { style: {
2467
+ } }, h("input", { type: "radio", name: "branch", class: "s-bullet-delivery-radio", checked: this.selectedBranch?.id === branch.id, disabled: !selectable }), h("span", { class: "s-bullet-delivery-branch-icon", "aria-hidden": "true" }, h("span", { innerHTML: Store })), h("div", { class: "flex flex-col" }, h("div", { class: "flex items-center gap-1 mb-1" }, h("p", { class: "s-bullet-delivery-branch-name text-start" }, branch.name), readiness?.label && (h("p", { class: `branch-status-badge${readiness.color ? ` ${readiness.color}` : ''}` }, readiness.label))), locationText ? (h("span", { class: "s-bullet-delivery-branch-prep", style: { fontSize: '0.8rem', lineHeight: '1.1rem', textAlign: this.isRTL ? 'right' : 'left' } }, h("i", { class: "sicon-location" }), "\u00A0", h("span", { class: "first-letter-cap" }, locationText))) : null, preparationTimeLabel ? (h("span", { class: "s-bullet-delivery-branch-prep", style: { fontSize: '0.8rem', lineHeight: '1.1rem', textAlign: this.isRTL ? 'right' : 'left' } }, h("i", { class: "sicon-clock" }), "\u00A0", h("span", { class: "first-letter-cap" }, Salla.lang.get('pages.checkout.pickup_duration'), ": ", preparationTimeLabel))) : null, readiness?.detail_line && (h("span", { class: "s-bullet-delivery-branch-prep", style: { fontSize: '0.8rem', lineHeight: '1.1rem', textAlign: this.isRTL ? 'right' : 'left' } }, h("i", { class: "sicon-store" }), "\u00A0", readiness.detail_line))), h("div", { style: {
6862
2468
  width: 'full',
6863
2469
  maxWidth: '50px',
6864
2470
  marginInlineStart: 'auto',
6865
- } }, branch.location?.lat != null && branch.location?.lng != null && (h$4("a", { href: `https://www.google.com/maps?q=${branch.location.lat},${branch.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: e => e.stopPropagation() }, h$4("span", { class: "s-bullet-delivery-branch-map-link-icon", innerHTML: GetDirections.replace(/mask0_25437_34440/g, `mask0_branch_${branch.id}`), "aria-hidden": "true" }), h$4("span", { class: "sr-only" }, Salla.lang.get('common.elements.open_in_google_maps')))))));
2471
+ } }, branch.location?.lat != null && branch.location?.lng != null && (h("a", { href: `https://www.google.com/maps?q=${branch.location.lat},${branch.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: e => e.stopPropagation() }, h("span", { class: "s-bullet-delivery-branch-map-link-icon", innerHTML: GetDirections.replace(/mask0_25437_34440/g, `mask0_branch_${branch.id}`), "aria-hidden": "true" }), h("span", { class: "sr-only" }, Salla.lang.get('common.elements.open_in_google_maps')))))));
6866
2472
  }))));
6867
2473
  }
6868
2474
  renderPickupTab() {
6869
- return (h$4("div", { class: {
2475
+ return (h("div", { class: {
6870
2476
  "s-bullet-delivery-content": true,
6871
2477
  "s-bullet-delivery-content--active": this.activeTab === "branch",
6872
2478
  "s-hidden": this.activeTab !== "branch",
@@ -6913,18 +2519,18 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
6913
2519
  }
6914
2520
  this.handleSubmitAddAddress(e);
6915
2521
  };
6916
- return (h$4("div", { class: "s-bullet-delivery-add-address" }, h$4("form", { class: "s-bullet-delivery-add-address-form", onSubmit: handleFormSubmit }, this.renderGuestDeliveryForm(), h$4("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single" }, h$4("salla-button", { type: "submit", loading: this.savingAddress, disabled: !canSubmit || this.savingAddress, class: "s-bullet-delivery-add-address-submit" }, submitLabel)))));
2522
+ return (h("div", { class: "s-bullet-delivery-add-address" }, h("form", { class: "s-bullet-delivery-add-address-form", onSubmit: handleFormSubmit }, this.renderGuestDeliveryForm(), h("div", { class: "s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single" }, h("salla-button", { type: "submit", loading: this.savingAddress, disabled: !canSubmit || this.savingAddress, class: "s-bullet-delivery-add-address-submit" }, submitLabel)))));
6917
2523
  }
6918
2524
  renderFooter() {
6919
2525
  if (this.activeTab === "address" && !this.isLoggedIn && this.isMapModeAvailable) {
6920
2526
  return null;
6921
2527
  }
6922
2528
  const showAddAddressInFooter = this.activeTab === "address" && this.isLoggedIn;
6923
- return (h$4("div", { class: "s-bullet-delivery-footer" }, h$4("salla-button", { ref: (btn) => {
2529
+ return (h("div", { class: "s-bullet-delivery-footer" }, h("salla-button", { ref: (btn) => {
6924
2530
  this.confirmBtn = btn;
6925
2531
  }, disabled: this.isConfirmDisabled(), onClick: () => this.handleConfirm(), "loader-position": "center", width: "wide" }, this.activeTab === "branch"
6926
2532
  ? Salla.lang.get("pages.checkout.confirm_receipt_from_the_branch")
6927
- : Salla.lang.get("pages.checkout.confirm_address")), showAddAddressInFooter && (h$4("salla-button", { onClick: () => this.handleAddNewAddress(), width: "wide", shape: "link" }, Salla.lang.get("pages.checkout.add_new_address"))), !this.isLoggedIn && (h$4("salla-button", { shape: "link", onClick: () => this.handleLogin() }, Salla.lang.get("pages.checkout.login_to_use_saved_addresses")))));
2533
+ : Salla.lang.get("pages.checkout.confirm_address")), showAddAddressInFooter && (h("salla-button", { onClick: () => this.handleAddNewAddress(), width: "wide", shape: "link" }, Salla.lang.get("pages.checkout.add_new_address"))), !this.isLoggedIn && (h("salla-button", { shape: "link", onClick: () => this.handleLogin() }, Salla.lang.get("pages.checkout.login_to_use_saved_addresses")))));
6928
2534
  }
6929
2535
  renderMainView() {
6930
2536
  const isAddressEmptyState = this.isLoggedIn &&
@@ -6934,7 +2540,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
6934
2540
  const activeTabView = this.activeTab === "branch" && this.supportsPickup
6935
2541
  ? this.renderPickupTab()
6936
2542
  : this.renderDeliveryTab();
6937
- return (h$4("div", null, this.showCartWillBeClearedBanner &&
2543
+ return (h("div", null, this.showCartWillBeClearedBanner &&
6938
2544
  this.renderAlert(Salla.lang.get("blocks.scope.empty_cart_warning")), this.allocationOutOfCoverageMessage &&
6939
2545
  this.renderAllocationOutOfCoverageAlert(), activeTabView, !isAddressEmptyState && this.renderFooter()));
6940
2546
  }
@@ -7077,11 +2683,11 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
7077
2683
  render() {
7078
2684
  if (this.isMobileApp || !this.isEnabled)
7079
2685
  return null; // no-op when disabled
7080
- return (h$4(Host, { class: "s-bullet-delivery" }, h$4("salla-modal", { ref: modal => {
2686
+ return (h(Host, { class: "s-bullet-delivery" }, h("salla-modal", { ref: modal => {
7081
2687
  this.modal = modal;
7082
- }, isClosable: !this.isRequired && !this.shouldForceNonClosable(), class: "s-bullet-delivery-modal", width: "sm" }, h$4("div", { class: "s-bullet-delivery-inner" }, h$4("div", { class: "s-bullet-delivery-header" }, h$4("h2", { class: "s-bullet-delivery-title" }, this.activeTab === 'address'
2688
+ }, isClosable: !this.isRequired && !this.shouldForceNonClosable(), class: "s-bullet-delivery-modal", width: "sm" }, h("div", { class: "s-bullet-delivery-inner" }, h("div", { class: "s-bullet-delivery-header" }, h("h2", { class: "s-bullet-delivery-title" }, this.activeTab === 'address'
7083
2689
  ? Salla.lang.get('blocks.home.add_address_for_order_delivery')
7084
- : Salla.lang.get('blocks.home.choose_branch_for_order_pickup')), h$4("p", { class: "s-bullet-delivery-subtitle" }, this.activeTab === 'address'
2690
+ : Salla.lang.get('blocks.home.choose_branch_for_order_pickup')), h("p", { class: "s-bullet-delivery-subtitle" }, this.activeTab === 'address'
7085
2691
  ? Salla.lang.get('blocks.home.products_available_for_delivery_shown_while_shopping')
7086
2692
  : Salla.lang.get('blocks.home.choose_branch_for_order_pickup_description'))), this.renderTabs(), this.viewMode === 'main' && this.renderMainView(), this.viewMode === 'add-address' && this.renderAddAddressForm()))));
7087
2693
  }