@salla.sa/twilight-components 2.14.382 → 2.14.384

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 (243) hide show
  1. package/dist/cjs/{filepond-g22JhArE.js → filepond-CJUBlGWZ.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-BLHE3V1F.js → filepond-plugin-file-poster-DzfdX-da.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-Cv69mp4T.js → filepond-plugin-file-validate-size-aKEs_A1i.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-UlN6zKxS.js → filepond-plugin-file-validate-type-BBQOuEjF.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-V6CWtRrp.js → filepond-plugin-image-edit-Ce6fwF2W.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-Bdel8-Be.js → filepond-plugin-image-exif-orientation-BcFGamVd.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-BbyhVd2-.js → filepond-plugin-image-preview-DktpahDI.js} +1 -1
  8. package/dist/cjs/{index-D6_fzuPF.js → index-CfgN9bup.js} +1 -1
  9. package/dist/cjs/{index-CgOy8iIV.js → index-Dc8V4JzY.js} +2 -2
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/salla-accordion-body_3.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_4.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-apps-icons.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
  19. package/dist/cjs/salla-bullet-delivery.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-count-down_2.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  79. package/dist/cjs/twilight.cjs.js +1 -1
  80. package/dist/cjs/{vanilla-picker-CBkQi6yD.js → vanilla-picker-DR583jAq.js} +1 -1
  81. package/dist/components/index.js +2 -2
  82. package/dist/esm/{filepond-R6QOZ4Ng.js → filepond-BWifXQjU.js} +1 -1
  83. package/dist/esm/{filepond-plugin-file-poster-CgZsOj29.js → filepond-plugin-file-poster-Cwfa6rZE.js} +1 -1
  84. package/dist/esm/{filepond-plugin-file-validate-size-CYlCC1qn.js → filepond-plugin-file-validate-size-BrX587rP.js} +1 -1
  85. package/dist/esm/{filepond-plugin-file-validate-type-D-twSapC.js → filepond-plugin-file-validate-type-CR3s_l2K.js} +1 -1
  86. package/dist/esm/{filepond-plugin-image-edit-C0lS-TeI.js → filepond-plugin-image-edit-DcaaNA7K.js} +1 -1
  87. package/dist/esm/{filepond-plugin-image-exif-orientation-g6QLr9rh.js → filepond-plugin-image-exif-orientation-BhT9UmOS.js} +1 -1
  88. package/dist/esm/{filepond-plugin-image-preview-dugWUsPI.js → filepond-plugin-image-preview-nWsxKqF2.js} +1 -1
  89. package/dist/esm/{index-B-fHbvwg.js → index-CSCx8X8V.js} +2 -2
  90. package/dist/esm/{index-CTaou2hZ.js → index-DHu5e7PE.js} +1 -1
  91. package/dist/esm/loader.js +2 -2
  92. package/dist/esm/salla-accordion-body_3.entry.js +1 -1
  93. package/dist/esm/salla-accordion_6.entry.js +1 -1
  94. package/dist/esm/salla-add-product-button_4.entry.js +1 -1
  95. package/dist/esm/salla-advertisement.entry.js +1 -1
  96. package/dist/esm/salla-alert_2.entry.js +1 -1
  97. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  98. package/dist/esm/salla-apps-icons.entry.js +1 -1
  99. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  100. package/dist/esm/salla-bullet-delivery.entry.js +1 -1
  101. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  102. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  103. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  104. package/dist/esm/salla-contacts.entry.js +1 -1
  105. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  106. package/dist/esm/salla-count-down_2.entry.js +1 -1
  107. package/dist/esm/salla-custom-fields.entry.js +1 -1
  108. package/dist/esm/salla-filters-widget.entry.js +1 -1
  109. package/dist/esm/salla-filters.entry.js +1 -1
  110. package/dist/esm/salla-gifting.entry.js +1 -1
  111. package/dist/esm/salla-hook.entry.js +1 -1
  112. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  113. package/dist/esm/salla-installment.entry.js +1 -1
  114. package/dist/esm/salla-list-tile.entry.js +1 -1
  115. package/dist/esm/salla-localization-modal.entry.js +1 -1
  116. package/dist/esm/salla-login-modal.entry.js +1 -1
  117. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  118. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  119. package/dist/esm/salla-loyalty.entry.js +1 -1
  120. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  121. package/dist/esm/salla-menu.entry.js +1 -1
  122. package/dist/esm/salla-metadata.entry.js +1 -1
  123. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  124. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  125. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  126. package/dist/esm/salla-notification-item.entry.js +1 -1
  127. package/dist/esm/salla-notifications.entry.js +1 -1
  128. package/dist/esm/salla-offer-modal.entry.js +1 -1
  129. package/dist/esm/salla-offer.entry.js +1 -1
  130. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  131. package/dist/esm/salla-order-details-options.entry.js +1 -1
  132. package/dist/esm/salla-order-details.entry.js +1 -1
  133. package/dist/esm/salla-order-summary.entry.js +1 -1
  134. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  135. package/dist/esm/salla-orders.entry.js +1 -1
  136. package/dist/esm/salla-payments.entry.js +1 -1
  137. package/dist/esm/salla-placeholder.entry.js +1 -1
  138. package/dist/esm/salla-price-range.entry.js +1 -1
  139. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  140. package/dist/esm/salla-products-list.entry.js +1 -1
  141. package/dist/esm/salla-products-slider.entry.js +1 -1
  142. package/dist/esm/salla-progress-bar.entry.js +1 -1
  143. package/dist/esm/salla-quick-order.entry.js +1 -1
  144. package/dist/esm/salla-rating-modal.entry.js +1 -1
  145. package/dist/esm/salla-scopes.entry.js +1 -1
  146. package/dist/esm/salla-search.entry.js +1 -1
  147. package/dist/esm/salla-skeleton.entry.js +1 -1
  148. package/dist/esm/salla-slider.entry.js +1 -1
  149. package/dist/esm/salla-social-share.entry.js +1 -1
  150. package/dist/esm/salla-social.entry.js +1 -1
  151. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  152. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  153. package/dist/esm/salla-tooltip.entry.js +1 -1
  154. package/dist/esm/salla-trust-badges.entry.js +1 -1
  155. package/dist/esm/salla-user-menu.entry.js +1 -1
  156. package/dist/esm/salla-user-profile.entry.js +1 -1
  157. package/dist/esm/salla-user-settings.entry.js +1 -1
  158. package/dist/esm/salla-verify.entry.js +1 -1
  159. package/dist/esm/salla-wallet.entry.js +1 -1
  160. package/dist/esm/twilight.js +2 -2
  161. package/dist/esm/{vanilla-picker-Duw3dTDS.js → vanilla-picker-CQ4dQJev.js} +1 -1
  162. package/dist/twilight/{p-3a5f3ce7.entry.js → p-0bd2951c.entry.js} +1 -1
  163. package/dist/twilight/{p-e3ef352f.entry.js → p-0e364b43.entry.js} +1 -1
  164. package/dist/twilight/{p-_Gk6BpnQ.js → p-1OAIxNJF.js} +1 -1
  165. package/dist/twilight/{p-5f5d4e1c.entry.js → p-1d296b1e.entry.js} +1 -1
  166. package/dist/twilight/{p-b053a827.entry.js → p-20695fed.entry.js} +1 -1
  167. package/dist/twilight/{p-4aae95f0.entry.js → p-211ecdf8.entry.js} +1 -1
  168. package/dist/twilight/{p-58a7329c.entry.js → p-2598b0e2.entry.js} +1 -1
  169. package/dist/twilight/{p-2b2fe14f.entry.js → p-27f38623.entry.js} +1 -1
  170. package/dist/twilight/{p-14142359.entry.js → p-2abc4a24.entry.js} +1 -1
  171. package/dist/twilight/{p-3a9331bc.entry.js → p-2f4597e6.entry.js} +1 -1
  172. package/dist/twilight/{p-aa6f8402.entry.js → p-3584002e.entry.js} +1 -1
  173. package/dist/twilight/{p-66831f23.entry.js → p-375f007b.entry.js} +1 -1
  174. package/dist/twilight/{p-b673072d.entry.js → p-3ae26c18.entry.js} +1 -1
  175. package/dist/twilight/{p-9fa0db12.entry.js → p-3c669bb0.entry.js} +1 -1
  176. package/dist/twilight/{p-421937b6.entry.js → p-47740515.entry.js} +1 -1
  177. package/dist/twilight/{p-6f81c83d.entry.js → p-4ba25464.entry.js} +1 -1
  178. package/dist/twilight/{p-1c2d5328.entry.js → p-4fd0fc2a.entry.js} +1 -1
  179. package/dist/twilight/{p-60c2abb3.entry.js → p-54a45b62.entry.js} +1 -1
  180. package/dist/twilight/{p-9b1f66de.entry.js → p-54bdfaa1.entry.js} +1 -1
  181. package/dist/twilight/{p-6ef9195a.entry.js → p-55f08b09.entry.js} +1 -1
  182. package/dist/twilight/{p-905174a5.entry.js → p-58a203ef.entry.js} +1 -1
  183. package/dist/twilight/{p-c74196cf.entry.js → p-612e7ad0.entry.js} +1 -1
  184. package/dist/twilight/{p-bf17e59a.entry.js → p-621ddaae.entry.js} +1 -1
  185. package/dist/twilight/{p-77332e8d.entry.js → p-67440334.entry.js} +1 -1
  186. package/dist/twilight/{p-4b294540.entry.js → p-69e3c48a.entry.js} +1 -1
  187. package/dist/twilight/{p-365c44c2.entry.js → p-71393e6a.entry.js} +1 -1
  188. package/dist/twilight/{p-60aeb2ce.entry.js → p-713d20a2.entry.js} +1 -1
  189. package/dist/twilight/{p-972f9d4f.entry.js → p-74fb528f.entry.js} +1 -1
  190. package/dist/twilight/{p-1f52af03.entry.js → p-759ea776.entry.js} +1 -1
  191. package/dist/twilight/{p-e1ed451f.entry.js → p-76293bed.entry.js} +1 -1
  192. package/dist/twilight/{p-2bc915b6.entry.js → p-7818157c.entry.js} +1 -1
  193. package/dist/twilight/{p-5579022f.entry.js → p-7c46f469.entry.js} +1 -1
  194. package/dist/twilight/{p-fb21368b.entry.js → p-7eb215ae.entry.js} +1 -1
  195. package/dist/twilight/{p-cfaf32ba.entry.js → p-7effdd10.entry.js} +1 -1
  196. package/dist/twilight/{p-5e825370.entry.js → p-8d8f3c5a.entry.js} +1 -1
  197. package/dist/twilight/{p-06f96f06.entry.js → p-8f0f02dc.entry.js} +1 -1
  198. package/dist/twilight/{p-95c952d0.entry.js → p-916ea128.entry.js} +1 -1
  199. package/dist/twilight/{p-0c08df8f.entry.js → p-9d9fd6ea.entry.js} +1 -1
  200. package/dist/twilight/{p-B2Gco6bY.js → p-C3V6igTx.js} +1 -1
  201. package/dist/twilight/p-CGbcJTo7.js +9 -0
  202. package/dist/twilight/{p-B7yaZRKc.js → p-CNaBlSvx.js} +1 -1
  203. package/dist/twilight/{p-DE1V8UWA.js → p-CQE3hxmT.js} +1 -1
  204. package/dist/twilight/p-CSCx8X8V.js +5 -0
  205. package/dist/twilight/{p-BX5ozk-b.js → p-CrmdYuCr.js} +1 -1
  206. package/dist/twilight/{p-Dl6-KoXs.js → p-DVkH3hdE.js} +1 -1
  207. package/dist/twilight/{p-D-4ztIM-.js → p-PTrxhb6X.js} +1 -1
  208. package/dist/twilight/{p-c7e947ae.entry.js → p-a1cd434a.entry.js} +1 -1
  209. package/dist/twilight/{p-58f7fea9.entry.js → p-a22e6e33.entry.js} +1 -1
  210. package/dist/twilight/{p-723a816b.entry.js → p-b4013078.entry.js} +1 -1
  211. package/dist/twilight/{p-19f147de.entry.js → p-b56db8c8.entry.js} +1 -1
  212. package/dist/twilight/{p-8ac939dc.entry.js → p-b851cdcd.entry.js} +1 -1
  213. package/dist/twilight/{p-2a66eb4d.entry.js → p-b9496c6c.entry.js} +1 -1
  214. package/dist/twilight/{p-9ec325af.entry.js → p-bd7a418e.entry.js} +1 -1
  215. package/dist/twilight/{p-389cd70d.entry.js → p-bfdce729.entry.js} +1 -1
  216. package/dist/twilight/{p-1af81775.entry.js → p-c4bea50f.entry.js} +1 -1
  217. package/dist/twilight/{p-a543b807.entry.js → p-c7f7c0fc.entry.js} +1 -1
  218. package/dist/twilight/{p-88084123.entry.js → p-c819a24b.entry.js} +1 -1
  219. package/dist/twilight/{p-a5e3ef61.entry.js → p-c8c92bd6.entry.js} +1 -1
  220. package/dist/twilight/{p-db583811.entry.js → p-c8e6b463.entry.js} +1 -1
  221. package/dist/twilight/{p-55a8aed2.entry.js → p-cc499b03.entry.js} +1 -1
  222. package/dist/twilight/{p-ec62577e.entry.js → p-cdba6449.entry.js} +1 -1
  223. package/dist/twilight/{p-e09f5066.entry.js → p-cef440b0.entry.js} +1 -1
  224. package/dist/twilight/{p-95a539e9.entry.js → p-d0c9709f.entry.js} +1 -1
  225. package/dist/twilight/{p-d4213eae.entry.js → p-d2992ac9.entry.js} +1 -1
  226. package/dist/twilight/{p-a3ad0b94.entry.js → p-d51c988f.entry.js} +1 -1
  227. package/dist/twilight/{p-c6282352.entry.js → p-d880213f.entry.js} +1 -1
  228. package/dist/twilight/{p-dc29cded.entry.js → p-d969e5f8.entry.js} +1 -1
  229. package/dist/twilight/{p-2418ce98.entry.js → p-db802523.entry.js} +1 -1
  230. package/dist/twilight/{p-e936f726.entry.js → p-ddf4eb18.entry.js} +1 -1
  231. package/dist/twilight/{p-2af6a330.entry.js → p-e1baac53.entry.js} +1 -1
  232. package/dist/twilight/{p-d761cf9b.entry.js → p-e1d3b456.entry.js} +1 -1
  233. package/dist/twilight/{p-cbc1251e.entry.js → p-eb7a8a3f.entry.js} +1 -1
  234. package/dist/twilight/{p-5d39792e.entry.js → p-ec07da81.entry.js} +1 -1
  235. package/dist/twilight/{p-53d39d70.entry.js → p-eff84a35.entry.js} +1 -1
  236. package/dist/twilight/{p-c77ccff5.entry.js → p-f2b2e290.entry.js} +1 -1
  237. package/dist/twilight/{p-7c0c0b78.entry.js → p-f58f83a1.entry.js} +1 -1
  238. package/dist/twilight/{p-fb9e9a71.entry.js → p-fcf342fd.entry.js} +1 -1
  239. package/dist/twilight/{p-vNDBdK6G.js → p-jh2tazFy.js} +1 -1
  240. package/dist/twilight/twilight.esm.js +1 -1
  241. package/package.json +5 -5
  242. package/dist/twilight/p-B-fHbvwg.js +0 -5
  243. package/dist/twilight/p-BZ25IjRt.js +0 -9
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-B-fHbvwg.js';
4
+ import { r as registerInstance, h, H as Host } from './index-CSCx8X8V.js';
5
5
  import { S as Search } from './search-BscTeWDc.js';
6
6
 
7
7
  var StoreAlt = `<!-- Generated by IcoMoon.io -->
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, a as getElement } from './index-B-fHbvwg.js';
4
+ import { r as registerInstance, h, a as getElement } from './index-CSCx8X8V.js';
5
5
  import { S as Search } from './search-BscTeWDc.js';
6
6
  import { H as Helper } from './Helper-DFMXF2_h.js';
7
7
  import './anime.es-CgtvEd63.js';
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-B-fHbvwg.js';
4
+ import { r as registerInstance, h, H as Host } from './index-CSCx8X8V.js';
5
5
 
6
6
  const sallaSkeletonCss = ":host{display:block}";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-B-fHbvwg.js';
4
+ import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-CSCx8X8V.js';
5
5
  import { a as ArrowRightIcon, A as ArrowLeftIcon } from './keyboard_arrow_right-Vqpj4CWE.js';
6
6
 
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, a as getElement } from './index-B-fHbvwg.js';
4
+ import { r as registerInstance, h, a as getElement } from './index-CSCx8X8V.js';
5
5
  import { a as anime } from './anime.es-CgtvEd63.js';
6
6
  import { f as facebook, t as twitter } from './facebook-CO-PeZ27.js';
7
7
  import { M as MailIcon } from './mail-DmgxDvXL.js';
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host, a as getElement } from './index-B-fHbvwg.js';
4
+ import { r as registerInstance, h, H as Host, a as getElement } from './index-CSCx8X8V.js';
5
5
  import { f as facebook, t as twitter } from './facebook-CO-PeZ27.js';
6
6
 
7
7
  var instagram = `<!-- Generated by IcoMoon.io -->
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, c as createEvent, a as getElement } from './index-B-fHbvwg.js';
4
+ import { r as registerInstance, h, c as createEvent, a as getElement } from './index-CSCx8X8V.js';
5
5
 
6
6
  const sallaTabContentCss = "";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-B-fHbvwg.js';
4
+ import { r as registerInstance, h, H as Host } from './index-CSCx8X8V.js';
5
5
 
6
6
  var DiscountType;
7
7
  (function (DiscountType) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, a as getElement } from './index-B-fHbvwg.js';
4
+ import { r as registerInstance, h, a as getElement } from './index-CSCx8X8V.js';
5
5
 
6
6
  const sallaTooltipCss = ".s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;transform:translateX(-39%);background-color:#baf3e6;color:#004d5a;bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;opacity:0;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:\"\";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#baf3e6 transparent transparent transparent}.s-tooltip-item:dir(ltr){transform:translateX(-72%)}.s-tooltip-item--dark{background-color:#555555;color:white;padding:5px 15px;border-radius:8px;font-size:12px;font-weight:normal;max-width:330px;width:max-content}.s-tooltip-item--dark::after{border-color:#555555 transparent transparent transparent}";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-B-fHbvwg.js';
4
+ import { r as registerInstance, h, H as Host } from './index-CSCx8X8V.js';
5
5
 
6
6
  const sallaTrustBadgesCss = "";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host, a as getElement } from './index-B-fHbvwg.js';
4
+ import { r as registerInstance, h, H as Host, a as getElement } from './index-CSCx8X8V.js';
5
5
  import { A as ArrowDown } from './keyboard_arrow_down-DCZbpt2a.js';
6
6
  import { B as BellRing } from './bell-ring-D3mWkc-3.js';
7
7
  import { P as PendingOrdersIcon } from './cart-DY4LZmNP.js';
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h } from './index-B-fHbvwg.js';
4
+ import { r as registerInstance, h } from './index-CSCx8X8V.js';
5
5
  import { G as Genders } from './interfaces-OF8QcbMM.js';
6
6
 
7
7
  const sallaUserProfileCss = ":host{display:block}";
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-B-fHbvwg.js';
4
+ import { r as registerInstance, h, H as Host } from './index-CSCx8X8V.js';
5
5
 
6
6
  var Bullhorn = `<!-- Generated by IcoMoon.io -->
7
7
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-B-fHbvwg.js';
4
+ import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-CSCx8X8V.js';
5
5
  import { M as MailIcon } from './mail-DmgxDvXL.js';
6
6
 
7
7
  var AndroidPhoneIcon = `<!-- Generated by IcoMoon.io -->
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-B-fHbvwg.js';
4
+ import { r as registerInstance, h, H as Host } from './index-CSCx8X8V.js';
5
5
 
6
6
  const sallaWalletCss = ".s-wallet-table{min-width:100%}.s-wallet-table-balance-container{display:flex !important;align-items:center !important;justify-content:flex-start !important;gap:1rem}.s-wallet-table-balance-icon{border-radius:50%;width:52px;height:52px;font-size:25px;padding:16px 13px;background:var(--color-primary-reverse);color:var(--color-primary)}.s-wallet-table-empty-state{display:flex;flex-direction:column;align-items:center}.s-wallet-table-empty-state i{font-size:80px;margin:4rem 0 2rem;color:var(--infinte-color)}.s-wallet-table-transaction-status{padding:6px 19px !important;border-radius:20px;width:max-content;display:flex;align-items:center}.s-wallet-table-transaction-status-default{background:#fff6eb;color:#a46f29}.s-wallet-table-transaction-status-cashback{background:#effbf6;color:#00af6c}.s-wallet-table-transaction-status-refund{background:#ecf3fe;color:#5196f3}.s-wallet-table-transaction-status-purchase{background:#feecec;color:#f55157}.s-wallet-table-transaction-status-icons-success{color:#00af6c}";
7
7
 
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-B-fHbvwg.js';
5
- export { s as setNonce } from './index-B-fHbvwg.js';
4
+ import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-CSCx8X8V.js';
5
+ export { s as setNonce } from './index-CSCx8X8V.js';
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Browser v4.35.1 | MIT Licensed | https://stenciljs.com
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-B-fHbvwg.js';
4
+ import { d as getDefaultExportFromCjs } from './index-CSCx8X8V.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as e,H as t}from"./p-B-fHbvwg.js";const a=class{constructor(e){s(this,e),this.type="normal",this.width="100%",this.height="100%"}render(){return e(t,{key:"0d85a5f753c250b1acacb0dea809879a549d8d12",class:"s-skeleton-wrapper",style:{width:this.width,height:this.height}},e("div",{key:"80c3b2555be6c0fef7794bb184c919d4be2bdf24",class:{"s-skeleton-item":!0,"s-skeleton-item-circular":"circle"==this.type}}," "))}};a.style=":host{display:block}";export{a as salla_skeleton}
4
+ import{r as s,h as e,H as t}from"./p-CSCx8X8V.js";const a=class{constructor(e){s(this,e),this.type="normal",this.width="100%",this.height="100%"}render(){return e(t,{key:"0d85a5f753c250b1acacb0dea809879a549d8d12",class:"s-skeleton-wrapper",style:{width:this.width,height:this.height}},e("div",{key:"80c3b2555be6c0fef7794bb184c919d4be2bdf24",class:{"s-skeleton-item":!0,"s-skeleton-item-circular":"circle"==this.type}}," "))}};a.style=":host{display:block}";export{a as salla_skeleton}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as s,a as i}from"./p-B-fHbvwg.js";import{H as n}from"./p-CHf8XdiS.js";import"./p-CgtvEd63.js";const a=class{constructor(s){t(this,s),this.itemPerPage=10,this.no_notifications_trans=salla.lang.get("blocks.header.no_notifications"),this.load_more_text_trans=salla.lang.get("common.elements.load_more"),salla.lang.onLoaded((()=>{this.no_notifications_trans=salla.lang.get("blocks.header.no_notifications"),this.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}loading(t=!0){let s=this.status?.querySelector(".s-button-text");s&&(n.toggleElementClassIf(s,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none")}getNotificationCard(t){const s=document.createElement("salla-notification-item");return s.notification=t,s.classList.add("s-block"),s}render(){return this.showPlaceholder?s("div",{class:"s-notifications-no-content"},s("salla-placeholder",{alignment:"center"},s("span",{slot:"title"},this.no_notifications_trans))):s("div",{class:"s-notifications-wrapper"},s("div",{class:"s-notifications-container",ref:t=>this.wrapper=t}),this.nextPage&&s("div",{class:"s-infinite-scroll-wrapper",ref:t=>this.status=t},s("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},s("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText??this.load_more_text_trans),s("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))))}handleResponse(t){return t.map((t=>this.getNotificationCard(t)))}initiateInfiniteScroll(){this.wrapper?(this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:!0,nextPage:this.nextPage,scrollThreshold:!1},!0),this.infiniteScroll?.on("request",(()=>{this.loading()})),this.infiniteScroll?.on("load",(t=>{this.loading(!1),this.pagination=t.pagination,this.nextPage=t.pagination.links?.next||null,this.handleResponse(t.data).forEach((t=>this.wrapper.append(t)));let s=this.host.querySelectorAll("salla-notification-item:not(.animated)");n.animateItems(s)})),this.infiniteScroll?.on("error",(t=>{salla.logger.error("Error loading more comments:",t)}))):salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.")}async loadInitialData(){await salla.api.notifications.fetch({per_page:this.itemPerPage}).then((t=>{this.pagination=t.pagination,this.total=t.pagination.total,this.nextPage=t.pagination.links?.next||null,setTimeout((()=>{if(!t.data.length)return this.showPlaceholder=!0;this.handleResponse(t.data).forEach((t=>this.wrapper.append(t))),this.initiateInfiniteScroll();let s=this.wrapper.querySelectorAll("salla-notification-item:not(.animated)");n.animateItems(s)}),100)})).catch((t=>{salla.logger.error(t),this.showPlaceholder=!0,this.loading(!1)}))}async loadMore(){this.infiniteScroll?.loadNextPage()}async componentWillLoad(){await this.loadInitialData()}get host(){return i(this)}};a.style="";export{a as salla_notifications}
4
+ import{r as t,h as s,a as i}from"./p-CSCx8X8V.js";import{H as n}from"./p-CHf8XdiS.js";import"./p-CgtvEd63.js";const a=class{constructor(s){t(this,s),this.itemPerPage=10,this.no_notifications_trans=salla.lang.get("blocks.header.no_notifications"),this.load_more_text_trans=salla.lang.get("common.elements.load_more"),salla.lang.onLoaded((()=>{this.no_notifications_trans=salla.lang.get("blocks.header.no_notifications"),this.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}loading(t=!0){let s=this.status?.querySelector(".s-button-text");s&&(n.toggleElementClassIf(s,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none")}getNotificationCard(t){const s=document.createElement("salla-notification-item");return s.notification=t,s.classList.add("s-block"),s}render(){return this.showPlaceholder?s("div",{class:"s-notifications-no-content"},s("salla-placeholder",{alignment:"center"},s("span",{slot:"title"},this.no_notifications_trans))):s("div",{class:"s-notifications-wrapper"},s("div",{class:"s-notifications-container",ref:t=>this.wrapper=t}),this.nextPage&&s("div",{class:"s-infinite-scroll-wrapper",ref:t=>this.status=t},s("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},s("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText??this.load_more_text_trans),s("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))))}handleResponse(t){return t.map((t=>this.getNotificationCard(t)))}initiateInfiniteScroll(){this.wrapper?(this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:!0,nextPage:this.nextPage,scrollThreshold:!1},!0),this.infiniteScroll?.on("request",(()=>{this.loading()})),this.infiniteScroll?.on("load",(t=>{this.loading(!1),this.pagination=t.pagination,this.nextPage=t.pagination.links?.next||null,this.handleResponse(t.data).forEach((t=>this.wrapper.append(t)));let s=this.host.querySelectorAll("salla-notification-item:not(.animated)");n.animateItems(s)})),this.infiniteScroll?.on("error",(t=>{salla.logger.error("Error loading more comments:",t)}))):salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.")}async loadInitialData(){await salla.api.notifications.fetch({per_page:this.itemPerPage}).then((t=>{this.pagination=t.pagination,this.total=t.pagination.total,this.nextPage=t.pagination.links?.next||null,setTimeout((()=>{if(!t.data.length)return this.showPlaceholder=!0;this.handleResponse(t.data).forEach((t=>this.wrapper.append(t))),this.initiateInfiniteScroll();let s=this.wrapper.querySelectorAll("salla-notification-item:not(.animated)");n.animateItems(s)}),100)})).catch((t=>{salla.logger.error(t),this.showPlaceholder=!0,this.loading(!1)}))}async loadMore(){this.infiniteScroll?.loadNextPage()}async componentWillLoad(){await this.loadInitialData()}get host(){return i(this)}};a.style="";export{a as salla_notifications}
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{d as e}from"./p-B-fHbvwg.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]);
4
+ import{d as e}from"./p-CSCx8X8V.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
5
  /*!
6
6
  * FilePondPluginFileValidateType 1.2.8
7
7
  * Licensed under MIT, https://opensource.org/licenses/MIT/
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as a,H as s,a as l}from"./p-B-fHbvwg.js";const i=class{constructor(a){t(this,a),this.alertDelay=null,this.data=salla.config.get("store.app_install_prompt"),this.open=!1,this.closing=!1}connectedCallback(){salla.onReady((()=>{if(this.data=salla.config.get("store.app_install_prompt"),this.isMobileOrTabletDevice()){if(!this.data)return salla.logger.error("Failed to retrieve salla-app-install-alert config");this.ctaLink=salla.url.get("app"),this.alertDelay=setTimeout((()=>this.open=!0),3e3)}}))}disconnectedCallback(){clearTimeout(this.alertDelay)}isMobileOrTabletDevice(t=1024){if("undefined"==typeof window||"undefined"==typeof navigator||"undefined"==typeof document)return!1;const a=window.matchMedia(`(max-width: ${t}px)`).matches,s=/Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent),l="ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0;return s&&a&&l}closeAlert(){salla.storage.set("app_install_prompt_disabled",!0),this.closing=!0,this.host.addEventListener("animationend",(()=>{this.closing=!1,this.open=!1}),{once:!0})}shouldShowAlert(){return!salla.config.isMobileApp()}render(){return this.data&&this.shouldShowAlert()?a(s,{class:`s-app-install-alert-wrapper ${this.open?"open":""} ${this.closing?"closing":""}`,position:this.data.position},a("div",null,a("img",{src:this.data.icon,width:"58",height:"58",alt:`${salla.config.get("store.name")}`})),a("div",{class:"s-app-install-alert-content"},a("h2",{class:"s-app-install-alert-title"},this.data.title),a("p",{class:"s-app-install-alert-sub-title"},this.data.sub_title," "," ",a("a",{href:this.ctaLink,target:"_blank","aria-label":"download app",class:"s-app-install-alert-cta"},salla.lang.getWithDefault("blocks.footer.download_app_now","حمله الآن")))),a("button",{class:"s-app-install-alert-cancel-button","aria-label":"close alert",onClick:()=>this.closeAlert()},a("i",{class:"sicon-cancel"}))):null}get host(){return l(this)}};i.style=":host{display:block}";export{i as salla_app_install_alert}
4
+ import{r as t,h as a,H as s,a as l}from"./p-CSCx8X8V.js";const i=class{constructor(a){t(this,a),this.alertDelay=null,this.data=salla.config.get("store.app_install_prompt"),this.open=!1,this.closing=!1}connectedCallback(){salla.onReady((()=>{if(this.data=salla.config.get("store.app_install_prompt"),this.isMobileOrTabletDevice()){if(!this.data)return salla.logger.error("Failed to retrieve salla-app-install-alert config");this.ctaLink=salla.url.get("app"),this.alertDelay=setTimeout((()=>this.open=!0),3e3)}}))}disconnectedCallback(){clearTimeout(this.alertDelay)}isMobileOrTabletDevice(t=1024){if("undefined"==typeof window||"undefined"==typeof navigator||"undefined"==typeof document)return!1;const a=window.matchMedia(`(max-width: ${t}px)`).matches,s=/Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent),l="ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0;return s&&a&&l}closeAlert(){salla.storage.set("app_install_prompt_disabled",!0),this.closing=!0,this.host.addEventListener("animationend",(()=>{this.closing=!1,this.open=!1}),{once:!0})}shouldShowAlert(){return!salla.config.isMobileApp()}render(){return this.data&&this.shouldShowAlert()?a(s,{class:`s-app-install-alert-wrapper ${this.open?"open":""} ${this.closing?"closing":""}`,position:this.data.position},a("div",null,a("img",{src:this.data.icon,width:"58",height:"58",alt:`${salla.config.get("store.name")}`})),a("div",{class:"s-app-install-alert-content"},a("h2",{class:"s-app-install-alert-title"},this.data.title),a("p",{class:"s-app-install-alert-sub-title"},this.data.sub_title," "," ",a("a",{href:this.ctaLink,target:"_blank","aria-label":"download app",class:"s-app-install-alert-cta"},salla.lang.getWithDefault("blocks.footer.download_app_now","حمله الآن")))),a("button",{class:"s-app-install-alert-cancel-button","aria-label":"close alert",onClick:()=>this.closeAlert()},a("i",{class:"sicon-cancel"}))):null}get host(){return l(this)}};i.style=":host{display:block}";export{i as salla_app_install_alert}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,c as s,h as i,H as e,a}from"./p-B-fHbvwg.js";import{F as l}from"./p-DL4h2bc3.js";import{H as r}from"./p-CHf8XdiS.js";import"./p-CgtvEd63.js";const o=class{constructor(i){t(this,i),this.changed=s(this,"changed"),this.isReady=!1,this.filtersData={},salla.event.on("filters::hidden",(()=>this.host.style.display="none")),salla.lang.onLoaded((()=>{this.apply=salla.lang.get("pages.checkout.apply"),this.reset=salla.lang.get("pages.categories.filters_reset")})),salla.event.on("filters::fetched",(({filters:t})=>{this.host.style.display="";let s={};this.filters=t.map((t=>{if(t.label={category_id:salla.lang.get("common.titles.categories"),brand_id:salla.lang.get("common.titles.brands"),rating:salla.lang.get("pages.categories.filter_rating"),price:salla.lang.get("pages.categories.filter_price")}[t.key]||t.label,"rating"==t.key){t.type=l.VALUES;let{max:s,min:i}=t.values;t.values=[5,4,3,2,1].filter((t=>t>=i||t<=s))}this.filtersData.variants&&t.type==l.VARIANTS&&(s.variants=this.filtersData.variants),this.filtersData[t.key]&&t.type!==l.VARIANTS&&(s[t.key]=this.filtersData[t.key]);let i=new URLSearchParams(window.location.search),e=!1;for(let t of i.keys())if(t.includes("filters")){e=!0;break}if("product.index"==salla.config.get("page.slug")&&0==Object.keys(s).length&&!e){let t=window.location.href,i=salla.config.get("page.id"),e=-1!==t.indexOf("?")?"&":"?",a=t+e+"filters[category_id]="+i;s.category_id=i,window.history.pushState({path:a},"",a)}return t})),this.filtersData=s,this.host.childNodes.forEach((async t=>t.setWidgetHeight&&await t.setWidgetHeight()))}))}async componentWillLoad(){try{const t=new URLSearchParams(window.location.search);this.filtersData=await r.extractFiltersFromUrl(t)}catch(t){console.warn("failed to get filters from URL",t.message)}}async getFilters(){return this.filtersData}async applyFilters(){if(!this.isReady)return;let t=Object.keys(this.filtersData).length>0;setTimeout((()=>{if(t){let t=new URL(window.location.href);for(const[s]of t.searchParams.entries())s.startsWith("filters")&&t.searchParams.delete(s);let s=this.encodeFilters(this.filtersData),i=t.search.split("&").filter((t=>!t.includes("filters"))).join("&");t.search=i?t.search.split("&filters")[0]+"&"+s:`?${s}`,window.history.pushState({},"",t.href)}else{let t=new URL(window.location.href);t.searchParams?.delete("filters"),window.history.pushState({},"",t.toString())}salla.event.emit("salla-filters::changed",this.filtersData),this.changed.emit(this.filtersData)}),300)}encodeFilters(t,s="filters"){const i=[];for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const a=t[e],l=s?`${s}[${e}]`:e;if(Array.isArray(a))for(let t=0;t<a.length;t++)i.push(`${l}[${t}]=${a[t]}`);else i.push("object"==typeof a&&null!==a?this.encodeFilters(a,l):`${l}=${a}`)}return i.join("&")}async resetFilters(){return this.removeFiltersQueryParams(),this.filtersData={},this.host.childNodes.forEach((t=>t.reset&&t.reset())),salla.event.emit("salla-filters::reset"),this.applyFilters()}removeFiltersQueryParams(){const t=new URLSearchParams(window.location.search),s=Array.from(t.keys()).filter((t=>!t.startsWith("filters["))).map((s=>`${encodeURIComponent(s)}=${encodeURIComponent(t.get(s))}`)).join("&"),i=s?`${window.location.pathname}?${s}`:window.location.pathname;window.history.pushState({},"",i)}handleOptionChange(t,s,i){s.type===l.RANGE&&(this.filtersData[s.key]=i);let e=t.target.checked;s.type===l.VARIANTS?(this.filtersData.variants=this.filtersData.variants||{},e&&(this.filtersData.variants[s.key]=i),e||delete this.filtersData.variants[s.key]):"radio"==t.target.type?(e&&(this.filtersData[s.key]=i),e||delete this.filtersData[s.key]):"checkbox"==t.target.type&&(this.filtersData[s.key]=this.filtersData[s.key]||[],e&&this.filtersData[s.key].push(i),this.filtersData[s.key]=this.filtersData[s.key].filter((t=>t!=i))),this.applyFilters()}render(){return i(e,{key:"3b38160573591da8249606b8c12b72b58d03551d"},this.filters?.map((t=>i("salla-filters-widget",{option:t,filtersData:this.filtersData,onChanged:({detail:{event:t,option:s,value:i}})=>{this.handleOptionChange(t,s,i)}}))),this.filters?.length?i("div",{class:"s-filters-footer"},i("salla-button",{color:"gray",fill:"outline",onClick:()=>this.resetFilters()},this.reset)):"")}componentDidLoad(){this.isReady=!0}get host(){return a(this)}};o.style=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";export{o as salla_filters}
4
+ import{r as t,c as s,h as i,H as e,a}from"./p-CSCx8X8V.js";import{F as l}from"./p-DL4h2bc3.js";import{H as r}from"./p-CHf8XdiS.js";import"./p-CgtvEd63.js";const o=class{constructor(i){t(this,i),this.changed=s(this,"changed"),this.isReady=!1,this.filtersData={},salla.event.on("filters::hidden",(()=>this.host.style.display="none")),salla.lang.onLoaded((()=>{this.apply=salla.lang.get("pages.checkout.apply"),this.reset=salla.lang.get("pages.categories.filters_reset")})),salla.event.on("filters::fetched",(({filters:t})=>{this.host.style.display="";let s={};this.filters=t.map((t=>{if(t.label={category_id:salla.lang.get("common.titles.categories"),brand_id:salla.lang.get("common.titles.brands"),rating:salla.lang.get("pages.categories.filter_rating"),price:salla.lang.get("pages.categories.filter_price")}[t.key]||t.label,"rating"==t.key){t.type=l.VALUES;let{max:s,min:i}=t.values;t.values=[5,4,3,2,1].filter((t=>t>=i||t<=s))}this.filtersData.variants&&t.type==l.VARIANTS&&(s.variants=this.filtersData.variants),this.filtersData[t.key]&&t.type!==l.VARIANTS&&(s[t.key]=this.filtersData[t.key]);let i=new URLSearchParams(window.location.search),e=!1;for(let t of i.keys())if(t.includes("filters")){e=!0;break}if("product.index"==salla.config.get("page.slug")&&0==Object.keys(s).length&&!e){let t=window.location.href,i=salla.config.get("page.id"),e=-1!==t.indexOf("?")?"&":"?",a=t+e+"filters[category_id]="+i;s.category_id=i,window.history.pushState({path:a},"",a)}return t})),this.filtersData=s,this.host.childNodes.forEach((async t=>t.setWidgetHeight&&await t.setWidgetHeight()))}))}async componentWillLoad(){try{const t=new URLSearchParams(window.location.search);this.filtersData=await r.extractFiltersFromUrl(t)}catch(t){console.warn("failed to get filters from URL",t.message)}}async getFilters(){return this.filtersData}async applyFilters(){if(!this.isReady)return;let t=Object.keys(this.filtersData).length>0;setTimeout((()=>{if(t){let t=new URL(window.location.href);for(const[s]of t.searchParams.entries())s.startsWith("filters")&&t.searchParams.delete(s);let s=this.encodeFilters(this.filtersData),i=t.search.split("&").filter((t=>!t.includes("filters"))).join("&");t.search=i?t.search.split("&filters")[0]+"&"+s:`?${s}`,window.history.pushState({},"",t.href)}else{let t=new URL(window.location.href);t.searchParams?.delete("filters"),window.history.pushState({},"",t.toString())}salla.event.emit("salla-filters::changed",this.filtersData),this.changed.emit(this.filtersData)}),300)}encodeFilters(t,s="filters"){const i=[];for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const a=t[e],l=s?`${s}[${e}]`:e;if(Array.isArray(a))for(let t=0;t<a.length;t++)i.push(`${l}[${t}]=${a[t]}`);else i.push("object"==typeof a&&null!==a?this.encodeFilters(a,l):`${l}=${a}`)}return i.join("&")}async resetFilters(){return this.removeFiltersQueryParams(),this.filtersData={},this.host.childNodes.forEach((t=>t.reset&&t.reset())),salla.event.emit("salla-filters::reset"),this.applyFilters()}removeFiltersQueryParams(){const t=new URLSearchParams(window.location.search),s=Array.from(t.keys()).filter((t=>!t.startsWith("filters["))).map((s=>`${encodeURIComponent(s)}=${encodeURIComponent(t.get(s))}`)).join("&"),i=s?`${window.location.pathname}?${s}`:window.location.pathname;window.history.pushState({},"",i)}handleOptionChange(t,s,i){s.type===l.RANGE&&(this.filtersData[s.key]=i);let e=t.target.checked;s.type===l.VARIANTS?(this.filtersData.variants=this.filtersData.variants||{},e&&(this.filtersData.variants[s.key]=i),e||delete this.filtersData.variants[s.key]):"radio"==t.target.type?(e&&(this.filtersData[s.key]=i),e||delete this.filtersData[s.key]):"checkbox"==t.target.type&&(this.filtersData[s.key]=this.filtersData[s.key]||[],e&&this.filtersData[s.key].push(i),this.filtersData[s.key]=this.filtersData[s.key].filter((t=>t!=i))),this.applyFilters()}render(){return i(e,{key:"3b38160573591da8249606b8c12b72b58d03551d"},this.filters?.map((t=>i("salla-filters-widget",{option:t,filtersData:this.filtersData,onChanged:({detail:{event:t,option:s,value:i}})=>{this.handleOptionChange(t,s,i)}}))),this.filters?.length?i("div",{class:"s-filters-footer"},i("salla-button",{color:"gray",fill:"outline",onClick:()=>this.resetFilters()},this.reset)):"")}componentDidLoad(){this.isReady=!0}get host(){return a(this)}};o.style=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";export{o as salla_filters}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as a,h as s,H as o,a as t}from"./p-B-fHbvwg.js";const n=class{constructor(s){a(this,s)}async mount(a){this.host.before(a)}render(){return s(o,{key:"a887790b6c3fa466e88b0b1c90fda502f3aca812"})}async componentDidLoad(){await Salla.hooks.registerComponent("salla-hook",this)}get host(){return t(this)}};n.style=":host {\n all: unset;\n display: none; /* marker only */\n }";export{n as salla_hook}
4
+ import{r as a,h as s,H as o,a as t}from"./p-CSCx8X8V.js";const n=class{constructor(s){a(this,s)}async mount(a){this.host.before(a)}render(){return s(o,{key:"a887790b6c3fa466e88b0b1c90fda502f3aca812"})}async componentDidLoad(){await Salla.hooks.registerComponent("salla-hook",this)}get host(){return t(this)}};n.style=":host {\n all: unset;\n display: none; /* marker only */\n }";export{n as salla_hook}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as e,H as s,a as l,F as d}from"./p-B-fHbvwg.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:"92c0fba176ee0d769f866a0ed50a1b27d43e9717",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"3184473ec9399f29fa225287d6adeea109b097ec",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 a=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:"9d632fa75f2dd987a03a8d8c417e520503b4b71d",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"05517aff0eae9141a8f1f7fa0d72044fbbd46af9",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:"ac01f882d3e8268b41032857816ba9481918f484"}))}get host(){return l(this)}};a.style="";export{o as salla_multiple_bundle_product_cart,a as salla_multiple_bundle_product_details}
4
+ import{r as t,h as e,H as s,a as l,F as d}from"./p-CSCx8X8V.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:"92c0fba176ee0d769f866a0ed50a1b27d43e9717",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"3184473ec9399f29fa225287d6adeea109b097ec",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 a=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:"9d632fa75f2dd987a03a8d8c417e520503b4b71d",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"05517aff0eae9141a8f1f7fa0d72044fbbd46af9",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:"ac01f882d3e8268b41032857816ba9481918f484"}))}get host(){return l(this)}};a.style="";export{o as salla_multiple_bundle_product_cart,a as salla_multiple_bundle_product_details}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as a,H as t,a as l}from"./p-B-fHbvwg.js";const i=class{constructor(a){s(this,a),this.apps=salla.config.get("store.apps"),this.appSlot=this.host.querySelector('[slot="app"]')?.innerHTML||'<img alt="{name}" src="{icon}" width="135" height="40" decoding="async" loading="lazy" />',salla.onReady((()=>{this.apps=salla.config.get("store.apps")})),salla.lang.onLoaded((()=>{this.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}getAppsArray(){return Object.entries(this.apps).map((([s,a])=>({name:s,value:a})))}componentWillLoad(){return new Promise((s=>salla.onReady(s)))}render(){const s=this.getAppsArray();if(!Array.isArray(s)||s.length)return a(t,{class:"s-apps-icons"},!this.hideTitle&&a("h3",null,this.appsTitle),a("div",{class:{"s-apps-icons-list":!0,vertical:this.vertical}},s.map(((s,t)=>a("a",{key:t,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:this.appSlot.replace(/\{icon\}/g,salla.url.cdn(`images/${s.name}.png`)).replace(/\{name\}/g,s.name)})))))}componentDidRender(){this.host.querySelector('[slot="app"]')?.remove()}get host(){return l(this)}};i.style=":host{display:block}";export{i as salla_apps_icons}
4
+ import{r as s,h as a,H as t,a as l}from"./p-CSCx8X8V.js";const i=class{constructor(a){s(this,a),this.apps=salla.config.get("store.apps"),this.appSlot=this.host.querySelector('[slot="app"]')?.innerHTML||'<img alt="{name}" src="{icon}" width="135" height="40" decoding="async" loading="lazy" />',salla.onReady((()=>{this.apps=salla.config.get("store.apps")})),salla.lang.onLoaded((()=>{this.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}getAppsArray(){return Object.entries(this.apps).map((([s,a])=>({name:s,value:a})))}componentWillLoad(){return new Promise((s=>salla.onReady(s)))}render(){const s=this.getAppsArray();if(!Array.isArray(s)||s.length)return a(t,{class:"s-apps-icons"},!this.hideTitle&&a("h3",null,this.appsTitle),a("div",{class:{"s-apps-icons-list":!0,vertical:this.vertical}},s.map(((s,t)=>a("a",{key:t,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:this.appSlot.replace(/\{icon\}/g,salla.url.cdn(`images/${s.name}.png`)).replace(/\{name\}/g,s.name)})))))}componentDidRender(){this.host.querySelector('[slot="app"]')?.remove()}get host(){return l(this)}};i.style=":host{display:block}";export{i as salla_apps_icons}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,a as e}from"./p-B-fHbvwg.js";var o,i;!function(s){s.ProductDetail="product.single",s.Cart="cart"}(o||(o={})),function(s){s.Conditional="conditional",s.PercentageOrFixed="fixed",s.DiscountsTable="discounts_table",s.Bank="bank",s.BuyXGetY="buy_x_get_y",s.SpecialPrice="special_price",s.Percentage="percentage",s.FixedAmount="fixed_amount"}(i||(i={}));const r=class{constructor(t){s(this,t),this.productCardComponent="salla-product-card",this.offersList=[],this.canRender=!1,this.showOffer=salla.config.get("store.settings.product.show_special_offers"),this.showAllOffersModal=!1,this.showProductsModal=!1,this.selectedOfferProducts=[],this.collapsedOffers={},this.expandedCategories={},this.productsLoaded=!1,this.offer_with_price_text=salla.lang.get("pages.offer.with_price",{price:""}),this.with_discount_text=salla.lang.get("pages.products.with_a_discount"),this.product_discount_text=salla.lang.get("pages.products.discount"),this.special_offer_text=salla.lang.get("pages.products.special_offer"),this.buy_quantity_text=s=>salla.lang.get("pages.offer.buy_quantity",{quantity:s}),this.products_link_text=salla.lang.get("pages.offer.included_products","المنتجات المشمولة"),this.min_spend_text=(s,t)=>salla.lang.get("pages.offer.min_spend_amount",{amount:s,currency:t},`بحد أدنى ${s} ${t} من مبلغ الشراء`),this.min_items_text=s=>salla.lang.get("pages.offer.min_items",{items:s},`بحد أدنى ${s} منتجات`),this.product_text=salla.lang.get("common.elements.product","منتج"),salla.lang.onLoaded((()=>{this.offer_with_price_text=salla.lang.get("pages.offer.with_price"),this.with_discount_text=salla.lang.get("pages.products.with_a_discount"),this.product_discount_text=salla.lang.get("pages.products.discount"),this.special_offer_text=salla.lang.get("pages.products.special_offer"),this.buy_quantity_text(0),this.products_link_text=salla.lang.get("pages.offer.included_products","المنتجات المشمولة"),this.min_spend_text=(s,t)=>salla.lang.get("pages.offer.min_spend_amount",{amount:s,currency:t},`بحد أدنى ${s} ${t} من مبلغ الشراء`),this.min_items_text=s=>salla.lang.get("pages.offer.min_items",{items:s},`بحد أدنى ${s} منتجات`),this.product_text=salla.lang.get("common.elements.product","منتج")})),salla.onReady((()=>{this.currentPage=salla.config.get("page.slug");const s=salla.config.get("currencies")||{},t=salla.config.get("user.currency_code");this.userCurrency=s[t]||{symbol:"",code:t||"SAR",name:""}}))}async getEndpointByPageName(){return this.currentPage==o.Cart?`offers/cart/${await Salla.cart.getCurrentCartId()}`:this.currentPage==o.ProductDetail?`offers/product/${salla.config.get("page.id")}`:"offers"}emitPromotionViewed(){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;const s=this.offersList.slice(0,5).map(((s,t)=>({id:s.id,name:s.title,creative:s.description||"",position:t+1})));salla.event.emit("salla::offer.promotion.viewed",s)}emitPromotionClicked(s,t=1){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;const e=s||this.offersList[0];salla.event.emit("salla::offer.promotion.clicked",[{id:e.id,name:e.title,creative:e.description||"",position:t}])}componentWillLoad(){return this.hasCustomComponent=!!customElements.get(this.productCardComponent),new Promise((s=>salla.onReady(s))).then((()=>{if(this.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers"),!this.showOffer)throw new Error("Merchant disabled showing the offers on product page")})).then((async()=>salla.api.request(await this.getEndpointByPageName()))).then((async s=>{if(!(this.offersList=s.data).length)throw new Error("salla-offers:: There is no offers!");if(this.offersList=this.offersList.filter((s=>[i.SpecialPrice,i.Bank,i.BuyXGetY,i.DiscountsTable,i.PercentageOrFixed,i.Percentage,i.FixedAmount].includes(s.type))),!this.offersList.length)throw new Error("salla-offers:: No supported offer types found!");let t=null;this.offersList.some((s=>{const t=s.details;return"category"===t.apply_to&&t.targets||"categories"===t.apply_to&&t.targets||s.type===i.BuyXGetY&&("categories"===t.get?.source||"category"===t.get?.source)}))&&(t=(await salla.product.api.categories()).data);const e=new Set;for(const s of this.offersList){const t=s.details;"product"!==t.apply_to&&"products"!==t.apply_to||!t.targets||t.targets.forEach((s=>e.add(s))),s.type===i.BuyXGetY&&"products"===t.get?.source&&t.get?.source_value&&t.get.source_value.forEach((s=>e.add(s))),s.type!==i.BuyXGetY||"products"!==t.buy?.source&&"product"!==t.buy?.source||!t.buy?.source_value||t.buy.source_value.forEach((s=>e.add(s)))}let o={};if(e.size>0)try{const s=await salla.product.api.fetch({source:"selected",source_value:Array.from(e)});o=Object.fromEntries(s.data.map((s=>[s.id,s])))}catch(s){o={}}for(const s of this.offersList){const e=s.details;if(("category"===e.apply_to&&e.targets||"categories"===e.apply_to&&e.targets)&&t&&(e.categories=this.findCategories(t,e.targets)),"product"!==e.apply_to&&"products"!==e.apply_to||!e.targets||(e.products=e.targets.map((s=>o[s])).filter(Boolean)),s.type===i.BuyXGetY&&e.get){const s=e.get;"products"===s.source&&s.source_value?s.products=s.source_value.map((s=>o[s])).filter(Boolean):("categories"===s.source||"category"===s.source)&&t&&s.source_value&&(s.categories=this.findCategories(t,s.source_value),e.categories=s.categories)}if(s.type===i.BuyXGetY&&e.buy){const s=e.buy;"products"!==s.source&&"product"!==s.source||!s.source_value||(s.products=s.source_value.map((s=>o[s])).filter(Boolean))}}return this.offersList})).then((()=>{this.canRender=!0})).catch((s=>{salla.logger.warn(s)}))}componentDidLoad(){let s=this.host.querySelector(".s-slider-block__title-nav");s?.classList.add("s-offer-bank-payment-nav"),this.emitPromotionViewed()}findCategories(s,t){let e=[];for(const o of s)t.includes(o.id_||o.id)&&e.push(o),o.sub_categories?.length>0&&(e=e.concat(this.findCategories(o.sub_categories,t)));return e}render(){if(!this.offersList.length||!this.canRender||!this.showOffer)return null;const s=salla.lang.get("pages.offer.offers_title","عروض المنتج"),e=salla.lang.get("pages.offer.offers_subtitle","احصل على المنتج بسعر مخفض مع أفضل العروض");return[t("div",{class:"s-offer-wrapper"},t("salla-slider",{type:"carousel",id:"offers-slider","block-title":s,"block-subTitle":e,"show-controls":this.offersList.length>1},t("div",{slot:"items"},this.offersList.slice(0,5).map(((s,t)=>this.renderOfferCard(s,t+1))),this.offersList.length>5&&this.renderShowMoreCard()))),this.renderAllOffersModal(),this.renderProductsModal()]}renderShowMoreCard(){return t("div",{class:"s-offer-slide-one-fourth swiper-slide",onClick:s=>{s.preventDefault(),s.stopPropagation(),this.openAllOffersModal()}},t("div",{class:"s-offer-card s-offer-show-more-card"},t("i",{class:"sicon-add s-offer-show-more-icon"}),t("h3",{class:"s-offer-show-more-title"},salla.lang.get("pages.offer.show_more_offers","عرض المزيد من العروض"))))}openAllOffersModal(){this.showAllOffersModal=!0}closeAllOffersModal(){this.showAllOffersModal=!1}closeProductsModal(){this.showProductsModal=!1,this.selectedOfferProducts=[],this.productsLoaded=!1}handleAccordionToggle(s,t){this.collapsedOffers={...this.collapsedOffers,[s]:t}}getOfferProducts(s){const t=s.details;return t.products&&t.products.length>0?t.products:s.type===i.BuyXGetY&&t.get?.products?t.get.products:[]}renderProductsLinkForModalCard(s,e){const o=this.getOfferProducts(s);return o&&0!==o.length?t("div",{class:"s-offer-products-link",onClick:s=>{s.stopPropagation(),this.selectedOfferProducts=o,this.showProductsModal=!0}},t("span",{class:"s-offer-products-link-text"},this.products_link_text),e&&t("i",{class:"sicon-keyboard_arrow_down s-offer-products-link-icon"})):null}renderAllOffersModal(){return t("salla-drawer",{visible:this.showAllOffersModal,position:"right",width:"md","no-padding":!0,"drawer-title":salla.lang.get("pages.offer.all_offers_title","جميع العروض"),onDrawerVisibilityChanged:s=>!s.detail&&this.closeAllOffersModal()},t("div",{class:"s-offer-drawer-content"},this.offersList.map(((s,t)=>this.renderModalOfferCard(s,t+1)))))}renderProductsModal(){return t("salla-drawer",{visible:this.showProductsModal,width:"md",position:"right","no-padding":!0,"drawer-title":this.products_link_text,onDrawerVisibilityChanged:s=>!s.detail&&this.closeProductsModal()},t("div",{class:"s-offer-products-drawer-content"},this.selectedOfferProducts?.length>0?t("div",null,!this.productsLoaded&&t("div",{class:"flex items-center justify-center p-8"},t("salla-loading",{size:"24"})),t("salla-products-list",{source:"selected","source-value":JSON.stringify(this.selectedOfferProducts.map((s=>s.id))),"product-card-component":this.productCardComponent,"horizontal-cards":!0,"compact-cards":!0,includes:["images"],onProductsFetched:()=>this.productsLoaded=!0})):t("div",{class:"p-4 text-center text-gray-500"},salla.lang.get("blocks.products.no_products_found","لا توجد منتجات"))))}renderModalOfferCard(s,e=1){const o=this.getOfferProducts(s),r=o&&o.length>0,a=!1!==this.collapsedOffers[s.id];return t("div",{class:"s-offer-drawer-card"},t("div",{class:"s-offer-card-main",onClick:()=>this.emitPromotionClicked(s,e)},t("div",{class:"s-offer-card-icon"},this.getOfferIcon(s.type)),t("div",{class:"s-offer-card-content"},t("h3",{class:"s-offer-card-title",title:s.title},s.title),s.description&&t("p",{class:"s-offer-card-description"},s.description),s.type===i.DiscountsTable?t("div",{class:"s-offer-card-details"},this.renderDiscountTableOfferContent(s)):s.type===i.PercentageOrFixed||s.type===i.Percentage||s.type===i.FixedAmount?t("div",{class:"s-offer-card-details"},this.renderPercentageOrFixedOfferContent(s),this.renderOfferCategories(s)):t("div",{class:"s-offer-card-details"},this.renderOfferCategories(s)))),r&&t("salla-accordion",{collapsed:a,collapsible:!0,size:"sm",onClick:s=>s.stopPropagation(),onAccordionToggle:t=>this.handleAccordionToggle(s.id,t.detail.payload.collapsed)},t("salla-accordion-head",{collapsible:!0,collapsed:a},t("div",{slot:"title",class:"s-offer-products-thumbnails"},t("span",{class:"s-offer-products-title"},this.products_link_text,t("i",{class:`sicon-keyboard_arrow_${a?"down":"up"} s-offer-products-link-icon`})),t("div",{class:"s-offer-products-thumbnails-stack"},o.slice(0,3).map(((s,e)=>t("div",{class:"s-offer-product-thumbnail",style:{zIndex:`${e+1}`}},t("img",{src:s.thumbnail||s.image?.url||salla.url.cdn("images/s-empty.png"),alt:s.name})))),o.length>3&&t("div",{class:"s-offer-products-more-count",style:{zIndex:"7"}},"+",o.length-3)))),t("salla-accordion-body",null,t("div",{class:"s-offer-products-content"},t("salla-products-list",{source:"selected","source-value":JSON.stringify(o.map((s=>s.id))),"product-card-component":this.productCardComponent,"horizontal-cards":!0,"compact-cards":!0,includes:["images"]})))))}renderOfferCard(s,e=1){return t("div",{class:"s-offer-slide-one-fourth swiper-slide",onClick:()=>this.emitPromotionClicked(s,e)},t("div",{class:"s-offer-card"},t("div",{class:"s-offer-card-icon"},this.getOfferIcon(s.type)),t("div",{class:"s-offer-card-content"},t("h3",{class:"s-offer-card-title",title:s.title},s.title),s.description&&t("p",{class:"s-offer-card-description"},s.description),t("div",{class:"s-offer-card-details"},s.type===i.DiscountsTable?this.renderDiscountTableOfferContent(s):s.type===i.PercentageOrFixed||s.type===i.Percentage||s.type===i.FixedAmount?[this.renderPercentageOrFixedOfferContent(s),this.renderOfferCategories(s)]:this.renderOfferCategories(s),this.renderProductsLinkForModalCard(s,!1)))))}getOfferIcon(s){return t("i",{class:{[i.DiscountsTable]:"sicon-discount-calculator",[i.Bank]:"sicon-bank",[i.SpecialPrice]:"sicon-fire",[i.BuyXGetY]:"sicon-gift",[i.PercentageOrFixed]:"sicon-special-discount",[i.Percentage]:"sicon-special-discount",[i.FixedAmount]:"sicon-special-discount"}[s]||"sicon-discount"})}renderDiscountTableOfferContent(s){const e=s.details.discounts||[];return e.length?t("div",null,t("div",{class:"s-offer-card-description"},salla.lang.get("pages.offer.discount_table_subtitle","وفر اكتر بشراء منتجات أكثر")),t("table",{class:"s-offer-discount-table"},t("tbody",null,this.groupDiscountsByRows(e,3).map(((s,e)=>t("tr",{key:e},s.map(((s,e)=>t("td",{key:e},t("div",{class:"s-offer-discount-percentage"},s.percentage,"%"),t("div",{class:"s-offer-discount-condition"},this.formatDiscountCondition(s))))))))))):null}renderPercentageOrFixedOfferContent(s){const e=s.details;return e.discount_value||e.min_spend>0||e.min_items>0?t("div",{class:"s-offer-percentage-fixed-content"},e.min_spend>0&&t("div",{class:"s-offer-min-spend"},this.min_spend_text(e.min_spend,this.userCurrency?.symbol||"")),e.min_items>0&&t("div",{class:"s-offer-min-items"},this.min_items_text(e.min_items))):null}groupDiscountsByRows(s,t){const e=[];for(let o=0;o<s.length;o+=t)e.push(s.slice(o,o+t));return e}formatDiscountCondition(s){return s.discounted_amount?`${s.discounted_amount} ${this.userCurrency?.symbol||""}`:null!=s.quantity?this.buy_quantity_text(s.quantity):`1 ${this.product_text}`}renderOfferCategories(s){const e=s.details;let o=e.categories||[];if(s.type===i.BuyXGetY&&e.get?.categories&&(o=e.get.categories),!o.length)return null;const r=this.expandedCategories[s.id],a=o.length>3,l=r?o:o.slice(0,3);return t("div",{class:"s-offer-categories"},t("div",{class:"s-offer-categories-list"},l.map(((s,e)=>t("a",{key:e,class:"s-offer-category-item",href:s.url||salla.url.create("categories",s.id||s.id_)},s.name))),a&&t("span",{class:"s-offer-categories-toggle",onClick:t=>{t.preventDefault(),t.stopPropagation(),this.toggleCategoryExpansion(s.id)}},r?t("span",null,t("i",{class:"sicon-keyboard_arrow_up"})," ",salla.lang.get("common.elements.hide","إخفاء")):t("span",null,salla.lang.get("common.elements.show","عرض")," ","+"+(o.length-3)," ",t("i",{class:"sicon-keyboard_arrow_down"})))))}toggleCategoryExpansion(s){this.expandedCategories={...this.expandedCategories,[s]:!this.expandedCategories[s]}}get host(){return e(this)}};r.style=":host .s-drawer-close:where([dir=rtl],[dir=rtl] *){left:0}";export{r as salla_offer}
4
+ import{r as s,h as t,a as e}from"./p-CSCx8X8V.js";var o,i;!function(s){s.ProductDetail="product.single",s.Cart="cart"}(o||(o={})),function(s){s.Conditional="conditional",s.PercentageOrFixed="fixed",s.DiscountsTable="discounts_table",s.Bank="bank",s.BuyXGetY="buy_x_get_y",s.SpecialPrice="special_price",s.Percentage="percentage",s.FixedAmount="fixed_amount"}(i||(i={}));const r=class{constructor(t){s(this,t),this.productCardComponent="salla-product-card",this.offersList=[],this.canRender=!1,this.showOffer=salla.config.get("store.settings.product.show_special_offers"),this.showAllOffersModal=!1,this.showProductsModal=!1,this.selectedOfferProducts=[],this.collapsedOffers={},this.expandedCategories={},this.productsLoaded=!1,this.offer_with_price_text=salla.lang.get("pages.offer.with_price",{price:""}),this.with_discount_text=salla.lang.get("pages.products.with_a_discount"),this.product_discount_text=salla.lang.get("pages.products.discount"),this.special_offer_text=salla.lang.get("pages.products.special_offer"),this.buy_quantity_text=s=>salla.lang.get("pages.offer.buy_quantity",{quantity:s}),this.products_link_text=salla.lang.get("pages.offer.included_products","المنتجات المشمولة"),this.min_spend_text=(s,t)=>salla.lang.get("pages.offer.min_spend_amount",{amount:s,currency:t},`بحد أدنى ${s} ${t} من مبلغ الشراء`),this.min_items_text=s=>salla.lang.get("pages.offer.min_items",{items:s},`بحد أدنى ${s} منتجات`),this.product_text=salla.lang.get("common.elements.product","منتج"),salla.lang.onLoaded((()=>{this.offer_with_price_text=salla.lang.get("pages.offer.with_price"),this.with_discount_text=salla.lang.get("pages.products.with_a_discount"),this.product_discount_text=salla.lang.get("pages.products.discount"),this.special_offer_text=salla.lang.get("pages.products.special_offer"),this.buy_quantity_text(0),this.products_link_text=salla.lang.get("pages.offer.included_products","المنتجات المشمولة"),this.min_spend_text=(s,t)=>salla.lang.get("pages.offer.min_spend_amount",{amount:s,currency:t},`بحد أدنى ${s} ${t} من مبلغ الشراء`),this.min_items_text=s=>salla.lang.get("pages.offer.min_items",{items:s},`بحد أدنى ${s} منتجات`),this.product_text=salla.lang.get("common.elements.product","منتج")})),salla.onReady((()=>{this.currentPage=salla.config.get("page.slug");const s=salla.config.get("currencies")||{},t=salla.config.get("user.currency_code");this.userCurrency=s[t]||{symbol:"",code:t||"SAR",name:""}}))}async getEndpointByPageName(){return this.currentPage==o.Cart?`offers/cart/${await Salla.cart.getCurrentCartId()}`:this.currentPage==o.ProductDetail?`offers/product/${salla.config.get("page.id")}`:"offers"}emitPromotionViewed(){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;const s=this.offersList.slice(0,5).map(((s,t)=>({id:s.id,name:s.title,creative:s.description||"",position:t+1})));salla.event.emit("salla::offer.promotion.viewed",s)}emitPromotionClicked(s,t=1){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;const e=s||this.offersList[0];salla.event.emit("salla::offer.promotion.clicked",[{id:e.id,name:e.title,creative:e.description||"",position:t}])}componentWillLoad(){return this.hasCustomComponent=!!customElements.get(this.productCardComponent),new Promise((s=>salla.onReady(s))).then((()=>{if(this.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers"),!this.showOffer)throw new Error("Merchant disabled showing the offers on product page")})).then((async()=>salla.api.request(await this.getEndpointByPageName()))).then((async s=>{if(!(this.offersList=s.data).length)throw new Error("salla-offers:: There is no offers!");if(this.offersList=this.offersList.filter((s=>[i.SpecialPrice,i.Bank,i.BuyXGetY,i.DiscountsTable,i.PercentageOrFixed,i.Percentage,i.FixedAmount].includes(s.type))),!this.offersList.length)throw new Error("salla-offers:: No supported offer types found!");let t=null;this.offersList.some((s=>{const t=s.details;return"category"===t.apply_to&&t.targets||"categories"===t.apply_to&&t.targets||s.type===i.BuyXGetY&&("categories"===t.get?.source||"category"===t.get?.source)}))&&(t=(await salla.product.api.categories()).data);const e=new Set;for(const s of this.offersList){const t=s.details;"product"!==t.apply_to&&"products"!==t.apply_to||!t.targets||t.targets.forEach((s=>e.add(s))),s.type===i.BuyXGetY&&"products"===t.get?.source&&t.get?.source_value&&t.get.source_value.forEach((s=>e.add(s))),s.type!==i.BuyXGetY||"products"!==t.buy?.source&&"product"!==t.buy?.source||!t.buy?.source_value||t.buy.source_value.forEach((s=>e.add(s)))}let o={};if(e.size>0)try{const s=await salla.product.api.fetch({source:"selected",source_value:Array.from(e)});o=Object.fromEntries(s.data.map((s=>[s.id,s])))}catch(s){o={}}for(const s of this.offersList){const e=s.details;if(("category"===e.apply_to&&e.targets||"categories"===e.apply_to&&e.targets)&&t&&(e.categories=this.findCategories(t,e.targets)),"product"!==e.apply_to&&"products"!==e.apply_to||!e.targets||(e.products=e.targets.map((s=>o[s])).filter(Boolean)),s.type===i.BuyXGetY&&e.get){const s=e.get;"products"===s.source&&s.source_value?s.products=s.source_value.map((s=>o[s])).filter(Boolean):("categories"===s.source||"category"===s.source)&&t&&s.source_value&&(s.categories=this.findCategories(t,s.source_value),e.categories=s.categories)}if(s.type===i.BuyXGetY&&e.buy){const s=e.buy;"products"!==s.source&&"product"!==s.source||!s.source_value||(s.products=s.source_value.map((s=>o[s])).filter(Boolean))}}return this.offersList})).then((()=>{this.canRender=!0})).catch((s=>{salla.logger.warn(s)}))}componentDidLoad(){let s=this.host.querySelector(".s-slider-block__title-nav");s?.classList.add("s-offer-bank-payment-nav"),this.emitPromotionViewed()}findCategories(s,t){let e=[];for(const o of s)t.includes(o.id_||o.id)&&e.push(o),o.sub_categories?.length>0&&(e=e.concat(this.findCategories(o.sub_categories,t)));return e}render(){if(!this.offersList.length||!this.canRender||!this.showOffer)return null;const s=salla.lang.get("pages.offer.offers_title","عروض المنتج"),e=salla.lang.get("pages.offer.offers_subtitle","احصل على المنتج بسعر مخفض مع أفضل العروض");return[t("div",{class:"s-offer-wrapper"},t("salla-slider",{type:"carousel",id:"offers-slider","block-title":s,"block-subTitle":e,"show-controls":this.offersList.length>1},t("div",{slot:"items"},this.offersList.slice(0,5).map(((s,t)=>this.renderOfferCard(s,t+1))),this.offersList.length>5&&this.renderShowMoreCard()))),this.renderAllOffersModal(),this.renderProductsModal()]}renderShowMoreCard(){return t("div",{class:"s-offer-slide-one-fourth swiper-slide",onClick:s=>{s.preventDefault(),s.stopPropagation(),this.openAllOffersModal()}},t("div",{class:"s-offer-card s-offer-show-more-card"},t("i",{class:"sicon-add s-offer-show-more-icon"}),t("h3",{class:"s-offer-show-more-title"},salla.lang.get("pages.offer.show_more_offers","عرض المزيد من العروض"))))}openAllOffersModal(){this.showAllOffersModal=!0}closeAllOffersModal(){this.showAllOffersModal=!1}closeProductsModal(){this.showProductsModal=!1,this.selectedOfferProducts=[],this.productsLoaded=!1}handleAccordionToggle(s,t){this.collapsedOffers={...this.collapsedOffers,[s]:t}}getOfferProducts(s){const t=s.details;return t.products&&t.products.length>0?t.products:s.type===i.BuyXGetY&&t.get?.products?t.get.products:[]}renderProductsLinkForModalCard(s,e){const o=this.getOfferProducts(s);return o&&0!==o.length?t("div",{class:"s-offer-products-link",onClick:s=>{s.stopPropagation(),this.selectedOfferProducts=o,this.showProductsModal=!0}},t("span",{class:"s-offer-products-link-text"},this.products_link_text),e&&t("i",{class:"sicon-keyboard_arrow_down s-offer-products-link-icon"})):null}renderAllOffersModal(){return t("salla-drawer",{visible:this.showAllOffersModal,position:"right",width:"md","no-padding":!0,"drawer-title":salla.lang.get("pages.offer.all_offers_title","جميع العروض"),onDrawerVisibilityChanged:s=>!s.detail&&this.closeAllOffersModal()},t("div",{class:"s-offer-drawer-content"},this.offersList.map(((s,t)=>this.renderModalOfferCard(s,t+1)))))}renderProductsModal(){return t("salla-drawer",{visible:this.showProductsModal,width:"md",position:"right","no-padding":!0,"drawer-title":this.products_link_text,onDrawerVisibilityChanged:s=>!s.detail&&this.closeProductsModal()},t("div",{class:"s-offer-products-drawer-content"},this.selectedOfferProducts?.length>0?t("div",null,!this.productsLoaded&&t("div",{class:"flex items-center justify-center p-8"},t("salla-loading",{size:"24"})),t("salla-products-list",{source:"selected","source-value":JSON.stringify(this.selectedOfferProducts.map((s=>s.id))),"product-card-component":this.productCardComponent,"horizontal-cards":!0,"compact-cards":!0,includes:["images"],onProductsFetched:()=>this.productsLoaded=!0})):t("div",{class:"p-4 text-center text-gray-500"},salla.lang.get("blocks.products.no_products_found","لا توجد منتجات"))))}renderModalOfferCard(s,e=1){const o=this.getOfferProducts(s),r=o&&o.length>0,a=!1!==this.collapsedOffers[s.id];return t("div",{class:"s-offer-drawer-card"},t("div",{class:"s-offer-card-main",onClick:()=>this.emitPromotionClicked(s,e)},t("div",{class:"s-offer-card-icon"},this.getOfferIcon(s.type)),t("div",{class:"s-offer-card-content"},t("h3",{class:"s-offer-card-title",title:s.title},s.title),s.description&&t("p",{class:"s-offer-card-description"},s.description),s.type===i.DiscountsTable?t("div",{class:"s-offer-card-details"},this.renderDiscountTableOfferContent(s)):s.type===i.PercentageOrFixed||s.type===i.Percentage||s.type===i.FixedAmount?t("div",{class:"s-offer-card-details"},this.renderPercentageOrFixedOfferContent(s),this.renderOfferCategories(s)):t("div",{class:"s-offer-card-details"},this.renderOfferCategories(s)))),r&&t("salla-accordion",{collapsed:a,collapsible:!0,size:"sm",onClick:s=>s.stopPropagation(),onAccordionToggle:t=>this.handleAccordionToggle(s.id,t.detail.payload.collapsed)},t("salla-accordion-head",{collapsible:!0,collapsed:a},t("div",{slot:"title",class:"s-offer-products-thumbnails"},t("span",{class:"s-offer-products-title"},this.products_link_text,t("i",{class:`sicon-keyboard_arrow_${a?"down":"up"} s-offer-products-link-icon`})),t("div",{class:"s-offer-products-thumbnails-stack"},o.slice(0,3).map(((s,e)=>t("div",{class:"s-offer-product-thumbnail",style:{zIndex:`${e+1}`}},t("img",{src:s.thumbnail||s.image?.url||salla.url.cdn("images/s-empty.png"),alt:s.name})))),o.length>3&&t("div",{class:"s-offer-products-more-count",style:{zIndex:"7"}},"+",o.length-3)))),t("salla-accordion-body",null,t("div",{class:"s-offer-products-content"},t("salla-products-list",{source:"selected","source-value":JSON.stringify(o.map((s=>s.id))),"product-card-component":this.productCardComponent,"horizontal-cards":!0,"compact-cards":!0,includes:["images"]})))))}renderOfferCard(s,e=1){return t("div",{class:"s-offer-slide-one-fourth swiper-slide",onClick:()=>this.emitPromotionClicked(s,e)},t("div",{class:"s-offer-card"},t("div",{class:"s-offer-card-icon"},this.getOfferIcon(s.type)),t("div",{class:"s-offer-card-content"},t("h3",{class:"s-offer-card-title",title:s.title},s.title),s.description&&t("p",{class:"s-offer-card-description"},s.description),t("div",{class:"s-offer-card-details"},s.type===i.DiscountsTable?this.renderDiscountTableOfferContent(s):s.type===i.PercentageOrFixed||s.type===i.Percentage||s.type===i.FixedAmount?[this.renderPercentageOrFixedOfferContent(s),this.renderOfferCategories(s)]:this.renderOfferCategories(s),this.renderProductsLinkForModalCard(s,!1)))))}getOfferIcon(s){return t("i",{class:{[i.DiscountsTable]:"sicon-discount-calculator",[i.Bank]:"sicon-bank",[i.SpecialPrice]:"sicon-fire",[i.BuyXGetY]:"sicon-gift",[i.PercentageOrFixed]:"sicon-special-discount",[i.Percentage]:"sicon-special-discount",[i.FixedAmount]:"sicon-special-discount"}[s]||"sicon-discount"})}renderDiscountTableOfferContent(s){const e=s.details.discounts||[];return e.length?t("div",null,t("div",{class:"s-offer-card-description"},salla.lang.get("pages.offer.discount_table_subtitle","وفر اكتر بشراء منتجات أكثر")),t("table",{class:"s-offer-discount-table"},t("tbody",null,this.groupDiscountsByRows(e,3).map(((s,e)=>t("tr",{key:e},s.map(((s,e)=>t("td",{key:e},t("div",{class:"s-offer-discount-percentage"},s.percentage,"%"),t("div",{class:"s-offer-discount-condition"},this.formatDiscountCondition(s))))))))))):null}renderPercentageOrFixedOfferContent(s){const e=s.details;return e.discount_value||e.min_spend>0||e.min_items>0?t("div",{class:"s-offer-percentage-fixed-content"},e.min_spend>0&&t("div",{class:"s-offer-min-spend"},this.min_spend_text(e.min_spend,this.userCurrency?.symbol||"")),e.min_items>0&&t("div",{class:"s-offer-min-items"},this.min_items_text(e.min_items))):null}groupDiscountsByRows(s,t){const e=[];for(let o=0;o<s.length;o+=t)e.push(s.slice(o,o+t));return e}formatDiscountCondition(s){return s.discounted_amount?`${s.discounted_amount} ${this.userCurrency?.symbol||""}`:null!=s.quantity?this.buy_quantity_text(s.quantity):`1 ${this.product_text}`}renderOfferCategories(s){const e=s.details;let o=e.categories||[];if(s.type===i.BuyXGetY&&e.get?.categories&&(o=e.get.categories),!o.length)return null;const r=this.expandedCategories[s.id],a=o.length>3,l=r?o:o.slice(0,3);return t("div",{class:"s-offer-categories"},t("div",{class:"s-offer-categories-list"},l.map(((s,e)=>t("a",{key:e,class:"s-offer-category-item",href:s.url||salla.url.create("categories",s.id||s.id_)},s.name))),a&&t("span",{class:"s-offer-categories-toggle",onClick:t=>{t.preventDefault(),t.stopPropagation(),this.toggleCategoryExpansion(s.id)}},r?t("span",null,t("i",{class:"sicon-keyboard_arrow_up"})," ",salla.lang.get("common.elements.hide","إخفاء")):t("span",null,salla.lang.get("common.elements.show","عرض")," ","+"+(o.length-3)," ",t("i",{class:"sicon-keyboard_arrow_down"})))))}toggleCategoryExpansion(s){this.expandedCategories={...this.expandedCategories,[s]:!this.expandedCategories[s]}}get host(){return e(this)}};r.style=":host .s-drawer-close:where([dir=rtl],[dir=rtl] *){left:0}";export{r as salla_offer}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,c as t,h as i,H as e,a as h}from"./p-B-fHbvwg.js";import{H as a}from"./p-CHf8XdiS.js";import{F as l}from"./p-DL4h2bc3.js";import"./p-CgtvEd63.js";const r=class{constructor(i){s(this,i),this.changed=t(this,"changed"),this.initialItemCount=10,this.expandedItemCount=15,this.calculatedInitialHeight=0,this.calculatedExpandedHeight=0,this.isOpen=!0,this.isShowMore=!1,this.showMoreLabel="عرض المزيد",this.showLessLabel="عرض أقل",this.page=salla.config.get("page"),this.searchQuery="",this.filteredCount=0}connectedCallback(){this.withLoadMore="price"!=this.option.key&&Array.isArray(this.option.values)&&this.option.values.length>this.initialItemCount,salla.onReady((()=>{this.page=salla.config.get("page")})),salla.lang.onLoaded((()=>{this.showMoreLabel=salla.lang.getWithDefault("common.titles.more",this.showMoreLabel),this.showLessLabel=salla.lang.getWithDefault("common.elements.show_less",this.showLessLabel)}))}componentDidLoad(){const s=this.widgetValues.querySelectorAll(".s-filters-label");if(s.length>0){const t=Math.min(this.initialItemCount,s.length);this.calculatedInitialHeight=35*this.initialItemCount,this.calculatedExpandedHeight=s.length>this.initialItemCount?35*this.expandedItemCount:35*t}this.widgetValues.scrollHeight<this.calculatedInitialHeight&&(this.withLoadMore=!1),this.withLoadMore&&this.widgetValues&&(this.widgetValues.style.maxHeight=`${this.calculatedInitialHeight}px`),this.widgetContent.style.height=`${this.widgetContent.scrollHeight}px`}async setWidgetHeight(s=250){this.widgetContent.removeAttribute("style"),setTimeout((()=>{this.widgetContent.style.height=this.widgetContent.scrollHeight+"px"}),s)}async reset(){this.option.type===l.RANGE&&this.priceRange.reset(),Array.from(this.host.querySelectorAll("input")).forEach((s=>s.checked=!1))}async showMore(){this.isShowMore=!this.isShowMore,this.widgetContent.style.height="auto",this.isShowMore||(this.widgetValues.scrollTop=0);const s=this.isShowMore?this.calculatedExpandedHeight:this.calculatedInitialHeight,t=this.searchQuery?this.filteredCount:Array.isArray(this.option.values)?this.option.values.length:0;this.widgetValues.style.maxHeight=`${s}px`,this.widgetValues.style.overflowY=this.isShowMore&&t>this.expandedItemCount?"auto":"hidden",setTimeout((()=>{this.widgetContent.style.height=`${this.widgetContent.scrollHeight}px`}),400)}async toggleWidget(){this.isOpen=!this.isOpen,a.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(()=>this.isOpen))}renderFilterOption(s){if(![l.VALUES,l.MINIMUM,l.VARIANTS].includes(s.type))return"";const t=s.values.filter((s=>{if(!this.searchQuery)return!0;const t="number"==typeof s?String(s):s?.value||s?.key||"";return String(t).toLowerCase().includes(this.searchQuery.toLowerCase())}));return this.filteredCount=t.length,0===t.length?i("div",{class:"s-filters-widget-empty-state"},salla.lang.get("common.elements.no_options")||"لا توجد نتائج"):t.map((t=>{let e="number"==typeof t?t:t.key||t.value;return i("label",{class:"s-filters-label",htmlFor:`${s.key}-option-${e}`,key:`${s.key}-option-${e}`},i("input",{id:`${s.key}-option-${e}`,name:s.key,type:"radio",checked:this.isSelectedOption(s,e),class:"s-filters-radio",onChange:t=>this.changed.emit({event:t,option:s,value:e})}),this.getOptionLabel(s,t))}))}isSelectedOption(s,t){return s.type===l.MINIMUM?this.filtersData[s.key]==t:s.type===l.VARIANTS?this.filtersData[s.type]&&this.filtersData[s.type][Object.keys(this.filtersData[s.type])[0]]==t:s.type===l.RANGE?this.filtersData[s.key]&&this.filtersData[s.key].min==t.min&&this.filtersData[s.key].max==t.max:s.type===l.VALUES&&this.filtersData[s.key]&&Number(this.filtersData[s.key])==Number(t)}getOptionLabel(s,t){return"rating"==s.key?i("salla-rating-stars",{size:"small",value:t}):i("span",{class:"s-filters-option-name"},t.value||"null")}render(){return i(e,{key:"aaa423868d5ecd62a1d3dbb05a5143f7983e15ab",class:"s-filters-widget-container"},i("h3",{key:"444a72e027f870fcd3f2fb01d8a52d642b1d6fab",class:"s-filters-widget-title",onClick:()=>this.toggleWidget()},i("span",{key:"1813e58218aefebecdd0b2d8af9ce89ce5c17b9f"},this.option.label),i("span",{key:"11926f6d1343095b29c93f010b99cfc07152918a",class:"s-filters-widget-plusminus "+(this.isOpen?"s-filters-widget-plusminus-active":"")})),i("div",{key:"24f151541c5da697d157f6f110fb640b316ad533",class:"s-filters-widget-content",ref:s=>this.widgetContent=s},Array.isArray(this.option.values)&&this.option.values.length>5&&i("div",{key:"12b4adb00888f657f9d67f84b377634190e0cedd",class:"s-filters-widget-search-wrapper",style:{padding:"8px 0",marginBottom:"8px"}},i("input",{key:"b14ff87ad64e594c3120be3b5e5d102c8d74cd98",type:"text",class:"s-filters-widget-search-input",placeholder:salla.lang.get("blocks.header.search_placeholder")||"بحث...",value:this.searchQuery,onInput:s=>this.searchQuery=s.target.value})),i("div",{key:"9a9f76a9ca1a9ae7e474dcf771e0a58936dee7d7",class:"s-filters-widget-values",ref:s=>this.widgetValues=s},i("slot",{key:"020b614afb9c6ca5aadfccafe748e73e8f2fa77a"}),this.option.type!==l.RANGE?this.renderFilterOption(this.option):i("salla-price-range",{onChanged:s=>{this.changed.emit(s.detail)},ref:s=>this.priceRange=s,filtersData:this.filtersData,option:this.option})),this.withLoadMore&&(!this.searchQuery||this.filteredCount>this.initialItemCount)&&i("a",{key:"4d03eccbc3b357444e27d61c647b09d435ceb1be",class:"s-filters-widget-more",onClick:()=>this.showMore()},this.isShowMore?this.showLessLabel:this.showMoreLabel)))}get host(){return h(this)}};r.style=":host{display:block}";export{r as salla_filters_widget}
4
+ import{r as s,c as t,h as i,H as e,a as h}from"./p-CSCx8X8V.js";import{H as a}from"./p-CHf8XdiS.js";import{F as l}from"./p-DL4h2bc3.js";import"./p-CgtvEd63.js";const r=class{constructor(i){s(this,i),this.changed=t(this,"changed"),this.initialItemCount=10,this.expandedItemCount=15,this.calculatedInitialHeight=0,this.calculatedExpandedHeight=0,this.isOpen=!0,this.isShowMore=!1,this.showMoreLabel="عرض المزيد",this.showLessLabel="عرض أقل",this.page=salla.config.get("page"),this.searchQuery="",this.filteredCount=0}connectedCallback(){this.withLoadMore="price"!=this.option.key&&Array.isArray(this.option.values)&&this.option.values.length>this.initialItemCount,salla.onReady((()=>{this.page=salla.config.get("page")})),salla.lang.onLoaded((()=>{this.showMoreLabel=salla.lang.getWithDefault("common.titles.more",this.showMoreLabel),this.showLessLabel=salla.lang.getWithDefault("common.elements.show_less",this.showLessLabel)}))}componentDidLoad(){const s=this.widgetValues.querySelectorAll(".s-filters-label");if(s.length>0){const t=Math.min(this.initialItemCount,s.length);this.calculatedInitialHeight=35*this.initialItemCount,this.calculatedExpandedHeight=s.length>this.initialItemCount?35*this.expandedItemCount:35*t}this.widgetValues.scrollHeight<this.calculatedInitialHeight&&(this.withLoadMore=!1),this.withLoadMore&&this.widgetValues&&(this.widgetValues.style.maxHeight=`${this.calculatedInitialHeight}px`),this.widgetContent.style.height=`${this.widgetContent.scrollHeight}px`}async setWidgetHeight(s=250){this.widgetContent.removeAttribute("style"),setTimeout((()=>{this.widgetContent.style.height=this.widgetContent.scrollHeight+"px"}),s)}async reset(){this.option.type===l.RANGE&&this.priceRange.reset(),Array.from(this.host.querySelectorAll("input")).forEach((s=>s.checked=!1))}async showMore(){this.isShowMore=!this.isShowMore,this.widgetContent.style.height="auto",this.isShowMore||(this.widgetValues.scrollTop=0);const s=this.isShowMore?this.calculatedExpandedHeight:this.calculatedInitialHeight,t=this.searchQuery?this.filteredCount:Array.isArray(this.option.values)?this.option.values.length:0;this.widgetValues.style.maxHeight=`${s}px`,this.widgetValues.style.overflowY=this.isShowMore&&t>this.expandedItemCount?"auto":"hidden",setTimeout((()=>{this.widgetContent.style.height=`${this.widgetContent.scrollHeight}px`}),400)}async toggleWidget(){this.isOpen=!this.isOpen,a.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(()=>this.isOpen))}renderFilterOption(s){if(![l.VALUES,l.MINIMUM,l.VARIANTS].includes(s.type))return"";const t=s.values.filter((s=>{if(!this.searchQuery)return!0;const t="number"==typeof s?String(s):s?.value||s?.key||"";return String(t).toLowerCase().includes(this.searchQuery.toLowerCase())}));return this.filteredCount=t.length,0===t.length?i("div",{class:"s-filters-widget-empty-state"},salla.lang.get("common.elements.no_options")||"لا توجد نتائج"):t.map((t=>{let e="number"==typeof t?t:t.key||t.value;return i("label",{class:"s-filters-label",htmlFor:`${s.key}-option-${e}`,key:`${s.key}-option-${e}`},i("input",{id:`${s.key}-option-${e}`,name:s.key,type:"radio",checked:this.isSelectedOption(s,e),class:"s-filters-radio",onChange:t=>this.changed.emit({event:t,option:s,value:e})}),this.getOptionLabel(s,t))}))}isSelectedOption(s,t){return s.type===l.MINIMUM?this.filtersData[s.key]==t:s.type===l.VARIANTS?this.filtersData[s.type]&&this.filtersData[s.type][Object.keys(this.filtersData[s.type])[0]]==t:s.type===l.RANGE?this.filtersData[s.key]&&this.filtersData[s.key].min==t.min&&this.filtersData[s.key].max==t.max:s.type===l.VALUES&&this.filtersData[s.key]&&Number(this.filtersData[s.key])==Number(t)}getOptionLabel(s,t){return"rating"==s.key?i("salla-rating-stars",{size:"small",value:t}):i("span",{class:"s-filters-option-name"},t.value||"null")}render(){return i(e,{key:"aaa423868d5ecd62a1d3dbb05a5143f7983e15ab",class:"s-filters-widget-container"},i("h3",{key:"444a72e027f870fcd3f2fb01d8a52d642b1d6fab",class:"s-filters-widget-title",onClick:()=>this.toggleWidget()},i("span",{key:"1813e58218aefebecdd0b2d8af9ce89ce5c17b9f"},this.option.label),i("span",{key:"11926f6d1343095b29c93f010b99cfc07152918a",class:"s-filters-widget-plusminus "+(this.isOpen?"s-filters-widget-plusminus-active":"")})),i("div",{key:"24f151541c5da697d157f6f110fb640b316ad533",class:"s-filters-widget-content",ref:s=>this.widgetContent=s},Array.isArray(this.option.values)&&this.option.values.length>5&&i("div",{key:"12b4adb00888f657f9d67f84b377634190e0cedd",class:"s-filters-widget-search-wrapper",style:{padding:"8px 0",marginBottom:"8px"}},i("input",{key:"b14ff87ad64e594c3120be3b5e5d102c8d74cd98",type:"text",class:"s-filters-widget-search-input",placeholder:salla.lang.get("blocks.header.search_placeholder")||"بحث...",value:this.searchQuery,onInput:s=>this.searchQuery=s.target.value})),i("div",{key:"9a9f76a9ca1a9ae7e474dcf771e0a58936dee7d7",class:"s-filters-widget-values",ref:s=>this.widgetValues=s},i("slot",{key:"020b614afb9c6ca5aadfccafe748e73e8f2fa77a"}),this.option.type!==l.RANGE?this.renderFilterOption(this.option):i("salla-price-range",{onChanged:s=>{this.changed.emit(s.detail)},ref:s=>this.priceRange=s,filtersData:this.filtersData,option:this.option})),this.withLoadMore&&(!this.searchQuery||this.filteredCount>this.initialItemCount)&&i("a",{key:"4d03eccbc3b357444e27d61c647b09d435ceb1be",class:"s-filters-widget-more",onClick:()=>this.showMore()},this.isShowMore?this.showLessLabel:this.showMoreLabel)))}get host(){return h(this)}};r.style=":host{display:block}";export{r as salla_filters_widget}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t}from"./p-B-fHbvwg.js";const r=class{constructor(t){s(this,t),this.height="10px";try{if(this.donation){let s="string"==typeof this.donation?JSON.parse(this.donation):this.donation;s.can_donate&&s.target_amount?(s.target_end_date="0000-00-00"==s.target_end_date?null:s.target_end_date,this.value=s.collected_amount,this.target=s.target_amount,this.header=salla.lang.get("pages.products.target"),this.message=s.target_end_date?salla.lang.get("pages.products.donation_target_date")+" "+s.target_end_date:""):this.message=s.target_amount?s.target_message:""}}catch(s){salla.log("Wrong donation json")}salla.lang.onLoaded((()=>{this.header=this.header?.replace("pages.products.target",salla.lang.get("pages.products.target")),this.message=this.message?.replace("pages.products.donation_target_date",salla.lang.get("pages.products.donation_target_date"))})),salla.onReady((()=>{this.color=this.color||salla.config.get("theme.color.primary","#ffd5c4"),this.unit||(this.unit=salla.config.currency().symbol)}))}getPercentage(){return this.value/this.target*100}render(){return this.target||this.message?t("div",{class:"s-progress-bar-container"},this.header?t("div",{class:"s-progress-bar-header"},this.header):"",this.getProgressBar(),this.message?t("span",{class:"s-progress-bar-message"},this.message):""):""}getProgressBar(){return this.target?[this.hideUnits?null:t("div",{class:"s-progress-bar-target-section"},t("span",{innerHTML:`${salla.helpers.number(this.value)} ${this.unit}`}),t("span",{innerHTML:`${salla.helpers.number(this.target)} ${this.unit}`})),t("div",{class:"s-progress-bar-wrapper",style:{height:this.height}},t("div",{class:{"s-progress-bar-progress":!0,"s-progress-bar-progress-stripped":this.stripped},style:{width:`${this.getPercentage()}%`,backgroundColor:this.color}}))]:null}};r.style="";export{r as salla_progress_bar}
4
+ import{r as s,h as t}from"./p-CSCx8X8V.js";const r=class{constructor(t){s(this,t),this.height="10px";try{if(this.donation){let s="string"==typeof this.donation?JSON.parse(this.donation):this.donation;s.can_donate&&s.target_amount?(s.target_end_date="0000-00-00"==s.target_end_date?null:s.target_end_date,this.value=s.collected_amount,this.target=s.target_amount,this.header=salla.lang.get("pages.products.target"),this.message=s.target_end_date?salla.lang.get("pages.products.donation_target_date")+" "+s.target_end_date:""):this.message=s.target_amount?s.target_message:""}}catch(s){salla.log("Wrong donation json")}salla.lang.onLoaded((()=>{this.header=this.header?.replace("pages.products.target",salla.lang.get("pages.products.target")),this.message=this.message?.replace("pages.products.donation_target_date",salla.lang.get("pages.products.donation_target_date"))})),salla.onReady((()=>{this.color=this.color||salla.config.get("theme.color.primary","#ffd5c4"),this.unit||(this.unit=salla.config.currency().symbol)}))}getPercentage(){return this.value/this.target*100}render(){return this.target||this.message?t("div",{class:"s-progress-bar-container"},this.header?t("div",{class:"s-progress-bar-header"},this.header):"",this.getProgressBar(),this.message?t("span",{class:"s-progress-bar-message"},this.message):""):""}getProgressBar(){return this.target?[this.hideUnits?null:t("div",{class:"s-progress-bar-target-section"},t("span",{innerHTML:`${salla.helpers.number(this.value)} ${this.unit}`}),t("span",{innerHTML:`${salla.helpers.number(this.target)} ${this.unit}`})),t("div",{class:"s-progress-bar-wrapper",style:{height:this.height}},t("div",{class:{"s-progress-bar-progress":!0,"s-progress-bar-progress-stripped":this.stripped},style:{width:`${this.getPercentage()}%`,backgroundColor:this.color}}))]:null}};r.style="";export{r as salla_progress_bar}