@salla.sa/twilight-components 3.0.10 → 3.0.11

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 (352) hide show
  1. package/dist/cjs/{Helper-Bq5ywe_Q.js → Helper-Bta9bFWz.js} +1 -1
  2. package/dist/cjs/{filepond-CeLuWP39.js → filepond-Dv48GITM.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-poster-zF8OrE5T.js → filepond-plugin-file-poster-Bn-5Zy-w.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-size-CWFqwSMQ.js → filepond-plugin-file-validate-size-DGwsFpCE.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-type-CPA9mQEI.js → filepond-plugin-file-validate-type--A7HwCGC.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-edit-D-uL3Yk2.js → filepond-plugin-image-edit-CZOu0C_e.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-BUPdT_KR.js → filepond-plugin-image-exif-orientation-DlkmyCu1.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-ySTrXgIM.js → filepond-plugin-image-preview-DtpRyOkv.js} +1 -1
  9. package/dist/cjs/{index-DvIh2sWT.js → index-Dbot13Bj.js} +2 -2
  10. package/dist/cjs/{intlTelInput-3D__jCUH.js → intlTelInput-7PzX73Yx.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +2 -2
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-applied-filters.cjs.entry.js +2 -2
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
  21. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-comment-form_9.cjs.entry.js +2 -2
  30. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters-widget.cjs.entry.js +2 -2
  38. package/dist/cjs/salla-filters.cjs.entry.js +2 -2
  39. package/dist/cjs/salla-free-shipping-banner.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-free-shipping-tag.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
  46. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
  65. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-items.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-order-payment.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-order-rewards.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-orders.cjs.entry.js +2 -2
  83. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-products-list.cjs.entry.js +8 -5
  90. package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
  91. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +2 -2
  93. package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
  94. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-search.cjs.entry.js +2 -2
  99. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-thank-you-header.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-thank-you-page.cjs.entry.js +1 -1
  105. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  106. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  107. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  108. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  109. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  110. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  111. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  112. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  113. package/dist/cjs/salla-wishlist-summary.cjs.entry.js +2 -2
  114. package/dist/cjs/twilight.cjs.js +1 -1
  115. package/dist/cjs/{vanilla-picker-CJuyUIp0.js → vanilla-picker-duouCWHz.js} +1 -1
  116. package/dist/collection/components/salla-products-list/salla-products-list.js +6 -3
  117. package/dist/components/index.js +2 -2
  118. package/dist/components/salla-products-list2.js +6 -3
  119. package/dist/docs.json +1 -1
  120. package/dist/esm/{Helper-CrMT8zX9.js → Helper-DWvWnPTT.js} +1 -1
  121. package/dist/esm/{filepond-DuKVrXmp.js → filepond-a9y0myDt.js} +1 -1
  122. package/dist/esm/{filepond-plugin-file-poster-Bd_PXIPD.js → filepond-plugin-file-poster-CdtFPjqC.js} +1 -1
  123. package/dist/esm/{filepond-plugin-file-validate-size-D3gbr2j4.js → filepond-plugin-file-validate-size-BVe60caz.js} +1 -1
  124. package/dist/esm/{filepond-plugin-file-validate-type-D9N7VDeK.js → filepond-plugin-file-validate-type-DoNTCSSY.js} +1 -1
  125. package/dist/esm/{filepond-plugin-image-edit-CSDoGjv9.js → filepond-plugin-image-edit-DxQBYiWr.js} +1 -1
  126. package/dist/esm/{filepond-plugin-image-exif-orientation-Dk107tLb.js → filepond-plugin-image-exif-orientation-BbbBG1df.js} +1 -1
  127. package/dist/esm/{filepond-plugin-image-preview-iA-7cAAh.js → filepond-plugin-image-preview-Dp9lSvoH.js} +1 -1
  128. package/dist/esm/{index-DGIIhW8W.js → index-Ca7ApeqJ.js} +2 -2
  129. package/dist/esm/{intlTelInput-CSLSv_ZP.js → intlTelInput-DHxBJckf.js} +1 -1
  130. package/dist/esm/loader.js +2 -2
  131. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  132. package/dist/esm/salla-accordion_6.entry.js +2 -2
  133. package/dist/esm/salla-add-product-button_5.entry.js +2 -2
  134. package/dist/esm/salla-advertisement.entry.js +1 -1
  135. package/dist/esm/salla-alert_2.entry.js +1 -1
  136. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  137. package/dist/esm/salla-applied-filters.entry.js +2 -2
  138. package/dist/esm/salla-apps-icons.entry.js +1 -1
  139. package/dist/esm/salla-attachment-view_9.entry.js +11 -11
  140. package/dist/esm/salla-badge.entry.js +1 -1
  141. package/dist/esm/salla-basket-gap.entry.js +1 -1
  142. package/dist/esm/salla-bullet-delivery_3.entry.js +1 -1
  143. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  144. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  145. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  146. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  147. package/dist/esm/salla-comment-factors.entry.js +1 -1
  148. package/dist/esm/salla-comment-form_9.entry.js +2 -2
  149. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  150. package/dist/esm/salla-contacts.entry.js +1 -1
  151. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  152. package/dist/esm/salla-count-down.entry.js +1 -1
  153. package/dist/esm/salla-custom-fields.entry.js +1 -1
  154. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  155. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  156. package/dist/esm/salla-filters-widget.entry.js +2 -2
  157. package/dist/esm/salla-filters.entry.js +2 -2
  158. package/dist/esm/salla-free-shipping-banner.entry.js +1 -1
  159. package/dist/esm/salla-free-shipping-tag.entry.js +1 -1
  160. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  161. package/dist/esm/salla-gift-card-redeem_2.entry.js +1 -1
  162. package/dist/esm/salla-gifting.entry.js +1 -1
  163. package/dist/esm/salla-hook.entry.js +1 -1
  164. package/dist/esm/salla-infinite-scroll.entry.js +2 -2
  165. package/dist/esm/salla-installment.entry.js +1 -1
  166. package/dist/esm/salla-list-tile.entry.js +1 -1
  167. package/dist/esm/salla-localization-modal.entry.js +1 -1
  168. package/dist/esm/salla-login-modal.entry.js +1 -1
  169. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  170. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  171. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  172. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  173. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  174. package/dist/esm/salla-loyalty.entry.js +1 -1
  175. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  176. package/dist/esm/salla-map_3.entry.js +1 -1
  177. package/dist/esm/salla-menu.entry.js +1 -1
  178. package/dist/esm/salla-metadata.entry.js +1 -1
  179. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  180. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  181. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  182. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  183. package/dist/esm/salla-notification-item_2.entry.js +2 -2
  184. package/dist/esm/salla-offer-modal.entry.js +1 -1
  185. package/dist/esm/salla-offer.entry.js +1 -1
  186. package/dist/esm/salla-order-branch.entry.js +1 -1
  187. package/dist/esm/salla-order-cancel.entry.js +1 -1
  188. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  189. package/dist/esm/salla-order-details-options.entry.js +1 -1
  190. package/dist/esm/salla-order-details.entry.js +1 -1
  191. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  192. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  193. package/dist/esm/salla-order-edit.entry.js +1 -1
  194. package/dist/esm/salla-order-items.entry.js +1 -1
  195. package/dist/esm/salla-order-options-modal.entry.js +1 -1
  196. package/dist/esm/salla-order-payment.entry.js +1 -1
  197. package/dist/esm/salla-order-rewards.entry.js +1 -1
  198. package/dist/esm/salla-order-shipments.entry.js +1 -1
  199. package/dist/esm/salla-order-summary.entry.js +1 -1
  200. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  201. package/dist/esm/salla-orders.entry.js +2 -2
  202. package/dist/esm/salla-payments.entry.js +1 -1
  203. package/dist/esm/salla-placeholder.entry.js +1 -1
  204. package/dist/esm/salla-price-range.entry.js +1 -1
  205. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  206. package/dist/esm/salla-product-card.entry.js +1 -1
  207. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  208. package/dist/esm/salla-products-list.entry.js +8 -5
  209. package/dist/esm/salla-products-slider.entry.js +2 -2
  210. package/dist/esm/salla-quick-order.entry.js +1 -1
  211. package/dist/esm/salla-rating-modal-v2.entry.js +2 -2
  212. package/dist/esm/salla-rating-modal.entry.js +2 -2
  213. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  214. package/dist/esm/salla-review-order-item.entry.js +1 -1
  215. package/dist/esm/salla-scopes.entry.js +1 -1
  216. package/dist/esm/salla-search-product-card.entry.js +1 -1
  217. package/dist/esm/salla-search.entry.js +2 -2
  218. package/dist/esm/salla-skeleton.entry.js +1 -1
  219. package/dist/esm/salla-social-share.entry.js +1 -1
  220. package/dist/esm/salla-social.entry.js +1 -1
  221. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  222. package/dist/esm/salla-thank-you-header.entry.js +1 -1
  223. package/dist/esm/salla-thank-you-page.entry.js +1 -1
  224. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  225. package/dist/esm/salla-trust-badges.entry.js +1 -1
  226. package/dist/esm/salla-user-menu.entry.js +1 -1
  227. package/dist/esm/salla-user-profile.entry.js +1 -1
  228. package/dist/esm/salla-user-settings.entry.js +1 -1
  229. package/dist/esm/salla-verify.entry.js +1 -1
  230. package/dist/esm/salla-wallet.entry.js +1 -1
  231. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  232. package/dist/esm/salla-wishlist-summary.entry.js +2 -2
  233. package/dist/esm/twilight.js +2 -2
  234. package/dist/esm/{vanilla-picker-BPkGEeVg.js → vanilla-picker-DanARkRw.js} +1 -1
  235. package/dist/twilight/{p-82050a27.entry.js → p-032c0248.entry.js} +1 -1
  236. package/dist/twilight/{p-8bf96c79.entry.js → p-08178cc2.entry.js} +1 -1
  237. package/dist/twilight/{p-1e829622.entry.js → p-09e7abf3.entry.js} +1 -1
  238. package/dist/twilight/{p-34b5e278.entry.js → p-13122f5c.entry.js} +1 -1
  239. package/dist/twilight/{p-d369ba43.entry.js → p-134ed665.entry.js} +1 -1
  240. package/dist/twilight/{p-6e92e3f4.entry.js → p-1a2d5015.entry.js} +1 -1
  241. package/dist/twilight/{p-b84c4478.entry.js → p-1c70702b.entry.js} +1 -1
  242. package/dist/twilight/{p-c7362418.entry.js → p-1dfcc1ea.entry.js} +1 -1
  243. package/dist/twilight/{p-c49a3a78.entry.js → p-205aa210.entry.js} +1 -1
  244. package/dist/twilight/{p-ad058e98.entry.js → p-21b0f3e1.entry.js} +1 -1
  245. package/dist/twilight/{p-47be7f05.entry.js → p-22886a79.entry.js} +1 -1
  246. package/dist/twilight/{p-092dec19.entry.js → p-22e54ab9.entry.js} +1 -1
  247. package/dist/twilight/{p-eaa6b12a.entry.js → p-238d619e.entry.js} +1 -1
  248. package/dist/twilight/{p-1be067f2.entry.js → p-267002f3.entry.js} +1 -1
  249. package/dist/twilight/{p-98bb0ba5.entry.js → p-26a52f1f.entry.js} +1 -1
  250. package/dist/twilight/{p-113afbd5.entry.js → p-27d1835a.entry.js} +1 -1
  251. package/dist/twilight/{p-4cb6aaec.entry.js → p-295e2f67.entry.js} +1 -1
  252. package/dist/twilight/{p-7bb1c27a.entry.js → p-2b2fe494.entry.js} +1 -1
  253. package/dist/twilight/{p-78473db1.entry.js → p-2fd1408b.entry.js} +1 -1
  254. package/dist/twilight/{p-c2e01ef5.entry.js → p-315334ee.entry.js} +1 -1
  255. package/dist/twilight/{p-fd1127b5.entry.js → p-31a7ed46.entry.js} +1 -1
  256. package/dist/twilight/{p-3fac348e.entry.js → p-35eb3258.entry.js} +1 -1
  257. package/dist/twilight/{p-296f2900.entry.js → p-3a7ead6f.entry.js} +1 -1
  258. package/dist/twilight/{p-0ff37ef4.entry.js → p-3ba56dd6.entry.js} +1 -1
  259. package/dist/twilight/{p-bb21e1c1.entry.js → p-47d6128e.entry.js} +1 -1
  260. package/dist/twilight/{p-98916e5f.entry.js → p-497a25c3.entry.js} +1 -1
  261. package/dist/twilight/{p-557b15a0.entry.js → p-49fd0d88.entry.js} +1 -1
  262. package/dist/twilight/{p-9ab072ba.entry.js → p-4c907708.entry.js} +1 -1
  263. package/dist/twilight/{p-877db84f.entry.js → p-4c9af3b2.entry.js} +1 -1
  264. package/dist/twilight/{p-f684ff53.entry.js → p-4dd1d56d.entry.js} +1 -1
  265. package/dist/twilight/{p-3d3cbcb2.entry.js → p-52224432.entry.js} +1 -1
  266. package/dist/twilight/{p-dfc11ac7.entry.js → p-522ebdcd.entry.js} +1 -1
  267. package/dist/twilight/{p-381d2beb.entry.js → p-53495b02.entry.js} +1 -1
  268. package/dist/twilight/{p-00c6ecab.entry.js → p-54bf725a.entry.js} +1 -1
  269. package/dist/twilight/{p-7de88a55.entry.js → p-555c22e5.entry.js} +1 -1
  270. package/dist/twilight/{p-14591d07.entry.js → p-59670a22.entry.js} +1 -1
  271. package/dist/twilight/{p-5649524f.entry.js → p-5eb216ae.entry.js} +1 -1
  272. package/dist/twilight/{p-5521d2d7.entry.js → p-604ec527.entry.js} +1 -1
  273. package/dist/twilight/{p-4e754376.entry.js → p-633fc7da.entry.js} +1 -1
  274. package/dist/twilight/{p-5c06a450.entry.js → p-637ae00c.entry.js} +1 -1
  275. package/dist/twilight/{p-4b15d9ed.entry.js → p-647ec80c.entry.js} +1 -1
  276. package/dist/twilight/p-657820ec.entry.js +4 -0
  277. package/dist/twilight/{p-9cd19af7.entry.js → p-6a75f33a.entry.js} +1 -1
  278. package/dist/twilight/{p-0196bd88.entry.js → p-6b5b0332.entry.js} +1 -1
  279. package/dist/twilight/{p-886b5304.entry.js → p-725246f7.entry.js} +1 -1
  280. package/dist/twilight/{p-98ff83f1.entry.js → p-78aa0530.entry.js} +1 -1
  281. package/dist/twilight/{p-efa5acab.entry.js → p-79535c09.entry.js} +1 -1
  282. package/dist/twilight/{p-84be385b.entry.js → p-7b74bfc8.entry.js} +1 -1
  283. package/dist/twilight/{p-ecf1bfc5.entry.js → p-7bfa9c00.entry.js} +1 -1
  284. package/dist/twilight/{p-c998b73a.entry.js → p-7e7513cc.entry.js} +1 -1
  285. package/dist/twilight/{p-e24f0aa2.entry.js → p-80bbc9a9.entry.js} +1 -1
  286. package/dist/twilight/{p-377f50cc.entry.js → p-83e2da9e.entry.js} +1 -1
  287. package/dist/twilight/{p-aa076bb8.entry.js → p-84e65c7c.entry.js} +1 -1
  288. package/dist/twilight/{p-91c93693.entry.js → p-86771eed.entry.js} +1 -1
  289. package/dist/twilight/{p-9e91dfb3.entry.js → p-874c4b47.entry.js} +1 -1
  290. package/dist/twilight/{p-6a1fd2b0.entry.js → p-88466a9b.entry.js} +1 -1
  291. package/dist/twilight/{p-1857da04.entry.js → p-8856f8ad.entry.js} +1 -1
  292. package/dist/twilight/{p-adf4a31a.entry.js → p-8c192a4d.entry.js} +1 -1
  293. package/dist/twilight/{p-262aea7a.entry.js → p-8d6f3f2e.entry.js} +1 -1
  294. package/dist/twilight/{p-8af0cec1.entry.js → p-8d765c05.entry.js} +1 -1
  295. package/dist/twilight/{p-f5b9483f.entry.js → p-8d951684.entry.js} +1 -1
  296. package/dist/twilight/{p-4e006a1b.entry.js → p-8f4b3753.entry.js} +1 -1
  297. package/dist/twilight/{p-e12a4bcf.entry.js → p-932ce23f.entry.js} +1 -1
  298. package/dist/twilight/{p-3d7c7c80.entry.js → p-933701cf.entry.js} +1 -1
  299. package/dist/twilight/{p-1c7a5ade.entry.js → p-942548d8.entry.js} +1 -1
  300. package/dist/twilight/{p-44bc9f12.entry.js → p-94b1af8e.entry.js} +1 -1
  301. package/dist/twilight/{p-3eb03df6.entry.js → p-9528dcf1.entry.js} +1 -1
  302. package/dist/twilight/{p-88bcf6fc.entry.js → p-96d44802.entry.js} +1 -1
  303. package/dist/twilight/{p-5007e907.entry.js → p-9827fca6.entry.js} +1 -1
  304. package/dist/twilight/{p-21e71ccf.entry.js → p-9c12e6f5.entry.js} +1 -1
  305. package/dist/twilight/{p-BLGbkbu1.js → p-BdcDWlJR.js} +1 -1
  306. package/dist/twilight/{p--eo26bTV.js → p-BupSmf9j.js} +1 -1
  307. package/dist/twilight/{p-BOhl3584.js → p-CIwiAeLZ.js} +1 -1
  308. package/dist/twilight/{p-hJaa5Kg2.js → p-CK8yh00L.js} +1 -1
  309. package/dist/twilight/{p-zgd_bCbS.js → p-CS-AMfl0.js} +1 -1
  310. package/dist/twilight/{p-CIquV5P1.js → p-CWOoBoFJ.js} +1 -1
  311. package/dist/twilight/p-Ca7ApeqJ.js +5 -0
  312. package/dist/twilight/{p-D3pvUMHD.js → p-CzQfsXbf.js} +1 -1
  313. package/dist/twilight/{p-Bxlk3Ewv.js → p-DxTmjl_3.js} +1 -1
  314. package/dist/twilight/{p-Bsc8TelJ.js → p-_8a0n6YQ.js} +1 -1
  315. package/dist/twilight/{p-09284bc3.entry.js → p-a01df707.entry.js} +1 -1
  316. package/dist/twilight/{p-cbee85ca.entry.js → p-a4248834.entry.js} +1 -1
  317. package/dist/twilight/{p-8f09fbdf.entry.js → p-a62d89f4.entry.js} +1 -1
  318. package/dist/twilight/{p-053ea5b5.entry.js → p-a8f64f77.entry.js} +1 -1
  319. package/dist/twilight/{p-b608f091.entry.js → p-aad33c09.entry.js} +1 -1
  320. package/dist/twilight/{p-c842a46c.entry.js → p-ab021327.entry.js} +1 -1
  321. package/dist/twilight/{p-6fba75cd.entry.js → p-ae509d7e.entry.js} +1 -1
  322. package/dist/twilight/{p-1defc4e4.entry.js → p-ae7e71c8.entry.js} +1 -1
  323. package/dist/twilight/{p-483886dc.entry.js → p-afe24b99.entry.js} +1 -1
  324. package/dist/twilight/{p-778d3f9d.entry.js → p-b0809748.entry.js} +1 -1
  325. package/dist/twilight/{p-8e467ad0.entry.js → p-b53ff1bd.entry.js} +1 -1
  326. package/dist/twilight/{p-71e47ffc.entry.js → p-ba44ab6e.entry.js} +1 -1
  327. package/dist/twilight/{p-6e12d141.entry.js → p-bb1adb13.entry.js} +1 -1
  328. package/dist/twilight/{p-3bc536ba.entry.js → p-bc949882.entry.js} +1 -1
  329. package/dist/twilight/{p-8e12437d.entry.js → p-bec78c3b.entry.js} +1 -1
  330. package/dist/twilight/{p-fb474528.entry.js → p-c01dd1e9.entry.js} +1 -1
  331. package/dist/twilight/{p-72da2c6f.entry.js → p-c2023ba6.entry.js} +1 -1
  332. package/dist/twilight/{p-d896721d.entry.js → p-c2fb7675.entry.js} +1 -1
  333. package/dist/twilight/{p-6ceb84ac.entry.js → p-cdf293e6.entry.js} +1 -1
  334. package/dist/twilight/{p-6ada6f3a.entry.js → p-d1a86615.entry.js} +1 -1
  335. package/dist/twilight/{p-b9579858.entry.js → p-d3a3e2ff.entry.js} +1 -1
  336. package/dist/twilight/{p-e4341418.entry.js → p-d827080e.entry.js} +1 -1
  337. package/dist/twilight/{p-e2353605.entry.js → p-def729de.entry.js} +1 -1
  338. package/dist/twilight/{p-d976fbba.entry.js → p-df79624c.entry.js} +1 -1
  339. package/dist/twilight/{p-223a4632.entry.js → p-e4ac39df.entry.js} +1 -1
  340. package/dist/twilight/{p-c4b6f56b.entry.js → p-e83adc0e.entry.js} +1 -1
  341. package/dist/twilight/{p-0744a008.entry.js → p-ebacd6a0.entry.js} +1 -1
  342. package/dist/twilight/{p-dac8351f.entry.js → p-f2a3c288.entry.js} +1 -1
  343. package/dist/twilight/{p-25f4472e.entry.js → p-f6602ece.entry.js} +1 -1
  344. package/dist/twilight/{p-67e1d4e2.entry.js → p-f6d21473.entry.js} +1 -1
  345. package/dist/twilight/{p-c561caaa.entry.js → p-f9ec9870.entry.js} +1 -1
  346. package/dist/twilight/{p-9d6250cb.entry.js → p-ff557e53.entry.js} +1 -1
  347. package/dist/twilight/{p-DgLQ39AN.js → p-pDbyUZfb.js} +1 -1
  348. package/dist/twilight/twilight.esm.js +1 -1
  349. package/dist/types/components/salla-products-list/salla-products-list.d.ts +2 -3
  350. package/package.json +5 -5
  351. package/dist/twilight/p-77f038f7.entry.js +0 -4
  352. package/dist/twilight/p-DGIIhW8W.js +0 -5
@@ -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,a as o}from"./p-DGIIhW8W.js";var r,n;!function(t){t.PERCENTAGE="percentage",t.FIXED="fixed",t.FREE_PRODUCT="free_product",t.FREE_SHIPPING="free_shipping"}(r||(r={})),function(t){t.PRODUCT_COUNT="products_count",t.PRODUCT_PURCHASE="order_amount"}(n||(n={}));const s=Object.freeze([]);let a,l=null,c=null,d=!1,f=null,h=null,u=0;function g(t){return"CartNotCreated"===t?.name}function m(){try{const t=salla.api?.cart?.getStoredCartId?salla.api.cart.getStoredCartId():salla.storage?.get?.("cart.id");return null==t||""===t?null:String(t)}catch(t){return null}}function p(){const t=m();void 0!==a&&a!==t&&(u++,l=null,c=null,d=!1,f=null),a=t}function b(t){return null==t?0:"number"==typeof t?isFinite(t)?t:0:"string"==typeof t&&parseFloat(t)||0}function w(t){if(null==t||""===t)return null;const i=b(t);return isFinite(i)?i:null}function y(t,i){if(null!==i)return i.length;const e=w(t?.data?.cart?.count??t?.data?.count??t?.cart?.count??t?.count);return null!==e&&e>=0?e:null}function x(t){for(const i of[t?.original_price,t?.product_price,t?.price]){const t=w(i&&"object"==typeof i?i.amount:i);if(null!==t&&t>0)return t}return null}function v(t,i){const e=t?.free_gift_quantity;return null!=e&&""!==e?b(e):i>0?i:0}function k(t){const i=[];for(const e of t){if(null==e?.id)continue;if(!e.added_by_offer)continue;const t=b(e.quantity),o=v(e,t);o<=0||i.push({id:String(e.id),offerId:w(e.offer_id),quantity:o,freeQuantity:o,lineQuantity:t,name:String(e.product_name??e.name??""),imageUrl:String(e.product_image?.url??e.product_image??e.image?.url??""),imageAlt:String(e.product_image?.alt??e.image?.alt??e.product_name??""),url:String(e.url??""),originalPrice:x(e)})}return i}function _(){if(f)return f;const t=u,i=Promise.resolve().then((()=>salla.api?.cart?.details?.())).then((t=>{const i=function(t){const i=t?.data?.cart?.items??t?.data?.items??t?.cart?.items??t?.items;return Array.isArray(i)?i:null}(t);return{gifts:k(i??[]),count:y(t,i),ok:!0}})).catch((t=>({gifts:l??[],count:g(t)?0:c,ok:!1}))).then((({gifts:i,count:e,ok:o})=>{t===u&&(l=i,c=e,d=o)})).finally((()=>{f===i&&(f=null)}));return f=i,i}const C=-1;var M,T;function z(t){const i="number"==typeof t?t:parseFloat(t);return Number.isFinite(i)?i:null}function S(t){return"boolean"==typeof t?t:1===t||0===t?1===t:"true"===t||"1"===t||"false"!==t&&"0"!==t&&void 0}function I(t){return z(t)??0}function L(t,i,e){return Math.max(i,Math.min(t,e))}function V(t){const i="number"==typeof t?t:parseFloat(t);if(!Number.isFinite(i))return null;const e=Math.trunc(i);return e>=0&&e<=4?e:null}!function(t){t.LOCKED="locked",t.CURRENT="current",t.COMPLETED="completed"}(M||(M={})),function(t){t.CURRENCY="currency",t.COUNT="count"}(T||(T={}));const F=[1e3,2e3,4e3],R='[data-testid^="store-cart-item-"], form[id^="item-"]';let $=0;const P={badges_summary:":completed of :total offers unlocked",congrats:"Congratulations! You’ve unlocked all rewards in this promotion",details_title:"Offer details",free_gift:"Free Gift",free_products_title:"Free products selected from the offer",guidance_conditions_unmet:"Your cart doesn’t meet the conditions for the next reward yet",guidance_next:"Add :remaining and get :reward",guidance_next_generic:"Add :remaining to unlock the next reward",manage_offer:"Manage offer",tier_requirement:"Spend :threshold and get :reward",tier_requirement_count:"Buy :threshold and get :reward",tier_requirement_count_generic:"Buy :threshold to unlock this offer",tier_requirement_generic:"Spend :threshold to unlock this offer",tier_title:"Offer (:number)"},j="pages.checkout.free_charge";function H(t){const i=document.createElement("div");return i.textContent=t??"",i.innerHTML}const O=(t={})=>i("svg",{class:t.class,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},i("path",{d:"M5.00016 9.16634C2.69898 9.16634 0.833496 7.30084 0.833496 4.99967C0.833496 2.69849 2.69898 0.833008 5.00016 0.833008C7.30133 0.833008 9.16683 2.69849 9.16683 4.99967C9.16683 7.30084 7.30133 9.16634 5.00016 9.16634ZM4.58458 6.66634L7.53087 3.72006L6.94162 3.13081L4.58458 5.48784L3.40608 4.3093L2.81683 4.89859L4.58458 6.66634Z",fill:"currentColor"})),q=(t={})=>i("svg",{class:t.class,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},i("path",{d:"M12.6667 6.66683H13.3333C13.7015 6.66683 14 6.9653 14 7.3335V14.0002C14 14.3684 13.7015 14.6668 13.3333 14.6668H2.66667C2.29848 14.6668 2 14.3684 2 14.0002V7.3335C2 6.9653 2.29848 6.66683 2.66667 6.66683H3.33333V6.00016C3.33333 3.42284 5.42267 1.3335 8 1.3335C10.5773 1.3335 12.6667 3.42284 12.6667 6.00016V6.66683ZM11.3333 6.66683V6.00016C11.3333 4.15922 9.84093 2.66683 8 2.66683C6.15905 2.66683 4.66667 4.15922 4.66667 6.00016V6.66683H11.3333ZM7.33333 9.3335V12.0002H8.66667V9.3335H7.33333Z",fill:"currentColor"})),N=(t={})=>i("svg",{class:t.class,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},i("path",{d:"M7.00033 12.8337C3.77866 12.8337 1.16699 10.222 1.16699 7.00033C1.16699 3.77866 3.77866 1.16699 7.00033 1.16699C10.222 1.16699 12.8337 3.77866 12.8337 7.00033C12.8337 10.222 10.222 12.8337 7.00033 12.8337ZM6.41699 6.41699V9.91699H7.58366V6.41699H6.41699ZM6.41699 4.08366V5.25033H7.58366V4.08366H6.41699Z",fill:"currentColor"})),W=class{constructor(i){t(this,i),this.offer=null,this.isLoading=!1,this.canRender=!0,this.gifts=[],this.cartItemCount=null,this.isTooltipHovered=!1,this.isTooltipPinned=!1,this.isGiftsOpen=!0,this.instanceId=++$,this.refreshGeneration=0,this.giftsGeneration=0,this.cartRefreshTimer=null,this.cartRefreshPending=!1,this.wantsCartUpdates=!1,this.isListeningToCartUpdates=!1,this.cartLookupRetryTimer=null,this.cartLookupRetries=0,this.cartLookupRetryPending=!1,this.deferredByEmptyCart=!1,this.isDisconnected=!1,this.skeletonWatchdog=null,this.skeletonDeadline=0,this.hasRelocated=!1,this.hasLoaded=!1,this.relocationObserver=null,this.relocationWatchTimer=null,this.relocationWatchExpired=!1,this.relocationLogged=!1,this.cartUpdatedHandler=t=>{this.readCartCountFromEvent(t),this.clearCartLookupRetry(),this.scheduleCartRefresh()}}componentWillLoad(){this.ensureSkeletonIsWatched();try{this.isEnabled()&&this.startLoading(),this.load().catch((t=>{this.stopLoading(),this.safeLog("load() failed",t)}))}catch(t){this.stopLoading(),this.safeLog("componentWillLoad threw synchronously",t)}}safeLog(t,i){try{salla.logger.warn("salla-conditional-offer::",t,i)}catch(t){}}connectedCallback(){this.isDisconnected=!1,this.ensureSkeletonIsWatched(),this.wantsCartUpdates&&!this.isListeningToCartUpdates&&this.subscribeToCartUpdates()&&(this.cartRefreshPending=!0),this.cartRefreshPending&&this.scheduleCartRefresh(),this.cartLookupRetryPending&&this.scheduleCartLookupRetry()}disconnectedCallback(){this.isDisconnected=!0,null!==this.cartRefreshTimer&&(clearTimeout(this.cartRefreshTimer),this.cartRefreshTimer=null),null!==this.cartLookupRetryTimer&&(clearTimeout(this.cartLookupRetryTimer),this.cartLookupRetryTimer=null),Promise.resolve().then((()=>{this.isDisconnected&&this.unsubscribeFromCartUpdates()})),null!==this.skeletonWatchdog&&(clearTimeout(this.skeletonWatchdog),this.skeletonWatchdog=null),this.stopWatchingForItemsColumn()}componentDidLoad(){this.hasLoaded=!0,this.relocateIntoItemsColumn()}isShowingSomething(){return this.canRender&&this.hasCartItems()}componentDidRender(){this.hasLoaded&&this.relocateIntoItemsColumn(),this.positionTooltip(),this.ensureSkeletonIsWatched()}relocateIntoItemsColumn(){if(!this.hasRelocated&&this.isShowingSomething())try{const t=this.hostEl;if(!t?.parentElement)return;const i=this.findItemsColumn(t);if(!i)return void this.watchForItemsColumn();if(this.hasRelocated=!0,this.stopWatchingForItemsColumn(),i===t.parentElement&&i.firstElementChild===t)return;i.insertBefore(t,i.firstChild)}catch(t){this.hasRelocated=!0,this.stopWatchingForItemsColumn(),this.safeLog("relocating the banner into the cart items column failed",t)}}findItemsColumn(t){let i=t;for(let e=0;i&&e<=3;e++){for(const e of this.getFollowingSiblings(i)){if(i===t&&this.matches(e,R))return t.parentElement;const o=this.findColumnWithin(e,t);if(o)return o}if(i=i.parentElement,!i||i===document.body||i===document.documentElement)break}return null}getFollowingSiblings(t){const i=[];for(let e=t.nextElementSibling;e;e=e.nextElementSibling)i.push(e);return i}findColumnWithin(t,i){const e=t.querySelector(R),o=(e?this.climbToChildOf(e,t):null)??t.querySelector(".main-content, [data-cart-items]");return!o||o===i||o.contains(i)?null:o}climbToChildOf(t,i){let e=t;for(;e&&e.parentElement&&e.parentElement!==i;)e=e.parentElement;return e?.parentElement===i?e:null}matches(t,i){return"function"==typeof t.matches&&t.matches(i)}watchForItemsColumn(){this.hasRelocated||this.relocationWatchExpired||this.relocationObserver||("undefined"!=typeof MutationObserver?(this.relocationObserver=new MutationObserver((()=>this.relocateIntoItemsColumn())),this.relocationObserver.observe(document.documentElement,{childList:!0,subtree:!0}),this.relocationWatchTimer=setTimeout((()=>{this.relocationWatchTimer=null,this.relocationWatchExpired=!0,this.stopWatchingForItemsColumn(),this.logNoItemsColumn()}),5e3)):this.logNoItemsColumn())}stopWatchingForItemsColumn(){if(this.relocationObserver){try{this.relocationObserver.disconnect()}catch(t){}this.relocationObserver=null}null!==this.relocationWatchTimer&&(clearTimeout(this.relocationWatchTimer),this.relocationWatchTimer=null)}logNoItemsColumn(){this.relocationLogged||(this.relocationLogged=!0,this.safeLog("no cart items column found — leaving the banner at full page width"))}ensureSkeletonIsWatched(){if(!this.isLoading)return;if(null!==this.skeletonWatchdog)return;const t=Date.now();0===this.skeletonDeadline&&(this.skeletonDeadline=t+8e3);const i=Math.max(0,this.skeletonDeadline-t);this.skeletonWatchdog=setTimeout((()=>{this.skeletonWatchdog=null,this.isLoading&&(Date.now()<this.skeletonDeadline?this.ensureSkeletonIsWatched():(this.isLoading=!1,this.skeletonDeadline=0,this.safeLog("still loading after 8000ms — dropping the skeleton")))}),i)}clearSkeletonWatchdog(){this.skeletonDeadline=0,null!==this.skeletonWatchdog&&(clearTimeout(this.skeletonWatchdog),this.skeletonWatchdog=null)}startLoading(){this.isLoading=!0,this.ensureSkeletonIsWatched()}stopLoading(){this.isLoading=!1,this.clearSkeletonWatchdog()}async load(){this.wantsCartUpdates=!0,this.subscribeToCartUpdates()||this.subscribeWhenSdkIsReady(),this.loadCart(),await this.waitForSdk(),await this.refresh()}waitForSdk(){let t,i;try{t=Promise.resolve(salla.onReady?.())}catch(t){return this.safeLog("salla.onReady() threw",t),Promise.resolve()}const e=new Promise((t=>{i=setTimeout(t,3e3)}));return Promise.race([t.catch((t=>this.safeLog("salla.onReady() rejected",t))),e]).then((()=>{clearTimeout(i)}))}subscribeToCartUpdates(){if(this.isListeningToCartUpdates)return!0;try{salla.event.on("cart::updated",this.cartUpdatedHandler),this.isListeningToCartUpdates=!0}catch(t){this.safeLog("cart::updated subscription failed",t)}return this.isListeningToCartUpdates}unsubscribeFromCartUpdates(){if(this.isListeningToCartUpdates){this.isListeningToCartUpdates=!1;try{salla.event.off("cart::updated",this.cartUpdatedHandler)}catch(t){this.safeLog("cart::updated unsubscription failed",t)}}}subscribeWhenSdkIsReady(){let t;try{t=Promise.resolve(salla.onReady?.())}catch(t){return}const i=()=>{this.isDisconnected||this.subscribeToCartUpdates()};t.then(i,i)}scheduleCartRefresh(){this.cartRefreshPending=!0,null!==this.cartRefreshTimer&&clearTimeout(this.cartRefreshTimer),this.cartRefreshTimer=null,this.isDisconnected||(this.cartRefreshTimer=setTimeout((()=>{this.cartRefreshTimer=null,this.runCartRefresh()}),200))}runCartRefresh(){this.isDisconnected||(this.cartRefreshPending=!1,this.refresh(),function(){if(h)return h;u++,l=null,c=null,d=!1,a=m();const t=()=>(h===i&&(h=null),_()),i=(f??Promise.resolve()).then(t,t).finally((()=>{h===i&&(h=null)}));return h=i,i}().then((()=>this.loadCart()),(()=>this.loadCart())))}readCartCountFromEvent(t){const i=this.toCartCount(t?.count)??this.readCartCountFromStorage();null!==i&&(this.cartItemCount=i)}readCartCountFromStorage(){try{return this.toCartCount(salla.storage?.get?.("cart.summary.count"))}catch(t){return null}}toCartCount(t){return"number"==typeof t&&Number.isFinite(t)&&t>=0?t:null}getFreeLabel(){const t=salla.lang.get(j);return t&&t!==j?t:"Free"}trans(t,i){const e=`blocks.cart_offer.${t}`,o=salla.lang.get(e,i);return o&&o!==e?o:Object.entries(i??{}).reduce(((t,[i,e])=>t.split(`:${i}`).join(e)),P[t])}isEnabled(){try{return!!salla.config.get("store.features")?.includes("conditional-offer")}catch(t){return!1}}async fetchOffer(){const{data:t}=await salla.api.cart.offers(),i=(t||[]).find((t=>"conditional"===t.type));return i?.details?.discounts?.length?i:null}async refresh(){const t=++this.refreshGeneration;if(!this.isEnabled())return this.stopLoading(),void(this.canRender=!1);if(0===this.cartItemCount)return this.stopLoading(),p(),void(d||(this.deferredByEmptyCart=!0,this.loadCart()));this.deferredByEmptyCart=!1,this.offer?this.stopLoading():this.startLoading();try{const i=await this.fetchOffer();if(this.isSuperseded(t))return;if(!i)return this.offer=null,void(this.canRender=!1);this.offer=i,this.canRender=!0,this.loadCart()}catch(i){if(this.isSuperseded(t))return;this.safeLog("offers() failed",i)}finally{t===this.refreshGeneration&&this.stopLoading()}}hasCartItems(){return"number"==typeof this.cartItemCount&&this.cartItemCount>=1}isSuperseded(t){return t!==this.refreshGeneration||this.isDisconnected}loadCart(){const t=++this.giftsGeneration;return Promise.all([(p(),d&&l?Promise.resolve(l):_().then((()=>l??s))),(p(),d&&l?Promise.resolve(c):_().then((()=>c)))]).then((([i,e])=>{t!==this.giftsGeneration||this.isDisconnected||this.cartRefreshPending||(null!==e&&(this.cartItemCount=e),null!==e?this.clearCartLookupRetry():null===this.cartItemCount&&this.scheduleCartLookupRetry(),this.deferredByEmptyCart&&this.hasCartItems()&&(this.deferredByEmptyCart=!1,this.refresh()),this.gifts=this.offer?this.selectOwnGifts(i):[])})).catch((t=>{this.safeLog("cart lookup failed",t)}))}scheduleCartLookupRetry(){this.cartLookupRetries>=F.length||(this.cartLookupRetryPending=!0,null!==this.cartLookupRetryTimer||this.isDisconnected||(this.cartLookupRetryTimer=setTimeout((()=>{this.cartLookupRetryTimer=null,this.cartLookupRetryPending=!1,this.canRender&&(this.cartLookupRetries++,this.loadCart())}),F[this.cartLookupRetries])))}clearCartLookupRetry(){this.cartLookupRetries=0,this.cartLookupRetryPending=!1,null!==this.cartLookupRetryTimer&&(clearTimeout(this.cartLookupRetryTimer),this.cartLookupRetryTimer=null)}selectOwnGifts(t){const i=Number(this.offer?.id);if(!Number.isFinite(i))return t;const e=t.filter((t=>null!==t.offerId&&Number(t.offerId)===i));return e.length?e:t.filter((t=>null===t.offerId))}getStages(){const t=(this.offer?.details?.discounts??[]).filter((({min_spend:t})=>null!==z(t)));return i=({min_spend:t})=>t,e=({id:t})=>t,(t??[]).map(((t,o)=>({item:t,index:o,threshold:I(i(t)),identity:e?z(e(t)):null}))).sort(((t,i)=>t.threshold!==i.threshold?t.threshold-i.threshold:null!==t.identity&&null!==i.identity&&t.identity!==i.identity?t.identity-i.identity:t.index-i.index)).map((({item:t})=>t));var i,e}getProgress(t){return function(t,i,e=0,o=[],r=[]){const n=(i??[]).map(((t,i)=>({index:i,threshold:z(t),applied:S(o?.[i]),tierValue:z(r?.[i])}))).filter((t=>null!==t.threshold)).sort(((t,i)=>t.threshold-i.threshold||t.index-i.index)),s=n.map((t=>t.threshold)),a=n.map((t=>t.applied)),l=a.some((t=>void 0!==t)),c=I(e);if(!s.length)return{thresholds:s,met:[],applied:a,appliedIndex:C,hasEngineVerdict:l,metCount:0,nextUnmetIndex:C,allMet:!1,lastReachedIndex:C,currentIndex:C,isComplete:!1,value:Math.max(0,I(t)),values:[],startValue:c,fills:[],overallPercentage:0};const d=s[s.length-1],f=L(I(t),0,Math.max(0,d)),h=n.map((({tierValue:t})=>null===t?f:L(t,0,Math.max(0,d))));let u=C;for(let t=0;t<s.length;t++)h[t]>=s[t]&&(u=t);const g=u===s.length-1,m=g?C:u+1,p=s.map(((t,i)=>function(t,i,e){return e<=i?t>=e?100:0:L((t-i)/(e-i)*100,0,100)}(h[i],0===i?c:s[i-1],t))),b=g?100:L((u+1+(p[m]??0)/100)/s.length*100,0,100);let w=C;for(let t=0;t<a.length;t++)!0===a[t]&&(w=t);const y=s.map(l?(t,i)=>i<=w:(t,i)=>i<=u),x=y.filter(Boolean).length,v=y.findIndex((t=>!t));return{thresholds:s,met:y,applied:a,appliedIndex:w,hasEngineVerdict:l,metCount:x,nextUnmetIndex:v,allMet:v===C,lastReachedIndex:u,currentIndex:m,isComplete:g,value:f,values:h,startValue:c,fills:p,overallPercentage:b}}(this.offer?.details?.current_value,t.map((({min_spend:t})=>t)),this.offer?.details?.start_value,t.map((({is_applied:t})=>t)),t.map((({current_value:t})=>t)))}tierKey(t,i){const e=Number(t?.id);return Number.isFinite(e)?`tier-${e}`:`pos-${i}`}stageMeasure(){return this.offer?.details?.based_on===n.PRODUCT_COUNT?T.COUNT:T.CURRENCY}formatRequirement(t){const i=this.offer?.details?.based_on;if(i===n.PRODUCT_COUNT)try{return salla.lang.choice("blocks.header.products_count",t)}catch(i){return this.safeLog("invalid products_count interval",i),`${t}`}return i===n.PRODUCT_PURCHASE?salla.money(t):(this.safeLog(`unexpected offer detail's based_on value: ${i}`),`${t}`)}getRewardText(t){return(t?.reward_label??"").trim()}getGuidanceMessage(t,i){if(i.nextUnmetIndex===C)return"";const e=function(t,i,e=T.CURRENCY){const o=i.thresholds[t];if(void 0===o)return 0;const r=Math.max(0,o-(i.values?.[t]??i.value));if(0===r)return 0;const n=e===T.COUNT?0:function(){try{const t="undefined"!=typeof salla?salla:void 0,i=V(t?.config?.currency?.()?.decimals);if(null!==i)return i;const e=V(t?.config?.get?.("store.currency.decimals"));if(null!==e)return e}catch(t){}return 2}(),s=Math.pow(10,n),a=Math.ceil(r*s-1e-6)/s;return a>0?a:1/s}(i.nextUnmetIndex,i,this.stageMeasure());if(e<=0)return this.trans("guidance_conditions_unmet");const o=this.formatRequirement(e),r=this.getRewardText(t[i.nextUnmetIndex]);return r?this.trans("guidance_next",{remaining:o,reward:H(r)}):this.trans("guidance_next_generic",{remaining:o})}getTierSentence(t,i,e){const o=this.formatRequirement(e.thresholds[i]),r=this.getRewardText(t),n=this.stageMeasure()===T.COUNT;return r?this.trans(n?"tier_requirement_count":"tier_requirement",{threshold:o,reward:H(r)}):this.trans(n?"tier_requirement_count_generic":"tier_requirement_generic",{threshold:o})}getRewardIcon(t){switch(t?.type){case r.PERCENTAGE:return"sicon-percentage";case r.FREE_PRODUCT:return"sicon-gift";case r.FIXED:return this.usesSarSymbol()?"sicon-sar":"sicon-banknote";default:return"sicon-tag"}}usesSarSymbol(){try{const t=salla.config.currency?.()?.symbol;return["SAR","ر.س"].includes(t)&&!!salla.config.get("store.settings.use_sar_symbol")}catch(t){return!1}}get isTooltipOpen(){return this.isTooltipHovered||this.isTooltipPinned}toggleTooltip(){this.isTooltipPinned=!this.isTooltipPinned}closeTooltip(t=!1){this.isTooltipOpen&&(this.isTooltipPinned=!1,this.isTooltipHovered=!1,t&&this.infoTriggerEl?.focus?.())}positionTooltip(){const t=this.tooltipEl,i=this.infoTriggerEl;if(this.isTooltipOpen&&t&&i)try{this.setTooltipOffsets(t,0,0);const e=window.innerWidth||document.documentElement?.clientWidth||0,o=t.getBoundingClientRect(),r=i.getBoundingClientRect(),n=o?.width||0;if(n<=0||e<=0)return;const s=r.left+r.width/2-n/2,a=8,l=Math.min(Math.max(s,a),Math.max(a,e-a-n))-s,c=Math.max(0,n/2-16),d=Math.min(Math.max(-l,-c),c);this.setTooltipOffsets(t,l,d)}catch(t){this.safeLog("positioning the offer details popover failed",t)}}setTooltipOffsets(t,i,e){t.style?.setProperty?.("--s-conditional-offer-tooltip-shift",`${Math.round(i)}px`),t.style?.setProperty?.("--s-conditional-offer-tooltip-caret",`${Math.round(e)}px`)}handleWindowResize(){this.positionTooltip()}handleDocumentKeydown(t){"Escape"!==t.key&&"Esc"!==t.key||this.closeTooltip(!0)}handleDocumentClick(t){if(!this.isTooltipPinned||!this.infoAnchorEl)return;const i="function"==typeof t.composedPath?t.composedPath():[];(i.length?i.includes(this.infoAnchorEl):this.infoAnchorEl.contains(t.target))||this.closeTooltip()}elementId(t){return`s-conditional-offer-${t}-${this.instanceId}`}renderBadges(t,e){return i("div",{class:"s-conditional-offer-badges",role:"img","aria-label":this.trans("badges_summary",{completed:`${e.metCount}`,total:`${t.length}`})},t.map(((t,o)=>{const r=e.met[o],n=this.tierKey(t,o);return[o>0?i("span",{key:`${n}-link`,class:{"s-conditional-offer-badge-link":!0,"s-conditional-offer-badge-link-met":r,"s-conditional-offer-badge-link-unmet":!r},"aria-hidden":"true"}):null,i("span",{key:n,class:{"s-conditional-offer-badge":!0,"s-conditional-offer-badge-met":r,"s-conditional-offer-badge-unmet":!r},"data-tier-state":r?"met":"unmet","data-tier-id":t?.id??void 0},i(r?O:q,{class:"s-conditional-offer-badge-icon"}))]})))}renderTooltip(t,e){const o=function(t){const i=t?.details?.rules;if("string"==typeof i){const t=i.trim();return""===t?null:t}if(Array.isArray(i)){const t=i.filter((t=>"string"==typeof t)).map((t=>t.trim())).filter((t=>""!==t)).join(" ");return""===t?null:t}return null}(this.offer);return i("div",{class:"s-conditional-offer-tooltip",id:this.elementId("tooltip"),role:"tooltip",ref:t=>this.tooltipEl=t},i("div",{class:"s-conditional-offer-tooltip-title"},this.offer?.title),o?i("div",{class:"s-conditional-offer-tooltip-description"},o):null,i("ul",{class:"s-conditional-offer-tooltip-list"},t.map(((t,o)=>{const r=e.met[o];return i("li",{key:this.tierKey(t,o),class:"s-conditional-offer-tier","data-tier-state":r?"met":"unmet","data-tier-id":t?.id??void 0},i("span",{class:{"s-conditional-offer-tier-icon":!0,"s-conditional-offer-tier-icon-met":r,"s-conditional-offer-tier-icon-unmet":!r}},i("i",{class:this.getRewardIcon(t),"aria-hidden":"true"}),i("span",{class:{"s-conditional-offer-tier-status":!0,"s-conditional-offer-tier-status-met":r,"s-conditional-offer-tier-status-unmet":!r},"aria-hidden":"true"},r?i(O,{class:"s-conditional-offer-tier-status-check"}):i(q,{class:"s-conditional-offer-tier-status-lock"}))),i("div",{class:"s-conditional-offer-tier-body"},i("div",{class:"s-conditional-offer-tier-title"},this.trans("tier_title",{number:`${o+1}`})),i("div",{class:{"s-conditional-offer-tier-text":!0,"s-conditional-offer-tier-text-met":r},innerHTML:this.getTierSentence(t,o,e)})))}))))}renderGiftsToggle(t){return i("button",{type:"button",id:this.elementId(`toggle-${t}`),class:{"s-conditional-offer-toggle":!0,"s-conditional-offer-toggle-inline":"inline"===t,"s-conditional-offer-toggle-bar":"bar"===t},"aria-expanded":this.isGiftsOpen?"true":"false","aria-controls":this.elementId("gifts"),onClick:()=>this.isGiftsOpen=!this.isGiftsOpen},i("span",null,this.trans("manage_offer")),i("i",{class:{"sicon-keyboard_arrow_down":!0,"s-conditional-offer-toggle-icon":!0,"s-conditional-offer-toggle-icon-open":this.isGiftsOpen},"aria-hidden":"true"}))}renderGiftsCard(){return i("div",{class:"s-conditional-offer-panel",id:this.elementId("gifts")},i("div",{class:"s-conditional-offer-gifts-header"},i("span",{class:"s-conditional-offer-gifts-icon"},i("i",{class:"sicon-gift","aria-hidden":"true"})),i("span",{class:"s-conditional-offer-gifts-title"},this.trans("free_products_title"))),i("ul",{class:"s-conditional-offer-gifts-list"},this.gifts.map((t=>this.renderGiftRow(t)))))}renderGiftRow(t){return i("li",{class:"s-conditional-offer-gift","data-item-id":t.id},i("span",{class:"s-conditional-offer-gift-thumb"},t.imageUrl?i("img",{class:"s-conditional-offer-gift-image",src:t.imageUrl,alt:t.imageAlt||t.name,loading:"lazy",decoding:"async"}):i("i",{class:"sicon-gift","aria-hidden":"true"})),i("div",{class:"s-conditional-offer-gift-body"},i("span",{class:"s-conditional-offer-gift-name"},t.name||this.trans("free_gift")),i("span",{class:"s-conditional-offer-gift-prices"},i("span",{class:"s-conditional-offer-gift-free"},this.getFreeLabel()),null!==t.originalPrice?i("span",{class:"s-conditional-offer-gift-price",innerHTML:salla.money(t.originalPrice)}):null)))}getLoadingSkeletonView(){return i(e,{class:"s-conditional-offer-root"},i("div",{class:"s-conditional-offer-banner"},i("div",{class:"s-conditional-offer-lead"},i("salla-skeleton",{height:"24px",width:"80px"}),i("div",{class:"s-conditional-offer-skeleton-text"},i("salla-skeleton",{height:"12px",width:"35%"}),i("salla-skeleton",{height:"16px",width:"60%"})))))}render(){if(!this.canRender)return null;if(!this.hasCartItems())return null;if(this.isLoading)return this.getLoadingSkeletonView();if(!this.offer)return null;const t=this.getStages(),o=this.getProgress(t),r=this.getGuidanceMessage(t,o),n=this.trans("details_title"),s=this.gifts.length>0;return i(e,{class:"s-conditional-offer-root"},i("div",{class:"s-conditional-offer-banner"},i("div",{class:"s-conditional-offer-lead"},this.renderBadges(t,o),i("div",{class:"s-conditional-offer-text"},i("div",{class:"s-conditional-offer-heading",onMouseEnter:()=>this.isTooltipHovered=!0,onMouseLeave:()=>this.isTooltipHovered=!1},i("span",{class:"s-conditional-offer-name"},this.offer.title),i("span",{class:"s-conditional-offer-info",ref:t=>this.infoAnchorEl=t},i("button",{type:"button",class:"s-conditional-offer-info-trigger",ref:t=>this.infoTriggerEl=t,"aria-label":n,title:n,"aria-expanded":this.isTooltipOpen?"true":"false","aria-describedby":this.elementId("tooltip"),onClick:()=>this.toggleTooltip()},i(N,{class:"s-conditional-offer-info-icon"})),this.isTooltipOpen?this.renderTooltip(t,o):null)),o.allMet?i("div",{class:"s-conditional-offer-message",role:"status"},this.trans("congrats")):r?i("div",{class:"s-conditional-offer-message",innerHTML:r}):null)),s?this.renderGiftsToggle("inline"):null),s&&this.isGiftsOpen?this.renderGiftsCard():null,s?this.renderGiftsToggle("bar"):null)}get hostEl(){return o(this)}};W.style='/*!twlt*/:host{display:block}.s-conditional-offer-root{background-color:rgba(0, 137, 123, 0.06);background-color:color-mix(in srgb, var(--color-primary, #00897b) 7%, transparent)}.s-conditional-offer-badges::-webkit-scrollbar{height:3px}.s-conditional-offer-badges::-webkit-scrollbar-thumb{border-radius:9999px;background-color:rgba(0, 0, 0, 0.15)}.s-conditional-offer-badges::-webkit-scrollbar-track{background-color:transparent}.s-conditional-offer-tooltip{--s-conditional-offer-tooltip-shift:0px;--s-conditional-offer-tooltip-caret:0px;transform:translateX(calc(-50% + var(--s-conditional-offer-tooltip-shift)))}.s-conditional-offer-tooltip::before{content:"";position:absolute;bottom:100%;left:50%;transform:translateX(calc(-50% + var(--s-conditional-offer-tooltip-caret)));border:8px solid transparent;border-bottom-color:#fff}.s-conditional-offer-tier-icon-met,.s-conditional-offer-tier-icon-unmet{color:var(--color-primary-dark, #00695c);background-color:rgba(0, 137, 123, 0.12);background-color:color-mix(in srgb, var(--color-primary, #00897b) 14%, transparent)}.s-conditional-offer-tier:not(:last-child)::before{content:"";position:absolute;top:2.5rem;bottom:-1rem;inset-inline-start:1.125rem;width:1px;background-color:#d1d5db}.visible{visibility:visible}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.w-6{width:1.5rem}.resize{resize:both}.gap-1{gap:0.25rem}.rounded{border-radius:var(--s-radius, 0.25rem)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-conditional-offer-root{margin-bottom:1.25rem;display:block;width:100%;min-width:0px;max-width:100%;border-radius:0.375rem;padding:0.75rem}@media (min-width: 768px){.s-conditional-offer-root{padding:1rem}}.s-conditional-offer-banner{display:flex;width:100%;min-width:0px;align-items:center;justify-content:space-between;gap:0.75rem}@media (min-width: 768px){.s-conditional-offer-banner{gap:1rem}}.s-conditional-offer-lead{display:flex;min-width:0px;flex:1 1 0%;align-items:center;gap:0.5rem}@media (min-width: 768px){.s-conditional-offer-lead{gap:0.75rem}}.s-conditional-offer-badges{display:flex;max-width:45%;flex-shrink:0;flex-wrap:nowrap;align-items:center;gap:0.25rem;overflow-x:auto;overscroll-behavior-x:contain;scroll-behavior:smooth;scrollbar-width:thin}.s-conditional-offer-badge{display:inline-flex;height:1.5rem;width:1.5rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;font-size:11px;line-height:1;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-conditional-offer-badge-met{background-color:var(--color-primary)}.s-conditional-offer-badge-unmet{--tw-bg-opacity:1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.s-conditional-offer-badge-link{width:0.5rem;flex-shrink:0;border-top-width:1px}.s-conditional-offer-badge-link-met{border-color:var(--color-primary)}.s-conditional-offer-badge-link-unmet{border-style:dashed;--tw-border-opacity:1;border-color:rgb(82 82 82 / var(--tw-border-opacity, 1))}.s-conditional-offer-badge-icon{height:0.75rem;width:0.75rem;flex-shrink:0}.s-conditional-offer-text{display:flex;min-width:0px;flex-direction:column;gap:0.125rem;text-align:start}.s-conditional-offer-heading{display:flex;min-width:0px;align-items:center;gap:0.375rem}.s-conditional-offer-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.s-conditional-offer-info{position:relative;display:inline-flex;flex-shrink:0;align-items:center}.s-conditional-offer-info-trigger{display:inline-flex;height:1rem;width:1rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;--tw-text-opacity:1;color:rgb(115 115 115 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-conditional-offer-info-trigger:hover{color:var(--color-primary-dark)}.s-conditional-offer-info-icon{height:0.875rem;width:0.875rem;flex-shrink:0}.s-conditional-offer-message{font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary-dark)}@media (min-width: 768px){.s-conditional-offer-message{font-size:1rem;line-height:1.5rem}}.s-conditional-offer-toggle{align-items:center;justify-content:center;gap:0.375rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(38 38 38 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-conditional-offer-toggle:hover{color:var(--color-primary-dark)}.s-conditional-offer-toggle-inline{display:none;flex-shrink:0}@media (min-width: 768px){.s-conditional-offer-toggle-inline{display:inline-flex}}.s-conditional-offer-toggle-bar{margin-top:0.5rem;display:inline-flex;width:100%;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:0.75rem;padding-right:0.75rem;padding-top:0.625rem;padding-bottom:0.625rem}@media (min-width: 768px){.s-conditional-offer-toggle-bar{display:none}}.s-conditional-offer-toggle-icon{font-size:1rem;line-height:1.5rem;line-height:1;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-conditional-offer-toggle-icon-open{--tw-rotate:180deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-conditional-offer-panel{margin-top:0.75rem;width:100%;min-width:0px;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem}.s-conditional-offer-gifts-header{margin-bottom:0.75rem;display:flex;align-items:center;gap:0.5rem}.s-conditional-offer-gifts-icon{display:inline-flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-color:var(--color-primary);font-size:1rem;line-height:1.5rem;line-height:1;color:var(--color-primary)}.s-conditional-offer-gifts-title{font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary-dark)}.s-conditional-offer-gifts-list{margin:0px;display:flex;list-style-type:none;flex-direction:column;gap:0.5rem;padding:0px}.s-conditional-offer-gift{display:flex;align-items:center;gap:0.75rem;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding:0.5rem}.s-conditional-offer-gift-thumb{display:inline-flex;height:3.5rem;width:3.5rem;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));font-size:1.25rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-conditional-offer-gift-image{height:100%;width:100%;object-fit:contain}.s-conditional-offer-gift-body{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.125rem;text-align:start}.s-conditional-offer-gift-name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(38 38 38 / var(--tw-text-opacity, 1))}.s-conditional-offer-gift-prices{display:flex;align-items:center;gap:0.5rem;font-size:0.75rem;line-height:1rem}.s-conditional-offer-gift-free{font-weight:700;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-conditional-offer-gift-price{--tw-text-opacity:1;color:rgb(115 115 115 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-conditional-offer-tooltip{position:absolute;top:calc(100% + 0.75rem);left:50%;z-index:10;width:min(22rem, calc(100vw - 2rem));border-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1rem;text-align:start;--tw-shadow:5px 10px 30px #2B2D340D;--tw-shadow-colored:5px 10px 30px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-conditional-offer-tooltip-title{font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary-dark)}.s-conditional-offer-tooltip-description{margin-top:0.25rem;font-size:0.75rem;line-height:1rem;line-height:1.625;--tw-text-opacity:1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.s-conditional-offer-tooltip-list{margin:0px;margin-top:0.75rem;display:flex;list-style-type:none;flex-direction:column;gap:1rem;padding:0px}.s-conditional-offer-tier{position:relative;display:flex;align-items:flex-start;gap:0.75rem}.s-conditional-offer-tier-icon{position:relative;display:inline-flex;height:2.25rem;width:2.25rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;font-size:1rem;line-height:1.5rem;line-height:1}.s-conditional-offer-tier-icon-unmet{color:var(--color-primary-dark)}.s-conditional-offer-tier-status{position:absolute;bottom:-0.125rem;display:inline-flex;height:1rem;width:1rem;align-items:center;justify-content:center;border-radius:9999px;border-width:2px;--tw-border-opacity:1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));inset-inline-start:-2px}.s-conditional-offer-tier-status-met{color:var(--color-primary-dark)}.s-conditional-offer-tier-status-unmet{--tw-text-opacity:1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.s-conditional-offer-tier-status-check{height:0.75rem;width:0.75rem;flex-shrink:0}.s-conditional-offer-tier-status-lock{height:0.625rem;width:0.625rem;flex-shrink:0}.s-conditional-offer-tier-body{display:flex;min-width:0px;flex-direction:column;gap:0.125rem}.s-conditional-offer-tier-title{font-size:0.75rem;line-height:1rem;font-weight:700;color:var(--color-primary-dark)}.s-conditional-offer-tier-text{font-size:0.75rem;line-height:1rem;line-height:1.625;--tw-text-opacity:1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.s-conditional-offer-tier-text-met{text-decoration-line:line-through}.s-conditional-offer-skeleton-text{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.375rem}';export{W as salla_conditional_offer}
4
+ import{r as t,h as i,H as e,a as o}from"./p-Ca7ApeqJ.js";var r,n;!function(t){t.PERCENTAGE="percentage",t.FIXED="fixed",t.FREE_PRODUCT="free_product",t.FREE_SHIPPING="free_shipping"}(r||(r={})),function(t){t.PRODUCT_COUNT="products_count",t.PRODUCT_PURCHASE="order_amount"}(n||(n={}));const s=Object.freeze([]);let a,l=null,c=null,d=!1,f=null,h=null,u=0;function g(t){return"CartNotCreated"===t?.name}function m(){try{const t=salla.api?.cart?.getStoredCartId?salla.api.cart.getStoredCartId():salla.storage?.get?.("cart.id");return null==t||""===t?null:String(t)}catch(t){return null}}function p(){const t=m();void 0!==a&&a!==t&&(u++,l=null,c=null,d=!1,f=null),a=t}function b(t){return null==t?0:"number"==typeof t?isFinite(t)?t:0:"string"==typeof t&&parseFloat(t)||0}function w(t){if(null==t||""===t)return null;const i=b(t);return isFinite(i)?i:null}function y(t,i){if(null!==i)return i.length;const e=w(t?.data?.cart?.count??t?.data?.count??t?.cart?.count??t?.count);return null!==e&&e>=0?e:null}function x(t){for(const i of[t?.original_price,t?.product_price,t?.price]){const t=w(i&&"object"==typeof i?i.amount:i);if(null!==t&&t>0)return t}return null}function v(t,i){const e=t?.free_gift_quantity;return null!=e&&""!==e?b(e):i>0?i:0}function k(t){const i=[];for(const e of t){if(null==e?.id)continue;if(!e.added_by_offer)continue;const t=b(e.quantity),o=v(e,t);o<=0||i.push({id:String(e.id),offerId:w(e.offer_id),quantity:o,freeQuantity:o,lineQuantity:t,name:String(e.product_name??e.name??""),imageUrl:String(e.product_image?.url??e.product_image??e.image?.url??""),imageAlt:String(e.product_image?.alt??e.image?.alt??e.product_name??""),url:String(e.url??""),originalPrice:x(e)})}return i}function _(){if(f)return f;const t=u,i=Promise.resolve().then((()=>salla.api?.cart?.details?.())).then((t=>{const i=function(t){const i=t?.data?.cart?.items??t?.data?.items??t?.cart?.items??t?.items;return Array.isArray(i)?i:null}(t);return{gifts:k(i??[]),count:y(t,i),ok:!0}})).catch((t=>({gifts:l??[],count:g(t)?0:c,ok:!1}))).then((({gifts:i,count:e,ok:o})=>{t===u&&(l=i,c=e,d=o)})).finally((()=>{f===i&&(f=null)}));return f=i,i}const C=-1;var M,T;function z(t){const i="number"==typeof t?t:parseFloat(t);return Number.isFinite(i)?i:null}function S(t){return"boolean"==typeof t?t:1===t||0===t?1===t:"true"===t||"1"===t||"false"!==t&&"0"!==t&&void 0}function L(t){return z(t)??0}function I(t,i,e){return Math.max(i,Math.min(t,e))}function V(t){const i="number"==typeof t?t:parseFloat(t);if(!Number.isFinite(i))return null;const e=Math.trunc(i);return e>=0&&e<=4?e:null}!function(t){t.LOCKED="locked",t.CURRENT="current",t.COMPLETED="completed"}(M||(M={})),function(t){t.CURRENCY="currency",t.COUNT="count"}(T||(T={}));const F=[1e3,2e3,4e3],R='[data-testid^="store-cart-item-"], form[id^="item-"]';let $=0;const P={badges_summary:":completed of :total offers unlocked",congrats:"Congratulations! You’ve unlocked all rewards in this promotion",details_title:"Offer details",free_gift:"Free Gift",free_products_title:"Free products selected from the offer",guidance_conditions_unmet:"Your cart doesn’t meet the conditions for the next reward yet",guidance_next:"Add :remaining and get :reward",guidance_next_generic:"Add :remaining to unlock the next reward",manage_offer:"Manage offer",tier_requirement:"Spend :threshold and get :reward",tier_requirement_count:"Buy :threshold and get :reward",tier_requirement_count_generic:"Buy :threshold to unlock this offer",tier_requirement_generic:"Spend :threshold to unlock this offer",tier_title:"Offer (:number)"},j="pages.checkout.free_charge";function H(t){const i=document.createElement("div");return i.textContent=t??"",i.innerHTML}const q=(t={})=>i("svg",{class:t.class,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},i("path",{d:"M5.00016 9.16634C2.69898 9.16634 0.833496 7.30084 0.833496 4.99967C0.833496 2.69849 2.69898 0.833008 5.00016 0.833008C7.30133 0.833008 9.16683 2.69849 9.16683 4.99967C9.16683 7.30084 7.30133 9.16634 5.00016 9.16634ZM4.58458 6.66634L7.53087 3.72006L6.94162 3.13081L4.58458 5.48784L3.40608 4.3093L2.81683 4.89859L4.58458 6.66634Z",fill:"currentColor"})),O=(t={})=>i("svg",{class:t.class,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},i("path",{d:"M12.6667 6.66683H13.3333C13.7015 6.66683 14 6.9653 14 7.3335V14.0002C14 14.3684 13.7015 14.6668 13.3333 14.6668H2.66667C2.29848 14.6668 2 14.3684 2 14.0002V7.3335C2 6.9653 2.29848 6.66683 2.66667 6.66683H3.33333V6.00016C3.33333 3.42284 5.42267 1.3335 8 1.3335C10.5773 1.3335 12.6667 3.42284 12.6667 6.00016V6.66683ZM11.3333 6.66683V6.00016C11.3333 4.15922 9.84093 2.66683 8 2.66683C6.15905 2.66683 4.66667 4.15922 4.66667 6.00016V6.66683H11.3333ZM7.33333 9.3335V12.0002H8.66667V9.3335H7.33333Z",fill:"currentColor"})),N=(t={})=>i("svg",{class:t.class,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},i("path",{d:"M7.00033 12.8337C3.77866 12.8337 1.16699 10.222 1.16699 7.00033C1.16699 3.77866 3.77866 1.16699 7.00033 1.16699C10.222 1.16699 12.8337 3.77866 12.8337 7.00033C12.8337 10.222 10.222 12.8337 7.00033 12.8337ZM6.41699 6.41699V9.91699H7.58366V6.41699H6.41699ZM6.41699 4.08366V5.25033H7.58366V4.08366H6.41699Z",fill:"currentColor"})),B=class{constructor(i){t(this,i),this.offer=null,this.isLoading=!1,this.canRender=!0,this.gifts=[],this.cartItemCount=null,this.isTooltipHovered=!1,this.isTooltipPinned=!1,this.isGiftsOpen=!0,this.instanceId=++$,this.refreshGeneration=0,this.giftsGeneration=0,this.cartRefreshTimer=null,this.cartRefreshPending=!1,this.wantsCartUpdates=!1,this.isListeningToCartUpdates=!1,this.cartLookupRetryTimer=null,this.cartLookupRetries=0,this.cartLookupRetryPending=!1,this.deferredByEmptyCart=!1,this.isDisconnected=!1,this.skeletonWatchdog=null,this.skeletonDeadline=0,this.hasRelocated=!1,this.hasLoaded=!1,this.relocationObserver=null,this.relocationWatchTimer=null,this.relocationWatchExpired=!1,this.relocationLogged=!1,this.cartUpdatedHandler=t=>{this.readCartCountFromEvent(t),this.clearCartLookupRetry(),this.scheduleCartRefresh()}}componentWillLoad(){this.ensureSkeletonIsWatched();try{this.isEnabled()&&this.startLoading(),this.load().catch((t=>{this.stopLoading(),this.safeLog("load() failed",t)}))}catch(t){this.stopLoading(),this.safeLog("componentWillLoad threw synchronously",t)}}safeLog(t,i){try{salla.logger.warn("salla-conditional-offer::",t,i)}catch(t){}}connectedCallback(){this.isDisconnected=!1,this.ensureSkeletonIsWatched(),this.wantsCartUpdates&&!this.isListeningToCartUpdates&&this.subscribeToCartUpdates()&&(this.cartRefreshPending=!0),this.cartRefreshPending&&this.scheduleCartRefresh(),this.cartLookupRetryPending&&this.scheduleCartLookupRetry()}disconnectedCallback(){this.isDisconnected=!0,null!==this.cartRefreshTimer&&(clearTimeout(this.cartRefreshTimer),this.cartRefreshTimer=null),null!==this.cartLookupRetryTimer&&(clearTimeout(this.cartLookupRetryTimer),this.cartLookupRetryTimer=null),Promise.resolve().then((()=>{this.isDisconnected&&this.unsubscribeFromCartUpdates()})),null!==this.skeletonWatchdog&&(clearTimeout(this.skeletonWatchdog),this.skeletonWatchdog=null),this.stopWatchingForItemsColumn()}componentDidLoad(){this.hasLoaded=!0,this.relocateIntoItemsColumn()}isShowingSomething(){return this.canRender&&this.hasCartItems()}componentDidRender(){this.hasLoaded&&this.relocateIntoItemsColumn(),this.positionTooltip(),this.ensureSkeletonIsWatched()}relocateIntoItemsColumn(){if(!this.hasRelocated&&this.isShowingSomething())try{const t=this.hostEl;if(!t?.parentElement)return;const i=this.findItemsColumn(t);if(!i)return void this.watchForItemsColumn();if(this.hasRelocated=!0,this.stopWatchingForItemsColumn(),i===t.parentElement&&i.firstElementChild===t)return;i.insertBefore(t,i.firstChild)}catch(t){this.hasRelocated=!0,this.stopWatchingForItemsColumn(),this.safeLog("relocating the banner into the cart items column failed",t)}}findItemsColumn(t){let i=t;for(let e=0;i&&e<=3;e++){for(const e of this.getFollowingSiblings(i)){if(i===t&&this.matches(e,R))return t.parentElement;const o=this.findColumnWithin(e,t);if(o)return o}if(i=i.parentElement,!i||i===document.body||i===document.documentElement)break}return null}getFollowingSiblings(t){const i=[];for(let e=t.nextElementSibling;e;e=e.nextElementSibling)i.push(e);return i}findColumnWithin(t,i){const e=t.querySelector(R),o=(e?this.climbToChildOf(e,t):null)??t.querySelector(".main-content, [data-cart-items]");return!o||o===i||o.contains(i)?null:o}climbToChildOf(t,i){let e=t;for(;e&&e.parentElement&&e.parentElement!==i;)e=e.parentElement;return e?.parentElement===i?e:null}matches(t,i){return"function"==typeof t.matches&&t.matches(i)}watchForItemsColumn(){this.hasRelocated||this.relocationWatchExpired||this.relocationObserver||("undefined"!=typeof MutationObserver?(this.relocationObserver=new MutationObserver((()=>this.relocateIntoItemsColumn())),this.relocationObserver.observe(document.documentElement,{childList:!0,subtree:!0}),this.relocationWatchTimer=setTimeout((()=>{this.relocationWatchTimer=null,this.relocationWatchExpired=!0,this.stopWatchingForItemsColumn(),this.logNoItemsColumn()}),5e3)):this.logNoItemsColumn())}stopWatchingForItemsColumn(){if(this.relocationObserver){try{this.relocationObserver.disconnect()}catch(t){}this.relocationObserver=null}null!==this.relocationWatchTimer&&(clearTimeout(this.relocationWatchTimer),this.relocationWatchTimer=null)}logNoItemsColumn(){this.relocationLogged||(this.relocationLogged=!0,this.safeLog("no cart items column found — leaving the banner at full page width"))}ensureSkeletonIsWatched(){if(!this.isLoading)return;if(null!==this.skeletonWatchdog)return;const t=Date.now();0===this.skeletonDeadline&&(this.skeletonDeadline=t+8e3);const i=Math.max(0,this.skeletonDeadline-t);this.skeletonWatchdog=setTimeout((()=>{this.skeletonWatchdog=null,this.isLoading&&(Date.now()<this.skeletonDeadline?this.ensureSkeletonIsWatched():(this.isLoading=!1,this.skeletonDeadline=0,this.safeLog("still loading after 8000ms — dropping the skeleton")))}),i)}clearSkeletonWatchdog(){this.skeletonDeadline=0,null!==this.skeletonWatchdog&&(clearTimeout(this.skeletonWatchdog),this.skeletonWatchdog=null)}startLoading(){this.isLoading=!0,this.ensureSkeletonIsWatched()}stopLoading(){this.isLoading=!1,this.clearSkeletonWatchdog()}async load(){this.wantsCartUpdates=!0,this.subscribeToCartUpdates()||this.subscribeWhenSdkIsReady(),this.loadCart(),await this.waitForSdk(),await this.refresh()}waitForSdk(){let t,i;try{t=Promise.resolve(salla.onReady?.())}catch(t){return this.safeLog("salla.onReady() threw",t),Promise.resolve()}const e=new Promise((t=>{i=setTimeout(t,3e3)}));return Promise.race([t.catch((t=>this.safeLog("salla.onReady() rejected",t))),e]).then((()=>{clearTimeout(i)}))}subscribeToCartUpdates(){if(this.isListeningToCartUpdates)return!0;try{salla.event.on("cart::updated",this.cartUpdatedHandler),this.isListeningToCartUpdates=!0}catch(t){this.safeLog("cart::updated subscription failed",t)}return this.isListeningToCartUpdates}unsubscribeFromCartUpdates(){if(this.isListeningToCartUpdates){this.isListeningToCartUpdates=!1;try{salla.event.off("cart::updated",this.cartUpdatedHandler)}catch(t){this.safeLog("cart::updated unsubscription failed",t)}}}subscribeWhenSdkIsReady(){let t;try{t=Promise.resolve(salla.onReady?.())}catch(t){return}const i=()=>{this.isDisconnected||this.subscribeToCartUpdates()};t.then(i,i)}scheduleCartRefresh(){this.cartRefreshPending=!0,null!==this.cartRefreshTimer&&clearTimeout(this.cartRefreshTimer),this.cartRefreshTimer=null,this.isDisconnected||(this.cartRefreshTimer=setTimeout((()=>{this.cartRefreshTimer=null,this.runCartRefresh()}),200))}runCartRefresh(){this.isDisconnected||(this.cartRefreshPending=!1,this.refresh(),function(){if(h)return h;u++,l=null,c=null,d=!1,a=m();const t=()=>(h===i&&(h=null),_()),i=(f??Promise.resolve()).then(t,t).finally((()=>{h===i&&(h=null)}));return h=i,i}().then((()=>this.loadCart()),(()=>this.loadCart())))}readCartCountFromEvent(t){const i=this.toCartCount(t?.count)??this.readCartCountFromStorage();null!==i&&(this.cartItemCount=i)}readCartCountFromStorage(){try{return this.toCartCount(salla.storage?.get?.("cart.summary.count"))}catch(t){return null}}toCartCount(t){return"number"==typeof t&&Number.isFinite(t)&&t>=0?t:null}getFreeLabel(){const t=salla.lang.get(j);return t&&t!==j?t:"Free"}trans(t,i){const e=`blocks.cart_offer.${t}`,o=salla.lang.get(e,i);return o&&o!==e?o:Object.entries(i??{}).reduce(((t,[i,e])=>t.split(`:${i}`).join(e)),P[t])}isEnabled(){try{return!!salla.config.get("store.features")?.includes("conditional-offer")}catch(t){return!1}}async fetchOffer(){const{data:t}=await salla.api.cart.offers(),i=(t||[]).find((t=>"conditional"===t.type));return i?.details?.discounts?.length?i:null}async refresh(){const t=++this.refreshGeneration;if(!this.isEnabled())return this.stopLoading(),void(this.canRender=!1);if(0===this.cartItemCount)return this.stopLoading(),p(),void(d||(this.deferredByEmptyCart=!0,this.loadCart()));this.deferredByEmptyCart=!1,this.offer?this.stopLoading():this.startLoading();try{const i=await this.fetchOffer();if(this.isSuperseded(t))return;if(!i)return this.offer=null,void(this.canRender=!1);this.offer=i,this.canRender=!0,this.loadCart()}catch(i){if(this.isSuperseded(t))return;this.safeLog("offers() failed",i)}finally{t===this.refreshGeneration&&this.stopLoading()}}hasCartItems(){return"number"==typeof this.cartItemCount&&this.cartItemCount>=1}isSuperseded(t){return t!==this.refreshGeneration||this.isDisconnected}loadCart(){const t=++this.giftsGeneration;return Promise.all([(p(),d&&l?Promise.resolve(l):_().then((()=>l??s))),(p(),d&&l?Promise.resolve(c):_().then((()=>c)))]).then((([i,e])=>{t!==this.giftsGeneration||this.isDisconnected||this.cartRefreshPending||(null!==e&&(this.cartItemCount=e),null!==e?this.clearCartLookupRetry():null===this.cartItemCount&&this.scheduleCartLookupRetry(),this.deferredByEmptyCart&&this.hasCartItems()&&(this.deferredByEmptyCart=!1,this.refresh()),this.gifts=this.offer?this.selectOwnGifts(i):[])})).catch((t=>{this.safeLog("cart lookup failed",t)}))}scheduleCartLookupRetry(){this.cartLookupRetries>=F.length||(this.cartLookupRetryPending=!0,null!==this.cartLookupRetryTimer||this.isDisconnected||(this.cartLookupRetryTimer=setTimeout((()=>{this.cartLookupRetryTimer=null,this.cartLookupRetryPending=!1,this.canRender&&(this.cartLookupRetries++,this.loadCart())}),F[this.cartLookupRetries])))}clearCartLookupRetry(){this.cartLookupRetries=0,this.cartLookupRetryPending=!1,null!==this.cartLookupRetryTimer&&(clearTimeout(this.cartLookupRetryTimer),this.cartLookupRetryTimer=null)}selectOwnGifts(t){const i=Number(this.offer?.id);if(!Number.isFinite(i))return t;const e=t.filter((t=>null!==t.offerId&&Number(t.offerId)===i));return e.length?e:t.filter((t=>null===t.offerId))}getStages(){const t=(this.offer?.details?.discounts??[]).filter((({min_spend:t})=>null!==z(t)));return i=({min_spend:t})=>t,e=({id:t})=>t,(t??[]).map(((t,o)=>({item:t,index:o,threshold:L(i(t)),identity:e?z(e(t)):null}))).sort(((t,i)=>t.threshold!==i.threshold?t.threshold-i.threshold:null!==t.identity&&null!==i.identity&&t.identity!==i.identity?t.identity-i.identity:t.index-i.index)).map((({item:t})=>t));var i,e}getProgress(t){return function(t,i,e=0,o=[],r=[]){const n=(i??[]).map(((t,i)=>({index:i,threshold:z(t),applied:S(o?.[i]),tierValue:z(r?.[i])}))).filter((t=>null!==t.threshold)).sort(((t,i)=>t.threshold-i.threshold||t.index-i.index)),s=n.map((t=>t.threshold)),a=n.map((t=>t.applied)),l=a.some((t=>void 0!==t)),c=L(e);if(!s.length)return{thresholds:s,met:[],applied:a,appliedIndex:C,hasEngineVerdict:l,metCount:0,nextUnmetIndex:C,allMet:!1,lastReachedIndex:C,currentIndex:C,isComplete:!1,value:Math.max(0,L(t)),values:[],startValue:c,fills:[],overallPercentage:0};const d=s[s.length-1],f=I(L(t),0,Math.max(0,d)),h=n.map((({tierValue:t})=>null===t?f:I(t,0,Math.max(0,d))));let u=C;for(let t=0;t<s.length;t++)h[t]>=s[t]&&(u=t);const g=u===s.length-1,m=g?C:u+1,p=s.map(((t,i)=>function(t,i,e){return e<=i?t>=e?100:0:I((t-i)/(e-i)*100,0,100)}(h[i],0===i?c:s[i-1],t))),b=g?100:I((u+1+(p[m]??0)/100)/s.length*100,0,100);let w=C;for(let t=0;t<a.length;t++)!0===a[t]&&(w=t);const y=s.map(l?(t,i)=>i<=w:(t,i)=>i<=u),x=y.filter(Boolean).length,v=y.findIndex((t=>!t));return{thresholds:s,met:y,applied:a,appliedIndex:w,hasEngineVerdict:l,metCount:x,nextUnmetIndex:v,allMet:v===C,lastReachedIndex:u,currentIndex:m,isComplete:g,value:f,values:h,startValue:c,fills:p,overallPercentage:b}}(this.offer?.details?.current_value,t.map((({min_spend:t})=>t)),this.offer?.details?.start_value,t.map((({is_applied:t})=>t)),t.map((({current_value:t})=>t)))}tierKey(t,i){const e=Number(t?.id);return Number.isFinite(e)?`tier-${e}`:`pos-${i}`}stageMeasure(){return this.offer?.details?.based_on===n.PRODUCT_COUNT?T.COUNT:T.CURRENCY}formatRequirement(t){const i=this.offer?.details?.based_on;if(i===n.PRODUCT_COUNT)try{return salla.lang.choice("blocks.header.products_count",t)}catch(i){return this.safeLog("invalid products_count interval",i),`${t}`}return i===n.PRODUCT_PURCHASE?salla.money(t):(this.safeLog(`unexpected offer detail's based_on value: ${i}`),`${t}`)}getRewardText(t){return(t?.reward_label??"").trim()}getGuidanceMessage(t,i){if(i.nextUnmetIndex===C)return"";const e=function(t,i,e=T.CURRENCY){const o=i.thresholds[t];if(void 0===o)return 0;const r=Math.max(0,o-(i.values?.[t]??i.value));if(0===r)return 0;const n=e===T.COUNT?0:function(){try{const t="undefined"!=typeof salla?salla:void 0,i=V(t?.config?.currency?.()?.decimals);if(null!==i)return i;const e=V(t?.config?.get?.("store.currency.decimals"));if(null!==e)return e}catch(t){}return 2}(),s=Math.pow(10,n),a=Math.ceil(r*s-1e-6)/s;return a>0?a:1/s}(i.nextUnmetIndex,i,this.stageMeasure());if(e<=0)return this.trans("guidance_conditions_unmet");const o=this.formatRequirement(e),r=this.getRewardText(t[i.nextUnmetIndex]);return r?this.trans("guidance_next",{remaining:o,reward:H(r)}):this.trans("guidance_next_generic",{remaining:o})}getTierSentence(t,i,e){const o=this.formatRequirement(e.thresholds[i]),r=this.getRewardText(t),n=this.stageMeasure()===T.COUNT;return r?this.trans(n?"tier_requirement_count":"tier_requirement",{threshold:o,reward:H(r)}):this.trans(n?"tier_requirement_count_generic":"tier_requirement_generic",{threshold:o})}getRewardIcon(t){switch(t?.type){case r.PERCENTAGE:return"sicon-percentage";case r.FREE_PRODUCT:return"sicon-gift";case r.FIXED:return this.usesSarSymbol()?"sicon-sar":"sicon-banknote";default:return"sicon-tag"}}usesSarSymbol(){try{const t=salla.config.currency?.()?.symbol;return["SAR","ر.س"].includes(t)&&!!salla.config.get("store.settings.use_sar_symbol")}catch(t){return!1}}get isTooltipOpen(){return this.isTooltipHovered||this.isTooltipPinned}toggleTooltip(){this.isTooltipPinned=!this.isTooltipPinned}closeTooltip(t=!1){this.isTooltipOpen&&(this.isTooltipPinned=!1,this.isTooltipHovered=!1,t&&this.infoTriggerEl?.focus?.())}positionTooltip(){const t=this.tooltipEl,i=this.infoTriggerEl;if(this.isTooltipOpen&&t&&i)try{this.setTooltipOffsets(t,0,0);const e=window.innerWidth||document.documentElement?.clientWidth||0,o=t.getBoundingClientRect(),r=i.getBoundingClientRect(),n=o?.width||0;if(n<=0||e<=0)return;const s=r.left+r.width/2-n/2,a=8,l=Math.min(Math.max(s,a),Math.max(a,e-a-n))-s,c=Math.max(0,n/2-16),d=Math.min(Math.max(-l,-c),c);this.setTooltipOffsets(t,l,d)}catch(t){this.safeLog("positioning the offer details popover failed",t)}}setTooltipOffsets(t,i,e){t.style?.setProperty?.("--s-conditional-offer-tooltip-shift",`${Math.round(i)}px`),t.style?.setProperty?.("--s-conditional-offer-tooltip-caret",`${Math.round(e)}px`)}handleWindowResize(){this.positionTooltip()}handleDocumentKeydown(t){"Escape"!==t.key&&"Esc"!==t.key||this.closeTooltip(!0)}handleDocumentClick(t){if(!this.isTooltipPinned||!this.infoAnchorEl)return;const i="function"==typeof t.composedPath?t.composedPath():[];(i.length?i.includes(this.infoAnchorEl):this.infoAnchorEl.contains(t.target))||this.closeTooltip()}elementId(t){return`s-conditional-offer-${t}-${this.instanceId}`}renderBadges(t,e){return i("div",{class:"s-conditional-offer-badges",role:"img","aria-label":this.trans("badges_summary",{completed:`${e.metCount}`,total:`${t.length}`})},t.map(((t,o)=>{const r=e.met[o],n=this.tierKey(t,o);return[o>0?i("span",{key:`${n}-link`,class:{"s-conditional-offer-badge-link":!0,"s-conditional-offer-badge-link-met":r,"s-conditional-offer-badge-link-unmet":!r},"aria-hidden":"true"}):null,i("span",{key:n,class:{"s-conditional-offer-badge":!0,"s-conditional-offer-badge-met":r,"s-conditional-offer-badge-unmet":!r},"data-tier-state":r?"met":"unmet","data-tier-id":t?.id??void 0},i(r?q:O,{class:"s-conditional-offer-badge-icon"}))]})))}renderTooltip(t,e){const o=function(t){const i=t?.details?.rules;if("string"==typeof i){const t=i.trim();return""===t?null:t}if(Array.isArray(i)){const t=i.filter((t=>"string"==typeof t)).map((t=>t.trim())).filter((t=>""!==t)).join(" ");return""===t?null:t}return null}(this.offer);return i("div",{class:"s-conditional-offer-tooltip",id:this.elementId("tooltip"),role:"tooltip",ref:t=>this.tooltipEl=t},i("div",{class:"s-conditional-offer-tooltip-title"},this.offer?.title),o?i("div",{class:"s-conditional-offer-tooltip-description"},o):null,i("ul",{class:"s-conditional-offer-tooltip-list"},t.map(((t,o)=>{const r=e.met[o];return i("li",{key:this.tierKey(t,o),class:"s-conditional-offer-tier","data-tier-state":r?"met":"unmet","data-tier-id":t?.id??void 0},i("span",{class:{"s-conditional-offer-tier-icon":!0,"s-conditional-offer-tier-icon-met":r,"s-conditional-offer-tier-icon-unmet":!r}},i("i",{class:this.getRewardIcon(t),"aria-hidden":"true"}),i("span",{class:{"s-conditional-offer-tier-status":!0,"s-conditional-offer-tier-status-met":r,"s-conditional-offer-tier-status-unmet":!r},"aria-hidden":"true"},r?i(q,{class:"s-conditional-offer-tier-status-check"}):i(O,{class:"s-conditional-offer-tier-status-lock"}))),i("div",{class:"s-conditional-offer-tier-body"},i("div",{class:"s-conditional-offer-tier-title"},this.trans("tier_title",{number:`${o+1}`})),i("div",{class:{"s-conditional-offer-tier-text":!0,"s-conditional-offer-tier-text-met":r},innerHTML:this.getTierSentence(t,o,e)})))}))))}renderGiftsToggle(t){return i("button",{type:"button",id:this.elementId(`toggle-${t}`),class:{"s-conditional-offer-toggle":!0,"s-conditional-offer-toggle-inline":"inline"===t,"s-conditional-offer-toggle-bar":"bar"===t},"aria-expanded":this.isGiftsOpen?"true":"false","aria-controls":this.elementId("gifts"),onClick:()=>this.isGiftsOpen=!this.isGiftsOpen},i("span",null,this.trans("manage_offer")),i("i",{class:{"sicon-keyboard_arrow_down":!0,"s-conditional-offer-toggle-icon":!0,"s-conditional-offer-toggle-icon-open":this.isGiftsOpen},"aria-hidden":"true"}))}renderGiftsCard(){return i("div",{class:"s-conditional-offer-panel",id:this.elementId("gifts")},i("div",{class:"s-conditional-offer-gifts-header"},i("span",{class:"s-conditional-offer-gifts-icon"},i("i",{class:"sicon-gift","aria-hidden":"true"})),i("span",{class:"s-conditional-offer-gifts-title"},this.trans("free_products_title"))),i("ul",{class:"s-conditional-offer-gifts-list"},this.gifts.map((t=>this.renderGiftRow(t)))))}renderGiftRow(t){return i("li",{class:"s-conditional-offer-gift","data-item-id":t.id},i("span",{class:"s-conditional-offer-gift-thumb"},t.imageUrl?i("img",{class:"s-conditional-offer-gift-image",src:t.imageUrl,alt:t.imageAlt||t.name,loading:"lazy",decoding:"async"}):i("i",{class:"sicon-gift","aria-hidden":"true"})),i("div",{class:"s-conditional-offer-gift-body"},i("span",{class:"s-conditional-offer-gift-name"},t.name||this.trans("free_gift")),i("span",{class:"s-conditional-offer-gift-prices"},i("span",{class:"s-conditional-offer-gift-free"},this.getFreeLabel()),null!==t.originalPrice?i("span",{class:"s-conditional-offer-gift-price",innerHTML:salla.money(t.originalPrice)}):null)))}getLoadingSkeletonView(){return i(e,{class:"s-conditional-offer-root"},i("div",{class:"s-conditional-offer-banner"},i("div",{class:"s-conditional-offer-lead"},i("salla-skeleton",{height:"24px",width:"80px"}),i("div",{class:"s-conditional-offer-skeleton-text"},i("salla-skeleton",{height:"12px",width:"35%"}),i("salla-skeleton",{height:"16px",width:"60%"})))))}render(){if(!this.canRender)return null;if(!this.hasCartItems())return null;if(this.isLoading)return this.getLoadingSkeletonView();if(!this.offer)return null;const t=this.getStages(),o=this.getProgress(t),r=this.getGuidanceMessage(t,o),n=this.trans("details_title"),s=this.gifts.length>0;return i(e,{class:"s-conditional-offer-root"},i("div",{class:"s-conditional-offer-banner"},i("div",{class:"s-conditional-offer-lead"},this.renderBadges(t,o),i("div",{class:"s-conditional-offer-text"},i("div",{class:"s-conditional-offer-heading",onMouseEnter:()=>this.isTooltipHovered=!0,onMouseLeave:()=>this.isTooltipHovered=!1},i("span",{class:"s-conditional-offer-name"},this.offer.title),i("span",{class:"s-conditional-offer-info",ref:t=>this.infoAnchorEl=t},i("button",{type:"button",class:"s-conditional-offer-info-trigger",ref:t=>this.infoTriggerEl=t,"aria-label":n,title:n,"aria-expanded":this.isTooltipOpen?"true":"false","aria-describedby":this.elementId("tooltip"),onClick:()=>this.toggleTooltip()},i(N,{class:"s-conditional-offer-info-icon"})),this.isTooltipOpen?this.renderTooltip(t,o):null)),o.allMet?i("div",{class:"s-conditional-offer-message",role:"status"},this.trans("congrats")):r?i("div",{class:"s-conditional-offer-message",innerHTML:r}):null)),s?this.renderGiftsToggle("inline"):null),s&&this.isGiftsOpen?this.renderGiftsCard():null,s?this.renderGiftsToggle("bar"):null)}get hostEl(){return o(this)}};B.style='/*!twlt*/:host{display:block}.s-conditional-offer-root{background-color:rgba(0, 137, 123, 0.06);background-color:color-mix(in srgb, var(--color-primary, #00897b) 7%, transparent)}.s-conditional-offer-badges::-webkit-scrollbar{height:3px}.s-conditional-offer-badges::-webkit-scrollbar-thumb{border-radius:9999px;background-color:rgba(0, 0, 0, 0.15)}.s-conditional-offer-badges::-webkit-scrollbar-track{background-color:transparent}.s-conditional-offer-tooltip{--s-conditional-offer-tooltip-shift:0px;--s-conditional-offer-tooltip-caret:0px;transform:translateX(calc(-50% + var(--s-conditional-offer-tooltip-shift)))}.s-conditional-offer-tooltip::before{content:"";position:absolute;bottom:100%;left:50%;transform:translateX(calc(-50% + var(--s-conditional-offer-tooltip-caret)));border:8px solid transparent;border-bottom-color:#fff}.s-conditional-offer-tier-icon-met,.s-conditional-offer-tier-icon-unmet{color:var(--color-primary-dark, #00695c);background-color:rgba(0, 137, 123, 0.12);background-color:color-mix(in srgb, var(--color-primary, #00897b) 14%, transparent)}.s-conditional-offer-tier:not(:last-child)::before{content:"";position:absolute;top:2.5rem;bottom:-1rem;inset-inline-start:1.125rem;width:1px;background-color:#d1d5db}.visible{visibility:visible}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.w-6{width:1.5rem}.resize{resize:both}.gap-1{gap:0.25rem}.rounded{border-radius:var(--s-radius, 0.25rem)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-conditional-offer-root{margin-bottom:1.25rem;display:block;width:100%;min-width:0px;max-width:100%;border-radius:0.375rem;padding:0.75rem}@media (min-width: 768px){.s-conditional-offer-root{padding:1rem}}.s-conditional-offer-banner{display:flex;width:100%;min-width:0px;align-items:center;justify-content:space-between;gap:0.75rem}@media (min-width: 768px){.s-conditional-offer-banner{gap:1rem}}.s-conditional-offer-lead{display:flex;min-width:0px;flex:1 1 0%;align-items:center;gap:0.5rem}@media (min-width: 768px){.s-conditional-offer-lead{gap:0.75rem}}.s-conditional-offer-badges{display:flex;max-width:45%;flex-shrink:0;flex-wrap:nowrap;align-items:center;gap:0.25rem;overflow-x:auto;overscroll-behavior-x:contain;scroll-behavior:smooth;scrollbar-width:thin}.s-conditional-offer-badge{display:inline-flex;height:1.5rem;width:1.5rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;font-size:11px;line-height:1;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-conditional-offer-badge-met{background-color:var(--color-primary)}.s-conditional-offer-badge-unmet{--tw-bg-opacity:1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.s-conditional-offer-badge-link{width:0.5rem;flex-shrink:0;border-top-width:1px}.s-conditional-offer-badge-link-met{border-color:var(--color-primary)}.s-conditional-offer-badge-link-unmet{border-style:dashed;--tw-border-opacity:1;border-color:rgb(82 82 82 / var(--tw-border-opacity, 1))}.s-conditional-offer-badge-icon{height:0.75rem;width:0.75rem;flex-shrink:0}.s-conditional-offer-text{display:flex;min-width:0px;flex-direction:column;gap:0.125rem;text-align:start}.s-conditional-offer-heading{display:flex;min-width:0px;align-items:center;gap:0.375rem}.s-conditional-offer-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.s-conditional-offer-info{position:relative;display:inline-flex;flex-shrink:0;align-items:center}.s-conditional-offer-info-trigger{display:inline-flex;height:1rem;width:1rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;--tw-text-opacity:1;color:rgb(115 115 115 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-conditional-offer-info-trigger:hover{color:var(--color-primary-dark)}.s-conditional-offer-info-icon{height:0.875rem;width:0.875rem;flex-shrink:0}.s-conditional-offer-message{font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary-dark)}@media (min-width: 768px){.s-conditional-offer-message{font-size:1rem;line-height:1.5rem}}.s-conditional-offer-toggle{align-items:center;justify-content:center;gap:0.375rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(38 38 38 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-conditional-offer-toggle:hover{color:var(--color-primary-dark)}.s-conditional-offer-toggle-inline{display:none;flex-shrink:0}@media (min-width: 768px){.s-conditional-offer-toggle-inline{display:inline-flex}}.s-conditional-offer-toggle-bar{margin-top:0.5rem;display:inline-flex;width:100%;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:0.75rem;padding-right:0.75rem;padding-top:0.625rem;padding-bottom:0.625rem}@media (min-width: 768px){.s-conditional-offer-toggle-bar{display:none}}.s-conditional-offer-toggle-icon{font-size:1rem;line-height:1.5rem;line-height:1;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-conditional-offer-toggle-icon-open{--tw-rotate:180deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-conditional-offer-panel{margin-top:0.75rem;width:100%;min-width:0px;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem}.s-conditional-offer-gifts-header{margin-bottom:0.75rem;display:flex;align-items:center;gap:0.5rem}.s-conditional-offer-gifts-icon{display:inline-flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-color:var(--color-primary);font-size:1rem;line-height:1.5rem;line-height:1;color:var(--color-primary)}.s-conditional-offer-gifts-title{font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary-dark)}.s-conditional-offer-gifts-list{margin:0px;display:flex;list-style-type:none;flex-direction:column;gap:0.5rem;padding:0px}.s-conditional-offer-gift{display:flex;align-items:center;gap:0.75rem;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding:0.5rem}.s-conditional-offer-gift-thumb{display:inline-flex;height:3.5rem;width:3.5rem;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));font-size:1.25rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-conditional-offer-gift-image{height:100%;width:100%;object-fit:contain}.s-conditional-offer-gift-body{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.125rem;text-align:start}.s-conditional-offer-gift-name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(38 38 38 / var(--tw-text-opacity, 1))}.s-conditional-offer-gift-prices{display:flex;align-items:center;gap:0.5rem;font-size:0.75rem;line-height:1rem}.s-conditional-offer-gift-free{font-weight:700;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-conditional-offer-gift-price{--tw-text-opacity:1;color:rgb(115 115 115 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-conditional-offer-tooltip{position:absolute;top:calc(100% + 0.75rem);left:50%;z-index:10;width:min(22rem, calc(100vw - 2rem));border-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1rem;text-align:start;--tw-shadow:5px 10px 30px #2B2D340D;--tw-shadow-colored:5px 10px 30px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-conditional-offer-tooltip-title{font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary-dark)}.s-conditional-offer-tooltip-description{margin-top:0.25rem;font-size:0.75rem;line-height:1rem;line-height:1.625;--tw-text-opacity:1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.s-conditional-offer-tooltip-list{margin:0px;margin-top:0.75rem;display:flex;list-style-type:none;flex-direction:column;gap:1rem;padding:0px}.s-conditional-offer-tier{position:relative;display:flex;align-items:flex-start;gap:0.75rem}.s-conditional-offer-tier-icon{position:relative;display:inline-flex;height:2.25rem;width:2.25rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;font-size:1rem;line-height:1.5rem;line-height:1}.s-conditional-offer-tier-icon-unmet{color:var(--color-primary-dark)}.s-conditional-offer-tier-status{position:absolute;bottom:-0.125rem;display:inline-flex;height:1rem;width:1rem;align-items:center;justify-content:center;border-radius:9999px;border-width:2px;--tw-border-opacity:1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));inset-inline-start:-2px}.s-conditional-offer-tier-status-met{color:var(--color-primary-dark)}.s-conditional-offer-tier-status-unmet{--tw-text-opacity:1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.s-conditional-offer-tier-status-check{height:0.75rem;width:0.75rem;flex-shrink:0}.s-conditional-offer-tier-status-lock{height:0.625rem;width:0.625rem;flex-shrink:0}.s-conditional-offer-tier-body{display:flex;min-width:0px;flex-direction:column;gap:0.125rem}.s-conditional-offer-tier-title{font-size:0.75rem;line-height:1rem;font-weight:700;color:var(--color-primary-dark)}.s-conditional-offer-tier-text{font-size:0.75rem;line-height:1rem;line-height:1.625;--tw-text-opacity:1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.s-conditional-offer-tier-text-met{text-decoration-line:line-through}.s-conditional-offer-skeleton-text{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.375rem}';export{B as salla_conditional_offer}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as a,h as s,H as o,a as t}from"./p-DGIIhW8W.js";const n=class{constructor(s){a(this,s)}async mount(a){this.host.before(a)}render(){return s(o,{key:"0daa39b46095b55c70c4689c5f7b5bf43b8cbbd8"})}async componentDidLoad(){await Salla.hooks.registerComponent("salla-hook",this)}get host(){return t(this)}};n.style=":host {\n all: unset;\n display: none; /* marker only */\n }";export{n as salla_hook}
4
+ import{r as a,h as s,H as o,a as t}from"./p-Ca7ApeqJ.js";const n=class{constructor(s){a(this,s)}async mount(a){this.host.before(a)}render(){return s(o,{key:"0daa39b46095b55c70c4689c5f7b5bf43b8cbbd8"})}async componentDidLoad(){await Salla.hooks.registerComponent("salla-hook",this)}get host(){return t(this)}};n.style=":host {\n all: unset;\n display: none; /* marker only */\n }";export{n as salla_hook}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,c as t,h as i}from"./p-DGIIhW8W.js";import{C as s}from"./p-C6jIkM-X.js";import{F as r}from"./p-OF8QcbMM.js";const o=class{constructor(i){e(this,i),this.fieldChanged=t(this,"fieldChanged"),this.fileUploaded=t(this,"fileUploaded"),this.isEditable=!0,this.fieldErrors={},this.isSubmitting=!1}get dragAndDropText(){return salla.lang.get("common.uploader.drag_and_drop")}get browseText(){return salla.lang.get("common.uploader.browse")}get saveButtonText(){return salla.lang.get("common.elements.save")}async setFields(e){this.parsedFields=e}async getFieldValues(){return this.parsedFields?.reduce(((e,t)=>(e[`custom_fields[${t.id}]`]=t.value,e)),{})||{}}async validateFields(){if(!this.parsedFields)return!0;const e=this.parsedFields.reduce(((e,t)=>(!t.required||t.value&&""!==t.value||(e[t.id.toString()]=`${t.label} is required`),e)),{});return this.fieldErrors=e,0===Object.keys(e).length}handleFieldChange(e,t){const i=t.target.value;e.value=i,this.clearFieldError(e.id);const s=!(e.required&&!i);s||this.setFieldError(e.id,`${e.label} is required`),this.fieldChanged.emit({fieldId:e.id,value:i,isValid:s})}handleFileUpload(e,t){const{error:i,file:s}=t.detail,r=!i;this.clearFieldError(e.id),r?e.value=s:this.setFieldError(e.id,"File upload failed"),this.fileUploaded.emit({fieldId:e.id,file:s,isValid:r})}clearFieldError(e){this.fieldErrors={...this.fieldErrors},delete this.fieldErrors[e]}setFieldError(e,t){this.fieldErrors={...this.fieldErrors,[e]:t}}renderTextField(e){return i("input",{disabled:!this.isEditable,type:e.type,id:`custom-field-${e.id}`,value:e.value?.toString()||"",onChange:t=>this.handleFieldChange(e,t),name:`${e.id}`,class:"form-input",required:e.required})}renderFileField(e){return i("salla-file-upload",{url:salla.url.api("upload"),id:`custom-field-${e.id}`,name:`${e.id}`,type:"registration",value:e.value,height:"120px",onAdded:t=>this.handleFileUpload(e,t),required:e.required,disabled:!this.isEditable,onUploaded:e=>{e.target.value=e.target.value?.url},allowRemove:!0,onRemoved:t=>{t.preventDefault(),t.stopPropagation(),e.value="",t.target.value=""},payloadName:"files[]",payloadParams:{type:"registration"},"instant-upload":!0},i("div",{class:"s-custom-fields-filepond-placeholder"},i("span",{class:"s-custom-fields-filepond-placeholder-icon"},i("i",{innerHTML:s})),i("p",{class:"s-custom-fields-filepond-placeholder-text"},this.dragAndDropText),i("span",{class:"filepond--label-action"},this.browseText)))}renderField(e){return i("div",{class:"s-custom-fields-field",key:e.id},i("label",{class:"s-custom-fields-field-label",htmlFor:`custom-field-${e.id}`},e.label,!!e.required&&i("span",{class:"s-custom-fields-required"},"*")),i("div",null,e.type===r.Photo?this.renderFileField(e):this.renderTextField(e),this.fieldErrors[e.id]&&i("p",{class:"s-custom-fields-error"},this.fieldErrors[e.id])))}componentWillLoad(){this.parsedFields=this.parseFields(this.fields)}parseFields(e){return e?"string"==typeof e?JSON.parse(e):Array.isArray(e)?e:[]:[]}async handleSubmit(e){e.preventDefault(),this.isSubmitting=!0;try{const t={},i=e.target.elements;for(let e=0;e<i.length;e++){const s=i[e];s.name&&!s.name.startsWith("hidden")&&s.value&&(t[s.name]=s.value)}await salla.api.profile.updateCustomFields({id:salla.config.get("store.id"),fields:t})}finally{this.isSubmitting=!1}}render(){return this.parsedFields?.length?i("form",{class:"s-custom-fields-wrapper",onSubmit:this.handleSubmit},this.parsedFields.map((e=>this.renderField(e))),i("salla-button",{type:"submit",loading:this.isSubmitting,disabled:this.isSubmitting||!this.isEditable,"loader-position":"end",class:"s-custom-fields-submit-btn"},this.saveButtonText)):null}};o.style="/*!twlt*/:host{display:block}.hidden{display:none}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.s-custom-fields-wrapper{display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));gap:1.5rem}@media (min-width: 640px){.s-custom-fields-wrapper{grid-template-columns:repeat(2, minmax(0, 1fr));gap:2rem}}.s-custom-fields-required{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-custom-fields-submit-btn{grid-column:1 / -1;width:100%}.s-custom-fields-field-error{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-custom-fields-field-label{margin-bottom:0.5rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-custom-fields-skeleton-wrapper{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));grid-template-rows:repeat(3, minmax(0, 1fr));gap:3rem}.s-custom-fields-filepond-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-custom-fields-filepond-placeholder-icon{margin-bottom:0.25rem}.s-custom-fields-filepond-placeholder-icon svg{height:1.5rem;width:1.5rem;fill:#7c8082}";export{o as salla_custom_fields}
4
+ import{r as e,c as t,h as i}from"./p-Ca7ApeqJ.js";import{C as s}from"./p-C6jIkM-X.js";import{F as r}from"./p-OF8QcbMM.js";const o=class{constructor(i){e(this,i),this.fieldChanged=t(this,"fieldChanged"),this.fileUploaded=t(this,"fileUploaded"),this.isEditable=!0,this.fieldErrors={},this.isSubmitting=!1}get dragAndDropText(){return salla.lang.get("common.uploader.drag_and_drop")}get browseText(){return salla.lang.get("common.uploader.browse")}get saveButtonText(){return salla.lang.get("common.elements.save")}async setFields(e){this.parsedFields=e}async getFieldValues(){return this.parsedFields?.reduce(((e,t)=>(e[`custom_fields[${t.id}]`]=t.value,e)),{})||{}}async validateFields(){if(!this.parsedFields)return!0;const e=this.parsedFields.reduce(((e,t)=>(!t.required||t.value&&""!==t.value||(e[t.id.toString()]=`${t.label} is required`),e)),{});return this.fieldErrors=e,0===Object.keys(e).length}handleFieldChange(e,t){const i=t.target.value;e.value=i,this.clearFieldError(e.id);const s=!(e.required&&!i);s||this.setFieldError(e.id,`${e.label} is required`),this.fieldChanged.emit({fieldId:e.id,value:i,isValid:s})}handleFileUpload(e,t){const{error:i,file:s}=t.detail,r=!i;this.clearFieldError(e.id),r?e.value=s:this.setFieldError(e.id,"File upload failed"),this.fileUploaded.emit({fieldId:e.id,file:s,isValid:r})}clearFieldError(e){this.fieldErrors={...this.fieldErrors},delete this.fieldErrors[e]}setFieldError(e,t){this.fieldErrors={...this.fieldErrors,[e]:t}}renderTextField(e){return i("input",{disabled:!this.isEditable,type:e.type,id:`custom-field-${e.id}`,value:e.value?.toString()||"",onChange:t=>this.handleFieldChange(e,t),name:`${e.id}`,class:"form-input",required:e.required})}renderFileField(e){return i("salla-file-upload",{url:salla.url.api("upload"),id:`custom-field-${e.id}`,name:`${e.id}`,type:"registration",value:e.value,height:"120px",onAdded:t=>this.handleFileUpload(e,t),required:e.required,disabled:!this.isEditable,onUploaded:e=>{e.target.value=e.target.value?.url},allowRemove:!0,onRemoved:t=>{t.preventDefault(),t.stopPropagation(),e.value="",t.target.value=""},payloadName:"files[]",payloadParams:{type:"registration"},"instant-upload":!0},i("div",{class:"s-custom-fields-filepond-placeholder"},i("span",{class:"s-custom-fields-filepond-placeholder-icon"},i("i",{innerHTML:s})),i("p",{class:"s-custom-fields-filepond-placeholder-text"},this.dragAndDropText),i("span",{class:"filepond--label-action"},this.browseText)))}renderField(e){return i("div",{class:"s-custom-fields-field",key:e.id},i("label",{class:"s-custom-fields-field-label",htmlFor:`custom-field-${e.id}`},e.label,!!e.required&&i("span",{class:"s-custom-fields-required"},"*")),i("div",null,e.type===r.Photo?this.renderFileField(e):this.renderTextField(e),this.fieldErrors[e.id]&&i("p",{class:"s-custom-fields-error"},this.fieldErrors[e.id])))}componentWillLoad(){this.parsedFields=this.parseFields(this.fields)}parseFields(e){return e?"string"==typeof e?JSON.parse(e):Array.isArray(e)?e:[]:[]}async handleSubmit(e){e.preventDefault(),this.isSubmitting=!0;try{const t={},i=e.target.elements;for(let e=0;e<i.length;e++){const s=i[e];s.name&&!s.name.startsWith("hidden")&&s.value&&(t[s.name]=s.value)}await salla.api.profile.updateCustomFields({id:salla.config.get("store.id"),fields:t})}finally{this.isSubmitting=!1}}render(){return this.parsedFields?.length?i("form",{class:"s-custom-fields-wrapper",onSubmit:this.handleSubmit},this.parsedFields.map((e=>this.renderField(e))),i("salla-button",{type:"submit",loading:this.isSubmitting,disabled:this.isSubmitting||!this.isEditable,"loader-position":"end",class:"s-custom-fields-submit-btn"},this.saveButtonText)):null}};o.style="/*!twlt*/:host{display:block}.hidden{display:none}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.s-custom-fields-wrapper{display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));gap:1.5rem}@media (min-width: 640px){.s-custom-fields-wrapper{grid-template-columns:repeat(2, minmax(0, 1fr));gap:2rem}}.s-custom-fields-required{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-custom-fields-submit-btn{grid-column:1 / -1;width:100%}.s-custom-fields-field-error{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-custom-fields-field-label{margin-bottom:0.5rem;display:block;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-custom-fields-skeleton-wrapper{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));grid-template-rows:repeat(3, minmax(0, 1fr));gap:3rem}.s-custom-fields-filepond-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-custom-fields-filepond-placeholder-icon{margin-bottom:0.25rem}.s-custom-fields-filepond-placeholder-icon svg{height:1.5rem;width:1.5rem;fill:#7c8082}";export{o as salla_custom_fields}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as r,a as e}from"./p-DGIIhW8W.js";import{t as o}from"./p-CxrJQ3Jf.js";var i,a;!function(t){t.ProductDetail="product.single",t.Cart="cart"}(i||(i={})),function(t){t.Conditional="conditional",t.PercentageOrFixed="fixed",t.DiscountsTable="discounts_table",t.Bank="bank",t.BuyXGetY="buy_x_get_y",t.SpecialPrice="special_price",t.Percentage="percentage",t.FixedAmount="fixed_amount"}(a||(a={}));const s=class{constructor(r){t(this,r),this.productCardComponent="salla-product-card",this.offersList=[],this.canRender=!1,this.showOffer=salla.config.get("store.settings.product.show_special_offers"),this.showAllOffersModal=!1,this.showProductsModal=!1,this.selectedOfferProducts=[],this.collapsedOffers={},this.expandedCategories={},this.productsLoaded=!1,this.offer_with_price_text=salla.lang.get("pages.offer.with_price",{price:""}),this.with_discount_text=salla.lang.get("pages.products.with_a_discount"),this.product_discount_text=salla.lang.get("pages.products.discount"),this.special_offer_text=salla.lang.get("pages.products.special_offer"),this.buy_quantity_text=t=>salla.lang.get("pages.offer.buy_quantity",{quantity:t}),this.products_link_text=salla.lang.get("pages.offer.included_products","المنتجات المشمولة"),this.min_spend_text=t=>o("pages.offer.min_spend_amount",{amount:t,currency:""},`بحد أدنى ${t} من مبلغ الشراء`),this.min_items_text=t=>o("pages.offer.min_items",{items:t},`بحد أدنى ${t} منتجات`),this.max_discount_text=t=>o("pages.offer.max_discount_amount",{amount:t,currency:""},`بحد أقصى ${t} للخصم`),this.branches_text=o("pages.offer.available_branches",{},"الفروع المتاحة"),this.buy_from_text=o("pages.offer.buy_from_categories",{},"اشترِ من:"),this.get_from_text=o("pages.offer.get_from_categories",{},"احصل من:"),this.payment_methods_text=o("pages.offer.payment_methods",{},"طرق الدفع"),this.product_text=salla.lang.get("common.elements.product","منتج"),salla.onReady((()=>{this.currentPage=salla.config.get("page.slug");const t=salla.config.get("currencies")||{},r=salla.config.get("user.currency_code");this.userCurrency=t[r]||{symbol:"",code:r||"SAR",name:""}}))}connectedCallback(){this.langUnsubscribe=salla.lang.subscribe((()=>{this.offer_with_price_text=salla.lang.get("pages.offer.with_price"),this.with_discount_text=salla.lang.get("pages.products.with_a_discount"),this.product_discount_text=salla.lang.get("pages.products.discount"),this.special_offer_text=salla.lang.get("pages.products.special_offer"),this.buy_quantity_text(0),this.products_link_text=salla.lang.get("pages.offer.included_products","المنتجات المشمولة"),this.min_spend_text=t=>o("pages.offer.min_spend_amount",{amount:t,currency:""},`بحد أدنى ${t} من مبلغ الشراء`),this.min_items_text=t=>o("pages.offer.min_items",{items:t},`بحد أدنى ${t} منتجات`),this.max_discount_text=t=>o("pages.offer.max_discount_amount",{amount:t,currency:""},`بحد أقصى ${t} للخصم`),this.branches_text=o("pages.offer.available_branches",{},"الفروع المتاحة"),this.buy_from_text=o("pages.offer.buy_from_categories",{},"اشترِ من:"),this.get_from_text=o("pages.offer.get_from_categories",{},"احصل من:"),this.payment_methods_text=o("pages.offer.payment_methods",{},"طرق الدفع"),this.product_text=salla.lang.get("common.elements.product","منتج")}))}disconnectedCallback(){this.langUnsubscribe?.()}async getEndpointByPageName(){return this.currentPage==i.Cart?`offers/cart/${await Salla.cart.getCurrentCartId()}`:this.currentPage==i.ProductDetail?`offers/product/${salla.config.get("page.id")}`:"offers"}emitPromotionViewed(){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;const t=this.offersList.slice(0,5).map(((t,r)=>({id:t.id,name:t.title,creative:t.description||"",position:r+1})));salla.event.emit("salla::offer.promotion.viewed",t)}emitPromotionClicked(t,r=1){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;const e=t||this.offersList[0];salla.event.emit("salla::offer.promotion.clicked",[{id:e.id,name:e.title,creative:e.description||"",position:r}])}componentWillLoad(){return this.hasCustomComponent=!!customElements.get(this.productCardComponent),new Promise((t=>salla.onReady(t))).then((()=>{if(this.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers"),!this.showOffer)throw new Error("Merchant disabled showing the offers on product page")})).then((async()=>this.currentPage==i.Cart?salla.api.cart.offers():salla.api.request(await this.getEndpointByPageName()))).then((async t=>{if(!(this.offersList=t.data).length)throw new Error("salla-offers:: There is no offers!");if(this.offersList=this.offersList.filter((t=>[a.SpecialPrice,a.Bank,a.BuyXGetY,a.DiscountsTable,a.PercentageOrFixed,a.Percentage,a.FixedAmount].includes(t.type))),!this.offersList.length)throw new Error("salla-offers:: No supported offer types found!");let r=null;this.offersList.some((t=>{const r=t.details;return"category"===r.apply_to&&r.targets||"categories"===r.apply_to&&r.targets||t.type===a.BuyXGetY&&("categories"===r.get?.source||"category"===r.get?.source||"categories"===r.buy?.source||"category"===r.buy?.source)}))&&(r=(await salla.product.api.categories()).data);const e=new Set;for(const t of this.offersList){const r=t.details;"product"!==r.apply_to&&"products"!==r.apply_to||!r.targets||r.targets.forEach((t=>e.add(t))),t.type===a.BuyXGetY&&"products"===r.get?.source&&r.get?.source_value&&r.get.source_value.forEach((t=>e.add(t))),t.type!==a.BuyXGetY||"products"!==r.buy?.source&&"product"!==r.buy?.source||!r.buy?.source_value||r.buy.source_value.forEach((t=>e.add(t)))}let o={};if(e.size>0)try{const t=await salla.product.api.fetch({source:"selected",source_value:Array.from(e)});o=Object.fromEntries(t.data.map((t=>[t.id,t])))}catch(t){o={}}for(const t of this.offersList){const e=t.details;if(("category"===e.apply_to&&e.targets||"categories"===e.apply_to&&e.targets)&&r&&(e.categories=this.findCategories(r,e.targets)),"product"!==e.apply_to&&"products"!==e.apply_to||!e.targets||(e.products=e.targets.map((t=>o[t])).filter(Boolean)),"brand"===e.apply_to&&e.targets&&(e.brands=e.targets),"tag"===e.apply_to&&e.targets&&(e.tags=e.targets),t.type===a.BuyXGetY&&e.get){const t=e.get;"products"===t.source&&t.source_value?t.products=t.source_value.map((t=>o[t])).filter(Boolean):("categories"===t.source||"category"===t.source)&&r&&t.source_value&&(t.categories=this.findCategories(r,t.source_value),e.categories=t.categories)}if(t.type===a.BuyXGetY&&e.buy){const t=e.buy;"products"!==t.source&&"product"!==t.source||!t.source_value?("categories"===t.source||"category"===t.source)&&r&&t.source_value&&(t.categories=this.findCategories(r,t.source_value)):t.products=t.source_value.map((t=>o[t])).filter(Boolean)}}return this.offersList})).then((()=>{this.canRender=!0})).catch((t=>{salla.logger.warn(t)}))}componentDidLoad(){let t=this.host.querySelector(".s-slider-block__title-nav");t?.classList.add("s-offer-bank-payment-nav"),this.emitPromotionViewed()}findCategories(t,r){let e=[];for(const o of t)r.includes(o.id_||o.id)&&e.push(o),o.sub_categories?.length>0&&(e=e.concat(this.findCategories(o.sub_categories,r)));return e}render(){if(!this.offersList.length||!this.canRender||!this.showOffer)return null;const t=salla.lang.get("pages.offer.offers_title","عروض المنتج"),e=salla.lang.get("pages.offer.offers_subtitle","احصل على المنتج بسعر مخفض مع أفضل العروض");return[r("div",{class:"s-offer-wrapper"},r("salla-slider",{type:"carousel",id:"offers-slider","block-title":t,"block-subTitle":e,"show-controls":this.offersList.length>1},r("div",{slot:"items"},this.offersList.slice(0,5).map(((t,r)=>this.renderOfferCard(t,r+1))),this.offersList.length>5&&this.renderShowMoreCard()))),this.renderAllOffersModal(),this.renderProductsModal()]}renderShowMoreCard(){return r("div",{class:"s-offer-slide-one-fourth swiper-slide",onClick:t=>{t.preventDefault(),t.stopPropagation(),this.openAllOffersModal()}},r("div",{class:"s-offer-card s-offer-show-more-card"},r("i",{class:"sicon-add s-offer-show-more-icon"}),r("h3",{class:"s-offer-show-more-title"},salla.lang.get("pages.offer.show_more_offers","عرض المزيد من العروض"))))}openAllOffersModal(){this.showAllOffersModal=!0}closeAllOffersModal(){this.showAllOffersModal=!1}closeProductsModal(){this.showProductsModal=!1,this.selectedOfferProducts=[],this.productsLoaded=!1}handleAccordionToggle(t,r){this.collapsedOffers={...this.collapsedOffers,[t]:r}}getOfferProducts(t){const r=t.details;return r.products&&r.products.length>0?r.products:t.type===a.BuyXGetY&&r.get?.products?r.get.products:[]}renderCardDescriptionRow(t,e=!1){const o=e&&t.type===a.DiscountsTable?this.renderProductsLinkForModalCard(t,!1):null;return t.description||o?r("div",{class:"s-offer-card-description-row"},t.description&&r("p",{class:"s-offer-card-description"},t.description),o):null}renderProductsLinkForModalCard(t,e){const o=this.getOfferProducts(t);return o&&0!==o.length?r("div",{class:"s-offer-products-link",onClick:t=>{t.stopPropagation(),this.selectedOfferProducts=o,this.showProductsModal=!0}},r("span",{class:"s-offer-products-link-text"},this.products_link_text),e&&r("i",{class:"sicon-keyboard_arrow_down s-offer-products-link-icon"})):null}renderAllOffersModal(){return r("salla-drawer",{visible:this.showAllOffersModal,position:"right",width:"md","no-padding":!0,"drawer-title":salla.lang.get("pages.offer.all_offers_title","جميع العروض"),onDrawerVisibilityChanged:t=>!t.detail&&this.closeAllOffersModal()},r("div",{class:"s-offer-drawer-content"},this.offersList.map(((t,r)=>this.renderModalOfferCard(t,r+1)))))}renderProductsModal(){return r("salla-drawer",{visible:this.showProductsModal,width:"md",position:"right","no-padding":!0,"drawer-title":this.products_link_text,onDrawerVisibilityChanged:t=>!t.detail&&this.closeProductsModal()},r("div",{class:"s-offer-products-drawer-content"},this.selectedOfferProducts?.length>0?r("div",null,!this.productsLoaded&&r("div",{class:"flex items-center justify-center p-8"},r("salla-loading",{size:"24"})),r("salla-products-list",{source:"selected","source-value":JSON.stringify(this.selectedOfferProducts.map((t=>t.id))),"product-card-component":this.productCardComponent,"horizontal-cards":!0,"compact-cards":!0,includes:["images"],onProductsFetched:()=>this.productsLoaded=!0})):r("div",{class:"p-4 text-center text-gray-500"},salla.lang.get("blocks.products.no_products_found","لا توجد منتجات"))))}renderModalOfferCard(t,e=1){const o=this.getOfferProducts(t),i=o&&o.length>0,s=!1!==this.collapsedOffers[t.id];return r("div",{class:"s-offer-drawer-card"},r("div",{class:"s-offer-card-main",onClick:()=>this.emitPromotionClicked(t,e)},r("div",{class:"s-offer-card-icon"},this.getOfferIcon(t.type)),r("div",{class:"s-offer-card-content"},r("h3",{class:"s-offer-card-title",title:t.title},t.title),this.renderCardDescriptionRow(t),r("div",{class:"s-offer-card-details"},t.type===a.DiscountsTable?this.renderDiscountTableOfferContent(t):t.type===a.PercentageOrFixed||t.type===a.Percentage||t.type===a.FixedAmount?this.renderPercentageOrFixedOfferContent(t):this.renderMinSpend(t),this.renderOfferCategories(t),this.renderOfferBrands(t),this.renderOfferTags(t),this.renderOfferPaymentMethods(t),this.renderOfferBranches(t)))),i&&r("salla-accordion",{collapsed:s,collapsible:!0,size:"sm",onClick:t=>t.stopPropagation(),onAccordionToggle:r=>this.handleAccordionToggle(t.id,r.detail.payload.collapsed)},r("salla-accordion-head",{collapsible:!0,collapsed:s},r("div",{slot:"title",class:"s-offer-products-thumbnails"},r("span",{class:"s-offer-products-title"},this.products_link_text,r("i",{class:`sicon-keyboard_arrow_${s?"down":"up"} s-offer-products-link-icon`})),r("div",{class:"s-offer-products-thumbnails-stack"},o.slice(0,3).map(((t,e)=>r("div",{class:"s-offer-product-thumbnail",style:{zIndex:`${e+1}`}},r("img",{src:t.thumbnail||t.image?.url||salla.url.cdn("images/s-empty.png"),alt:t.name})))),o.length>3&&r("div",{class:"s-offer-products-more-count",style:{zIndex:"7"}},"+",o.length-3)))),r("salla-accordion-body",null,r("div",{class:"s-offer-products-content"},r("salla-products-list",{source:"selected","source-value":JSON.stringify(o.map((t=>t.id))),"product-card-component":this.productCardComponent,"horizontal-cards":!0,"compact-cards":!0,includes:["images"]})))))}renderOfferCard(t,e=1){return r("div",{class:"s-offer-slide-one-fourth swiper-slide",onClick:()=>this.emitPromotionClicked(t,e)},r("div",{class:"s-offer-card"},r("div",{class:"s-offer-card-icon"},this.getOfferIcon(t.type)),r("div",{class:"s-offer-card-content"},r("h3",{class:"s-offer-card-title",title:t.title},t.title),this.renderCardDescriptionRow(t,!0),r("div",{class:"s-offer-card-details"},t.type===a.DiscountsTable?[this.renderDiscountTableOfferContent(t),this.renderOfferCategories(t),this.renderOfferBrands(t),this.renderOfferTags(t),this.renderOfferPaymentMethods(t),this.renderOfferBranches(t)]:t.type===a.PercentageOrFixed||t.type===a.Percentage||t.type===a.FixedAmount?[this.renderPercentageOrFixedOfferContent(t),this.renderOfferCategories(t),this.renderOfferBrands(t),this.renderOfferTags(t),this.renderOfferPaymentMethods(t),this.renderOfferBranches(t)]:[this.renderMinSpend(t),this.renderOfferCategories(t),this.renderOfferBrands(t),this.renderOfferTags(t),this.renderOfferPaymentMethods(t),this.renderOfferBranches(t)],t.type!==a.DiscountsTable&&this.renderProductsLinkForModalCard(t,!1)))))}getOfferIcon(t){return r("i",{class:{[a.DiscountsTable]:"sicon-discount-calculator",[a.Bank]:"sicon-bank",[a.SpecialPrice]:"sicon-fire",[a.BuyXGetY]:"sicon-gift",[a.PercentageOrFixed]:"sicon-special-discount",[a.Percentage]:"sicon-special-discount",[a.FixedAmount]:"sicon-special-discount"}[t]||"sicon-discount"})}renderDiscountTableOfferContent(t){const e=t.details.discounts||[];return e.length?r("div",null,!t.description&&r("div",{class:"s-offer-card-description"},salla.lang.get("pages.offer.discount_table_subtitle","وفِّر أكثر بشراء منتجات أكثر")),r("table",{class:"s-offer-discount-table"},r("tbody",null,this.groupDiscountsByRows(e,3).map(((t,e)=>r("tr",{key:e},t.map(((t,e)=>r("td",{key:e},r("div",{class:"s-offer-discount-percentage"},t.percentage,"%"),r("div",{class:"s-offer-discount-condition"},this.formatDiscountCondition(t))))))))))):null}renderMinSpend(t){const e=t.details;return e.min_spend>0?r("div",{class:"s-offer-min-spend",innerHTML:this.min_spend_text(this.money(e.min_spend))}):null}renderPercentageOrFixedOfferContent(t){const e=t.details;return e.discount_value||e.min_spend>0||e.min_items>0||e.max_discount_amount>0?r("div",{class:"s-offer-percentage-fixed-content"},e.min_spend>0&&r("div",{class:"s-offer-min-spend",innerHTML:this.min_spend_text(this.money(e.min_spend))}),e.min_items>0&&r("div",{class:"s-offer-min-items"},this.min_items_text(e.min_items)),e.max_discount_amount>0&&r("div",{class:"s-offer-max-discount",innerHTML:this.max_discount_text(this.money(e.max_discount_amount))})):null}groupDiscountsByRows(t,r){const e=[];for(let o=0;o<t.length;o+=r)e.push(t.slice(o,o+r));return e}money(t){return"function"==typeof salla?.money?salla.money(t):`${t} ${this.userCurrency?.symbol||""}`}formatDiscountCondition(t){return`${t.quantity??1} ${this.product_text}`}renderCategoryGroup(t,e,o){return r("div",{class:"s-offer-categories-group"},r("span",{class:"s-offer-categories-label"},o),r("div",{class:"s-offer-categories-list"},e.map(((e,o)=>r("a",{key:`${t.id}-${o}`,class:"s-offer-category-item",href:e.url||salla.url.create("categories",e.id||e.id_)},e.name)))))}renderOfferCategories(t){const e=t.details;let o=e.categories||[];if(t.type===a.BuyXGetY&&e.get?.categories&&(o=e.get.categories),t.type===a.BuyXGetY){const o=e.buy?.categories||[],i=e.get?.categories||[],a=t=>t.map((t=>t.id||t.id_)).join(",");if(o.length&&i.length&&a(o)!==a(i))return r("div",{class:"s-offer-categories"},this.renderCategoryGroup(t,o,this.buy_from_text),this.renderCategoryGroup(t,i,this.get_from_text))}if(!o.length)return null;const i=this.expandedCategories[t.id],s=o.length>3,n=i?o:o.slice(0,3);return r("div",{class:"s-offer-categories"},r("div",{class:"s-offer-categories-list"},n.map(((t,e)=>r("a",{key:e,class:"s-offer-category-item",href:t.url||salla.url.create("categories",t.id||t.id_)},t.name))),s&&r("span",{class:"s-offer-categories-toggle",onClick:r=>{r.preventDefault(),r.stopPropagation(),this.toggleCategoryExpansion(t.id)}},i?r("span",null,r("i",{class:"sicon-keyboard_arrow_up"})," ",salla.lang.get("common.elements.hide","إخفاء")):r("span",null,salla.lang.get("common.elements.show","عرض")," ","+"+(o.length-3)," ",r("i",{class:"sicon-keyboard_arrow_down"})))))}renderOfferBrands(t){const e=t.details.brands||[];if(!e.length)return null;const o=this.expandedCategories[t.id],i=e.length>3,a=o?e:e.slice(0,3);return r("div",{class:"s-offer-categories"},r("div",{class:"s-offer-categories-list"},a.map(((t,e)=>r("a",{key:e,class:"s-offer-category-item",href:t.url},t.name))),i&&r("span",{class:"s-offer-categories-toggle",onClick:r=>{r.preventDefault(),r.stopPropagation(),this.toggleCategoryExpansion(t.id)}},o?r("span",null,r("i",{class:"sicon-keyboard_arrow_up"})," ",salla.lang.get("common.elements.hide","إخفاء")):r("span",null,salla.lang.get("common.elements.show","عرض")," ","+"+(e.length-3)," ",r("i",{class:"sicon-keyboard_arrow_down"})))))}renderOfferPaymentMethods(t){const e=t.details.payment_methods||[];return e.length?r("div",{class:"s-offer-payment-methods"},r("span",{class:"s-offer-payment-methods-label"},this.payment_methods_text),r("div",{class:"s-offer-payment-methods-list"},e.map(((t,e)=>r("span",{key:e,class:"s-offer-payment-method-item"},t.name))))):null}renderOfferBranches(t){const e=t.details.branches||[];return e.length?r("div",{class:"s-offer-branches"},r("span",{class:"s-offer-branches-label"},this.branches_text),r("div",{class:"s-offer-branches-list"},e.map(((t,e)=>r("span",{key:e,class:"s-offer-branch-item"},t.name))))):null}renderOfferTags(t){const e=t.details.tags||[];if(!e.length)return null;const o=this.expandedCategories[t.id],i=e.length>3,a=o?e:e.slice(0,3);return r("div",{class:"s-offer-categories"},r("div",{class:"s-offer-categories-list"},a.map(((t,e)=>r("a",{key:e,class:"s-offer-category-item",href:t.url||salla.url.create("tags",t.id)},t.name))),i&&r("span",{class:"s-offer-categories-toggle",onClick:r=>{r.preventDefault(),r.stopPropagation(),this.toggleCategoryExpansion(t.id)}},o?r("span",null,r("i",{class:"sicon-keyboard_arrow_up"})," ",salla.lang.get("common.elements.hide","إخفاء")):r("span",null,salla.lang.get("common.elements.show","عرض")," ","+"+(e.length-3)," ",r("i",{class:"sicon-keyboard_arrow_down"})))))}toggleCategoryExpansion(t){this.expandedCategories={...this.expandedCategories,[t]:!this.expandedCategories[t]}}get host(){return e(this)}};s.style='/*!twlt*/:host .s-drawer-close:where([dir=rtl],[dir=rtl] *){left:0}.visible{visibility:visible}.fixed{position:fixed}.block{display:block}.flex{display:flex}.table{display:table}.grid{display:grid}.items-center{align-items:center}.justify-center{justify-content:center}.p-4{padding:1rem}.p-8{padding:2rem}.text-center{text-align:center}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-offer-wrapper{position:relative;margin-bottom:2rem;overflow:hidden;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1));padding:0.625rem}@media (min-width: 640px){.s-offer-wrapper{padding:1.25rem}}@media (min-width: 768px){.s-offer-wrapper{margin-bottom:4rem}}.s-offer-corner-badge{position:absolute;z-index:1;float:left;margin:0px;height:auto;width:auto;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-width:0px;--tw-bg-opacity:1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1));padding-left:3rem;padding-right:3rem;padding-top:0.25rem;padding-bottom:0.25rem;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-offer-corner-badge:where([dir="ltr"],[dir="ltr"] *){top:1.25rem;right:-3.5rem;--tw-rotate:45deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-offer-corner-badge:where([dir="rtl"],[dir="rtl"] *){top:0.75rem;left:-3rem;--tw-rotate:-45deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-offer-slide-one-sixth{width:50% !important}@media (min-width: 640px){.s-offer-slide-one-sixth{width:33.333333% !important}}@media (min-width: 768px){.s-offer-slide-one-sixth{width:25% !important}}@media (min-width: 1024px){.s-offer-slide-one-sixth{width:16.666667% !important}}.s-offer-slide-one-sixth-single{display:flex;align-items:center !important;gap:0.75rem}.s-offer-slide-cat-entry{display:flex;height:9rem;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-offer-slide-cat-entry:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:5px 10px 30px #2B2D340D;--tw-shadow-colored:5px 10px 30px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-slide-cat-entry i{margin-bottom:1rem;display:inline-block;font-size:33px;color:var(--color-primary)}.s-offer-slide-cat-entry h4{font-size:0.875rem;line-height:1.25rem;font-weight:700}.s-offer-slide-one-fourth{height:auto;width:auto;max-width:310px}.s-offer-slide-offer-entry{display:flex;height:9rem;flex-direction:column;align-items:center;justify-content:space-between;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));text-align:center;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-offer-slide-offer-entry:hover{--tw-shadow:5px 10px 30px #2B2D340D;--tw-shadow-colored:5px 10px 30px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-slide-offer-entry-price-quantity-container{display:flex;width:100%;flex-grow:1;flex-direction:column;justify-content:center;padding:0.75rem}.s-offer-slide-offer-entry-quantity{margin-bottom:0.25rem}.s-offer-slide-offer-entry-price{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-offer-slide-offer-entry-price-amount{font-size:1.875rem;line-height:2.25rem;font-weight:800;--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-offer-slide-offer-entry-price-amount-percent{width:100%;border-top-width:1px;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding:0.5rem;font-size:0.875rem;line-height:1.25rem}.s-offer-slide-offer-entry-price-amount-percent span{font-weight:700}.s-offer-discount-list{margin-top:1.25rem}.s-offer-discount-list>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.625rem * var(--tw-space-y-reverse))}.s-offer-discount-list-item{display:flex;justify-content:space-between;border-top-width:1px;padding-top:0.625rem}.s-offer-discount-list-item-money{font-weight:700;--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-offer-discount-list-item-discount{font-size:0.875rem;line-height:1.25rem}.s-offer-discount-list-item-discount span{font-weight:700}.s-offer-bank-wrapper{position:relative;display:flex;min-height:144px;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:0.5rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem}.s-offer-bank-wrapper:hover{--tw-shadow:5px 10px 30px #2B2D340D;--tw-shadow-colored:5px 10px 30px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-bank-wrapper-multi-spacer{margin-top:1.25rem}.s-offer-bank-wrapper-sinlge-item{display:flex;align-items:center;gap:0.75rem}.s-offer-bank-logo{margin-bottom:0.25rem;display:flex;height:5rem;width:5rem;align-items:center;border-radius:var(--s-radius, 0.25rem)}.s-offer-bank-logo img{height:100%;max-height:100%;width:100%;object-fit:contain}.s-offer-bank-payment-wrapper{display:flex;min-width:84px;flex-wrap:nowrap;align-items:center;justify-content:center;gap:0.25rem}.s-offer-bank-payment-single{display:flex;height:1.5rem;width:2rem;align-items:center;justify-content:center;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-offer-bank-payment-single img{max-height:100%;max-width:100%;object-fit:contain}.s-offer-bank-payment-discount-percent{position:absolute;top:-1rem;left:auto;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1));padding-left:0.5rem;padding-right:0.5rem;padding-top:0.25rem;padding-bottom:0.25rem;font-size:11px;font-weight:600;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));--tw-shadow:0 1px 2px rgba(0,0,0,0.35);--tw-shadow-colored:0 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-bank-message{width:100%}.s-offer-bank-message h2{max-width:92%;font-size:1rem;line-height:1.5rem;font-weight:500;--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-offer-bank-message p{max-width:95%;font-size:0.875rem;line-height:1.25rem;font-weight:400;line-height:1.5;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-offer-bank-message-amount{font-weight:700;--tw-text-opacity:1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.s-offer-bank-payment-nav{margin-left:3.5rem !important;margin-right:3.5rem !important}.s-offer-.s-slider-block__title{position:relative;margin-bottom:1.25rem}.s-offer-.s-slider-block__title::before{position:absolute;top:1rem;font-size:3rem;font-weight:400;line-height:1;--tw-text-opacity:1;color:rgb(254 242 242 / var(--tw-text-opacity, 1));--tw-content:\'ee30\';content:var(--tw-content)}.s-offer-.s-slider-block__title:where([dir="ltr"],[dir="ltr"] *)::before{content:var(--tw-content);left:0px}.s-offer-.s-slider-block__title:where([dir="rtl"],[dir="rtl"] *)::before{content:var(--tw-content);right:0px}.s-offer-.s-offer-wrapper .s-slider-block__title h2{z-index:0;font-size:1.125rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-offer-.s-offer-wrapper .s-slider-block__title p{margin-top:0.25rem;overflow:visible;display:block;-webkit-box-orient:horizontal;-webkit-line-clamp:none;line-height:1.5rem}.s-offer-wrapper .s-slider-block__title::before{content:\\ee30;font-family:sallaicons;position:absolute;top:1rem;font-size:3rem;font-weight:400;line-height:1;z-index:-1;color:rgba(254, 242, 242, 1)}.s-offer-bank-wrapper-single-item{display:flex;align-items:center;gap:0.875rem}.s-offer-slides-container{display:flex;gap:1rem}.s-offer-card{margin-left:auto;margin-right:auto;display:flex;height:100%;min-height:138px;max-width:28rem;gap:0.75rem;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1.5rem;padding-right:1.5rem;padding-top:1.25rem;padding-bottom:1.25rem}.s-offer-card-icon{display:flex;height:3rem;width:3rem;flex-shrink:0;align-items:center;justify-content:center;align-self:flex-start;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));font-size:1.5rem;line-height:2rem}.s-offer-card-content{min-width:0px;flex:1 1 0%;text-align:right}.s-offer-card-title{margin-bottom:0.25rem;width:100%;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.875rem;line-height:1.25rem;font-weight:600;line-height:1.25;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-offer-card-description{font-size:0.875rem;line-height:1.25rem;line-height:1.625;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-offer-card-description-row{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:0.75rem;row-gap:0.25rem}.s-offer-card-details{display:flex;width:100%;flex-direction:column}.s-offer-shared-content{display:flex;flex-direction:column;align-items:center;text-align:center}.s-offer-drawer-card{overflow:hidden;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1.5rem;padding-bottom:1.5rem}.s-offer-drawer-card:last-child{border-bottom-width:0px}.s-offer-drawer-card .s-offer-card-main{display:flex;align-items:center;gap:1rem;padding:0px}.s-offer-drawer-card .s-offer-card-icon{display:flex;height:3rem;width:3rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));font-size:1.25rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-offer-drawer-card .s-offer-card-content{min-width:0px;flex:1 1 0%;text-align:right}.s-offer-drawer-card .s-offer-card-title{margin-bottom:0.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-offer-drawer-card .s-offer-card-description{font-size:0.875rem;line-height:1.25rem;line-height:1.625;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-offer-drawer-card .s-accordion-wrapper{margin:0px}.s-offer-drawer-card .s-accordion-head-wrapper{margin-right:60px;width:100%;max-width:370px;cursor:pointer;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-bottom:0.75rem;padding-right:0px;padding-top:0px}.s-offer-drawer-card .s-accordion-head-wrapper-end{display:none !important}.s-offer-drawer-card .s-accordion-body-wrapper{max-height:1000px;overflow:auto;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-bottom:0px}.s-offer-drawer-card .s-accordion-body-wrapper::-webkit-scrollbar{width:5px}.s-offer-drawer-card .s-accordion-body-wrapper::-webkit-scrollbar-track{background-color:#eee}.s-offer-drawer-card .s-accordion-body-wrapper::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-offer-drawer-card .s-accordion-body-wrapper-content{overflow:visible}.s-offer-products-thumbnails{display:flex;width:100%;align-items:center;justify-content:space-between}.s-offer-products-thumbnails-stack{position:relative;display:flex;align-items:center}.s-offer-product-thumbnail{position:relative;z-index:10;margin-left:-0.5rem;height:2rem;width:2rem;overflow:hidden;border-radius:0.375rem;border-width:2px;--tw-border-opacity:1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-offer-product-thumbnail:first-child{margin-left:0px}.s-offer-product-thumbnail img{height:100%;width:100%;object-fit:cover}.s-offer-products-more-count{position:relative;z-index:50;margin-left:-0.5rem;display:flex;height:2rem;width:2rem;align-items:center;justify-content:center;border-radius:0.375rem;border-width:2px;--tw-border-opacity:1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:11px;font-weight:400;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));direction:ltr}.s-offer-products-title{display:flex;align-items:center;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-offer-products-accordion-content{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding:0.75rem}.s-offer-products-link{display:flex;cursor:pointer;align-items:center;justify-content:space-between;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-offer-products-link:hover{--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-offer-products-link-text{font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1));text-decoration-line:underline}.s-offer-products-link-icon{font-size:15px;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1));transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-offer-products-link:hover .s-offer-products-link-icon{--tw-translate-x:-0.25rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-offer-drawer-padding{padding:0px !important}.s-offer-drawer-content{max-height:calc(100vh - 120px);overflow-y:auto !important;padding-left:1rem;padding-right:1rem}.s-offer-drawer-content::-webkit-scrollbar{width:5px}.s-offer-drawer-content::-webkit-scrollbar-track{background-color:#eee}.s-offer-drawer-content::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-offer-products-drawer-content{max-height:calc(100vh - 120px);overflow-y:auto !important;padding-left:1.5rem;padding-right:1.5rem}.s-offer-products-drawer-content::-webkit-scrollbar{width:5px}.s-offer-products-drawer-content::-webkit-scrollbar-track{background-color:#eee}.s-offer-products-drawer-content::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-offer-products-list-single-column .s-products-list-wrapper{display:grid !important;grid-template-columns:repeat(1, minmax(0, 1fr)) !important;gap:0.75rem}.s-offer-products-list-single-column salla-product-card[horizontal] img{height:60px !important;max-height:60px !important;width:60px !important;max-width:60px !important;object-fit:cover !important}.s-offer-products-list-single-column salla-product-card[horizontal] button{--tw-bg-opacity:1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1));--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-offer-products-list-single-column salla-product-card[horizontal] button:hover{--tw-bg-opacity:1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.s-offer-discount-table{width:100%;border-collapse:collapse}.s-offer-discount-table tr:not(:last-child){border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-offer-discount-table td{padding:0.75rem;text-align:right}.s-offer-discount-table td:first-child{padding-right:0px}.s-offer-discount-percentage{font-size:0.75rem;line-height:1rem;font-weight:700;line-height:1.25}.s-offer-discount-condition{margin-top:0.25rem;font-size:10px;line-height:1.25;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-offer-categories{margin-top:0.75rem;text-align:right}.s-offer-categories-group{margin-top:0.25rem;display:flex;flex-wrap:wrap;align-items:baseline;column-gap:0.5rem}.s-offer-categories-label{flex-shrink:0;font-size:13px;font-weight:700;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-offer-categories-list{display:flex;flex-wrap:wrap;column-gap:1rem;font-size:13px;line-height:1.625}.s-offer-categories-list a{text-decoration-line:underline}.s-offer-category-item{display:inline-block;cursor:pointer;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-offer-category-item:hover{--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-offer-categories-toggle{cursor:pointer;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-offer-categories-toggle:hover{--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-offer-min-spend{margin-top:0.625rem;font-size:13px;line-height:17px;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-offer-percentage-fixed-content{display:flex;flex-direction:column}.s-offer-min-items{font-size:13px;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-offer-discount-table-subtitle{margin-bottom:0.75rem;font-size:0.875rem;line-height:1.25rem;line-height:1.625;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-offer-show-more-card{pointer-events:auto;display:flex;cursor:pointer;align-items:center;justify-content:center;gap:0.25rem;text-align:center}.s-offer-show-more-icon{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-offer-show-more-title{font-size:0.875rem;line-height:1.25rem;font-weight:600;line-height:1.25;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-offer-drawer-card .s-products-list-compact-cards{margin-bottom:0px !important}.s-offer-max-discount{font-size:13px;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-offer-branches{margin-top:0.75rem;text-align:right}.s-offer-branches-label{margin-bottom:0.25rem;display:block;font-size:13px;font-weight:700;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-offer-branches-list{display:flex;flex-wrap:wrap;column-gap:1rem;font-size:13px;line-height:1.625}.s-offer-branch-item{display:inline-block;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-offer-payment-methods{margin-top:0.75rem;text-align:right}.s-offer-payment-methods-label{margin-bottom:0.25rem;display:block;font-size:13px;font-weight:700;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-offer-payment-methods-list{display:flex;flex-wrap:wrap;column-gap:1rem;font-size:13px;line-height:1.625}.s-offer-payment-method-item{display:inline-block;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-offer-discount-amount{font-size:12px;line-height:15px;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-offer-modal-cat-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-offer-modal-cat-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-brand-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-offer-modal-brand-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-tag-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-offer-modal-tag-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-product.swiper-slide{display:flex;width:70%;flex-shrink:0;flex-grow:1;flex-direction:column}@media (min-width: 640px){.s-offer-modal-product.swiper-slide{width:40%}}@media (min-width: 1024px){.s-offer-modal-product.swiper-slide{width:28%}}';export{s as salla_offer}
4
+ import{r as t,h as r,a as e}from"./p-Ca7ApeqJ.js";import{t as o}from"./p-CxrJQ3Jf.js";var i,a;!function(t){t.ProductDetail="product.single",t.Cart="cart"}(i||(i={})),function(t){t.Conditional="conditional",t.PercentageOrFixed="fixed",t.DiscountsTable="discounts_table",t.Bank="bank",t.BuyXGetY="buy_x_get_y",t.SpecialPrice="special_price",t.Percentage="percentage",t.FixedAmount="fixed_amount"}(a||(a={}));const s=class{constructor(r){t(this,r),this.productCardComponent="salla-product-card",this.offersList=[],this.canRender=!1,this.showOffer=salla.config.get("store.settings.product.show_special_offers"),this.showAllOffersModal=!1,this.showProductsModal=!1,this.selectedOfferProducts=[],this.collapsedOffers={},this.expandedCategories={},this.productsLoaded=!1,this.offer_with_price_text=salla.lang.get("pages.offer.with_price",{price:""}),this.with_discount_text=salla.lang.get("pages.products.with_a_discount"),this.product_discount_text=salla.lang.get("pages.products.discount"),this.special_offer_text=salla.lang.get("pages.products.special_offer"),this.buy_quantity_text=t=>salla.lang.get("pages.offer.buy_quantity",{quantity:t}),this.products_link_text=salla.lang.get("pages.offer.included_products","المنتجات المشمولة"),this.min_spend_text=t=>o("pages.offer.min_spend_amount",{amount:t,currency:""},`بحد أدنى ${t} من مبلغ الشراء`),this.min_items_text=t=>o("pages.offer.min_items",{items:t},`بحد أدنى ${t} منتجات`),this.max_discount_text=t=>o("pages.offer.max_discount_amount",{amount:t,currency:""},`بحد أقصى ${t} للخصم`),this.branches_text=o("pages.offer.available_branches",{},"الفروع المتاحة"),this.buy_from_text=o("pages.offer.buy_from_categories",{},"اشترِ من:"),this.get_from_text=o("pages.offer.get_from_categories",{},"احصل من:"),this.payment_methods_text=o("pages.offer.payment_methods",{},"طرق الدفع"),this.product_text=salla.lang.get("common.elements.product","منتج"),salla.onReady((()=>{this.currentPage=salla.config.get("page.slug");const t=salla.config.get("currencies")||{},r=salla.config.get("user.currency_code");this.userCurrency=t[r]||{symbol:"",code:r||"SAR",name:""}}))}connectedCallback(){this.langUnsubscribe=salla.lang.subscribe((()=>{this.offer_with_price_text=salla.lang.get("pages.offer.with_price"),this.with_discount_text=salla.lang.get("pages.products.with_a_discount"),this.product_discount_text=salla.lang.get("pages.products.discount"),this.special_offer_text=salla.lang.get("pages.products.special_offer"),this.buy_quantity_text(0),this.products_link_text=salla.lang.get("pages.offer.included_products","المنتجات المشمولة"),this.min_spend_text=t=>o("pages.offer.min_spend_amount",{amount:t,currency:""},`بحد أدنى ${t} من مبلغ الشراء`),this.min_items_text=t=>o("pages.offer.min_items",{items:t},`بحد أدنى ${t} منتجات`),this.max_discount_text=t=>o("pages.offer.max_discount_amount",{amount:t,currency:""},`بحد أقصى ${t} للخصم`),this.branches_text=o("pages.offer.available_branches",{},"الفروع المتاحة"),this.buy_from_text=o("pages.offer.buy_from_categories",{},"اشترِ من:"),this.get_from_text=o("pages.offer.get_from_categories",{},"احصل من:"),this.payment_methods_text=o("pages.offer.payment_methods",{},"طرق الدفع"),this.product_text=salla.lang.get("common.elements.product","منتج")}))}disconnectedCallback(){this.langUnsubscribe?.()}async getEndpointByPageName(){return this.currentPage==i.Cart?`offers/cart/${await Salla.cart.getCurrentCartId()}`:this.currentPage==i.ProductDetail?`offers/product/${salla.config.get("page.id")}`:"offers"}emitPromotionViewed(){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;const t=this.offersList.slice(0,5).map(((t,r)=>({id:t.id,name:t.title,creative:t.description||"",position:r+1})));salla.event.emit("salla::offer.promotion.viewed",t)}emitPromotionClicked(t,r=1){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;const e=t||this.offersList[0];salla.event.emit("salla::offer.promotion.clicked",[{id:e.id,name:e.title,creative:e.description||"",position:r}])}componentWillLoad(){return this.hasCustomComponent=!!customElements.get(this.productCardComponent),new Promise((t=>salla.onReady(t))).then((()=>{if(this.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers"),!this.showOffer)throw new Error("Merchant disabled showing the offers on product page")})).then((async()=>this.currentPage==i.Cart?salla.api.cart.offers():salla.api.request(await this.getEndpointByPageName()))).then((async t=>{if(!(this.offersList=t.data).length)throw new Error("salla-offers:: There is no offers!");if(this.offersList=this.offersList.filter((t=>[a.SpecialPrice,a.Bank,a.BuyXGetY,a.DiscountsTable,a.PercentageOrFixed,a.Percentage,a.FixedAmount].includes(t.type))),!this.offersList.length)throw new Error("salla-offers:: No supported offer types found!");let r=null;this.offersList.some((t=>{const r=t.details;return"category"===r.apply_to&&r.targets||"categories"===r.apply_to&&r.targets||t.type===a.BuyXGetY&&("categories"===r.get?.source||"category"===r.get?.source||"categories"===r.buy?.source||"category"===r.buy?.source)}))&&(r=(await salla.product.api.categories()).data);const e=new Set;for(const t of this.offersList){const r=t.details;"product"!==r.apply_to&&"products"!==r.apply_to||!r.targets||r.targets.forEach((t=>e.add(t))),t.type===a.BuyXGetY&&"products"===r.get?.source&&r.get?.source_value&&r.get.source_value.forEach((t=>e.add(t))),t.type!==a.BuyXGetY||"products"!==r.buy?.source&&"product"!==r.buy?.source||!r.buy?.source_value||r.buy.source_value.forEach((t=>e.add(t)))}let o={};if(e.size>0)try{const t=await salla.product.api.fetch({source:"selected",source_value:Array.from(e)});o=Object.fromEntries(t.data.map((t=>[t.id,t])))}catch(t){o={}}for(const t of this.offersList){const e=t.details;if(("category"===e.apply_to&&e.targets||"categories"===e.apply_to&&e.targets)&&r&&(e.categories=this.findCategories(r,e.targets)),"product"!==e.apply_to&&"products"!==e.apply_to||!e.targets||(e.products=e.targets.map((t=>o[t])).filter(Boolean)),"brand"===e.apply_to&&e.targets&&(e.brands=e.targets),"tag"===e.apply_to&&e.targets&&(e.tags=e.targets),t.type===a.BuyXGetY&&e.get){const t=e.get;"products"===t.source&&t.source_value?t.products=t.source_value.map((t=>o[t])).filter(Boolean):("categories"===t.source||"category"===t.source)&&r&&t.source_value&&(t.categories=this.findCategories(r,t.source_value),e.categories=t.categories)}if(t.type===a.BuyXGetY&&e.buy){const t=e.buy;"products"!==t.source&&"product"!==t.source||!t.source_value?("categories"===t.source||"category"===t.source)&&r&&t.source_value&&(t.categories=this.findCategories(r,t.source_value)):t.products=t.source_value.map((t=>o[t])).filter(Boolean)}}return this.offersList})).then((()=>{this.canRender=!0})).catch((t=>{salla.logger.warn(t)}))}componentDidLoad(){let t=this.host.querySelector(".s-slider-block__title-nav");t?.classList.add("s-offer-bank-payment-nav"),this.emitPromotionViewed()}findCategories(t,r){let e=[];for(const o of t)r.includes(o.id_||o.id)&&e.push(o),o.sub_categories?.length>0&&(e=e.concat(this.findCategories(o.sub_categories,r)));return e}render(){if(!this.offersList.length||!this.canRender||!this.showOffer)return null;const t=salla.lang.get("pages.offer.offers_title","عروض المنتج"),e=salla.lang.get("pages.offer.offers_subtitle","احصل على المنتج بسعر مخفض مع أفضل العروض");return[r("div",{class:"s-offer-wrapper"},r("salla-slider",{type:"carousel",id:"offers-slider","block-title":t,"block-subTitle":e,"show-controls":this.offersList.length>1},r("div",{slot:"items"},this.offersList.slice(0,5).map(((t,r)=>this.renderOfferCard(t,r+1))),this.offersList.length>5&&this.renderShowMoreCard()))),this.renderAllOffersModal(),this.renderProductsModal()]}renderShowMoreCard(){return r("div",{class:"s-offer-slide-one-fourth swiper-slide",onClick:t=>{t.preventDefault(),t.stopPropagation(),this.openAllOffersModal()}},r("div",{class:"s-offer-card s-offer-show-more-card"},r("i",{class:"sicon-add s-offer-show-more-icon"}),r("h3",{class:"s-offer-show-more-title"},salla.lang.get("pages.offer.show_more_offers","عرض المزيد من العروض"))))}openAllOffersModal(){this.showAllOffersModal=!0}closeAllOffersModal(){this.showAllOffersModal=!1}closeProductsModal(){this.showProductsModal=!1,this.selectedOfferProducts=[],this.productsLoaded=!1}handleAccordionToggle(t,r){this.collapsedOffers={...this.collapsedOffers,[t]:r}}getOfferProducts(t){const r=t.details;return r.products&&r.products.length>0?r.products:t.type===a.BuyXGetY&&r.get?.products?r.get.products:[]}renderCardDescriptionRow(t,e=!1){const o=e&&t.type===a.DiscountsTable?this.renderProductsLinkForModalCard(t,!1):null;return t.description||o?r("div",{class:"s-offer-card-description-row"},t.description&&r("p",{class:"s-offer-card-description"},t.description),o):null}renderProductsLinkForModalCard(t,e){const o=this.getOfferProducts(t);return o&&0!==o.length?r("div",{class:"s-offer-products-link",onClick:t=>{t.stopPropagation(),this.selectedOfferProducts=o,this.showProductsModal=!0}},r("span",{class:"s-offer-products-link-text"},this.products_link_text),e&&r("i",{class:"sicon-keyboard_arrow_down s-offer-products-link-icon"})):null}renderAllOffersModal(){return r("salla-drawer",{visible:this.showAllOffersModal,position:"right",width:"md","no-padding":!0,"drawer-title":salla.lang.get("pages.offer.all_offers_title","جميع العروض"),onDrawerVisibilityChanged:t=>!t.detail&&this.closeAllOffersModal()},r("div",{class:"s-offer-drawer-content"},this.offersList.map(((t,r)=>this.renderModalOfferCard(t,r+1)))))}renderProductsModal(){return r("salla-drawer",{visible:this.showProductsModal,width:"md",position:"right","no-padding":!0,"drawer-title":this.products_link_text,onDrawerVisibilityChanged:t=>!t.detail&&this.closeProductsModal()},r("div",{class:"s-offer-products-drawer-content"},this.selectedOfferProducts?.length>0?r("div",null,!this.productsLoaded&&r("div",{class:"flex items-center justify-center p-8"},r("salla-loading",{size:"24"})),r("salla-products-list",{source:"selected","source-value":JSON.stringify(this.selectedOfferProducts.map((t=>t.id))),"product-card-component":this.productCardComponent,"horizontal-cards":!0,"compact-cards":!0,includes:["images"],onProductsFetched:()=>this.productsLoaded=!0})):r("div",{class:"p-4 text-center text-gray-500"},salla.lang.get("blocks.products.no_products_found","لا توجد منتجات"))))}renderModalOfferCard(t,e=1){const o=this.getOfferProducts(t),i=o&&o.length>0,s=!1!==this.collapsedOffers[t.id];return r("div",{class:"s-offer-drawer-card"},r("div",{class:"s-offer-card-main",onClick:()=>this.emitPromotionClicked(t,e)},r("div",{class:"s-offer-card-icon"},this.getOfferIcon(t.type)),r("div",{class:"s-offer-card-content"},r("h3",{class:"s-offer-card-title",title:t.title},t.title),this.renderCardDescriptionRow(t),r("div",{class:"s-offer-card-details"},t.type===a.DiscountsTable?this.renderDiscountTableOfferContent(t):t.type===a.PercentageOrFixed||t.type===a.Percentage||t.type===a.FixedAmount?this.renderPercentageOrFixedOfferContent(t):this.renderMinSpend(t),this.renderOfferCategories(t),this.renderOfferBrands(t),this.renderOfferTags(t),this.renderOfferPaymentMethods(t),this.renderOfferBranches(t)))),i&&r("salla-accordion",{collapsed:s,collapsible:!0,size:"sm",onClick:t=>t.stopPropagation(),onAccordionToggle:r=>this.handleAccordionToggle(t.id,r.detail.payload.collapsed)},r("salla-accordion-head",{collapsible:!0,collapsed:s},r("div",{slot:"title",class:"s-offer-products-thumbnails"},r("span",{class:"s-offer-products-title"},this.products_link_text,r("i",{class:`sicon-keyboard_arrow_${s?"down":"up"} s-offer-products-link-icon`})),r("div",{class:"s-offer-products-thumbnails-stack"},o.slice(0,3).map(((t,e)=>r("div",{class:"s-offer-product-thumbnail",style:{zIndex:`${e+1}`}},r("img",{src:t.thumbnail||t.image?.url||salla.url.cdn("images/s-empty.png"),alt:t.name})))),o.length>3&&r("div",{class:"s-offer-products-more-count",style:{zIndex:"7"}},"+",o.length-3)))),r("salla-accordion-body",null,r("div",{class:"s-offer-products-content"},r("salla-products-list",{source:"selected","source-value":JSON.stringify(o.map((t=>t.id))),"product-card-component":this.productCardComponent,"horizontal-cards":!0,"compact-cards":!0,includes:["images"]})))))}renderOfferCard(t,e=1){return r("div",{class:"s-offer-slide-one-fourth swiper-slide",onClick:()=>this.emitPromotionClicked(t,e)},r("div",{class:"s-offer-card"},r("div",{class:"s-offer-card-icon"},this.getOfferIcon(t.type)),r("div",{class:"s-offer-card-content"},r("h3",{class:"s-offer-card-title",title:t.title},t.title),this.renderCardDescriptionRow(t,!0),r("div",{class:"s-offer-card-details"},t.type===a.DiscountsTable?[this.renderDiscountTableOfferContent(t),this.renderOfferCategories(t),this.renderOfferBrands(t),this.renderOfferTags(t),this.renderOfferPaymentMethods(t),this.renderOfferBranches(t)]:t.type===a.PercentageOrFixed||t.type===a.Percentage||t.type===a.FixedAmount?[this.renderPercentageOrFixedOfferContent(t),this.renderOfferCategories(t),this.renderOfferBrands(t),this.renderOfferTags(t),this.renderOfferPaymentMethods(t),this.renderOfferBranches(t)]:[this.renderMinSpend(t),this.renderOfferCategories(t),this.renderOfferBrands(t),this.renderOfferTags(t),this.renderOfferPaymentMethods(t),this.renderOfferBranches(t)],t.type!==a.DiscountsTable&&this.renderProductsLinkForModalCard(t,!1)))))}getOfferIcon(t){return r("i",{class:{[a.DiscountsTable]:"sicon-discount-calculator",[a.Bank]:"sicon-bank",[a.SpecialPrice]:"sicon-fire",[a.BuyXGetY]:"sicon-gift",[a.PercentageOrFixed]:"sicon-special-discount",[a.Percentage]:"sicon-special-discount",[a.FixedAmount]:"sicon-special-discount"}[t]||"sicon-discount"})}renderDiscountTableOfferContent(t){const e=t.details.discounts||[];return e.length?r("div",null,!t.description&&r("div",{class:"s-offer-card-description"},salla.lang.get("pages.offer.discount_table_subtitle","وفِّر أكثر بشراء منتجات أكثر")),r("table",{class:"s-offer-discount-table"},r("tbody",null,this.groupDiscountsByRows(e,3).map(((t,e)=>r("tr",{key:e},t.map(((t,e)=>r("td",{key:e},r("div",{class:"s-offer-discount-percentage"},t.percentage,"%"),r("div",{class:"s-offer-discount-condition"},this.formatDiscountCondition(t))))))))))):null}renderMinSpend(t){const e=t.details;return e.min_spend>0?r("div",{class:"s-offer-min-spend",innerHTML:this.min_spend_text(this.money(e.min_spend))}):null}renderPercentageOrFixedOfferContent(t){const e=t.details;return e.discount_value||e.min_spend>0||e.min_items>0||e.max_discount_amount>0?r("div",{class:"s-offer-percentage-fixed-content"},e.min_spend>0&&r("div",{class:"s-offer-min-spend",innerHTML:this.min_spend_text(this.money(e.min_spend))}),e.min_items>0&&r("div",{class:"s-offer-min-items"},this.min_items_text(e.min_items)),e.max_discount_amount>0&&r("div",{class:"s-offer-max-discount",innerHTML:this.max_discount_text(this.money(e.max_discount_amount))})):null}groupDiscountsByRows(t,r){const e=[];for(let o=0;o<t.length;o+=r)e.push(t.slice(o,o+r));return e}money(t){return"function"==typeof salla?.money?salla.money(t):`${t} ${this.userCurrency?.symbol||""}`}formatDiscountCondition(t){return`${t.quantity??1} ${this.product_text}`}renderCategoryGroup(t,e,o){return r("div",{class:"s-offer-categories-group"},r("span",{class:"s-offer-categories-label"},o),r("div",{class:"s-offer-categories-list"},e.map(((e,o)=>r("a",{key:`${t.id}-${o}`,class:"s-offer-category-item",href:e.url||salla.url.create("categories",e.id||e.id_)},e.name)))))}renderOfferCategories(t){const e=t.details;let o=e.categories||[];if(t.type===a.BuyXGetY&&e.get?.categories&&(o=e.get.categories),t.type===a.BuyXGetY){const o=e.buy?.categories||[],i=e.get?.categories||[],a=t=>t.map((t=>t.id||t.id_)).join(",");if(o.length&&i.length&&a(o)!==a(i))return r("div",{class:"s-offer-categories"},this.renderCategoryGroup(t,o,this.buy_from_text),this.renderCategoryGroup(t,i,this.get_from_text))}if(!o.length)return null;const i=this.expandedCategories[t.id],s=o.length>3,n=i?o:o.slice(0,3);return r("div",{class:"s-offer-categories"},r("div",{class:"s-offer-categories-list"},n.map(((t,e)=>r("a",{key:e,class:"s-offer-category-item",href:t.url||salla.url.create("categories",t.id||t.id_)},t.name))),s&&r("span",{class:"s-offer-categories-toggle",onClick:r=>{r.preventDefault(),r.stopPropagation(),this.toggleCategoryExpansion(t.id)}},i?r("span",null,r("i",{class:"sicon-keyboard_arrow_up"})," ",salla.lang.get("common.elements.hide","إخفاء")):r("span",null,salla.lang.get("common.elements.show","عرض")," ","+"+(o.length-3)," ",r("i",{class:"sicon-keyboard_arrow_down"})))))}renderOfferBrands(t){const e=t.details.brands||[];if(!e.length)return null;const o=this.expandedCategories[t.id],i=e.length>3,a=o?e:e.slice(0,3);return r("div",{class:"s-offer-categories"},r("div",{class:"s-offer-categories-list"},a.map(((t,e)=>r("a",{key:e,class:"s-offer-category-item",href:t.url},t.name))),i&&r("span",{class:"s-offer-categories-toggle",onClick:r=>{r.preventDefault(),r.stopPropagation(),this.toggleCategoryExpansion(t.id)}},o?r("span",null,r("i",{class:"sicon-keyboard_arrow_up"})," ",salla.lang.get("common.elements.hide","إخفاء")):r("span",null,salla.lang.get("common.elements.show","عرض")," ","+"+(e.length-3)," ",r("i",{class:"sicon-keyboard_arrow_down"})))))}renderOfferPaymentMethods(t){const e=t.details.payment_methods||[];return e.length?r("div",{class:"s-offer-payment-methods"},r("span",{class:"s-offer-payment-methods-label"},this.payment_methods_text),r("div",{class:"s-offer-payment-methods-list"},e.map(((t,e)=>r("span",{key:e,class:"s-offer-payment-method-item"},t.name))))):null}renderOfferBranches(t){const e=t.details.branches||[];return e.length?r("div",{class:"s-offer-branches"},r("span",{class:"s-offer-branches-label"},this.branches_text),r("div",{class:"s-offer-branches-list"},e.map(((t,e)=>r("span",{key:e,class:"s-offer-branch-item"},t.name))))):null}renderOfferTags(t){const e=t.details.tags||[];if(!e.length)return null;const o=this.expandedCategories[t.id],i=e.length>3,a=o?e:e.slice(0,3);return r("div",{class:"s-offer-categories"},r("div",{class:"s-offer-categories-list"},a.map(((t,e)=>r("a",{key:e,class:"s-offer-category-item",href:t.url||salla.url.create("tags",t.id)},t.name))),i&&r("span",{class:"s-offer-categories-toggle",onClick:r=>{r.preventDefault(),r.stopPropagation(),this.toggleCategoryExpansion(t.id)}},o?r("span",null,r("i",{class:"sicon-keyboard_arrow_up"})," ",salla.lang.get("common.elements.hide","إخفاء")):r("span",null,salla.lang.get("common.elements.show","عرض")," ","+"+(e.length-3)," ",r("i",{class:"sicon-keyboard_arrow_down"})))))}toggleCategoryExpansion(t){this.expandedCategories={...this.expandedCategories,[t]:!this.expandedCategories[t]}}get host(){return e(this)}};s.style='/*!twlt*/:host .s-drawer-close:where([dir=rtl],[dir=rtl] *){left:0}.visible{visibility:visible}.fixed{position:fixed}.block{display:block}.flex{display:flex}.table{display:table}.grid{display:grid}.items-center{align-items:center}.justify-center{justify-content:center}.p-4{padding:1rem}.p-8{padding:2rem}.text-center{text-align:center}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-offer-wrapper{position:relative;margin-bottom:2rem;overflow:hidden;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1));padding:0.625rem}@media (min-width: 640px){.s-offer-wrapper{padding:1.25rem}}@media (min-width: 768px){.s-offer-wrapper{margin-bottom:4rem}}.s-offer-corner-badge{position:absolute;z-index:1;float:left;margin:0px;height:auto;width:auto;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-width:0px;--tw-bg-opacity:1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1));padding-left:3rem;padding-right:3rem;padding-top:0.25rem;padding-bottom:0.25rem;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-offer-corner-badge:where([dir="ltr"],[dir="ltr"] *){top:1.25rem;right:-3.5rem;--tw-rotate:45deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-offer-corner-badge:where([dir="rtl"],[dir="rtl"] *){top:0.75rem;left:-3rem;--tw-rotate:-45deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-offer-slide-one-sixth{width:50% !important}@media (min-width: 640px){.s-offer-slide-one-sixth{width:33.333333% !important}}@media (min-width: 768px){.s-offer-slide-one-sixth{width:25% !important}}@media (min-width: 1024px){.s-offer-slide-one-sixth{width:16.666667% !important}}.s-offer-slide-one-sixth-single{display:flex;align-items:center !important;gap:0.75rem}.s-offer-slide-cat-entry{display:flex;height:9rem;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-offer-slide-cat-entry:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:5px 10px 30px #2B2D340D;--tw-shadow-colored:5px 10px 30px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-slide-cat-entry i{margin-bottom:1rem;display:inline-block;font-size:33px;color:var(--color-primary)}.s-offer-slide-cat-entry h4{font-size:0.875rem;line-height:1.25rem;font-weight:700}.s-offer-slide-one-fourth{height:auto;width:auto;max-width:310px}.s-offer-slide-offer-entry{display:flex;height:9rem;flex-direction:column;align-items:center;justify-content:space-between;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));text-align:center;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-offer-slide-offer-entry:hover{--tw-shadow:5px 10px 30px #2B2D340D;--tw-shadow-colored:5px 10px 30px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-slide-offer-entry-price-quantity-container{display:flex;width:100%;flex-grow:1;flex-direction:column;justify-content:center;padding:0.75rem}.s-offer-slide-offer-entry-quantity{margin-bottom:0.25rem}.s-offer-slide-offer-entry-price{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-offer-slide-offer-entry-price-amount{font-size:1.875rem;line-height:2.25rem;font-weight:800;--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-offer-slide-offer-entry-price-amount-percent{width:100%;border-top-width:1px;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding:0.5rem;font-size:0.875rem;line-height:1.25rem}.s-offer-slide-offer-entry-price-amount-percent span{font-weight:700}.s-offer-discount-list{margin-top:1.25rem}.s-offer-discount-list>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.625rem * var(--tw-space-y-reverse))}.s-offer-discount-list-item{display:flex;justify-content:space-between;border-top-width:1px;padding-top:0.625rem}.s-offer-discount-list-item-money{font-weight:700;--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-offer-discount-list-item-discount{font-size:0.875rem;line-height:1.25rem}.s-offer-discount-list-item-discount span{font-weight:700}.s-offer-bank-wrapper{position:relative;display:flex;min-height:144px;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:0.5rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem}.s-offer-bank-wrapper:hover{--tw-shadow:5px 10px 30px #2B2D340D;--tw-shadow-colored:5px 10px 30px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-bank-wrapper-multi-spacer{margin-top:1.25rem}.s-offer-bank-wrapper-sinlge-item{display:flex;align-items:center;gap:0.75rem}.s-offer-bank-logo{margin-bottom:0.25rem;display:flex;height:5rem;width:5rem;align-items:center;border-radius:var(--s-radius, 0.25rem)}.s-offer-bank-logo img{height:100%;max-height:100%;width:100%;object-fit:contain}.s-offer-bank-payment-wrapper{display:flex;min-width:84px;flex-wrap:nowrap;align-items:center;justify-content:center;gap:0.25rem}.s-offer-bank-payment-single{display:flex;height:1.5rem;width:2rem;align-items:center;justify-content:center;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-offer-bank-payment-single img{max-height:100%;max-width:100%;object-fit:contain}.s-offer-bank-payment-discount-percent{position:absolute;top:-1rem;left:auto;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1));padding-left:0.5rem;padding-right:0.5rem;padding-top:0.25rem;padding-bottom:0.25rem;font-size:11px;font-weight:600;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));--tw-shadow:0 1px 2px rgba(0,0,0,0.35);--tw-shadow-colored:0 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-bank-message{width:100%}.s-offer-bank-message h2{max-width:92%;font-size:1rem;line-height:1.5rem;font-weight:500;--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-offer-bank-message p{max-width:95%;font-size:0.875rem;line-height:1.25rem;font-weight:400;line-height:1.5;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-offer-bank-message-amount{font-weight:700;--tw-text-opacity:1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.s-offer-bank-payment-nav{margin-left:3.5rem !important;margin-right:3.5rem !important}.s-offer-.s-slider-block__title{position:relative;margin-bottom:1.25rem}.s-offer-.s-slider-block__title::before{position:absolute;top:1rem;font-size:3rem;font-weight:400;line-height:1;--tw-text-opacity:1;color:rgb(254 242 242 / var(--tw-text-opacity, 1));--tw-content:\'ee30\';content:var(--tw-content)}.s-offer-.s-slider-block__title:where([dir="ltr"],[dir="ltr"] *)::before{content:var(--tw-content);left:0px}.s-offer-.s-slider-block__title:where([dir="rtl"],[dir="rtl"] *)::before{content:var(--tw-content);right:0px}.s-offer-.s-offer-wrapper .s-slider-block__title h2{z-index:0;font-size:1.125rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-offer-.s-offer-wrapper .s-slider-block__title p{margin-top:0.25rem;overflow:visible;display:block;-webkit-box-orient:horizontal;-webkit-line-clamp:none;line-height:1.5rem}.s-offer-wrapper .s-slider-block__title::before{content:\\ee30;font-family:sallaicons;position:absolute;top:1rem;font-size:3rem;font-weight:400;line-height:1;z-index:-1;color:rgba(254, 242, 242, 1)}.s-offer-bank-wrapper-single-item{display:flex;align-items:center;gap:0.875rem}.s-offer-slides-container{display:flex;gap:1rem}.s-offer-card{margin-left:auto;margin-right:auto;display:flex;height:100%;min-height:138px;max-width:28rem;gap:0.75rem;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1.5rem;padding-right:1.5rem;padding-top:1.25rem;padding-bottom:1.25rem}.s-offer-card-icon{display:flex;height:3rem;width:3rem;flex-shrink:0;align-items:center;justify-content:center;align-self:flex-start;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));font-size:1.5rem;line-height:2rem}.s-offer-card-content{min-width:0px;flex:1 1 0%;text-align:right}.s-offer-card-title{margin-bottom:0.25rem;width:100%;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.875rem;line-height:1.25rem;font-weight:600;line-height:1.25;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-offer-card-description{font-size:0.875rem;line-height:1.25rem;line-height:1.625;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-offer-card-description-row{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:0.75rem;row-gap:0.25rem}.s-offer-card-details{display:flex;width:100%;flex-direction:column}.s-offer-shared-content{display:flex;flex-direction:column;align-items:center;text-align:center}.s-offer-drawer-card{overflow:hidden;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1.5rem;padding-bottom:1.5rem}.s-offer-drawer-card:last-child{border-bottom-width:0px}.s-offer-drawer-card .s-offer-card-main{display:flex;align-items:center;gap:1rem;padding:0px}.s-offer-drawer-card .s-offer-card-icon{display:flex;height:3rem;width:3rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));font-size:1.25rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-offer-drawer-card .s-offer-card-content{min-width:0px;flex:1 1 0%;text-align:right}.s-offer-drawer-card .s-offer-card-title{margin-bottom:0.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-offer-drawer-card .s-offer-card-description{font-size:0.875rem;line-height:1.25rem;line-height:1.625;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-offer-drawer-card .s-accordion-wrapper{margin:0px}.s-offer-drawer-card .s-accordion-head-wrapper{margin-right:60px;width:100%;max-width:370px;cursor:pointer;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-bottom:0.75rem;padding-right:0px;padding-top:0px}.s-offer-drawer-card .s-accordion-head-wrapper-end{display:none !important}.s-offer-drawer-card .s-accordion-body-wrapper{max-height:1000px;overflow:auto;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-bottom:0px}.s-offer-drawer-card .s-accordion-body-wrapper::-webkit-scrollbar{width:5px}.s-offer-drawer-card .s-accordion-body-wrapper::-webkit-scrollbar-track{background-color:#eee}.s-offer-drawer-card .s-accordion-body-wrapper::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-offer-drawer-card .s-accordion-body-wrapper-content{overflow:visible}.s-offer-products-thumbnails{display:flex;width:100%;align-items:center;justify-content:space-between}.s-offer-products-thumbnails-stack{position:relative;display:flex;align-items:center}.s-offer-product-thumbnail{position:relative;z-index:10;margin-left:-0.5rem;height:2rem;width:2rem;overflow:hidden;border-radius:0.375rem;border-width:2px;--tw-border-opacity:1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-offer-product-thumbnail:first-child{margin-left:0px}.s-offer-product-thumbnail img{height:100%;width:100%;object-fit:cover}.s-offer-products-more-count{position:relative;z-index:50;margin-left:-0.5rem;display:flex;height:2rem;width:2rem;align-items:center;justify-content:center;border-radius:0.375rem;border-width:2px;--tw-border-opacity:1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:11px;font-weight:400;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));direction:ltr}.s-offer-products-title{display:flex;align-items:center;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-offer-products-accordion-content{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding:0.75rem}.s-offer-products-link{display:flex;cursor:pointer;align-items:center;justify-content:space-between;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-offer-products-link:hover{--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-offer-products-link-text{font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1));text-decoration-line:underline}.s-offer-products-link-icon{font-size:15px;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1));transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-offer-products-link:hover .s-offer-products-link-icon{--tw-translate-x:-0.25rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-offer-drawer-padding{padding:0px !important}.s-offer-drawer-content{max-height:calc(100vh - 120px);overflow-y:auto !important;padding-left:1rem;padding-right:1rem}.s-offer-drawer-content::-webkit-scrollbar{width:5px}.s-offer-drawer-content::-webkit-scrollbar-track{background-color:#eee}.s-offer-drawer-content::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-offer-products-drawer-content{max-height:calc(100vh - 120px);overflow-y:auto !important;padding-left:1.5rem;padding-right:1.5rem}.s-offer-products-drawer-content::-webkit-scrollbar{width:5px}.s-offer-products-drawer-content::-webkit-scrollbar-track{background-color:#eee}.s-offer-products-drawer-content::-webkit-scrollbar-thumb{background-color:var(--color-primary);border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.s-offer-products-list-single-column .s-products-list-wrapper{display:grid !important;grid-template-columns:repeat(1, minmax(0, 1fr)) !important;gap:0.75rem}.s-offer-products-list-single-column salla-product-card[horizontal] img{height:60px !important;max-height:60px !important;width:60px !important;max-width:60px !important;object-fit:cover !important}.s-offer-products-list-single-column salla-product-card[horizontal] button{--tw-bg-opacity:1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1));--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-offer-products-list-single-column salla-product-card[horizontal] button:hover{--tw-bg-opacity:1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.s-offer-discount-table{width:100%;border-collapse:collapse}.s-offer-discount-table tr:not(:last-child){border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-offer-discount-table td{padding:0.75rem;text-align:right}.s-offer-discount-table td:first-child{padding-right:0px}.s-offer-discount-percentage{font-size:0.75rem;line-height:1rem;font-weight:700;line-height:1.25}.s-offer-discount-condition{margin-top:0.25rem;font-size:10px;line-height:1.25;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-offer-categories{margin-top:0.75rem;text-align:right}.s-offer-categories-group{margin-top:0.25rem;display:flex;flex-wrap:wrap;align-items:baseline;column-gap:0.5rem}.s-offer-categories-label{flex-shrink:0;font-size:13px;font-weight:700;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-offer-categories-list{display:flex;flex-wrap:wrap;column-gap:1rem;font-size:13px;line-height:1.625}.s-offer-categories-list a{text-decoration-line:underline}.s-offer-category-item{display:inline-block;cursor:pointer;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-offer-category-item:hover{--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-offer-categories-toggle{cursor:pointer;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-offer-categories-toggle:hover{--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-offer-min-spend{margin-top:0.625rem;font-size:13px;line-height:17px;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-offer-percentage-fixed-content{display:flex;flex-direction:column}.s-offer-min-items{font-size:13px;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-offer-discount-table-subtitle{margin-bottom:0.75rem;font-size:0.875rem;line-height:1.25rem;line-height:1.625;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-offer-show-more-card{pointer-events:auto;display:flex;cursor:pointer;align-items:center;justify-content:center;gap:0.25rem;text-align:center}.s-offer-show-more-icon{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-offer-show-more-title{font-size:0.875rem;line-height:1.25rem;font-weight:600;line-height:1.25;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-offer-drawer-card .s-products-list-compact-cards{margin-bottom:0px !important}.s-offer-max-discount{font-size:13px;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-offer-branches{margin-top:0.75rem;text-align:right}.s-offer-branches-label{margin-bottom:0.25rem;display:block;font-size:13px;font-weight:700;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-offer-branches-list{display:flex;flex-wrap:wrap;column-gap:1rem;font-size:13px;line-height:1.625}.s-offer-branch-item{display:inline-block;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-offer-payment-methods{margin-top:0.75rem;text-align:right}.s-offer-payment-methods-label{margin-bottom:0.25rem;display:block;font-size:13px;font-weight:700;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-offer-payment-methods-list{display:flex;flex-wrap:wrap;column-gap:1rem;font-size:13px;line-height:1.625}.s-offer-payment-method-item{display:inline-block;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-offer-discount-amount{font-size:12px;line-height:15px;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-offer-modal-cat-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-offer-modal-cat-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-brand-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-offer-modal-brand-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-tag-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-offer-modal-tag-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-product.swiper-slide{display:flex;width:70%;flex-shrink:0;flex-grow:1;flex-direction:column}@media (min-width: 640px){.s-offer-modal-product.swiper-slide{width:40%}}@media (min-width: 1024px){.s-offer-modal-product.swiper-slide{width:28%}}';export{s as salla_offer}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as e,H as i}from"./p-DGIIhW8W.js";const s=class{constructor(e){t(this,e),this.href=void 0,this.target="_self"}generateClass(){return{"s-list-tile-item":!0,"s-list-tile-item-href":!!this.href}}render(){return e(i,{key:"6fa6853330ca2663bfd431f9d361c68c8fd7b6c1"},e("a",{key:"f319b78e25ac746fd1eab2d80bc3442ba0c83efc",class:this.generateClass(),href:this.href||"#",target:this.target,"aria-label":"List Tile Link"},e("div",{key:"6c05824750a1f83403fe08b46a54acfc2c212ea4",class:"s-list-tile-item-icon"},e("slot",{key:"d0ea4a9056e09af9a2bb5c01a49634aed5d5ab1a",name:"icon"})),e("div",{key:"8621527374ff7875e8548da8dd2e494364a77143",class:"s-list-tile-item-content"},e("div",{key:"16c573f5262ee832554ba4d453c96037d7acfe13",class:"s-list-tile-item-title"},e("slot",{key:"0fb716fcbe485fa387ced50f0793716679484c09",name:"title"})),e("div",{key:"0c9a1eb470ce27cf94ce6c5e03e509c3f3783f0a",class:"s-list-tile-item-subtitle"},e("slot",{key:"c465030602c439be2fe81f389b1833773954d215",name:"subtitle"}))),e("div",{key:"642d123634be3764bde9d762fc2fc06bf5d5ae6e",class:"s-list-tile-item-action"},e("slot",{key:"0f4070d39a3c326b4a78a3b3814523a999465961",name:"action"}))))}};s.style='/*!twlt*/.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-gifting-widget .s-list-tile-item-icon{display:none}.s-gifting-widget-vertical .s-list-tile-item-icon{display:block}.s-gifting-widget-vertical .s-list-tile-item-title svg{fill:var(--color-primary)}.s-gifting-widget-vertical .s-list-tile-item-subtitle{padding-right:3.5rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-gifting-widget-vertical .s-list-tile-item{flex-wrap:wrap;padding:0px}@media (min-width: 1024px){.s-gifting-widget-vertical .s-list-tile-item-action{flex:1 1 0%}}.s-gifting-widget .s-list-tile-item{flex-direction:column;justify-content:space-between;gap:1rem;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:1.25rem;text-align:center}@media (min-width: 768px){.s-gifting-widget .s-list-tile-item{text-align:left}}@media (min-width: 1024px){.s-gifting-widget .s-list-tile-item{flex-direction:row}}@media (min-width: 768px){.s-gifting-widget .s-list-tile-item:where([dir="rtl"],[dir="rtl"] *){text-align:right}}.s-list-tile-item{position:relative;display:flex;align-items:center;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1));text-decoration-line:none}.s-list-tile-item-href{cursor:pointer}.s-list-tile-item-icon{margin-right:1rem;flex-shrink:0}.s-list-tile-item-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:1rem;margin-right:0px}.s-list-tile-item-title{font-size:1rem;line-height:1.5rem}.s-list-tile-item-subtitle{font-size:0.875rem;line-height:1.25rem}.s-loyalty-skeleton .s-list-tile-item-content{display:block;width:100%}.s-loyalty-widget .s-list-tile-item{padding:0px !important}.s-loyalty-after-exchange .s-list-tile-item{position:relative;justify-content:space-between;overflow:hidden;border-radius:var(--s-radius, 0.25rem);padding-top:0.75rem;padding-bottom:0.75rem}.s-loyalty-after-exchange .s-list-tile-item::after{pointer-events:none;position:absolute;inset:0px;display:block;height:100%;width:100%;background-color:var(--color-primary);opacity:.08;--tw-content:\'\';content:var(--tw-content)}.s-loyalty-after-exchange .s-list-tile-item .s-list-tile-item-title{font-size:15px}.s-loyalty-program-after-exchange .s-list-tile-item{position:relative;justify-content:space-between;overflow:hidden;border-radius:var(--s-radius, 0.25rem);background-color:var(--color-primary);padding-top:0.75rem;padding-bottom:0.75rem}.s-loyalty-program-after-exchange .s-list-tile-item .s-list-tile-item-title{font-size:0.875rem;line-height:1.25rem}.s-loyalty-program-panel-widget .s-list-tile-item{padding:0px !important}.s-scopes-skeleton .s-list-tile-item-content{display:block;width:100%}.s-scopes-skeleton .s-list-tile-item-icon{margin-right:2rem}.s-scopes-skeleton .s-list-tile-item-icon:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:2rem}.s-user-settings-section .s-list-tile-item{align-items:flex-start;background-color:transparent;padding:1.25rem}@media (min-width: 768px){.s-user-settings-section .s-list-tile-item{align-items:center}}.s-user-settings-section .s-list-tile-item-action{margin-left:auto}.s-user-settings-section .s-list-tile-item-action:where([dir="rtl"],[dir="rtl"] *){margin-right:auto;margin-left:0px}.s-user-settings-section .s-list-tile-item-action button{width:100%;padding:10px}.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:wrap}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:nowrap}}.s-user-settings-section-delete-user .s-list-tile-item-icon{position:relative;top:5px}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-icon{top:0px}}@media (max-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-content{flex:1 0 85%}.s-user-settings-section-delete-user .s-list-tile-item-action{flex:1 1 100%;margin-top:1rem}}';export{s as salla_list_tile}
4
+ import{r as t,h as e,H as i}from"./p-Ca7ApeqJ.js";const s=class{constructor(e){t(this,e),this.href=void 0,this.target="_self"}generateClass(){return{"s-list-tile-item":!0,"s-list-tile-item-href":!!this.href}}render(){return e(i,{key:"6fa6853330ca2663bfd431f9d361c68c8fd7b6c1"},e("a",{key:"f319b78e25ac746fd1eab2d80bc3442ba0c83efc",class:this.generateClass(),href:this.href||"#",target:this.target,"aria-label":"List Tile Link"},e("div",{key:"6c05824750a1f83403fe08b46a54acfc2c212ea4",class:"s-list-tile-item-icon"},e("slot",{key:"d0ea4a9056e09af9a2bb5c01a49634aed5d5ab1a",name:"icon"})),e("div",{key:"8621527374ff7875e8548da8dd2e494364a77143",class:"s-list-tile-item-content"},e("div",{key:"16c573f5262ee832554ba4d453c96037d7acfe13",class:"s-list-tile-item-title"},e("slot",{key:"0fb716fcbe485fa387ced50f0793716679484c09",name:"title"})),e("div",{key:"0c9a1eb470ce27cf94ce6c5e03e509c3f3783f0a",class:"s-list-tile-item-subtitle"},e("slot",{key:"c465030602c439be2fe81f389b1833773954d215",name:"subtitle"}))),e("div",{key:"642d123634be3764bde9d762fc2fc06bf5d5ae6e",class:"s-list-tile-item-action"},e("slot",{key:"0f4070d39a3c326b4a78a3b3814523a999465961",name:"action"}))))}};s.style='/*!twlt*/.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-gifting-widget .s-list-tile-item-icon{display:none}.s-gifting-widget-vertical .s-list-tile-item-icon{display:block}.s-gifting-widget-vertical .s-list-tile-item-title svg{fill:var(--color-primary)}.s-gifting-widget-vertical .s-list-tile-item-subtitle{padding-right:3.5rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-gifting-widget-vertical .s-list-tile-item{flex-wrap:wrap;padding:0px}@media (min-width: 1024px){.s-gifting-widget-vertical .s-list-tile-item-action{flex:1 1 0%}}.s-gifting-widget .s-list-tile-item{flex-direction:column;justify-content:space-between;gap:1rem;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:1.25rem;text-align:center}@media (min-width: 768px){.s-gifting-widget .s-list-tile-item{text-align:left}}@media (min-width: 1024px){.s-gifting-widget .s-list-tile-item{flex-direction:row}}@media (min-width: 768px){.s-gifting-widget .s-list-tile-item:where([dir="rtl"],[dir="rtl"] *){text-align:right}}.s-list-tile-item{position:relative;display:flex;align-items:center;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1));text-decoration-line:none}.s-list-tile-item-href{cursor:pointer}.s-list-tile-item-icon{margin-right:1rem;flex-shrink:0}.s-list-tile-item-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:1rem;margin-right:0px}.s-list-tile-item-title{font-size:1rem;line-height:1.5rem}.s-list-tile-item-subtitle{font-size:0.875rem;line-height:1.25rem}.s-loyalty-skeleton .s-list-tile-item-content{display:block;width:100%}.s-loyalty-widget .s-list-tile-item{padding:0px !important}.s-loyalty-after-exchange .s-list-tile-item{position:relative;justify-content:space-between;overflow:hidden;border-radius:var(--s-radius, 0.25rem);padding-top:0.75rem;padding-bottom:0.75rem}.s-loyalty-after-exchange .s-list-tile-item::after{pointer-events:none;position:absolute;inset:0px;display:block;height:100%;width:100%;background-color:var(--color-primary);opacity:.08;--tw-content:\'\';content:var(--tw-content)}.s-loyalty-after-exchange .s-list-tile-item .s-list-tile-item-title{font-size:15px}.s-loyalty-program-after-exchange .s-list-tile-item{position:relative;justify-content:space-between;overflow:hidden;border-radius:var(--s-radius, 0.25rem);background-color:var(--color-primary);padding-top:0.75rem;padding-bottom:0.75rem}.s-loyalty-program-after-exchange .s-list-tile-item .s-list-tile-item-title{font-size:0.875rem;line-height:1.25rem}.s-loyalty-program-panel-widget .s-list-tile-item{padding:0px !important}.s-scopes-skeleton .s-list-tile-item-content{display:block;width:100%}.s-scopes-skeleton .s-list-tile-item-icon{margin-right:2rem}.s-scopes-skeleton .s-list-tile-item-icon:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:2rem}.s-user-settings-section .s-list-tile-item{align-items:flex-start;background-color:transparent;padding:1.25rem}@media (min-width: 768px){.s-user-settings-section .s-list-tile-item{align-items:center}}.s-user-settings-section .s-list-tile-item-action{margin-left:auto}.s-user-settings-section .s-list-tile-item-action:where([dir="rtl"],[dir="rtl"] *){margin-right:auto;margin-left:0px}.s-user-settings-section .s-list-tile-item-action button{width:100%;padding:10px}.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:wrap}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:nowrap}}.s-user-settings-section-delete-user .s-list-tile-item-icon{position:relative;top:5px}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-icon{top:0px}}@media (max-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-content{flex:1 0 85%}.s-user-settings-section-delete-user .s-list-tile-item-action{flex:1 1 100%;margin-top:1rem}}';export{s as salla_list_tile}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,a}from"./p-DGIIhW8W.js";const i=class{constructor(t){e(this,t),this.hasError=!1}connectedCallback(){this.sizeGuideOpenListener=e=>this.open(e),salla.event.on("size-guide::open",this.sizeGuideOpenListener),this.langUnsubscribe=salla.lang.subscribe((()=>{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")}))}disconnectedCallback(){salla.event.off("size-guide::open",this.sizeGuideOpenListener),this.langUnsubscribe?.()}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 t("salla-placeholder",{alignment:"center",iconSize:"xl"},t("div",{slot:"title"},this.placeholder_title),t("div",{slot:"description"},this.placeholder_description))}render(){return t("salla-modal",{key:"31195e037abff8654af838c6c87ba5e52646afe2",class:"s-product-size-guide-wrapper",id:"salla-product-size-guide-modal",isLoading:!0,"has-skeleton":!0,width:"md",ref:e=>this.modal=e},t("span",{key:"586f60a7466f2f9d167f5861357f4337b325e706",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'}),t("div",{key:"0e129703a53a4de9a280d067600991ef6d020f59",slot:"loading"},t("div",{key:"7937b1e2525437aba3e0d25987678ffe0bfaec06",class:"s-product-size-guide-skeleton"},t("salla-skeleton",{key:"03201726c4817b1a61dc9d0a6b5076d33e8d5abe",height:"15px",width:"25%"}),t("div",{key:"bb71cdf3ee7b1d82fab177be16c65bb15f46af35",class:"s-product-size-guide-skeleton-header"},t("salla-skeleton",{key:"1dabafdfb70285a313024c4481da2b8d82d2706a",height:"40px"}),t("salla-skeleton",{key:"d858a2795a8f2e9b92fe74b435acab70cde9cf79",height:"40px"}),t("salla-skeleton",{key:"aa02427470f7b1614d7900e8eed981a91da80dd7",height:"40px"}),t("salla-skeleton",{key:"fee729b4620c49cb2d869851dfdfbd3f56713b2b",height:"40px"})),t("div",{key:"acac2ba31051539ce1d7a86cbb54b0a95d672716",class:"s-product-size-guide-skeleton-content"},t("salla-skeleton",{key:"950bac6b9532c876a9b19fe7eb614218d8eabed1",height:"15px",width:"25%"}),t("salla-skeleton",{key:"3a03a7cee62ff565c38dbd4cac10b155841a4a17",height:"10px",width:"75%"}),t("salla-skeleton",{key:"731c5f9191b4133d35d32914063ab5ee207160a5",height:"10px",width:"50%"}),t("salla-skeleton",{key:"ecf3a698f63110937102b881ed8888bffc1aff6f",height:"10px",width:"75%"}),t("salla-skeleton",{key:"52d88576752037bcf9878a8527aa3d083f5d0e89",height:"10px",width:"100%"}),t("salla-skeleton",{key:"9b1274d4c5e9d997b1fa23005ca8a07b0d067574",height:"10px",width:"25%"}),t("salla-skeleton",{key:"15c28ca15f44c71417c6ad340303eed09bd33752",height:"10px",width:"60%"}),t("salla-skeleton",{key:"dcf626b475fbe54ed2d8c678261d7e98e4640c42",height:"10px",width:"45%"}),t("salla-skeleton",{key:"b242994920b6f079b0d0aa582f92fa85e8ff355a",height:"10px",width:"30%"})))),t("slot",{key:"d8f52fa5454c208364e1d062dc102c628945318a",name:"header"}),!this.hasError&&this.guides?[t("salla-tabs",{activeTab:this.guides[0]?.name},this.guides.map((e=>t("salla-tab-header",{slot:"header",name:e.name},t("span",null,e.name)))),this.guides.map((e=>t("salla-tab-content",{slot:"content",name:e.name},t("div",{innerHTML:e.description})))))]:this.showPlaceholder(),t("slot",{key:"1a0d9d1a01e18e5bd1c610dac92654f53c2dcad4",name:"footer"}))}get host(){return a(this)}};i.style='/*!twlt*/.s-product-size-guide-wrapper .s-modal-title{margin-bottom:0px !important}.s-product-size-guide-wrapper .s-tabs-content{max-height:60vh;overflow:auto}@media (min-width: 768px){.s-product-size-guide-wrapper .s-tabs-content{max-height:70vh}}.s-product-size-guide-placeholder{display:flex;align-items:center;justify-content:center}.s-product-size-guide-skeleton-table{margin-top:1.25rem;width:100%;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));line-height:1.25rem}.s-product-size-guide-skeleton-table td{border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.5rem;line-height:1.25rem}.s-product-size-guide-header-icon{display:inline-flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 640px){.s-product-size-guide-header-icon{margin-left:auto;margin-right:auto;margin-bottom:1rem;height:5rem;width:5rem}}.s-product-size-guide-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}@media (min-width: 640px){.s-product-size-guide-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}}.s-product-size-guide-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}@media (min-width: 640px){.s-product-size-guide-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}}.s-product-size-guide-header-icon svg{height:1.25rem;width:1.25rem;flex-shrink:0;fill:#9ca3af}.s-product-size-guide-skeleton-content{margin-top:1.25rem;display:flex;flex-direction:column}.s-product-size-guide-skeleton-content>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.75rem * var(--tw-space-y-reverse))}.s-product-size-guide-skeleton-header{margin-top:2rem;margin-bottom:2rem;display:flex;align-items:center;justify-content:space-between}.s-product-size-guide-skeleton-header>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-product-size-guide-skeleton-header:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-product-size-guide-skeleton-header>salla-skeleton{flex:1 1 0%}';export{i as salla_product_size_guide}
4
+ import{r as e,h as t,a}from"./p-Ca7ApeqJ.js";const i=class{constructor(t){e(this,t),this.hasError=!1}connectedCallback(){this.sizeGuideOpenListener=e=>this.open(e),salla.event.on("size-guide::open",this.sizeGuideOpenListener),this.langUnsubscribe=salla.lang.subscribe((()=>{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")}))}disconnectedCallback(){salla.event.off("size-guide::open",this.sizeGuideOpenListener),this.langUnsubscribe?.()}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 t("salla-placeholder",{alignment:"center",iconSize:"xl"},t("div",{slot:"title"},this.placeholder_title),t("div",{slot:"description"},this.placeholder_description))}render(){return t("salla-modal",{key:"31195e037abff8654af838c6c87ba5e52646afe2",class:"s-product-size-guide-wrapper",id:"salla-product-size-guide-modal",isLoading:!0,"has-skeleton":!0,width:"md",ref:e=>this.modal=e},t("span",{key:"586f60a7466f2f9d167f5861357f4337b325e706",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'}),t("div",{key:"0e129703a53a4de9a280d067600991ef6d020f59",slot:"loading"},t("div",{key:"7937b1e2525437aba3e0d25987678ffe0bfaec06",class:"s-product-size-guide-skeleton"},t("salla-skeleton",{key:"03201726c4817b1a61dc9d0a6b5076d33e8d5abe",height:"15px",width:"25%"}),t("div",{key:"bb71cdf3ee7b1d82fab177be16c65bb15f46af35",class:"s-product-size-guide-skeleton-header"},t("salla-skeleton",{key:"1dabafdfb70285a313024c4481da2b8d82d2706a",height:"40px"}),t("salla-skeleton",{key:"d858a2795a8f2e9b92fe74b435acab70cde9cf79",height:"40px"}),t("salla-skeleton",{key:"aa02427470f7b1614d7900e8eed981a91da80dd7",height:"40px"}),t("salla-skeleton",{key:"fee729b4620c49cb2d869851dfdfbd3f56713b2b",height:"40px"})),t("div",{key:"acac2ba31051539ce1d7a86cbb54b0a95d672716",class:"s-product-size-guide-skeleton-content"},t("salla-skeleton",{key:"950bac6b9532c876a9b19fe7eb614218d8eabed1",height:"15px",width:"25%"}),t("salla-skeleton",{key:"3a03a7cee62ff565c38dbd4cac10b155841a4a17",height:"10px",width:"75%"}),t("salla-skeleton",{key:"731c5f9191b4133d35d32914063ab5ee207160a5",height:"10px",width:"50%"}),t("salla-skeleton",{key:"ecf3a698f63110937102b881ed8888bffc1aff6f",height:"10px",width:"75%"}),t("salla-skeleton",{key:"52d88576752037bcf9878a8527aa3d083f5d0e89",height:"10px",width:"100%"}),t("salla-skeleton",{key:"9b1274d4c5e9d997b1fa23005ca8a07b0d067574",height:"10px",width:"25%"}),t("salla-skeleton",{key:"15c28ca15f44c71417c6ad340303eed09bd33752",height:"10px",width:"60%"}),t("salla-skeleton",{key:"dcf626b475fbe54ed2d8c678261d7e98e4640c42",height:"10px",width:"45%"}),t("salla-skeleton",{key:"b242994920b6f079b0d0aa582f92fa85e8ff355a",height:"10px",width:"30%"})))),t("slot",{key:"d8f52fa5454c208364e1d062dc102c628945318a",name:"header"}),!this.hasError&&this.guides?[t("salla-tabs",{activeTab:this.guides[0]?.name},this.guides.map((e=>t("salla-tab-header",{slot:"header",name:e.name},t("span",null,e.name)))),this.guides.map((e=>t("salla-tab-content",{slot:"content",name:e.name},t("div",{innerHTML:e.description})))))]:this.showPlaceholder(),t("slot",{key:"1a0d9d1a01e18e5bd1c610dac92654f53c2dcad4",name:"footer"}))}get host(){return a(this)}};i.style='/*!twlt*/.s-product-size-guide-wrapper .s-modal-title{margin-bottom:0px !important}.s-product-size-guide-wrapper .s-tabs-content{max-height:60vh;overflow:auto}@media (min-width: 768px){.s-product-size-guide-wrapper .s-tabs-content{max-height:70vh}}.s-product-size-guide-placeholder{display:flex;align-items:center;justify-content:center}.s-product-size-guide-skeleton-table{margin-top:1.25rem;width:100%;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));line-height:1.25rem}.s-product-size-guide-skeleton-table td{border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.5rem;line-height:1.25rem}.s-product-size-guide-header-icon{display:inline-flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 640px){.s-product-size-guide-header-icon{margin-left:auto;margin-right:auto;margin-bottom:1rem;height:5rem;width:5rem}}.s-product-size-guide-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}@media (min-width: 640px){.s-product-size-guide-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}}.s-product-size-guide-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}@media (min-width: 640px){.s-product-size-guide-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}}.s-product-size-guide-header-icon svg{height:1.25rem;width:1.25rem;flex-shrink:0;fill:#9ca3af}.s-product-size-guide-skeleton-content{margin-top:1.25rem;display:flex;flex-direction:column}.s-product-size-guide-skeleton-content>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.75rem * var(--tw-space-y-reverse))}.s-product-size-guide-skeleton-header{margin-top:2rem;margin-bottom:2rem;display:flex;align-items:center;justify-content:space-between}.s-product-size-guide-skeleton-header>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-product-size-guide-skeleton-header:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-product-size-guide-skeleton-header>salla-skeleton{flex:1 1 0%}';export{i as salla_product_size_guide}