@salla.sa/twilight-components 2.14.574 → 2.14.576

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 (348) hide show
  1. package/dist/cjs/{filepond-BqzmHqFG.js → filepond-pMiRtx1x.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-Rc_hYm4g.js → filepond-plugin-file-poster-DxsZ8Mch.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-MQOyXwCH.js → filepond-plugin-file-validate-size-B6fa4wXz.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-0_gq-gig.js → filepond-plugin-file-validate-type-BEggFpci.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-DjWvYOF_.js → filepond-plugin-image-edit-BDwSySal.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-BGNpJuyh.js → filepond-plugin-image-exif-orientation-HE8n94tY.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-BoPR2rRr.js → filepond-plugin-image-preview-C-CaMrlm.js} +1 -1
  8. package/dist/cjs/{index-BGm5j5Zj.js → index-B3IyDlYG.js} +2 -2
  9. package/dist/cjs/{intlTelInput-CIZvknP0.js → intlTelInput-CeiHZwpn.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  12. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-applied-filters.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +10 -10
  20. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +1 -1
  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-cart-summary-card.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-form_9.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-gift-card-redeem.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  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_3.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_2.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer-modal.cjs.entry.js +30 -4
  63. package/dist/cjs/salla-offer.cjs.entry.js +132 -24
  64. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-cancel.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-options-modal.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-orders.cjs.entry.js +38 -13
  77. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-tooltip.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/translate-BeU1QX_r.js +20 -0
  108. package/dist/cjs/twilight.cjs.js +2 -2
  109. package/dist/cjs/{vanilla-picker-BwaB87Xi.js → vanilla-picker-DBIBI2Jr.js} +1 -1
  110. package/dist/collection/Helpers/translate.js +16 -0
  111. package/dist/collection/components/salla-offer/salla-offer.css +86 -0
  112. package/dist/collection/components/salla-offer/salla-offer.js +135 -22
  113. package/dist/collection/components/salla-offer-modal/salla-offer-modal.css +32 -0
  114. package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +28 -2
  115. package/dist/collection/components/salla-orders/salla-orders.js +39 -12
  116. package/dist/components/index.js +2 -2
  117. package/dist/components/salla-offer-modal.js +29 -3
  118. package/dist/components/salla-offer.js +136 -23
  119. package/dist/components/salla-orders.js +39 -12
  120. package/dist/components/translate.js +18 -0
  121. package/dist/esm/{filepond-DcoYtlMX.js → filepond-C6VyLUVF.js} +1 -1
  122. package/dist/esm/{filepond-plugin-file-poster-CBcS6Ln1.js → filepond-plugin-file-poster-BfFqi2TO.js} +1 -1
  123. package/dist/esm/{filepond-plugin-file-validate-size-HuNTwpc9.js → filepond-plugin-file-validate-size-BBqb56CB.js} +1 -1
  124. package/dist/esm/{filepond-plugin-file-validate-type-BOjEfXdn.js → filepond-plugin-file-validate-type-O67G3mL2.js} +1 -1
  125. package/dist/esm/{filepond-plugin-image-edit-BL7zREI5.js → filepond-plugin-image-edit-CGZyNJxN.js} +1 -1
  126. package/dist/esm/{filepond-plugin-image-exif-orientation-BJgL9era.js → filepond-plugin-image-exif-orientation-DA7fGQP3.js} +1 -1
  127. package/dist/esm/{filepond-plugin-image-preview-DPUJHFk0.js → filepond-plugin-image-preview-BijvA1XW.js} +1 -1
  128. package/dist/esm/{index-BXNtVhVe.js → index-VyEjj_Gx.js} +2 -2
  129. package/dist/esm/{intlTelInput-wU6Kly2g.js → intlTelInput-DE-bT5KJ.js} +1 -1
  130. package/dist/esm/loader.js +3 -3
  131. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  132. package/dist/esm/salla-accordion_6.entry.js +1 -1
  133. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  134. package/dist/esm/salla-advertisement.entry.js +1 -1
  135. package/dist/esm/salla-alert_2.entry.js +1 -1
  136. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  137. package/dist/esm/salla-applied-filters.entry.js +1 -1
  138. package/dist/esm/salla-apps-icons.entry.js +1 -1
  139. package/dist/esm/salla-attachment-view_9.entry.js +10 -10
  140. package/dist/esm/salla-badge.entry.js +1 -1
  141. package/dist/esm/salla-basket-gap.entry.js +1 -1
  142. package/dist/esm/salla-bullet-delivery_3.entry.js +1 -1
  143. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  144. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  145. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  146. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  147. package/dist/esm/salla-comment-factors.entry.js +1 -1
  148. package/dist/esm/salla-comment-form_9.entry.js +1 -1
  149. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  150. package/dist/esm/salla-contacts.entry.js +1 -1
  151. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  152. package/dist/esm/salla-count-down.entry.js +1 -1
  153. package/dist/esm/salla-custom-fields.entry.js +1 -1
  154. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  155. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  156. package/dist/esm/salla-filters-widget.entry.js +1 -1
  157. package/dist/esm/salla-filters.entry.js +1 -1
  158. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  159. package/dist/esm/salla-gift-card-redeem.entry.js +1 -1
  160. package/dist/esm/salla-gifting.entry.js +1 -1
  161. package/dist/esm/salla-hook.entry.js +1 -1
  162. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  163. package/dist/esm/salla-installment.entry.js +1 -1
  164. package/dist/esm/salla-list-tile.entry.js +1 -1
  165. package/dist/esm/salla-localization-modal.entry.js +1 -1
  166. package/dist/esm/salla-login-modal.entry.js +1 -1
  167. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  168. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  169. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  170. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  171. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  172. package/dist/esm/salla-loyalty.entry.js +1 -1
  173. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  174. package/dist/esm/salla-map_3.entry.js +1 -1
  175. package/dist/esm/salla-menu.entry.js +1 -1
  176. package/dist/esm/salla-metadata.entry.js +1 -1
  177. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  178. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  179. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  180. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  181. package/dist/esm/salla-notification-item_2.entry.js +1 -1
  182. package/dist/esm/salla-offer-modal.entry.js +30 -4
  183. package/dist/esm/salla-offer.entry.js +132 -24
  184. package/dist/esm/salla-order-branch.entry.js +1 -1
  185. package/dist/esm/salla-order-cancel.entry.js +1 -1
  186. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  187. package/dist/esm/salla-order-details-options.entry.js +1 -1
  188. package/dist/esm/salla-order-details.entry.js +1 -1
  189. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  190. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  191. package/dist/esm/salla-order-edit.entry.js +1 -1
  192. package/dist/esm/salla-order-options-modal.entry.js +1 -1
  193. package/dist/esm/salla-order-shipments.entry.js +1 -1
  194. package/dist/esm/salla-order-summary.entry.js +1 -1
  195. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  196. package/dist/esm/salla-orders.entry.js +38 -13
  197. package/dist/esm/salla-payments.entry.js +1 -1
  198. package/dist/esm/salla-placeholder.entry.js +1 -1
  199. package/dist/esm/salla-price-range.entry.js +1 -1
  200. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  201. package/dist/esm/salla-product-card.entry.js +1 -1
  202. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  203. package/dist/esm/salla-products-list.entry.js +1 -1
  204. package/dist/esm/salla-products-slider.entry.js +1 -1
  205. package/dist/esm/salla-quick-order.entry.js +1 -1
  206. package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
  207. package/dist/esm/salla-rating-modal.entry.js +1 -1
  208. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  209. package/dist/esm/salla-review-order-item.entry.js +1 -1
  210. package/dist/esm/salla-scopes.entry.js +1 -1
  211. package/dist/esm/salla-search-product-card.entry.js +1 -1
  212. package/dist/esm/salla-search.entry.js +1 -1
  213. package/dist/esm/salla-skeleton.entry.js +1 -1
  214. package/dist/esm/salla-social-share.entry.js +1 -1
  215. package/dist/esm/salla-social.entry.js +1 -1
  216. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  217. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  218. package/dist/esm/salla-tooltip.entry.js +1 -1
  219. package/dist/esm/salla-trust-badges.entry.js +1 -1
  220. package/dist/esm/salla-user-menu.entry.js +1 -1
  221. package/dist/esm/salla-user-profile.entry.js +1 -1
  222. package/dist/esm/salla-user-settings.entry.js +1 -1
  223. package/dist/esm/salla-verify.entry.js +1 -1
  224. package/dist/esm/salla-wallet.entry.js +1 -1
  225. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  226. package/dist/esm/salla-wishlist-summary.entry.js +1 -1
  227. package/dist/esm/translate-CrSV-tno.js +18 -0
  228. package/dist/esm/twilight.js +3 -3
  229. package/dist/esm/{vanilla-picker-CFcUgW74.js → vanilla-picker-BVwvMAEs.js} +1 -1
  230. package/dist/twilight/{p-0d18b6f2.entry.js → p-02df3435.entry.js} +1 -1
  231. package/dist/twilight/{p-bee482ce.entry.js → p-08bcc8c6.entry.js} +1 -1
  232. package/dist/twilight/{p-6fe398ae.entry.js → p-0987a1bf.entry.js} +1 -1
  233. package/dist/twilight/{p-1a4028e2.entry.js → p-09ab0b69.entry.js} +1 -1
  234. package/dist/twilight/{p-c67dcc94.entry.js → p-10da5fab.entry.js} +1 -1
  235. package/dist/twilight/{p-0a135b25.entry.js → p-12bcfd57.entry.js} +1 -1
  236. package/dist/twilight/{p-98137b26.entry.js → p-140bf9e1.entry.js} +1 -1
  237. package/dist/twilight/{p-6210a661.entry.js → p-15fd28e8.entry.js} +1 -1
  238. package/dist/twilight/{p-ab97de5d.entry.js → p-19c39465.entry.js} +1 -1
  239. package/dist/twilight/{p-88f762de.entry.js → p-1b2ce7bb.entry.js} +1 -1
  240. package/dist/twilight/{p-d1520e68.entry.js → p-22efe055.entry.js} +1 -1
  241. package/dist/twilight/{p-4563fd77.entry.js → p-237ee8db.entry.js} +1 -1
  242. package/dist/twilight/{p-a57e299a.entry.js → p-2438d7e1.entry.js} +1 -1
  243. package/dist/twilight/{p-12822eba.entry.js → p-26105855.entry.js} +1 -1
  244. package/dist/twilight/p-29bc507d.entry.js +4 -0
  245. package/dist/twilight/{p-76403e24.entry.js → p-2aa87b3c.entry.js} +1 -1
  246. package/dist/twilight/{p-70147959.entry.js → p-2d43aaae.entry.js} +1 -1
  247. package/dist/twilight/{p-6d56ebac.entry.js → p-354f6595.entry.js} +1 -1
  248. package/dist/twilight/p-370939c2.entry.js +4 -0
  249. package/dist/twilight/{p-fd6aed5e.entry.js → p-38f82c85.entry.js} +1 -1
  250. package/dist/twilight/{p-c5f087a3.entry.js → p-4198d092.entry.js} +1 -1
  251. package/dist/twilight/{p-9f23104d.entry.js → p-47ddfc87.entry.js} +1 -1
  252. package/dist/twilight/{p-e63f5b80.entry.js → p-4abd6abc.entry.js} +1 -1
  253. package/dist/twilight/{p-c0c23759.entry.js → p-4bcf0187.entry.js} +1 -1
  254. package/dist/twilight/{p-9282b995.entry.js → p-55469fd9.entry.js} +1 -1
  255. package/dist/twilight/{p-eccd8aa9.entry.js → p-55afe19f.entry.js} +1 -1
  256. package/dist/twilight/{p-a581c552.entry.js → p-565f021e.entry.js} +1 -1
  257. package/dist/twilight/{p-dedfcc58.entry.js → p-58398f44.entry.js} +1 -1
  258. package/dist/twilight/{p-6665f42e.entry.js → p-63a287b4.entry.js} +1 -1
  259. package/dist/twilight/{p-900f78b6.entry.js → p-63af5354.entry.js} +1 -1
  260. package/dist/twilight/{p-f583571c.entry.js → p-66be47ec.entry.js} +1 -1
  261. package/dist/twilight/{p-38806031.entry.js → p-6c4d3288.entry.js} +1 -1
  262. package/dist/twilight/{p-71ec3f8a.entry.js → p-6d46f977.entry.js} +1 -1
  263. package/dist/twilight/{p-3e7a7eb0.entry.js → p-70577d8b.entry.js} +1 -1
  264. package/dist/twilight/{p-043b2382.entry.js → p-724be00d.entry.js} +1 -1
  265. package/dist/twilight/{p-e50b99cb.entry.js → p-76843521.entry.js} +1 -1
  266. package/dist/twilight/{p-aec3d7ce.entry.js → p-7d4c9e95.entry.js} +1 -1
  267. package/dist/twilight/{p-f48ada4a.entry.js → p-7ef406e5.entry.js} +1 -1
  268. package/dist/twilight/{p-6b378bcd.entry.js → p-7f38bccf.entry.js} +1 -1
  269. package/dist/twilight/{p-e9cc9f4f.entry.js → p-80cf8042.entry.js} +1 -1
  270. package/dist/twilight/{p-b0671070.entry.js → p-82186e1c.entry.js} +1 -1
  271. package/dist/twilight/{p-747153bc.entry.js → p-85a81ddd.entry.js} +1 -1
  272. package/dist/twilight/{p-de3eeec4.entry.js → p-85d5c0b6.entry.js} +1 -1
  273. package/dist/twilight/{p-bd89bcf5.entry.js → p-88918b1b.entry.js} +1 -1
  274. package/dist/twilight/{p-48f47f92.entry.js → p-90033ecc.entry.js} +1 -1
  275. package/dist/twilight/{p-8666489e.entry.js → p-915965eb.entry.js} +1 -1
  276. package/dist/twilight/{p-a0c5bc92.entry.js → p-9417b38b.entry.js} +1 -1
  277. package/dist/twilight/{p-dc9b9ef7.entry.js → p-95494a3d.entry.js} +1 -1
  278. package/dist/twilight/{p-ac2926d9.entry.js → p-9a0ad6b4.entry.js} +1 -1
  279. package/dist/twilight/{p-43124a9d.entry.js → p-9df6ef40.entry.js} +1 -1
  280. package/dist/twilight/{p-78a84f80.entry.js → p-9eebb417.entry.js} +1 -1
  281. package/dist/twilight/{p-6142183b.entry.js → p-9f485845.entry.js} +1 -1
  282. package/dist/twilight/p-BB5KMFvk.js +9 -0
  283. package/dist/twilight/{p-CMcDoqmG.js → p-BZQPZ7Vk.js} +1 -1
  284. package/dist/twilight/{p-BFib9jF0.js → p-BqBflUu5.js} +1 -1
  285. package/dist/twilight/{p-CPkPdW2Q.js → p-CVE_4GIW.js} +1 -1
  286. package/dist/twilight/p-CrSV-tno.js +4 -0
  287. package/dist/twilight/{p-CDojVREu.js → p-Dht_HSXg.js} +2 -2
  288. package/dist/twilight/{p-BpnCDmiM.js → p-DtngMbK9.js} +1 -1
  289. package/dist/twilight/{p-C3JsXKHY.js → p-MofCSty6.js} +1 -1
  290. package/dist/twilight/{p-BXNtVhVe.js → p-VyEjj_Gx.js} +1 -1
  291. package/dist/twilight/{p-COQlWLWv.js → p-XWoqFS1d.js} +1 -1
  292. package/dist/twilight/{p-a34258d2.entry.js → p-a185519a.entry.js} +1 -1
  293. package/dist/twilight/{p-91e4594d.entry.js → p-a291f319.entry.js} +1 -1
  294. package/dist/twilight/{p-52c31b1a.entry.js → p-a2bf4487.entry.js} +1 -1
  295. package/dist/twilight/{p-f4583bb2.entry.js → p-a4ba6008.entry.js} +1 -1
  296. package/dist/twilight/{p-c163a216.entry.js → p-a5dc1d5e.entry.js} +1 -1
  297. package/dist/twilight/{p-987a75aa.entry.js → p-a8f4fa9e.entry.js} +1 -1
  298. package/dist/twilight/{p-e6233f15.entry.js → p-a990b069.entry.js} +1 -1
  299. package/dist/twilight/{p-0bcaa1af.entry.js → p-b06b0973.entry.js} +1 -1
  300. package/dist/twilight/{p-2e08cf78.entry.js → p-b35956cc.entry.js} +1 -1
  301. package/dist/twilight/{p-853b2efe.entry.js → p-b3a36e11.entry.js} +1 -1
  302. package/dist/twilight/{p-90aa29f3.entry.js → p-b7e14e40.entry.js} +1 -1
  303. package/dist/twilight/{p-8f3642d1.entry.js → p-b930b2ba.entry.js} +1 -1
  304. package/dist/twilight/{p-70eaceea.entry.js → p-b9e85434.entry.js} +1 -1
  305. package/dist/twilight/{p-9dfe1ec1.entry.js → p-bb2c9ac9.entry.js} +1 -1
  306. package/dist/twilight/{p-bb0bc7ed.entry.js → p-bb83242c.entry.js} +1 -1
  307. package/dist/twilight/{p-9cca8055.entry.js → p-bc1251f6.entry.js} +1 -1
  308. package/dist/twilight/{p-f174afea.entry.js → p-c032ca19.entry.js} +1 -1
  309. package/dist/twilight/{p-44899fd8.entry.js → p-c1f9932b.entry.js} +1 -1
  310. package/dist/twilight/{p-23540811.entry.js → p-c593919c.entry.js} +1 -1
  311. package/dist/twilight/{p-9979ada5.entry.js → p-c63be3cf.entry.js} +1 -1
  312. package/dist/twilight/{p-817cfe1a.entry.js → p-c6e6daf9.entry.js} +1 -1
  313. package/dist/twilight/{p-d702af41.entry.js → p-c95f4657.entry.js} +1 -1
  314. package/dist/twilight/{p-b11508cb.entry.js → p-ca7cd467.entry.js} +1 -1
  315. package/dist/twilight/{p-9d667925.entry.js → p-cbaa45a4.entry.js} +1 -1
  316. package/dist/twilight/{p-1ea4c8e4.entry.js → p-ceae3b17.entry.js} +1 -1
  317. package/dist/twilight/{p-16b9ea73.entry.js → p-d0445027.entry.js} +1 -1
  318. package/dist/twilight/{p-565eda17.entry.js → p-d4466357.entry.js} +1 -1
  319. package/dist/twilight/{p-8e114c27.entry.js → p-d59a53f5.entry.js} +1 -1
  320. package/dist/twilight/{p-7a099b00.entry.js → p-d5d8230d.entry.js} +1 -1
  321. package/dist/twilight/{p-79f495b7.entry.js → p-d6c4c0f7.entry.js} +1 -1
  322. package/dist/twilight/{p-b0ff401e.entry.js → p-dcba291c.entry.js} +1 -1
  323. package/dist/twilight/{p-bc2203b6.entry.js → p-e2d0eb4c.entry.js} +1 -1
  324. package/dist/twilight/p-e6803d06.entry.js +4 -0
  325. package/dist/twilight/{p-2ee3c58e.entry.js → p-ec378cee.entry.js} +1 -1
  326. package/dist/twilight/{p-b5329852.entry.js → p-f059fb37.entry.js} +1 -1
  327. package/dist/twilight/{p-3ae64529.entry.js → p-f12fc91c.entry.js} +1 -1
  328. package/dist/twilight/{p-d365bd72.entry.js → p-f1d0d4da.entry.js} +1 -1
  329. package/dist/twilight/{p-1853b5ba.entry.js → p-f265b4ea.entry.js} +1 -1
  330. package/dist/twilight/{p-50a88286.entry.js → p-f291fd6b.entry.js} +1 -1
  331. package/dist/twilight/{p-fc0a3c91.entry.js → p-f7063e39.entry.js} +1 -1
  332. package/dist/twilight/{p-dbd9523b.entry.js → p-f7f35e00.entry.js} +1 -1
  333. package/dist/twilight/{p-e77d6649.entry.js → p-f889b4d2.entry.js} +1 -1
  334. package/dist/twilight/{p-bdb558a2.entry.js → p-faa90387.entry.js} +1 -1
  335. package/dist/twilight/{p-f7e38710.entry.js → p-fe8cb1d6.entry.js} +1 -1
  336. package/dist/twilight/{p-D9StCBh9.js → p-k8NfWBBa.js} +2 -2
  337. package/dist/twilight/twilight.esm.js +1 -1
  338. package/dist/types/Helpers/translate.d.ts +10 -0
  339. package/dist/types/components/salla-offer/salla-offer.d.ts +52 -1
  340. package/dist/types/components/salla-offer-modal/offer-schema.d.ts +12 -0
  341. package/dist/types/components/salla-offer-modal/salla-offer-modal.d.ts +7 -0
  342. package/dist/types/components/salla-orders/interface.d.ts +2 -0
  343. package/dist/types/components/salla-orders/salla-orders.d.ts +5 -1
  344. package/package.json +5 -5
  345. package/dist/twilight/p-02eccebc.entry.js +0 -4
  346. package/dist/twilight/p-1bcacd6b.entry.js +0 -4
  347. package/dist/twilight/p-22087f33.entry.js +0 -4
  348. package/dist/twilight/p-b84FyDqk.js +0 -9
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import { h } from "@stencil/core";
5
5
  import { PageType, OfferType } from "./interfaces";
6
+ import { translate } from "../../Helpers/translate";
6
7
  /**
7
8
  * `salla-offer` is a StencilJS component that displays offers, categories, products, banks, and discount information.
8
9
  * It uses the `salla-slider` component for carousel functionality.
@@ -43,8 +44,13 @@ export class SallaOffer {
43
44
  this.special_offer_text = salla.lang.get('pages.products.special_offer');
44
45
  this.buy_quantity_text = (quantity) => salla.lang.get('pages.offer.buy_quantity', { quantity });
45
46
  this.products_link_text = salla.lang.get('pages.offer.included_products', 'المنتجات المشمولة');
46
- this.min_spend_text = (amount, currency) => salla.lang.get('pages.offer.min_spend_amount', { amount, currency }, `بحد أدنى ${amount} ${currency} من مبلغ الشراء`);
47
- this.min_items_text = (items) => salla.lang.get('pages.offer.min_items', { items }, `بحد أدنى ${items} منتجات`);
47
+ this.min_spend_text = (money) => translate('pages.offer.min_spend_amount', { amount: money, currency: '' }, `بحد أدنى ${money} من مبلغ الشراء`);
48
+ this.min_items_text = (items) => translate('pages.offer.min_items', { items }, `بحد أدنى ${items} منتجات`);
49
+ this.max_discount_text = (money) => translate('pages.offer.max_discount_amount', { amount: money, currency: '' }, `بحد أقصى ${money} للخصم`);
50
+ this.branches_text = translate('pages.offer.available_branches', {}, 'الفروع المتاحة');
51
+ this.buy_from_text = translate('pages.offer.buy_from_categories', {}, 'اشترِ من:');
52
+ this.get_from_text = translate('pages.offer.get_from_categories', {}, 'احصل من:');
53
+ this.payment_methods_text = translate('pages.offer.payment_methods', {}, 'طرق الدفع');
48
54
  this.product_text = salla.lang.get('common.elements.product', 'منتج');
49
55
  // Language
50
56
  salla.lang.onLoaded(() => {
@@ -54,8 +60,13 @@ export class SallaOffer {
54
60
  this.special_offer_text = salla.lang.get('pages.products.special_offer');
55
61
  this.buy_quantity_text(0);
56
62
  this.products_link_text = salla.lang.get('pages.offer.included_products', 'المنتجات المشمولة');
57
- this.min_spend_text = (amount, currency) => salla.lang.get('pages.offer.min_spend_amount', { amount, currency }, `بحد أدنى ${amount} ${currency} من مبلغ الشراء`);
58
- this.min_items_text = (items) => salla.lang.get('pages.offer.min_items', { items }, `بحد أدنى ${items} منتجات`);
63
+ this.min_spend_text = (money) => translate('pages.offer.min_spend_amount', { amount: money, currency: '' }, `بحد أدنى ${money} من مبلغ الشراء`);
64
+ this.min_items_text = (items) => translate('pages.offer.min_items', { items }, `بحد أدنى ${items} منتجات`);
65
+ this.max_discount_text = (money) => translate('pages.offer.max_discount_amount', { amount: money, currency: '' }, `بحد أقصى ${money} للخصم`);
66
+ this.branches_text = translate('pages.offer.available_branches', {}, 'الفروع المتاحة');
67
+ this.buy_from_text = translate('pages.offer.buy_from_categories', {}, 'اشترِ من:');
68
+ this.get_from_text = translate('pages.offer.get_from_categories', {}, 'احصل من:');
69
+ this.payment_methods_text = translate('pages.offer.payment_methods', {}, 'طرق الدفع');
59
70
  this.product_text = salla.lang.get('common.elements.product', 'منتج');
60
71
  });
61
72
  salla.onReady(() => {
@@ -133,7 +144,9 @@ export class SallaOffer {
133
144
  const details = offer.details;
134
145
  return (details.apply_to === 'category' && details.targets) ||
135
146
  (details.apply_to === 'categories' && details.targets) ||
136
- (offer.type === OfferType.BuyXGetY && (details.get?.source === 'categories' || details.get?.source === 'category'));
147
+ (offer.type === OfferType.BuyXGetY &&
148
+ (details.get?.source === 'categories' || details.get?.source === 'category' ||
149
+ details.buy?.source === 'categories' || details.buy?.source === 'category'));
137
150
  });
138
151
  if (needsCategories) {
139
152
  const res = await salla.product.api.categories();
@@ -199,6 +212,11 @@ export class SallaOffer {
199
212
  if ((buyX.source === 'products' || buyX.source === 'product') && buyX.source_value) {
200
213
  buyX.products = buyX.source_value.map(id => allProducts[id]).filter(Boolean);
201
214
  }
215
+ else if ((buyX.source === 'categories' || buyX.source === 'category') && allCategories && buyX.source_value) {
216
+ // Without this the buy side stayed unresolved and the card could only
217
+ // ever show the get-side categories.
218
+ buyX.categories = this.findCategories(allCategories, buyX.source_value);
219
+ }
202
220
  }
203
221
  }
204
222
  return this.offersList;
@@ -282,6 +300,21 @@ export class SallaOffer {
282
300
  // For categories, we'll return empty array as we handle categories separately
283
301
  return [];
284
302
  }
303
+ /**
304
+ * Title-adjacent description row.
305
+ *
306
+ * For a discount table the design sits the included-products link on the same
307
+ * line as the short description, rather than below the tier grid.
308
+ */
309
+ renderCardDescriptionRow(offer, withProductsLink = false) {
310
+ const inlineLink = withProductsLink && offer.type === OfferType.DiscountsTable
311
+ ? this.renderProductsLinkForModalCard(offer, false)
312
+ : null;
313
+ if (!offer.description && !inlineLink) {
314
+ return null;
315
+ }
316
+ return (h("div", { class: "s-offer-card-description-row" }, offer.description && h("p", { class: "s-offer-card-description" }, offer.description), inlineLink));
317
+ }
285
318
  renderProductsLinkForModalCard(offer, isInDrawer) {
286
319
  const products = this.getOfferProducts(offer);
287
320
  if (!products || products.length === 0) {
@@ -304,23 +337,32 @@ export class SallaOffer {
304
337
  const products = this.getOfferProducts(offer);
305
338
  const hasProducts = products && products.length > 0;
306
339
  const isCollapsed = this.collapsedOffers[offer.id] !== false; // Default to collapsed
307
- return (h("div", { class: "s-offer-drawer-card" }, h("div", { class: "s-offer-card-main", onClick: () => this.emitPromotionClicked(offer, position) }, h("div", { class: "s-offer-card-icon" }, this.getOfferIcon(offer.type)), h("div", { class: "s-offer-card-content" }, h("h3", { class: "s-offer-card-title", title: offer.title }, offer.title), offer.description && h("p", { class: "s-offer-card-description" }, offer.description), offer.type === OfferType.DiscountsTable ? (h("div", { class: "s-offer-card-details" }, this.renderDiscountTableOfferContent(offer))) : (offer.type === OfferType.PercentageOrFixed || offer.type === OfferType.Percentage || offer.type === OfferType.FixedAmount) ? (h("div", { class: "s-offer-card-details" }, this.renderPercentageOrFixedOfferContent(offer), this.renderOfferCategories(offer), this.renderOfferBrands(offer), this.renderOfferTags(offer))) : (h("div", { class: "s-offer-card-details" }, this.renderOfferCategories(offer), this.renderOfferBrands(offer), this.renderOfferTags(offer))))), hasProducts && (h("salla-accordion", { collapsed: isCollapsed, collapsible: true, size: "sm", onClick: (e) => e.stopPropagation(), onAccordionToggle: (e) => this.handleAccordionToggle(offer.id, e.detail.payload.collapsed) }, h("salla-accordion-head", { collapsible: true, collapsed: isCollapsed }, h("div", { slot: "title", class: "s-offer-products-thumbnails" }, h("span", { class: "s-offer-products-title" }, this.products_link_text, h("i", { class: `sicon-keyboard_arrow_${isCollapsed ? 'down' : 'up'} s-offer-products-link-icon` })), h("div", { class: "s-offer-products-thumbnails-stack" }, products.slice(0, 3).map((product, index) => (h("div", { class: "s-offer-product-thumbnail", style: { zIndex: `${index + 1}` } }, h("img", { src: product.thumbnail || product.image?.url || salla.url.cdn('images/s-empty.png'), alt: product.name })))), products.length > 3 && (h("div", { class: "s-offer-products-more-count", style: { zIndex: '7' } }, "+", products.length - 3))))), h("salla-accordion-body", null, h("div", { class: "s-offer-products-content" }, h("salla-products-list", { source: "selected", "source-value": JSON.stringify(products.map(p => p.id)), "product-card-component": this.productCardComponent, "horizontal-cards": true, "compact-cards": true, includes: ["images"] })))))));
340
+ return (h("div", { class: "s-offer-drawer-card" }, h("div", { class: "s-offer-card-main", onClick: () => this.emitPromotionClicked(offer, position) }, h("div", { class: "s-offer-card-icon" }, this.getOfferIcon(offer.type)), h("div", { class: "s-offer-card-content" }, h("h3", { class: "s-offer-card-title", title: offer.title }, offer.title), this.renderCardDescriptionRow(offer), offer.type === OfferType.DiscountsTable ? (h("div", { class: "s-offer-card-details" }, this.renderDiscountTableOfferContent(offer), this.renderOfferPaymentMethods(offer), this.renderOfferBranches(offer))) : (offer.type === OfferType.PercentageOrFixed || offer.type === OfferType.Percentage || offer.type === OfferType.FixedAmount) ? (h("div", { class: "s-offer-card-details" }, this.renderPercentageOrFixedOfferContent(offer), this.renderOfferCategories(offer), this.renderOfferBrands(offer), this.renderOfferTags(offer), this.renderOfferPaymentMethods(offer), this.renderOfferBranches(offer))) : (h("div", { class: "s-offer-card-details" }, this.renderMinSpend(offer), this.renderOfferCategories(offer), this.renderOfferBrands(offer), this.renderOfferTags(offer), this.renderOfferPaymentMethods(offer), this.renderOfferBranches(offer))))), hasProducts && (h("salla-accordion", { collapsed: isCollapsed, collapsible: true, size: "sm", onClick: (e) => e.stopPropagation(), onAccordionToggle: (e) => this.handleAccordionToggle(offer.id, e.detail.payload.collapsed) }, h("salla-accordion-head", { collapsible: true, collapsed: isCollapsed }, h("div", { slot: "title", class: "s-offer-products-thumbnails" }, h("span", { class: "s-offer-products-title" }, this.products_link_text, h("i", { class: `sicon-keyboard_arrow_${isCollapsed ? 'down' : 'up'} s-offer-products-link-icon` })), h("div", { class: "s-offer-products-thumbnails-stack" }, products.slice(0, 3).map((product, index) => (h("div", { class: "s-offer-product-thumbnail", style: { zIndex: `${index + 1}` } }, h("img", { src: product.thumbnail || product.image?.url || salla.url.cdn('images/s-empty.png'), alt: product.name })))), products.length > 3 && (h("div", { class: "s-offer-products-more-count", style: { zIndex: '7' } }, "+", products.length - 3))))), h("salla-accordion-body", null, h("div", { class: "s-offer-products-content" }, h("salla-products-list", { source: "selected", "source-value": JSON.stringify(products.map(p => p.id)), "product-card-component": this.productCardComponent, "horizontal-cards": true, "compact-cards": true, includes: ["images"] })))))));
308
341
  }
309
342
  renderOfferCard(offer, position = 1) {
310
- return (h("div", { class: "s-offer-slide-one-fourth swiper-slide", onClick: () => this.emitPromotionClicked(offer, position) }, h("div", { class: "s-offer-card" }, h("div", { class: "s-offer-card-icon" }, this.getOfferIcon(offer.type)), h("div", { class: "s-offer-card-content" }, h("h3", { class: "s-offer-card-title", title: offer.title }, offer.title), offer.description && h("p", { class: "s-offer-card-description" }, offer.description), h("div", { class: "s-offer-card-details" }, offer.type === OfferType.DiscountsTable
311
- ? this.renderDiscountTableOfferContent(offer)
343
+ return (h("div", { class: "s-offer-slide-one-fourth swiper-slide", onClick: () => this.emitPromotionClicked(offer, position) }, h("div", { class: "s-offer-card" }, h("div", { class: "s-offer-card-icon" }, this.getOfferIcon(offer.type)), h("div", { class: "s-offer-card-content" }, h("h3", { class: "s-offer-card-title", title: offer.title }, offer.title), this.renderCardDescriptionRow(offer, true), h("div", { class: "s-offer-card-details" }, offer.type === OfferType.DiscountsTable
344
+ ? [
345
+ this.renderDiscountTableOfferContent(offer),
346
+ this.renderOfferPaymentMethods(offer),
347
+ this.renderOfferBranches(offer)
348
+ ]
312
349
  : (offer.type === OfferType.PercentageOrFixed || offer.type === OfferType.Percentage || offer.type === OfferType.FixedAmount)
313
350
  ? [
314
351
  this.renderPercentageOrFixedOfferContent(offer),
315
352
  this.renderOfferCategories(offer),
316
353
  this.renderOfferBrands(offer),
317
- this.renderOfferTags(offer)
354
+ this.renderOfferTags(offer),
355
+ this.renderOfferPaymentMethods(offer),
356
+ this.renderOfferBranches(offer)
318
357
  ]
319
358
  : [
359
+ this.renderMinSpend(offer),
320
360
  this.renderOfferCategories(offer),
321
361
  this.renderOfferBrands(offer),
322
- this.renderOfferTags(offer)
323
- ], this.renderProductsLinkForModalCard(offer, false))))));
362
+ this.renderOfferTags(offer),
363
+ this.renderOfferPaymentMethods(offer),
364
+ this.renderOfferBranches(offer)
365
+ ], offer.type !== OfferType.DiscountsTable && this.renderProductsLinkForModalCard(offer, false))))));
324
366
  }
325
367
  getOfferIcon(offerType) {
326
368
  const iconMap = {
@@ -339,13 +381,28 @@ export class SallaOffer {
339
381
  const discounts = details.discounts || [];
340
382
  if (!discounts.length)
341
383
  return null;
342
- return (h("div", null, h("div", { class: "s-offer-card-description" }, salla.lang.get('pages.offer.discount_table_subtitle', 'وفر اكتر بشراء منتجات أكثر')), h("table", { class: "s-offer-discount-table" }, h("tbody", null, this.groupDiscountsByRows(discounts, 3).map((row, rowIndex) => (h("tr", { key: rowIndex }, row.map((discount, colIndex) => (h("td", { key: colIndex }, h("div", { class: "s-offer-discount-percentage" }, discount.percentage, "%"), h("div", { class: "s-offer-discount-condition" }, this.formatDiscountCondition(discount))))))))))));
384
+ return (h("div", null, !offer.description && (h("div", { class: "s-offer-card-description" }, salla.lang.get('pages.offer.discount_table_subtitle', 'وفِّر أكثر بشراء منتجات أكثر'))), h("table", { class: "s-offer-discount-table" }, h("tbody", null, this.groupDiscountsByRows(discounts, 3).map((row, rowIndex) => (h("tr", { key: rowIndex }, row.map((discount, colIndex) => (h("td", { key: colIndex }, h("div", { class: "s-offer-discount-percentage" }, discount.percentage, "%"), h("div", { class: "s-offer-discount-condition" }, this.formatDiscountCondition(discount))))))))))));
385
+ }
386
+ /**
387
+ * The minimum-purchase line for the offer types that have no conditions block
388
+ * of their own — BuyXGetY, SpecialPrice and Bank.
389
+ *
390
+ * Guarded on `min_spend` alone. This renders only the min-spend row, so the
391
+ * block-level guard used by renderPercentageOrFixedOfferContent (which gates
392
+ * three independently-rendered rows) does not apply here: borrowing it made
393
+ * any offer carrying just a `discount_value` print "a minimum of 0.00".
394
+ */
395
+ renderMinSpend(offer) {
396
+ const details = offer.details;
397
+ if (!(details.min_spend > 0))
398
+ return null;
399
+ return (h("div", { class: "s-offer-min-spend", innerHTML: this.min_spend_text(this.money(details.min_spend)) }));
343
400
  }
344
401
  renderPercentageOrFixedOfferContent(offer) {
345
402
  const details = offer.details;
346
- if (!details.discount_value && !(details.min_spend > 0) && !(details.min_items > 0))
403
+ if (!details.discount_value && !(details.min_spend > 0) && !(details.min_items > 0) && !(details.max_discount_amount > 0))
347
404
  return null;
348
- return (h("div", { class: "s-offer-percentage-fixed-content" }, details.min_spend > 0 && (h("div", { class: "s-offer-min-spend" }, this.min_spend_text(details.min_spend, this.userCurrency?.symbol || ''))), details.min_items > 0 && (h("div", { class: "s-offer-min-items" }, this.min_items_text(details.min_items)))));
405
+ return (h("div", { class: "s-offer-percentage-fixed-content" }, details.min_spend > 0 && (h("div", { class: "s-offer-min-spend", innerHTML: this.min_spend_text(this.money(details.min_spend)) })), details.min_items > 0 && (h("div", { class: "s-offer-min-items" }, this.min_items_text(details.min_items))), details.max_discount_amount > 0 && (h("div", { class: "s-offer-max-discount", innerHTML: this.max_discount_text(this.money(details.max_discount_amount)) }))));
349
406
  }
350
407
  groupDiscountsByRows(discounts, itemsPerRow) {
351
408
  const rows = [];
@@ -354,15 +411,31 @@ export class SallaOffer {
354
411
  }
355
412
  return rows;
356
413
  }
414
+ /**
415
+ * A tier is labelled by its item count ("20 منتج"), with the percentage above
416
+ * it saying what the shopper gets. `discounted_amount` is the resulting price;
417
+ * returning that here took the condition's place and hid the item count
418
+ * entirely, which is what the tiers used to render on the product page.
419
+ */
420
+ /**
421
+ * Money the way the rest of the storefront renders it.
422
+ *
423
+ * `salla.money()` returns markup — it swaps the currency for
424
+ * `<i class=sicon-sar></i>` when the store has the SAR symbol enabled — so the
425
+ * result has to be set with innerHTML. Printing it as text is what showed the
426
+ * riyal icon as raw code on the offer card and in the popup.
427
+ */
428
+ money(amount) {
429
+ return typeof salla?.money === 'function'
430
+ ? salla.money(amount)
431
+ : `${amount} ${this.userCurrency?.symbol || ''}`;
432
+ }
357
433
  formatDiscountCondition(discount) {
358
- // Format the condition text based on discount amount or quantity
359
- if (discount.discounted_amount) {
360
- return `${discount.discounted_amount} ${this.userCurrency?.symbol || ''}`;
361
- }
362
- if (discount.quantity != null) {
363
- return this.buy_quantity_text(discount.quantity);
364
- }
365
- return `1 ${this.product_text}`;
434
+ return `${discount.quantity ?? 1} ${this.product_text}`;
435
+ }
436
+ /** One labelled row of category links, used when buy and get differ. */
437
+ renderCategoryGroup(offer, categories, label) {
438
+ return (h("div", { class: "s-offer-categories-group" }, h("span", { class: "s-offer-categories-label" }, label), h("div", { class: "s-offer-categories-list" }, categories.map((category, index) => (h("a", { key: `${offer.id}-${index}`, class: "s-offer-category-item", href: category.url || salla.url.create('categories', category.id || category.id_) }, category.name))))));
366
439
  }
367
440
  renderOfferCategories(offer) {
368
441
  const details = offer.details;
@@ -372,6 +445,17 @@ export class SallaOffer {
372
445
  if (offer.type === OfferType.BuyXGetY && details.get?.categories) {
373
446
  categories = details.get.categories;
374
447
  }
448
+ // "Buy 2 from A, get 1 from B" needs both sides named; one flat list reads as
449
+ // if the whole offer were scoped to B. Only split when the sides really
450
+ // differ, so same-category offers keep rendering as a single list.
451
+ if (offer.type === OfferType.BuyXGetY) {
452
+ const buySide = details.buy?.categories || [];
453
+ const getSide = details.get?.categories || [];
454
+ const idsOf = (list) => list.map(c => c.id || c.id_).join(',');
455
+ if (buySide.length && getSide.length && idsOf(buySide) !== idsOf(getSide)) {
456
+ return (h("div", { class: "s-offer-categories" }, this.renderCategoryGroup(offer, buySide, this.buy_from_text), this.renderCategoryGroup(offer, getSide, this.get_from_text)));
457
+ }
458
+ }
375
459
  if (!categories.length)
376
460
  return null;
377
461
  const maxVisible = 3; // Show only first 3 categories initially
@@ -399,6 +483,30 @@ export class SallaOffer {
399
483
  this.toggleCategoryExpansion(offer.id);
400
484
  } }, isExpanded ? (h("span", null, h("i", { class: "sicon-keyboard_arrow_up" }), ' ', salla.lang.get('common.elements.hide', 'إخفاء'))) : (h("span", null, salla.lang.get('common.elements.show', 'عرض'), " ", `+${brands.length - maxVisible}`, ' ', h("i", { class: "sicon-keyboard_arrow_down" }))))))));
401
485
  }
486
+ /**
487
+ * Payment methods the offer is conditioned on. Reads `payment_methods` rather
488
+ * than `targets`: for a payment-method offer `targets` holds bare encoded ids
489
+ * with no label to show.
490
+ */
491
+ renderOfferPaymentMethods(offer) {
492
+ const details = offer.details;
493
+ const methods = details.payment_methods || [];
494
+ if (!methods.length)
495
+ return null;
496
+ return (h("div", { class: "s-offer-payment-methods" }, h("span", { class: "s-offer-payment-methods-label" }, this.payment_methods_text), h("div", { class: "s-offer-payment-methods-list" }, methods.map((method, index) => (h("span", { key: index, class: "s-offer-payment-method-item" }, method.name))))));
497
+ }
498
+ /**
499
+ * Branch restriction. Rendered for every offer type because the restriction is
500
+ * a condition on the offer itself, not on what it discounts. Branches carry no
501
+ * storefront URL, so these are plain badges rather than links.
502
+ */
503
+ renderOfferBranches(offer) {
504
+ const details = offer.details;
505
+ const branches = details.branches || [];
506
+ if (!branches.length)
507
+ return null;
508
+ return (h("div", { class: "s-offer-branches" }, h("span", { class: "s-offer-branches-label" }, this.branches_text), h("div", { class: "s-offer-branches-list" }, branches.map((branch, index) => (h("span", { key: index, class: "s-offer-branch-item" }, branch.name))))));
509
+ }
402
510
  renderOfferTags(offer) {
403
511
  const details = offer.details;
404
512
  const tags = details.tags || [];
@@ -484,6 +592,11 @@ export class SallaOffer {
484
592
  "products_link_text": {},
485
593
  "min_spend_text": {},
486
594
  "min_items_text": {},
595
+ "max_discount_text": {},
596
+ "branches_text": {},
597
+ "buy_from_text": {},
598
+ "get_from_text": {},
599
+ "payment_methods_text": {},
487
600
  "product_text": {}
488
601
  };
489
602
  }
@@ -518,3 +518,35 @@
518
518
  .s-offer-modal-type-discounts-table .s-modal-body {
519
519
  position: relative !important;
520
520
  }
521
+ .s-offer-modal-conditions {
522
+ margin-top: 1rem;
523
+ display: flex;
524
+ flex-direction: column;
525
+ gap: 0.5rem;
526
+ text-align: center;
527
+ }
528
+ .s-offer-modal-condition {
529
+ font-size: 13px;
530
+ line-height: 17px;
531
+ --tw-text-opacity: 1;
532
+ color: rgb(156 163 175 / var(--tw-text-opacity, 1));
533
+ }
534
+ .s-offer-modal-condition-group {
535
+ display: flex;
536
+ flex-direction: column;
537
+ align-items: center;
538
+ gap: 0.25rem;
539
+ }
540
+ .s-offer-modal-condition-label {
541
+ font-size: 13px;
542
+ font-weight: 700;
543
+ --tw-text-opacity: 1;
544
+ color: rgb(107 114 128 / var(--tw-text-opacity, 1));
545
+ }
546
+ .s-offer-modal-condition-items {
547
+ display: flex;
548
+ flex-wrap: wrap;
549
+ justify-content: center;
550
+ column-gap: 0.75rem;
551
+ row-gap: 0.25rem;
552
+ }
@@ -2,6 +2,7 @@
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
4
  import { h } from "@stencil/core";
5
+ import { translate } from "../../Helpers/translate";
5
6
  import SpecialDiscountIcon from "../../assets/svg/special-discount.svg";
6
7
  import Tag from "../../assets/svg/tag.svg";
7
8
  import Cart2 from "../../assets/svg/cart2.svg";
@@ -124,6 +125,30 @@ export class SallaOfferModal {
124
125
  this.emitPromotionClicked(this.offer);
125
126
  salla.api.withoutNotifier(() => salla.cart.quickAdd(this.productID, qty, this.offer_type)).then(() => this.modal.close());
126
127
  }
128
+ /**
129
+ * Conditions attached to the offer — spend floor, discount ceiling, eligible
130
+ * payment methods and branch restriction. Rendered outside `getOfferContent()`
131
+ * because that method returns a single element per offer shape, while these
132
+ * apply across all of them.
133
+ */
134
+ getOfferConditions() {
135
+ const buy = this.offer.buy || {};
136
+ const get = this.offer.get || {};
137
+ const branches = this.offer.branches || [];
138
+ const paymentMethods = buy.payment_methods || [];
139
+ const hasMinAmount = buy.min_amount > 0;
140
+ const hasMinItems = buy.min_items > 0;
141
+ const hasMaxDiscount = get.max_discount_amount > 0;
142
+ if (!hasMinAmount && !hasMinItems && !hasMaxDiscount && !paymentMethods.length && !branches.length) {
143
+ return null;
144
+ }
145
+ return h("div", { class: "s-offer-modal-conditions" }, hasMinAmount &&
146
+ h("p", { class: "s-offer-modal-condition", innerHTML: translate('pages.offer.min_spend_amount', { amount: salla.money(buy.min_amount), currency: '' }, `بحد أدنى ${salla.money(buy.min_amount)} من مبلغ الشراء`) }), hasMinItems &&
147
+ h("p", { class: "s-offer-modal-condition" }, translate('pages.offer.min_items', { items: buy.min_items }, `بحد أدنى ${buy.min_items} منتجات`)), hasMaxDiscount &&
148
+ h("p", { class: "s-offer-modal-condition", innerHTML: translate('pages.offer.max_discount_amount', { amount: salla.money(get.max_discount_amount), currency: '' }, `بحد أقصى ${salla.money(get.max_discount_amount)} للخصم`) }), !!paymentMethods.length &&
149
+ h("div", { class: "s-offer-modal-condition-group" }, h("span", { class: "s-offer-modal-condition-label" }, translate('pages.offer.payment_methods', {}, 'طرق الدفع')), h("div", { class: "s-offer-modal-condition-items" }, paymentMethods.map((method) => h("span", { class: "s-offer-modal-badge-text" }, method.name)))), !!branches.length &&
150
+ h("div", { class: "s-offer-modal-condition-group" }, h("span", { class: "s-offer-modal-condition-label" }, translate('pages.offer.available_branches', {}, 'الفروع المتاحة')), h("div", { class: "s-offer-modal-condition-items" }, branches.map((branch) => h("span", { class: "s-offer-modal-badge-text" }, branch.name)))));
151
+ }
127
152
  getOfferContent() {
128
153
  if (this.offer.get.discounts_table) {
129
154
  return h("div", { class: "s-offer-modal-discount-table" }, h("table", null, h("tbody", null, this.offer.get.discounts_table?.map(discount => h("tr", null, h("td", null, discount.text), h("td", { class: "s-offer-modal-discount-table-cell" }, h("salla-button", { fill: "outline", shape: "btn", color: "primary", size: "medium", width: "normal", onClick: () => this.addToCart(discount.quantity) }, this.addToCartLabel)))))));
@@ -205,8 +230,9 @@ export class SallaOfferModal {
205
230
  // '</div>';
206
231
  // }
207
232
  render() {
208
- return h("salla-modal", { key: 'fc50768aeae326779fc8321f98be591f19694877', "has-skeleton": true, "sub-title": this.offer_message, ref: modal => this.modal = modal, isLoading: true, class: `s-offer-modal-type-${this.offer_type ? this.offer_type : ''}` }, h("div", { key: '0acb2bcfd86d7c43ffb806d9ef1c60ddf6babbe3', slot: 'loading' }, h("div", { key: '9d71931ba0fe2da318b111938f8df049c8bcba3f', class: "s-offer-modal-skeleton" }, h("div", { key: '2c56879682a5587f895b98122b11f7ac9b854277', class: "s-offer-modal-skeleton-header" }, h("salla-skeleton", { key: '58fcd5fe1bacde1f1bc289142821dbf2b98936ea', type: 'circle', height: '80px', width: '80px' }), h("salla-skeleton", { key: '2ff2cf01d0423560b51a4a1ca1cb5957aad07571', height: '15px', width: '50%' }), h("salla-skeleton", { key: '879bc41293537d830604d056328a5390d1f83677', height: '10px', width: '30%' })), h("div", { key: 'c56c86160c0aa8cb9bab302adac0bb3ce6f0b544', class: "s-offer-modal-skeleton-items" }, [...Array(3)].map(() => h("div", { class: "s-offer-modal-skeleton-item" }, h("salla-skeleton", { height: '9rem' }), h("div", { class: "s-offer-modal-skeleton-item-title" }, h("salla-skeleton", { height: '15px', width: '100%' })), h("div", { class: "s-offer-modal-skeleton-item-subtitle" }, h("salla-skeleton", { height: '9px', width: '50%' }), h("div", { innerHTML: Cart2 }))))), h("div", { key: '7ae342a4e8bcb1acb104a7faaa51591453342446', class: "s-offer-modal-skeleton-footer" }, h("salla-skeleton", { key: '064b069c56f8db50b508382f7a1b3d40aa929faf', height: '15px', width: '50%' }), h("salla-skeleton", { key: 'b8da7d4dea95f74e68954b69866f3e0c4c5d04c1', height: '15px', width: '30%' })))), !this.hasError && this.offer !== null
209
- ? [h("span", { slot: 'icon', class: "s-offer-modal-header-icon", innerHTML: SpecialDiscountIcon }), this.getOfferContent(), h("div", { class: "s-offer-modal-footer", slot: "footer" }, this.offer.formatted_date ?
233
+ return h("salla-modal", { key: '65f0a5622466ab72be96f7a251e6ebab29c3f30c', "has-skeleton": true, "sub-title": this.offer_message, ref: modal => this.modal = modal, isLoading: true, class: `s-offer-modal-type-${this.offer_type ? this.offer_type : ''}` }, h("div", { key: 'cb235e4d13b95673bde9bd5eeac1ee1ff7e0c1f4', slot: 'loading' }, h("div", { key: '249ced69c178e7071cb100c11829120f2b0a52b6', class: "s-offer-modal-skeleton" }, h("div", { key: '44da044786147e7b693866a7b3e776742622a7d2', class: "s-offer-modal-skeleton-header" }, h("salla-skeleton", { key: 'cca94fa75f1086118dcce2dd6e4099cc09d9db7c', type: 'circle', height: '80px', width: '80px' }), h("salla-skeleton", { key: 'a0e1548a9f168c724b9353fca617ed55407b8537', height: '15px', width: '50%' }), h("salla-skeleton", { key: '72fd306f044249a568fc5ddf75eed898685955a5', height: '10px', width: '30%' })), h("div", { key: 'c54ceb5db0887372d487448c39cf1f2fe2b9cfd6', class: "s-offer-modal-skeleton-items" }, [...Array(3)].map(() => h("div", { class: "s-offer-modal-skeleton-item" }, h("salla-skeleton", { height: '9rem' }), h("div", { class: "s-offer-modal-skeleton-item-title" }, h("salla-skeleton", { height: '15px', width: '100%' })), h("div", { class: "s-offer-modal-skeleton-item-subtitle" }, h("salla-skeleton", { height: '9px', width: '50%' }), h("div", { innerHTML: Cart2 }))))), h("div", { key: '82400b8a1b032ce266cbd093d04607cabd4334ce', class: "s-offer-modal-skeleton-footer" }, h("salla-skeleton", { key: '1898c3045f98af8a5fa70fc96544bdc93c8e21d2', height: '15px', width: '50%' }), h("salla-skeleton", { key: '2b3746f994eb9baaf5c8ed62e9b779fe6746a0a4', height: '15px', width: '30%' })))), !this.hasError && this.offer !== null
234
+ ? [h("span", { slot: 'icon', class: "s-offer-modal-header-icon", innerHTML: SpecialDiscountIcon }), this.getOfferContent(),
235
+ this.getOfferConditions(), h("div", { class: "s-offer-modal-footer", slot: "footer" }, this.offer.formatted_date ?
210
236
  h("p", { class: "s-offer-modal-expiry" }, salla.lang.get('pages.products.offer_expires_in'), " ", this.offer.formatted_date)
211
237
  : '', h("label", { class: "s-offer-modal-remember-label" }, h("input", { type: "checkbox", onChange: e => this.rememberMe(e), class: "s-offer-modal-remember-input" }), "\u00A0 ", salla.lang.get('common.elements.remember_my_choice'))),
212
238
  ] :
@@ -5,15 +5,20 @@ import { h } from "@stencil/core";
5
5
  import Helper from "../../Helpers/Helper";
6
6
  const FEEDBACK_STATUS_WAITING = 'waiting';
7
7
  const TAB_QUERY_PARAM = 'tab';
8
+ const SHOW_EXTERNAL_ORDERS_FEATURE = 'show-external-orders';
8
9
  function getFilterFromSearchParams() {
9
10
  const tab = new URLSearchParams(window.location.search).get(TAB_QUERY_PARAM);
10
- return tab === 'waiting' ? 'waiting' : 'all';
11
+ if (tab === 'waiting' || tab === 'archived')
12
+ return tab;
13
+ return 'all';
11
14
  }
12
15
  const LANG_DEFAULTS = {
13
16
  'pages.orders.filter_all': { ar: 'الكل', en: 'All' },
17
+ 'pages.orders.filter_archived': { ar: 'الطلبات المؤرشفة', en: 'Archived orders' },
14
18
  'pages.orders.filter_awaiting_review': { ar: 'بانتظار تقييمك', en: 'Awaiting your review' },
15
19
  'pages.orders.leave_review': { ar: 'أضف تقييمك', en: 'Add review' },
16
20
  'pages.orders.no_unrated_orders': { ar: 'لا توجد طلبات غير مقيَّمة', en: 'No unrated orders' },
21
+ 'pages.orders.no_archived_orders': { ar: 'لا توجد طلبات مؤرشفة', en: 'No archived orders' },
17
22
  'pages.orders.review_banner': {
18
23
  ar: 'لديك طلبات بانتظار تقييمك. شارك رأيك وساعدنا على تحسين تجربتك.',
19
24
  en: 'You have orders awaiting your review. Share your feedback and help us improve your experience.',
@@ -33,9 +38,11 @@ export class SallaOrder {
33
38
  this.load_more_text_trans = salla.lang.get('common.elements.load_more');
34
39
  this.languageCode = salla.lang.locale;
35
40
  this.filterAllText = salla.lang.getWithDefault('pages.orders.filter_all', 'الكل');
41
+ this.filterArchivedText = salla.lang.getWithDefault('pages.orders.filter_archived', 'الطلبات المؤرشفة');
36
42
  this.filterAwaitingReviewText = salla.lang.getWithDefault('pages.orders.filter_awaiting_review', 'بانتظار تقييمك');
37
43
  this.leaveReviewText = salla.lang.getWithDefault('pages.orders.leave_review', 'شارك تقييمك');
38
44
  this.noUnratedOrdersText = salla.lang.getWithDefault('pages.orders.no_unrated_orders', 'لا توجد طلبات غير مقيَّمة');
45
+ this.noArchivedOrdersText = salla.lang.getWithDefault('pages.orders.no_archived_orders', 'لا توجد طلبات مؤرشفة');
39
46
  this.orders = [];
40
47
  this.nextPage = null;
41
48
  this.activeFilter = getFilterFromSearchParams();
@@ -44,6 +51,7 @@ export class SallaOrder {
44
51
  this.isFetching = false;
45
52
  this.reviewPoints = 0;
46
53
  this.filterGeneration = 0;
54
+ this.showExternalOrders = false;
47
55
  salla.lang.onLoaded(() => {
48
56
  this.languageCode = salla.lang.locale;
49
57
  this.orderNumberText = salla.lang.get('pages.thank_you.order_id');
@@ -63,9 +71,11 @@ export class SallaOrder {
63
71
  }
64
72
  refreshReviewLabels() {
65
73
  this.filterAllText = salla.lang.getWithDefault('pages.orders.filter_all', 'الكل');
74
+ this.filterArchivedText = salla.lang.getWithDefault('pages.orders.filter_archived', 'الطلبات المؤرشفة');
66
75
  this.filterAwaitingReviewText = salla.lang.getWithDefault('pages.orders.filter_awaiting_review', 'بانتظار تقييمك');
67
76
  this.leaveReviewText = salla.lang.getWithDefault('pages.orders.leave_review', 'شارك تقييمك');
68
77
  this.noUnratedOrdersText = salla.lang.getWithDefault('pages.orders.no_unrated_orders', 'لا توجد طلبات غير مقيَّمة');
78
+ this.noArchivedOrdersText = salla.lang.getWithDefault('pages.orders.no_archived_orders', 'لا توجد طلبات مؤرشفة');
69
79
  }
70
80
  setupLoyalty() {
71
81
  // ? Flags
@@ -210,11 +220,11 @@ export class SallaOrder {
210
220
  return;
211
221
  this.setLoadMoreLoading(false);
212
222
  this.isFetching = true;
213
- // Rows are appended to the wrapper imperatively (outside Stencil's vdom), so
223
+ // Rows are appended to the table body imperatively (outside Stencil's vdom), so
214
224
  // switching the render branch to the skeleton table won't clear them on its
215
225
  // own — clear them explicitly or the old rows linger alongside the skeleton.
216
- if (this.wrapper) {
217
- this.wrapper.innerHTML = '';
226
+ if (this.ordersTableBody) {
227
+ this.ordersTableBody.innerHTML = '';
218
228
  }
219
229
  this.filterGeneration++;
220
230
  const feedbackStatus = filter === 'waiting' ? FEEDBACK_STATUS_WAITING : null;
@@ -224,6 +234,7 @@ export class SallaOrder {
224
234
  format: 'light',
225
235
  types: [''],
226
236
  feedback_status: feedbackStatus,
237
+ ...(filter === 'archived' ? { external_orders: 1 } : {}),
227
238
  });
228
239
  this.orders = resp.data;
229
240
  this.hasInfiniteScroll = !!resp.pagination?.links.next;
@@ -237,8 +248,8 @@ export class SallaOrder {
237
248
  }
238
249
  if (!this.orders.length) {
239
250
  this.setLoadMoreLoading(false);
240
- this.emptyFilterResult = filter === 'waiting';
241
- this.showPlaceholder = filter !== 'waiting';
251
+ this.emptyFilterResult = filter !== 'all';
252
+ this.showPlaceholder = filter === 'all';
242
253
  return;
243
254
  }
244
255
  this.showPlaceholder = false;
@@ -256,7 +267,9 @@ export class SallaOrder {
256
267
  }
257
268
  }
258
269
  getSingleOrderItem(order) {
259
- const referenceId = order.reference_id ?? '';
270
+ const orderNumber = String((this.activeFilter === 'archived' ? order.external_order_id : order.reference_id) ?? '');
271
+ // ponytail: # only for pure digits; alphanumeric external ids stay bare
272
+ const orderNumberLabel = /^\d+$/.test(orderNumber) ? `#${orderNumber}` : orderNumber;
260
273
  const tr = document.createElement('tr');
261
274
  tr.classList.add('s-orders-table-tbody-tr', 's-orders-table-tbody-tr-shadow');
262
275
  const td1 = document.createElement('td');
@@ -268,7 +281,7 @@ export class SallaOrder {
268
281
  span1.textContent = `${this.orderNumberText}:`;
269
282
  const span2 = document.createElement('span');
270
283
  span2.classList.add('s-orders-reference-id');
271
- span2.textContent = `#${referenceId}`;
284
+ span2.textContent = orderNumberLabel;
272
285
  div1.appendChild(span1);
273
286
  div1.appendChild(span2);
274
287
  if (order.source === 'buy_as_gift') {
@@ -286,7 +299,7 @@ export class SallaOrder {
286
299
  sallaButton.classList.add('relative');
287
300
  sallaButton.setAttribute('color', 'dark');
288
301
  sallaButton.setAttribute('shape', 'link');
289
- sallaButton.dataset.content = String(referenceId);
302
+ sallaButton.dataset.content = orderNumber;
290
303
  sallaButton.addEventListener('click', event => {
291
304
  Helper.copyToClipboard(event);
292
305
  Helper.toggleElementClassIf(sallaButton, 'copied', 'code-to-copy', () => true);
@@ -295,7 +308,7 @@ export class SallaOrder {
295
308
  }, 1000);
296
309
  });
297
310
  const span3 = document.createElement('span');
298
- span3.textContent = '#' + referenceId;
311
+ span3.textContent = orderNumberLabel;
299
312
  const copyIcon = document.createElement('i');
300
313
  copyIcon.classList.add('sicon-swap-stroke', 's-orders-copy-to-clipboard-button-icon');
301
314
  // Check the text direction
@@ -427,8 +440,13 @@ export class SallaOrder {
427
440
  renderSkeletonRows(count = 5) {
428
441
  return Array.from({ length: count }, (_, index) => this.renderSkeletonRow(index));
429
442
  }
443
+ getEmptyFilterText() {
444
+ return this.activeFilter === 'archived'
445
+ ? this.noArchivedOrdersText
446
+ : this.noUnratedOrdersText;
447
+ }
430
448
  renderFilters() {
431
- return (h("div", { class: "s-orders-filters" }, h("salla-button", { size: "small", color: this.activeFilter === 'all' ? 'primary' : 'light', fill: "outline", onClick: () => this.switchFilter('all'), enableLoader: false }, this.filterAllText), h("salla-button", { size: "small", color: this.activeFilter === 'waiting' ? 'primary' : 'light', fill: "outline", onClick: () => this.switchFilter('waiting'), enableLoader: false }, this.filterAwaitingReviewText)));
449
+ return (h("div", { class: "s-orders-filters" }, h("salla-button", { size: "small", color: this.activeFilter === 'all' ? 'primary' : 'light', fill: "outline", onClick: () => this.switchFilter('all'), enableLoader: false }, this.filterAllText), this.showExternalOrders && (h("salla-button", { size: "small", color: this.activeFilter === 'archived' ? 'primary' : 'light', fill: "outline", onClick: () => this.switchFilter('archived'), enableLoader: false }, this.filterArchivedText)), h("salla-button", { size: "small", color: this.activeFilter === 'waiting' ? 'primary' : 'light', fill: "outline", onClick: () => this.switchFilter('waiting'), enableLoader: false }, this.filterAwaitingReviewText)));
432
450
  }
433
451
  renderBanner() {
434
452
  if (!this.pendingReviewCount)
@@ -439,7 +457,7 @@ export class SallaOrder {
439
457
  if (this.showPlaceholder) {
440
458
  return (h("div", { class: "s-orders-no-content" }, h("i", { class: "sicon-packed-box icon" }), h("p", null, this.noOrderText)));
441
459
  }
442
- return (h("div", { class: "s-orders-wrapper" }, this.renderBanner(), this.renderFilters(), h("div", { class: "s-orders-list-wrapper" }, this.isFetching ? (h("table", { class: "s-orders-table s-orders-table-skeleton" }, this.renderTableHead(), h("tbody", { class: "s-orders-table-tbody" }, this.renderSkeletonRows()))) : this.emptyFilterResult ? (h("div", { class: "s-orders-no-content" }, h("i", { class: "sicon-packed-box icon" }), h("p", null, this.noUnratedOrdersText))) : (h("table", { class: "s-orders-table" }, this.renderTableHead(), h("tbody", { class: "s-orders-table-tbody", ref: element => (this.ordersTableBody = element) })))), this.nextPage && !this.emptyFilterResult && (h("div", { class: "s-infinite-scroll-wrapper", ref: status => (this.status = status) }, h("button", { type: "button", onClick: () => this.loadMore(), class: "s-infinite-scroll-btn s-button-btn s-button-primary" }, h("span", { class: "s-button-text s-infinite-scroll-btn-text" }, this.loadMoreText ?? this.load_more_text_trans), h("span", { class: "s-button-loader s-button-loader-center s-infinite-scroll-btn-loader", ref: btnLoader => (this.btnLoader = btnLoader), style: { display: 'none' } })))), h("salla-rating-modal", { ref: el => (this.ratingModal = el) })));
460
+ return (h("div", { class: "s-orders-wrapper" }, this.renderBanner(), this.renderFilters(), h("div", { class: "s-orders-list-wrapper" }, this.isFetching ? (h("table", { class: "s-orders-table s-orders-table-skeleton" }, this.renderTableHead(), h("tbody", { class: "s-orders-table-tbody" }, this.renderSkeletonRows()))) : this.emptyFilterResult ? (h("div", { class: "s-orders-no-content" }, h("i", { class: "sicon-packed-box icon" }), h("p", null, this.getEmptyFilterText()))) : (h("table", { class: "s-orders-table" }, this.renderTableHead(), h("tbody", { class: "s-orders-table-tbody", ref: element => (this.ordersTableBody = element) })))), this.nextPage && !this.emptyFilterResult && (h("div", { class: "s-infinite-scroll-wrapper", ref: status => (this.status = status) }, h("button", { type: "button", onClick: () => this.loadMore(), class: "s-infinite-scroll-btn s-button-btn s-button-primary" }, h("span", { class: "s-button-text s-infinite-scroll-btn-text" }, this.loadMoreText ?? this.load_more_text_trans), h("span", { class: "s-button-loader s-button-loader-center s-infinite-scroll-btn-loader", ref: btnLoader => (this.btnLoader = btnLoader), style: { display: 'none' } })))), h("salla-rating-modal", { ref: el => (this.ratingModal = el) })));
443
461
  }
444
462
  componentDidRender() {
445
463
  this.populateOrdersTableIfEmpty();
@@ -451,6 +469,13 @@ export class SallaOrder {
451
469
  });
452
470
  return salla.onReady().then(() => {
453
471
  this.setupLoyalty();
472
+ this.showExternalOrders = salla.config
473
+ .get('store.features', [])
474
+ .includes(SHOW_EXTERNAL_ORDERS_FEATURE);
475
+ if (this.activeFilter === 'archived' && !this.showExternalOrders) {
476
+ this.activeFilter = 'all';
477
+ this.syncFilterToSearchParams('all');
478
+ }
454
479
  const tasks = [this.fetchOrders(this.activeFilter)];
455
480
  // fetchOrders already resolves the pending count when the initial tab is "waiting"
456
481
  if (this.activeFilter !== 'waiting') {
@@ -527,9 +552,11 @@ export class SallaOrder {
527
552
  "load_more_text_trans": {},
528
553
  "languageCode": {},
529
554
  "filterAllText": {},
555
+ "filterArchivedText": {},
530
556
  "filterAwaitingReviewText": {},
531
557
  "leaveReviewText": {},
532
558
  "noUnratedOrdersText": {},
559
+ "noArchivedOrdersText": {},
533
560
  "orders": {},
534
561
  "pagination": {},
535
562
  "hasInfiniteScroll": {},