@salla.sa/twilight-components 2.14.438 → 2.14.440

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 (330) hide show
  1. package/dist/cjs/{filepond-DMRIHf1C.js → filepond-DOOLwTpX.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-CM9PlkkE.js → filepond-plugin-file-poster-D7nMzJ2p.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-CtgoDQtd.js → filepond-plugin-file-validate-size-DpCJ71im.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-DqSFCcfx.js → filepond-plugin-file-validate-type-CDZ5OaBc.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-k32QwoLh.js → filepond-plugin-image-edit-BzGZimte.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-BsOFwzDp.js → filepond-plugin-image-exif-orientation-D1fPPBi_.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-Bh5GBaFR.js → filepond-plugin-image-preview-CEhIwZKp.js} +1 -1
  8. package/dist/cjs/{functions-g_kb3rFp.js → functions-CdVaIsQM.js} +1 -1
  9. package/dist/cjs/{index-BUh2wfzU.js → index-E66k07Rj.js} +1 -1
  10. package/dist/cjs/{index-BFaAWRue.js → index-oqqfD8M2.js} +2 -2
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
  21. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  44. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  45. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  46. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  49. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  50. package/dist/cjs/salla-loyalty.cjs.entry.js +16 -6
  51. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-map.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +247 -42
  56. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +86 -25
  57. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-edit.cjs.entry.js +29 -5
  69. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-product-card-embed.cjs.entry.js +2 -2
  76. package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-reward-action_4.cjs.entry.js +13 -8
  83. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  98. package/dist/cjs/{tracked-promise-hdme5g67.js → tracked-promise-DV0VuqZL.js} +1 -1
  99. package/dist/cjs/twilight.cjs.js +2 -2
  100. package/dist/cjs/{vanilla-picker-D37h-mXi.js → vanilla-picker-DvOQTQXG.js} +1 -1
  101. package/dist/collection/components/salla-loyalty/salla-loyalty.js +17 -7
  102. package/dist/collection/components/salla-loyalty-program/salla-reward-exchange.js +10 -5
  103. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +278 -41
  104. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +18 -4
  105. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +107 -20
  106. package/dist/collection/components/salla-order-edit/salla-order-edit.js +47 -4
  107. package/dist/collection/components/salla-product-card-embed/salla-product-card-embed.css +32 -0
  108. package/dist/components/index.js +2 -2
  109. package/dist/components/salla-loyalty.js +15 -5
  110. package/dist/components/salla-multiple-bundle-product-details2.js +250 -42
  111. package/dist/components/salla-multiple-bundle-product-options-modal2.js +18 -4
  112. package/dist/components/salla-multiple-bundle-product-slider2.js +69 -20
  113. package/dist/components/salla-order-edit.js +29 -4
  114. package/dist/components/salla-product-card-embed.js +1 -1
  115. package/dist/components/salla-reward-exchange2.js +10 -5
  116. package/dist/esm/{filepond-B_eTEvbP.js → filepond-Crf00c7G.js} +1 -1
  117. package/dist/esm/{filepond-plugin-file-poster-C9WrU6X2.js → filepond-plugin-file-poster-B3uKBJe-.js} +1 -1
  118. package/dist/esm/{filepond-plugin-file-validate-size-CXza6gk6.js → filepond-plugin-file-validate-size-CWVDRdsV.js} +1 -1
  119. package/dist/esm/{filepond-plugin-file-validate-type-NwmI_I3c.js → filepond-plugin-file-validate-type-VQGNZwF9.js} +1 -1
  120. package/dist/esm/{filepond-plugin-image-edit-BkFkrboM.js → filepond-plugin-image-edit-DOhXVk8j.js} +1 -1
  121. package/dist/esm/{filepond-plugin-image-exif-orientation-q63RMohC.js → filepond-plugin-image-exif-orientation-Co8jzTVW.js} +1 -1
  122. package/dist/esm/{filepond-plugin-image-preview-DBrJFq-R.js → filepond-plugin-image-preview-gQWAQlCp.js} +1 -1
  123. package/dist/esm/{functions-BiPE31Ri.js → functions-D8zpoRMj.js} +1 -1
  124. package/dist/esm/{index-DMFHjmvU.js → index-DX6k_dv6.js} +1 -1
  125. package/dist/esm/{index-DQ335bXf.js → index-XEcnGv2r.js} +2 -2
  126. package/dist/esm/loader.js +3 -3
  127. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  128. package/dist/esm/salla-accordion_6.entry.js +1 -1
  129. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  130. package/dist/esm/salla-advertisement.entry.js +1 -1
  131. package/dist/esm/salla-alert_2.entry.js +1 -1
  132. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  133. package/dist/esm/salla-apps-icons.entry.js +1 -1
  134. package/dist/esm/salla-badge.entry.js +1 -1
  135. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  136. package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
  137. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  138. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  139. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  140. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  141. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  142. package/dist/esm/salla-contacts.entry.js +1 -1
  143. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  144. package/dist/esm/salla-count-down.entry.js +1 -1
  145. package/dist/esm/salla-custom-fields.entry.js +1 -1
  146. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  147. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  148. package/dist/esm/salla-filters-widget.entry.js +1 -1
  149. package/dist/esm/salla-filters.entry.js +1 -1
  150. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  151. package/dist/esm/salla-gifting.entry.js +1 -1
  152. package/dist/esm/salla-hook.entry.js +1 -1
  153. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  154. package/dist/esm/salla-installment.entry.js +1 -1
  155. package/dist/esm/salla-list-tile.entry.js +1 -1
  156. package/dist/esm/salla-localization-modal.entry.js +1 -1
  157. package/dist/esm/salla-login-modal.entry.js +1 -1
  158. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  159. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  160. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  161. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  162. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  163. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  164. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  165. package/dist/esm/salla-loyalty.entry.js +16 -6
  166. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  167. package/dist/esm/salla-map.entry.js +1 -1
  168. package/dist/esm/salla-menu.entry.js +1 -1
  169. package/dist/esm/salla-metadata.entry.js +1 -1
  170. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +247 -42
  171. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +86 -25
  172. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  173. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  174. package/dist/esm/salla-notification-item.entry.js +1 -1
  175. package/dist/esm/salla-notifications.entry.js +1 -1
  176. package/dist/esm/salla-offer-modal.entry.js +1 -1
  177. package/dist/esm/salla-offer.entry.js +1 -1
  178. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  179. package/dist/esm/salla-order-details-options.entry.js +1 -1
  180. package/dist/esm/salla-order-details.entry.js +1 -1
  181. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  182. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  183. package/dist/esm/salla-order-edit.entry.js +29 -5
  184. package/dist/esm/salla-order-summary.entry.js +1 -1
  185. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  186. package/dist/esm/salla-orders.entry.js +1 -1
  187. package/dist/esm/salla-payments.entry.js +1 -1
  188. package/dist/esm/salla-placeholder.entry.js +1 -1
  189. package/dist/esm/salla-price-range.entry.js +1 -1
  190. package/dist/esm/salla-product-card-embed.entry.js +2 -2
  191. package/dist/esm/salla-product-card_2.entry.js +1 -1
  192. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  193. package/dist/esm/salla-products-list.entry.js +1 -1
  194. package/dist/esm/salla-progress-bar.entry.js +1 -1
  195. package/dist/esm/salla-quick-order.entry.js +1 -1
  196. package/dist/esm/salla-rating-modal.entry.js +1 -1
  197. package/dist/esm/salla-reward-action_4.entry.js +13 -8
  198. package/dist/esm/salla-scopes.entry.js +1 -1
  199. package/dist/esm/salla-search.entry.js +1 -1
  200. package/dist/esm/salla-skeleton.entry.js +1 -1
  201. package/dist/esm/salla-slider.entry.js +1 -1
  202. package/dist/esm/salla-social-share.entry.js +1 -1
  203. package/dist/esm/salla-social.entry.js +1 -1
  204. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  205. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  206. package/dist/esm/salla-tooltip.entry.js +1 -1
  207. package/dist/esm/salla-trust-badges.entry.js +1 -1
  208. package/dist/esm/salla-user-menu.entry.js +1 -1
  209. package/dist/esm/salla-user-profile.entry.js +1 -1
  210. package/dist/esm/salla-user-settings.entry.js +1 -1
  211. package/dist/esm/salla-verify.entry.js +1 -1
  212. package/dist/esm/salla-wallet.entry.js +1 -1
  213. package/dist/esm/{tracked-promise-BhtDirMQ.js → tracked-promise-DhOWivzL.js} +1 -1
  214. package/dist/esm/twilight.js +3 -3
  215. package/dist/esm/{vanilla-picker-BzZq8SzV.js → vanilla-picker-C0njJzZd.js} +1 -1
  216. package/dist/twilight/{p-d4e63cb0.entry.js → p-00b633b2.entry.js} +1 -1
  217. package/dist/twilight/{p-221134fb.entry.js → p-0238a9dd.entry.js} +1 -1
  218. package/dist/twilight/{p-6e08db14.entry.js → p-05ae76f4.entry.js} +1 -1
  219. package/dist/twilight/{p-aa36205d.entry.js → p-06f77f81.entry.js} +1 -1
  220. package/dist/twilight/{p-07be70d2.entry.js → p-07d26676.entry.js} +1 -1
  221. package/dist/twilight/{p-f1557ed0.entry.js → p-07f973b1.entry.js} +1 -1
  222. package/dist/twilight/{p-b9c8c411.entry.js → p-0c342e2d.entry.js} +1 -1
  223. package/dist/twilight/{p-369177eb.entry.js → p-11da2f39.entry.js} +1 -1
  224. package/dist/twilight/{p-6cec9d8b.entry.js → p-1d8eb252.entry.js} +1 -1
  225. package/dist/twilight/{p-5fed66db.entry.js → p-203d6ae6.entry.js} +1 -1
  226. package/dist/twilight/{p-c30d45a8.entry.js → p-2cae7b1c.entry.js} +1 -1
  227. package/dist/twilight/{p-d066ae04.entry.js → p-2dce17b0.entry.js} +1 -1
  228. package/dist/twilight/{p-5fb93465.entry.js → p-2eddcffd.entry.js} +1 -1
  229. package/dist/twilight/{p-6d38d301.entry.js → p-31b06705.entry.js} +1 -1
  230. package/dist/twilight/{p-3be9c04b.entry.js → p-33362e8b.entry.js} +1 -1
  231. package/dist/twilight/{p-3e154bc2.entry.js → p-39498902.entry.js} +1 -1
  232. package/dist/twilight/{p-e6f8fcfc.entry.js → p-3ba87443.entry.js} +1 -1
  233. package/dist/twilight/{p-daafcb01.entry.js → p-3e054be0.entry.js} +1 -1
  234. package/dist/twilight/{p-589cb52c.entry.js → p-3edb7319.entry.js} +1 -1
  235. package/dist/twilight/{p-bea852ea.entry.js → p-461cd74c.entry.js} +1 -1
  236. package/dist/twilight/{p-881a5342.entry.js → p-476c4acb.entry.js} +1 -1
  237. package/dist/twilight/{p-b4092e4a.entry.js → p-4a3b5eca.entry.js} +1 -1
  238. package/dist/twilight/p-4e52fd6c.entry.js +4 -0
  239. package/dist/twilight/{p-f8b95b7e.entry.js → p-55dfaddd.entry.js} +1 -1
  240. package/dist/twilight/{p-a0206469.entry.js → p-56bd83f4.entry.js} +1 -1
  241. package/dist/twilight/{p-eb2d7c1e.entry.js → p-57a9293b.entry.js} +1 -1
  242. package/dist/twilight/{p-4897c441.entry.js → p-5c972b65.entry.js} +1 -1
  243. package/dist/twilight/{p-33d27bc3.entry.js → p-5df17c20.entry.js} +1 -1
  244. package/dist/twilight/p-5e643edb.entry.js +4 -0
  245. package/dist/twilight/{p-2d79709b.entry.js → p-5fd650c4.entry.js} +1 -1
  246. package/dist/twilight/{p-9696f2bd.entry.js → p-60d7a5e2.entry.js} +1 -1
  247. package/dist/twilight/{p-718e1549.entry.js → p-6ab3e94b.entry.js} +1 -1
  248. package/dist/twilight/{p-ff688f7c.entry.js → p-6c63e8a6.entry.js} +1 -1
  249. package/dist/twilight/{p-2b7ee145.entry.js → p-6d35b20c.entry.js} +1 -1
  250. package/dist/twilight/{p-be37a491.entry.js → p-6fed57e8.entry.js} +1 -1
  251. package/dist/twilight/{p-ef9ca9c4.entry.js → p-6ff38910.entry.js} +1 -1
  252. package/dist/twilight/{p-d5faf3f2.entry.js → p-78be4e2c.entry.js} +1 -1
  253. package/dist/twilight/{p-8bacc84d.entry.js → p-8207fb6f.entry.js} +1 -1
  254. package/dist/twilight/{p-ebe41004.entry.js → p-854eb825.entry.js} +1 -1
  255. package/dist/twilight/{p-ed845161.entry.js → p-8a4da11a.entry.js} +1 -1
  256. package/dist/twilight/{p-d8db1e81.entry.js → p-8c34fab2.entry.js} +1 -1
  257. package/dist/twilight/{p-6202fa66.entry.js → p-924555bd.entry.js} +1 -1
  258. package/dist/twilight/p-925690e3.entry.js +4 -0
  259. package/dist/twilight/{p-297ec2ce.entry.js → p-925869b3.entry.js} +1 -1
  260. package/dist/twilight/{p-bb8c7088.entry.js → p-93e060da.entry.js} +1 -1
  261. package/dist/twilight/{p-ff876842.entry.js → p-94b31962.entry.js} +1 -1
  262. package/dist/twilight/{p-24e09615.entry.js → p-9731d50b.entry.js} +1 -1
  263. package/dist/twilight/{p-0ddfb0d5.entry.js → p-9b2ba1e6.entry.js} +1 -1
  264. package/dist/twilight/{p-7eb778b4.entry.js → p-9c2942c3.entry.js} +1 -1
  265. package/dist/twilight/{p-a346db45.entry.js → p-9c3d5fdc.entry.js} +1 -1
  266. package/dist/twilight/{p-DWu6q1tc.js → p-B2jZw8NF.js} +1 -1
  267. package/dist/twilight/{p-CTwbej6G.js → p-B5kt5KrJ.js} +1 -1
  268. package/dist/twilight/{p-DMjajnP-.js → p-CMvDceec.js} +1 -1
  269. package/dist/twilight/{p-DjXDHHNL.js → p-Cw0D47mx.js} +1 -1
  270. package/dist/twilight/{p-RIEsmIVs.js → p-DL6eUQYK.js} +1 -1
  271. package/dist/twilight/{p-BUMSWZZf.js → p-DWyUFC7G.js} +1 -1
  272. package/dist/twilight/{p-Fxr_hOjI.js → p-DXDm8GqM.js} +1 -1
  273. package/dist/twilight/{p-w0fuGkIE.js → p-Dar-Px4H.js} +1 -1
  274. package/dist/twilight/{p-DoYiSf8E.js → p-DrCHWc9_.js} +1 -1
  275. package/dist/twilight/{p-wzq5caUN.js → p-DvOajQJL.js} +1 -1
  276. package/dist/twilight/{p-DQ335bXf.js → p-XEcnGv2r.js} +1 -1
  277. package/dist/twilight/p-YUFLgZi3.js +9 -0
  278. package/dist/twilight/{p-6fa0cf74.entry.js → p-a14b7bb6.entry.js} +1 -1
  279. package/dist/twilight/{p-11eecd61.entry.js → p-a2fa4306.entry.js} +1 -1
  280. package/dist/twilight/{p-9cf93a24.entry.js → p-a49d9c6e.entry.js} +1 -1
  281. package/dist/twilight/{p-cfd727fa.entry.js → p-aaf3736b.entry.js} +1 -1
  282. package/dist/twilight/{p-d4b8eba6.entry.js → p-aeeec3d8.entry.js} +1 -1
  283. package/dist/twilight/{p-2e289f17.entry.js → p-b1f79652.entry.js} +1 -1
  284. package/dist/twilight/p-b352e237.entry.js +4 -0
  285. package/dist/twilight/{p-85716765.entry.js → p-b3859adb.entry.js} +1 -1
  286. package/dist/twilight/{p-70736834.entry.js → p-b7e4542c.entry.js} +1 -1
  287. package/dist/twilight/{p-d20aefbc.entry.js → p-bea56108.entry.js} +1 -1
  288. package/dist/twilight/{p-a0791739.entry.js → p-c0162a6e.entry.js} +1 -1
  289. package/dist/twilight/{p-b57c111f.entry.js → p-c12ff95c.entry.js} +1 -1
  290. package/dist/twilight/{p-3388bef7.entry.js → p-c3432589.entry.js} +1 -1
  291. package/dist/twilight/{p-0cff0922.entry.js → p-c5250fca.entry.js} +1 -1
  292. package/dist/twilight/{p-ae40f1ae.entry.js → p-c55b672d.entry.js} +1 -1
  293. package/dist/twilight/{p-541ff06e.entry.js → p-c612ad0b.entry.js} +1 -1
  294. package/dist/twilight/{p-07beed15.entry.js → p-c999abc3.entry.js} +1 -1
  295. package/dist/twilight/{p-d8878610.entry.js → p-cd5722c4.entry.js} +1 -1
  296. package/dist/twilight/{p-0d3c80d3.entry.js → p-cff61b58.entry.js} +1 -1
  297. package/dist/twilight/{p-c0dc55a8.entry.js → p-d0b10f8b.entry.js} +1 -1
  298. package/dist/twilight/{p-26731090.entry.js → p-d1808642.entry.js} +1 -1
  299. package/dist/twilight/{p-cbad4eaa.entry.js → p-d1bfd0bc.entry.js} +1 -1
  300. package/dist/twilight/{p-c8971552.entry.js → p-d1e67236.entry.js} +1 -1
  301. package/dist/twilight/{p-fa3ad81b.entry.js → p-d34f2a6c.entry.js} +1 -1
  302. package/dist/twilight/{p-655adc8d.entry.js → p-d473010e.entry.js} +1 -1
  303. package/dist/twilight/{p-c756f476.entry.js → p-deaebd7b.entry.js} +1 -1
  304. package/dist/twilight/{p-ca19f9fb.entry.js → p-e50b4426.entry.js} +1 -1
  305. package/dist/twilight/p-eab889dc.entry.js +4 -0
  306. package/dist/twilight/{p-037a87a1.entry.js → p-ed55bd99.entry.js} +1 -1
  307. package/dist/twilight/{p-bbcb1943.entry.js → p-ed770165.entry.js} +1 -1
  308. package/dist/twilight/{p-a17e97a0.entry.js → p-f076d705.entry.js} +1 -1
  309. package/dist/twilight/{p-4c211080.entry.js → p-f1bed530.entry.js} +1 -1
  310. package/dist/twilight/p-f34ea06b.entry.js +4 -0
  311. package/dist/twilight/{p-2f2c7468.entry.js → p-f5207897.entry.js} +1 -1
  312. package/dist/twilight/{p-0a5550c2.entry.js → p-f668e5dd.entry.js} +1 -1
  313. package/dist/twilight/{p-6e4e0af9.entry.js → p-f8d7196e.entry.js} +1 -1
  314. package/dist/twilight/twilight.esm.js +1 -1
  315. package/dist/types/components/salla-loyalty/salla-loyalty.d.ts +2 -1
  316. package/dist/types/components/salla-loyalty-program/salla-reward-exchange.d.ts +1 -0
  317. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.d.ts +20 -0
  318. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.d.ts +1 -0
  319. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.d.ts +9 -0
  320. package/dist/types/components/salla-multiple-bundle-product/interfaces.d.ts +1 -0
  321. package/dist/types/components/salla-order-edit/salla-order-edit.d.ts +4 -0
  322. package/dist/types/components.d.ts +30 -1
  323. package/package.json +5 -5
  324. package/dist/twilight/p-21f83b12.entry.js +0 -4
  325. package/dist/twilight/p-23d555d3.entry.js +0 -4
  326. package/dist/twilight/p-6e4d10a8.entry.js +0 -4
  327. package/dist/twilight/p-7fbf8aef.entry.js +0 -4
  328. package/dist/twilight/p-8b0a38e7.entry.js +0 -4
  329. package/dist/twilight/p-QRBCTWM0.js +0 -9
  330. package/dist/twilight/p-a7fcca2e.entry.js +0 -4
@@ -5,6 +5,7 @@ export declare class SallaRewardExchange {
5
5
  productId: number | null;
6
6
  exchange: TrackedPromiseState<any, [number, null, number]>;
7
7
  private reset;
8
+ private getApiErrorMessage;
8
9
  handleConfirm(): Promise<void>;
9
10
  handleCancel(): void;
10
11
  render(): any;
@@ -7,6 +7,22 @@ export declare class SallaMultipleBundleProductDetails {
7
7
  };
8
8
  private productSelectedHandler;
9
9
  host: HTMLElement;
10
+ private isSingleProductSection;
11
+ private getObligatoryMin;
12
+ private isProductSelectionLocked;
13
+ /** Empty max → cap is the number of products in the section. */
14
+ private getEffectiveMax;
15
+ private getSelectedCount;
16
+ private isAtSelectionLimit;
17
+ private canSelectProductInSection;
18
+ canSelectBundleProduct(sectionId: string | number, productId: string | number): Promise<boolean>;
19
+ private queryProductCheckbox;
20
+ private dispatchBubblingChange;
21
+ /** Uncheck checkbox, remove form inputs, and reset modal state for one product slot. */
22
+ private clearSectionProductSlot;
23
+ /** max=1: replace section selection and keep DOM/form in sync. */
24
+ private syncSectionSelection;
25
+ private autoSelectSingleProductSections;
10
26
  private clearProductFormData;
11
27
  private clearProductModalOptions;
12
28
  onSelectProduct: (sectionId: string | number, product: any) => void;
@@ -14,6 +30,10 @@ export declare class SallaMultipleBundleProductDetails {
14
30
  onSelectProductOptions: (product: any, sectionId: any) => void;
15
31
  private handleBundleSliderProductSelected;
16
32
  private handleBundleSliderProductOptionsSelected;
33
+ private getProgressStatus;
34
+ private getSectionSelectionNote;
35
+ handleSectionsChange(): void;
36
+ componentWillLoad(): void;
17
37
  private renderAccordionHeader;
18
38
  componentDidLoad(): void;
19
39
  disconnectedCallback(): void;
@@ -14,6 +14,7 @@ export declare class SallaMultipleBundleProductOptionsModal {
14
14
  isLoading: boolean;
15
15
  hasUnsavedChanges: boolean;
16
16
  validationErrors: string[];
17
+ private isProductAlreadySelected;
17
18
  private modal;
18
19
  private optionChangeListener;
19
20
  private checkboxChangeListener;
@@ -9,7 +9,14 @@ export declare class SallaMultipleBundleProductSlider {
9
9
  selectedProducts: {
10
10
  [sectionId: string]: Set<string | number>;
11
11
  };
12
+ /** When true, the selected product cannot be deselected (single-product section with min = 1). */
13
+ isSelectionLocked: boolean;
14
+ /** Maximum selectable products for this section (empty max → all products in section). */
15
+ selectionLimit: number;
12
16
  host: HTMLElement;
17
+ private getSelectedCount;
18
+ private isMaxSelectionReached;
19
+ private isProductSelectionDisabled;
13
20
  /** Emitted when a product is clicked/toggled within the slider. */
14
21
  productSelected: EventEmitter<{
15
22
  product: BundleProduct;
@@ -31,6 +38,8 @@ export declare class SallaMultipleBundleProductSlider {
31
38
  }>): void;
32
39
  private clearSavedOptionsState;
33
40
  private generateEventName;
41
+ private getCheckbox;
42
+ private preventLockedDeselect;
34
43
  private handleProductClick;
35
44
  private handleOptionsClick;
36
45
  render(): any;
@@ -78,6 +78,7 @@ export interface BundleSection {
78
78
  name: string;
79
79
  sort: number;
80
80
  obligatory_products?: number;
81
+ max_obligatory_products?: number;
81
82
  status?: boolean;
82
83
  products?: BundleProduct[];
83
84
  [key: string]: any;
@@ -11,6 +11,8 @@ export declare class SallaOrderEdit {
11
11
  orderId: string | number;
12
12
  /** Pre-loaded order data (JSON string). */
13
13
  orderData: string;
14
+ /** JSON-encoded array of category IDs to exclude from the products list (e.g. "[1,2,3]"). */
15
+ excludedCategories: string;
14
16
  order: OrderEditData;
15
17
  loading: boolean;
16
18
  error: string;
@@ -41,8 +43,10 @@ export declare class SallaOrderEdit {
41
43
  private readonly productsPanelMobileQuery;
42
44
  private readonly handleProductsPanelViewportChange;
43
45
  private readonly hasProductTypeFilter;
46
+ private readonly hasExcludedCategoriesFilter;
44
47
  private readonly normalizeProductsListArrayParams;
45
48
  private readonly handleBeforeBuildListUrl;
49
+ private getParsedExcludedCategories;
46
50
  private readonly defaultProductsListSource;
47
51
  private readonly debouncedProductSearch;
48
52
  componentWillLoad(): Promise<void>;
@@ -1536,7 +1536,7 @@ export namespace Components {
1536
1536
  * Exchange loyalty points with the selected prize item
1537
1537
  * @param loyalty_prize_id
1538
1538
  */
1539
- "exchangeLoyaltyPoint": () => Promise<any>;
1539
+ "exchangeLoyaltyPoint": () => Promise<void>;
1540
1540
  /**
1541
1541
  * Message to show for guest users.
1542
1542
  */
@@ -1828,6 +1828,7 @@ export namespace Components {
1828
1828
  "sections": BundleSection[];
1829
1829
  }
1830
1830
  interface SallaMultipleBundleProductDetails {
1831
+ "canSelectBundleProduct": (sectionId: string | number, productId: string | number) => Promise<boolean>;
1831
1832
  /**
1832
1833
  * The list of sections belonging to a bundle product.
1833
1834
  * @default []
@@ -1849,6 +1850,11 @@ export namespace Components {
1849
1850
  "refreshOptionsState": () => Promise<void>;
1850
1851
  }
1851
1852
  interface SallaMultipleBundleProductSlider {
1853
+ /**
1854
+ * When true, the selected product cannot be deselected (single-product section with min = 1).
1855
+ * @default false
1856
+ */
1857
+ "isSelectionLocked": boolean;
1852
1858
  /**
1853
1859
  * The data for the current bundle section being rendered in this slider.
1854
1860
  */
@@ -1862,6 +1868,11 @@ export namespace Components {
1862
1868
  * @default {}
1863
1869
  */
1864
1870
  "selectedProducts": { [sectionId: string]: Set<string | number> };
1871
+ /**
1872
+ * Maximum selectable products for this section (empty max → all products in section).
1873
+ * @default 0
1874
+ */
1875
+ "selectionLimit": number;
1865
1876
  }
1866
1877
  interface SallaNextOrderCoupon {
1867
1878
  }
@@ -1966,6 +1977,10 @@ export namespace Components {
1966
1977
  * as an editable card with quantity controls, editable options, and an order summary.
1967
1978
  */
1968
1979
  interface SallaOrderEdit {
1980
+ /**
1981
+ * JSON-encoded array of category IDs to exclude from the products list (e.g. "[1,2,3]").
1982
+ */
1983
+ "excludedCategories": string;
1969
1984
  /**
1970
1985
  * Pre-loaded order data (JSON string).
1971
1986
  */
@@ -6454,6 +6469,11 @@ declare namespace LocalJSX {
6454
6469
  }>) => void;
6455
6470
  }
6456
6471
  interface SallaMultipleBundleProductSlider {
6472
+ /**
6473
+ * When true, the selected product cannot be deselected (single-product section with min = 1).
6474
+ * @default false
6475
+ */
6476
+ "isSelectionLocked"?: boolean;
6457
6477
  /**
6458
6478
  * Emitted when the user clicks the "options" button on a product card.
6459
6479
  */
@@ -6478,6 +6498,11 @@ declare namespace LocalJSX {
6478
6498
  * @default {}
6479
6499
  */
6480
6500
  "selectedProducts"?: { [sectionId: string]: Set<string | number> };
6501
+ /**
6502
+ * Maximum selectable products for this section (empty max → all products in section).
6503
+ * @default 0
6504
+ */
6505
+ "selectionLimit"?: number;
6481
6506
  }
6482
6507
  interface SallaNextOrderCoupon {
6483
6508
  }
@@ -6572,6 +6597,10 @@ declare namespace LocalJSX {
6572
6597
  * as an editable card with quantity controls, editable options, and an order summary.
6573
6598
  */
6574
6599
  interface SallaOrderEdit {
6600
+ /**
6601
+ * JSON-encoded array of category IDs to exclude from the products list (e.g. "[1,2,3]").
6602
+ */
6603
+ "excludedCategories"?: string;
6575
6604
  /**
6576
6605
  * Pre-loaded order data (JSON string).
6577
6606
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight-components",
3
- "version": "2.14.438",
3
+ "version": "2.14.440",
4
4
  "license": "GPL-3.0",
5
5
  "author": "Salla Team <support@salla.dev> (https://salla.dev)",
6
6
  "bugs": {
@@ -79,9 +79,9 @@
79
79
  "typescript": "^5.4.5"
80
80
  },
81
81
  "dependencies": {
82
- "@salla.sa/applepay": "2.14.438",
83
- "@salla.sa/twilight": "2.14.438",
84
- "@salla.sa/twilight-tailwind-theme": "2.14.438",
82
+ "@salla.sa/applepay": "2.14.440",
83
+ "@salla.sa/twilight": "2.14.440",
84
+ "@salla.sa/twilight-tailwind-theme": "2.14.440",
85
85
  "@types/node": "^20.4.8",
86
86
  "animejs": "^3.2.2",
87
87
  "class-variance-authority": "0.7.0",
@@ -100,5 +100,5 @@
100
100
  "vanilla-lazyload": "^17.8.5",
101
101
  "vanilla-picker": "^2.12.2"
102
102
  },
103
- "gitHead": "ff5f5278fa96abaea52d1f2515ecd4ab79b814de"
103
+ "gitHead": "98862d7cbd385458f4f44feb1b795f993e855c19"
104
104
  }
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as t,h as s,H as a}from"./p-DQ335bXf.js";const d=class{constructor(s){t(this,s),this.loading=!1,this.hasError=!1,this.productData=null}async componentWillLoad(){await salla.onReady(),await this.fetchProduct()}componentDidRender(){this.renderCardNode()}fetchProduct(){return this.productId?(this.loading=!0,this.hasError=!1,salla.api.withoutNotifier((()=>salla.product.api.getDetails(this.productId))).then((t=>{const s=t.data;this.productData=s??null,this.hasError=!s})).catch((()=>{this.productData=null,this.hasError=!0})).finally((()=>{this.loading=!1}))):(this.productData=null,this.loading=!1,void(this.hasError=!1))}renderCardNode(){if(!this.cardContainer)return;if(this.cardContainer.textContent="",!this.productData||this.loading||this.hasError)return;const t=window.customElements.get("custom-salla-product-card")?"custom-salla-product-card":"salla-product-card",s=document.createElement(t);s.product=this.productData,this.cardContainer.appendChild(s)}render(){const t={"s-product-card-embed-card":!0,"s-product-card-embed-card-align-left":"left"===this.align,"s-product-card-embed-card-align-right":"right"===this.align,"s-product-card-embed-card-align-center":"center"===this.align};return s(a,{key:"77c85dadd3d886ab94323d5676b3a8135157352e"},this.hasError&&s("span",{key:"ee80e9375cbdbc08546ae6ad0d1020b32a3dafc8",class:"s-product-card-embed-fallback"}),s("div",{key:"50e35de032d0d66f7772a8e44b5744587307795c",class:t,ref:t=>{this.cardContainer=t}}))}};d.style="";export{d as salla_product_card_embed}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as t,c as s,h as i,H as e,a as n}from"./p-DQ335bXf.js";import{A as o,a as l}from"./p-Vqpj4CWE.js";const d=class{constructor(i){t(this,i),this.optionsSaved=s(this,"optionsSaved"),this.productSelected=s(this,"productSelected"),this.product=null,this.sectionId=null,this.sectionIndex=0,this.productIndex=0,this.selectedOptions={},this.optionsResetTokens={},this.isLoading=!1,this.hasUnsavedChanges=!1,this.validationErrors=[]}generateCacheKey(t,s,i){return`${t||"unknown"}-${s||0}-${i||"unknown"}`}handleProductChange(t){setTimeout((()=>{this.modal&&t&&this.modal.setTitle(t.name||"")}),100),this.validationErrors=[],this.hasUnsavedChanges=!1}async open(){this.modal?(this.isLoading=!0,this.product?.name&&this.modal.setTitle(this.product.name),this.modal.open(),setTimeout((async()=>{this.product?.id&&await this.initializeSelectedOptions(),this.product?.name&&this.modal.setTitle(this.product.name),this.modal.stopLoading(),this.isLoading=!1}),300)):requestAnimationFrame((()=>this.open()))}async close(){this.modal&&this.modal.close()}async refreshOptionsState(){this.selectedOptions={...this.selectedOptions}}componentDidLoad(){this.modalOpenListener=t=>{this.product=t.product,this.sectionId=t.sectionId||null,this.sectionIndex=t.sectionIndex||0,this.productIndex=t.productIndex||0,this.open()},salla.event.on("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener=t=>{t&&t.productId&&this.clearProductOptions(t.productId,t.sectionId,t.productIndex)},salla.event.on("multiple-bundle-product-modal::clear-options",this.clearOptionsListener),this.optionChangeListener=t=>{const s=t.detail||t,{option:i,detail:e}=s,n=i||s.option_id&&this.product?.options?.find((t=>t.id===s.option_id||String(t.id)===String(s.option_id))),o=e||(s.id?s:null);this.product?.id&&n&&this.handleOptionChange(Number(this.product.id),n,o)},salla.event.on("product-options::change",this.optionChangeListener),this.checkboxChangeListener=t=>{const s=t.target;if(s&&"checkbox"===s.type&&s.name&&s.name.includes("bundle[")&&s.name.includes("][id]")){const t=s.name.match(/^bundle\[([^\]]+)\]\[([^\]]+)\]\[id\]$/);if(t&&!s.checked){const[,i,e]=t,n=s.value,o=this.host.closest("form");this.cleanupProductDeselection({sectionId:i,productIndex:parseInt(e,10),productId:n,form:o,uncheckedInput:s})}}},document.addEventListener("change",this.checkboxChangeListener)}disconnectedCallback(){this.checkboxChangeListener&&document.removeEventListener("change",this.checkboxChangeListener),this.optionChangeListener&&salla.event.off("product-options::change",this.optionChangeListener),this.modalOpenListener&&salla.event.off("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener&&salla.event.off("multiple-bundle-product-modal::clear-options",this.clearOptionsListener)}cleanupProductDeselection(t){const{sectionId:s,productIndex:i,productId:e,form:n,uncheckedInput:o}=t;if(this.clearProductOptions(e,s,i),n){const t=`bundle[${s}][${i}]`;Array.from(n.querySelectorAll(`input[name^="${t}"]`)).forEach((s=>{if(s===o)return;const i="hidden"===s.type,n=s.getAttribute("data-product-id")===String(e)&&s.name?.startsWith(t);(i||n)&&s.remove()})),requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});n.dispatchEvent(t)}))}}generateFormInputName(t,s,i){return`bundle[${t}][${s}][options][${i}]`}async initializeSelectedOptions(){if(!this.product?.id)return;const t=this.product.id,s=this.generateCacheKey(this.sectionId,this.productIndex,t),i=document.querySelector(`salla-product-options[product-id="${t}"]`);if(i)try{const t=await i.getSelectedOptions();t&&t.length>0&&(this.selectedOptions={...this.selectedOptions,[s]:t})}catch(t){console.warn("Could not initialize selected options:",t)}}clearProductOptions(t,s,i){const e={...this.selectedOptions};if(null==s||null==i||Number.isNaN(i)){const s=`-${String(t)}`,i=[];Object.keys(e).forEach((t=>{t.endsWith(s)&&(delete e[t],i.push(t))})),i.forEach((t=>this.bumpOptionsResetToken(t)))}else{const n=this.generateCacheKey(s,i,t);delete e[n],this.bumpOptionsResetToken(n)}this.selectedOptions=e,this.validationErrors=[],this.hasUnsavedChanges=!1}bumpOptionsResetToken(t){t&&(this.optionsResetTokens={...this.optionsResetTokens,[t]:(this.optionsResetTokens[t]||0)+1})}async handleOptionChange(t,s,i){const e=this.generateCacheKey(this.sectionId,this.productIndex,t),n=document.querySelector(`salla-product-options[product-id="${t}"]`);let o=[];if(n)try{o=await n.getSelectedOptions()||[]}catch(t){console.warn("Could not get current selections from component:",t)}if(o.length>0)this.selectedOptions={...this.selectedOptions,[e]:o};else if(this.selectedOptions[e]&&this.selectedOptions[e].length>0){const t=[...this.selectedOptions[e]||[]],n=t.findIndex((t=>t.option_id===s.id));n>-1?i&&null!=i.id?t[n]={...i,option_id:s.id}:t.splice(n,1):i&&null!=i.id&&t.push({...i,option_id:s.id}),this.selectedOptions={...this.selectedOptions,[e]:t}}else i&&null!=i.id&&(this.selectedOptions={...this.selectedOptions,[e]:[{...i,option_id:s.id}]});this.hasUnsavedChanges=!0,this.validationErrors=[]}async validateOptions(){if(!this.product?.options)return!0;const t=[],s=this.product.id,i=this.generateCacheKey(this.sectionId,this.productIndex,s),e=document.querySelector(`salla-product-options[product-id="${s}"]`);let n=[];if(e)try{n=await e.getSelectedOptions()||[];const t=this.selectedOptions[i]||[];(t.length>n.length||0===n.length&&t.length>0)&&(n=t)}catch(t){n=this.selectedOptions[i]||[]}else n=this.selectedOptions[i]||[];return 0===n.length&&t.push(salla.lang.get("pages.products.no_options_selected")),this.product.options.forEach((s=>{s.required&&(n.some((t=>t.option_id==s.id))||t.push(salla.lang.get("pages.products.required_option_missing",{option:s.name})))})),this.validationErrors=t,0===t.length}async onSave(t){t.preventDefault();const s=this.product?.id;if(!s)return;const i=this.generateCacheKey(this.sectionId,this.productIndex,s);if(await new Promise((t=>setTimeout(t,100))),await this.validateOptions()){this.isLoading=!0;try{const t=document.querySelector(`salla-product-options[product-id="${s}"]`);let e=await(t?.getSelectedOptions());if((!e||0===e.length)&&this.selectedOptions[i]?.length>0&&(e=this.selectedOptions[i]),!e||0===e.length)return void(this.isLoading=!1);this.selectedOptions={...this.selectedOptions,[i]:e};const n=this.host.closest("form");if(!n)return void(this.isLoading=!1);const o=`bundle[${this.sectionId}][${this.productIndex}]`;Array.from(n.querySelectorAll(`input[name^="${o}"][type="hidden"]`)).forEach((t=>t.remove())),Array.from(n.querySelectorAll(`[data-product-id="${s}"][name^="${o}"]`)).forEach((t=>t.remove()));const l=`bundle[${this.sectionId}][${this.productIndex}][id]`,d=document.getElementById(l);if(d)d.checked=!0;else{const t=document.createElement("input");t.type="hidden",t.name=`bundle[${this.sectionId}][${this.productIndex}][id]`,t.value=String(s),t.dataset.productId=String(s),n.appendChild(t)}e.forEach((t=>{const i=t.option_id,e=document.createElement("input");e.type="hidden",e.name=this.generateFormInputName(this.sectionId,this.productIndex??0,i),e.value=String(t.id),e.dataset.productId=String(s),n.appendChild(e)}));const a=new window.Event("change",{bubbles:!0});n.dispatchEvent(a),this.optionsSaved.emit({productId:Number(s),selectedOptions:e,sectionId:this.sectionId,productIndex:this.productIndex}),this.sectionId&&this.productSelected.emit({productId:Number(s),sectionId:this.sectionId,product:this.product,fromModal:!0}),salla.notify.success(salla.lang.get("pages.products.options_saved")),this.hasUnsavedChanges=!1,this.validationErrors=[],this.modal.close()}catch(t){salla.notify.error(salla.lang.get("pages.products.options_save_error"))}finally{this.isLoading=!1}}else salla.notify.error(this.validationErrors.join(", "))}getOptionsWithSelectedState(){if(!this.product?.options)return[];const t=this.generateCacheKey(this.sectionId,this.productIndex,this.product.id),s=this.selectedOptions[t]||[];return this.product.options.map((t=>({...t,details:t.details.map((t=>{const i=s.some((s=>s.id===t.id));return{...t,is_selected:i}}))})))}render(){const t=this.product?.id,s=this.getOptionsWithSelectedState(),n=this.generateCacheKey(this.sectionId,this.productIndex,t),o=this.optionsResetTokens[n]||0,l=this.isLoading||s.some((t=>t.details.some((t=>t.is_selected&&!0===t.is_out))));return i(e,{key:"d9dc4018798fe902048f3e3e37fcb2edf84713b0"},i("salla-modal",{key:"af3cc56a9c2c969dc0cbb2b4caba14fd270a11bb",isLoading:this.isLoading,ref:t=>this.modal=t,width:"md",centered:!1,id:`s-multiple-bundle-product-options-modal-options-${t}`,class:"s-multiple-bundle-product-options-modal-wrapper"},i("div",{key:"10fcc08be35bfd4231f9cf48501614ae49a985a3",slot:"loading"},i("salla-skeleton",{key:"1aee9616e4f05188067708506352b0d97d504696",height:"100%",width:"100%"})),this.product?.images&&this.product?.images.length>0&&i("salla-slider",{key:"a7d7a459d383c353b5ef716365ba0a0ac5d3a0b7",id:`details-slider-${this.product?.id}`,type:"thumbs",loop:!1,"auto-height":!0,"listen-to-thumbnails-option":!0,showThumbsControls:!1,controlsOuter:!1,showControls:!1,class:"s-multiple-bundle-product-options-modal-slider",verticalThumbs:!0,thumbsConfig:{centeredSlides:!0,centeredSlidesBounds:!0,slidesPerView:Math.min(5,Math.max(1,this.product?.images.length)),watchOverflow:!0,watchSlidesProgress:!0,direction:"vertical",spaceBetween:10}},i("div",{key:"11970032bdc37e5d20d6737e3109fcec9b4de4cb",slot:"items"},this.product?.images&&this.product?.images.map(((t,s)=>i("div",{key:s,class:"swiper-slide"},i("img",{src:t.url,alt:t.alt||`${this.product?.name} - Image ${s+1}`,loading:"lazy",onError:t=>{t.target.style.display="none"}}))))),this.product?.images&&this.product?.images.length>1&&i("div",{key:"c7d0fd432d8449e4742f0686ddecb7e87bebf159",slot:"thumbs"},this.product?.images&&this.product?.images.map(((t,s)=>i("div",{key:s,"data-caption":`${this.product?.name} - Image ${s+1}`},i("img",{src:t.url,loading:"eager",class:"s-multiple-bundle-product-options-modal-slider-thumb",title:`${this.product?.name} - ${s+1}`,alt:t.alt||`${this.product?.name} - ${s+1}`,onError:t=>{t.target.style.display="none"}})))))),i("salla-product-options",{options:JSON.stringify(s),key:`${n}-reset-${o}`,"product-id":t,"unique-key":`${n}-reset-${o}`}),i("div",{key:"c9b5f53696d9f8800e3a6be31ec78b51f0cb9bb1",slot:"footer"},i("div",{key:"e972370006feae6c17797f54c415ef0d2aaa3f57",class:"s-multiple-bundle-product-options-modal-footer"},i("salla-button",{key:"7a3787936eec6c0c8a69a64799af5595f51909f9",onClick:t=>this.onSave(t),loading:this.isLoading,disabled:l},this.isLoading?salla.lang.get("common.elements.saving"):salla.lang.get("common.elements.save"))))))}get host(){return n(this)}static get watchers(){return{product:["handleProductChange"]}}};d.style=":host{display:block}";const a=class{constructor(i){t(this,i),this.productSelected=s(this,"productSelected"),this.productOptionsSelected=s(this,"productOptionsSelected"),this.selectedProducts={},this.savedOptionsByInstance={},this.handleProductClick=(t,s)=>{const i=this.generateEventName(this.section.id,s),e=document.getElementById(i);if(e){if(e){const i=!e.checked;i||(this.dispatchClearOptionsEvent(t,s),this.clearSavedOptionsState(this.section.id,s)),e.checked=i,requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});e.dispatchEvent(t)}))}this.productSelected.emit({product:t,sectionId:this.section.id})}},this.handleOptionsClick=t=>{this.productOptionsSelected.emit({product:t,sectionId:this.section.id})}}getProductInstanceKey(t,s){return`${t}::${s}`}dispatchClearOptionsEvent(t,s){salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t.id,sectionId:this.section.id,sectionIndex:this.sectionIndex,productIndex:s})}handleOptionsSaved(t){const s=t.detail;if(!s)return;const{sectionId:i,productIndex:e,selectedOptions:n}=s;if(null==i||i!==this.section?.id)return;if(null==e||Number.isNaN(e))return;const o=this.getProductInstanceKey(i,e);if(n?.length)this.savedOptionsByInstance={...this.savedOptionsByInstance,[o]:!0};else if(this.savedOptionsByInstance[o]){const t={...this.savedOptionsByInstance};delete t[o],this.savedOptionsByInstance=t}}clearSavedOptionsState(t,s){const i=this.getProductInstanceKey(t,s);if(!this.savedOptionsByInstance[i])return;const e={...this.savedOptionsByInstance};delete e[i],this.savedOptionsByInstance=e}generateEventName(t,s){return`bundle[${t}][${s}][id]`}render(){return i(e,{key:"ecdac4638007d9435ec8b06f32114a0dada03b86"},i("salla-slider",{key:"c245e7dcfd157908063fd5ec13c6d49f8862dd18",type:"carousel",controlsOuter:!1,showControls:!1,id:`accordion-multiple-bundle-product-${this.section.id}`,pagination:!0,class:"s-multiple-bundle-product-wrapper-slider",sliderConfig:{spaceBetween:0}},i("div",{key:"17bdd6def2ff6f1d2ad22fa8b5299fc0000b1e82",slot:"items"},this?.section?.products?.map(((t,s)=>{const e=this.selectedProducts[this.section.id]?.has(t.id)||!1,n=this.savedOptionsByInstance[this.getProductInstanceKey(this.section.id,s)]?salla.lang.getWithDefault("pages.products.edit_selected_options","تعديل الخيارات"):salla.lang.get("pages.products.choose_from_options");let d=salla.config.get("theme.is_rtl",!0)?o:l;return i("div",{class:"s-multiple-bundle-product-slide-one-third "+(0==t.quantity?"s-multiple-bundle-product-slide-one-third-disabled":""),key:t.id},i("div",{class:"s-multiple-bundle-product-card"},i("div",{class:"s-multiple-bundle-product-image-wrapper",onClick:()=>this.handleProductClick(t,s)},i("input",{id:this.generateEventName(this.section.id,s),type:"checkbox",class:"s-multiple-bundle-product-checkbox",checked:e,name:this.generateEventName(this.section.id,s),value:t.id}),i("img",{src:t.image.url||salla.url.cdn("images/s-empty.png"),loading:"lazy",alt:t.image.alt||t.name,class:"s-multiple-bundle-product-image"})),i("div",{class:"s-multiple-bundle-product-content-wrapper"},i("div",{class:"s-multiple-bundle-product-content"},i("div",{class:"s-multiple-bundle-product-details"},i("div",{class:"s-multiple-bundle-product-title-wrapper"},i("h2",{class:"s-multiple-bundle-product-title"},i("a",{href:t?.url||"#",target:"_blank",rel:"noopener noreferrer"},t.name))),i("div",{class:"s-multiple-bundle-product-price-wrapper"},i("span",{class:"s-multiple-bundle-product-price"},i("span",{innerHTML:salla.money(t.price)})),t.sale_price>0&&i("span",{class:"s-multiple-bundle-product-price-discount"},i("span",{innerHTML:salla.money(t.regular_price)})))),t.quantity_in_group>0&&0!==t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.pieces"),i("span",null,t.quantity_in_group)),0===t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.quantity_in_group_finished"))),t.options?.length>0&&i("button",{class:"s-multiple-bundle-product-button",onClick:()=>this.handleOptionsClick(t),type:"button"},n,i("span",{class:"s-multiple-bundle-product-button-icon",innerHTML:d})))))})))))}get host(){return n(this)}};a.style="";export{d as salla_multiple_bundle_product_options_modal,a as salla_multiple_bundle_product_slider}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as t,h as e,H as s,a as l,F as d}from"./p-DQ335bXf.js";const o=class{constructor(e){t(this,e),this.sections=[],this.itemNumber=""}deleteItem(t,e){const s=this.host.closest("form");if(s){const l=s.getAttribute("id");if(l&&"string"==typeof l){const s=l.match(/item-(\d+)/)?.[1];this.itemNumber=s||"";const d=this.host.querySelector(`#accordion-${e.id}`);salla.cart.deleteItem(`${this.itemNumber}?product_id=${e.id}&section_id=${t}`).then((()=>d?.remove()))}}}renderRemoveButton(t,s,l=!1){return e("salla-button",{type:"button",shape:l?"btn":"icon",fill:l?"outline":"solid",size:"small",color:"danger","aria-label":"Remove from the cart",onClick:()=>this.deleteItem(t,s)},l?salla.lang.get("common.elements.delete"):e("i",{class:"sicon-cancel"}))}renderAccordionHeader(t,s){const l=s?.options&&s?.options?.length>0;return e("div",{slot:"html",class:"s-multiple-bundle-product-cart-header-wrapper"},e("div",{class:"s-multiple-bundle-product-cart-header "+(l?"":"s-multiple-bundle-product-cart-header-no-options")},e("div",{class:"s-multiple-bundle-product-cart-header-content"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-image-wrapper"},e("img",{src:s?.image?.url,alt:s?.image?.alt||s?.name,class:"s-multiple-bundle-product-cart-header-image"})),e("div",{class:"s-multiple-bundle-product-cart-header-content-details"},e("h2",{class:"s-multiple-bundle-product-cart-header-content-details-title"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-content-details-title-link"},s?.name)),e("div",{class:"s-multiple-bundle-product-cart-header-content-details-price"},e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-regular"},e("span",{innerHTML:s?.price?salla.money(s?.price):""})),s?.sale_price>0&&e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-sale"},e("span",{innerHTML:salla.money(s?.sale_price)}))),s?.quantity_in_group>0&&0!==s?.quantity&&e("p",{class:"s-multiple-bundle-product-cart-header-content-details-quantity"},e("span",null,salla.lang.get("pages.products.number_of_pieces")),e("span",null,s?.quantity_in_group)))),!l&&e("div",{class:"s-multiple-bundle-product-cart-header-remove-button"},this.renderRemoveButton(t,s,!1))))}render(){return e(s,{key:"d11f8075e15cd1379d6754b5ce13c81fa7cf9f03",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"293351d69f5e12039ecab876832c6164b1235dab",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>t.products.map((l=>{const d={sectionId:t.id,sectionIndex:s,productId:l.id};return e("salla-accordion",{key:l.id,collapsed:!1,bordered:!0,collapsible:!!(l.options&&l.options.length>0),size:"sm",id:`accordion-${l.id}`},e("salla-accordion-head",null,this.renderAccordionHeader(String(t.id),l)),l.options&&l.options.length>0&&e("salla-accordion-body",null,e("salla-product-options",{options:JSON.stringify(l.options),key:`${l.id}-persistent`,"product-id":l.id,"bundle-context":JSON.stringify(d)}),e("div",{class:"s-multiple-bundle-product-cart-body-remove-button"},this.renderRemoveButton(String(t.id),l,!0))))}))))))}get host(){return l(this)}};o.style="";const c=class{constructor(e){t(this,e),this.sections=[],this.selectedProducts={},this.productSelectedHandler=null,this.onSelectProduct=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const s=e.id,l=this.selectedProducts[t].has(s);l?(this.selectedProducts[t].delete(s),this.clearProductFormData(s,t),this.clearProductModalOptions(s,t)):this.selectedProducts[t].add(s),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options,wasSelected:l,isSelected:!l})},this.ensureProductSelected=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const s=e.id;this.selectedProducts[t].has(s)||(this.selectedProducts[t].add(s),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options}))},this.onSelectProductOptions=(t,e)=>{const s=this.sections.findIndex((t=>t.id==e)),l=this.sections.find((t=>t.id==e)),d=l?.products?.findIndex((e=>e.id==t.id))??0;salla.event.dispatch("multiple-bundle-product-modal::open",{product:t,sectionId:e,sectionIndex:s,productIndex:d})},this.handleBundleSliderProductSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProduct(s,e)},this.handleBundleSliderProductOptionsSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProductOptions(e,s)}}clearProductFormData(t,e){const s=this.host.closest("form");if(e){const l=`bundle[${e}][`;Array.from(s.querySelectorAll("input")).filter((e=>e.getAttribute("data-product-id")===String(t)&&e.name&&e.name.startsWith(l))).forEach((t=>t.remove()))}else s.querySelectorAll(`[data-product-id="${t}"]`).forEach((t=>t.remove()))}clearProductModalOptions(t,e){let s=null,l=null;if(null!=e&&(s=this.sections.findIndex((t=>t.id==e)),s>-1)){const e=this.sections[s];if(e){const s=e.products?.findIndex((e=>e.id==t));l="number"==typeof s&&s>-1?s:null}}salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t,sectionId:e,sectionIndex:s,productIndex:l})}renderAccordionHeader(t,s){return e(d,null,e("h2",{slot:"title"},t?.name),t?.obligatory_products?e("span",{slot:"note"},salla.lang.get("pages.products.obligatory_products",{count:t?.obligatory_products||0})):"",e("span",{slot:"progress"},s,"/",t?.products?.length||0))}componentDidLoad(){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&(this.productSelectedHandler=t=>{const{productId:e,sectionId:s,product:l,fromModal:d}=t.detail;d?this.ensureProductSelected(s,l||{id:e}):this.onSelectProduct(s,l||{id:e})},t.addEventListener("productSelected",this.productSelectedHandler))}disconnectedCallback(){if(this.productSelectedHandler){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&t.removeEventListener("productSelected",this.productSelectedHandler),this.productSelectedHandler=null}}render(){return e(s,{key:"27a3d6baa97585e983db19522ab2981ecc9e50f1",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"c96cf52dfaee161a03a6bf97de267d9942a47a49",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>e("salla-accordion",{key:t.id,collapsed:0!==s},e("salla-accordion-head",null,this.renderAccordionHeader(t,this.selectedProducts[t.id]?.size||0)),e("salla-accordion-body",null,e("salla-multiple-bundle-product-slider",{section:t,sectionIndex:s,selectedProducts:this.selectedProducts,onProductSelected:this.handleBundleSliderProductSelected,onProductOptionsSelected:this.handleBundleSliderProductOptionsSelected})))))),e("salla-multiple-bundle-product-options-modal",{key:"6627ee4f67bcd775b16e470dd4735848e6087fd4"}))}get host(){return l(this)}};c.style="";export{o as salla_multiple_bundle_product_cart,c as salla_multiple_bundle_product_details}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as a,h as t}from"./p-DQ335bXf.js";import{S as l}from"./p-D4oPi1Ov.js";import{S as s}from"./p-8Tsmrwno.js";const e=class{constructor(t){a(this,t),this.activeTabType="",this.tabsKey=0,this.selectedItem=void 0,this.allowEmail=!0,this.allowMobile=!0,this.requireEmail=!1,salla.event.on("loyalty::open",(()=>this.open())),salla.auth.event.onLoggedIn((()=>{this.is_loggedin=!0})),salla.onReady((()=>{this.is_loggedin=salla.config.isUser()})),salla.lang.onLoaded((()=>{this.guestMessage=salla.lang.get("pages.loyalty_program.guest_message"),this.translationLoaded=!0})),salla.cart.event.onUpdated((a=>{this.prizePoints=a.loyalty.prize?.points,this.prizeTitle=a.loyalty.prize?.title,this.customerPoints=a.loyalty.customer_points||this.customerPoints}))}onTabSelected(a){const t=this.loyaltyProgram?.prizes.find((t=>t.title===a.detail?.name));t&&(this.activeTabType=t.type)}setSelectedPrizeItem(a){this.selectedItem=this.selectedItem&&this.selectedItem?.id==a.id?void 0:a}handleLongText(a){return a.length>150?a.substring(0,150)+"...":a}prizeItem(a){return t("div",{onClick:()=>this.setSelectedPrizeItem(a),class:{"s-loyalty-prize-item-selected":!!this.selectedItem&&this.selectedItem?.id==a.id,"s-loyalty-prize-item":!0}},t("img",{class:"s-loyalty-prize-item-image",src:a.image,alt:a.name}),t("div",{class:"s-loyalty-prize-item-title"},a.name),t("div",{class:"s-loyalty-prize-item-subtitle"},this.handleLongText(a.description)),t("div",{class:"s-loyalty-prize-item-points"},a.cost_points," ",salla.lang.get("pages.loyalty_program.point"),t("div",{class:"s-loyalty-prize-item-check"},t("div",null))))}getConfirmationModal(){return[t("salla-placeholder",{alignment:"center",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80">\n<title>star3</title>\n <defs>\n <style>\n .a {\n fill: none !important;\n }\n\n .b {\n fill: #ff9e01;\n }\n\n .c {\n fill: #fff;\n opacity: 0.1;\n }\n\n </style>\n </defs>\n <g transform="translate(-683 -269)">\n <rect class="a" width="80" height="80" transform="translate(683 269)" />\n <g transform="translate(684.539 261.216)">\n <path class="b"\n d="M110.117,37.062,90.024,35.2,82.043,16.665a1.61,1.61,0,0,0-2.958,0L71.1,35.2,51.011,37.062a1.61,1.61,0,0,0-.914,2.813l15.16,13.318L60.821,72.878a1.61,1.61,0,0,0,2.393,1.739l17.351-10.3,17.351,10.3a1.61,1.61,0,0,0,2.393-1.739L95.871,53.192l15.16-13.318A1.61,1.61,0,0,0,110.117,37.062Z"\n transform="translate(-42.104 -4.011)" />\n <g transform="translate(0 10.971)">\n <path class="b"\n d="M93.54,12.016c1.024,1.423,3.915,7.533,5.568,11.094a.559.559,0,0,1-.891.641c-2.853-2.7-7.73-7.377-8.754-8.8a2.512,2.512,0,0,1,4.077-2.935Z"\n transform="translate(-75.621 -10.971)" />\n <path class="b"\n d="M360.909,12.016c-1.024,1.423-3.915,7.533-5.568,11.094a.559.559,0,0,0,.891.641c2.853-2.7,7.73-7.377,8.754-8.8a2.512,2.512,0,0,0-4.077-2.935Z"\n transform="translate(-301.908 -10.971)" />\n <path class="b"\n d="M427.538,284.659c-1.667-.543-8.366-1.441-12.261-1.934a.559.559,0,0,0-.34,1.044c3.436,1.9,9.377,5.123,11.044,5.666a2.512,2.512,0,0,0,1.558-4.776Z"\n transform="translate(-352.351 -241.894)" />\n <path class="b"\n d="M1.734,284.659c1.667-.543,8.366-1.441,12.261-1.934a.559.559,0,0,1,.34,1.044c-3.436,1.9-9.377,5.123-11.044,5.666a2.512,2.512,0,0,1-1.558-4.776Z"\n transform="translate(0 -241.894)" />\n <path class="b"\n d="M239.794,412.414c0-1.753,1.224-8.4,1.963-12.257a.559.559,0,0,1,1.1,0c.739,3.855,1.963,10.5,1.963,12.257a2.512,2.512,0,0,1-5.023,0Z"\n transform="translate(-203.768 -341.301)" />\n </g>\n <path class="c"\n d="M84.945,23.4l-2.9-6.74a1.61,1.61,0,0,0-2.958,0L71.1,35.2,51.011,37.062a1.61,1.61,0,0,0-.914,2.813l15.16,13.318L60.821,72.878a1.61,1.61,0,0,0,2.393,1.739l2.309-1.371A125,125,0,0,1,84.945,23.4Z"\n transform="translate(-42.104 -4.011)" />\n </g>\n </g>\n</svg>\n',class:"s-loyalty-confirmation-modal-content"},t("div",{slot:"title",class:"s-loyalty-confirmation-title"},salla.lang.get("pages.loyalty_program.exchange_points")),t("div",{slot:"description"},salla.lang.get("pages.loyalty_program.are_you_sure_to_exchange")," ( ",t("strong",null,this.selectedItem?.cost_points)," ",salla.lang.get("pages.loyalty_program.point")," ) ",salla.lang.get("pages.loyalty_program.for")," ( ",t("strong",null,this.selectedItem?.name)," )")),t("div",{class:"s-loyalty-confirmation-actions"},t("salla-button",{fill:"outline",width:"wide",onClick:()=>this.cancelProcess()},salla.lang.get("pages.loyalty_program.cancellation")),t("salla-button",{loading:this.buttonLoading,width:"wide",onClick:()=>this.exchangeLoyaltyPoint()},salla.lang.get("pages.loyalty_program.confirm")))]}getAfterExchangeUI(){return t("slot",{name:"points-applied-widget"},t("salla-list-tile",{class:"s-loyalty-after-exchange"},t("div",{slot:"title",class:"s-loyalty-after-exchange-title"},this.prizeTitle,"   -   ",this.prizePoints," ",salla.lang.get("pages.loyalty_program.point")),t("div",{slot:"action",class:"s-loyalty-after-exchange-action"},t("salla-button",{class:"s-loyalty-after-exchange-reset",shape:"icon",fill:"outline",color:"danger",size:"small",onClick:()=>this.resetExchange()},t("span",{innerHTML:s})))))}async open(){return this.is_loggedin?(this.modal?.open(),await salla.loyalty.getProgram().then((a=>{this.loyaltyProgram=a.data,this.activeTabType=this.loyaltyProgram.prizes[0]?.type||"",this.tabsKey++})).catch((a=>{this.hasError=!0,this.errorMessage=a.response?.data?.error?.message||a.response?.data})).finally((()=>this.modal?.stopLoading()))):salla.event.dispatch("login::open")}async close(){return this.modal.close()}async resetExchange(){return await salla.loyalty.reset()}async openConfirmation(){return await this.modal.close().then((()=>this.confirmationModal?.open())).catch((a=>console.log(a)))}async cancelProcess(){return await this.confirmationModal.close().then((()=>this.selectedItem=null)).catch((a=>console.log(a)))}async exchangeLoyaltyPoint(){return this.buttonLoading=!0,await salla.loyalty.exchange(this.selectedItem?.id).then((()=>"FREE_PRODUCT"==this.selectedItem.key&&salla.url.is_page("cart")&&window.location.reload())).finally((()=>{this.buttonLoading=!1,this.cancelProcess()}))}render(){return this.prizePoints?this.getAfterExchangeUI():[t("slot",{name:"widget"},this.customerPoints?t("salla-list-tile",{class:"s-loyalty-widget"},t("div",{slot:"icon",class:"s-loyalty-widget-icon",innerHTML:l}),t("div",{slot:"subtitle"},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_total_point_summary",{balance:this.customerPoints}):this.guestMessage,t("salla-button",{shape:"link",color:"primary",onClick:()=>salla.event.dispatch("loyalty::open")},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_point_exchange_now"):salla.lang.get("blocks.header.login")))):""),t("salla-modal",{noPadding:!0,width:"sm",ref:a=>this.confirmationModal=a},this.getConfirmationModal()),t("salla-modal",{isLoading:!0,"has-skeleton":!0,width:"md",ref:a=>this.modal=a},t("div",{slot:"loading"},t("div",{class:"s-loyalty-skeleton"},t("salla-list-tile",{class:"s-loyalty-header"},t("div",{slot:"icon",class:"s-loyalty-header-icon"},t("salla-skeleton",{type:"circle",height:"6rem",width:"6rem"})),t("div",{slot:"title",class:"s-loyalty-header-title mb-5"},t("salla-skeleton",{height:"15px",width:"50%"})),t("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},t("salla-skeleton",{height:"10px"}),t("salla-skeleton",{height:"10px",width:"75%"}))),t("div",{class:"s-loyalty-skeleton-cards"},[...Array(3)].map((()=>t("div",{class:"s-loyalty-prize-item swiper-slide"},t("salla-skeleton",{height:"9rem"}),t("div",{class:"s-loyalty-prize-item-title"},t("salla-skeleton",{height:"15px",width:"75%"})),t("div",{class:"s-loyalty-prize-item-subtitle"},t("salla-skeleton",{height:"10px",width:"50%"}),t("salla-skeleton",{height:"10px",width:"25%"})),t("div",{class:"s-loyalty-prize-item-points"},t("salla-skeleton",{height:"15px",width:"100px"}),t("div",{class:"s-loyalty-prize-item-check"},t("salla-skeleton",{height:"1rem",width:"1rem",type:"circle"}))))))))),!this.hasError&&this.loyaltyProgram?[t("salla-list-tile",{id:"s-loyalty-header",class:"s-loyalty-header"},t("div",{slot:"icon",class:"s-loyalty-header-icon",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" width="54.079" height="53.191" viewBox="0 0 54.079 53.191"><defs><style>.a{fill:#ee9d0d;}.b{fill:#c7830b;}.c{fill:#ea2b2d;}.d{fill:#cb2527;}.e{fill:#6699ce;}.f{fill:#faa6b2;}.g{fill:#a6deff;}.h{fill:#eeb436;}.i{fill:#f72d2f;}</style></defs><path class="a" d="M40,248H77.3v25.88a2.1,2.1,0,0,1-2.1,2.1H42.1a2.1,2.1,0,0,1-2.1-2.1Z" transform="translate(-38.135 -222.787)"/><path class="b" d="M250.632,248.711v12.755L236.2,248h13.67Z" transform="translate(-211.463 -222.787)"/><path class="b" d="M333.957,336v3.207L330.52,336Z" transform="translate(-294.787 -300.528)"/><path class="c" d="M226.194,32.048l-.5.185a5.035,5.035,0,0,0-3.072,3.292l-.468,1.585-.759.414a5.035,5.035,0,0,0-2.422,3l8.865,8.271,5.09-5.456.262-6.205a5.191,5.191,0,0,0-7-5.083Z" transform="translate(-196.246 -31.722)"/><path class="c" d="M358.628,175.48l-.15.509a5.034,5.034,0,0,1-3.072,3.292l-1.55.577-.359.785a5.034,5.034,0,0,1-2.822,2.624L341.81,175l5.09-5.455,6.172-.69a5.191,5.191,0,0,1,5.555,6.629Z" transform="translate(-304.761 -152.837)"/><path class="d" d="M168,248h7.461v27.978H168Z" transform="translate(-151.213 -222.787)"/><path class="c" d="M40,336H77.3v7.461H40Z" transform="translate(-38.135 -300.528)"/><path class="d" d="M333.957,336v3.207L330.52,336Z" transform="translate(-294.787 -300.528)"/><path class="a" d="M2.1,0H40.8a2.1,2.1,0,0,1,2.1,2.1V9.326H0V2.1A2.1,2.1,0,0,1,2.1,0Z" transform="matrix(0.731, 0.682, -0.682, 0.731, 18.641, 4.976)"/><path class="d" d="M0,0H9.326V9.326H0Z" transform="matrix(0.731, 0.682, -0.682, 0.731, 30.912, 16.424)"/><path class="d" d="M286.857,79.389a.931.931,0,0,1-.74-.365l-.615-.8a12.516,12.516,0,0,1-2.528-9,.933.933,0,0,1,1.855.2,10.66,10.66,0,0,0,2.153,7.667l.615.8a.933.933,0,0,1-.739,1.5Z" transform="translate(-252.718 -64.113)"/><path class="c" d="M185.485,178.151l-.039.014a30.78,30.78,0,0,1-12.034,1.906l-2.381-.1,4.092,3.817-1.181,4,3.728-1.206a30.775,30.775,0,0,0,9.833-5.315l.71-.572Z" transform="translate(-153.891 -161.081)"/><path class="d" d="M363.834,194.779a12.51,12.51,0,0,1-6.93-2.1l-.843-.559a.933.933,0,1,1,1.031-1.554l.842.558a10.659,10.659,0,0,0,7.8,1.618.933.933,0,1,1,.328,1.836A12.663,12.663,0,0,1,363.834,194.779Z" transform="translate(-316.982 -171.914)"/><path class="c" d="M275,202.524l-.012.04a30.776,30.776,0,0,0-1.069,12.137l.265,2.369-4.092-3.817-3.909,1.455.945-3.8a30.776,30.776,0,0,1,4.622-10.177l.521-.748Z" transform="translate(-237.949 -180.364)"/><circle class="e" cx="1.865" cy="1.865" r="1.865" transform="translate(10.259 0.032)"/><circle class="f" cx="1.865" cy="1.865" r="1.865" transform="translate(0 21.482)"/><path class="g" d="M36.663,36.663a.933.933,0,0,1-.885-.638l-.048-.143a2.946,2.946,0,0,0-2.8-2.017.933.933,0,1,1,0-1.865A4.808,4.808,0,0,1,37.5,35.292l.048.143a.933.933,0,0,1-.885,1.228Z" transform="translate(-31.067 -31.968)"/><path class="g" d="M79.493,194.438a.929.929,0,0,1-.506-.15l-.185-.12a2.074,2.074,0,0,0-2.192-.047.933.933,0,0,1-.947-1.607,3.929,3.929,0,0,1,4.153.088l.185.12a.933.933,0,0,1-.508,1.716Z" transform="translate(-69.235 -173.283)"/><path class="h" d="M27.751,85.141l2.88,2.644,3.811-.874-1.624,3.556,2.008,3.354-3.884-.446-2.569,2.946L27.6,92.49,24,90.957l3.4-1.922Z" transform="translate(-24 -78.914)"/><path class="h" d="M82.174,227.375l-.959,3.772,2.564,2.928-3.884.254L77.9,237.673l-1.442-3.615-3.8-.862,2.993-2.488-.353-3.876,3.291,2.078Z" transform="translate(-66.992 -204.086)"/><path class="i" d="M300.471,141.9l-5.455-5.09,5.09-5.456a8.342,8.342,0,0,1,5.455,5.09Z" transform="translate(-263.422 -119.737)"/></svg>'}),t("div",{slot:"title",class:"s-loyalty-header-title"},this.loyaltyProgram.prize_promotion_title),t("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},this.loyaltyProgram.prize_promotion_description)),t("salla-tabs",{key:this.tabsKey},this.loyaltyProgram.prizes.map((a=>t("salla-tab-header",{slot:"header",name:a.title},t("span",null,a.title)))),this.loyaltyProgram.prizes.map(((a,l)=>t("salla-tab-content",{slot:"content",name:a.title},t("salla-slider",{class:"s-loyalty-slider",loop:!1,"controls-outer":!0,id:"loyalty-popup-slider-"+l,type:"carousel"},t("div",{slot:"items"},a.items.map((a=>this.prizeItem(a))))))))),"FREE_PRODUCT"===this.activeTabType?.toUpperCase()&&(salla.config.get("store.features")||[]).includes("loyalty-system-v2")?t("a",{href:salla.url.get(""),class:"s-loyalty-program-redeem-btn s-button-element s-button-btn s-button-solid s-button-wide s-button-primary s-button-wrap"},salla.lang.get("pages.loyalty_program.shop_now")):t("salla-button",{disabled:!this.selectedItem,width:"wide",class:"s-loyalty-program-redeem-btn",onClick:()=>this.openConfirmation()},salla.lang.get("pages.loyalty_program.exchange_points"))]:t("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?t("span",{slot:"description"},this.errorMessage):""))]}};e.style="";export{e as salla_loyalty}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as s,h as t,H as i}from"./p-DQ335bXf.js";import{g as e,a,c as d,u as r,r as o,m as l,b as n,f as h,d as c,e as u,h as m,i as p}from"./p-C8xwacGT.js";import"./p-CoQJOPRz.js";const f=class{constructor(t){s(this,t),this.loading=!0,this.saveLoading=!1,this.payload={items:{update:[],remove:[],add:[]}},this.expired=!1,this.editPreview=null,this.productSearchQuery="",this.productsListKey=0,this.productsListSource="latest",this.productsListSourceValue="",this.selectedProductToAdd=null,this.addProductQuantity=1,this.addProductLoading=!1,this.addProductConfirmLoading=!1,this.mobileProductsModalMounted=!1,this.isMobileViewport=!1,this.mobileProductsListLoading=!1,this.confirming=!1,this.handleMobileProductSelected=s=>{s.stopPropagation(),this.handleProductSelected(s)},this.productsPanelMobileQuery="(max-width: 768px)",this.handleProductsPanelViewportChange=s=>{this.isMobileViewport=s.matches},this.hasProductTypeFilter=s=>{const t=s.indexOf("?"),i=(t>=0?s.slice(t+1):s).split("#")[0];return Array.from(new URLSearchParams(i)).some((([s,t])=>"product"===t&&/^filters\[types\](?:\[(?:\d*)\])?$/.test(s)))},this.normalizeProductsListArrayParams=s=>s.replace(/(^|[?&])(includes|source_value|filters(?:\[|%5B)[^&=\]%]+?(?:\]|%5D))(\[|%5B)\d+(\]|%5D)(?==)/gi,((s,t,i,e,a)=>`${t}${i}${e}${a}`)),this.handleBeforeBuildListUrl=s=>{"salla-order-edit-product-card"===s.component?.productCardComponent&&"string"==typeof s.url&&(s.url=this.normalizeProductsListArrayParams(s.url),this.hasProductTypeFilter(s.url)||(s.url+=(s.url.includes("?")?"&":"?")+"filters[types][]=product"))},this.defaultProductsListSource="latest",this.debouncedProductSearch=salla.helpers.debounce((s=>this.applyProductSearch(s)),500)}async componentWillLoad(){this.setupProductsPanelViewportQuery(),await salla.onReady(),this.unregisterBeforeBuildListUrlHook=salla.hooks.registerHook("salla-products-list","beforeBuildListUrl",this.handleBeforeBuildListUrl),this.loadFromProp(),this.startExpiryCheck()}disconnectedCallback(){clearInterval(this.expiryInterval),this.unregisterBeforeBuildListUrlHook?.(),this.productsPanelViewportQuery?.removeEventListener("change",this.handleProductsPanelViewportChange),this.mobileProductsModal?.removeEventListener("orderEditProductSelected",this.handleMobileProductSelected)}setupProductsPanelViewportQuery(){"undefined"!=typeof window&&"function"==typeof window.matchMedia&&(this.productsPanelViewportQuery=window.matchMedia(this.productsPanelMobileQuery),this.isMobileViewport=this.productsPanelViewportQuery.matches,this.productsPanelViewportQuery.addEventListener("change",this.handleProductsPanelViewportChange))}startExpiryCheck(){const s=this.order?.customer_editing_session?.ends_at;if(!s)return;const t=()=>new Date(`${s.replace(" ","T")}+03:00`).getTime()<=Date.now();t()?this.expired=!0:this.expiryInterval=setInterval((()=>{t()&&(this.expired=!0,clearInterval(this.expiryInterval))}),1e3)}loadFromProp(){try{if(!this.orderData)return void(this.error=salla.lang.getWithDefault("pages.orders.order_not_found","الطلب غير موجود"));const s="string"==typeof this.orderData?JSON.parse(this.orderData):this.orderData;this.order={...s,items:s.items.map((s=>({...s,selectedOptions:e(s)})))}}catch(s){this.error=salla.lang.getWithDefault("pages.orders.order_not_found","الطلب غير موجود")}finally{this.loading=!1}}applyProductSearch(s){const t=s?.trim()||"",i=t?"search":this.defaultProductsListSource,e="search"===i?JSON.stringify(t):"";this.productsListSource===i&&this.productsListSourceValue===e||(this.productsListSource=i,this.productsListSourceValue=e,this.productsListKey+=1)}handleProductSearch(s){const t=s.target?.value||"";this.productSearchQuery=t,this.debouncedProductSearch(t)}getProductsListKey(s){return`${s}-${this.productsListSource}-${this.productsListSourceValue}-${this.productsListKey}`}handleMobileProductsScroll(s){const t=s.currentTarget;if(t.scrollHeight-t.scrollTop-t.clientHeight>200||this.mobileProductsListLoading)return;const i=t.querySelector("salla-products-list");i&&(this.mobileProductsListLoading=!0,i.loadMore().finally((()=>{this.mobileProductsListLoading=!1})))}waitForNextFrame(){return new Promise((s=>requestAnimationFrame((()=>s(void 0)))))}async openMobileProductsModal(){this.mobileProductsModalMounted||(this.mobileProductsModalMounted=!0,await this.waitForNextFrame()),await(this.mobileProductsModal?.open?.())}setMobileProductsModal(s){this.mobileProductsModal!==s&&(this.mobileProductsModal?.removeEventListener("orderEditProductSelected",this.handleMobileProductSelected),this.mobileProductsModal=s,this.mobileProductsModal?.addEventListener("orderEditProductSelected",this.handleMobileProductSelected))}resetAddProductDrawer(){this.selectedProductToAdd=null,this.addProductQuantity=1,this.addProductLoading=!1,this.addProductConfirmLoading=!1,this.addProductOptions=null}getAddProductMaxQuantity(s=this.selectedProductToAdd){return a(s)}clampAddProductQuantity(s,t=this.selectedProductToAdd){return d(s,this.getAddProductMaxQuantity(t))}getApiErrorMessage(s){return s?.response?.data?.error?.message||s?.response?.data?.message}notifyApiError(s){const t=this.getApiErrorMessage(s);t&&salla.notify.error(t)}async validateAddProductOptions(){return!this.selectedProductToAdd?.options?.length||!!this.addProductOptions&&(await(this.addProductOptions.validateAndScroll?.())??await(this.addProductOptions.reportValidity?.())??!1)}updateLocalOrderItem(s,t,i,e){this.order={...this.order,items:r(this.order.items,s,t,i,e)}}removeLocalOrderItem(s){this.order={...this.order,items:o(this.order.items,s)}}setPayloadItems(s){this.payload={...this.payload,items:l(this.payload.items,s)}}handleAddProductQuantityChange(s){const t=s.detail,i=t?.quantity??parseInt(s.target?.value,10);isNaN(i)||i<1||(this.addProductQuantity=this.clampAddProductQuantity(i))}async handleProductSelected(s){const t=s.detail?.product;if(t?.id&&!this.addProductLoading){this.addProductLoading=!0;try{this.selectedProductToAdd=n(t),this.addProductQuantity=1,await(this.mobileProductsModal?.close?.()),await this.waitForNextFrame(),await(this.addProductDrawer?.open?.())}catch(s){this.notifyApiError(s)}finally{this.addProductLoading=!1}}}async confirmAddProduct(){if(this.selectedProductToAdd?.id&&!this.addProductConfirmLoading){this.addProductConfirmLoading=!0;try{const s=this.getAddProductMaxQuantity(),t=this.clampAddProductQuantity(this.addProductQuantity);t!==this.addProductQuantity&&(this.addProductQuantity=t);const i=this.addProductOptions;if(!await this.validateAddProductOptions())return void salla.notify.error(salla.lang.getWithDefault("common.messages.required_fields","يرجى تعبئة الحقول المطلوبة"));const e=await(i?.getSelectedOptionsData?.())||{},a=await(i?.getOptionsData?.())||this.selectedProductToAdd.options||[],r=h(this.order?.items,this.selectedProductToAdd.id,e);if(r){const i=d(r.quantity+t,s);return this.updateLocalOrderItem(r.id,i,a,e),this.setPayloadItems(r.isNew?{add:c(this.payload.items.add,r.id,i,e)}:{update:u(this.payload.items.update,r.id,i,e)}),void await(this.addProductDrawer?.close?.())}const o=m(this.selectedProductToAdd,t,a,e),l={itemId:o.id,product_id:this.selectedProductToAdd.id,quantity:t,options:e};this.order={...this.order,items:[...this.order.items,o]},this.setPayloadItems({add:[...this.payload.items.add,l]}),await(this.addProductDrawer?.close?.())}catch(s){this.notifyApiError(s)}finally{this.addProductConfirmLoading=!1}}}handleItemUpdated(s){if(!this.order)return;const{itemId:t,quantity:i,options:e,optionDefinitions:r}=s.detail,o=this.order.items.find((s=>s.id===t));if(!o)return;const l=d(i,a(o.product));if(o.isNew)return this.setPayloadItems({add:c(this.payload.items.add,t,l,e)}),void this.updateLocalOrderItem(t,l,r,e);this.setPayloadItems({update:u(this.payload.items.update,t,l,e??{})}),this.updateLocalOrderItem(t,l,r,e)}handleItemRemoved(s){if(!this.order)return;if(this.order.items.length<=1)return void salla.notify.error(salla.lang.getWithDefault("pages.orders.order_cannot_be_empty","لا يمكن إزالة جميع المنتجات من الطلب"));const{itemId:t}=s.detail,i=this.order.items.find((s=>s.id===t));if(i){if(i.isNew)return this.setPayloadItems({add:this.payload.items.add.filter((s=>s.itemId!==t))}),void this.removeLocalOrderItem(t);this.setPayloadItems({update:this.payload.items.update.filter((s=>s.id!==t)),remove:[...this.payload.items.remove,t]}),this.removeLocalOrderItem(t)}}get hasChanges(){return this.payload.items.update.length>0||this.payload.items.remove.length>0||this.payload.items.add.length>0}async saveOrder(){if(this.hasChanges){this.saveLoading=!0;try{const s=await salla.order.api.editOrder(this.orderId,p(this.payload));this.editPreview=s?.data?.data||s?.data,await(this.saveModal?.open?.())}catch(s){this.notifyApiError(s)}finally{this.saveLoading=!1}}}navigateToOrder(){const s=new URL(window.location.href);s.pathname=s.pathname.replace(/\/edit\/?$/,""),s.search="",window.location.href=s.href}handleConfirm(){this.confirming=!0,this.editPreview?.payment?.required&&this.editPreview.payment.payment_url?window.location.href=this.editPreview.payment.payment_url:this.navigateToOrder()}async cancelEditSession(){try{await salla.order.api.cancelEditSession(this.orderId),this.navigateToOrder()}catch(s){this.notifyApiError(s)}}renderProductsPanel(){const s=salla.lang.getWithDefault("pages.orders.add_product_to_order","أضف منتج للطلب");return t("section",{class:"s-order-edit-products-panel"},t("div",{class:"s-order-edit-products-header"},t("h2",{class:"s-order-edit-products-title"},s)),this.renderProductsPickerContent("panel"))}renderProductsPickerContent(s){return t("div",{class:{"s-order-edit-products-picker":!0,"s-order-edit-products-modal-content":"modal"===s}},t("label",{class:"s-order-edit-products-search"},t("i",{class:"sicon-search"}),t("input",{type:"search",class:"s-order-edit-products-search-input",placeholder:salla.lang.getWithDefault("pages.products.search_for_product","ابحث عن منتج"),value:this.productSearchQuery,onInput:s=>this.handleProductSearch(s)})),t("div",{class:"s-order-edit-products-list",onScroll:"modal"===s?s=>this.handleMobileProductsScroll(s):void 0},t("salla-products-list",{key:this.getProductsListKey(s),includes:["options"],source:this.productsListSource,"source-value":this.productsListSourceValue,autoload:!0,"product-card-component":"salla-order-edit-product-card"})))}renderMobileProductsModal(){return t("salla-modal",{ref:s=>this.setMobileProductsModal(s),width:"md",class:"s-order-edit-mobile-products-modal","modal-title":salla.lang.getWithDefault("pages.orders.add_product_to_order","أضف منتج للطلب"),onModalVisibilityChanged:s=>{s.detail||(this.mobileProductsModalMounted=!1)}},this.mobileProductsModalMounted?this.renderProductsPickerContent("modal"):null)}renderAddProductDrawer(){const s=this.selectedProductToAdd,i=s?.name||salla.lang.getWithDefault("common.elements.product","منتج"),e=s?.price,a=this.getAddProductMaxQuantity(s),d=s?`order-edit-add-${s.id}`:"order-edit-add",r={value:this.clampAddProductQuantity(this.addProductQuantity,s)};return a&&(r.max=a),t("salla-modal",{ref:s=>this.addProductDrawer=s,width:"md","modal-title":salla.lang.getWithDefault("pages.orders.add_product_to_order","أضف منتج للطلب"),onModalVisibilityChanged:s=>{s.detail||this.resetAddProductDrawer()}},t("div",{class:"s-order-edit-add-modal"},this.addProductLoading?t("div",{class:"s-order-edit-add-modal-loading"},t("salla-loading",null)):s?t("div",{class:"s-order-edit-add-modal-content"},t("div",{class:"s-order-edit-add-modal-header"},t("div",{class:"s-order-edit-add-modal-media"},s.image?.url&&t("img",{src:s.image.url,alt:s.image.alt||i,class:"s-order-edit-add-modal-image"}),t("div",{class:"s-order-edit-add-modal-details"},t("h3",{class:"s-order-edit-add-modal-name"},i),null!=e&&t("span",{class:"s-order-edit-add-modal-price",innerHTML:salla.money(e)})))),t("div",{class:"s-order-edit-add-modal-quantity"},t("h3",{class:"s-order-edit-add-modal-section-title"},salla.lang.getWithDefault("common.elements.quantity","الكمية")),t("div",{class:"s-order-edit-add-modal-quantity-input"},t("salla-quantity-input",{...r,onChange:s=>this.handleAddProductQuantityChange(s)}))),s.options?.length>0&&t("form",{onSubmit:s=>s.preventDefault()},t("salla-product-options",{ref:s=>this.addProductOptions=s,"product-id":s.id,"unique-key":d,options:JSON.stringify(s.options),key:`${d}-options`})),t("div",{class:"s-order-edit-add-modal-actions"},t("salla-button",{onClick:()=>this.confirmAddProduct(),loading:this.addProductConfirmLoading},salla.lang.getWithDefault("common.elements.confirm","تأكيد")),t("salla-button",{color:"gray",fill:"outline",onClick:()=>this.addProductDrawer?.close?.()},salla.lang.getWithDefault("common.elements.cancel","الغاء")))):null))}renderSaveModal(){const s=this.editPreview,i=s?.totals?.remaining_amount?.amount>0,e=s?.totals?.refund_amount?.amount>0,a=s?.totals?.tax?.amount?.amount;return t("salla-modal",{ref:s=>this.saveModal=s,width:"md",onModalVisibilityChanged:async s=>{s.detail||(this.editPreview=null,this.confirming||await this.cancelEditSession(),this.confirming=!1)}},t("div",{class:"s-order-edit-modal"},t("h2",{class:"s-order-edit-modal-title"},salla.lang.getWithDefault("pages.orders.edit_summary_title","ملخص الطلب بعد التعديل")),s?.items?.length>0&&t("div",{class:"s-order-edit-modal-items"},s.items.map((s=>{const i=this.order?.items?.find((t=>t.id==s.id)),e=i?.product?.image?.url,a=s.options?.join("/ ");return t("div",{class:"s-order-edit-modal-item"},t("div",{class:"s-order-edit-modal-item-start"},e&&t("img",{src:e,alt:s.name,class:"s-order-edit-modal-item-image"}),t("div",null,t("p",{class:"s-order-edit-modal-item-name"},s.name),a&&t("span",{class:"s-order-edit-modal-item-options"},a))),t("div",{class:"s-order-edit-modal-item-end"},t("span",{class:"s-order-edit-modal-item-price",innerHTML:salla.money(s.price.amount)})))}))),s?.totals?.updated_products_total&&t("div",{class:"s-order-edit-modal-row"},t("span",{class:"s-order-edit-modal-row-label"},salla.lang.getWithDefault("pages.orders.modified_products_total","مجموع المنتجات المعدلة")),t("span",{class:"s-order-edit-modal-row-value",innerHTML:salla.money(s.totals.updated_products_total.amount)})),a>0&&t("div",{class:"s-order-edit-modal-row"},t("span",{class:"s-order-edit-modal-tax-label"},t("i",{class:"sicon-info-circle s-order-edit-modal-tax-icon"}),salla.lang.getWithDefault("pages.orders.vat","ضريبة القيمة المضافة")),t("span",{class:"s-order-edit-modal-row-value",innerHTML:salla.money(a)})),s?.totals?.total&&t("div",{class:"s-order-edit-modal-total"},t("span",{class:"s-order-edit-modal-total-label"},salla.lang.getWithDefault("pages.orders.order_total","اجمالي الطلب")),t("span",{class:"s-order-edit-modal-total-value",innerHTML:salla.money(s.totals.total.amount)})),e&&t("div",{class:"s-order-edit-modal-refund"},t("i",{class:"sicon-info-circle s-order-edit-modal-refund-icon"}),t("p",{class:"s-order-edit-modal-refund-text"},salla.lang.getWithDefault("pages.orders.refund_message","سيتم تحويل فارق المبلغ على نفس وسيلة الدفع"))),t("div",{class:"s-order-edit-modal-btn-wrapper"},t("salla-button",{onClick:()=>this.handleConfirm()},i?salla.lang.getWithDefault("pages.orders.pay_difference","دفع فارق المبلغ"):e?salla.lang.getWithDefault("pages.orders.confirm_and_receive_difference","تأكيد واستلام فارق المبلغ"):salla.lang.getWithDefault("pages.orders.confirm_changes","تأكيد التعديلات"),t("i",{class:"sicon-keyboard_arrow_left s-order-edit-modal-btn-icon"})))))}render(){if(this.loading)return t(i,null,t("salla-loading",null));if(this.expired)return t(i,null,t("div",{class:"s-order-edit-expired"},t("p",null,salla.lang.getWithDefault("pages.orders.edit_session_expired","انتهت مدة التعديل المتاحة")),t("salla-button",{onClick:()=>this.navigateToOrder()},salla.lang.getWithDefault("pages.orders.back_to_order","العودة إلى تفاصيل الطلب"))));if(this.error||!this.order)return t(i,null,t("div",{class:"s-order-edit-no-content-placeholder"},t("i",{class:"sicon-shopping-bag icon"}),t("p",null,this.error)));const s=this.order.items&&this.order.items.length>0,e=this.order.customer_editing_session?.ends_at;return t(i,null,e&&t("div",{class:"s-order-edit-timer-wrapper"},t("salla-count-down",{prefixText:salla.lang.getWithDefault("pages.orders.edit_within","يمكنك التعديل خلال"),date:e,horizontal:!0,withButton:!0,autoSegments:!0,labeled:!1,size:"sm",color:"primary"})),t("div",{class:"s-order-edit-layout"},this.isMobileViewport?null:this.renderProductsPanel(),t("section",{class:"s-order-edit-order-panel"},t("div",{class:"s-order-edit-items-wrapper"},t("h2",{class:"s-order-edit-items-title"},salla.lang.getWithDefault("pages.orders.order_products","منتجات الطلب")),s?this.order.items.map(((s,i)=>[t("salla-order-edit-item",{key:s.id,item:s,orderId:this.orderId}),i<this.order.items.length-1?t("div",{class:"s-order-edit-items-divider"}):null])):t("div",{class:"s-order-edit-no-content-placeholder"},t("i",{class:"sicon-shopping-bag icon"}),t("p",null,salla.lang.getWithDefault("common.elements.no_items","لا توجد عناصر")))),t("div",{class:"s-order-edit-actions"},t("salla-button",{class:"s-order-edit-mobile-products-trigger",color:"gray",size:"small",fill:"outline",onClick:()=>this.openMobileProductsModal()},t("i",{class:"sicon-add s-order-edit-mobile-products-trigger-icon"}),salla.lang.getWithDefault("pages.orders.add_product","إضافة منتج")),t("salla-button",{onClick:()=>this.saveOrder(),loading:this.saveLoading,size:"small",disabled:!this.hasChanges},salla.lang.getWithDefault("pages.orders.save_changes","حفظ التعديلات")),t("salla-button",{size:"small",color:"gray",fill:"outline",onClick:()=>this.cancelEditSession()},salla.lang.getWithDefault("common.elements.cancel","الغاء"))))),this.renderMobileProductsModal(),this.renderAddProductDrawer(),this.renderSaveModal())}};f.style=":host{display:block}";export{f as salla_order_edit}
@@ -1,9 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{d as e}from"./p-DQ335bXf.js";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}var n,i,E={exports:{}},r=n?E.exports:(n=1,E.exports=(i=function(e){var t=e.addFilter,n=e.utils,i=n.Type,E=n.isString,r=n.replaceInString,T=n.guesstimateMimeType,u=n.getExtensionFromFilename,o=n.getFilenameFromURL,_=function(e,t){return e.some((function(e){return/\*$/.test(e)?(n=e,(/^[^/]+/.exec(t)||[]).pop()===n.slice(0,-2)):e===t;var n}))},a=function(e,t,n){if(0===t.length)return!0;var i=function(e){var t="";if(E(e)){var n=o(e),i=u(n);i&&(t=T(i))}else t=e.type;return t}(e);return n?new Promise((function(E,r){n(e,i).then((function(e){_(t,e)?E():r()})).catch(r)})):_(t,i)};return t("SET_ATTRIBUTE_TO_OPTION_MAP",(function(e){return Object.assign(e,{accept:"acceptedFileTypes"})})),t("ALLOW_HOPPER_ITEM",(function(e,t){var n=t.query;return!n("GET_ALLOW_FILE_TYPE_VALIDATION")||a(e,n("GET_ACCEPTED_FILE_TYPES"))})),t("LOAD_FILE",(function(e,t){var n=t.query;return new Promise((function(t,i){if(n("GET_ALLOW_FILE_TYPE_VALIDATION")){var E=n("GET_ACCEPTED_FILE_TYPES"),T=n("GET_FILE_VALIDATE_TYPE_DETECT_TYPE"),u=a(e,E,T),o=function(){var e,t=E.map((e=n("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP"),function(t){return null!==e[t]&&(e[t]||t)})).filter((function(e){return!1!==e})),T=t.filter((function(e,n){return t.indexOf(e)===n}));i({status:{main:n("GET_LABEL_FILE_TYPE_NOT_ALLOWED"),sub:r(n("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES"),{allTypes:T.join(", "),allButLastType:T.slice(0,-1).join(", "),lastType:T[T.length-1]})}})};if("boolean"==typeof u)return u?t(e):o();u.then((function(){t(e)})).catch(o)}else t(e)}))})),{options:{allowFileTypeValidation:[!0,i.BOOLEAN],acceptedFileTypes:[[],i.ARRAY],labelFileTypeNotAllowed:["File is of invalid type",i.STRING],fileValidateTypeLabelExpectedTypes:["Expects {allButLastType} or {lastType}",i.STRING],fileValidateTypeLabelExpectedTypesMap:[{},i.OBJECT],fileValidateTypeDetectType:[null,i.FUNCTION]}}},"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:i})),i)),T=t({__proto__:null,default:e(r)},[r]);
5
- /*!
6
- * FilePondPluginFileValidateType 1.2.9
7
- * Licensed under MIT, https://opensource.org/licenses/MIT/
8
- * Please visit https://pqina.nl/filepond/ for details.
9
- */export{T as f}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as t,c as e,h as r,H as d}from"./p-DQ335bXf.js";const c=class{constructor(r){t(this,r),this.orderEditProductSelected=e(this,"orderEditProductSelected")}get productData(){if(!this.product)return{};if("object"==typeof this.product)return this.product;try{return JSON.parse(this.product)}catch(t){return{}}}handleSelectProduct(){this.orderEditProductSelected.emit({product:this.productData})}render(){const t=this.productData,e=t?.name||salla.lang.getWithDefault("common.elements.product","منتج"),c=t?.price;return r(d,{key:"9f9278890bd821cf7b1caecdf4484a26273fe407"},r("button",{key:"6d28490ff098143000fff6543702ba805e997077",type:"button",class:"s-order-edit-product-card",onClick:()=>this.handleSelectProduct()},r("div",{key:"b7399553a7b79303b8bae8c9b624f460fe761946",class:"s-order-edit-product-card-media"},t?.image?.url?r("img",{src:t.image.url,alt:t.image.alt||e,class:"s-order-edit-product-card-image"}):r("div",{class:"s-order-edit-product-card-placeholder"},r("i",{class:"sicon-shopping-bag"}))),r("div",{key:"5cd57cf519f5d681116336cc6db8aed3569b761d",class:"s-order-edit-product-card-content"},r("h3",{key:"51312a3708d95f3d6d654099b25a2a4644c70aaa",class:"s-order-edit-product-card-title"},e),null!=c&&r("p",{key:"c09988f616198ae0d527e994e5c55e8b0a01c218",class:"s-order-edit-product-card-price",innerHTML:salla.money(c)}))))}};c.style=":host{display:block;min-width:0}";export{c as salla_order_edit_product_card}