@salla.sa/twilight-components 2.14.592 → 2.14.594

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 (358) hide show
  1. package/dist/cjs/{apple-pay-order-options-B036Wu4O.js → apple-pay-order-options-CA8IYRTb.js} +1 -0
  2. package/dist/cjs/{filepond-YeXzkn77.js → filepond-DtGoIKEP.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-poster-BEU99tEc.js → filepond-plugin-file-poster-DMejMF1-.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-size-BSsf6VIk.js → filepond-plugin-file-validate-size-J_fE6OBS.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-type-BkxQQF1Y.js → filepond-plugin-file-validate-type-BpewyAzF.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-edit-h9C4LxoR.js → filepond-plugin-image-edit-DPNUTWCK.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-nDfSwZEM.js → filepond-plugin-image-exif-orientation-CZ6YRu70.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-C-FDU_4k.js → filepond-plugin-image-preview-CgV-oWXK.js} +1 -1
  9. package/dist/cjs/{index-DI5yx1uj.js → index-BziKkkwT.js} +21 -7
  10. package/dist/cjs/{intlTelInput-AgidDx18.js → intlTelInput-BLuZALMt.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 +116 -4
  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-applied-filters.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +10 -10
  21. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +286 -20
  24. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-comment-form_9.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-gifting.cjs.entry.js +2 -2
  42. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-notification-item_2.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-cancel.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  105. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  106. package/dist/cjs/salla-wishlist-summary.cjs.entry.js +1 -1
  107. package/dist/cjs/twilight.cjs.js +2 -2
  108. package/dist/cjs/{vanilla-picker-DLfPr_3c.js → vanilla-picker-36O-wrIX.js} +1 -1
  109. package/dist/collection/components/salla-add-product-button/salla-add-product-button.css +58 -36
  110. package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +116 -1
  111. package/dist/collection/components/salla-bullet-delivery/location-distance-warning.js +28 -0
  112. package/dist/collection/components/salla-bullet-delivery/location-icon.svg +26 -0
  113. package/dist/collection/components/salla-bullet-delivery/location-permission-notice.js +103 -0
  114. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.css +136 -0
  115. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +133 -19
  116. package/dist/collection/components/salla-order-options-modal/apple-pay-order-options.js +1 -1
  117. package/dist/collection/global/app.js +2 -0
  118. package/dist/collection/global/app.spec.ts +33 -0
  119. package/dist/collection/global/app.ts +2 -0
  120. package/dist/collection/global/chunk-errors.js +14 -0
  121. package/dist/collection/global/chunk-errors.spec.ts +47 -0
  122. package/dist/collection/global/chunk-errors.ts +13 -0
  123. package/dist/components/apple-pay-order-options.js +1 -1
  124. package/dist/components/index.js +15 -2
  125. package/dist/components/salla-add-product-button2.js +116 -2
  126. package/dist/components/salla-bullet-delivery.js +288 -20
  127. package/dist/components/salla-gifting.js +1 -1
  128. package/dist/components/salla-quick-buy2.js +1 -1
  129. package/dist/docs.json +29 -13
  130. package/dist/esm/{apple-pay-order-options-s0kn7yr8.js → apple-pay-order-options-BS2iQKah.js} +1 -1
  131. package/dist/esm/{filepond-C3uLKJlo.js → filepond-DZJO0NDO.js} +1 -1
  132. package/dist/esm/{filepond-plugin-file-poster-BNO8nuwN.js → filepond-plugin-file-poster-BGjhc2cd.js} +1 -1
  133. package/dist/esm/{filepond-plugin-file-validate-size-CMMYF-rL.js → filepond-plugin-file-validate-size-s9w1K7Bl.js} +1 -1
  134. package/dist/esm/{filepond-plugin-file-validate-type-DSYhKJ7B.js → filepond-plugin-file-validate-type-OfI6GFgP.js} +1 -1
  135. package/dist/esm/{filepond-plugin-image-edit-lJgRMQAo.js → filepond-plugin-image-edit-Cfselyr4.js} +1 -1
  136. package/dist/esm/{filepond-plugin-image-exif-orientation-B0tYK1GE.js → filepond-plugin-image-exif-orientation-ConUo4eP.js} +1 -1
  137. package/dist/esm/{filepond-plugin-image-preview-kWmnxhXu.js → filepond-plugin-image-preview-BJ4T10Ty.js} +1 -1
  138. package/dist/esm/{index-Bk24FlDL.js → index-Bxge4xib.js} +21 -7
  139. package/dist/esm/{intlTelInput-nODQyuq0.js → intlTelInput-B-IoM3ox.js} +1 -1
  140. package/dist/esm/loader.js +3 -3
  141. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  142. package/dist/esm/salla-accordion_6.entry.js +1 -1
  143. package/dist/esm/salla-add-product-button_5.entry.js +116 -4
  144. package/dist/esm/salla-advertisement.entry.js +1 -1
  145. package/dist/esm/salla-alert_2.entry.js +1 -1
  146. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  147. package/dist/esm/salla-applied-filters.entry.js +1 -1
  148. package/dist/esm/salla-apps-icons.entry.js +1 -1
  149. package/dist/esm/salla-attachment-view_9.entry.js +10 -10
  150. package/dist/esm/salla-badge.entry.js +1 -1
  151. package/dist/esm/salla-basket-gap.entry.js +1 -1
  152. package/dist/esm/salla-bullet-delivery_3.entry.js +286 -20
  153. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  154. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  155. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  156. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  157. package/dist/esm/salla-comment-factors.entry.js +1 -1
  158. package/dist/esm/salla-comment-form_9.entry.js +1 -1
  159. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  160. package/dist/esm/salla-contacts.entry.js +1 -1
  161. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  162. package/dist/esm/salla-count-down.entry.js +1 -1
  163. package/dist/esm/salla-custom-fields.entry.js +1 -1
  164. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  165. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  166. package/dist/esm/salla-filters-widget.entry.js +1 -1
  167. package/dist/esm/salla-filters.entry.js +1 -1
  168. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  169. package/dist/esm/salla-gift-card-redeem_2.entry.js +1 -1
  170. package/dist/esm/salla-gifting.entry.js +2 -2
  171. package/dist/esm/salla-hook.entry.js +1 -1
  172. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  173. package/dist/esm/salla-installment.entry.js +1 -1
  174. package/dist/esm/salla-list-tile.entry.js +1 -1
  175. package/dist/esm/salla-localization-modal.entry.js +1 -1
  176. package/dist/esm/salla-login-modal.entry.js +1 -1
  177. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  178. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  179. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  180. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  181. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  182. package/dist/esm/salla-loyalty.entry.js +1 -1
  183. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  184. package/dist/esm/salla-map_3.entry.js +1 -1
  185. package/dist/esm/salla-menu.entry.js +1 -1
  186. package/dist/esm/salla-metadata.entry.js +1 -1
  187. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  188. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  189. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  190. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  191. package/dist/esm/salla-notification-item_2.entry.js +1 -1
  192. package/dist/esm/salla-offer-modal.entry.js +1 -1
  193. package/dist/esm/salla-offer.entry.js +1 -1
  194. package/dist/esm/salla-order-branch.entry.js +1 -1
  195. package/dist/esm/salla-order-cancel.entry.js +1 -1
  196. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  197. package/dist/esm/salla-order-details-options.entry.js +1 -1
  198. package/dist/esm/salla-order-details.entry.js +1 -1
  199. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  200. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  201. package/dist/esm/salla-order-edit.entry.js +1 -1
  202. package/dist/esm/salla-order-options-modal.entry.js +1 -1
  203. package/dist/esm/salla-order-shipments.entry.js +1 -1
  204. package/dist/esm/salla-order-summary.entry.js +1 -1
  205. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  206. package/dist/esm/salla-orders.entry.js +1 -1
  207. package/dist/esm/salla-payments.entry.js +1 -1
  208. package/dist/esm/salla-placeholder.entry.js +1 -1
  209. package/dist/esm/salla-price-range.entry.js +1 -1
  210. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  211. package/dist/esm/salla-product-card.entry.js +1 -1
  212. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  213. package/dist/esm/salla-products-list.entry.js +1 -1
  214. package/dist/esm/salla-products-slider.entry.js +1 -1
  215. package/dist/esm/salla-quick-order.entry.js +1 -1
  216. package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
  217. package/dist/esm/salla-rating-modal.entry.js +1 -1
  218. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  219. package/dist/esm/salla-review-order-item.entry.js +1 -1
  220. package/dist/esm/salla-scopes.entry.js +1 -1
  221. package/dist/esm/salla-search-product-card.entry.js +1 -1
  222. package/dist/esm/salla-search.entry.js +1 -1
  223. package/dist/esm/salla-skeleton.entry.js +1 -1
  224. package/dist/esm/salla-social-share.entry.js +1 -1
  225. package/dist/esm/salla-social.entry.js +1 -1
  226. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  227. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  228. package/dist/esm/salla-trust-badges.entry.js +1 -1
  229. package/dist/esm/salla-user-menu.entry.js +1 -1
  230. package/dist/esm/salla-user-profile.entry.js +1 -1
  231. package/dist/esm/salla-user-settings.entry.js +1 -1
  232. package/dist/esm/salla-verify.entry.js +1 -1
  233. package/dist/esm/salla-wallet.entry.js +1 -1
  234. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  235. package/dist/esm/salla-wishlist-summary.entry.js +1 -1
  236. package/dist/esm/twilight.js +3 -3
  237. package/dist/esm/{vanilla-picker-B1bTUgHP.js → vanilla-picker-D1RSTlum.js} +1 -1
  238. package/dist/twilight/global/app.spec.ts +33 -0
  239. package/dist/twilight/global/app.ts +2 -0
  240. package/dist/twilight/global/chunk-errors.spec.ts +47 -0
  241. package/dist/twilight/global/chunk-errors.ts +13 -0
  242. package/dist/twilight/{p-68411931.entry.js → p-00cb1c25.entry.js} +1 -1
  243. package/dist/twilight/{p-be729ca2.entry.js → p-0835d9ab.entry.js} +1 -1
  244. package/dist/twilight/{p-5435dbcd.entry.js → p-09e56514.entry.js} +1 -1
  245. package/dist/twilight/{p-b6dc3e12.entry.js → p-0bbd0d06.entry.js} +1 -1
  246. package/dist/twilight/{p-2191d792.entry.js → p-0d464350.entry.js} +1 -1
  247. package/dist/twilight/{p-e7127704.entry.js → p-0e1a454b.entry.js} +1 -1
  248. package/dist/twilight/{p-0dc90c55.entry.js → p-106ea7ed.entry.js} +1 -1
  249. package/dist/twilight/{p-b1b096d7.entry.js → p-125482ce.entry.js} +1 -1
  250. package/dist/twilight/{p-9048520b.entry.js → p-15824030.entry.js} +1 -1
  251. package/dist/twilight/{p-612b6d87.entry.js → p-1769ead6.entry.js} +1 -1
  252. package/dist/twilight/{p-7b4a8237.entry.js → p-1b56374e.entry.js} +1 -1
  253. package/dist/twilight/{p-658de43b.entry.js → p-1d551b52.entry.js} +1 -1
  254. package/dist/twilight/{p-f5c9e513.entry.js → p-21d1a687.entry.js} +1 -1
  255. package/dist/twilight/{p-bb152b39.entry.js → p-22f21c95.entry.js} +1 -1
  256. package/dist/twilight/{p-4f76e9e2.entry.js → p-2510973e.entry.js} +1 -1
  257. package/dist/twilight/{p-6760ec19.entry.js → p-2c2f0608.entry.js} +1 -1
  258. package/dist/twilight/{p-7ff0c546.entry.js → p-2c8b8935.entry.js} +1 -1
  259. package/dist/twilight/{p-06643011.entry.js → p-2e5bace8.entry.js} +1 -1
  260. package/dist/twilight/{p-5f6a5a4b.entry.js → p-2ef59b30.entry.js} +1 -1
  261. package/dist/twilight/{p-f4f7ed38.entry.js → p-30b7383a.entry.js} +1 -1
  262. package/dist/twilight/{p-ce6c709b.entry.js → p-30f24d97.entry.js} +1 -1
  263. package/dist/twilight/{p-e2aa0e72.entry.js → p-3162901e.entry.js} +1 -1
  264. package/dist/twilight/{p-45035389.entry.js → p-34454493.entry.js} +1 -1
  265. package/dist/twilight/{p-f8f9c563.entry.js → p-35bc566f.entry.js} +1 -1
  266. package/dist/twilight/{p-b1b345d6.entry.js → p-35c0ca9a.entry.js} +1 -1
  267. package/dist/twilight/{p-c313bd11.entry.js → p-3e02b792.entry.js} +1 -1
  268. package/dist/twilight/{p-c3a2696b.entry.js → p-42162de9.entry.js} +1 -1
  269. package/dist/twilight/{p-c1d18b73.entry.js → p-4362756f.entry.js} +1 -1
  270. package/dist/twilight/{p-2fc68bfd.entry.js → p-4457a289.entry.js} +1 -1
  271. package/dist/twilight/{p-d9ccdd8f.entry.js → p-4543b3b3.entry.js} +1 -1
  272. package/dist/twilight/{p-3bf37615.entry.js → p-4cedf139.entry.js} +1 -1
  273. package/dist/twilight/{p-75f32b91.entry.js → p-51243641.entry.js} +1 -1
  274. package/dist/twilight/{p-f263bba9.entry.js → p-51e8c2b2.entry.js} +1 -1
  275. package/dist/twilight/{p-a0f1b867.entry.js → p-52012794.entry.js} +1 -1
  276. package/dist/twilight/{p-3e6f2bf8.entry.js → p-530b513d.entry.js} +1 -1
  277. package/dist/twilight/{p-e7ca6d06.entry.js → p-57097563.entry.js} +1 -1
  278. package/dist/twilight/{p-b95a6e20.entry.js → p-572a1f84.entry.js} +1 -1
  279. package/dist/twilight/{p-872d6d68.entry.js → p-59256d82.entry.js} +1 -1
  280. package/dist/twilight/{p-9e6f4ec4.entry.js → p-5b3a04cd.entry.js} +1 -1
  281. package/dist/twilight/p-614b7b61.entry.js +4 -0
  282. package/dist/twilight/{p-a057f532.entry.js → p-64c76ad9.entry.js} +1 -1
  283. package/dist/twilight/{p-dfd212d5.entry.js → p-66131771.entry.js} +1 -1
  284. package/dist/twilight/{p-6673a16f.entry.js → p-6b90f160.entry.js} +1 -1
  285. package/dist/twilight/{p-b5e774db.entry.js → p-6bfcdb38.entry.js} +1 -1
  286. package/dist/twilight/{p-c1d815c9.entry.js → p-6d3d5a0b.entry.js} +1 -1
  287. package/dist/twilight/{p-377642ea.entry.js → p-6e42d70f.entry.js} +1 -1
  288. package/dist/twilight/{p-6a76acd8.entry.js → p-6e57ff9f.entry.js} +1 -1
  289. package/dist/twilight/{p-91a1baf1.entry.js → p-751ff32d.entry.js} +1 -1
  290. package/dist/twilight/{p-42e02411.entry.js → p-78963d5d.entry.js} +1 -1
  291. package/dist/twilight/{p-a75680ae.entry.js → p-790ea507.entry.js} +1 -1
  292. package/dist/twilight/{p-eaae379c.entry.js → p-79bb0c41.entry.js} +1 -1
  293. package/dist/twilight/{p-1b1bebf6.entry.js → p-7ed0db2e.entry.js} +1 -1
  294. package/dist/twilight/{p-c9ebe466.entry.js → p-84308a79.entry.js} +1 -1
  295. package/dist/twilight/{p-43ca88d0.entry.js → p-8c229520.entry.js} +1 -1
  296. package/dist/twilight/{p-e58b7ef9.entry.js → p-94970458.entry.js} +1 -1
  297. package/dist/twilight/{p-ad52dcf7.entry.js → p-94e85b3c.entry.js} +1 -1
  298. package/dist/twilight/{p-f7ee4910.entry.js → p-988f6193.entry.js} +1 -1
  299. package/dist/twilight/{p-540029a5.entry.js → p-9f0459ec.entry.js} +1 -1
  300. package/dist/twilight/{p-BnmP7F4y.js → p-B5twlAuI.js} +1 -1
  301. package/dist/twilight/p-BS2iQKah.js +4 -0
  302. package/dist/twilight/{p-Ct18qgaq.js → p-BXAODWDa.js} +1 -1
  303. package/dist/twilight/{p-DvlAEiaH.js → p-BkWctmFE.js} +1 -1
  304. package/dist/twilight/{p-Bk24FlDL.js → p-Bxge4xib.js} +2 -2
  305. package/dist/twilight/{p-BvUmZYa9.js → p-CINox5XU.js} +1 -1
  306. package/dist/twilight/{p-B-LS1xDz.js → p-CWLJmpv-.js} +1 -1
  307. package/dist/twilight/{p-CHqh7vb6.js → p-DKEu8h4M.js} +1 -1
  308. package/dist/twilight/{p-CXo-IH2o.js → p-DnoH14HK.js} +1 -1
  309. package/dist/twilight/{p-CcGfWKIx.js → p-EiLe0Yi_.js} +1 -1
  310. package/dist/twilight/{p-DBjpz_eG.js → p-W-AkIawg.js} +1 -1
  311. package/dist/twilight/{p-b37ae926.entry.js → p-a37bc663.entry.js} +1 -1
  312. package/dist/twilight/{p-ced74b88.entry.js → p-a3a69984.entry.js} +1 -1
  313. package/dist/twilight/{p-42150f97.entry.js → p-a912d6a3.entry.js} +1 -1
  314. package/dist/twilight/{p-ed6ea140.entry.js → p-aa96807e.entry.js} +1 -1
  315. package/dist/twilight/{p-5fc75260.entry.js → p-aafa69d6.entry.js} +1 -1
  316. package/dist/twilight/{p-08256e67.entry.js → p-abfbba72.entry.js} +1 -1
  317. package/dist/twilight/{p-cd432c49.entry.js → p-b1dc78db.entry.js} +1 -1
  318. package/dist/twilight/{p-79676f24.entry.js → p-b2322278.entry.js} +1 -1
  319. package/dist/twilight/{p-21b3877b.entry.js → p-b3213fee.entry.js} +1 -1
  320. package/dist/twilight/{p-dc51993c.entry.js → p-b6918b2b.entry.js} +1 -1
  321. package/dist/twilight/{p-1d05ff72.entry.js → p-b8661b67.entry.js} +1 -1
  322. package/dist/twilight/{p-83ccddd5.entry.js → p-be3f6dbe.entry.js} +1 -1
  323. package/dist/twilight/{p-7038e1af.entry.js → p-bff2400f.entry.js} +1 -1
  324. package/dist/twilight/{p-b2c41e36.entry.js → p-c0274022.entry.js} +1 -1
  325. package/dist/twilight/{p-03dffb99.entry.js → p-c16b9f4a.entry.js} +1 -1
  326. package/dist/twilight/{p-38418821.entry.js → p-c476eaab.entry.js} +1 -1
  327. package/dist/twilight/{p-f9f0a5ee.entry.js → p-c4bf8d24.entry.js} +1 -1
  328. package/dist/twilight/p-c903b6bb.entry.js +4 -0
  329. package/dist/twilight/{p-0e122915.entry.js → p-d1e4e15e.entry.js} +1 -1
  330. package/dist/twilight/{p-523f9816.entry.js → p-d2e929bd.entry.js} +1 -1
  331. package/dist/twilight/{p-43c5ec34.entry.js → p-d38b5aaa.entry.js} +1 -1
  332. package/dist/twilight/{p-22135b7c.entry.js → p-d6d7c6a1.entry.js} +1 -1
  333. package/dist/twilight/{p-7750be26.entry.js → p-d9188e76.entry.js} +1 -1
  334. package/dist/twilight/{p-320d6b04.entry.js → p-db53740d.entry.js} +1 -1
  335. package/dist/twilight/{p-21802082.entry.js → p-df313b00.entry.js} +1 -1
  336. package/dist/twilight/{p-46721e68.entry.js → p-df407f01.entry.js} +1 -1
  337. package/dist/twilight/{p-4fd73440.entry.js → p-e19a980b.entry.js} +1 -1
  338. package/dist/twilight/{p-813a40cc.entry.js → p-e1b0dafc.entry.js} +1 -1
  339. package/dist/twilight/{p-d73307c7.entry.js → p-e7e52491.entry.js} +1 -1
  340. package/dist/twilight/{p-f74ccae4.entry.js → p-ebbb25fc.entry.js} +1 -1
  341. package/dist/twilight/{p-becb6580.entry.js → p-f046edd3.entry.js} +1 -1
  342. package/dist/twilight/{p-250262a9.entry.js → p-f22ec479.entry.js} +1 -1
  343. package/dist/twilight/{p-fbee9e50.entry.js → p-f4c94e30.entry.js} +1 -1
  344. package/dist/twilight/{p-02202feb.entry.js → p-fae38591.entry.js} +1 -1
  345. package/dist/twilight/{p-d601977e.entry.js → p-fb119c27.entry.js} +1 -1
  346. package/dist/twilight/{p-cc74d38b.entry.js → p-fd615606.entry.js} +1 -1
  347. package/dist/twilight/{p-b009d316.entry.js → p-fd6fc043.entry.js} +1 -1
  348. package/dist/twilight/twilight.esm.js +1 -1
  349. package/dist/types/components/salla-add-product-button/salla-add-product-button.d.ts +16 -0
  350. package/dist/types/components/salla-bullet-delivery/location-distance-warning.d.ts +12 -0
  351. package/dist/types/components/salla-bullet-delivery/location-permission-notice.d.ts +39 -0
  352. package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +31 -0
  353. package/dist/types/components/salla-order-options-modal/apple-pay-order-options.d.ts +2 -0
  354. package/dist/types/global/chunk-errors.d.ts +2 -0
  355. package/package.json +5 -5
  356. package/dist/twilight/p-07174244.entry.js +0 -4
  357. package/dist/twilight/p-f3ffe84f.entry.js +0 -4
  358. package/dist/twilight/p-s0kn7yr8.js +0 -4
@@ -5,6 +5,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
5
5
  import { P as PendingOrdersIcon } from './cart.js';
6
6
  import { H as Helper } from './Helper.js';
7
7
  import { i as injectFreeProductsIntoPayload, d as defineCustomElement$3, c as canCompleteApplePay, a as isApplePayHostedRedirect } from './salla-quick-buy2.js';
8
+ import { e as ensureOrderOptionsModal, a as appendOrderOptionsToPayload } from './apple-pay-order-options.js';
8
9
  import { d as defineCustomElement$h } from './salla-attachment-view2.js';
9
10
  import { d as defineCustomElement$g } from './salla-booking-field2.js';
10
11
  import { d as defineCustomElement$f } from './salla-button2.js';
@@ -257,7 +258,7 @@ class FastCheckoutGate {
257
258
  }
258
259
  }
259
260
 
260
- const sallaAddProductButtonCss = "/*!twlt*/:host{display:block}salla-add-product-button[width=wide]{width:100%}.sticky{position:sticky}.hidden{display:none}.w-full{width:100%}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-hidden{display:none}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.s-hidden{display:none}.s-add-product-button-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.s-add-product-button-with-quick-buy{display:flex}@media (min-width: 640px){.s-add-product-button-with-quick-buy{flex-direction:column}}.s-add-product-button-with-quick-buy:not(.s-add-product-button-with-sticky-bar){flex-direction:column !important}.s-add-product-button-main{display:flex;width:66.666667%;column-gap:0.375rem}@media (min-width: 640px){.s-add-product-button-main{width:100%;column-gap:0.625rem}}.s-add-product-button-with-sticky-bar salla-quick-buy{width:33.333333%}@media (min-width: 640px){.s-add-product-button-with-sticky-bar salla-quick-buy{width:100%}}.s-add-product-button-with-quick-buy:not(.s-add-product-button-with-sticky-bar) .s-add-product-button-main{width:100%}.s-add-product-button-with-quick-buy:not(.s-add-product-button-with-apple-pay) .s-add-product-button-main{width:100%}.s-add-product-button-main:not(.w-full)>salla-button{width:50% !important}.s-add-product-button-main .s-add-product-button-mini-checkout{--salla-fast-checkout-button-border-radius:.75rem;width:50%}.s-add-product-button-with-sticky-bar{width:100% !important}@media (min-width: 640px){.s-add-product-button-with-sticky-bar{width:auto}}.s-add-product-button-with-apple-pay{column-gap:0.375rem}@media (min-width: 640px){.s-add-product-button-with-apple-pay{column-gap:unset}}.s-add-product-button-with-apple-pay:not(.s-add-product-button-with-sticky-bar) salla-quick-buy apple-pay-button{margin-top:0.625rem}.s-add-product-button-with-sticky-bar salla-quick-buy .s-quick-buy-button .s-button-text span{display:none}@media (min-width: 768px){.s-add-product-button-with-sticky-bar salla-quick-buy .s-quick-buy-button .s-button-text span{display:block}}.s-add-product-button-mini-checkout-content{display:flex;flex-shrink:0;align-items:center;white-space:nowrap;font-size:.8rem}@media (min-width: 640px){.s-add-product-button-mini-checkout-content{font-size:0.875rem;line-height:1.25rem}}.s-add-product-button-mini-checkout-content:where([dir=\"rtl\"],[dir=\"rtl\"] *){flex-direction:row-reverse}.s-add-product-button-mini-checkout-content svg{margin-right:0.375rem;height:1rem;width:1rem;fill:currentColor}.s-add-product-button-mini-checkout-content svg:where([dir=\"rtl\"],[dir=\"rtl\"] *){margin-right:0px;margin-left:0.375rem}.s-add-product-button-busy{pointer-events:none;position:relative}.s-add-product-button-busy::after{position:absolute;top:50%;left:50%;z-index:10;height:1rem;width:1rem;--tw-translate-x:-50%;content:var(--tw-content);--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{content:var(--tw-content);transform:rotate(360deg)}}.s-add-product-button-busy::after{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;border-style:solid;border-top-color:var(--color-primary);border-left-color:var(--color-primary);border-bottom-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-border-opacity:1;border-right-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-content:'';content:var(--tw-content)}";
261
+ const sallaAddProductButtonCss = "/*!twlt*/:host{display:block}salla-add-product-button[width=wide]{width:100%}.s-add-product-button-buy-now{display:block;font-family:'PingARLT';font-weight:normal}.s-add-product-button-buy-now .s-fast-checkout-button{display:flex;align-items:center;justify-content:center;height:var(--salla-fast-checkout-button-height, 2.5rem);width:var(--salla-fast-checkout-button-width, 100%);border-radius:var(--salla-fast-checkout-button-border-radius, 0.375rem);font-size:0.875rem;font-weight:bold;text-transform:uppercase;cursor:pointer;transition:all 0.3s ease-in-out;border:none;font-family:'PingARLT';gap:5px;direction:ltr;border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse);padding:1px 6px;line-height:normal;letter-spacing:normal;outline:none}.s-add-product-button-buy-now .s-fast-checkout-button:focus-visible{outline:auto}.s-add-product-button-buy-now .s-fast-checkout-button:hover{background-color:var(--color-primary)}.s-add-product-button-buy-now .s-fast-checkout-button.outline{background-color:transparent;border:1px solid var(--color-primary);color:var(--color-primary)}.s-add-product-button-buy-now .s-fast-checkout-button.rtl{flex-direction:row-reverse}.s-add-product-button-buy-now .s-fast-checkout-button:disabled{cursor:progress;opacity:0.7}.sticky{position:sticky}.hidden{display:none}.w-full{width:100%}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-hidden{display:none}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.s-hidden{display:none}.s-add-product-button-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.s-add-product-button-with-quick-buy{display:flex}@media (min-width: 640px){.s-add-product-button-with-quick-buy{flex-direction:column}}.s-add-product-button-with-quick-buy:not(.s-add-product-button-with-sticky-bar){flex-direction:column !important}.s-add-product-button-main{display:flex;width:66.666667%;column-gap:0.375rem}@media (min-width: 640px){.s-add-product-button-main{width:100%;column-gap:0.625rem}}.s-add-product-button-with-sticky-bar salla-quick-buy{width:33.333333%}@media (min-width: 640px){.s-add-product-button-with-sticky-bar salla-quick-buy{width:100%}}.s-add-product-button-with-quick-buy:not(.s-add-product-button-with-sticky-bar) .s-add-product-button-main{width:100%}.s-add-product-button-with-quick-buy:not(.s-add-product-button-with-apple-pay) .s-add-product-button-main{width:100%}.s-add-product-button-main:not(.w-full)>salla-button{width:50% !important}.s-add-product-button-main .s-add-product-button-mini-checkout{--salla-fast-checkout-button-border-radius:.75rem;width:50%}.s-add-product-button-with-sticky-bar{width:100% !important}@media (min-width: 640px){.s-add-product-button-with-sticky-bar{width:auto}}.s-add-product-button-with-apple-pay{column-gap:0.375rem}@media (min-width: 640px){.s-add-product-button-with-apple-pay{column-gap:unset}}.s-add-product-button-with-apple-pay:not(.s-add-product-button-with-sticky-bar) salla-quick-buy apple-pay-button{margin-top:0.625rem}.s-add-product-button-with-sticky-bar salla-quick-buy .s-quick-buy-button .s-button-text span{display:none}@media (min-width: 768px){.s-add-product-button-with-sticky-bar salla-quick-buy .s-quick-buy-button .s-button-text span{display:block}}.s-add-product-button-mini-checkout-content{display:flex;flex-shrink:0;align-items:center;white-space:nowrap;font-size:.8rem}@media (min-width: 640px){.s-add-product-button-mini-checkout-content{font-size:0.875rem;line-height:1.25rem}}.s-add-product-button-mini-checkout-content:where([dir=\"rtl\"],[dir=\"rtl\"] *){flex-direction:row-reverse}.s-add-product-button-mini-checkout-content svg{margin-right:0.375rem;height:1rem;width:1rem;fill:currentColor}.s-add-product-button-mini-checkout-content svg:where([dir=\"rtl\"],[dir=\"rtl\"] *){margin-right:0px;margin-left:0.375rem}.s-add-product-button-busy{pointer-events:none;position:relative}.s-add-product-button-busy::after{position:absolute;top:50%;left:50%;z-index:10;height:1rem;width:1rem;--tw-translate-x:-50%;content:var(--tw-content);--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{content:var(--tw-content);transform:rotate(360deg)}}.s-add-product-button-busy::after{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;border-style:solid;border-top-color:var(--color-primary);border-left-color:var(--color-primary);border-bottom-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-border-opacity:1;border-right-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-content:'';content:var(--tw-content)}";
261
262
 
262
263
  const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddProductButton extends HTMLElement {
263
264
  constructor() {
@@ -266,6 +267,11 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
266
267
  this.success = createEvent(this, "success", 7);
267
268
  this.failed = createEvent(this, "failed", 7);
268
269
  this.hostAttributes = {};
270
+ this.buyNowBusy = false;
271
+ /** Latest buy-now click; an older click still waiting on Bullet Delivery drops out. */
272
+ this.buyNowToken = 0;
273
+ this.buyNowLastClick = 0;
274
+ this.buyNowLivePrice = 0;
269
275
  /**
270
276
  * Has Pre Order
271
277
  */
@@ -280,6 +286,7 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
280
286
  this.productType = 'product';
281
287
  this.selectedOptions = [];
282
288
  this.buyNowText = salla.lang.get('pages.products.buy_now');
289
+ this.buyNowLoading = false;
283
290
  /** Use matchMedia instead of window.innerWidth to avoid forced reflow (Lighthouse/PageSpeed) */
284
291
  this.isDesktopViewport = typeof window !== 'undefined' ? window.matchMedia('(min-width: 768px)').matches : true;
285
292
  this.viewportMediaQuery = null;
@@ -287,6 +294,9 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
287
294
  this.orderOptionsGateAttached = false;
288
295
  /** Guards one-time attachment of the fast-checkout Bullet Delivery gate (logic lives in FastCheckoutGate). */
289
296
  this.fastCheckoutGateAttached = false;
297
+ this.onBuyNowPriceUpdated = (response) => {
298
+ this.buyNowLivePrice = Number(response?.data?.price) || this.buyNowLivePrice;
299
+ };
290
300
  this.onViewportChange = (e) => {
291
301
  this.isDesktopViewport = e.matches;
292
302
  this.btn?.setText((e.matches && !!this.passedLabel) ? this.passedLabel : this.getLabel());
@@ -414,6 +424,105 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
414
424
  type: this.supportStickyBar && !this.isDesktopViewport ? 'plain' : this.productType == 'donating' ? 'donate' : 'buy'
415
425
  };
416
426
  }
427
+ // Store setting: quick-buy skips the mini-checkout popup and goes straight to the checkout page.
428
+ get redirectsToCheckout() {
429
+ return salla.config.get('store.settings.buy_now.redirect_to_checkout') === true;
430
+ }
431
+ /** The fast-checkout slot renders and the store redirects, so the buy-now button is on the page. */
432
+ get showsBuyNowButton() {
433
+ return this.showQuickBuy
434
+ && !!document.getElementById('fast-checkout-js')
435
+ && !['financial_support', 'donating'].includes(this.productType)
436
+ && this.redirectsToCheckout;
437
+ }
438
+ buyNowButton() {
439
+ return h("div", { class: "s-add-product-button-mini-checkout s-mini-checkout hide-scroll s-add-product-button-buy-now" }, h("button", { type: "button", class: `s-fast-checkout-button outline ${salla.lang.locale == 'ar' ? 'rtl' : 'ltr'}`, disabled: this.buyNowLoading, onClick: () => this.buyNowRedirect() }, h("div", { class: "s-add-product-button-mini-checkout-content" }, h("span", { innerHTML: WalletIcon }), this.buyNowText)));
440
+ }
441
+ async buyNowRedirect() {
442
+ // A double-click would reach Bullet Delivery twice, which stalls its guest gate.
443
+ const now = Date.now();
444
+ if (this.buyNowBusy || now - this.buyNowLastClick < 500) {
445
+ return;
446
+ }
447
+ this.buyNowLastClick = now;
448
+ const token = ++this.buyNowToken;
449
+ const optionsEl = document.querySelector(`salla-product-options[product-id="${this.productId}"]`);
450
+ if (optionsEl?.validateAndScroll && !(await optionsEl.validateAndScroll())) {
451
+ return;
452
+ }
453
+ // Bullet Delivery's address gate, as the widget runs it; stays pending if the shopper backs out.
454
+ await salla.cart.event.beforeStartFastCheckout();
455
+ if (token !== this.buyNowToken || this.buyNowBusy) {
456
+ return;
457
+ }
458
+ this.buyNowBusy = true;
459
+ let leaving = false;
460
+ try {
461
+ this.buyNowLoading = true;
462
+ const form = document.querySelector('form.product-form');
463
+ const data = form ? new FormData(form) : new FormData();
464
+ data.set('id', String(this.productId));
465
+ data.set('source', 'buy_now');
466
+ if (!(await this.collectOrderOptions(data))) {
467
+ return;
468
+ }
469
+ const resp = await salla.api.request('checkout/mini', data, 'post');
470
+ if (resp.data?.url) {
471
+ leaving = this.openCheckout(resp.data.url);
472
+ }
473
+ else if (resp.data?.to === 'login') {
474
+ salla.event.dispatch('login::open');
475
+ }
476
+ }
477
+ catch (error) {
478
+ this.failed.emit(error);
479
+ }
480
+ finally {
481
+ if (!leaving) {
482
+ this.buyNowBusy = false;
483
+ this.buyNowLoading = false;
484
+ }
485
+ }
486
+ }
487
+ /** Order options and free offer products, as the widget collects them; false when the modal is dismissed. */
488
+ async collectOrderOptions(data) {
489
+ let resp;
490
+ try {
491
+ resp = await salla.api.withoutNotifier(() => salla.product.api.getOrderOptions([{ id: this.productId, quantity: Number(data.get('quantity')) || 1 }]));
492
+ }
493
+ catch (error) {
494
+ salla?.logger?.warn?.('order-options: fetch failed', error);
495
+ return true;
496
+ }
497
+ const orderOptions = resp?.data?.order_options || [];
498
+ const freeProducts = (Array.isArray(resp?.data?.advance_free_product) ? resp.data.advance_free_product : [])
499
+ .filter((entry) => Array.isArray(entry?.options) && entry.options.length);
500
+ if (!orderOptions.length && !freeProducts.length) {
501
+ return true;
502
+ }
503
+ try {
504
+ const result = await ensureOrderOptionsModal().open({
505
+ orderOptions,
506
+ freeProducts,
507
+ basePrice: this.buyNowLivePrice || Number(resp?.data?.products?.[0]?.price?.amount) || 0,
508
+ });
509
+ appendOrderOptionsToPayload(data, result?.orderOptions || []);
510
+ injectFreeProductsIntoPayload(data, result?.freeProducts || []);
511
+ return true;
512
+ }
513
+ catch {
514
+ return false;
515
+ }
516
+ }
517
+ /** Native SPA webviews own the checkout screen; returns true when this page navigates away. */
518
+ openCheckout(url) {
519
+ if (salla.mobile?.isSpaWebview?.() && salla.mobile.openCheckout) {
520
+ salla.mobile.openCheckout(url);
521
+ return false;
522
+ }
523
+ window.location.href = url;
524
+ return true;
525
+ }
417
526
  miniCheckoutWidget() {
418
527
  let storeId = salla.config.get('store.id');
419
528
  if (!storeId) {
@@ -466,11 +575,14 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
466
575
  } }, h("div", { class: {
467
576
  's-add-product-button-main': this.showQuickBuy,
468
577
  'w-full': !document.getElementById('fast-checkout-js') || ['financial_support', 'donating'].includes(this.productType) // This is a temporary fix until all themes fully support the fast checkout -- To be removed later
469
- } }, h("salla-button", { color: this.productStatus === 'sale' ? 'primary' : 'light', type: "button", fill: this.productStatus === 'sale' ? 'solid' : 'outline', ref: el => this.btn = el, onClick: event => this.addProductToCart(event), disabled: this.productStatus !== 'sale', "aria-label": this.isIconOnlyLabel ? this.addToCartLabel : undefined, ...this.getBtnAttributes(), "loader-position": "center" }, h("slot", null)), this.showQuickBuy && !!document.getElementById('fast-checkout-js') && !['financial_support', 'donating'].includes(this.productType) ? this.miniCheckoutWidget() : ''), this.showQuickBuy && this.isApplePayActive ? h("salla-quick-buy", { ...this.getQuickBuyBtnAttributes() }) : '');
578
+ } }, h("salla-button", { color: this.productStatus === 'sale' ? 'primary' : 'light', type: "button", fill: this.productStatus === 'sale' ? 'solid' : 'outline', ref: el => this.btn = el, onClick: event => this.addProductToCart(event), disabled: this.productStatus !== 'sale', "aria-label": this.isIconOnlyLabel ? this.addToCartLabel : undefined, ...this.getBtnAttributes(), "loader-position": "center" }, h("slot", null)), this.showQuickBuy && !!document.getElementById('fast-checkout-js') && !['financial_support', 'donating'].includes(this.productType) ? (this.redirectsToCheckout ? this.buyNowButton() : this.miniCheckoutWidget()) : ''), this.showQuickBuy && this.isApplePayActive ? h("salla-quick-buy", { ...this.getQuickBuyBtnAttributes() }) : '');
470
579
  }
471
580
  async componentDidLoad() {
472
581
  // Register this component for hooks system, already on it logic to run componentDidLoad trigger
473
582
  await Salla.hooks.registerComponent('salla-add-product-button', this);
583
+ if (this.showsBuyNowButton) {
584
+ salla.product?.event?.onPriceUpdated?.(this.onBuyNowPriceUpdated);
585
+ }
474
586
  if (!this.notifyOptionsAvailability) {
475
587
  return;
476
588
  }
@@ -519,6 +631,7 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
519
631
  }
520
632
  disconnectedCallback() {
521
633
  this.viewportMediaQuery?.removeEventListener('change', this.onViewportChange);
634
+ salla.product?.event?.offPriceUpdated?.(this.onBuyNowPriceUpdated);
522
635
  }
523
636
  get host() { return this; }
524
637
  static get style() { return sallaAddProductButtonCss; }
@@ -540,6 +653,7 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
540
653
  "showQuickBuy": [32],
541
654
  "isApplePayActive": [32],
542
655
  "buyNowText": [32],
656
+ "buyNowLoading": [32],
543
657
  "isDesktopViewport": [32]
544
658
  }]);
545
659
  function defineCustomElement() {