@salla.sa/twilight-components 2.14.440 → 2.14.442

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 (310) hide show
  1. package/dist/cjs/{filepond-DOOLwTpX.js → filepond-ChNXH_CM.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-D7nMzJ2p.js → filepond-plugin-file-poster-CmFwQi0o.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-DpCJ71im.js → filepond-plugin-file-validate-size-C5y99Z3t.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-CDZ5OaBc.js → filepond-plugin-file-validate-type-CqRGD1AJ.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-BzGZimte.js → filepond-plugin-image-edit-s3z0z0Mh.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-D1fPPBi_.js → filepond-plugin-image-exif-orientation-D13PJ6Ei.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-CEhIwZKp.js → filepond-plugin-image-preview-DQiPJFdf.js} +1 -1
  8. package/dist/cjs/{functions-CdVaIsQM.js → functions-9qsVe_zH.js} +1 -1
  9. package/dist/cjs/{index-oqqfD8M2.js → index-CjhZ1IEy.js} +6 -6
  10. package/dist/cjs/{index-E66k07Rj.js → index-DEgF9StN.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +2 -2
  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 +1 -1
  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_2.cjs.entry.js +1 -1
  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-cashback-banner.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-delivery-promise.cjs.entry.js +41 -35
  32. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  44. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  45. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  46. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  49. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  50. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-map.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  83. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  98. package/dist/cjs/{tracked-promise-DV0VuqZL.js → tracked-promise-CT8ZsEnF.js} +1 -1
  99. package/dist/cjs/twilight.cjs.js +2 -2
  100. package/dist/cjs/{vanilla-picker-DvOQTQXG.js → vanilla-picker-IsJbIaW6.js} +1 -1
  101. package/dist/collection/components/salla-delivery-promise/delivery-promise-api.js +4 -3
  102. package/dist/collection/components/salla-delivery-promise/salla-delivery-promise.js +38 -25
  103. package/dist/components/index.js +2 -2
  104. package/dist/components/salla-delivery-promise.js +54 -42
  105. package/dist/esm/{filepond-Crf00c7G.js → filepond--H5Je975.js} +1 -1
  106. package/dist/esm/{filepond-plugin-file-poster-B3uKBJe-.js → filepond-plugin-file-poster-C7qRk6qw.js} +1 -1
  107. package/dist/esm/{filepond-plugin-file-validate-size-CWVDRdsV.js → filepond-plugin-file-validate-size-DFV1VUlm.js} +1 -1
  108. package/dist/esm/{filepond-plugin-file-validate-type-VQGNZwF9.js → filepond-plugin-file-validate-type-7MrehGt0.js} +1 -1
  109. package/dist/esm/{filepond-plugin-image-edit-DOhXVk8j.js → filepond-plugin-image-edit-BACaZzDG.js} +1 -1
  110. package/dist/esm/{filepond-plugin-image-exif-orientation-Co8jzTVW.js → filepond-plugin-image-exif-orientation-Ckgi2RjT.js} +1 -1
  111. package/dist/esm/{filepond-plugin-image-preview-gQWAQlCp.js → filepond-plugin-image-preview-CXxZ1JZ2.js} +1 -1
  112. package/dist/esm/{functions-D8zpoRMj.js → functions-le7E3Z-D.js} +1 -1
  113. package/dist/esm/{index-DX6k_dv6.js → index-C-JheRmw.js} +1 -1
  114. package/dist/esm/{index-XEcnGv2r.js → index-CU41HKIU.js} +6 -6
  115. package/dist/esm/loader.js +3 -3
  116. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  117. package/dist/esm/salla-accordion_6.entry.js +1 -1
  118. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  119. package/dist/esm/salla-advertisement.entry.js +1 -1
  120. package/dist/esm/salla-alert_2.entry.js +1 -1
  121. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  122. package/dist/esm/salla-apps-icons.entry.js +1 -1
  123. package/dist/esm/salla-badge.entry.js +1 -1
  124. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  125. package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
  126. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  127. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  128. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  129. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  130. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  131. package/dist/esm/salla-contacts.entry.js +1 -1
  132. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  133. package/dist/esm/salla-count-down.entry.js +1 -1
  134. package/dist/esm/salla-custom-fields.entry.js +1 -1
  135. package/dist/esm/salla-delivery-promise.entry.js +41 -35
  136. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  137. package/dist/esm/salla-filters-widget.entry.js +1 -1
  138. package/dist/esm/salla-filters.entry.js +1 -1
  139. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  140. package/dist/esm/salla-gifting.entry.js +1 -1
  141. package/dist/esm/salla-hook.entry.js +1 -1
  142. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  143. package/dist/esm/salla-installment.entry.js +1 -1
  144. package/dist/esm/salla-list-tile.entry.js +1 -1
  145. package/dist/esm/salla-localization-modal.entry.js +1 -1
  146. package/dist/esm/salla-login-modal.entry.js +1 -1
  147. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  148. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  149. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  150. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  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 +1 -1
  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-next-order-coupon.entry.js +1 -1
  163. package/dist/esm/salla-notification-item.entry.js +1 -1
  164. package/dist/esm/salla-notifications.entry.js +1 -1
  165. package/dist/esm/salla-offer-modal.entry.js +1 -1
  166. package/dist/esm/salla-offer.entry.js +1 -1
  167. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  168. package/dist/esm/salla-order-details-options.entry.js +1 -1
  169. package/dist/esm/salla-order-details.entry.js +1 -1
  170. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  171. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  172. package/dist/esm/salla-order-edit.entry.js +1 -1
  173. package/dist/esm/salla-order-summary.entry.js +1 -1
  174. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  175. package/dist/esm/salla-orders.entry.js +1 -1
  176. package/dist/esm/salla-payments.entry.js +1 -1
  177. package/dist/esm/salla-placeholder.entry.js +1 -1
  178. package/dist/esm/salla-price-range.entry.js +1 -1
  179. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  180. package/dist/esm/salla-product-card_2.entry.js +1 -1
  181. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  182. package/dist/esm/salla-products-list.entry.js +1 -1
  183. package/dist/esm/salla-progress-bar.entry.js +1 -1
  184. package/dist/esm/salla-quick-order.entry.js +1 -1
  185. package/dist/esm/salla-rating-modal.entry.js +1 -1
  186. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  187. package/dist/esm/salla-scopes.entry.js +1 -1
  188. package/dist/esm/salla-search.entry.js +1 -1
  189. package/dist/esm/salla-skeleton.entry.js +1 -1
  190. package/dist/esm/salla-slider.entry.js +1 -1
  191. package/dist/esm/salla-social-share.entry.js +1 -1
  192. package/dist/esm/salla-social.entry.js +1 -1
  193. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  194. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  195. package/dist/esm/salla-tooltip.entry.js +1 -1
  196. package/dist/esm/salla-trust-badges.entry.js +1 -1
  197. package/dist/esm/salla-user-menu.entry.js +1 -1
  198. package/dist/esm/salla-user-profile.entry.js +1 -1
  199. package/dist/esm/salla-user-settings.entry.js +1 -1
  200. package/dist/esm/salla-verify.entry.js +1 -1
  201. package/dist/esm/salla-wallet.entry.js +1 -1
  202. package/dist/esm/{tracked-promise-DhOWivzL.js → tracked-promise-8v-XqyN8.js} +1 -1
  203. package/dist/esm/twilight.js +3 -3
  204. package/dist/esm/{vanilla-picker-C0njJzZd.js → vanilla-picker-CIUD0MUE.js} +1 -1
  205. package/dist/twilight/{p-DXDm8GqM.js → p-0Jokuna_.js} +1 -1
  206. package/dist/twilight/{p-f1bed530.entry.js → p-0a037636.entry.js} +1 -1
  207. package/dist/twilight/{p-aaf3736b.entry.js → p-0a69eb23.entry.js} +1 -1
  208. package/dist/twilight/{p-9c3d5fdc.entry.js → p-10bf54e3.entry.js} +1 -1
  209. package/dist/twilight/{p-d1808642.entry.js → p-17306014.entry.js} +1 -1
  210. package/dist/twilight/{p-0c342e2d.entry.js → p-1a2a68b4.entry.js} +1 -1
  211. package/dist/twilight/{p-924555bd.entry.js → p-1bd8edcd.entry.js} +1 -1
  212. package/dist/twilight/{p-925690e3.entry.js → p-1ea81716.entry.js} +1 -1
  213. package/dist/twilight/{p-c55b672d.entry.js → p-2291b892.entry.js} +1 -1
  214. package/dist/twilight/{p-07f973b1.entry.js → p-24883adf.entry.js} +1 -1
  215. package/dist/twilight/{p-93e060da.entry.js → p-26dd390f.entry.js} +1 -1
  216. package/dist/twilight/{p-5c972b65.entry.js → p-2a718fa7.entry.js} +1 -1
  217. package/dist/twilight/{p-203d6ae6.entry.js → p-2c0db1f5.entry.js} +1 -1
  218. package/dist/twilight/{p-bea56108.entry.js → p-2c7f026e.entry.js} +1 -1
  219. package/dist/twilight/{p-f668e5dd.entry.js → p-2d366936.entry.js} +1 -1
  220. package/dist/twilight/{p-d1bfd0bc.entry.js → p-2dd96a61.entry.js} +1 -1
  221. package/dist/twilight/{p-07d26676.entry.js → p-3045811f.entry.js} +1 -1
  222. package/dist/twilight/{p-2cae7b1c.entry.js → p-30e73901.entry.js} +1 -1
  223. package/dist/twilight/{p-00b633b2.entry.js → p-37ebae38.entry.js} +1 -1
  224. package/dist/twilight/{p-d473010e.entry.js → p-3a6bb586.entry.js} +1 -1
  225. package/dist/twilight/{p-60d7a5e2.entry.js → p-3d98fdd8.entry.js} +1 -1
  226. package/dist/twilight/{p-c999abc3.entry.js → p-457a4d82.entry.js} +1 -1
  227. package/dist/twilight/{p-c5250fca.entry.js → p-45dd0756.entry.js} +1 -1
  228. package/dist/twilight/{p-d34f2a6c.entry.js → p-46fc246d.entry.js} +1 -1
  229. package/dist/twilight/{p-2eddcffd.entry.js → p-4716f425.entry.js} +1 -1
  230. package/dist/twilight/{p-CMvDceec.js → p-4HuspMnD.js} +1 -1
  231. package/dist/twilight/{p-6c63e8a6.entry.js → p-4afd5f4d.entry.js} +1 -1
  232. package/dist/twilight/{p-4a3b5eca.entry.js → p-4c6b1394.entry.js} +1 -1
  233. package/dist/twilight/{p-d0b10f8b.entry.js → p-4eae9786.entry.js} +1 -1
  234. package/dist/twilight/{p-aeeec3d8.entry.js → p-4f499c9f.entry.js} +1 -1
  235. package/dist/twilight/{p-476c4acb.entry.js → p-53c581d9.entry.js} +1 -1
  236. package/dist/twilight/{p-c612ad0b.entry.js → p-5bbfbf2d.entry.js} +1 -1
  237. package/dist/twilight/{p-1d8eb252.entry.js → p-5e56607d.entry.js} +1 -1
  238. package/dist/twilight/{p-6d35b20c.entry.js → p-5fd93ca6.entry.js} +1 -1
  239. package/dist/twilight/{p-4e52fd6c.entry.js → p-61cc072b.entry.js} +1 -1
  240. package/dist/twilight/{p-3ba87443.entry.js → p-675fc44c.entry.js} +1 -1
  241. package/dist/twilight/{p-ed55bd99.entry.js → p-69507fcc.entry.js} +1 -1
  242. package/dist/twilight/{p-461cd74c.entry.js → p-6de1e1ec.entry.js} +1 -1
  243. package/dist/twilight/{p-b3859adb.entry.js → p-6ffecf89.entry.js} +1 -1
  244. package/dist/twilight/{p-eab889dc.entry.js → p-70c4bf7e.entry.js} +1 -1
  245. package/dist/twilight/{p-31b06705.entry.js → p-756b5f8c.entry.js} +1 -1
  246. package/dist/twilight/{p-deaebd7b.entry.js → p-7a16b35e.entry.js} +1 -1
  247. package/dist/twilight/{p-5e643edb.entry.js → p-7b5b8acf.entry.js} +1 -1
  248. package/dist/twilight/{p-6ab3e94b.entry.js → p-7d6b9967.entry.js} +1 -1
  249. package/dist/twilight/{p-a2fa4306.entry.js → p-857f0932.entry.js} +1 -1
  250. package/dist/twilight/{p-94b31962.entry.js → p-8a004a6d.entry.js} +1 -1
  251. package/dist/twilight/{p-8c34fab2.entry.js → p-8c0420fa.entry.js} +1 -1
  252. package/dist/twilight/{p-56bd83f4.entry.js → p-96c88b66.entry.js} +1 -1
  253. package/dist/twilight/{p-55dfaddd.entry.js → p-977b5c24.entry.js} +1 -1
  254. package/dist/twilight/{p-b7e4542c.entry.js → p-987384b6.entry.js} +1 -1
  255. package/dist/twilight/{p-05ae76f4.entry.js → p-99156981.entry.js} +1 -1
  256. package/dist/twilight/{p-9c2942c3.entry.js → p-9da20408.entry.js} +1 -1
  257. package/dist/twilight/{p-78be4e2c.entry.js → p-9db73e14.entry.js} +1 -1
  258. package/dist/twilight/{p-925869b3.entry.js → p-9e85d4ce.entry.js} +1 -1
  259. package/dist/twilight/{p-DrCHWc9_.js → p-B6oEXetm.js} +1 -1
  260. package/dist/twilight/{p-DvOajQJL.js → p-BlupF8Lq.js} +1 -1
  261. package/dist/twilight/{p-B2jZw8NF.js → p-Br_oy0wM.js} +1 -1
  262. package/dist/twilight/{p-Cw0D47mx.js → p-C5Dg1GRn.js} +1 -1
  263. package/dist/twilight/{p-XEcnGv2r.js → p-CU41HKIU.js} +1 -1
  264. package/dist/twilight/p-DGwOPCLT.js +9 -0
  265. package/dist/twilight/{p-DWyUFC7G.js → p-Dr7vWDR0.js} +1 -1
  266. package/dist/twilight/{p-Dar-Px4H.js → p-DtsEFBDg.js} +1 -1
  267. package/dist/twilight/{p-B5kt5KrJ.js → p-S7MHEIjD.js} +1 -1
  268. package/dist/twilight/p-a1628685.entry.js +4 -0
  269. package/dist/twilight/{p-06f77f81.entry.js → p-a1ad5903.entry.js} +1 -1
  270. package/dist/twilight/{p-9731d50b.entry.js → p-a2c79057.entry.js} +1 -1
  271. package/dist/twilight/{p-ed770165.entry.js → p-a7af7fe2.entry.js} +1 -1
  272. package/dist/twilight/{p-3edb7319.entry.js → p-a9fc0655.entry.js} +1 -1
  273. package/dist/twilight/{p-cd5722c4.entry.js → p-bc9b1447.entry.js} +1 -1
  274. package/dist/twilight/p-bd8b04c3.entry.js +4 -0
  275. package/dist/twilight/{p-33362e8b.entry.js → p-be04ef65.entry.js} +1 -1
  276. package/dist/twilight/{p-5fd650c4.entry.js → p-c1003e80.entry.js} +1 -1
  277. package/dist/twilight/{p-a49d9c6e.entry.js → p-c2bf5b8a.entry.js} +1 -1
  278. package/dist/twilight/{p-e50b4426.entry.js → p-c3b2afd8.entry.js} +1 -1
  279. package/dist/twilight/{p-3e054be0.entry.js → p-c7042b0f.entry.js} +1 -1
  280. package/dist/twilight/{p-8a4da11a.entry.js → p-c7f37130.entry.js} +1 -1
  281. package/dist/twilight/{p-854eb825.entry.js → p-cdf5d86d.entry.js} +1 -1
  282. package/dist/twilight/{p-f8d7196e.entry.js → p-cf6ec931.entry.js} +1 -1
  283. package/dist/twilight/{p-b1f79652.entry.js → p-d2dae9ab.entry.js} +1 -1
  284. package/dist/twilight/{p-f34ea06b.entry.js → p-d60ecfc3.entry.js} +1 -1
  285. package/dist/twilight/{p-c12ff95c.entry.js → p-d6408462.entry.js} +1 -1
  286. package/dist/twilight/{p-6fed57e8.entry.js → p-d785b662.entry.js} +1 -1
  287. package/dist/twilight/{p-d1e67236.entry.js → p-dc29bb5d.entry.js} +1 -1
  288. package/dist/twilight/{p-2dce17b0.entry.js → p-dc6f9843.entry.js} +1 -1
  289. package/dist/twilight/{p-9b2ba1e6.entry.js → p-dddfea5d.entry.js} +1 -1
  290. package/dist/twilight/{p-8207fb6f.entry.js → p-e0c1c0ee.entry.js} +1 -1
  291. package/dist/twilight/{p-11da2f39.entry.js → p-e1703718.entry.js} +1 -1
  292. package/dist/twilight/{p-f5207897.entry.js → p-e39304ef.entry.js} +1 -1
  293. package/dist/twilight/{p-6ff38910.entry.js → p-e501c31a.entry.js} +1 -1
  294. package/dist/twilight/{p-a14b7bb6.entry.js → p-e7ceabbf.entry.js} +1 -1
  295. package/dist/twilight/{p-c0162a6e.entry.js → p-f074ecfe.entry.js} +1 -1
  296. package/dist/twilight/{p-f076d705.entry.js → p-f1255077.entry.js} +1 -1
  297. package/dist/twilight/{p-0238a9dd.entry.js → p-f71c8240.entry.js} +1 -1
  298. package/dist/twilight/p-f86d1059.entry.js +4 -0
  299. package/dist/twilight/{p-5df17c20.entry.js → p-fc1ab34a.entry.js} +1 -1
  300. package/dist/twilight/{p-c3432589.entry.js → p-fc7877b8.entry.js} +1 -1
  301. package/dist/twilight/{p-57a9293b.entry.js → p-fe2ca187.entry.js} +1 -1
  302. package/dist/twilight/{p-DL6eUQYK.js → p-moLp9ne-.js} +1 -1
  303. package/dist/twilight/twilight.esm.js +1 -1
  304. package/dist/types/components/salla-delivery-promise/delivery-promise-api.d.ts +1 -1
  305. package/dist/types/components/salla-delivery-promise/salla-delivery-promise.d.ts +6 -5
  306. package/package.json +5 -5
  307. package/dist/twilight/p-39498902.entry.js +0 -4
  308. package/dist/twilight/p-YUFLgZi3.js +0 -9
  309. package/dist/twilight/p-b352e237.entry.js +0 -4
  310. package/dist/twilight/p-cff61b58.entry.js +0 -4
@@ -1,7 +1,7 @@
1
1
  import type { City, OptionType } from './interfaces';
2
2
  export declare function log(message: string, data?: unknown): void;
3
3
  /** Fetch available cities for a product's delivery promises. */
4
- export declare function fetchCities(productId: number): Promise<{
4
+ export declare function fetchCities(productId: number, keyword?: string): Promise<{
5
5
  cities: City[];
6
6
  }>;
7
7
  /** Fetch the delivery promise message for a given city or branch. */
@@ -21,10 +21,12 @@ export declare class SallaDeliveryPromise {
21
21
  cities: City[];
22
22
  selectedCity: City | null;
23
23
  isLoadingCities: boolean;
24
- modalSearchQuery: string;
25
24
  cityPendingSelection: City | null;
26
- isCityPopoverOpen: boolean;
25
+ modalCities: City[];
26
+ isSearchingCities: boolean;
27
27
  private cityModalRef;
28
+ private citySearchTimer;
29
+ private citySearchCounter;
28
30
  componentDidLoad(): Promise<void>;
29
31
  disconnectedCallback(): void;
30
32
  private onBulletDeliveryConfirmed;
@@ -35,9 +37,8 @@ export declare class SallaDeliveryPromise {
35
37
  private loadCities;
36
38
  private loadDeliveryMessage;
37
39
  private openCityChangeModal;
38
- private handleModalSearchInput;
39
- private handleModalComboboxActivate;
40
- private handleModalSelectCity;
40
+ private handleCitySearch;
41
+ private searchCitiesRemote;
41
42
  private handleConfirmCityModal;
42
43
  private handleHeaderClick;
43
44
  private renderLoadingSkeleton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight-components",
3
- "version": "2.14.440",
3
+ "version": "2.14.442",
4
4
  "license": "GPL-3.0",
5
5
  "author": "Salla Team <support@salla.dev> (https://salla.dev)",
6
6
  "bugs": {
@@ -79,9 +79,9 @@
79
79
  "typescript": "^5.4.5"
80
80
  },
81
81
  "dependencies": {
82
- "@salla.sa/applepay": "2.14.440",
83
- "@salla.sa/twilight": "2.14.440",
84
- "@salla.sa/twilight-tailwind-theme": "2.14.440",
82
+ "@salla.sa/applepay": "2.14.442",
83
+ "@salla.sa/twilight": "2.14.442",
84
+ "@salla.sa/twilight-tailwind-theme": "2.14.442",
85
85
  "@types/node": "^20.4.8",
86
86
  "animejs": "^3.2.2",
87
87
  "class-variance-authority": "0.7.0",
@@ -100,5 +100,5 @@
100
100
  "vanilla-lazyload": "^17.8.5",
101
101
  "vanilla-picker": "^2.12.2"
102
102
  },
103
- "gitHead": "98862d7cbd385458f4f44feb1b795f993e855c19"
103
+ "gitHead": "f986a217a9a389cb349f3c5db68b9e3c00d965f6"
104
104
  }
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{h as a,r as s}from"./p-XEcnGv2r.js";import{s as l}from"./p-B-Rj6b9M.js";import{n as o,a as t,c as r}from"./p-DvOajQJL.js";import{S as e,a as i}from"./p-Bs6JxDkg.js";import{S as n}from"./p-CZRcMGA9.js";import{S as p}from"./p-D1s2kXqL.js";import{S as c}from"./p-QpH8MU22.js";import{S as y}from"./p-0-eTJXSD.js";import{S as m}from"./p-CXRKXFgT.js";import{T as g}from"./p-Dar-Px4H.js";import{a as d}from"./p-CgtvEd63.js";var h=function(a,s,l,o){var t,r=arguments.length,e=r<3?s:null===o?o=Object.getOwnPropertyDescriptor(s,l):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)e=Reflect.decorate(a,s,l,o);else for(var i=a.length-1;i>=0;i--)(t=a[i])&&(e=(r<3?t(e):r>3?t(s,l,e):t(s,l))||e);return r>3&&e&&Object.defineProperty(s,l,e),e};const u={all:a("span",{class:"s-loyalty-program-rewards-tab-icon",innerHTML:i}),free_shipping:a("span",{class:"s-loyalty-program-rewards-tab-icon",innerHTML:n}),coupon_discount:a("span",{class:"s-loyalty-program-rewards-tab-icon",innerHTML:e}),free_product:a("span",{class:"s-loyalty-program-rewards-tab-icon",innerHTML:p})},f=class{constructor(a){s(this,a),this.currentPrize=null,this.collapsed=!0,this.animatedPoints=0,this.handleExchangeSucceeded=()=>{this.points(),this.program()}}componentWillLoad(){return salla.onReady().then((()=>salla.lang.onLoaded())).then((()=>l())).then((()=>{this.program(),this.points(),salla.event.on("loyalty::exchange.succeeded",this.handleExchangeSucceeded)})).catch((a=>salla.logger.error(a)))}disconnectedCallback(){salla.event.off("loyalty::exchange.succeeded",this.handleExchangeSucceeded)}getOutlineItem(s,l,o){const t={1:a("span",{innerHTML:c}),2:a("span",{innerHTML:y}),3:a("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>cart-upload</title>\n<path d="M14.545 7.669l3.121-2.732v9.729c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-9.728l3.121 2.732c0.253 0.22 0.567 0.329 0.879 0.329 0.371 0 0.74-0.155 1.004-0.455 0.485-0.555 0.429-1.396-0.125-1.881l-5.333-4.667c-0.503-0.44-1.253-0.44-1.756 0l-5.333 4.667c-0.555 0.484-0.611 1.327-0.125 1.881 0.484 0.552 1.325 0.609 1.881 0.124zM30.647 5.371c-0.713-0.171-1.436 0.267-1.609 0.983l-2.744 11.363c-0.171 0.568-0.684 0.951-1.277 0.951h-12.136c-0.563 0-1.067-0.356-1.256-0.885l-6.035-16.896c-0.189-0.531-0.692-0.885-1.256-0.885h-2.667c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h1.727l5.719 16.012c0.567 1.588 2.081 2.655 3.768 2.655h12.136c1.78 0 3.32-1.145 3.851-2.92l2.763-11.433c0.173-0.716-0.267-1.436-0.983-1.609zM13.667 24c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM13.667 29.333c-0.735 0-1.333-0.599-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.599 1.333 1.333-0.599 1.333-1.333 1.333zM24.333 24c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM24.333 29.333c-0.735 0-1.333-0.599-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.599 1.333 1.333-0.599 1.333-1.333 1.333z"></path>\n</svg>\n'})};return a("li",{class:"s-loyalty-program-item"},a("div",{class:"s-loyalty-program-content"},a("span",{class:"s-loyalty-program-icon-container"},a("span",{class:"s-loyalty-program-text-gradient"},s),a("span",{class:"s-loyalty-program-icon"},t[s])),a("div",{class:"s-loyalty-program-title"},l),a("div",{class:"s-loyalty-program-description"},o)))}render(){if("error"===this.program.status)return a("p",null,salla.lang.get("common.errors.error_occured"));const s=this.program.data.points.slice(0,this.collapsed?t(this.program.data.points.length):this.program.data.points.length),l=this.program.data.prizes,o=this.program.data.prizes_count;return a("div",{class:"s-loyalty-program-container"},a("salla-loyalty-hero",{name:this.program.data.name,description:this.program.data.description,image:this.program.data.image},salla.config.isUser()?a("div",{slot:"crosspoint",class:"s-loyalty-program-profile-wrapper"},a("div",{class:"s-loyalty-program-profile-container"},a("div",{class:"s-loyalty-program-profile-points-section"},a("h2",{class:"s-loyalty-program-profile-label"},salla.lang.get("pages.loyalty_program.your_points")),a("p",{class:"s-loyalty-program-profile-points"},a("span",{class:"s-loyalty-program-profile-points-value"},this.animatedPoints?this.animatedPoints:this.points.data)," ",salla.lang.get("pages.loyalty_program.point"))),a("div",{class:"s-loyalty-program-profile-icon"},a("span",{innerHTML:m})))):a("button",{slot:"action",onClick:()=>salla.event.dispatch("login::open"),class:{"s-loyalty-program-login-action":!0,"s-loyalty-program-login-action-dark":!this.program.data.image,"s-loyalty-program-login-action-light":!!this.program.data.image}},salla.lang.get("blocks.header.login"))),a("div",{class:"s-loyalty-program-outline-section"},a("section",{class:"s-loyalty-program-section"},a("header",{class:"s-loyalty-program-header"},a("h1",{class:"s-loyalty-program-main-title"},salla.lang.get("pages.loyalty_program.how_to_start")),a("p",{class:"s-loyalty-program-subtitle"},salla.lang.get("pages.loyalty_program.three_simple_steps"))),a("ol",{class:"s-loyalty-program-list"},this.getOutlineItem(1,salla.lang.get("pages.loyalty_program.register"),salla.lang.get("pages.loyalty_program.create_account")),this.getOutlineItem(2,salla.lang.get("pages.loyalty_program.earn_points"),salla.lang.get("pages.loyalty_program.complete_tasks")),this.getOutlineItem(3,salla.lang.get("pages.loyalty_program.redeem_rewards"),salla.lang.get("pages.loyalty_program.enjoy_rewards"))))),a("div",{class:"s-loyalty-program-points-wrapper"},a("section",{class:"s-loyalty-program-points-section"},a("header",{class:"s-loyalty-program-points-header"},a("h1",{class:"s-loyalty-program-points-title"},this.program.data.promotion_title),a("p",{class:"s-loyalty-program-points-description"},this.program.data.promotion_description)),a("div",{class:"s-loyalty-program-points-spacer"}),a("ul",{class:{"s-loyalty-program-points-list-one":1===this.program.data.points.length,"s-loyalty-program-points-list-two":2===this.program.data.points.length,"s-loyalty-program-points-list-multi":this.program.data.points.length>2}},s.map((s=>a("li",null,a("salla-loyalty-point",{point:s}))))),a("div",{class:"s-loyalty-program-points-spacer"}),t(this.program.data.points.length)!==this.program.data.points.length&&a("button",{class:"s-loyalty-program-points-more-button",onClick:()=>this.collapsed=!this.collapsed},this.collapsed?a("span",null,salla.lang.get("pages.loyalty_program.show_more"),"  ",a("span",{style:{fontSize:"1.2rem",fontWeight:"300"}},"+")):a("span",null,salla.lang.get("pages.loyalty_program.show_less"),"  ",a("span",{style:{fontSize:"1.2rem",fontWeight:"300"}},"-"))))),"success"!==this.program.status?"":a("div",{class:"s-loyalty-program-rewards-container s-loyalty-program-slider-arrows-edges"},a("section",{class:{"s-loyalty-program-tabs-hider":l.length<=2||o<=4}},a("h1",{class:"s-loyalty-program-rewards-heading-mobile"},salla.lang.get("pages.loyalty_program.rewards")),a("salla-tabs",null,a("div",{slot:"header",class:"s-loyalty-program-rewards-tab-items"},l.map((s=>a("salla-tab-header",{slot:"header",name:s.type},u[s.type],a("span",null,s.title))))),a("h1",{slot:"header",class:"s-loyalty-program-rewards-heading-desktop"},salla.lang.get("pages.loyalty_program.rewards")),l.map((s=>a("salla-tab-content",{slot:"content",name:s.type},a("salla-slider",{id:s.type,type:"default","slider-config":'{"loop":false,"slidesPerView":"auto","freeMode":true,"spaceBetween":12,"breakpoints":{"768":{"slidesPerView":4,"spaceBetween":24,"freeMode":false,"speed":300}}}'},a("div",{slot:"items"},s.items.map((s=>a("salla-reward-card",{prize:s,onAreaClick:()=>{this.currentPrize=s,r((()=>this.detailsModal.open()))},onActionClick:()=>{this.currentPrize=s,r((()=>this.detailsModal.open()))}}))))))))),a("salla-modal",{ref:a=>this.detailsModal=a,class:"s-loyalty-program-modal",width:"md",noPadding:!0},this.currentPrize?a("salla-reward-details",{onActionClick:()=>r((()=>this.exchangeModal.open())),prize:this.currentPrize}):""),a("salla-modal",{ref:a=>this.exchangeModal=a,class:"s-loyalty-program-modal",width:"sm"},this.currentPrize?a("salla-reward-exchange",{prize:this.currentPrize}):""))))}};h([g((async function(){const{data:a}=await salla.loyalty.getProgram();return o(a)}),{initialData:{points:[],prizes:[],prizes_count:0}})],f.prototype,"program",void 0),h([g((async function(){const{data:a}=await salla.loyalty.getPoints();return d({targets:{value:0},value:a.points??0,round:1,easing:"easeOutQuad",duration:2e3,update:a=>{this.animatedPoints=a.animations[0].currentValue}}),a.points}))],f.prototype,"points",void 0),f.style="";export{f as salla_loyalty_program}
@@ -1,9 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{d as e}from"./p-XEcnGv2r.js";function n(e,n){return n.forEach((function(n){n&&"string"!=typeof n&&!Array.isArray(n)&&Object.keys(n).forEach((function(t){if("default"!==t&&!(t in e)){var E=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,E.get?E:{enumerable:!0,get:function(){return n[t]}})}}))})),Object.freeze(e)}var t,E,i={exports:{}},r=t?i.exports:(t=1,i.exports=(E=function(e){var n=e.addFilter,t=e.utils,E=t.Type,i=t.isString,r=t.replaceInString,T=t.guesstimateMimeType,u=t.getExtensionFromFilename,o=t.getFilenameFromURL,_=function(e,n){return e.some((function(e){return/\*$/.test(e)?(t=e,(/^[^/]+/.exec(n)||[]).pop()===t.slice(0,-2)):e===n;var t}))},a=function(e,n,t){if(0===n.length)return!0;var E=function(e){var n="";if(i(e)){var t=o(e),E=u(t);E&&(n=T(E))}else n=e.type;return n}(e);return t?new Promise((function(i,r){t(e,E).then((function(e){_(n,e)?i():r()})).catch(r)})):_(n,E)};return n("SET_ATTRIBUTE_TO_OPTION_MAP",(function(e){return Object.assign(e,{accept:"acceptedFileTypes"})})),n("ALLOW_HOPPER_ITEM",(function(e,n){var t=n.query;return!t("GET_ALLOW_FILE_TYPE_VALIDATION")||a(e,t("GET_ACCEPTED_FILE_TYPES"))})),n("LOAD_FILE",(function(e,n){var t=n.query;return new Promise((function(n,E){if(t("GET_ALLOW_FILE_TYPE_VALIDATION")){var i=t("GET_ACCEPTED_FILE_TYPES"),T=t("GET_FILE_VALIDATE_TYPE_DETECT_TYPE"),u=a(e,i,T),o=function(){var e,n=i.map((e=t("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP"),function(n){return null!==e[n]&&(e[n]||n)})).filter((function(e){return!1!==e})),T=n.filter((function(e,t){return n.indexOf(e)===t}));E({status:{main:t("GET_LABEL_FILE_TYPE_NOT_ALLOWED"),sub:r(t("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES"),{allTypes:T.join(", "),allButLastType:T.slice(0,-1).join(", "),lastType:T[T.length-1]})}})};if("boolean"==typeof u)return u?n(e):o();u.then((function(){n(e)})).catch(o)}else n(e)}))})),{options:{allowFileTypeValidation:[!0,E.BOOLEAN],acceptedFileTypes:[[],E.ARRAY],labelFileTypeNotAllowed:["File is of invalid type",E.STRING],fileValidateTypeLabelExpectedTypes:["Expects {allButLastType} or {lastType}",E.STRING],fileValidateTypeLabelExpectedTypesMap:[{},E.OBJECT],fileValidateTypeDetectType:[null,E.FUNCTION]}}},"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:E})),E)),T=n({__proto__:null,default:e(r)},[r]);
5
- /*!
6
- * FilePondPluginFileValidateType 1.2.9
7
- * Licensed under MIT, https://opensource.org/licenses/MIT/
8
- * Please visit https://pqina.nl/filepond/ for details.
9
- */export{T as f}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as t,c as r,h as e,H as c}from"./p-XEcnGv2r.js";const d=class{constructor(e){t(this,e),this.orderEditProductSelected=r(this,"orderEditProductSelected")}get productData(){if(!this.product)return{};if("object"==typeof this.product)return this.product;try{return JSON.parse(this.product)}catch(t){return{}}}handleSelectProduct(){this.orderEditProductSelected.emit({product:this.productData})}render(){const t=this.productData,r=t?.name||salla.lang.getWithDefault("common.elements.product","منتج"),d=t?.price;return e(c,{key:"9f9278890bd821cf7b1caecdf4484a26273fe407"},e("button",{key:"6d28490ff098143000fff6543702ba805e997077",type:"button",class:"s-order-edit-product-card",onClick:()=>this.handleSelectProduct()},e("div",{key:"b7399553a7b79303b8bae8c9b624f460fe761946",class:"s-order-edit-product-card-media"},t?.image?.url?e("img",{src:t.image.url,alt:t.image.alt||r,class:"s-order-edit-product-card-image"}):e("div",{class:"s-order-edit-product-card-placeholder"},e("i",{class:"sicon-shopping-bag"}))),e("div",{key:"5cd57cf519f5d681116336cc6db8aed3569b761d",class:"s-order-edit-product-card-content"},e("h3",{key:"51312a3708d95f3d6d654099b25a2a4644c70aaa",class:"s-order-edit-product-card-title"},r),null!=d&&e("p",{key:"c09988f616198ae0d527e994e5c55e8b0a01c218",class:"s-order-edit-product-card-price",innerHTML:salla.money(d)}))))}};d.style=":host{display:block;min-width:0}";export{d as salla_order_edit_product_card}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as s,h as e,H as i,a as t}from"./p-XEcnGv2r.js";function l(s,e){localStorage.getItem("salla-delivery-promise-debug")&&(void 0!==e?console.log(s,e):console.log(s))}function a(){const s=(Boolean(salla.config.get("store.settings.bullet_delivery.settings.remember_last_session"))?salla.storage.store:salla.storage.session).get("bullet_delivery_intent");return s&&"object"==typeof s?s:null}const r={deliveryTo:"توصيل إلى",pickupFromBranch:"الاستلام من فرع",noResults:"لا توجد نتائج",selectCity:"اختر المدينة",changeCityTitle:"تغيير المدينة",changeCitySubtitle:"",cityFieldLabel:"المدينة",modalSearchPlaceholder:"ابحث عن مدينة",confirmAddress:"تأكيد العنوان",errorDeliveryPromise:"لا يتوفر وعد تسليم لهذه المدينة",errorPickupPromise:"لا يتوفر وعد تسليم لهذا الفرع"};function o(s){const e=salla.config.get("user.language_code");return e&&"ar"!==e&&s.name_en?.trim()?s.name_en.trim():s.name}const n="salla-bullet-delivery-override-ip",h=class{constructor(e){s(this,e),this.isDeliveryPromiseEnabled=!1,this.isLoginCycleEnabled=!1,this.canRender=!1,this.labels=r,this.selectedLabel=null,this.deliveryMessage=null,this.hasError=!1,this.errorMessage="",this.isLoadingPromises=!1,this.selectedCityLoginCycle=null,this.selectedBranchLoginCycle=null,this.cities=[],this.selectedCity=null,this.isLoadingCities=!1,this.modalSearchQuery="",this.cityPendingSelection=null,this.isCityPopoverOpen=!1,this.onBulletDeliveryConfirmed=()=>{this.applyBulletIntent()},this.handleModalSearchInput=s=>{this.modalSearchQuery=s.target.value,this.isCityPopoverOpen=!0},this.handleModalComboboxActivate=()=>{this.isCityPopoverOpen=!0},this.handleHeaderClick=s=>{s.stopPropagation(),this.isLoginCycleEnabled?this.openBulletDeliveryModal():this.openCityChangeModal()}}async componentDidLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.labels={deliveryTo:salla.lang.getWithDefault("pages.products.promise_deliver_to",r.deliveryTo),pickupFromBranch:salla.lang.getWithDefault("pages.products.promise_pickup_from_branch",r.pickupFromBranch),noResults:salla.lang.getWithDefault("common.elements.no_options",r.noResults),selectCity:salla.lang.getWithDefault("common.elements.select_city",r.selectCity),changeCityTitle:salla.lang.getWithDefault("pages.products.promise_change_city_title",r.changeCityTitle),changeCitySubtitle:salla.lang.getWithDefault("pages.products.promise_change_city_subtitle","قد تتغيّر مدة التوصيل حسب المدينة."),cityFieldLabel:salla.lang.getWithDefault("pages.products.promise_city_field",r.cityFieldLabel),modalSearchPlaceholder:salla.lang.getWithDefault("pages.products.promise_search_city",r.modalSearchPlaceholder),confirmAddress:salla.lang.getWithDefault("pages.checkout.confirm_address",r.confirmAddress),errorDeliveryPromise:salla.lang.getWithDefault("pages.products.promise_delivery_not_available",r.errorDeliveryPromise),errorPickupPromise:salla.lang.getWithDefault("pages.products.promise_pickup_not_available",r.errorPickupPromise)},this.isDeliveryPromiseEnabled=salla.config.get("store.features",[]).includes("delivery-promises"),this.isLoginCycleEnabled=salla.config.get("store.features",[]).includes("bullet-delivery-v2"),this.productId=salla.config.get("page.id"),this.isDeliveryPromiseEnabled?this.isLoginCycleEnabled?await this.initLoginCycleFlow():(this.selectedLabel=`${this.labels.deliveryTo} ${this.labels.selectCity}`,await this.loadCities()):this.canRender=!1}disconnectedCallback(){window.removeEventListener("bulletDeliveryConfirmed",this.onBulletDeliveryConfirmed)}getIPDeliveryLocation(){const s="store.shipping.delivery_location",e={cityId:salla.config.get(`${s}.city_id`),cityName:salla.config.get(`${s}.city_name`)};return localStorage.getItem(n)?JSON.parse(localStorage.getItem(n)):e}async initLoginCycleFlow(){const s=this.applyBulletIntent(),{cityId:e,cityName:i}=this.getIPDeliveryLocation();l("delivery promise login cycle flow getIPDeliveryLocation",this.getIPDeliveryLocation()),e&&i&&!s&&(this.selectedLabel=`${this.labels.deliveryTo} ${i}`,await this.loadDeliveryMessage(e,"city")),this.canRender=!0,window.addEventListener("bulletDeliveryConfirmed",this.onBulletDeliveryConfirmed)}applyBulletIntent(){const s=function(){const s=a();if(!s)return null;if("address"===s.type){const e=s.address_details?.city,i=null!=e?.id?Number(e.id):null!=s.city_id?Number(s.city_id):null,t=e?.name?.trim()||"";return null!=i?{type:"address",option:{id:i,name:t}}:null}if("branch"===s.type){const e=null!=s.branch_id?Number(s.branch_id):null!=s.branch_details?.id?Number(s.branch_details.id):null,i=s.branch_details?.name?.trim()||"";return null!=e?{type:"branch",option:{id:e,name:i}}:null}return null}();return s?("address"===s.type?(this.selectedCityLoginCycle=s.option,this.selectedBranchLoginCycle=null,this.selectedLabel=`${this.labels.deliveryTo} ${s.option.name||this.labels.selectCity}`,this.loadDeliveryMessage(s.option.id,"city")):(this.selectedBranchLoginCycle=s.option,this.selectedCityLoginCycle=null,this.selectedLabel=`${this.labels.pickupFromBranch} ${s.option.name}`,this.loadDeliveryMessage(s.option.id,"branch")),!0):(this.selectedLabel=`${this.labels.deliveryTo} ${this.labels.selectCity}`,this.selectedCityLoginCycle=null,this.selectedBranchLoginCycle=null,this.deliveryMessage=null,!1)}openBulletDeliveryModal(){salla.event.emit("salla::bullet-delivery.modal.open.requested",function(){const s=a(),e={};if("address"===s?.type&&null!=s.address_id&&(e.preselected_address_id=Number(s.address_id)),"branch"===s?.type){const i=s.branch_id??s.branch_details?.id;null!=i&&(e.preselected_branch_id=Number(i))}return e}())}async loadCities(){this.isLoadingCities=!0,this.hasError=!1;const{cityId:s,cityName:e}=this.getIPDeliveryLocation();l("delivery promise standard flow getIPDeliveryLocation",this.getIPDeliveryLocation());try{const{cities:i}=await async function(s){l("fetchCities start",{productId:s});const e=await salla.api.request(salla.url.api(`products/${s}/delivery-promises/cities`));return e.success&&Array.isArray(e.data)&&0!==e.data.length?(l("fetchCities success",{count:e.data.length}),{cities:e.data}):(l("fetchCities: no data",{response:e}),{cities:[]})}(this.productId);if(!i.length)return void(this.canRender=!1);if(this.cities=i,this.canRender=!0,s&&e){this.selectedLabel=`${this.labels.deliveryTo} ${e}`;const i=this.cities.find((e=>String(e.id)===String(s)));i&&(l("delivery promise standard flow autoCity found",i),this.selectedCity=i,this.modalSearchQuery=o(i)),await this.loadDeliveryMessage(s,"city")}}catch(s){this.hasError=!0,this.errorMessage=s.message||"Failed to load cities",this.canRender=!1}finally{this.isLoadingCities=!1}}async loadDeliveryMessage(s,e){this.isLoadingPromises=!0,this.hasError=!1,this.deliveryMessage=null;try{this.deliveryMessage=await async function(s,e,i,t){l("fetchDeliveryMessage start",{productId:s,id:e,optionType:i});let a="";a="city"!==i||t?`?reference_id=${e}&reference_type=${i}`:`?reference_id=${e}`;const r=await salla.api.withoutNotifier((()=>salla.api.request(salla.url.api(`products/${s}/delivery-promises${a}`))));if(!r.success)throw l("fetchDeliveryMessage error",{response:r}),new Error(r.error?.message||"Failed to fetch delivery promise");const o=r.data?.message?.trim();return l("fetchDeliveryMessage success",{message:o}),o||null}(this.productId,s,e,this.isLoginCycleEnabled)}catch(s){this.hasError=!0,this.errorMessage="city"===e?this.labels.errorDeliveryPromise:this.labels.errorPickupPromise}finally{this.isLoadingPromises=!1}}async openCityChangeModal(){this.cityModalRef&&(this.cityPendingSelection=null,this.isCityPopoverOpen=!1,await this.cityModalRef.setTitle(this.labels.changeCityTitle),await this.cityModalRef.open())}handleModalSelectCity(s){this.cityPendingSelection=s,this.modalSearchQuery=o(s),this.isCityPopoverOpen=!1}async handleConfirmCityModal(){if(!this.cityPendingSelection)return void await(this.cityModalRef?.close());const s=this.cityPendingSelection;this.selectedCity=s,this.selectedLabel=`${this.labels.deliveryTo} ${o(s)}`,await this.loadDeliveryMessage(s.id,"city"),await(this.cityModalRef?.close())}renderLoadingSkeleton(){return e(i,{class:"s-delivery-promise-wrapper s-delivery-promise-skeleton"},e("div",{class:"s-delivery-promise-container"},e("div",{class:"s-delivery-promise-header s-delivery-promise-header-skeleton"},e("div",{class:"s-delivery-promise-location"},e("salla-skeleton",{height:"14px",width:"180px"})),e("salla-skeleton",{height:"18px",width:"18px"})),e("div",{class:"s-delivery-promise-loading"},e("salla-skeleton",{height:"20px",width:"80%"}))))}renderDeliveryMessage(){return this.isLoadingPromises?e("div",{class:"s-delivery-promise-loading"},e("salla-skeleton",{height:"20px",width:"80%"})):this.deliveryMessage?e("div",{class:"s-delivery-promise-message"},this.deliveryMessage):null}renderCityModalBody(){const s=function(s,e){const i=e.trim().toLowerCase();return i?s.filter((s=>s.name.toLowerCase().includes(i)||(s.name_en||"").toLowerCase().includes(i))):[...s]}(this.cities,this.modalSearchQuery);return e("div",{class:"s-delivery-promise-modal-body"},e("label",{class:"s-delivery-promise-modal-field-label",htmlFor:"s-delivery-promise-modal-search"},this.labels.cityFieldLabel,e("span",{class:"s-delivery-promise-required","aria-hidden":"true"}," *")),e("div",{class:"s-delivery-promise-modal-combobox"},e("div",{class:"s-delivery-promise-modal-search",onClick:this.handleModalComboboxActivate},e("i",{class:"sicon-search","aria-hidden":"true"}),e("input",{id:"s-delivery-promise-modal-search",type:"text",class:"form-input",placeholder:this.labels.modalSearchPlaceholder,value:this.modalSearchQuery,onInput:this.handleModalSearchInput,autocomplete:"off","aria-autocomplete":"list","aria-expanded":this.isCityPopoverOpen?"true":"false","aria-controls":"s-delivery-promise-modal-listbox"})),e("div",{id:"s-delivery-promise-modal-listbox",class:"s-delivery-promise-modal-popover",role:"listbox",hidden:!this.isCityPopoverOpen},e("div",{class:"s-delivery-promise-modal-list s-scrollbar"},0===s.length?e("div",{class:"s-delivery-promise-modal-empty"},this.labels.noResults):s.map((s=>e("button",{key:s.id,type:"button",role:"option",class:{"s-delivery-promise-modal-item":!0,"s-delivery-promise-modal-item--selected":this.cityPendingSelection?.id===s.id},"aria-selected":this.cityPendingSelection?.id===s.id?"true":"false",onClick:e=>{e.stopPropagation(),this.handleModalSelectCity(s)}},e("span",{class:"s-delivery-promise-modal-item-name"},s.name),this.cityPendingSelection?.id===s.id?e("i",{class:"sicon-check","aria-hidden":"true"}):null)))))))}renderCityChangeModal(){return this.isLoginCycleEnabled?null:e("salla-modal",{id:"s-delivery-promise-city-modal",ref:s=>{this.cityModalRef=s},class:"s-delivery-promise-city-modal",isClosable:!0,width:"md","modal-title":this.labels.changeCityTitle,subTitle:this.labels.changeCitySubtitle},this.renderCityModalBody(),e("salla-button",{slot:"footer",width:"wide",disabled:!this.cityPendingSelection,onClick:()=>this.handleConfirmCityModal()},!this.isLoadingPromises&&this.labels.confirmAddress))}render(){return this.isDeliveryPromiseEnabled?this.isLoadingCities?this.renderLoadingSkeleton():this.canRender?e(i,{class:"s-delivery-promise-wrapper"},e("div",{class:"s-delivery-promise-container"},e("div",{class:"s-delivery-promise-header",onClick:this.handleHeaderClick},e("div",{class:"s-delivery-promise-location"},e("span",{class:"s-delivery-promise-title"},this.selectedLabel)),e("i",{class:"sicon-keyboard_arrow_down s-delivery-promise-arrow"})),this.hasError&&e("div",{class:"s-delivery-promise-error"},this.errorMessage),!this.hasError&&this.renderDeliveryMessage()),this.renderCityChangeModal()):null:null}get host(){return t(this)}};export{h as salla_delivery_promise}