@salla.sa/twilight-components 2.14.466 → 2.14.468

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 (361) hide show
  1. package/dist/cjs/{filepond-ChLzVjJY.js → filepond-C1SAyrFq.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-CsFmGjnc.js → filepond-plugin-file-poster-DAhQ7rGa.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-CHsUG4Ey.js → filepond-plugin-file-validate-size-qfwxpApK.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-BcOZG5x6.js → filepond-plugin-file-validate-type-BbYanfPf.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-Cq0bUS7X.js → filepond-plugin-image-edit-lWdFhMNt.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-D6e7ezt-.js → filepond-plugin-image-exif-orientation-C2wUYBSb.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-B0fvWDqM.js → filepond-plugin-image-preview-B1ukjrjT.js} +1 -1
  8. package/dist/cjs/{functions-DQkYfvtq.js → functions-DCSgyun2.js} +1 -1
  9. package/dist/cjs/{index-DTSWXcbN.js → index-CXr_39D8.js} +9 -5
  10. package/dist/cjs/{index-MaPhQdOr.js → index-D3oJJZKW.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/{mail-Bgvt2hc9.js → mail-C9D8MHae.js} +2 -2
  13. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +29 -84
  16. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-booking-field_7.cjs.entry.js +11 -11
  22. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +91 -7
  23. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
  29. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-gifting.cjs.entry.js +63 -28
  38. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-login-modal.cjs.entry.js +32 -2
  44. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  45. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +4 -4
  46. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  47. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  51. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  52. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-map.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-products-list.cjs.entry.js +259 -64
  82. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-quick-order.cjs.entry.js +3 -3
  84. package/dist/cjs/salla-rating-modal.cjs.entry.js +3 -3
  85. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  86. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-social-share.cjs.entry.js +252 -32
  91. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
  93. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
  95. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
  99. package/dist/cjs/salla-verify.cjs.entry.js +3 -3
  100. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +329 -0
  102. package/dist/cjs/{tracked-promise-ePwPYqjc.js → tracked-promise-BsYRgTGD.js} +1 -1
  103. package/dist/cjs/twilight.cjs.js +2 -2
  104. package/dist/cjs/{vanilla-picker-l24zONcP.js → vanilla-picker-DkdzTjSC.js} +1 -1
  105. package/dist/collection/collection-manifest.json +2 -1
  106. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +90 -6
  107. package/dist/collection/components/salla-gifting/salla-gifting.js +69 -29
  108. package/dist/collection/components/salla-login-modal/salla-login-modal.js +31 -1
  109. package/dist/collection/components/salla-product-options/salla-product-options.css +0 -3
  110. package/dist/collection/components/salla-product-options/salla-product-options.js +28 -84
  111. package/dist/collection/components/salla-products-list/salla-products-list.css +76 -0
  112. package/dist/collection/components/salla-products-list/salla-products-list.js +387 -65
  113. package/dist/collection/components/salla-social-share/salla-social-share.css +161 -0
  114. package/dist/collection/components/salla-social-share/salla-social-share.js +316 -50
  115. package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
  116. package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
  117. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  118. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  119. package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
  120. package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
  121. package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.css +65 -0
  122. package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +432 -0
  123. package/dist/components/index.js +5 -5
  124. package/dist/components/salla-bullet-delivery.js +90 -6
  125. package/dist/components/salla-gifting.js +63 -27
  126. package/dist/components/salla-login-modal2.js +31 -1
  127. package/dist/components/salla-product-options2.js +28 -84
  128. package/dist/components/salla-products-list2.js +266 -64
  129. package/dist/components/salla-social-share.js +1 -189
  130. package/dist/components/salla-social-share2.js +420 -0
  131. package/dist/components/salla-tab-content2.js +1 -1
  132. package/dist/components/salla-tab-header2.js +1 -1
  133. package/dist/components/salla-tabs2.js +1 -1
  134. package/dist/components/salla-tel-input2.js +1 -1
  135. package/dist/components/salla-tooltip2.js +1 -1
  136. package/dist/components/salla-user-settings.js +1 -1
  137. package/dist/components/salla-wishlist-actions.d.ts +11 -0
  138. package/dist/components/salla-wishlist-actions.js +375 -0
  139. package/dist/esm/{filepond-C8Bwo-02.js → filepond-C4pZr9nR.js} +1 -1
  140. package/dist/esm/{filepond-plugin-file-poster-Bx3Pf2Jt.js → filepond-plugin-file-poster-CXpAGxT4.js} +1 -1
  141. package/dist/esm/{filepond-plugin-file-validate-size-B855u7Nl.js → filepond-plugin-file-validate-size-Dk4M6ge1.js} +1 -1
  142. package/dist/esm/{filepond-plugin-file-validate-type-Bi5ftj6I.js → filepond-plugin-file-validate-type-DD7qvRsg.js} +1 -1
  143. package/dist/esm/{filepond-plugin-image-edit-BDsvflVi.js → filepond-plugin-image-edit-DMllAEkg.js} +1 -1
  144. package/dist/esm/{filepond-plugin-image-exif-orientation-CIBvl9lW.js → filepond-plugin-image-exif-orientation-BRCbcu_E.js} +1 -1
  145. package/dist/esm/{filepond-plugin-image-preview-iKOdvH4g.js → filepond-plugin-image-preview-DgeylrwN.js} +1 -1
  146. package/dist/esm/{functions-Bc7BItqP.js → functions-DrS7by6t.js} +1 -1
  147. package/dist/esm/{index-TDIoPT-F.js → index-9SnsJoYO.js} +1 -1
  148. package/dist/esm/{index-B4SEH_Fg.js → index-D2yBy7Jh.js} +9 -5
  149. package/dist/esm/loader.js +3 -3
  150. package/dist/esm/{mail-DLNIOD9t.js → mail-DzAIgzdz.js} +2 -2
  151. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  152. package/dist/esm/salla-accordion_6.entry.js +1 -1
  153. package/dist/esm/salla-add-product-button_5.entry.js +29 -84
  154. package/dist/esm/salla-advertisement.entry.js +1 -1
  155. package/dist/esm/salla-alert_2.entry.js +1 -1
  156. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  157. package/dist/esm/salla-apps-icons.entry.js +1 -1
  158. package/dist/esm/salla-badge.entry.js +1 -1
  159. package/dist/esm/salla-booking-field_7.entry.js +11 -11
  160. package/dist/esm/salla-bullet-delivery_2.entry.js +91 -7
  161. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  162. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  163. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  164. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  165. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  166. package/dist/esm/salla-contacts.entry.js +3 -3
  167. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  168. package/dist/esm/salla-count-down.entry.js +1 -1
  169. package/dist/esm/salla-custom-fields.entry.js +1 -1
  170. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  171. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  172. package/dist/esm/salla-filters-widget.entry.js +1 -1
  173. package/dist/esm/salla-filters.entry.js +1 -1
  174. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  175. package/dist/esm/salla-gifting.entry.js +63 -28
  176. package/dist/esm/salla-hook.entry.js +1 -1
  177. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  178. package/dist/esm/salla-installment.entry.js +1 -1
  179. package/dist/esm/salla-list-tile.entry.js +1 -1
  180. package/dist/esm/salla-localization-modal.entry.js +1 -1
  181. package/dist/esm/salla-login-modal.entry.js +32 -2
  182. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  183. package/dist/esm/salla-loyalty-hero_2.entry.js +4 -4
  184. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  185. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  186. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  187. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  188. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  189. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  190. package/dist/esm/salla-loyalty.entry.js +1 -1
  191. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  192. package/dist/esm/salla-map.entry.js +1 -1
  193. package/dist/esm/salla-menu.entry.js +1 -1
  194. package/dist/esm/salla-metadata.entry.js +1 -1
  195. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  196. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  197. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  198. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  199. package/dist/esm/salla-notification-item.entry.js +1 -1
  200. package/dist/esm/salla-notifications.entry.js +1 -1
  201. package/dist/esm/salla-offer-modal.entry.js +1 -1
  202. package/dist/esm/salla-offer.entry.js +1 -1
  203. package/dist/esm/salla-order-branch.entry.js +1 -1
  204. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  205. package/dist/esm/salla-order-details-options.entry.js +1 -1
  206. package/dist/esm/salla-order-details.entry.js +1 -1
  207. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  208. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  209. package/dist/esm/salla-order-edit.entry.js +1 -1
  210. package/dist/esm/salla-order-summary.entry.js +1 -1
  211. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  212. package/dist/esm/salla-orders.entry.js +1 -1
  213. package/dist/esm/salla-payments.entry.js +1 -1
  214. package/dist/esm/salla-placeholder.entry.js +1 -1
  215. package/dist/esm/salla-price-range.entry.js +1 -1
  216. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  217. package/dist/esm/salla-product-card_2.entry.js +1 -1
  218. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  219. package/dist/esm/salla-products-list.entry.js +259 -64
  220. package/dist/esm/salla-progress-bar.entry.js +1 -1
  221. package/dist/esm/salla-quick-order.entry.js +3 -3
  222. package/dist/esm/salla-rating-modal.entry.js +3 -3
  223. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  224. package/dist/esm/salla-scopes.entry.js +1 -1
  225. package/dist/esm/salla-search.entry.js +1 -1
  226. package/dist/esm/salla-skeleton.entry.js +1 -1
  227. package/dist/esm/salla-slider.entry.js +1 -1
  228. package/dist/esm/salla-social-share.entry.js +252 -32
  229. package/dist/esm/salla-social.entry.js +1 -1
  230. package/dist/esm/salla-tab-content_3.entry.js +4 -4
  231. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  232. package/dist/esm/salla-tooltip.entry.js +2 -2
  233. package/dist/esm/salla-trust-badges.entry.js +1 -1
  234. package/dist/esm/salla-user-menu.entry.js +1 -1
  235. package/dist/esm/salla-user-profile.entry.js +1 -1
  236. package/dist/esm/salla-user-settings.entry.js +2 -2
  237. package/dist/esm/salla-verify.entry.js +3 -3
  238. package/dist/esm/salla-wallet.entry.js +1 -1
  239. package/dist/esm/salla-wishlist-actions.entry.js +327 -0
  240. package/dist/esm/{tracked-promise-DJMfgq3q.js → tracked-promise-CTcAqNfZ.js} +1 -1
  241. package/dist/esm/twilight.js +3 -3
  242. package/dist/esm/{vanilla-picker-BZ3Kpnm6.js → vanilla-picker-DfeK45Yv.js} +1 -1
  243. package/dist/twilight/{p-7a144cce.entry.js → p-07af3286.entry.js} +1 -1
  244. package/dist/twilight/{p-08fa3250.entry.js → p-08337b2b.entry.js} +1 -1
  245. package/dist/twilight/{p-c4a2f0c4.entry.js → p-08771dff.entry.js} +1 -1
  246. package/dist/twilight/{p-63b6ff19.entry.js → p-0e1bab4f.entry.js} +1 -1
  247. package/dist/twilight/{p-a94c8805.entry.js → p-0eadca17.entry.js} +1 -1
  248. package/dist/twilight/{p-92ecbfb3.entry.js → p-12ccc1ab.entry.js} +1 -1
  249. package/dist/twilight/{p-d1be0cf0.entry.js → p-1574176e.entry.js} +1 -1
  250. package/dist/twilight/{p-b1c9125f.entry.js → p-17015f9c.entry.js} +1 -1
  251. package/dist/twilight/{p-f4326883.entry.js → p-1920b702.entry.js} +1 -1
  252. package/dist/twilight/{p-65cc4abf.entry.js → p-1a1cebfa.entry.js} +1 -1
  253. package/dist/twilight/{p-b22966df.entry.js → p-1a844fda.entry.js} +1 -1
  254. package/dist/twilight/{p-1beccaa5.entry.js → p-1b7ebf47.entry.js} +1 -1
  255. package/dist/twilight/{p-999abe04.entry.js → p-223d7ceb.entry.js} +1 -1
  256. package/dist/twilight/{p-b99ecd2c.entry.js → p-255f5d2a.entry.js} +1 -1
  257. package/dist/twilight/{p-077c5ae5.entry.js → p-266f57de.entry.js} +1 -1
  258. package/dist/twilight/p-28bdf8ec.entry.js +4 -0
  259. package/dist/twilight/{p-089507be.entry.js → p-2c7086ec.entry.js} +1 -1
  260. package/dist/twilight/{p-fe6a634f.entry.js → p-2c7f524a.entry.js} +1 -1
  261. package/dist/twilight/{p-ac91aa4f.entry.js → p-30ea9a82.entry.js} +1 -1
  262. package/dist/twilight/{p-0beaf6f8.entry.js → p-313d38cd.entry.js} +1 -1
  263. package/dist/twilight/{p-70658c1a.entry.js → p-315ce27b.entry.js} +1 -1
  264. package/dist/twilight/p-378d45e2.entry.js +4 -0
  265. package/dist/twilight/{p-96489529.entry.js → p-3c2fe8cd.entry.js} +1 -1
  266. package/dist/twilight/{p-3b416cdd.entry.js → p-3d1e7982.entry.js} +1 -1
  267. package/dist/twilight/{p-7e0bfa67.entry.js → p-3d7c0ac6.entry.js} +1 -1
  268. package/dist/twilight/{p-3e9fb046.entry.js → p-3d8d289e.entry.js} +1 -1
  269. package/dist/twilight/{p-c5b5162c.entry.js → p-4144c908.entry.js} +1 -1
  270. package/dist/twilight/{p-f4a5521e.entry.js → p-453a7bb2.entry.js} +1 -1
  271. package/dist/twilight/{p-7a238d37.entry.js → p-4c457ba5.entry.js} +1 -1
  272. package/dist/twilight/{p-d33fe4fe.entry.js → p-4d3bcacd.entry.js} +1 -1
  273. package/dist/twilight/{p-53c1a65f.entry.js → p-4dedb514.entry.js} +1 -1
  274. package/dist/twilight/{p-eebe55bd.entry.js → p-50dfec0a.entry.js} +1 -1
  275. package/dist/twilight/{p-72627a5b.entry.js → p-53f83426.entry.js} +1 -1
  276. package/dist/twilight/{p-20bed966.entry.js → p-54e9ac89.entry.js} +1 -1
  277. package/dist/twilight/{p-20b24e22.entry.js → p-571b8e00.entry.js} +1 -1
  278. package/dist/twilight/{p-7e0f8832.entry.js → p-5a5057a8.entry.js} +1 -1
  279. package/dist/twilight/{p-5817d5db.entry.js → p-5a9b94f8.entry.js} +1 -1
  280. package/dist/twilight/{p-ac2979bf.entry.js → p-5c1c520a.entry.js} +1 -1
  281. package/dist/twilight/{p-649cca57.entry.js → p-5d06fe77.entry.js} +1 -1
  282. package/dist/twilight/{p-eb7e08dd.entry.js → p-5e433652.entry.js} +1 -1
  283. package/dist/twilight/{p-c605f897.entry.js → p-6046666d.entry.js} +1 -1
  284. package/dist/twilight/{p-ace778dd.entry.js → p-67e23040.entry.js} +1 -1
  285. package/dist/twilight/{p-0c721c37.entry.js → p-6c777951.entry.js} +1 -1
  286. package/dist/twilight/{p-aaf77847.entry.js → p-749dbf27.entry.js} +1 -1
  287. package/dist/twilight/p-7bd464f3.entry.js +4 -0
  288. package/dist/twilight/{p-88a26183.entry.js → p-7ffc1711.entry.js} +1 -1
  289. package/dist/twilight/{p-173638ad.entry.js → p-83b6c374.entry.js} +1 -1
  290. package/dist/twilight/{p-83f3fe92.entry.js → p-8b5d26d3.entry.js} +1 -1
  291. package/dist/twilight/{p-46efd843.entry.js → p-9a0514dd.entry.js} +1 -1
  292. package/dist/twilight/{p-a8a43d8f.entry.js → p-9ba953ab.entry.js} +1 -1
  293. package/dist/twilight/{p-BhwNzoAX.js → p-BGpAIcg-.js} +1 -1
  294. package/dist/twilight/{p-DqcHIrMk.js → p-BHkz1ssL.js} +1 -1
  295. package/dist/twilight/{p-DCiLQw-U.js → p-BZhp8a87.js} +1 -1
  296. package/dist/twilight/{p-1GhsZ-y0.js → p-Bo1nXenO.js} +1 -1
  297. package/dist/twilight/{p-B8tpOftS.js → p-BojnM4VS.js} +1 -1
  298. package/dist/twilight/{p-CzKuXgcx.js → p-CBU9I-zy.js} +1 -1
  299. package/dist/twilight/{p-BPrbqbi4.js → p-CGd7EQZr.js} +1 -1
  300. package/dist/twilight/p-D01LipFK.js +9 -0
  301. package/dist/twilight/{p-B4SEH_Fg.js → p-D2yBy7Jh.js} +2 -2
  302. package/dist/twilight/{p-Bol9M57m.js → p-DSgSJMud.js} +2 -2
  303. package/dist/twilight/{p-DLNIOD9t.js → p-DzAIgzdz.js} +1 -1
  304. package/dist/twilight/{p-26ff2da1.entry.js → p-a0d88c4d.entry.js} +1 -1
  305. package/dist/twilight/{p-7f8b4a78.entry.js → p-a2b53a52.entry.js} +1 -1
  306. package/dist/twilight/{p-c360bc76.entry.js → p-a3e1fafc.entry.js} +1 -1
  307. package/dist/twilight/{p-204b9c34.entry.js → p-a463d567.entry.js} +1 -1
  308. package/dist/twilight/{p-39e531f4.entry.js → p-a6a9e398.entry.js} +1 -1
  309. package/dist/twilight/{p-5a8e7bb9.entry.js → p-a79f60e6.entry.js} +1 -1
  310. package/dist/twilight/{p-36528e88.entry.js → p-aadfd70e.entry.js} +1 -1
  311. package/dist/twilight/{p-7dc4a6ce.entry.js → p-ad0a27e2.entry.js} +1 -1
  312. package/dist/twilight/{p-2a1c12f9.entry.js → p-ae8bd2e7.entry.js} +1 -1
  313. package/dist/twilight/{p-50b92803.entry.js → p-af121bbf.entry.js} +1 -1
  314. package/dist/twilight/p-b0f28806.entry.js +4 -0
  315. package/dist/twilight/{p-7c46d055.entry.js → p-b3f6b725.entry.js} +1 -1
  316. package/dist/twilight/{p-e0e8b5ee.entry.js → p-b7e720e8.entry.js} +1 -1
  317. package/dist/twilight/{p-19748525.entry.js → p-b80016c8.entry.js} +1 -1
  318. package/dist/twilight/{p-19afb593.entry.js → p-c0f40eea.entry.js} +1 -1
  319. package/dist/twilight/p-c4bc10c1.entry.js +4 -0
  320. package/dist/twilight/{p-6bf44c4f.entry.js → p-c637b6bb.entry.js} +1 -1
  321. package/dist/twilight/{p-afb4ffe9.entry.js → p-c6e18746.entry.js} +1 -1
  322. package/dist/twilight/{p-a0433089.entry.js → p-cb855cb3.entry.js} +1 -1
  323. package/dist/twilight/{p-88c110ae.entry.js → p-cbc44b3e.entry.js} +1 -1
  324. package/dist/twilight/{p-d98c3e96.entry.js → p-cbf547f0.entry.js} +1 -1
  325. package/dist/twilight/{p-78cc1984.entry.js → p-cebad615.entry.js} +1 -1
  326. package/dist/twilight/{p-0abda719.entry.js → p-cfd910a8.entry.js} +1 -1
  327. package/dist/twilight/{p-a366dff0.entry.js → p-d0a8b9be.entry.js} +1 -1
  328. package/dist/twilight/{p-921b23fc.entry.js → p-d0cae7da.entry.js} +1 -1
  329. package/dist/twilight/{p-47df8f81.entry.js → p-d861eea6.entry.js} +1 -1
  330. package/dist/twilight/p-daa9c0b3.entry.js +4 -0
  331. package/dist/twilight/{p-7310af57.entry.js → p-db43fa93.entry.js} +1 -1
  332. package/dist/twilight/{p-83beb2f7.entry.js → p-e06a7e19.entry.js} +1 -1
  333. package/dist/twilight/{p-6fb05a50.entry.js → p-e34f68e0.entry.js} +1 -1
  334. package/dist/twilight/{p-5647ab30.entry.js → p-e4cac2a9.entry.js} +1 -1
  335. package/dist/twilight/{p-9f817867.entry.js → p-e5de1833.entry.js} +1 -1
  336. package/dist/twilight/{p-61bbcb2e.entry.js → p-e80ee5b0.entry.js} +2 -2
  337. package/dist/twilight/{p-42523f08.entry.js → p-e8ffc069.entry.js} +1 -1
  338. package/dist/twilight/{p-1027f1df.entry.js → p-ee8c7a5a.entry.js} +1 -1
  339. package/dist/twilight/{p-6667d7e9.entry.js → p-f0dedf42.entry.js} +1 -1
  340. package/dist/twilight/{p-fc2c74e3.entry.js → p-f3a01895.entry.js} +1 -1
  341. package/dist/twilight/{p-e0bafef7.entry.js → p-fb56a444.entry.js} +1 -1
  342. package/dist/twilight/{p-02dac67d.entry.js → p-fe1bced4.entry.js} +1 -1
  343. package/dist/twilight/{p-Cip0ZIcP.js → p-paiaALkJ.js} +1 -1
  344. package/dist/twilight/{p-BNurXH-d.js → p-xz8gqXL9.js} +1 -1
  345. package/dist/twilight/twilight.esm.js +1 -1
  346. package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +16 -0
  347. package/dist/types/components/salla-gifting/gift-schema.d.ts +4 -0
  348. package/dist/types/components/salla-gifting/salla-gifting.d.ts +4 -1
  349. package/dist/types/components/salla-login-modal/salla-login-modal.d.ts +2 -0
  350. package/dist/types/components/salla-product-options/salla-product-options.d.ts +0 -11
  351. package/dist/types/components/salla-products-list/salla-products-list.d.ts +60 -6
  352. package/dist/types/components/salla-social-share/salla-social-share.d.ts +39 -2
  353. package/dist/types/components/salla-wishlist-actions/salla-wishlist-actions.d.ts +93 -0
  354. package/dist/types/components.d.ts +172 -18
  355. package/package.json +5 -5
  356. package/dist/twilight/p-6020ddec.entry.js +0 -4
  357. package/dist/twilight/p-645254eb.entry.js +0 -4
  358. package/dist/twilight/p-99a57ad1.entry.js +0 -4
  359. package/dist/twilight/p-BnjD0Cne.js +0 -9
  360. package/dist/twilight/p-b3456579.entry.js +0 -4
  361. package/dist/twilight/p-d19c0be3.entry.js +0 -4
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-DTSWXcbN.js');
6
+ var index = require('./index-CXr_39D8.js');
7
7
 
8
8
  function _mergeNamespaces(n, m) {
9
9
  m.forEach(function (e) {
@@ -122,7 +122,8 @@
122
122
  "components/salla-user-profile/salla-user-profile.js",
123
123
  "components/salla-user-settings/salla-user-settings.js",
124
124
  "components/salla-verify/salla-verify.js",
125
- "components/salla-wallet/salla-wallet.js"
125
+ "components/salla-wallet/salla-wallet.js",
126
+ "components/salla-wishlist-actions/salla-wishlist-actions.js"
126
127
  ],
127
128
  "compiler": {
128
129
  "name": "@stencil/core",
@@ -6,6 +6,8 @@ import { bulletDeliveryAPI, clearApiCache, isSaudiArabia } from "./api-service";
6
6
  import { buildAddressLocationPayloadFromSelection, filterBranches, findNearestBranch, formatWorkingHoursDisplay, getBranchFirstSlot, getGeolocationErrorMessage, getIntentBranchId, getIntentCityId, getIntentCountryCode, getIntentCountryId, getIntentDistrictId, getIntentLatitude, getIntentLongitude, getIntentRegionId, getIntentSubtitle, hasSessionAddressIntent, requireRegionAndDistrictForSA, } from "./helpers";
7
7
  const BRANCH_SEARCH_DEBOUNCE_MS = 1000;
8
8
  const GEOLOCATION_TIMEOUT = 10000;
9
+ /** Final fallback center used only if `user.default_geo_location` is absent (Riyadh — matches checkout map-page). */
10
+ const DEFAULT_MAP_CENTER = { lat: 24.7756042, lng: 46.7360729 };
9
11
  import { load } from "@salla.sa/ui-google-map-render";
10
12
  import "@salla.sa/ui-google-map-render";
11
13
  import GetDirections from "../../assets/svg/get-directions.svg";
@@ -64,6 +66,8 @@ export class SallaBulletDelivery {
64
66
  /** True after saved addresses have been loaded (lazy: only when address tab is shown). */
65
67
  this.savedAddressesLoaded = false;
66
68
  this.gmapRef = null;
69
+ /** Guards against re-prompting for geolocation each time the map (re)initializes within one flow. */
70
+ this.autoGeolocationTriggered = false;
67
71
  // Core state
68
72
  this.activeTab = "address";
69
73
  this.isLoggedIn = false;
@@ -205,6 +209,8 @@ export class SallaBulletDelivery {
205
209
  shortAddress: detail.place?.placeId ?? detail.place?.place_id ?? undefined,
206
210
  formattedAddress: detail.place?.formattedAddress ?? detail.place?.formatted_address ?? undefined,
207
211
  };
212
+ // Bias autocomplete results toward the currently selected location.
213
+ this.updateLocationBias();
208
214
  setTimeout(() => {
209
215
  const marker = this.gmapRef?.locationMarker;
210
216
  if (marker)
@@ -216,6 +222,25 @@ export class SallaBulletDelivery {
216
222
  if (this.gmapRef && typeof this.gmapRef.resize === 'function') {
217
223
  this.gmapRef.resize();
218
224
  }
225
+ this.updateLocationBias();
226
+ // Auto-locate the customer so the map never opens "empty" — matches checkout map-page
227
+ // (getCurrentLocation(true) pans to the resolved position). Skip if a location is already set
228
+ // (e.g. returning from the confirm step). Falls back silently to mapInitialCenter if denied.
229
+ if (!this.autoGeolocationTriggered && !this.hasMapLocation() && this.gmapRef) {
230
+ const getCurrentLocation = this.gmapRef.getCurrentLocation;
231
+ if (typeof getCurrentLocation === 'function') {
232
+ this.autoGeolocationTriggered = true;
233
+ try {
234
+ const result = getCurrentLocation.call(this.gmapRef, true);
235
+ if (result && typeof result.catch === 'function') {
236
+ result.catch((err) => log('Auto geolocation failed', err));
237
+ }
238
+ }
239
+ catch (err) {
240
+ log('Auto geolocation threw', err);
241
+ }
242
+ }
243
+ }
219
244
  };
220
245
  /**
221
246
  * Submit add-address form: create address via API then switch back to list.
@@ -339,6 +364,9 @@ export class SallaBulletDelivery {
339
364
  get isRequired() {
340
365
  return !!Salla.config.get("store.settings.bullet_delivery.settings.is_required");
341
366
  }
367
+ get isSupportsDelivery() {
368
+ return !!Salla.config.get("store.settings.bullet_delivery.supports_delivery");
369
+ }
342
370
  get isMobileApp() {
343
371
  return Salla.config.isMobileApp();
344
372
  }
@@ -447,6 +475,7 @@ export class SallaBulletDelivery {
447
475
  }
448
476
  resetState() {
449
477
  this.viewMode = "main";
478
+ this.autoGeolocationTriggered = false;
450
479
  this.selectedCountry = null;
451
480
  this.selectedRegion = null;
452
481
  this.selectedCity = null;
@@ -524,12 +553,27 @@ export class SallaBulletDelivery {
524
553
  // only when it represents a valid session-style address.
525
554
  return hasSessionAddressIntent(intent);
526
555
  }
556
+ /**
557
+ * Whether the store still supports the delivery method captured in a stored
558
+ * intent. Shared by the cart pill and the cart-submit gate so an unsupported
559
+ * method (e.g. a remembered delivery address in a now pickup-only store) is
560
+ * never treated as a valid/complete selection.
561
+ */
562
+ isIntentMethodSupported(intent) {
563
+ if (intent.type === "branch")
564
+ return this.supportsPickup;
565
+ if (intent.type === "address")
566
+ return this.isSupportsDelivery;
567
+ return false;
568
+ }
527
569
  hasCompleteIntentForLoggedInUser() {
528
570
  if (this.isGuestUser())
529
571
  return false;
530
572
  const intent = this.getStoredIntent();
531
573
  if (!intent)
532
574
  return false;
575
+ if (!this.isIntentMethodSupported(intent))
576
+ return false;
533
577
  if (intent.type === "address")
534
578
  return !!intent.address_id;
535
579
  if (intent.type === "branch")
@@ -1107,6 +1151,7 @@ export class SallaBulletDelivery {
1107
1151
  async handleAddNewAddress() {
1108
1152
  this.viewMode = "add-address";
1109
1153
  this.mapLocationData = null;
1154
+ this.autoGeolocationTriggered = false;
1110
1155
  this.fetchAddressToken();
1111
1156
  const intent = this.getStoredIntent();
1112
1157
  const sessionCountryId = getIntentCountryId(intent);
@@ -1129,6 +1174,7 @@ export class SallaBulletDelivery {
1129
1174
  this.mapLocationData = null;
1130
1175
  this.mapStep = 'map';
1131
1176
  this.addressDescription = '';
1177
+ this.autoGeolocationTriggered = false;
1132
1178
  }
1133
1179
  // ─── Map methods ───
1134
1180
  async fetchAddressToken() {
@@ -1153,6 +1199,15 @@ export class SallaBulletDelivery {
1153
1199
  this.loadingToken = false;
1154
1200
  }
1155
1201
  }
1202
+ /** Bias autocomplete toward the current selection (or the initial center) — mirrors checkout's map-page. */
1203
+ updateLocationBias() {
1204
+ if (!this.gmapRef)
1205
+ return;
1206
+ const center = this.hasMapLocation()
1207
+ ? { lat: this.mapLocationData.lat, lng: this.mapLocationData.lng }
1208
+ : this.mapInitialCenter;
1209
+ this.gmapRef.autocompleteLocationBias = { center, radius: 500000 };
1210
+ }
1156
1211
  hasMapLocation() {
1157
1212
  return this.mapLocationData?.lat != null && this.mapLocationData?.lng != null;
1158
1213
  }
@@ -1163,6 +1218,27 @@ export class SallaBulletDelivery {
1163
1218
  get isMapModeAvailable() {
1164
1219
  return this.isMapSettingEnabled && !!salla.config.get('store.settings.keys.maps') && !!this.addressToken;
1165
1220
  }
1221
+ /** Center shown before geolocation resolves — the customer's IP-based default (falls back to Riyadh). */
1222
+ get mapInitialCenter() {
1223
+ const geo = salla.config.get('user.default_geo_location');
1224
+ // Coerce defensively: config may arrive as strings, blank/whitespace, NaN, or out-of-range
1225
+ // values. Reject blanks before coercion (Number('') === 0) and validate lat/lng ranges so we
1226
+ // never feed (0,0) or an invalid point to the map; otherwise fall back to the default center.
1227
+ const lat = this.toCoordinate(geo?.lat);
1228
+ const lng = this.toCoordinate(geo?.lng);
1229
+ const isValid = lat != null && lng != null &&
1230
+ lat >= -90 && lat <= 90 && lng >= -180 && lng <= 180;
1231
+ return isValid ? { lat, lng } : DEFAULT_MAP_CENTER;
1232
+ }
1233
+ /** Parse a config coordinate to a finite number, treating blank/whitespace strings as missing. */
1234
+ toCoordinate(value) {
1235
+ if (typeof value === 'string' && value.trim() === '')
1236
+ return null;
1237
+ if (value == null)
1238
+ return null;
1239
+ const num = Number(value);
1240
+ return Number.isFinite(num) ? num : null;
1241
+ }
1166
1242
  // ─── End Map methods ───
1167
1243
  /**
1168
1244
  * Build address/location payload from guest-form state (same fields as add-address).
@@ -1733,10 +1809,10 @@ export class SallaBulletDelivery {
1733
1809
  getCartViewConfig(intent) {
1734
1810
  if (!intent || !Salla.url.is_page("cart"))
1735
1811
  return null;
1812
+ if (!this.isIntentMethodSupported(intent))
1813
+ return null;
1736
1814
  const isBranch = intent.type === "branch";
1737
1815
  const isAddress = intent.type === "address";
1738
- if ((isBranch && !this.supportsPickup) || (!isBranch && !isAddress))
1739
- return null;
1740
1816
  return {
1741
1817
  title: isBranch
1742
1818
  ? Salla.lang.get("pages.checkout.pickup_option")
@@ -1786,13 +1862,15 @@ export class SallaBulletDelivery {
1786
1862
  return wrapper;
1787
1863
  }
1788
1864
  renderTabs() {
1789
- // Show tabs only when pickup is supported; otherwise delivery-only view with no tabs
1865
+ // Show tabs only when pickup is supported; otherwise delivery-only view with no tabs.
1866
+ // The pickup tab is gated by this same `supportsPickup` check, while the delivery
1867
+ // tab is shown only when bullet delivery supports delivery (`isSupportsDelivery`).
1790
1868
  if (!this.supportsPickup)
1791
1869
  return null;
1792
- return (h("div", { class: "s-bullet-delivery-tabs" }, h("button", { type: "button", class: {
1870
+ return (h("div", { class: "s-bullet-delivery-tabs" }, this.isSupportsDelivery && (h("button", { type: "button", class: {
1793
1871
  "s-bullet-delivery-tab": true,
1794
1872
  "s-bullet-delivery-tab--active": this.activeTab === "address",
1795
- }, onClick: () => this.handleTabChange("address") }, h("span", { class: "s-bullet-delivery-tab-icon", innerHTML: Location, "aria-hidden": "true" }), h("span", null, Salla.lang.get("mobile_app.strings.delivery"))), h("button", { type: "button", class: {
1873
+ }, onClick: () => this.handleTabChange("address") }, h("span", { class: "s-bullet-delivery-tab-icon", innerHTML: Location, "aria-hidden": "true" }), h("span", null, Salla.lang.get("mobile_app.strings.delivery")))), h("button", { type: "button", class: {
1796
1874
  "s-bullet-delivery-tab": true,
1797
1875
  "s-bullet-delivery-tab--active": this.activeTab === "branch",
1798
1876
  }, onClick: () => this.handleTabChange("branch") }, h("span", { class: "s-bullet-delivery-tab-icon", innerHTML: Store, "aria-hidden": "true" }), h("span", null, Salla.lang.get("mobile_app.strings.pickup")))));
@@ -1945,7 +2023,13 @@ export class SallaBulletDelivery {
1945
2023
  }
1946
2024
  renderMapSection() {
1947
2025
  const isSA = isSaudiArabia(this.selectedCountry?.code ?? '');
1948
- return (h("div", { class: "s-bullet-delivery-map-container" }, h("gmap-map", { ref: (el) => (this.gmapRef = el), zoom: 16, "map-id": "DEMO_MAP_ID", "enable-autocomplete": true, "enable-geolocation": true, "show-location-marker": true, language: Salla.lang.getLocale?.() ?? document.documentElement.lang ?? 'ar', "geolocation-button-label": Salla.lang.get('pages.checkout.current_location'), "autocomplete-placeholder": Salla.lang.get('pages.checkout.search_for_address'), "autocomplete-hint": isSA ? Salla.lang.get('pages.checkout.short_address_format_validation') : undefined, "autocomplete-country": this.selectedCountry?.code?.toLowerCase(), "autocomplete-resolve": false, "autocomplete-auth-token": this.addressToken, "location-marker-background": "#4285F4", "location-marker-border-color": "#1967D2", "location-marker-glyph-color": "#FFFFFF", "location-marker-scale": 1.3, "onGmap-location-changed": this.handleMapLocationChanged, "onGmap-ready": this.handleMapReady })));
2026
+ const loc = this.mapLocationData;
2027
+ const hasLoc = loc?.lat != null && loc?.lng != null;
2028
+ // Resolve the center once (the getter reads salla.config) and reuse it for the marker so the
2029
+ // map never opens "empty": before a selection the marker sits on the IP/Riyadh default and is
2030
+ // dragged/replaced once auto-geolocation or the user picks a real position.
2031
+ const center = hasLoc ? { lat: loc.lat, lng: loc.lng } : this.mapInitialCenter;
2032
+ return (h("div", { class: "s-bullet-delivery-map-container" }, h("gmap-map", { ref: (el) => (this.gmapRef = el), center: center, zoom: 16, "min-zoom": 4, "max-zoom": 21, "map-id": "DEMO_MAP_ID", "enable-autocomplete": true, "enable-geolocation": true, "show-location-marker": true, "location-marker-position": hasLoc ? { lat: loc.lat, lng: loc.lng, accuracy: 50 } : { ...center, accuracy: 50 }, language: Salla.lang.getLocale?.() ?? document.documentElement.lang ?? 'ar', "geolocation-button-label": Salla.lang.get('pages.checkout.current_location'), "autocomplete-placeholder": Salla.lang.get('pages.checkout.search_for_address'), "autocomplete-hint": isSA ? Salla.lang.get('pages.checkout.short_address_format_validation') : undefined, "autocomplete-country": this.selectedCountry?.code?.toLowerCase(), "autocomplete-resolve": false, "autocomplete-auth-token": this.addressToken, "location-marker-background": "#4285F4", "location-marker-border-color": "#1967D2", "location-marker-glyph-color": "#FFFFFF", "location-marker-scale": 1.3, "onGmap-location-changed": this.handleMapLocationChanged, "onGmap-ready": this.handleMapReady })));
1949
2033
  }
1950
2034
  renderAddressConfirmation() {
1951
2035
  const address = this.mapLocationData?.formattedAddress ?? '';
@@ -14,7 +14,7 @@ import Alert from "../../assets/svg/alert.svg";
14
14
  export class SallaGifting {
15
15
  constructor() {
16
16
  this.defaultEvent = "gifting:open";
17
- this.selectImageForYourGift = salla.lang.get('blocks.buy_as_gift.select_image_or_upload');
17
+ this.selectImageForYourGift = salla.lang.get('blocks.buy_as_gift.select_image_for_your_gift');
18
18
  this.currentStep = 1;
19
19
  this.showCalendar = false;
20
20
  this.showGiftText = false;
@@ -50,6 +50,7 @@ export class SallaGifting {
50
50
  this.timeZone = null;
51
51
  this.receiverCountryCode = salla.config.get('store.scope.countries')?.[0] || salla.config.get('store.store_country') || 'SA';
52
52
  this.hostId = `salla-gifting-${Math.random().toString(36).slice(2, 10)}`;
53
+ this.disableClass = this.gift?.show_image_upload ? '' : 'pointer-events-none';
53
54
  /**
54
55
  * The form selector to be used to get the form data
55
56
  */
@@ -175,6 +176,13 @@ export class SallaGifting {
175
176
  salla.event.dispatch('login::open', { withoutReload: true });
176
177
  return;
177
178
  }
179
+ this.currentStep = 1;
180
+ this.parentClass = 'is-current-step-1';
181
+ this.step2Animated = false;
182
+ this.selectedText = undefined;
183
+ this.selectedGiftTextOption = undefined;
184
+ this.uploadedImage = undefined;
185
+ this.selectedImage = undefined;
178
186
  await this.modal.open();
179
187
  // Determine the appropriate method to call based on the `physicalProducts` flag
180
188
  const giftDetailsMethod = this.productId ? () => salla.product.getGiftProductDetails(this.productId) : () => salla.cart.getGiftCartDetails();
@@ -182,6 +190,20 @@ export class SallaGifting {
182
190
  .then((response) => {
183
191
  this.gift = response.data;
184
192
  this.senderName = this.gift.sender_name;
193
+ this.disableClass = this.gift?.show_image_upload ? '' : 'pointer-events-none';
194
+ if (!this.gift.show_texts) {
195
+ this.selectedGiftTextOption = undefined;
196
+ this.selectedText = undefined;
197
+ }
198
+ if (!this.gift.show_images) {
199
+ this.selectedImage = undefined;
200
+ this.uploadedImage = undefined;
201
+ }
202
+ if (this.skipStep1()) {
203
+ this.currentStep = 2;
204
+ this.parentClass = 'is-current-step-2';
205
+ this.step2Animated = true;
206
+ }
185
207
  })
186
208
  .catch(e => {
187
209
  this.hasError = true;
@@ -189,6 +211,9 @@ export class SallaGifting {
189
211
  })
190
212
  .finally(() => this.modal.stopLoading());
191
213
  }
214
+ skipStep1() {
215
+ return !!this.gift && !this.gift.show_images && !this.gift.show_texts;
216
+ }
192
217
  /**
193
218
  *
194
219
  * Hide / close the gifting modal window
@@ -243,21 +268,12 @@ export class SallaGifting {
243
268
  *
244
269
  * Go to the step 2
245
270
  */
246
- async goToStep2() {
247
- if (!this.selectedGiftTextOption) {
248
- this.textSelect.classList.add('s-form-has-error');
249
- this.customTextArea.classList.remove('s-form-has-error');
271
+ async goToStep2(withValidation = true) {
272
+ if (!this.step1Elems)
250
273
  return;
251
- }
252
- else if (this.selectedGiftTextOption == 'custom' && !this.selectedText) {
253
- this.textSelect.classList.remove('s-form-has-error');
254
- this.customTextArea.classList.add('s-form-has-error');
274
+ if (withValidation && !this.validateStep1()) {
255
275
  return;
256
276
  }
257
- else {
258
- this.textSelect.classList.remove('s-form-has-error');
259
- this.customTextArea.classList.remove('s-form-has-error');
260
- }
261
277
  this.setWrapperHeight(2, 600, 0);
262
278
  let stepNextAnime = new anime.timeline();
263
279
  stepNextAnime.add({
@@ -290,6 +306,23 @@ export class SallaGifting {
290
306
  this.currentStep = 2;
291
307
  this.parentClass = `is-current-step-${this.currentStep}`;
292
308
  }
309
+ validateStep1() {
310
+ if (!this.gift?.show_texts)
311
+ return true;
312
+ if (!this.selectedGiftTextOption) {
313
+ this.textSelect?.classList.add('s-form-has-error');
314
+ this.customTextArea?.classList.remove('s-form-has-error');
315
+ return false;
316
+ }
317
+ else if (this.selectedGiftTextOption == 'custom' && !this.selectedText) {
318
+ this.textSelect?.classList.remove('s-form-has-error');
319
+ this.customTextArea?.classList.add('s-form-has-error');
320
+ return false;
321
+ }
322
+ this.textSelect?.classList.remove('s-form-has-error');
323
+ this.customTextArea?.classList.remove('s-form-has-error');
324
+ return true;
325
+ }
293
326
  /**
294
327
  *
295
328
  * Go to the step 1
@@ -332,7 +365,7 @@ export class SallaGifting {
332
365
  this.parentClass = `is-current-step-${this.currentStep}`;
333
366
  }
334
367
  getFilepondPlaceholder() {
335
- return `<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon">${Images}</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload ? this.selectImageOrUpload : ''}</p></div>`;
368
+ return `<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon">${Images}</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload && this.gift.show_image_upload ? this.selectImageOrUpload : this.selectImageForYourGift}</p></div>`;
336
369
  }
337
370
  setPreview(image) {
338
371
  this.uploader?.classList.add('has-bg');
@@ -342,7 +375,7 @@ export class SallaGifting {
342
375
  bg.style.backgroundImage = "url('" + image.url + "')";
343
376
  this.uploader?.querySelector('.filepond--root')?.appendChild(bg);
344
377
  this.uploadedImage = image.url;
345
- if (!!this.gift && this.gift.gift_images.length) {
378
+ if (!!this.gift && this.gift.gift_images?.length) {
346
379
  this.setWrapperHeight(1, 150, 0);
347
380
  }
348
381
  }
@@ -355,7 +388,7 @@ export class SallaGifting {
355
388
  }
356
389
  handleTextAreaChange(event) {
357
390
  this.selectedText = event.target.value;
358
- this.customTextArea.classList.remove('s-form-has-error');
391
+ this.customTextArea?.classList.remove('s-form-has-error');
359
392
  }
360
393
  clearError(key) {
361
394
  if (this.errors?.[key]) {
@@ -506,13 +539,13 @@ export class SallaGifting {
506
539
  }
507
540
  handleUploadImage(img) {
508
541
  this.uploadedImage = img;
509
- if (!!this.gift && this.gift.gift_images.length) {
542
+ if (!!this.gift && this.gift.gift_images?.length) {
510
543
  this.setWrapperHeight(1, 150, 0);
511
544
  }
512
545
  }
513
546
  handleRemoveImage() {
514
547
  this.uploadedImage = '';
515
- if (!!this.gift && this.gift.gift_images.length) {
548
+ if (!!this.gift && this.gift.gift_images?.length) {
516
549
  this.setWrapperHeight(1, 150, 0);
517
550
  }
518
551
  }
@@ -646,16 +679,18 @@ export class SallaGifting {
646
679
  }
647
680
  render() {
648
681
  return [
649
- h("div", { key: 'db700f9ec96a6974f3b815bb017ebe97ae8fe5c0' }, h("salla-list-tile", { key: '1e2fd1c0b375c85fcd4af1ea071c36879e6913c5', class: this.generateClass() }, h("div", { key: 'a9d02c933bc13bf8765e7e91ce08b2c9495954e5', slot: "title" }, this.vertical ? h("span", { innerHTML: GiftSharing }) : '', h("h3", { key: '56bd850368806c6ed5770ea5f6b0339749a77dfa' }, !!this.widgetTitle ? this.widgetTitle : this.sectionTitle)), h("div", { key: 'fbb4940fd3e3578f2f5a479d9d44be8dfbda7e43', slot: "subtitle" }, h("div", { key: 'fb7e8532984fbfc6fd61c55a6d44d7cdbb4bc9a2' }, !!this.widgetSubtitle ? this.widgetSubtitle : this.sectionSubtitle)), h("div", { key: '04f27f1ddbfa0b06be111b6c3176fbda5ea6d43a', slot: "action" }, h("salla-button", { key: 'fe71a1a773e5275ede7d1b3ea535c330688028b7', color: "primary", fill: "outline", width: "wide", class: "s-gifting-widget-action", onClick: () => this.handleGiftButtonClick() }, h("slot", { key: 'd62127d30254df2d8add55e0e1dbcfefb686e359', name: "widget-btn-content" }, h("div", { key: '5ddbb695af142baf3bb6986627f97a7a7607eb31', class: "s-gifting-widget-action-content" }, h("span", { key: '7820fb6abd9d7a9c1035c0f80191a3ff2a4c5fe8', innerHTML: GiftSharing }), " \u00A0", h("span", { key: '2cfc69862d3d087375efaed3bcec0ff0c1587989' }, this.sectionBtnText)))))), h("salla-modal", { key: '32c19391248ba6186f43fea59493171079e7bf07', id: this.hostId, isLoading: true, class: "s-gifting-modal", width: "sm", ref: modal => this.modal = modal }, h("div", { key: 'e4b5829416314f25793158dae0c530b8057b4085', slot: "loading" }, h("div", { key: '6ee873add5868f105b7ec7291c2a8c8fc033c588', class: "s-gifting-skeleton" }, h("div", { key: '40aae38f8b2d62b434394811a3ef6d8bc00f6f32', class: "s-gifting-modal-header" }, h("salla-skeleton", { key: 'a652cd74a16d0db662ea4a518ebfab366a3c3899', type: 'circle', height: '5rem', width: '5rem' }), h("h2", { key: 'edb4a1477893246e98207aeba7bfb5af686f20b9', class: "s-gifting-modal-title" }, h("div", { key: '83ef942b15450cc59ad32d8c5b3ba43a32bcb29c', class: "s-gifting-modal-badge-wrapper" }, h("salla-skeleton", { key: 'd9041c777a2fa0aa7ffc752958c7441916a02f85', height: '15px', width: '150px' })))), h("div", { key: 'fe3bb9dad01becba87486c4886037fd67b059919', class: "s-gifting-skeleton-content" }, h("salla-skeleton", { key: '08bd8304b66264b70f6df68e64da3560a1f75461', height: '10px', width: '150px' }), h("salla-skeleton", { key: 'bbea0d7ff0c846897af2ef5d3696b252a2f4e662', height: '230px' }), h("salla-skeleton", { key: '8cb1fde02e31a1accabd2e26409983e7ba56eeb1', height: '10px', width: '150px' }), h("salla-skeleton", { key: 'f80a986b953278bac41505506adf8d611566a167', height: '30px' }), h("salla-skeleton", { key: 'f7eccce69b619de385872642e1fb62b2cf6c3082', height: '40px' })))), h("slot", { key: 'd299e46040193b441f8171d05e0048849e3df8d5', name: "header" }), !!this.hasError ?
682
+ h("div", { key: '7872fb48bbc18682b2dffec6e45469ed1f348cd2' }, h("salla-list-tile", { key: 'c1885fdb40f33d203b857de13644f43964570f71', class: this.generateClass() }, h("div", { key: '77bd3860e23af43f088ee96b74901e2048baaafc', slot: "title" }, this.vertical ? h("span", { innerHTML: GiftSharing }) : '', h("h3", { key: '72e2e4d99b227b48bdd1f13866c3eea874139096' }, !!this.widgetTitle ? this.widgetTitle : this.sectionTitle)), h("div", { key: '63c219936015b9d5ee3a8102dbbce748ce0e62c5', slot: "subtitle" }, h("div", { key: '4f31a0c50120697a9b96a2b77411d74f4efc5e66' }, !!this.widgetSubtitle ? this.widgetSubtitle : this.sectionSubtitle)), h("div", { key: '47f0c995ad0f921a2fdca1c8e5f0e25d897e1fb0', slot: "action" }, h("salla-button", { key: '40145bed2bc9464279d1ae16a358b5a30d255ffd', color: "primary", fill: "outline", width: "wide", class: "s-gifting-widget-action", onClick: () => this.handleGiftButtonClick() }, h("slot", { key: 'd5620606453e0af1a5186f84fa12e1f4957a9747', name: "widget-btn-content" }, h("div", { key: '038ff62e726de1800907f8a8c136a434c7c6d036', class: "s-gifting-widget-action-content" }, h("span", { key: '4e785b4e17db238b6bfeb7646709006c9a4502bb', innerHTML: GiftSharing }), " \u00A0", h("span", { key: '5965ed90aeaf684db53d3241a9287de290f10b4a' }, this.sectionBtnText)))))), h("salla-modal", { key: 'b150b2b29f751fa4db3bfff17c4e617eb7b6db5d', id: this.hostId, isLoading: true, class: "s-gifting-modal", width: "sm", ref: modal => this.modal = modal }, h("div", { key: '57167453738915bb235da0bc44498f66daaa9454', slot: "loading" }, h("div", { key: 'fd0eab2fd0d46a76dcd00511ec05366862d86d2c', class: "s-gifting-skeleton" }, h("div", { key: '6d2bb659ca06a2cadf203d83e4f5966a78bc5f01', class: "s-gifting-modal-header" }, h("salla-skeleton", { key: 'cb47841822cf9fed5b5c20664617ac52bad135ce', type: 'circle', height: '5rem', width: '5rem' }), h("h2", { key: 'e9823fc0c00a326b495e4e7e6ff6567f03d1423e', class: "s-gifting-modal-title" }, h("div", { key: '584d50ba2c1bec0fb8e530418be60fc8a0b9c2d8', class: "s-gifting-modal-badge-wrapper" }, h("salla-skeleton", { key: '493b5e6f9fa7a1d45fa52a6f3f4602e5737b9632', height: '15px', width: '150px' })))), h("div", { key: 'd33d22031f8cd6084a1c177ada6657a89ff45ad8', class: "s-gifting-skeleton-content" }, h("salla-skeleton", { key: '792e91cdcd7ede6896653fa147124cfcdc649a9f', height: '10px', width: '150px' }), h("salla-skeleton", { key: '88ca984320729528e2a3e7cab350a96202a81da6', height: '230px' }), h("salla-skeleton", { key: 'fad81ac6972eaa37766cb489d175516249afb5e6', height: '10px', width: '150px' }), h("salla-skeleton", { key: 'a4e82c29d7940b7af14af4251cc6f97e811be99a', height: '30px' }), h("salla-skeleton", { key: '6339a34ffc0deb925f69b5b0a0ed540d986e0a0b', height: '40px' })))), h("slot", { key: '8fd7cad6fbc2d73fb770ae75301f327906817c6f', name: "header" }), !!this.hasError ?
650
683
  h("salla-placeholder", { alignment: "center" }, h("span", { slot: "title" }, this.errorMessage || salla.lang.get('common.errors.empty_results')), h("span", { slot: "description" }, " "))
651
684
  :
652
685
  [
653
- h("div", { class: "s-gifting-modal-header" }, h("span", { class: "s-gifting-modal-icon" }, h("span", { innerHTML: GiftSharing })), h("h2", { class: "s-gifting-modal-title" }, h("div", { class: "s-gifting-modal-badge-wrapper" }, h("div", { class: "s-gifting-modal-badge" }, h("span", null, h("span", null, this.currentStep), "/2")), h("span", null, this.giftDetails)))),
654
- h("div", { class: "s-gifting-steps-wrapper " + this.parentClass, ref: el => this.stepsWrapper = el }, h("div", { class: "s-gifting-step-one gift-step-1", ref: el => this.step1Elems = el }, h("div", { class: "s-gifting-modal-uploader-title anime-item" }, this.selectImageForYourGift), h("div", { class: "s-gifting-modal-uploader anime-item", ref: el => this.uploader = el }, h("span", { class: "s-gifting-remove-preview", onClick: () => this.removePreview(), innerHTML: Cancel }), this.selectImageOrUpload && h("salla-file-upload", { "instant-upload": true, name: "image_url", url: salla.url.api(salla.product.api.getUrl('giftImage')), onUploaded: event => this.handleUploadImage(event.detail), labelIdle: this.getFilepondPlaceholder(), onRemoved: () => this.handleRemoveImage() })), h("div", { class: "anime-item" }, !this.uploadedImage && !!this.gift && !!this.gift.gift_images && this.gift.gift_images.length > 0 ?
655
- h("salla-slider", { id: "gifting-slider", loop: false, "controls-outer": true, class: "s-gifting-slider", type: "carousel" }, h("div", { slot: "items" }, this.gift && this.gift.gift_images ?
656
- this.gift?.gift_images.map((item) => h("a", { class: "s-gifting-clickable s-gifting-image", onClick: () => this.setPreview(item) }, h("img", { style: { "width": "120px" }, src: item.url, alt: `${item.id}` }))) : ''))
657
- : ""), h("div", { class: "anime-item" }, h("div", { class: "s-form-group s-gifting-selectText", ref: el => this.textSelect = el }, h("select", { id: "gift-text-selection", name: "gift-text-selection", class: "s-form-control s-gifting-select", onChange: e => this.toggleGiftText(e) }, h("option", { "data-id": null, selected: true }, this.selectGiftMessage), this.gift && this.gift.gift_texts ?
658
- this.gift?.gift_texts.map((txt) => h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)) : '', h("option", { "data-id": "custom" }, this.giftCustomText))), h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide", ref: (el) => this.customTextArea = el }, h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), h("div", { class: "mt-1" }, h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))), h("div", { class: "anime-item" }, h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() }, h("span", null, this.nextStep)))), h("div", { class: "s-gifting-step-two gift-step-2", ref: el => this.step2Elems = el }, h("div", { class: this.step2ItemClass(this.errors?.['sender_name'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ?
686
+ h("div", { class: "s-gifting-modal-header" }, h("span", { class: "s-gifting-modal-icon" }, h("span", { innerHTML: GiftSharing })), h("h2", { class: "s-gifting-modal-title" }, h("div", { class: "s-gifting-modal-badge-wrapper" }, !this.skipStep1() && h("div", { class: "s-gifting-modal-badge" }, h("span", null, h("span", null, this.currentStep), "/2")), h("span", null, this.giftDetails)))),
687
+ h("div", { class: "s-gifting-steps-wrapper " + this.parentClass, ref: el => this.stepsWrapper = el }, !this.skipStep1() && h("div", { class: "s-gifting-step-one gift-step-1", ref: el => this.step1Elems = el }, h("div", { class: "s-gifting-modal-uploader-title anime-item" }, this.selectImageForYourGift), this.gift && this.gift.show_images &&
688
+ h("div", null, h("div", { class: `s-gifting-modal-uploader anime-item ${this.disableClass}`, ref: el => this.uploader = el }, h("span", { class: "s-gifting-remove-preview pointer-events-auto", onClick: () => this.removePreview(), innerHTML: Cancel }), this.selectImageOrUpload && this.gift && h("salla-file-upload", { "instant-upload": true, name: "image_url", url: salla.url.api(salla.product.api.getUrl('giftImage')), onUploaded: event => this.handleUploadImage(event.detail), labelIdle: this.getFilepondPlaceholder(), onRemoved: () => this.handleRemoveImage() })), h("div", { class: "anime-item" }, !this.uploadedImage && !!this.gift && !!this.gift.gift_images && this.gift.gift_images.length > 0 ?
689
+ h("salla-slider", { id: "gifting-slider", loop: false, "controls-outer": true, class: "s-gifting-slider", type: "carousel" }, h("div", { slot: "items" }, this.gift && this.gift.gift_images ?
690
+ this.gift?.gift_images.map((item) => h("a", { class: "s-gifting-clickable s-gifting-image", onClick: () => this.setPreview(item) }, h("img", { style: { "width": "120px" }, src: item.url, alt: `${item.id}` }))) : ''))
691
+ : "")), this.gift && this.gift.show_texts ?
692
+ h("div", { class: "anime-item" }, h("div", { class: "s-form-group s-gifting-selectText", ref: el => this.textSelect = el }, h("select", { id: "gift-text-selection", name: "gift-text-selection", class: "s-form-control s-gifting-select", onChange: e => this.toggleGiftText(e) }, h("option", { "data-id": null, selected: true }, this.selectGiftMessage), this.gift && this.gift.gift_texts ?
693
+ this.gift?.gift_texts.map((txt) => h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)) : '', this.gift && this.gift.show_custom_text ? h("option", { "data-id": "custom" }, this.giftCustomText) : null)), h("div", { class: this.showGiftText && this.gift && this.gift.show_custom_text ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide", ref: (el) => this.customTextArea = el }, h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), h("div", { class: "mt-1" }, h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))) : null, h("div", { class: "anime-item" }, h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2(!!this.gift?.show_texts) }, h("span", null, this.nextStep)))), h("div", { class: "s-gifting-step-two gift-step-2", style: this.skipStep1() ? { opacity: '1', transform: 'translateX(0)', position: 'relative' } : undefined, ref: el => this.step2Elems = el }, h("div", { class: this.step2ItemClass(this.errors?.['sender_name'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ?
659
694
  h("span", { class: "s-gifting-error" }, this.errors['sender_name']) : ''), h("div", { class: this.step2ItemClass(this.errors?.['receiver.name'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ?
660
695
  h("span", { class: "s-gifting-error" }, this.errors['receiver.name']) : ''), h("div", { class: this.step2ItemClass(this.errors?.['receiver.mobile'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ?
661
696
  h("span", { class: "s-gifting-error" }, this.errors['receiver.mobile']) : ''), this.isPhysical() &&
@@ -665,8 +700,8 @@ export class SallaGifting {
665
700
  h("span", { class: "s-gifting-error" }, this.errors['receiver.region']) : ''), this.isPhysical() &&
666
701
  h("div", { class: this.step2ItemClass(this.errors?.['receiver.city_id'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label", htmlFor: `${this.hostId}-city` }, this.receiverCityFieldLabel), h("salla-searchable-dropdown", { placeholder: this.selectCity, items: this.displayedCities, selectedItem: this.selectedCity, loading: this.loadingCities, searching: this.searchingCities, disabled: this.loadingCities || (this.isKSA && !this.selectedRegionId), required: true, inputId: `${this.hostId}-city`, searchQuery: this.citySearchQuery, clientSearch: !this.enableCityAjaxSearch, dropUp: true, keepParentScroll: true, onItemSelected: (e) => this.handleCitySelected(e.detail), onSearchInput: (e) => this.handleCitySearch(e.detail), onDropdownClosed: () => this.handleCityDropdownClosed() }), this.errors && this.errors['receiver.city_id'] ?
667
702
  h("span", { class: "s-gifting-error" }, this.errors['receiver.city_id']) : ''), this.isPhysical() &&
668
- h("div", { class: this.step2ItemClass('s-gifting-info') }, h("span", { innerHTML: Alert }), h("span", null, this.selectCityInfo)), !this.isPhysical() && h("div", { class: this.step2ItemClass() }, h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: `schedule-${this.hostId}` }, h("input", { type: "checkbox", name: 'schedule', id: `schedule-${this.hostId}`, onChange: () => this.toggleCalendar(), class: "s-checkbox" }), h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), h("div", { class: this.getCalendarClasses(), ref: (el) => this.calendarFormGroup = el }, h("label", { class: "s-form-label" }, this.selectSendDateAndTime), h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), h("div", { class: this.step2ItemClass('s-gifting-step-two-footer') }, h("a", { href: "#!", innerHTML: LeftArrow, onClick: (e) => this.goToStep1(e) }), h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, h("span", null, this.sendGift)))))
669
- ], h("slot", { key: 'bd8cd1628ed4282b177f0ddcd5fb93289c47b4d6', name: "footer" })))
703
+ h("div", { class: this.step2ItemClass('s-gifting-info') }, h("span", { innerHTML: Alert }), h("span", null, this.selectCityInfo)), !this.isPhysical() && h("div", { class: this.step2ItemClass() }, h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: `schedule-${this.hostId}` }, h("input", { type: "checkbox", name: 'schedule', id: `schedule-${this.hostId}`, onChange: () => this.toggleCalendar(), class: "s-checkbox" }), h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), h("div", { class: this.getCalendarClasses(), ref: (el) => this.calendarFormGroup = el }, h("label", { class: "s-form-label" }, this.selectSendDateAndTime), h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), h("div", { class: this.step2ItemClass('s-gifting-step-two-footer') }, !this.skipStep1() && h("a", { href: "#!", innerHTML: LeftArrow, onClick: (e) => this.goToStep1(e) }), h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, h("span", null, this.sendGift)))))
704
+ ], h("slot", { key: 'bdc014a95dab59f9f1e22f71741b5ba5f2ea3ee8', name: "footer" })))
670
705
  ];
671
706
  }
672
707
  static get is() { return "salla-gifting"; }
@@ -887,6 +922,7 @@ export class SallaGifting {
887
922
  "receiverCountryCode": {},
888
923
  "receiverEmail": {},
889
924
  "hostId": {},
925
+ "disableClass": {},
890
926
  "receiverCity": {}
891
927
  };
892
928
  }
@@ -932,8 +968,12 @@ export class SallaGifting {
932
968
  },
933
969
  "goToStep2": {
934
970
  "complexType": {
935
- "signature": "() => Promise<void>",
936
- "parameters": [],
971
+ "signature": "(withValidation?: boolean) => Promise<void>",
972
+ "parameters": [{
973
+ "name": "withValidation",
974
+ "type": "boolean",
975
+ "docs": ""
976
+ }],
937
977
  "references": {
938
978
  "Promise": {
939
979
  "location": "global",
@@ -56,7 +56,8 @@ export class SallaLoginModal {
56
56
  }
57
57
  componentDidLoad() {
58
58
  window.addEventListener('message', (event) => {
59
- if (event.data.source != "login") {
59
+ // Trust only our login iframe/passkey popup at the accounts origin.
60
+ if (!this.isTrustedMessage(event) || event.data?.source != "login") {
60
61
  return;
61
62
  }
62
63
  if (!this.inline && !this.canRenderIframe) {
@@ -133,6 +134,8 @@ export class SallaLoginModal {
133
134
  return window.location.reload();
134
135
  }
135
136
  if (action === 'open_page') {
137
+ if (!this.isSafeUrl(value?.url))
138
+ return;
136
139
  return window.location.href = value.url;
137
140
  }
138
141
  if (action === 'open_passkey_page') {
@@ -245,6 +248,33 @@ export class SallaLoginModal {
245
248
  }
246
249
  withCartReset && Salla.cart.reset();
247
250
  }
251
+ // Accept postMessage only from our own login iframe/passkey popup at the accounts origin.
252
+ isTrustedMessage(event) {
253
+ const fromIframe = !!this.iframe && event.source === this.iframe.contentWindow;
254
+ const fromPasskey = !!this.createPassKey && event.source === this.createPassKey;
255
+ if (!fromIframe && !fromPasskey)
256
+ return false;
257
+ let origin;
258
+ try {
259
+ origin = new URL(salla.config.get('login.url', 'https://accounts.salla.com')).origin;
260
+ }
261
+ catch (e) {
262
+ origin = 'https://accounts.salla.com';
263
+ }
264
+ return event.origin === origin;
265
+ }
266
+ // Reject javascript:/data: and other non-http(s) navigation targets.
267
+ isSafeUrl(url) {
268
+ if (typeof url !== 'string' || !url)
269
+ return false;
270
+ try {
271
+ const { protocol } = new URL(url, location.href);
272
+ return protocol === 'https:' || protocol === 'http:';
273
+ }
274
+ catch (e) {
275
+ return false;
276
+ }
277
+ }
248
278
  sendMessageToIframe(message) {
249
279
  if (!this.iframe)
250
280
  return;
@@ -1,3 +0,0 @@
1
- .s-product-options-option-stock-out {
2
- opacity: 0.5;
3
- }