@salla.sa/twilight-components 2.14.588 → 2.14.589

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 (332) hide show
  1. package/dist/cjs/{filepond-FHDuUT2A.js → filepond-BbRL5Spe.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-cswOK9iC.js → filepond-plugin-file-poster-DVUBjaQx.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-BKHetR6q.js → filepond-plugin-file-validate-size-BR7SoIq0.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-TR28icaL.js → filepond-plugin-file-validate-type-CEkMfiUA.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-D-Wzkzl3.js → filepond-plugin-image-edit-p-XQj23Q.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-BF-uGQ3T.js → filepond-plugin-image-exif-orientation-DeRO_gvX.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-BMRguebr.js → filepond-plugin-image-preview-Bfm8Swyp.js} +1 -1
  8. package/dist/cjs/{index-C3RW52t1.js → index-CfGnMoB7.js} +2 -2
  9. package/dist/cjs/{intlTelInput-BwwLaGw1.js → intlTelInput-Pqo18emd.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  12. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-applied-filters.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +10 -10
  20. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-form_9.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-gift-card-redeem.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-products-list.cjs.entry.js +21 -5
  84. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  105. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  106. package/dist/cjs/salla-wishlist-summary.cjs.entry.js +1 -1
  107. package/dist/cjs/twilight.cjs.js +1 -1
  108. package/dist/cjs/{vanilla-picker-BCVMDRc5.js → vanilla-picker-DWuMUfiW.js} +1 -1
  109. package/dist/collection/components/salla-products-list/salla-products-list.css +3 -0
  110. package/dist/collection/components/salla-products-list/salla-products-list.js +19 -3
  111. package/dist/components/index.js +2 -2
  112. package/dist/components/salla-products-list2.js +20 -4
  113. package/dist/docs.json +1 -1
  114. package/dist/esm/{filepond-D9x8e0kN.js → filepond-CJqzOtq7.js} +1 -1
  115. package/dist/esm/{filepond-plugin-file-poster-Dnc-RXWn.js → filepond-plugin-file-poster-CPydcEjJ.js} +1 -1
  116. package/dist/esm/{filepond-plugin-file-validate-size-CZkCBl_R.js → filepond-plugin-file-validate-size-Yy4pNy1Q.js} +1 -1
  117. package/dist/esm/{filepond-plugin-file-validate-type-C5Nsnz-Z.js → filepond-plugin-file-validate-type-Ck1P2E4e.js} +1 -1
  118. package/dist/esm/{filepond-plugin-image-edit-hv6HNezY.js → filepond-plugin-image-edit-DEUmnuGf.js} +1 -1
  119. package/dist/esm/{filepond-plugin-image-exif-orientation-xKI5gBkW.js → filepond-plugin-image-exif-orientation-BPgJye8E.js} +1 -1
  120. package/dist/esm/{filepond-plugin-image-preview-C1Lw27uf.js → filepond-plugin-image-preview-CqUSx6BO.js} +1 -1
  121. package/dist/esm/{index-BTR557QH.js → index-BnDYuqv2.js} +2 -2
  122. package/dist/esm/{intlTelInput-HpgbsbG0.js → intlTelInput-Z8OsAFtr.js} +1 -1
  123. package/dist/esm/loader.js +2 -2
  124. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  125. package/dist/esm/salla-accordion_6.entry.js +1 -1
  126. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  127. package/dist/esm/salla-advertisement.entry.js +1 -1
  128. package/dist/esm/salla-alert_2.entry.js +1 -1
  129. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  130. package/dist/esm/salla-applied-filters.entry.js +1 -1
  131. package/dist/esm/salla-apps-icons.entry.js +1 -1
  132. package/dist/esm/salla-attachment-view_9.entry.js +10 -10
  133. package/dist/esm/salla-badge.entry.js +1 -1
  134. package/dist/esm/salla-basket-gap.entry.js +1 -1
  135. package/dist/esm/salla-bullet-delivery_3.entry.js +1 -1
  136. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  137. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  138. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  139. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  140. package/dist/esm/salla-comment-factors.entry.js +1 -1
  141. package/dist/esm/salla-comment-form_9.entry.js +1 -1
  142. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  143. package/dist/esm/salla-contacts.entry.js +1 -1
  144. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  145. package/dist/esm/salla-count-down.entry.js +1 -1
  146. package/dist/esm/salla-custom-fields.entry.js +1 -1
  147. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  148. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  149. package/dist/esm/salla-filters-widget.entry.js +1 -1
  150. package/dist/esm/salla-filters.entry.js +1 -1
  151. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  152. package/dist/esm/salla-gift-card-redeem.entry.js +1 -1
  153. package/dist/esm/salla-gifting.entry.js +1 -1
  154. package/dist/esm/salla-hook.entry.js +1 -1
  155. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  156. package/dist/esm/salla-installment.entry.js +1 -1
  157. package/dist/esm/salla-list-tile.entry.js +1 -1
  158. package/dist/esm/salla-localization-modal.entry.js +1 -1
  159. package/dist/esm/salla-login-modal.entry.js +1 -1
  160. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  161. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  162. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  163. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  164. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  165. package/dist/esm/salla-loyalty.entry.js +1 -1
  166. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  167. package/dist/esm/salla-map_3.entry.js +1 -1
  168. package/dist/esm/salla-menu.entry.js +1 -1
  169. package/dist/esm/salla-metadata.entry.js +1 -1
  170. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  171. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  172. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  173. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  174. package/dist/esm/salla-notification-item_2.entry.js +1 -1
  175. package/dist/esm/salla-offer-modal.entry.js +1 -1
  176. package/dist/esm/salla-offer.entry.js +1 -1
  177. package/dist/esm/salla-order-branch.entry.js +1 -1
  178. package/dist/esm/salla-order-cancel.entry.js +1 -1
  179. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  180. package/dist/esm/salla-order-details-options.entry.js +1 -1
  181. package/dist/esm/salla-order-details.entry.js +1 -1
  182. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  183. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  184. package/dist/esm/salla-order-edit.entry.js +1 -1
  185. package/dist/esm/salla-order-options-modal.entry.js +1 -1
  186. package/dist/esm/salla-order-shipments.entry.js +1 -1
  187. package/dist/esm/salla-order-summary.entry.js +1 -1
  188. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  189. package/dist/esm/salla-orders.entry.js +1 -1
  190. package/dist/esm/salla-payments.entry.js +1 -1
  191. package/dist/esm/salla-placeholder.entry.js +1 -1
  192. package/dist/esm/salla-price-range.entry.js +1 -1
  193. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  194. package/dist/esm/salla-product-card.entry.js +1 -1
  195. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  196. package/dist/esm/salla-products-list.entry.js +21 -5
  197. package/dist/esm/salla-products-slider.entry.js +1 -1
  198. package/dist/esm/salla-quick-order.entry.js +1 -1
  199. package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
  200. package/dist/esm/salla-rating-modal.entry.js +1 -1
  201. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  202. package/dist/esm/salla-review-order-item.entry.js +1 -1
  203. package/dist/esm/salla-scopes.entry.js +1 -1
  204. package/dist/esm/salla-search-product-card.entry.js +1 -1
  205. package/dist/esm/salla-search.entry.js +1 -1
  206. package/dist/esm/salla-skeleton.entry.js +1 -1
  207. package/dist/esm/salla-social-share.entry.js +1 -1
  208. package/dist/esm/salla-social.entry.js +1 -1
  209. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  210. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  211. package/dist/esm/salla-tooltip.entry.js +1 -1
  212. package/dist/esm/salla-trust-badges.entry.js +1 -1
  213. package/dist/esm/salla-user-menu.entry.js +1 -1
  214. package/dist/esm/salla-user-profile.entry.js +1 -1
  215. package/dist/esm/salla-user-settings.entry.js +1 -1
  216. package/dist/esm/salla-verify.entry.js +1 -1
  217. package/dist/esm/salla-wallet.entry.js +1 -1
  218. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  219. package/dist/esm/salla-wishlist-summary.entry.js +1 -1
  220. package/dist/esm/twilight.js +2 -2
  221. package/dist/esm/{vanilla-picker-Cwahuohu.js → vanilla-picker-DnAUrfGC.js} +1 -1
  222. package/dist/twilight/{p-6371ecfb.entry.js → p-00bc0e76.entry.js} +1 -1
  223. package/dist/twilight/{p-791a4de0.entry.js → p-018629e9.entry.js} +1 -1
  224. package/dist/twilight/{p-d09e982e.entry.js → p-085aac95.entry.js} +1 -1
  225. package/dist/twilight/{p-2ffe4f20.entry.js → p-08a8a1ff.entry.js} +1 -1
  226. package/dist/twilight/{p-e8c637d0.entry.js → p-0b53b377.entry.js} +1 -1
  227. package/dist/twilight/{p-1e930884.entry.js → p-0e1f8e61.entry.js} +1 -1
  228. package/dist/twilight/{p-63997e17.entry.js → p-0ecf936e.entry.js} +1 -1
  229. package/dist/twilight/{p-4d4f5878.entry.js → p-0efb20f7.entry.js} +1 -1
  230. package/dist/twilight/{p-79f75f23.entry.js → p-0f5846fe.entry.js} +1 -1
  231. package/dist/twilight/{p-6c6cfa25.entry.js → p-11a1c557.entry.js} +1 -1
  232. package/dist/twilight/{p-8de1f867.entry.js → p-11b351be.entry.js} +1 -1
  233. package/dist/twilight/{p-4de41a53.entry.js → p-152cac66.entry.js} +1 -1
  234. package/dist/twilight/{p-fb4906f6.entry.js → p-171e4a2f.entry.js} +1 -1
  235. package/dist/twilight/{p-d5d2b0fb.entry.js → p-179c76df.entry.js} +1 -1
  236. package/dist/twilight/{p-c50f18ff.entry.js → p-1a598e9b.entry.js} +1 -1
  237. package/dist/twilight/{p-41d66dbc.entry.js → p-1bafeac8.entry.js} +1 -1
  238. package/dist/twilight/{p-29992256.entry.js → p-1c812d90.entry.js} +1 -1
  239. package/dist/twilight/{p-4ee88ae3.entry.js → p-1d1315d7.entry.js} +1 -1
  240. package/dist/twilight/{p-a462cf60.entry.js → p-2cdcd70d.entry.js} +1 -1
  241. package/dist/twilight/{p-a73f0f08.entry.js → p-3319b19b.entry.js} +1 -1
  242. package/dist/twilight/{p-5dfb4250.entry.js → p-331fe074.entry.js} +1 -1
  243. package/dist/twilight/{p-b7a84f6a.entry.js → p-343a9ec3.entry.js} +1 -1
  244. package/dist/twilight/{p-53b89833.entry.js → p-35dabed0.entry.js} +1 -1
  245. package/dist/twilight/{p-db30160d.entry.js → p-3771c21e.entry.js} +1 -1
  246. package/dist/twilight/{p-0f559883.entry.js → p-3b14f3d4.entry.js} +1 -1
  247. package/dist/twilight/{p-3f6c6e95.entry.js → p-3d08b459.entry.js} +1 -1
  248. package/dist/twilight/{p-DXNyBG0s.js → p-3jS5Dm-u.js} +1 -1
  249. package/dist/twilight/{p-54bdf670.entry.js → p-4262b4d7.entry.js} +1 -1
  250. package/dist/twilight/{p-5572c1bb.entry.js → p-444e6c0b.entry.js} +1 -1
  251. package/dist/twilight/{p-639ef336.entry.js → p-45b9c237.entry.js} +1 -1
  252. package/dist/twilight/{p-913e3175.entry.js → p-47d94d77.entry.js} +1 -1
  253. package/dist/twilight/{p-0447c80d.entry.js → p-483551e7.entry.js} +1 -1
  254. package/dist/twilight/{p-88aae8b5.entry.js → p-4d0df0fe.entry.js} +1 -1
  255. package/dist/twilight/{p-f3abd84c.entry.js → p-4e50bc09.entry.js} +1 -1
  256. package/dist/twilight/{p-89365ad7.entry.js → p-53dc0615.entry.js} +1 -1
  257. package/dist/twilight/{p-eee4a3dd.entry.js → p-5537738b.entry.js} +1 -1
  258. package/dist/twilight/{p-dd9260b4.entry.js → p-56f0cfcb.entry.js} +1 -1
  259. package/dist/twilight/{p-fdb6d4c3.entry.js → p-612fb2e8.entry.js} +1 -1
  260. package/dist/twilight/p-648a4d8d.entry.js +4 -0
  261. package/dist/twilight/{p-48a3c4d0.entry.js → p-652ab33d.entry.js} +1 -1
  262. package/dist/twilight/{p-fa984e9c.entry.js → p-661755d7.entry.js} +1 -1
  263. package/dist/twilight/{p-a0d251ec.entry.js → p-66ae8f3b.entry.js} +1 -1
  264. package/dist/twilight/{p-ed7ffc7e.entry.js → p-67e24689.entry.js} +1 -1
  265. package/dist/twilight/{p-b8ba7d7a.entry.js → p-6ca5c1b6.entry.js} +1 -1
  266. package/dist/twilight/{p-65dac0dc.entry.js → p-6f26c1cd.entry.js} +1 -1
  267. package/dist/twilight/{p-28a76fa1.entry.js → p-700f2c8b.entry.js} +1 -1
  268. package/dist/twilight/{p-9df8e4bd.entry.js → p-71c70e04.entry.js} +1 -1
  269. package/dist/twilight/{p-eeece90d.entry.js → p-721b6019.entry.js} +1 -1
  270. package/dist/twilight/{p-1b19b60d.entry.js → p-760d1b6c.entry.js} +1 -1
  271. package/dist/twilight/{p-46a2bf53.entry.js → p-7c9e88d3.entry.js} +1 -1
  272. package/dist/twilight/{p-75316703.entry.js → p-7ccdd251.entry.js} +1 -1
  273. package/dist/twilight/{p-9bb8bd6c.entry.js → p-7eeb788a.entry.js} +1 -1
  274. package/dist/twilight/{p-730f67ce.entry.js → p-80228706.entry.js} +1 -1
  275. package/dist/twilight/{p-fc146f87.entry.js → p-80ead7f0.entry.js} +1 -1
  276. package/dist/twilight/{p-6972a912.entry.js → p-81cdd5c5.entry.js} +1 -1
  277. package/dist/twilight/{p-d3a0ba94.entry.js → p-827fa966.entry.js} +1 -1
  278. package/dist/twilight/{p-d78b3444.entry.js → p-85f0dcd7.entry.js} +1 -1
  279. package/dist/twilight/{p-GQ-wuBin.js → p-8Y4Ctfsa.js} +1 -1
  280. package/dist/twilight/{p-9e49d85f.entry.js → p-8cf71ac9.entry.js} +1 -1
  281. package/dist/twilight/{p-e551f928.entry.js → p-8e679d21.entry.js} +1 -1
  282. package/dist/twilight/{p-7bce8959.entry.js → p-8ef3ef7d.entry.js} +1 -1
  283. package/dist/twilight/{p-7a5150ad.entry.js → p-9932f7a0.entry.js} +1 -1
  284. package/dist/twilight/{p-9b95f107.entry.js → p-9bc5c3d5.entry.js} +1 -1
  285. package/dist/twilight/{p-e0bdbbff.entry.js → p-9fd926a2.entry.js} +1 -1
  286. package/dist/twilight/{p-Y9R2faFd.js → p-B7eX2j-t.js} +1 -1
  287. package/dist/twilight/{p-D82O5pkw.js → p-BXv9XzTR.js} +1 -1
  288. package/dist/twilight/{p-BTR557QH.js → p-BnDYuqv2.js} +1 -1
  289. package/dist/twilight/{p-3xURxQbt.js → p-CR5J1D0q.js} +1 -1
  290. package/dist/twilight/{p-X6DlYEXx.js → p-DTfPuMCT.js} +1 -1
  291. package/dist/twilight/{p-DdVH7VEz.js → p-DV1rxosP.js} +1 -1
  292. package/dist/twilight/p-DpkirgB4.js +9 -0
  293. package/dist/twilight/{p-AWtDVHWY.js → p-G2sLbl_C.js} +1 -1
  294. package/dist/twilight/{p-d3977f2f.entry.js → p-aac26dda.entry.js} +1 -1
  295. package/dist/twilight/{p-a2df5f85.entry.js → p-ad7814d7.entry.js} +1 -1
  296. package/dist/twilight/{p-8da97f62.entry.js → p-ae8b1d8b.entry.js} +1 -1
  297. package/dist/twilight/{p-025f158d.entry.js → p-afc3d17b.entry.js} +1 -1
  298. package/dist/twilight/{p-1bd13cb1.entry.js → p-ba5f879e.entry.js} +1 -1
  299. package/dist/twilight/{p-bbb88414.entry.js → p-ba61073e.entry.js} +1 -1
  300. package/dist/twilight/{p-aca47dd5.entry.js → p-bd559920.entry.js} +1 -1
  301. package/dist/twilight/{p-3d31cbfe.entry.js → p-bdf47e97.entry.js} +1 -1
  302. package/dist/twilight/{p-b0dee69a.entry.js → p-bf7e7835.entry.js} +1 -1
  303. package/dist/twilight/{p-1d93fdb7.entry.js → p-c0304211.entry.js} +1 -1
  304. package/dist/twilight/{p-52b0e3e5.entry.js → p-c2858bed.entry.js} +1 -1
  305. package/dist/twilight/{p-9ca993de.entry.js → p-c5948d07.entry.js} +1 -1
  306. package/dist/twilight/{p-b8eead91.entry.js → p-c895701a.entry.js} +1 -1
  307. package/dist/twilight/{p-4b6dc22a.entry.js → p-cbeff415.entry.js} +1 -1
  308. package/dist/twilight/{p-2b088e94.entry.js → p-cdad2ba2.entry.js} +1 -1
  309. package/dist/twilight/{p-5b34281f.entry.js → p-cfe6fbe3.entry.js} +1 -1
  310. package/dist/twilight/{p-3f6e3bca.entry.js → p-cff5dd0b.entry.js} +1 -1
  311. package/dist/twilight/{p-ce20fc73.entry.js → p-d38ae081.entry.js} +1 -1
  312. package/dist/twilight/{p-4cdfb0ed.entry.js → p-d38e101f.entry.js} +1 -1
  313. package/dist/twilight/{p-13186e26.entry.js → p-dcaaa19e.entry.js} +1 -1
  314. package/dist/twilight/{p-1e2aa94c.entry.js → p-df3feae1.entry.js} +1 -1
  315. package/dist/twilight/{p-39c0175f.entry.js → p-df933610.entry.js} +1 -1
  316. package/dist/twilight/{p-ca14d0e0.entry.js → p-dfdd4c78.entry.js} +1 -1
  317. package/dist/twilight/{p-1d60d5cf.entry.js → p-e0b0e90f.entry.js} +1 -1
  318. package/dist/twilight/{p-34ea8023.entry.js → p-e1a8f943.entry.js} +1 -1
  319. package/dist/twilight/{p-58bfa710.entry.js → p-e49ce881.entry.js} +1 -1
  320. package/dist/twilight/{p-43a135f9.entry.js → p-ea8379b8.entry.js} +1 -1
  321. package/dist/twilight/{p-ac968f38.entry.js → p-eb0c5e39.entry.js} +1 -1
  322. package/dist/twilight/{p-5e48d054.entry.js → p-ed7c4f53.entry.js} +1 -1
  323. package/dist/twilight/{p-34cae9d4.entry.js → p-ef5a0e71.entry.js} +1 -1
  324. package/dist/twilight/{p-5d8f8d31.entry.js → p-f5ccd5d1.entry.js} +1 -1
  325. package/dist/twilight/{p-2158f53a.entry.js → p-f70bf6b0.entry.js} +1 -1
  326. package/dist/twilight/{p-f2099ffc.entry.js → p-fdb16a84.entry.js} +1 -1
  327. package/dist/twilight/{p-7117a3df.entry.js → p-ff5362e3.entry.js} +1 -1
  328. package/dist/twilight/twilight.esm.js +1 -1
  329. package/dist/types/components/salla-products-list/salla-products-list.d.ts +1 -0
  330. package/package.json +5 -5
  331. package/dist/twilight/p-891fd288.entry.js +0 -4
  332. package/dist/twilight/p-Zr_Na9jM.js +0 -9
@@ -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 i}from"./p-BTR557QH.js";const n=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 i=this.host.querySelector(`#accordion-${e.id}`);salla.cart.deleteItem(`${this.itemNumber}?product_id=${e.id}&section_id=${t}`).then((()=>i?.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:"f4a66dc2916ad42108b551790e1a1a581a55d6b1",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"fa96a2da58ee5be80c79c1a6fff66fbcf49cd87e",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>t.products.map((l=>{const i={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(i)}),e("div",{class:"s-multiple-bundle-product-cart-body-remove-button"},this.renderRemoveButton(String(t.id),l,!0))))}))))))}get host(){return l(this)}};n.style="";const c=class{constructor(e){t(this,e),this.sections=[],this.selectedProducts={},this.productSelectedHandler=null,this.onSelectProduct=(t,e)=>{const s=e.id,l=this.selectedProducts[t]?.has(s)??!1,i=this.sections.find((e=>e.id==t));if(!(l&&i&&this.isProductSelectionLocked(i))){if(!l){if(!i)return;if(1!==this.getEffectiveMax(i)&&this.isAtSelectionLimit(i))return}this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])},l?(this.selectedProducts[t].delete(s),this.clearProductFormData(s,t),this.clearProductModalOptions(s,t)):1===this.getEffectiveMax(i)?this.syncSectionSelection(t,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,wasSelected:l,isSelected:!l})}},this.ensureProductSelected=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const s=e.id;if(this.selectedProducts[t].has(s))return;const l=this.sections.find((e=>e.id==t));if(!l)return;const i=this.getEffectiveMax(l);if(1===i)this.syncSectionSelection(t,s);else{if(i>1&&this.isAtSelectionLimit(l))return;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.find((t=>t.id==e));if(!s||!this.canSelectProductInSection(s,t.id))return;const l=this.sections.findIndex((t=>t.id==e)),i=s.products?.findIndex((e=>e.id==t.id))??0,n=this.selectedProducts[e]?.has(t.id)??!1;salla.event.dispatch("multiple-bundle-product-modal::open",{product:t,sectionId:e,sectionIndex:l,productIndex:i,isProductAlreadySelected:n})},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)}}isSingleProductSection(t){return 1===(t.products?.length??0)}getObligatoryMin(t){const e=t.obligatory_products;if(null==e)return 0;const s=Number(e);return Number.isNaN(s)?0:s}isProductSelectionLocked(t){return this.isSingleProductSection(t)&&1===this.getObligatoryMin(t)}getEffectiveMax(t){const e=t.products?.length??0,s=t.max_obligatory_products;return null!=s&&s>0?Math.min(s,e):e}getSelectedCount(t){return this.selectedProducts[t]?.size??0}isAtSelectionLimit(t){return this.getSelectedCount(t.id)>=this.getEffectiveMax(t)}canSelectProductInSection(t,e){return!!this.selectedProducts[t.id]?.has(e)||1===this.getEffectiveMax(t)||!this.isAtSelectionLimit(t)}async canSelectBundleProduct(t,e){const s=this.sections.find((e=>e.id==t));return!!s&&this.canSelectProductInSection(s,e)}queryProductCheckbox(t,e){const s=`input.s-multiple-bundle-product-checkbox[name="bundle[${t}][${e}][id]"]`,l=this.host.closest("form"),i=l?.querySelector(s);if(i)return i;for(const t of this.host.querySelectorAll("salla-multiple-bundle-product-slider")){const e=(t.shadowRoot??t).querySelector(s);if(e)return e}return null}dispatchBubblingChange(t){requestAnimationFrame((()=>{t.dispatchEvent(new window.Event("change",{bubbles:!0}))}))}clearSectionProductSlot(t,e,s){const l=this.queryProductCheckbox(t,s);l&&(l.checked=!1);const i=this.host.closest("form");if(i){const e=`bundle[${t}][${s}]`;Array.from(i.querySelectorAll("input")).forEach((t=>{t.name?.startsWith(e)&&("checkbox"===t.type&&t.name?.endsWith("][id]")?t.checked=!1:t.remove())}))}this.clearProductModalOptions(e,t)}syncSectionSelection(t,e){const s=this.sections.find((e=>e.id==t));s?.products?.forEach(((s,l)=>{s.id!=e&&this.clearSectionProductSlot(t,s.id,l)})),this.selectedProducts[t]=new Set([e]);const l=s?.products?.findIndex((t=>t.id==e))??-1,i=l>=0?this.queryProductCheckbox(t,l):null;i&&(i.checked=!0,this.dispatchBubblingChange(i))}autoSelectSingleProductSections(){if(!this.sections?.length)return;const t={...this.selectedProducts};let e=!1;const s=[];for(const l of this.sections){if(!this.isProductSelectionLocked(l))continue;const i=l.products?.[0];if(!i||!i.unlimited_quantity&&(i.quantity??0)<=0)continue;const n=l.id,c=new Set(t[n]||[]);c.has(i.id)||(c.add(i.id),t[n]=c,e=!0,s.push({product:i}))}e&&(this.selectedProducts=t,s.forEach((({product:t})=>{salla.event.dispatch("on-bundle-product-selected",{id:t.id,name:t.name,options:t.options})})))}clearProductFormData(t,e){if(null!=e){const s=this.sections.find((t=>t.id==e)),l=s?.products?.findIndex((e=>e.id==t))??-1;if(l>=0)return void this.clearSectionProductSlot(e,t,l)}const s=this.host.closest("form");s&&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})}getProgressStatus(t){const e=this.getSelectedCount(t.id),s=this.getEffectiveMax(t);return s>0?`${e}/${s}`:"0"}getSectionSelectionNote(t){const e=this.getObligatoryMin(t),s=Number(t.max_obligatory_products)||0,l=e>0,i=s>0;return l||i?l&&i?e===s?salla.lang.getWithDefault("pages.products.bundle_select_exact",`اختر ${e} منتجات`,{count:e}):salla.lang.getWithDefault("pages.products.bundle_select_range",`اختر من ${e} إلى ${s} منتجات`,{min:e,max:s}):l?salla.lang.getWithDefault("pages.products.bundle_select_min",`اختر على الأقل ${e} منتجات`,{min:e}):salla.lang.getWithDefault("pages.products.bundle_select_max",`اختر حتى ${s} منتجات`,{max:s}):null}handleSectionsChange(){this.autoSelectSingleProductSections()}componentWillLoad(){this.autoSelectSingleProductSections()}renderAccordionHeader(t){const s=this.getSectionSelectionNote(t);return e(i,null,e("h2",{slot:"title"},t?.name),s?e("span",{slot:"note"},s):null,e("span",{slot:"progress"},this.getProgressStatus(t)))}componentDidLoad(){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&(this.productSelectedHandler=t=>{const{productId:e,sectionId:s,product:l,fromModal:i}=t.detail;i?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:"379725e546f6eeb670a23166de2a2d829e48da96",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"5939dfacd285738495dda3481d4974775152dc76",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)),e("salla-accordion-body",null,e("salla-multiple-bundle-product-slider",{section:t,sectionIndex:s,selectedProducts:this.selectedProducts,selectionLimit:this.getEffectiveMax(t),isSelectionLocked:this.isProductSelectionLocked(t),onProductSelected:this.handleBundleSliderProductSelected,onProductOptionsSelected:this.handleBundleSliderProductOptionsSelected})))))),e("salla-multiple-bundle-product-options-modal",{key:"2270a07c784a748e7ffaf48164e5cc8b09116878"}))}get host(){return l(this)}static get watchers(){return{sections:["handleSectionsChange"]}}};c.style="";export{n as salla_multiple_bundle_product_cart,c as salla_multiple_bundle_product_details}
4
+ import{r as t,h as e,H as s,a as l,F as i}from"./p-BnDYuqv2.js";const n=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 i=this.host.querySelector(`#accordion-${e.id}`);salla.cart.deleteItem(`${this.itemNumber}?product_id=${e.id}&section_id=${t}`).then((()=>i?.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:"f4a66dc2916ad42108b551790e1a1a581a55d6b1",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"fa96a2da58ee5be80c79c1a6fff66fbcf49cd87e",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>t.products.map((l=>{const i={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(i)}),e("div",{class:"s-multiple-bundle-product-cart-body-remove-button"},this.renderRemoveButton(String(t.id),l,!0))))}))))))}get host(){return l(this)}};n.style="";const c=class{constructor(e){t(this,e),this.sections=[],this.selectedProducts={},this.productSelectedHandler=null,this.onSelectProduct=(t,e)=>{const s=e.id,l=this.selectedProducts[t]?.has(s)??!1,i=this.sections.find((e=>e.id==t));if(!(l&&i&&this.isProductSelectionLocked(i))){if(!l){if(!i)return;if(1!==this.getEffectiveMax(i)&&this.isAtSelectionLimit(i))return}this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])},l?(this.selectedProducts[t].delete(s),this.clearProductFormData(s,t),this.clearProductModalOptions(s,t)):1===this.getEffectiveMax(i)?this.syncSectionSelection(t,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,wasSelected:l,isSelected:!l})}},this.ensureProductSelected=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const s=e.id;if(this.selectedProducts[t].has(s))return;const l=this.sections.find((e=>e.id==t));if(!l)return;const i=this.getEffectiveMax(l);if(1===i)this.syncSectionSelection(t,s);else{if(i>1&&this.isAtSelectionLimit(l))return;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.find((t=>t.id==e));if(!s||!this.canSelectProductInSection(s,t.id))return;const l=this.sections.findIndex((t=>t.id==e)),i=s.products?.findIndex((e=>e.id==t.id))??0,n=this.selectedProducts[e]?.has(t.id)??!1;salla.event.dispatch("multiple-bundle-product-modal::open",{product:t,sectionId:e,sectionIndex:l,productIndex:i,isProductAlreadySelected:n})},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)}}isSingleProductSection(t){return 1===(t.products?.length??0)}getObligatoryMin(t){const e=t.obligatory_products;if(null==e)return 0;const s=Number(e);return Number.isNaN(s)?0:s}isProductSelectionLocked(t){return this.isSingleProductSection(t)&&1===this.getObligatoryMin(t)}getEffectiveMax(t){const e=t.products?.length??0,s=t.max_obligatory_products;return null!=s&&s>0?Math.min(s,e):e}getSelectedCount(t){return this.selectedProducts[t]?.size??0}isAtSelectionLimit(t){return this.getSelectedCount(t.id)>=this.getEffectiveMax(t)}canSelectProductInSection(t,e){return!!this.selectedProducts[t.id]?.has(e)||1===this.getEffectiveMax(t)||!this.isAtSelectionLimit(t)}async canSelectBundleProduct(t,e){const s=this.sections.find((e=>e.id==t));return!!s&&this.canSelectProductInSection(s,e)}queryProductCheckbox(t,e){const s=`input.s-multiple-bundle-product-checkbox[name="bundle[${t}][${e}][id]"]`,l=this.host.closest("form"),i=l?.querySelector(s);if(i)return i;for(const t of this.host.querySelectorAll("salla-multiple-bundle-product-slider")){const e=(t.shadowRoot??t).querySelector(s);if(e)return e}return null}dispatchBubblingChange(t){requestAnimationFrame((()=>{t.dispatchEvent(new window.Event("change",{bubbles:!0}))}))}clearSectionProductSlot(t,e,s){const l=this.queryProductCheckbox(t,s);l&&(l.checked=!1);const i=this.host.closest("form");if(i){const e=`bundle[${t}][${s}]`;Array.from(i.querySelectorAll("input")).forEach((t=>{t.name?.startsWith(e)&&("checkbox"===t.type&&t.name?.endsWith("][id]")?t.checked=!1:t.remove())}))}this.clearProductModalOptions(e,t)}syncSectionSelection(t,e){const s=this.sections.find((e=>e.id==t));s?.products?.forEach(((s,l)=>{s.id!=e&&this.clearSectionProductSlot(t,s.id,l)})),this.selectedProducts[t]=new Set([e]);const l=s?.products?.findIndex((t=>t.id==e))??-1,i=l>=0?this.queryProductCheckbox(t,l):null;i&&(i.checked=!0,this.dispatchBubblingChange(i))}autoSelectSingleProductSections(){if(!this.sections?.length)return;const t={...this.selectedProducts};let e=!1;const s=[];for(const l of this.sections){if(!this.isProductSelectionLocked(l))continue;const i=l.products?.[0];if(!i||!i.unlimited_quantity&&(i.quantity??0)<=0)continue;const n=l.id,c=new Set(t[n]||[]);c.has(i.id)||(c.add(i.id),t[n]=c,e=!0,s.push({product:i}))}e&&(this.selectedProducts=t,s.forEach((({product:t})=>{salla.event.dispatch("on-bundle-product-selected",{id:t.id,name:t.name,options:t.options})})))}clearProductFormData(t,e){if(null!=e){const s=this.sections.find((t=>t.id==e)),l=s?.products?.findIndex((e=>e.id==t))??-1;if(l>=0)return void this.clearSectionProductSlot(e,t,l)}const s=this.host.closest("form");s&&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})}getProgressStatus(t){const e=this.getSelectedCount(t.id),s=this.getEffectiveMax(t);return s>0?`${e}/${s}`:"0"}getSectionSelectionNote(t){const e=this.getObligatoryMin(t),s=Number(t.max_obligatory_products)||0,l=e>0,i=s>0;return l||i?l&&i?e===s?salla.lang.getWithDefault("pages.products.bundle_select_exact",`اختر ${e} منتجات`,{count:e}):salla.lang.getWithDefault("pages.products.bundle_select_range",`اختر من ${e} إلى ${s} منتجات`,{min:e,max:s}):l?salla.lang.getWithDefault("pages.products.bundle_select_min",`اختر على الأقل ${e} منتجات`,{min:e}):salla.lang.getWithDefault("pages.products.bundle_select_max",`اختر حتى ${s} منتجات`,{max:s}):null}handleSectionsChange(){this.autoSelectSingleProductSections()}componentWillLoad(){this.autoSelectSingleProductSections()}renderAccordionHeader(t){const s=this.getSectionSelectionNote(t);return e(i,null,e("h2",{slot:"title"},t?.name),s?e("span",{slot:"note"},s):null,e("span",{slot:"progress"},this.getProgressStatus(t)))}componentDidLoad(){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&(this.productSelectedHandler=t=>{const{productId:e,sectionId:s,product:l,fromModal:i}=t.detail;i?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:"379725e546f6eeb670a23166de2a2d829e48da96",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"5939dfacd285738495dda3481d4974775152dc76",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)),e("salla-accordion-body",null,e("salla-multiple-bundle-product-slider",{section:t,sectionIndex:s,selectedProducts:this.selectedProducts,selectionLimit:this.getEffectiveMax(t),isSelectionLocked:this.isProductSelectionLocked(t),onProductSelected:this.handleBundleSliderProductSelected,onProductOptionsSelected:this.handleBundleSliderProductOptionsSelected})))))),e("salla-multiple-bundle-product-options-modal",{key:"2270a07c784a748e7ffaf48164e5cc8b09116878"}))}get host(){return l(this)}static get watchers(){return{sections:["handleSectionsChange"]}}};c.style="";export{n as salla_multiple_bundle_product_cart,c as salla_multiple_bundle_product_details}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as e,H as r,a as i}from"./p-BTR557QH.js";import{A as s}from"./p-DCZbpt2a.js";import{B as a}from"./p-D3mWkc-3.js";import{C as o}from"./p-gFG8By9O.js";import{H as n}from"./p-00vBRoH3.js";import{C as l}from"./p-BsLF_HK7.js";import{S as d}from"./p-D4oPi1Ov.js";import{l as c}from"./p-BChI23pG.js";var m='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>user-circle</title>\n<path d="M16 22.964c-4.525 0-8.447 1.713-9.993 4.365-0.371 0.636-0.156 1.452 0.48 1.823s1.453 0.156 1.823-0.48c0.855-1.465 3.624-3.041 7.689-3.041s6.835 1.576 7.689 3.041c0.249 0.424 0.696 0.661 1.155 0.661 0.228 0 0.459-0.059 0.669-0.181 0.637-0.371 0.852-1.187 0.48-1.823-1.545-2.652-5.467-4.365-9.992-4.365zM22.667 13.631c0-3.676-2.991-6.667-6.667-6.667s-6.667 2.991-6.667 6.667 2.991 6.667 6.667 6.667 6.667-2.992 6.667-6.667zM12 13.631c0-2.205 1.795-4 4-4s4 1.795 4 4-1.795 4-4 4-4-1.795-4-4zM16 0.297c-8.823 0-16 7.177-16 16 0 2.941 0.821 5.831 2.373 8.357 0.252 0.411 0.689 0.636 1.137 0.636 0.239 0 0.479-0.064 0.696-0.197 0.628-0.385 0.824-1.207 0.439-1.833-1.295-2.108-1.979-4.516-1.979-6.963 0-7.352 5.981-13.333 13.333-13.333s13.333 5.981 13.333 13.333c0 2.448-0.684 4.856-1.979 6.961-0.385 0.628-0.189 1.448 0.437 1.835 0.627 0.384 1.448 0.189 1.835-0.437 1.553-2.527 2.373-5.416 2.373-8.359 0-8.823-7.177-16-16-16z"></path>\n</svg>\n';const h=class{constructor(e){t(this,e),this.accountLoading=!1,this.opened=!1,this.notifications=salla.lang.get("common.titles.notifications"),this.orders=salla.lang.get("common.titles.orders"),this.pending_orders=salla.lang.get("common.titles.pending_orders"),this.wishlist=salla.lang.get("common.titles.wishlist"),this.profile=salla.lang.get("common.titles.profile"),this.rating=salla.lang.get("common.titles.rating"),this.wallet=salla.lang.get("common.titles.wallet"),this.settings=salla.lang.get("common.titles.settings"),this.loyalty_points=salla.lang.get("pages.loyalty_program.loyalty_points"),this.logout=salla.lang.get("blocks.header.logout"),this.hello=salla.lang.get("pages.checkout.hello"),this.first_name=salla.storage.get("user.first_name")||"",this.last_name=salla.storage.get("user.last_name")||"",this.avatar=salla.storage.get("user.avatar")||salla.url.cdn("images/avatar.png",40,40),this.badges={notifications:salla.helpers.number(salla.storage.get("user.notifications")||0),pending_orders:salla.helpers.number(salla.storage.get("user.pending_orders")||0)},this.sallaAccountEnabled=!1,this.walletBalance="",this.walletBalanceLoading=!1,this.walletBalanceLoaded=!1,this.hasBadges=Number(salla.storage.get("user.pending_orders"))>0||Number(salla.storage.get("user.notifications"))>0,this.inline=!1,this.avatarOnly=!1,this.showHeader=!1,this.relativeDropdown=!1,this.showTrigger=!1,this.onClickOutside=()=>{this.opened=!1},this.OrderUpdate=0,this.accountPrefixedKeys=["orders","pending_orders","wallet","notifications","rating","profile","wishlist","settings"],this.items={notifications:a,orders:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>box-bankers</title>\n<path d="M28 1.333h-24c-2.205 0-4 1.795-4 4v5.333c0 0.736 0.597 1.333 1.333 1.333v14.667c0 2.205 1.795 4 4 4h21.333c2.205 0 4-1.795 4-4v-14.667c0.736 0 1.333-0.597 1.333-1.333v-5.333c0-2.205-1.795-4-4-4zM28 26.667c0 0.735-0.599 1.333-1.333 1.333h-21.333c-0.735 0-1.333-0.599-1.333-1.333v-14.667h5.333v2.667c0 1.471 1.196 2.667 2.667 2.667h8c1.471 0 2.667-1.196 2.667-2.667v-2.667h5.333zM12 14.667v-2.667h8v2.667zM29.333 9.333h-26.667v-4c0-0.735 0.599-1.333 1.333-1.333h24c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',pending_orders:o,wishlist:n,wallet:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>wallet</title>\n<path d="M28 6.667h-24c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333h24c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-24c-2.204 0-3.999 1.793-4 3.997v18.669c0 3.676 2.991 6.667 6.667 6.667h21.333c2.205 0 4-1.795 4-4v-16c0-2.205-1.795-4-4-4zM29.333 26.667c0 0.736-0.597 1.333-1.333 1.333h-21.333c-2.205 0-4-1.795-4-4v-14.895c0.416 0.147 0.865 0.228 1.333 0.228h24c0.736 0 1.333 0.597 1.333 1.333zM22.667 14.667c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 20c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.597 1.333-1.333 1.333z"></path>\n</svg>\n',loyalty_points:c,profile:m}}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.loadTranslations(),this.initiate(),Salla.event.on("api::token.injected",(t=>this.profileUrl=this.buildProfileUrl(t))),this.sallaAccountEnabled=Salla.config.get("store.features")?.includes("salla-account"),this.items=this.sallaAccountEnabled?{...this.items,settings:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>settings</title>\n<path d="M29.717 19.037l-1.817-1.499c0.067-0.512 0.1-1.028 0.1-1.539s-0.033-1.027-0.1-1.54l1.817-1.499c1.177-0.969 1.479-2.633 0.716-3.956l-1.159-2.009c-0.761-1.324-2.349-1.895-3.784-1.359l-2.212 0.829c-0.817-0.627-1.704-1.139-2.649-1.535l-0.388-2.332c-0.251-1.507-1.54-2.6-3.067-2.6h-2.319c-1.525 0-2.815 1.093-3.065 2.6l-0.388 2.332c-0.945 0.396-1.833 0.909-2.649 1.535l-2.212-0.829c-1.428-0.533-3.021 0.036-3.783 1.359l-1.16 2.011c-0.763 1.323-0.46 2.985 0.716 3.955l1.817 1.499c-0.067 0.513-0.1 1.029-0.1 1.54s0.033 1.027 0.1 1.539l-1.819 1.5c-1.176 0.971-1.476 2.635-0.715 3.955l1.159 2.011c0.763 1.324 2.356 1.899 3.784 1.36l2.212-0.831c0.816 0.625 1.703 1.139 2.649 1.535l0.388 2.332c0.251 1.507 1.54 2.6 3.067 2.6h2.319c1.527 0 2.816-1.093 3.065-2.6l0.389-2.332c0.947-0.396 1.833-0.909 2.649-1.535l2.212 0.831c1.432 0.539 3.023-0.035 3.783-1.36l1.16-2.011c0.76-1.32 0.459-2.984-0.717-3.956zM28.123 21.663l-1.16 2.011c-0.108 0.188-0.336 0.267-0.536 0.193l-2.931-1.1c-0.459-0.173-0.979-0.079-1.349 0.248-0.923 0.811-1.979 1.423-3.139 1.819-0.464 0.157-0.804 0.559-0.885 1.043l-0.515 3.087c-0.033 0.215-0.216 0.371-0.433 0.371h-2.319c-0.217 0-0.4-0.156-0.436-0.371l-0.513-3.087c-0.080-0.484-0.42-0.884-0.885-1.043-1.16-0.396-2.216-1.008-3.139-1.819-0.248-0.217-0.561-0.332-0.88-0.332-0.157 0-0.316 0.028-0.469 0.084l-2.931 1.1c-0.199 0.079-0.428-0.004-0.537-0.193l-1.159-2.011c-0.109-0.191-0.067-0.428 0.101-0.568l2.409-1.985c0.379-0.312 0.555-0.807 0.46-1.288-0.119-0.605-0.179-1.219-0.179-1.821 0-0.604 0.060-1.217 0.181-1.823 0.095-0.481-0.081-0.976-0.46-1.288l-2.409-1.985c-0.168-0.139-0.211-0.376-0.101-0.567l1.16-2.011c0.107-0.188 0.332-0.268 0.536-0.193l2.931 1.1c0.459 0.172 0.979 0.079 1.348-0.247 0.924-0.812 1.98-1.424 3.139-1.817 0.465-0.159 0.805-0.559 0.885-1.044l0.513-3.088c0.036-0.215 0.219-0.371 0.436-0.371h2.319c0.217 0 0.4 0.156 0.436 0.371l0.515 3.088c0.081 0.484 0.42 0.885 0.885 1.044 1.157 0.393 2.213 1.005 3.139 1.817 0.371 0.325 0.889 0.42 1.349 0.247l2.929-1.099c0.203-0.076 0.428 0.005 0.537 0.193l1.159 2.009c0.109 0.191 0.067 0.428-0.101 0.567l-2.409 1.985c-0.379 0.312-0.555 0.807-0.46 1.288 0.119 0.605 0.179 1.219 0.179 1.823 0 0.603-0.060 1.216-0.181 1.821-0.095 0.48 0.081 0.975 0.46 1.288l2.408 1.984c0.169 0.141 0.212 0.379 0.103 0.569zM16.016 10.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM16.016 18.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n'}:this.items,this.host.hasAttribute("with-rating")&&(this.items.rating=d),this.items.logout='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>send-out</title>\n<path d="M16 26.667h-9.333c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.736 0.597-1.333 1.333-1.333h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-9.333c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM29.231 15.491c-0.068-0.164-0.167-0.312-0.289-0.436l-5.332-5.332c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l3.057 3.059h-12.781c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h12.781l-3.057 3.057c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l5.332-5.332c0.124-0.123 0.221-0.271 0.289-0.435 0.135-0.325 0.135-0.693 0-1.019z"></path>\n</svg>\n';let t=Salla.storage.get("token");t||(t=""),this.profileUrl=this.buildProfileUrl(t);const e=this.host.querySelector('[slot="trigger"]');this.triggerSlot='<div class="s-user-menu-trigger"><div class="s-user-menu-avatar-wrap"><img class="s-user-menu-trigger-avatar" src="{avatar}" alt="{first_name}{last_name}" /></div><div class="s-user-menu-trigger-content"><span class="s-user-menu-trigger-hello">{hello}</span><p class="s-user-menu-trigger-name">{first_name} {last_name}</p></div> <i class="s-user-menu-trigger-icon">{icon}</i></div>',e&&(this.triggerSlot=e.innerHTML,e.innerHTML=this.replaceParams(e.innerHTML))}loadTranslations(){this.notifications=Salla.lang.get("common.titles.notifications"),this.orders=Salla.lang.get("common.titles.orders"),this.pending_orders=Salla.lang.get("common.titles.pending_orders"),this.wishlist=Salla.lang.get("common.titles.wishlist"),this.profile=Salla.lang.get("common.titles.profile"),this.hello=Salla.lang.get("pages.checkout.hello"),this.rating=Salla.lang.get("common.titles.rating"),this.wallet=Salla.lang.get("common.titles.wallet"),this.settings=Salla.lang.get("common.titles.settings"),this.loyalty_points=Salla.lang.get("pages.loyalty_program.loyalty_points"),this.logout=Salla.lang.get("blocks.header.logout")}async loadWalletBalance(){if(!Salla.config.isGuest()){this.walletBalanceLoading=!0;try{const t=await salla.api.withoutNotifier((()=>salla.api.request("/balance/wallet?light=1"))),e=Number(t?.data?.balance)||0;this.walletBalance=e?Salla.money({amount:Number(e.toFixed(2)),currency:Salla.config.get("user.currency_code")}):"",this.walletBalanceLoaded=!0}catch{}finally{this.walletBalanceLoading=!1}}}initiate(){return Salla.config.isGuest()?this.autoMountLoginModal():(this.is_loggedIn=!0,!this.inline&&(salla.url.is_page("customer.notifications")||salla.url.is_page("customer.orders.index.pending")||salla.url.is_page("customer.profile")||(Date.now()-(salla.storage.get("user.fetched_at")||0))/1e3/60>30)?this.fetchFreshProfile():void salla.event.on("profile::info.fetched",(t=>{this.updateProfileState(t)})))}autoMountLoginModal(){this.showTrigger&&(document.querySelector("salla-login-modal")||Salla.hooks.mount("body:end",document.createElement("salla-login-modal")))}fetchFreshProfile(){salla.api.token?salla.profile.api.info().then((t=>{this.updateProfileState(t)})):salla.log("trying to fetchFreshProfile before injected the token!!")}updateProfileState(t){this.badges={notifications:salla.helpers.number(t.data.notifications||0),pending_orders:salla.helpers.number(t.data.pending_orders||0)},this.hasBadges=Number(t.data.pending_orders)>0||Number(t.data.notifications)>0,this.first_name=t.data.first_name,this.last_name=t.data.last_name,this.avatar=t.data.avatar||salla.url.cdn("images/avatar.png",40,40)}async open(t){this.opened=!this.opened,t.stopPropagation(),this.opened&&(!window.can_access_wallet||this.walletBalanceLoaded||this.walletBalanceLoading||this.loadWalletBalance(),window.addEventListener("click",this.onClickOutside))}menuItemClicked(t,e){"logout"===e&&(t.preventDefault(),salla.auth.logout("sall-user-menu"))}replaceParams(t){return t.replace(/\{hello\}/g,this.hello).replace(/\{first_name\}/g,this.first_name).replace(/\{last_name\}/g,this.last_name).replace(/\{avatar\}/g,this.avatar).replace(/\{icon\}/g,s)}getTheHeader(){return e("div",{class:{"s-user-menu-trigger-slot":!0,"s-user-menu-red-dot":this.hasBadges,"s-user-menu-trigger-avatar-only":this.avatarOnly},id:"trigger-slot",onClick:t=>this.open(t),onKeyUp:t=>this.open(t),innerHTML:this.replaceParams(this.triggerSlot)})}getItemAnchorLinkAttrs(t){if("profile"===t&&this.profileUrl&&this.sallaAccountEnabled)return{href:this.profileUrl,target:"_blank",rel:"noopener noreferrer"};const e="loyalty_points"===t?"loyalty":t,r=this.accountPrefixedKeys.includes(e)?`account/${e}`:e;return{href:Salla.url.get(r)}}getMenuItem([t,r],i){if(("wallet"!==t||window.can_access_wallet)&&("loyalty_points"!==t||Salla.config.get("store.features").includes("loyalty-system")))return e("li",{class:{"s-user-menu-dropdown-item":!0,"s-user-menu-dropdown-item-logout":i+1===Object.entries(this.items).length}},e("a",{...this.getItemAnchorLinkAttrs(t),class:"s-user-menu-dropdown-item-link",onClick:e=>this.menuItemClicked(e,t)},e("i",{class:"s-user-menu-dropdown-item-prefix",innerHTML:r}),e("span",{class:"s-user-menu-dropdown-item-title"},this[t]),"wallet"!==t||this.inline||!this.walletBalance&&!this.walletBalanceLoading?"":e("span",{class:"s-user-menu-dropdown-item-balance",style:{display:"inline-flex",alignItems:"center",gap:"4px"}},this.walletBalance?e("span",{innerHTML:this.walletBalance}):"",this.walletBalanceLoading?e("salla-loading",{size:"14"}):""),["٠","0",void 0].includes(this.badges[t])?"":e("span",{class:"s-user-menu-dropdown-item-badge"},this.badges[t])))}componentShouldUpdate(){this.opened||window.removeEventListener("click",this.onClickOutside)}render(){return e(r,null,this.is_loggedIn?this.inline?e("ul",{class:"s-user-menu-inline"},Object.entries(this.items).map(((t,e)=>this.getMenuItem(t,e)))):e("div",{class:{"s-user-menu-wrapper":!0,"s-user-menu-relative-dropdown":this.relativeDropdown}},this.getTheHeader(),e("div",{class:{"s-user-menu-toggler":!0,opened:this.opened}},e("div",{class:"s-user-menu-dropdown",onClick:t=>t.stopPropagation(),onKeyUp:t=>t.stopPropagation()},this.showHeader?e("div",{class:"s-user-menu-dropdown-header"},e("img",{src:this.avatar,alt:`${this.first_name} ${this.last_name}`}),e("div",{class:"s-user-menu-dropdown-header-content"},e("span",null,this.hello),e("p",null,this.first_name," ",this.last_name)),e("button",{type:"button",class:"s-user-menu-dropdown-header-close",innerHTML:l,onClick:()=>{this.opened=!1}})):"",e("ul",{class:"s-user-menu-dropdown-list"},Object.entries(this.items).map(((t,e)=>this.getMenuItem(t,e))))))):e("slot",{name:"login-btn"},e("button",{type:"button",class:"s-user-menu-login-btn",onClick:()=>salla.event.dispatch("login::open"),innerHTML:m})))}async componentDidLoad(){await Salla.hooks.registerComponent("salla-user-menu",this),document.lazyLoadInstance?.update(this.host.querySelectorAll(".lazy"))}buildProfileUrl(t){return`${Salla.config.get("account.url","https://accounts.salla.com")}/${salla.config.get("user.language_code")}/user?store=${Salla.config.get("store.id")}&info=${encodeURIComponent(t)}`}get host(){return i(this)}};h.style='/*!twlt*/.relative{position:relative}.inline{display:inline}.inline-flex{display:inline-flex}salla-user-menu div[slot=\'trigger\']{display:none}.s-user-menu-wrapper{display:block;min-width:max-content;flex-shrink:0}.s-user-menu-relative-dropdown{position:relative}.s-user-menu-trigger{display:flex;width:fit-content;cursor:pointer;align-items:center;border-top-right-radius:0.375rem;border-top-left-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:0.625rem;padding-right:0.625rem;padding-top:0.875rem;padding-bottom:0.875rem;font-size:0.875rem;line-height:1.25rem}.s-user-menu-trigger-icon svg{height:1.25rem;width:1.25rem;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-user-menu-toggler::before{pointer-events:none;visibility:hidden;position:fixed;left:0px;top:0px;z-index:10;height:100vh;width:100vw;background-color:#71717abf;opacity:0;transition-duration:300ms;--tw-content:\'\';content:var(--tw-content)}.s-user-menu-toggler.opened::before{pointer-events:auto;visibility:visible;content:var(--tw-content);opacity:1}@media (min-width: 768px){.s-user-menu-toggler.opened::before{pointer-events:none;visibility:hidden;content:var(--tw-content);opacity:0}}.s-user-menu-toggler.opened .s-user-menu-trigger svg{--tw-rotate:180deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-user-menu-toggler.opened .s-user-menu-dropdown{visibility:visible;--tw-translate-y:0px;--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:1}.s-user-menu-trigger-avatar{display:inline-block;height:2.5rem;width:2.5rem;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));object-fit:cover}.s-user-menu-trigger-content{margin-left:0.5rem;margin-right:0.25rem}.s-user-menu-trigger-content:where([dir="rtl"],[dir="rtl"] *){margin-right:0.5rem;margin-left:0.25rem}.s-user-menu-trigger-avatar-only .s-user-menu-trigger-content{display:none}.s-user-menu-trigger-avatar-only .s-user-menu-trigger-icon{display:none}.s-user-menu-trigger-avatar-only .s-user-menu-trigger-avatar{border-width:0px}.s-user-menu-trigger-hello{font-size:14px;--tw-text-opacity:1;color:rgb(153 153 153 / var(--tw-text-opacity, 1))}.s-user-menu-trigger-name{margin-top:0.125rem;font-size:15px;line-height:1;--tw-text-opacity:1;color:rgb(68 68 68 / var(--tw-text-opacity, 1))}.s-user-menu-trigger-icon{margin-left:10px}.s-user-menu-trigger-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px;margin-right:10px}.s-user-menu-trigger-text-value{font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-user-menu-dropdown{visibility:hidden;position:fixed;bottom:0px;top:auto;right:0px;z-index:30;width:100%;transform-origin:center;--tw-translate-y:2.5rem;--tw-scale-y:.9;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-top-left-radius:0.375rem;border-top-right-radius:0.375rem;border-bottom-right-radius:0px;border-bottom-left-radius:0px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));opacity:0;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}@media (min-width: 768px){.s-user-menu-dropdown{position:absolute;bottom:unset;top:100%;width:15rem;transform-origin:top right;--tw-translate-y:-1rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0.375rem;border-bottom-left-radius:0.375rem;--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transition-duration:200ms}}@media (min-width: 1024px){.s-user-menu-dropdown{border-top-width:1px;border-color:rgb(209 213 219 / 0.3)}}.s-user-menu-dropdown:where([dir="rtl"],[dir="rtl"] *){left:0px;right:unset}.s-user-menu-dropdown-list>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1px * var(--tw-space-y-reverse))}.s-user-menu-dropdown-list{padding-top:0.5rem;padding-left:0.5rem;padding-right:0.5rem;padding-bottom:1rem}@media (min-width: 1024px){.s-user-menu-dropdown-list{padding-left:0px;padding-right:0px;padding-bottom:0.5rem}}.s-user-menu-dropdown-item a{display:flex;align-items:center;padding-left:1.5rem;padding-right:1.5rem;padding-top:0.625rem;padding-bottom:0.625rem;--tw-text-opacity:1;color:rgb(68 68 68 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-user-menu-dropdown-item a:hover{background-color:rgb(229 231 235 / 0.3)}@media (min-width: 640px){.s-user-menu-dropdown-item a{font-size:0.875rem;line-height:1.25rem}}.s-user-menu-dropdown-item-logout a{--tw-text-opacity:1 !important;color:rgb(255 68 58 / var(--tw-text-opacity, 1)) !important}.s-user-menu-dropdown-item-logout a svg{fill:#FF443A !important}.s-user-menu-dropdown-item-prefix svg{margin-right:0.75rem;height:1rem;width:1rem;fill:#9ca3af}.s-user-menu-dropdown-item-prefix svg:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:0.75rem}.s-user-menu-dropdown-header{position:relative;margin-bottom:0.25rem;display:flex;align-items:center;border-bottom-width:1px;padding:1rem}@media (min-width: 768px){.s-user-menu-dropdown-header{display:none}}.s-user-menu-dropdown-header img{pointer-events:none;margin-right:0.75rem;height:3rem;width:3rem;border-radius:9999px;object-fit:cover}.s-user-menu-dropdown-header img:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:0.75rem}.s-user-menu-dropdown-header-content span{font-size:14px;--tw-text-opacity:1;color:rgb(153 153 153 / var(--tw-text-opacity, 1))}.s-user-menu-dropdown-header-content p{font-size:1rem;line-height:1.5rem;font-weight:700;line-height:1;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-user-menu-dropdown-header-close{position:absolute;top:1.25rem;right:1rem;z-index:50;border-radius:9999px}.s-user-menu-dropdown-header-close:where([dir="rtl"],[dir="rtl"] *){right:unset;left:1rem}.s-user-menu-dropdown-header-close svg{height:1.25rem;width:1.25rem;fill:#ef4444}.s-user-menu-dropdown-item-badge{position:absolute;right:0.625rem;display:flex;height:1.25rem;width:1.25rem;flex-direction:column;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1));font-size:0.75rem;line-height:1rem;line-height:inherit;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-user-menu-dropdown-item-badge:where([dir="rtl"],[dir="rtl"] *){right:unset;left:0.625rem}.s-user-menu-dropdown-item-balance{margin-left:0.5rem;margin-right:0.5rem}.s-user-menu-red-dot .s-user-menu-avatar-wrap{position:relative}.s-user-menu-red-dot .s-user-menu-avatar-wrap:after{position:absolute;top:0px;height:0.75rem;width:0.75rem;border-radius:9999px;border-width:2px;--tw-border-opacity:1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-user-menu-red-dot .s-user-menu-avatar-wrap:where([dir="ltr"],[dir="ltr"] *):after{left:0px}.s-user-menu-red-dot .s-user-menu-avatar-wrap:where([dir="rtl"],[dir="rtl"] *):after{right:0px}.header-is-dark .s-user-menu-red-dot .s-user-menu-avatar-wrap:after{--tw-border-opacity:1;border-color:rgb(14 15 15 / var(--tw-border-opacity, 1))}.s-user-menu-login-btn{display:flex;height:2.5rem;width:2.5rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));outline:2px solid transparent;outline-offset:2px;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-user-menu-login-btn:hover{opacity:0.8}.s-user-menu-login-btn svg{height:1.25rem;width:1.25rem;fill:#374151}.s-user-menu-dropdown-item-suffix:where([dir="ltr"],[dir="ltr"] *){margin-left:auto}.s-user-menu-dropdown-item-suffix:where([dir="rtl"],[dir="rtl"] *){margin-right:auto}.s-user-menu-dropdown-item-suffix svg{height:1rem;width:1rem;fill:#9ca3af}.s-user-menu-dropdown-item-suffix-link{display:flex;align-items:center}';export{h as salla_user_menu}
4
+ import{r as t,h as e,H as r,a as i}from"./p-BnDYuqv2.js";import{A as s}from"./p-DCZbpt2a.js";import{B as a}from"./p-D3mWkc-3.js";import{C as o}from"./p-gFG8By9O.js";import{H as n}from"./p-00vBRoH3.js";import{C as l}from"./p-BsLF_HK7.js";import{S as d}from"./p-D4oPi1Ov.js";import{l as c}from"./p-BChI23pG.js";var m='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>user-circle</title>\n<path d="M16 22.964c-4.525 0-8.447 1.713-9.993 4.365-0.371 0.636-0.156 1.452 0.48 1.823s1.453 0.156 1.823-0.48c0.855-1.465 3.624-3.041 7.689-3.041s6.835 1.576 7.689 3.041c0.249 0.424 0.696 0.661 1.155 0.661 0.228 0 0.459-0.059 0.669-0.181 0.637-0.371 0.852-1.187 0.48-1.823-1.545-2.652-5.467-4.365-9.992-4.365zM22.667 13.631c0-3.676-2.991-6.667-6.667-6.667s-6.667 2.991-6.667 6.667 2.991 6.667 6.667 6.667 6.667-2.992 6.667-6.667zM12 13.631c0-2.205 1.795-4 4-4s4 1.795 4 4-1.795 4-4 4-4-1.795-4-4zM16 0.297c-8.823 0-16 7.177-16 16 0 2.941 0.821 5.831 2.373 8.357 0.252 0.411 0.689 0.636 1.137 0.636 0.239 0 0.479-0.064 0.696-0.197 0.628-0.385 0.824-1.207 0.439-1.833-1.295-2.108-1.979-4.516-1.979-6.963 0-7.352 5.981-13.333 13.333-13.333s13.333 5.981 13.333 13.333c0 2.448-0.684 4.856-1.979 6.961-0.385 0.628-0.189 1.448 0.437 1.835 0.627 0.384 1.448 0.189 1.835-0.437 1.553-2.527 2.373-5.416 2.373-8.359 0-8.823-7.177-16-16-16z"></path>\n</svg>\n';const h=class{constructor(e){t(this,e),this.accountLoading=!1,this.opened=!1,this.notifications=salla.lang.get("common.titles.notifications"),this.orders=salla.lang.get("common.titles.orders"),this.pending_orders=salla.lang.get("common.titles.pending_orders"),this.wishlist=salla.lang.get("common.titles.wishlist"),this.profile=salla.lang.get("common.titles.profile"),this.rating=salla.lang.get("common.titles.rating"),this.wallet=salla.lang.get("common.titles.wallet"),this.settings=salla.lang.get("common.titles.settings"),this.loyalty_points=salla.lang.get("pages.loyalty_program.loyalty_points"),this.logout=salla.lang.get("blocks.header.logout"),this.hello=salla.lang.get("pages.checkout.hello"),this.first_name=salla.storage.get("user.first_name")||"",this.last_name=salla.storage.get("user.last_name")||"",this.avatar=salla.storage.get("user.avatar")||salla.url.cdn("images/avatar.png",40,40),this.badges={notifications:salla.helpers.number(salla.storage.get("user.notifications")||0),pending_orders:salla.helpers.number(salla.storage.get("user.pending_orders")||0)},this.sallaAccountEnabled=!1,this.walletBalance="",this.walletBalanceLoading=!1,this.walletBalanceLoaded=!1,this.hasBadges=Number(salla.storage.get("user.pending_orders"))>0||Number(salla.storage.get("user.notifications"))>0,this.inline=!1,this.avatarOnly=!1,this.showHeader=!1,this.relativeDropdown=!1,this.showTrigger=!1,this.onClickOutside=()=>{this.opened=!1},this.OrderUpdate=0,this.accountPrefixedKeys=["orders","pending_orders","wallet","notifications","rating","profile","wishlist","settings"],this.items={notifications:a,orders:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>box-bankers</title>\n<path d="M28 1.333h-24c-2.205 0-4 1.795-4 4v5.333c0 0.736 0.597 1.333 1.333 1.333v14.667c0 2.205 1.795 4 4 4h21.333c2.205 0 4-1.795 4-4v-14.667c0.736 0 1.333-0.597 1.333-1.333v-5.333c0-2.205-1.795-4-4-4zM28 26.667c0 0.735-0.599 1.333-1.333 1.333h-21.333c-0.735 0-1.333-0.599-1.333-1.333v-14.667h5.333v2.667c0 1.471 1.196 2.667 2.667 2.667h8c1.471 0 2.667-1.196 2.667-2.667v-2.667h5.333zM12 14.667v-2.667h8v2.667zM29.333 9.333h-26.667v-4c0-0.735 0.599-1.333 1.333-1.333h24c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',pending_orders:o,wishlist:n,wallet:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>wallet</title>\n<path d="M28 6.667h-24c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333h24c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-24c-2.204 0-3.999 1.793-4 3.997v18.669c0 3.676 2.991 6.667 6.667 6.667h21.333c2.205 0 4-1.795 4-4v-16c0-2.205-1.795-4-4-4zM29.333 26.667c0 0.736-0.597 1.333-1.333 1.333h-21.333c-2.205 0-4-1.795-4-4v-14.895c0.416 0.147 0.865 0.228 1.333 0.228h24c0.736 0 1.333 0.597 1.333 1.333zM22.667 14.667c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 20c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.597 1.333-1.333 1.333z"></path>\n</svg>\n',loyalty_points:c,profile:m}}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.loadTranslations(),this.initiate(),Salla.event.on("api::token.injected",(t=>this.profileUrl=this.buildProfileUrl(t))),this.sallaAccountEnabled=Salla.config.get("store.features")?.includes("salla-account"),this.items=this.sallaAccountEnabled?{...this.items,settings:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>settings</title>\n<path d="M29.717 19.037l-1.817-1.499c0.067-0.512 0.1-1.028 0.1-1.539s-0.033-1.027-0.1-1.54l1.817-1.499c1.177-0.969 1.479-2.633 0.716-3.956l-1.159-2.009c-0.761-1.324-2.349-1.895-3.784-1.359l-2.212 0.829c-0.817-0.627-1.704-1.139-2.649-1.535l-0.388-2.332c-0.251-1.507-1.54-2.6-3.067-2.6h-2.319c-1.525 0-2.815 1.093-3.065 2.6l-0.388 2.332c-0.945 0.396-1.833 0.909-2.649 1.535l-2.212-0.829c-1.428-0.533-3.021 0.036-3.783 1.359l-1.16 2.011c-0.763 1.323-0.46 2.985 0.716 3.955l1.817 1.499c-0.067 0.513-0.1 1.029-0.1 1.54s0.033 1.027 0.1 1.539l-1.819 1.5c-1.176 0.971-1.476 2.635-0.715 3.955l1.159 2.011c0.763 1.324 2.356 1.899 3.784 1.36l2.212-0.831c0.816 0.625 1.703 1.139 2.649 1.535l0.388 2.332c0.251 1.507 1.54 2.6 3.067 2.6h2.319c1.527 0 2.816-1.093 3.065-2.6l0.389-2.332c0.947-0.396 1.833-0.909 2.649-1.535l2.212 0.831c1.432 0.539 3.023-0.035 3.783-1.36l1.16-2.011c0.76-1.32 0.459-2.984-0.717-3.956zM28.123 21.663l-1.16 2.011c-0.108 0.188-0.336 0.267-0.536 0.193l-2.931-1.1c-0.459-0.173-0.979-0.079-1.349 0.248-0.923 0.811-1.979 1.423-3.139 1.819-0.464 0.157-0.804 0.559-0.885 1.043l-0.515 3.087c-0.033 0.215-0.216 0.371-0.433 0.371h-2.319c-0.217 0-0.4-0.156-0.436-0.371l-0.513-3.087c-0.080-0.484-0.42-0.884-0.885-1.043-1.16-0.396-2.216-1.008-3.139-1.819-0.248-0.217-0.561-0.332-0.88-0.332-0.157 0-0.316 0.028-0.469 0.084l-2.931 1.1c-0.199 0.079-0.428-0.004-0.537-0.193l-1.159-2.011c-0.109-0.191-0.067-0.428 0.101-0.568l2.409-1.985c0.379-0.312 0.555-0.807 0.46-1.288-0.119-0.605-0.179-1.219-0.179-1.821 0-0.604 0.060-1.217 0.181-1.823 0.095-0.481-0.081-0.976-0.46-1.288l-2.409-1.985c-0.168-0.139-0.211-0.376-0.101-0.567l1.16-2.011c0.107-0.188 0.332-0.268 0.536-0.193l2.931 1.1c0.459 0.172 0.979 0.079 1.348-0.247 0.924-0.812 1.98-1.424 3.139-1.817 0.465-0.159 0.805-0.559 0.885-1.044l0.513-3.088c0.036-0.215 0.219-0.371 0.436-0.371h2.319c0.217 0 0.4 0.156 0.436 0.371l0.515 3.088c0.081 0.484 0.42 0.885 0.885 1.044 1.157 0.393 2.213 1.005 3.139 1.817 0.371 0.325 0.889 0.42 1.349 0.247l2.929-1.099c0.203-0.076 0.428 0.005 0.537 0.193l1.159 2.009c0.109 0.191 0.067 0.428-0.101 0.567l-2.409 1.985c-0.379 0.312-0.555 0.807-0.46 1.288 0.119 0.605 0.179 1.219 0.179 1.823 0 0.603-0.060 1.216-0.181 1.821-0.095 0.48 0.081 0.975 0.46 1.288l2.408 1.984c0.169 0.141 0.212 0.379 0.103 0.569zM16.016 10.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM16.016 18.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n'}:this.items,this.host.hasAttribute("with-rating")&&(this.items.rating=d),this.items.logout='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>send-out</title>\n<path d="M16 26.667h-9.333c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.736 0.597-1.333 1.333-1.333h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-9.333c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM29.231 15.491c-0.068-0.164-0.167-0.312-0.289-0.436l-5.332-5.332c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l3.057 3.059h-12.781c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h12.781l-3.057 3.057c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l5.332-5.332c0.124-0.123 0.221-0.271 0.289-0.435 0.135-0.325 0.135-0.693 0-1.019z"></path>\n</svg>\n';let t=Salla.storage.get("token");t||(t=""),this.profileUrl=this.buildProfileUrl(t);const e=this.host.querySelector('[slot="trigger"]');this.triggerSlot='<div class="s-user-menu-trigger"><div class="s-user-menu-avatar-wrap"><img class="s-user-menu-trigger-avatar" src="{avatar}" alt="{first_name}{last_name}" /></div><div class="s-user-menu-trigger-content"><span class="s-user-menu-trigger-hello">{hello}</span><p class="s-user-menu-trigger-name">{first_name} {last_name}</p></div> <i class="s-user-menu-trigger-icon">{icon}</i></div>',e&&(this.triggerSlot=e.innerHTML,e.innerHTML=this.replaceParams(e.innerHTML))}loadTranslations(){this.notifications=Salla.lang.get("common.titles.notifications"),this.orders=Salla.lang.get("common.titles.orders"),this.pending_orders=Salla.lang.get("common.titles.pending_orders"),this.wishlist=Salla.lang.get("common.titles.wishlist"),this.profile=Salla.lang.get("common.titles.profile"),this.hello=Salla.lang.get("pages.checkout.hello"),this.rating=Salla.lang.get("common.titles.rating"),this.wallet=Salla.lang.get("common.titles.wallet"),this.settings=Salla.lang.get("common.titles.settings"),this.loyalty_points=Salla.lang.get("pages.loyalty_program.loyalty_points"),this.logout=Salla.lang.get("blocks.header.logout")}async loadWalletBalance(){if(!Salla.config.isGuest()){this.walletBalanceLoading=!0;try{const t=await salla.api.withoutNotifier((()=>salla.api.request("/balance/wallet?light=1"))),e=Number(t?.data?.balance)||0;this.walletBalance=e?Salla.money({amount:Number(e.toFixed(2)),currency:Salla.config.get("user.currency_code")}):"",this.walletBalanceLoaded=!0}catch{}finally{this.walletBalanceLoading=!1}}}initiate(){return Salla.config.isGuest()?this.autoMountLoginModal():(this.is_loggedIn=!0,!this.inline&&(salla.url.is_page("customer.notifications")||salla.url.is_page("customer.orders.index.pending")||salla.url.is_page("customer.profile")||(Date.now()-(salla.storage.get("user.fetched_at")||0))/1e3/60>30)?this.fetchFreshProfile():void salla.event.on("profile::info.fetched",(t=>{this.updateProfileState(t)})))}autoMountLoginModal(){this.showTrigger&&(document.querySelector("salla-login-modal")||Salla.hooks.mount("body:end",document.createElement("salla-login-modal")))}fetchFreshProfile(){salla.api.token?salla.profile.api.info().then((t=>{this.updateProfileState(t)})):salla.log("trying to fetchFreshProfile before injected the token!!")}updateProfileState(t){this.badges={notifications:salla.helpers.number(t.data.notifications||0),pending_orders:salla.helpers.number(t.data.pending_orders||0)},this.hasBadges=Number(t.data.pending_orders)>0||Number(t.data.notifications)>0,this.first_name=t.data.first_name,this.last_name=t.data.last_name,this.avatar=t.data.avatar||salla.url.cdn("images/avatar.png",40,40)}async open(t){this.opened=!this.opened,t.stopPropagation(),this.opened&&(!window.can_access_wallet||this.walletBalanceLoaded||this.walletBalanceLoading||this.loadWalletBalance(),window.addEventListener("click",this.onClickOutside))}menuItemClicked(t,e){"logout"===e&&(t.preventDefault(),salla.auth.logout("sall-user-menu"))}replaceParams(t){return t.replace(/\{hello\}/g,this.hello).replace(/\{first_name\}/g,this.first_name).replace(/\{last_name\}/g,this.last_name).replace(/\{avatar\}/g,this.avatar).replace(/\{icon\}/g,s)}getTheHeader(){return e("div",{class:{"s-user-menu-trigger-slot":!0,"s-user-menu-red-dot":this.hasBadges,"s-user-menu-trigger-avatar-only":this.avatarOnly},id:"trigger-slot",onClick:t=>this.open(t),onKeyUp:t=>this.open(t),innerHTML:this.replaceParams(this.triggerSlot)})}getItemAnchorLinkAttrs(t){if("profile"===t&&this.profileUrl&&this.sallaAccountEnabled)return{href:this.profileUrl,target:"_blank",rel:"noopener noreferrer"};const e="loyalty_points"===t?"loyalty":t,r=this.accountPrefixedKeys.includes(e)?`account/${e}`:e;return{href:Salla.url.get(r)}}getMenuItem([t,r],i){if(("wallet"!==t||window.can_access_wallet)&&("loyalty_points"!==t||Salla.config.get("store.features").includes("loyalty-system")))return e("li",{class:{"s-user-menu-dropdown-item":!0,"s-user-menu-dropdown-item-logout":i+1===Object.entries(this.items).length}},e("a",{...this.getItemAnchorLinkAttrs(t),class:"s-user-menu-dropdown-item-link",onClick:e=>this.menuItemClicked(e,t)},e("i",{class:"s-user-menu-dropdown-item-prefix",innerHTML:r}),e("span",{class:"s-user-menu-dropdown-item-title"},this[t]),"wallet"!==t||this.inline||!this.walletBalance&&!this.walletBalanceLoading?"":e("span",{class:"s-user-menu-dropdown-item-balance",style:{display:"inline-flex",alignItems:"center",gap:"4px"}},this.walletBalance?e("span",{innerHTML:this.walletBalance}):"",this.walletBalanceLoading?e("salla-loading",{size:"14"}):""),["٠","0",void 0].includes(this.badges[t])?"":e("span",{class:"s-user-menu-dropdown-item-badge"},this.badges[t])))}componentShouldUpdate(){this.opened||window.removeEventListener("click",this.onClickOutside)}render(){return e(r,null,this.is_loggedIn?this.inline?e("ul",{class:"s-user-menu-inline"},Object.entries(this.items).map(((t,e)=>this.getMenuItem(t,e)))):e("div",{class:{"s-user-menu-wrapper":!0,"s-user-menu-relative-dropdown":this.relativeDropdown}},this.getTheHeader(),e("div",{class:{"s-user-menu-toggler":!0,opened:this.opened}},e("div",{class:"s-user-menu-dropdown",onClick:t=>t.stopPropagation(),onKeyUp:t=>t.stopPropagation()},this.showHeader?e("div",{class:"s-user-menu-dropdown-header"},e("img",{src:this.avatar,alt:`${this.first_name} ${this.last_name}`}),e("div",{class:"s-user-menu-dropdown-header-content"},e("span",null,this.hello),e("p",null,this.first_name," ",this.last_name)),e("button",{type:"button",class:"s-user-menu-dropdown-header-close",innerHTML:l,onClick:()=>{this.opened=!1}})):"",e("ul",{class:"s-user-menu-dropdown-list"},Object.entries(this.items).map(((t,e)=>this.getMenuItem(t,e))))))):e("slot",{name:"login-btn"},e("button",{type:"button",class:"s-user-menu-login-btn",onClick:()=>salla.event.dispatch("login::open"),innerHTML:m})))}async componentDidLoad(){await Salla.hooks.registerComponent("salla-user-menu",this),document.lazyLoadInstance?.update(this.host.querySelectorAll(".lazy"))}buildProfileUrl(t){return`${Salla.config.get("account.url","https://accounts.salla.com")}/${salla.config.get("user.language_code")}/user?store=${Salla.config.get("store.id")}&info=${encodeURIComponent(t)}`}get host(){return i(this)}};h.style='/*!twlt*/.relative{position:relative}.inline{display:inline}.inline-flex{display:inline-flex}salla-user-menu div[slot=\'trigger\']{display:none}.s-user-menu-wrapper{display:block;min-width:max-content;flex-shrink:0}.s-user-menu-relative-dropdown{position:relative}.s-user-menu-trigger{display:flex;width:fit-content;cursor:pointer;align-items:center;border-top-right-radius:0.375rem;border-top-left-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:0.625rem;padding-right:0.625rem;padding-top:0.875rem;padding-bottom:0.875rem;font-size:0.875rem;line-height:1.25rem}.s-user-menu-trigger-icon svg{height:1.25rem;width:1.25rem;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-user-menu-toggler::before{pointer-events:none;visibility:hidden;position:fixed;left:0px;top:0px;z-index:10;height:100vh;width:100vw;background-color:#71717abf;opacity:0;transition-duration:300ms;--tw-content:\'\';content:var(--tw-content)}.s-user-menu-toggler.opened::before{pointer-events:auto;visibility:visible;content:var(--tw-content);opacity:1}@media (min-width: 768px){.s-user-menu-toggler.opened::before{pointer-events:none;visibility:hidden;content:var(--tw-content);opacity:0}}.s-user-menu-toggler.opened .s-user-menu-trigger svg{--tw-rotate:180deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-user-menu-toggler.opened .s-user-menu-dropdown{visibility:visible;--tw-translate-y:0px;--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:1}.s-user-menu-trigger-avatar{display:inline-block;height:2.5rem;width:2.5rem;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));object-fit:cover}.s-user-menu-trigger-content{margin-left:0.5rem;margin-right:0.25rem}.s-user-menu-trigger-content:where([dir="rtl"],[dir="rtl"] *){margin-right:0.5rem;margin-left:0.25rem}.s-user-menu-trigger-avatar-only .s-user-menu-trigger-content{display:none}.s-user-menu-trigger-avatar-only .s-user-menu-trigger-icon{display:none}.s-user-menu-trigger-avatar-only .s-user-menu-trigger-avatar{border-width:0px}.s-user-menu-trigger-hello{font-size:14px;--tw-text-opacity:1;color:rgb(153 153 153 / var(--tw-text-opacity, 1))}.s-user-menu-trigger-name{margin-top:0.125rem;font-size:15px;line-height:1;--tw-text-opacity:1;color:rgb(68 68 68 / var(--tw-text-opacity, 1))}.s-user-menu-trigger-icon{margin-left:10px}.s-user-menu-trigger-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px;margin-right:10px}.s-user-menu-trigger-text-value{font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-user-menu-dropdown{visibility:hidden;position:fixed;bottom:0px;top:auto;right:0px;z-index:30;width:100%;transform-origin:center;--tw-translate-y:2.5rem;--tw-scale-y:.9;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-top-left-radius:0.375rem;border-top-right-radius:0.375rem;border-bottom-right-radius:0px;border-bottom-left-radius:0px;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));opacity:0;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}@media (min-width: 768px){.s-user-menu-dropdown{position:absolute;bottom:unset;top:100%;width:15rem;transform-origin:top right;--tw-translate-y:-1rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0.375rem;border-bottom-left-radius:0.375rem;--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transition-duration:200ms}}@media (min-width: 1024px){.s-user-menu-dropdown{border-top-width:1px;border-color:rgb(209 213 219 / 0.3)}}.s-user-menu-dropdown:where([dir="rtl"],[dir="rtl"] *){left:0px;right:unset}.s-user-menu-dropdown-list>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1px * var(--tw-space-y-reverse))}.s-user-menu-dropdown-list{padding-top:0.5rem;padding-left:0.5rem;padding-right:0.5rem;padding-bottom:1rem}@media (min-width: 1024px){.s-user-menu-dropdown-list{padding-left:0px;padding-right:0px;padding-bottom:0.5rem}}.s-user-menu-dropdown-item a{display:flex;align-items:center;padding-left:1.5rem;padding-right:1.5rem;padding-top:0.625rem;padding-bottom:0.625rem;--tw-text-opacity:1;color:rgb(68 68 68 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-user-menu-dropdown-item a:hover{background-color:rgb(229 231 235 / 0.3)}@media (min-width: 640px){.s-user-menu-dropdown-item a{font-size:0.875rem;line-height:1.25rem}}.s-user-menu-dropdown-item-logout a{--tw-text-opacity:1 !important;color:rgb(255 68 58 / var(--tw-text-opacity, 1)) !important}.s-user-menu-dropdown-item-logout a svg{fill:#FF443A !important}.s-user-menu-dropdown-item-prefix svg{margin-right:0.75rem;height:1rem;width:1rem;fill:#9ca3af}.s-user-menu-dropdown-item-prefix svg:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:0.75rem}.s-user-menu-dropdown-header{position:relative;margin-bottom:0.25rem;display:flex;align-items:center;border-bottom-width:1px;padding:1rem}@media (min-width: 768px){.s-user-menu-dropdown-header{display:none}}.s-user-menu-dropdown-header img{pointer-events:none;margin-right:0.75rem;height:3rem;width:3rem;border-radius:9999px;object-fit:cover}.s-user-menu-dropdown-header img:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:0.75rem}.s-user-menu-dropdown-header-content span{font-size:14px;--tw-text-opacity:1;color:rgb(153 153 153 / var(--tw-text-opacity, 1))}.s-user-menu-dropdown-header-content p{font-size:1rem;line-height:1.5rem;font-weight:700;line-height:1;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-user-menu-dropdown-header-close{position:absolute;top:1.25rem;right:1rem;z-index:50;border-radius:9999px}.s-user-menu-dropdown-header-close:where([dir="rtl"],[dir="rtl"] *){right:unset;left:1rem}.s-user-menu-dropdown-header-close svg{height:1.25rem;width:1.25rem;fill:#ef4444}.s-user-menu-dropdown-item-badge{position:absolute;right:0.625rem;display:flex;height:1.25rem;width:1.25rem;flex-direction:column;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1));font-size:0.75rem;line-height:1rem;line-height:inherit;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-user-menu-dropdown-item-badge:where([dir="rtl"],[dir="rtl"] *){right:unset;left:0.625rem}.s-user-menu-dropdown-item-balance{margin-left:0.5rem;margin-right:0.5rem}.s-user-menu-red-dot .s-user-menu-avatar-wrap{position:relative}.s-user-menu-red-dot .s-user-menu-avatar-wrap:after{position:absolute;top:0px;height:0.75rem;width:0.75rem;border-radius:9999px;border-width:2px;--tw-border-opacity:1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-user-menu-red-dot .s-user-menu-avatar-wrap:where([dir="ltr"],[dir="ltr"] *):after{left:0px}.s-user-menu-red-dot .s-user-menu-avatar-wrap:where([dir="rtl"],[dir="rtl"] *):after{right:0px}.header-is-dark .s-user-menu-red-dot .s-user-menu-avatar-wrap:after{--tw-border-opacity:1;border-color:rgb(14 15 15 / var(--tw-border-opacity, 1))}.s-user-menu-login-btn{display:flex;height:2.5rem;width:2.5rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));outline:2px solid transparent;outline-offset:2px;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-user-menu-login-btn:hover{opacity:0.8}.s-user-menu-login-btn svg{height:1.25rem;width:1.25rem;fill:#374151}.s-user-menu-dropdown-item-suffix:where([dir="ltr"],[dir="ltr"] *){margin-left:auto}.s-user-menu-dropdown-item-suffix:where([dir="rtl"],[dir="rtl"] *){margin-right:auto}.s-user-menu-dropdown-item-suffix svg{height:1rem;width:1rem;fill:#9ca3af}.s-user-menu-dropdown-item-suffix-link{display:flex;align-items:center}';export{h as salla_user_menu}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r,h as e,a as t}from"./p-BTR557QH.js";import{S as s}from"./p-BscTeWDc.js";import{C as a}from"./p-BsLF_HK7.js";import{A as i,a as o}from"./p-Vqpj4CWE.js";import{H as c}from"./p-Brgf4SAC.js";import"./p-CgtvEd63.js";const n="salla::search-history";function l(){if("undefined"==typeof window)return n;const r=new URLSearchParams(window.location.search).get("scope");return r?`${n}-${r}`:n}const h={searchPlaceholder:"",noOptions:"",outOfStock:"",close:"",back:"",remove:"",searchHistory:"",trendingCategories:"",mostSearched:"",searchSuggestions:"",categories:"",searchResults:"",searchViewAllTemplate:""},d={"common.elements.search_history":{ar:"آخر ما تم البحث عنه",en:"Recently Searched"},"common.elements.trending_categories":{ar:"التصنيفات الأكثر بحثاً",en:"Trending categories"},"common.elements.most_searched":{ar:"المنتجات الأكثر بحثاً",en:"Trending products"},"common.elements.search_suggestions":{ar:"اقتراحات البحث",en:"Search suggestions"},"common.elements.categories":{ar:"التصنيفات",en:"Categories"},"common.elements.search_results":{ar:"نتائج البحث",en:"Search results"},"common.elements.search_view_all":{ar:'عرض كل النتائج لـ ":word"',en:'View all results for ":word"'}};function p(r){return salla.url.get("search?q="+encodeURI(r))}function m(r,e){const[t,s=""]=r.split("?"),a=new URLSearchParams(s);return a.set("_svs",e),`${t}?${a.toString()}`}function g(r){const e=l();salla.storage.set(e,r)}const w={trendingCategories:[],mostSearchedProducts:[]};let u=null;const b=class{constructor(e){r(this,e),this.hasTrackedFocus=!1,this.hasLoadedPopularSearches=!1,this.translationLoaded=!1,this.labels=h,this.loading=!1,this.typing=!1,this.debounce=setTimeout((()=>""),1e3),this.search_term="",this.hasInputValue=!1,this.searchHistory=function(){const r=l(),e=salla.storage.get(r,[]);return Array.isArray(e)?e.filter((r=>"string"==typeof r)):[]}(),this.trendingCategories=[],this.mostSearchedProducts=[],this.placeholder=!1,this.inline=!1,this.oval=!1,this.height=60,this.maxWords=5,this.showAction=!1,this.tracking={searchFocus:()=>{this.hasTrackedFocus||(this.hasTrackedFocus=!0,salla.event.emit("salla-search::input.focused"))},productClick:(r,e)=>{c.saveProductSource("search"),this.commitSearchHistory(this.search_term),salla.event.emit("salla-search::product.clicked",[{product:r,position:e}])},recommendationClick:(r,e)=>{salla.event.emit("salla-search::recommendation.clicked",{term:r,source:e})}},salla.event.on("search::open",(()=>this.open()))}async open(){this.hasLoadedPopularSearches||(this.hasLoadedPopularSearches=!0,function(){if(!u){const r=salla.search.popular().then((r=>({trendingCategories:(r?.data?.categories||[]).map((r=>({name:r.name,url:m(salla.url.create("categories",r.id),"search-trending")}))),mostSearchedProducts:(r?.data?.products||[]).map((r=>({name:r.name,url:m(salla.url.create("products",r.id),"search-trending")})))}))).catch((()=>(u=null,w)));u=r}return u}().then((({trendingCategories:r,mostSearchedProducts:e})=>{this.trendingCategories=r,this.mostSearchedProducts=e}))),await(this.modal?.open().then((()=>setTimeout((()=>this.searchInput?.focus()),300))))}handleModalVisibilityChanged(r){r.target!==this.modal||r.detail||this.onModalClose()}onModalClose(){this.searchInput&&(this.searchInput.value=""),this.results=void 0,this.search_term="",this.hasInputValue=!1,this.afterSearching()}handleKeyDown(r){if("Enter"!==r.key)return;const e=this.searchInput?.value??"";e.length<=2||(e!==this.search_term&&(clearTimeout(this.debounce),this.typing=!1,this.search_term=e),this.commitSearchHistory(e),this.searchInput&&(this.searchInput.value=""),this.hasInputValue=!1,setTimeout((()=>{window.location.href=p(e)}),100))}commitSearchHistory(r){r&&(this.searchHistory=function(r,e){const t=e.trim();if(!t)return r;const s=r.filter((r=>r.toLowerCase()!==t.toLowerCase()));return[t,...s].slice(0,10)}(this.searchHistory,r),g(this.searchHistory))}removeFromSearchHistory(r){this.searchHistory=this.searchHistory.filter((e=>e!==r)),g(this.searchHistory),this.afterSearching()}async componentWillLoad(){await salla.lang.onLoaded(),function(){if(!salla?.lang?.addBulk)return;const r=Object.entries(d).reduce(((r,[e,t])=>(salla.lang.get(e)===e&&(r[e]=t),r)),{});Object.keys(r).length&&salla.lang.addBulk(r)}(),this.labels={searchPlaceholder:salla.lang.get("blocks.header.search_placeholder"),noOptions:salla.lang.get("common.elements.no_options"),outOfStock:salla.lang.get("pages.products.out_of_stock"),close:salla.lang.get("common.elements.close"),back:salla.lang.get("common.elements.back"),remove:salla.lang.get("common.elements.remove"),searchHistory:salla.lang.get("common.elements.search_history"),trendingCategories:salla.lang.get("common.elements.trending_categories"),mostSearched:salla.lang.get("common.elements.most_searched"),searchSuggestions:salla.lang.get("common.elements.search_suggestions"),categories:salla.lang.get("common.elements.categories"),searchResults:salla.lang.get("common.elements.search_results"),searchViewAllTemplate:salla.lang.get("common.elements.search_view_all")},this.translationLoaded=!0}debounceSearch(r){this.typing=!0,clearTimeout(this.debounce),this.debounce=setTimeout((()=>{this.typing=!1,this.search_term=r.target.value}),700)}limitWordsAndSearch(r){let e=r.target.value;this.hasInputValue=e.length>0;const t=e.trim().split(/\s+/);if(t.length>this.maxWords){const r=t.slice(0,this.maxWords).join(" ");this.searchInput&&(this.searchInput.value=r)}this.debounceSearch(r)}getQueryParam(r){return new URLSearchParams(window.location.search).get(r)}handleActionClick(){if(this.search_term&&this.search_term.length>2)return this.search(this.search_term)}handleSearch(r){r.length>2?this.search(r):(this.results=void 0,this.afterSearching())}search(r){this.loading=!0,salla.product.fetch({source:"search",source_value:r}).then((e=>{this.results=e,salla.event.emit("Products Searched",{query:r,total:e.data?.length})})).catch((r=>"Query is same as previous one!"!==r?this.results=void 0:null)).finally((()=>this.afterSearching()))}afterSearching(){this.loading=!1,salla.product.api.previousQuery=""}renderCategoriesSection(r){return this.trendingCategories.length?e("div",null,e("p",{class:"s-search-idle-section-title"},r),e("div",{class:"s-search-idle-categories-list"},this.trendingCategories.map((r=>e("a",{class:"s-search-idle-category-chip",href:r.url,onClick:()=>this.tracking.recommendationClick(r.name,"category")},r.name,r.count?e("span",{class:"s-search-idle-category-count"},r.count):null))))):null}renderMostSearchedProductsSection(r,t){return this.mostSearchedProducts.length?e("div",null,e("p",{class:"s-search-idle-section-title"},r),e("ul",{class:"s-search-most-searched-list"},this.mostSearchedProducts.map((r=>e("li",null,e("a",{class:"s-search-most-searched-item",href:r.url,onClick:()=>this.tracking.recommendationClick(r.name,t)},e("span",{class:"s-search-most-searched-icon",innerHTML:s}),r.name)))))):null}renderSearchHistorySection(){return!this.searchHistory.length||this.hasInputValue?null:e("div",null,e("p",{class:"s-search-idle-section-title"},this.labels.searchHistory),e("div",{class:"s-search-history-list"},this.searchHistory.map((r=>e("span",{class:"s-search-history-chip"},e("a",{class:"s-search-history-chip-term",href:m(p(r),"history"),onClick:()=>{this.tracking.recommendationClick(r,"history")}},e("span",{class:"s-search-history-chip-icon",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="currentColor" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M3.49902 14.9656C4.72475 18.4791 8.06749 21 11.999 21C16.9696 21 20.999 16.9706 20.999 12C20.999 7.02944 16.9696 3 11.999 3C8.29827 3 4.8984 5.6756 3.68943 8.5"></path>\n <path d="M11.999 7V12L14.999 14"></path>\n <path d="M7.49751 8.74363C7.49751 8.74363 3.81388 9.3026 3.25487 8.7436C2.69585 8.1846 3.25488 4.50098 3.25488 4.50098"></path>\n</svg>\n'}),r),e("button",{type:"button",class:"s-search-history-chip-remove","aria-label":this.labels.remove,onClick:()=>this.removeFromSearchHistory(r)},e("span",{innerHTML:a})))))))}renderIdlePanel(){return e("div",{class:{"s-search-idle-panel":!0,"s-search-idle-panel-empty":!(this.searchHistory.length>0&&!this.hasInputValue||this.trendingCategories.length>0||this.mostSearchedProducts.length>0)}},this.renderSearchHistorySection(),this.renderCategoriesSection(this.labels.trendingCategories),this.renderMostSearchedProductsSection(this.labels.mostSearched,"trending"))}renderResultsBody(){return e("div",{class:"s-search-results-body"},null,e("div",{class:{"s-search-results-grid-wrap":!0,"s-search-results-grid-wrap-no-sidebar":!0}},e("p",{class:"s-search-idle-section-title"},this.labels.searchResults),e("div",{class:"s-search-results-grid"},this.results?.data.map(((r,t)=>e("div",{key:r.id,class:"s-search-grid-item",onClick:()=>this.tracking.productClick(r,t)},e("salla-search-product-card",{product:{...r,url:r.url+"?from=search-bar"},hideAddBtn:!0})))),0===this.results?.data.length?e("p",{class:"s-search-no-results-placeholder"},this.labels.noOptions):null)))}renderViewAllLink(){return this.results?.data.length?e("a",{class:"s-search-view-all",href:p(this.search_term),onClick:()=>this.commitSearchHistory(this.search_term)},this.labels.searchViewAllTemplate.replace(":word",this.search_term),e("span",{class:"s-search-view-all-icon",innerHTML:salla.config.get("theme.is_rtl",!0)?i:o})):null}renderDropdown(){return this.results?this.renderResultsBody():this.renderIdlePanel()}renderInputWrapper(){const r=e("div",{class:"s-search-input-wrapper"},e("span",{class:"s-search-icon-wrap"},e("span",{class:"s-search-icon",innerHTML:this.loading?'<i class="s-search-spinner-loader"/>':s})),e("input",{type:"search",enterkeyhint:"search",autocomplete:"off",class:"s-search-input",placeholder:this.labels.searchPlaceholder,onInput:r=>this.limitWordsAndSearch(r),onKeyDown:r=>this.handleKeyDown(r),onFocus:()=>this.tracking.searchFocus(),ref:r=>this.searchInput=r,style:{height:this.height+"px",borderRadius:this.oval?this.height/2+"px":""}}),this.showAction?e("salla-button",{loading:this.loading,class:{"s-search-action":!0,"s-search-action-oval":this.oval},onClick:()=>this.handleActionClick()},!this.loading&&e("span",{innerHTML:s})):null);return e("div",{class:"s-search-input-row"},e("button",{type:"button",class:"s-search-back-btn","aria-label":this.labels.back,onClick:()=>this.modal?.close()},e("span",{innerHTML:salla.config.get("theme.is_rtl",!0)?o:i})),r)}renderPlaceholderTrigger(){return e("div",{class:"s-search-input-wrapper"},e("span",{class:"s-search-icon-wrap"},e("span",{class:"s-search-icon",innerHTML:s})),e("button",{type:"button",class:"s-search-input s-search-placeholder-trigger",onClick:()=>this.open(),style:{height:this.height+"px",borderRadius:this.oval?this.height/2+"px":""}},this.labels.searchPlaceholder))}renderInlineTrigger(){return e("div",{class:"s-search-input-wrapper"},e("span",{class:"s-search-icon-wrap"},e("span",{class:"s-search-icon",innerHTML:s})),e("input",{type:"search",readOnly:!0,class:"s-search-input s-search-placeholder-trigger",placeholder:this.labels.searchPlaceholder,onFocus:()=>this.open(),style:{height:this.height+"px",borderRadius:this.oval?this.height/2+"px":""}}))}renderModal(){return e("salla-modal",{position:"top",class:"s-search-modal s-search-modal-new","hide-close-button":!0,ref:r=>this.modal=r},e("div",{class:"s-search-panel"},this.renderInputWrapper(),this.renderDropdown(),this.renderViewAllLink()))}render(){return this.placeholder?e("div",{class:"s-search-placeholder-wrapper s-search-placeholder-wrapper-new s-search-inline"},this.renderPlaceholderTrigger(),this.renderModal()):this.inline?e("div",{class:"s-search-placeholder-wrapper s-search-placeholder-wrapper-new s-search-inline"},this.renderInlineTrigger(),this.renderModal()):this.renderModal()}componentDidLoad(){this.afterSearching()}get host(){return t(this)}static get watchers(){return{search_term:["handleSearch"]}}};b.style='/*!twlt*/.s-search-placeholder-wrapper{position:relative;display:inline-block}.s-search-placeholder-wrapper-new{display:block;width:100%}.s-search-input-wrapper{position:relative}.s-search-placeholder-trigger{cursor:pointer;appearance:none;text-align:start}.s-search-divider{border:none;border-top:1px solid #F3F4F6;margin:0.25rem 0}.visible{visibility:visible}.inline{display:inline}.hidden{display:none}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-search-container{position:relative;z-index:99;max-height:14rem;border-radius:0.375rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-search-oval{border-radius:20px}.s-search-inline{min-width:220px}.s-search-container-open{max-height:24rem;border-radius:0px !important}.s-search-container-open .s-search-input{border-top-left-radius:0.375rem !important;border-top-right-radius:0.375rem !important;border-bottom-right-radius:0px !important;border-bottom-left-radius:0px !important;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-search-no-results .s-search-input{border-bottom-right-radius:0px;border-bottom-left-radius:0px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-search-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-top:0px;padding-bottom:0.125rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-search-input:focus{--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-ring-color:transparent}.s-search-input:where([dir="ltr"],[dir="ltr"] *){padding-left:2.5rem}.s-search-input:where([dir="rtl"],[dir="rtl"] *){padding-right:2.5rem}.s-search-input:focus{outline:2px solid transparent !important;outline-offset:2px !important;box-shadow:none !important;border-color:#e5e7eb !important}.s-search-modal-new .s-search-input{--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-search-icon-wrap{position:absolute;top:50%;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));line-height:1;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-icon-wrap:where([dir="ltr"],[dir="ltr"] *){left:1rem}.s-search-icon-wrap:where([dir="rtl"],[dir="rtl"] *){right:1rem}.s-search-icon svg{height:1rem;width:1rem;fill:#9ca3af}.s-search-spinner-loader{display:block;height:1rem;width:1rem}@keyframes spin{to{transform:rotate(360deg)}}.s-search-spinner-loader{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));border-right-color:var(--color-primary)}.s-search-results{position:absolute;margin:auto;max-height:24rem;width:100%;max-width:100%;overflow-y:auto;border-bottom-right-radius:0.375rem;border-bottom-left-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-search-no-results{border-bottom-right-radius:0px !important;border-bottom-left-radius:0px !important}.s-search-no-results-placeholder{grid-column:1 / -1;padding:1rem;text-align:center;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-product{display:flex;height:100%;justify-content:space-around;overflow:hidden;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));background-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-search-product:last-child{border-bottom-width:0px}.s-search-product:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}@media (min-width: 480px){.s-search-product{padding-left:1.25rem;padding-right:1.25rem}}.s-search-product-image-container{position:relative;height:3.5rem;width:5rem;overflow:hidden;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-search-product-image{position:relative;height:100%;width:100%;object-fit:cover;font-size:0px}.s-search-product-image::before{position:absolute;top:0px;left:0px;height:100%;width:100%;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-search-product-details{flex:1 1 0%;padding-top:0.25rem}.s-search-product-details:where([dir="ltr"],[dir="ltr"] *){padding-left:1rem}@media (min-width: 480px){.s-search-product-details:where([dir="ltr"],[dir="ltr"] *){padding-left:1.25rem}}.s-search-product-details:where([dir="rtl"],[dir="rtl"] *){padding-right:1rem}@media (min-width: 480px){.s-search-product-details:where([dir="rtl"],[dir="rtl"] *){padding-right:1.25rem}}.s-search-product-title{margin-bottom:0.375rem;display:flex;flex-direction:column;align-items:baseline;justify-content:flex-start;font-size:0.875rem;font-weight:700;line-height:1.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-product-price{display:flex;width:100%;align-items:center;font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary)}.s-search-product-regular-price{padding-left:0.75rem;padding-right:0.75rem;font-weight:500;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-search-product-not-available{--tw-grayscale:grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-search-action{position:absolute;height:100%}.s-search-action:where([dir="ltr"],[dir="ltr"] *){right:0px}.s-search-action:where([dir="rtl"],[dir="rtl"] *){left:0px;border-top-right-radius:0px;border-bottom-right-radius:0px}.s-search-action-oval:where([dir="ltr"],[dir="ltr"] *){border-top-right-radius:9999px;border-bottom-right-radius:9999px}.s-search-action-oval:where([dir="rtl"],[dir="rtl"] *){border-top-left-radius:9999px;border-bottom-left-radius:9999px}.s-search-input-row{margin:1rem;display:flex;align-items:center}.s-search-back-btn{display:flex;flex-shrink:0;align-items:center;justify-content:center;padding:0.25rem;line-height:1;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-search-back-btn:hover{--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.s-search-back-btn{display:none}}.s-search-back-btn svg{height:1.5rem;width:1.5rem;fill:#6b7280}.s-search-input-wrapper{position:relative;display:flex;flex-grow:1;align-items:center}.s-search-panel{display:flex;height:100%;flex-direction:column}.s-search-results-body{display:flex;min-height:0px;flex:1 1 0%;flex-direction:column;gap:0.75rem;overflow:hidden;--tw-shadow:0 -4px 6px -4px rgba(0,0,0,0.1);--tw-shadow-colored:0 -4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}@media (min-width: 640px){.s-search-results-body{flex-direction:row}}.s-search-results-grid-wrap{min-height:0px;min-width:0px;flex:1 1 0%;overflow-y:auto}@media (min-width: 640px){.s-search-results-grid-wrap{max-height:24rem !important}}.s-search-results-grid-wrap-no-sidebar{padding-left:1rem;padding-right:1rem}@media (min-width: 640px){.s-search-results-grid-wrap-no-sidebar{padding-left:1.25rem;padding-right:1.25rem}}.s-search-results-grid{display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));align-content:flex-start;column-gap:0.75rem;row-gap:0.25rem}@media (min-width: 640px){.s-search-results-grid{grid-template-columns:repeat(2, minmax(0, 1fr))}}@media (min-width: 1024px){.s-search-results-grid{grid-template-columns:repeat(3, minmax(0, 1fr))}}.s-search-grid-item{cursor:pointer;border-radius:0.375rem;padding:0.25rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-search-grid-item:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-search-grid-item .s-product-card-out-badge{--tw-bg-opacity:1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1));--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-search-view-all{display:flex;flex-shrink:0;align-items:center;justify-content:center;gap:0.25rem;border-top-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding:0.75rem;text-align:center;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-search-view-all:hover{text-decoration-line:underline}.s-search-view-all-icon{line-height:1}.s-search-view-all-icon svg{height:1rem;width:1rem;fill:#6b7280}.s-search-sidebar{max-height:none;width:100%;flex-shrink:0}.s-search-sidebar>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.s-search-sidebar{padding:0.5rem}@media (min-width: 640px){.s-search-sidebar{max-height:24rem !important;width:16rem;overflow-y:auto !important;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding:0.75rem}}@media (min-width: 480px){.s-search-sidebar{width:13rem}}.s-search-sidebar:where([dir="ltr"],[dir="ltr"] *){--tw-shadow:4px 0 6px -4px rgba(0,0,0,0.1);--tw-shadow-colored:4px 0 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-search-sidebar:where([dir="rtl"],[dir="rtl"] *){--tw-shadow:-4px 0 6px -4px rgba(0,0,0,0.1);--tw-shadow-colored:-4px 0 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-search-idle-panel{min-height:6rem}.s-search-idle-panel>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.s-search-idle-panel{overflow-y:auto;padding:1rem;padding-top:0px;--tw-shadow:0 -4px 6px -4px rgba(0,0,0,0.1);--tw-shadow-colored:0 -4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-search-idle-panel-empty{max-height:none !important;min-height:0px !important;padding:0px !important;--tw-shadow:0 0 #0000 !important;--tw-shadow-colored:0 0 #0000 !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important}.s-search-idle-section-title{margin-bottom:0.5rem;margin-top:0.5rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-history-list{display:flex;flex-wrap:wrap;gap:0.5rem}.s-search-history-chip{display:inline-flex;align-items:center;gap:0.375rem;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding-top:0.375rem;padding-bottom:0.375rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-history-chip:hover{background-color:color-mix(in srgb,var(--color-primary) 10%,transparent)}.s-search-history-chip:where([dir="ltr"],[dir="ltr"] *){padding-left:0.75rem;padding-right:0.5rem}.s-search-history-chip:where([dir="rtl"],[dir="rtl"] *){padding-right:0.75rem;padding-left:0.5rem}.s-search-history-chip-term{display:inline-flex;align-items:center;gap:0.25rem;line-height:1}.s-search-history-chip:hover .s-search-history-chip-term{color:var(--color-primary)}.s-search-history-chip-icon svg{height:0.875rem;width:0.875rem}.s-search-history-chip-remove svg{height:0.625rem;width:0.625rem;fill:#9ca3af}.s-search-idle-categories-list{display:flex;flex-wrap:wrap;gap:0.5rem}.s-search-idle-category-chip{display:inline-flex;align-items:center;gap:0.25rem;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding-left:0.75rem;padding-right:0.75rem;padding-top:0.375rem;padding-bottom:0.375rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-idle-category-chip:hover{background-color:color-mix(in srgb,var(--color-primary) 10%,transparent);color:var(--color-primary)}.s-search-sidebar .s-search-idle-category-chip{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-search-idle-category-count{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-most-searched-list{display:flex;flex-direction:column}.s-search-most-searched-item{display:flex;width:100%;align-items:center;gap:0.5rem;padding-top:0.375rem;padding-bottom:0.375rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-most-searched-item:hover{color:var(--color-primary)}.s-search-most-searched-icon svg{height:0.875rem;width:0.875rem;fill:#9ca3af}@media (min-width: 640px){.s-search-modal .s-modal-wrapper{align-items:flex-start;padding:0}.s-search-modal .s-modal-spacer{display:inline}.s-search-modal .s-modal-body{padding:0;width:700px;max-width:90%;margin-top:3.2rem;border-radius:0.5rem;overflow:visible;position:relative !important}}.s-search-modal .s-modal-close{top:50%;transform:translateY(-50%)}@media (max-width: 639px){.s-search-modal .s-modal-body .s-search-results{position:static;margin-top:0}.s-search-modal.s-search-modal-new .s-modal-body{height:100dvh;max-height:100dvh !important}}@media (min-width: 640px){.s-search-modal.s-search-modal-new .s-modal-body{background:var(--color-surface, #fff);overflow:hidden;width:1100px;max-width:95%}}.s-search-product-card-out-of-stock img.loaded{--tw-grayscale:grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-search-product-card-image img.loaded{position:relative;opacity:1}';export{b as salla_search}
4
+ import{r,h as e,a as t}from"./p-BnDYuqv2.js";import{S as s}from"./p-BscTeWDc.js";import{C as a}from"./p-BsLF_HK7.js";import{A as i,a as o}from"./p-Vqpj4CWE.js";import{H as c}from"./p-Brgf4SAC.js";import"./p-CgtvEd63.js";const n="salla::search-history";function l(){if("undefined"==typeof window)return n;const r=new URLSearchParams(window.location.search).get("scope");return r?`${n}-${r}`:n}const h={searchPlaceholder:"",noOptions:"",outOfStock:"",close:"",back:"",remove:"",searchHistory:"",trendingCategories:"",mostSearched:"",searchSuggestions:"",categories:"",searchResults:"",searchViewAllTemplate:""},d={"common.elements.search_history":{ar:"آخر ما تم البحث عنه",en:"Recently Searched"},"common.elements.trending_categories":{ar:"التصنيفات الأكثر بحثاً",en:"Trending categories"},"common.elements.most_searched":{ar:"المنتجات الأكثر بحثاً",en:"Trending products"},"common.elements.search_suggestions":{ar:"اقتراحات البحث",en:"Search suggestions"},"common.elements.categories":{ar:"التصنيفات",en:"Categories"},"common.elements.search_results":{ar:"نتائج البحث",en:"Search results"},"common.elements.search_view_all":{ar:'عرض كل النتائج لـ ":word"',en:'View all results for ":word"'}};function p(r){return salla.url.get("search?q="+encodeURI(r))}function m(r,e){const[t,s=""]=r.split("?"),a=new URLSearchParams(s);return a.set("_svs",e),`${t}?${a.toString()}`}function g(r){const e=l();salla.storage.set(e,r)}const w={trendingCategories:[],mostSearchedProducts:[]};let u=null;const b=class{constructor(e){r(this,e),this.hasTrackedFocus=!1,this.hasLoadedPopularSearches=!1,this.translationLoaded=!1,this.labels=h,this.loading=!1,this.typing=!1,this.debounce=setTimeout((()=>""),1e3),this.search_term="",this.hasInputValue=!1,this.searchHistory=function(){const r=l(),e=salla.storage.get(r,[]);return Array.isArray(e)?e.filter((r=>"string"==typeof r)):[]}(),this.trendingCategories=[],this.mostSearchedProducts=[],this.placeholder=!1,this.inline=!1,this.oval=!1,this.height=60,this.maxWords=5,this.showAction=!1,this.tracking={searchFocus:()=>{this.hasTrackedFocus||(this.hasTrackedFocus=!0,salla.event.emit("salla-search::input.focused"))},productClick:(r,e)=>{c.saveProductSource("search"),this.commitSearchHistory(this.search_term),salla.event.emit("salla-search::product.clicked",[{product:r,position:e}])},recommendationClick:(r,e)=>{salla.event.emit("salla-search::recommendation.clicked",{term:r,source:e})}},salla.event.on("search::open",(()=>this.open()))}async open(){this.hasLoadedPopularSearches||(this.hasLoadedPopularSearches=!0,function(){if(!u){const r=salla.search.popular().then((r=>({trendingCategories:(r?.data?.categories||[]).map((r=>({name:r.name,url:m(salla.url.create("categories",r.id),"search-trending")}))),mostSearchedProducts:(r?.data?.products||[]).map((r=>({name:r.name,url:m(salla.url.create("products",r.id),"search-trending")})))}))).catch((()=>(u=null,w)));u=r}return u}().then((({trendingCategories:r,mostSearchedProducts:e})=>{this.trendingCategories=r,this.mostSearchedProducts=e}))),await(this.modal?.open().then((()=>setTimeout((()=>this.searchInput?.focus()),300))))}handleModalVisibilityChanged(r){r.target!==this.modal||r.detail||this.onModalClose()}onModalClose(){this.searchInput&&(this.searchInput.value=""),this.results=void 0,this.search_term="",this.hasInputValue=!1,this.afterSearching()}handleKeyDown(r){if("Enter"!==r.key)return;const e=this.searchInput?.value??"";e.length<=2||(e!==this.search_term&&(clearTimeout(this.debounce),this.typing=!1,this.search_term=e),this.commitSearchHistory(e),this.searchInput&&(this.searchInput.value=""),this.hasInputValue=!1,setTimeout((()=>{window.location.href=p(e)}),100))}commitSearchHistory(r){r&&(this.searchHistory=function(r,e){const t=e.trim();if(!t)return r;const s=r.filter((r=>r.toLowerCase()!==t.toLowerCase()));return[t,...s].slice(0,10)}(this.searchHistory,r),g(this.searchHistory))}removeFromSearchHistory(r){this.searchHistory=this.searchHistory.filter((e=>e!==r)),g(this.searchHistory),this.afterSearching()}async componentWillLoad(){await salla.lang.onLoaded(),function(){if(!salla?.lang?.addBulk)return;const r=Object.entries(d).reduce(((r,[e,t])=>(salla.lang.get(e)===e&&(r[e]=t),r)),{});Object.keys(r).length&&salla.lang.addBulk(r)}(),this.labels={searchPlaceholder:salla.lang.get("blocks.header.search_placeholder"),noOptions:salla.lang.get("common.elements.no_options"),outOfStock:salla.lang.get("pages.products.out_of_stock"),close:salla.lang.get("common.elements.close"),back:salla.lang.get("common.elements.back"),remove:salla.lang.get("common.elements.remove"),searchHistory:salla.lang.get("common.elements.search_history"),trendingCategories:salla.lang.get("common.elements.trending_categories"),mostSearched:salla.lang.get("common.elements.most_searched"),searchSuggestions:salla.lang.get("common.elements.search_suggestions"),categories:salla.lang.get("common.elements.categories"),searchResults:salla.lang.get("common.elements.search_results"),searchViewAllTemplate:salla.lang.get("common.elements.search_view_all")},this.translationLoaded=!0}debounceSearch(r){this.typing=!0,clearTimeout(this.debounce),this.debounce=setTimeout((()=>{this.typing=!1,this.search_term=r.target.value}),700)}limitWordsAndSearch(r){let e=r.target.value;this.hasInputValue=e.length>0;const t=e.trim().split(/\s+/);if(t.length>this.maxWords){const r=t.slice(0,this.maxWords).join(" ");this.searchInput&&(this.searchInput.value=r)}this.debounceSearch(r)}getQueryParam(r){return new URLSearchParams(window.location.search).get(r)}handleActionClick(){if(this.search_term&&this.search_term.length>2)return this.search(this.search_term)}handleSearch(r){r.length>2?this.search(r):(this.results=void 0,this.afterSearching())}search(r){this.loading=!0,salla.product.fetch({source:"search",source_value:r}).then((e=>{this.results=e,salla.event.emit("Products Searched",{query:r,total:e.data?.length})})).catch((r=>"Query is same as previous one!"!==r?this.results=void 0:null)).finally((()=>this.afterSearching()))}afterSearching(){this.loading=!1,salla.product.api.previousQuery=""}renderCategoriesSection(r){return this.trendingCategories.length?e("div",null,e("p",{class:"s-search-idle-section-title"},r),e("div",{class:"s-search-idle-categories-list"},this.trendingCategories.map((r=>e("a",{class:"s-search-idle-category-chip",href:r.url,onClick:()=>this.tracking.recommendationClick(r.name,"category")},r.name,r.count?e("span",{class:"s-search-idle-category-count"},r.count):null))))):null}renderMostSearchedProductsSection(r,t){return this.mostSearchedProducts.length?e("div",null,e("p",{class:"s-search-idle-section-title"},r),e("ul",{class:"s-search-most-searched-list"},this.mostSearchedProducts.map((r=>e("li",null,e("a",{class:"s-search-most-searched-item",href:r.url,onClick:()=>this.tracking.recommendationClick(r.name,t)},e("span",{class:"s-search-most-searched-icon",innerHTML:s}),r.name)))))):null}renderSearchHistorySection(){return!this.searchHistory.length||this.hasInputValue?null:e("div",null,e("p",{class:"s-search-idle-section-title"},this.labels.searchHistory),e("div",{class:"s-search-history-list"},this.searchHistory.map((r=>e("span",{class:"s-search-history-chip"},e("a",{class:"s-search-history-chip-term",href:m(p(r),"history"),onClick:()=>{this.tracking.recommendationClick(r,"history")}},e("span",{class:"s-search-history-chip-icon",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="currentColor" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M3.49902 14.9656C4.72475 18.4791 8.06749 21 11.999 21C16.9696 21 20.999 16.9706 20.999 12C20.999 7.02944 16.9696 3 11.999 3C8.29827 3 4.8984 5.6756 3.68943 8.5"></path>\n <path d="M11.999 7V12L14.999 14"></path>\n <path d="M7.49751 8.74363C7.49751 8.74363 3.81388 9.3026 3.25487 8.7436C2.69585 8.1846 3.25488 4.50098 3.25488 4.50098"></path>\n</svg>\n'}),r),e("button",{type:"button",class:"s-search-history-chip-remove","aria-label":this.labels.remove,onClick:()=>this.removeFromSearchHistory(r)},e("span",{innerHTML:a})))))))}renderIdlePanel(){return e("div",{class:{"s-search-idle-panel":!0,"s-search-idle-panel-empty":!(this.searchHistory.length>0&&!this.hasInputValue||this.trendingCategories.length>0||this.mostSearchedProducts.length>0)}},this.renderSearchHistorySection(),this.renderCategoriesSection(this.labels.trendingCategories),this.renderMostSearchedProductsSection(this.labels.mostSearched,"trending"))}renderResultsBody(){return e("div",{class:"s-search-results-body"},null,e("div",{class:{"s-search-results-grid-wrap":!0,"s-search-results-grid-wrap-no-sidebar":!0}},e("p",{class:"s-search-idle-section-title"},this.labels.searchResults),e("div",{class:"s-search-results-grid"},this.results?.data.map(((r,t)=>e("div",{key:r.id,class:"s-search-grid-item",onClick:()=>this.tracking.productClick(r,t)},e("salla-search-product-card",{product:{...r,url:r.url+"?from=search-bar"},hideAddBtn:!0})))),0===this.results?.data.length?e("p",{class:"s-search-no-results-placeholder"},this.labels.noOptions):null)))}renderViewAllLink(){return this.results?.data.length?e("a",{class:"s-search-view-all",href:p(this.search_term),onClick:()=>this.commitSearchHistory(this.search_term)},this.labels.searchViewAllTemplate.replace(":word",this.search_term),e("span",{class:"s-search-view-all-icon",innerHTML:salla.config.get("theme.is_rtl",!0)?i:o})):null}renderDropdown(){return this.results?this.renderResultsBody():this.renderIdlePanel()}renderInputWrapper(){const r=e("div",{class:"s-search-input-wrapper"},e("span",{class:"s-search-icon-wrap"},e("span",{class:"s-search-icon",innerHTML:this.loading?'<i class="s-search-spinner-loader"/>':s})),e("input",{type:"search",enterkeyhint:"search",autocomplete:"off",class:"s-search-input",placeholder:this.labels.searchPlaceholder,onInput:r=>this.limitWordsAndSearch(r),onKeyDown:r=>this.handleKeyDown(r),onFocus:()=>this.tracking.searchFocus(),ref:r=>this.searchInput=r,style:{height:this.height+"px",borderRadius:this.oval?this.height/2+"px":""}}),this.showAction?e("salla-button",{loading:this.loading,class:{"s-search-action":!0,"s-search-action-oval":this.oval},onClick:()=>this.handleActionClick()},!this.loading&&e("span",{innerHTML:s})):null);return e("div",{class:"s-search-input-row"},e("button",{type:"button",class:"s-search-back-btn","aria-label":this.labels.back,onClick:()=>this.modal?.close()},e("span",{innerHTML:salla.config.get("theme.is_rtl",!0)?o:i})),r)}renderPlaceholderTrigger(){return e("div",{class:"s-search-input-wrapper"},e("span",{class:"s-search-icon-wrap"},e("span",{class:"s-search-icon",innerHTML:s})),e("button",{type:"button",class:"s-search-input s-search-placeholder-trigger",onClick:()=>this.open(),style:{height:this.height+"px",borderRadius:this.oval?this.height/2+"px":""}},this.labels.searchPlaceholder))}renderInlineTrigger(){return e("div",{class:"s-search-input-wrapper"},e("span",{class:"s-search-icon-wrap"},e("span",{class:"s-search-icon",innerHTML:s})),e("input",{type:"search",readOnly:!0,class:"s-search-input s-search-placeholder-trigger",placeholder:this.labels.searchPlaceholder,onFocus:()=>this.open(),style:{height:this.height+"px",borderRadius:this.oval?this.height/2+"px":""}}))}renderModal(){return e("salla-modal",{position:"top",class:"s-search-modal s-search-modal-new","hide-close-button":!0,ref:r=>this.modal=r},e("div",{class:"s-search-panel"},this.renderInputWrapper(),this.renderDropdown(),this.renderViewAllLink()))}render(){return this.placeholder?e("div",{class:"s-search-placeholder-wrapper s-search-placeholder-wrapper-new s-search-inline"},this.renderPlaceholderTrigger(),this.renderModal()):this.inline?e("div",{class:"s-search-placeholder-wrapper s-search-placeholder-wrapper-new s-search-inline"},this.renderInlineTrigger(),this.renderModal()):this.renderModal()}componentDidLoad(){this.afterSearching()}get host(){return t(this)}static get watchers(){return{search_term:["handleSearch"]}}};b.style='/*!twlt*/.s-search-placeholder-wrapper{position:relative;display:inline-block}.s-search-placeholder-wrapper-new{display:block;width:100%}.s-search-input-wrapper{position:relative}.s-search-placeholder-trigger{cursor:pointer;appearance:none;text-align:start}.s-search-divider{border:none;border-top:1px solid #F3F4F6;margin:0.25rem 0}.visible{visibility:visible}.inline{display:inline}.hidden{display:none}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-search-container{position:relative;z-index:99;max-height:14rem;border-radius:0.375rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-search-oval{border-radius:20px}.s-search-inline{min-width:220px}.s-search-container-open{max-height:24rem;border-radius:0px !important}.s-search-container-open .s-search-input{border-top-left-radius:0.375rem !important;border-top-right-radius:0.375rem !important;border-bottom-right-radius:0px !important;border-bottom-left-radius:0px !important;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-search-no-results .s-search-input{border-bottom-right-radius:0px;border-bottom-left-radius:0px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-search-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-top:0px;padding-bottom:0.125rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-search-input:focus{--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-ring-color:transparent}.s-search-input:where([dir="ltr"],[dir="ltr"] *){padding-left:2.5rem}.s-search-input:where([dir="rtl"],[dir="rtl"] *){padding-right:2.5rem}.s-search-input:focus{outline:2px solid transparent !important;outline-offset:2px !important;box-shadow:none !important;border-color:#e5e7eb !important}.s-search-modal-new .s-search-input{--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-search-icon-wrap{position:absolute;top:50%;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));line-height:1;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-icon-wrap:where([dir="ltr"],[dir="ltr"] *){left:1rem}.s-search-icon-wrap:where([dir="rtl"],[dir="rtl"] *){right:1rem}.s-search-icon svg{height:1rem;width:1rem;fill:#9ca3af}.s-search-spinner-loader{display:block;height:1rem;width:1rem}@keyframes spin{to{transform:rotate(360deg)}}.s-search-spinner-loader{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));border-right-color:var(--color-primary)}.s-search-results{position:absolute;margin:auto;max-height:24rem;width:100%;max-width:100%;overflow-y:auto;border-bottom-right-radius:0.375rem;border-bottom-left-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-search-no-results{border-bottom-right-radius:0px !important;border-bottom-left-radius:0px !important}.s-search-no-results-placeholder{grid-column:1 / -1;padding:1rem;text-align:center;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-product{display:flex;height:100%;justify-content:space-around;overflow:hidden;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));background-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-search-product:last-child{border-bottom-width:0px}.s-search-product:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}@media (min-width: 480px){.s-search-product{padding-left:1.25rem;padding-right:1.25rem}}.s-search-product-image-container{position:relative;height:3.5rem;width:5rem;overflow:hidden;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-search-product-image{position:relative;height:100%;width:100%;object-fit:cover;font-size:0px}.s-search-product-image::before{position:absolute;top:0px;left:0px;height:100%;width:100%;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-search-product-details{flex:1 1 0%;padding-top:0.25rem}.s-search-product-details:where([dir="ltr"],[dir="ltr"] *){padding-left:1rem}@media (min-width: 480px){.s-search-product-details:where([dir="ltr"],[dir="ltr"] *){padding-left:1.25rem}}.s-search-product-details:where([dir="rtl"],[dir="rtl"] *){padding-right:1rem}@media (min-width: 480px){.s-search-product-details:where([dir="rtl"],[dir="rtl"] *){padding-right:1.25rem}}.s-search-product-title{margin-bottom:0.375rem;display:flex;flex-direction:column;align-items:baseline;justify-content:flex-start;font-size:0.875rem;font-weight:700;line-height:1.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-product-price{display:flex;width:100%;align-items:center;font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary)}.s-search-product-regular-price{padding-left:0.75rem;padding-right:0.75rem;font-weight:500;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-search-product-not-available{--tw-grayscale:grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-search-action{position:absolute;height:100%}.s-search-action:where([dir="ltr"],[dir="ltr"] *){right:0px}.s-search-action:where([dir="rtl"],[dir="rtl"] *){left:0px;border-top-right-radius:0px;border-bottom-right-radius:0px}.s-search-action-oval:where([dir="ltr"],[dir="ltr"] *){border-top-right-radius:9999px;border-bottom-right-radius:9999px}.s-search-action-oval:where([dir="rtl"],[dir="rtl"] *){border-top-left-radius:9999px;border-bottom-left-radius:9999px}.s-search-input-row{margin:1rem;display:flex;align-items:center}.s-search-back-btn{display:flex;flex-shrink:0;align-items:center;justify-content:center;padding:0.25rem;line-height:1;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-search-back-btn:hover{--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.s-search-back-btn{display:none}}.s-search-back-btn svg{height:1.5rem;width:1.5rem;fill:#6b7280}.s-search-input-wrapper{position:relative;display:flex;flex-grow:1;align-items:center}.s-search-panel{display:flex;height:100%;flex-direction:column}.s-search-results-body{display:flex;min-height:0px;flex:1 1 0%;flex-direction:column;gap:0.75rem;overflow:hidden;--tw-shadow:0 -4px 6px -4px rgba(0,0,0,0.1);--tw-shadow-colored:0 -4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}@media (min-width: 640px){.s-search-results-body{flex-direction:row}}.s-search-results-grid-wrap{min-height:0px;min-width:0px;flex:1 1 0%;overflow-y:auto}@media (min-width: 640px){.s-search-results-grid-wrap{max-height:24rem !important}}.s-search-results-grid-wrap-no-sidebar{padding-left:1rem;padding-right:1rem}@media (min-width: 640px){.s-search-results-grid-wrap-no-sidebar{padding-left:1.25rem;padding-right:1.25rem}}.s-search-results-grid{display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));align-content:flex-start;column-gap:0.75rem;row-gap:0.25rem}@media (min-width: 640px){.s-search-results-grid{grid-template-columns:repeat(2, minmax(0, 1fr))}}@media (min-width: 1024px){.s-search-results-grid{grid-template-columns:repeat(3, minmax(0, 1fr))}}.s-search-grid-item{cursor:pointer;border-radius:0.375rem;padding:0.25rem;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-search-grid-item:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-search-grid-item .s-product-card-out-badge{--tw-bg-opacity:1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1));--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-search-view-all{display:flex;flex-shrink:0;align-items:center;justify-content:center;gap:0.25rem;border-top-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding:0.75rem;text-align:center;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-search-view-all:hover{text-decoration-line:underline}.s-search-view-all-icon{line-height:1}.s-search-view-all-icon svg{height:1rem;width:1rem;fill:#6b7280}.s-search-sidebar{max-height:none;width:100%;flex-shrink:0}.s-search-sidebar>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.s-search-sidebar{padding:0.5rem}@media (min-width: 640px){.s-search-sidebar{max-height:24rem !important;width:16rem;overflow-y:auto !important;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding:0.75rem}}@media (min-width: 480px){.s-search-sidebar{width:13rem}}.s-search-sidebar:where([dir="ltr"],[dir="ltr"] *){--tw-shadow:4px 0 6px -4px rgba(0,0,0,0.1);--tw-shadow-colored:4px 0 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-search-sidebar:where([dir="rtl"],[dir="rtl"] *){--tw-shadow:-4px 0 6px -4px rgba(0,0,0,0.1);--tw-shadow-colored:-4px 0 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-search-idle-panel{min-height:6rem}.s-search-idle-panel>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.s-search-idle-panel{overflow-y:auto;padding:1rem;padding-top:0px;--tw-shadow:0 -4px 6px -4px rgba(0,0,0,0.1);--tw-shadow-colored:0 -4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-search-idle-panel-empty{max-height:none !important;min-height:0px !important;padding:0px !important;--tw-shadow:0 0 #0000 !important;--tw-shadow-colored:0 0 #0000 !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important}.s-search-idle-section-title{margin-bottom:0.5rem;margin-top:0.5rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-history-list{display:flex;flex-wrap:wrap;gap:0.5rem}.s-search-history-chip{display:inline-flex;align-items:center;gap:0.375rem;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding-top:0.375rem;padding-bottom:0.375rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-history-chip:hover{background-color:color-mix(in srgb,var(--color-primary) 10%,transparent)}.s-search-history-chip:where([dir="ltr"],[dir="ltr"] *){padding-left:0.75rem;padding-right:0.5rem}.s-search-history-chip:where([dir="rtl"],[dir="rtl"] *){padding-right:0.75rem;padding-left:0.5rem}.s-search-history-chip-term{display:inline-flex;align-items:center;gap:0.25rem;line-height:1}.s-search-history-chip:hover .s-search-history-chip-term{color:var(--color-primary)}.s-search-history-chip-icon svg{height:0.875rem;width:0.875rem}.s-search-history-chip-remove svg{height:0.625rem;width:0.625rem;fill:#9ca3af}.s-search-idle-categories-list{display:flex;flex-wrap:wrap;gap:0.5rem}.s-search-idle-category-chip{display:inline-flex;align-items:center;gap:0.25rem;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding-left:0.75rem;padding-right:0.75rem;padding-top:0.375rem;padding-bottom:0.375rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-idle-category-chip:hover{background-color:color-mix(in srgb,var(--color-primary) 10%,transparent);color:var(--color-primary)}.s-search-sidebar .s-search-idle-category-chip{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-search-idle-category-count{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-search-most-searched-list{display:flex;flex-direction:column}.s-search-most-searched-item{display:flex;width:100%;align-items:center;gap:0.5rem;padding-top:0.375rem;padding-bottom:0.375rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-search-most-searched-item:hover{color:var(--color-primary)}.s-search-most-searched-icon svg{height:0.875rem;width:0.875rem;fill:#9ca3af}@media (min-width: 640px){.s-search-modal .s-modal-wrapper{align-items:flex-start;padding:0}.s-search-modal .s-modal-spacer{display:inline}.s-search-modal .s-modal-body{padding:0;width:700px;max-width:90%;margin-top:3.2rem;border-radius:0.5rem;overflow:visible;position:relative !important}}.s-search-modal .s-modal-close{top:50%;transform:translateY(-50%)}@media (max-width: 639px){.s-search-modal .s-modal-body .s-search-results{position:static;margin-top:0}.s-search-modal.s-search-modal-new .s-modal-body{height:100dvh;max-height:100dvh !important}}@media (min-width: 640px){.s-search-modal.s-search-modal-new .s-modal-body{background:var(--color-surface, #fff);overflow:hidden;width:1100px;max-width:95%}}.s-search-product-card-out-of-stock img.loaded{--tw-grayscale:grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-search-product-card-image img.loaded{position:relative;opacity:1}';export{b as salla_search}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as s,H as r}from"./p-BTR557QH.js";const t=class{constructor(s){e(this,s),this.dark=!1,this.commercialRegisterLabel="",this.freelanceLabel=""}componentWillLoad(){this.initializeTranslations()}isVisibilityEnforced(){return"SA"===salla.config.get("store.store_country")}initializeTranslations(){salla.lang.onLoaded((()=>{const e=(e,s,r)=>{salla.helpers.setNested(salla.lang.messages[e],s,r)};e("ar.trans","blocks.footer.commercial_register","السجل التجاري"),e("en.trans","blocks.footer.commercial_register","Commercial Register"),e("ar.trans","blocks.footer.freelance","وثيقة العمل الحر"),e("en.trans","blocks.footer.freelance","Freelance Certificate"),this.commercialRegisterLabel=salla.lang.getWithDefault("blocks.footer.commercial_register","السجل التجاري"),this.freelanceLabel=salla.lang.getWithDefault("blocks.footer.freelance","وثيقة العمل الحر")}))}getBadgeData(){const e=salla.config.get("store.settings.commercial_number"),s=salla.config.get("store.settings.freelance_number");return e?{number:e,label:this.commercialRegisterLabel||"السجل التجاري",imageUrl:salla.url.cdn("images/commercial-register.png",70,70),type:"commercial"}:s?{number:s,label:this.freelanceLabel||"وثيقة العمل الحر",imageUrl:this.dark?salla.url.cdn("images/freelance-white.png"):salla.url.cdn("images/freelance.png"),type:"freelance"}:null}render(){const e=this.getBadgeData();return e?s(r,{class:"s-trust-badges-wrapper "+(this.dark?"dark":"")},this.isVisibilityEnforced()?s("img",{class:"s-trust-badges-image",width:"55",height:"55",src:e.imageUrl,alt:e.label}):null,s("div",{class:"s-trust-badges-content"},s("p",{class:"s-trust-badges-label"},e.label),s("b",{class:"s-trust-badges-number"},e.number))):null}};t.style='/*!twlt*/.s-trust-badges-wrapper{display:flex;align-items:center}.s-trust-badges-wrapper>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}.s-trust-badges-wrapper:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-trust-badges-label{margin-bottom:0.25rem;font-size:0.875rem;line-height:1.25rem}.s-trust-badges-number{font-size:0.875rem;line-height:1.25rem}';export{t as salla_trust_badges}
4
+ import{r as e,h as s,H as r}from"./p-BnDYuqv2.js";const t=class{constructor(s){e(this,s),this.dark=!1,this.commercialRegisterLabel="",this.freelanceLabel=""}componentWillLoad(){this.initializeTranslations()}isVisibilityEnforced(){return"SA"===salla.config.get("store.store_country")}initializeTranslations(){salla.lang.onLoaded((()=>{const e=(e,s,r)=>{salla.helpers.setNested(salla.lang.messages[e],s,r)};e("ar.trans","blocks.footer.commercial_register","السجل التجاري"),e("en.trans","blocks.footer.commercial_register","Commercial Register"),e("ar.trans","blocks.footer.freelance","وثيقة العمل الحر"),e("en.trans","blocks.footer.freelance","Freelance Certificate"),this.commercialRegisterLabel=salla.lang.getWithDefault("blocks.footer.commercial_register","السجل التجاري"),this.freelanceLabel=salla.lang.getWithDefault("blocks.footer.freelance","وثيقة العمل الحر")}))}getBadgeData(){const e=salla.config.get("store.settings.commercial_number"),s=salla.config.get("store.settings.freelance_number");return e?{number:e,label:this.commercialRegisterLabel||"السجل التجاري",imageUrl:salla.url.cdn("images/commercial-register.png",70,70),type:"commercial"}:s?{number:s,label:this.freelanceLabel||"وثيقة العمل الحر",imageUrl:this.dark?salla.url.cdn("images/freelance-white.png"):salla.url.cdn("images/freelance.png"),type:"freelance"}:null}render(){const e=this.getBadgeData();return e?s(r,{class:"s-trust-badges-wrapper "+(this.dark?"dark":"")},this.isVisibilityEnforced()?s("img",{class:"s-trust-badges-image",width:"55",height:"55",src:e.imageUrl,alt:e.label}):null,s("div",{class:"s-trust-badges-content"},s("p",{class:"s-trust-badges-label"},e.label),s("b",{class:"s-trust-badges-number"},e.number))):null}};t.style='/*!twlt*/.s-trust-badges-wrapper{display:flex;align-items:center}.s-trust-badges-wrapper>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}.s-trust-badges-wrapper:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-trust-badges-label{margin-bottom:0.25rem;font-size:0.875rem;line-height:1.25rem}.s-trust-badges-number{font-size:0.875rem;line-height:1.25rem}';export{t as salla_trust_badges}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as s,H as r,a as i}from"./p-BTR557QH.js";import{H as e}from"./p-Brgf4SAC.js";import"./p-CgtvEd63.js";const a=class{constructor(s){t(this,s),this.productCardComponent="custom-salla-product-card",this.apiUrl="",this.requestId=null,this.onWishlistStorageSynced=()=>e.syncWishlistIcons(this.host,`${this.productCardComponent}, salla-product-card`)}componentWillLoad(){return salla.onReady().then((async()=>{if(this.includes=e.parseJson(this.includes||this.host.getAttribute("includes")),Array.isArray(this.includes)||(this.includes=null),e.setIncludes(this.includes),this.sourceValueIsValid=!(!this.getSourceValue()&&!this.isSourceWithoutValue()),this.sourceValueIsValid){if(this.hasCustomComponent=!!customElements.get(this.productCardComponent),"json"===this.source)return this.productsData=await this.applyBeforeAppendItems(this.getSourceValue()),void(this.isReady=!0);if("related"!=this.getSource()||salla.config.get("store.settings.product.related_products_enabled"))return"related"===this.getSource()&&salla.config.get("store.settings.product.related_products_enabled")&&"random"===salla.config.get("store.settings.product.product-recommendation-type")&&salla.config.get("store.features")?.includes("ai-driven-personalized-product")&&(this.sourceValue=await salla.recommendations.similarProducts(this.sourceValue,{limit:this.limit||12}).extractProductIds(),this.source="selected"),salla.api.withoutNotifier((()=>salla.product.api.fetch({source:e.getApiSource(this.getSource()),source_value:this.getSourceValue(),limit:this.limit}))).then((t=>e.injectExtraFieldsToResponse(t))).then((async t=>{t._requestId&&(this.requestId=t._requestId),this.productsData=await this.applyBeforeAppendItems(t.data),this.isReady=!0,t.source=this.getSource(),t.sourceValue=this.getSourceValue(),salla.event.emit("salla-products-slider::products.fetched",this.productsData)}));this.isReady=!1}else salla.logger.warn(`source-value prop is required for source [${this.getSource()}]`)}))}componentDidRender(){let t=0;const s=setInterval((()=>{this.host.querySelectorAll('[loading="lazy"]')?.forEach((t=>t.removeAttribute("loading"))),t++,t>=10&&clearInterval(s)}),1e3)}connectedCallback(){salla.event.on("wishlist::storage.synced",this.onWishlistStorageSynced)}disconnectedCallback(){salla.event.off("wishlist::storage.synced",this.onWishlistStorageSynced)}async componentDidLoad(){await Salla.hooks.registerComponent("salla-products-slider",this)}onReadyChanged(t){t&&salla.wishlist.api.syncStorageFromServer()}isSourceWithoutValue(){return["offers","latest","sales","top-rated"].includes(this.getSource())}getItemHTML(t){const r="landing-page"===this.getSource();r&&(t.url="");const i=r?void 0:()=>{e.saveProductSource(this.getSource()),e.saveProductPosition(t.position),e.saveRequestId(this.requestId)};if(this.hasCustomComponent&&"custom-salla-product-card"==this.productCardComponent.toLowerCase())return s("div",{class:"s-products-slider-card",onClick:i},s("custom-salla-product-card",{product:t,source:this.getSource(),"source-value":this.getSourceValue()}));if(this.hasCustomComponent){const r=document.createElement(this.productCardComponent);return r.setAttribute("product",JSON.stringify(t)),r.setAttribute("source",this.getSource()),r.setAttribute("source-value",this.getSourceValue()),s("div",{class:"s-products-slider-card",onClick:i,innerHTML:r.outerHTML})}return s("div",{class:"s-products-slider-card",onClick:i},s("salla-product-card",{"show-quantity":r,"hide-add-btn":r,"shadow-on-hover":!0,product:t}))}canRender(){return this.sourceValueIsValid&&this.isReady}getSource(){return e.getProductsSource(this.source)}getSourceValue(){return e.getProductsSourceValue(this.source,this.sourceValue)}async applyBeforeAppendItems(t){const s=Array.isArray(t)?t:[],r={component:this,items:s};try{return await salla.hooks.call("salla-products-slider","beforeAppendItems",r),Array.isArray(r.items)?r.items:s}catch{return s}}render(){if(this.canRender())return s(r,{class:"s-products-slider-wrapper"},s("salla-slider",{class:"s-products-slider-slider",id:this.sliderId||`s-products-slider-${Math.random().toString(36).substr(2,9)}`,...this.sliderProps||{},"auto-play":this.autoplay,type:"carousel","block-title":this.blockTitle,"block-subTitle":this.subTitle,"display-all-url":this.displayAllUrl,sliderConfig:this.sliderConfig?this.sliderConfig:null},s("div",{slot:"items"},this.productsData?.map((t=>this.getItemHTML(t))))))}get host(){return i(this)}static get watchers(){return{isReady:["onReadyChanged"]}}};a.style='/*!twlt*/.block{display:block}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-products-slider-wrapper{margin-bottom:2rem}@media (min-width: 768px){.s-products-slider-wrapper{margin-bottom:5rem}}@media (min-width: 1024px){.s-products-slider-wrapper{overflow:hidden}}.s-products-slider-wrapper:where([dir="ltr"],[dir="ltr"] *){padding-right:0px}.s-products-slider-wrapper:where([dir="rtl"],[dir="rtl"] *){padding-left:0px}.s-products-slider-card{height:auto !important;width:100%;max-width:250px;padding-left:0.5rem;padding-right:0.5rem}@media (min-width: 640px){.s-products-slider-card{width:50%;max-width:320px}}@media (min-width: 768px){.s-products-slider-card{width:33.333333%}}@media (min-width: 1024px){.s-products-slider-card{width:25%}}';export{a as salla_products_slider}
4
+ import{r as t,h as s,H as r,a as i}from"./p-BnDYuqv2.js";import{H as e}from"./p-Brgf4SAC.js";import"./p-CgtvEd63.js";const a=class{constructor(s){t(this,s),this.productCardComponent="custom-salla-product-card",this.apiUrl="",this.requestId=null,this.onWishlistStorageSynced=()=>e.syncWishlistIcons(this.host,`${this.productCardComponent}, salla-product-card`)}componentWillLoad(){return salla.onReady().then((async()=>{if(this.includes=e.parseJson(this.includes||this.host.getAttribute("includes")),Array.isArray(this.includes)||(this.includes=null),e.setIncludes(this.includes),this.sourceValueIsValid=!(!this.getSourceValue()&&!this.isSourceWithoutValue()),this.sourceValueIsValid){if(this.hasCustomComponent=!!customElements.get(this.productCardComponent),"json"===this.source)return this.productsData=await this.applyBeforeAppendItems(this.getSourceValue()),void(this.isReady=!0);if("related"!=this.getSource()||salla.config.get("store.settings.product.related_products_enabled"))return"related"===this.getSource()&&salla.config.get("store.settings.product.related_products_enabled")&&"random"===salla.config.get("store.settings.product.product-recommendation-type")&&salla.config.get("store.features")?.includes("ai-driven-personalized-product")&&(this.sourceValue=await salla.recommendations.similarProducts(this.sourceValue,{limit:this.limit||12}).extractProductIds(),this.source="selected"),salla.api.withoutNotifier((()=>salla.product.api.fetch({source:e.getApiSource(this.getSource()),source_value:this.getSourceValue(),limit:this.limit}))).then((t=>e.injectExtraFieldsToResponse(t))).then((async t=>{t._requestId&&(this.requestId=t._requestId),this.productsData=await this.applyBeforeAppendItems(t.data),this.isReady=!0,t.source=this.getSource(),t.sourceValue=this.getSourceValue(),salla.event.emit("salla-products-slider::products.fetched",this.productsData)}));this.isReady=!1}else salla.logger.warn(`source-value prop is required for source [${this.getSource()}]`)}))}componentDidRender(){let t=0;const s=setInterval((()=>{this.host.querySelectorAll('[loading="lazy"]')?.forEach((t=>t.removeAttribute("loading"))),t++,t>=10&&clearInterval(s)}),1e3)}connectedCallback(){salla.event.on("wishlist::storage.synced",this.onWishlistStorageSynced)}disconnectedCallback(){salla.event.off("wishlist::storage.synced",this.onWishlistStorageSynced)}async componentDidLoad(){await Salla.hooks.registerComponent("salla-products-slider",this)}onReadyChanged(t){t&&salla.wishlist.api.syncStorageFromServer()}isSourceWithoutValue(){return["offers","latest","sales","top-rated"].includes(this.getSource())}getItemHTML(t){const r="landing-page"===this.getSource();r&&(t.url="");const i=r?void 0:()=>{e.saveProductSource(this.getSource()),e.saveProductPosition(t.position),e.saveRequestId(this.requestId)};if(this.hasCustomComponent&&"custom-salla-product-card"==this.productCardComponent.toLowerCase())return s("div",{class:"s-products-slider-card",onClick:i},s("custom-salla-product-card",{product:t,source:this.getSource(),"source-value":this.getSourceValue()}));if(this.hasCustomComponent){const r=document.createElement(this.productCardComponent);return r.setAttribute("product",JSON.stringify(t)),r.setAttribute("source",this.getSource()),r.setAttribute("source-value",this.getSourceValue()),s("div",{class:"s-products-slider-card",onClick:i,innerHTML:r.outerHTML})}return s("div",{class:"s-products-slider-card",onClick:i},s("salla-product-card",{"show-quantity":r,"hide-add-btn":r,"shadow-on-hover":!0,product:t}))}canRender(){return this.sourceValueIsValid&&this.isReady}getSource(){return e.getProductsSource(this.source)}getSourceValue(){return e.getProductsSourceValue(this.source,this.sourceValue)}async applyBeforeAppendItems(t){const s=Array.isArray(t)?t:[],r={component:this,items:s};try{return await salla.hooks.call("salla-products-slider","beforeAppendItems",r),Array.isArray(r.items)?r.items:s}catch{return s}}render(){if(this.canRender())return s(r,{class:"s-products-slider-wrapper"},s("salla-slider",{class:"s-products-slider-slider",id:this.sliderId||`s-products-slider-${Math.random().toString(36).substr(2,9)}`,...this.sliderProps||{},"auto-play":this.autoplay,type:"carousel","block-title":this.blockTitle,"block-subTitle":this.subTitle,"display-all-url":this.displayAllUrl,sliderConfig:this.sliderConfig?this.sliderConfig:null},s("div",{slot:"items"},this.productsData?.map((t=>this.getItemHTML(t))))))}get host(){return i(this)}static get watchers(){return{isReady:["onReadyChanged"]}}};a.style='/*!twlt*/.block{display:block}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-products-slider-wrapper{margin-bottom:2rem}@media (min-width: 768px){.s-products-slider-wrapper{margin-bottom:5rem}}@media (min-width: 1024px){.s-products-slider-wrapper{overflow:hidden}}.s-products-slider-wrapper:where([dir="ltr"],[dir="ltr"] *){padding-right:0px}.s-products-slider-wrapper:where([dir="rtl"],[dir="rtl"] *){padding-left:0px}.s-products-slider-card{height:auto !important;width:100%;max-width:250px;padding-left:0.5rem;padding-right:0.5rem}@media (min-width: 640px){.s-products-slider-card{width:50%;max-width:320px}}@media (min-width: 768px){.s-products-slider-card{width:33.333333%}}@media (min-width: 1024px){.s-products-slider-card{width:25%}}';export{a as salla_products_slider}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as s,H as i,a as e}from"./p-BTR557QH.js";import{W as n}from"./p-CgR-T_ZS.js";import{M as a}from"./p-DmgxDvXL.js";const o=class{constructor(s){t(this,s),this.contacts=salla.config.get("store.contacts"),this.iconsList={mobile:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',whatsapp:n,phone:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n',telegram:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n',email:a},this.contactSlot=this.host.querySelector('[slot="contact"]')?.innerHTML||`<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>${!this.iconsOnly&&"<span class='unicode'>{value}</span>"}</a>`,salla.onReady((()=>{this.contacts=salla.config.get("store.contacts")})),salla.lang.onLoaded((()=>{this.contactsTitle=this.contactsTitle||salla.lang.get("blocks.footer.social")}))}getContactsArray(){return Object.entries(this.contacts).filter((([t,s])=>""!==s)).map((([t,s])=>({type:t,value:s})))}getContactLink(t){const s=this.contacts[t];switch(t){case"phone":case"mobile":return`tel:${s}`;case"whatsapp":const t=(s||"").toString().replace(/[^\d]/g,"");return t?`https://wa.me/${t}`:salla.url.get("whatsapp/send");case"email":return`mailto:${s}`;case"telegram":return s.startsWith("https://t.me/")?s:`https://t.me/${s}`;default:return s}}getContactIcon(t){return this.iconsList[t]}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}render(){const t=this.getContactsArray();if(t&&0!=t.length)return this.isHeader?s(i,{class:"s-contacts s-contacts-header"},t.filter((t=>"phone"==t.type||"email"==t.type)).map(((t,i)=>s("a",{href:this.getContactLink(t.type),key:i,class:"s-contacts-topnav-link"},"email"===t.type?t.value:[s("span",null,this.contactsTitle,": "),s("span",{class:"unicode"},t.value)])))):s(i,{class:"s-contacts"},!this.hideTitle&&s("h3",{class:"s-contacts-title"},this.contactsTitle),s("div",{class:{"s-contacts-list":!0,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},t.map(((t,i)=>s("div",{key:i,id:"contact-slot",innerHTML:this.contactSlot.replace(/\{icon\}/g,this.getContactIcon(t.type)).replace(/\{value\}/g,t.value.toString()).replace(/\{link\}/g,this.getContactLink(t.type))})))))}componentDidRender(){this.host.querySelector('[slot="contact"]')?.remove()}get host(){return e(this)}};o.style='/*!twlt*/.unicode{unicode-bidi:plaintext}.block{display:block}.contents{display:contents}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-contacts-title{margin-bottom:0.75rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}@media (min-width: 1024px){.s-contacts-title{margin-bottom:1.25rem}}.s-contacts-header{display:none;align-items:center}@media (min-width: 1024px){.s-contacts-header{display:flex}}.s-contacts-topnav-link{display:inline-block;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1px;padding-bottom:1px;font-size:0.875rem;line-height:1.25rem;line-height:1;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-contacts-topnav-link:hover{opacity:0.8}.s-contacts-topnav-link:where([dir="ltr"],[dir="ltr"] *){border-right-width:1px}.s-contacts-topnav-link:last-child:where([dir="ltr"],[dir="ltr"] *){border-width:0px;padding-right:0px}.s-contacts-topnav-link:where([dir="rtl"],[dir="rtl"] *){border-left-width:1px}.s-contacts-topnav-link:last-child:where([dir="rtl"],[dir="rtl"] *){border-width:0px;padding-left:0px}.s-contacts-item{display:flex;align-items:center;font-size:0.875rem;line-height:1.25rem;line-height:1}.s-contacts-icon{display:flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;border-width:1px}.s-contacts-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.625rem}.s-contacts-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.625rem}.s-contacts-icon svg{height:0.875rem;width:0.875rem;fill:currentColor}.s-contacts-list{display:flex;gap:1rem}.s-contacts-list-horizontal{align-items:center}.s-contacts-list-vertical{flex-direction:column}.s-contacts-list-icons-only .s-contacts-icon{margin-left:0px;margin-right:0px}';export{o as salla_contacts}
4
+ import{r as t,h as s,H as i,a as e}from"./p-BnDYuqv2.js";import{W as n}from"./p-CgR-T_ZS.js";import{M as a}from"./p-DmgxDvXL.js";const o=class{constructor(s){t(this,s),this.contacts=salla.config.get("store.contacts"),this.iconsList={mobile:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',whatsapp:n,phone:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n',telegram:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n',email:a},this.contactSlot=this.host.querySelector('[slot="contact"]')?.innerHTML||`<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>${!this.iconsOnly&&"<span class='unicode'>{value}</span>"}</a>`,salla.onReady((()=>{this.contacts=salla.config.get("store.contacts")})),salla.lang.onLoaded((()=>{this.contactsTitle=this.contactsTitle||salla.lang.get("blocks.footer.social")}))}getContactsArray(){return Object.entries(this.contacts).filter((([t,s])=>""!==s)).map((([t,s])=>({type:t,value:s})))}getContactLink(t){const s=this.contacts[t];switch(t){case"phone":case"mobile":return`tel:${s}`;case"whatsapp":const t=(s||"").toString().replace(/[^\d]/g,"");return t?`https://wa.me/${t}`:salla.url.get("whatsapp/send");case"email":return`mailto:${s}`;case"telegram":return s.startsWith("https://t.me/")?s:`https://t.me/${s}`;default:return s}}getContactIcon(t){return this.iconsList[t]}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}render(){const t=this.getContactsArray();if(t&&0!=t.length)return this.isHeader?s(i,{class:"s-contacts s-contacts-header"},t.filter((t=>"phone"==t.type||"email"==t.type)).map(((t,i)=>s("a",{href:this.getContactLink(t.type),key:i,class:"s-contacts-topnav-link"},"email"===t.type?t.value:[s("span",null,this.contactsTitle,": "),s("span",{class:"unicode"},t.value)])))):s(i,{class:"s-contacts"},!this.hideTitle&&s("h3",{class:"s-contacts-title"},this.contactsTitle),s("div",{class:{"s-contacts-list":!0,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},t.map(((t,i)=>s("div",{key:i,id:"contact-slot",innerHTML:this.contactSlot.replace(/\{icon\}/g,this.getContactIcon(t.type)).replace(/\{value\}/g,t.value.toString()).replace(/\{link\}/g,this.getContactLink(t.type))})))))}componentDidRender(){this.host.querySelector('[slot="contact"]')?.remove()}get host(){return e(this)}};o.style='/*!twlt*/.unicode{unicode-bidi:plaintext}.block{display:block}.contents{display:contents}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-contacts-title{margin-bottom:0.75rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}@media (min-width: 1024px){.s-contacts-title{margin-bottom:1.25rem}}.s-contacts-header{display:none;align-items:center}@media (min-width: 1024px){.s-contacts-header{display:flex}}.s-contacts-topnav-link{display:inline-block;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1px;padding-bottom:1px;font-size:0.875rem;line-height:1.25rem;line-height:1;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-contacts-topnav-link:hover{opacity:0.8}.s-contacts-topnav-link:where([dir="ltr"],[dir="ltr"] *){border-right-width:1px}.s-contacts-topnav-link:last-child:where([dir="ltr"],[dir="ltr"] *){border-width:0px;padding-right:0px}.s-contacts-topnav-link:where([dir="rtl"],[dir="rtl"] *){border-left-width:1px}.s-contacts-topnav-link:last-child:where([dir="rtl"],[dir="rtl"] *){border-width:0px;padding-left:0px}.s-contacts-item{display:flex;align-items:center;font-size:0.875rem;line-height:1.25rem;line-height:1}.s-contacts-icon{display:flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;border-width:1px}.s-contacts-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.625rem}.s-contacts-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.625rem}.s-contacts-icon svg{height:0.875rem;width:0.875rem;fill:currentColor}.s-contacts-list{display:flex;gap:1rem}.s-contacts-list-horizontal{align-items:center}.s-contacts-list-vertical{flex-direction:column}.s-contacts-list-icons-only .s-contacts-icon{margin-left:0px;margin-right:0px}';export{o as salla_contacts}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as e,H as a}from"./p-BTR557QH.js";const r=class{constructor(e){t(this,e),this.transactionsArray=[],this.isLoading=!1,this.nextPageUrl="",this.requestSeq=0,this.handleClick=()=>{this.isLoading||this.loadMoreTransactions()},this.handleGiftCardRedeemed=()=>{this.loadTransactions()}}componentWillLoad(){return salla.onReady().then((()=>this.loadTransactions()))}normalizeTransactions(t){if(Array.isArray(t))return{list:t,nextPageUrl:""};const e=t?.current_page??1,a=e<(t?.last_page??e)?`/balance/wallet?per_page=${t?.per_page??10}&page=${e+1}`:"";return{list:t?.data??[],nextPageUrl:a}}loadTransactions(){return this.fetchTransactions("/balance/wallet?per_page=10&page=1",!1)}loadMoreTransactions(){return this.fetchTransactions(this.nextPageUrl||"/balance/wallet?page=2&per_page=10",!0)}async fetchTransactions(t,e){const a=++this.requestSeq;this.isLoading=!0;try{const r=await salla.api.request(t);if(a!==this.requestSeq)return;const{list:l,nextPageUrl:i}=this.normalizeTransactions(r.data.transactions);this.nextPageUrl=i,this.transactionsArray=e?[...this.transactionsArray,...l]:l,this.balance=r.data.balance}catch(t){if(a!==this.requestSeq)return;console.error("Error loading wallet transactions",t)}finally{a===this.requestSeq&&(this.isLoading=!1)}}formatDate(t){return t?new Date(1e3*t).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"}):""}renderCell(t,a){return e("td",{class:"s-wallet-table-tbody-tr-td"},e("div",{class:"s-wallet-table-tbody-tr-td-content"},e("span",{class:"s-wallet-mobile-title"},salla.lang.get(`pages.wallet.${t}`),":"),a))}isCredit(t){return"debit"!==t.transaction_type}renderSummary(){return e("div",{class:"s-wallet-summary"},e("div",{class:"s-wallet-balance-card"},e("span",{class:"s-wallet-balance-mark"},e("i",{class:"sicon-wallet","aria-hidden":"true"})),e("div",{class:"s-wallet-balance-figure",innerHTML:salla.money(this.balance)}),e("div",{class:"s-wallet-balance-label"},salla.lang.get("pages.wallet.balance"))),e("salla-gift-card-redeem",{onGiftCardRedeemed:this.handleGiftCardRedeemed}))}render(){return this.transactionsArray.length>0?e(a,null,this.renderSummary(),e("h2",{style:{"margin-top":"32px"}},salla.lang.get("pages.wallet.title")),e("table",{class:"s-wallet-table"},e("thead",{class:"s-wallet-table-head"},e("tr",{class:"s-wallet-table-head-tr"},e("th",{scope:"col"},salla.lang.get("pages.wallet.transaction_number")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.amount")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.date")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.order_no")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.expiry_date")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.transaction_type")," "))),e("tbody",{class:"s-wallet-table-tbody"},this.transactionsArray.map((t=>e("tr",{class:"s-wallet-table-tbody-tr s-wallet-table-tbody-tr-shadow animated"},this.renderCell("transaction_number",[t.id&&e("span",{class:"hidden md:inline-block"},"#",t.id),e("div",{class:"flex items-center md:hidden"},e("salla-button",{class:"relative",color:"dark",shape:"link","data-content":t.order_id},t.order_id&&e("span",null,"#",t.order_id)))]),this.renderCell("amount",e("div",{class:{"s-wallet-amount":!0,"s-wallet-amount-credit":this.isCredit(t),"s-wallet-amount-debit":!this.isCredit(t)}},e("span",{class:"s-wallet-amount-sign"},this.isCredit(t)?"+":"-"),e("span",{innerHTML:salla.money(t.amount)}))),this.renderCell("date",this.formatDate(t.created_at)),this.renderCell("order_no",e("span",{class:"rtl:mr-auto ltr:ml-auto md:mx-0"},t.order_id&&e("span",null,"#",t.order_id))),this.renderCell("expiry_date",e("span",null,this.formatDate(t.expired_at))),this.renderCell("transaction_type",e("div",{class:"s-wallet-transaction-type"},!!t.description&&[e("i",{id:t.id.toString(),class:"sicon-information text-lg rtl:ml-4 ltr:mr-4 s-wallet-table-transaction-status-icon-success"}),e("salla-tooltip",{text:t.description,targetId:t.id.toString()})],e("span",null,t.title)))))))),e("div",{class:"s-infinite-scroll-wrapper"},!!this.nextPageUrl&&e("salla-button",{onClick:this.handleClick,loading:this.isLoading},salla.lang.get("common.elements.load_more")))):e(a,null,this.renderSummary(),e("h2",{style:{"margin-top":"32px"}},salla.lang.get("pages.wallet.title")),e("div",{class:"s-wallet-table-empty-state"},e("i",{class:"sicon-full-wallet"}),e("div",{class:"text-center p-3 text-xl font-bold "},salla.lang.get("pages.wallet.no_transactions")),e("div",{class:"text-center text-gray-400 text-sm font-normal "},salla.lang.get("pages.wallet.zero_balance")," ")))}};r.style='/*!twlt*/@charset "UTF-8";.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}.s-wallet-summary{display:flex;align-items:stretch;gap:16px;margin-bottom:28px}.s-wallet-balance-card{flex:0 0 34%;max-width:240px;background:#fff;border-radius:12px;padding:20px;box-sizing:border-box}.s-wallet-balance-mark{width:48px;height:48px;border-radius:9999px;background:var(--color-primary-reverse, #eaf7f0);color:var(--color-primary, #2e8b57);display:inline-flex;align-items:center;justify-content:center;font-size:22px;margin-bottom:12px}.s-wallet-balance-figure{font-size:18px;font-weight:700;color:#1c1c1c}.s-wallet-balance-label{margin-top:2px;font-size:12px;color:#9aa0a6}.s-wallet-amount{display:inline-flex;align-items:center;gap:4px;font-weight:700;white-space:nowrap}.s-wallet-amount-credit{color:#00af6c}.s-wallet-amount-debit{color:#f55157}.s-wallet-transaction-type{display:flex;align-items:center;color:#4b5563}@media screen and (min-width: 768px){.s-wallet-balance-card{display:flex;flex-direction:column;justify-content:center}}@media screen and (max-width: 767px){.s-wallet-summary{gap:12px;margin-bottom:20px}.s-wallet-balance-card{flex:0 0 38%;padding:16px;text-align:center}.s-wallet-balance-mark{margin-bottom:8px}}.absolute{position:absolute}.relative{position:relative}.flex{display:flex}.table{display:table}.hidden{display:none}.items-center{align-items:center}.p-3{padding:0.75rem}.text-center{text-align:center}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:0.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.font-normal{font-weight:400}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-wallet-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.625rem * var(--tw-space-y-reverse))}@media (min-width: 768px){.s-wallet-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}}.s-wallet-mobile-title{display:inline-block;width:8rem;font-weight:400;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.s-wallet-mobile-title{display:none}}.s-wallet-reference-id{display:none}@media (min-width: 768px){.s-wallet-reference-id{display:inline-block}}.s-wallet-buy-as-gift-icon{margin-left:0.25rem;margin-right:0.25rem;display:inline-block;color:var(--color-primary)}.s-wallet-copy-to-clipboard-button{display:flex;align-items:center}@media (min-width: 768px){.s-wallet-copy-to-clipboard-button{display:none}}.s-wallet-copy-to-clipboard-button salla-button{position:relative}.s-wallet-copy-to-clipboard-button-icon{pointer-events:none;font-size:0.75rem;line-height:1rem}.s-wallet-copy-to-clipboard-button-icon:where([dir="ltr"],[dir="ltr"] *){margin-left:0.25rem}.s-wallet-copy-to-clipboard-button-icon:where([dir="rtl"],[dir="rtl"] *){margin-right:0.25rem}@media (min-width: 768px){.s-wallet-status-container{margin-left:0px;margin-right:0px}}.s-wallet-status-container:where([dir="ltr"],[dir="ltr"] *){margin-left:auto}.s-wallet-status-container:where([dir="rtl"],[dir="rtl"] *){margin-right:auto}.s-wallet-status-container i{margin-top:0.25rem}.s-wallet-status-container i:where([dir="ltr"],[dir="ltr"] *){margin-right:0.25rem}.s-wallet-status-container i:where([dir="rtl"],[dir="rtl"] *){margin-left:0.25rem}.s-wallet-rated-text{--tw-text-opacity:1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.s-wallet-unrated-text{--tw-text-opacity:1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.s-wallet-no-content{display:flex;height:100%;flex-direction:column;align-items:center;justify-content:center;padding-top:2.5rem;padding-bottom:5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-wallet-no-content .icon{margin-bottom:1rem;display:flex;height:8rem;width:8rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:3rem;line-height:1;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-wallet-no-content p{margin-bottom:1rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-wallet-table{min-width:100%;border-collapse:separate}@media (min-width: 768px){.s-wallet-table{margin-bottom:-0.75rem;--tw-border-spacing-y:1.25rem;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}}.s-wallet-table-head{margin-bottom:1.25rem;display:none;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}@media (min-width: 768px){.s-wallet-table-head{display:table-header-group}}.s-wallet-table-head-tr-th{padding-left:1.5rem;padding-right:1.5rem;text-align:start;font-size:0.875rem;line-height:1.25rem;font-weight:500;text-transform:uppercase;letter-spacing:0.05em}.s-wallet-table-head-tr-th:where([dir="ltr"],[dir="ltr"] *){text-align:left}.s-wallet-table-head-tr-th:last-child:where([dir="ltr"],[dir="ltr"] *){text-align:right}.s-wallet-table-head-tr-th:where([dir="rtl"],[dir="rtl"] *){text-align:right}.s-wallet-table-head-tr-th:last-child:where([dir="rtl"],[dir="rtl"] *){text-align:left}.s-wallet-table-tbody-tr{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;overflow:hidden;border-radius:var(--s-radius, 0.25rem);border-bottom-width:8px;border-top-width:8px;--tw-border-opacity:1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem;transition-property:box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}@media (min-width: 768px){.s-wallet-table-tbody-tr{display:table-row;flex-direction:row;flex-wrap:nowrap;padding:0px}}.s-wallet-table-tbody-tr-td{width:100%;white-space:nowrap;font-size:0.875rem;line-height:1.25rem}.s-wallet-table-tbody-tr-td:first-child{font-weight:700}@media (min-width: 768px){.s-wallet-table-tbody-tr-td{height:5rem;width:auto}.s-wallet-table-tbody-tr-td:last-child{text-align:end}.s-wallet-table-tbody-tr-td:first-child:where([dir="ltr"],[dir="ltr"] *){border-top-left-radius:0.375rem;border-bottom-left-radius:0.375rem}.s-wallet-table-tbody-tr-td:first-child:where([dir="rtl"],[dir="rtl"] *){border-top-right-radius:0.375rem;border-bottom-right-radius:0.375rem}}.s-wallet-table-tbody-tr-td:first-child{font-weight:700}.s-wallet-table-tbody-tr-td-content{position:relative;display:flex;align-items:center;justify-content:space-between;padding-left:0.5rem;padding-right:0.5rem;padding-top:0.25rem;padding-bottom:0.25rem;font-size:0.75rem;line-height:1rem}@media (min-width: 768px){.s-wallet-table-tbody-tr-td-content{padding-left:1.5rem;padding-right:1.5rem;padding-top:1.5rem;padding-bottom:1.5rem}}.s-wallet-table-tbody-tr-td-content:where([dir="ltr"],[dir="ltr"] *){padding-right:0.5rem}.s-wallet-table-tbody-tr-td-content:where([dir="rtl"],[dir="rtl"] *){padding-left:0.5rem}.s-wallet-table-tbody-tr a{position:absolute;top:0px;bottom:0px;display:block;width:100%}.s-wallet-table-tbody-tr a:where([dir="ltr"],[dir="ltr"] *){left:0px}.s-wallet-table-tbody-tr a:where([dir="rtl"],[dir="rtl"] *){right:0px}@media (min-width: 768px){.md\\:mx-0{margin-left:0px;margin-right:0px}.md\\:inline-block{display:inline-block}.md\\:hidden{display:none}}.ltr\\:ml-auto:where([dir="ltr"],[dir="ltr"] *){margin-left:auto}.ltr\\:mr-4:where([dir="ltr"],[dir="ltr"] *){margin-right:1rem}.rtl\\:ml-4:where([dir="rtl"],[dir="rtl"] *){margin-left:1rem}.rtl\\:mr-auto:where([dir="rtl"],[dir="rtl"] *){margin-right:auto}/*!twlt*/.s-button-btn{position:relative;display:inline-flex;flex:1 1 0%;user-select:none;flex-direction:row-reverse;align-items:center;justify-content:center;white-space:nowrap;border-radius:var(--s-radius, 0.25rem);border-style:solid;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-btn:hover{opacity:0.8}.s-button-primary{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-button-primary:hover{background-color:var(--color-primary-dark)}.s-button-text{pointer-events:none;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-loader{margin-left:0.5rem;margin-right:0.5rem;display:flex;align-items:center;justify-content:center;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-button-loader::before{display:inline-block;height:1rem;content:var(--tw-content);width:1rem}@keyframes spin{to{content:var(--tw-content);transform:rotate(360deg)}}.s-button-loader::before{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;border-style:solid;border-top-color:var(--color-primary);border-left-color:var(--color-primary);border-bottom-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-border-opacity:1;border-right-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;margin:0px !important;--tw-translate-y:-50%;--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-infinite-scroll-wrapper{margin-top:1rem;text-align:center}.s-infinite-scroll-last{margin:0px;text-align:center}.s-infinite-scroll-error{margin:0px;text-align:center}';export{r as salla_wallet}
4
+ import{r as t,h as e,H as a}from"./p-BnDYuqv2.js";const r=class{constructor(e){t(this,e),this.transactionsArray=[],this.isLoading=!1,this.nextPageUrl="",this.requestSeq=0,this.handleClick=()=>{this.isLoading||this.loadMoreTransactions()},this.handleGiftCardRedeemed=()=>{this.loadTransactions()}}componentWillLoad(){return salla.onReady().then((()=>this.loadTransactions()))}normalizeTransactions(t){if(Array.isArray(t))return{list:t,nextPageUrl:""};const e=t?.current_page??1,a=e<(t?.last_page??e)?`/balance/wallet?per_page=${t?.per_page??10}&page=${e+1}`:"";return{list:t?.data??[],nextPageUrl:a}}loadTransactions(){return this.fetchTransactions("/balance/wallet?per_page=10&page=1",!1)}loadMoreTransactions(){return this.fetchTransactions(this.nextPageUrl||"/balance/wallet?page=2&per_page=10",!0)}async fetchTransactions(t,e){const a=++this.requestSeq;this.isLoading=!0;try{const r=await salla.api.request(t);if(a!==this.requestSeq)return;const{list:l,nextPageUrl:i}=this.normalizeTransactions(r.data.transactions);this.nextPageUrl=i,this.transactionsArray=e?[...this.transactionsArray,...l]:l,this.balance=r.data.balance}catch(t){if(a!==this.requestSeq)return;console.error("Error loading wallet transactions",t)}finally{a===this.requestSeq&&(this.isLoading=!1)}}formatDate(t){return t?new Date(1e3*t).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"}):""}renderCell(t,a){return e("td",{class:"s-wallet-table-tbody-tr-td"},e("div",{class:"s-wallet-table-tbody-tr-td-content"},e("span",{class:"s-wallet-mobile-title"},salla.lang.get(`pages.wallet.${t}`),":"),a))}isCredit(t){return"debit"!==t.transaction_type}renderSummary(){return e("div",{class:"s-wallet-summary"},e("div",{class:"s-wallet-balance-card"},e("span",{class:"s-wallet-balance-mark"},e("i",{class:"sicon-wallet","aria-hidden":"true"})),e("div",{class:"s-wallet-balance-figure",innerHTML:salla.money(this.balance)}),e("div",{class:"s-wallet-balance-label"},salla.lang.get("pages.wallet.balance"))),e("salla-gift-card-redeem",{onGiftCardRedeemed:this.handleGiftCardRedeemed}))}render(){return this.transactionsArray.length>0?e(a,null,this.renderSummary(),e("h2",{style:{"margin-top":"32px"}},salla.lang.get("pages.wallet.title")),e("table",{class:"s-wallet-table"},e("thead",{class:"s-wallet-table-head"},e("tr",{class:"s-wallet-table-head-tr"},e("th",{scope:"col"},salla.lang.get("pages.wallet.transaction_number")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.amount")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.date")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.order_no")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.expiry_date")),e("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.transaction_type")," "))),e("tbody",{class:"s-wallet-table-tbody"},this.transactionsArray.map((t=>e("tr",{class:"s-wallet-table-tbody-tr s-wallet-table-tbody-tr-shadow animated"},this.renderCell("transaction_number",[t.id&&e("span",{class:"hidden md:inline-block"},"#",t.id),e("div",{class:"flex items-center md:hidden"},e("salla-button",{class:"relative",color:"dark",shape:"link","data-content":t.order_id},t.order_id&&e("span",null,"#",t.order_id)))]),this.renderCell("amount",e("div",{class:{"s-wallet-amount":!0,"s-wallet-amount-credit":this.isCredit(t),"s-wallet-amount-debit":!this.isCredit(t)}},e("span",{class:"s-wallet-amount-sign"},this.isCredit(t)?"+":"-"),e("span",{innerHTML:salla.money(t.amount)}))),this.renderCell("date",this.formatDate(t.created_at)),this.renderCell("order_no",e("span",{class:"rtl:mr-auto ltr:ml-auto md:mx-0"},t.order_id&&e("span",null,"#",t.order_id))),this.renderCell("expiry_date",e("span",null,this.formatDate(t.expired_at))),this.renderCell("transaction_type",e("div",{class:"s-wallet-transaction-type"},!!t.description&&[e("i",{id:t.id.toString(),class:"sicon-information text-lg rtl:ml-4 ltr:mr-4 s-wallet-table-transaction-status-icon-success"}),e("salla-tooltip",{text:t.description,targetId:t.id.toString()})],e("span",null,t.title)))))))),e("div",{class:"s-infinite-scroll-wrapper"},!!this.nextPageUrl&&e("salla-button",{onClick:this.handleClick,loading:this.isLoading},salla.lang.get("common.elements.load_more")))):e(a,null,this.renderSummary(),e("h2",{style:{"margin-top":"32px"}},salla.lang.get("pages.wallet.title")),e("div",{class:"s-wallet-table-empty-state"},e("i",{class:"sicon-full-wallet"}),e("div",{class:"text-center p-3 text-xl font-bold "},salla.lang.get("pages.wallet.no_transactions")),e("div",{class:"text-center text-gray-400 text-sm font-normal "},salla.lang.get("pages.wallet.zero_balance")," ")))}};r.style='/*!twlt*/@charset "UTF-8";.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}.s-wallet-summary{display:flex;align-items:stretch;gap:16px;margin-bottom:28px}.s-wallet-balance-card{flex:0 0 34%;max-width:240px;background:#fff;border-radius:12px;padding:20px;box-sizing:border-box}.s-wallet-balance-mark{width:48px;height:48px;border-radius:9999px;background:var(--color-primary-reverse, #eaf7f0);color:var(--color-primary, #2e8b57);display:inline-flex;align-items:center;justify-content:center;font-size:22px;margin-bottom:12px}.s-wallet-balance-figure{font-size:18px;font-weight:700;color:#1c1c1c}.s-wallet-balance-label{margin-top:2px;font-size:12px;color:#9aa0a6}.s-wallet-amount{display:inline-flex;align-items:center;gap:4px;font-weight:700;white-space:nowrap}.s-wallet-amount-credit{color:#00af6c}.s-wallet-amount-debit{color:#f55157}.s-wallet-transaction-type{display:flex;align-items:center;color:#4b5563}@media screen and (min-width: 768px){.s-wallet-balance-card{display:flex;flex-direction:column;justify-content:center}}@media screen and (max-width: 767px){.s-wallet-summary{gap:12px;margin-bottom:20px}.s-wallet-balance-card{flex:0 0 38%;padding:16px;text-align:center}.s-wallet-balance-mark{margin-bottom:8px}}.absolute{position:absolute}.relative{position:relative}.flex{display:flex}.table{display:table}.hidden{display:none}.items-center{align-items:center}.p-3{padding:0.75rem}.text-center{text-align:center}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:0.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.font-normal{font-weight:400}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-wallet-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.625rem * var(--tw-space-y-reverse))}@media (min-width: 768px){.s-wallet-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}}.s-wallet-mobile-title{display:inline-block;width:8rem;font-weight:400;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.s-wallet-mobile-title{display:none}}.s-wallet-reference-id{display:none}@media (min-width: 768px){.s-wallet-reference-id{display:inline-block}}.s-wallet-buy-as-gift-icon{margin-left:0.25rem;margin-right:0.25rem;display:inline-block;color:var(--color-primary)}.s-wallet-copy-to-clipboard-button{display:flex;align-items:center}@media (min-width: 768px){.s-wallet-copy-to-clipboard-button{display:none}}.s-wallet-copy-to-clipboard-button salla-button{position:relative}.s-wallet-copy-to-clipboard-button-icon{pointer-events:none;font-size:0.75rem;line-height:1rem}.s-wallet-copy-to-clipboard-button-icon:where([dir="ltr"],[dir="ltr"] *){margin-left:0.25rem}.s-wallet-copy-to-clipboard-button-icon:where([dir="rtl"],[dir="rtl"] *){margin-right:0.25rem}@media (min-width: 768px){.s-wallet-status-container{margin-left:0px;margin-right:0px}}.s-wallet-status-container:where([dir="ltr"],[dir="ltr"] *){margin-left:auto}.s-wallet-status-container:where([dir="rtl"],[dir="rtl"] *){margin-right:auto}.s-wallet-status-container i{margin-top:0.25rem}.s-wallet-status-container i:where([dir="ltr"],[dir="ltr"] *){margin-right:0.25rem}.s-wallet-status-container i:where([dir="rtl"],[dir="rtl"] *){margin-left:0.25rem}.s-wallet-rated-text{--tw-text-opacity:1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.s-wallet-unrated-text{--tw-text-opacity:1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.s-wallet-no-content{display:flex;height:100%;flex-direction:column;align-items:center;justify-content:center;padding-top:2.5rem;padding-bottom:5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-wallet-no-content .icon{margin-bottom:1rem;display:flex;height:8rem;width:8rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:3rem;line-height:1;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-wallet-no-content p{margin-bottom:1rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-wallet-table{min-width:100%;border-collapse:separate}@media (min-width: 768px){.s-wallet-table{margin-bottom:-0.75rem;--tw-border-spacing-y:1.25rem;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}}.s-wallet-table-head{margin-bottom:1.25rem;display:none;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}@media (min-width: 768px){.s-wallet-table-head{display:table-header-group}}.s-wallet-table-head-tr-th{padding-left:1.5rem;padding-right:1.5rem;text-align:start;font-size:0.875rem;line-height:1.25rem;font-weight:500;text-transform:uppercase;letter-spacing:0.05em}.s-wallet-table-head-tr-th:where([dir="ltr"],[dir="ltr"] *){text-align:left}.s-wallet-table-head-tr-th:last-child:where([dir="ltr"],[dir="ltr"] *){text-align:right}.s-wallet-table-head-tr-th:where([dir="rtl"],[dir="rtl"] *){text-align:right}.s-wallet-table-head-tr-th:last-child:where([dir="rtl"],[dir="rtl"] *){text-align:left}.s-wallet-table-tbody-tr{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;overflow:hidden;border-radius:var(--s-radius, 0.25rem);border-bottom-width:8px;border-top-width:8px;--tw-border-opacity:1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem;transition-property:box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}@media (min-width: 768px){.s-wallet-table-tbody-tr{display:table-row;flex-direction:row;flex-wrap:nowrap;padding:0px}}.s-wallet-table-tbody-tr-td{width:100%;white-space:nowrap;font-size:0.875rem;line-height:1.25rem}.s-wallet-table-tbody-tr-td:first-child{font-weight:700}@media (min-width: 768px){.s-wallet-table-tbody-tr-td{height:5rem;width:auto}.s-wallet-table-tbody-tr-td:last-child{text-align:end}.s-wallet-table-tbody-tr-td:first-child:where([dir="ltr"],[dir="ltr"] *){border-top-left-radius:0.375rem;border-bottom-left-radius:0.375rem}.s-wallet-table-tbody-tr-td:first-child:where([dir="rtl"],[dir="rtl"] *){border-top-right-radius:0.375rem;border-bottom-right-radius:0.375rem}}.s-wallet-table-tbody-tr-td:first-child{font-weight:700}.s-wallet-table-tbody-tr-td-content{position:relative;display:flex;align-items:center;justify-content:space-between;padding-left:0.5rem;padding-right:0.5rem;padding-top:0.25rem;padding-bottom:0.25rem;font-size:0.75rem;line-height:1rem}@media (min-width: 768px){.s-wallet-table-tbody-tr-td-content{padding-left:1.5rem;padding-right:1.5rem;padding-top:1.5rem;padding-bottom:1.5rem}}.s-wallet-table-tbody-tr-td-content:where([dir="ltr"],[dir="ltr"] *){padding-right:0.5rem}.s-wallet-table-tbody-tr-td-content:where([dir="rtl"],[dir="rtl"] *){padding-left:0.5rem}.s-wallet-table-tbody-tr a{position:absolute;top:0px;bottom:0px;display:block;width:100%}.s-wallet-table-tbody-tr a:where([dir="ltr"],[dir="ltr"] *){left:0px}.s-wallet-table-tbody-tr a:where([dir="rtl"],[dir="rtl"] *){right:0px}@media (min-width: 768px){.md\\:mx-0{margin-left:0px;margin-right:0px}.md\\:inline-block{display:inline-block}.md\\:hidden{display:none}}.ltr\\:ml-auto:where([dir="ltr"],[dir="ltr"] *){margin-left:auto}.ltr\\:mr-4:where([dir="ltr"],[dir="ltr"] *){margin-right:1rem}.rtl\\:ml-4:where([dir="rtl"],[dir="rtl"] *){margin-left:1rem}.rtl\\:mr-auto:where([dir="rtl"],[dir="rtl"] *){margin-right:auto}/*!twlt*/.s-button-btn{position:relative;display:inline-flex;flex:1 1 0%;user-select:none;flex-direction:row-reverse;align-items:center;justify-content:center;white-space:nowrap;border-radius:var(--s-radius, 0.25rem);border-style:solid;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-btn:hover{opacity:0.8}.s-button-primary{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-button-primary:hover{background-color:var(--color-primary-dark)}.s-button-text{pointer-events:none;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-loader{margin-left:0.5rem;margin-right:0.5rem;display:flex;align-items:center;justify-content:center;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-button-loader::before{display:inline-block;height:1rem;content:var(--tw-content);width:1rem}@keyframes spin{to{content:var(--tw-content);transform:rotate(360deg)}}.s-button-loader::before{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;border-style:solid;border-top-color:var(--color-primary);border-left-color:var(--color-primary);border-bottom-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-border-opacity:1;border-right-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;margin:0px !important;--tw-translate-y:-50%;--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-infinite-scroll-wrapper{margin-top:1rem;text-align:center}.s-infinite-scroll-last{margin:0px;text-align:center}.s-infinite-scroll-error{margin:0px;text-align:center}';export{r as salla_wallet}