@salla.sa/twilight-components 2.14.381 → 2.14.382

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/dist/cjs/{filepond-CsqfBzs3.js → filepond-g22JhArE.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-BWhvanmU.js → filepond-plugin-file-poster-BLHE3V1F.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-noIyy5Yp.js → filepond-plugin-file-validate-size-Cv69mp4T.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-N76Wh7ZL.js → filepond-plugin-file-validate-type-UlN6zKxS.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-BkgUR4kG.js → filepond-plugin-image-edit-V6CWtRrp.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-DLFISFCC.js → filepond-plugin-image-exif-orientation-Bdel8-Be.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-CtTDfIQp.js → filepond-plugin-image-preview-BbyhVd2-.js} +1 -1
  8. package/dist/cjs/{index-Bxxuur88.js → index-CgOy8iIV.js} +2 -2
  9. package/dist/cjs/{index-B-K6ToCR.js → index-D6_fzuPF.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/salla-accordion-body_3.cjs.entry.js +1 -1
  12. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-add-product-button_4.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
  19. package/dist/cjs/salla-bullet-delivery.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-count-down_2.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  79. package/dist/cjs/twilight.cjs.js +1 -1
  80. package/dist/cjs/{vanilla-picker-DDwsUdkB.js → vanilla-picker-CBkQi6yD.js} +1 -1
  81. package/dist/components/index.js +2 -2
  82. package/dist/esm/{filepond-Dw5LLI9G.js → filepond-R6QOZ4Ng.js} +1 -1
  83. package/dist/esm/{filepond-plugin-file-poster-BQve1M8B.js → filepond-plugin-file-poster-CgZsOj29.js} +1 -1
  84. package/dist/esm/{filepond-plugin-file-validate-size-Mq0exUD8.js → filepond-plugin-file-validate-size-CYlCC1qn.js} +1 -1
  85. package/dist/esm/{filepond-plugin-file-validate-type-BjZfWuzA.js → filepond-plugin-file-validate-type-D-twSapC.js} +1 -1
  86. package/dist/esm/{filepond-plugin-image-edit-B_Mw4seW.js → filepond-plugin-image-edit-C0lS-TeI.js} +1 -1
  87. package/dist/esm/{filepond-plugin-image-exif-orientation-D1rHHcpP.js → filepond-plugin-image-exif-orientation-g6QLr9rh.js} +1 -1
  88. package/dist/esm/{filepond-plugin-image-preview-CSOxFeXE.js → filepond-plugin-image-preview-dugWUsPI.js} +1 -1
  89. package/dist/esm/{index-BpoZBzEy.js → index-B-fHbvwg.js} +2 -2
  90. package/dist/esm/{index-COcTESat.js → index-CTaou2hZ.js} +1 -1
  91. package/dist/esm/loader.js +2 -2
  92. package/dist/esm/salla-accordion-body_3.entry.js +1 -1
  93. package/dist/esm/salla-accordion_6.entry.js +1 -1
  94. package/dist/esm/salla-add-product-button_4.entry.js +1 -1
  95. package/dist/esm/salla-advertisement.entry.js +1 -1
  96. package/dist/esm/salla-alert_2.entry.js +1 -1
  97. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  98. package/dist/esm/salla-apps-icons.entry.js +1 -1
  99. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  100. package/dist/esm/salla-bullet-delivery.entry.js +1 -1
  101. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  102. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  103. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  104. package/dist/esm/salla-contacts.entry.js +1 -1
  105. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  106. package/dist/esm/salla-count-down_2.entry.js +1 -1
  107. package/dist/esm/salla-custom-fields.entry.js +1 -1
  108. package/dist/esm/salla-filters-widget.entry.js +1 -1
  109. package/dist/esm/salla-filters.entry.js +1 -1
  110. package/dist/esm/salla-gifting.entry.js +1 -1
  111. package/dist/esm/salla-hook.entry.js +1 -1
  112. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  113. package/dist/esm/salla-installment.entry.js +1 -1
  114. package/dist/esm/salla-list-tile.entry.js +1 -1
  115. package/dist/esm/salla-localization-modal.entry.js +1 -1
  116. package/dist/esm/salla-login-modal.entry.js +1 -1
  117. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  118. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  119. package/dist/esm/salla-loyalty.entry.js +1 -1
  120. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  121. package/dist/esm/salla-menu.entry.js +1 -1
  122. package/dist/esm/salla-metadata.entry.js +1 -1
  123. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  124. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  125. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  126. package/dist/esm/salla-notification-item.entry.js +1 -1
  127. package/dist/esm/salla-notifications.entry.js +1 -1
  128. package/dist/esm/salla-offer-modal.entry.js +1 -1
  129. package/dist/esm/salla-offer.entry.js +1 -1
  130. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  131. package/dist/esm/salla-order-details-options.entry.js +1 -1
  132. package/dist/esm/salla-order-details.entry.js +1 -1
  133. package/dist/esm/salla-order-summary.entry.js +1 -1
  134. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  135. package/dist/esm/salla-orders.entry.js +1 -1
  136. package/dist/esm/salla-payments.entry.js +1 -1
  137. package/dist/esm/salla-placeholder.entry.js +1 -1
  138. package/dist/esm/salla-price-range.entry.js +1 -1
  139. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  140. package/dist/esm/salla-products-list.entry.js +1 -1
  141. package/dist/esm/salla-products-slider.entry.js +1 -1
  142. package/dist/esm/salla-progress-bar.entry.js +1 -1
  143. package/dist/esm/salla-quick-order.entry.js +1 -1
  144. package/dist/esm/salla-rating-modal.entry.js +1 -1
  145. package/dist/esm/salla-scopes.entry.js +1 -1
  146. package/dist/esm/salla-search.entry.js +1 -1
  147. package/dist/esm/salla-skeleton.entry.js +1 -1
  148. package/dist/esm/salla-slider.entry.js +1 -1
  149. package/dist/esm/salla-social-share.entry.js +1 -1
  150. package/dist/esm/salla-social.entry.js +1 -1
  151. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  152. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  153. package/dist/esm/salla-tooltip.entry.js +1 -1
  154. package/dist/esm/salla-trust-badges.entry.js +1 -1
  155. package/dist/esm/salla-user-menu.entry.js +1 -1
  156. package/dist/esm/salla-user-profile.entry.js +1 -1
  157. package/dist/esm/salla-user-settings.entry.js +1 -1
  158. package/dist/esm/salla-verify.entry.js +1 -1
  159. package/dist/esm/salla-wallet.entry.js +1 -1
  160. package/dist/esm/twilight.js +2 -2
  161. package/dist/esm/{vanilla-picker-COFfA4w_.js → vanilla-picker-Duw3dTDS.js} +1 -1
  162. package/dist/twilight/{p-645926ff.entry.js → p-06f96f06.entry.js} +1 -1
  163. package/dist/twilight/{p-87995ef8.entry.js → p-0c08df8f.entry.js} +1 -1
  164. package/dist/twilight/{p-ca995389.entry.js → p-14142359.entry.js} +1 -1
  165. package/dist/twilight/{p-b070f96a.entry.js → p-19f147de.entry.js} +1 -1
  166. package/dist/twilight/{p-bdefc2f2.entry.js → p-1af81775.entry.js} +1 -1
  167. package/dist/twilight/{p-ab35c8be.entry.js → p-1c2d5328.entry.js} +1 -1
  168. package/dist/twilight/{p-efd9618b.entry.js → p-1f52af03.entry.js} +1 -1
  169. package/dist/twilight/{p-5507971f.entry.js → p-2418ce98.entry.js} +1 -1
  170. package/dist/twilight/{p-c1a34acb.entry.js → p-2a66eb4d.entry.js} +1 -1
  171. package/dist/twilight/{p-4463abd4.entry.js → p-2af6a330.entry.js} +1 -1
  172. package/dist/twilight/{p-dd01d95c.entry.js → p-2b2fe14f.entry.js} +1 -1
  173. package/dist/twilight/{p-97fb05e9.entry.js → p-2bc915b6.entry.js} +1 -1
  174. package/dist/twilight/{p-5e99999b.entry.js → p-365c44c2.entry.js} +1 -1
  175. package/dist/twilight/{p-b01d274c.entry.js → p-389cd70d.entry.js} +1 -1
  176. package/dist/twilight/{p-f60ec106.entry.js → p-3a5f3ce7.entry.js} +1 -1
  177. package/dist/twilight/{p-8edc0ff0.entry.js → p-3a9331bc.entry.js} +1 -1
  178. package/dist/twilight/{p-dff43324.entry.js → p-421937b6.entry.js} +1 -1
  179. package/dist/twilight/{p-f7bf59b9.entry.js → p-4aae95f0.entry.js} +1 -1
  180. package/dist/twilight/{p-73ab234b.entry.js → p-4b294540.entry.js} +1 -1
  181. package/dist/twilight/{p-c5b6f255.entry.js → p-53d39d70.entry.js} +1 -1
  182. package/dist/twilight/{p-84c228b3.entry.js → p-5579022f.entry.js} +1 -1
  183. package/dist/twilight/{p-264fbff6.entry.js → p-55a8aed2.entry.js} +1 -1
  184. package/dist/twilight/{p-a3ec6623.entry.js → p-58a7329c.entry.js} +1 -1
  185. package/dist/twilight/{p-538189c6.entry.js → p-58f7fea9.entry.js} +1 -1
  186. package/dist/twilight/{p-c69cfce4.entry.js → p-5d39792e.entry.js} +1 -1
  187. package/dist/twilight/{p-acd0216d.entry.js → p-5e825370.entry.js} +1 -1
  188. package/dist/twilight/{p-b2979968.entry.js → p-5f5d4e1c.entry.js} +1 -1
  189. package/dist/twilight/{p-9aea4727.entry.js → p-60aeb2ce.entry.js} +1 -1
  190. package/dist/twilight/{p-ca62b40b.entry.js → p-60c2abb3.entry.js} +1 -1
  191. package/dist/twilight/{p-6004b9f6.entry.js → p-66831f23.entry.js} +1 -1
  192. package/dist/twilight/{p-04b8ab10.entry.js → p-6ef9195a.entry.js} +1 -1
  193. package/dist/twilight/{p-c74dd641.entry.js → p-6f81c83d.entry.js} +1 -1
  194. package/dist/twilight/{p-fdad85d2.entry.js → p-723a816b.entry.js} +1 -1
  195. package/dist/twilight/{p-f78b23ea.entry.js → p-77332e8d.entry.js} +1 -1
  196. package/dist/twilight/{p-39581e5c.entry.js → p-7c0c0b78.entry.js} +1 -1
  197. package/dist/twilight/{p-d9e33667.entry.js → p-88084123.entry.js} +1 -1
  198. package/dist/twilight/{p-17b7160b.entry.js → p-8ac939dc.entry.js} +1 -1
  199. package/dist/twilight/{p-64e748a7.entry.js → p-905174a5.entry.js} +1 -1
  200. package/dist/twilight/{p-3041a8c3.entry.js → p-95a539e9.entry.js} +1 -1
  201. package/dist/twilight/{p-f2b27a5e.entry.js → p-95c952d0.entry.js} +1 -1
  202. package/dist/twilight/{p-ed12b178.entry.js → p-972f9d4f.entry.js} +1 -1
  203. package/dist/twilight/{p-f158ba7c.entry.js → p-9b1f66de.entry.js} +1 -1
  204. package/dist/twilight/{p-15fd3093.entry.js → p-9ec325af.entry.js} +1 -1
  205. package/dist/twilight/{p-4919e5a9.entry.js → p-9fa0db12.entry.js} +1 -1
  206. package/dist/twilight/{p-BpoZBzEy.js → p-B-fHbvwg.js} +1 -1
  207. package/dist/twilight/{p-4jF7OEOD.js → p-B2Gco6bY.js} +1 -1
  208. package/dist/twilight/{p-tNbreaQ2.js → p-B7yaZRKc.js} +1 -1
  209. package/dist/twilight/{p-B_eS27OO.js → p-BX5ozk-b.js} +1 -1
  210. package/dist/twilight/p-BZ25IjRt.js +9 -0
  211. package/dist/twilight/{p-eWBd8uwT.js → p-D-4ztIM-.js} +1 -1
  212. package/dist/twilight/{p-ChWnmXKQ.js → p-DE1V8UWA.js} +1 -1
  213. package/dist/twilight/{p-rPMW4kOC.js → p-Dl6-KoXs.js} +1 -1
  214. package/dist/twilight/p-_Gk6BpnQ.js +9 -0
  215. package/dist/twilight/{p-53c9c271.entry.js → p-a3ad0b94.entry.js} +1 -1
  216. package/dist/twilight/{p-e66f7d14.entry.js → p-a543b807.entry.js} +1 -1
  217. package/dist/twilight/{p-64a71c5b.entry.js → p-a5e3ef61.entry.js} +1 -1
  218. package/dist/twilight/{p-f625565a.entry.js → p-aa6f8402.entry.js} +1 -1
  219. package/dist/twilight/{p-2199d718.entry.js → p-b053a827.entry.js} +1 -1
  220. package/dist/twilight/{p-4ffae40f.entry.js → p-b673072d.entry.js} +1 -1
  221. package/dist/twilight/{p-83f3ec31.entry.js → p-bf17e59a.entry.js} +1 -1
  222. package/dist/twilight/{p-24377f25.entry.js → p-c6282352.entry.js} +1 -1
  223. package/dist/twilight/{p-9f184cae.entry.js → p-c74196cf.entry.js} +1 -1
  224. package/dist/twilight/{p-c614db39.entry.js → p-c77ccff5.entry.js} +1 -1
  225. package/dist/twilight/{p-6a92b5dd.entry.js → p-c7e947ae.entry.js} +1 -1
  226. package/dist/twilight/{p-e35623f2.entry.js → p-cbc1251e.entry.js} +1 -1
  227. package/dist/twilight/{p-c5b8fb5f.entry.js → p-cfaf32ba.entry.js} +1 -1
  228. package/dist/twilight/{p-7131d69f.entry.js → p-d4213eae.entry.js} +1 -1
  229. package/dist/twilight/{p-98cb7b70.entry.js → p-d761cf9b.entry.js} +1 -1
  230. package/dist/twilight/{p-a1bf8ad3.entry.js → p-db583811.entry.js} +1 -1
  231. package/dist/twilight/{p-15a594fa.entry.js → p-dc29cded.entry.js} +1 -1
  232. package/dist/twilight/{p-0413c734.entry.js → p-e09f5066.entry.js} +1 -1
  233. package/dist/twilight/{p-e4d4516c.entry.js → p-e1ed451f.entry.js} +1 -1
  234. package/dist/twilight/{p-c0540583.entry.js → p-e3ef352f.entry.js} +1 -1
  235. package/dist/twilight/{p-30e99651.entry.js → p-e936f726.entry.js} +1 -1
  236. package/dist/twilight/{p-3f181a96.entry.js → p-ec62577e.entry.js} +1 -1
  237. package/dist/twilight/{p-984f5fdb.entry.js → p-fb21368b.entry.js} +1 -1
  238. package/dist/twilight/{p-6af10c58.entry.js → p-fb9e9a71.entry.js} +1 -1
  239. package/dist/twilight/{p-OV5ZDGcP.js → p-vNDBdK6G.js} +1 -1
  240. package/dist/twilight/twilight.esm.js +1 -1
  241. package/package.json +5 -5
  242. package/dist/twilight/p-BEN319Se.js +0 -9
  243. package/dist/twilight/p-CLHtpy_k.js +0 -9
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as c,h as l,H as t,a as s}from"./p-BpoZBzEy.js";import{f as e,t as i}from"./p-CO-PeZ27.js";const o=class{constructor(l){c(this,l),this.links=salla.config.get("store.social"),this.iconsList={instagram:'\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>instagram</title>\n<path d="M23 32h-14c-4.971 0-9-4.029-9-9v0-14c0-4.971 4.029-9 9-9v0h14c4.971 0 9 4.029 9 9v0 14c0 4.971-4.029 9-9 9v0zM9 2c-3.866 0-7 3.134-7 7v0 14c0 3.866 3.134 7 7 7v0h14c3.866 0 7-3.134 7-7v0-14c0-3.866-3.134-7-7-7v0zM16 24c-4.418 0-8-3.582-8-8s3.582-8 8-8c4.418 0 8 3.582 8 8v0c0 4.418-3.582 8-8 8v0zM16 10c-3.314 0-6 2.686-6 6s2.686 6 6 6c3.314 0 6-2.686 6-6v0c0-3.314-2.686-6-6-6v0zM25 9c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2v0c0 1.105-0.895 2-2 2v0zM25 7v0z"></path>\n</svg>\n',twitter:i,facebook:e,youtube:'\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>youtube</title>\n<path d="M16 28c-3.666 0-8.376-0.056-10.29-0.162-0.113 0.010-0.244 0.016-0.376 0.016-1.676 0-3.139-0.91-3.922-2.264l-0.012-0.022c-0.97-1.6-1.4-4.248-1.4-8.558s0.436-6.962 1.412-8.6c0.782-1.36 2.227-2.262 3.883-2.262 0.148 0 0.293 0.007 0.437 0.021l-0.018-0.001c1.872-0.124 6.544-0.168 10.286-0.168s8.4 0.044 10.292 0.168c0.124-0.012 0.267-0.019 0.412-0.019 1.656 0 3.101 0.905 3.866 2.247l0.012 0.022c0.982 1.624 1.418 4.27 1.418 8.582 0 4.338-0.438 6.982-1.422 8.6-0.789 1.364-2.241 2.268-3.904 2.268-0.133 0-0.265-0.006-0.395-0.017l0.017 0.001c-1.926 0.092-6.632 0.148-10.296 0.148zM16 8c-3.712 0-8.334 0.042-10.168 0.164-1.688 0.094-2.14 0.306-2.702 1.268-0.756 1.81-1.195 3.913-1.195 6.119 0 0.51 0.024 1.015 0.069 1.513l-0.005-0.064c-0.042 0.435-0.065 0.941-0.065 1.453 0 2.198 0.438 4.294 1.231 6.205l-0.039-0.107c0.566 0.968 1.022 1.184 2.708 1.296 3.29 0.184 17.022 0.184 20.34 0 1.678-0.11 2.132-0.326 2.684-1.28 0.764-1.803 1.208-3.899 1.208-6.1 0-0.513-0.024-1.020-0.071-1.52l0.005 0.064c0.042-0.436 0.065-0.943 0.065-1.455 0-2.203-0.439-4.303-1.235-6.218l0.040 0.107v-0.016c-0.554-0.958-1-1.17-2.684-1.264-1.862-0.122-6.644-0.164-10.186-0.164zM13 23c-0.552 0-1-0.448-1-1v0-10c0 0 0 0 0 0 0-0.552 0.448-1 1-1 0.196 0 0.38 0.057 0.534 0.154l-0.004-0.002 8 5c0.284 0.18 0.47 0.492 0.47 0.848s-0.186 0.668-0.466 0.846l-0.004 0.002-8 5c-0.15 0.095-0.334 0.152-0.53 0.152 0 0 0 0 0 0v0zM14 13.8v6.4l5.114-3.2z"></path>\n</svg>\n',snapchat:'\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>snapchat</title>\n<path d="M16.186 30h-0.266c-1.843-0.023-3.525-0.693-4.834-1.792l0.012 0.010c-0.476-0.405-1.043-0.72-1.665-0.909l-0.033-0.009c-0.287-0.044-0.617-0.069-0.954-0.069-0.492 0-0.972 0.053-1.434 0.155l0.044-0.008c-0.261 0.061-0.564 0.102-0.875 0.114l-0.009 0c-0.017 0.001-0.036 0.001-0.056 0.001-0.811 0-1.495-0.545-1.705-1.288l-0.003-0.012c-0.076-0.26-0.132-0.506-0.186-0.746-0.961-0.157-1.822-0.412-2.633-0.76l0.073 0.028c-0.667-0.259-1.199-0.745-1.509-1.362l-0.007-0.016c-0.082-0.189-0.135-0.409-0.146-0.64l-0-0.004c-0.002-0.031-0.003-0.067-0.003-0.103 0-0.841 0.614-1.538 1.417-1.668l0.010-0.001c0.822-0.141 1.555-0.438 2.198-0.859l-0.022 0.013c0.611-0.405 1.138-0.872 1.591-1.404l0.009-0.010c0.526-0.595 0.98-1.273 1.337-2.007l0.023-0.053c0.060-0.102 0.107-0.22 0.135-0.346l0.001-0.008c-0.092-0.020-0.73-0.222-0.972-0.298s-0.374-0.12-0.506-0.17c-0.546-0.205-1.016-0.487-1.424-0.839l0.006 0.005c-0.471-0.388-0.768-0.971-0.768-1.624 0-0.126 0.011-0.249 0.032-0.369l-0.002 0.013c0.143-0.644 0.551-1.172 1.1-1.474l0.011-0.006c0.389-0.241 0.861-0.384 1.366-0.384 0.347 0 0.678 0.067 0.982 0.19l-0.018-0.006c0.128 0.060 0.242 0.106 0.344 0.142-0.082-0.573-0.129-1.235-0.129-1.908 0-1.482 0.227-2.91 0.648-4.253l-0.027 0.101c0.512-1.142 1.207-2.114 2.056-2.925l0.004-0.003c0.7-0.664 1.516-1.214 2.413-1.616l0.055-0.022c1.128-0.5 2.444-0.794 3.828-0.8h0.592c1.386 0.007 2.701 0.301 3.893 0.825l-0.063-0.025c0.956 0.42 1.777 0.967 2.485 1.632l-0.005-0.004c0.855 0.815 1.55 1.789 2.039 2.876l0.023 0.058c0.396 1.237 0.625 2.659 0.625 4.135 0 0.658-0.045 1.304-0.133 1.938l0.008-0.073 0.172-0.076c0.303-0.16 0.661-0.253 1.042-0.253 0.374 0 0.728 0.091 1.039 0.251l-0.013-0.006c0.886 0.274 1.528 1.063 1.582 2.008l0 0.006c-0.001 0.602-0.25 1.146-0.65 1.536l-0 0c-0.429 0.408-0.945 0.73-1.516 0.935l-0.030 0.009c-0.144 0.056-0.316 0.112-0.504 0.17-0.367 0.103-0.686 0.235-0.984 0.398l0.024-0.012c0.018 0.030 0.042 0.094 0.086 0.18 0.963 2.174 2.834 3.796 5.118 4.4l0.054 0.012c0.814 0.133 1.427 0.83 1.427 1.671 0 0.036-0.001 0.072-0.003 0.108l0-0.005c-0.012 0.241-0.070 0.465-0.165 0.669l0.005-0.011c-0.319 0.624-0.847 1.103-1.489 1.352l-0.019 0.006c-0.739 0.323-1.6 0.578-2.497 0.724l-0.063 0.008c-0.056 0.264-0.112 0.496-0.186 0.742-0.215 0.747-0.893 1.284-1.696 1.284-0.011 0-0.021-0-0.032-0l0.002 0c-0.328-0.004-0.644-0.042-0.949-0.11l0.031 0.006c-0.404-0.090-0.869-0.142-1.345-0.142-0.353 0-0.7 0.029-1.038 0.083l0.037-0.005c-0.653 0.195-1.218 0.508-1.699 0.917l0.007-0.005c-1.275 1.065-2.916 1.731-4.71 1.788l-0.012 0zM8.444 25.218c0.457 0.001 0.904 0.041 1.339 0.117l-0.047-0.007c0.966 0.232 1.808 0.664 2.516 1.252l-0.010-0.008c0.96 0.829 2.199 1.357 3.56 1.427l0.014 0.001h0.37c1.373-0.070 2.61-0.597 3.576-1.43l-0.008 0.006c0.701-0.583 1.546-1.016 2.474-1.239l0.042-0.009c0.394-0.063 0.849-0.1 1.312-0.1 0.615 0 1.216 0.064 1.795 0.186l-0.057-0.010c0.105 0.023 0.238 0.045 0.372 0.059l0.016 0.001c0.042-0.162 0.076-0.314 0.11-0.47 0.059-0.339 0.156-0.641 0.287-0.924l-0.009 0.023 0.234-0.44 0.492-0.078c0.99-0.119 1.892-0.359 2.738-0.705l-0.070 0.025c0.086-0.040 0.158-0.076 0.216-0.11-2.748-0.86-4.933-2.816-6.081-5.342l-0.025-0.062c-0.184-0.31-0.294-0.684-0.294-1.083 0-0.27 0.050-0.528 0.14-0.765l-0.005 0.015c0.492-0.783 1.284-1.339 2.212-1.507l0.020-0.003c0.14-0.044 0.27-0.084 0.376-0.126 0.327-0.108 0.609-0.272 0.849-0.482l-0.003 0.002c0.074-0.106 0-0.2-0.216-0.284-0.094-0.041-0.203-0.065-0.318-0.066h-0c-0.529 0.242-1.142 0.411-1.786 0.474l-0.024 0.002c-0.313-0-0.612-0.064-0.883-0.18l0.015 0.006-0.628-0.28 0.072-1.272c0.093-0.623 0.146-1.342 0.146-2.074 0-1.269-0.16-2.501-0.46-3.677l0.022 0.103c-0.396-0.896-0.936-1.659-1.598-2.296l-0.002-0.002c-0.541-0.508-1.172-0.928-1.865-1.233l-0.043-0.017c-0.895-0.396-1.939-0.629-3.036-0.634h-0.002l-0.218-1v1h-0.348c-1.105 0.003-2.155 0.237-3.106 0.656l0.050-0.020c-0.733 0.322-1.361 0.742-1.903 1.253l0.003-0.003c-0.663 0.638-1.203 1.398-1.582 2.247l-0.018 0.045c-0.279 1.065-0.44 2.287-0.44 3.547 0 0.704 0.050 1.395 0.147 2.072l-0.009-0.078 0.080 1.372-0.618 0.284c-0.31 0.108-0.666 0.17-1.038 0.17-0.6 0-1.163-0.163-1.645-0.446l0.015 0.008c-0.019-0.001-0.041-0.002-0.064-0.002-0.154 0-0.299 0.039-0.425 0.109l0.005-0.002c-0.063 0.032-0.115 0.078-0.153 0.135l-0.001 0.001c0.258 0.244 0.567 0.435 0.91 0.556l0.018 0.006c0.094 0.036 0.2 0.070 0.32 0.108 0.971 0.167 1.784 0.732 2.282 1.516l0.008 0.014c0.087 0.225 0.137 0.486 0.137 0.758 0 0.403-0.11 0.781-0.303 1.104l0.005-0.010c-0.459 0.983-1.016 1.829-1.677 2.582l0.011-0.012c-0.588 0.687-1.26 1.279-2.004 1.768l-0.036 0.022c-0.689 0.451-1.49 0.805-2.346 1.017l-0.054 0.011c0.060 0.034 0.132 0.072 0.218 0.112 0.776 0.322 1.678 0.561 2.618 0.675l0.050 0.005 0.498 0.078 0.234 0.446c0.116 0.255 0.209 0.553 0.265 0.863l0.003 0.023c0.038 0.164 0.072 0.328 0.118 0.496 0.12-0.014 0.242-0.042 0.378-0.068 0.528-0.12 1.138-0.192 1.762-0.2l0.006-0zM30.244 22.892v0z"></path>\n</svg>\n',tiktok:'\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>tiktok</title>\n<path d="M29.046 7.029c-3.359 0-6.092-2.733-6.092-6.092 0-0.518-0.42-0.938-0.938-0.938h-5.021c-0.518 0-0.938 0.42-0.938 0.938v20.585c0 1.975-1.606 3.581-3.581 3.581s-3.581-1.606-3.581-3.581c0-1.975 1.606-3.581 3.581-3.581 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938-5.777 0-10.477 4.7-10.477 10.477s4.7 10.477 10.477 10.477c5.777 0 10.477-4.7 10.477-10.477v-9.112c1.866 0.995 3.942 1.514 6.092 1.514 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938zM28.108 12.011c-2.001-0.166-3.902-0.866-5.544-2.047-0.285-0.206-0.662-0.234-0.975-0.073s-0.51 0.482-0.51 0.834v10.798c0 4.743-3.859 8.602-8.602 8.602s-8.602-3.859-8.602-8.602c0-4.427 3.361-8.083 7.665-8.552v3.176c-2.563 0.446-4.519 2.687-4.519 5.376 0 3.009 2.447 5.456 5.456 5.456s5.456-2.448 5.456-5.456v-19.648h3.201c0.429 3.645 3.329 6.545 6.974 6.974z"></path>\n</svg>\n'},this.socialSlot=this.host.querySelector('[slot="social-item"]')?.innerHTML||'<a href={link} rel="noopener" target="_blank" title={type} aria-label={type}><span class="s-social-icon">{icon}</span></a>',salla.lang.onLoaded((()=>{this.links=salla.config.get("store.social")}))}getLinksArray(){return this.links?Object.entries(this.links).filter((([c,l])=>!!l&&"whatsapp"!==c)).map((([c,l])=>({type:c,value:l}))):[]}componentWillLoad(){return new Promise((c=>salla.onReady(c)))}render(){const c=this.getLinksArray();return l(t,{key:"63d306c569080a2719d6e2731dc5fe0d6b8f77f4"},l("ul",{key:"12c71e69359695da6c2ab3f607973b314c639e1e",class:"s-social-list"},c.map((c=>l("li",{class:"s-social-link"},l("div",{id:"social-slot",innerHTML:this.socialSlot.replace(/\{icon\}/g,this.iconsList[c.type]).replace(/\{type\}/g,c.type).replace(/\{link\}/g,c.value.toString())}))))))}componentDidRender(){this.host.querySelectorAll("#social-slot").forEach((c=>c.replaceWith(c.firstChild))),this.host.querySelector('[slot="social-item"]')?.remove()}get host(){return s(this)}};o.style=":host{display:block}";export{o as salla_social}
4
+ import{r as c,h as l,H as t,a as s}from"./p-B-fHbvwg.js";import{f as e,t as i}from"./p-CO-PeZ27.js";const o=class{constructor(l){c(this,l),this.links=salla.config.get("store.social"),this.iconsList={instagram:'\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>instagram</title>\n<path d="M23 32h-14c-4.971 0-9-4.029-9-9v0-14c0-4.971 4.029-9 9-9v0h14c4.971 0 9 4.029 9 9v0 14c0 4.971-4.029 9-9 9v0zM9 2c-3.866 0-7 3.134-7 7v0 14c0 3.866 3.134 7 7 7v0h14c3.866 0 7-3.134 7-7v0-14c0-3.866-3.134-7-7-7v0zM16 24c-4.418 0-8-3.582-8-8s3.582-8 8-8c4.418 0 8 3.582 8 8v0c0 4.418-3.582 8-8 8v0zM16 10c-3.314 0-6 2.686-6 6s2.686 6 6 6c3.314 0 6-2.686 6-6v0c0-3.314-2.686-6-6-6v0zM25 9c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2v0c0 1.105-0.895 2-2 2v0zM25 7v0z"></path>\n</svg>\n',twitter:i,facebook:e,youtube:'\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>youtube</title>\n<path d="M16 28c-3.666 0-8.376-0.056-10.29-0.162-0.113 0.010-0.244 0.016-0.376 0.016-1.676 0-3.139-0.91-3.922-2.264l-0.012-0.022c-0.97-1.6-1.4-4.248-1.4-8.558s0.436-6.962 1.412-8.6c0.782-1.36 2.227-2.262 3.883-2.262 0.148 0 0.293 0.007 0.437 0.021l-0.018-0.001c1.872-0.124 6.544-0.168 10.286-0.168s8.4 0.044 10.292 0.168c0.124-0.012 0.267-0.019 0.412-0.019 1.656 0 3.101 0.905 3.866 2.247l0.012 0.022c0.982 1.624 1.418 4.27 1.418 8.582 0 4.338-0.438 6.982-1.422 8.6-0.789 1.364-2.241 2.268-3.904 2.268-0.133 0-0.265-0.006-0.395-0.017l0.017 0.001c-1.926 0.092-6.632 0.148-10.296 0.148zM16 8c-3.712 0-8.334 0.042-10.168 0.164-1.688 0.094-2.14 0.306-2.702 1.268-0.756 1.81-1.195 3.913-1.195 6.119 0 0.51 0.024 1.015 0.069 1.513l-0.005-0.064c-0.042 0.435-0.065 0.941-0.065 1.453 0 2.198 0.438 4.294 1.231 6.205l-0.039-0.107c0.566 0.968 1.022 1.184 2.708 1.296 3.29 0.184 17.022 0.184 20.34 0 1.678-0.11 2.132-0.326 2.684-1.28 0.764-1.803 1.208-3.899 1.208-6.1 0-0.513-0.024-1.020-0.071-1.52l0.005 0.064c0.042-0.436 0.065-0.943 0.065-1.455 0-2.203-0.439-4.303-1.235-6.218l0.040 0.107v-0.016c-0.554-0.958-1-1.17-2.684-1.264-1.862-0.122-6.644-0.164-10.186-0.164zM13 23c-0.552 0-1-0.448-1-1v0-10c0 0 0 0 0 0 0-0.552 0.448-1 1-1 0.196 0 0.38 0.057 0.534 0.154l-0.004-0.002 8 5c0.284 0.18 0.47 0.492 0.47 0.848s-0.186 0.668-0.466 0.846l-0.004 0.002-8 5c-0.15 0.095-0.334 0.152-0.53 0.152 0 0 0 0 0 0v0zM14 13.8v6.4l5.114-3.2z"></path>\n</svg>\n',snapchat:'\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>snapchat</title>\n<path d="M16.186 30h-0.266c-1.843-0.023-3.525-0.693-4.834-1.792l0.012 0.010c-0.476-0.405-1.043-0.72-1.665-0.909l-0.033-0.009c-0.287-0.044-0.617-0.069-0.954-0.069-0.492 0-0.972 0.053-1.434 0.155l0.044-0.008c-0.261 0.061-0.564 0.102-0.875 0.114l-0.009 0c-0.017 0.001-0.036 0.001-0.056 0.001-0.811 0-1.495-0.545-1.705-1.288l-0.003-0.012c-0.076-0.26-0.132-0.506-0.186-0.746-0.961-0.157-1.822-0.412-2.633-0.76l0.073 0.028c-0.667-0.259-1.199-0.745-1.509-1.362l-0.007-0.016c-0.082-0.189-0.135-0.409-0.146-0.64l-0-0.004c-0.002-0.031-0.003-0.067-0.003-0.103 0-0.841 0.614-1.538 1.417-1.668l0.010-0.001c0.822-0.141 1.555-0.438 2.198-0.859l-0.022 0.013c0.611-0.405 1.138-0.872 1.591-1.404l0.009-0.010c0.526-0.595 0.98-1.273 1.337-2.007l0.023-0.053c0.060-0.102 0.107-0.22 0.135-0.346l0.001-0.008c-0.092-0.020-0.73-0.222-0.972-0.298s-0.374-0.12-0.506-0.17c-0.546-0.205-1.016-0.487-1.424-0.839l0.006 0.005c-0.471-0.388-0.768-0.971-0.768-1.624 0-0.126 0.011-0.249 0.032-0.369l-0.002 0.013c0.143-0.644 0.551-1.172 1.1-1.474l0.011-0.006c0.389-0.241 0.861-0.384 1.366-0.384 0.347 0 0.678 0.067 0.982 0.19l-0.018-0.006c0.128 0.060 0.242 0.106 0.344 0.142-0.082-0.573-0.129-1.235-0.129-1.908 0-1.482 0.227-2.91 0.648-4.253l-0.027 0.101c0.512-1.142 1.207-2.114 2.056-2.925l0.004-0.003c0.7-0.664 1.516-1.214 2.413-1.616l0.055-0.022c1.128-0.5 2.444-0.794 3.828-0.8h0.592c1.386 0.007 2.701 0.301 3.893 0.825l-0.063-0.025c0.956 0.42 1.777 0.967 2.485 1.632l-0.005-0.004c0.855 0.815 1.55 1.789 2.039 2.876l0.023 0.058c0.396 1.237 0.625 2.659 0.625 4.135 0 0.658-0.045 1.304-0.133 1.938l0.008-0.073 0.172-0.076c0.303-0.16 0.661-0.253 1.042-0.253 0.374 0 0.728 0.091 1.039 0.251l-0.013-0.006c0.886 0.274 1.528 1.063 1.582 2.008l0 0.006c-0.001 0.602-0.25 1.146-0.65 1.536l-0 0c-0.429 0.408-0.945 0.73-1.516 0.935l-0.030 0.009c-0.144 0.056-0.316 0.112-0.504 0.17-0.367 0.103-0.686 0.235-0.984 0.398l0.024-0.012c0.018 0.030 0.042 0.094 0.086 0.18 0.963 2.174 2.834 3.796 5.118 4.4l0.054 0.012c0.814 0.133 1.427 0.83 1.427 1.671 0 0.036-0.001 0.072-0.003 0.108l0-0.005c-0.012 0.241-0.070 0.465-0.165 0.669l0.005-0.011c-0.319 0.624-0.847 1.103-1.489 1.352l-0.019 0.006c-0.739 0.323-1.6 0.578-2.497 0.724l-0.063 0.008c-0.056 0.264-0.112 0.496-0.186 0.742-0.215 0.747-0.893 1.284-1.696 1.284-0.011 0-0.021-0-0.032-0l0.002 0c-0.328-0.004-0.644-0.042-0.949-0.11l0.031 0.006c-0.404-0.090-0.869-0.142-1.345-0.142-0.353 0-0.7 0.029-1.038 0.083l0.037-0.005c-0.653 0.195-1.218 0.508-1.699 0.917l0.007-0.005c-1.275 1.065-2.916 1.731-4.71 1.788l-0.012 0zM8.444 25.218c0.457 0.001 0.904 0.041 1.339 0.117l-0.047-0.007c0.966 0.232 1.808 0.664 2.516 1.252l-0.010-0.008c0.96 0.829 2.199 1.357 3.56 1.427l0.014 0.001h0.37c1.373-0.070 2.61-0.597 3.576-1.43l-0.008 0.006c0.701-0.583 1.546-1.016 2.474-1.239l0.042-0.009c0.394-0.063 0.849-0.1 1.312-0.1 0.615 0 1.216 0.064 1.795 0.186l-0.057-0.010c0.105 0.023 0.238 0.045 0.372 0.059l0.016 0.001c0.042-0.162 0.076-0.314 0.11-0.47 0.059-0.339 0.156-0.641 0.287-0.924l-0.009 0.023 0.234-0.44 0.492-0.078c0.99-0.119 1.892-0.359 2.738-0.705l-0.070 0.025c0.086-0.040 0.158-0.076 0.216-0.11-2.748-0.86-4.933-2.816-6.081-5.342l-0.025-0.062c-0.184-0.31-0.294-0.684-0.294-1.083 0-0.27 0.050-0.528 0.14-0.765l-0.005 0.015c0.492-0.783 1.284-1.339 2.212-1.507l0.020-0.003c0.14-0.044 0.27-0.084 0.376-0.126 0.327-0.108 0.609-0.272 0.849-0.482l-0.003 0.002c0.074-0.106 0-0.2-0.216-0.284-0.094-0.041-0.203-0.065-0.318-0.066h-0c-0.529 0.242-1.142 0.411-1.786 0.474l-0.024 0.002c-0.313-0-0.612-0.064-0.883-0.18l0.015 0.006-0.628-0.28 0.072-1.272c0.093-0.623 0.146-1.342 0.146-2.074 0-1.269-0.16-2.501-0.46-3.677l0.022 0.103c-0.396-0.896-0.936-1.659-1.598-2.296l-0.002-0.002c-0.541-0.508-1.172-0.928-1.865-1.233l-0.043-0.017c-0.895-0.396-1.939-0.629-3.036-0.634h-0.002l-0.218-1v1h-0.348c-1.105 0.003-2.155 0.237-3.106 0.656l0.050-0.020c-0.733 0.322-1.361 0.742-1.903 1.253l0.003-0.003c-0.663 0.638-1.203 1.398-1.582 2.247l-0.018 0.045c-0.279 1.065-0.44 2.287-0.44 3.547 0 0.704 0.050 1.395 0.147 2.072l-0.009-0.078 0.080 1.372-0.618 0.284c-0.31 0.108-0.666 0.17-1.038 0.17-0.6 0-1.163-0.163-1.645-0.446l0.015 0.008c-0.019-0.001-0.041-0.002-0.064-0.002-0.154 0-0.299 0.039-0.425 0.109l0.005-0.002c-0.063 0.032-0.115 0.078-0.153 0.135l-0.001 0.001c0.258 0.244 0.567 0.435 0.91 0.556l0.018 0.006c0.094 0.036 0.2 0.070 0.32 0.108 0.971 0.167 1.784 0.732 2.282 1.516l0.008 0.014c0.087 0.225 0.137 0.486 0.137 0.758 0 0.403-0.11 0.781-0.303 1.104l0.005-0.010c-0.459 0.983-1.016 1.829-1.677 2.582l0.011-0.012c-0.588 0.687-1.26 1.279-2.004 1.768l-0.036 0.022c-0.689 0.451-1.49 0.805-2.346 1.017l-0.054 0.011c0.060 0.034 0.132 0.072 0.218 0.112 0.776 0.322 1.678 0.561 2.618 0.675l0.050 0.005 0.498 0.078 0.234 0.446c0.116 0.255 0.209 0.553 0.265 0.863l0.003 0.023c0.038 0.164 0.072 0.328 0.118 0.496 0.12-0.014 0.242-0.042 0.378-0.068 0.528-0.12 1.138-0.192 1.762-0.2l0.006-0zM30.244 22.892v0z"></path>\n</svg>\n',tiktok:'\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>tiktok</title>\n<path d="M29.046 7.029c-3.359 0-6.092-2.733-6.092-6.092 0-0.518-0.42-0.938-0.938-0.938h-5.021c-0.518 0-0.938 0.42-0.938 0.938v20.585c0 1.975-1.606 3.581-3.581 3.581s-3.581-1.606-3.581-3.581c0-1.975 1.606-3.581 3.581-3.581 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938-5.777 0-10.477 4.7-10.477 10.477s4.7 10.477 10.477 10.477c5.777 0 10.477-4.7 10.477-10.477v-9.112c1.866 0.995 3.942 1.514 6.092 1.514 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938zM28.108 12.011c-2.001-0.166-3.902-0.866-5.544-2.047-0.285-0.206-0.662-0.234-0.975-0.073s-0.51 0.482-0.51 0.834v10.798c0 4.743-3.859 8.602-8.602 8.602s-8.602-3.859-8.602-8.602c0-4.427 3.361-8.083 7.665-8.552v3.176c-2.563 0.446-4.519 2.687-4.519 5.376 0 3.009 2.447 5.456 5.456 5.456s5.456-2.448 5.456-5.456v-19.648h3.201c0.429 3.645 3.329 6.545 6.974 6.974z"></path>\n</svg>\n'},this.socialSlot=this.host.querySelector('[slot="social-item"]')?.innerHTML||'<a href={link} rel="noopener" target="_blank" title={type} aria-label={type}><span class="s-social-icon">{icon}</span></a>',salla.lang.onLoaded((()=>{this.links=salla.config.get("store.social")}))}getLinksArray(){return this.links?Object.entries(this.links).filter((([c,l])=>!!l&&"whatsapp"!==c)).map((([c,l])=>({type:c,value:l}))):[]}componentWillLoad(){return new Promise((c=>salla.onReady(c)))}render(){const c=this.getLinksArray();return l(t,{key:"63d306c569080a2719d6e2731dc5fe0d6b8f77f4"},l("ul",{key:"12c71e69359695da6c2ab3f607973b314c639e1e",class:"s-social-list"},c.map((c=>l("li",{class:"s-social-link"},l("div",{id:"social-slot",innerHTML:this.socialSlot.replace(/\{icon\}/g,this.iconsList[c.type]).replace(/\{type\}/g,c.type).replace(/\{link\}/g,c.value.toString())}))))))}componentDidRender(){this.host.querySelectorAll("#social-slot").forEach((c=>c.replaceWith(c.firstChild))),this.host.querySelector('[slot="social-item"]')?.remove()}get host(){return s(this)}};o.style=":host{display:block}";export{o as salla_social}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as e,H as s,a as l,F as d}from"./p-BpoZBzEy.js";const o=class{constructor(e){t(this,e),this.sections=[],this.itemNumber=""}deleteItem(t,e){const s=this.host.closest("form");if(s){const l=s.getAttribute("id");if(l&&"string"==typeof l){const s=l.match(/item-(\d+)/)?.[1];this.itemNumber=s||"";const d=this.host.querySelector(`#accordion-${e.id}`);salla.cart.deleteItem(`${this.itemNumber}?product_id=${e.id}&section_id=${t}`).then((()=>d?.remove()))}}}renderRemoveButton(t,s,l=!1){return e("salla-button",{type:"button",shape:l?"btn":"icon",fill:l?"outline":"solid",size:"small",color:"danger","aria-label":"Remove from the cart",onClick:()=>this.deleteItem(t,s)},l?salla.lang.get("common.elements.delete"):e("i",{class:"sicon-cancel"}))}renderAccordionHeader(t,s){const l=s?.options&&s?.options?.length>0;return e("div",{slot:"html",class:"s-multiple-bundle-product-cart-header-wrapper"},e("div",{class:"s-multiple-bundle-product-cart-header "+(l?"":"s-multiple-bundle-product-cart-header-no-options")},e("div",{class:"s-multiple-bundle-product-cart-header-content"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-image-wrapper"},e("img",{src:s?.image?.url,alt:s?.image?.alt||s?.name,class:"s-multiple-bundle-product-cart-header-image"})),e("div",{class:"s-multiple-bundle-product-cart-header-content-details"},e("h2",{class:"s-multiple-bundle-product-cart-header-content-details-title"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-content-details-title-link"},s?.name)),e("div",{class:"s-multiple-bundle-product-cart-header-content-details-price"},e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-regular"},e("span",{innerHTML:s?.price?salla.money(s?.price):""})),s?.sale_price>0&&e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-sale"},e("span",{innerHTML:salla.money(s?.sale_price)}))),s?.quantity_in_group>0&&0!==s?.quantity&&e("p",{class:"s-multiple-bundle-product-cart-header-content-details-quantity"},e("span",null,salla.lang.get("pages.products.number_of_pieces")),e("span",null,s?.quantity_in_group)))),!l&&e("div",{class:"s-multiple-bundle-product-cart-header-remove-button"},this.renderRemoveButton(t,s,!1))))}render(){return e(s,{key:"92c0fba176ee0d769f866a0ed50a1b27d43e9717",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"3184473ec9399f29fa225287d6adeea109b097ec",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>t.products.map((l=>{const d={sectionId:t.id,sectionIndex:s,productId:l.id};return e("salla-accordion",{key:l.id,collapsed:!1,bordered:!0,collapsible:!!(l.options&&l.options.length>0),size:"sm",id:`accordion-${l.id}`},e("salla-accordion-head",null,this.renderAccordionHeader(String(t.id),l)),l.options&&l.options.length>0&&e("salla-accordion-body",null,e("salla-product-options",{options:JSON.stringify(l.options),key:`${l.id}-persistent`,"product-id":l.id,"bundle-context":JSON.stringify(d)}),e("div",{class:"s-multiple-bundle-product-cart-body-remove-button"},this.renderRemoveButton(String(t.id),l,!0))))}))))))}get host(){return l(this)}};o.style="";const a=class{constructor(e){t(this,e),this.sections=[],this.selectedProducts={},this.productSelectedHandler=null,this.onSelectProduct=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const s=e.id,l=this.selectedProducts[t].has(s);l?(this.selectedProducts[t].delete(s),this.clearProductFormData(s,t),this.clearProductModalOptions(s,t)):this.selectedProducts[t].add(s),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options,wasSelected:l,isSelected:!l})},this.ensureProductSelected=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const s=e.id;this.selectedProducts[t].has(s)||(this.selectedProducts[t].add(s),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options}))},this.onSelectProductOptions=(t,e)=>{const s=this.sections.findIndex((t=>t.id==e)),l=this.sections.find((t=>t.id==e)),d=l?.products?.findIndex((e=>e.id==t.id))??0;salla.event.dispatch("multiple-bundle-product-modal::open",{product:t,sectionId:e,sectionIndex:s,productIndex:d})},this.handleBundleSliderProductSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProduct(s,e)},this.handleBundleSliderProductOptionsSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProductOptions(e,s)}}clearProductFormData(t,e){const s=this.host.closest("form");if(e){const l=`bundle[${e}][`;Array.from(s.querySelectorAll("input")).filter((e=>e.getAttribute("data-product-id")===String(t)&&e.name&&e.name.startsWith(l))).forEach((t=>t.remove()))}else s.querySelectorAll(`[data-product-id="${t}"]`).forEach((t=>t.remove()))}clearProductModalOptions(t,e){let s=null,l=null;if(null!=e&&(s=this.sections.findIndex((t=>t.id==e)),s>-1)){const e=this.sections[s];if(e){const s=e.products?.findIndex((e=>e.id==t));l="number"==typeof s&&s>-1?s:null}}salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t,sectionId:e,sectionIndex:s,productIndex:l})}renderAccordionHeader(t,s){return e(d,null,e("h2",{slot:"title"},t?.name),t?.obligatory_products?e("span",{slot:"note"},salla.lang.get("pages.products.obligatory_products",{count:t?.obligatory_products||0})):"",e("span",{slot:"progress"},s,"/",t?.products?.length||0))}componentDidLoad(){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&(this.productSelectedHandler=t=>{const{productId:e,sectionId:s,product:l,fromModal:d}=t.detail;d?this.ensureProductSelected(s,l||{id:e}):this.onSelectProduct(s,l||{id:e})},t.addEventListener("productSelected",this.productSelectedHandler))}disconnectedCallback(){if(this.productSelectedHandler){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&t.removeEventListener("productSelected",this.productSelectedHandler),this.productSelectedHandler=null}}render(){return e(s,{key:"9d632fa75f2dd987a03a8d8c417e520503b4b71d",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"05517aff0eae9141a8f1f7fa0d72044fbbd46af9",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>e("salla-accordion",{key:t.id,collapsed:0!==s},e("salla-accordion-head",null,this.renderAccordionHeader(t,this.selectedProducts[t.id]?.size||0)),e("salla-accordion-body",null,e("salla-multiple-bundle-product-slider",{section:t,sectionIndex:s,selectedProducts:this.selectedProducts,onProductSelected:this.handleBundleSliderProductSelected,onProductOptionsSelected:this.handleBundleSliderProductOptionsSelected})))))),e("salla-multiple-bundle-product-options-modal",{key:"ac01f882d3e8268b41032857816ba9481918f484"}))}get host(){return l(this)}};a.style="";export{o as salla_multiple_bundle_product_cart,a as salla_multiple_bundle_product_details}
4
+ import{r as t,h as e,H as s,a as l,F as d}from"./p-B-fHbvwg.js";const o=class{constructor(e){t(this,e),this.sections=[],this.itemNumber=""}deleteItem(t,e){const s=this.host.closest("form");if(s){const l=s.getAttribute("id");if(l&&"string"==typeof l){const s=l.match(/item-(\d+)/)?.[1];this.itemNumber=s||"";const d=this.host.querySelector(`#accordion-${e.id}`);salla.cart.deleteItem(`${this.itemNumber}?product_id=${e.id}&section_id=${t}`).then((()=>d?.remove()))}}}renderRemoveButton(t,s,l=!1){return e("salla-button",{type:"button",shape:l?"btn":"icon",fill:l?"outline":"solid",size:"small",color:"danger","aria-label":"Remove from the cart",onClick:()=>this.deleteItem(t,s)},l?salla.lang.get("common.elements.delete"):e("i",{class:"sicon-cancel"}))}renderAccordionHeader(t,s){const l=s?.options&&s?.options?.length>0;return e("div",{slot:"html",class:"s-multiple-bundle-product-cart-header-wrapper"},e("div",{class:"s-multiple-bundle-product-cart-header "+(l?"":"s-multiple-bundle-product-cart-header-no-options")},e("div",{class:"s-multiple-bundle-product-cart-header-content"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-image-wrapper"},e("img",{src:s?.image?.url,alt:s?.image?.alt||s?.name,class:"s-multiple-bundle-product-cart-header-image"})),e("div",{class:"s-multiple-bundle-product-cart-header-content-details"},e("h2",{class:"s-multiple-bundle-product-cart-header-content-details-title"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-content-details-title-link"},s?.name)),e("div",{class:"s-multiple-bundle-product-cart-header-content-details-price"},e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-regular"},e("span",{innerHTML:s?.price?salla.money(s?.price):""})),s?.sale_price>0&&e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-sale"},e("span",{innerHTML:salla.money(s?.sale_price)}))),s?.quantity_in_group>0&&0!==s?.quantity&&e("p",{class:"s-multiple-bundle-product-cart-header-content-details-quantity"},e("span",null,salla.lang.get("pages.products.number_of_pieces")),e("span",null,s?.quantity_in_group)))),!l&&e("div",{class:"s-multiple-bundle-product-cart-header-remove-button"},this.renderRemoveButton(t,s,!1))))}render(){return e(s,{key:"92c0fba176ee0d769f866a0ed50a1b27d43e9717",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"3184473ec9399f29fa225287d6adeea109b097ec",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>t.products.map((l=>{const d={sectionId:t.id,sectionIndex:s,productId:l.id};return e("salla-accordion",{key:l.id,collapsed:!1,bordered:!0,collapsible:!!(l.options&&l.options.length>0),size:"sm",id:`accordion-${l.id}`},e("salla-accordion-head",null,this.renderAccordionHeader(String(t.id),l)),l.options&&l.options.length>0&&e("salla-accordion-body",null,e("salla-product-options",{options:JSON.stringify(l.options),key:`${l.id}-persistent`,"product-id":l.id,"bundle-context":JSON.stringify(d)}),e("div",{class:"s-multiple-bundle-product-cart-body-remove-button"},this.renderRemoveButton(String(t.id),l,!0))))}))))))}get host(){return l(this)}};o.style="";const a=class{constructor(e){t(this,e),this.sections=[],this.selectedProducts={},this.productSelectedHandler=null,this.onSelectProduct=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const s=e.id,l=this.selectedProducts[t].has(s);l?(this.selectedProducts[t].delete(s),this.clearProductFormData(s,t),this.clearProductModalOptions(s,t)):this.selectedProducts[t].add(s),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options,wasSelected:l,isSelected:!l})},this.ensureProductSelected=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const s=e.id;this.selectedProducts[t].has(s)||(this.selectedProducts[t].add(s),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options}))},this.onSelectProductOptions=(t,e)=>{const s=this.sections.findIndex((t=>t.id==e)),l=this.sections.find((t=>t.id==e)),d=l?.products?.findIndex((e=>e.id==t.id))??0;salla.event.dispatch("multiple-bundle-product-modal::open",{product:t,sectionId:e,sectionIndex:s,productIndex:d})},this.handleBundleSliderProductSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProduct(s,e)},this.handleBundleSliderProductOptionsSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProductOptions(e,s)}}clearProductFormData(t,e){const s=this.host.closest("form");if(e){const l=`bundle[${e}][`;Array.from(s.querySelectorAll("input")).filter((e=>e.getAttribute("data-product-id")===String(t)&&e.name&&e.name.startsWith(l))).forEach((t=>t.remove()))}else s.querySelectorAll(`[data-product-id="${t}"]`).forEach((t=>t.remove()))}clearProductModalOptions(t,e){let s=null,l=null;if(null!=e&&(s=this.sections.findIndex((t=>t.id==e)),s>-1)){const e=this.sections[s];if(e){const s=e.products?.findIndex((e=>e.id==t));l="number"==typeof s&&s>-1?s:null}}salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t,sectionId:e,sectionIndex:s,productIndex:l})}renderAccordionHeader(t,s){return e(d,null,e("h2",{slot:"title"},t?.name),t?.obligatory_products?e("span",{slot:"note"},salla.lang.get("pages.products.obligatory_products",{count:t?.obligatory_products||0})):"",e("span",{slot:"progress"},s,"/",t?.products?.length||0))}componentDidLoad(){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&(this.productSelectedHandler=t=>{const{productId:e,sectionId:s,product:l,fromModal:d}=t.detail;d?this.ensureProductSelected(s,l||{id:e}):this.onSelectProduct(s,l||{id:e})},t.addEventListener("productSelected",this.productSelectedHandler))}disconnectedCallback(){if(this.productSelectedHandler){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&t.removeEventListener("productSelected",this.productSelectedHandler),this.productSelectedHandler=null}}render(){return e(s,{key:"9d632fa75f2dd987a03a8d8c417e520503b4b71d",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"05517aff0eae9141a8f1f7fa0d72044fbbd46af9",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>e("salla-accordion",{key:t.id,collapsed:0!==s},e("salla-accordion-head",null,this.renderAccordionHeader(t,this.selectedProducts[t.id]?.size||0)),e("salla-accordion-body",null,e("salla-multiple-bundle-product-slider",{section:t,sectionIndex:s,selectedProducts:this.selectedProducts,onProductSelected:this.handleBundleSliderProductSelected,onProductOptionsSelected:this.handleBundleSliderProductOptionsSelected})))))),e("salla-multiple-bundle-product-options-modal",{key:"ac01f882d3e8268b41032857816ba9481918f484"}))}get host(){return l(this)}};a.style="";export{o as salla_multiple_bundle_product_cart,a as salla_multiple_bundle_product_details}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as a,a as s}from"./p-BpoZBzEy.js";const l=class{constructor(a){e(this,a),this.hasError=!1,salla.event.on("size-guide::open",(e=>this.open(e))),salla.lang.onLoaded((()=>{this.placeholder_title=salla.lang.get("pages.products.size_guide_placeholder"),this.placeholder_description=salla.lang.get("pages.products.size_guide_placeholder_info"),this.modal_title=salla.lang.get("pages.products.size_guides")}))}async open(e){return this.modal.setTitle(this.modal_title),this.modal.open(),await salla.api.withoutNotifier((()=>salla.product.getSizeGuides(e))).then((e=>{this.guides=e.data})).catch((e=>{console.log(e),this.hasError=!0,this.placeholder_description=e.response?.data?.error?.message||e.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}showPlaceholder(){return a("salla-placeholder",{alignment:"center",iconSize:"xl"},a("div",{slot:"title"},this.placeholder_title),a("div",{slot:"description"},this.placeholder_description))}render(){return a("salla-modal",{key:"ee92769c8a6ef18fa3817c39dbf26a6a4bff23a8",class:"s-product-size-guide-wrapper",id:"salla-product-size-guide-modal",isLoading:!0,"has-skeleton":!0,width:"md",ref:e=>this.modal=e},a("span",{key:"3d969a0a2c77b8f873dcb934ed2421537cb964e4",slot:"icon",class:"s-product-size-guide-header-icon",innerHTML:'\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>pencil-ruler</title>\n<path d="M3.057 11.609c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l6.667-6.667c0.521-0.521 0.521-1.364 0-1.885l-1.285-1.285c-1.143-1.143-2.661-1.772-4.276-1.772-1.616 0-3.135 0.629-4.276 1.772-1.143 1.141-1.772 2.66-1.772 4.276 0 1.615 0.629 3.135 1.772 4.276zM3.657 3.657c1.277-1.277 3.504-1.277 4.781 0l0.343 0.343-4.781 4.781-0.343-0.343c-0.639-0.639-0.991-1.488-0.991-2.391s0.352-1.752 0.991-2.391zM29.317 20.972c-0.2-0.707-0.932-1.119-1.645-0.921-0.709 0.2-1.121 0.937-0.921 1.645l1.987 7.041-7.041-1.987c-0.707-0.195-1.444 0.213-1.645 0.921-0.2 0.708 0.212 1.445 0.921 1.645l9.333 2.633c0.119 0.032 0.24 0.049 0.361 0.049 0.349 0 0.689-0.137 0.943-0.391 0.341-0.341 0.472-0.84 0.34-1.305zM31.609 8.772l-8.381-8.381c-0.5-0.5-1.385-0.5-1.885 0l-8.171 8.171s-0.001 0-0.001 0.001 0 0.001-0.001 0.001l-4.607 4.607s0 0-0.001 0 0 0 0 0.001l-8.171 8.171c-0.251 0.249-0.391 0.588-0.391 0.943 0 0.353 0.14 0.693 0.391 0.943l8.381 8.381c0.249 0.251 0.589 0.391 0.943 0.391s0.693-0.14 0.943-0.391l20.952-20.952c0.521-0.521 0.521-1.365 0-1.885zM9.715 28.781l-6.495-6.496 1.676-1.676 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-3.008-3.008 2.724-2.724 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.52 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.365 0-1.885l-3.008-3.008 1.677-1.677 6.496 6.496z"></path>\n</svg>\n'}),a("div",{key:"e018072d407a6c44f8481c08efc59a991a0eb3fd",slot:"loading"},a("div",{key:"0667c648322893ad770faf98cebe245917ff63f4",class:"s-product-size-guide-skeleton"},a("salla-skeleton",{key:"758a611fa61eda549a6decc541c11da1115a2f2f",height:"15px",width:"25%"}),a("div",{key:"8ab9e86a59b4cbb9a03458599a7fef9bd8243573",class:"s-product-size-guide-skeleton-header"},a("salla-skeleton",{key:"01c47a9a1776c53ce84034bb0c0decf8485fcd6a",height:"40px"}),a("salla-skeleton",{key:"65aee0267fc69e08993fe57df2722dd5b90900ae",height:"40px"}),a("salla-skeleton",{key:"250836e73e41353588a08c15ae619730617a96d3",height:"40px"}),a("salla-skeleton",{key:"f69fe0eac766ecb7441ea41b43e679921211e8c1",height:"40px"})),a("div",{key:"5e9d83171dba98fb4beb8ab149ae7f075f528c26",class:"s-product-size-guide-skeleton-content"},a("salla-skeleton",{key:"259f2f0fe3e0e4ed568119ca3967541785b4875d",height:"15px",width:"25%"}),a("salla-skeleton",{key:"0f66a4bc8e1a426f19787775e39fdc526e5635ab",height:"10px",width:"75%"}),a("salla-skeleton",{key:"ae62c34708c5f4b6ece5eb3caf13b867b2c1e17c",height:"10px",width:"50%"}),a("salla-skeleton",{key:"c3a03c44c2452d4dd37eaf6d3927e2ae8ef885fd",height:"10px",width:"75%"}),a("salla-skeleton",{key:"fb42a6a8dd803f8cef6e5990a5f2e17e6e87bbfc",height:"10px",width:"100%"}),a("salla-skeleton",{key:"b972cba0a06ae46f09fa4c8a352a780e9b620445",height:"10px",width:"25%"}),a("salla-skeleton",{key:"ac3d5c03485c0d64dc3d868c8f1588565167b60e",height:"10px",width:"60%"}),a("salla-skeleton",{key:"ec3a83f4eb22bc42d6df5f37bb04b9da54edf309",height:"10px",width:"45%"}),a("salla-skeleton",{key:"62e8d10fae559f7abe3ed3088c03e4fa5e2230b4",height:"10px",width:"30%"})))),a("slot",{key:"59ab1d26dde5103727840c81c4e855638403bf13",name:"header"}),!this.hasError&&this.guides?[a("salla-tabs",null,this.guides.map((e=>a("salla-tab-header",{slot:"header",name:e.name},a("span",null,e.name)))),this.guides.map((e=>a("salla-tab-content",{slot:"content",name:e.name},a("div",{innerHTML:e.description})))))]:this.showPlaceholder(),a("slot",{key:"efd65db973af6678c45c97b5021702dc0585f621",name:"footer"}))}get host(){return s(this)}};l.style="";export{l as salla_product_size_guide}
4
+ import{r as e,h as a,a as s}from"./p-B-fHbvwg.js";const l=class{constructor(a){e(this,a),this.hasError=!1,salla.event.on("size-guide::open",(e=>this.open(e))),salla.lang.onLoaded((()=>{this.placeholder_title=salla.lang.get("pages.products.size_guide_placeholder"),this.placeholder_description=salla.lang.get("pages.products.size_guide_placeholder_info"),this.modal_title=salla.lang.get("pages.products.size_guides")}))}async open(e){return this.modal.setTitle(this.modal_title),this.modal.open(),await salla.api.withoutNotifier((()=>salla.product.getSizeGuides(e))).then((e=>{this.guides=e.data})).catch((e=>{console.log(e),this.hasError=!0,this.placeholder_description=e.response?.data?.error?.message||e.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}showPlaceholder(){return a("salla-placeholder",{alignment:"center",iconSize:"xl"},a("div",{slot:"title"},this.placeholder_title),a("div",{slot:"description"},this.placeholder_description))}render(){return a("salla-modal",{key:"ee92769c8a6ef18fa3817c39dbf26a6a4bff23a8",class:"s-product-size-guide-wrapper",id:"salla-product-size-guide-modal",isLoading:!0,"has-skeleton":!0,width:"md",ref:e=>this.modal=e},a("span",{key:"3d969a0a2c77b8f873dcb934ed2421537cb964e4",slot:"icon",class:"s-product-size-guide-header-icon",innerHTML:'\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>pencil-ruler</title>\n<path d="M3.057 11.609c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l6.667-6.667c0.521-0.521 0.521-1.364 0-1.885l-1.285-1.285c-1.143-1.143-2.661-1.772-4.276-1.772-1.616 0-3.135 0.629-4.276 1.772-1.143 1.141-1.772 2.66-1.772 4.276 0 1.615 0.629 3.135 1.772 4.276zM3.657 3.657c1.277-1.277 3.504-1.277 4.781 0l0.343 0.343-4.781 4.781-0.343-0.343c-0.639-0.639-0.991-1.488-0.991-2.391s0.352-1.752 0.991-2.391zM29.317 20.972c-0.2-0.707-0.932-1.119-1.645-0.921-0.709 0.2-1.121 0.937-0.921 1.645l1.987 7.041-7.041-1.987c-0.707-0.195-1.444 0.213-1.645 0.921-0.2 0.708 0.212 1.445 0.921 1.645l9.333 2.633c0.119 0.032 0.24 0.049 0.361 0.049 0.349 0 0.689-0.137 0.943-0.391 0.341-0.341 0.472-0.84 0.34-1.305zM31.609 8.772l-8.381-8.381c-0.5-0.5-1.385-0.5-1.885 0l-8.171 8.171s-0.001 0-0.001 0.001 0 0.001-0.001 0.001l-4.607 4.607s0 0-0.001 0 0 0 0 0.001l-8.171 8.171c-0.251 0.249-0.391 0.588-0.391 0.943 0 0.353 0.14 0.693 0.391 0.943l8.381 8.381c0.249 0.251 0.589 0.391 0.943 0.391s0.693-0.14 0.943-0.391l20.952-20.952c0.521-0.521 0.521-1.365 0-1.885zM9.715 28.781l-6.495-6.496 1.676-1.676 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-3.008-3.008 2.724-2.724 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.52 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.365 0-1.885l-3.008-3.008 1.677-1.677 6.496 6.496z"></path>\n</svg>\n'}),a("div",{key:"e018072d407a6c44f8481c08efc59a991a0eb3fd",slot:"loading"},a("div",{key:"0667c648322893ad770faf98cebe245917ff63f4",class:"s-product-size-guide-skeleton"},a("salla-skeleton",{key:"758a611fa61eda549a6decc541c11da1115a2f2f",height:"15px",width:"25%"}),a("div",{key:"8ab9e86a59b4cbb9a03458599a7fef9bd8243573",class:"s-product-size-guide-skeleton-header"},a("salla-skeleton",{key:"01c47a9a1776c53ce84034bb0c0decf8485fcd6a",height:"40px"}),a("salla-skeleton",{key:"65aee0267fc69e08993fe57df2722dd5b90900ae",height:"40px"}),a("salla-skeleton",{key:"250836e73e41353588a08c15ae619730617a96d3",height:"40px"}),a("salla-skeleton",{key:"f69fe0eac766ecb7441ea41b43e679921211e8c1",height:"40px"})),a("div",{key:"5e9d83171dba98fb4beb8ab149ae7f075f528c26",class:"s-product-size-guide-skeleton-content"},a("salla-skeleton",{key:"259f2f0fe3e0e4ed568119ca3967541785b4875d",height:"15px",width:"25%"}),a("salla-skeleton",{key:"0f66a4bc8e1a426f19787775e39fdc526e5635ab",height:"10px",width:"75%"}),a("salla-skeleton",{key:"ae62c34708c5f4b6ece5eb3caf13b867b2c1e17c",height:"10px",width:"50%"}),a("salla-skeleton",{key:"c3a03c44c2452d4dd37eaf6d3927e2ae8ef885fd",height:"10px",width:"75%"}),a("salla-skeleton",{key:"fb42a6a8dd803f8cef6e5990a5f2e17e6e87bbfc",height:"10px",width:"100%"}),a("salla-skeleton",{key:"b972cba0a06ae46f09fa4c8a352a780e9b620445",height:"10px",width:"25%"}),a("salla-skeleton",{key:"ac3d5c03485c0d64dc3d868c8f1588565167b60e",height:"10px",width:"60%"}),a("salla-skeleton",{key:"ec3a83f4eb22bc42d6df5f37bb04b9da54edf309",height:"10px",width:"45%"}),a("salla-skeleton",{key:"62e8d10fae559f7abe3ed3088c03e4fa5e2230b4",height:"10px",width:"30%"})))),a("slot",{key:"59ab1d26dde5103727840c81c4e855638403bf13",name:"header"}),!this.hasError&&this.guides?[a("salla-tabs",null,this.guides.map((e=>a("salla-tab-header",{slot:"header",name:e.name},a("span",null,e.name)))),this.guides.map((e=>a("salla-tab-content",{slot:"content",name:e.name},a("div",{innerHTML:e.description})))))]:this.showPlaceholder(),a("slot",{key:"efd65db973af6678c45c97b5021702dc0585f621",name:"footer"}))}get host(){return s(this)}};l.style="";export{l as salla_product_size_guide}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,c as t,h as s,H as i}from"./p-BpoZBzEy.js";import{a}from"./p-BedNk7k1.js";const l=class{constructor(s){e(this,s),this.changed=t(this,"changed"),this.min=0,this.max=1e4,this.moreThanLabel="أكثر من",this.lessThanLabel="أقل من",this.toLabel="الى",this.fromLabel="من",this.typing=!1,this.isMin=!1,this.isRTL=salla.config.get("theme.is_rtl",!0),this.filterValues=[]}connectedCallback(){if(this.filtersData&&this.filtersData?.price&&(this.minPrice=this.filtersData.price.min,this.maxPrice=this.filtersData.price.max),salla.lang.onLoaded((()=>{this.moreThanLabel=salla.lang.getWithDefault("common.elements.more_than",this.moreThanLabel),this.lessThanLabel=salla.lang.getWithDefault("common.elements.less_than",this.lessThanLabel),this.toLabel=salla.lang.getWithDefault("common.elements.to",this.toLabel),this.fromLabel=salla.lang.getWithDefault("common.elements.from",this.fromLabel)})),1==this.option.values.length)return;if(this.option.values.length<=5)return void(this.filterValues=this.option.values);const e=Math.ceil(this.option.values.length/5);for(let t=0;t<this.option.values.length;t+=e)this.filterValues.push(this.option.values.slice(t,t+e).reduce(((e,t)=>(e.to=t.to,e.count+=t.count,e))))}async reset(){this.minInput.value=null,this.maxInput.value=null,this.minPrice=null,this.maxPrice=null}getPriceLabel(e){return isNaN(e.from)||e.from<1?`${this.lessThanLabel} ${salla.money(e.to)}`:isNaN(e.to)||e.to<1?`${this.moreThanLabel} ${salla.money(e.from)}`:`${salla.money(e.from)} ${this.toLabel} ${salla.money(e.to)}`}minInputValidation(e){e&&(e>this.max||this.maxPrice&&e>this.maxPrice)||(e<this.min?this.minPrice=this.min:e&&(this.minPrice=e))}maxInputValidation(e){e&&(e<this.min||this.minPrice&&e<this.minPrice)||e>this.max&&(this.maxPrice=this.max)}async changedEventHandler(e){salla.helpers.inputDigitsOnly(this.minInput),salla.helpers.inputDigitsOnly(this.maxInput);const t=this.minPrice?1*+this.minPrice:null,s=this.maxPrice?1*+this.maxPrice:null;this.maxPrice||(this.maxPrice=""),this.isMin?this.minInputValidation(t):(this.minPrice||(this.minPrice=0),this.maxInputValidation(s)),this.isReady&&this.changed.emit({event:e,option:this.option,value:{max:this.maxPrice,min:this.minPrice}})}handleMinMaxPrice(e,t){this.minPrice=t.from,this.maxPrice="*"!==t.to?t.to:"",this.changedEventHandler(e)}isChecked(e){return!(!this.minPrice&&!this.maxPrice)&&(((e.from<1||"*"==e.from)&&0==this.minPrice||e.from==this.minPrice)&&("*"==e.to||!e.to||e.to==this.maxPrice))}handleMinPrice(e){this.isMin=!0;const t=e.target.value;this.minPrice=""===t?0:t}handleMaxPrice(e){this.isMin=!1;const t=e.target.value;this.maxPrice=void 0===t?"":t}render(){return s(i,{key:"e925357a9ad305bcdcb45e08b47328fe0551e966"},this.filterValues.map(((e,t)=>s("label",{class:"s-filters-label",htmlFor:`${this.option.key}-${t}`,key:t},s("input",{id:`${this.option.key}-${t}`,name:"price",type:"radio",checked:this.isChecked(e),class:"s-filters-radio",onChange:t=>this.handleMinMaxPrice(t,e)}),s("span",{innerHTML:this.getPriceLabel(e)})))),s("div",{key:"402f820f0b39da9351495ef274b50508bc20df94",class:"flex justify-center items-center"},s("div",{key:"9207efd9b9629b9167a0fe373ddb035c7ae319f9",class:"relative max-w-xl w-full"},s("div",{key:"aeac9d75de4cf783d03a53fd4c87d32e4dd7175d",class:"s-price-range-inputs"},s("div",{key:"b339efed61f4bcfe4553b0a7256cc8bf87b2a52f",class:"s-price-range-relative"},s("div",{key:"68bee590d6b8a2201cde80044f91bcfcb738ead6",class:"s-price-range-currency"}," ",salla.config.currency().symbol),s("input",{key:"3f74c22f11c4b4e770e8ed729c845cee0496cb12",type:"number",maxlength:"5",ref:e=>this.minInput=e,onBlur:e=>this.handleMinPrice(e),value:this.minPrice,placeholder:this.fromLabel,class:"s-price-range-number-input"})),s("div",{key:"3e7dc99a3404a6f8498466a9be3b71db856c23f4",class:"s-price-range-gray-text"}," -"),s("div",{key:"fa2703140f2346df311bf329c40f67b4a16df247",class:"s-price-range-relative"},s("div",{key:"e0ac6ee63329b64b320c8fb12c4a94b903785443",class:"s-price-range-currency"}," ",salla.config.currency().symbol),s("input",{key:"5aeab39a70a9ff02654b2c04b4db908672ca2dd8",type:"number",maxlength:"5",ref:e=>this.maxInput=e,onBlur:e=>this.handleMaxPrice(e),value:this.maxPrice,placeholder:this.toLabel,class:"s-price-range-number-input","aria-describedby":"price-currency"})),s("salla-button",{key:"6b27214991ebac764b2220beb4cb31a339203657",color:"gray",shape:"icon",size:"small",fill:"outline",onClick:e=>this.changedEventHandler(e)},s("span",{key:"7713e50bc43c1be0610f5f64e7513c0bbe5ec249",innerHTML:this.isRTL?a:'\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>arrow-right</title>\n<path d="M29.217 15.465c-0.019-0.044-0.056-0.077-0.080-0.119-0.067-0.116-0.139-0.227-0.236-0.317-0.011-0.009-0.013-0.024-0.024-0.033l-10.667-9.333c-0.553-0.484-1.396-0.429-1.881 0.125-0.484 0.555-0.428 1.396 0.127 1.881l7.996 6.997h-20.452c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h20.452l-7.996 6.997c-0.555 0.485-0.611 1.327-0.127 1.881 0.264 0.3 0.633 0.455 1.004 0.455 0.312 0 0.625-0.109 0.877-0.331l10.667-9.333c0.011-0.009 0.015-0.024 0.024-0.033 0.097-0.091 0.169-0.201 0.236-0.317 0.024-0.041 0.060-0.075 0.080-0.119 0.073-0.163 0.116-0.343 0.116-0.533s-0.043-0.371-0.116-0.535z"></path>\n</svg>\n'}))))))}componentDidLoad(){this.isReady=!0}};l.style=":host{display:block}.rtl .rtl-range-slider,[dir=rtl] .rtl-range-slider{transform:rotateY(180deg)}.rtl .rtl-range-numbers,[dir=rtl] .rtl-range-numbers{flex-direction:row-reverse}.rtl .form-select,.rtl select,[dir=rtl] .form-select,[dir=rtl] select{background-position:left 0.5rem center;padding-right:12px}.rtl .menu-divide li:not(:last-child):after,[dir=rtl] .menu-divide li:not(:last-child):after{left:0;right:auto}input[type=range]::-webkit-slider-thumb{pointer-events:all;width:24px;height:24px;-webkit-appearance:none}[type=checkbox]:checked{background-size:80%}";export{l as salla_price_range}
4
+ import{r as e,c as t,h as s,H as i}from"./p-B-fHbvwg.js";import{a}from"./p-BedNk7k1.js";const l=class{constructor(s){e(this,s),this.changed=t(this,"changed"),this.min=0,this.max=1e4,this.moreThanLabel="أكثر من",this.lessThanLabel="أقل من",this.toLabel="الى",this.fromLabel="من",this.typing=!1,this.isMin=!1,this.isRTL=salla.config.get("theme.is_rtl",!0),this.filterValues=[]}connectedCallback(){if(this.filtersData&&this.filtersData?.price&&(this.minPrice=this.filtersData.price.min,this.maxPrice=this.filtersData.price.max),salla.lang.onLoaded((()=>{this.moreThanLabel=salla.lang.getWithDefault("common.elements.more_than",this.moreThanLabel),this.lessThanLabel=salla.lang.getWithDefault("common.elements.less_than",this.lessThanLabel),this.toLabel=salla.lang.getWithDefault("common.elements.to",this.toLabel),this.fromLabel=salla.lang.getWithDefault("common.elements.from",this.fromLabel)})),1==this.option.values.length)return;if(this.option.values.length<=5)return void(this.filterValues=this.option.values);const e=Math.ceil(this.option.values.length/5);for(let t=0;t<this.option.values.length;t+=e)this.filterValues.push(this.option.values.slice(t,t+e).reduce(((e,t)=>(e.to=t.to,e.count+=t.count,e))))}async reset(){this.minInput.value=null,this.maxInput.value=null,this.minPrice=null,this.maxPrice=null}getPriceLabel(e){return isNaN(e.from)||e.from<1?`${this.lessThanLabel} ${salla.money(e.to)}`:isNaN(e.to)||e.to<1?`${this.moreThanLabel} ${salla.money(e.from)}`:`${salla.money(e.from)} ${this.toLabel} ${salla.money(e.to)}`}minInputValidation(e){e&&(e>this.max||this.maxPrice&&e>this.maxPrice)||(e<this.min?this.minPrice=this.min:e&&(this.minPrice=e))}maxInputValidation(e){e&&(e<this.min||this.minPrice&&e<this.minPrice)||e>this.max&&(this.maxPrice=this.max)}async changedEventHandler(e){salla.helpers.inputDigitsOnly(this.minInput),salla.helpers.inputDigitsOnly(this.maxInput);const t=this.minPrice?1*+this.minPrice:null,s=this.maxPrice?1*+this.maxPrice:null;this.maxPrice||(this.maxPrice=""),this.isMin?this.minInputValidation(t):(this.minPrice||(this.minPrice=0),this.maxInputValidation(s)),this.isReady&&this.changed.emit({event:e,option:this.option,value:{max:this.maxPrice,min:this.minPrice}})}handleMinMaxPrice(e,t){this.minPrice=t.from,this.maxPrice="*"!==t.to?t.to:"",this.changedEventHandler(e)}isChecked(e){return!(!this.minPrice&&!this.maxPrice)&&(((e.from<1||"*"==e.from)&&0==this.minPrice||e.from==this.minPrice)&&("*"==e.to||!e.to||e.to==this.maxPrice))}handleMinPrice(e){this.isMin=!0;const t=e.target.value;this.minPrice=""===t?0:t}handleMaxPrice(e){this.isMin=!1;const t=e.target.value;this.maxPrice=void 0===t?"":t}render(){return s(i,{key:"e925357a9ad305bcdcb45e08b47328fe0551e966"},this.filterValues.map(((e,t)=>s("label",{class:"s-filters-label",htmlFor:`${this.option.key}-${t}`,key:t},s("input",{id:`${this.option.key}-${t}`,name:"price",type:"radio",checked:this.isChecked(e),class:"s-filters-radio",onChange:t=>this.handleMinMaxPrice(t,e)}),s("span",{innerHTML:this.getPriceLabel(e)})))),s("div",{key:"402f820f0b39da9351495ef274b50508bc20df94",class:"flex justify-center items-center"},s("div",{key:"9207efd9b9629b9167a0fe373ddb035c7ae319f9",class:"relative max-w-xl w-full"},s("div",{key:"aeac9d75de4cf783d03a53fd4c87d32e4dd7175d",class:"s-price-range-inputs"},s("div",{key:"b339efed61f4bcfe4553b0a7256cc8bf87b2a52f",class:"s-price-range-relative"},s("div",{key:"68bee590d6b8a2201cde80044f91bcfcb738ead6",class:"s-price-range-currency"}," ",salla.config.currency().symbol),s("input",{key:"3f74c22f11c4b4e770e8ed729c845cee0496cb12",type:"number",maxlength:"5",ref:e=>this.minInput=e,onBlur:e=>this.handleMinPrice(e),value:this.minPrice,placeholder:this.fromLabel,class:"s-price-range-number-input"})),s("div",{key:"3e7dc99a3404a6f8498466a9be3b71db856c23f4",class:"s-price-range-gray-text"}," -"),s("div",{key:"fa2703140f2346df311bf329c40f67b4a16df247",class:"s-price-range-relative"},s("div",{key:"e0ac6ee63329b64b320c8fb12c4a94b903785443",class:"s-price-range-currency"}," ",salla.config.currency().symbol),s("input",{key:"5aeab39a70a9ff02654b2c04b4db908672ca2dd8",type:"number",maxlength:"5",ref:e=>this.maxInput=e,onBlur:e=>this.handleMaxPrice(e),value:this.maxPrice,placeholder:this.toLabel,class:"s-price-range-number-input","aria-describedby":"price-currency"})),s("salla-button",{key:"6b27214991ebac764b2220beb4cb31a339203657",color:"gray",shape:"icon",size:"small",fill:"outline",onClick:e=>this.changedEventHandler(e)},s("span",{key:"7713e50bc43c1be0610f5f64e7513c0bbe5ec249",innerHTML:this.isRTL?a:'\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>arrow-right</title>\n<path d="M29.217 15.465c-0.019-0.044-0.056-0.077-0.080-0.119-0.067-0.116-0.139-0.227-0.236-0.317-0.011-0.009-0.013-0.024-0.024-0.033l-10.667-9.333c-0.553-0.484-1.396-0.429-1.881 0.125-0.484 0.555-0.428 1.396 0.127 1.881l7.996 6.997h-20.452c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h20.452l-7.996 6.997c-0.555 0.485-0.611 1.327-0.127 1.881 0.264 0.3 0.633 0.455 1.004 0.455 0.312 0 0.625-0.109 0.877-0.331l10.667-9.333c0.011-0.009 0.015-0.024 0.024-0.033 0.097-0.091 0.169-0.201 0.236-0.317 0.024-0.041 0.060-0.075 0.080-0.119 0.073-0.163 0.116-0.343 0.116-0.533s-0.043-0.371-0.116-0.535z"></path>\n</svg>\n'}))))))}componentDidLoad(){this.isReady=!0}};l.style=":host{display:block}.rtl .rtl-range-slider,[dir=rtl] .rtl-range-slider{transform:rotateY(180deg)}.rtl .rtl-range-numbers,[dir=rtl] .rtl-range-numbers{flex-direction:row-reverse}.rtl .form-select,.rtl select,[dir=rtl] .form-select,[dir=rtl] select{background-position:left 0.5rem center;padding-right:12px}.rtl .menu-divide li:not(:last-child):after,[dir=rtl] .menu-divide li:not(:last-child):after{left:0;right:auto}input[type=range]::-webkit-slider-thumb{pointer-events:all;width:24px;height:24px;-webkit-appearance:none}[type=checkbox]:checked{background-size:80%}";export{l as salla_price_range}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as a,h as l,a as s}from"./p-BpoZBzEy.js";const e=class{constructor(l){a(this,l),this.languageNames={ar:"العربية",en:"English",sq:"shqip",hy:"հայերէն",bg:"български",zh:"汉语",hr:"hrvatski",cs:"čeština",da:"dansk",nl:"dutch",et:"eesti keel",fi:"suomen kieli",fr:"Français",de:"Deutsch",el:"Ελληνικά",hi:"हिन्दी",hu:"magyar",ind:"bahasa Indonesia",ga:"Gaeilge",it:"Italiano",ja:"日本語",ko:"한국어",lv:"latviešu",mt:"Maltese",fa:"فارسی",pl:"Polish",pt:"português",ro:"română",ru:"русский",sl:"slovenščina",es:"Español",sv:"svenska",tl:"Tagalog (Filipino)",tr:"Türkçe",uk:"украї́нська",ur:"اُردُو",ms:"Bahasa Malaysia"},this.currenciesList={SAR:{en:"Saudi Riyal",ar:"ريال سعودي",symbol:"ر.س"},USD:{en:"US Dollar",ar:"دولار أمريكي",symbol:"$"},EUR:{en:"Euro",ar:"يورو",symbol:"€"},AED:{en:"UAE Dirham",ar:"درهم اماراتي",symbol:"د.إ"},KWD:{en:"Kuwaiti Dinar",ar:"دينار كويتي",symbol:"د.ك"},BHD:{en:"Bahraini Dinar",ar:"دينار بحريني",symbol:"د.ب"},QAR:{en:"Qatari Riyal",ar:"ريال قطري",symbol:"ر.ق"},OMR:{en:"Omani Rial",ar:"ريال عماني",symbol:"ر.ع"},AUD:{en:"Australian Dollar",ar:"دولار استرالي",symbol:"$"},CAD:{en:"Canadian Dollar",ar:"دولار كندي",symbol:"$"},CNY:{en:"Renminbi",ar:"رنمينبي",symbol:"¥"},EGP:{en:"Egyptian Pound",ar:"جنيه مصري",symbol:"ج.م"},GBP:{en:"Pound Sterling",ar:"جنيه استرليني",symbol:"£"},IDR:{en:"Indonesian Rupiah",ar:"روبية إندونيسية",symbol:"Rp"},INR:{en:"Indian Rupee",ar:"روبية هندية",symbol:"₹"},JPY:{en:"Japanese Yen",ar:"ين ياباني",symbol:"¥"},MYR:{en:"Malaysian Ringgit",ar:"رينغيت ماليزي",symbol:"RM"},PKR:{en:"Pakistani Rupee",ar:"روبية باكستانية",symbol:"Rs."},SEK:{en:"Swedish Krona",ar:"كرونة سويدية",symbol:"kr"},SGD:{en:"Singapore Dollar",ar:"دولار سنغافوري",symbol:"$"},TRY:{en:"Turkish Lira",ar:"ليرة تركية",symbol:"₺"},IQD:{en:"Iraqi Dinar",ar:"دينار عراقي",symbol:"د.ع"},LBP:{en:"Lebanese Pound",ar:"ليرة لبنانية",symbol:"ل.ل"},MRO:{en:"Mauritanian Ouguiya",ar:"أوقية موريتانية",symbol:"UM"},SDG:{en:"Sudanese Pound",ar:"جنيه سوداني",symbol:"SDG"},SYP:{en:"Syrian Pound",ar:"ليرة سورية",symbol:"ل.س"},TND:{en:"Tunisian Dinar",ar:"دينار تونسي",symbol:"د.ت"},JOD:{en:"Jordanian Dinar",ar:"دينار أردني",symbol:"JOD"},DZD:{en:"Algerian Dinar",ar:"دينار جزائري",symbol:"دج"},MAD:{en:"Moroccan Dirham",ar:"درهم مغربي",symbol:"د.م."},LYD:{en:"Libyan Dinar",ar:"دينار ليبي",symbol:"LD"},YER:{en:"Yemeni Riyal",ar:"ريال يمني",symbol:"ر.ي"}},this.arabicCurrencies=["SAR","AED","KWD","BHD","QAR","OMR","EGP","IQD","LBP","SYP","TND","DZD","MAD","YER"],this.languages=[],this.currencies=[],this.hasError=!1,this.showTrigger=!1,this.languageSlot=this.host.querySelector('[slot="language"]')?.innerHTML||'<label class="s-localization-modal-label" for="lang-{code}"><span>{name}</span></label>',this.currencySlot=this.host.querySelector('[slot="currency"]')?.innerHTML||'<label class="s-localization-modal-label" for="currency-{code}"><span>{name}</span><small class="s-localization-modal-currency">{symbol}</small></label>'}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),Salla.event.on("localization::open",(()=>this.open())),this.language||(this.language=Salla.config.get("user.language_code")),this.currency||(this.currency=Salla.config.get("user.currency_code"))}async open(){return this.modal.open(),await Salla.api.withoutNotifier((()=>this.getLanguages())).then((()=>this.getCurrencies())).then((()=>{this.languages.length<2&&this.currencies.length<2&&this.modal.close()})).catch((a=>{console.log(a),this.hasError=!0,this.errorMessage=a.response?.data?.error?.message||a.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}getCurrency(a){return this.currenciesList[a||this.currency]||{en:"Saudi Riyal",ar:"ريال سعودي",symbol:"ر.س"}}getLanguageName(){return this.languageNames[this.language]||this.language||""}getCurrencySymbol(a){return"SAR"===(a=a||this.currency)?'<i class="sicon-sar"></i>':"ar"!==this.language&&this.arabicCurrencies.includes(a)?a:this.getCurrency(a).symbol}getCurrencyName(a){return"ar"===this.language?this.getCurrency(a).ar:this.getCurrency(a).en}async getLanguages(){return this.languages.length>1?null:await Salla.config.languages().then((a=>this.languages=a))}async getCurrencies(){return this.currencies.length>1?null:await Salla.config.currencies().then((a=>this.currencies=Object.values(a||{})))}onChangeCurrency(a){this.currency=a.target.value}onChangeLanguage(a){this.language=a.target.value}async submit(){let a;this.btn.load().then((()=>{if(this.currency){if(this.currency!==Salla.config.get("user.currency_code","SAR"))return a=window.location.href,Salla.currency.api.change(this.currency)}else Salla.log("There is no currency!")})).then((()=>{this.language!==Salla.config.get("user.language_code","ar")&&(a=Salla.helpers.addParamToUrl("lang",this.language))})).then((()=>{Salla.cookie.set("s-lang",this.language),Salla.cookie.set("s-curr",this.currency)})).then((()=>this.btn.stop())).then((()=>this.close())).then((()=>{a&&(window.location.href=a.replace(`/${Salla.config.get("user.language_code")}/`,`/${this.language}/`))}))}render(){return[this.showTrigger?l("button",{type:"button",onClick:()=>this.open(),class:"s-localization-modal-trigger-btn"},l("span",null,this.getLanguageName()),l("span",{class:"s-localization-modal-trigger-separator"},"|")," ",l("span",{innerHTML:this.getCurrencySymbol()})):"",l("salla-modal",{key:"ae9553ab14e30b7e9b6466d1e959e469e544ca5b",isLoading:!0,class:"s-hidden",ref:a=>this.modal=a,width:"xs"},l("div",{key:"84bf38810a3d1c99ee084951ef596cc33a18e4f7",slot:"loading"},l("div",{key:"5e808b2a7774bc1f1e1fe25cb880c45a3b97f1aa",class:"s-localization-modal-skeleton"},l("salla-skeleton",{key:"c0000d5f4f5fb663f059822fe1a4f24a78a9dd65",width:"25%",height:"15px"}),l("div",{key:"45164d658a0ee5e8825422af35605bfd83e383ff",class:"s-localization-modal-skeleton-content"},[...Array(4)].map((()=>l("div",{class:"s-localization-modal-skeleton-item"},l("div",{class:"s-localization-modal-skeleton-item-flex"},l("salla-skeleton",{type:"circle",height:"16px",width:"16px"}),l("salla-skeleton",{height:"10px",width:"100px"})),l("salla-skeleton",{height:"15px",width:"20px"}))))),l("salla-skeleton",{key:"1e63980f25677892f731e6ad30eda08b8a3852e0",width:"25%",height:"15px"}),l("div",{key:"b1263061b94885e99d540f90054244fb41fd0a68",class:"s-localization-modal-skeleton-content"},[...Array(4)].map((()=>l("div",{class:"s-localization-modal-skeleton-item"},l("div",{class:"s-localization-modal-skeleton-item-flex"},l("salla-skeleton",{type:"circle",height:"16px",width:"16px"}),l("salla-skeleton",{height:"10px",width:"100px"})),l("salla-skeleton",{height:"15px",width:"20px"}))))),l("salla-skeleton",{key:"6dfbe5d71475640cd41dfe3d01e9277f2b2b80c5",height:"40px",width:"100%"}))),this.hasError?l("salla-placeholder",{alignment:"center"},l("span",{slot:"description"},this.errorMessage)):l("div",{class:"s-localization-modal-inner"},this.languages.length>1?l("div",{class:"s-localization-modal-section"},l("label",{class:"s-localization-modal-title"},Salla.lang.get("common.titles.language")),l("div",{class:"s-localization-modal-section-inner"},this.languages.length<6?this.languages.map((a=>l("div",{class:"s-localization-modal-item"},l("input",{class:"s-localization-modal-input",type:"radio",checked:this.language==a.iso_code,onChange:()=>this.language=a.iso_code,name:"language",id:"lang-"+a.code.toLowerCase(),value:a.code}),l("div",{class:"s-localization-modal-label-slot",id:"language-slot",innerHTML:this.languageSlot.replace(/\{name\}/g,a.name).replace(/\{code\}/g,a.code).replace(/\{country_code\}/g,a.country_code)})))):l("select",{class:"s-localization-modal-select",name:"language",onChange:a=>this.onChangeLanguage(a)},this.languages.map((a=>l("option",{value:a.code,selected:this.language==a.code},a.name)))))):"",this.currencies.length>1?l("div",{class:"s-localization-modal-section"},l("label",{class:"s-localization-modal-title"},Salla.lang.get("common.titles.currency")),l("div",{class:"s-localization-modal-section-inner"},this.currencies.length<6?this.currencies.map((a=>l("div",{class:"s-localization-modal-item"},l("input",{class:"s-localization-modal-input",type:"radio",name:"currency",checked:this.currency==a.code,onChange:()=>this.currency=a.code,id:"currency-"+a.code,value:a.code}),l("div",{class:"s-localization-modal-label-slot",id:"currency-slot",innerHTML:this.currencySlot.replace(/\{name\}/g,this.getCurrencyName(a.code)).replace(/\{code\}/g,a.code).replace(/\{symbol\}/g,this.getCurrencySymbol(a.code)).replace(/\{country_code\}/g,a.country_code)})))):l("select",{class:"s-localization-modal-select",name:"currency",onChange:a=>this.onChangeCurrency(a)},this.currencies.map((a=>l("option",{value:a.code,selected:this.currency==a.code},a.name)))))):"",l("salla-button",{width:"wide",ref:a=>this.btn=a,onClick:()=>this.submit()},Salla.lang.get("common.elements.ok"))))]}componentDidRender(){this.host.querySelectorAll("#currency-slot").forEach((a=>a.replaceWith(a.firstChild))),this.host.querySelectorAll("#language-slot").forEach((a=>a.replaceWith(a.firstChild)))}get host(){return s(this)}};export{e as salla_localization_modal}
4
+ import{r as a,h as l,a as s}from"./p-B-fHbvwg.js";const e=class{constructor(l){a(this,l),this.languageNames={ar:"العربية",en:"English",sq:"shqip",hy:"հայերէն",bg:"български",zh:"汉语",hr:"hrvatski",cs:"čeština",da:"dansk",nl:"dutch",et:"eesti keel",fi:"suomen kieli",fr:"Français",de:"Deutsch",el:"Ελληνικά",hi:"हिन्दी",hu:"magyar",ind:"bahasa Indonesia",ga:"Gaeilge",it:"Italiano",ja:"日本語",ko:"한국어",lv:"latviešu",mt:"Maltese",fa:"فارسی",pl:"Polish",pt:"português",ro:"română",ru:"русский",sl:"slovenščina",es:"Español",sv:"svenska",tl:"Tagalog (Filipino)",tr:"Türkçe",uk:"украї́нська",ur:"اُردُو",ms:"Bahasa Malaysia"},this.currenciesList={SAR:{en:"Saudi Riyal",ar:"ريال سعودي",symbol:"ر.س"},USD:{en:"US Dollar",ar:"دولار أمريكي",symbol:"$"},EUR:{en:"Euro",ar:"يورو",symbol:"€"},AED:{en:"UAE Dirham",ar:"درهم اماراتي",symbol:"د.إ"},KWD:{en:"Kuwaiti Dinar",ar:"دينار كويتي",symbol:"د.ك"},BHD:{en:"Bahraini Dinar",ar:"دينار بحريني",symbol:"د.ب"},QAR:{en:"Qatari Riyal",ar:"ريال قطري",symbol:"ر.ق"},OMR:{en:"Omani Rial",ar:"ريال عماني",symbol:"ر.ع"},AUD:{en:"Australian Dollar",ar:"دولار استرالي",symbol:"$"},CAD:{en:"Canadian Dollar",ar:"دولار كندي",symbol:"$"},CNY:{en:"Renminbi",ar:"رنمينبي",symbol:"¥"},EGP:{en:"Egyptian Pound",ar:"جنيه مصري",symbol:"ج.م"},GBP:{en:"Pound Sterling",ar:"جنيه استرليني",symbol:"£"},IDR:{en:"Indonesian Rupiah",ar:"روبية إندونيسية",symbol:"Rp"},INR:{en:"Indian Rupee",ar:"روبية هندية",symbol:"₹"},JPY:{en:"Japanese Yen",ar:"ين ياباني",symbol:"¥"},MYR:{en:"Malaysian Ringgit",ar:"رينغيت ماليزي",symbol:"RM"},PKR:{en:"Pakistani Rupee",ar:"روبية باكستانية",symbol:"Rs."},SEK:{en:"Swedish Krona",ar:"كرونة سويدية",symbol:"kr"},SGD:{en:"Singapore Dollar",ar:"دولار سنغافوري",symbol:"$"},TRY:{en:"Turkish Lira",ar:"ليرة تركية",symbol:"₺"},IQD:{en:"Iraqi Dinar",ar:"دينار عراقي",symbol:"د.ع"},LBP:{en:"Lebanese Pound",ar:"ليرة لبنانية",symbol:"ل.ل"},MRO:{en:"Mauritanian Ouguiya",ar:"أوقية موريتانية",symbol:"UM"},SDG:{en:"Sudanese Pound",ar:"جنيه سوداني",symbol:"SDG"},SYP:{en:"Syrian Pound",ar:"ليرة سورية",symbol:"ل.س"},TND:{en:"Tunisian Dinar",ar:"دينار تونسي",symbol:"د.ت"},JOD:{en:"Jordanian Dinar",ar:"دينار أردني",symbol:"JOD"},DZD:{en:"Algerian Dinar",ar:"دينار جزائري",symbol:"دج"},MAD:{en:"Moroccan Dirham",ar:"درهم مغربي",symbol:"د.م."},LYD:{en:"Libyan Dinar",ar:"دينار ليبي",symbol:"LD"},YER:{en:"Yemeni Riyal",ar:"ريال يمني",symbol:"ر.ي"}},this.arabicCurrencies=["SAR","AED","KWD","BHD","QAR","OMR","EGP","IQD","LBP","SYP","TND","DZD","MAD","YER"],this.languages=[],this.currencies=[],this.hasError=!1,this.showTrigger=!1,this.languageSlot=this.host.querySelector('[slot="language"]')?.innerHTML||'<label class="s-localization-modal-label" for="lang-{code}"><span>{name}</span></label>',this.currencySlot=this.host.querySelector('[slot="currency"]')?.innerHTML||'<label class="s-localization-modal-label" for="currency-{code}"><span>{name}</span><small class="s-localization-modal-currency">{symbol}</small></label>'}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),Salla.event.on("localization::open",(()=>this.open())),this.language||(this.language=Salla.config.get("user.language_code")),this.currency||(this.currency=Salla.config.get("user.currency_code"))}async open(){return this.modal.open(),await Salla.api.withoutNotifier((()=>this.getLanguages())).then((()=>this.getCurrencies())).then((()=>{this.languages.length<2&&this.currencies.length<2&&this.modal.close()})).catch((a=>{console.log(a),this.hasError=!0,this.errorMessage=a.response?.data?.error?.message||a.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}getCurrency(a){return this.currenciesList[a||this.currency]||{en:"Saudi Riyal",ar:"ريال سعودي",symbol:"ر.س"}}getLanguageName(){return this.languageNames[this.language]||this.language||""}getCurrencySymbol(a){return"SAR"===(a=a||this.currency)?'<i class="sicon-sar"></i>':"ar"!==this.language&&this.arabicCurrencies.includes(a)?a:this.getCurrency(a).symbol}getCurrencyName(a){return"ar"===this.language?this.getCurrency(a).ar:this.getCurrency(a).en}async getLanguages(){return this.languages.length>1?null:await Salla.config.languages().then((a=>this.languages=a))}async getCurrencies(){return this.currencies.length>1?null:await Salla.config.currencies().then((a=>this.currencies=Object.values(a||{})))}onChangeCurrency(a){this.currency=a.target.value}onChangeLanguage(a){this.language=a.target.value}async submit(){let a;this.btn.load().then((()=>{if(this.currency){if(this.currency!==Salla.config.get("user.currency_code","SAR"))return a=window.location.href,Salla.currency.api.change(this.currency)}else Salla.log("There is no currency!")})).then((()=>{this.language!==Salla.config.get("user.language_code","ar")&&(a=Salla.helpers.addParamToUrl("lang",this.language))})).then((()=>{Salla.cookie.set("s-lang",this.language),Salla.cookie.set("s-curr",this.currency)})).then((()=>this.btn.stop())).then((()=>this.close())).then((()=>{a&&(window.location.href=a.replace(`/${Salla.config.get("user.language_code")}/`,`/${this.language}/`))}))}render(){return[this.showTrigger?l("button",{type:"button",onClick:()=>this.open(),class:"s-localization-modal-trigger-btn"},l("span",null,this.getLanguageName()),l("span",{class:"s-localization-modal-trigger-separator"},"|")," ",l("span",{innerHTML:this.getCurrencySymbol()})):"",l("salla-modal",{key:"ae9553ab14e30b7e9b6466d1e959e469e544ca5b",isLoading:!0,class:"s-hidden",ref:a=>this.modal=a,width:"xs"},l("div",{key:"84bf38810a3d1c99ee084951ef596cc33a18e4f7",slot:"loading"},l("div",{key:"5e808b2a7774bc1f1e1fe25cb880c45a3b97f1aa",class:"s-localization-modal-skeleton"},l("salla-skeleton",{key:"c0000d5f4f5fb663f059822fe1a4f24a78a9dd65",width:"25%",height:"15px"}),l("div",{key:"45164d658a0ee5e8825422af35605bfd83e383ff",class:"s-localization-modal-skeleton-content"},[...Array(4)].map((()=>l("div",{class:"s-localization-modal-skeleton-item"},l("div",{class:"s-localization-modal-skeleton-item-flex"},l("salla-skeleton",{type:"circle",height:"16px",width:"16px"}),l("salla-skeleton",{height:"10px",width:"100px"})),l("salla-skeleton",{height:"15px",width:"20px"}))))),l("salla-skeleton",{key:"1e63980f25677892f731e6ad30eda08b8a3852e0",width:"25%",height:"15px"}),l("div",{key:"b1263061b94885e99d540f90054244fb41fd0a68",class:"s-localization-modal-skeleton-content"},[...Array(4)].map((()=>l("div",{class:"s-localization-modal-skeleton-item"},l("div",{class:"s-localization-modal-skeleton-item-flex"},l("salla-skeleton",{type:"circle",height:"16px",width:"16px"}),l("salla-skeleton",{height:"10px",width:"100px"})),l("salla-skeleton",{height:"15px",width:"20px"}))))),l("salla-skeleton",{key:"6dfbe5d71475640cd41dfe3d01e9277f2b2b80c5",height:"40px",width:"100%"}))),this.hasError?l("salla-placeholder",{alignment:"center"},l("span",{slot:"description"},this.errorMessage)):l("div",{class:"s-localization-modal-inner"},this.languages.length>1?l("div",{class:"s-localization-modal-section"},l("label",{class:"s-localization-modal-title"},Salla.lang.get("common.titles.language")),l("div",{class:"s-localization-modal-section-inner"},this.languages.length<6?this.languages.map((a=>l("div",{class:"s-localization-modal-item"},l("input",{class:"s-localization-modal-input",type:"radio",checked:this.language==a.iso_code,onChange:()=>this.language=a.iso_code,name:"language",id:"lang-"+a.code.toLowerCase(),value:a.code}),l("div",{class:"s-localization-modal-label-slot",id:"language-slot",innerHTML:this.languageSlot.replace(/\{name\}/g,a.name).replace(/\{code\}/g,a.code).replace(/\{country_code\}/g,a.country_code)})))):l("select",{class:"s-localization-modal-select",name:"language",onChange:a=>this.onChangeLanguage(a)},this.languages.map((a=>l("option",{value:a.code,selected:this.language==a.code},a.name)))))):"",this.currencies.length>1?l("div",{class:"s-localization-modal-section"},l("label",{class:"s-localization-modal-title"},Salla.lang.get("common.titles.currency")),l("div",{class:"s-localization-modal-section-inner"},this.currencies.length<6?this.currencies.map((a=>l("div",{class:"s-localization-modal-item"},l("input",{class:"s-localization-modal-input",type:"radio",name:"currency",checked:this.currency==a.code,onChange:()=>this.currency=a.code,id:"currency-"+a.code,value:a.code}),l("div",{class:"s-localization-modal-label-slot",id:"currency-slot",innerHTML:this.currencySlot.replace(/\{name\}/g,this.getCurrencyName(a.code)).replace(/\{code\}/g,a.code).replace(/\{symbol\}/g,this.getCurrencySymbol(a.code)).replace(/\{country_code\}/g,a.country_code)})))):l("select",{class:"s-localization-modal-select",name:"currency",onChange:a=>this.onChangeCurrency(a)},this.currencies.map((a=>l("option",{value:a.code,selected:this.currency==a.code},a.name)))))):"",l("salla-button",{width:"wide",ref:a=>this.btn=a,onClick:()=>this.submit()},Salla.lang.get("common.elements.ok"))))]}componentDidRender(){this.host.querySelectorAll("#currency-slot").forEach((a=>a.replaceWith(a.firstChild))),this.host.querySelectorAll("#language-slot").forEach((a=>a.replaceWith(a.firstChild)))}get host(){return s(this)}};export{e as salla_localization_modal}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as a,H as s,a as l}from"./p-BpoZBzEy.js";const i=class{constructor(a){t(this,a),this.alertDelay=null,this.data=salla.config.get("store.app_install_prompt"),this.open=!1,this.closing=!1}connectedCallback(){salla.onReady((()=>{if(this.data=salla.config.get("store.app_install_prompt"),this.isMobileOrTabletDevice()){if(!this.data)return salla.logger.error("Failed to retrieve salla-app-install-alert config");this.ctaLink=salla.url.get("app"),this.alertDelay=setTimeout((()=>this.open=!0),3e3)}}))}disconnectedCallback(){clearTimeout(this.alertDelay)}isMobileOrTabletDevice(t=1024){if("undefined"==typeof window||"undefined"==typeof navigator||"undefined"==typeof document)return!1;const a=window.matchMedia(`(max-width: ${t}px)`).matches,s=/Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent),l="ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0;return s&&a&&l}closeAlert(){salla.storage.set("app_install_prompt_disabled",!0),this.closing=!0,this.host.addEventListener("animationend",(()=>{this.closing=!1,this.open=!1}),{once:!0})}shouldShowAlert(){return!salla.config.isMobileApp()}render(){return this.data&&this.shouldShowAlert()?a(s,{class:`s-app-install-alert-wrapper ${this.open?"open":""} ${this.closing?"closing":""}`,position:this.data.position},a("div",null,a("img",{src:this.data.icon,width:"58",height:"58",alt:`${salla.config.get("store.name")}`})),a("div",{class:"s-app-install-alert-content"},a("h2",{class:"s-app-install-alert-title"},this.data.title),a("p",{class:"s-app-install-alert-sub-title"},this.data.sub_title," "," ",a("a",{href:this.ctaLink,target:"_blank","aria-label":"download app",class:"s-app-install-alert-cta"},salla.lang.getWithDefault("blocks.footer.download_app_now","حمله الآن")))),a("button",{class:"s-app-install-alert-cancel-button","aria-label":"close alert",onClick:()=>this.closeAlert()},a("i",{class:"sicon-cancel"}))):null}get host(){return l(this)}};i.style=":host{display:block}";export{i as salla_app_install_alert}
4
+ import{r as t,h as a,H as s,a as l}from"./p-B-fHbvwg.js";const i=class{constructor(a){t(this,a),this.alertDelay=null,this.data=salla.config.get("store.app_install_prompt"),this.open=!1,this.closing=!1}connectedCallback(){salla.onReady((()=>{if(this.data=salla.config.get("store.app_install_prompt"),this.isMobileOrTabletDevice()){if(!this.data)return salla.logger.error("Failed to retrieve salla-app-install-alert config");this.ctaLink=salla.url.get("app"),this.alertDelay=setTimeout((()=>this.open=!0),3e3)}}))}disconnectedCallback(){clearTimeout(this.alertDelay)}isMobileOrTabletDevice(t=1024){if("undefined"==typeof window||"undefined"==typeof navigator||"undefined"==typeof document)return!1;const a=window.matchMedia(`(max-width: ${t}px)`).matches,s=/Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent),l="ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0;return s&&a&&l}closeAlert(){salla.storage.set("app_install_prompt_disabled",!0),this.closing=!0,this.host.addEventListener("animationend",(()=>{this.closing=!1,this.open=!1}),{once:!0})}shouldShowAlert(){return!salla.config.isMobileApp()}render(){return this.data&&this.shouldShowAlert()?a(s,{class:`s-app-install-alert-wrapper ${this.open?"open":""} ${this.closing?"closing":""}`,position:this.data.position},a("div",null,a("img",{src:this.data.icon,width:"58",height:"58",alt:`${salla.config.get("store.name")}`})),a("div",{class:"s-app-install-alert-content"},a("h2",{class:"s-app-install-alert-title"},this.data.title),a("p",{class:"s-app-install-alert-sub-title"},this.data.sub_title," "," ",a("a",{href:this.ctaLink,target:"_blank","aria-label":"download app",class:"s-app-install-alert-cta"},salla.lang.getWithDefault("blocks.footer.download_app_now","حمله الآن")))),a("button",{class:"s-app-install-alert-cancel-button","aria-label":"close alert",onClick:()=>this.closeAlert()},a("i",{class:"sicon-cancel"}))):null}get host(){return l(this)}};i.style=":host{display:block}";export{i as salla_app_install_alert}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as s,H as e}from"./p-BpoZBzEy.js";const r=class{constructor(s){t(this,s),this.parsedSections=[]}parseProducts(t){let s=[];if("string"==typeof t)try{const e=JSON.parse(t);s=this.extractSections(e)}catch(e){console.error("Invalid JSON passed to bundleSections prop:",t),s=[]}else t&&(s=this.extractSections(t));this.parsedSections=s}extractSections(t){return t.bundle&&t.bundle.sections&&Array.isArray(t.bundle.sections)?t.bundle.sections:Array.isArray(t)?t:t.sections&&Array.isArray(t.sections)?t.sections:(console.warn("No valid sections found in data:",t),[])}isCartPage(){return salla.url.is_page("cart")}renderCartPage(){return s("salla-multiple-bundle-product-cart",{sections:this.parsedSections})}renderDetailsPage(){return s("salla-multiple-bundle-product-details",{sections:this.parsedSections})}componentWillLoad(){this.parseProducts(this.bundleSections)}render(){return s(e,{key:"2a4510d1ccd3dc840d25a288cb0788a7dd23672c",class:"s-multiple-bundle-product-wrapper"},this.isCartPage()?this.renderCartPage():this.renderDetailsPage())}static get watchers(){return{bundleSections:["parseProducts"]}}};r.style=":host{display:block}";export{r as salla_multiple_bundle_product}
4
+ import{r as t,h as s,H as e}from"./p-B-fHbvwg.js";const r=class{constructor(s){t(this,s),this.parsedSections=[]}parseProducts(t){let s=[];if("string"==typeof t)try{const e=JSON.parse(t);s=this.extractSections(e)}catch(e){console.error("Invalid JSON passed to bundleSections prop:",t),s=[]}else t&&(s=this.extractSections(t));this.parsedSections=s}extractSections(t){return t.bundle&&t.bundle.sections&&Array.isArray(t.bundle.sections)?t.bundle.sections:Array.isArray(t)?t:t.sections&&Array.isArray(t.sections)?t.sections:(console.warn("No valid sections found in data:",t),[])}isCartPage(){return salla.url.is_page("cart")}renderCartPage(){return s("salla-multiple-bundle-product-cart",{sections:this.parsedSections})}renderDetailsPage(){return s("salla-multiple-bundle-product-details",{sections:this.parsedSections})}componentWillLoad(){this.parseProducts(this.bundleSections)}render(){return s(e,{key:"2a4510d1ccd3dc840d25a288cb0788a7dd23672c",class:"s-multiple-bundle-product-wrapper"},this.isCartPage()?this.renderCartPage():this.renderDetailsPage())}static get watchers(){return{bundleSections:["parseProducts"]}}};r.style=":host{display:block}";export{r as salla_multiple_bundle_product}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as i,H as e}from"./p-BpoZBzEy.js";var s,a;!function(t){t.PERCENTAGE="percentage",t.FIXED="fixed",t.FREE_PRODUCT="free_product"}(s||(s={})),function(t){t.PRODUCT_COUNT="products_count",t.PRODUCT_PURCHASE="order_amount"}(a||(a={}));const o=class{constructor(i){t(this,i),this.offer=null,this.products={},this.isLoading=!1,this.canRender=!0}componentWillLoad(){salla.onReady().then((()=>{if(!salla.config.get("store.features")?.includes("conditional-offer")||""!==salla.storage.get("cart")&&!salla.storage.get("cart")?.summary?.count)throw new Error("feature or cart object does not existed")})).then((()=>salla.api.cart.offers())).then((({data:t})=>{if(this.offer=t.find((t=>"conditional"===t.type)),this.offer)return this.isLoading=!0,this.offer.details.discounts.unshift({value:0,min_spend:0}),this.updateInitialOfferValue();this.canRender=!1})).then((()=>{if(this.offer)return this.getProducts()})).then((()=>{this.offer&&salla.event.on("cart::updated",(t=>this.updateOfferValues(t)))})).catch((t=>{this.canRender=!1,salla.logger.warn("salla-conditional-offer:: ",t)})).finally((()=>{this.isLoading=!1}))}getProducts(){const t=this.offer.details.discounts.filter((({type:t})=>t===s.FREE_PRODUCT)).map((({value:t})=>t)).filter(Boolean);if(t.length>0)return salla.product.fetch({source:"selected",source_value:t}).then((t=>{const i=t?.data;if(i&&Array.isArray(i)){const t={...this.products};i.forEach((({id:i,url:e,image:s,name:a,price:o})=>{i&&a&&s?.url&&e&&void 0!==o&&(t[i]={url:e,image:s,name:a,price:o})})),this.products=t}}))}updateInitialOfferValue(){return salla.api.cart.details().then((({data:{cart:t}})=>this.updateOfferValues(t)))}updateOfferValues({items:t,sub_total:i}){const e=this.offer.details.based_on===a.PRODUCT_COUNT?t?.reduce(((t,{quantity:i})=>t+i),0)??0:i;return this.offer={...this.offer,details:{...this.offer?.details,current_value:e}},this.offer}renderTooltip(t){const e=t.value,s=this.products[e];return s?i("salla-tooltip",{class:"absolute left-0 -top-2",targetId:`avatar-product-${e}`,theme:"dark"},i("div",{class:"flex gap-3 text-start"},s?.image?.url&&i("img",{src:s.image.url,alt:s?.image?.alt||s.name||"",class:"w-12 h-12 object-cover rounded-lg flex-shrink-0",loading:"lazy",decoding:"async"}),i("div",{class:"flex-1"},i("div",{class:"leading-tight mb-1"},s.name),i("div",{class:"text-xs text-gray-300",innerHTML:salla.money(s.price)})))):(salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`),null)}getCheckpointContent(t){if(t.type===s.PERCENTAGE)return`${t.value}%`;if(t.type===s.FIXED)return i("span",{innerHTML:salla.money(t.value)});if(t.type!==s.FREE_PRODUCT)return salla.logger.error(`salla-conditional-offer:: unexpected type (${t.type})!`),"";const e=this.products[t.value];return e?i("a",{class:"s-conditional-offer-product-link",href:e.url},i("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:e?.image?.alt||"",src:e?.image?.url})):(salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`),"")}getOfferType(t){const i=this.offer.details?.based_on;return i===a.PRODUCT_COUNT?salla.lang.choice("blocks.header.products_count",t.min_spend):i===a.PRODUCT_PURCHASE?salla.money(t.min_spend):(salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${i}`),`${t.min_spend}`)}clamp(t,i,e){return Math.max(i,Math.min(t,e))}mapValueRanges(t,i,e,s,a){const o=(t-i)*(a-s)/(e-i)+s;return o===Number.POSITIVE_INFINITY?100:o===Number.NEGATIVE_INFINITY?0:this.clamp(o,0,100)}getCheckPointView(t,e){const a=this.offer.details.discounts.findIndex((({min_spend:i})=>i===t.min_spend)),o=this.mapValueRanges(this.offer.details.current_value,this.offer.details.discounts[a-1]?.min_spend??0,t.min_spend,0,100),l=t.min_spend<=this.offer.details.current_value;return i("div",{class:"s-conditional-offer-checkpoint-container"},e>0?[i("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},i("div",{class:"s-conditional-offer-progress-line-inactive"}),i("div",{class:"s-conditional-offer-progress-line-active",style:{width:`${o}%`}})),i("div",{key:"checkpoint",class:"s-conditional-offer-checkpoint "+(l?"s-conditional-offer-active-checkpoint":"")},i("div",{class:"s-conditional-offer-item-avatar-content "+(l?"active":""),id:t.type===s.FREE_PRODUCT?`avatar-product-${t.value}`:`avatar-${t.value??e}`},this.products&&this.getCheckpointContent(t)),this.products&&t.type===s.FREE_PRODUCT&&this.renderTooltip(t),i("div",{class:"s-conditional-offer-checkpoint-label "+(l?"active":""),innerHTML:this.getOfferType(t)}))]:i("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":!0,"first-checkpoint":0===e,active:l},innerHTML:this.getOfferType(t)}))}getLoadingSkeletonView(){return i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-skeleton-inner-container"},i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"30%"})),i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"35%"})),i("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((()=>[i("salla-skeleton",{key:"checkpoint-line",height:"8px"}),i("div",{key:"checkpoint"},i("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))])))))}render(){return this.canRender?this.isLoading?this.getLoadingSkeletonView():this.offer?i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-title-wrapper"},i("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?i("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",i("i",{class:"sicon-information"})):null),i("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map(((t,e)=>i("div",{class:{"flex-1":e>0},key:t.min_spend},this.getCheckPointView(t,e)))))):null:null}};o.style=":host{display:block}";export{o as salla_conditional_offer}
4
+ import{r as t,h as i,H as e}from"./p-B-fHbvwg.js";var s,a;!function(t){t.PERCENTAGE="percentage",t.FIXED="fixed",t.FREE_PRODUCT="free_product"}(s||(s={})),function(t){t.PRODUCT_COUNT="products_count",t.PRODUCT_PURCHASE="order_amount"}(a||(a={}));const l=class{constructor(i){t(this,i),this.offer=null,this.products={},this.isLoading=!1,this.canRender=!0}componentWillLoad(){salla.onReady().then((()=>{if(!salla.config.get("store.features")?.includes("conditional-offer")||""!==salla.storage.get("cart")&&!salla.storage.get("cart")?.summary?.count)throw new Error("feature or cart object does not existed")})).then((()=>salla.api.cart.offers())).then((({data:t})=>{if(this.offer=t.find((t=>"conditional"===t.type)),this.offer)return this.isLoading=!0,this.offer.details.discounts.unshift({value:0,min_spend:0}),this.updateInitialOfferValue();this.canRender=!1})).then((()=>{if(this.offer)return this.getProducts()})).then((()=>{this.offer&&salla.event.on("cart::updated",(t=>this.updateOfferValues(t)))})).catch((t=>{this.canRender=!1,salla.logger.warn("salla-conditional-offer:: ",t)})).finally((()=>{this.isLoading=!1}))}getProducts(){const t=this.offer.details.discounts.filter((({type:t})=>t===s.FREE_PRODUCT)).map((({value:t})=>t)).filter(Boolean);if(t.length>0)return salla.product.fetch({source:"selected",source_value:t}).then((t=>{const i=t?.data;if(i&&Array.isArray(i)){const t={...this.products};i.forEach((({id:i,url:e,image:s,name:a,price:l})=>{i&&a&&s?.url&&e&&void 0!==l&&(t[i]={url:e,image:s,name:a,price:l})})),this.products=t}}))}updateInitialOfferValue(){return salla.api.cart.details().then((({data:{cart:t}})=>this.updateOfferValues(t)))}updateOfferValues({items:t,sub_total:i}){const e=this.offer.details.based_on===a.PRODUCT_COUNT?t?.reduce(((t,{quantity:i})=>t+i),0)??0:i;return this.offer={...this.offer,details:{...this.offer?.details,current_value:e}},this.offer}renderTooltip(t){const e=t.value,s=this.products[e];return s?i("salla-tooltip",{class:"absolute left-0 -top-2",targetId:`avatar-product-${e}`,theme:"dark"},i("div",{class:"flex gap-3 text-start"},s?.image?.url&&i("img",{src:s.image.url,alt:s?.image?.alt||s.name||"",class:"w-12 h-12 object-cover rounded-lg flex-shrink-0",loading:"lazy",decoding:"async"}),i("div",{class:"flex-1"},i("div",{class:"leading-tight mb-1"},s.name),i("div",{class:"text-xs text-gray-300",innerHTML:salla.money(s.price)})))):(salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`),null)}getCheckpointContent(t){if(t.type===s.PERCENTAGE)return`${t.value}%`;if(t.type===s.FIXED)return i("span",{innerHTML:salla.money(t.value)});if(t.type!==s.FREE_PRODUCT)return salla.logger.error(`salla-conditional-offer:: unexpected type (${t.type})!`),"";const e=this.products[t.value];return e?i("a",{class:"s-conditional-offer-product-link",href:e.url},i("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:e?.image?.alt||"",src:e?.image?.url})):(salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`),"")}getOfferType(t){const i=this.offer.details?.based_on;return i===a.PRODUCT_COUNT?salla.lang.choice("blocks.header.products_count",t.min_spend):i===a.PRODUCT_PURCHASE?salla.money(t.min_spend):(salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${i}`),`${t.min_spend}`)}clamp(t,i,e){return Math.max(i,Math.min(t,e))}mapValueRanges(t,i,e,s,a){const l=(t-i)*(a-s)/(e-i)+s;return l===Number.POSITIVE_INFINITY?100:l===Number.NEGATIVE_INFINITY?0:this.clamp(l,0,100)}getCheckPointView(t,e){const a=this.offer.details.discounts.findIndex((({min_spend:i})=>i===t.min_spend)),l=this.mapValueRanges(this.offer.details.current_value,this.offer.details.discounts[a-1]?.min_spend??0,t.min_spend,0,100),n=t.min_spend<=this.offer.details.current_value;return i("div",{class:"s-conditional-offer-checkpoint-container"},e>0?[i("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},i("div",{class:"s-conditional-offer-progress-line-inactive"}),i("div",{class:"s-conditional-offer-progress-line-active",style:{width:`${l}%`}})),i("div",{key:"checkpoint",class:"s-conditional-offer-checkpoint "+(n?"s-conditional-offer-active-checkpoint":"")},i("div",{class:"s-conditional-offer-item-avatar-content "+(n?"active":""),id:t.type===s.FREE_PRODUCT?`avatar-product-${t.value}`:`avatar-${t.value??e}`},this.products&&this.getCheckpointContent(t)),this.products&&t.type===s.FREE_PRODUCT&&this.renderTooltip(t),i("div",{class:"s-conditional-offer-checkpoint-label "+(n?"active":""),innerHTML:this.getOfferType(t)}))]:i("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":!0,"first-checkpoint":0===e,active:n},innerHTML:this.getOfferType(t)}))}getLoadingSkeletonView(){return i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-skeleton-inner-container"},i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"30%"})),i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"35%"})),i("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((()=>[i("salla-skeleton",{key:"checkpoint-line",height:"8px"}),i("div",{key:"checkpoint"},i("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))])))))}render(){return this.canRender?this.isLoading?this.getLoadingSkeletonView():this.offer?i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-title-wrapper"},i("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?i("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",i("i",{class:"sicon-information"})):null),i("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map(((t,e)=>i("div",{class:{"flex-1":e>0},key:t.min_spend},this.getCheckPointView(t,e)))))):null:null}};l.style=":host{display:block}";export{l as salla_conditional_offer}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as i,a as e,f as a,i as n,j as r,d as l}from"./p-BpoZBzEy.js";import{i as o}from"./p-BsXh13x8.js";import{a as h}from"./p-CgtvEd63.js";import{H as c}from"./p-CHf8XdiS.js";import{S as m}from"./p-D4oPi1Ov.js";import{a as d}from"./p-BedNk7k1.js";import{S as u}from"./p-DiKTtDW5.js";const p=class{constructor(t){s(this,t),this.placeholder=salla.lang.get("blocks.comments.placeholder"),this.submitText=salla.lang.get("blocks.comments.submit"),salla.lang.onLoaded((()=>{this.placeholder=salla.lang.get("blocks.comments.placeholder"),this.submitText=salla.lang.get("blocks.comments.submit")})),salla.onReady((()=>{this.canComment=salla.config.get("user.can_comment"),this.itemId=salla.config.get("page.id"),this.type=salla.url.is_page("page-single")?"page":salla.url.is_page("blog.single")?"blog":"product"}))}submit(){this.commentForm.reportValidity()?this.submitBtn.load().then((()=>salla.comment.add({id:this.itemId,comment:this.commentField.value,type:this.type}))).finally((()=>this.submitBtn.stop)):salla.log("CommentForm:: validation error!")}render(){return t(i,{key:"1c2cdcb7dea3afa14a9fbe7700b05241c6e36770"},this.canComment?t("form",{ref:s=>this.commentForm=s},t("div",{class:"s-comment-form-wrapper"},this.showAvatar?t("img",{class:"s-comment-form-avatar",src:salla.config.get("user.avatar"),alt:"user avatar"}):"",t("div",{class:"s-comment-form-content"},t("textarea",{cols:30,rows:5,minlength:"4",maxlength:"500",ref:s=>this.commentField=s,placeholder:this.placeholder,class:"s-comment-form-input",required:!0}),t("br",null),t("div",{class:"s-comment-form-action"},t("salla-button",{ref:s=>this.submitBtn=s,"loader-position":"center",onClick:()=>this.submit()},this.submitText))))):"")}};p.style=":host{display:block}";const g=class{constructor(t){s(this,t),this.has_bought_trans=salla.lang.get("blocks.comments.has_bought"),this.rated_trans=salla.lang.get("pages.rating.rated"),this.waiting_approval_trans=salla.lang.get("blocks.comments.waiting_approval"),this.has_order_trans=salla.lang.get("blocks.comments.has_order"),this.allowLikes=salla.config.get("store.settings.rating.allow_likes"),this.allowAttachImages=salla.config.get("store.settings.rating.allow_attach_images"),this.helpfulLabel=salla.lang.getWithDefault("blocks.comments.helpful","مفيد"),this.likesCount=0,this.likedComments=[],salla.lang.onLoaded((()=>{const s=(s,t,i)=>new Promise((e=>{salla.helpers.setNested(salla.lang.messages[s],t,i),e(!0)}));this.has_bought_trans=salla.lang.get("blocks.comments.has_bought"),this.rated_trans=salla.lang.get("pages.rating.rated"),this.waiting_approval_trans=salla.lang.get("blocks.comments.waiting_approval"),this.has_order_trans=salla.lang.get("blocks.comments.has_order"),(async()=>{await s("ar.trans","blocks.comments.helpful","مفيد"),await s("en.trans","blocks.comments.helpful","Helpful"),this.helpfulLabel=salla.lang.getWithDefault("blocks.comments.helpful","مفيد")})()}))}componentDidLoad(){this.likesCount=this.comment.likes_count;try{this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]"),this.likedComments.includes(this.comment.id)&&(this.likeBtn.classList.add("liked"),this.likeBtn.fill="solid")}catch{salla.log("Bad json for liked_comments")}}getReplies(){return Array.isArray(this.comment.replies)?this.comment.replies:[this.comment.replies]}getDate(s){const[t]=s.split(" "),[i,e,a]=t.split("-");return`${parseInt(a,10)}/${parseInt(e,10)}/${parseInt(i,10)}`}getTime(s){const[,t]=s.split(" "),[i,e]=t.split(":");return`${parseInt(i,10)}:${parseInt(e,10)}`}async toggleLike(){if(salla.config.isGuest())return salla.notify.error(salla.lang.get("common.messages.must_login"));this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]");const s=this.likedComments.includes(this.comment.id);try{const t=s?`rating/${this.comment.id}/unlike`:`rating/${this.comment.id}/like`,i=await salla.api.request(t,"","put");salla.log(i.message),s?(this.likeBtn.classList.remove("liked"),this.likeBtn.fill="outline",this.updateLikedComments(this.comment.id,!1),this.likesCount--):(this.likeBtn.classList.add("liked"),this.likeBtn.fill="solid",this.updateLikedComments(this.comment.id,!0),this.likesCount++)}catch(s){409==s.response.status&&(this.likeBtn.classList.contains("liked")?(this.likeBtn.fill="outline",this.likeBtn.classList.remove("liked"),this.updateLikedComments(this.comment.id,!1),this.likesCount--):(this.likeBtn.fill="solid",this.likeBtn.classList.add("liked"),salla.logger.warn("Like already exists"),this.updateLikedComments(this.comment.id,!0)))}}updateLikedComments(s,t){this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]"),t?this.likedComments.includes(s)||this.likedComments.push(s):this.likedComments=this.likedComments.filter((t=>t!==s)),localStorage.setItem("liked_comments",JSON.stringify(this.likedComments))}PinnedIcon(){return t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"16",height:"16",color:"#555555",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},t("path",{d:"M12 16V21"}),t("path",{d:"M8 5.2918C8 5.02079 8 4.88529 8.01312 4.77132C8.1194 3.84789 8.84789 3.1194 9.77133 3.01312C9.88529 3 10.0208 3 10.2918 3H13.7082C13.9792 3 14.1147 3 14.2287 3.01312C15.1521 3.1194 15.8806 3.84789 15.9869 4.77132C16 4.88529 16 5.02079 16 5.2918C16 5.37885 16 5.42237 15.9967 5.46264C15.9708 5.78281 15.7927 6.07104 15.5179 6.2374C15.4834 6.25832 15.4444 6.27779 15.3666 6.31672L15.1055 6.44726C14.7021 6.64897 14.5003 6.74983 14.3681 6.90564C14.26 7.03286 14.1856 7.18509 14.1515 7.34846C14.1097 7.54854 14.1539 7.76968 14.2424 8.21197L15 12H15.3333C15.9533 12 16.2633 12 16.5176 12.0681C17.2078 12.2531 17.7469 12.7922 17.9319 13.4824C18 13.7367 18 14.0467 18 14.6667C18 14.9767 18 15.1317 17.9659 15.2588C17.8735 15.6039 17.6039 15.8735 17.2588 15.9659C17.1317 16 16.9767 16 16.6667 16H7.33333C7.02334 16 6.86835 16 6.74118 15.9659C6.39609 15.8735 6.12654 15.6039 6.03407 15.2588C6 15.1317 6 14.9767 6 14.6667C6 14.0467 6 13.7367 6.06815 13.4824C6.25308 12.7922 6.79218 12.2531 7.48236 12.0681C7.73669 12 8.04669 12 8.66667 12H9L9.75761 8.21197C9.84606 7.76968 9.89029 7.54854 9.84852 7.34846C9.81441 7.18509 9.73995 7.03286 9.63194 6.90564C9.49965 6.74983 9.29794 6.64897 8.89452 6.44726L8.63344 6.31672C8.55558 6.27779 8.51665 6.25832 8.48208 6.2374C8.20731 6.07104 8.02917 5.78281 8.00326 5.46264C8 5.42237 8 5.37885 8 5.2918Z"}))}render(){let s="admin"==this.comment.type;return t(i,{key:"93d39f2ef35c0cfdcd6333e58e6a836845b4fe12",class:s?"s-comments-item-admin":"s-comments-item"},t("div",{key:"c160b10f946149c293cb0daeaf96aa7b06ba095e",class:{"s-comments-item-wrapper":!s,"s-comments-item-admin-wrapper":s},id:`s-comments-item-${this.comment.id}`},t("div",{key:"60728bde4f0293cf419b589759b6621c5f0a519a",class:"s-comments-item-inner s-comments-flex-1"},s&&t("span",{key:"aac6a394aa6460756c4c54d0a0c671078d1dddd6",class:"s-comments-item-reply-icon",innerHTML:'\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>reply</title>\n<path d="M20 14.667h-12.609l9.401-6.927c0.592-0.436 0.72-1.271 0.283-1.863-0.439-0.595-1.273-0.72-1.864-0.283l-12.667 9.333c-0.343 0.251-0.544 0.649-0.544 1.072s0.201 0.821 0.543 1.073l12.667 9.333c0.237 0.176 0.515 0.26 0.789 0.26 0.409 0 0.813-0.188 1.075-0.543 0.437-0.592 0.309-1.427-0.283-1.863l-9.4-6.928h12.609c4.412 0 8 3.588 8 8 0 0.737 0.597 1.333 1.333 1.333s1.333-0.596 1.333-1.333c0-5.881-4.785-10.667-10.667-10.667z"></path>\n</svg>\n'}),t("div",{key:"cdca36fac4f23720084477ee889325942d25341e",class:"s-comments-item-avatar"},t("img",{key:"07e8e17f7470d87607c8aaa8f15e283b129ca070","data-src":this.comment?.avatar,alt:this.comment?.name,src:this.comment?.avatar,class:"s-comments-item-avatar-img lazy"})),t("div",{key:"6ef14e9b64d8300a24d886c081cc66ec621fd2a6",class:"s-comments-flex-1"},t("div",{key:"4f72cfb690978fae30d8ef7c957e6adf53a2872d",class:"s-comments-item-user-wrapper"},t("div",{key:"413840281c0050521a8ae4fd60e502ed821f4260",class:"s-comments-item-user-info"},t("h3",{key:"814c32cefc6b62585022ab3e1cdb59965553f1d2",class:this.comment.is_pinned?"s-comments-item-user-info-name":"s-comments-item-user-info-name-with-margin"},this.comment?.name),this.comment.is_pinned?t("div",{class:"s-comments-item-pinned-icon-with-margin"},this.PinnedIcon()):null,!this.comment.has_order&&!this.comment.rating||this.comment.is_pending||this.hideBought?null:t("div",{class:"s-comments-flex"},this.comment.has_order?[t("span",{class:"s-comments-item-has-order-check-icon",innerHTML:o}),t("span",{class:"s-comments-item-has-order-check-text"},this.has_bought_trans," ",this.comment.rating?", ":"")]:null,this.comment.rating?t("span",{class:"s-comments-item-rated-widget"},this.rated_trans):null)),t("p",{key:"7c6745073e250e100c8a613e4fd94d751042fb7f",class:"s-comments-item-timestamp s-ltr"},this.getDate(this.comment.created_at?.date),t("span",{key:"011cfc88b9702e14f6ea9d8ded0fa6f8678adb18",class:"s-comments-item-time"}," - ",this.getTime(this.comment.created_at?.date))),this.comment.rating||this.comment.stars?t("salla-rating-stars",{size:"mini",class:"s-comments-item-stars",value:this.comment.rating||this.comment.stars}):null),t("div",{key:"044599867529f9526306ac258981a15e4c43e369",class:"s-comments-item-content"},t("p",{key:"d3d082f84a154205bb6eedb0d14c2bb9a83387ee",innerHTML:this.comment.content}),this.allowAttachImages&&t("div",{key:"c475b4911834163084ede77e2c1f289ea9efddca",class:"s-comments-item-images"},this.comment.images.map(((s,i)=>t("img",{key:i,src:s,alt:"",onClick:()=>this.modal.open()}))),t("salla-modal",{key:"384d4555813e8e9c4bf7c6ad626def802f8f6f5a",ref:s=>this.modal=s,width:"sm"},t("salla-slider",{key:"a2be6511ff82555b87196183c6f463f4582c18c4",id:`s-comments-item-${this.comment.id}-images`,class:"s-comments-item-images-slider",type:"thumbs","auto-height":!0,showControls:this.comment.images.length>1,"show-thumbs-controls":"false"},t("div",{key:"c6029d94bdddf9958758fbd8c3dbca3e40ad1c01",slot:"items"},this.comment.images.map(((s,i)=>t("img",{key:i,src:s,alt:""})))),t("div",{key:"b5febbea6d46ce3b920f5bc15866eebb54f440e4",slot:"thumbs"},this.comment.images.map(((s,i)=>t("div",{class:"s-comments-item-images-slider-thumb"},t("img",{key:i,src:s,alt:""})))))))),this.allowLikes&&!s&&salla.url.is_page("product.single")?t("salla-button",{ref:s=>this.likeBtn=s,class:"s-comments-item-like-btn "+(this.likedComments.includes(this.comment.id)?"liked":""),loaderPosition:"center",fill:"outline",size:"small",onClick:()=>this.toggleLike()},t("span",null,this.helpfulLabel," ",this.likesCount>0?`(${this.likesCount})`:""),t("span",{innerHTML:'\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>thumbs-up</title>\n<path d="M26.667 10.667h-8.261l1.279-3.38c0.723-1.911 0.087-4.051-1.549-5.203-0.909-0.639-2.004-0.881-3.085-0.684-1.101 0.203-2.061 0.837-2.703 1.787l-5.452 8.067c-0.148 0.22-0.228 0.48-0.228 0.747v12c0 3.676 2.991 6.667 6.667 6.667h8.688c2.535 0 4.817-1.407 5.955-3.671l2.548-5.063c0.093-0.187 0.143-0.392 0.143-0.6v-6.667c0-2.205-1.795-4-4-4zM28 21.017l-2.405 4.78c-0.683 1.359-2.052 2.203-3.573 2.203h-8.688c-2.205 0-4-1.795-4-4v-11.592l5.223-7.728c0.237-0.352 0.584-0.585 0.975-0.657 0.367-0.067 0.749 0.017 1.068 0.241 0.631 0.444 0.879 1.317 0.591 2.079l-1.963 5.185c-0.156 0.409-0.099 0.869 0.149 1.229s0.66 0.576 1.099 0.576h10.192c0.735 0 1.333 0.599 1.333 1.333zM2.667 10.667c-0.736 0-1.333 0.597-1.333 1.333v16c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-16c0-0.736-0.597-1.333-1.333-1.333z"></path>\n</svg>\n'})):"",this.comment.is_pending?t("span",{class:"s-comments-item-pending-text"},this.waiting_approval_trans):null))),this.getReplies().length&&!s?this.getReplies().map((s=>t("div",null,t("salla-comment-item",{comment:s})))):null))}get host(){return e(this)}};var v;g.style=":host{display:block}",function(s){s.PAGE="page",s.PRODUCT="product",s.BLOG="blog"}(v||(v={}));const f=class{constructor(t){s(this,t),this.type=v.PAGE,this.showFormAvatar=!1,this.hideBought=!1,this.testimonials=!1,this.noComments=salla.lang.get("blocks.comments.no_comments"),this.comment_title=salla.lang.get("blocks.comments.title"),this.comment_name=salla.lang.get("blocks.comments.comment"),this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary"),this.allowLikes=salla.config.get("store.settings.rating.allow_likes"),salla.onReady((()=>{this.allowLikes=salla.config.get("store.settings.rating.allow_likes"),this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary")})),salla.lang.onLoaded((()=>{this.comment_title=salla.lang.get("blocks.comments.title"),this.comment_name=salla.lang.get("blocks.comments.comment"),this.noComments=salla.lang.get("pages.rating.no_ratings");const s=(s,t,i)=>new Promise((e=>{salla.helpers.setNested(salla.lang.messages[s],t,i),e(!0)}));(async()=>{await s("ar.trans","blocks.comments.most_helpful","الأكثر إفادة"),await s("en.trans","blocks.comments.most_helpful","Most helpful"),this.mostHelpfulLabel=salla.lang.get("blocks.comments.most_helpful"),this.comment_title=salla.lang.get("blocks.comments.title"),this.comment_name=salla.lang.get("blocks.comments.comment"),this.noComments=salla.lang.get("pages.rating.no_ratings")})()}))}pluralize(s,t){const i=s.split("|"),e=[{condition:0===t,index:0},{condition:1===t,index:1},{condition:2===t,index:2},{condition:t>2&&t<=10,index:3},{condition:t>=11,index:4}],{index:a}=e.find((({condition:s})=>s))||{index:i.length-1};return i[a].replace(":count",salla.helpers.number(t.toString())).replace(/\{[0-9]+\}/g,"").replace(/\[\d+,\d+\]|\[11,\*\]/g,"")}wrapConsoleError(){Salla.infiniteScroll.errorWrapped||((()=>{const s=console.error.bind(console);console.error=(...t)=>{const i=t[0];return"string"==typeof i&&i.toLowerCase().replace(/\s/g,"").includes("infinitescroll")?console.log(...t):s(...t)}})(),Salla.infiniteScroll.errorWrapped=!0)}initiateInfiniteScroll(){this.wrapper?(this.wrapConsoleError(),this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:!1,nextPage:this.nextPage,scrollThreshold:!1},!0),this.infiniteScroll?.on("request",(()=>{this.loading()})),this.infiniteScroll?.on("load",(s=>{this.pagination=s.pagination,this.nextPage="object"==typeof s.pagination.links&&s.pagination.links.next?s.pagination.links.next:null;for(const t of this.handleResponse(s))this.wrapper.append(t);const t=this.host.querySelectorAll("salla-comment-item:not(.animated):not(.s-comments-item-admin)");this.animateItems(t),this.loading(!1)})),this.infiniteScroll?.on("error",(s=>{salla.console.error("Error loading more comments:",s)}))):console.error("Wrapper is undefined. Cannot initiate infinite scroll.")}loading(s=!0){const t=this.status?.querySelector(".s-button-text");t&&(c.toggleElementClassIf(t,"s-button-hide","s-button-show",(()=>s)),this.btnLoader.style.display=s?"inherit":"none")}animateItems(s){h({targets:s,opacity:[0,1],duration:1200,translateY:[20,0],delay:(s,t)=>100*t,easing:"easeOutExpo",complete:()=>{for(const t of s)t.classList.add("animated")}})}async reload(){if(this.showPlaceholder=!1,this.wrapper){this.wrapper.innerHTML="";const s=document.createElement("salla-loading");this.wrapper.append(s)}this.nextPage=null,this.loadInitialData()}getCommentHTML(s){const t=document.createElement("salla-comment-item");return t.comment=s,t.hideBought=this.hideBought,t}handleResponse(s){return s.data?.map((s=>this.getCommentHTML(s)))||[]}componentWillLoad(){return salla.onReady().then((()=>{this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary")})).then((()=>this.loading())).then((()=>(this.hideTitle=this.hideTitle||this.testimonials,this.hideForm=this.hideForm||this.testimonials,this.loadInitialData())))}async loadInitialData(){try{let s={data:[],pagination:{}};const t=new URLSearchParams(window.location.search);if(t.has("sort")&&(this.sort=t.get("sort")),this.testimonials){const t={sort:this.sort,type:"store"};s=await salla.api.request("reviews",{params:t},"get")}else s=await salla.api.comment.getComments(this.type,this.itemId,1,5,this.sort);if(!s.data||!s.data.length)return this.showPlaceholder=!1,void this.loading(!1);if(this.wrapper&&(this.wrapper.innerHTML=""),this.comments=s.data,this.pagination=s.pagination,this.total=s.pagination.total,this.nextPage="object"==typeof s.pagination.links&&s.pagination.links.next?s.pagination.links.next:null,this.nextPage&&this.sort)try{const s=new URL(this.nextPage,window.location.origin);s.searchParams.get("sort")||(s.searchParams.set("sort",this.sort),this.nextPage=s.toString())}catch(s){const t=this.nextPage.includes("?");/[?&]sort=/.test(this.nextPage)||(this.nextPage=this.nextPage+(t?"&":"?")+`sort=${this.sort}`)}setTimeout((()=>{for(const t of this.handleResponse(s))this.wrapper.append(t);this.initiateInfiniteScroll();const t=this.wrapper.querySelectorAll("salla-comment-item:not(.animated)");this.animateItems(t)}),100)}catch(s){console.error("Error loading initial data:",s),this.showPlaceholder=!0,this.loading(!1)}}async loadMore(){this.infiniteScroll?.loadNextPage()}render(){return this.showPlaceholder?t("div",null,this.total&&!this.hideTitle?t("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",this.hideForm||this.testimonials?"":t("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}),t("div",{class:"s-comments-placeholder"},t("span",{innerHTML:'\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>chat-bubbles</title>\n<path d="M15.333 17.333c4.779 0 8.667-3.888 8.667-8.667s-3.888-8.667-8.667-8.667h-6.667c-4.779 0-8.667 3.888-8.667 8.667 0 2.985 1.513 5.712 4 7.297v4.703c0 0.497 0.277 0.953 0.717 1.183 0.195 0.1 0.405 0.151 0.616 0.151 0.269 0 0.536-0.081 0.764-0.241l6.323-4.425zM11.236 14.908l-4.569 3.199v-2.913c0-0.5-0.28-0.959-0.725-1.187-2.020-1.035-3.275-3.080-3.275-5.34 0-3.308 2.692-6 6-6h6.667c3.308 0 6 2.692 6 6s-2.692 6-6 6h-3.333c-0.273 0-0.54 0.084-0.764 0.241zM29.196 12.964c-0.543-0.5-1.388-0.464-1.884 0.077-0.5 0.541-0.465 1.385 0.077 1.884 1.253 1.156 1.944 2.72 1.944 4.408 0 2.26-1.255 4.305-3.275 5.339-0.445 0.228-0.725 0.687-0.725 1.188v2.572l-5.441-2.939c-0.195-0.104-0.412-0.16-0.633-0.16h-2.592c-1.688 0-3.309-0.724-4.451-1.988-0.492-0.545-1.335-0.591-1.883-0.096-0.547 0.493-0.589 1.336-0.096 1.883 1.644 1.823 3.988 2.868 6.429 2.868h2.255l7.111 3.84c0.199 0.107 0.417 0.16 0.635 0.16 0.236 0 0.472-0.063 0.683-0.188 0.404-0.241 0.651-0.676 0.651-1.145v-4.036c2.487-1.585 4-4.311 4-7.297 0-2.407-1.023-4.727-2.804-6.369z"></path>\n</svg>\n'}),t("p",null,this.noComments))):t("div",{class:`s-comments s-comments-${this.testimonials?"testimonials":this.type}`},t("div",{class:this.type===v.PAGE?"s-comments-page-container":"s-comments-container"},this.total&&!this.hideTitle?t("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",!this.hideForm&&t("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}),salla.url.is_page("product.single")?t("salla-reviews-summary",{itemId:this.itemId}):"",t("div",{class:"s-comments-header "+(this.total?"has-total":"")},!!this.total&&t("span",{class:"s-comments-count-label",innerHTML:this.pluralize(this.comment_name,this.total)}),this.total&&!this.testimonials&&this.type!==v.BLOG?t("div",{class:"s-comments-filter-wrapper"},t("label",{class:"s-comments-filter-label",htmlFor:"comments-filter"},salla.lang.get("pages.categories.sorting")),t("select",{id:"comments-filter","aria-label":salla.lang.get("pages.categories.sorting"),class:"s-form-control s-comments-sort-input",onChange:s=>{this.sort=s.target.value,this.reload()}},t("option",{value:"latest",selected:!0},salla.lang.get("pages.testimonials.sort_by_date_desc")),t("option",{value:"oldest"},salla.lang.get("pages.testimonials.sort_by_date_asc")),this.allowLikes&&t("option",{value:"most_helpful"},this.mostHelpfulLabel))):""),t("div",{ref:s=>{this.wrapper=s}}),this.nextPage&&t("div",{class:"s-infinite-scroll-wrapper",ref:s=>{this.status=s}},t("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary",type:"button"},t("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")),t("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:s=>{this.btnLoader=s},style:{display:"none"}})))))}get host(){return e(this)}};f.style=":host{display:block}";const w=class{constructor(t){s(this,t),this.translationsLoaded=!1,this.labels=[],this.reviewLabel="",this.selectedStar=0,this.name="rating",this.size="medium",this.reviews=0,this.editable=!1}async componentWillLoad(){await new Promise((s=>{salla.lang.onLoaded((()=>{this.labels=[salla.lang.get("pages.rating.poor"),salla.lang.get("pages.rating.average"),salla.lang.get("pages.rating.good"),salla.lang.get("pages.rating.very_good"),salla.lang.get("pages.rating.excellent")],this.value&&this.withLabel&&(this.reviewLabel=this.labels[this.value-1]),this.reviewsElement&&(this.reviewsElement.innerText=`(${salla.helpers.number(salla.lang.choice("pages.rating.reviews",this.reviews))})`),this.translationsLoaded=!0,s()}))}))}initiateRating(){this.host.addEventListener("click",this.handleRating.bind(this))}handleRating(){if(!this.starsElem)return;let s=this.starsElem.querySelectorAll(".s-rating-stars-hovered"),t=s[s.length-1];if(!t)return;let i=parseInt(t.getAttribute("data-star"));this.starsElem.querySelector(".rating_hidden_input").value=i.toString(),this.starsElem.querySelectorAll(".s-rating-stars-btn-star").forEach(((s,t)=>c.toggleElementClassIf(s,"s-rating-stars-selected","s-rating-stars-unselected",(()=>t<i)))),this.starsElem.querySelectorAll("[aria-pressed]").forEach((s=>s.removeAttribute("aria-pressed"))),t.setAttribute("aria-pressed","true"),this.selectedStar=i,this.withLabel&&(this.reviewLabel=this.labels[i-1])}triggerRatingProgrammatically(s){if(!this.starsElem)return;const t=this.starsElem.querySelectorAll(".s-rating-stars-btn-star");t&&s>=0&&s<=t.length&&(t.forEach(((t,i)=>{t.classList.toggle("s-rating-stars-hovered",i<=s)})),this.handleRating())}highlightSelectedStars(){let s="s-rating-stars-hovered",t=this.starsElem?.querySelectorAll(".s-rating-stars-btn-star");t?.forEach(((i,e)=>{i.addEventListener("mouseover",(()=>{for(let i=0;i<=e;i++)t[i].classList.add(s);this.withLabel&&(this.reviewLabel=this.labels[e])})),i.addEventListener("mouseout",(()=>{i.classList.remove(s),this.withLabel&&(this.reviewLabel=this.selectedStar?this.labels[this.selectedStar-1]:"")}))})),this.starsElem?.addEventListener("mouseout",(()=>t.forEach((t=>t.classList.remove(s)))))}createStars(s){let i=[];for(let e=0;e<5;e++)i.push(t("span",{class:{"s-rating-stars-btn-star":!0,["s-rating-stars-"+this.size]:!0,"s-rating-stars-selected":e<s},innerHTML:m}));return this.reviews>0&&i.push(t("span",{class:"s-rating-stars-reviews",ref:s=>this.reviewsElement=s},"(",salla.helpers.number(salla.lang.choice("pages.rating.reviews",this.reviews)),")")),i}render(){return this.translationsLoaded?this.host.closest(".swiper-slide")?.classList.contains("swiper-slide-duplicate")?"":t(i,null,t("div",{class:"s-rating-stars-wrapper"},!this.value&&0!=this.value||this.editable?t("div",{class:"s-rating-stars-element",ref:s=>this.starsElem=s},t("input",{type:"hidden",class:"rating_hidden_input",name:this.name,value:""}),[1,2,3,4,5].map((s=>t("button",{class:"s-rating-stars-btn-star s-rating-stars-"+this.size,"data-star":s},t("span",{innerHTML:m}))))):this.createStars(this.value),this.withLabel&&this.reviewLabel?t("span",{class:"s-rating-stars-label"},this.reviewLabel):"")):t(i,null)}componentDidLoad(){if(this.initiateRating(),this.highlightSelectedStars(),this.value&&this.editable){const s=this.starsElem?.querySelectorAll(".s-rating-stars-btn-star");s&&this.value>=0&&this.value<=s.length&&this.triggerRatingProgrammatically(this.value-1)}}get host(){return e(this)}};w.style="";const b=class{constructor(t){s(this,t),this.currentSlide=0,this.showPurchaseCount=!1,this.startPoint={x:0,y:0},this.isSwiping=!1,this.isRTL="rtl",this.handlePointerDown=s=>{s.isPrimary&&(this.sliderElement?.setPointerCapture(s.pointerId),this.startSwipe(s.clientX,s.clientY),s.preventDefault())},this.handlePointerMove=s=>{this.isSwiping&&s.isPrimary&&s.preventDefault()},this.handlePointerUp=s=>{this.isSwiping&&s.isPrimary&&(this.sliderElement?.releasePointerCapture(s.pointerId),this.endSwipe(s.clientX,s.clientY))},this.handlePointerCancel=s=>{this.isSwiping&&s.isPrimary&&(this.sliderElement?.releasePointerCapture(s.pointerId),this.isSwiping=!1)},this.goToSlide=s=>{this.currentSlide=Math.max(0,Math.min(s,this.images.length-1))}}async componentDidLoad(){await salla.onReady(),this.showPurchaseCount=!!salla.config.get("store.settings.product.total_sold_enabled",!1),this.isRTL=salla.config.get("theme.is_rtl",!0),this.purchasedCount=salla.lang.getWithDefault("blocks.home.reviews.purchased_count",this.isRTL?` تم شراءه ${this.review.product?.sold_quantity} مرة`:`Purchased ${this.review.product.sold_quantity} times`,{count:this.review.product?.sold_quantity}),this.initializeSlider()}disconnectedCallback(){this.removeEventListeners()}get images(){const{review:s}=this;return s?.images?.length>1?s.images.map(((s,t)=>({url:s,alt:"",id:t}))):s?.product?.images||[]}get hasMultipleImages(){return this.images.length>1}get slideTransform(){return`translateX(${100*this.currentSlide*(this.isRTL?1:-1)}%)`}initializeSlider(){this.hasMultipleImages&&(this.sliderElement=this.el.querySelector(".s-review-card-slider-container"),this.sliderElement&&(this.sliderElement.style.touchAction="pan-y pinch-zoom",this.addEventListeners()))}addEventListeners(){this.sliderElement&&(this.sliderElement.addEventListener("pointerdown",this.handlePointerDown,{passive:!1}),this.sliderElement.addEventListener("pointermove",this.handlePointerMove,{passive:!1}),this.sliderElement.addEventListener("pointerup",this.handlePointerUp,{passive:!0}),this.sliderElement.addEventListener("pointercancel",this.handlePointerCancel,{passive:!0}))}removeEventListeners(){this.sliderElement&&(this.sliderElement.removeEventListener("pointerdown",this.handlePointerDown),this.sliderElement.removeEventListener("pointermove",this.handlePointerMove),this.sliderElement.removeEventListener("pointerup",this.handlePointerUp),this.sliderElement.removeEventListener("pointercancel",this.handlePointerCancel))}startSwipe(s,t){this.startPoint={x:s,y:t},this.isSwiping=!0}componentDidRender(){this.removeEventListeners(),this.addEventListeners()}endSwipe(s,t){this.isSwiping=!1,this.processSwipe(s-this.startPoint.x,t-this.startPoint.y)}processSwipe(s,t){if(Math.abs(s)<10||Math.abs(t)>Math.abs(s))return;const i=s<0;(this.isRTL?!i:i)?this.goToNextSlide():this.goToPrevSlide()}goToNextSlide(){this.currentSlide<this.images.length-1&&this.currentSlide++}goToPrevSlide(){this.currentSlide>0&&this.currentSlide--}renderStars(){return Array(5).fill(null).map(((s,i)=>t("span",{key:i,innerHTML:this.review.stars>=i+1?' <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.00045 13.6951L3.71036 16.6563L4.89186 10.71L0.440918 6.59397L6.4612 5.88017L9.00045 0.375122L11.5396 5.88017L17.5599 6.59397L13.109 10.71L14.2905 16.6563L9.00045 13.6951Z" fill="currentcolor" />\n</svg>':' <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.00045 13.6951L3.71036 16.6563L4.89186 10.71L0.440918 6.59397L6.4612 5.88017L9.00045 0.375122L11.5396 5.88017L17.5599 6.59397L13.109 10.71L14.2905 16.6563L9.00045 13.6951Z" fill="#DDDDDD" />\n</svg>'})))}renderDots(){return this.images.map((({url:s},i)=>t("button",{key:s||i,type:"button",class:"s-review-card-slider-dot "+(this.currentSlide===i?"active":""),onClick:()=>this.goToSlide(i),"aria-label":`Go to slide ${i+1}`,onPointerDown:()=>this.goToSlide(i)})))}renderSlider(){return this.hasMultipleImages?t("div",{class:"s-review-card-slider-container"},t("div",{class:"s-review-card-slides",style:{transform:this.slideTransform}},this.images.map((s=>t("div",{key:s?.id,class:"s-review-card-slider-slide"},t("img",{src:s.url,alt:s.alt||"Product image",width:275,height:275,loading:"lazy",draggable:!1}))))),t("div",{class:"s-review-card-slider-dots"},this.renderDots())):null}renderSingleImage(){const s=this.review?.product?.image;return!s||this.hasMultipleImages?null:t("img",{src:s.url,alt:s.alt||"Product image",class:"s-review-card-image",width:275,height:275,loading:"lazy",decoding:"async",draggable:!1})}renderHeader(){return t("div",{class:"s-review-card-header"},t("div",{class:"s-review-card-reviewer-name"},t("p",null,this.review?.name),this.review?.has_order&&t("span",{class:"s-review-card-verified-icon",innerHTML:o})),t("div",{class:"s-review-card-stars"},this.renderStars()))}renderProductInfo(){const s=this.review?.product;return s?t("a",{href:this.review?.product?.url,class:"s-review-card-product-container"},t("img",{alt:s.image?.alt||"Product",src:s.image?.url,class:"s-review-card-product-image",width:60,height:60,loading:"lazy",decoding:"async",draggable:!1}),t("div",{class:"s-review-card-product-details"},t("p",{class:"s-review-card-product-details-name"},s.name),this.showPurchaseCount?t("p",{class:"s-review-card-product-details-purchase-count"},t("span",{innerHTML:' <svg width="12" height="17" view-box="0 0 12 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6 16.2501C9.10658 16.2501 11.625 13.7317 11.625 10.6251C11.625 9.976 11.4523 9.35252 11.25 8.77232C9.99998 10.0075 9.05002 10.6251 8.4 10.6251C11.3966 5.37512 9.75 3.12512 5.25 0.125122C5.625 3.87475 3.15302 5.58043 2.14634 6.52757C1.0559 7.5535 0.375 9.00977 0.375 10.6251C0.375 13.7317 2.89339 16.2501 6 16.2501ZM6.53205 2.92636C8.96333 4.98908 8.97495 6.59185 7.09725 9.88157C6.5265 10.8815 7.2486 12.1251 8.4 12.1251C8.9163 12.1251 9.43807 11.9745 9.98917 11.6789C9.52342 13.4466 7.91393 14.7501 6 14.7501C3.72182 14.7501 1.875 12.9033 1.875 10.6251C1.875 9.47072 2.34959 8.39582 3.17419 7.62002C3.2687 7.53115 3.74812 7.1062 3.76858 7.08782C4.08646 6.8017 4.34835 6.54985 4.60718 6.2727C5.52998 5.28461 6.19283 4.18735 6.53205 2.92636Z" fill="currentcolor" />\n </svg>'}),this.purchasedCount):null)):null}render(){return t("div",{key:"48e1eb2b71e5ee6e66def2aac42e9b6255935a17",class:"s-review-card-container"},this.renderSlider(),this.renderSingleImage(),y(),t("div",{key:"0b24ea13f1f31224fff7e73d5db6c428adef0bd9",class:"s-review-card-content"},this.renderHeader(),t("p",{key:"44501e61b5eed711820bece91053534a2baacbde",class:"s-review-card-review-content",innerHTML:this.review?.content}),y(),this.renderProductInfo()))}get el(){return e(this)}},y=()=>t("div",{class:"s-review-card-divider "});b.style=":host{display:block}";const k=class{constructor(t){s(this,t),this.limit=5,this.type="store",this.sort="latest",this.hideCustomerInfo=!1,this.reviews=[],this.showReviews=!1,this.testimonialText=salla.lang.get("blocks.home.testimonials"),this.displayAllLinkText=salla.lang.get("blocks.home.display_all"),this.displayAllURL=null,this.source=this.source,salla.onReady((()=>{this.displayAllURL=salla.url.get("testimonials"),this.isRTL=salla.config.get("theme.is_rtl",!0)})),salla.lang.onLoaded((()=>{this.testimonialText=salla.lang.get("blocks.home.testimonials"),this.displayAllLinkText=salla.lang.get("blocks.home.display_all")}))}fetchReviews(){if("json"===this.source)return Promise.resolve(JSON.parse(this.sourceValue));const s=["products","categories"].includes(this.source),t={limit:this.limit,source:this.source,items:s?JSON.parse(this.sourceValue):this.sourceValue,sort:this.sort,type:this.type,hide_customer_info:this.hideCustomerInfo?1:0};return salla.api.request("reviews",{params:t},"get")}componentWillLoad(){return new Promise((s=>salla.onReady(s))).then((()=>this.fetchReviews())).then((s=>s.data||[])).then((s=>{s.length&&(this.reviews=s,this.showReviews=!0,c.generateReviewSchema(this.reviews))}))}render(){return t("div",{key:"87bb92617b9d324de1302a6ca936f53c32127783",class:"s-reviews-container"},t("div",{key:"9f787c6c51986619ac833dbb5ec600117f44ac11",class:"s-reviews-header-wrapper"},t("h1",{key:"cfbd2cc1d756a364daae2aadeb622f562a2b2861",class:"s-reviews-header"},this.testimonialText),this.displayAllLink?t("a",{href:this.displayAllURL,class:"s-reviews-display-all"},this.displayAllLinkText,t("span",{class:"s-reviews-display-all-icon",innerHTML:d})):null),t("salla-slider",{key:"2ee3a757f2535a35b8361602a9f5e20700bb7f74",centered:!0,"slides-per-view":1,type:"testimonials",class:"s-reviews-testimonials-slider","controls-outer":!0,"auto-play":!0,id:`testimonials-${this.source}-slider`},t("div",{key:"9560489ef5c998b0eef8f0a2a9f7eec5e2f27c6d",slot:"items"},this.reviews.map(((s,i)=>t("div",{key:i,class:"s-reviews-swiper-slide"},t("div",{class:"s-reviews-testimonial"},t("div",{class:"s-reviews-testimonial__inner"},t("div",{class:"s-reviews-testimonial__avatar"},t("img",{src:"images/s-empty.png","data-src":s.avatar,alt:s.name?s.name:"testimonial-"+i,class:"lazy"})),t("div",{class:"s-reviews-testimonial__text"},t("p",{innerHTML:s.content}),t("div",{class:"s-reviews-testimonial__name_wrapper"},t("div",{class:"s-reviews-testimonial__info"},s.name&&t("h2",null,`${s.name}`)),t("div",{class:"s-reviews-testimonial__rating"},t("salla-rating-stars",{size:"small",value:s.stars})))),t("span",{class:"s-reviews-testimonial__icon",innerHTML:'\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>quote-open</title>\n<path d="M8 12v-5.333c0-0.737-0.596-1.333-1.333-1.333-3.676 0-6.667 2.991-6.667 6.667v8c0 3.676 2.991 6.667 6.667 6.667h1.333c3.676 0 6.667-2.991 6.667-6.667v-1.333c0-3.676-2.991-6.667-6.667-6.667zM12 20c0 2.205-1.795 4-4 4h-1.333c-2.205 0-4-1.795-4-4v-8c0-1.739 1.115-3.221 2.667-3.772v5.105c0 0.737 0.596 1.333 1.333 1.333h1.333c2.205 0 4 1.795 4 4zM25.333 12v-5.333c0-0.737-0.596-1.333-1.333-1.333-3.676 0-6.667 2.991-6.667 6.667v8c0 3.676 2.991 6.667 6.667 6.667h1.333c3.676 0 6.667-2.991 6.667-6.667v-1.333c0-3.676-2.991-6.667-6.667-6.667zM29.333 20c0 2.205-1.795 4-4 4h-1.333c-2.205 0-4-1.795-4-4v-8c0-1.739 1.115-3.221 2.667-3.772v5.105c0 0.737 0.596 1.333 1.333 1.333h1.333c2.205 0 4 1.795 4 4z"></path>\n</svg>\n'})))))))))}};var _,C,L,x,M,S,T,z,H,$,I,P;function D(){if($)return H;$=1;var s=n(),t=function(){if(C)return _;C=1;var s=a();return _=function(){return s.Date.now()}}(),i=function(){if(z)return T;z=1;var s=function(){if(S)return M;S=1;var s=function(){if(x)return L;x=1;var s=/\s/;return L=function(t){for(var i=t.length;i--&&s.test(t.charAt(i)););return i}}(),t=/^\s+/;return M=function(i){return i?i.slice(0,s(i)+1).replace(t,""):i}}(),t=n(),i=r(),e=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,o=parseInt;return T=function(n){if("number"==typeof n)return n;if(i(n))return NaN;if(t(n)){var r="function"==typeof n.valueOf?n.valueOf():n;n=t(r)?r+"":r}if("string"!=typeof n)return 0===n?n:+n;n=s(n);var h=a.test(n);return h||l.test(n)?o(n.slice(2),h?2:8):e.test(n)?NaN:+n}}(),e=Math.max,l=Math.min;return H=function(a,n,r){var o,h,c,m,d,u,p=0,g=!1,v=!1,f=!0;if("function"!=typeof a)throw new TypeError("Expected a function");function w(s){var t=o,i=h;return o=h=void 0,p=s,m=a.apply(i,t)}function b(s){var t=s-u;return void 0===u||t>=n||t<0||v&&s-p>=c}function y(){var s=t();if(b(s))return k(s);d=setTimeout(y,function(s){var t=n-(s-u);return v?l(t,c-(s-p)):t}(s))}function k(s){return d=void 0,f&&o?w(s):(o=h=void 0,m)}function _(){var s=t(),i=b(s);if(o=arguments,h=this,u=s,i){if(void 0===d)return function(s){return p=s,d=setTimeout(y,n),g?w(s):m}(u);if(v)return clearTimeout(d),d=setTimeout(y,n),w(u)}return void 0===d&&(d=setTimeout(y,n)),m}return n=i(n)||0,s(r)&&(g=!!r.leading,c=(v="maxWait"in r)?e(i(r.maxWait)||0,n):c,f="trailing"in r?!!r.trailing:f),_.cancel=function(){void 0!==d&&clearTimeout(d),p=0,o=u=h=d=void 0},_.flush=function(){return void 0===d?m:k(t())},_},H}k.style="";var E=l(function(){if(P)return I;P=1;var s=D(),t=n();return I=function(i,e,a){var n=!0,r=!0;if("function"!=typeof i)throw new TypeError("Expected a function");return t(a)&&(n="leading"in a?!!a.leading:n,r="trailing"in a?!!a.trailing:r),s(i,e,{leading:n,maxWait:e,trailing:r})}}());class R{constructor(s){this.grid=s,this.create=()=>{this.mutationObserver.observe(this.grid,{childList:!0});for(const s of Array.from(this.grid.children))this.resizeObserver.observe(s)},this.onContainerMutation=s=>{const t=s.flatMap((s=>Array.from(s.removedNodes))),i=s.flatMap((s=>Array.from(s.addedNodes)));for(const s of t)s instanceof Element&&this.resizeObserver.unobserve(s);for(const s of i)s instanceof Element&&this.resizeObserver.observe(s);t.length>0&&0===i.length&&this.update()},this.onChildrenResize=s=>{s.filter((s=>null!==s.target.parentElement)).length>0&&this.update()},this.update=E((()=>{const s=window.getComputedStyle(this.grid);if(!1===s.getPropertyValue("display").includes("grid"))return void this.clean();const t=function(s){return window.getComputedStyle(s).getPropertyValue("grid-template-columns").trim().split(/\s+(?=(?:[^()]*\([^()]*\))*[^()]*$)/)}(this.grid);if(t.length<=1)return void this.clean();const i=Number.parseFloat(s.getPropertyValue("row-gap").trim())||0,e=Array.from(this.grid.children);for(let s=0;s<t.length;s++){const t=e[s];t?.style.removeProperty("margin-top")}for(let s=0;s<e.length;s++){const a=e[s-t.length],n=e[s];if(void 0!==a&&void 0!==n){const s=a.getBoundingClientRect().bottom;n.style.removeProperty("margin-top");const t=n.getBoundingClientRect().top;if(t-i!==s){const e=Math.round(100*(s-(t-i)+Number.EPSILON))/100;n.style.setProperty("margin-top",`${e}px`)}}}}),32),this.destroy=()=>{this.resizeObserver.disconnect(),this.mutationObserver.disconnect(),this.clean()},this.clean=()=>{for(const s of Array.from(this.grid.children))s.style.removeProperty("margin-top")},this.mutationObserver=new MutationObserver(this.onContainerMutation),this.resizeObserver=new ResizeObserver(this.onChildrenResize),!1===CSS.supports("grid-template-rows","masonry")&&this.create()}[Symbol.dispose](){this.destroy()}}const j=class{constructor(t){s(this,t),this.reviews=[],this.isLoading=!1,this.pagination=null,this.sort="latest"}getUrlParams(){const s=new URLSearchParams(window.location.search);return{sort:s.get("sort")||null,page:Number.parseInt(s.get("page"))||1}}updateUrlParams(s){const t=new URL(window.location.href);for(const[i,e]of Object.entries(s))e?t.searchParams.set(i,e.toString()):t.searchParams.delete(i);window.history.replaceState({},"",t.toString())}fetchReviews(s,t){const i=this.getUrlParams();return salla.api.request("reviews",{params:{type:"products",format:"lite",per_page:8,page:t||i.page||1,sort:s||i.sort||null}})}async initializeMasonry(){const s=this.el.querySelector(".s-reviews-page-grid");if(s)try{new R(s),salla.logger.info("Masonry initialized successfully")}catch(s){salla.logger.error("Masonry initialization failed:",s)}}animateReviewCards(){const s=this.wrapper.querySelectorAll("salla-review-card:not(.animated)");c.animateItems(s)}initiateInfiniteScroll(){this.wrapper?(this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.pagination?.links?.next||null,history:!1,scrollThreshold:!1},!0),this.infiniteScroll?.on("request",(()=>{this.isLoading=!0})),this.infiniteScroll?.on("load",(s=>{this.pagination=s.pagination,this.reviews=[...this.reviews,...s.data],this.isLoading=!1,this.updateUrlParams({page:s.pagination.current_page})})),this.infiniteScroll?.on("error",(s=>{salla.logger.error("Error loading more reviews:",s),this.isLoading=!1}))):salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.")}componentDidRender(){setTimeout((()=>{requestAnimationFrame(this.animateReviewCards.bind(this))}),176)}async componentWillLoad(){try{await salla.onReady(),this.langTitlesReviews=salla.lang.get("common.titles.reviews"),this.langSorting=salla.lang.get("pages.categories.sorting"),this.placeholderText=salla.lang.choice("pages.rating.reviews",0),this.langLoadMore=salla.lang.get("common.elements.load_more"),this.langSortByTopRating=salla.lang.get("pages.testimonials.sort_by_rating_desc"),this.langSortByMostRecent=salla.lang.get("pages.testimonials.sort_by_date_desc"),this.langSortByLeastRated=salla.lang.get("pages.testimonials.sort_by_rating_asc"),this.langSortByLeastRecent=salla.lang.get("pages.testimonials.sort_by_date_asc");const s=this.getUrlParams(),t=await this.fetchReviews(s.sort);this.sort=s.sort,this.reviews=t.data,this.pagination=t.pagination,this.langRatingReviews=salla.lang.choice("pages.rating.reviews",this.pagination?.total)}catch(s){salla.logger.error("Error loading reviews:",s)}}async handleSorting(s){const t=s.target.value;this.sort=t,this.updateUrlParams({sort:t,page:1});const i=await this.fetchReviews(t,1);this.reviews=i.data,this.pagination=i.pagination}async componentDidLoad(){await this.initializeMasonry(),this.initiateInfiniteScroll(),this.sort=this.getUrlParams().sort||"latest",this.updateUrlParams({sort:this.sort,page:1})}disconnectedCallback(){this.infiniteScroll&&this.infiniteScroll.destroy()}renderSortingOptions(){return[{value:"latest",label:this.langSortByMostRecent},{value:"oldest",label:this.langSortByLeastRecent},{value:"top_rating",label:this.langSortByTopRating},{value:"bottom_rating",label:this.langSortByLeastRated}].map((s=>t("option",{key:s.value,value:s.value,selected:s.value===this.sort},s.label)))}render(){return t("host",{key:"a38a67a03a9ef104b0233f560d764b31e5dbe636"},t("div",{key:"9bcd8e6b51ade66e2a7ec6499c03d481e9ea9462",class:"s-reviews-page-header-wrapper"},t("h2",{key:"2af4f0e2f6814278c5f02a53cf20223eba0924b7",class:"s-reviews-page-title"},this.langTitlesReviews,t("span",{key:"9741437a092ae5b56f2633b0cdd7629bb83bcdf4",class:"s-reviews-page-count"},"(",this.langRatingReviews,")")),t("div",{key:"68255bc0c46369dfbfa7966cbae3524014a020e0",class:"s-reviews-page-filter-wrapper"},t("label",{key:"5aa4b79c6de3f960d235b35a3391e0aa883f1803",class:"s-reviews-page-filter-label",htmlFor:"testimonials-filter"},this.langSorting),t("select",{key:"66ffbca8eab701b4177fbd16deb6b45cd8b03440",onChange:s=>this.handleSorting(s),disabled:!this.reviews.length,class:"s-reviews-page-filter"},this.renderSortingOptions()))),this.reviews.length?t("main",{class:"s-reviews-page-grid",ref:s=>{this.wrapper=s}},this.reviews.map((s=>t("salla-review-card",{key:s.id,review:s})))):t("div",{class:"s-products-list-placeholder"},t("span",{innerHTML:u}),t("p",null,this.placeholderText)),this.pagination?.links?.next&&this.reviews.length?t("div",{class:"s-reviews-page-load-more-container"},t("salla-button",{class:"s-reviews-page-load-more-btn",loading:this.isLoading,onClick:()=>this.infiniteScroll?.loadNextPage(),onKeyUp:()=>this.infiniteScroll?.loadNextPage()},this.langLoadMore)):null)}get el(){return e(this)}};j.style=":host{display:block}";const N=class{constructor(t){s(this,t),this.canRender=!1,this.showRatingSummary=!1,this.recommendationOnly=!1,this.showRecommendation=!1}async componentWillLoad(){try{await salla.onReady(),this.initializeLanguages(),this.loadConfig(),(this.showRatingSummary||this.showRecommendation)&&await this.loadSummary()}catch(s){console.error("Failed to initialize reviews summary component:",s)}}async loadConfig(){this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary"),this.showRecommendation=salla.config.get("store.settings.rating.show_recommendation"),this.recommendationOnly=this.showRecommendation&&!this.showRatingSummary}initializeLanguages(){return Salla.lang.onLoaded((()=>{Salla.lang.addBulk({"blocks.comments.based_on":{ar:"بناءً على",en:"Based on"},"blocks.comments.recommended":{ar:"أوصوا بالمنتج",en:"Recommended"}}),this.basedOnLabel=salla.lang.get("blocks.comments.based_on"),this.recommendedLabel=salla.lang.get("blocks.comments.recommended")}))}async loadSummary(){if(!this.itemId)return console.error("Error loading reviews summary: itemId is not defined"),this.canRender=!1;try{const s=await salla.api.request(`rating/summary/${this.itemId}`);if(!s?.data||Array.isArray(s.data.reviews)&&!s.data.reviews.length)return this.canRender=!1,void(this.data=null);this.data=s.data,this.canRender=!0}catch(s){this.canRender=!1,this.data=null,console.error("Error loading reviews summary:",s)}}renderRecommendation(){return this.showRecommendation&&this.data?.recommendation?t("div",{class:("s-reviews-summary-header-section "+(this.recommendationOnly?"s-reviews-summary-recommendation-only":"")).trim()},t("h4",{class:"s-reviews-summary-recommendation-percentage"},"%",this.data?.recommendation),t("p",{class:"s-reviews-summary-count"},this.recommendedLabel)):null}render(){if(!this.canRender)return null;if(this.recommendationOnly)return this.renderRecommendation();const s={1:0,2:0,3:0,4:0,5:0,...this.data.reviews},e=Object.keys(s).reverse().map((i=>{const e=s[i];return t("div",{key:i,class:"s-reviews-summary-row"},t("div",{class:"s-reviews-summary-row-rate"},i," ",t("span",{innerHTML:m})),t("salla-progress-bar",{class:"s-reviews-summary-progress",value:e,target:100,hideUnits:!0,height:"16px"}),t("span",{class:"s-reviews-summary-percentage"},e,"%"))}));return t(i,{class:"s-reviews-summary-wrapper"},t("div",{class:"s-reviews-summary-header"},t("div",{class:"s-reviews-summary-header-section"},t("h3",{class:"s-reviews-summary-average"},this.data.rating),t("div",null,t("salla-rating-stars",{size:"large",value:this.data.rating}),t("p",{class:"s-reviews-summary-count"},this.basedOnLabel," ",salla.helpers.number(salla.lang.choice("pages.rating.reviews",this.data.count))))),this.renderRecommendation()),t("div",{class:"s-reviews-summary-rows"},e))}};N.style=":host{display:block}";export{p as salla_comment_form,g as salla_comment_item,f as salla_comments,w as salla_rating_stars,b as salla_review_card,k as salla_reviews,j as salla_reviews_page,N as salla_reviews_summary}
4
+ import{r as s,h as t,H as i,a as e,f as a,i as n,j as r,d as l}from"./p-B-fHbvwg.js";import{i as o}from"./p-BsXh13x8.js";import{a as h}from"./p-CgtvEd63.js";import{H as c}from"./p-CHf8XdiS.js";import{S as m}from"./p-D4oPi1Ov.js";import{a as d}from"./p-BedNk7k1.js";import{S as u}from"./p-DiKTtDW5.js";const p=class{constructor(t){s(this,t),this.placeholder=salla.lang.get("blocks.comments.placeholder"),this.submitText=salla.lang.get("blocks.comments.submit"),salla.lang.onLoaded((()=>{this.placeholder=salla.lang.get("blocks.comments.placeholder"),this.submitText=salla.lang.get("blocks.comments.submit")})),salla.onReady((()=>{this.canComment=salla.config.get("user.can_comment"),this.itemId=salla.config.get("page.id"),this.type=salla.url.is_page("page-single")?"page":salla.url.is_page("blog.single")?"blog":"product"}))}submit(){this.commentForm.reportValidity()?this.submitBtn.load().then((()=>salla.comment.add({id:this.itemId,comment:this.commentField.value,type:this.type}))).finally((()=>this.submitBtn.stop)):salla.log("CommentForm:: validation error!")}render(){return t(i,{key:"1c2cdcb7dea3afa14a9fbe7700b05241c6e36770"},this.canComment?t("form",{ref:s=>this.commentForm=s},t("div",{class:"s-comment-form-wrapper"},this.showAvatar?t("img",{class:"s-comment-form-avatar",src:salla.config.get("user.avatar"),alt:"user avatar"}):"",t("div",{class:"s-comment-form-content"},t("textarea",{cols:30,rows:5,minlength:"4",maxlength:"500",ref:s=>this.commentField=s,placeholder:this.placeholder,class:"s-comment-form-input",required:!0}),t("br",null),t("div",{class:"s-comment-form-action"},t("salla-button",{ref:s=>this.submitBtn=s,"loader-position":"center",onClick:()=>this.submit()},this.submitText))))):"")}};p.style=":host{display:block}";const g=class{constructor(t){s(this,t),this.has_bought_trans=salla.lang.get("blocks.comments.has_bought"),this.rated_trans=salla.lang.get("pages.rating.rated"),this.waiting_approval_trans=salla.lang.get("blocks.comments.waiting_approval"),this.has_order_trans=salla.lang.get("blocks.comments.has_order"),this.allowLikes=salla.config.get("store.settings.rating.allow_likes"),this.allowAttachImages=salla.config.get("store.settings.rating.allow_attach_images"),this.helpfulLabel=salla.lang.getWithDefault("blocks.comments.helpful","مفيد"),this.likesCount=0,this.likedComments=[],salla.lang.onLoaded((()=>{const s=(s,t,i)=>new Promise((e=>{salla.helpers.setNested(salla.lang.messages[s],t,i),e(!0)}));this.has_bought_trans=salla.lang.get("blocks.comments.has_bought"),this.rated_trans=salla.lang.get("pages.rating.rated"),this.waiting_approval_trans=salla.lang.get("blocks.comments.waiting_approval"),this.has_order_trans=salla.lang.get("blocks.comments.has_order"),(async()=>{await s("ar.trans","blocks.comments.helpful","مفيد"),await s("en.trans","blocks.comments.helpful","Helpful"),this.helpfulLabel=salla.lang.getWithDefault("blocks.comments.helpful","مفيد")})()}))}componentDidLoad(){this.likesCount=this.comment.likes_count;try{this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]"),this.likedComments.includes(this.comment.id)&&(this.likeBtn.classList.add("liked"),this.likeBtn.fill="solid")}catch{salla.log("Bad json for liked_comments")}}getReplies(){return Array.isArray(this.comment.replies)?this.comment.replies:[this.comment.replies]}getDate(s){const[t]=s.split(" "),[i,e,a]=t.split("-");return`${parseInt(a,10)}/${parseInt(e,10)}/${parseInt(i,10)}`}getTime(s){const[,t]=s.split(" "),[i,e]=t.split(":");return`${parseInt(i,10)}:${parseInt(e,10)}`}async toggleLike(){if(salla.config.isGuest())return salla.notify.error(salla.lang.get("common.messages.must_login"));this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]");const s=this.likedComments.includes(this.comment.id);try{const t=s?`rating/${this.comment.id}/unlike`:`rating/${this.comment.id}/like`,i=await salla.api.request(t,"","put");salla.log(i.message),s?(this.likeBtn.classList.remove("liked"),this.likeBtn.fill="outline",this.updateLikedComments(this.comment.id,!1),this.likesCount--):(this.likeBtn.classList.add("liked"),this.likeBtn.fill="solid",this.updateLikedComments(this.comment.id,!0),this.likesCount++)}catch(s){409==s.response.status&&(this.likeBtn.classList.contains("liked")?(this.likeBtn.fill="outline",this.likeBtn.classList.remove("liked"),this.updateLikedComments(this.comment.id,!1),this.likesCount--):(this.likeBtn.fill="solid",this.likeBtn.classList.add("liked"),salla.logger.warn("Like already exists"),this.updateLikedComments(this.comment.id,!0)))}}updateLikedComments(s,t){this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]"),t?this.likedComments.includes(s)||this.likedComments.push(s):this.likedComments=this.likedComments.filter((t=>t!==s)),localStorage.setItem("liked_comments",JSON.stringify(this.likedComments))}PinnedIcon(){return t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"16",height:"16",color:"#555555",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},t("path",{d:"M12 16V21"}),t("path",{d:"M8 5.2918C8 5.02079 8 4.88529 8.01312 4.77132C8.1194 3.84789 8.84789 3.1194 9.77133 3.01312C9.88529 3 10.0208 3 10.2918 3H13.7082C13.9792 3 14.1147 3 14.2287 3.01312C15.1521 3.1194 15.8806 3.84789 15.9869 4.77132C16 4.88529 16 5.02079 16 5.2918C16 5.37885 16 5.42237 15.9967 5.46264C15.9708 5.78281 15.7927 6.07104 15.5179 6.2374C15.4834 6.25832 15.4444 6.27779 15.3666 6.31672L15.1055 6.44726C14.7021 6.64897 14.5003 6.74983 14.3681 6.90564C14.26 7.03286 14.1856 7.18509 14.1515 7.34846C14.1097 7.54854 14.1539 7.76968 14.2424 8.21197L15 12H15.3333C15.9533 12 16.2633 12 16.5176 12.0681C17.2078 12.2531 17.7469 12.7922 17.9319 13.4824C18 13.7367 18 14.0467 18 14.6667C18 14.9767 18 15.1317 17.9659 15.2588C17.8735 15.6039 17.6039 15.8735 17.2588 15.9659C17.1317 16 16.9767 16 16.6667 16H7.33333C7.02334 16 6.86835 16 6.74118 15.9659C6.39609 15.8735 6.12654 15.6039 6.03407 15.2588C6 15.1317 6 14.9767 6 14.6667C6 14.0467 6 13.7367 6.06815 13.4824C6.25308 12.7922 6.79218 12.2531 7.48236 12.0681C7.73669 12 8.04669 12 8.66667 12H9L9.75761 8.21197C9.84606 7.76968 9.89029 7.54854 9.84852 7.34846C9.81441 7.18509 9.73995 7.03286 9.63194 6.90564C9.49965 6.74983 9.29794 6.64897 8.89452 6.44726L8.63344 6.31672C8.55558 6.27779 8.51665 6.25832 8.48208 6.2374C8.20731 6.07104 8.02917 5.78281 8.00326 5.46264C8 5.42237 8 5.37885 8 5.2918Z"}))}render(){let s="admin"==this.comment.type;return t(i,{key:"93d39f2ef35c0cfdcd6333e58e6a836845b4fe12",class:s?"s-comments-item-admin":"s-comments-item"},t("div",{key:"c160b10f946149c293cb0daeaf96aa7b06ba095e",class:{"s-comments-item-wrapper":!s,"s-comments-item-admin-wrapper":s},id:`s-comments-item-${this.comment.id}`},t("div",{key:"60728bde4f0293cf419b589759b6621c5f0a519a",class:"s-comments-item-inner s-comments-flex-1"},s&&t("span",{key:"aac6a394aa6460756c4c54d0a0c671078d1dddd6",class:"s-comments-item-reply-icon",innerHTML:'\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>reply</title>\n<path d="M20 14.667h-12.609l9.401-6.927c0.592-0.436 0.72-1.271 0.283-1.863-0.439-0.595-1.273-0.72-1.864-0.283l-12.667 9.333c-0.343 0.251-0.544 0.649-0.544 1.072s0.201 0.821 0.543 1.073l12.667 9.333c0.237 0.176 0.515 0.26 0.789 0.26 0.409 0 0.813-0.188 1.075-0.543 0.437-0.592 0.309-1.427-0.283-1.863l-9.4-6.928h12.609c4.412 0 8 3.588 8 8 0 0.737 0.597 1.333 1.333 1.333s1.333-0.596 1.333-1.333c0-5.881-4.785-10.667-10.667-10.667z"></path>\n</svg>\n'}),t("div",{key:"cdca36fac4f23720084477ee889325942d25341e",class:"s-comments-item-avatar"},t("img",{key:"07e8e17f7470d87607c8aaa8f15e283b129ca070","data-src":this.comment?.avatar,alt:this.comment?.name,src:this.comment?.avatar,class:"s-comments-item-avatar-img lazy"})),t("div",{key:"6ef14e9b64d8300a24d886c081cc66ec621fd2a6",class:"s-comments-flex-1"},t("div",{key:"4f72cfb690978fae30d8ef7c957e6adf53a2872d",class:"s-comments-item-user-wrapper"},t("div",{key:"413840281c0050521a8ae4fd60e502ed821f4260",class:"s-comments-item-user-info"},t("h3",{key:"814c32cefc6b62585022ab3e1cdb59965553f1d2",class:this.comment.is_pinned?"s-comments-item-user-info-name":"s-comments-item-user-info-name-with-margin"},this.comment?.name),this.comment.is_pinned?t("div",{class:"s-comments-item-pinned-icon-with-margin"},this.PinnedIcon()):null,!this.comment.has_order&&!this.comment.rating||this.comment.is_pending||this.hideBought?null:t("div",{class:"s-comments-flex"},this.comment.has_order?[t("span",{class:"s-comments-item-has-order-check-icon",innerHTML:o}),t("span",{class:"s-comments-item-has-order-check-text"},this.has_bought_trans," ",this.comment.rating?", ":"")]:null,this.comment.rating?t("span",{class:"s-comments-item-rated-widget"},this.rated_trans):null)),t("p",{key:"7c6745073e250e100c8a613e4fd94d751042fb7f",class:"s-comments-item-timestamp s-ltr"},this.getDate(this.comment.created_at?.date),t("span",{key:"011cfc88b9702e14f6ea9d8ded0fa6f8678adb18",class:"s-comments-item-time"}," - ",this.getTime(this.comment.created_at?.date))),this.comment.rating||this.comment.stars?t("salla-rating-stars",{size:"mini",class:"s-comments-item-stars",value:this.comment.rating||this.comment.stars}):null),t("div",{key:"044599867529f9526306ac258981a15e4c43e369",class:"s-comments-item-content"},t("p",{key:"d3d082f84a154205bb6eedb0d14c2bb9a83387ee",innerHTML:this.comment.content}),this.allowAttachImages&&t("div",{key:"c475b4911834163084ede77e2c1f289ea9efddca",class:"s-comments-item-images"},this.comment.images.map(((s,i)=>t("img",{key:i,src:s,alt:"",onClick:()=>this.modal.open()}))),t("salla-modal",{key:"384d4555813e8e9c4bf7c6ad626def802f8f6f5a",ref:s=>this.modal=s,width:"sm"},t("salla-slider",{key:"a2be6511ff82555b87196183c6f463f4582c18c4",id:`s-comments-item-${this.comment.id}-images`,class:"s-comments-item-images-slider",type:"thumbs","auto-height":!0,showControls:this.comment.images.length>1,"show-thumbs-controls":"false"},t("div",{key:"c6029d94bdddf9958758fbd8c3dbca3e40ad1c01",slot:"items"},this.comment.images.map(((s,i)=>t("img",{key:i,src:s,alt:""})))),t("div",{key:"b5febbea6d46ce3b920f5bc15866eebb54f440e4",slot:"thumbs"},this.comment.images.map(((s,i)=>t("div",{class:"s-comments-item-images-slider-thumb"},t("img",{key:i,src:s,alt:""})))))))),this.allowLikes&&!s&&salla.url.is_page("product.single")?t("salla-button",{ref:s=>this.likeBtn=s,class:"s-comments-item-like-btn "+(this.likedComments.includes(this.comment.id)?"liked":""),loaderPosition:"center",fill:"outline",size:"small",onClick:()=>this.toggleLike()},t("span",null,this.helpfulLabel," ",this.likesCount>0?`(${this.likesCount})`:""),t("span",{innerHTML:'\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>thumbs-up</title>\n<path d="M26.667 10.667h-8.261l1.279-3.38c0.723-1.911 0.087-4.051-1.549-5.203-0.909-0.639-2.004-0.881-3.085-0.684-1.101 0.203-2.061 0.837-2.703 1.787l-5.452 8.067c-0.148 0.22-0.228 0.48-0.228 0.747v12c0 3.676 2.991 6.667 6.667 6.667h8.688c2.535 0 4.817-1.407 5.955-3.671l2.548-5.063c0.093-0.187 0.143-0.392 0.143-0.6v-6.667c0-2.205-1.795-4-4-4zM28 21.017l-2.405 4.78c-0.683 1.359-2.052 2.203-3.573 2.203h-8.688c-2.205 0-4-1.795-4-4v-11.592l5.223-7.728c0.237-0.352 0.584-0.585 0.975-0.657 0.367-0.067 0.749 0.017 1.068 0.241 0.631 0.444 0.879 1.317 0.591 2.079l-1.963 5.185c-0.156 0.409-0.099 0.869 0.149 1.229s0.66 0.576 1.099 0.576h10.192c0.735 0 1.333 0.599 1.333 1.333zM2.667 10.667c-0.736 0-1.333 0.597-1.333 1.333v16c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-16c0-0.736-0.597-1.333-1.333-1.333z"></path>\n</svg>\n'})):"",this.comment.is_pending?t("span",{class:"s-comments-item-pending-text"},this.waiting_approval_trans):null))),this.getReplies().length&&!s?this.getReplies().map((s=>t("div",null,t("salla-comment-item",{comment:s})))):null))}get host(){return e(this)}};var v;g.style=":host{display:block}",function(s){s.PAGE="page",s.PRODUCT="product",s.BLOG="blog"}(v||(v={}));const f=class{constructor(t){s(this,t),this.type=v.PAGE,this.showFormAvatar=!1,this.hideBought=!1,this.testimonials=!1,this.noComments=salla.lang.get("blocks.comments.no_comments"),this.comment_title=salla.lang.get("blocks.comments.title"),this.comment_name=salla.lang.get("blocks.comments.comment"),this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary"),this.allowLikes=salla.config.get("store.settings.rating.allow_likes"),salla.onReady((()=>{this.allowLikes=salla.config.get("store.settings.rating.allow_likes"),this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary")})),salla.lang.onLoaded((()=>{this.comment_title=salla.lang.get("blocks.comments.title"),this.comment_name=salla.lang.get("blocks.comments.comment"),this.noComments=salla.lang.get("pages.rating.no_ratings");const s=(s,t,i)=>new Promise((e=>{salla.helpers.setNested(salla.lang.messages[s],t,i),e(!0)}));(async()=>{await s("ar.trans","blocks.comments.most_helpful","الأكثر إفادة"),await s("en.trans","blocks.comments.most_helpful","Most helpful"),this.mostHelpfulLabel=salla.lang.get("blocks.comments.most_helpful"),this.comment_title=salla.lang.get("blocks.comments.title"),this.comment_name=salla.lang.get("blocks.comments.comment"),this.noComments=salla.lang.get("pages.rating.no_ratings")})()}))}pluralize(s,t){const i=s.split("|"),e=[{condition:0===t,index:0},{condition:1===t,index:1},{condition:2===t,index:2},{condition:t>2&&t<=10,index:3},{condition:t>=11,index:4}],{index:a}=e.find((({condition:s})=>s))||{index:i.length-1};return i[a].replace(":count",salla.helpers.number(t.toString())).replace(/\{[0-9]+\}/g,"").replace(/\[\d+,\d+\]|\[11,\*\]/g,"")}wrapConsoleError(){Salla.infiniteScroll.errorWrapped||((()=>{const s=console.error.bind(console);console.error=(...t)=>{const i=t[0];return"string"==typeof i&&i.toLowerCase().replace(/\s/g,"").includes("infinitescroll")?console.log(...t):s(...t)}})(),Salla.infiniteScroll.errorWrapped=!0)}initiateInfiniteScroll(){this.wrapper?(this.wrapConsoleError(),this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:!1,nextPage:this.nextPage,scrollThreshold:!1},!0),this.infiniteScroll?.on("request",(()=>{this.loading()})),this.infiniteScroll?.on("load",(s=>{this.pagination=s.pagination,this.nextPage="object"==typeof s.pagination.links&&s.pagination.links.next?s.pagination.links.next:null;for(const t of this.handleResponse(s))this.wrapper.append(t);const t=this.host.querySelectorAll("salla-comment-item:not(.animated):not(.s-comments-item-admin)");this.animateItems(t),this.loading(!1)})),this.infiniteScroll?.on("error",(s=>{salla.console.error("Error loading more comments:",s)}))):console.error("Wrapper is undefined. Cannot initiate infinite scroll.")}loading(s=!0){const t=this.status?.querySelector(".s-button-text");t&&(c.toggleElementClassIf(t,"s-button-hide","s-button-show",(()=>s)),this.btnLoader.style.display=s?"inherit":"none")}animateItems(s){h({targets:s,opacity:[0,1],duration:1200,translateY:[20,0],delay:(s,t)=>100*t,easing:"easeOutExpo",complete:()=>{for(const t of s)t.classList.add("animated")}})}async reload(){if(this.showPlaceholder=!1,this.wrapper){this.wrapper.innerHTML="";const s=document.createElement("salla-loading");this.wrapper.append(s)}this.nextPage=null,this.loadInitialData()}getCommentHTML(s){const t=document.createElement("salla-comment-item");return t.comment=s,t.hideBought=this.hideBought,t}handleResponse(s){return s.data?.map((s=>this.getCommentHTML(s)))||[]}componentWillLoad(){return salla.onReady().then((()=>{this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary")})).then((()=>this.loading())).then((()=>(this.hideTitle=this.hideTitle||this.testimonials,this.hideForm=this.hideForm||this.testimonials,this.loadInitialData())))}async loadInitialData(){try{let s={data:[],pagination:{}};const t=new URLSearchParams(window.location.search);if(t.has("sort")&&(this.sort=t.get("sort")),this.testimonials){const t={sort:this.sort,type:"store"};s=await salla.api.request("reviews",{params:t},"get")}else s=await salla.api.comment.getComments(this.type,this.itemId,1,5,this.sort);if(!s.data||!s.data.length)return this.showPlaceholder=!1,void this.loading(!1);if(this.wrapper&&(this.wrapper.innerHTML=""),this.comments=s.data,this.pagination=s.pagination,this.total=s.pagination.total,this.nextPage="object"==typeof s.pagination.links&&s.pagination.links.next?s.pagination.links.next:null,this.nextPage&&this.sort)try{const s=new URL(this.nextPage,window.location.origin);s.searchParams.get("sort")||(s.searchParams.set("sort",this.sort),this.nextPage=s.toString())}catch(s){const t=this.nextPage.includes("?");/[?&]sort=/.test(this.nextPage)||(this.nextPage=this.nextPage+(t?"&":"?")+`sort=${this.sort}`)}setTimeout((()=>{for(const t of this.handleResponse(s))this.wrapper.append(t);this.initiateInfiniteScroll();const t=this.wrapper.querySelectorAll("salla-comment-item:not(.animated)");this.animateItems(t)}),100)}catch(s){console.error("Error loading initial data:",s),this.showPlaceholder=!0,this.loading(!1)}}async loadMore(){this.infiniteScroll?.loadNextPage()}render(){return this.showPlaceholder?t("div",null,this.total&&!this.hideTitle?t("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",this.hideForm||this.testimonials?"":t("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}),t("div",{class:"s-comments-placeholder"},t("span",{innerHTML:'\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>chat-bubbles</title>\n<path d="M15.333 17.333c4.779 0 8.667-3.888 8.667-8.667s-3.888-8.667-8.667-8.667h-6.667c-4.779 0-8.667 3.888-8.667 8.667 0 2.985 1.513 5.712 4 7.297v4.703c0 0.497 0.277 0.953 0.717 1.183 0.195 0.1 0.405 0.151 0.616 0.151 0.269 0 0.536-0.081 0.764-0.241l6.323-4.425zM11.236 14.908l-4.569 3.199v-2.913c0-0.5-0.28-0.959-0.725-1.187-2.020-1.035-3.275-3.080-3.275-5.34 0-3.308 2.692-6 6-6h6.667c3.308 0 6 2.692 6 6s-2.692 6-6 6h-3.333c-0.273 0-0.54 0.084-0.764 0.241zM29.196 12.964c-0.543-0.5-1.388-0.464-1.884 0.077-0.5 0.541-0.465 1.385 0.077 1.884 1.253 1.156 1.944 2.72 1.944 4.408 0 2.26-1.255 4.305-3.275 5.339-0.445 0.228-0.725 0.687-0.725 1.188v2.572l-5.441-2.939c-0.195-0.104-0.412-0.16-0.633-0.16h-2.592c-1.688 0-3.309-0.724-4.451-1.988-0.492-0.545-1.335-0.591-1.883-0.096-0.547 0.493-0.589 1.336-0.096 1.883 1.644 1.823 3.988 2.868 6.429 2.868h2.255l7.111 3.84c0.199 0.107 0.417 0.16 0.635 0.16 0.236 0 0.472-0.063 0.683-0.188 0.404-0.241 0.651-0.676 0.651-1.145v-4.036c2.487-1.585 4-4.311 4-7.297 0-2.407-1.023-4.727-2.804-6.369z"></path>\n</svg>\n'}),t("p",null,this.noComments))):t("div",{class:`s-comments s-comments-${this.testimonials?"testimonials":this.type}`},t("div",{class:this.type===v.PAGE?"s-comments-page-container":"s-comments-container"},this.total&&!this.hideTitle?t("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",!this.hideForm&&t("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}),salla.url.is_page("product.single")?t("salla-reviews-summary",{itemId:this.itemId}):"",t("div",{class:"s-comments-header "+(this.total?"has-total":"")},!!this.total&&t("span",{class:"s-comments-count-label",innerHTML:this.pluralize(this.comment_name,this.total)}),this.total&&!this.testimonials&&this.type!==v.BLOG?t("div",{class:"s-comments-filter-wrapper"},t("label",{class:"s-comments-filter-label",htmlFor:"comments-filter"},salla.lang.get("pages.categories.sorting")),t("select",{id:"comments-filter","aria-label":salla.lang.get("pages.categories.sorting"),class:"s-form-control s-comments-sort-input",onChange:s=>{this.sort=s.target.value,this.reload()}},t("option",{value:"latest",selected:!0},salla.lang.get("pages.testimonials.sort_by_date_desc")),t("option",{value:"oldest"},salla.lang.get("pages.testimonials.sort_by_date_asc")),this.allowLikes&&t("option",{value:"most_helpful"},this.mostHelpfulLabel))):""),t("div",{ref:s=>{this.wrapper=s}}),this.nextPage&&t("div",{class:"s-infinite-scroll-wrapper",ref:s=>{this.status=s}},t("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary",type:"button"},t("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")),t("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:s=>{this.btnLoader=s},style:{display:"none"}})))))}get host(){return e(this)}};f.style=":host{display:block}";const w=class{constructor(t){s(this,t),this.translationsLoaded=!1,this.labels=[],this.reviewLabel="",this.selectedStar=0,this.name="rating",this.size="medium",this.reviews=0,this.editable=!1}async componentWillLoad(){await new Promise((s=>{salla.lang.onLoaded((()=>{this.labels=[salla.lang.get("pages.rating.poor"),salla.lang.get("pages.rating.average"),salla.lang.get("pages.rating.good"),salla.lang.get("pages.rating.very_good"),salla.lang.get("pages.rating.excellent")],this.value&&this.withLabel&&(this.reviewLabel=this.labels[this.value-1]),this.reviewsElement&&(this.reviewsElement.innerText=`(${salla.helpers.number(salla.lang.choice("pages.rating.reviews",this.reviews))})`),this.translationsLoaded=!0,s()}))}))}initiateRating(){this.host.addEventListener("click",this.handleRating.bind(this))}handleRating(){if(!this.starsElem)return;let s=this.starsElem.querySelectorAll(".s-rating-stars-hovered"),t=s[s.length-1];if(!t)return;let i=parseInt(t.getAttribute("data-star"));this.starsElem.querySelector(".rating_hidden_input").value=i.toString(),this.starsElem.querySelectorAll(".s-rating-stars-btn-star").forEach(((s,t)=>c.toggleElementClassIf(s,"s-rating-stars-selected","s-rating-stars-unselected",(()=>t<i)))),this.starsElem.querySelectorAll("[aria-pressed]").forEach((s=>s.removeAttribute("aria-pressed"))),t.setAttribute("aria-pressed","true"),this.selectedStar=i,this.withLabel&&(this.reviewLabel=this.labels[i-1])}triggerRatingProgrammatically(s){if(!this.starsElem)return;const t=this.starsElem.querySelectorAll(".s-rating-stars-btn-star");t&&s>=0&&s<=t.length&&(t.forEach(((t,i)=>{t.classList.toggle("s-rating-stars-hovered",i<=s)})),this.handleRating())}highlightSelectedStars(){let s="s-rating-stars-hovered",t=this.starsElem?.querySelectorAll(".s-rating-stars-btn-star");t?.forEach(((i,e)=>{i.addEventListener("mouseover",(()=>{for(let i=0;i<=e;i++)t[i].classList.add(s);this.withLabel&&(this.reviewLabel=this.labels[e])})),i.addEventListener("mouseout",(()=>{i.classList.remove(s),this.withLabel&&(this.reviewLabel=this.selectedStar?this.labels[this.selectedStar-1]:"")}))})),this.starsElem?.addEventListener("mouseout",(()=>t.forEach((t=>t.classList.remove(s)))))}createStars(s){let i=[];for(let e=0;e<5;e++)i.push(t("span",{class:{"s-rating-stars-btn-star":!0,["s-rating-stars-"+this.size]:!0,"s-rating-stars-selected":e<s},innerHTML:m}));return this.reviews>0&&i.push(t("span",{class:"s-rating-stars-reviews",ref:s=>this.reviewsElement=s},"(",salla.helpers.number(salla.lang.choice("pages.rating.reviews",this.reviews)),")")),i}render(){return this.translationsLoaded?this.host.closest(".swiper-slide")?.classList.contains("swiper-slide-duplicate")?"":t(i,null,t("div",{class:"s-rating-stars-wrapper"},!this.value&&0!=this.value||this.editable?t("div",{class:"s-rating-stars-element",ref:s=>this.starsElem=s},t("input",{type:"hidden",class:"rating_hidden_input",name:this.name,value:""}),[1,2,3,4,5].map((s=>t("button",{class:"s-rating-stars-btn-star s-rating-stars-"+this.size,"data-star":s},t("span",{innerHTML:m}))))):this.createStars(this.value),this.withLabel&&this.reviewLabel?t("span",{class:"s-rating-stars-label"},this.reviewLabel):"")):t(i,null)}componentDidLoad(){if(this.initiateRating(),this.highlightSelectedStars(),this.value&&this.editable){const s=this.starsElem?.querySelectorAll(".s-rating-stars-btn-star");s&&this.value>=0&&this.value<=s.length&&this.triggerRatingProgrammatically(this.value-1)}}get host(){return e(this)}};w.style="";const b=class{constructor(t){s(this,t),this.currentSlide=0,this.showPurchaseCount=!1,this.startPoint={x:0,y:0},this.isSwiping=!1,this.isRTL="rtl",this.handlePointerDown=s=>{s.isPrimary&&(this.sliderElement?.setPointerCapture(s.pointerId),this.startSwipe(s.clientX,s.clientY),s.preventDefault())},this.handlePointerMove=s=>{this.isSwiping&&s.isPrimary&&s.preventDefault()},this.handlePointerUp=s=>{this.isSwiping&&s.isPrimary&&(this.sliderElement?.releasePointerCapture(s.pointerId),this.endSwipe(s.clientX,s.clientY))},this.handlePointerCancel=s=>{this.isSwiping&&s.isPrimary&&(this.sliderElement?.releasePointerCapture(s.pointerId),this.isSwiping=!1)},this.goToSlide=s=>{this.currentSlide=Math.max(0,Math.min(s,this.images.length-1))}}async componentDidLoad(){await salla.onReady(),this.showPurchaseCount=!!salla.config.get("store.settings.product.total_sold_enabled",!1),this.isRTL=salla.config.get("theme.is_rtl",!0),this.purchasedCount=salla.lang.getWithDefault("blocks.home.reviews.purchased_count",this.isRTL?` تم شراءه ${this.review.product?.sold_quantity} مرة`:`Purchased ${this.review.product.sold_quantity} times`,{count:this.review.product?.sold_quantity}),this.initializeSlider()}disconnectedCallback(){this.removeEventListeners()}get images(){const{review:s}=this;return s?.images?.length>1?s.images.map(((s,t)=>({url:s,alt:"",id:t}))):s?.product?.images||[]}get hasMultipleImages(){return this.images.length>1}get slideTransform(){return`translateX(${100*this.currentSlide*(this.isRTL?1:-1)}%)`}initializeSlider(){this.hasMultipleImages&&(this.sliderElement=this.el.querySelector(".s-review-card-slider-container"),this.sliderElement&&(this.sliderElement.style.touchAction="pan-y pinch-zoom",this.addEventListeners()))}addEventListeners(){this.sliderElement&&(this.sliderElement.addEventListener("pointerdown",this.handlePointerDown,{passive:!1}),this.sliderElement.addEventListener("pointermove",this.handlePointerMove,{passive:!1}),this.sliderElement.addEventListener("pointerup",this.handlePointerUp,{passive:!0}),this.sliderElement.addEventListener("pointercancel",this.handlePointerCancel,{passive:!0}))}removeEventListeners(){this.sliderElement&&(this.sliderElement.removeEventListener("pointerdown",this.handlePointerDown),this.sliderElement.removeEventListener("pointermove",this.handlePointerMove),this.sliderElement.removeEventListener("pointerup",this.handlePointerUp),this.sliderElement.removeEventListener("pointercancel",this.handlePointerCancel))}startSwipe(s,t){this.startPoint={x:s,y:t},this.isSwiping=!0}componentDidRender(){this.removeEventListeners(),this.addEventListeners()}endSwipe(s,t){this.isSwiping=!1,this.processSwipe(s-this.startPoint.x,t-this.startPoint.y)}processSwipe(s,t){if(Math.abs(s)<10||Math.abs(t)>Math.abs(s))return;const i=s<0;(this.isRTL?!i:i)?this.goToNextSlide():this.goToPrevSlide()}goToNextSlide(){this.currentSlide<this.images.length-1&&this.currentSlide++}goToPrevSlide(){this.currentSlide>0&&this.currentSlide--}renderStars(){return Array(5).fill(null).map(((s,i)=>t("span",{key:i,innerHTML:this.review.stars>=i+1?' <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.00045 13.6951L3.71036 16.6563L4.89186 10.71L0.440918 6.59397L6.4612 5.88017L9.00045 0.375122L11.5396 5.88017L17.5599 6.59397L13.109 10.71L14.2905 16.6563L9.00045 13.6951Z" fill="currentcolor" />\n</svg>':' <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.00045 13.6951L3.71036 16.6563L4.89186 10.71L0.440918 6.59397L6.4612 5.88017L9.00045 0.375122L11.5396 5.88017L17.5599 6.59397L13.109 10.71L14.2905 16.6563L9.00045 13.6951Z" fill="#DDDDDD" />\n</svg>'})))}renderDots(){return this.images.map((({url:s},i)=>t("button",{key:s||i,type:"button",class:"s-review-card-slider-dot "+(this.currentSlide===i?"active":""),onClick:()=>this.goToSlide(i),"aria-label":`Go to slide ${i+1}`,onPointerDown:()=>this.goToSlide(i)})))}renderSlider(){return this.hasMultipleImages?t("div",{class:"s-review-card-slider-container"},t("div",{class:"s-review-card-slides",style:{transform:this.slideTransform}},this.images.map((s=>t("div",{key:s?.id,class:"s-review-card-slider-slide"},t("img",{src:s.url,alt:s.alt||"Product image",width:275,height:275,loading:"lazy",draggable:!1}))))),t("div",{class:"s-review-card-slider-dots"},this.renderDots())):null}renderSingleImage(){const s=this.review?.product?.image;return!s||this.hasMultipleImages?null:t("img",{src:s.url,alt:s.alt||"Product image",class:"s-review-card-image",width:275,height:275,loading:"lazy",decoding:"async",draggable:!1})}renderHeader(){return t("div",{class:"s-review-card-header"},t("div",{class:"s-review-card-reviewer-name"},t("p",null,this.review?.name),this.review?.has_order&&t("span",{class:"s-review-card-verified-icon",innerHTML:o})),t("div",{class:"s-review-card-stars"},this.renderStars()))}renderProductInfo(){const s=this.review?.product;return s?t("a",{href:this.review?.product?.url,class:"s-review-card-product-container"},t("img",{alt:s.image?.alt||"Product",src:s.image?.url,class:"s-review-card-product-image",width:60,height:60,loading:"lazy",decoding:"async",draggable:!1}),t("div",{class:"s-review-card-product-details"},t("p",{class:"s-review-card-product-details-name"},s.name),this.showPurchaseCount?t("p",{class:"s-review-card-product-details-purchase-count"},t("span",{innerHTML:' <svg width="12" height="17" view-box="0 0 12 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6 16.2501C9.10658 16.2501 11.625 13.7317 11.625 10.6251C11.625 9.976 11.4523 9.35252 11.25 8.77232C9.99998 10.0075 9.05002 10.6251 8.4 10.6251C11.3966 5.37512 9.75 3.12512 5.25 0.125122C5.625 3.87475 3.15302 5.58043 2.14634 6.52757C1.0559 7.5535 0.375 9.00977 0.375 10.6251C0.375 13.7317 2.89339 16.2501 6 16.2501ZM6.53205 2.92636C8.96333 4.98908 8.97495 6.59185 7.09725 9.88157C6.5265 10.8815 7.2486 12.1251 8.4 12.1251C8.9163 12.1251 9.43807 11.9745 9.98917 11.6789C9.52342 13.4466 7.91393 14.7501 6 14.7501C3.72182 14.7501 1.875 12.9033 1.875 10.6251C1.875 9.47072 2.34959 8.39582 3.17419 7.62002C3.2687 7.53115 3.74812 7.1062 3.76858 7.08782C4.08646 6.8017 4.34835 6.54985 4.60718 6.2727C5.52998 5.28461 6.19283 4.18735 6.53205 2.92636Z" fill="currentcolor" />\n </svg>'}),this.purchasedCount):null)):null}render(){return t("div",{key:"48e1eb2b71e5ee6e66def2aac42e9b6255935a17",class:"s-review-card-container"},this.renderSlider(),this.renderSingleImage(),y(),t("div",{key:"0b24ea13f1f31224fff7e73d5db6c428adef0bd9",class:"s-review-card-content"},this.renderHeader(),t("p",{key:"44501e61b5eed711820bece91053534a2baacbde",class:"s-review-card-review-content",innerHTML:this.review?.content}),y(),this.renderProductInfo()))}get el(){return e(this)}},y=()=>t("div",{class:"s-review-card-divider "});b.style=":host{display:block}";const k=class{constructor(t){s(this,t),this.limit=5,this.type="store",this.sort="latest",this.hideCustomerInfo=!1,this.reviews=[],this.showReviews=!1,this.testimonialText=salla.lang.get("blocks.home.testimonials"),this.displayAllLinkText=salla.lang.get("blocks.home.display_all"),this.displayAllURL=null,this.source=this.source,salla.onReady((()=>{this.displayAllURL=salla.url.get("testimonials"),this.isRTL=salla.config.get("theme.is_rtl",!0)})),salla.lang.onLoaded((()=>{this.testimonialText=salla.lang.get("blocks.home.testimonials"),this.displayAllLinkText=salla.lang.get("blocks.home.display_all")}))}fetchReviews(){if("json"===this.source)return Promise.resolve(JSON.parse(this.sourceValue));const s=["products","categories"].includes(this.source),t={limit:this.limit,source:this.source,items:s?JSON.parse(this.sourceValue):this.sourceValue,sort:this.sort,type:this.type,hide_customer_info:this.hideCustomerInfo?1:0};return salla.api.request("reviews",{params:t},"get")}componentWillLoad(){return new Promise((s=>salla.onReady(s))).then((()=>this.fetchReviews())).then((s=>s.data||[])).then((s=>{s.length&&(this.reviews=s,this.showReviews=!0,c.generateReviewSchema(this.reviews))}))}render(){return t("div",{key:"87bb92617b9d324de1302a6ca936f53c32127783",class:"s-reviews-container"},t("div",{key:"9f787c6c51986619ac833dbb5ec600117f44ac11",class:"s-reviews-header-wrapper"},t("h1",{key:"cfbd2cc1d756a364daae2aadeb622f562a2b2861",class:"s-reviews-header"},this.testimonialText),this.displayAllLink?t("a",{href:this.displayAllURL,class:"s-reviews-display-all"},this.displayAllLinkText,t("span",{class:"s-reviews-display-all-icon",innerHTML:d})):null),t("salla-slider",{key:"2ee3a757f2535a35b8361602a9f5e20700bb7f74",centered:!0,"slides-per-view":1,type:"testimonials",class:"s-reviews-testimonials-slider","controls-outer":!0,"auto-play":!0,id:`testimonials-${this.source}-slider`},t("div",{key:"9560489ef5c998b0eef8f0a2a9f7eec5e2f27c6d",slot:"items"},this.reviews.map(((s,i)=>t("div",{key:i,class:"s-reviews-swiper-slide"},t("div",{class:"s-reviews-testimonial"},t("div",{class:"s-reviews-testimonial__inner"},t("div",{class:"s-reviews-testimonial__avatar"},t("img",{src:"images/s-empty.png","data-src":s.avatar,alt:s.name?s.name:"testimonial-"+i,class:"lazy"})),t("div",{class:"s-reviews-testimonial__text"},t("p",{innerHTML:s.content}),t("div",{class:"s-reviews-testimonial__name_wrapper"},t("div",{class:"s-reviews-testimonial__info"},s.name&&t("h2",null,`${s.name}`)),t("div",{class:"s-reviews-testimonial__rating"},t("salla-rating-stars",{size:"small",value:s.stars})))),t("span",{class:"s-reviews-testimonial__icon",innerHTML:'\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>quote-open</title>\n<path d="M8 12v-5.333c0-0.737-0.596-1.333-1.333-1.333-3.676 0-6.667 2.991-6.667 6.667v8c0 3.676 2.991 6.667 6.667 6.667h1.333c3.676 0 6.667-2.991 6.667-6.667v-1.333c0-3.676-2.991-6.667-6.667-6.667zM12 20c0 2.205-1.795 4-4 4h-1.333c-2.205 0-4-1.795-4-4v-8c0-1.739 1.115-3.221 2.667-3.772v5.105c0 0.737 0.596 1.333 1.333 1.333h1.333c2.205 0 4 1.795 4 4zM25.333 12v-5.333c0-0.737-0.596-1.333-1.333-1.333-3.676 0-6.667 2.991-6.667 6.667v8c0 3.676 2.991 6.667 6.667 6.667h1.333c3.676 0 6.667-2.991 6.667-6.667v-1.333c0-3.676-2.991-6.667-6.667-6.667zM29.333 20c0 2.205-1.795 4-4 4h-1.333c-2.205 0-4-1.795-4-4v-8c0-1.739 1.115-3.221 2.667-3.772v5.105c0 0.737 0.596 1.333 1.333 1.333h1.333c2.205 0 4 1.795 4 4z"></path>\n</svg>\n'})))))))))}};var _,C,L,x,M,S,T,z,H,$,I,P;function D(){if($)return H;$=1;var s=n(),t=function(){if(C)return _;C=1;var s=a();return _=function(){return s.Date.now()}}(),i=function(){if(z)return T;z=1;var s=function(){if(S)return M;S=1;var s=function(){if(x)return L;x=1;var s=/\s/;return L=function(t){for(var i=t.length;i--&&s.test(t.charAt(i)););return i}}(),t=/^\s+/;return M=function(i){return i?i.slice(0,s(i)+1).replace(t,""):i}}(),t=n(),i=r(),e=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,o=parseInt;return T=function(n){if("number"==typeof n)return n;if(i(n))return NaN;if(t(n)){var r="function"==typeof n.valueOf?n.valueOf():n;n=t(r)?r+"":r}if("string"!=typeof n)return 0===n?n:+n;n=s(n);var h=a.test(n);return h||l.test(n)?o(n.slice(2),h?2:8):e.test(n)?NaN:+n}}(),e=Math.max,l=Math.min;return H=function(a,n,r){var o,h,c,m,d,u,p=0,g=!1,v=!1,f=!0;if("function"!=typeof a)throw new TypeError("Expected a function");function w(s){var t=o,i=h;return o=h=void 0,p=s,m=a.apply(i,t)}function b(s){var t=s-u;return void 0===u||t>=n||t<0||v&&s-p>=c}function y(){var s=t();if(b(s))return k(s);d=setTimeout(y,function(s){var t=n-(s-u);return v?l(t,c-(s-p)):t}(s))}function k(s){return d=void 0,f&&o?w(s):(o=h=void 0,m)}function _(){var s=t(),i=b(s);if(o=arguments,h=this,u=s,i){if(void 0===d)return function(s){return p=s,d=setTimeout(y,n),g?w(s):m}(u);if(v)return clearTimeout(d),d=setTimeout(y,n),w(u)}return void 0===d&&(d=setTimeout(y,n)),m}return n=i(n)||0,s(r)&&(g=!!r.leading,c=(v="maxWait"in r)?e(i(r.maxWait)||0,n):c,f="trailing"in r?!!r.trailing:f),_.cancel=function(){void 0!==d&&clearTimeout(d),p=0,o=u=h=d=void 0},_.flush=function(){return void 0===d?m:k(t())},_},H}k.style="";var E=l(function(){if(P)return I;P=1;var s=D(),t=n();return I=function(i,e,a){var n=!0,r=!0;if("function"!=typeof i)throw new TypeError("Expected a function");return t(a)&&(n="leading"in a?!!a.leading:n,r="trailing"in a?!!a.trailing:r),s(i,e,{leading:n,maxWait:e,trailing:r})}}());class R{constructor(s){this.grid=s,this.create=()=>{this.mutationObserver.observe(this.grid,{childList:!0});for(const s of Array.from(this.grid.children))this.resizeObserver.observe(s)},this.onContainerMutation=s=>{const t=s.flatMap((s=>Array.from(s.removedNodes))),i=s.flatMap((s=>Array.from(s.addedNodes)));for(const s of t)s instanceof Element&&this.resizeObserver.unobserve(s);for(const s of i)s instanceof Element&&this.resizeObserver.observe(s);t.length>0&&0===i.length&&this.update()},this.onChildrenResize=s=>{s.filter((s=>null!==s.target.parentElement)).length>0&&this.update()},this.update=E((()=>{const s=window.getComputedStyle(this.grid);if(!1===s.getPropertyValue("display").includes("grid"))return void this.clean();const t=function(s){return window.getComputedStyle(s).getPropertyValue("grid-template-columns").trim().split(/\s+(?=(?:[^()]*\([^()]*\))*[^()]*$)/)}(this.grid);if(t.length<=1)return void this.clean();const i=Number.parseFloat(s.getPropertyValue("row-gap").trim())||0,e=Array.from(this.grid.children);for(let s=0;s<t.length;s++){const t=e[s];t?.style.removeProperty("margin-top")}for(let s=0;s<e.length;s++){const a=e[s-t.length],n=e[s];if(void 0!==a&&void 0!==n){const s=a.getBoundingClientRect().bottom;n.style.removeProperty("margin-top");const t=n.getBoundingClientRect().top;if(t-i!==s){const e=Math.round(100*(s-(t-i)+Number.EPSILON))/100;n.style.setProperty("margin-top",`${e}px`)}}}}),32),this.destroy=()=>{this.resizeObserver.disconnect(),this.mutationObserver.disconnect(),this.clean()},this.clean=()=>{for(const s of Array.from(this.grid.children))s.style.removeProperty("margin-top")},this.mutationObserver=new MutationObserver(this.onContainerMutation),this.resizeObserver=new ResizeObserver(this.onChildrenResize),!1===CSS.supports("grid-template-rows","masonry")&&this.create()}[Symbol.dispose](){this.destroy()}}const j=class{constructor(t){s(this,t),this.reviews=[],this.isLoading=!1,this.pagination=null,this.sort="latest"}getUrlParams(){const s=new URLSearchParams(window.location.search);return{sort:s.get("sort")||null,page:Number.parseInt(s.get("page"))||1}}updateUrlParams(s){const t=new URL(window.location.href);for(const[i,e]of Object.entries(s))e?t.searchParams.set(i,e.toString()):t.searchParams.delete(i);window.history.replaceState({},"",t.toString())}fetchReviews(s,t){const i=this.getUrlParams();return salla.api.request("reviews",{params:{type:"products",format:"lite",per_page:8,page:t||i.page||1,sort:s||i.sort||null}})}async initializeMasonry(){const s=this.el.querySelector(".s-reviews-page-grid");if(s)try{new R(s),salla.logger.info("Masonry initialized successfully")}catch(s){salla.logger.error("Masonry initialization failed:",s)}}animateReviewCards(){const s=this.wrapper.querySelectorAll("salla-review-card:not(.animated)");c.animateItems(s)}initiateInfiniteScroll(){this.wrapper?(this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.pagination?.links?.next||null,history:!1,scrollThreshold:!1},!0),this.infiniteScroll?.on("request",(()=>{this.isLoading=!0})),this.infiniteScroll?.on("load",(s=>{this.pagination=s.pagination,this.reviews=[...this.reviews,...s.data],this.isLoading=!1,this.updateUrlParams({page:s.pagination.current_page})})),this.infiniteScroll?.on("error",(s=>{salla.logger.error("Error loading more reviews:",s),this.isLoading=!1}))):salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.")}componentDidRender(){setTimeout((()=>{requestAnimationFrame(this.animateReviewCards.bind(this))}),176)}async componentWillLoad(){try{await salla.onReady(),this.langTitlesReviews=salla.lang.get("common.titles.reviews"),this.langSorting=salla.lang.get("pages.categories.sorting"),this.placeholderText=salla.lang.choice("pages.rating.reviews",0),this.langLoadMore=salla.lang.get("common.elements.load_more"),this.langSortByTopRating=salla.lang.get("pages.testimonials.sort_by_rating_desc"),this.langSortByMostRecent=salla.lang.get("pages.testimonials.sort_by_date_desc"),this.langSortByLeastRated=salla.lang.get("pages.testimonials.sort_by_rating_asc"),this.langSortByLeastRecent=salla.lang.get("pages.testimonials.sort_by_date_asc");const s=this.getUrlParams(),t=await this.fetchReviews(s.sort);this.sort=s.sort,this.reviews=t.data,this.pagination=t.pagination,this.langRatingReviews=salla.lang.choice("pages.rating.reviews",this.pagination?.total)}catch(s){salla.logger.error("Error loading reviews:",s)}}async handleSorting(s){const t=s.target.value;this.sort=t,this.updateUrlParams({sort:t,page:1});const i=await this.fetchReviews(t,1);this.reviews=i.data,this.pagination=i.pagination}async componentDidLoad(){await this.initializeMasonry(),this.initiateInfiniteScroll(),this.sort=this.getUrlParams().sort||"latest",this.updateUrlParams({sort:this.sort,page:1})}disconnectedCallback(){this.infiniteScroll&&this.infiniteScroll.destroy()}renderSortingOptions(){return[{value:"latest",label:this.langSortByMostRecent},{value:"oldest",label:this.langSortByLeastRecent},{value:"top_rating",label:this.langSortByTopRating},{value:"bottom_rating",label:this.langSortByLeastRated}].map((s=>t("option",{key:s.value,value:s.value,selected:s.value===this.sort},s.label)))}render(){return t("host",{key:"a38a67a03a9ef104b0233f560d764b31e5dbe636"},t("div",{key:"9bcd8e6b51ade66e2a7ec6499c03d481e9ea9462",class:"s-reviews-page-header-wrapper"},t("h2",{key:"2af4f0e2f6814278c5f02a53cf20223eba0924b7",class:"s-reviews-page-title"},this.langTitlesReviews,t("span",{key:"9741437a092ae5b56f2633b0cdd7629bb83bcdf4",class:"s-reviews-page-count"},"(",this.langRatingReviews,")")),t("div",{key:"68255bc0c46369dfbfa7966cbae3524014a020e0",class:"s-reviews-page-filter-wrapper"},t("label",{key:"5aa4b79c6de3f960d235b35a3391e0aa883f1803",class:"s-reviews-page-filter-label",htmlFor:"testimonials-filter"},this.langSorting),t("select",{key:"66ffbca8eab701b4177fbd16deb6b45cd8b03440",onChange:s=>this.handleSorting(s),disabled:!this.reviews.length,class:"s-reviews-page-filter"},this.renderSortingOptions()))),this.reviews.length?t("main",{class:"s-reviews-page-grid",ref:s=>{this.wrapper=s}},this.reviews.map((s=>t("salla-review-card",{key:s.id,review:s})))):t("div",{class:"s-products-list-placeholder"},t("span",{innerHTML:u}),t("p",null,this.placeholderText)),this.pagination?.links?.next&&this.reviews.length?t("div",{class:"s-reviews-page-load-more-container"},t("salla-button",{class:"s-reviews-page-load-more-btn",loading:this.isLoading,onClick:()=>this.infiniteScroll?.loadNextPage(),onKeyUp:()=>this.infiniteScroll?.loadNextPage()},this.langLoadMore)):null)}get el(){return e(this)}};j.style=":host{display:block}";const N=class{constructor(t){s(this,t),this.canRender=!1,this.showRatingSummary=!1,this.recommendationOnly=!1,this.showRecommendation=!1}async componentWillLoad(){try{await salla.onReady(),this.initializeLanguages(),this.loadConfig(),(this.showRatingSummary||this.showRecommendation)&&await this.loadSummary()}catch(s){console.error("Failed to initialize reviews summary component:",s)}}async loadConfig(){this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary"),this.showRecommendation=salla.config.get("store.settings.rating.show_recommendation"),this.recommendationOnly=this.showRecommendation&&!this.showRatingSummary}initializeLanguages(){return Salla.lang.onLoaded((()=>{Salla.lang.addBulk({"blocks.comments.based_on":{ar:"بناءً على",en:"Based on"},"blocks.comments.recommended":{ar:"أوصوا بالمنتج",en:"Recommended"}}),this.basedOnLabel=salla.lang.get("blocks.comments.based_on"),this.recommendedLabel=salla.lang.get("blocks.comments.recommended")}))}async loadSummary(){if(!this.itemId)return console.error("Error loading reviews summary: itemId is not defined"),this.canRender=!1;try{const s=await salla.api.request(`rating/summary/${this.itemId}`);if(!s?.data||Array.isArray(s.data.reviews)&&!s.data.reviews.length)return this.canRender=!1,void(this.data=null);this.data=s.data,this.canRender=!0}catch(s){this.canRender=!1,this.data=null,console.error("Error loading reviews summary:",s)}}renderRecommendation(){return this.showRecommendation&&this.data?.recommendation?t("div",{class:("s-reviews-summary-header-section "+(this.recommendationOnly?"s-reviews-summary-recommendation-only":"")).trim()},t("h4",{class:"s-reviews-summary-recommendation-percentage"},"%",this.data?.recommendation),t("p",{class:"s-reviews-summary-count"},this.recommendedLabel)):null}render(){if(!this.canRender)return null;if(this.recommendationOnly)return this.renderRecommendation();const s={1:0,2:0,3:0,4:0,5:0,...this.data.reviews},e=Object.keys(s).reverse().map((i=>{const e=s[i];return t("div",{key:i,class:"s-reviews-summary-row"},t("div",{class:"s-reviews-summary-row-rate"},i," ",t("span",{innerHTML:m})),t("salla-progress-bar",{class:"s-reviews-summary-progress",value:e,target:100,hideUnits:!0,height:"16px"}),t("span",{class:"s-reviews-summary-percentage"},e,"%"))}));return t(i,{class:"s-reviews-summary-wrapper"},t("div",{class:"s-reviews-summary-header"},t("div",{class:"s-reviews-summary-header-section"},t("h3",{class:"s-reviews-summary-average"},this.data.rating),t("div",null,t("salla-rating-stars",{size:"large",value:this.data.rating}),t("p",{class:"s-reviews-summary-count"},this.basedOnLabel," ",salla.helpers.number(salla.lang.choice("pages.rating.reviews",this.data.count))))),this.renderRecommendation()),t("div",{class:"s-reviews-summary-rows"},e))}};N.style=":host{display:block}";export{p as salla_comment_form,g as salla_comment_item,f as salla_comments,w as salla_rating_stars,b as salla_review_card,k as salla_reviews,j as salla_reviews_page,N as salla_reviews_summary}