@salla.sa/twilight-components 2.14.415 → 2.14.417

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 (301) hide show
  1. package/dist/cjs/{filepond-BSgA0m51.js → filepond-CLDRrF9Y.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-B_U56Mab.js → filepond-plugin-file-poster-BG080TXY.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-CMrqQo_q.js → filepond-plugin-file-validate-size-D9x7yIeS.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-DVXx7vBT.js → filepond-plugin-file-validate-type-CpHYiI2P.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-DGNKXZ2S.js → filepond-plugin-image-edit-B6TFtexK.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-CDzotJbv.js → filepond-plugin-image-exif-orientation-C4Ycs5Ji.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-BpPTY8Td.js → filepond-plugin-image-preview-CWlUoPsm.js} +1 -1
  8. package/dist/cjs/{functions-Dn6MANYA.js → functions-B0oYwrYv.js} +1 -1
  9. package/dist/cjs/{index-DKILCfeB.js → index-BQnJvBnq.js} +2 -2
  10. package/dist/cjs/{index-B5bZG9f4.js → index-DEDv7FBx.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +2 -2
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
  21. package/dist/cjs/salla-bullet-delivery.cjs.entry.js +10 -9
  22. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-delivery-promise.cjs.entry.js +2 -2
  31. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  43. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  44. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  45. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  47. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  48. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-map.cjs.entry.js +5 -5
  51. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  78. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-slider.cjs.entry.js +12 -5
  82. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  93. package/dist/cjs/{tracked-promise-CYjUhHsR.js → tracked-promise-BYjrk7x6.js} +1 -1
  94. package/dist/cjs/twilight.cjs.js +1 -1
  95. package/dist/cjs/{vanilla-picker-Cu_O9pv0.js → vanilla-picker-DbbhCpKU.js} +1 -1
  96. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +9 -8
  97. package/dist/collection/components/salla-delivery-promise/salla-delivery-promise.js +1 -1
  98. package/dist/collection/components/salla-map/salla-map.js +4 -4
  99. package/dist/collection/components/salla-product-options/salla-product-options.js +1 -1
  100. package/dist/collection/components/salla-slider/salla-slider.js +12 -5
  101. package/dist/components/index.js +2 -2
  102. package/dist/components/salla-bullet-delivery.js +9 -8
  103. package/dist/components/salla-delivery-promise.js +1 -1
  104. package/dist/components/salla-map2.js +4 -4
  105. package/dist/components/salla-product-options2.js +1 -1
  106. package/dist/components/salla-slider2.js +11 -4
  107. package/dist/esm/{filepond-B3rUfZ_Q.js → filepond-B25v0bOp.js} +1 -1
  108. package/dist/esm/{filepond-plugin-file-poster-DEDQEC6r.js → filepond-plugin-file-poster-3pI-GrYi.js} +1 -1
  109. package/dist/esm/{filepond-plugin-file-validate-size--a2eBQUT.js → filepond-plugin-file-validate-size-BF3zIjLe.js} +1 -1
  110. package/dist/esm/{filepond-plugin-file-validate-type-DxbdaAsO.js → filepond-plugin-file-validate-type-BR91w5t3.js} +1 -1
  111. package/dist/esm/{filepond-plugin-image-edit-DyPAs_ZT.js → filepond-plugin-image-edit-DPwgIvr6.js} +1 -1
  112. package/dist/esm/{filepond-plugin-image-exif-orientation-CECU3kdx.js → filepond-plugin-image-exif-orientation-Ba27xDEr.js} +1 -1
  113. package/dist/esm/{filepond-plugin-image-preview-BvMmLc3M.js → filepond-plugin-image-preview-CAEqmh_E.js} +1 -1
  114. package/dist/esm/{functions-DlXFEByO.js → functions-Bk6s9Xp6.js} +1 -1
  115. package/dist/esm/{index-BJrHu3Q4.js → index-CN6KGTlN.js} +2 -2
  116. package/dist/esm/{index-s83vHKfp.js → index-SSgsVJTU.js} +1 -1
  117. package/dist/esm/loader.js +2 -2
  118. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  119. package/dist/esm/salla-accordion_6.entry.js +1 -1
  120. package/dist/esm/salla-add-product-button_5.entry.js +2 -2
  121. package/dist/esm/salla-advertisement.entry.js +1 -1
  122. package/dist/esm/salla-alert_2.entry.js +1 -1
  123. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  124. package/dist/esm/salla-apps-icons.entry.js +1 -1
  125. package/dist/esm/salla-badge.entry.js +1 -1
  126. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  127. package/dist/esm/salla-bullet-delivery.entry.js +10 -9
  128. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  129. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  130. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  131. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  132. package/dist/esm/salla-contacts.entry.js +1 -1
  133. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  134. package/dist/esm/salla-count-down.entry.js +1 -1
  135. package/dist/esm/salla-custom-fields.entry.js +1 -1
  136. package/dist/esm/salla-delivery-promise.entry.js +2 -2
  137. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  138. package/dist/esm/salla-filters-widget.entry.js +1 -1
  139. package/dist/esm/salla-filters.entry.js +1 -1
  140. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  141. package/dist/esm/salla-gifting.entry.js +1 -1
  142. package/dist/esm/salla-hook.entry.js +1 -1
  143. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  144. package/dist/esm/salla-installment.entry.js +1 -1
  145. package/dist/esm/salla-list-tile.entry.js +1 -1
  146. package/dist/esm/salla-localization-modal.entry.js +1 -1
  147. package/dist/esm/salla-login-modal.entry.js +1 -1
  148. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  149. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  150. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  151. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  152. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  153. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  154. package/dist/esm/salla-loyalty.entry.js +1 -1
  155. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  156. package/dist/esm/salla-map.entry.js +5 -5
  157. package/dist/esm/salla-menu.entry.js +1 -1
  158. package/dist/esm/salla-metadata.entry.js +1 -1
  159. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  160. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  161. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  162. package/dist/esm/salla-notification-item.entry.js +1 -1
  163. package/dist/esm/salla-notifications.entry.js +1 -1
  164. package/dist/esm/salla-offer-modal.entry.js +1 -1
  165. package/dist/esm/salla-offer.entry.js +1 -1
  166. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  167. package/dist/esm/salla-order-details-options.entry.js +1 -1
  168. package/dist/esm/salla-order-details.entry.js +1 -1
  169. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  170. package/dist/esm/salla-order-edit.entry.js +1 -1
  171. package/dist/esm/salla-order-summary.entry.js +1 -1
  172. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  173. package/dist/esm/salla-orders.entry.js +1 -1
  174. package/dist/esm/salla-payments.entry.js +1 -1
  175. package/dist/esm/salla-placeholder.entry.js +1 -1
  176. package/dist/esm/salla-price-range.entry.js +1 -1
  177. package/dist/esm/salla-product-card_2.entry.js +1 -1
  178. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  179. package/dist/esm/salla-products-list.entry.js +1 -1
  180. package/dist/esm/salla-progress-bar.entry.js +1 -1
  181. package/dist/esm/salla-quick-order.entry.js +1 -1
  182. package/dist/esm/salla-rating-modal.entry.js +1 -1
  183. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  184. package/dist/esm/salla-scopes.entry.js +1 -1
  185. package/dist/esm/salla-search.entry.js +1 -1
  186. package/dist/esm/salla-skeleton.entry.js +1 -1
  187. package/dist/esm/salla-slider.entry.js +12 -5
  188. package/dist/esm/salla-social-share.entry.js +1 -1
  189. package/dist/esm/salla-social.entry.js +1 -1
  190. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  191. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  192. package/dist/esm/salla-tooltip.entry.js +1 -1
  193. package/dist/esm/salla-trust-badges.entry.js +1 -1
  194. package/dist/esm/salla-user-menu.entry.js +1 -1
  195. package/dist/esm/salla-user-profile.entry.js +1 -1
  196. package/dist/esm/salla-user-settings.entry.js +1 -1
  197. package/dist/esm/salla-verify.entry.js +1 -1
  198. package/dist/esm/salla-wallet.entry.js +1 -1
  199. package/dist/esm/{tracked-promise-BpC4uz19.js → tracked-promise-BpxjPYjA.js} +1 -1
  200. package/dist/esm/twilight.js +2 -2
  201. package/dist/esm/{vanilla-picker-EWATXRmN.js → vanilla-picker-CoVpA0FA.js} +1 -1
  202. package/dist/twilight/{p-00ddd52f.entry.js → p-01e5a467.entry.js} +1 -1
  203. package/dist/twilight/{p-32644ff6.entry.js → p-078e99bf.entry.js} +1 -1
  204. package/dist/twilight/{p-479420b3.entry.js → p-100664ef.entry.js} +1 -1
  205. package/dist/twilight/{p-e9e0b4b0.entry.js → p-12a70121.entry.js} +1 -1
  206. package/dist/twilight/{p-404c2e14.entry.js → p-1ac92f5a.entry.js} +1 -1
  207. package/dist/twilight/{p-cad60fb9.entry.js → p-21c9f888.entry.js} +1 -1
  208. package/dist/twilight/{p-0a768074.entry.js → p-269c76e2.entry.js} +1 -1
  209. package/dist/twilight/{p-ce6c21be.entry.js → p-2835e988.entry.js} +1 -1
  210. package/dist/twilight/p-2a3c8c27.entry.js +4 -0
  211. package/dist/twilight/{p-34900416.entry.js → p-30847b55.entry.js} +1 -1
  212. package/dist/twilight/{p-67617d49.entry.js → p-329af334.entry.js} +1 -1
  213. package/dist/twilight/{p-e715cf82.entry.js → p-337dc693.entry.js} +1 -1
  214. package/dist/twilight/{p-0eb6ff2f.entry.js → p-38661112.entry.js} +1 -1
  215. package/dist/twilight/{p-65cece5f.entry.js → p-38856897.entry.js} +1 -1
  216. package/dist/twilight/{p-1bc51071.entry.js → p-3a336511.entry.js} +1 -1
  217. package/dist/twilight/{p-3f02973f.entry.js → p-3d7867a2.entry.js} +1 -1
  218. package/dist/twilight/{p-4b7be330.entry.js → p-3ea047a7.entry.js} +1 -1
  219. package/dist/twilight/{p-31c8711f.entry.js → p-41338b27.entry.js} +1 -1
  220. package/dist/twilight/p-418574c0.entry.js +4 -0
  221. package/dist/twilight/{p-1bcf0168.entry.js → p-43eca2f5.entry.js} +1 -1
  222. package/dist/twilight/{p-b866c259.entry.js → p-44147d14.entry.js} +1 -1
  223. package/dist/twilight/{p-e2facd9b.entry.js → p-4546305a.entry.js} +1 -1
  224. package/dist/twilight/{p-7f41d7a1.entry.js → p-4bf158ef.entry.js} +1 -1
  225. package/dist/twilight/{p-96dfe5f7.entry.js → p-4e02648d.entry.js} +1 -1
  226. package/dist/twilight/{p-78fa7baa.entry.js → p-4f898f9a.entry.js} +1 -1
  227. package/dist/twilight/{p-5c710f88.entry.js → p-50562d51.entry.js} +1 -1
  228. package/dist/twilight/{p-555eb535.entry.js → p-50a976c7.entry.js} +1 -1
  229. package/dist/twilight/{p-6c5450b6.entry.js → p-529f8c0a.entry.js} +1 -1
  230. package/dist/twilight/{p-7810ffdb.entry.js → p-53c44a72.entry.js} +1 -1
  231. package/dist/twilight/{p-f9ec3859.entry.js → p-5980a88b.entry.js} +1 -1
  232. package/dist/twilight/{p-90c2bb26.entry.js → p-5a719b92.entry.js} +1 -1
  233. package/dist/twilight/{p-4fb84597.entry.js → p-5c2221e4.entry.js} +1 -1
  234. package/dist/twilight/{p-4370441c.entry.js → p-5ccc2829.entry.js} +1 -1
  235. package/dist/twilight/{p-db66c636.entry.js → p-5fe916ee.entry.js} +1 -1
  236. package/dist/twilight/{p-1dabd43d.entry.js → p-60bcb05d.entry.js} +1 -1
  237. package/dist/twilight/{p-995be2a3.entry.js → p-65b943d6.entry.js} +1 -1
  238. package/dist/twilight/{p-d0f37850.entry.js → p-66aac45f.entry.js} +1 -1
  239. package/dist/twilight/{p-1efb7a3d.entry.js → p-6edcfd67.entry.js} +1 -1
  240. package/dist/twilight/{p-1340cc10.entry.js → p-6f620e38.entry.js} +1 -1
  241. package/dist/twilight/{p-1cfc81cb.entry.js → p-73f6f7c7.entry.js} +1 -1
  242. package/dist/twilight/{p-d2cee8e2.entry.js → p-7cd6a7c4.entry.js} +1 -1
  243. package/dist/twilight/{p-0f3c0d0b.entry.js → p-7d0a6459.entry.js} +1 -1
  244. package/dist/twilight/{p-4cf8947e.entry.js → p-7df3848c.entry.js} +1 -1
  245. package/dist/twilight/{p-1f421639.entry.js → p-8867d017.entry.js} +1 -1
  246. package/dist/twilight/p-89912723.entry.js +4 -0
  247. package/dist/twilight/{p-e2dddc75.entry.js → p-89e6dc27.entry.js} +1 -1
  248. package/dist/twilight/{p-c84ac61b.entry.js → p-8cd3e1ee.entry.js} +1 -1
  249. package/dist/twilight/{p-62bc6e04.entry.js → p-8f45764d.entry.js} +1 -1
  250. package/dist/twilight/{p-26b97651.entry.js → p-8f879479.entry.js} +1 -1
  251. package/dist/twilight/{p-3201fa7d.entry.js → p-901f4d3c.entry.js} +1 -1
  252. package/dist/twilight/{p-d32a5200.entry.js → p-92948a3c.entry.js} +1 -1
  253. package/dist/twilight/{p-14483d4f.entry.js → p-93489e49.entry.js} +1 -1
  254. package/dist/twilight/{p-f2f94c2a.entry.js → p-93fd1f4c.entry.js} +1 -1
  255. package/dist/twilight/{p-f2ee2742.entry.js → p-943a70d5.entry.js} +1 -1
  256. package/dist/twilight/{p-293a2370.entry.js → p-984298b9.entry.js} +1 -1
  257. package/dist/twilight/{p-5de3e90f.entry.js → p-984ad4f5.entry.js} +1 -1
  258. package/dist/twilight/{p-b3338aba.entry.js → p-9e2f4e04.entry.js} +1 -1
  259. package/dist/twilight/{p-7bae206a.entry.js → p-9ef5baee.entry.js} +1 -1
  260. package/dist/twilight/{p-BhL20bfQ.js → p-BHMFnn7K.js} +1 -1
  261. package/dist/twilight/{p-B--H81EX.js → p-BI8HHCBk.js} +2 -2
  262. package/dist/twilight/{p-DDjn6-rT.js → p-BqUtsKuV.js} +1 -1
  263. package/dist/twilight/{p-BJrHu3Q4.js → p-CN6KGTlN.js} +1 -1
  264. package/dist/twilight/{p-CyRmFTSk.js → p-CSkvMMJe.js} +1 -1
  265. package/dist/twilight/{p-BokHJNvn.js → p-CZ0CFRkg.js} +1 -1
  266. package/dist/twilight/{p-CraZjTa1.js → p-D3AXrniM.js} +1 -1
  267. package/dist/twilight/{p-Cn23iQH-.js → p-Dhp50bRZ.js} +1 -1
  268. package/dist/twilight/{p-C50OVcDe.js → p-Dnp_uMrB.js} +1 -1
  269. package/dist/twilight/{p-CbR-jw9t.js → p-DyiIcpTE.js} +1 -1
  270. package/dist/twilight/{p-DJMIuJ3l.js → p-IfDGKmqz.js} +1 -1
  271. package/dist/twilight/{p-sXTTBYrW.js → p-OFtreEoC.js} +1 -1
  272. package/dist/twilight/{p-23a530eb.entry.js → p-a0f201dc.entry.js} +1 -1
  273. package/dist/twilight/{p-caa664d2.entry.js → p-a31559f1.entry.js} +1 -1
  274. package/dist/twilight/{p-8dfd35fd.entry.js → p-a3a24c3a.entry.js} +1 -1
  275. package/dist/twilight/{p-909a325c.entry.js → p-a3eaba68.entry.js} +1 -1
  276. package/dist/twilight/{p-b4560bcf.entry.js → p-a6b86d59.entry.js} +1 -1
  277. package/dist/twilight/{p-8a8952c9.entry.js → p-acdba86b.entry.js} +1 -1
  278. package/dist/twilight/{p-1a5ec95f.entry.js → p-b21dff70.entry.js} +1 -1
  279. package/dist/twilight/{p-4aa90fca.entry.js → p-b3ad1668.entry.js} +1 -1
  280. package/dist/twilight/{p-b45e0eb4.entry.js → p-b94fd507.entry.js} +1 -1
  281. package/dist/twilight/{p-ccf80fc5.entry.js → p-bbf9d24f.entry.js} +1 -1
  282. package/dist/twilight/{p-a1be369b.entry.js → p-c20a8155.entry.js} +1 -1
  283. package/dist/twilight/{p-66b013a9.entry.js → p-cb7286b0.entry.js} +1 -1
  284. package/dist/twilight/{p-20a86446.entry.js → p-cba54712.entry.js} +1 -1
  285. package/dist/twilight/{p-8246a2a1.entry.js → p-ce32049d.entry.js} +1 -1
  286. package/dist/twilight/{p-2c99cc69.entry.js → p-d83942f4.entry.js} +1 -1
  287. package/dist/twilight/{p-038c5d40.entry.js → p-ea67e7fb.entry.js} +1 -1
  288. package/dist/twilight/{p-8e37135a.entry.js → p-f6010b04.entry.js} +1 -1
  289. package/dist/twilight/{p-4bef45b0.entry.js → p-f6862c1d.entry.js} +1 -1
  290. package/dist/twilight/{p-291693b7.entry.js → p-f6cb5670.entry.js} +1 -1
  291. package/dist/twilight/{p-f0fed4a2.entry.js → p-f8971c24.entry.js} +1 -1
  292. package/dist/twilight/{p-1e542b72.entry.js → p-f953dac6.entry.js} +1 -1
  293. package/dist/twilight/{p-2b6e8d69.entry.js → p-fa6c9d88.entry.js} +1 -1
  294. package/dist/twilight/{p-5c4dcfbf.entry.js → p-fd200890.entry.js} +1 -1
  295. package/dist/twilight/twilight.esm.js +1 -1
  296. package/dist/types/components/salla-slider/salla-slider.d.ts +1 -1
  297. package/dist/types/components.d.ts +2 -2
  298. package/package.json +5 -5
  299. package/dist/twilight/p-5b78a478.entry.js +0 -4
  300. package/dist/twilight/p-8eaf0791.entry.js +0 -4
  301. package/dist/twilight/p-df385d43.entry.js +0 -4
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as t,c as s,h as e,H as i}from"./p-BJrHu3Q4.js";import{S as l}from"./p-BscTeWDc.js";import{L as a}from"./p-BO5AoBAP.js";import{a as n,A as r}from"./p-Vqpj4CWE.js";const h="BulletDeliveryAPI",o=t=>{const s=null==t?Number.NaN:Number(t);return!Number.isNaN(s)&&0!==s};async function d(t,s,e){try{return await t()}catch(t){return console.error(`${h}: ${e}`,t),s}}const c=t=>"SA"===String(t).toUpperCase(),u={getCountries:async(t=!1)=>d((async()=>((await salla.api.request("shipping/countries",{params:{for_branch:t?1:0}}))?.data??[]).map((t=>({id:t.id,code:t.code,name:t.name,has_regions:c(t.code)})))),[],"Error getting countries"),getRegions:async t=>o(t)?d((async()=>((await salla.api.request(`shipping/countries/${t}/regions`))?.data??[]).map((s=>({id:s.id,name:s.name,code:s.code,country_id:Number(t)})))),[],"Error fetching regions"):(console.warn(`${h}: getRegions called without valid country_id`),[]),getCities:async(t,s)=>o(t)?d((async()=>{const e={for_branch:0,country_id:t};return s&&(e.region_id=s),((await salla.api.request("shipping/cities",{params:e}))?.data??[]).map((s=>({id:s.id,name:s.name,country_id:t,...null!=s.region_id&&{region_id:s.region_id}})))}),[],"Error fetching cities"):(console.warn(`${h}: getCities called without valid country_id`),[]),getDistricts:async t=>o(t)?d((async()=>{const s=(await salla.api.request("shipping/districts",{params:{for_branch:0,city_id:t}}))?.data;return(Array.isArray(s)?s:Array.isArray(s?.districts)?s.districts:[]).map((s=>({id:s.id,name:s.name,name_en:s.name_en,city_id:t})))}),[],"Error fetching districts"):(console.warn(`${h}: getDistricts called without valid city_id`),[]),getSavedAddresses:async()=>d((async()=>{const t=(await salla.api.request("address"))?.data;return Array.isArray(t)?t:[]}),[],"Error fetching user addresses"),getBranches:async({query:t,lat:s,lng:e,country_id:i,per_page:l=20}={})=>d((async()=>{const a={per_page:l};t?.trim().length>=2&&(a.query=t),s&&(a.lat=s),e&&(a.lng=e),i&&(a.country_id=i);const n=await salla.api.request("branches",{params:a});return Array.isArray(n?.data)?n.data:[]}),[],"Error fetching branches"),saveAddressLocation:async t=>d((async()=>{const s=await salla.api.request("address/location",{...t,for_allocation:!0},"post"),e=s?.data??s;return{success:!0,address:"object"==typeof e&&null!=e&&"id"in e?e:void 0}}),{success:!1},"Error saving address/location"),setDeliveryScope:async t=>d((async()=>(await salla.scope.change({id:t}),salla.storage.set("scope",{...salla.storage.get("scope")||{},id:t}),!0)),!1,"Error setting delivery scope"),async allocateScope(t){try{const s=await salla.api.request("scopes/allocation",t,"post");return{success:!0,data:s?.data??s}}catch(t){console.error(`${h}: Error allocating scope`,t);const e=t;return{success:!1,error:null!=e?.response?.data?(s=e.response.data,s?.error?.message??s?.message??"Failed to allocate scope"):e?.message??"Unknown error"}}var s}},y=t=>t*(Math.PI/180);function b(t,s,e,i){const l=y(e-t),a=y(i-s),n=Math.sin(l/2)**2+Math.cos(y(t))*Math.cos(y(e))*Math.sin(a/2)**2;return 12742*Math.atan2(Math.sqrt(n),Math.sqrt(1-n))}function p(t,s){const[e,i]=String(t).trim().split(":").map(Number);return Number.isNaN(e)||Number.isNaN(i)?t:new Date(2e3,0,1,e,i).toLocaleTimeString(s,{hour:"numeric",minute:"2-digit",hour12:!0})}const v=(t,s,e)=>{if("branch"===t.type){const s=t.branch_details?.city??t.branch_details?.name;return s?`${e} ${s}`.trim():""}if("address"===t.type&&t.address_details){const e=[t.address_details.district?.name,t.address_details.city?.name,t.address_details.country?.name].filter(Boolean).join("، ")||t.address_details.short_address||"";return e?`${s} ${e}`.trim():""}return""},g=t=>null!=t?Number(t):void 0,m=t=>g(t?.address_details?.country?.id),f=t=>t?.country_code??t?.address_details?.country?.code??"",_=t=>g(t?.address_details?.region?.id),C=t=>g(t?.address_details?.city?.id),k=t=>g(t?.address_details?.district?.id),S=t=>t?.branch_details?.id,w=t=>t?.branch_details?.latitude,x=t=>t?.branch_details?.longitude,M=t=>{if(!t||"address"!==t.type||t.address_id)return!1;const s=m(t),e=C(t),i=k(t),l=f(t),a=null!=i&&0!==Number(i),n=Boolean(t.address_details?.district?.name?.trim()),r=!c(l)||a||n;return!!(s&&e&&r)},A=(t,s,e)=>!t||!c(t)||null!=s&&0!==Number(s)&&null!=e&&("number"==typeof e?0!==e:String(e).trim().length>0),B={[GeolocationPositionError.PERMISSION_DENIED]:"Location permission denied",[GeolocationPositionError.POSITION_UNAVAILABLE]:"Location unavailable",[GeolocationPositionError.TIMEOUT]:"Location timeout"};var L='<svg width="15" height="14" viewBox="0 0 15 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M1.14453 5.83032L1.14453 9.16486C1.14453 11.0511 1.14453 11.9943 1.73032 12.5803C2.3161 13.1663 3.25891 13.1663 5.14453 13.1663L9.14453 13.1663C11.0301 13.1663 11.9729 13.1663 12.5587 12.5803C13.1445 11.9943 13.1445 11.0511 13.1445 9.16486V5.83032"\n stroke="currentcolor" stroke-linecap="round" />\n <path\n d="M9.14453 10.1619C8.68846 10.5667 7.9624 10.8285 7.14453 10.8285C6.32666 10.8285 5.60059 10.5667 5.14453 10.1619"\n stroke="currentcolor" stroke-linecap="round" />\n <path\n d="M5.90256 4.44533C5.71455 5.12426 5.03086 6.29542 3.73185 6.46516C2.58488 6.61502 1.71497 6.11437 1.49277 5.90504C1.24779 5.7353 0.689441 5.19216 0.552703 4.85269C0.415966 4.51322 0.575492 3.77771 0.689441 3.47785L1.14495 2.15892C1.25615 1.82765 1.51646 1.04411 1.78334 0.779094C2.05022 0.514073 2.59054 0.502543 2.81294 0.502543L7.48329 0.502543C8.68543 0.519525 11.3139 0.491824 11.8335 0.502545C12.3532 0.513266 12.6654 0.948828 12.7565 1.13553C13.5318 3.01341 13.8333 4.08889 13.8333 4.54717C13.7321 5.03605 13.3133 5.95787 11.8335 6.36332C10.2956 6.7847 9.42363 5.96509 9.15007 5.65043M5.27015 5.65044C5.48665 5.91635 6.16578 6.45158 7.15029 6.46516C8.1348 6.47873 8.98485 5.79188 9.28681 5.44676C9.37227 5.34492 9.55687 5.04279 9.7483 4.44533"\n stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" />\n</svg>\n ';const N=class{constructor(e){t(this,e),this.bulletDeliveryConfirmed=s(this,"bulletDeliveryConfirmed"),this.bulletDeliveryClosed=s(this,"bulletDeliveryClosed"),this.addressCreated=s(this,"addressCreated"),this.headerContextUpdate=s(this,"headerContextUpdate"),this.confirming=!1,this.pendingCartSubmitResolver=null,this.pendingCartSubmitPromise=null,this.cartSubmitConfirmationPending=!1,this.branchSearchDebounceTimer=null,this.componentReady=!1,this.pendingOpen=!1,this.tabChanging=!1,this.intentStorageKey="bullet_delivery_intent",this.sessionShownKey="bullet_delivery_shown",this.incompleteIntentPromptKey="bullet_delivery_incomplete_intent_prompted",this.cartItemAddedEvent="cart::item.added",this.cartItemAddedHandler=null,this.cartSubmittingHandler=null,this.useCartEventApi=!1,this.authLoggedInHandler=null,this.authLoggedOutHandler=null,this.loginClosedHandler=null,this.hasExplicitPreselectedIdsForOpen=!1,this.bulletDeliveryOpenHandler=t=>{this.preselectedAddressId=t?.preselected_address_id,this.preselectedBranchId=t?.preselected_branch_id,this.hasExplicitPreselectedIdsForOpen=null!=t?.preselected_address_id||null!=t?.preselected_branch_id,this.open()},this.closeHandler=null,this.savedAddressesLoaded=!1,this.loading=!0,this.activeTab="address",this.isLoggedIn=!1,this.viewMode="main",this.countries=[],this.regions=[],this.cities=[],this.districts=[],this.loadingRegions=!1,this.selectedCountry=null,this.selectedRegion=null,this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.savedAddresses=[],this.selectedSavedAddress=null,this.selectedSessionAddress=!1,this.branches=[],this.filteredBranches=[],this.selectedBranch=null,this.branchSearchQuery="",this.loadingCities=!1,this.loadingDistricts=!1,this.loadingBranches=!1,this.loadingNearestBranch=!1,this.locationError="",this.savingAddress=!1,this.loadingSavedAddresses=!1,this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null,this.newAddressForm={...N.INITIAL_ADDRESS_FORM},this.handleSubmitAddAddress=async t=>{if(t.preventDefault(),!this.savingAddress&&this.selectedCountry&&this.selectedCity&&A(this.selectedCountry?.code,this.selectedRegion?.id,this.selectedDistrict?.id??(this.districtName?.trim()||null))){this.savingAddress=!0;try{const t=this.buildAddressLocationPayload(),{success:s,address:e}=await u.saveAddressLocation(t);if(s){await this.loadSavedAddresses();const t=e??this.savedAddresses[0]??null;t?.is_in_coverage&&(this.selectedSessionAddress=!1,this.selectedSavedAddress=t),this.addressCreated.emit({address:t}),this.viewMode="main",this.districtName=""}else Salla.notify?.error(Salla.lang.get("common.errors.error_occurred"))}catch(t){console.error("SallaBulletDelivery: Error saving address",t),Salla.notify?.error(Salla.lang.get("common.errors.error_occurred"))}finally{this.savingAddress=!1}}}}get supportsPickup(){return!!Salla.config.get("store.settings.bullet_delivery.supports_pickup")}get openingType(){return Salla.config.get("store.settings.bullet_delivery.settings.type")}get isRequired(){return!!Salla.config.get("store.settings.bullet_delivery.settings.is_required")}async open(){if(this.componentReady&&this.modal){this.resetState(),this.loading=!0,this.modal.open();try{this.isLoggedIn=!this.isGuestUser();const t=this.cleanStaleGuestAddressIdIfNeeded(this.getStoredIntent());this.applyPreselectedIdsFromIntent(t);const s=!this.isLoggedIn&&"address"===t?.type&&null!=m(t)&&null!=C(t);if(this.activeTab=this.supportsPickup&&t?.type&&("address"===t.type||"branch"===t.type)?t.type:"address",await Promise.all([this.loadCountries(s),this.isLoggedIn&&"address"===this.activeTab?this.loadSavedAddresses().then((()=>{this.savedAddressesLoaded=!0})):Promise.resolve()]),this.isLoggedIn&&this.preselectedAddressId){const t=this.savedAddresses.find((t=>t.id===this.preselectedAddressId));t&&(this.selectedSessionAddress=!1,this.selectedSavedAddress=t)}if("branch"===this.activeTab){const s=w(t),e=x(t);if(null!=s&&null!=e?await this.loadBranchesWithLocation(s,e):await this.loadBranches(),this.preselectedBranchId){const t=this.branches.find((t=>t.id===this.preselectedBranchId));t&&(this.selectedBranch=t)}}await this.prefillFromSessionStorage()}catch(t){console.error("SallaBulletDelivery: Error loading data",t)}finally{this.loading=!1,this.modal?.stopLoading(),this.overrideScopeSwitchUI()}}else this.pendingOpen=!0}async close(){if(!this.shouldForceNonClosable()||this.confirming)return this.cartSubmitConfirmationPending&&!this.confirming&&this.resolvePendingCartSubmit(),this.bulletDeliveryClosed.emit(),this.modal?.close()}resetState(){this.viewMode="main",this.selectedCountry=null,this.selectedRegion=null,this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.selectedSavedAddress=null,this.selectedSessionAddress=!1,this.selectedBranch=null,this.branchSearchQuery="",this.regions=[],this.cities=[],this.districts=[],this.branches=[],this.filteredBranches=[],this.newAddressForm={...N.INITIAL_ADDRESS_FORM},this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null,this.locationError="",this.savedAddressesLoaded=!1,this.loadingSavedAddresses=!1}getIntentStorage(){const t=Boolean(Salla.config.get("store.settings.bullet_delivery.settings.remember_last_session"));return Salla.storage[t?"store":"session"]}getShownStorage(){return Salla.storage.session}getStoredIntent(){return this.getIntentStorage().get(this.intentStorageKey)}isGuestUser(){return"guest"===String(Salla.config.get("user.type")??"guest")}cleanStaleGuestAddressIdIfNeeded(t){if(!this.isGuestUser()||"address"!==t?.type||!t.address_id)return t;const s={...t,address_id:void 0};return this.setStoredIntent(s),s}applyPreselectedIdsFromIntent(t){this.hasExplicitPreselectedIdsForOpen?this.hasExplicitPreselectedIdsForOpen=!1:(this.preselectedAddressId=void 0,this.preselectedBranchId=void 0,this.isGuestUser()?"branch"===t?.type&&t.branch_id&&(this.preselectedBranchId=t.branch_id):"address"===t?.type&&t.address_id?this.preselectedAddressId=t.address_id:"branch"===t?.type&&t.branch_id&&(this.preselectedBranchId=t.branch_id))}hasIncompleteUserAddressIntent(){if(this.isGuestUser())return!1;const t=this.getStoredIntent();return!(!t||"address"!==t.type||t.address_id||!t.address_details)&&M(t)}hasCompleteIntentForLoggedInUser(){if(this.isGuestUser())return!1;const t=this.getStoredIntent();return!!t&&("address"===t.type?!!t.address_id:"branch"===t.type&&!!t.branch_id)}shouldForceNonClosable(){return!this.isGuestUser()&&!!Salla.url.is_page("cart")&&!this.hasCompleteIntentForLoggedInUser()}shouldPromptIncompleteIntentThisSession(){const t=this.getShownStorage();return this.hasIncompleteUserAddressIntent()&&!0!==t.get(this.incompleteIntentPromptKey)}markIncompleteIntentPrompted(){this.getShownStorage().set(this.incompleteIntentPromptKey,!0)}setStoredIntent(t){this.getIntentStorage().set(this.intentStorageKey,t),this.overrideScopeSwitchUI()}clearBulletDeliveryStoredData(){Salla.storage.session.remove(this.intentStorageKey),Salla.storage.store.remove(this.intentStorageKey),Salla.storage.session.remove(this.sessionShownKey),Salla.storage.session.remove(this.incompleteIntentPromptKey),this.overrideScopeSwitchUI()}async prefillAddressFromStoredIntent(){const t=this.getStoredIntent();if(!t||"address"!==t.type||null==C(t))return;const s=m(t);if(!s)return;const e=this.countries.find((t=>String(t.id)===String(s)));if(!e)return;this.selectedCountry=e,this.updateNewAddressForm({country_id:Number(e.id)});const i=c(e.code),l=C(t),a=_(t),n=k(t),r=t.address_details?.district?.name,[h,o,d]=await Promise.all([i?u.getRegions(e.id):Promise.resolve([]),u.getCities(e.id,i&&null!=a?a:void 0),null!=l?u.getDistricts(Number(l)):Promise.resolve([])]);if(i&&(this.regions=h),this.cities=o,this.districts=d,this.loadingCities=!1,this.loadingRegions=!1,this.loadingDistricts=!1,i&&null!=a){const t=this.regions.find((t=>String(t.id)===String(a)));t&&(this.selectedRegion=t,this.updateNewAddressForm({region_id:t.id}))}if(null!=l&&this.cities.length>0){const t=this.cities.find((t=>String(t.id)===String(l)));t&&(this.selectedCity=t,this.updateNewAddressForm({city_id:t.id,city:t}))}if(this.districts.length>0){const t=this.findPrefillDistrict(n,r);t&&(this.updateNewAddressForm({district_id:t.id,district:t}),this.selectedDistrict=t)}!this.selectedDistrict&&r&&(this.districtName=r)}updateNewAddressForm(t){this.newAddressForm={...this.newAddressForm,...t}}hasBeenShownThisSession(){return!0===this.getShownStorage().get(this.sessionShownKey)}markShownThisSession(){this.getShownStorage().set(this.sessionShownKey,!0)}async loadCountries(t=!1){const s="branch"===this.activeTab;this.countries=await u.getCountries(s);const e=Salla.config.get("store.settings.bullet_delivery.customer_location.country"),i=e&&this.countries.length>0?this.countries.find((t=>String(t.code).toUpperCase()===String(e).toUpperCase())):null;i&&(this.selectedCountry=i,this.updateNewAddressForm({country_id:Number(this.selectedCountry.id)}),t||(c(this.selectedCountry.code)?await this.loadRegions(this.selectedCountry.id):await this.loadCities(this.selectedCountry.id)))}async loadCities(t,s){this.loadingCities=!0,this.cities=[],this.districts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="";try{this.cities=await u.getCities(t,s)}finally{this.loadingCities=!1}}async loadDistricts(t){this.loadingDistricts=!0,this.districts=[],this.selectedDistrict=null,this.districtName="";try{this.districts=await u.getDistricts(t)}finally{this.loadingDistricts=!1}}findPrefillDistrict(t,s){if(0===this.districts.length)return;if(null!=t){const s=this.districts.find((s=>String(s.id)===String(t)));if(s)return s}const e=s?.trim().toLowerCase();return e?this.districts.find((t=>{const s=t.name?.trim().toLowerCase(),i=t.name_en?.trim().toLowerCase();return s===e||i===e})):void 0}async loadBranches(){this.loadingBranches=!0;try{this.branches=await u.getBranches({country_id:this.selectedCountry?.id}),this.filterBranches()}finally{this.loadingBranches=!1}}filterBranches(){this.filteredBranches=((t,s)=>{if(!s)return t;const e=s.toLowerCase();return t.filter((t=>t.name.toLowerCase().includes(e)||t.city?.name?.toLowerCase().includes(e)))})(this.branches,this.branchSearchQuery)}async prefillFromSessionStorage(){try{const t=this.getStoredIntent();if(!t)return;if("address"!==this.activeTab||"address"!==t.type||this.isLoggedIn||await this.prefillAddressFromStoredIntent(),"branch"===this.activeTab&&"branch"===t.type){const s=m(t);if(null!=s){const e=this.countries.find((t=>String(t.id)===String(s)));if(e){this.selectedCountry=e,this.updateNewAddressForm({country_id:Number(e.id)});const s=S(t);if(null!=s&&this.branches.length>0){const t=this.branches.find((t=>t.id===s));t&&(this.selectedBranch=t)}}}}}catch(t){console.error("[BulletDelivery] Error prefilling from session storage:",t)}}async loadSavedAddresses(){this.savedAddresses=await u.getSavedAddresses();const t=this.getStoredIntent();if(M(t))this.selectedSessionAddress=!0,this.selectedSavedAddress=null;else{const t=this.savedAddresses.find((t=>t.is_default&&!1!==t.is_in_coverage));if(t)this.selectedSavedAddress=t;else{const t=this.savedAddresses.find((t=>!1!==t.is_in_coverage));t&&(this.selectedSavedAddress=t)}}}applyCountryChange(t){this.selectedCountry=t,this.selectedRegion=null,this.regions=[],this.cities=[],this.districts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="",this.allocationOutOfCoverageMessage=null,this.selectedCountry&&(this.updateNewAddressForm({country_id:Number(this.selectedCountry.id),region_id:void 0,city_id:void 0,district_id:void 0,city:void 0,district:void 0}),"branch"===this.activeTab?this.loadBranches():c(this.selectedCountry.code)?this.loadRegions(this.selectedCountry.id):this.loadCities(this.selectedCountry.id))}async loadRegions(t){this.loadingRegions=!0,this.regions=[],this.selectedRegion=null,this.cities=[],this.districts=[],this.selectedCity=null,this.selectedDistrict=null,this.districtName="";try{this.regions=await u.getRegions(t)}finally{this.loadingRegions=!1}}emitHeaderContextUpdate(t,s,e){let i="";"address"===t.type?s?i=s.district?.name&&s.city?.name?`${s.district.name}، ${s.city.name}`:s.city?.name??"":this.selectedCity?i=this.selectedDistrict?`${this.selectedDistrict.name}، ${this.selectedCity.name}`:this.selectedCity.name:t.address_details&&(i=[t.address_details.district?.name,t.address_details.city.name,t.address_details.country.name].filter(Boolean).join("، ")||t.address_details.short_address||""):e?i=e.name:t.branch_details&&(i=t.branch_details.city??t.branch_details.name);const l="address"===t.type?Salla.lang.get("mobile_app.strings.delivery"):Salla.lang.get("mobile_app.strings.pickup");this.headerContextUpdate.emit({type:t.type,display_text:i?`${l}: ${i}`:"",country_code:t.country_code,city:this.selectedCity?.name??t.address_details?.city?.name,district:this.selectedDistrict?.name??t.address_details?.district?.name,branch_name:e?.name??t.branch_details?.name})}handleBranchSearch(t){const s=t.target.value;if(this.branchSearchQuery=s,this.branchSearchDebounceTimer&&clearTimeout(this.branchSearchDebounceTimer),!s?.trim())return this.branchSearchQuery="",void this.loadBranches();this.branchSearchDebounceTimer=setTimeout((async()=>{if(!(s.trim().length<2)){this.loadingBranches=!0;try{this.branches=await u.getBranches({country_id:this.selectedCountry?.id,query:s}),this.filterBranches()}finally{this.loadingBranches=!1}}}),1e3)}async loadBranchesWithLocation(t,s){this.loadingBranches=!0;try{if(this.branches=await u.getBranches({country_id:this.selectedCountry?.id,lat:t,lng:s}),this.filterBranches(),!this.selectedCountry&&this.branches.length>0){const t=this.branches[0];if(t.country){const s=this.countries.find((s=>s.id===t.country.id));s&&(this.selectedCountry=s,this.updateNewAddressForm({country_id:Number(s.id)}))}}}finally{this.loadingBranches=!1}}async handleFindNearestBranch(){if(navigator.geolocation){this.loadingNearestBranch=!0,this.locationError="";try{const t=await new Promise(((t,s)=>{navigator.geolocation.getCurrentPosition(t,s,{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})})),{latitude:s,longitude:e}=t.coords;await this.loadBranchesWithLocation(s,e);const i=function(t,s,e){let i=null,l=Number.POSITIVE_INFINITY;for(const a of t){const t=null!=a.location?.lat?Number(a.location.lat):Number.NaN,n=null!=a.location?.lng?Number(a.location.lng):Number.NaN;if(Number.isNaN(t)||Number.isNaN(n)||!1===a.is_open)continue;const r=b(s,e,t,n);r<l&&(l=r,i=a)}return i}(this.branches,s,e);i&&(this.selectedBranch=i,this.branchSearchQuery="",this.filterBranches())}catch(t){const s=t;this.locationError=B["number"==typeof s?.code?s.code:-1]??"An error occurred while detecting location"}finally{this.loadingNearestBranch=!1}}else this.locationError=Salla.lang.get("pages.checkout.current_location_not_supported")}handleBranchSelect(t){this.selectedBranch=t}handleSavedAddressSelect(t){!1!==t.is_in_coverage?(this.selectedSavedAddress=t,this.selectedSessionAddress=!1):Salla.notify?.error(Salla.lang.get("pages.checkout.shipping_not_available"))}handleSessionAddressSelect(){this.selectedSessionAddress=!0,this.selectedSavedAddress=null}async handleAddNewAddress(){this.viewMode="add-address";const t=this.getStoredIntent(),s=m(t);if(s&&this.countries.length>0){const t=this.countries.find((t=>t.id===s));t&&(this.selectedCountry=t,this.updateNewAddressForm({country_id:Number(t.id)}),c(t.code)?await this.loadRegions(t.id):await this.loadCities(t.id))}}handleBackToAddressList(){this.viewMode="main"}buildAddressLocationPayload(){const t=this.selectedDistrict?.name??this.districtName?.trim()??"";return function(t){const{countryId:s,countryCode:e,regionId:i,cityId:l,districtId:a,description:n=""}=t,r=n||"";return{country_id:Number(s)||void 0,region_id:null!=i?Number(i):void 0,city_id:null!=l?Number(l):void 0,district_id:null!=a?Number(a):void 0,description:r,...e&&c(e)&&{local:r}}}({countryId:this.selectedCountry?.id??0,countryCode:this.selectedCountry?.code,regionId:this.selectedRegion?.id,cityId:this.selectedCity?.id,districtId:this.selectedDistrict?.id,description:t})}async handleTabChange(t){if(!this.tabChanging){this.tabChanging=!0;try{this.activeTab=t,this.showCartWillBeClearedBanner=!1,this.allocationOutOfCoverageMessage=null;const s="branch"===t;this.countries=await u.getCountries(s);const e=this.selectedCountry?.id;if(null!=e&&(this.selectedCountry=this.countries.find((t=>t.id===e))||null),this.selectedCountry)if("branch"===t){const t=this.getStoredIntent(),s=w(t),e=x(t);null!=s&&null!=e?await this.loadBranchesWithLocation(s,e):await this.loadBranches();const i=S(t);if(null!=i&&this.branches.length>0){const t=this.branches.find((t=>t.id===i));t&&(this.selectedBranch=t)}}else if("address"===t){if(this.isLoggedIn&&!this.savedAddressesLoaded){this.loadingSavedAddresses=!0;try{await this.loadSavedAddresses(),this.savedAddressesLoaded=!0}finally{this.loadingSavedAddresses=!1}}if(!this.isLoggedIn){const t=this.getStoredIntent();t&&C(t)&&await this.prefillAddressFromStoredIntent()}}}finally{this.tabChanging=!1}}}isConfirmDisabled(){return"branch"===this.activeTab?!this.selectedBranch:!("address"!==this.activeTab||this.isLoggedIn&&this.selectedSessionAddress||(this.isLoggedIn&&this.selectedSavedAddress?!1!==this.selectedSavedAddress.is_in_coverage:this.selectedCountry&&this.selectedCity&&A(this.selectedCountry?.code,this.selectedRegion?.id,this.selectedDistrict?.id??(this.districtName?.trim()||null))))}handleLogin(){Salla.auth.setCanRedirect(!1),Salla.event.dispatch("bullet-delivery::close"),Salla.event.dispatch("login::open",Salla.url.is_page("cart")?{withoutReload:!0,source:"cart-submit"}:{withoutReload:!0,source:"bullet-delivery"})}resolvePendingCartSubmit(){if(!this.pendingCartSubmitResolver)return;const t=this.pendingCartSubmitResolver;this.pendingCartSubmitResolver=null,this.pendingCartSubmitPromise=null,this.cartSubmitConfirmationPending=!1,t()}buildIntentAddress(){if("address"!==this.activeTab||!this.selectedCountry||!this.selectedCity)return;const t={id:this.selectedCountry.id,name:this.selectedCountry.name,code:this.selectedCountry.code},s={id:this.selectedCity.id,name:this.selectedCity.name},e=this.selectedRegion?{id:this.selectedRegion.id,name:this.selectedRegion.name,code:this.selectedRegion.code}:void 0,i=this.selectedDistrict?{id:this.selectedDistrict.id,name:this.selectedDistrict.name}:this.districtName?{id:0,name:this.districtName}:void 0,l=this.selectedSavedAddress?.short_address;return{country:t,region:e,city:s,district:i,short_address:l}}buildIntentAddressFromSaved(t){return{country:{id:t.country?.id??t.country_id??0,name:t.country?.name??"",code:t.country?.code},region:t.region?{id:t.region.id,name:t.region.name,code:t.region.code}:void 0,city:{id:t.city?.id??t.city_id??0,name:t.city?.name??""},district:t.district?{id:t.district.id,name:t.district.name}:void 0,short_address:t.short_address}}buildIntentBranch(){if("branch"!==this.activeTab||!this.selectedBranch)return;const t=this.selectedBranch,s=null!=t.location?.lat?Number(t.location.lat):void 0,e=null!=t.location?.lng?Number(t.location.lng):void 0;return{id:t.id,name:t.name,city:t.city?.name,latitude:s,longitude:e}}buildAllocationConfirmedAddressData(t){return"address"!==this.activeTab?null:{saved_address:t??this.selectedSavedAddress??void 0,country:this.selectedCountry??void 0,region:this.selectedRegion??void 0,city:this.selectedCity??void 0,district:this.selectedDistrict??void 0,district_name:this.districtName?.trim()||void 0,short_address:t?.short_address??this.selectedSavedAddress?.short_address,form_data:{...this.newAddressForm}}}async handleConfirm(){if(this.isConfirmDisabled()||this.confirming)return;this.confirming=!0,this.confirmBtn?.load();let t=!1;try{const s={type:this.activeTab,country_id:Number(this.selectedCountry?.id)||0,country_code:this.selectedCountry?.code||""};let e,i,l;if("address"===this.activeTab)if(this.isLoggedIn&&this.selectedSessionAddress){const t=await this.saveSessionAddressToProfile();if(!t)return Salla.notify?.error(Salla.lang.get("common.errors.error_occurred")),void this.confirmBtn?.stop();s.address_id=t.id,e=t,this.selectedSessionAddress=!1,this.selectedSavedAddress=t,s.address_details=this.buildIntentAddressFromSaved(t)}else this.isLoggedIn&&this.selectedSavedAddress?(s.address_id=this.selectedSavedAddress.id,e=this.selectedSavedAddress,s.address_details=this.buildIntentAddressFromSaved(this.selectedSavedAddress)):s.address_details=this.buildIntentAddress();else s.branch_details=this.buildIntentBranch(),s.branch_id=this.selectedBranch?.id,i=this.selectedBranch||void 0;"address"===this.activeTab?this.isLoggedIn&&this.selectedSavedAddress?l={type:"address",address_id:String(this.selectedSavedAddress.id)}:(l={type:"address",country_id:String(this.selectedCountry?.id||0),city_id:String(this.selectedCity?.id||"")},c(this.selectedCountry?.code??"")&&(this.selectedRegion?.id&&(l.region_id=String(this.selectedRegion.id)),l.district_id=String(this.selectedDistrict?.id||""))):l={type:"branch",branch_id:String(this.selectedBranch?.id||"")};const a=await u.allocateScope(l);if(!a.success){console.error("BulletDelivery: Scope allocation failed",a.error);const t=a.error||("address"===this.activeTab?Salla.lang.get("pages.checkout.address_out_of_coverage"):Salla.lang.get("pages.checkout.failed_to_set_pickup"));return Salla.notify?.error(t),this.allocationOutOfCoverageMessage=t,this.confirmBtn?.stop(),void(this.confirming=!1)}let n;if(a.data){const t=a.data;n=t.id;const e=t?.allocation?.type,i=t?.allocation?.branch_id;e&&Salla.api.setHeader("s-scope-allocation-type",e),i&&Salla.api.setHeader("s-scope-allocation-id",String(i));const l=Salla.config.get("store.scope",Salla.storage.get("scope"))||{};Salla.storage.set("scope",{...l,id:n,allocation_type:e,allocation_id:i?String(i):void 0}),s.allocation_headers={"s-scope-allocation-type":e,"s-scope-allocation-id":i?String(i):void 0}}this.markShownThisSession(),this.setStoredIntent(s),n&&await u.setDeliveryScope(n);const r={...s,address:this.buildAllocationConfirmedAddressData(e),branch:i??null,allocation_request:l,allocation_response:a.data??null};Salla.event.dispatch("bullet-delivery::allocation.confirmed",r),this.bulletDeliveryConfirmed.emit({...s,address:e,branch:i}),this.emitHeaderContextUpdate(s,e,i),t=!0,setTimeout((()=>{if(this.confirmBtn?.stop(),this.close(),this.confirming=!1,this.cartSubmitConfirmationPending)this.resolvePendingCartSubmit();else if(n){const t=Salla.storage.get("scope")||{};let s=Salla.helpers.addParamToUrl("scope",n);t.allocation_id&&(s=Salla.helpers.addParamToUrl("allocation_id",t.allocation_id,s)),t.allocation_type&&(s=Salla.helpers.addParamToUrl("allocation_type",t.allocation_type,s)),window.location.replace(s)}else window.location.reload()}),500)}finally{t||(this.confirming=!1)}}getCartViewConfig(t){if(!t||!Salla.url.is_page("cart"))return null;const s="branch"===t.type,e="address"===t.type;return s&&!this.supportsPickup||!s&&!e?null:{title:s?Salla.lang.get("pages.checkout.pickup_option"):Salla.lang.get("pages.checkout.delivery_option"),subtitle:v(t,Salla.lang.get("common.elements.to"),""),buttonText:Salla.lang.get("common.elements.edit"),isAddress:e,intent:t}}createCartViewElement(){const t=this.getStoredIntent(),s=this.getCartViewConfig(t);if(!s)return null;const{title:e,subtitle:i,buttonText:l,intent:n}=s,r="branch"===n.type?{preselected_branch_id:S(n)}:{preselected_address_id:n.address_id},h=document.createElement("span");h.className="s-bullet-delivery-cart-view-icon s-bullet-delivery-tab-icon",h.setAttribute("aria-hidden","true"),h.innerHTML=a;const o=document.createElement("span");o.className="s-bullet-delivery-cart-view-title",o.textContent=e;const d=document.createElement("span");d.className="s-bullet-delivery-cart-view-subtitle",d.textContent=i;const c=document.createElement("div");c.className="s-bullet-delivery-cart-view-text",c.append(o,d);const u=document.createElement("div");u.className="s-bullet-delivery-cart-view-info",u.append(h,c);const y=document.createElement("salla-button");y.className="s-bullet-delivery-cart-view-button",y.setAttribute("fill","outline"),y.setAttribute("color","primary"),y.textContent=l,y.addEventListener("click",(()=>Salla.event.emit("bullet-delivery::open",r)));const b=document.createElement("div");return b.className="s-bullet-delivery-cart-view",b.append(u,y),b}renderSkeleton(){return e("div",{slot:"loading",class:"s-bullet-delivery-skeleton"},e("div",{class:"s-bullet-delivery-skeleton-header"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-title",height:"28px",width:"68%"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-subtitle",height:"18px",width:"84%"})),e("div",{class:{"s-bullet-delivery-skeleton-tabs":!0,"s-bullet-delivery-skeleton-tabs--single":!this.supportsPickup}},e("div",{class:"s-bullet-delivery-skeleton-tab"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-tab-icon",height:"32px",width:"32px"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-tab-label",height:"18px",width:"92px"})),this.supportsPickup&&e("div",{class:"s-bullet-delivery-skeleton-tab"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-tab-icon",height:"32px",width:"32px"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-tab-label",height:"18px",width:"84px"}))),e("div",{class:"s-bullet-delivery-skeleton-content"},e("div",{class:"s-bullet-delivery-skeleton-field"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-label",height:"16px",width:"96px"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-control",height:"56px",width:"100%"})),e("div",{class:"s-bullet-delivery-skeleton-field"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-label",height:"16px",width:"104px"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-control",height:"56px",width:"100%"})),e("div",{class:"s-bullet-delivery-skeleton-field"},e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-label",height:"16px",width:"88px"}),e("salla-skeleton",{class:"s-bullet-delivery-skeleton-field-control",height:"56px",width:"100%"}))),e("div",{class:"s-bullet-delivery-skeleton-footer"},e("salla-skeleton",{height:"52px",width:"100%"})))}renderTabs(){return this.supportsPickup?e("div",{class:"s-bullet-delivery-tabs"},e("button",{type:"button",class:{"s-bullet-delivery-tab":!0,"s-bullet-delivery-tab--active":"address"===this.activeTab},onClick:()=>this.handleTabChange("address")},e("span",{class:"s-bullet-delivery-tab-icon",innerHTML:a,"aria-hidden":"true"}),e("span",null,Salla.lang.get("mobile_app.strings.delivery"))),e("button",{type:"button",class:{"s-bullet-delivery-tab":!0,"s-bullet-delivery-tab--active":"branch"===this.activeTab},onClick:()=>this.handleTabChange("branch")},e("span",{class:"s-bullet-delivery-tab-icon",innerHTML:L,"aria-hidden":"true"}),e("span",null,Salla.lang.get("mobile_app.strings.pickup")))):null}renderAlert(t){return e("div",{class:"s-bullet-delivery-allocation-out-of-coverage",role:"alert"},e("span",{class:"s-bullet-delivery-allocation-out-of-coverage-icon","aria-hidden":"true"},e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true"},e("title",null,"Information"),e("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor","stroke-width":"1.5",fill:"currentColor"}),e("text",{x:"10",y:"14","text-anchor":"middle",fill:"white","font-size":"12","font-weight":"bold"},"i"))),e("span",{class:"s-bullet-delivery-allocation-out-of-coverage-text"},t))}renderAllocationOutOfCoverageAlert(){const t=this.allocationOutOfCoverageMessage||Salla.lang.get("pages.checkout.shipping_not_available");return this.renderAlert(t)}renderCountrySelect(){return e("div",{class:"s-bullet-delivery-field"},e("label",{class:"s-bullet-delivery-label",htmlFor:"bullet-delivery-country"},Salla.lang.get("blocks.buy_as_gift.receiver_country"),e("span",{class:"text-red-500"}," *")),e("select",{id:"bullet-delivery-country",class:"form-input",onChange:t=>{const s=Number.parseInt(t.target.value),e=this.countries.find((t=>t.id===s));this.showCartWillBeClearedBanner=!(!this.selectedCountry||!e||this.selectedCountry.code===e.code),this.applyCountryChange(e||null)}},e("option",{value:"",disabled:!0,selected:!this.selectedCountry},Salla.lang.get("pages.checkout.select_country")),this.countries.map((t=>e("option",{key:t.id,value:t.id,selected:this.selectedCountry?.id===t.id},t.name)))))}renderSelectLoader(){return e("span",{class:"s-bullet-delivery-select-loader","aria-hidden":"true"},e("salla-skeleton",{height:"16px",width:"16px"}))}renderLoadingLabel(t,s,i=!1,l=!0){return e("label",{class:"s-bullet-delivery-label",htmlFor:s},e("span",{class:"s-bullet-delivery-label-content"},e("span",null,t,l&&e("span",{class:"text-red-500"}," *")),i&&this.renderSelectLoader()))}renderRegionSelect(){return c(this.selectedCountry?.code??"")&&this.selectedCountry?e("div",{class:"s-bullet-delivery-field"},this.renderLoadingLabel(Salla.lang.get("pages.checkout.region_field"),"bullet-delivery-region",this.loadingRegions),e("select",{id:"bullet-delivery-region",class:"form-input",disabled:this.loadingRegions||0===this.regions.length,onChange:t=>{const s=Number.parseInt(t.target.value),e=this.regions.find((t=>t.id===s));this.selectedRegion=e||null,this.updateNewAddressForm({region_id:e?.id,city_id:void 0,district_id:void 0,city:void 0,district:void 0}),e&&this.selectedCountry&&this.loadCities(this.selectedCountry.id,e.id)}},e("option",{value:"",disabled:!0,selected:!this.selectedRegion},Salla.lang.get("pages.checkout.select_region")),this.regions.map((t=>e("option",{key:t.id,value:t.id,selected:this.selectedRegion?.id===t.id},t.name))))):null}renderCityDistrictSelects(){const t=c(this.selectedCountry?.code??""),s=t,i=s&&this.selectedCity&&!this.loadingDistricts&&0===this.districts.length,l=!this.selectedCountry||t&&!this.selectedRegion||this.loadingCities||0===this.cities.length,a=!this.selectedCountry||t&&!this.selectedRegion||!this.selectedCity||this.loadingDistricts;return e("div",{class:"s-bullet-delivery-field-row"},e("div",{class:"s-bullet-delivery-field"},this.renderLoadingLabel(Salla.lang.get("blocks.buy_as_gift.receiver_city"),"bullet-delivery-city",this.loadingCities),e("select",{id:"bullet-delivery-city",class:"form-input",disabled:l,onChange:t=>{const e=Number.parseInt(t.target.value),i=this.cities.find((t=>t.id===e));this.selectedCity=i||null,this.selectedDistrict=null,this.districtName="",i&&(this.updateNewAddressForm({city:i,district:void 0}),s&&this.loadDistricts(i.id))}},e("option",{value:"",disabled:!0,selected:!this.selectedCity},Salla.lang.get("pages.checkout.select_city")),this.cities.map((t=>e("option",{key:t.id,value:t.id,selected:this.selectedCity?.id===t.id},t.name))))),s&&e("div",{class:"s-bullet-delivery-field"},this.renderLoadingLabel(Salla.lang.get("pages.checkout.district_field"),"bullet-delivery-district",this.loadingDistricts&&!i),i?e("input",{id:"bullet-delivery-district",type:"text",class:"form-input",placeholder:Salla.lang.get("pages.checkout.select_district"),value:this.districtName,disabled:a,onInput:t=>{this.districtName=t.target.value,this.updateNewAddressForm({district:void 0})}}):e("select",{id:"bullet-delivery-district",class:"form-input",disabled:a||0===this.districts.length,onChange:t=>{const s=Number.parseInt(t.target.value),e=this.districts.find((t=>t.id===s));this.selectedDistrict=e||null,this.districtName="",e&&this.updateNewAddressForm({district:e})}},e("option",{value:"",disabled:!0,selected:!this.selectedDistrict},Salla.lang.get("pages.checkout.select_district")),this.districts.map((t=>{const s="ar"===Salla.config.get("user.language_code")?t.name:t.name_en??t.name;return e("option",{key:t.id,value:t.id,selected:this.selectedDistrict?.id===t.id},s)})))))}renderSavedAddressesEmptyState(){return e("div",{class:"s-bullet-delivery-saved-addresses-empty"},e("div",{class:"s-bullet-delivery-saved-addresses-empty-icon","aria-hidden":"true"},e("svg",{width:"28",height:"28",viewBox:"0 0 28 29",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("title",null,"No Saved Adresses"),e("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"}))),e("p",{class:"s-bullet-delivery-saved-addresses-empty-title"},Salla.lang.get("pages.checkout.no_saved_addresses")),e("p",{class:"s-bullet-delivery-saved-addresses-empty-desc"},Salla.lang.get("pages.checkout.add_address_simplify_shipping")),e("salla-button",{onClick:()=>this.handleAddNewAddress(),onKeyUp:()=>this.handleAddNewAddress()},Salla.lang.get("pages.checkout.add_new_address")))}async saveSessionAddressToProfile(){const t=this.getStoredIntent(),s=m(t),e=C(t),i=k(t);if(!t||"address"!==t.type||!s||!e)return null;const l=f(t);if(c(l)&&!i)return null;const a=c(l),n=t.address_details?.district?.name??"",r={country_id:s,region_id:_(t),city_id:e,district_id:i,description:n};a&&(r.local=n);try{const{success:t,address:s}=await u.saveAddressLocation(r);if(!t)return null;const e=s??null;return e&&this.addressCreated.emit({address:e}),e}catch(t){return console.error("SallaBulletDelivery: Error saving session address",t),null}}renderSavedAddresses(){if(!this.isLoggedIn)return null;if(this.loadingSavedAddresses)return e("div",{class:"s-bullet-delivery-addresses-list s-scrollbar"},[1,2,3].map((t=>e("div",{key:t,class:"s-bullet-delivery-address-item s-bullet-delivery-address-item--skeleton"},e("salla-skeleton",{class:"s-bullet-delivery-skel-radio",height:"18px",width:"18px"}),e("salla-skeleton",{class:"s-bullet-delivery-skel-map",height:"36px",width:"36px"}),e("div",{class:"s-bullet-delivery-address-content"},e("div",{class:"s-bullet-delivery-address-lines"},e("salla-skeleton",{height:"18px",width:"72%"}),e("salla-skeleton",{height:"16px",width:"56%"})))))));const t=this.getStoredIntent(),s=M(t),i=s&&t?.address_details&&[t.address_details.city?.name,t.address_details.country?.name].filter(Boolean).join("، ")||"",l=s&&t?.address_details?(t.address_details.district?.name??"").trim():"";return 0!==this.savedAddresses.length||s?e("div",{class:"s-bullet-delivery-addresses-list s-scrollbar"},s&&this.renderAddressRow({key:"session-address",line1:i,line2:l,selected:this.selectedSessionAddress,onClick:()=>this.handleSessionAddressSelect()}),this.savedAddresses.map((t=>{const s=[t.building_number,t.street].filter(Boolean).join("، ")||t.formatted?.address_one||t.short_address||"",e=[t.district?.name,t.city?.name,t.country?.name].filter(Boolean).join("، "),i=(t.formatted?.address_two||e)??"",l=!1!==t.is_in_coverage;return this.renderAddressRow({key:String(t.id),line1:s,line2:i,selected:this.selectedSavedAddress?.id===t.id,disabled:!l,onClick:()=>l&&this.handleSavedAddressSelect(t)})}))):this.renderSavedAddressesEmptyState()}renderAddressRow(t){const{key:s,line1:i,line2:l,selected:a,disabled:n=!1,onClick:r}=t;return e("button",{key:s,class:{"s-bullet-delivery-address-item":!0,"s-bullet-delivery-address-item--selected":a,"s-bullet-delivery-address-item--disabled":n},type:"button",onClick:n?void 0:r,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),n||r())}},e("input",{type:"radio",name:"saved_address",class:"s-bullet-delivery-radio",checked:a,disabled:n,onClick:t=>t.stopPropagation()}),e("span",{class:"s-bullet-delivery-address-map-icon",innerHTML:'<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g filter="url(#filter0_d_24181_220540)">\n <mask id="mask0_24181_220540" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="1" y="0" width="33" height="32">\n <rect x="1.90958" y="0.576577" width="30.8468" height="30.8468" rx="9.22523" fill="#D9D9D9" stroke="white" stroke-width="1.15315"/>\n </mask>\n <g mask="url(#mask0_24181_220540)">\n <rect x="1.90958" y="0.576577" width="30.8468" height="30.8468" rx="9.22523" fill="#E8E8E8" stroke="white" stroke-width="1.15315"/>\n <path d="M17.9096 6.77445L28.7204 5.33301H32.4681L32.7564 11.8195V23.6393L10.4141 23.9276V10.8105L17.9096 6.77445Z" fill="#97E7C8"/>\n <path d="M-2.70303 10.6664H10.2699M41.6934 5.47722C38.378 5.47722 34.7744 5.47722 27.8555 5.47722C20.9366 5.47722 18.4862 6.63037 15.4591 8.64839C12.4321 10.6664 10.2699 10.6664 10.2699 10.6664M10.2699 34.4502V23.6394M10.2699 10.6664V23.6394M-6.16249 23.6394H10.2699M10.2699 23.6394H21.0807M38.8105 23.6394H21.0807M21.0807 23.6394V34.4502" stroke="white" stroke-width="2.30631"/>\n <rect x="2.34202" y="1.00901" width="29.982" height="29.982" rx="8.79279" stroke="white" stroke-width="2.01802"/>\n </g>\n <g clip-path="url(#clip0_24181_220540)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M18.069 19.8621C19.4995 18.6902 22.171 16.0948 22.171 13.0548C22.171 11.7333 21.6461 10.466 20.7117 9.5316C19.7773 8.5972 18.51 8.07227 17.1885 8.07227C15.8671 8.07227 14.5998 8.5972 13.6654 9.5316C12.731 10.466 12.2061 11.7333 12.2061 13.0548C12.2061 16.0948 14.8776 18.6902 16.3081 19.8621C16.5553 20.0679 16.8669 20.1806 17.1885 20.1806C17.5102 20.1806 17.8218 20.0679 18.069 19.8621ZM17.1885 14.1618C17.517 14.1618 17.838 14.0644 18.1111 13.8819C18.3842 13.6995 18.597 13.4401 18.7227 13.1367C18.8484 12.8333 18.8812 12.4994 18.8172 12.1773C18.7531 11.8552 18.595 11.5593 18.3627 11.3271C18.1305 11.0948 17.8346 10.9367 17.5125 10.8726C17.1904 10.8085 16.8565 10.8414 16.5531 10.9671C16.2497 11.0928 15.9903 11.3056 15.8079 11.5787C15.6254 11.8518 15.528 12.1728 15.528 12.5012C15.528 12.9416 15.703 13.364 16.0144 13.6754C16.3258 13.9868 16.7481 14.1618 17.1885 14.1618Z" fill="#55575D"/>\n </g>\n </g>\n <defs>\n <filter id="filter0_d_24181_220540" x="-0.000325561" y="0" width="34.6667" height="34.6667" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n <feFlood flood-opacity="0" result="BackgroundImageFix"/>\n <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n <feOffset dy="1.33333"/>\n <feGaussianBlur stdDeviation="0.666667"/>\n <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0"/>\n <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_24181_220540"/>\n <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_24181_220540" result="shape"/>\n </filter>\n <clipPath id="clip0_24181_220540">\n <rect width="12.1081" height="12.1081" fill="white" transform="translate(11.1338 8.07227)"/>\n </clipPath>\n </defs>\n </svg>\n ',"aria-hidden":"true"}),e("div",{class:"s-bullet-delivery-address-content"},e("div",{class:"s-bullet-delivery-address-lines"},e("span",{class:"s-bullet-delivery-address-line1"},i),e("span",{class:"s-bullet-delivery-address-line2"},l))))}renderGuestDeliveryForm(){const t=c(this.selectedCountry?.code??"");return[this.renderCountrySelect(),t?this.renderRegionSelect():null,this.renderCityDistrictSelects()]}renderDeliveryTab(){return e("div",{class:{"s-bullet-delivery-content":!0,"s-bullet-delivery-content--active":"address"===this.activeTab,"s-hidden":"address"!==this.activeTab}},this.isLoggedIn?this.renderSavedAddresses():this.renderGuestDeliveryForm())}renderBranchSearch(){return e("div",{class:"s-bullet-delivery-branch-search"},e("div",{class:"s-bullet-delivery-search-row"},e("div",{class:"s-bullet-delivery-search s-bullet-delivery-branch-search-wrap"},e("span",{class:"s-bullet-delivery-search-icon s-bullet-delivery-branch-search-icon",innerHTML:l,"aria-hidden":"true"}),e("input",{type:"text",class:"s-bullet-delivery-branch-search-input form-input",placeholder:Salla.lang.get("pages.checkout.search_for_city_or_branch"),value:this.branchSearchQuery,onInput:t=>this.handleBranchSearch(t),autocomplete:"off"})),e("button",{type:"button",class:{"s-bullet-delivery-location-btn":!0,"s-bullet-delivery-location-btn--full":!0,"s-bullet-delivery-location-btn--loading":this.loadingNearestBranch},onClick:()=>this.handleFindNearestBranch(),disabled:this.loadingNearestBranch},this.loadingNearestBranch?e("span",{class:"s-bullet-delivery-location-icon","aria-hidden":"true"},e("salla-skeleton",{height:"18px",width:"18px"})):e("span",{class:"s-bullet-delivery-location-icon",innerHTML:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M13.3258 7.65006C13.3258 10.7797 10.7888 13.3167 7.65916 13.3167C4.52955 13.3167 1.99249 10.7797 1.99249 7.65006C1.99249 4.52045 4.52955 1.9834 7.65916 1.9834C10.7888 1.9834 13.3258 4.52045 13.3258 7.65006Z"\n stroke="#555555" stroke-width="1.3" />\n <path d="M14.65 7.65039H13.3167" stroke="#555555" stroke-width="1.3" stroke-linecap="round"\n stroke-linejoin="round" />\n <path d="M1.98336 7.65039L0.650024 7.65039" stroke="#555555" stroke-width="1.3"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M7.65002 0.650065L7.65002 1.9834" stroke="#555555" stroke-width="1.3"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M7.65002 13.3171L7.65002 14.6504" stroke="#555555" stroke-width="1.3"\n stroke-linecap="round" stroke-linejoin="round" />\n <path\n d="M9.64999 7.65039C9.64999 8.75496 8.75456 9.65039 7.64999 9.65039C6.54542 9.65039 5.64999 8.75496 5.64999 7.65039C5.64999 6.54582 6.54542 5.65039 7.64999 5.65039C8.75456 5.65039 9.64999 6.54582 9.64999 7.65039Z"\n stroke="#555555" stroke-width="1.3" />\n</svg>\n ',"aria-hidden":"true"}),e("span",null,Salla.lang.get("pages.checkout.nearest_to_my_location")))),this.locationError&&"branch"===this.activeTab&&e("span",{class:"s-bullet-delivery-error"},this.locationError))}renderBranchList(){return this.loadingBranches?e("div",{class:"s-bullet-delivery-branches-wrap"},e("div",{class:"s-bullet-delivery-branches-loading"},[1,2,3,4].map((t=>e("div",{key:t,class:"s-bullet-delivery-branch-skeleton"},e("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-radio",type:"circle",height:"16px",width:"16px"}),e("div",{class:"s-bullet-delivery-branch-skeleton-icon"},e("salla-skeleton",{height:"34px",width:"34px"})),e("div",{class:"s-bullet-delivery-branch-skeleton-content"},e("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-title",height:"12px",width:"124px"})),e("salla-skeleton",{class:"s-bullet-delivery-branch-skeleton-time",height:"12px",width:"88px"}),e("div",{class:"s-bullet-delivery-branch-skeleton-map"},e("salla-skeleton",{height:"32px",width:"32px"}))))))):0===this.filteredBranches.length?e("salla-placeholder",{alignment:"center",class:"s-bullet-delivery-placeholder"},e("span",{slot:"title"},Salla.lang.get("pages.checkout.no_pickup_branches_found"))):e("div",{class:"s-bullet-delivery-branches-wrap"},e("ul",{class:"s-bullet-delivery-branches-list s-scrollbar"},this.filteredBranches.map((t=>e("li",{key:t.id,class:{"s-bullet-delivery-branch-item":!0,"s-bullet-delivery-branch-item--selected":this.selectedBranch?.id===t.id,"s-bullet-delivery-branch-item--disabled":!1===t.is_open},tabIndex:!1===t.is_open?-1:0,role:"option","aria-disabled":!1===t.is_open,onClick:()=>!1!==t.is_open&&this.handleBranchSelect(t),onKeyDown:s=>{"Enter"!==s.key&&" "!==s.key||(s.preventDefault(),!1!==t.is_open&&this.handleBranchSelect(t))}},e("input",{type:"radio",name:"branch",class:"s-bullet-delivery-radio",checked:this.selectedBranch?.id===t.id,disabled:!1===t.is_open}),e("span",{class:"s-bullet-delivery-branch-icon","aria-hidden":"true"},e("span",{innerHTML:L})),e("div",{class:"s-bullet-delivery-branch-info"},e("span",{class:"s-bullet-delivery-branch-name"},t.name),t.preparation_time?e("span",{class:"s-bullet-delivery-branch-prep"},`${Salla.lang.get("pages.checkout.processing_time")}: ${t.preparation_time}`):null),(()=>{const s=(i=t.working_hours,i?.[0]?.times?.[0]??null);var i;return s?e("span",{class:"s-bullet-delivery-branch-time"},function(t,s,e,i){const l=String(t).trim(),a=String(s).trim();return l&&a?"00:00"===l?`${i} ${p(a,e)}`:`${p(l,e)} - ${p(a,e)}`:""}(s.from,s.to,Salla.config.get("user.language_code")||"ar",Salla.lang.get("pages.checkout.until"))):null})(),null!=t.location?.lat&&null!=t.location?.lng&&e("a",{href:`https://www.google.com/maps?q=${t.location.lat},${t.location.lng}`,target:"_blank",rel:"noopener noreferrer",class:"s-bullet-delivery-branch-map-link",title:Salla.lang.get("common.elements.open_in_google_maps"),onClick:t=>t.stopPropagation()},e("span",{class:"s-bullet-delivery-branch-map-link-icon",innerHTML:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M7.94798 3.19336C11.1309 2.1083 12.7223 1.56578 13.5783 2.42174C14.4342 3.27771 13.8917 4.86914 12.8066 8.05201L12.0678 10.2195C11.2344 12.6639 10.8178 13.8861 10.131 13.9872C9.94631 14.0144 9.75517 13.9981 9.57248 13.9394C8.89297 13.7212 8.53377 12.4326 7.81538 9.8553C7.65604 9.28364 7.57637 8.99781 7.39494 8.7795C7.34228 8.71614 7.28386 8.65772 7.2205 8.60506C7.00219 8.42363 6.71636 8.34396 6.1447 8.18462C3.56741 7.46623 2.27876 7.10703 2.0606 6.42752C2.00195 6.24483 1.98558 6.05369 2.01277 5.86903C2.11392 5.18221 3.33613 4.76556 5.78054 3.93225L7.94798 3.19336Z"\n stroke="#555555" stroke-width="1.2" />\n</svg>\n '.replace(/mask0_25437_34440/g,`mask0_branch_${t.id}`),"aria-hidden":"true"}),e("span",{class:"sr-only"},Salla.lang.get("common.elements.open_in_google_maps"))))))))}renderPickupTab(){return e("div",{class:{"s-bullet-delivery-content":!0,"s-bullet-delivery-content--active":"branch"===this.activeTab,"s-hidden":"branch"!==this.activeTab}},this.renderCountrySelect(),this.renderBranchSearch(),this.renderBranchList())}renderAddAddressForm(){const t=Salla.lang.get("pages.checkout.add_new_address"),s=c(this.selectedCountry?.code??""),i=this.selectedCountry&&this.selectedCity&&(!s||this.selectedRegion)&&(!s||!!this.selectedDistrict||!!(this.districtName&&this.districtName.trim().length>0)),l=this.savingAddress?Salla.lang.get("pages.checkout.loading"):Salla.lang.get("pages.checkout.confirm_address");return e("div",{class:"s-bullet-delivery-add-address"},e("div",{class:"s-bullet-delivery-add-address-header"},e("button",{type:"button",class:"s-bullet-delivery-add-address-title",onClick:()=>this.handleBackToAddressList(),onKeyDown:t=>"Enter"===t.key&&this.handleBackToAddressList()},e("span",{innerHTML:this.isRTL?n:r,"aria-hidden":"true"}),e("span",{class:"s-bullet-delivery-add-address-title-text"},t))),e("form",{class:"s-bullet-delivery-add-address-form",onSubmit:t=>this.handleSubmitAddAddress(t)},this.renderGuestDeliveryForm(),e("div",{class:"s-bullet-delivery-form-actions s-bullet-delivery-form-actions--single"},e("salla-button",{type:"submit",loading:this.savingAddress,disabled:!i||this.savingAddress,class:"s-bullet-delivery-add-address-submit"},l))))}renderFooter(){const t="address"===this.activeTab&&this.isLoggedIn;return e("div",{class:"s-bullet-delivery-footer"},e("salla-button",{ref:t=>{this.confirmBtn=t},disabled:this.isConfirmDisabled(),onClick:()=>this.handleConfirm(),"loader-position":"center",width:"wide"},"branch"===this.activeTab?Salla.lang.get("pages.checkout.confirm_receipt_from_the_branch"):Salla.lang.get("pages.checkout.confirm_address")),t&&e("salla-button",{onClick:()=>this.handleAddNewAddress(),width:"wide",shape:"link"},Salla.lang.get("pages.checkout.add_new_address")),!this.isLoggedIn&&e("salla-button",{shape:"link",onClick:this.handleLogin},Salla.lang.get("pages.checkout.login_to_use_saved_addresses")))}renderMainView(){const t=this.isLoggedIn&&"address"===this.activeTab&&0===this.savedAddresses.length&&!M(this.getStoredIntent()),s="branch"===this.activeTab&&this.supportsPickup?this.renderPickupTab():this.renderDeliveryTab();return e("div",null,e("div",{class:"s-bullet-delivery-header"},e("h2",{class:"s-bullet-delivery-title"},"address"===this.activeTab?Salla.lang.get("blocks.home.add_address_for_order_delivery"):Salla.lang.get("blocks.home.how_prefer_to_receive_order")),e("p",{class:"s-bullet-delivery-subtitle"},"address"===this.activeTab?Salla.lang.get("blocks.home.products_available_for_delivery_shown_while_shopping"):Salla.lang.get("blocks.home.products_available_for_delivery_or_pickup_shown_while_shopping"))),this.renderTabs(),this.showCartWillBeClearedBanner&&this.renderAlert(Salla.lang.get("blocks.scope.empty_cart_warning")),this.allocationOutOfCoverageMessage&&this.renderAllocationOutOfCoverageAlert(),s,!t&&this.renderFooter())}handleAfterAddToCart(){if("after_add_to_cart"!==this.openingType)return;const t=this.shouldPromptIncompleteIntentThisSession();this.hasBeenShownThisSession()&&!t||this.modal?.hasAttribute?.("visible")||(t&&this.markIncompleteIntentPrompted(),this.open())}overrideScopeSwitchUI(){const t=this.getStoredIntent(),s=document.querySelector('[onclick*="scopes"]');if(!s)return;if(!t||"address"!==t.type&&"branch"!==t.type)return s.style.display="none",void(s.onclick=()=>this.open());const e=(t,s)=>t&&t.length>s?`${t.slice(0,s)}...`:t??"",i="branch"===t.type?`${Salla.lang.get("mobile_app.strings.pickup")} ${Salla.lang.get("common.elements.from")} ${e(t.branch_details?.name,20)}`:`${Salla.lang.get("mobile_app.strings.delivery")} ${Salla.lang.get("common.elements.to")} ${e(t.address_details?.city?.name,10)}`;s.style.display="inline-flex",s.onclick=()=>this.open();const l=s.querySelector('span:not([class*="sicon"]):not([class*="icon"])');if(l)l.textContent=i;else{const t=Array.from(s.childNodes).find((t=>t.nodeType===Node.TEXT_NODE&&t.textContent?.trim()));t&&(t.textContent=` ${i}`)}}async componentWillLoad(){await Salla.onReady();try{this.overrideScopeSwitchUI(),this.cartSubmittingHandler=async()=>{this.pendingCartSubmitPromise?await this.pendingCartSubmitPromise:this.hasCompleteIntentForLoggedInUser()||(this.cartSubmitConfirmationPending=!0,this.pendingCartSubmitPromise=new Promise((t=>{if(this.pendingCartSubmitResolver=t,this.isGuestUser())return Salla.auth.setCanRedirect(!1),void Salla.event.dispatch("login::open",{withoutReload:!0,source:"cart-submit"});this.open()})),await this.pendingCartSubmitPromise)},Salla.cart.event.onSubmitting(this.cartSubmittingHandler)}catch(t){console.warn("SallaBulletDelivery: overrideScopeSwitchUI failed",t)}Salla.event.on("bullet-delivery::open",this.bulletDeliveryOpenHandler),this.closeHandler=this.close.bind(this),Salla.event.on("bullet-delivery::close",this.closeHandler),this.isRTL=Salla.config.get("theme.is_rtl"),this.authLoggedInHandler=()=>{if(this.cartSubmitConfirmationPending)return Salla.event.dispatch("login::close"),this.hasCompleteIntentForLoggedInUser()?void this.resolvePendingCartSubmit():void(this.modal?.hasAttribute?.("visible")||this.open());this.hasIncompleteUserAddressIntent()&&(this.modal?.hasAttribute?.("visible")||this.open())},Salla.event.on("auth::logged.in",this.authLoggedInHandler),this.authLoggedOutHandler=()=>{this.clearBulletDeliveryStoredData()},Salla.event.on("auth::logged.out",this.authLoggedOutHandler),this.loginClosedHandler=()=>{this.cartSubmitConfirmationPending&&this.isGuestUser()&&(this.hasCompleteIntentForLoggedInUser()||this.resolvePendingCartSubmit())},Salla.event.on("salla-login::closed",this.loginClosedHandler),this.cartItemAddedHandler=()=>this.handleAfterAddToCart(),"function"==typeof Salla.cart?.event?.onItemAdded?(this.useCartEventApi=!0,Salla.cart.event.onItemAdded(this.cartItemAddedHandler)):Salla.event.on(this.cartItemAddedEvent,this.cartItemAddedHandler)}render(){return e(i,{key:"83c8404002c477d2eedc8103fde0a8645e81d9a8",class:"s-bullet-delivery"},e("salla-modal",{key:"5ba5b3fb56422415654e5d48f9656a86abe02c10",ref:t=>{this.modal=t},isClosable:!this.isRequired&&!this.shouldForceNonClosable(),class:"s-bullet-delivery-modal",isLoading:this.loading,width:"sm"},this.loading?this.renderSkeleton():e("div",{class:"s-bullet-delivery-inner"},"main"===this.viewMode&&this.renderMainView(),"add-address"===this.viewMode&&this.renderAddAddressForm())))}componentDidLoad(){if(this.componentReady=!0,this.pendingOpen)return this.pendingOpen=!1,void this.open();switch(this.openingType){case"first_visit":this.hasBeenShownThisSession()?this.shouldPromptIncompleteIntentThisSession()&&(this.markIncompleteIntentPrompted(),this.open()):this.open();break;case"on_cart_click":Salla.url.is_page("cart")&&(!0===this.getShownStorage().get(this.sessionShownKey)?this.shouldPromptIncompleteIntentThisSession()&&(this.markIncompleteIntentPrompted(),this.open()):this.open())}const t=this.createCartViewElement();t&&"function"==typeof salla?.hooks?.mount&&Salla.hooks.mount("cart:items.start",t).catch((()=>{}))}disconnectedCallback(){this.componentReady=!1,Salla.event.off("bullet-delivery::open",this.bulletDeliveryOpenHandler),this.closeHandler&&(Salla.event.off("bullet-delivery::close",this.closeHandler),this.closeHandler=null),this.cartItemAddedHandler&&(this.useCartEventApi&&"function"==typeof Salla.cart?.event?.offItemAdded?Salla.cart.event.offItemAdded(this.cartItemAddedHandler):Salla.event.off(this.cartItemAddedEvent,this.cartItemAddedHandler),this.cartItemAddedHandler=null),this.cartSubmittingHandler&&("function"==typeof Salla.cart?.event?.offSubmitting?Salla.cart.event.offSubmitting(this.cartSubmittingHandler):Salla.event.off("cart::submitting",this.cartSubmittingHandler),this.cartSubmittingHandler=null),this.authLoggedInHandler&&(Salla.event.off("auth::logged.in",this.authLoggedInHandler),this.authLoggedInHandler=null),this.authLoggedOutHandler&&(Salla.event.off("auth::logged.out",this.authLoggedOutHandler),this.authLoggedOutHandler=null),this.loginClosedHandler&&(Salla.event.off("salla-login::closed",this.loginClosedHandler),this.loginClosedHandler=null)}};N.INITIAL_ADDRESS_FORM={country_id:0,is_default:!1,city_id:void 0,district_id:void 0,street:void 0,building_number:void 0,additional_number:void 0,postal_code:void 0,description:void 0},N.style="@supports (interpolate-size: allow-keywords) and (block-size: calc-size(auto, size)) {\n .s-bullet-delivery .s-bullet-delivery-modal .s-modal-body, .s-bullet-delivery-inner {\n @apply [interpolate-size:allow-keywords];\n }\n .s-bullet-delivery .s-bullet-delivery-modal .s-modal-body {\n @apply [overflow:clip] [transition:block-size_500ms_ease];\n }\n .s-bullet-delivery-inner {\n @apply [overflow:clip] [transition:block-size_500ms_ease];\n block-size: calc-size(auto, size);\n }\n}\n\n@keyframes s-bullet-delivery-fade-in {\n from {\n opacity: 0;\n transform: translateY(6px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}";export{N as salla_bullet_delivery}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as e,c as t,h as s,H as i,a as l}from"./p-BJrHu3Q4.js";import{L as a}from"./p-BO5AoBAP.js";var o={light:[{featureType:"water",elementType:"geometry",stylers:[{color:"#e9e9e9"},{lightness:17}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#f5f5f5"},{lightness:20}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#ffffff"},{lightness:17}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#ffffff"},{lightness:29},{weight:.2}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#ffffff"},{lightness:18}]},{featureType:"road.local",elementType:"geometry",stylers:[{color:"#ffffff"},{lightness:16}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#f5f5f5"},{lightness:21}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#dedede"},{lightness:21}]},{elementType:"labels.text.stroke",stylers:[{visibility:"on"},{color:"#ffffff"},{lightness:16}]},{elementType:"labels.text.fill",stylers:[{saturation:36},{color:"#333333"},{lightness:40}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#f2f2f2"},{lightness:19}]},{featureType:"administrative",elementType:"geometry.fill",stylers:[{color:"#fefefe"},{lightness:20}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#fefefe"},{lightness:17},{weight:1.2}]}],dark:[{elementType:"geometry",stylers:[{color:"#242f3e"}]},{elementType:"labels.text.fill",stylers:[{color:"#746855"}]},{elementType:"labels.text.stroke",stylers:[{color:"#242f3e"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#263c3f"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#6b9a76"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#38414e"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#212a37"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#9ca5b3"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#746855"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#1f2835"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#f3d19c"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#2f3948"}]},{featureType:"transit.station",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#17263c"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#515c6d"}]},{featureType:"water",elementType:"labels.text.stroke",stylers:[{color:"#17263c"}]}]};class r{constructor(e=null,t={}){if(this.apiKey=e,this.options=t,"undefined"==typeof window)throw new Error("google-maps is supported only in browser environment")}load(){return void 0!==this.api?Promise.resolve(this.api):void 0!==this.loader?this.loader:(window[r.CALLBACK_NAME]=()=>{if(this.api=window.google,void 0===this.resolve)throw new Error("Should not happen");this.resolve(this.api)},window.gm_authFailure=()=>{if(void 0===this.reject)throw new Error("Should not happen");this.reject(new Error("google-maps: authentication error"))},this.loader=new Promise(((e,t)=>{this.resolve=e,this.reject=t;const s=document.createElement("script");s.src=this.createUrl(),s.async=!0,s.onerror=e=>t(e),document.head.appendChild(s)})))}createUrl(){const e=[`callback=${r.CALLBACK_NAME}`];this.apiKey&&e.push(`key=${this.apiKey}`);for(let t in this.options)if(this.options.hasOwnProperty(t)){let s=this.options[t];"version"===t&&(t="v"),"libraries"===t&&(s=s.join(",")),e.push(`${t}=${s}`)}return`https://maps.googleapis.com/maps/api/js?${e.join("&")}`}}r.CALLBACK_NAME="_dk_google_maps_loader_cb";const h=class{constructor(s){e(this,s),this.selected=t(this,"selected"),this.mapClicked=t(this,"mapClicked"),this.currentLocationChanged=t(this,"currentLocationChanged"),this.invalidInput=t(this,"invalidInput"),this.defaultLat=21.419421,this.defaultLng=39.82553,this.modalActivityTitle=salla.lang.get("pages.checkout.select_your_address_from_map"),this.confirmButtonTitle=salla.lang.get("pages.checkout.confirm_address"),this.locateButtonTitle=salla.lang.get("pages.cart.detect_location"),this.locateButtonEdit=salla.lang.get("common.elements.edit"),this.searchPlaceholder=salla.lang.get("pages.checkout.search_for_address"),this.searchInputValue=null,this.formattedAddress="",this.geolocationError=!1,this.name="location",this.required=!1,this.readonly=!1,this.searchable=!1,this.zoom=10,this.theme="light",salla.lang.onLoaded((()=>{this.modalActivityTitle=salla.lang.get("pages.checkout.select_your_address_from_map"),this.confirmButtonTitle=salla.lang.get("pages.checkout.confirm_address"),this.locateButtonTitle=salla.lang.get("pages.cart.detect_location"),this.locateButtonEdit=salla.lang.get("common.elements.edit"),this.searchPlaceholder=salla.lang.get("pages.checkout.search_for_address")})),salla.onReady((()=>{this.apiKey=salla.config.get("store.settings.keys.maps","AIzaSyBFgFISAizDP3YVWj0y5rF8JKKNQ2vohdc")}))}formatAddress(e){return e.length>25?e.substring(0,25)+"...":e}getLatLng(){return this.selectedLat&&this.selectedLng?`${this.selectedLat}, ${this.selectedLng}`:null}getPositionAddress(e,t=!1){(new google.maps.Geocoder).geocode({location:e},((e,s)=>{s===google.maps.GeocoderStatus.OK&&(this.searchable&&(this.searchInputValue=e[0].formatted_address,this.searchInput.value=e[0].formatted_address),t&&(this.formattedAddress=e[0].formatted_address))}))}initGoogleMaps(e,t){new r(this.apiKey,e).load().then((e=>{if(this.map=new e.maps.Map(t,{center:this.lat||this.lng?{lat:this.lat,lng:this.lng}:{lat:this.defaultLat,lng:this.defaultLng},zoom:this.zoom,zoomControl:!0,mapTypeControl:!1,scaleControl:!1,streetViewControl:!1,rotateControl:!1,fullscreenControl:!1,disableDefaultUI:!1}),this.map.setOptions({styles:"light"===this.theme?o.light:o.dark}),this.marker=new e.maps.Marker({position:this.map.getCenter(),map:this.map,icon:{url:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">\n<rect width="36" height="36" rx="18" fill="#5CD5C4"/>\n<path d="M18 10C17.0104 10 16.1458 10.1771 15.4062 10.5312C14.6562 10.8854 14.026 11.3542 13.5156 11.9375C13.0156 12.5104 12.6406 13.1667 12.3906 13.9062C12.1302 14.6458 12 15.401 12 16.1719C12 16.8906 12.2604 17.7656 12.7812 18.7969C13.3021 19.8281 13.8854 20.8333 14.5312 21.8125C15.1875 22.7812 15.8073 23.6406 16.3906 24.3906C16.9844 25.1302 17.349 25.5885 17.4844 25.7656C17.5469 25.8385 17.625 25.8958 17.7188 25.9375C17.8125 25.9792 17.9062 26 18 26C18.1042 26 18.1979 25.9792 18.2812 25.9375C18.375 25.8958 18.4531 25.8385 18.5156 25.7656C18.651 25.5885 19.0156 25.1302 19.6094 24.3906C20.1927 23.6406 20.8073 22.7812 21.4531 21.8125C22.1094 20.8333 22.6979 19.8281 23.2188 18.7969C23.7396 17.7656 24 16.8906 24 16.1719C24 15.401 23.8698 14.6458 23.6094 13.9062C23.3594 13.1667 22.9792 12.5104 22.4688 11.9375C21.9688 11.3542 21.3438 10.8854 20.5938 10.5312C19.8542 10.1771 18.9896 10 18 10ZM18 24.2812C17.5833 23.75 17.1094 23.1198 16.5781 22.3906C16.0365 21.651 15.526 20.901 15.0469 20.1406C14.5677 19.3698 14.1615 18.6302 13.8281 17.9219C13.4948 17.2135 13.3281 16.6302 13.3281 16.1719C13.3281 15.5885 13.4219 15.0052 13.6094 14.4219C13.7969 13.849 14.0781 13.3333 14.4531 12.875C14.8385 12.4167 15.3281 12.0469 15.9219 11.7656C16.5052 11.474 17.1979 11.3281 18 11.3281C18.8021 11.3281 19.4948 11.474 20.0781 11.7656C20.6719 12.0469 21.1562 12.4167 21.5312 12.875C21.9167 13.3333 22.2031 13.849 22.3906 14.4219C22.5781 15.0052 22.6719 15.5885 22.6719 16.1719C22.6719 16.6302 22.5052 17.2135 22.1719 17.9219C21.8385 18.6302 21.4323 19.3698 20.9531 20.1406C20.474 20.901 19.9688 21.651 19.4375 22.3906C18.8958 23.1198 18.4167 23.75 18 24.2812ZM18 13.3281C17.2604 13.3281 16.6302 13.5885 16.1094 14.1094C15.5885 14.6302 15.3281 15.2604 15.3281 16C15.3281 16.7396 15.5885 17.3698 16.1094 17.8906C16.6302 18.4115 17.2604 18.6719 18 18.6719C18.7396 18.6719 19.3698 18.4115 19.8906 17.8906C20.4115 17.3698 20.6719 16.7396 20.6719 16C20.6719 15.2604 20.4115 14.6302 19.8906 14.1094C19.3698 13.5885 18.7396 13.3281 18 13.3281ZM18 17.3281C17.6354 17.3281 17.3229 17.1979 17.0625 16.9375C16.8021 16.6771 16.6719 16.3646 16.6719 16C16.6719 15.6354 16.8021 15.3229 17.0625 15.0625C17.3229 14.8021 17.6354 14.6719 18 14.6719C18.3646 14.6719 18.6771 14.8021 18.9375 15.0625C19.1979 15.3229 19.3281 15.6354 19.3281 16C19.3281 16.3646 19.1979 16.6771 18.9375 16.9375C18.6771 17.1979 18.3646 17.3281 18 17.3281Z" fill="white"/>\n</svg>\n'),scaledSize:new e.maps.Size(30,30)}}),this.searchable){const t=new e.maps.places.SearchBox(this.searchInput);e.maps.event.addListener(t,"places_changed",(()=>{const e=t.getPlaces();e.length>0&&this.map&&(this.map.setCenter(e[0].geometry.location),this.lat=e[0].geometry.location.lat(),this.lng=e[0].geometry.location.lng(),this.marker.setPosition(e[0].geometry.location),this.searchInputValue=e[0].formatted_address,this.formattedAddress=e[0].formatted_address)}))}e.maps.event.addListener(this.map,"click",(e=>{this.readonly||(this.marker.setPosition(e.latLng),this.lat=e.latLng.lat(),this.lng=e.latLng.lng(),this.getPositionAddress(e.latLng),this.mapClicked.emit({lat:e.latLng.lat(),lng:e.latLng.lng(),address:this.formattedAddress?this.formattedAddress:null}))})),this.lat||this.lng||(this.getCurrentLocation(),this.geolocationError&&(this.map.setCenter({lat:this.lat,lng:this.lng}),this.marker.setPosition({lat:this.lat,lng:this.lng})))}))}getCurrentLocation(){navigator.geolocation&&this.map?navigator.geolocation.getCurrentPosition((e=>{const t={center:new google.maps.LatLng(e.coords.latitude,e.coords.longitude),zoom:15};this.map.setOptions(t),this.marker.setPosition(t.center),this.getPositionAddress(t.center),this.lat=e.coords.latitude,this.lng=e.coords.longitude,this.currentLocationChanged.emit({lat:e.coords.latitude,lng:e.coords.longitude,address:this.formattedAddress?this.formattedAddress:null})}),this.handleLocationError.bind(this)):(salla.log("Geolocation is not supported by this browser."),this.geolocationError=!0)}handleLocationError(e){switch(this.geolocationError=!0,e.code){case e.PERMISSION_DENIED:salla.log("User denied the request for Geolocation.");break;case e.POSITION_UNAVAILABLE:salla.log("Location information is unavailable.");break;case e.TIMEOUT:salla.log("The request to get user location timed out.");break;case e.UNKNOWN_ERROR:salla.log("An unknown error occurred.")}}componentDidLoad(){this.lat&&this.lng&&fetch(`https://maps.googleapis.com/maps/api/geocode/json?latlng=${this.lat},${this.lng}&key=${this.apiKey}&language=${salla.config.get("user.language_code")||document.documentElement.lang||"ar"}`).then((e=>e.json())).then((e=>{"OK"===e.status&&(this.formattedAddress=e.results[0].formatted_address,this.searchInputValue=e.results[0].formatted_address,this.searchInput.value=e.results[0].formatted_address,this.selectedLng=this.lng,this.selectedLat=this.lat)})),this.mapInput.addEventListener("invalid",(e=>{this.invalidInput.emit(e)})),this.mapInput.addEventListener("input",(()=>{this.mapInput.setCustomValidity(""),this.mapInput.reportValidity()}))}async open(){return this.map||this.initGoogleMaps({libraries:this.searchable?["places","search"]:[],language:salla.config.get("user.language_code")||document.documentElement.lang||"ar"},this.mapElement),await this.locationModal.open()}getLocationModal(){return s("div",null,s("div",{class:"s-map-modal-title"},this.modalTitle?this.modalTitle:this.modalActivityTitle),s("div",{class:"s-map-modal-body"},s("div",{class:"s-map-element",ref:e=>this.mapElement=e}),this.readonly?"":[this.searchable&&s("div",{class:"s-map-search-wrapper"},s("input",{class:"s-map-search-input",ref:e=>this.searchInput=e,placeholder:this.searchPlaceholder})),s("salla-button",{class:"s-map-my-location-button",onClick:()=>{this.getCurrentLocation()},shape:"icon",color:"primary"},s("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>location-target</title>\n<path d="M16 9.333c-3.676 0-6.667 2.991-6.667 6.667s2.991 6.667 6.667 6.667 6.667-2.991 6.667-6.667-2.991-6.667-6.667-6.667zM16 20c-2.205 0-4-1.795-4-4s1.795-4 4-4 4 1.795 4 4-1.795 4-4 4zM30.667 14.667h-1.401c-0.627-6.289-5.643-11.305-11.932-11.932v-1.401c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.401c-6.289 0.627-11.305 5.643-11.932 11.932h-1.401c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h1.401c0.628 6.289 5.643 11.305 11.932 11.932v1.401c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-1.401c6.289-0.628 11.305-5.643 11.932-11.932h1.401c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333zM16 26.667c-5.881 0-10.667-4.785-10.667-10.667s4.785-10.667 10.667-10.667 10.667 4.785 10.667 10.667-4.785 10.667-10.667 10.667z"></path>\n</svg>\n'})),s("salla-button",{class:"s-map-submit-button",color:"primary",width:"wide",onClick:()=>{let e={lat:this.lat,lng:this.lng,address:this.formattedAddress?this.formattedAddress:null};salla.event.emit("salla-map::selected",e),this.selected.emit(e),this.selectedLat=e.lat,this.selectedLng=e.lng,this.getPositionAddress(new google.maps.LatLng(e.lat,e.lng),!0),this.mapInput.value=this.selectedLat&&this.selectedLng?`${this.selectedLat}, ${this.selectedLng}`:null,this.mapInput.dispatchEvent(new window.Event("change",{bubbles:!0})),this.locationModal.close()}},this.confirmButtonTitle)]))}render(){return s(i,{key:"302015399be6ef260a6617b31a6065e5facf940f",class:"s-map-wrapper"},s("salla-modal",{key:"9f6cdedaeaa81ae33e14f09bf6cae48c4d3b152b",class:"s-map-modal-wrapper",noPadding:!0,ref:e=>{this.locationModal=e}},this.getLocationModal()),s("slot",{key:"7085cb61e2e404a22381825feaabfcc36e6f20fb",name:"button"},s("salla-button",{key:"3ebf2ec427c6d5edf501262afd096f5a82e69a13",onClick:()=>{this.open()},color:"primary",class:"s-map-location-button"},s("span",{key:"aa4dfd6a1282d651a0e78631c8165c2cbdd536d2",class:"s-map-location-icon",innerHTML:this.formattedAddress?'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>edit</title>\n<path d="M30.583 1.417c-1.828-1.829-5.019-1.829-6.847 0l-13.396 13.396c-0.161 0.161-0.279 0.361-0.341 0.581l-1.949 6.911c-0.131 0.464 0 0.964 0.341 1.305 0.253 0.252 0.593 0.389 0.943 0.389 0.121 0 0.243-0.016 0.361-0.051l6.911-1.949c0.22-0.061 0.419-0.179 0.581-0.34l10.455-10.453s0 0 0 0l2.941-2.941c1.887-1.888 1.887-4.96 0-6.848zM15.547 19.528l-4.284 1.208 1.208-4.284 9.265-9.265 3.076 3.076zM28.696 6.38l-1.999 1.999-3.076-3.076 1.999-1.999c0.849-0.848 2.227-0.848 3.076 0 0.848 0.848 0.848 2.227 0 3.076zM24 20c-0.737 0-1.333 0.597-1.333 1.333v4c0 2.205-1.795 4-4 4h-12c-2.205 0-4-1.795-4-4v-12c0-2.205 1.795-4 4-4h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-4c-3.676 0-6.667 2.991-6.667 6.667v12c0 3.676 2.991 6.667 6.667 6.667h12c3.676 0 6.667-2.991 6.667-6.667v-4c0-0.736-0.596-1.333-1.333-1.333z"></path>\n</svg>\n':a}),this.formattedAddress?s("div",null,this.locateButtonEdit," | ",this.formatAddress(this.formattedAddress)):this.locateButtonTitle)),s("input",{key:"eadd1bbe75d9ba2898bb770e7e6aa9a02e21dece",class:"s-hidden",name:this.name,required:this.required,value:this.getLatLng(),ref:e=>this.mapInput=e}))}get host(){return l(this)}};h.style="";export{h as salla_map}