@salla.sa/twilight-components 2.14.446 → 2.14.447

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 (306) hide show
  1. package/dist/cjs/{filepond-rDr-05NK.js → filepond-H0V09y77.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-DXUkwq91.js → filepond-plugin-file-poster-z_Pgx1za.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-CmWT-l1o.js → filepond-plugin-file-validate-size-BgbBSmud.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-CI-SRLe5.js → filepond-plugin-file-validate-type-D2zmv3Bc.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-D0ccVwFm.js → filepond-plugin-image-edit-B74CXTZm.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-CC7CmDIV.js → filepond-plugin-image-exif-orientation-DyaNWpnA.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-DOMTJIsr.js → filepond-plugin-image-preview-C0XDHIb0.js} +1 -1
  8. package/dist/cjs/{functions-BrD7nRK2.js → functions-Bs97hO7_.js} +1 -1
  9. package/dist/cjs/{index-BBFmWakU.js → index-B5-Obq5h.js} +1 -1
  10. package/dist/cjs/{index-DA8jhZqT.js → index-CBTkKuC2.js} +2 -2
  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 +1 -1
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
  21. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  44. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  45. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  46. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  49. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  50. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-map.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-products-list.cjs.entry.js +33 -32
  79. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  83. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  98. package/dist/cjs/{tracked-promise-vD81wqoM.js → tracked-promise-CyZ6P0Ww.js} +1 -1
  99. package/dist/cjs/twilight.cjs.js +1 -1
  100. package/dist/cjs/{vanilla-picker-Dc4-oPc4.js → vanilla-picker-Bd-KMT3o.js} +1 -1
  101. package/dist/collection/components/salla-products-list/salla-products-list.js +32 -31
  102. package/dist/components/index.js +2 -2
  103. package/dist/components/salla-products-list2.js +32 -31
  104. package/dist/esm/{filepond-CpYF7JQY.js → filepond-DO_Qk3JK.js} +1 -1
  105. package/dist/esm/{filepond-plugin-file-poster-ob6i92P3.js → filepond-plugin-file-poster-Btb31Xcs.js} +1 -1
  106. package/dist/esm/{filepond-plugin-file-validate-size-h8AHfyQH.js → filepond-plugin-file-validate-size-Bs8yCeGp.js} +1 -1
  107. package/dist/esm/{filepond-plugin-file-validate-type-BPLx-hfr.js → filepond-plugin-file-validate-type-B5rUPm_4.js} +1 -1
  108. package/dist/esm/{filepond-plugin-image-edit-B7wPe8-3.js → filepond-plugin-image-edit-XOXQA_f1.js} +1 -1
  109. package/dist/esm/{filepond-plugin-image-exif-orientation-e7W60Y2D.js → filepond-plugin-image-exif-orientation-DUyferIn.js} +1 -1
  110. package/dist/esm/{filepond-plugin-image-preview-DOov9hTx.js → filepond-plugin-image-preview-BHVQ0frN.js} +1 -1
  111. package/dist/esm/{functions-BRfvCQ-R.js → functions-CHwbDaMQ.js} +1 -1
  112. package/dist/esm/{index-nKWbBz_d.js → index-DECtOcJg.js} +1 -1
  113. package/dist/esm/{index-DryPCgN9.js → index-DtunYVY8.js} +2 -2
  114. package/dist/esm/loader.js +2 -2
  115. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  116. package/dist/esm/salla-accordion_6.entry.js +1 -1
  117. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  118. package/dist/esm/salla-advertisement.entry.js +1 -1
  119. package/dist/esm/salla-alert_2.entry.js +1 -1
  120. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  121. package/dist/esm/salla-apps-icons.entry.js +1 -1
  122. package/dist/esm/salla-badge.entry.js +1 -1
  123. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  124. package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
  125. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  126. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  127. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  128. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  129. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  130. package/dist/esm/salla-contacts.entry.js +1 -1
  131. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  132. package/dist/esm/salla-count-down.entry.js +1 -1
  133. package/dist/esm/salla-custom-fields.entry.js +1 -1
  134. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  135. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  136. package/dist/esm/salla-filters-widget.entry.js +1 -1
  137. package/dist/esm/salla-filters.entry.js +1 -1
  138. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  139. package/dist/esm/salla-gifting.entry.js +1 -1
  140. package/dist/esm/salla-hook.entry.js +1 -1
  141. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  142. package/dist/esm/salla-installment.entry.js +1 -1
  143. package/dist/esm/salla-list-tile.entry.js +1 -1
  144. package/dist/esm/salla-localization-modal.entry.js +1 -1
  145. package/dist/esm/salla-login-modal.entry.js +1 -1
  146. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  147. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  148. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  149. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  150. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  151. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  152. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  153. package/dist/esm/salla-loyalty.entry.js +1 -1
  154. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  155. package/dist/esm/salla-map.entry.js +1 -1
  156. package/dist/esm/salla-menu.entry.js +1 -1
  157. package/dist/esm/salla-metadata.entry.js +1 -1
  158. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  159. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  160. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  161. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  162. package/dist/esm/salla-notification-item.entry.js +1 -1
  163. package/dist/esm/salla-notifications.entry.js +1 -1
  164. package/dist/esm/salla-offer-modal.entry.js +1 -1
  165. package/dist/esm/salla-offer.entry.js +1 -1
  166. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  167. package/dist/esm/salla-order-details-options.entry.js +1 -1
  168. package/dist/esm/salla-order-details.entry.js +1 -1
  169. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  170. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  171. package/dist/esm/salla-order-edit.entry.js +1 -1
  172. package/dist/esm/salla-order-summary.entry.js +1 -1
  173. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  174. package/dist/esm/salla-orders.entry.js +1 -1
  175. package/dist/esm/salla-payments.entry.js +1 -1
  176. package/dist/esm/salla-placeholder.entry.js +1 -1
  177. package/dist/esm/salla-price-range.entry.js +1 -1
  178. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  179. package/dist/esm/salla-product-card_2.entry.js +1 -1
  180. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  181. package/dist/esm/salla-products-list.entry.js +33 -32
  182. package/dist/esm/salla-progress-bar.entry.js +1 -1
  183. package/dist/esm/salla-quick-order.entry.js +1 -1
  184. package/dist/esm/salla-rating-modal.entry.js +1 -1
  185. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  186. package/dist/esm/salla-scopes.entry.js +1 -1
  187. package/dist/esm/salla-search.entry.js +1 -1
  188. package/dist/esm/salla-skeleton.entry.js +1 -1
  189. package/dist/esm/salla-slider.entry.js +1 -1
  190. package/dist/esm/salla-social-share.entry.js +1 -1
  191. package/dist/esm/salla-social.entry.js +1 -1
  192. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  193. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  194. package/dist/esm/salla-tooltip.entry.js +1 -1
  195. package/dist/esm/salla-trust-badges.entry.js +1 -1
  196. package/dist/esm/salla-user-menu.entry.js +1 -1
  197. package/dist/esm/salla-user-profile.entry.js +1 -1
  198. package/dist/esm/salla-user-settings.entry.js +1 -1
  199. package/dist/esm/salla-verify.entry.js +1 -1
  200. package/dist/esm/salla-wallet.entry.js +1 -1
  201. package/dist/esm/{tracked-promise-x7FFO6oF.js → tracked-promise-BcnHGy9I.js} +1 -1
  202. package/dist/esm/twilight.js +2 -2
  203. package/dist/esm/{vanilla-picker-WM2eU5Jq.js → vanilla-picker-CKYy2jA4.js} +1 -1
  204. package/dist/twilight/{p-25b0ee17.entry.js → p-041fe75d.entry.js} +1 -1
  205. package/dist/twilight/{p-a35822f5.entry.js → p-071f9c31.entry.js} +1 -1
  206. package/dist/twilight/{p-5f08f47d.entry.js → p-0c3c496e.entry.js} +1 -1
  207. package/dist/twilight/{p-cfa852cf.entry.js → p-0e1a6208.entry.js} +1 -1
  208. package/dist/twilight/{p-752c4d55.entry.js → p-1431bedb.entry.js} +1 -1
  209. package/dist/twilight/{p-27954727.entry.js → p-158c0fd9.entry.js} +1 -1
  210. package/dist/twilight/{p-3ea0a5bb.entry.js → p-1c54fe1c.entry.js} +1 -1
  211. package/dist/twilight/{p-da8058f3.entry.js → p-1d86e9f5.entry.js} +1 -1
  212. package/dist/twilight/{p-362d1920.entry.js → p-1e8c6aca.entry.js} +1 -1
  213. package/dist/twilight/{p-be360c44.entry.js → p-22eac711.entry.js} +1 -1
  214. package/dist/twilight/{p-02be2d0d.entry.js → p-23ef52d4.entry.js} +1 -1
  215. package/dist/twilight/{p-41b5d22c.entry.js → p-2460406e.entry.js} +1 -1
  216. package/dist/twilight/{p-7447b19b.entry.js → p-2733190a.entry.js} +1 -1
  217. package/dist/twilight/{p-c81c589b.entry.js → p-2934beff.entry.js} +1 -1
  218. package/dist/twilight/{p-f7b7ea3d.entry.js → p-2c04d113.entry.js} +1 -1
  219. package/dist/twilight/{p-e290b5c5.entry.js → p-2e9679fb.entry.js} +1 -1
  220. package/dist/twilight/{p-f2563e2b.entry.js → p-33968d21.entry.js} +1 -1
  221. package/dist/twilight/{p-4b0747a1.entry.js → p-360e32b5.entry.js} +1 -1
  222. package/dist/twilight/{p-38c40f88.entry.js → p-36df6391.entry.js} +1 -1
  223. package/dist/twilight/{p-43420d4d.entry.js → p-38069747.entry.js} +1 -1
  224. package/dist/twilight/{p-b607e474.entry.js → p-39c65bfc.entry.js} +1 -1
  225. package/dist/twilight/{p-f974d986.entry.js → p-3a8af7f6.entry.js} +1 -1
  226. package/dist/twilight/{p-cc65c26b.entry.js → p-3f2201f2.entry.js} +1 -1
  227. package/dist/twilight/{p-891d0baa.entry.js → p-429c2869.entry.js} +1 -1
  228. package/dist/twilight/{p-3c8531fd.entry.js → p-44b9b2ac.entry.js} +1 -1
  229. package/dist/twilight/{p-04bf282e.entry.js → p-452601b5.entry.js} +1 -1
  230. package/dist/twilight/{p-6b2d84be.entry.js → p-49077075.entry.js} +1 -1
  231. package/dist/twilight/{p-0fbc1adc.entry.js → p-493258d1.entry.js} +1 -1
  232. package/dist/twilight/{p-86e3a8fc.entry.js → p-4f8ea699.entry.js} +1 -1
  233. package/dist/twilight/{p-f6d9edd5.entry.js → p-50dd7bd2.entry.js} +1 -1
  234. package/dist/twilight/{p-e114505e.entry.js → p-51e35559.entry.js} +1 -1
  235. package/dist/twilight/{p-e00cbb9e.entry.js → p-5374824f.entry.js} +1 -1
  236. package/dist/twilight/{p-eb3ef9e4.entry.js → p-54a3559b.entry.js} +1 -1
  237. package/dist/twilight/{p-a09118de.entry.js → p-5571c0bb.entry.js} +1 -1
  238. package/dist/twilight/{p-3158d2a9.entry.js → p-5648016f.entry.js} +1 -1
  239. package/dist/twilight/{p-b51a70cc.entry.js → p-6272d023.entry.js} +1 -1
  240. package/dist/twilight/{p-f38b7948.entry.js → p-62f3f1f7.entry.js} +1 -1
  241. package/dist/twilight/{p-56f5aac9.entry.js → p-664fb7b8.entry.js} +1 -1
  242. package/dist/twilight/{p-740ccc8e.entry.js → p-6b65c0d5.entry.js} +1 -1
  243. package/dist/twilight/{p-4139872a.entry.js → p-6c788e1e.entry.js} +1 -1
  244. package/dist/twilight/{p-7b91245f.entry.js → p-70b75d07.entry.js} +1 -1
  245. package/dist/twilight/{p-c312d0db.entry.js → p-75f8c604.entry.js} +1 -1
  246. package/dist/twilight/{p-43e5cb00.entry.js → p-76c1ba40.entry.js} +1 -1
  247. package/dist/twilight/{p-63dd5a3c.entry.js → p-7749da52.entry.js} +1 -1
  248. package/dist/twilight/{p-d9adeaf2.entry.js → p-7d5cff28.entry.js} +1 -1
  249. package/dist/twilight/{p-e20e9fcc.entry.js → p-7f7d1bf1.entry.js} +1 -1
  250. package/dist/twilight/{p-47ac0d89.entry.js → p-8116827d.entry.js} +1 -1
  251. package/dist/twilight/{p-ffe84d46.entry.js → p-814a9889.entry.js} +1 -1
  252. package/dist/twilight/{p-1a8ffb6a.entry.js → p-83807c54.entry.js} +1 -1
  253. package/dist/twilight/{p-dc0d3911.entry.js → p-84ec609c.entry.js} +1 -1
  254. package/dist/twilight/{p-e84c62f7.entry.js → p-86c39145.entry.js} +1 -1
  255. package/dist/twilight/{p-f2f152fc.entry.js → p-8815596b.entry.js} +1 -1
  256. package/dist/twilight/p-8MUZ2pqK.js +4 -0
  257. package/dist/twilight/{p-306017cc.entry.js → p-8c78f5b7.entry.js} +1 -1
  258. package/dist/twilight/{p-e450e794.entry.js → p-8d335191.entry.js} +1 -1
  259. package/dist/twilight/{p-85911960.entry.js → p-8e0ee5ac.entry.js} +1 -1
  260. package/dist/twilight/{p-66b9efc0.entry.js → p-9396295d.entry.js} +1 -1
  261. package/dist/twilight/{p-4eb51d3e.entry.js → p-951e437f.entry.js} +1 -1
  262. package/dist/twilight/{p-e1176fed.entry.js → p-98dc6f0f.entry.js} +1 -1
  263. package/dist/twilight/{p-65421b04.entry.js → p-99804fec.entry.js} +1 -1
  264. package/dist/twilight/{p-DfQlAXmu.js → p-AGKwl7ld.js} +1 -1
  265. package/dist/twilight/{p-CW4u-F7Z.js → p-BBI8lVBK.js} +2 -2
  266. package/dist/twilight/{p-DnhZebll.js → p-BOSt2xT-.js} +1 -1
  267. package/dist/twilight/{p-k4lInm67.js → p-Be4qhkKw.js} +1 -1
  268. package/dist/twilight/{p-D0NjtBeS.js → p-BkdZznAG.js} +1 -1
  269. package/dist/twilight/{p-Cqvb5bEk.js → p-C6iDVPJi.js} +1 -1
  270. package/dist/twilight/{p-_2O7LkzU.js → p-Cdkh5eMM.js} +1 -1
  271. package/dist/twilight/{p-W3jneIaI.js → p-DInJVX-i.js} +1 -1
  272. package/dist/twilight/{p-DkfNyQIQ.js → p-DY_H4fO3.js} +1 -1
  273. package/dist/twilight/{p-B09zahHa.js → p-DpPRVQAV.js} +1 -1
  274. package/dist/twilight/{p-DryPCgN9.js → p-DtunYVY8.js} +1 -1
  275. package/dist/twilight/{p-6c25d9f0.entry.js → p-a5205495.entry.js} +1 -1
  276. package/dist/twilight/p-a6cbb062.entry.js +4 -0
  277. package/dist/twilight/{p-e5cfb673.entry.js → p-a7c81e63.entry.js} +1 -1
  278. package/dist/twilight/{p-39e59627.entry.js → p-afe87123.entry.js} +1 -1
  279. package/dist/twilight/{p-06254080.entry.js → p-b6e37661.entry.js} +1 -1
  280. package/dist/twilight/{p-70e5fcb0.entry.js → p-b9965792.entry.js} +1 -1
  281. package/dist/twilight/{p-d520bdb9.entry.js → p-bfe9f635.entry.js} +1 -1
  282. package/dist/twilight/{p-f196f804.entry.js → p-c2b5570d.entry.js} +1 -1
  283. package/dist/twilight/{p-acef8c7b.entry.js → p-c351436d.entry.js} +1 -1
  284. package/dist/twilight/{p-c22a3b11.entry.js → p-c987d08e.entry.js} +1 -1
  285. package/dist/twilight/{p-96ce2dbc.entry.js → p-ca674d67.entry.js} +1 -1
  286. package/dist/twilight/{p-372ff04c.entry.js → p-cc9246b7.entry.js} +1 -1
  287. package/dist/twilight/{p-57e63e76.entry.js → p-ce2e72a2.entry.js} +1 -1
  288. package/dist/twilight/{p-db288463.entry.js → p-ce81c02d.entry.js} +1 -1
  289. package/dist/twilight/{p-4e8a8906.entry.js → p-d2617fba.entry.js} +1 -1
  290. package/dist/twilight/{p-56af742e.entry.js → p-d5d4347d.entry.js} +1 -1
  291. package/dist/twilight/{p-6e33dad3.entry.js → p-d7f22d4e.entry.js} +1 -1
  292. package/dist/twilight/{p-38334780.entry.js → p-d9a9ab0e.entry.js} +1 -1
  293. package/dist/twilight/{p-691abee2.entry.js → p-df88d27a.entry.js} +1 -1
  294. package/dist/twilight/{p-426a869c.entry.js → p-e1e75d50.entry.js} +1 -1
  295. package/dist/twilight/{p-02281f9b.entry.js → p-e6f940d8.entry.js} +1 -1
  296. package/dist/twilight/{p-d72ac224.entry.js → p-e701a5e1.entry.js} +1 -1
  297. package/dist/twilight/{p-385277f9.entry.js → p-e8551517.entry.js} +1 -1
  298. package/dist/twilight/{p-d6ceeb02.entry.js → p-f2b78b99.entry.js} +1 -1
  299. package/dist/twilight/{p-ec145c3d.entry.js → p-f6a86eab.entry.js} +1 -1
  300. package/dist/twilight/{p-46b2f44a.entry.js → p-f92bd80a.entry.js} +1 -1
  301. package/dist/twilight/{p-392bac91.entry.js → p-f95d2671.entry.js} +1 -1
  302. package/dist/twilight/twilight.esm.js +1 -1
  303. package/dist/types/components/salla-products-list/salla-products-list.d.ts +1 -0
  304. package/package.json +5 -5
  305. package/dist/twilight/p-Dv6JHEwK.js +0 -4
  306. package/dist/twilight/p-c1b9517f.entry.js +0 -4
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, a as getElement } from './index-DtunYVY8.js';
5
5
 
6
6
  var PageType;
7
7
  (function (PageType) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host } from './index-DtunYVY8.js';
5
5
 
6
6
  const sallaOrderDetailsMultipleBundleProductCss = "";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host } from './index-DtunYVY8.js';
5
5
 
6
6
  var copyIcon = `<!-- Generated by IcoMoon.io -->
7
7
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, F as Fragment, H as Host } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, F as Fragment, H as Host } from './index-DtunYVY8.js';
5
5
 
6
6
  const sallaOrderDetailsCss = "";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-DtunYVY8.js';
5
5
  import { a as getOrderEditProductMaxQuantity } from './helpers-DR_vlSvU.js';
6
6
  import './interfaces-CoQJOPRz.js';
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-DtunYVY8.js';
5
5
 
6
6
  const sallaOrderEditProductCardCss = ":host{display:block;min-width:0}";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host } from './index-DtunYVY8.js';
5
5
  import { g as getOrderItemSelectedOptions, a as getOrderEditProductMaxQuantity, c as clampOrderEditQuantity, u as updateOrderItems, r as removeOrderItems, m as mergePayloadItems, b as cloneOrderEditProduct, f as findMergeableItem, d as updateAddedPayloadList, e as upsertPayloadUpdateList, h as createAddedOrderItem, i as buildSavePayload } from './helpers-DR_vlSvU.js';
6
6
  import './interfaces-CoQJOPRz.js';
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h } from './index-DtunYVY8.js';
5
5
  import { i as iconCopy } from './swap-stroke-DqDX5na4.js';
6
6
  import { S as SICheck } from './check-BZp0rKEO.js';
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host } from './index-DtunYVY8.js';
5
5
 
6
6
  const sallaOrderTotalsCardCss = ":host{display:block}";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, a as getElement } from './index-DtunYVY8.js';
5
5
  import { H as Helper } from './Helper-DFMXF2_h.js';
6
6
  import './anime.es-CgtvEd63.js';
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host, a as getElement } from './index-DtunYVY8.js';
5
5
 
6
6
  const sallaPaymentsCss = ":host{display:block}";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host } from './index-DtunYVY8.js';
5
5
 
6
6
  var Inbox = `<!-- Generated by IcoMoon.io -->
7
7
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-DtunYVY8.js';
5
5
  import { a as arrowLeft } from './arrow-left-BedNk7k1.js';
6
6
 
7
7
  var arrowRight = `<!-- Generated by IcoMoon.io -->
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host, a as getElement } from './index-DtunYVY8.js';
5
5
 
6
6
  const sallaProductCardEmbedCss = "@charset \"UTF-8\";:host{display:inline-block;vertical-align:top;max-width:12rem}:host([align=left]){float:inline-start;margin-block-end:1em;margin-inline-end:1em;shape-outside:margin-box}:host([align=right]){float:inline-end;margin-block-end:1em;margin-inline-start:1em;shape-outside:margin-box}:host([align=center]){display:block;clear:both;margin-block:1em;margin-inline:auto}.s-product-card-embed-card{display:block}";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host, a as getElement } from './index-DtunYVY8.js';
5
5
  import { S as Star } from './star2-D4oPi1Ov.js';
6
6
  import { H as Helper } from './Helper-DFMXF2_h.js';
7
7
  import './anime.es-CgtvEd63.js';
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, a as getElement } from './index-DtunYVY8.js';
5
5
 
6
6
  var PencilRuler = `<!-- Generated by IcoMoon.io -->
7
7
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-DtunYVY8.js';
5
5
  import { a as anime } from './anime.es-CgtvEd63.js';
6
6
  import { S as ShoppingBag } from './shopping-bag-DiKTtDW5.js';
7
7
  import { H as Helper } from './Helper-DFMXF2_h.js';
@@ -437,6 +437,34 @@ const SallaProductsList = class {
437
437
  getSourceValue() {
438
438
  return this.currentCategoryIdFilter ? this.currentCategoryIdFilter : Helper.getProductsSourceValue(this.source, this.sourceValue);
439
439
  }
440
+ logFetchError(errorPhase, error, fetchPath, http, response) {
441
+ try {
442
+ const body = response && typeof response === 'object' ? response : null;
443
+ const sourceValue = this.getSourceValue();
444
+ salla.analytics?.log('salla::products.list.fetch.error', {
445
+ errorPhase,
446
+ source: this.getSource(),
447
+ sourceValue: typeof sourceValue === 'string' && sourceValue.length > 200
448
+ ? `${sourceValue.slice(0, 200)}…`
449
+ : Array.isArray(sourceValue) ? { length: sourceValue.length } : sourceValue,
450
+ pageIndex: this.infiniteScroll?.pageIndex,
451
+ fetchPath,
452
+ httpStatus: http?.status,
453
+ httpStatusText: http?.statusText,
454
+ responseUrl: http?.url,
455
+ ...(body && {
456
+ dataCount: Array.isArray(body.data) ? body.data.length : undefined,
457
+ responseKeys: Object.keys(body).slice(0, 15),
458
+ filtersCount: Array.isArray(body.filters) ? body.filters.length : undefined,
459
+ }),
460
+ errorMessage: error instanceof Error ? error.message : String(error),
461
+ ...(errorPhase === 'processing' && error instanceof Error && error.stack
462
+ ? { errorStack: error.stack.slice(0, 500) }
463
+ : {}),
464
+ });
465
+ }
466
+ catch { /* analytics */ }
467
+ }
440
468
  appendDataLayer(data) {
441
469
  if (typeof dataLayer !== 'object' || !Array.isArray(dataLayer)) {
442
470
  //todo:: check if we should define it here
@@ -513,47 +541,20 @@ const SallaProductsList = class {
513
541
  }
514
542
  catch (error) {
515
543
  console.error('Error during load:', error);
516
- try {
517
- const res = httpResponse;
518
- salla.analytics?.log('salla::products.list.fetch.error', {
519
- source: this.getSource(),
520
- nextPage: this.nextPage,
521
- pageIndex: this.infiniteScroll?.pageIndex,
522
- fetchPath: typeof path === 'string' ? path : undefined,
523
- httpStatus: res?.status,
524
- httpStatusText: res?.statusText,
525
- responseUrl: res?.url,
526
- itemsLength: Array.isArray(response?.data) ? response.data.length : undefined,
527
- responseKeys: response && typeof response === 'object' ? Object.keys(response).slice(0, 30) : undefined,
528
- errorMessage: error instanceof Error ? error.message : String(error),
529
- });
530
- }
531
- catch { /* analytics */ }
544
+ const res = httpResponse;
545
+ this.logFetchError('processing', error, typeof path === 'string' ? path : undefined, res, response);
532
546
  }
533
547
  finally {
534
548
  this.isProcessing = false;
535
549
  }
536
550
  });
537
551
  this.infiniteScroll?.on('error', (error, path, httpResponse) => {
538
- console.log('Error occurred during request');
539
- try {
540
- const res = httpResponse;
541
- salla.analytics?.log('salla::products.list.fetch.error', {
542
- source: this.getSource(),
543
- nextPage: this.nextPage,
544
- pageIndex: this.infiniteScroll?.pageIndex,
545
- fetchPath: path,
546
- httpStatus: res?.status,
547
- httpStatusText: res?.statusText,
548
- responseUrl: res?.url,
549
- errorMessage: error instanceof Error ? error.message : String(error),
550
- });
551
- }
552
- catch { /* analytics */ }
552
+ const res = httpResponse;
553
553
  this.status.querySelector('.s-infinite-scroll-error').classList.remove('s-hidden');
554
554
  this.placeholderLoader && this.placeholderLoader.remove();
555
555
  this.loading(false);
556
556
  this.isProcessing = false;
557
+ this.logFetchError('fetch', error, path, res);
557
558
  });
558
559
  salla.onReady(() => {
559
560
  const snapshot = sessionStorage.getItem(this.infiniteScrollStateKey);
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h } from './index-DtunYVY8.js';
5
5
 
6
6
  const sallaProgressBarCss = "";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-DtunYVY8.js';
5
5
  import { S as SIiPhoneX } from './iphone-x-CciN5Q_x.js';
6
6
  import { S as SIMail } from './mail-DLNIOD9t.js';
7
7
  import { S as SICancel } from './cancel-8Tsmrwno.js';
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host, a as getElement } from './index-DtunYVY8.js';
5
5
  import { W as WishListIcon } from './star-ZT7ehBBk.js';
6
6
  import { C as CheckCircle2 } from './check-circle2-BV4kqbdL.js';
7
7
  import { H as Helper } from './Helper-DFMXF2_h.js';
@@ -1,13 +1,13 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-DryPCgN9.js';
5
- import { c as closeModals, b as brand_path, f as formattedPointsJsx } from './functions-BRfvCQ-R.js';
4
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-DtunYVY8.js';
5
+ import { c as closeModals, b as brand_path, f as formattedPointsJsx } from './functions-CHwbDaMQ.js';
6
6
  import { S as SIGift } from './gift-CXRKXFgT.js';
7
7
  import { S as SITag } from './tag-cgSL_BIo.js';
8
8
  import { S as SICheck } from './check-BZp0rKEO.js';
9
9
  import { S as SICancel } from './cancel-8Tsmrwno.js';
10
- import { T as TrackedPromise } from './tracked-promise-x7FFO6oF.js';
10
+ import { T as TrackedPromise } from './tracked-promise-BcnHGy9I.js';
11
11
 
12
12
  const sallaLoyaltyProgramCss$3 = "";
13
13
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host } from './index-DtunYVY8.js';
5
5
  import { S as Search } from './search-BscTeWDc.js';
6
6
 
7
7
  var StoreAlt = `<!-- Generated by IcoMoon.io -->
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, a as getElement } from './index-DtunYVY8.js';
5
5
  import { S as Search } from './search-BscTeWDc.js';
6
6
  import { H as Helper } from './Helper-DFMXF2_h.js';
7
7
  import './anime.es-CgtvEd63.js';
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host } from './index-DtunYVY8.js';
5
5
 
6
6
  const sallaSkeletonCss = ":host{display:block}";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-DtunYVY8.js';
5
5
  import { a as ArrowRightIcon, A as ArrowLeftIcon } from './keyboard_arrow_right-Vqpj4CWE.js';
6
6
 
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, a as getElement } from './index-DtunYVY8.js';
5
5
  import { a as anime } from './anime.es-CgtvEd63.js';
6
6
  import { f as facebook, t as twitter } from './facebook-CO-PeZ27.js';
7
7
  import { S as SIMail } from './mail-DLNIOD9t.js';
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host, a as getElement } from './index-DtunYVY8.js';
5
5
  import { f as facebook, t as twitter } from './facebook-CO-PeZ27.js';
6
6
 
7
7
  var instagram = `<!-- Generated by IcoMoon.io -->
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, c as createEvent, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, c as createEvent, a as getElement } from './index-DtunYVY8.js';
5
5
 
6
6
  const sallaTabContentCss = "";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host } from './index-DtunYVY8.js';
5
5
 
6
6
  var DiscountType;
7
7
  (function (DiscountType) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, a as getElement } from './index-DtunYVY8.js';
5
5
 
6
6
  const sallaTooltipCss = ".s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;transform:translateX(-63%) translateY(-50%);background-color:var(--color-primary);color:var(--color-primary-reverse);bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;opacity:0;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:\"\";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:var(--color-primary) transparent transparent transparent}.s-tooltip-item:dir(ltr){transform:translateX(-72%)}.s-tooltip-item--dark{background-color:#555555;color:white;padding:5px 15px;border-radius:8px;font-size:12px;font-weight:normal;max-width:330px;width:max-content}.s-tooltip-item--dark::after{border-color:#555555 transparent transparent transparent}";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host } from './index-DtunYVY8.js';
5
5
 
6
6
  const sallaTrustBadgesCss = "";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host, a as getElement } from './index-DtunYVY8.js';
5
5
  import { A as ArrowDown } from './keyboard_arrow_down-DCZbpt2a.js';
6
6
  import { B as BellRing } from './bell-ring-D3mWkc-3.js';
7
7
  import { P as PendingOrdersIcon } from './cart-DY4LZmNP.js';
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h } from './index-DtunYVY8.js';
5
5
  import { G as Genders } from './interfaces-OF8QcbMM.js';
6
6
 
7
7
  const sallaUserProfileCss = ":host{display:block}";
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host } from './index-DtunYVY8.js';
5
5
 
6
6
  var Bullhorn = `<!-- Generated by IcoMoon.io -->
7
7
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-DtunYVY8.js';
5
5
  import { S as SIMail } from './mail-DLNIOD9t.js';
6
6
 
7
7
  var AndroidPhoneIcon = `<!-- Generated by IcoMoon.io -->
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-DryPCgN9.js';
4
+ import { r as registerInstance, h, H as Host } from './index-DtunYVY8.js';
5
5
 
6
6
  const sallaWalletCss = ".s-wallet-table{min-width:100%}.s-wallet-table-balance-container{display:flex !important;align-items:center !important;justify-content:flex-start !important;gap:1rem}.s-wallet-table-balance-icon{border-radius:50%;width:52px;height:52px;font-size:25px;padding:16px 13px;background:var(--color-primary-reverse);color:var(--color-primary)}.s-wallet-table-empty-state{display:flex;flex-direction:column;align-items:center}.s-wallet-table-empty-state i{font-size:80px;margin:4rem 0 2rem;color:var(--infinte-color)}.s-wallet-table-transaction-status{padding:6px 19px !important;border-radius:20px;width:max-content;display:flex;align-items:center}.s-wallet-table-transaction-status-default{background:#fff6eb;color:#a46f29}.s-wallet-table-transaction-status-cashback{background:#effbf6;color:#00af6c}.s-wallet-table-transaction-status-refund{background:#ecf3fe;color:#5196f3}.s-wallet-table-transaction-status-purchase{background:#feecec;color:#f55157}.s-wallet-table-transaction-status-icons-success{color:#00af6c}";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { f as forceUpdate } from './index-DryPCgN9.js';
4
+ import { f as forceUpdate } from './index-DtunYVY8.js';
5
5
 
6
6
  function TrackedPromise(fn, options = {}) {
7
7
  options = Object.assign({ initialData: undefined, initialStatus: 'idle' }, options);
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-DryPCgN9.js';
5
- export { s as setNonce } from './index-DryPCgN9.js';
4
+ import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-DtunYVY8.js';
5
+ export { s as setNonce } from './index-DtunYVY8.js';
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Browser v4.35.1 | MIT Licensed | https://stenciljs.com
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-DryPCgN9.js';
4
+ import { d as getDefaultExportFromCjs } from './index-DtunYVY8.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t}from"./p-DryPCgN9.js";const r=class{constructor(t){s(this,t),this.height="10px";try{if(this.donation){let s="string"==typeof this.donation?JSON.parse(this.donation):this.donation;s.can_donate&&s.target_amount?(s.target_end_date="0000-00-00"==s.target_end_date?null:s.target_end_date,this.value=s.collected_amount,this.target=s.target_amount,this.header=salla.lang.get("pages.products.target"),this.message=s.target_end_date?salla.lang.get("pages.products.donation_target_date")+" "+s.target_end_date:""):this.message=s.target_amount?s.target_message:""}}catch(s){salla.log("Wrong donation json")}salla.lang.onLoaded((()=>{this.header=this.header?.replace("pages.products.target",salla.lang.get("pages.products.target")),this.message=this.message?.replace("pages.products.donation_target_date",salla.lang.get("pages.products.donation_target_date"))})),salla.onReady((()=>{this.color=this.color||salla.config.get("theme.color.primary","#ffd5c4"),this.unit||(this.unit=salla.config.currency().symbol)}))}getPercentage(){return this.value/this.target*100}render(){return this.target||this.message?t("div",{class:"s-progress-bar-container"},this.header?t("div",{class:"s-progress-bar-header"},this.header):"",this.getProgressBar(),this.message?t("span",{class:"s-progress-bar-message"},this.message):""):""}getProgressBar(){return this.target?[this.hideUnits?null:t("div",{class:"s-progress-bar-target-section"},t("span",{innerHTML:`${salla.helpers.number(this.value)} ${this.unit}`}),t("span",{innerHTML:`${salla.helpers.number(this.target)} ${this.unit}`})),t("div",{class:"s-progress-bar-wrapper",style:{height:this.height}},t("div",{class:{"s-progress-bar-progress":!0,"s-progress-bar-progress-stripped":this.stripped},style:{width:`${this.getPercentage()}%`,backgroundColor:this.color}}))]:null}};r.style="";export{r as salla_progress_bar}
4
+ import{r as s,h as t}from"./p-DtunYVY8.js";const r=class{constructor(t){s(this,t),this.height="10px";try{if(this.donation){let s="string"==typeof this.donation?JSON.parse(this.donation):this.donation;s.can_donate&&s.target_amount?(s.target_end_date="0000-00-00"==s.target_end_date?null:s.target_end_date,this.value=s.collected_amount,this.target=s.target_amount,this.header=salla.lang.get("pages.products.target"),this.message=s.target_end_date?salla.lang.get("pages.products.donation_target_date")+" "+s.target_end_date:""):this.message=s.target_amount?s.target_message:""}}catch(s){salla.log("Wrong donation json")}salla.lang.onLoaded((()=>{this.header=this.header?.replace("pages.products.target",salla.lang.get("pages.products.target")),this.message=this.message?.replace("pages.products.donation_target_date",salla.lang.get("pages.products.donation_target_date"))})),salla.onReady((()=>{this.color=this.color||salla.config.get("theme.color.primary","#ffd5c4"),this.unit||(this.unit=salla.config.currency().symbol)}))}getPercentage(){return this.value/this.target*100}render(){return this.target||this.message?t("div",{class:"s-progress-bar-container"},this.header?t("div",{class:"s-progress-bar-header"},this.header):"",this.getProgressBar(),this.message?t("span",{class:"s-progress-bar-message"},this.message):""):""}getProgressBar(){return this.target?[this.hideUnits?null:t("div",{class:"s-progress-bar-target-section"},t("span",{innerHTML:`${salla.helpers.number(this.value)} ${this.unit}`}),t("span",{innerHTML:`${salla.helpers.number(this.target)} ${this.unit}`})),t("div",{class:"s-progress-bar-wrapper",style:{height:this.height}},t("div",{class:{"s-progress-bar-progress":!0,"s-progress-bar-progress-stripped":this.stripped},style:{width:`${this.getPercentage()}%`,backgroundColor:this.color}}))]:null}};r.style="";export{r as salla_progress_bar}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,H as r}from"./p-DryPCgN9.js";var s;!function(e){e.PERCENTAGE="percentage",e.FIXED="fixed"}(s||(s={}));const i={staticIcons:['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M3 12C7.5 12 12 7.5 12 3C12 7.5 16.5 12 21 12C16.5 12 12 16.5 12 21C12 16.5 7.5 12 3 12Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M2 19.5C2.83333 19.5 4.5 17.8333 4.5 17C4.5 17.8333 6.16667 19.5 7 19.5C6.16667 19.5 4.5 21.1667 4.5 22C4.5 21.1667 2.83333 19.5 2 19.5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M16 5C17 5 19 3 19 2C19 3 21 5 22 5C21 5 19 7 19 8C19 7 17 5 16 5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M14.2644 18.3717C14.5806 17.407 14.7387 16.9247 15.0616 16.593C15.215 16.4354 15.3932 16.3048 15.5887 16.2066C16.0003 16 16.5003 16 17.5002 16C18.5001 16 19.0001 16 19.4116 16.2066C19.6072 16.3048 19.7853 16.4354 19.9388 16.593C20.2617 16.9247 20.4198 17.407 20.736 18.3717L21.0624 19.3675C21.4561 20.5688 21.653 21.1694 21.3587 21.5847C21.0643 22 20.4418 22 19.1966 22H15.8038C14.5586 22 13.936 22 13.6417 21.5847C13.3473 21.1694 13.5442 20.5688 13.938 19.3675L14.2644 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M8.76421 10.3717C9.08041 9.40705 9.23851 8.92471 9.56143 8.59298C9.71485 8.43537 9.89299 8.3048 10.0885 8.20663C10.5001 8 11.0001 8 12 8C12.9999 8 13.4999 8 13.9115 8.20663C14.107 8.3048 14.2851 8.43537 14.4386 8.59298C14.7615 8.92471 14.9196 9.40705 15.2358 10.3717L15.5622 11.3675C15.956 12.5688 16.1528 13.1694 15.8585 13.5847C15.5642 14 14.9416 14 13.6964 14H10.3036C9.05842 14 8.43585 14 8.1415 13.5847C7.84716 13.1694 8.04404 12.5688 8.43779 11.3675L8.76421 10.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M3.26439 18.3717C3.58059 17.407 3.73869 16.9247 4.06162 16.593C4.21504 16.4354 4.39317 16.3048 4.58872 16.2066C5.00031 16 5.50027 16 6.50018 16C7.5001 16 8.00006 16 8.41165 16.2066C8.6072 16.3048 8.78533 16.4354 8.93875 16.593C9.26167 16.9247 9.41977 17.407 9.73597 18.3717L10.0624 19.3675C10.4561 20.5688 10.653 21.1694 10.3587 21.5847C10.0643 22 9.44176 22 8.19661 22H4.80375C3.5586 22 2.93603 22 2.64169 21.5847C2.34735 21.1694 2.54422 20.5688 2.93797 19.3675L3.26439 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M12 2V4M7.5 3.5L9 5M16.5 3.5L15 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M5.78223 4.18192C6.43007 3.68319 6.754 3.43383 7.12788 3.27323C7.29741 3.20041 7.47367 3.14158 7.65459 3.09741C8.0536 3 8.4767 3 9.32289 3H14.6771C15.5233 3 15.9464 3 16.3454 3.09741C16.5263 3.14158 16.7026 3.20041 16.8721 3.27323C17.246 3.43383 17.5699 3.68319 18.2178 4.18192C20.3644 5.83448 21.4378 6.66077 21.8057 7.73078C21.9694 8.20673 22.0305 8.70728 21.9858 9.20461C21.8852 10.3227 21.0379 11.346 19.3433 13.3925L15.3498 18.2153C13.8126 20.0718 13.044 21 12 21C10.956 21 10.1874 20.0718 8.65018 18.2153L4.65671 13.3925C2.96208 11.346 2.11476 10.3227 2.0142 9.20461C1.96947 8.70728 2.03064 8.20673 2.1943 7.73078C2.56224 6.66077 3.63557 5.83448 5.78223 4.18192Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M10 8.5H14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>'],staticColors:["#993018","#444444","#D18F36","#315F9C"]};class o{static findTierByIndex(e,t){return e.find((e=>e.index===t))||null}static findTierByName(e,t){return e.find((e=>e.tier_name===t))||null}static getTierNameByIndex(e,t){return this.findTierByIndex(e,t)?.tier_name}static findCurrentTierIndex(e,t){if(!t)return 0;for(let r=t.length-1;r>=0;r--)if(e>=t[r].threshold)return t[r].index;return 0}}const n=class{constructor(t){e(this,t),this.currentTierIndex=0,this.canRender=!1,this.isLoading=!1,this.handleTabClick=e=>{this.activeTabTier=e},salla.lang.onLoaded((()=>{this.loyaltyProgramText=salla.lang.get("blocks.tiered_offer.program_title"),this.currentTierText=salla.lang.get("blocks.tiered_offer.current_tier"),this.discountText=salla.lang.get("blocks.tiered_offer.discount"),this.benefitText=salla.lang.get("blocks.tiered_offer.tier_description")}))}async componentWillLoad(){try{if(await salla.onReady(),!this.checkFeatureEnabled())return;if(!this.checkCartExists())return;this.isLoading=!0;const e=await this.fetchTieredOfferData();if(!e)return;this.initializeComponent(e)}catch(e){this.canRender=!1,salla.logger.warn("salla-tiered-offer:: ",e)}finally{this.isLoading=!1}}checkFeatureEnabled(){return salla.config.get("store.features")?.includes("tiered-offer")}checkCartExists(){return!!salla.storage.get("cart")?.summary?.count}validateCouponCompatibility(e,t){return!(t&&!e.details?.applied_with_coupon)}async fetchTieredOfferData(){try{const{data:e}=await salla.api.cart.offers(),t=e.find((e=>"tiered_offer"===e.type));return t?this.validateCouponCompatibility(t,salla.storage.get("cart")?.coupon)?t:(this.canRender=!1,null):null}catch(e){throw e}}initializeComponent(e){this.apiOfferData=e,this.tieredOfferData=this.mapApiDataToTiers(this.apiOfferData),this.loyaltyProgramText=this.apiOfferData.title||this.loyaltyProgramText;const t=this.findCurrentTierIndex(this.apiOfferData.details?.current_value||0);0!==t?(this.currentTierIndex=t,this.currentTier=o.getTierNameByIndex(this.tieredOfferData.tiers,t),this.activeTabTier=this.currentTier,this.canRender=!0):this.canRender=!1}componentDidLoad(){salla.event.on("cart::updated",(async e=>{const t=await this.fetchTieredOfferData();t&&this.updateOfferValues(e,t)}))}mapApiDataToTiers(e){const t=[...e.details.discounts].sort(((e,t)=>e.min_spend-t.min_spend)).map(((e,t)=>({name:e.name,tier_name:e.name,discount:e.type===s.PERCENTAGE?`${salla.helpers.number(e.value)}%`:salla.money(e.value),icon:i.staticIcons[t]||i.staticIcons[0],threshold:e.min_spend,text_color:i.staticColors[t],index:t+1})));return{current_tier:o.getTierNameByIndex(t,this.findCurrentTierIndex(e.details.current_value,t)),tiers:t}}findCurrentTierIndex(e,t=this.tieredOfferData?.tiers){return o.findCurrentTierIndex(e,t||[])}updateOfferValues(e,t){if(!t||!this.tieredOfferData)return;if(!this.validateCouponCompatibility(t,e.coupon))return void(this.canRender=!1);if(this.canRender=!0,!1===t.details?.with_current_cart)return;const r=t.details?.current_value||0;this.apiOfferData=t;const s=this.findCurrentTierIndex(r);0!==s?(this.canRender=!0,this.currentTierIndex=s,this.currentTier=o.getTierNameByIndex(this.tieredOfferData.tiers,s),this.activeTabTier!==this.currentTier&&(this.activeTabTier=this.currentTier)):this.canRender=!1}getLoadingSkeletonView(){return t(r,null,t("div",{class:"s-tiered-offer-container"},t("div",{class:"s-tiered-offer-skeleton-wrapper"},t("div",{class:"s-tiered-offer-skeleton-title"},t("salla-skeleton",{height:"16px",width:"40%"})),t("div",{class:"s-tiered-offer-skeleton-subtitle"},t("salla-skeleton",{height:"20px",width:"60%"})),t("div",{class:"s-tiered-offer-skeleton-progress"},t("salla-skeleton",{height:"16px",width:"100%"})),t("div",{class:"s-tiered-offer-skeleton-tabs"},t("salla-skeleton",{height:"50px",width:"100%"})))))}getCurrentTierData(){return o.findTierByIndex(this.tieredOfferData.tiers,this.currentTierIndex)||this.tieredOfferData.tiers[0]}getProgressWidth(){const e=this.tieredOfferData.tiers.length;return this.findCurrentTierIndex(this.apiOfferData.details?.current_value||0)/e*100}calculateMilestonePosition(e,t){return 1===t?"calc(100% - 18px)":`${Math.max(2,Math.min(95,(e+1)/t*100-8/t))}%`}getMilestoneStyles(e,t,r){const s="rtl"===document.documentElement.dir,i=this.calculateMilestonePosition(t,r),o=e.name.length>6?"flex-end":"center";return{[s?"right":"left"]:i,alignItems:o,position:"absolute",transform:s?"translateX(50%)":"translateX(-50%)"}}getMilestoneIconStyles(e,t,r){return t?{color:e.text_color}:r?{color:"var(--color-primary)"}:{}}renderProgressBarBackground(e){return[t("div",{class:"s-tiered-offer-progress-bg"}),t("div",{class:"s-tiered-offer-progress-fill",style:{width:`${e}%`}})]}renderMilestoneIcon(e,r,s){const i=["s-tiered-offer-milestone-icon",r?"s-tiered-offer-milestone-active":"",s?"s-tiered-offer-milestone-completed":""].filter(Boolean).join(" ");return t("div",{class:i,style:this.getMilestoneIconStyles(e,r,s)},t("span",{innerHTML:e.icon}))}renderMilestoneName(e,r){return t("div",{class:"s-tiered-offer-milestone-name"},r&&t("span",{style:{color:e.text_color}},e.name))}renderMilestones(e,r){return t("div",{class:"s-tiered-offer-milestones-wrapper"},t("div",{class:1===r?"s-tiered-offer-single-milestone-justify-end":"s-tiered-offer-milestones"},this.tieredOfferData.tiers.map(((s,i)=>{const o=e>=s.threshold,n=s.tier_name===this.currentTier;return t("div",{class:"s-tiered-offer-milestone",style:this.getMilestoneStyles(s,i,r)},this.renderMilestoneIcon(s,n,o),this.renderMilestoneName(s,n))}))))}renderProgressBar(){const e=this.getProgressWidth(),r=this.tieredOfferData.tiers.length,s=this.apiOfferData.details?.current_value||0;return t("div",{class:"s-tiered-offer-progress-container"},t("div",{class:"s-tiered-offer-progress-wrapper"},this.renderProgressBarBackground(e),this.renderMilestones(s,r)))}renderTabs(){return t("div",{class:"s-tiered-offer-tabs-container"},t("div",{class:"s-tiered-offer-tab-headers"},this.tieredOfferData.tiers.map((e=>t("button",{class:"s-tiered-offer-tab-header "+(e.tier_name===this.activeTabTier?"s-tiered-offer-tab-active":""),onClick:()=>this.handleTabClick(e.tier_name)},t("span",null,e.name))))),t("div",{class:"s-tiered-offer-tab-content-wrapper"},(()=>{const e=o.findTierByName(this.tieredOfferData.tiers,this.activeTabTier);return e?t("div",{class:"s-tiered-offer-tab-content"},t("div",{class:"s-tiered-offer-tab-content-inner"},t("div",{class:"s-tiered-offer-discount-section"},t("p",{class:"s-tiered-offer-discount-title"},this.discountText," ",t("span",{innerHTML:e.discount})),t("p",{class:"s-tiered-offer-benefit-description"},this.benefitText," ",e.name)))):null})()))}render(){if(this.isLoading)return this.getLoadingSkeletonView();if(!this.canRender||!this.tieredOfferData)return null;const e=this.getCurrentTierData();return t(r,null,t("div",{class:"s-tiered-offer-container"},t("div",{class:"s-tiered-offer-header"},t("div",{class:"s-tiered-offer-header-content"},t("p",{class:"s-tiered-offer-program-title"},this.loyaltyProgramText),t("div",{class:"s-tiered-offer-current-tier-name-wrapper"},t("h2",{class:"s-tiered-offer-current-tier"},this.currentTierText," ",t("span",{class:"s-tiered-offer-tier-name"},e.name)),t("span",{innerHTML:e.icon})))),this.renderProgressBar(),this.renderTabs()))}};n.style=".s-tiered-offer-milestone-icon svg{color:currentColor}.s-tiered-offer-milestone-icon svg path{stroke:currentColor;fill:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg path{fill:currentColor;stroke:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg[fill=none] path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg[fill=none] path{fill:none;stroke:currentColor}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-bg{transform:scaleX(-1)}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-fill{transform:scaleX(-1);left:auto}[dir=rtl] .flip-x{transform:scaleX(-1)}";export{n as salla_tiered_offer}
4
+ import{r as e,h as t,H as r}from"./p-DtunYVY8.js";var s;!function(e){e.PERCENTAGE="percentage",e.FIXED="fixed"}(s||(s={}));const i={staticIcons:['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M3 12C7.5 12 12 7.5 12 3C12 7.5 16.5 12 21 12C16.5 12 12 16.5 12 21C12 16.5 7.5 12 3 12Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M2 19.5C2.83333 19.5 4.5 17.8333 4.5 17C4.5 17.8333 6.16667 19.5 7 19.5C6.16667 19.5 4.5 21.1667 4.5 22C4.5 21.1667 2.83333 19.5 2 19.5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M16 5C17 5 19 3 19 2C19 3 21 5 22 5C21 5 19 7 19 8C19 7 17 5 16 5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M14.2644 18.3717C14.5806 17.407 14.7387 16.9247 15.0616 16.593C15.215 16.4354 15.3932 16.3048 15.5887 16.2066C16.0003 16 16.5003 16 17.5002 16C18.5001 16 19.0001 16 19.4116 16.2066C19.6072 16.3048 19.7853 16.4354 19.9388 16.593C20.2617 16.9247 20.4198 17.407 20.736 18.3717L21.0624 19.3675C21.4561 20.5688 21.653 21.1694 21.3587 21.5847C21.0643 22 20.4418 22 19.1966 22H15.8038C14.5586 22 13.936 22 13.6417 21.5847C13.3473 21.1694 13.5442 20.5688 13.938 19.3675L14.2644 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M8.76421 10.3717C9.08041 9.40705 9.23851 8.92471 9.56143 8.59298C9.71485 8.43537 9.89299 8.3048 10.0885 8.20663C10.5001 8 11.0001 8 12 8C12.9999 8 13.4999 8 13.9115 8.20663C14.107 8.3048 14.2851 8.43537 14.4386 8.59298C14.7615 8.92471 14.9196 9.40705 15.2358 10.3717L15.5622 11.3675C15.956 12.5688 16.1528 13.1694 15.8585 13.5847C15.5642 14 14.9416 14 13.6964 14H10.3036C9.05842 14 8.43585 14 8.1415 13.5847C7.84716 13.1694 8.04404 12.5688 8.43779 11.3675L8.76421 10.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M3.26439 18.3717C3.58059 17.407 3.73869 16.9247 4.06162 16.593C4.21504 16.4354 4.39317 16.3048 4.58872 16.2066C5.00031 16 5.50027 16 6.50018 16C7.5001 16 8.00006 16 8.41165 16.2066C8.6072 16.3048 8.78533 16.4354 8.93875 16.593C9.26167 16.9247 9.41977 17.407 9.73597 18.3717L10.0624 19.3675C10.4561 20.5688 10.653 21.1694 10.3587 21.5847C10.0643 22 9.44176 22 8.19661 22H4.80375C3.5586 22 2.93603 22 2.64169 21.5847C2.34735 21.1694 2.54422 20.5688 2.93797 19.3675L3.26439 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M12 2V4M7.5 3.5L9 5M16.5 3.5L15 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M5.78223 4.18192C6.43007 3.68319 6.754 3.43383 7.12788 3.27323C7.29741 3.20041 7.47367 3.14158 7.65459 3.09741C8.0536 3 8.4767 3 9.32289 3H14.6771C15.5233 3 15.9464 3 16.3454 3.09741C16.5263 3.14158 16.7026 3.20041 16.8721 3.27323C17.246 3.43383 17.5699 3.68319 18.2178 4.18192C20.3644 5.83448 21.4378 6.66077 21.8057 7.73078C21.9694 8.20673 22.0305 8.70728 21.9858 9.20461C21.8852 10.3227 21.0379 11.346 19.3433 13.3925L15.3498 18.2153C13.8126 20.0718 13.044 21 12 21C10.956 21 10.1874 20.0718 8.65018 18.2153L4.65671 13.3925C2.96208 11.346 2.11476 10.3227 2.0142 9.20461C1.96947 8.70728 2.03064 8.20673 2.1943 7.73078C2.56224 6.66077 3.63557 5.83448 5.78223 4.18192Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M10 8.5H14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>'],staticColors:["#993018","#444444","#D18F36","#315F9C"]};class o{static findTierByIndex(e,t){return e.find((e=>e.index===t))||null}static findTierByName(e,t){return e.find((e=>e.tier_name===t))||null}static getTierNameByIndex(e,t){return this.findTierByIndex(e,t)?.tier_name}static findCurrentTierIndex(e,t){if(!t)return 0;for(let r=t.length-1;r>=0;r--)if(e>=t[r].threshold)return t[r].index;return 0}}const n=class{constructor(t){e(this,t),this.currentTierIndex=0,this.canRender=!1,this.isLoading=!1,this.handleTabClick=e=>{this.activeTabTier=e},salla.lang.onLoaded((()=>{this.loyaltyProgramText=salla.lang.get("blocks.tiered_offer.program_title"),this.currentTierText=salla.lang.get("blocks.tiered_offer.current_tier"),this.discountText=salla.lang.get("blocks.tiered_offer.discount"),this.benefitText=salla.lang.get("blocks.tiered_offer.tier_description")}))}async componentWillLoad(){try{if(await salla.onReady(),!this.checkFeatureEnabled())return;if(!this.checkCartExists())return;this.isLoading=!0;const e=await this.fetchTieredOfferData();if(!e)return;this.initializeComponent(e)}catch(e){this.canRender=!1,salla.logger.warn("salla-tiered-offer:: ",e)}finally{this.isLoading=!1}}checkFeatureEnabled(){return salla.config.get("store.features")?.includes("tiered-offer")}checkCartExists(){return!!salla.storage.get("cart")?.summary?.count}validateCouponCompatibility(e,t){return!(t&&!e.details?.applied_with_coupon)}async fetchTieredOfferData(){try{const{data:e}=await salla.api.cart.offers(),t=e.find((e=>"tiered_offer"===e.type));return t?this.validateCouponCompatibility(t,salla.storage.get("cart")?.coupon)?t:(this.canRender=!1,null):null}catch(e){throw e}}initializeComponent(e){this.apiOfferData=e,this.tieredOfferData=this.mapApiDataToTiers(this.apiOfferData),this.loyaltyProgramText=this.apiOfferData.title||this.loyaltyProgramText;const t=this.findCurrentTierIndex(this.apiOfferData.details?.current_value||0);0!==t?(this.currentTierIndex=t,this.currentTier=o.getTierNameByIndex(this.tieredOfferData.tiers,t),this.activeTabTier=this.currentTier,this.canRender=!0):this.canRender=!1}componentDidLoad(){salla.event.on("cart::updated",(async e=>{const t=await this.fetchTieredOfferData();t&&this.updateOfferValues(e,t)}))}mapApiDataToTiers(e){const t=[...e.details.discounts].sort(((e,t)=>e.min_spend-t.min_spend)).map(((e,t)=>({name:e.name,tier_name:e.name,discount:e.type===s.PERCENTAGE?`${salla.helpers.number(e.value)}%`:salla.money(e.value),icon:i.staticIcons[t]||i.staticIcons[0],threshold:e.min_spend,text_color:i.staticColors[t],index:t+1})));return{current_tier:o.getTierNameByIndex(t,this.findCurrentTierIndex(e.details.current_value,t)),tiers:t}}findCurrentTierIndex(e,t=this.tieredOfferData?.tiers){return o.findCurrentTierIndex(e,t||[])}updateOfferValues(e,t){if(!t||!this.tieredOfferData)return;if(!this.validateCouponCompatibility(t,e.coupon))return void(this.canRender=!1);if(this.canRender=!0,!1===t.details?.with_current_cart)return;const r=t.details?.current_value||0;this.apiOfferData=t;const s=this.findCurrentTierIndex(r);0!==s?(this.canRender=!0,this.currentTierIndex=s,this.currentTier=o.getTierNameByIndex(this.tieredOfferData.tiers,s),this.activeTabTier!==this.currentTier&&(this.activeTabTier=this.currentTier)):this.canRender=!1}getLoadingSkeletonView(){return t(r,null,t("div",{class:"s-tiered-offer-container"},t("div",{class:"s-tiered-offer-skeleton-wrapper"},t("div",{class:"s-tiered-offer-skeleton-title"},t("salla-skeleton",{height:"16px",width:"40%"})),t("div",{class:"s-tiered-offer-skeleton-subtitle"},t("salla-skeleton",{height:"20px",width:"60%"})),t("div",{class:"s-tiered-offer-skeleton-progress"},t("salla-skeleton",{height:"16px",width:"100%"})),t("div",{class:"s-tiered-offer-skeleton-tabs"},t("salla-skeleton",{height:"50px",width:"100%"})))))}getCurrentTierData(){return o.findTierByIndex(this.tieredOfferData.tiers,this.currentTierIndex)||this.tieredOfferData.tiers[0]}getProgressWidth(){const e=this.tieredOfferData.tiers.length;return this.findCurrentTierIndex(this.apiOfferData.details?.current_value||0)/e*100}calculateMilestonePosition(e,t){return 1===t?"calc(100% - 18px)":`${Math.max(2,Math.min(95,(e+1)/t*100-8/t))}%`}getMilestoneStyles(e,t,r){const s="rtl"===document.documentElement.dir,i=this.calculateMilestonePosition(t,r),o=e.name.length>6?"flex-end":"center";return{[s?"right":"left"]:i,alignItems:o,position:"absolute",transform:s?"translateX(50%)":"translateX(-50%)"}}getMilestoneIconStyles(e,t,r){return t?{color:e.text_color}:r?{color:"var(--color-primary)"}:{}}renderProgressBarBackground(e){return[t("div",{class:"s-tiered-offer-progress-bg"}),t("div",{class:"s-tiered-offer-progress-fill",style:{width:`${e}%`}})]}renderMilestoneIcon(e,r,s){const i=["s-tiered-offer-milestone-icon",r?"s-tiered-offer-milestone-active":"",s?"s-tiered-offer-milestone-completed":""].filter(Boolean).join(" ");return t("div",{class:i,style:this.getMilestoneIconStyles(e,r,s)},t("span",{innerHTML:e.icon}))}renderMilestoneName(e,r){return t("div",{class:"s-tiered-offer-milestone-name"},r&&t("span",{style:{color:e.text_color}},e.name))}renderMilestones(e,r){return t("div",{class:"s-tiered-offer-milestones-wrapper"},t("div",{class:1===r?"s-tiered-offer-single-milestone-justify-end":"s-tiered-offer-milestones"},this.tieredOfferData.tiers.map(((s,i)=>{const o=e>=s.threshold,n=s.tier_name===this.currentTier;return t("div",{class:"s-tiered-offer-milestone",style:this.getMilestoneStyles(s,i,r)},this.renderMilestoneIcon(s,n,o),this.renderMilestoneName(s,n))}))))}renderProgressBar(){const e=this.getProgressWidth(),r=this.tieredOfferData.tiers.length,s=this.apiOfferData.details?.current_value||0;return t("div",{class:"s-tiered-offer-progress-container"},t("div",{class:"s-tiered-offer-progress-wrapper"},this.renderProgressBarBackground(e),this.renderMilestones(s,r)))}renderTabs(){return t("div",{class:"s-tiered-offer-tabs-container"},t("div",{class:"s-tiered-offer-tab-headers"},this.tieredOfferData.tiers.map((e=>t("button",{class:"s-tiered-offer-tab-header "+(e.tier_name===this.activeTabTier?"s-tiered-offer-tab-active":""),onClick:()=>this.handleTabClick(e.tier_name)},t("span",null,e.name))))),t("div",{class:"s-tiered-offer-tab-content-wrapper"},(()=>{const e=o.findTierByName(this.tieredOfferData.tiers,this.activeTabTier);return e?t("div",{class:"s-tiered-offer-tab-content"},t("div",{class:"s-tiered-offer-tab-content-inner"},t("div",{class:"s-tiered-offer-discount-section"},t("p",{class:"s-tiered-offer-discount-title"},this.discountText," ",t("span",{innerHTML:e.discount})),t("p",{class:"s-tiered-offer-benefit-description"},this.benefitText," ",e.name)))):null})()))}render(){if(this.isLoading)return this.getLoadingSkeletonView();if(!this.canRender||!this.tieredOfferData)return null;const e=this.getCurrentTierData();return t(r,null,t("div",{class:"s-tiered-offer-container"},t("div",{class:"s-tiered-offer-header"},t("div",{class:"s-tiered-offer-header-content"},t("p",{class:"s-tiered-offer-program-title"},this.loyaltyProgramText),t("div",{class:"s-tiered-offer-current-tier-name-wrapper"},t("h2",{class:"s-tiered-offer-current-tier"},this.currentTierText," ",t("span",{class:"s-tiered-offer-tier-name"},e.name)),t("span",{innerHTML:e.icon})))),this.renderProgressBar(),this.renderTabs()))}};n.style=".s-tiered-offer-milestone-icon svg{color:currentColor}.s-tiered-offer-milestone-icon svg path{stroke:currentColor;fill:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg path{fill:currentColor;stroke:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg[fill=none] path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg[fill=none] path{fill:none;stroke:currentColor}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-bg{transform:scaleX(-1)}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-fill{transform:scaleX(-1);left:auto}[dir=rtl] .flip-x{transform:scaleX(-1)}";export{n as salla_tiered_offer}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t}from"./p-DryPCgN9.js";import{T as o}from"./p-CJUR4sUM.js";import{i as n}from"./p-DqDX5na4.js";const e=class{constructor(t){s(this,t),this.coupon=null,this.isLoading=!0,this.titlePercentTpl="",this.titleFixedTpl="",this.badgeLabel="",this.minSpendTpl="",this.expiresTpl="",this.shopNowLabel="",this.copyLabel="",this.copiedLabel=""}componentWillLoad(){Salla.onReady().then((()=>Salla.lang.onLoaded())).then((()=>(this.loadTranslations(),this.loadCoupon()))).catch((()=>{this.isLoading=!1}))}loadTranslations(){this.titlePercentTpl=Salla.lang.get("pages.thank_you.next_order_coupon_title_percent")||"",this.titleFixedTpl=Salla.lang.get("pages.thank_you.next_order_coupon_title_fixed")||"",this.badgeLabel=Salla.lang.get("pages.thank_you.next_order_coupon_badge")||"",this.minSpendTpl=Salla.lang.get("pages.thank_you.next_order_coupon_min_spend")||"",this.expiresTpl=Salla.lang.get("pages.thank_you.next_order_coupon_expires")||"",this.shopNowLabel=Salla.lang.get("pages.thank_you.next_order_coupon_shop_now")||"",this.copyLabel=Salla.lang.get("common.elements.copy")||"",this.copiedLabel=Salla.lang.get("pages.thank_you.next_order_coupon_copied")||""}async loadCoupon(){try{const s=await salla.api.request("coupons",{params:{type:"thankyou"}}),t=s?.data,o=Array.isArray(t)?t:Array.isArray(t?.data)?t.data:[];this.coupon=o[0]??null}catch{this.coupon=null}finally{this.isLoading=!1}}async copyCode(){if(this.coupon)try{await navigator.clipboard.writeText(this.coupon.code),salla.notify.success(this.copiedLabel),salla.event.dispatch("salla::next-order-coupon.code.copied",{code:this.coupon.code})}catch{}}isPercentage(){return"P"===this.coupon?.type||"percentage"===this.coupon?.type}formatAmount(){if(!this.coupon)return"";if(this.isPercentage())return`${salla.helpers.number(this.coupon.amount)}%`;const s=this.coupon.amount;return t("span","object"==typeof s&&s.amount?{innerHTML:salla.money(s.amount,s.currency)}:{innerHTML:salla.money(s)})}formatMinSpend(){const s=this.coupon?.minimum_amount;return s&&("object"!=typeof s||s.amount)?"string"==typeof s?s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):salla.money(s.amount,s.currency):""}formatExpiry(){const s=this.coupon?.expiry_date;return s?new Date(s).toLocaleDateString(Salla.lang.locale||"en-GB"):""}renderSkeleton(){return t("div",{class:"s-next-order-coupon-wrapper s-next-order-coupon-skeleton"},t("div",{class:"s-next-order-coupon-inner"},t("div",{class:"s-next-order-coupon-info"},t("salla-skeleton",{type:"normal",width:"48px",height:"48px"}),t("div",{class:"s-next-order-coupon-details"},t("salla-skeleton",{height:"14px",width:"220px"}),t("salla-skeleton",{height:"12px",width:"140px"}))),t("div",{class:"s-next-order-coupon-actions"},t("salla-skeleton",{height:"40px",width:"140px"}),t("salla-skeleton",{height:"40px",width:"100px"}))))}renderTitle(){const s=this.formatAmount(),o=this.isPercentage()?this.titlePercentTpl:this.titleFixedTpl,n=this.isPercentage()?":amount%":":amount",e=o.split(n);return t("p",{class:"s-next-order-coupon-title"},e[0],t("span",{class:"s-next-order-coupon-amount"},s),e[1]||"")}render(){if(this.isLoading)return this.renderSkeleton();if(!this.coupon)return null;const s=this.formatMinSpend(),e=this.formatExpiry();return t("div",{class:"s-next-order-coupon-wrapper"},t("div",{class:"s-next-order-coupon-inner"},t("div",{class:"s-next-order-coupon-info"},t("div",{class:"s-next-order-coupon-icon-wrap"},t("span",{class:"s-next-order-coupon-icon-bg"}),t("span",{class:"s-next-order-coupon-icon",innerHTML:o})),t("div",{class:"s-next-order-coupon-details"},t("div",{class:"s-next-order-coupon-title-row"},this.renderTitle(),t("span",{class:"s-next-order-coupon-badge"},t("span",{class:"s-next-order-coupon-badge-bg"}),t("span",{class:"s-next-order-coupon-badge-text"},this.badgeLabel))),(s||e)&&t("p",{class:"s-next-order-coupon-meta"},s&&t("span",{innerHTML:this.minSpendTpl.replace(":amount",s)}),e&&t("span",null,this.expiresTpl.replace(":date",e))))),t("div",{class:"s-next-order-coupon-actions"},t("div",{class:"s-next-order-coupon-code-box"},t("span",{class:"s-next-order-coupon-code-text"},this.coupon.code),t("salla-button",{shape:"link",class:"s-next-order-coupon-copy-btn",title:this.copyLabel,onClick:()=>this.copyCode()},t("span",{class:"s-next-order-coupon-copy-icon",innerHTML:n}))),t("salla-button",{href:salla.url.get(""),class:"s-next-order-coupon-shop-btn"},this.shopNowLabel))))}};e.style=":host{display:block}";export{e as salla_next_order_coupon}
4
+ import{r as s,h as t}from"./p-DtunYVY8.js";import{T as o}from"./p-CJUR4sUM.js";import{i as n}from"./p-DqDX5na4.js";const e=class{constructor(t){s(this,t),this.coupon=null,this.isLoading=!0,this.titlePercentTpl="",this.titleFixedTpl="",this.badgeLabel="",this.minSpendTpl="",this.expiresTpl="",this.shopNowLabel="",this.copyLabel="",this.copiedLabel=""}componentWillLoad(){Salla.onReady().then((()=>Salla.lang.onLoaded())).then((()=>(this.loadTranslations(),this.loadCoupon()))).catch((()=>{this.isLoading=!1}))}loadTranslations(){this.titlePercentTpl=Salla.lang.get("pages.thank_you.next_order_coupon_title_percent")||"",this.titleFixedTpl=Salla.lang.get("pages.thank_you.next_order_coupon_title_fixed")||"",this.badgeLabel=Salla.lang.get("pages.thank_you.next_order_coupon_badge")||"",this.minSpendTpl=Salla.lang.get("pages.thank_you.next_order_coupon_min_spend")||"",this.expiresTpl=Salla.lang.get("pages.thank_you.next_order_coupon_expires")||"",this.shopNowLabel=Salla.lang.get("pages.thank_you.next_order_coupon_shop_now")||"",this.copyLabel=Salla.lang.get("common.elements.copy")||"",this.copiedLabel=Salla.lang.get("pages.thank_you.next_order_coupon_copied")||""}async loadCoupon(){try{const s=await salla.api.request("coupons",{params:{type:"thankyou"}}),t=s?.data,o=Array.isArray(t)?t:Array.isArray(t?.data)?t.data:[];this.coupon=o[0]??null}catch{this.coupon=null}finally{this.isLoading=!1}}async copyCode(){if(this.coupon)try{await navigator.clipboard.writeText(this.coupon.code),salla.notify.success(this.copiedLabel),salla.event.dispatch("salla::next-order-coupon.code.copied",{code:this.coupon.code})}catch{}}isPercentage(){return"P"===this.coupon?.type||"percentage"===this.coupon?.type}formatAmount(){if(!this.coupon)return"";if(this.isPercentage())return`${salla.helpers.number(this.coupon.amount)}%`;const s=this.coupon.amount;return t("span","object"==typeof s&&s.amount?{innerHTML:salla.money(s.amount,s.currency)}:{innerHTML:salla.money(s)})}formatMinSpend(){const s=this.coupon?.minimum_amount;return s&&("object"!=typeof s||s.amount)?"string"==typeof s?s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):salla.money(s.amount,s.currency):""}formatExpiry(){const s=this.coupon?.expiry_date;return s?new Date(s).toLocaleDateString(Salla.lang.locale||"en-GB"):""}renderSkeleton(){return t("div",{class:"s-next-order-coupon-wrapper s-next-order-coupon-skeleton"},t("div",{class:"s-next-order-coupon-inner"},t("div",{class:"s-next-order-coupon-info"},t("salla-skeleton",{type:"normal",width:"48px",height:"48px"}),t("div",{class:"s-next-order-coupon-details"},t("salla-skeleton",{height:"14px",width:"220px"}),t("salla-skeleton",{height:"12px",width:"140px"}))),t("div",{class:"s-next-order-coupon-actions"},t("salla-skeleton",{height:"40px",width:"140px"}),t("salla-skeleton",{height:"40px",width:"100px"}))))}renderTitle(){const s=this.formatAmount(),o=this.isPercentage()?this.titlePercentTpl:this.titleFixedTpl,n=this.isPercentage()?":amount%":":amount",e=o.split(n);return t("p",{class:"s-next-order-coupon-title"},e[0],t("span",{class:"s-next-order-coupon-amount"},s),e[1]||"")}render(){if(this.isLoading)return this.renderSkeleton();if(!this.coupon)return null;const s=this.formatMinSpend(),e=this.formatExpiry();return t("div",{class:"s-next-order-coupon-wrapper"},t("div",{class:"s-next-order-coupon-inner"},t("div",{class:"s-next-order-coupon-info"},t("div",{class:"s-next-order-coupon-icon-wrap"},t("span",{class:"s-next-order-coupon-icon-bg"}),t("span",{class:"s-next-order-coupon-icon",innerHTML:o})),t("div",{class:"s-next-order-coupon-details"},t("div",{class:"s-next-order-coupon-title-row"},this.renderTitle(),t("span",{class:"s-next-order-coupon-badge"},t("span",{class:"s-next-order-coupon-badge-bg"}),t("span",{class:"s-next-order-coupon-badge-text"},this.badgeLabel))),(s||e)&&t("p",{class:"s-next-order-coupon-meta"},s&&t("span",{innerHTML:this.minSpendTpl.replace(":amount",s)}),e&&t("span",null,this.expiresTpl.replace(":date",e))))),t("div",{class:"s-next-order-coupon-actions"},t("div",{class:"s-next-order-coupon-code-box"},t("span",{class:"s-next-order-coupon-code-text"},this.coupon.code),t("salla-button",{shape:"link",class:"s-next-order-coupon-copy-btn",title:this.copyLabel,onClick:()=>this.copyCode()},t("span",{class:"s-next-order-coupon-copy-icon",innerHTML:n}))),t("salla-button",{href:salla.url.get(""),class:"s-next-order-coupon-shop-btn"},this.shopNowLabel))))}};e.style=":host{display:block}";export{e as salla_next_order_coupon}